I hope it’s not, like, a trademark of Nintendo or something

June 20th, 2008

Current project: Picross in Ruby, using Korundum and such. Which is so much better than using C++ directly. <3

However, note to me and anyone else using it: Qt::MainWindow#central_widget= doesn’t work. You have to use #setCentralWidget or #set_central_widget, or whatever, otherwise it’ll overlap with the other parts of the window like the menu bar and so on. Knowing this in advance would’ve saved about an hour of futile debugging. :( (Obviously this goes for KDE::MainWindow and KDE::XmlGuiWindow as well.)

On the other hand, the fact that it automatically translates ruby_style_identifiers to qtStyleIdentifiers is pretty cool, even though I suppose in the grand scheme of things it’s about as important as bracketing styles…

Update: some screenshots to show what I mean.

set_central_widget central_widget=
Right Wrong
Good Arg

Consecuan stuff, again

May 17th, 2008

First things first:

cósecúre-jen-i      rónata-sa       tese        reti-waicőmai
consecuar-lang-INS  write\IRR-PSV   seemingly   more-heavy
What is written in Consecuan sounds more important.

The height of wit, I know. (New grammar point, though: seþ and seis, i.e. ‘it’, are often left out, as they are here.)

For some reason I’ve got another urge to make some damn languages (though I’m sure it’ll be gone by tomorrow), and since its wiki page just stops in the middle of a section, Consecuan is as good a candidate as any. (Also, I have a few ideas, which I find helps.)

The main problem I have is the same as everyone, I imagine: not enough words. It takes a surprising amount of effort to come up with something that doesn’t sound absolutely retarded (though maybe that part’s just me), so I get like three words in and just give up. (A word generator is cheating, and at any rate it’d be far more effort than it’s worth to come up with one that gives good results. Still, it could be interesting I suppose?)

So yeah. I’m probably not going to actually make many Consecuan-related posts here, since that’s what the wiki’s for, but I just felt like mentioning it.

Edit: the wiki actually has some sort of a logo now (as does here). Let’s see if anyone notices. (I already know that answer to that, but still.)

xorg.conf

May 17th, 2008

No-content post ahoy!

No-one wants to see my xorg.conf, I know, but it took me forever to track down the right things for my touchpad. Damn thing doesn’t support multitouch though :(

(Also, man synaptics is useful.)

Read the rest of this entry »

Now I want Qt 4.4 even more

May 7th, 2008

This is why Qt is the best toolkit ever. Shame the Kubuntu repos still only have 4.3. (I know I could update it myself, but that will invariably prove to be a pain in the bum somewhere down the line.)

For some reason I never really connected MapReduce with futures in my mind until just now, but yes. Everyone knows the real name for reduce is foldl, though. :v

Vim can, it seems, do everything

May 2nd, 2008

Since the computer labs didn’t have LyX installed, I’m writing my CS essays (one of which is due today…) in Vim. Someone in SH/SC or the CoC or somewhere mentioned a few things which would make it less painful (setting linebreak and nolist, mapping up/down to gk/gj, and so on), and of course, spell checking.

I thought spell checking would be terrible, it would try to ‘correct’ all the markup, and finding dictionaries would be a pain. But as always Vim knows what it’s doing. Only text with no other highlighting is checked, and to get a dictionary you just have to do

:mksp <output file> /usr/share/dict/words.

Put the resultant .spl file in ~/.vim/spell and all is well.

In conclusion: if you think Vim can’t do something, you’re wrong. (Well, except for diagnosing mental disorders.)

Dialog box of the day

April 15th, 2008

PS. No GSoC for me this year. :effort:

GSoC

March 20th, 2008

The deadline for GSoC applications is fast approaching. I’d totally forgotten about it until the obligatory CoC thread, so I hadn’t given it the slightest bit of thought until the last couple of days.

Now that I remember it exists though, I really want to enter. Despite my recent, um, problems with anything resembling writing a program, and the fact that to date I have not written a single program exceeding about five hundred lines. I have to start somewhere, I suppose? A GUI for darcs, written in Haskell, is probably not the best place, though. But it would be fun!

Pros

  • Something to do
  • Might actually *gasp* do something useful
  • Helping darcs
  • CV++
  • Money :v

Cons

  • Difficult
  • Requires attention span
  • Takes time
  • Hindering darcs with half-arsed contributions

So, will I apply? Ideally I’d say I’ll consider it. Really though, inertia means I probably won’t. Maybe next year.

edit: Obviously I don’t absolutely positively have to do a darcs GUI. It’s just something that caught my eye. Also Boost.SafeInt, which looks pretty easy, but if it’s as easy as it looks to me then someone with actual C++ knowledge would’ve done it in about an afternoon, so it’s probably not.

“Programming-language related pun” print

March 6th, 2008

Factor is a fun language. It’s postfix, making your code look like mirror-image LISP (or, RPN, which of course is what it is), and for the most part, all the data (and functions, etc) are all on a single stack at once.

An example, which finds the answer to Project Euler problem 5:

USING: math kernel math.ranges sequences ;
 
: gcd ( x y -- z ) dup 0 = [ drop ] [ swap over mod gcd ] if ;
 
: lcm ( x y -- z ) 2dup gcd / * ;
 
: answer ( -- n ) 2 20 [a,b] 1 [ lcm ] reduce ;

Take the gcd function. It looks at the top of the stack, and if it’s equal to zero, deletes it. We have to duplicate it before checking, because = (and < and friends) replace the top two elements with t/f, and we may want to keep it around. If it’s not equal to zero, we swap the top elements, copy the second one over to the top, find the modulus of the top two, and recurse. So it’s basically the Euclidean algorithm in RPN.

Isn’t it funny-looking? The spaces around the brackets and (semi)colons are necessary; the tokens are separated by whitespace but otherwise can contain any character. Like in the above, [a,b] is all one word, a function which makes a range (or interval if you use the one in math.intervals, of course) from the top two stack elements.

For bonus points, it supports functional programming; the blobs in square brackets are ‘quotations’, which are just pushed on the stack as they are to maybe be called later. We need to do this for if, because only one of them is ever used. Similarly for while the quotations (one for the condition, one for the body) are called repeatedly.

A pity my syntax highlighting doesn’t support it. :(

edit: Euclidean algorithm fixed.

Site woes

February 19th, 2008

For some reason, my host’s MySQL server keeps dying recently.

Also, index.php had the wrong permissions until just now which stopped it from being displayed. Which was strange.

edit: umask! :fist:

…Did I even mention it in the first place?

February 12th, 2008

I’m certain no-one cares, but, KScrapbook is now as abandoned as Fotobilder is. I should have noticed this with the LiveJournal/Photobucket integration, to be honest. Anyway, I didn’t really see the point in continuing.

In fairness, Fotobilder’s not really abandoned as much as just being folded into LiveJournal. But if they can’t be bothered to update their documentation, well, I’m a bit stuck either way.