Wednesday, October 31, 2007

Of love, life, and linux.

So I hear w00t about Gill [1] and not being ambiguous and not running away.

It seems that I have been struck by the "more girlfriend implies less
blogging" syndrome. I was thinking I could avoid it, but evidently not. There
has even been loads of stuff that I have thought "I should write about that".
I would also like to spew my feelings on here, but I suspect that some people
might have objections to that.

I really need an economist/machine learning specialist to help me build a
model of love based on utility/expected reward. So far, I have
Utility(him) = Utility_0(him) + love(her) * Utility(her)
Utility(her) = Utility_0(her) + love(him) * Utility(him)

So if love(him) = love(her) = love (a constant) then how large does it need to
be for Utility(him) to double? Also, should there also be a "time spent
together" factor in there, and what form should it take?


I've been stupidly busy recently. Probably my own fault for being so
lazy/distracted on the weekend/before. I'm gonna get screwed tomorrow for not
handing in work, and the next day (though I was able to do surprisingly much
of the risk paper in the half hour I thought I had)


In Linux news, we now have a JCR computer, for use with hermes. If you want an
account for more than that, please put something tasty in my (or Rob's)
pigeonhole. Also, if you know a good method for providing authorization
from /etc/shadow to kerberos or radius, please let us know. It would be good
to let all srcf users have un-restricted access onto the system. We'll see
what happens.


For Kopete users: a nice little hack: in the alias plugin, assign
"idle" to "exec dcop kopete KopeteIface setAutoAway"
Now you can type /idle to immediately go "away" until you next move the mouse.
Useful for adding finality to conversations without fucking up your status
for when you actually return.

[1] wget

http://alsuren.blogspot.com/2007/05/dancingthe-fateful-post.html

-o - |
sed -e s/Jill/Gill/

Friday, October 26, 2007

Organization

It seems I win at failing at organization.

*may have frantically started doing supervision work 10110* minutes before my
risk supervsion.*

*and no, that's not binary.

Tuesday, October 23, 2007

In other news:

Squee: I have my bike back! Fankoo mummum and daddums!

The Cambridge Lindy Exchange was really good, and I am thoroughly shattered.
Also, Cycling back from the speakeasy with just a sweaty t-shirt on is
probably not wise. I will go to the shops at some point and get lots of fruit
to ward off the customary "I've just been dancing with half of about 80
people from around the world" pestilence.

Sucks to be Stu, who managed to get diseased before they even *arrived*.

Reliable contact methods.

It would appear that email is the best way to contact me. My phone was having
a strop from about sunday morning until now, so attempts to organise meetings
etc. may have failed. *blush*

To contrast, I have checked my email about 10 times in that period, and my
computer has checked many more times, just to make sure that nothing was
missed, and so that it could quickly give me an error message if the system
failed for any reason.

Thursday, October 11, 2007

Performance Dancing

When I was in London, Sally asked me whether I would join a performance
troupe, so when I came back to cambs, I told the guys about it, and asked
them (very vaguely) whether it was a good idea. They said yeah...

Then on [last] wed, I went to the intermediates, and was completely dead. I
wasn't leading properly, and I was thinking way too much. Katherine also
reminded me that I was still yanking rather than body leading swing-outs.
Also, I should probably make the effort to get the breaks/half-breaks in the
shimsham. All in all, I really don't feel ready for performance dancing.

On the other hand, There are so many things that I keep getting told that I'm
doing badly, and I see really obviously when I see pictures of myself
dancing. Maybe joining a dance troupe would would provide the explicit
invitation for people to try to help me sort out those things. I think I
would also benefit from seeing a video of myself, and correcting my own
mistakes.

I think I will try to get at least one private lesson before the end of term.
I should ask Matt and Lotte about what's possible though.

I will tag the relevant people in the facebook copy of this when the lindy
exchange is over, and they're a little less busy. I would like to see
people's comments on this. What should I do?

Wednesday, October 10, 2007

To all you yucky competition dancers.

I say that "Jack and Jill"s are the only competitions that have the right to
call themselves partner dance competitions. All others should be called
paired solo/performance dance competitions.

http://en.wikipedia.org/wiki/Jack_and_Jill_(dance)

Example:
http://www.lindylibrary.com/main/ultimate-lindy-hop-showdown-2006/ulhs2006-jack-jill-finals-competitio.html

Wednesday, October 03, 2007

Synchronisation

I have spent *hours* messing about with my phone, trying to make it import my
calendar. It seems that the solution is actually really simple. The reason it
took so long to find is that it doesn't involve using any of the linux
calendar synchronization utilities.

1) Create an account on http://www.scheduleworld.com/
2) install the funambol client for windows mobile on your device
3) sync mobile device
4) export an ical from linux
5) import ical into scheduleworld
6) sync mobile device

The *really stupid* thing is that all of the above is done using open source
software, and yet there is no solution on linux which will let me sync with
scheduleworld. Let's hope this improves for KDE4.

Wednesday, September 19, 2007

Impromptu Holiday.

Seems I'm in Norfolk with Dad.

Anyone want me to visit them on my way back to London?

Saturday, September 15, 2007

[status update] Menu System

= The Good =
+ entries are sorted by title (A=black, Z=white, and layed out in a
predictable position.)
+ It works as an application launcher, or as a web-based links page
+ You can try it yourself:
Web: http://www.srcf.ucam.org/~dl325/python/links/links.py?username=YOUR_NAME
Desktop:
$ sudo aptitude install git-core pyqt4-dev-tools libqt4-dev qt4-designer python-xdg xdg-utils python-sqlite kdebase-bin
$ git clone http://www.srcf.ucam.org/~dl325/python/links/.git/
$ python qsmenu.py

= The Bad =
- Currently, it just picks the first menu entry it finds for each program, and
doesn't prefer working/svg icons over broken/pixelated ones
- It needs a name! Post ideas here:

https://www.blogger.com/comment.g?blogID=6107001&postID=663834070309131498

= The Future =
+ I reckon my menu system could be adapted to work with file menus as well
(create a DataEngine that understands KDE's XMLGUI crap). That would be
hardcore (and *better* than MS Office's ribbon, with less manual work).
+ Add an info panel at the bottom, for more verbose info on entries.
+ Make a data engine with a[n incremental] search function that modifies the
scores.
+ Add sub-folders to the menu, which cause the entries within to stand out.
+ Experiment with regions that contain other regions
+ Experiment with highlighting to show newly available/last used entries.
+ Make the data engine thread-safe, and event-driven.
+ Port to Plasma for KDE4

= The Inner workings =
There are 3 components:
* Data Engine
* Layout Engine
* Rendering Engine

The Data Engine is responsible for collecting and ordering data, and assigning
scores. It is also responsible for compiling the data into a 1-D list of
entries.
The Layout Engine takes the 1-D list of entries, and maps each entry into a
region (of one or more squares on a 2-D space). It passes this data to the
rendering engine by calling draw_square() repeatedly. It also calculates the
center of the region, using a bit of GCSE maths.
The Rendering Engine deals with the user interface crap. It draws the squares,
and deals with clicks by sending them to the data engine.

The layout algorithm is a case of "cut parent square into 4 children, and
repeat until there is only 1 entry in each child square, then paint."
The sub-dividing and checking for entries is done in 1-D rather than 2-D, so
it's pretty fast.
The slow bit is the rendering, which is done using C libraries anyway :D.

= "But how do you make it look so pretty?" =
I fudge it. I leave a gap with no information in it. That way, "there is only
1 entry in the child square" happens after only a few sub-divisions. This is
something that I stumbled upon by accident, when I fed it some bad input
data.


To give you an idea of how nasty it *could* look, this is a picture drawn with
the gaps as normal:
< http://www.srcf.ucam.org/~dl325/python/links/map_DTsoSj.png >
and this is the picture with
< http://www.srcf.ucam.org/~dl325/python/links/map_EJjvka.png >
brown=fudge (I decided on fudge_factor rather than blur, as that's what it is)
lines are drawn in the brown by sub-dividing, to create the simplest possible
regions (ie ones with the largest/fewest squares).

[HELP!] Menu System (Name ideas?)

I'm sure you've all seen my posts about the menu/links system I'm developing.
< http://www.srcf.ucam.org/~dl325/python/links/links.py?username=YOUR_NAME >
It's all going well (update post to come shortly) but I *NEED A NAME*.

Whoever comes up with the best name will win brownie[ point]s, and a mention
in the docs.

Click "Add a Comment" now for your chance to win!

Sunday, September 09, 2007

Back to life

Turns out it was just the power supply, and I *think* it's just the input
module. I have bought a new one from PC world, but it's shit (doesn't live up
to the claims made in the manual), so I'm going to try fixing my Asus one
when I get back to cambridge. *cradles his dead asus power supply tenderly*

I told some girl I would add her on facebook on Thursday night. I should
probably do that, shouldn't I?

Friday, September 07, 2007

More Problems

I *may* have exploded my computer.

It went bang.

Thursday, September 06, 2007

Fan Problems

It's been pissing me off for way too long, so I'm getting a new fan for my graphics card (and maybe my CPU) before I next turn on my computer. Dunno how long that will take.

As a happy coincidence, I may also be able to get my daily routine sorted out, and stop coding at 2 in the morning.

Wednesday, September 05, 2007

Cool Interactiveness (OMGZ)

I have created a menu system, inspired by:
- xkcd's hilbert curve
-- http://xkcd.com/195/
- Dasher
--http://www.inference.phy.cam.ac.uk/dasher/

--http://en.wikipedia.org/wiki/Dasher
- KDE's QuickLaunch toolbar ("Most Popular Application" mode)
-- help:/kicker/launcher-applet.html (not documented)

It can be found at:
http://www.srcf.ucam.org/~dl325/python/links/links.py?username=YOUR_NAME

Each time you click on a link, it will become bigger, but everything will stay
in *roughly* the same place. Check it out for yourself. You can add and
remove links using the link in the top right corner (though the interface
need a bit of polishing). Please do, because I would love to see what it
looks like once a few people have been using it for a while.

Replace YOUR_NAME with something memorable, and you will automatically get a
new account, with all of the links imported from everyone else.

I will post more updates as I develop more. If someone wants to turn it into a
plasma applet, or a start menu, get in touch. Also, if someone knows how to
use CGI or SQL properly, *HELP ME!*, because my code is a complete mess.

Wednesday, August 29, 2007

late nights

Oh god: It would appear that I have stayed up until 2:00 reading

http://en.wikipedia.org/wiki/C++0x
as far as

http://en.wikipedia.org/wiki/C++0x#C.2B.2B_standard_library_extension
(std::tr1, which I already know about)

While I know this is quite tragic, a few things have come from it:

function add = <>(x,y) -> int {x+y}

It seems that C++09 is getting pretty much *all* of the cool/useful features
of python (with the possible exceptions of list comprehensions and nested
scopes, which might be possible to implement with some hackery). It remains
statically typed, but you no longer have to be explicit, and you can do duck
typing using 'concept's.

Maybe I will take the time to write a few things using tr1, to get back in
practice. *slightly tempted to try writing a boo/python/rpython compiler that
will output to C++09*

Friday, August 24, 2007

CupsAndString released. Now what to do?

Okay, so I have released the first version of cupsandstring
<https://launchpad.net/cupsandstring/>. I have a few things I could do now:

a) Create a Skype connection manager
b) Clean up the telepathy-python bindings
c) Try porting to windows
d) Start work on that package manager idea of alexreg's (a set of MSI packages
with deb-like dependencies, but which can install themselves on windows,
where there isn't necessarily a package manager already installed.)

