The time I spent believing that my buffered input stream class had a leak because of two silly mistakes somewhere else could have easily been better employed. So I am happy to share my findings and spare other developers the same frustration. No rocket science here, just two simple anti-patterns.
I just found out about a convenient way of taking screenshots from the iPhone Simulator (which, incidentally, is also an iPad Simulator). Just run your application and when you get to the screen you need to save, press Control + Command + C. The ‘screenful’ will be copied to your clipboard. One easy option at […]
Strangely enough, there is no way in the Cocoa or Cocoa Touch frameworks to read a stream of bytes as a sequence of characters line by line. The option of creating a string from a file, with methods such as stringWithContentsOfFile of NSString, and then generating an array of lines with componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet] certainly seems […]
A quick way to truncate a file to zero length without affecting any other attributes (owner, permissions, and so on)? Here goes… In the terminal window, type the following command at the prompt : > filename.ext The file called filename.ext will be reduced to zero bytes (emptied, basically). Everything else stays as it is, apart […]
When working in PHP, the most convenient way of dealing with timestamps is through the time() function, which returns an integer representing the number of seconds from the UNIX epoch (1 Jan 1970 at 00:00 GMT). That’s perfect for passing around your code modules, calculating time differences and easy conversion to string with the date() […]
I’m using SVN for my XCode projects, but have soon realised that XCode support for SVN is not powerful enough. So I have decided to go the old good command-line way… One of the most fundamental things I want to be able to do is ignore files – there is a lot of stuff in […]
It’s often useful to be able to split big archived files into smaller chunks, move them to – say – an external FAT32 hard drive (that won’t take anything bigger than 4Gb), and then recompose the original by combining the pieces. The MacOS X native archiver doesn’t handle that, and I didn’t like the idea […]
I’ve just found out about two convenient shell commands that can be used to check out and change/remove file associations in Windows. The first one is ftype, that allows you to define aliases for executable files to be invoked. The other one is assoc, whereby you can associate file name extensions to the aforementioned aliases.
After spending almost an hour trying to understand why an extended method would just not be available to the extended object types, I found out about a limit of this feature that I will make a note of, for future reference.
ricmest (09.04.2008 15:43:44): FEDE NOSTRO CHE SEI SOTTO I CIELI DI LONDRA, GRAZIE PER AVERCI AIUTATO A GUADAGNARE IL NOSTRO PANE QUOTIDIANO, NON CI INDURRE NELLA TENTAZIONE DI MANDARTI A QUEL PAESE, OGNI TANTO… MA LIBERACI DAI PROBLEMI AFFINCHE’ CI SI POSSA DEDICARE MEGLIO AL NOSTRO PORTALE, AMEN