Mar 29, 2011

Amazon Cloud Drive

Anar here...

I've just learned, that Amazon has opened a cloud storage, called "Amazon Cloud Drive". According to roomers Apple also wants to do something like this. Maybe they even will make MobileMe for free or a part of the service for free. So, obviously Amazon is a bit faster on this one.

Amazone offeres 5 GB of a cloud storage for FREE to store your music, video, photos or other documents. If you buy a music track from Amazon, then your storage will be extended up to 20 GB for free for one year.
BTW, users can't store music files with the DRM, since these files can't be easily moved between devices.

If you want to have more than 5 GB of a storage space, of course there is a storage plan (see below) for that :)


Taking into account the success of Amazon's elastic cloud, I hope this project will also be useful and less expensive.

Mar 28, 2011

Xcode 4 bugfix update is out

In short, Apple has just released a new version of Xcode 4.0.1. This is mostly a bugfix release:

Improved Assistant editor logic when switching among different file types 
Fixed a bug that prevented indexing of some projects 
Fixed a bug related to nil settings in the Core Data model editor 
Fixed a bug in LLVM GCC 4.2 and LLVM compiler 2.0 for iOS projects 
Additional bug fixes and stability improvements


Mar 23, 2011

Xcode + AStyle. Part 2. (for Xcode 4.x)

Anar here...

Long time ago I've described a recipe to use astyle from within Xcode 3.x.

Now as you may know, Xcode 4 doesn't provide the "user script" menu. I knew about it since Xcode 4 developer preview versions, but kept hoping the menu item would be back.
This didn't happen :( We have now a stable release of Xcode 4 and there is no sign of user's script in it.

What I think is that Apple either couldn't implement a support for "user script" or they want us to use automator services.
So, now I try to use automator to accomplish the same as I did in XCode 3's user script menu.


#1
Run Automator. Start a new service workflow.

#2
Select, that you service will receives selected "text" and check that it will "Replace selected text"

#3
Drag the "Run Shell Scrip" to your workflow and add commands as in the following screenshot:

Save your service and now when you want to re-indent your code, just select the whole source file content and select your service from the service menu. Works OK, but there are some drawbacks, see below (at the very end of the post).

Of course you must write the path to your own astyle option file, in my case I use "/Users/anar/Documents/workspace/Support/astylerc", as you can see on the screenshot, which sets the following:
#Indent a C or C++ file.
mode=c
# ANSI style formatting/indenting
style=ansi
# Do not retain a backup of the original file
suffix=none
# Indent 'class' and 'struct' blocks so that the blocks 'public:', 'protected:' and 'private:' are indented.
indent-classes
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
indent-switches
# Indent 'case X:' blocks from the 'case X:' headers.
indent-cases
# Add extra indentation to namespace blocks.
indent-namespaces
# Indent multi-line preprocessor definitions ending with a backslash.
indent-preprocessor
# Converts tabs into single spaces.
convert-tabs
# Set the minimal indent that is added when a header is built of multiple-lines.
min-conditional-indent=0
# Indent a maximum of # spaces in a continuous statement
max-instatement-indent=80
# Insert space padding around operators.
pad=oper
# Insert space padding around parenthesis on the inside only. 
pad=paren-in
# Remove extra space padding around parenthesis on the inside and outside.
unpad=paren


Drawbacks

The following is the only, what I found so far:

  • Unfortunately I don't see any way to keep the potision of the cursor after the service is called.
  • One should select the whole file content and execute the service on it. Which is inconvenient in some cases. I didn't find a way to get a file name of the current file, which I could then provide to the service.

Mar 9, 2011

Xcode 4 is out (Updated)

Apple has just released its new IDE - Xcode 4.
The main news here is that it is not not entirely for free as it was with Xcode 3.

Members of iOS and Mac Developer programs will get it for free, others can purchase Xcode 4 in App Store for 3.99 Euro ($ 4.99).



Well, I've been using Xcode 4 since the first developer preview and I can only say that it definitely costs more than 4 Euro ;)

Updated:
Just in case you want to uninstall a previous version of Xcode and don't know how to do so:
sudo /Developer/Library/uninstall-devtools --mode=all

or in case of Xcode 4 Developer Preview:
sudo /Xcode4/Library/uninstall-devtools --mode=all

Mar 8, 2011

Mac OS X: Screen Sharing

How to enable a screen sharing of a remote Mac (10.6) if you forgot to enable it and your Mac is behind a firewall?

This is the question I asked myself today when I desperately was in need to use some GUI on my Mac Pro at work place, while I am on a business trip right now and have my laptop with me :(

Same as always with the Mac OS X - it appeared to be very easy to implement.

So, you have a remote Mac "A", which is behind a firewall and you want to connect to it via an open domain "B" (to where ssh is possible) from your local Mac (a laptop, for example).

STEP #1

Enable an SSH tunnel via an open domain to you remote Mac. On your local Mac just open a terminal and enter the following:

ssh -N -L 3000:loginnameA@hostnameA:5900 loginnameB@hostnameB

The command will create a tunnel and hang. When you are done terminate the command and the tunnel will be disabled.

STEP #2
Open another terminal on your local Mac and ssh to your remote Mac to enable a screen sharing:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -clientopts -setvnclegacy -vnclegacy yes -clientopts -setvncpw -vncpw mypasswd -restart -agent -privs -all

STEP #3
Start sharing the screen :)

In Safari enter the following URL: vnc://localhost:3000

Should work now :)

Disable screen sharing
SSH to your remote Mac and execute the command:

sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -configure -access -off

Don't forget to terminate the SSH tunnel (Step #1).



Hope it helps some one to save time.

Mar 2, 2011

yet another video post :)


Anar here...

The following is a very entertaining video I would like to keep ;)
This time it's an advertisement from Nike and it's all about the Robert Rodriguez Style.... And by the way... directed by Robert Rodriguez as well ;)  ... starring Bruce Willis!

A Really Great Job: