Sparkle is the updates framework for cocoa that “just works” , yea ok it does , however the documentation for it is a bit lacking on some very important aspects that i discovered over time :
1 – the preferences for your application must have SUAutomaticallyUpdate TRUE for autoupdates to happen , just setting SUEnableAutomaticChecks TRUE in the app’s Info.plist is not enough ,
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setBool:YES forKey:@"SUAutomaticallyUpdate"];
[defaults synchronize];
OR
SUUpdater *updater = [SUUpdater updaterForBundle:[NSBundle mainBundle]];
[updater setAutomaticallyChecksForUpdates:YES];
OR
create a checkbox in the preferences of your app to toggle it on , unless you do that you have to use one of the methods above directly in code.
2 – since 1.0 sparkle implemented sparkle:shortVersionString to match CFBundleShortVersionString , the problem however is that it is only used when it also sees a different version in sparkle:version , for example if your app has
CFBundleVersion 1
CFBundleShortVersionString 1.1
and the appcast has
sparkle:version=”1″
sparkle:shortVersionString=”1.2″
sparkle will say you have the latest version , it only uses shortVersionString if version differs from CFBundleVersion
3 – some times you might also want to force a update , either when the user clicks a Update Now button or when the application launches
SUUpdater *updater = [SUUpdater updaterForBundle:[NSBundle mainBundle]];
[updater checkForUpdates:nil];
OR
[updater setAutomaticallyDownloadsUpdates:NO];
[updater checkForUpdatesInBackground];
Both check for a update , however the first way also notifies the user if the current version is the latest one , so should only be triggered from a user action.
The second can be ran transparently on startup as it will not alert the user unless there is a new update , remember to set automaticallydownloadupdates off , or else the updates will only get downloaded and never installed (bug in Sparkle 1.5 b6)
EDIT: the bug has been confirmed for 1.5 b6 by Andy Matuschak , it is fixed in the github sources however http://github.com/andymatuschak/Sparkle/
Posted: December 13th, 2009
Categories:
osx,
software
Tags:
cocoa,
sparkle,
update
Comments:
No Comments.
Ok so this is about the dreaded jarsigner error :
unable to sign jar: java.util.zip.ZipException: invalid entry compressed size
99% of the time what that means is your jar is already signed
However jarsigner has no way to remove signatures from a jar , but you can do that manually since a jar file is a zip archive all you have to do is extract it , delete the META-INF directory and repack it.
Personally i use muCommander , you have to do this : shift+F6 (rename to .zip) > enter > del META-INF > enter > shift+F6 (rename back)
It treats archives as standard directories so it automatically handles the unpacking and repacking of the archive transparently
If you are a terminal lover you can run this for the same results:
zip -d YourJar.ext “META-INF*”
deleting: META-INF/MANIFEST.MF
deleting: META-INF/CERT.SF
deleting: META-INF/CERT.RSA
Which is going to result in this :
deleting: META-INF/MANIFEST.MF
deleting: META-INF/CERT.SF
deleting: META-INF/CERT.RSA
The reason why i have to go into all this is because unlike Eclipse , Netbeans has no way of building a unsigned android apk (unless you mess about with -sign in nbproject/build-impl.xml) but this should apply and work with any kind of java package signing scenario (except the Maven jarsigner which blissfully has a unsign feature)
Posted: October 28th, 2009
Categories:
google,
software
Tags:
android,
jarsigner,
java,
netbeans
Comments:
No Comments.
Personally i think a gesture enabled mouse is a great move , and am looking forward to seeing it implemented in more mice , besides the mighty mouse i have been using a Logitech Air mouse which has a touch scroll with momentum which i miss dearly when using the mighty mouse , i am sure the same will be true about gestures.
But for now i want to touch on some issues with the magic mouse , when it was announced i was hoping a old issue with te apple mouses might have been addressed , that is the inability to hold down both buttons , the mouse registers a left click when a user clicks with both the right and the left fingers pressing.
While the swipe functionality alleviates this a bit there are still a number of 3d applications , games , and browsers that need the old “poorman’s swipe” a left swipe being similar to pressing and holding the right button then pressing the left and vice-versa , but this way of clicking can not be entirely replaced by the swipe feature as you can not swipe and drag for example.
What i do hope is that software developers will start to be aware of gesture enabled mice and of mice lacking 2button hold functionality , or even better mice manufacturers start making mice that implement both features , in any event here is a osx application i wrote for the purpose of testing mouse functionality.

