Little Spikey Land - programming

Computers Stole My Social Skills


Monday, September 06, 2004

mac programming

Checkmail Manual


Here's a low-tech/high-tech solution for checking your mail under OS X remotely, using the standard Mail program in OS X:

checkmail script

It's low-tech in that it's just a basic shell-script, but high-tech in that I suspect it will only be useful to people who are happy with the commandline and ssh.

To use it save the script to your mac and make it executable (chmod +x checkmail.sh). Then from another computer you can ssh to your mac and run the script to see if there are any new messages. This is only really useful in a situation where your mac is not too far away. In my case I use it to see if I have new mail, when I am using my laptop downstairs (away from my mac).

Most of the work is done using the osascript command, which communicates with the Mail application. I am sure with a little work the script could be extended to read the titles of the messages and list who they are from too.

Example output:

[iMac:~] john% ./checkmail.sh 
Mon Sep  6 17:51:22 BST 2004
Checking mail
INBOX: 0 unread
JPL: 0 unread
Psion: 0 unread
SB: 0 unread
Outbox: 0 unread

posted at 5:56 PM John
xml
permalink

Sunday, December 28, 2003

programming stuff

Argh


Right so I've only got 2000 words done so far, but at least I have a cute digital camera now:

me with the inside of a cracker

Also did a bit of (unassesed) work for molecular and quantum computation. Wrote three little (less than 4K) cellular automata applets: Conways Game of Life, Sand Piles and Excitable Lattices. It made me feel a bit better to right some code with (sort of) a purpose.


Edited on: Sunday, December 28, 2003 10:16 PM
posted at 10:14 PM John
xml
permalink

Thursday, December 11, 2003

programming stuff

Presentation


Well I had my presentation for my mini-project on Wednesday. I was quite nervous, but it seemed to go fairly well. Anyway, because I used Latex for preparing my slides I was easily able to make a PDF of the slides. The slides are not very informative, as I did not want to end up just reading from them, but they do have some references on them and some pretty graphs too.


posted at 11:29 PM John
xml
permalink

Sunday, December 07, 2003

programming

Python Matlab library


Found this handy library, for Python, called Matplotlib. Basically it gives you a set of functions that work in a very similar fashion to Matlab. I've been using it for automatically generating graphs of the data from my simulations:

Average Fitness

The library lets you output as png's (handy for viewing) or as ps (postscript - very handy for when I do my report in latex). Haven't messed around with the formatting yet, as can be seen by the fact that the bottom axis is a bit messed up, but at this stage having graphs I can glance at quickly is more useful.


posted at 7:02 PM John
xml
permalink

Saturday, December 06, 2003

programming stuff

Uni Website


Well looks like my Uni Website just came online. Not much to look at yet, only a link to the DNA Sim I wrote for Molecular and Quantum Computation.

Hopefully I've have a few more things on it soon. Maybe some results from my mini-project even.


posted at 12:45 AM John
xml
permalink

Saturday, November 29, 2003

java programming stuff

Schweet Evolution


Predator Chasing Prey

Well now I'm happy!

I have made the parameter that controls an agents "field of vision" evolvable. In this case all agents started off with fields of vision of 180° (ie they can see in front and to the left and right). I created two species one coloured blue and specified as being herbivores, the other coloured red and carnivorous. The interesting thing is that after a while the carnivores and herbivores have differentiated by field of vision quite well.

In the above picture you can see (from the black lines) that the herbivore now has a field of vision that allows it see partially behind it. This is great for when it is being chased (particularly as the carnivores are slightly faster). Conversely the carnivore has a field of vision that is slightly more forward looking. This lets it stay a bit more "focused" on it's target.

The best thing about this is that this is what you would expect from real life predators and prey. Think cat (forward looking) versus mouse (eyes on side of head, lets it look around).

The only weird (but still interesting) thing at the moment is that the predators tend to stay in one place and turn on the spot. This seem to work fairly well as they can scan the "horizon" for incoming herbivores and pounce on them when they appear!


posted at 6:08 PM John
xml
permalink

Saturday, November 22, 2003

java programming

Little Spikey Land 3