The idea that excites me most is the skype one. I would love to see what kinds
of hacks people come out with if I manage to get voice and video working on
that. Doesn't seem too hard either: http://skype4py.sourceforge.net/

Friday, August 17, 2007

Virtual Desktops

For those of you on Windows: [context] Linux and Mac OSX give you "virtual
desktops", which are like multiple virtual screens that you can switch
between. Each one has its own task bar, so it gives you more flexibility to
manage your windows.[/context]

I have found that having 4 virtual desktops isn't enough for me. I now have 5.
I still have about 3 things in each task bar

I think it's kind-of since I started using Boa-Constructor. Boa takes a whole
desktop of its own, because it needs a debugger window, editor, and shell
window, and some toolbar window at the top that I've never used, but which
can't be closed without closing the whole thing.

I have also started doing a lot of development using a different user for
developing each project, and another for testing, and I find that it helps to
keep each account on its own desktop.[context]Linux (and Mac, I think) allow
multiple users *using* the same machine *at the same time*. This is illegal
on Windows.[/context]

This trend towards increasing numbers of virtual desktops is interesting,
because when I started using linux (SuSE) it only had 2 by default, (this was
enough because I only had 128MB of RAM, so having too many programs open
slowed down my computer). I wonder when I will get to 6, or even 12. When I
start using Virtual Machines, and want a new VD for each VM?

Friday, August 10, 2007

New keyboard

I went out yesterday and got a microsoft ergonomic keyboard. It's interesting
having a split down the middle of the keyboard, because I often use b with my
right hand, and y with my left. I'm not such a fan of the ridiculously long
enter key, because it takes a bit of effort to press until you get used to
it.

There are a few keys that don't generate events ("zoom", which is a rocker
button along the center of the keyboard, the "customizable" buttons 1-5
and "My Favorites" along the top, and the "spell" button that shares the f10
button (which I plan never to use, as it requires the function keys to be
disabled))

I am really quite fond of how they've put '=', '(', and ')' in the space just
above the numpad. Shame I hardly ever use the numpad... and shame the bracket
symbols don't produce X events :P

I've also noticed something quite good about the linux/kde way of doing
things: you can use ctrl to modify the actions of even non-standard keyboard
keys, so in amarok: next track=ctrl+volumeup, previous=ctrl+volumedown.

