Last week I found something quite frustrating with the tar command on Mac OS X, it likes to put hidden files into archives when you tar them up, it doesn’t give you any warning, just does it.
Creating a tar, and then having a look at its contents, you’ll see something like this :
JamesMac:staging-area JElsey$ tar -tf MyApplication.tar.gz src/ src/._MyApplication.cmd src/MyApplication.cmd src/._MyApplication.properties src/MyApplication.properties src/lib/ src/lib/._anExternalJar.jar src/lib/anExternalJar.jar
Notice the files prefixed with “._”.
You can quite easily stop this, by setting the following environment variable (I prefer to set this up in the bashrc_profile):
Decided on a long name for your application when you created it, but are now fed up of seeing it display like this on the home screen?
You can quickly and easily change the display name of your application but amending InfoPlist.strings to the following
/* Localized versions of Info.plist keys */ CFBundleDisplayName = "My App";
Easy as that, since the plist file is localised, we can use this for multiplate languages/locales.
Messing around with your subversion directories and fed up of the .svn hidden folders laying around? If you try and checkin some directories that contain a .svn folder from some other repository, you’re going to have a whole world of pain trying to fix it (speaking from first hand experience here)
The easiest way to clear up rogue .svn directories is to run this command (on linux or mac). It will recursively find all directories named .svn, and pass them in for removal.
Frustrated, that I recently couldn’t find my maven settings.xml file because the Mac OS X Finder doesn’t show hidden files by default, I found that the following can correct that
- Open a terminal
- Type this : defaults write com.apple.finder AppleShowAllFiles TRUE
- Kill any open finder sessions by typing (note the capital F) : killall Finder
- Re open the Finder, and you should now be able to see hidden files.
You can also reverse the above by changing TRUE to FALSE.
Hope this helps
Sending a tweet from your iOS application could not be any easier, Apple and Twitter really were looking out for their developers.
With iOS 5, the twitter account is authenticated under the settings menu of the device, which means that any application can request this account to use for tweet, and that is all you need to do; sign in, then request these details in your application.
Follow these easy steps
Sign into twitter on your phone
If you’ve found yourself using Tesseract on the iOS platform, and you’re scratching your head as to why the OCR results are so terribly incorrect, you might be interested in the following. Most of the tesseract iOS tutorials talk about compiling the libraries, but don’t really cover how to use it.
Are you using something like this to interface with the tesseract API?
char* text = tess->TesseractRect(imageData,(int)bytes_per_pixel,(int)bytes_per_line, 0, 0,(int) imageSize.height,(int) imageSize.width); NSLog(@"Converted text: %@",[NSStringstringWithCString:text encoding:NSUTF8StringEncoding]);
I was using this to start with, and the results were terrible, if it was able to read anything it was mostly returning special characters or just utter nonsense.
I came across a brilliant little feature of the linux sed command today that I wasn’t aware of, and thought it was well worth posting up about.
I’d been using sed statements inside a bash script, to trawl through property files and replace values, these were all alphanumeric values so I didn’t have any problems with the usual sed comand of
sed -e s/replaceThisValue/withThisValue/g
That worked great, but then I had some properties introduced that contained special characters, notably the forward slash and equals. I scanned the interwebz for answers and there were all sorts of complicated techniques for escaping special characters, passing them into awk and all sorts of other such nonsense, however there is a much simpler way, just use a different separator character.
I’m not the type of person that gets bored easily, I’ve always got many things to keep me amused, mostly side projects at home. I’m a firm believer, that if you don’t set yourself goals in the first place, then you won’t have anything to fail to achieve, so I’ve set myself a list of targets that I’d like to achieve in 2012 knowing full well I probably won’t get around to them all, but if I can do at least 3, it was worth it.
I’ve recently decided to cancel my hosting package with 1and1, as I don’t really have much use for it any more what with all the freebies Google is dishing out.
I needed to take a backup of all my files, and unfortunately mget doesn’t (or at least at the time) doesn’t support the downloading of directories, luckily there is another tool to help, <a href=”http://en.wikipedia.org/wiki/Wget”>wget</a>.
This example of wget will download all files (the -r specifies recursively) from a directory on the domain
<code>wget -r ftp://account_name:firstname.lastname@example.org/directoryname</code>
Slackware, which I like to refer to as “proper linux”, theres no messing around with fancy wizards, this is hardcore linux; and a good cure for insomnia (second to Linux From Scratch that is)
This should help you get Slackware 13 installed, I did all of this using Virtual Box so make sure you have that installed first, and have created an environment ready for slackware.
Insert your LiveCD, or mount your downloaded ISO onto Virtual Box, then start up the virtual machine. Once virtual box has loaded up it should bring you to the first welcome screen in the Slackware 13 installation.