Here is a screen shot of part of my mini project. It shows the "Species Dialog" that lets you control the parameters of the agents. The coolest thing about it, is that you can change the number of sensors and the agents field of vision. You can have forward looking predators and prey with 360° vision if you want, or combinations in between.


Edited on: Saturday, November 22, 2003 10:53 PM
posted at 10:52 PM John
xml
permalink

Thursday, November 13, 2003

programming stuff

NEAT


Work at Uni continues on my project. Nearly got evolution working in the virtual world I am making (Little Spikey Land 3?). I am at the stage of figuring out the wiring of my agents, such that they have more potential for evolving in interesting ways.

Kennon (who is doing Natural Computation at B'ham) pointed my in the direction of NEAT (NeuroEvolution of Augmenting Topologies). I had not come across it before. It lets you evolve ever more complex topologies, but still allows you to crossover Neural Networks that are not identical. Looks pretty good, so I think I might give it a go.

It should be useful from the co-evolution side of things, as I can then compare and contrast between NEAT (which allows for increases in complexity) to fixed network topologies.


posted at 8:02 PM John
xml
permalink

Friday, October 17, 2003

drawing java programming

Gallery


Did a bit of work on making myself a gallery generation program. Basically I want something so that I don't have to do too much to add new pictures, but that will give me a fair bit of flexibility. As like a lot of programmers I have chosen to "roll my own". It's partly for the sake of it and partly so I can make it do exactly what I want it to do.

Anyway, here is a screen shot of a gallery it has made. The interesting thing here is that the thumbnails were generated automatically and still look reasonable, even though the original pictures were all sorts of different sizes. At the moment it is biased towards using the top left of an image for a thumbnail, but I want to make that user controllable too. In the mean time it'll be a nice bit of "relief" programming when I want to procrastinate. ;^)

Also done another inked picture.


Edited on: Friday, October 17, 2003 8:39 PM
posted at 8:38 PM John
xml
permalink

Monday, October 06, 2003

programming stuff

Being a Student Again


It feels strange being a student again. I think I got used to having my free time as my own. Not that I've been particularly busy this week (first week after all), but I feel guilty that I haven't been doing more. I guess that will change when I get started on my first "mini-project".

I am hoping to do a mini shared networked world of sorts. It'll probably be quite basic as I have less than ten weeks (unless it turns into my summer project too), but hopefully I can get something working. Here goes Little Spikey Land II...


posted at 12:09 AM John
xml
permalink

Tuesday, September 30, 2003

java mac programming

Jammies


I wrote a little java version of the MacOS program called "Stickies", which lets you leave virtual post-itTM notes on your screen. It's called Jammies, because Jam is sticky and I couldn't think up a better name. I have it setup so that it starts up when I login. It should remember how it was when you left it (including whether it was minimised or not). It's only a tiny program so Java is probably overkill. Maybe I should write a tiny C version for Linux...

... just uploaded a version which slightly simplifies changing colors and closing notes.


Edited on: Monday, October 06, 2003 12:35 AM
posted at 9:51 PM John
xml
permalink

Monday, September 15, 2003

drawing programming stuff

ASCII Art


Well just had a quick play around and wrote an ASCII Art generating program. which was based on a bit of code from Wikipedia. I've made it so you can move a slide bar to alter the effective contrast. Works pretty well:
                           d.  MM '     (bM                                                      ,M        M)                                     
                          dMM. MM       (MM                                                      dM     . ,P)                                     
                          MMMM.(M       (M`                                                      M(    ,) ())                                     
                         (MP MM/M       (M                                                       Md    () M))                                     
                         MM' "(bM.  `  ,(M                                               aa.    (M,    d ,P,)dMb                                  
                        (MM   `MM)    ,MV)                                            daMMMMb   (MV'  ,M ()MM""Md.                                
                        VMMa   (MM    MP`'        ,.(a                           ',dMMMMMM"Mb   (M)      dMM    V)                                
                        MMMM)   MM , aM)         (MP`MMbaaa      d.(            'dMMMMM" `MMMb  (M)     ,MV)    (.                                
                        MMMM)   MM)  MM)       ,aMMaMMMMMMMMMMMMaM M           aMMMMP'     `VM)  (),    dMdaaa  (                                 
                        MM''M.  VMM  (M       ,MMMMMMMMMMMMMMMMMMM`)           MMP"P        (MM  ()(    bM)V"V) P                                 
                        dP (Mb  (MM  M)      dMMMM"'`"`"""PVMM"""M)            `     ,aMbMaa. "  (b`.  ,dM,   ) P                                 
                        Mb  MM   VM) M)     (MMMP",  `  ,   .    ` .                ,MMMMMMMMb   `M.)  (PP    .d)                                 
                         M   Md  (M) M)    ,MV"' . adbMbaaaaa.,                   .aMMMMMMMMMMM  ,Md)   M)   (,P                                  
                         M,  (M. `Mb M)    "    \MMMMVMMMMMMMb `                 ,MM"MMMMMMMMMM  (MPb  MP M  VM)                                  
                          () `MM  MM M)       aMMMMMMMVMMM"MMMM.              a ,MMM VMMMPMMPVP   ()M  M)()  aM                                   
                          d)  M"a(MM M)       MMMMM"M)(MMM)MMM`' M          (dM,M"`M) MMMMMP'M)   ()P  M)(' (MP                                   
                          VM  () (MM M)     d )`"V  MM VMMbMPMb ,P          dM\M"'`MMdMMMMM'aM a  ()M (M)M` MM'                                   
                          (M. `) (VMbV)     P,  ,   VMa "\MM)`M.db.       ,aMM(P   (MMMMMMP(MM     )M (MM) MM'                                    
                           P)  ' M(MMM.      (  Mb. (MMMMMMP  ()PM)       (MMP()    `"MP' (MMP      " dMM  P                                      
                            M)   )(MMM)         (MM ."MMMMP'   MMMM        MP'(' d.     ,dMM'       ,.VMP ()                                      
                            ,)  ,)MMMM)          (Mda  `     M.`M'M)       VM    MMbaadMMMP'       M(,MM) M'                                      
                            (M  `MMMMM)           MMMa ,, ,aMMM`)dP'      ,MM     (PMMM""          MP(VM  `                                       
                             M. (MdVMM)            MMMMMMMMMMM",MP,'      `"      `' '             )M)M) ,                                        
                             (b `'M(MM'             VMMP""""'   ",M        ,.                     ()),M' `                                        
                             (M. `bMMM              ' `"'                   )   '(                (M)MM (P                                        
                             M(b (M"MM              .      aM                   .M ,              (M,MM  '                                        
                             `dV `P,MM.             '   ,dM'                     VdM"M) .         MMdVM M                                         
                              M/'  (MMb              ,MP""                       (                M M().                                          
                              (()  MVM)                                                           M()M))                                          
                              (.d  M(M)                                                          (M( Mb)                                          
                              `)M ,PdM'                                                          (M(  M)                                          
                               )(.()V(                                      )                    (M ( ('

Edited on: Monday, September 15, 2003 11:29 PM
posted at 11:25 PM John
xml
permalink

Tuesday, September 02, 2003

programming stuff

j00 r a vb n00b, I pwn u with my l337 vb skillz, h4x0r


Well I just got a months coding work today! In VB!?! Should be interesting, and a lot better than data entry (and better paid too). It should take me up to the start of term nicely and it means I don't have to worry about money quite as much. I might even be able to afford a few luxuries (because wireless networking is obviously a necessity).

p.s. sorry about the title, Megatokyo has warped my mind and this resulted in me receiving this comment from a friend.


posted at 8:11 PM John
xml
permalink

Monday, August 25, 2003

books java programming

Java Books


It's been a while since I bought any Java books and now I've just gone and got two. I guess it's because I'm heading off to Uni again and want to brush up on a few things.

The first book was JDK 1.4 Tutorial, which covers the new features of java 1.4. It makes trying to grok the new APIs a lot easier.

The second is Java Extreme Programming Cookbook which I have wanted for some time. This one is going to be very useful as it covers things like Ant and JUnit. I've already set up an Ant build file for JPL and I shall soon be writing some unit tests, which will help ensure my code is much more robust.


Edited on: Monday, August 25, 2003 5:29 PM
posted at 5:07 PM John
xml
permalink

HomeArchives

Little Spikey Land

Powered By thingamablog