Wednesday, 31 October 2012

mac mini, how do I xxxx thee? Let me count the ways...

In case, like me, you put a CD/DVD into your mac mini and it doesn't appear on the desk top, to eject follow this simple set of instructions...
  1. Search internet for help
  2. Try opening itunes to see if you can eject from there
  3. Try opening a terminal and typing "drutil tray eject"
  4. Try restarting computer holding down the mouse button
  5. Try the above another couple of times, just in case
  6. Try restarting the computer holding down the option key (I might be wrong but I think the 'option' key is the one with 'alt' written on it) when you see the startup selection screen, press eject key on the keyboard (if you have one)
  7. Repeat the above a couple of times 
  8. Try restarting the computer holding down the key combination... Command-Option-O-F (the command key, might be the one with the apple logo on it)
  9. Try the above a couple of times, try holding down the keys, try repeatedly pressing them, if you ever see a command prompt on the screen you've found the Open Firmware prompt, try typing in "eject cd"
  10. Try restarting your computer and doing nothing at all for 15 mins, you never know, magic might happen, it might just eject itself
  11. Admit defeat, there is no software related way of getting your CD back.
  12. Unplug the computer, leave it for a coule of mins, turn it over and using a kitchen knife pry the casing away from the base
  13. Ease the casing off the computer, the CD housing is at the top, remove the four screws holding the top of the CD case in place and slide out your CD
  14. Replace the screws 
  15. Replace the casing 
  16. Plug in everything and turn back on, job done, I can now return the CD to the library  
  17. At this point I'm not sure if i should put an unwanted disk into the mac, to ensure I never put something I actually need in there again. Maybe something that humanity would be better off without, like Sex in the City 2?


Saturday, 27 October 2012

11.9 °

After a number of years of hardly going swimming at all, I started going to Brockwell lido at the end of the summer. It's unheated and starting to get quite cold, it's been around 13 to 14 degrees, but this morning it was a crisp 11.9°c (34°f). Luckily the Gym/Spa has a open weekend so after the pool you can sit in the spa and recover! Recommend : )
Apart from that its been ISO-9001 this week, happy to say that we passed with flying colours! Go team Map : )

Sunday, 21 October 2012

The Bree Louise

The Bree Louise pub at Euston is a place I've walked past many a time, but never ventured into. Normally I'm heading for Diwana around the corner in Drummond St. a veggie restaurant from the era when veggie resturants where few and far between.  The other day I was heading for the Bree Louise to meet a friend, who as it turned out didn't show up while I was there. I did find a spaniard and an american to talk to though, so not all was lost! And the pub, a dusty, old-school pub with fantastic selection of ales. recommend : )

I finally decided enough was enough today and I'd put my mind to getting Tomcat debugging to work in IntelliJ, something I've always meant to do, just never got round to.

Firstly I needed need to get Tomcat Server to show up in Run/Debug Configurations and Application servers to show up in Settings > IDE Settings . It wasn't there so I went to Settings > Pluggins and and enabled Tomcat integration. After the IDE restarted I added my Tomcat to the Applications Servers section by opening Settings > Application Servers > Add, it asked me for my Tomcat home and base directories ("tomcat home" where the bin is and "tomcat base" is where the "webapps" directory is, on my deployment the conf director was in base location and IntelliJ was expecting it to be in home, so I had to symlink it in).

Then selected the Run/Debug Configurations menu, clicked Add, selected Tomcat server (local in my case), give it a name and leave the defaults as they are.

I needed to create an artifact in Project Structure to link to my tomcat webapp. This was a simple task of choosing Add >Web Application Exploded an adding the source folders.

I needed to tweak some stuff to get tomcat to play nicely, IntelliJ wanted to start tomcat by running ./catalina.sh run, starting tomcat this way was giving me Tomcat – Java.Lang.OutOfMemoryError: PermGen Space error, in the end I added this to the catalina.sh file
JAVA_OPTS="-Xms536m -Xmx1024m -XX:PermSize=256m 
-XX:MaxPermSize=256m $JAVA_OPTS"
probably not the best way of doing things, but it did sort out my start up issues!
All this required a lot of starting tomcat, a quick way to find tomcat process id in order to kill it (presuming your running on 8080)
$ sudo netstat -lpn |grep :8080
tcp6  0  0   :::8080    :::*   LISTEN   6447/java
$ kill 6447 
or  $ kill -9 [proc id] if your hard core!

Anyway, debugging is now working, I haven't explored all the options but did check the "persist sessions" checkbox which means you can pick up where you left off between restarts which is magic! And, hot swapping seems to work (on occasion).

Why didn't I get this sorted ages ago?!




Saturday, 13 October 2012

Veg dumplings

Itsu round just the corner from work in Fetter lane do very fine veg dumplings, i'm not normally a one for the chains, but have to say... yum.

I was struggling for a while, trying to copy an action in PhotoShop (CS3), it turns out all you need to do is drag it onto the "Create new action" icon and boom!

Another thing that turns out to be quite easy is formatting a date from a string in jsp, in the example below the "published" variable is a string, the pattern attribute on the parseDate tag must match the format of your string, after that you have a date object variable which you can format using the formatDate tag.

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>


<c:set var="published" value="2012-10-01 12:24:09.263" />

<fmt:parseDate 
    value="${published}" 
    pattern="yyyy-MM-dd HH:mm:ss" 
    var="publishedDate"/>

<p>Published: 
<fmt:formatDate 
    value="${publishedDate}" 
    type="date"
    dateStyle="full"/>
</p>

checkout http://www.tutorialspoint.com/jsp/jstl_format_formatdate_tag.htm for more info on what the type and dateStyle attributes do.

Saturday, 6 October 2012

What I learned this week; Ganache

What I learned this week; Ganache

It is possible to ruin a ganache, you stir it like crazy when it still hot! Since I was stuck with it, not having any more cream, I mixed it with a hand blender when it was just getting cool. It didn't have the glossy sheen it should, but made an acceptable covering for the cake.

Also, having had some IE7 problems when loading YUI3 at the bottom of the page I've gone and stuck one in the document head for older versions of IE.

<!--[if lte IE 7]>
    <script 
        type="text/javascript" 
        src="/lib/yui/${yuiVersion}/build/yui/yui-min.js"></script>
<![endif]-->

On a related point, it seems that in IE9 borer-radius is supported, but not in conjunction with a gradient filter, at least not on what I was doing, so decided that I'd rather have the rounded corners than the gradient.

<!--[if IE 9]>
  <style type="text/css">
    #divContainer div.topbar {
        border-radius:10px 10px 0 0;
        filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);
    }
  </style>
<![endif]-->
 

Note: the opinions on this page don't represent that of my employer in anyway. And, actually only vaguely represent my opinions on the date of publication. (Unlike Ms T, I am very much for turning)