Archive

Posts Tagged ‘Software’

Outlook not so good.

August 16th, 2010

An important person in the company (all praise the company!) has just attempted to send me an updated security certificate by email.

Oh, no, no, no, my friend! Surely you know that I’m running Micros~1 Outlook as my office mail client?

You see: Outlook knows what’s good for you, and apparently, security certificates are not. Indeed, Outlook will not allow me to access this file, or even give me the option of “Don’t worry, I know what I’m doing.”

[Here's a fun fact: The certificate was *sent* *using* *Outlook*. So, Outlook will happily send files that it deems to be unsafe, but the poor sap on the other end won't get to use it.]

Now, I tend to place a degree of value on others’ time. So it pains me to have to reply to someone saying “Hi, Outlook won’t let me open your attachment. Can you jump through hoops X, Y, Z to get it to me?”

Outlook used to simply be a poor email client. Now it has become actively counterproductive.

Self , ,

C++ Templates for XCode 3.2

November 19th, 2009

Here are a couple of Project templates I made for XCode 3.2. One for a WxWidgets based project (wxMac 2.8), and one for a GLUT project. Hope they work.

  • GLUT C++ Project – Initializes GLUT and creates a scene containing a cube which can be rotated using the keyboard arrow keys. toggle an axis widget using ‘w’, toggle fullscreen using ‘o’ and exit using ESC. The FPS is displayed in the titlebar.
  • WxWidgets C++ Project – Initializes a WxWidgets based app with an empty frame.

Programming , , ,

Nethack on OS X 10.6 (Snow Leopard)

November 13th, 2009

O.K. So, this is kind of a followup to a previous post I did about how I like to setup Nethack on my Mac. However, more recently, some of the patches I had used stopped working on later versions of Mac OS (10.5 and 10.6). So I spent a bit of time looking into this today and I got some positive results. (update: I think the problem I had with Menucolor compiling was that it didn’t like the regexp method – I changed this to simply use the wildcard matching.)

Nethack with Status Colors and Menu Colors

Nethack with Status Colors and Menu Colors

Unfortunately, because the two patches I’m applying have resulting conflicts- it meant manually applying the patches to the source code in some cases (also: I’m lazy). I, therefore, don’t have an elegant method of actually applying the two patches that I can pass on. What I am doing instead is providing two things: The complete refined archive of the patched Nethack source which should be ready-to-compile on OS 10.6; And also the .diff file produced from a vanilla copy of the source and my own patched version. I will also provide my new updated nethackrc file. (ok… 3 things :-) )

Here’s some details about the setup this provides:

  1. The Status Colors patch is applied. This is a configurable patch allowing you to color code status effects – hunger, blindness, HP, Gold, AC, etc. It’s very, very cool! :-)
  2. Menucolors patch applied. This is a configurable patch that let’s you apply colors to popup menus. e.g. inventory items can be red for cursed, green for blessed, etc. Again, this patch is very neat!
  3. The initial configuration for getting Nethack to build on mac has been taken care of.

So Here are the links to get everything up and running. I should say at this point that this stuff works on my machine and YMMV. If something is broken and you want my to take a look at it just leave a comment of send an email – I’ll try to fix it if I have time. You may also want to dig through the changes in the patch.

  1. nethack-3.4.3-patched.zip
  2. nh343-_menustatus_orig.diff
  3. .nethackrc

I hope this is useful for someone who wants a nice shiny setup of Nethack on Snow Leopard. :-)

Programming , , , , ,

Saving the World: The American Way

March 7th, 2009

Out of curiosity, I download America’s Army for Mac ealier. Having just completed the Basic training and M.O.U.T. exercise I would like to reflect on some of my favourite lessons so far:

  1. Use of cover: You may not discharge your weapon outside the active room.  Soldier, your mission is to charge screaming into the center of the room unloading single rounds from your weapon. Now go an be an American Hero!
  2. Flash Grenades: Flash grenades can be used to temporarily blind your foe, buying you an additional couple of seconds to clear the room.  However, it takes about 4 seconds to switch between grenades and firearm, so keep your finger on the trigger and prepare to open fire! (Why not send flash grenades in before entering the room? see poimt 1)
  3. Identification: In order to minimise friendly or civilian casualties, it is vital to quickly identify your enemy. Tip: They’re wearing balaclavas and bandannas. Son, the U.S. Army has always prided itself on telling the difference between friend and enemy!

Self , , ,

Quick Org-Mode Hacks

February 25th, 2009

Recently , I’ve come to rely on Emacs for more or less everything I do on a computer. Of course, in work there are some exceptions: We must use Outlook for emails (the bulk), various windows only business tools (the cruft), etc.

But, as far as possible I will use Emacs because I love the simplicity, speed and extensibility.