- Title: ClickTest.app
Caption: (universal binary , requires OSX 1.5+)
File: ClickTest.app.zip
Size: 61 kB
Posted: October 22nd, 2009
Categories:
osx,
software
Tags:
apple,
gestures,
magic mouse,
mouse,
swipe
Comments:
1 Comment.

Wether you like to have a file manager running as root , need a file manager that can really dig into the guts of the os or are just nostalgic for the good ole 2 pane commanders , either way you got to have mc handy on your brand new 64 bit osx.
There are a number of ways to install it , you can go all out downloading the source and dependences and compile , or take a easy road by means of the macports or fink packages , however there you might find this way the easiest .
Attached to this post is a zip file with the compiled sources, download and extract it to the root directory of /mc , then open a terminal with 5 tabs , type “cd” in each then drag each of the folders to a different tab , press enter in each , then type “sudo make install” in each tab , in this order : gettext > pkgconfig > glib > slang > mc.
That’s all there is to it, delete /mc, now type mc to get your native 64bit mc fix.

- Title: mc
Caption: archive
File: mc.zip
Size: 53 MB
Posted: September 30th, 2009
Categories:
osx,
software
Tags:
macosx,
snow leopard
Comments:
No Comments.
On the heels of the Firefox 3.5 release that brings HTML5 video embedding support the following pattern of embedding video files emerges (including on mozilla.com and openvideoalliance.org) that is two distinct sources for the video , one encoded with ogg , one with mpeg4 , using html code as follows :
<video>
<source src=”thefile.m4v” type=”video/mp4″>
<source src=”thefile.ogg” type=”video/ogg”>
</video>
What this does is show the mp4 file in safari and the ogg file in firefox , and it is all well and dandy except in the cases where a lot of media is involved it is unpractical at least to have 2 formats for every video file .
So let’s chose just one format then , because ogg is a open standard and endorsed by the One Video Alliance it is a safe bet , sites like Dailymotion are already migrating to it .
Ok , how about browsers besides firefox , well safari for example can also support ogg video with a codec plugin namely Xiph Quicktime Component , but a simple test reveals a problem with the mime types , safari will not play the ogg file if it has type=”video/ogg” in the html tag , works just when embeded ogg files have no type defined.
At this point i am not certain whether it’s a bug or just a misconfiguration in osx or safari, apparently safari uses system wide mime-type settings that are accessible with System Preferences plugins like RCDefaultApp and MisFox but they do not help this cause a lot.
The point i am trying to make is that if you want to use a single format for embedding video and want it to work in all html5 compatible browsers (with ogg plugins) you best not define the type in the html tag if you want the video to work in safari.
Posted: June 30th, 2009
Categories:
software
Tags:
browsers,
firefox,
html5,
ogg,
safari,
video
Comments:
No Comments.
OSX is nice , and not because it has no shortcomings , but because you can fix them as opposed to windows.This has a lot to do with the power of osx that stems from it having applescript and a posix compliant shell.
Here is how to change metadata of files so you can play divx movies with itunes for example , with terminal and devtools
find /path/toyour/movies/directory -name “*.avi” -print0 | xargs -0 /developer/tools/SetFile -t “MooV”
, with applescript http://forums.ilounge.com/showthread.php?t=214705
Now that you can play those files with itunes how about having them show and play in Front Row from the confort of your remote , without even adding them to the itunes library , it is just a matter of making symbolic links in your ~/Movies folder to the directories containing your movies , you can use the shell or just alt+cmd drag them to ~/Movies to make the links.
If yo do not know by now you can download movies from youtube just by selecting the file in Safari > Activity > Copy > Paste into downloads window.
How about playing every movie format there is including the flash movies you just downloaded from youtube in anything you like , quicktime , itunes , frontrow etc , well then just download http://perian.org/ and never care about formats of movies ever again.
To top it off i have a script for those times when you do want to know what are your movie files encoded with , this is a extremely fast shell script , with basic info , you can get it packaged as a osx app to drag folders to or directly as a cross-platform script.

