Google Analytics
Friday, November 18, 2005
Tuesday, November 15, 2005
Goodbye Sony
I owned a Sony walkman. It was good. Sometime between then and now something went very wrong over at Sony.
To cut a long story short, Sony's music CDs intentionally infected people's computers. It opened up gaping security holes in the operating system (Macs too), let people cheat in online games, reported back to Sony the songs you were listening to and even got on Microsoft's bad side (of all companies!).
Why? To protect their copyright.
If that wasn't enough (and for any sane person it should be) it has been discovered that in the process of "protecting their copyright", Sony has violated another group's copyright! They used some software that is released under an open source license in their application, without complying with the (very liberal) conditions of its use. Essentially, they are hypocrites to boot.
I have a friend who has decided to boycott McDonalds, in order to do his part in not supporting evil corporations. Well, it's time for me to add Sony on to my black list.
Update: It seems Sony have officially apologised and released a list of affected titles. They are allowing people to replace their rootkitted CDs with normal ones too. It's great that they're doing this, but it only happened after the uproar became deafening -- they should have done it earlier.
To cut a long story short, Sony's music CDs intentionally infected people's computers. It opened up gaping security holes in the operating system (Macs too), let people cheat in online games, reported back to Sony the songs you were listening to and even got on Microsoft's bad side (of all companies!).
Why? To protect their copyright.
If that wasn't enough (and for any sane person it should be) it has been discovered that in the process of "protecting their copyright", Sony has violated another group's copyright! They used some software that is released under an open source license in their application, without complying with the (very liberal) conditions of its use. Essentially, they are hypocrites to boot.
I have a friend who has decided to boycott McDonalds, in order to do his part in not supporting evil corporations. Well, it's time for me to add Sony on to my black list.
Update: It seems Sony have officially apologised and released a list of affected titles. They are allowing people to replace their rootkitted CDs with normal ones too. It's great that they're doing this, but it only happened after the uproar became deafening -- they should have done it earlier.
Thursday, November 10, 2005
Resident Set Size in Mac OS X
A process lives in its own segment of virtual memory. Not all of this virtual memory is in RAM though. The 'bits' (typically called 'pages') that are in RAM make up what is known as the resident set size (RSS) of a process. As a process runs, the active parts need to be brought into RAM, becoming part of the RSS. Unused pages may be removed (discarded completely or written back to disk if they've changed from the on-disk copy). It's up to the operating system when to do this. Usually when the system is low on physical RAM the OS will start removing pages.
You can view the RSS of a process on most Unices (Linux, Mac OS X included) by bringing up a terminal and going
For my thesis I needed to write a program that did some stuff and reported its effective memory usage at the same time. I also had to get it to run on several operating systems. OS X posed quite a challenge as it has no
After a heck of a lot of digging I eventually found this and this and this, not to mention the source code for the
Here's the code:
And that should report the RSS and total VM size of the current process that invokes this code (in bytes). It's probably not perfect (it should have more error checking) but hopefully it will get me by.
You can view the RSS of a process on most Unices (Linux, Mac OS X included) by bringing up a terminal and going
ps -o pid,ucomm,rss (it will probably be given in kilobytes). Or, try the popular top program, which may report it under the heading of 'RES' or 'RSIZE'.For my thesis I needed to write a program that did some stuff and reported its effective memory usage at the same time. I also had to get it to run on several operating systems. OS X posed quite a challenge as it has no
/proc pseudo file system. I couldn't simply open a file and pull out the right number.After a heck of a lot of digging I eventually found this and this and this, not to mention the source code for the
ps utility itself (yay OpenDarwin). This got me pretty close, and took me forever. However, it wasn't until I found a document in Google's cache (that 404'd when I tried it) by Chaz McGarvey that I got over the line.Here's the code:
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <mach/task.h>
#include <mach/mach_init.h>
void getres(task_t task, unsigned int *rss, unsigned int *vs)
{
struct task_basic_info t_info;
mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
task_info(task, TASK_BASIC_INFO, (task_info_t)&t_info, &t_info_count);
*rss = t_info.resident_size;
*vs = t_info.virtual_size;
}
void memcheck()
{
unsigned int rss, vs, psize;
task_t task = MACH_PORT_NULL;
if (task_for_pid(current_task(), getpid(), &task) != KERN_SUCCESS)
abort();
getres(task, &rss, &vs);
psize = getpagesize();
fprintf(stderr, "RSS: %u KiB, VS: %u KiB.\n", rss, vs);
}
And that should report the RSS and total VM size of the current process that invokes this code (in bytes). It's probably not perfect (it should have more error checking) but hopefully it will get me by.
Wednesday, November 02, 2005
How to install the Luxi Mono font in TexShop
I've just spent way too much time trying to get this font installed. I wanted to install it as it was recommended by the Listings package (PDF) for LaTeX as the font to use if you wanted your code listings (a) in a monospace font (who wouldn't?) and (b) able to be in bold type (for highlighted keywords, etc.).
I found the LuxiMono package on CTAN, then tried to figure out how to install it for ages, then finally came across this post from the Mac-Tex mailing list describing the process for another font package.
The secret is putting everything in
Then the magic command is
To take advantage of the font, I just added
I hope this alleviates headaches for some others out there!
I found the LuxiMono package on CTAN, then tried to figure out how to install it for ages, then finally came across this post from the Mac-Tex mailing list describing the process for another font package.
The secret is putting everything in
~/Library/texmf/. I think it's just quickest to dump a tree listing of what I have there:.
|-- doc
| `-- fonts
| `-- luxi
| |-- LICENSE
| `-- luximono.txt
|-- dvips
| |-- config
| | `-- ul9.map
| `-- luxi
| `-- ul9.map
|-- fonts
| |-- afm
| | `-- public
| | `-- luxi
| | |-- ul9b8a.afm
| | |-- ul9bo8a.afm
| | |-- ul9r8a.afm
| | `-- ul9ro8a.afm
| |-- map
| | `-- vtex
| | `-- ul9.ali
| |-- tfm
| | `-- public
| | `-- luxi
| | |-- ul9b8a.tfm
| | |-- ul9b8c.tfm
| | |-- ul9b8r.tfm
| | |-- ul9b8t.tfm
| | |-- ul9bo8a.tfm
| | |-- ul9bo8c.tfm
| | |-- ul9bo8r.tfm
| | |-- ul9bo8t.tfm
| | |-- ul9r8a.tfm
| | |-- ul9r8c.tfm
| | |-- ul9r8r.tfm
| | |-- ul9r8t.tfm
| | |-- ul9ro8a.tfm
| | |-- ul9ro8c.tfm
| | |-- ul9ro8r.tfm
| | `-- ul9ro8t.tfm
| |-- type1
| | `-- public
| | `-- luxi
| | |-- ul9b8a.pfb
| | |-- ul9bo8a.pfb
| | |-- ul9r8a.pfb
| | `-- ul9ro8a.pfb
| `-- vf
| `-- public
| `-- luxi
| |-- ul9b8c.vf
| |-- ul9b8t.vf
| |-- ul9bo8c.vf
| |-- ul9bo8t.vf
| |-- ul9r8c.vf
| |-- ul9r8t.vf
| |-- ul9ro8c.vf
| `-- ul9ro8t.vf
`-- tex
|-- context
| `-- pdfsync4context.tex
|-- latex
| |-- luxi
| | |-- luximono.sty
| | |-- t1ul9.fd
| | `-- ts1ul9.fd
| `-- pdfsync.sty
`-- plain
`-- pdfsync.tex
26 directories, 43 files
Then the magic command is
sudo updmap --enable MixedMap ul9.map. You may need to be in the dvips/luxi dir to run that. Also, just in case you're getting confused, the .tex, .vf, .ali and .tfm files were either already there or auto-generated.To take advantage of the font, I just added
\usepackage[scaled]{luximono} to my LaTeX document, and it automatically became the default \tt font for it.I hope this alleviates headaches for some others out there!
Tuesday, October 25, 2005
WoW Adventures Volume MCXVII
So I've been leveling an alt, a dwarf warrior. I have to say, I used to think a warrior would be the most boring class -- but I'm finding it awesome! I love the idea of being the person in charge of making sure I'm the only one who gets hurt.
I played a number of Warsong Gulch games last night, which prompted this blog entry. I played about three or four games. Every time I played I topped the Alliance ladder, and around half the time I topped the combined ladder. Of course, the ladder ranks you by number of killing blows, which is not a true indication of everyone's contributions (boy did I recognise that when I PvP'd as a priest). We actually won one of our games as well -- which in my books is a huge achievement as the Horde generally dominate PvP. Especially WSG. Below are a few highlights:
When running over to the Horde base I saw a rogue off in the distance heading towards ours. As I got closer he stealthed. I took a guess at where he might be and tossed some dynamite there. He was barely in the blast radius, the damage he took causing him to unstealth. I charged him and it was all over shortly :)
I was involved in a side-skirmish one on one with a hunter in my base. His stupid pet was gnawing away at me but I ignored it. It was fairly evenly matched, yet as we both started getting low on health my hamstring debuff ran out on him (oops), so he wing clipped me and started to run off (his pet still drawing me closer to death). Realising a chase would eventually end in my death, I cocked my rifle and shot him in the back. He fell down face first into the ground, his pet disappearing. I was quite lucky as he still had 5% health. The shot barely killed him.
Both teams held each others flag. The Horde carrier was hiding somewhere unknown. At about the same time, someone found the Horde carrier (a rogue) but was by himself, losing the battle, and our flag carrier died, returning the Horde flag back to its base. The player who lost to the rogue was smart enough to notify us and click the map, indicating the hiding spot. Using tab selection I managed to find the rogue and take him out, returning our flag.
I proceeded back to the flag room and grabbed the returned Horde flag and started running back to our base. By then I had a few helpers with me, and it wasn't long before we ran into what seemed like the entire Horde team heading back just to kill me. There was an epic battle where I was running around like crazy, managing to take out people along with my friends, with a druid and priest managing to drop heals on me too! Eventually we thinned them down and I made a run for it, drinking a health potion to increase my chances. By the time I got back to the base our flag had been taken, so I had to camp. The druid stayed with me for a while, but then went off to help get a return.
It was tempting to drop concentration, but I kept at it (camping is hard because it's boring). Eventually a lone Horde rogue unstealthed behind me and started getting stuck into me. I immediately started running around him in circles so he wouldn't be able to see my back very well. He got my health down quite low but I took him out. I then requested some backup and the druid and a hunter came back for me.
Soon after our team managed to return our flag, but some horde were reading to grab it again! As soon as it was returned I ran a few metres to cap it, but there is a slight delay (as I discovered). I need to stand there for a few seconds before it will register as a cap. As I was standing there a Horde player ran through me and grabbed our flag right from under our nose! Reinforcements came in just in time to help us take him down, but another Horde grabbed the flag in the exact same fashion straight after! Eventually we got on top of things and I was able to make my first WSG cap!
We started that game losing 0-1 but came back to win 3-1. My cap was our number 2. The game was lengthy -- I think I got over 100 honourable kills in that one alone.
It's almost tempting to leave this character at level 19 just for low-level BG PvP purposes! Suffice to say, I have discovered warriors are fun.
I played a number of Warsong Gulch games last night, which prompted this blog entry. I played about three or four games. Every time I played I topped the Alliance ladder, and around half the time I topped the combined ladder. Of course, the ladder ranks you by number of killing blows, which is not a true indication of everyone's contributions (boy did I recognise that when I PvP'd as a priest). We actually won one of our games as well -- which in my books is a huge achievement as the Horde generally dominate PvP. Especially WSG. Below are a few highlights:
When running over to the Horde base I saw a rogue off in the distance heading towards ours. As I got closer he stealthed. I took a guess at where he might be and tossed some dynamite there. He was barely in the blast radius, the damage he took causing him to unstealth. I charged him and it was all over shortly :)
I was involved in a side-skirmish one on one with a hunter in my base. His stupid pet was gnawing away at me but I ignored it. It was fairly evenly matched, yet as we both started getting low on health my hamstring debuff ran out on him (oops), so he wing clipped me and started to run off (his pet still drawing me closer to death). Realising a chase would eventually end in my death, I cocked my rifle and shot him in the back. He fell down face first into the ground, his pet disappearing. I was quite lucky as he still had 5% health. The shot barely killed him.
Both teams held each others flag. The Horde carrier was hiding somewhere unknown. At about the same time, someone found the Horde carrier (a rogue) but was by himself, losing the battle, and our flag carrier died, returning the Horde flag back to its base. The player who lost to the rogue was smart enough to notify us and click the map, indicating the hiding spot. Using tab selection I managed to find the rogue and take him out, returning our flag.
I proceeded back to the flag room and grabbed the returned Horde flag and started running back to our base. By then I had a few helpers with me, and it wasn't long before we ran into what seemed like the entire Horde team heading back just to kill me. There was an epic battle where I was running around like crazy, managing to take out people along with my friends, with a druid and priest managing to drop heals on me too! Eventually we thinned them down and I made a run for it, drinking a health potion to increase my chances. By the time I got back to the base our flag had been taken, so I had to camp. The druid stayed with me for a while, but then went off to help get a return.
It was tempting to drop concentration, but I kept at it (camping is hard because it's boring). Eventually a lone Horde rogue unstealthed behind me and started getting stuck into me. I immediately started running around him in circles so he wouldn't be able to see my back very well. He got my health down quite low but I took him out. I then requested some backup and the druid and a hunter came back for me.
Soon after our team managed to return our flag, but some horde were reading to grab it again! As soon as it was returned I ran a few metres to cap it, but there is a slight delay (as I discovered). I need to stand there for a few seconds before it will register as a cap. As I was standing there a Horde player ran through me and grabbed our flag right from under our nose! Reinforcements came in just in time to help us take him down, but another Horde grabbed the flag in the exact same fashion straight after! Eventually we got on top of things and I was able to make my first WSG cap!
We started that game losing 0-1 but came back to win 3-1. My cap was our number 2. The game was lengthy -- I think I got over 100 honourable kills in that one alone.
It's almost tempting to leave this character at level 19 just for low-level BG PvP purposes! Suffice to say, I have discovered warriors are fun.
Monday, October 24, 2005
You know you're good when...
| You Passed 8th Grade Math |
Congratulations, you got 9/10 correct! |
9/10??!?!
Thursday, October 20, 2005
I am teh Yoda!
Yay!
In other news, I've been enjoying and participating in Pete's Why Don't You Blog About It? site.
Subscribe to:
Posts (Atom)