Skip to main content

Posts

Showing posts with the label hacking

AndroidStudio and a RAM Disk

Ok, my iMac is late 2012 and only has 8GB of RAM. I decided to see if it would be possible to speed up my development cycle, especially for running unit tests and the like but just as much for an improved build time as well. After much fiddling in the dark and reading some great pages, I eventually came up with the following solution that works for me but bear this in mind: Danger Will Robinson RAM is volatile so everything you do is gone forever when you unmount it or shutdown so don't forget to copy your changes elsewhere. If you have Git integrated properly then get into the habit of committing frequently. I have considered writing a small bash script to run `rsync` from a custom menu option  (and thus a shortcut key binding) or look into using the Apple Automator to transfer any changed files across to the hard drive. Whatever... you have been warned! Step one: Create the RAM disk, I do it like this: diskutil erasevolume HFS + "RAMBO" `hdiutil attac...

Using a RAM disk with Opera on OS X

Having recently configured AndroidStudio to use a RAM disk for Gradle, I thought I would look around and see if I can use the remaining space for Opera. This is essentially a reproduction of this fine page: http://www.ghacks.net/2010/10/20/how-to-change-the-opera-cache-directory/ That page does not deal with Macs though and after a little bit of experimentation I came up with this spell: open /Applications/Opera.app/ --args --disk-cache-dir=/Volumes/RamDisk/opera For the record, here is my Opera version: Make sure that the specified folder exists before starting Opera, if might automatically create the folder for you but I didn't bother to find out, I hate disappointment. And for the record, the way I create a RAM disk on my iMac, which is done automatically when I log in, is like this: diskutil erasevolume HFS+ "RamDisk" `hdiutil attach -nomount ram://4194304` The above line was courtesy of this YouTube video: Thanks to Bartech TV then! So, with Turbo m...

Prime Peace

I think prime numbers are the numerical expression of peace. Restful nodes in the vibration of everything. Prime factorisation has always struck me as something truly astounding and it is reassuring to know that awsesome minds are hard at work trying to solve the Riemann hypothesis right now. There are some truly wonderful professional and amateur (in the nicest sense of the word) explorations I have watched recently and the ones that moved me the most, in order of cool factor were: This guy,Carlos Paris, has put in some serious work with AutoCAD and made some interesting observations. I truly enjoyed watching all of his four videos. Awesome work Carlos. As an interested amateur I found his work and thoughts to be very compelling. I am sure the professionals would groan or moan but to me this video is most excellent and informative. Speaking of the professionals, this video is also very interesting to watch as it goes some way to visually explaining the Riemann hypothesis in...

Cross platform development with Scheme

Just a quick note about something I recently found whilst trying not to buy MOCL… http://www.lambdanative.org/ LambdaNative is developed and maintained by the Pediatric Anethesia Research Team (PART) and the Electical and Computer Engineering in Medicine (ECEM) group at the University of British Columbia (UBC). I have spent a week or two evaluating it and accidentally contributed a pull request that got merged and one that didn’t and I have to say that, for what it offers, it is awesomely good. Having personally spent many hours with it now, I do not yet think it is ready for mainstream development for a few reasons. I don’t mean that it a bad way either. What I mean is that the language, Scheme, is not really that widely known and as such it probably won’t break out into the public arena any time yet. That’s a real shame because I think that they have achieved an amazing thing; total abstraction of the underlying platform with a really powerful, underestimated language. ...

Control OSX Screen Brightness from Ubuntu 14.04 (on a USB stick!)

After trawling here and there and trying lots of different things, for me this works on my late 2012 21″ iMac with an ACPI card. It’s best to put the script into a file, make sure the file is discoverable on PATH. All details are in the folder: /sys/class/backlight/acpi_video0 which on my machine looks like this: ubuntu@ubuntu:~/mc2$ cd /sys/class/backlight/acpi_video0 ubuntu@ubuntu:/sys/class/backlight/acpi_video0$ ls -l total 0 -r--r--r-- 1 root root 4096 Oct 7 08:29 actual_brightness -rw-r--r-- 1 root root 4096 Oct 7 08:29 bl_power -rw-r--r-- 1 root root 4096 Oct 7 08:28 brightness lrwxrwxrwx 1 root root 0 Oct 7 08:29 device -> ../../../0000:01:00.0 -r--r--r-- 1 root root 4096 Oct 7 08:03 max_brightness drwxr-xr-x 2 root root 0 Oct 7 08:29 power lrwxrwxrwx 1 root root 0 Oct 7 08:29 subsystem -> ../../../../../../class/backlight -r--r--r-- 1 root root 4096 Oct 7 08:03 type -rw-r--r-- 1 root root 4096 Oct 7 08:03 uevent WARNING: If you use values higher than the maximum...

Why is software development still so hard?

Total experience to date: thirty-one years. Started with UCSD Pascal and Z80 assembler. Currently into Haskell and Prolog and anything functional. Putting all that to one side, as we all know that the language you use to implement a solution is by and large irrelevant, no really, you know it is… I find myself lately finding it harder and harder to want to embark on any sort of personal project. A mere twenty years ago I was brimming with enthusiasm for it but these days I just find myself wanting to watch cat videos on YouTube. Initially... I was spell-bound (and to some extent still am) at the age of eleven that you could “express an idea” in the language that the computer could understand, be it BASIC or whatever was available and then sometime later have that idea executing. Of course, the idea has to be information processing centric; that’s what the infernal machines do so well. Eventually... I realised that you could express solutions using any number of techniques rang...

Command line atmospherics with mpg123

I have loved listening to SOMA.FM for years, especially Groove Salad. I also recently found a brilliant little site called soundrown.com , which plays various background noises in response it seems to recent scientific study that shows a certain level of background noise helps you get in the zone, stay there and be more productive. Being a command line person, I looked around to see if I could mix the two and not have to use a browser, and here is my solution, using mpg123: $ mpg123 -q http://173.239.76.148:8032 & $ mpg123 -q http://www.soundrown.com/Audio/Final%20Normalized/mp33/CoffeeShopFinal15.mp3 & You can put it into a script I guess like I did. The “-q” stops any output and the trailing ampersand backgrounds the processes; this stops junk appearing in your terminal window from time to time. I can’t work without it much these days, it helps to drown out the office noise around me.