Posted: May 8th, 2008
Categories:
osx,
software
Tags:
hacks,
macosx,
movies,
terminal,
tips,
tricks
Comments:
No Comments.
It comes as no surprise too , microsoft’s paradigm for adding new features is reinventing the wheel , and they overengineer it just to the point where it is inevitable to break , and impossible to determine why it did so.
Without further adieu let me present MicroSoft Visual C++ 2005 and it’s brand new ‘wheel’ , i mean deployment model , dll’s now have to come with manifests and policies , and rely on the Side-by-Side service and this is is just a rough sketch , you can seehttp://msdn2.microsoft.com/en-us/library/ms235342.aspx for in depth details , there is a method to this madness you know , as always.
To put it bluntly however what you have are :
2 files in %windir%\WinSxS\Manifests\ , a .cat file (security catalog , for the policy) and a .manifest file (xml file for describing the libraries)
then you have a directory in %windir%\WinSxS\ where you need to put your actual libraries (directory name and filenames being a mix of the name , version , hash , and architecture so you wind up with something like x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50608.0_x-ww_6262d37f
, nice )
Ok , so now to the explanation , all that is microsoft striving to accomplish with all this is so we can have different version of the same library for our programs that were built with and require a specific version of it , when all you had to do to achieve this since windows 3.1 till 2000 was drop the library in the same location with the program , as a windows program will always try to load a library from its parent folder first , then start looking in every path for it , so you had different versions of the same library , each with the program that required that version.
There can be much more to be said but i rest my case for now , what are the platforms that are ‘vulnerable’ , i mean capable of this new deployment model you might ask , why it’s NT 5.2 and it’s older brother NT 5.1 (vulgarly known as Windows 2003 and XP respectively)
Posted: February 20th, 2006
Categories:
rants,
software
Tags:
microsoft,
programming,
rant
Comments:
No Comments.
It is common belief that Perl is the language of choice for the purpose of data processing and manipulation , and i couldn’t agree more , having been turning to it every time i needed some serious data processing , only to get the best results at each undertaking.
However back then in 99 when looking for a method of automating the calculation of my monthly online time from my dialup provider’s access logs , a task for which ASM just wouldn’t cut it , i had no other choice but to assume this thing about perl and data manipulation as the truth and have a go at the language without knowing for certain.
Today after quite a while and many data manipulation scripts , and quite coincidentally for the purpose of calculating the total downtime of my isp from my server’s access logs , i can not feel but pleased with the power you have with perl and it’s data manipulation drive , so i felt like evoking this wonderful side of perl myself too.
Now as to not make this article a dry reading , and because probably nobody likes staring at a program execution with no progress display for hours on end , or not even minutes , i am going to explain 2 simple progress display trick for your perl scripts.
Roughly the trick consists in using \r (carriage return) to write over the same line over and over, while also disabling output buffering where it is the case
The first example below is the simpler one , but memory buffers are sacrificed for this and do not use this example for files bigger than some dozens of megabytes or loading times will be drastic and memory usage intensive , that aside this should not present any other speed decreases given you write your script in a speed conscious manner.
use POSIX;
#disable output buffering
$| = 1;
open (INFILE,”< $infile”) or die “$infile file not found”;
@data=<INFILE>;
foreach $a (@data){
$proc = floor((($#data – $.) / $#data) * 100);
print “$. more lines to process ($proc% processed)\r”;
$.–;
}
In this second script we are not buffering the whole file into memory , so loading speeds will be great even tho’ we have to use a function to count the total line number of the file with clines() before starting to process it
use POSIX;
#disable output buffering
$| = 1;
#reading line length
print “Reading $infile….”;
$lines = clines($infile);
print “done ($lines lines)\n”;
#processing data
open (INFILE,”< $infile”) or die “$infile file not found”;
$out = 0;
while(<INFILE>) {
$proc = floor(($out / $lines) * 100);
print $lines-$out.” more lines to process ($proc% processed)\r”;
$out++;
}
sub clines {
my ($filename) = @_;
$lines = 0;
open(FILE, $filename) or die “Can’t open `$filename’: $!”;
while (sysread FILE, $buffer, 4096) {
$lines += ($buffer =~ tr/\n//);
}
close FILE;
return $lines
}
Posted: January 14th, 2006
Categories:
software
Tags:
code,
perl,
programming,
tips
Comments:
No Comments.
I was baffled but not really surprised by a relatively new discovery by Dr. David Dunning that the most likely persons to overestimate their skills in a area are the ones that do not have any skills in that area.
The logical explanation seems to be that the skills required for competence often are the same skills necessary to recognize competence.
Interesting is the fact that unlike their unskilled counterparts, the most able subjects in the study, Kruger and Dunning found, were likely to underestimate their own competence.
The researchers attributes this to the fact that, in the absence of information about how others are doing, highly competent subjects assumed that others were performing as well as they were — a phenomenon psychologists term the “false consensus effect.”
This brings in mind a book that dates back to 1969 by Dr. Laurence Johnston Peter , The Peter Principle which largely states that every person in a organization strives to reach and eventually gets promoted to their incompetence level , at which they remain from thereafter.
In my opinion Dr.’s Dunning study sheds new light on the The Peter Principle , because now we can assume that a explanation to why the person never gets put off its incompetence level is that he appears to be at his most competent level only while being utterly incompetent.
Now let us go way back to 1716 and see exactly the same thing portrayed in a old japanese writingHagakure
QUOTE:
In one’s life. there are levels in the pursuit of study. In the lowest level, a person studies but nothing comes of it, and he feels that both he and others are unskillful. At this point he is worthless. In the middle level he is still useless but is aware of his own insufficiencies and can also see the insufficiencies of others. In a higher level he has pride concerning his own ability, rejoices in praise from others, and laments the lack of ability in his fellows. This man has worth. In the highest level a man has the look of knowing nothing.
Astonishingly how the insight on the human nature from almost 300 years ago is still as valid and revealing as the modern studies.
Intrigued by these new perspectives i have started to a little survey by myself on a much smaller scale , more exactly i am asking the users that take my PHP Skill Test and the Common Knowledge Test to average their competence for that test before seeing the test results


In the above graph notice how big is the difference at the end of the chart between the many with lots of confidence and the few with lots of knowledge


In the above graph a small scale number reflects a minority while a big number a majority , the distance between the two lines reflects the proportion between knowledge and confidence , a equal amount of them is reflected where the lines entwine.
The 2000 Ig Nobel Prize was awarded to David Dunning of Cornell University and Justin Kreuger of the University of Illinois, for their report, “Unskilled and Unaware of It: How Difficulties in Recognizing One’s Own Incompetence Lead to Inflated Self-Assessments.” ( published in the Journal of Personality and Social Psychology, vol. 77, no. 6, December 1999, pp. 1121-1134 )
Xtreme Programming or XP for short are “agile” programming methodologies are the spearhead of what are known as lightweight programming methodologies , and are getting more popular every day.
They relate closely to opensource methodologies and are essentially a license to hack for the oppressed corporate developers so i can easily
understand their joy and sympathize with these methods myself.
In my opinion , the agile xp method is nothing else but a definition ,standardization and enhancement of the developing methods that are
used outside of the corporate bureaucracy monolithic methodologies , and that is buy itself a very good thing if those standards start to be used inside coporations , and is definitely something they have to thank the open source movement for.
Posted: March 17th, 2005
Categories:
rants,
software
Tags:
agile,
hacking,
programming,
XP
Comments:
No Comments.