In particular, I have discovered org-mode which has now taken over my personal scheduling routine. Org-mode is a personal planner for emacs which allows the user to: Create todo lists, schedule items for certain dates, mark items complete, use checklists, add tables. It’s impressive the amount of features this small, text-based operating system can offer.

So here’s some quickie hacks I’ve started working at for org mode. My wishlist is as follows:

  • [X] Store all org-mode schedules together
  • [X] Custom org save function (facilitating above)
  • [   ] Strip TODO/BUG/FIXME lines from source code and:
    • Store in org file called “<project name>”
    • insert links back to source file
    • add tags based on: language, filename, type

The third item is still in progress but I’ll explain my current org setup now and provide some expressions for the customisation:

;; Org Mode
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(setq org-log-done t) ;timestamp on completion

The first two lines create global keyboard shortcuts (key-bindings) which are available from anywhere within Emacs. ‘Ctrl-c l’ will store a link to a url or file, ‘Ctrl-c a’ will open your org-mode agenda (where you can view your calendar, appointments, todo items. This is the thing I have come to rely on :-) )

the add-to-list command tells Emacs to use org-mode by default for any file with a .org extension. the last line sets the org-log-done variable to true: This means that when we mark a todo item as complete it will be timestamped with the completion date. I like this feature.

So that’s just a bit of simple customisation. Now I’ll add a couple of functions that take care of saving my tasks.

(setq org-mode-file-dir "~/.emacs.d/org-files")
(setq org-agenda-files (append (list org-mode-file-dir)
org-agenda-files))

These two functions set variables telling emacs where to find org-mode files containing agenda items. The first is my own private directory added to behave as a default location for saving.

(defun smh-org-mode-save-buffer ()
(interactive)
(if (equal nil (buffer-filename))
(let ((input (read-from-minibuffer "Org Topic: " (buffer-name))))
(write-file (concat org-mode-file-dir input ".org")))
(save-buffer)))

Next I added a custom save function which simplifies the process of saving. If the current buffer is not already linked to a file (buffer-filename is nil) then it will prompt for an Org Topic. I like to think of organising things by topic. The default topic will be the name of the buffer if you supplied one previously. When a topic is given it will store the file as .org in the org-mode-file-dir. One the other hand, if the buffer is already linked to a file it will simple save as normal.

(add-hook 'org-mode-hook
(lambda () (define-key 'org-mode-map "\C-x\C-s"
'smh-org-mode-save-buffer)))

Finally I created a mode-specific key binding: I do this by adding a hook to org-mode… This means whenever org-mode gets called the hooked functions will also be evaluated. I have redefined the ‘save’ keystroke for org-mode to call my custom save function.

This is what I have so far and I find it quite helpful for organising Tasks and Todos manually.  My next step is to analyse source code and look for TODO, BUG or FIXME lines and create org-mode files automatically.

Programming , , , , , , ,

Emacs for Blogging

January 31st, 2009

This is a test post using weblogger.el for Aquamacs 1.6*. If it works
I’ll probably use it as my main offline blogging client.

Aquamacs is a Mac port of the popular multi-purpose program
Emacs. Emacs is used for many purposes such as tetris, email,
calendar and organiser…. There are even rumours that it can be used
for editing text!

Self, Software , , ,

Happy Birthday to GNU

December 13th, 2008

I almost missed this.  Here’s a video of a very smart chap (Stephen Fry) celebrating 25 years of Free Software.  In doing so he provides a clear and simple insight into the meaning and importance of freedom.

http://www.gnu.org/fry/

 

Self, Software , , ,

Clash: Common Lisp as Shell

October 23rd, 2008

I often feel a little sad that – being a child of the 80s – I will never have the chance to operate a Lisp Machine.  They were popular around the time that AI was the big buzzword in Computer Science, then they died out when that bubble burst.  Today the buzzwords are ‘Cloud Computing‘, ‘Virtualisation‘, ‘Agile Development‘ and all kinds of terms related to abstraction of services, infrastructure and development.  (The very things that Lisp offered.

As an homage to these archaic list processing behemoths, I have followed the instructions on clisp.cons.org for setting up Common Lisp as a login shell.  So far it’s looking surprisingly good.  It has the features of bash – for the most part – infused with the ability to directly evaluate lisp expressions and save the definitions out as you work.

The instructions on clisp.cons.org call for a lot of package compilation and dependency walking but if you are running a fairly recent debian or ubuntu system then you should be able to get up and running by installing the following packages through apt-get:  clisp clisp-dev cl-ffi libreadline5.

So – that’s the shell now running through Lisp.  Next step is to have a separate processor performing symbol tagging and type checking, hardware implementations of primitive lisp procedures, … etc! :-)

Powered by Qumana

Self, Software , , , , ,