One thing I'm not too fond of is how you can only have two shortcuts assigned
to each action, and there are programs *coughAmarokcough* that have actions
that can be mapped to global shortcuts, but not normal shortcuts.

Tuesday, August 07, 2007

Progress Report (summary of the things that interest me)

This

Please comment if there's something in here that looks interesting, or you
want more info on. This is a list of the projects that I am
currently/previously working on, organized by progress. Entries take the
form:

Project name(description):
tasks completed
tasks still to do

cupsandstring.pymsn(text-based msn in <128 lines of python):
works (can send/receive chats, and view a list of online users)
shorten to <128 lines, convert to GNU readline to allow tab completion

cupsandstring.telepathy(text-based multi-protocol in 256 lines):
can list contacts sometimes.
remove references to pymsn. Add incoming/outgoing chats

telepathy-butterfly (connection manager to support cupsandstring):
written a few patches
still keeps doing odd stuff to me, making cupsandstring hard

Windows Vista under QEMU(for development of kde/telepathy under windows):
see previous post (STOP:)
wait for new version of QEMU to officially support it

Windows XP under Qemu:
works, but is unreadable
get a *legal* version which isn't in spanish or portugese

telepathy-tick(DBus: com.Skype.API based telepathy connectionmanager):
not started. the com.Skype.API protocol is well documented though.
start with text chat and presence, then look at concurrent accounts

Left and Right handed mice (so that each hand is using the mouse naturally):
own two appropriate mice
work out how to identify mice *reliably* using evdev in xorg.conf

TheBus(a simplified dbus interface):
discontinued (after I realised how much of a nasty hack it was)
try adding features to existing dbus bindings. see about a pure python lib

Multi-PointerX (multiple people on the same computer at the same time :D ):
got it working a while ago. A lot has happened upstream since then
not tried recently. Doesn't work with nvidia driver. git is a bitch.

KDE4 (once again, just trying it out for now):
works quite well. Even kopete has started compiling and looks swish :D
check up on it periodically. Eventually start hacking telepathy into apps.

Windows package manager (like apt for .msi files rather than .debs)
Not started: Relies on me getting windows working in a vm.

Feedback/questions welcome. We love questions.

Friday, August 03, 2007

Craftsmanship in Consumerism

I have just finished reading The Culture of the New Capitalism (Richard
Sennett) and there is a section dealing with craftsmanship, and pride in
quality. There is also a chapter on consumers, and the way we are taught to
crave new things, and then not value them anymore once we have them. When
evaluating what to buy, we need to make decisions even though we often have
very limited knowledge of the production of the item. So what rules should we
use when deciding which items to buy?

One way to approach the problem is "How would I design this item?". My friends
will be able to pre-empt my answer: "unix", but when is this valid?

"Simplicity of implementation is more desirable than simplicity of interface."
This goes directly against the modern consumer's way of thinking: "If I can
buy something that is easier to use, why should I reject it because it is
more complicated to make? Let me give a few examples:
"Serrated knives vs straight bladed knives"
Serrated knives are often slightly more effective at cutting when they are
first bought, but have you ever tried sharpening one? I would go for a
straight knife, and buy a knife sharpener. It is possible to get a
microscopically serrated knife with just a single stroke of a knife
sharpener.
"Manual doors vs Automatic doors"
When I was in america, they had some busses with pneumatic doors, and some
that the driver had to operate by hand using a simple lever. The busses all
looked about the same age, and the doors on many of them were failing. The
difference was that the failing pneumatic doors were deathly slow, because
the driver pushed a button and waited. The manual doors were often just as
slow to close, in the wrong hands, because they often closed with the wrong
door on the outside, but the more experienced drivers could get them to open
and close in maybe a tenth the time of the pneumatic ones.

So when is it beneficial to pick the unix design in these cases?
"When people will be working with it for a long time". The reason being that a
complicated interface can be learnt over time, while a complicated
implementation will often get warn out, and be very difficult to fix.
Annoyingly, a commercially successful product must aim for the opposite
ideal.

In the case of products like the bus door, the products last longer because
the operator has more subtle control over them, and can optimise them to make
them work better for longer. I could sharpen a knife so that it could saw
through meat, or I could sharpen it to give me a nice fine shave. I enjoy
that kind of thing. I think that learning subtle control of simple tools like
that could be automatically done by machines in the near future. Obviously,
it will be the electronic tools that get tuned first, and I can't wait for
zigbee devices to come out and for standards to emerge to enable remote
controlled machine learning systems.


Footnote:
Those who know me will know that I have a long history of being dreadful at
buying clothing: it takes me ages, and I often buy items that I quickly tire
of. This is mainly because I don't have much practice: I buy new clothes very
rarely.

I'm sure I could have phrased this better...