Posted on Feb 29, 2012

New comments management system

Hello dear .bloggandomene readers,
I’ve changed the default WordPress comments management system towards Disqus to get a better comprehensive tool for comments management and availability.

Unfortunately I was using a third party plugin to maintain the list of subscriptions to posts. This plugin is not strictly part of WordPress so it is quite likely that you lost your comments subscriptions to your favorite posts.

Renewing the subscriptions should be quite easy since you will just have to click on the “Subscribe by email” link at the bottom of the Disqus comment box.

Indeed you have to manually do that for every post you intend to subscribe to.

Sorry about that!

Subscribe by email

Posted on Feb 28, 2012

R build system for Sublime Text

Today I’ve been played with R.
Since I’m using Sublime Text as my first choice editor, I needed a build system script to quickly run the code.

It’s very trivial:


{
"cmd": ["R", "--no-save", "-f $file"]
}

Posted on Dec 1, 2011

The Desktop Environment week


Nope, it’s not a national holiday. It’s the week that every geek wastes trying new DEs and, usually, it happens every year.

I don’t know if you are aware of this behaviour, but Linux users certainly do.

On regular basis, upgrades are made to all the Desktop Environments like KDE, Gnome, LXDE and so on and so forth. Linux users tend to hang out different social environments such as IRC, Mailing Lists and forums. In these places, there are lots of discussions like “what is the best DE?” and, usually, Gnome and KDE fanboys are the most involved. Users won’t notice this at the beginning of the discussion but, latently, something starts growing into their minds: the lusting after an alternative DE.

And here comes the worst.

Gnome users are typical the ones that brag about the cleanness and ease of use of their desktop. They are very likely to be self-convinced minimalists and they love GTK because they are clean and have thin borders and small buttons.

KDE users are the one exhibiting the most pastel-rounded smoothly-animated desktop ever. They claim that KDE is so gorgeous because of the integration of every single bit and every single app. They love Qt: these library are the most comprehensive and powerful library in the world and they should be used by everyone. Typically this kind of desktop has lots of hiccups because of the huge amount of enabled effects that are shipped with the default installation.

LXDE users are the ones that finally are celebrating the right-click implementation on their desktops.

Of course there are also the ones that do not use a DE at all. I think they are blessed.

When two different DE-users meet each other, the flames of hatred burn and there is some sort of vendor-buyer approach in which the two sides defend their position and aims to “convert” the opponent like priests do with people.
And here the seeds of a new change got planted in each other brains.

Typically, the KDE user, is the one that can hardly be convinced to switch because his creed relies upon getting more effects and more candy stuff. Unfortunately, there is nothing more bloated than KDE.

On the other hand, Gnome users are the one looking for more minimalism and less buttons, effects but more shortcuts and accelerators. Luckily for them, the world has plenty of alternatives.

When the alternatives begin being considered, the DE week starts.

During this week, the user installs thousands of apps, libraries that pull billions of dependencies with the sole scope of devastating the system. Notice that the productivity drops to nearly zero. The user gots distracted by new buttons, different applications promoting different semantics in their usage. The user starts tuning up the system, blaming against developers for missing features and, obviously, bugs.
The week has almost passed and the user has only to fix the so called “just two things” when, suddenly, realises that he quickly needs to do the typical thing that he always did with that specific program that he loves so much but doesn’t fit into the new environment.
Oh my sweet good Lord, tragedy.

Googling, aptituding, emerging, pacmanning and you name it. Nothing does feel the same as before, nothing seems to be so awesome as before. There’s nothing left to do if not rolling back to the previous habitat in which everything was just fine. At this point the exhaust user, whose productivity is back at maximum level, will exclaim “Aw, fuck off stupid douchebags. My system r0x and there’s nothing better than it. I will never ever never do that again. I just wasted up one week of my life”.
You know, though, that in one year you will be back at square one.

I want to conclude saying that I truly and sincerely give my deepest sympathy to all Gnome users. I know that Gnome 3 sucks for most of you and I hope you will eventually find your way. Once again.

Posted on Nov 3, 2011

How to enable Airdrop on old Macs running Lion

Airdrop is a feature available in Lion that allows users to easily share files between Macs without sharing a connection to the same Wi-Fi Network.
It uses PAN to provide for p2p connection (like Bluetooth does).
It may happen that your old mac does not carry a Wi-Fi module capable of supporting this type of network but there’s a known workaround to make this possible.
Fire up your terminal and issue

defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1

Once you did that, relaunch Finder by Opt+Clicking onto the Finder icon in the dock or by issuing

killall Finder

in a terminal shell.

Now you should have your old-fashioned MacBook running both Lion and Airdrop.

Thank you @LorenzoMMariani that pointed this out to my attention.

Posted on Aug 17, 2011

Automatically update store schema with Core Data

Today I was playing with Core Data technology and I was trying to check whether it is possible to update the store schema according to the changes I made to the entities, relationships and whatever else.

I found out that the important steps are:

  • Use the versioning: before modifying your current schema you should select “Editor -> Add Model Version..”
  • Edit as much as you like
  • Select the new version as the active one
  • Go to your app delegate file and modify the - (NSPersistentStoreCoordinator *) persistentStoreCoordinator method as follows:
    NSURL *url = [applicationFilesDirectory URLByAppendingPathComponent:@"YourApp.storedata"];
        __persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom];
    
    NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
    						 [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
    						 [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
    
    if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url options:options error:&error]) {
    		// The rest of the code here
    	}
    
    return __persistentStoreCoordinator;
    



    The highlighted lines are the one to be added. Please notice that row 8 needs to be updated with options:options. I only tried it using NSSQLiteStoreType as persistent store type but it should work fine even with NSXMLStoreType.

References:

  1. Working with Core Data: Schema Versioning and Lightweight Migrations

Posted on Aug 4, 2011

Migrate from Typo blog to WordPress

Those of you that follow my blog have already noticed that in the past days a major change to the website has happened.

In fact, I moved from Typo to WordPress.
The most difficult part is not to find a theme, fix the CSS, play with the sidebar or anything like that; the mess comes when you have to migrate the data (posts, categories, tags, comments, …).
In order to do so I readapted a Ruby script to work with the latest version of the two blog engines (Typo 6.0.5 vs WordPress 3.1.2). You can find my version here.

To use it, just copy it inside your $TYPO_ROOT/script directory. Then simply issue

RAILS_ENV=production ruby script/wp_export.rb > out.wxr

and wait for the magic to happen.

Once the scripts ends, out.wxr file will contain all the content you had on your previous Typo installation.
In order to proceed, you have to install WordPress Importer, a plugin that allows you to import a WordPress blog from file. Install it, activate it, then import the file generated in the step above and you’re all set.

Posted on Jul 21, 2011

How to burn Lion boot image once installed

Plenty of websites and users have posted the solution to the problem “How can I burn a Lion image onto a DVD?”. What I was really looking for today is a way to get the installation files back in order to be capable of extracting the dmg file containing the image to burn.

The solution is pretty trivial: fire up the Mac App Store and click on the “Purchased” tab on the top. You’ll get the list of applications you have previously bought. Around the top of such list there should be an entry labeled “OS X Lion”. Keeping your “alt” button pressed, click on that entry (on the name). You will enter the Lion page but the install button is now labeled as “Install”. Keep the “alt” key button pressed and click on the “Install” button. The Mac App Store will ask you again for your Apple ID. Issue your credentials and enjoy (once again) the download.

The following steps are the same proposed in many blogs on how to burn OSX Lion dmg image.

After the download completes, go into “Applications” and search for the “Install OS X Lion.app” file. Right click -> Show package content, locate “SharedSupport” directory and pick up the file named “InstallESD.dmg”. Copy it somewhere else and burn it. Oh you just need a common DVD-R single layer.

See ya!

Posted on May 11, 2011

iTerm 2: iTerm successor

I’m not very fond in reviews because I think I’m not really good at it. Anyhow, yesterday I discovered the existence of iTerm 2.

For me, iTerm, is really not an option over Terminal (the terminal emulator shipped with Mac OS X). The latter feels a little bit dizzy starting from the selection (try to select a path in Terminal.app) and ending to the poor tab management in Terminal compared to the one brought by iTerm.

When I hit iTerm 2 website I jumped to the features page to see what’s actually is different and I saw a lot of cool-but-useless things except for three killing ones:

  • The split panes

  • The set mark capability

This latter feature is somehow hidden, in a very loose sense. It allows you to mark a position on your terminal screen and come back to that position with the “Jump to Mark” menu item.
It comes to be very handy when you have commands that print out a lot of garbage and you are interested in reading the output starting from the top instead of the bottom.

There are a lot of more features such as the instant replay (that I don’t think I will ever use it) or the autocompletion (that is somehow interesting but so much time has past since I started using the UNIX console that I don’t think I will remember this feature while using the terminal).

Does it sound interesting? Then give it a try!

Posted on May 1, 2011

Free over-the-air distribution

Few days ago, Matteo Kuzeko, pointed out to my attention a web service that easily allows iOS developers to share they own application over-the-air in order to do beta testing: TestFlight

In my previous related post I briefly told you how to do the same all by yourself; with TestFlight the goal is the same but this service brings altogether few interesting features. Practically speaking, you have to build up a Team. The latter is usually composed by the developers and the testers.
With the online control-panel you can invite people by using their email addresses (one at a time) or you can generate an URL to send to all of them an invitation to join the beta testing.

Once your teammates subscribe to the website, they will have to register their devices as well. Once they do that, the developers have to add their device to the list of “compatible” devices. This step is required only the first time you set up the team.

The cool features that TestFlight brings are the instant report of what’s going on in the team (it displays the status of all the teammates and what they did so far) and it sends notifications every time the developers deploy (and hence upload) a new version of the app. This way the mates are automatically notified by the system.

I found it to be very interesting and quite immediate and I will definitively propose it to my team in the next days.

Posted on Apr 11, 2011

Early 2011 Macbook Pro GPU Switch

Today I tried gfxCardStatus, an application that allows you to monitor whether you are using the integrated or the discrete GPU.

I have nothing to complain about how long lasts my battery, I just did it out of curiosity.

I discovered, on regular basis, that when I open Chrome and I go to a page containing flash video (such as Youtube) the application notifies me that the discrete GPU has been turned on. It is not a big deal. The tricky part comes when you actuallly close the page containing such player.
The application keeps telling me that the discrete GPU is still enabled.

As you can see, from the image below, gfxCardStatus says that there is a process asking for the GPU. This process is Chrome, indeed.

The real problem here is that the only solution to turn the discrete GPU off and switch back to the integrated one is to completely close Chrome. I guess this is because of the Flash Player staying in background even when you close the tab responsible for it.

Then I tried with Safari and the discrete GPU card is not turned on. Furthermore, the same things, for both the scenarios above, happen if I try with the HTML 5 player.

This makes me think that Apple is properly using the discrete/integrated GPU switch and, for third party developers, having set a low threshold (I don’t know on which kind of parameter) in order to turn on the discrete GPU even if it should be unnecessary.