söndag 23 november 2008

Build components

After a weekend of work, I finally got myself a build component that I'm semi-pleased with, for C and C++ projects, using Subversion. Most likely works for any other lower level programming language as well.

First off, structure. Each component is it's own BTT(Branches, Tags, Trunk)-root, residing in a Project_Modules directory in subversion. Each component contains an inc, src, test and a stubs directory. Rationale for the BTT-root is that, with a separate BTT-root for each component we can raise the version of each separate component without having to raise it for the entire project.

The Project directory resides on the same level as Project_Modules, and is empty, only containing the subversion property externals pointing to the trunks of the Components in Project_Modules. Rationale for this is to have a simple place to checkout the entire project. It's a bit dangerous when working with branches, and requires a little bit extra care so one doesnt write into the trunk out of mistake. Possibly block everyone but a specific user to write in the trunks and have that CM person do all the branching/merging. It is time consuming however.

It looks something like this:
  • Project_Modules
    • Component1
      • inc
      • src
      • test
      • stubs
    • Component2
      • inc
      • src
      • test
      • stubs
  • Project
Inc directory is the public interface of the component towards the other components. Src directory contains the actual code of the component. Test contains unit tests (personally, i create a new directory for each new unit test file). Stubs contains the stubs of my own component. Ie, Component1/stubs will contain stubs for the functions in Component1. Rationale being that 95% of the time, we want to stub another component in the same way, instead of keeping stubs of a component in 10 different components, we keep it in one place.

lördag 22 november 2008

Criminalized generation

So, IPRED is coming to this country, Swedens government is forcing it into effect. Even though there has been quite heavy resistance and a lot of people don't like it. I agree. It's a complete nutjob of a law. Before moving on, let me state that I am here discussing the Swedish implementation of the law. This is even further going than the original EU directive COM(2006)0168. The best part is, they just "softened it". Ie, it was even worse from the beginning.

As has already been said by thousands of others, but it can't be said enough times. The law moves the burden of the police work from the (almost) objective police to the absolutely partial owners themself. Let's consider this: We have for centuries had a police force because they are objective. They deal with criminals and they should hopefully not take sides for either part in a case, it's left to the court to do this.

With IPRED, the entire burden of investigating a crime is moved to the plaintiff. The plaintiff (in this case, the intellectual property owner) or someone working for the plaintiff, finds someone downloading a piece that they "own". They then move on to demanding the name and contact information of that person from the Internet Service Provider (ISP) of the Internet address of that specific downloader. Current law does not tell the ISP that it has to comply with the demand. IPRED does. The plaintiff can now move on to the next step below.

The plaintiff are then free to send monetary demands to the "defender", who will find out about the problem with the monetary demand. The monetary demand is formed as "pay us money or we draw you in front of a court and you will loose a lot more". Basically, you will have a gigantic mass of people just paying out of freight "who knows, maybe my kids/spouse/visitor did download that song on my computer?". Or how about framing someone you don't like, it's not gonna be hard, trust me. Don't like your neighbour, go download a free program and hack him, then set up a bittorrent client to keep downloading/uploading from their computer.

Now, this is the basic argument people have against this new law. Unfortunately, it has been cobbled together by retards and rather IQ-free people and been compromised by to such a degree that it's no longer coherent. One of the sideeffects of this law is that it will become illegal to buy an application or download a open source application and then run on your own computer. The same plaintiff above could sue every single owner of a Microsoft Windows Vista license (for example) if they can find a instance where Vista steps on their patent.

This comes to mind, when one reads IPRED:

When the Nazis came for the communists,
I remained silent;
I was not a communist.
When they locked up the social democrats,
I remained silent;
I was not a social democrat.
When they came for the trade unionists,
I did not speak out;
I was not a trade unionist.
When they came for the Jews,
I remained silent;
I was not a Jew.
When they came for me,
there was no one left to speak out.

onsdag 29 oktober 2008

"New" subversion structure using svn:externals

Me and the boss deviced a new structure for the project during the last few weeks, and it's been slowly refining in our heads until yesterday when we finally implemented it. I think we made a rather refined and complex structure, but once we got it into place physically and once we get the general idea into the developers heads (including me), I think it will prove very powerful.

That being said, I don't think this is a new structure, I just think people are very quiet about how they use subversion, and it's a problem. Newcomers do the same old errors over and over again. So, let's get on to try and explain it all.

Most projects uses a single BTT root, where BTT stands for Branches, Tags and Trunk. Ie, they start a project, and then straight in the root put the BTT, and then inside that, they create the project structure. For example:
  • project-root/
    • Branches
    • Tags
    • Trunk
      • admin
      • src
      • out
      • test
This is a good basic structure for very small projects, containing perhaps 10'ish files, or where the actual implementation is perfectly homogenous and has no need for separated versioning. Every time we want to make a release, we cheap copy the content to Tags as a new tag (called perhaps /Tags/Milestone1-RC1). We now have a release that we can provide to people.

The problem comes if it isn't so homogenous. For example, let's say you are developing a calculator. It has two objects, a numpad and a display. What if you want to make a new version just of the display? You need to make a completely new version, including for the numpad.
Or how about wanting to branch just a small part of the project? Ie, I want to use a branch for the numpad, and then use the trunk for the display. You'd then have to make a cheap copy for the entire tree. Admittedly, it isn't costing too much.

Our "new" structure deals with this on a different level. Basically, the idea is to have multiple BTT roots, and then use svn:externals to connect the correct tags to create
1) a complete releasable project and
2) a complete workarea project.

For the calculator example, you get the following structure:
  • calculator/
    • Calculator_Modules/
      • Display/
        • Branches/
        • Tags/
        • Trunk/
      • Numpad/
        • Branches/
        • Tags/
        • Trunk/
    • Calculator/
      • Branches/
      • Tags/
      • Trunk/
As you can see, it looks much more complex, and it is, but the possibilities are infinitely much better.

The Calculator/Trunk/ directory contains a svn:externals property linking in the Calculator_Modules/Display/Trunk as Display and Calculator_Modules/Numpad/Trunk as Numpad. This works by linking external resources into the current directory structure, so basically I would get the trunks into my Calculator trunk, but properly renamed, without them actually being there in the repository. This also works on "real externals" by the way, such as linking in a specific version of a library from some repository on the Internet.

To create a Calculator/Tags/MS1 we could either just set a -rXX to the correct subversion revision, or we would create svn:externals to the correct Display and Numpad Tags, not their trunk. This way, we can say that "Calculator 1.0 contains Display 2.0 and Numpad 2.1", not "Calculator 1.0 contains Display revision 439 and Numpad revision 587", or even worse "Calculator 1.0 is revision 587" which completely lacks granularity.

I'm not completely sure it's perfect, and others have probably already tested it, but I think it will be pretty sweet :-).

tisdag 28 oktober 2008

Mednafen configuration for Logitech Precision

As I've already stated partially, I got an HTPC at home running MythTV on ubuntu. One of the things I've wanted to do for a long time was to get some games running on it. Supertuxkart was simple and was installed in less than 3-4 minutes once I understood the basics of the MythGames plugin (typing with a on-screen keyboard and a remote control is slow).

Anyways, I did have some problems getting a NES emulator, or any emulator at all as a matter of fact, running on it, and I also had some problems getting input from the right devices to them properly. I finally decided on mednafen as it seemed the easiest to understand.

Let's understand the structure. NES and other games are usually downloaded in some image file. Mednafen is installed as a binary. MythGames needs to know about the binary used to launch a NES image, and where the NES images are located. I downloaded mednafen using apt-get install mednafen. Secondly, MythGames needs to know where you will put the images, personally I put them in /var/games/nes/. This is entered into the mythtv configuration using the Setup -> Game Settings -> Game Players. Choose New Game Player and enter

Player name: mednafen (for example)
Type: Other
command: mednafen -nes.stretch 1 -fs 1 -vdriver 0 %s
Rom Path: /var/games/nes

Having a keyboard around when doing this is prefered, using the on-screen keyboard takes ages.

Once this is done, go to Setup -> Game Settings -> Scan for games. This will scan the /var/games/nes directory for all images and add them to the list. To start a game, go to Games. Then get into the "All Games" -> "mednafen" and you should find all the games from /var/games/nes there.

Click one, and the game should hopefully start. The first time mednafen is run, it creates a directory ~/.mednafen/ containing a basic configuration. The following is an example to get my Logitech Precision gamepad running with it:

nes.input.port1.gamepad.a joystick 42190af389429475 00000002
nes.input.port1.gamepad.rapid_a joystick 42190af389429475 00000003
nes.input.port1.gamepad.b joystick 42190af389429475 00000000
nes.input.port1.gamepad.rapid_b joystick 42190af389429475 00000001
nes.input.port1.gamepad.select joystick 42190af389429475 00000008
nes.input.port1.gamepad.start joystick 42190af389429475 00000009
nes.input.port1.gamepad.up joystick 42190af389429475 0000c001
nes.input.port1.gamepad.down joystick 42190af389429475 00008001
nes.input.port1.gamepad.left joystick 42190af389429475 0000c000
nes.input.port1.gamepad.right joystick 42190af389429475 00008000

nes.input.port2.gamepad.a joystick 42190af389429476 00000002
nes.input.port2.gamepad.rapid_a joystick 42190af389429476 00000003
nes.input.port2.gamepad.b joystick 42190af389429476 00000000
nes.input.port2.gamepad.rapid_b joystick 42190af389429476 00000001
nes.input.port2.gamepad.select joystick 42190af389429476 00000008
nes.input.port2.gamepad.start joystick 42190af389429476 00000009
nes.input.port2.gamepad.up joystick 42190af389429476 0000c001
nes.input.port2.gamepad.down joystick 42190af389429476 00008001
nes.input.port2.gamepad.left joystick 42190af389429476 0000c000
nes.input.port2.gamepad.right joystick 42190af389429476 00008000

command.exit joystick 42190af389429475 00000006&joystick 42190af389429475 00000007
command.exit joystick 42190af389429476 00000006&joystick 42190af389429476 00000007

Unfortunately, the above changes around a bit from device to device and atm i'm not even sure the i'd will survive from disconnect/connect of the gamepads.

The proper way of doing this is to:

1. Start a game.
2. Press Alt+Shift+1
3. Push the correct buttons asked for on screen to do specified command. (First time you push a button adds it to the command, second time you push the same button marks it "final" for the command sequence. Peculiar, I know. So, to make the game use button 2 and 3 in conjunction to be button A, you'd first press button 2 once, then button 3 twice.
4. hit esc on the keyboard to leave mednafen. The config should now be saved.

I haven't found a way to create the "command.exit" commands yet. I'll have to work some more on that.

måndag 20 oktober 2008

Stoneage efficiency measurements

Once again I react to the inefficiency of corporate bureaucracy. A very common way of measuring efficiency is to use statistics. How do you use statistics to measure efficiency, and especially in cases such as helpdesk and support functions in a corporation?

A common way of doing this is to just measure closed tickets, and how long time is spent per ticket. I'm not sure how many companies still do this, but I've run into it more than once (actually, more times than I can count on my own hands) in the last year.

The problem is that any given person with the sole efficiency measurement being quantitative applied knowingly on him will react by trying to increase his efficiency, and how better to do that than to just cut and paste answers and close any tickets as soon as that's done.

My response to this, is it quality or quantity that is most interesting? I believe the answer is quite simple in this case, I'm all for quality. Unfortunately, the entire economic system seems to be leaning towards quantity rather than quality these days. I think a half decent compromise however is how CCP in eve-online is handling user support, and it's the same way I've done it when I did user support.

Once you get a problem report (aka ticket), skim through the message, see if you can find a common denominator with some of the most known 6-7 problems (or more if you're unlucky). Send a cut and paste response (with either an explanation, or a detailed step by step fix), but keep the ticket alive until the person responds. If no response has been received in a given time, say a week, try to contact them again and see if the problem was solved before closing it. If the problem hasn't been solved by this simple round, it's either time to send it to 2nd line support, or if there is no 2nd line support start asking for information that can be used to debug the problem, and delve deeper into the problem.

I'm not claiming this is a holy grail of any kind, but it does hopefully keep more customers happy. It requires happy and motivated support personel, and that can at least try to keep face up for a while with customers. To do that, it requires proper motivators, and definitely not some stoneage efficiency measures. Get customer satisfaction index into the game, even if it's an internal function in your company, or an external function fronting towards your customers.

måndag 13 oktober 2008

Switching GNU toolchains in eclipse -- the easy way

This is a method of switching to a different toolchain that I found in eclipse. Basically, my goal was to get eclipse to use a secondary toolchain. Primarily in my first step, I tried making eclipse use a crosscompiling gnu toolchain.

Doing this the "right" way seems to entail writing plugins eclipse, and to write lots of XML configurations and so forth. Not having the luxury of infinite time and money (yet wanting a managed build), but rather being result driven, I finally managed to solve it partially with a hack.

My secondary goal now is to make the build work with a completely "non-gnu toolchain" (renesas sh compiler), I will try to hack together this in the upcoming days. I'll get back to this topic again, once I know if it works or not. In the meantime, this is how I got it to compile with "non-standard" toolchain, and "standard" cygwin toolchain at the same time.

  1. Install the toolchain somewhere.
  2. Setup your PATH with the /bin/ directory in it.
    1. Start -> Control Panel -> System.
    2. Enter the Advanced tab.
    3. Click Environment Variables.
    4. Find the PATH variable in System variables.
    5. Edit and add ;c:\path\to\your\toolchain\ at the end of it.
    6. OK
    7. OK

  3. Create a new Build Configuration (Target for example).
    1. Right click the project in the Project Explorer.
    2. Build Configurations -> Manage...
    3. New...
    4. Write name "Target" and a description.
    5. Copy settings from another target that might contain decent default values.
    6. Ok
    7. Ok

  4. Edit the Settings for the "Target" Build Configuration.
    1. Right click the project in the Project Explorer.
    2. Choose Properties.
    3. Go to C/C++ Build -> Settings.
    4. Choose the right Configuration at the top (Target in our case).
    5. For each heading in Tool Settings (GCC Assembler, Cygwin C Compiler, Cygwin C Linker)
      1. Click the heading.
      2. Edit the Command field (for example, instead of using gcc, you might be using arm-elf-gcc or m68k-uclinux-gcc).
      3. Apply.

    6. OK.

  5. Try to build the new "Target" Build.


Hint: A problem I ran into was that my new toolchain couldnt understand/interpret unix style paths properly and not hinting very openly about it. Ie, I got "missing header files" all over the build. Turning on verbose (-v flag) in the C/C++ Builds -> Settings, and then under Cygwin C Compiler -> Miscellaneous gave me an error like "ignoring nonexistent directory", which turned out that instead of using "../inc/" I had to use "..\inc\".

torsdag 9 oktober 2008

Removing U3 from a SanDisk cruzer micro 1gb memory

Girlfriend has had a USB memory stick for a long long time now, and every time I plugged it into the computer, I've gotten completely raving mad at how retarded it is. The story is this, it has 2 separate partitions. 1 partition where you save files etc, and a "system" partition containing something called U3. U3 is closest described as a virus imho.

The system partition is read only and I found no way of easily making it read/write/formattable. Every time you plug in the USB stick, it will autorun a junk program called U3 launchpad with a lot of popups showing up to let you know about it, and it has a bad notion of trying to be a second "start" menu or something.

Anyways, I decided for the 3rd time to try and remove this crap from the USB stick, both times before I got about 10 minutes into the process, at which time the computer had locked up hard on me 2-3 times, and almost had me stomping on the memory stick out of sheer annoyance. Same thing happened this time. But, I had some more perseverance, and actually access to the internet this time, and started searching for others with the same kind of problem.

I found this: http://www.u3.com/uninstall/ . The sheer idiocy of this amazes me. Let's assume that here I am buying a memory stick to help me "when I have no access to the internet", and I get some junk with me on the usb drive. The only way of getting rid of the junk, is to download an application off of the "thing I will likely not have access to".

So, I download the application, and run it. It asked me if I wanted to backup the data on the memory stick. I did, so I choose to backup data on it, and continued. It downloaded the data properly to the harddrive it looked like, and continued to reformat the drive. At this point, it crashed, trying to replug the USB drive didn't work -- apparently the driver for the drive was already installed. So, reboot the computer, and it finally recognizes the drive again. It's empty, no more U3, but the application never got around to actually formatting the new drive and reinsert the backed up data. No worries I think, I format the drive, and manage to search down the backup to C:\Documents and Settings\\Application Data\U3\temp\U3BkUpDir. Guess what, the application only copied the directory structure, no data is actually in the directories.

And they have the audacity to _really really_ try to talk me into "nooo, you want to keep this application, it will save your life" more or less. It's a freaking virus. It's actually harder to get rid of than quite a lot of viruses, and caused more of a havoc imho. Anyways, check out the above link to get rid of U3. And be prepared to backup data on your own

måndag 6 oktober 2008

The dead horse rebeaten to life - How governments keeps banks alive

So, once again it happens, local governments jumps the bandwagons to save big time banks who have done a crap job at making sound and good business. Once again we have people completely misbehaving, and in general doing bad business, getting their wallets lined with more money from the governments to save them.

Personally, I don't have a belief in either [political] direction really, but I think that if we are going to make a sustainable planetarian (as opposed to the wordinternational, which always tend to exclude countries) economic system, we need to stop promoting the current scenario with promoted competition and then giving our friends (the loosers) prizes for doing bad choices. This is contra-productive in my humble opinion, and stagnates the market and the players in a bad circle.

We have two diametrically opposite choices planetarian economical systems -- in reality, no we don't have these choices, but to make what I believe is a sustainable planetarian system. I refuse to talk about global economy as we've already seen where that leads.

The problem
The world willingly entered (yes yes, I'm beating a dead horse as well) a global economic system during the 1990's, the leaderships and right wing politicos of countries jumped the possibilities, while citizens and left wing politicos where slightly defiant and backwards, something normally attributed to right wing people. Either way, we entered the system, but only partially. Banks (swedbank, hypo real estate, fannie mae, et al) and global mega corporations (ibm, dell, coca cola company, disney, ford, nestle, et al) are using the possibilities to its fullest, they are no longer national entities, they are everywhere and anywhere and noone except themself has a decent window into the ins and outs of their economical structures. And no, no, no -- Nasdaq, SEC, NYSEC, and none of the so called third parties have a decent looking glass into these kind of megacorps. In actuality -- the ones who where in some part supposed to be our warrants against misbehaviour, where the ones misbehaving the worst in this round.

National governments and local governments are still living in the local economic system, they know part of what is happening, not even close to everything. They are still regarding banks and other megacorps as local entities, which does good for the locals, and which needs local support in bad times. For examples, look at Lehman brothers, Hypo Real Estate or SE-banken back in the days.

Are they really worthy of our [local] support? As it currently stands, the economical machinery doesn't work. It's out of sync with reality, fantasy sums of money are passing around every day in the forms of loans and 1's and 0's.

I will pull a weird example from a game I've played for quite some time, eve-online (It has it's own problems, admittedly), to show how numbers can be misguiding. Recently, there's been a gigantic war between two different factions -- GBC and NC. Normally all "kills" are gathered on specific webpages for each alliance, GBC has several alliances, and NC has several alliances as well. Now looking at any one of those alliances killboards for a big battle, you always have the "local", ie the alliance who owns the killboard, looking as if they came out as the winner of the battle. Now, go over to an alliance on the other side, it looks the same way, the "locals" where winning. In this case, you only get a partial overview of the fight -- you get the losses of that specific alliance but none of the others, but since everyone from all alliances on one side are sharing the kills, all the kills are showing up on any one of the respective alliances killboard.

This [eve fights] alone is hard to get accurate numbers on unless you do some serious data aggregation and acquisition, now let's try to get accurate numbers for a real life company operating in 50+ countries, especially if anyone at any level in that company has something to hide? And if the one who has something to hide, is the one who is supposed to be supervising the market?

Choices
The situation as it looks is untenable, we are currently fighting a fire with fire, and most likely moving problems from one place to another.

There are of course, several different choices imho, but to be perfectly logical, there are a few different changes that must be made.

Choice number one, go liberal. Do not engage in saving the different banks in financial crisis, let them be devoured by bad choices and the strong ones survive. The problem is, how do you make this work on a planetary level? Ie, if the banks in your region are not saved, they get a disadvantage in comparison to banks from regions which have regional support in bad times, hence putting darwinian rules out of the calculation. In other words, a planetary agreement must be reached for this to happen.

Choice number two, go all out socialistic, save the banks, but in return all the banks should either be run in such a way that their own proceeds will pay for either their own demise (Ie., make them pay for some kind of government run insurance, which must reach a zero result over a defined timeline), and also make the figureheads and CEO's of financial institutions and banks personally responsible for what happens inside their organisation. Make it personally hurt whoever is responsible. This also requires quite a lot of unison between countries as to not provide too much leeway for any one of the banks around.

In summary, something needs to be done about this. Every 15-20 years or so we have another financial crisis due to more and more greed, and mostly it's about the same type of people doing the same type of mistake over and over again.

onsdag 1 oktober 2008

Moving interface from Enterprise Architect to C include file

After writing this, i realized the output after this is almost 100% the same as I got from exporting the original class as a C header from Enterprise Architect, still putting this out there as it's a nice regex. Cut n paste each function line from EA to the header file. format will be a bit screwed up, for example:

functionname(varname: vartype, varname2: vartype2): void

Begin with moving trailing return type to beginning:

:%s/^\(.*)\): \(\w\+\)$/\2 \1;/g

Get all varnames and vartypes into correct positions:

:%s/\(\w\+\): \(\w\+\)/\2 \1/g

All function declarations should now be fixed.

fredag 26 september 2008

Dangling locks in the Subversion tree

I recently ran into another rather peculiar and interesting case with subversion. As I've already explained, I don't have actual physical access to the subversion servers we are perusing for our project. We use TortoiseSVN for access to the repository on our local systems.

My boss was working with some excel and word files checked into the repository. He had template.xls locked as he was working in it, he decided to rename it to a template, so template.xlt it is (and checked in). After doing some more work, he decided this was a bad idea, so he changes it back to template.xls, and tries to check it back in again... no luck, it wont work.

15-20 minutes worth of investigation later, we found the problem. TortoiseSVN had been configured to always check "Keep Locks" on commit, hence the client kept the lock when he commited the template.xls deletion. To fix this problem, run svnadmin lslock and then svnadmin rmlock the file in question. Please note that this requires actual access to the physical subversion repository. Http or svnserve will not do in other words.

A step by step on how to cause the Dangling lock problem -- All of the actions are done via TortoiseSVN interface:
  1. Create a repository.
  2. Check out the repository.
  3. Add a file to the repository, set the svn:needs-lock property.
  4. Commit the file.
  5. Lock the file.
  6. Change name of the file, and check the "Keep locks" checkbutton.
  7. Commit the changes.
  8. Change the filename back to the original filename.
  9. Commit the change. This step will fail.
This is a rather funny problem imho :-). We finally managed to get it fixed after contacting the IT department and sending them the command. 10 minutes to cause the problem, 20 minutes to analyze it, 20 hours to wait for the fix. Sometimes there should be less depth in organizations.

tisdag 23 september 2008

In windows, noone hears you scream

As you've all noticed, I've been working overtime with Windows as of late. I'm working in the embedded development industry, and wherever I turn, there is windows. To be honest, I don't get this industry and why the hell they keep running in this environment. Most of the people I've met in the trade are brilliant minds and know what they are doing, but the business in general are very backwards refusing to let go of things.

Also, another reason for the entire trade being stuck in such a fashion is all the tools produced. You have a market catering to the same market with software and tools, developing for a single common development platform -- Windows. And you have product lifetime to take into consideration.... There are still a bountiful of products out there that was developed before windows 3 was created.

All of this is creating a rather stagnant trade where it's hard to get a move on, test new things, do something differently. Just take my last few weeks of working with subversion/trac/cruisecontrol on windows. Had I known just how much work I would be forced into just because someone else decided that we run it on Windows XP, I would have protested loudly.

I can't simply get rid of this horrible abomination of an operating system in this trade, thats the sad but simple fact as of today. Sure, I've managed to get trac and cruisecontrol into the project, and we use subversion since before. But, I still need Windows for proprietary development environments, proprietary fileformats from customers, proprietary software from proprietary software companies, and so forth and so forth. And before you say anything, unfortunately I'm really stuck this time, proprietary IDE and compilers for weird hardware. Every time I touch an embedded project, it's the same thing "oops, we gotta use this processor or that dohicky which requires software Y which requires Microsoft Windows".

What's just taken me 3 weeks in Windows -- Basically, setting up subversion/svnsync/trac/cruisecontrol and some small work around that -- was accomplished in that time, even though I did the same in less than 2 days just before in Linux. As we're building for target via cruisecontrol, we where stuck with using Windows as the compilers where proprietary...

I'm a Unix person by soul, I love it, it's natural to me, it's my home. It's where I come from! I feel like I'm screaming at this insanity asylum that is Windows, but nobody is listening to me. The entire Operating system is befuddled with incompetence, idiocy and bad design choices.

fredag 19 september 2008

Svnsync automatisation via Windows Scheduler

Recently I've been setting up for a project, as you might have noticed, and one of the problems we ran into was the fact that we have a centralized subversion repository. We don't have access to control or install anything on the actual server unfortunately, so hence we can't install trac on that system, as previously explained. The solution is to sync the main subversion databases to the trac server as previously explained.

A secondary problem arising from this, is that we can't actually change the hook files of the master repository. The solution to this, is to add a synchronizing scheduler. As I was stressed, and had no time to deal with this properly, I had to run with the Windows Scheduler of all horrible solutions. The following explains how to set it up.

Windows Scheduled synchronize Task

Warning!
The windows scheduler does not start automatically when you reboot etc. If you do this, the task restarts at it's start time, so if it's set to run at 00.00 every day, and then every 5 minutes, it will restart and start running at 00.00, not as soon as the machine is started up again. This is pure evil.

A scheduled task is set up as follows, create a bat file (ie, c:\projects\svn\project\svnsync-project.bat):
svnsync synchronize http://localhost/svn/project --sync-username slaveuser --sync-password tjohej --source-password password
c:\Python25\Scripts\trac-admin.exe c:\projects\trac\project\ resync
The Second line unfortunately has to be done to resync the new changes with the trac database. After this, create a scheduled task in windows as follows:
  1. Go to start -> control panel -> scheduled tasks
  2. Click Add scheduled task
  3. Click Next
  4. Click Browse...
  5. Browse to your svnsync-project.bat file, as described above. Double click it.
  6. Set name (default is ok). Perform this task: Daily
  7. Click Next
  8. Start time: 00:00, Every day, Start date: today
  9. Fill in username/password to run it as.
  10. Select open advanced properties for this task. Click Finish.
  11. Go to tab Schedule. Choose Advanced.
  12. Click Repeat task, fill in Every 10 minutes, and click Time and fill in 23:59
  13. Click OK.
  14. Click OK
  15. Done.
This could most likely be done from cruisecontrol, but as stated, i'm stressed. I hate windows by now (at/cron is just sooo much nicer to handle).

torsdag 11 september 2008

Linux iMON pad remote controller with lirc

Introduction
In short, the SoundGraph iMON PAD that came with my SilverStone LC20 doesn't work very well with the default ubuntu 8.04 installation. I've previously discussed how to get the VFD running, and am now turning my attention to the remote control and how to get it decently working in mythtv with lirc.

Let's start by looking at the following image:
In short, red files are "main steps" which the "packets" flow from the remote control, and finally reaching lircd where they are converted from a binary stream into something intelligeble (with the help of the lircrc file, which specifies names for the different hex codes).

blue boxes are configuration files, green boxes are "users" of lircrc -- ie, they will connect to lircd and receive all the updates from lircd as needed. Finally, magenta boxes are different things needed to build to get stuff running.

Installation
Everything will work out of the (ubuntu 8.04) box more or less, except for the big blobby nice mousepad on the remote control. That one is a mouse -- sort of -- and doesn't work at all for me, your mileage may vary however (ie, it didn't work for me, it might change fast)

Install Xorg, mythtv, mplayer, linux-kernel sources (needed later) and lirc via apt-get or your prefered frontend. Configure the packages, start xorg and make mythtvfrontend start from the .xinitrc if you so wish, and then start via the startx script, or rather make it start up as you feel most comfortable with. I'm an old fart and I like my startx.

Once all this is set up, all things should work, except the remote control, as already said. Most buttons will work, but not the big blobby knob (a.k.a. mousepad).

HACK
Well, it's time to hack the horrible hack I guess. Download lirc-0.8.3 from www.lirc.org. Also, download the pad2keys patch from http://brakemeier.de/electronics/vdr/lirc-imon.html.

1. Unpack the lirc package.
2. Patch the lirc package with the pad2keys patch (it will most likely fail with some chunks, just look at the patch, and add the code manually, are you a hacker or not?!).
3. Configure and make the lirc package. Don't install it.
4. run uname -r, note your kernel version (2.6.24-19-server for example).
5. run "locate lirc_imon.ko" (have you updated your locate database? man updatedb, hint hint). If there are more than one in the list showing up, find the one in /lib/modules//blah blah.
6. Copy lirc-0.8.3/drivers/lirc_imon/lirc_imon.ko to the file you found in step 5, and replace the old one.
7. Either reboot, or if you know how to rmmod lirc_imon.ko and modprobe the new one. This might fail if you followed my previous post on islcd=0 etc, if you did, remove that line again.

Don't forget to edit your lircd.conf with the new IR codes from the brakemeyer.de webpage. Set PAD key's to good values, such as this:

Up 0x690281B7
Right 0x688A81B7
Down 0x688291B7
Left 0x6A8281B7


Finally add them to your lircrc in a good way, such as this:

begin
prog = mythtv
button = Up
config = Up
delay = 2
repeat = 1
end

begin
prog = mythtv
button = Down
config = Down
delay = 2
repeat = 1
end

begin
prog = mythtv
button = Left
config = Left
delay = 2
repeat = 1
end

begin
prog = mythtv
button = Right
config = Right
delay = 2
repeat = 1
end

So, you're now a hacker of immense proportions. Celebrate with some mead and grow a beard like the rest of the hackers ;-).

Trac on separate server from subversion

It is possible to have Trac on a different server than the subversion server, albeit a bit convoluted. This is slightly stolen note from http://blogs.open.collab.net/svn/2007/08/mirroring-repos.html

Set up the master subversion server as you would normally. We will get back to this one.

On the trac server, install subversion etc as well. This server will rely on svnsync to become a secondary/mirror subversion server. It must not be used for checking in or working against, it is purely a repository for reading.

Set up trac and all other tools required on the mirror server.

Now, you need to set up user accounts on the mirror server. To start with, create the mirror subversion repository, it will be empty to begin with:

svnadmin create MIRROR_REPOS_PATH

After that, create authz authentication files for the repositories to stop anyone from writing/working against the mirror repository, such as the following:

[/]
* = r
svnsync = rw

You could extend this by writing hook scripts blocking anything but the svnsync user.

If the master subversion repository is live while adding the trac database, all of the following must be done during server maintenance window (ie, close it down from any kind of access, except the mirror machine).

Once all that is done, its time to initialize the the mirror server with the master subversion repository (ie, move over the data).

svnsync initialize URL_TO_MIRROR_REPO URL_TO_MASTER_REPO --username=svnsync --password=svnsyncpassword

And once that has successfully been done, do as follows:

svnsync synchronize URL_TO_MIRROR_REPO --username=svnsync --password=svnsyncpassword

The final step is to either add a scheduler (cron.d) script, or a post-commit hook script running the following:

# Example for synchronizing one repository from the post-commit hook
#!/bin/sh
SVNSYNC=/usr/local/bin/svnsync
$SVNSYNC synchronize URL_TO_MIRROR_REPO --username=svnsync --password=svnsyncpassword &
exit 0

Preferably run it from post-commit as it gives better refresh rate.

You can now run the trac against the mirrored subversion server.

onsdag 10 september 2008

Trac on windows

Trac is a rightfull bitch to install on win32 as it requires very specific version matching of packages. This is a long winded installation note with the more or less latest versions available as of this writing.

I'm hoping to get working on TortoiseSVN and Trac integration once this is done (ie, make tortoise automatically set variables etc sent in change notes, which can hence update the issue tracking systems in trac and so forth. The way of working is really really sweet imho, and I think it could be a really nice way of working. I'm just sad that I have to set all this serverstuff up on windows though.

Let's begin with a list of all the installation files used:

python-2.5.2.msi
setuptools-0.6c8.win32-py2.5.exe
py25-pysvn-svn150-1.6.0-975.exe
svn-python-1.5.2.win32-py2.5.exe
Genshi-0.5.win32-py2.5.exe
Trac-0.11.win32.exe
WampServer2.0c.exe
CruiseControl-2.7.3.exe
TortoiseSVN-1.5.3.13783-win32-svn-1.5.2.msi
WampServer2-APACHE229.exe
svn-win32-1.5.2.zip
mod_python-3.3.1.win32-py2.5-Apache2.2.exe


These packages should be fairly simple to get started with. Install them straight on, in the order mentioned.

python-2.5.2.msi
setuptools-0.6c8.win32-py2.5.exe
py25-pysvn-svn150-1.6.0-975.exe
svn-python-1.5.2.win32-py2.5.exe
Genshi-0.5.win32-py2.5.exe
Trac-0.11.win32.exe

Install the above packages in that order. Some errors i ran into:

Unsupported version control system "svn"

I accidentally used svn-python-1.5.0.win32-py2.5.exe. It also complained about not finding SSLEAY32.DLL which threw me off course, looking for the wrong solution.

Secondary applications
On top of this, the following applications where installed (not yet configured/set up).

WampServer2.0c.exe
CruiseControl-2.7.3.exe
TortoiseSVN-1.5.3.13783-win32-svn-1.5.2.msi

WampServer2-APACHE229.exe
The Apache2.2.9 must be installed before svn-win32-1.5.2.zip files are, and the .so files must be put in 2.2.9 as that package will not run on Apache2.2.8. Apache 2.2.8 with svn-win32-1.5.2.zip will die silently without hint as to why it died.

Once all of the above is installed, create a svn repository in c:\projects\svn\test (create directories, and then right click test and choose TortoiseSVN -> Create repository here.
Now create a trac database in c:\projects\trac\test\ by running

c:\python2.5\trac-admin.exe c:\projects\trac\test\ initenv

Answer the questions asked by trac-admin.exe. To test the trac at this point, run tracd.exe per ordinations from trac-admin.exe.

svn-win32-1.5.2.zip
Contains required files to make dav_svn work in apache2.2, edited extract on how to install:
For an Apache server here's the essentials:
1. Copy bin/mod_dav_svn.so and bin/mod_authz_svn.so to the Apache modules directory.
2. Add the Subversion/bin directory to the SYSTEM PATH.
3. Edit the Apache configuration file (httpd.conf) and make the following changes:
3a. Uncomment the following two lines:

#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_module modules/mod_dav.so

3b. Add the following two lines to the end of the LoadModule section:

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

3c. Add the following to end of the file.

<location /svn>
DAV svn
SVNPath c:\projects\svn\test
AuthType Basic
AuthName "My Subversion repository"
AuthUserFile "c:\projects\svn\test\conf\passwd" Require valid-user
</location>

Add users to passwd file above:

C:\wampbin\apache\apache2.2.9\bin\htpasswd.exe -b \projects\svn\test\conf\passwd myuser hejhej

Finally installing Trac in apache2.2

mod_python-3.3.1.win32-py2.5-Apache2.2.exe
To run trac via apache, you need the above module for apache as well. Once this is done, add the following to modules section of apache:

LoadModule python_module modules/mod_python.so

To test the python installation add the following to the end of your httpd.conf:

<location /mpinfo>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler mod_python.testhandler
</location>

And if that works, test the following:

<Location /trac>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv "c:/projects/trac/test/"
PythonOption TracUriRoot /trac
</Location>

Further reading

Ubuntu 8.04 lirc_imon VFD's

I got a silverstone LC20 chassi with a built in iMON vacuum fluorescent display (VFD) and IR remote control. I recently upgraded to Ubuntu 8.04 from 7.10 -- yes I know, I am a bit late, but generally you don't have to deal with kinks like this one when that happens.

Ubuntu 7.10 -> 8.04 changed the behaviour of the lirc_imon module pretty little, yet radically. The old default was to treat all iMON driven screens as VFD's, but it now defaults to treat all iMON modules as LCD modules instead.

This results in tons of errors being pumped out (10's-100's per second), like this one:

Sep 9 21:35:00 fs1 kernel: [ 71.481262] /var/lib/dkms/lirc/0.8.3~pre1/build/drivers/lirc_imon/lirc_imon.c: lcd_write: invalid payload size: 32 (expecting 8)

Also, the VFD will not work. To make a long story short, to fix it, you need to tell the kernel module that the VFD is in fact a VFD and not a LCD, by giving the kernel module the option islcd=0. For example, in /etc/modprobe.d/options:

options lirc_imon islcd=0

I hope this helps anyone out there. I will soon try to have something together on getting the iMON PAD working properly. The basics was simple to get working, but the "mousepad" has been a general pain to get up and running properly.

tisdag 9 september 2008

If god is omnipotent, why did he need to rest on the 7th day? Shouldn't he have been fixing his errors?

måndag 8 september 2008

Qt presentation tomorrow

So, I'm holding a brief Qt presentation on a demo i made a few weeks back. It's pretty, and got a ton of stylesheets on it. Going down tomorrow at work. Hopefully people will be a little bit interested at least. It's not that often I dare get my ass up there behind a podium, or speak up at all for that matter.

To be honest, I don't know why really, I just hate being in front of people talking and possibly saying anything that might be wrong. Of course, there's a reason why I'm doing the presentation, and not someone else. I'm the only one with any substantial experience at all of this subject, so why not basically.

Also, I'm feeling horribly stressed as of late. I started on a project last week, and it's getting to me. Need to take a minute, sit down, and calm down.

söndag 7 september 2008

IKEA and stuffs

Once again we've been to IKEA. Once again, we got back home with a ton of stuff. Picked up a lot of smaller things we needed, lights, bowls, etc. Also, we went by jysk and finally found a half-decent tv-bench. We didn't really love it, but agreed that with some white paint, we could actually stand it for a year or two. It's taken almost a year of bickering to finally find a tv bench that we both can agree to buy. Hilarious :).

To sum it all up as simple as possible, we have no really good space to put a tv at, either its a bad angle towards the sofa, or it's in the middle of the floor, or we have a too small space for most tv benches. Also, I have a htpc + a huge amplifier, both are ... not quite sure, but both chassis looks to be based on 4U rack-mountable machines (H16xW43xD43cm approx), and both need to fit in the tv-bench. Annoyingly, almost 90% of all tv-benches havent been planned to fit that size HTPC/amplifiers. It's a standardized size, sure it's the absolute largest standard size you will see on this type of hardware, but it's still standard.

Let's take an example, the chassis of both machines are 16cm high. Out of maybe 10 benches we found that have "high" shelfs for dvd's etc, only 1 or possibly 2 could fit a 16cm machine. The rest where around 15,5cm, or sometimes simply not deep enough, etc. Why the hell is there a common form factor, and the designers of furniture can't deign themselfs to look it up and design the furniture to hold the common hardware?

Anyways, we did find a few benches that could've worked... except... they where so freakishly ugly it's not even funny. Take EINA avlastningsbord for example. Looks decent on the pictures there, but in reality the material/finish looks like cardboard box that's been standing out in the rain and then dried up. Lerberg was actually a candidate, just because it was so cheap, and we only need to use it as long as we live in this apartment. Check out the max load of it though, 10kg?? We couldn't even have put the tv on it, and we only have a 20" LCD tv. Not to talk about the 25kg htpc or 16kg amplifier. Flärke was another really cheap option, except... it simply doesnt fit with our furniture, and it doesnt look very good, AND machines doesnt fit in the bench.

Either way, we found a bench finally - at jysk. They didnt have it in store yesterday, so hopefully I'll be able to pick it up today at another store. Can't find any pictures of it, so just saying it looks half decent at least :).

onsdag 3 september 2008

Continuous integration and buildserver

So, I finally got around to trying out continuous integration and got a buildserver at home. Ok, not much use on any 1-man projects, but should be good enough for some testing at least. I'm currently using cruisecontrol for it, and so far so good. I've got a few points I sincerely react against, but I'll get back to that a bit later.

For those not knowing what continuous integration is, I suggest reading the above link. Basically, when you run a project, you always run into some "final" integration problems. People have coded each on their own side, and you wind up having to "integrating" the code so that it all works as supposed. In the one extreme, you have everyone coding on their own tree from start to end, and then you finally have an integration session. In this shitty situation, you have no clue how long it will take. On the other extreme, you have "perfect" continuous integration, where every single line of code is tested and checked that it doesnt screw things up.

A buildserver such as cruisecontrol is an excellent tool for doing "good" continuous integration. What it does is as follows, it connects to your central code repository, checks for any changes. If there was changes, it downloads them, and then rebuilds the project(s). If you have done it properly, you also have a ton of tests that you can run on the project. This is then reported or output in several different ways. Did it fail, did it succeed, and so forth.

I might be able to convince my new project manager to use a cruisecontrol server for the project I am working on at the moment, and he sounds like he likes the idea. We just need to consider everything for this project, and I need to figure out just how it works and how to configure it etc etc etc =) . Either way, I think it will be interesting to find out more about this type of development, and to see if it actually changes the development in any large way.

Oh, yes, I currently got two things I need to figure out with cruisecontrol. If I got it right, it doesn't support GNU Make. Not supporting make seems... well, to be honest, totally stupid. It's been one of the biggest make systems for 20 years or more, so there's bound to be like 500000+ projects out there already running Make. I know it's an old system, but it works, and it's there already.

The second thing, I'm not totally certain of this, but subversion support seems to be abysmal. I need to look more at it however to find out the lay of the land or something.

måndag 1 september 2008

Re: "Miljövän rasar mot flygshow"

http://www.gp.se/gp/jsp/Crosslink.jsp?d=113&a=442174

I need to comment on this news story as it really annoyed me.

I've personally grown up with airplanes and airshows very close to me as my father was a pilot, I have quite a few old friends that are pilots, and I've always been interested in airplanes and I admit that this might have coloured my perspective very heavily. However, the hypocrisy and bullshit, if you excuse my language, that Lotta Holmberg spews forth is just plain wrong.

Before she even considers throwing stones in her own glass house, she should contemplate how she herself is living. She's even so mentally deficit as to admit that she hasn't even stopped her "yearly trip to the sun". Now, let's do some really simple math on this.

Let's consider how many people get anything from a trip with a charter airplane "to the sun", approximately 200-500, let's say 400 to err on her side. Average trip time from this country to "a place in the sun" would be approximately 5-6 hours airtime, so a grand total of 12 hours both ways. Split the airtime per passenger, 12/400 which turns into 1.8 minutes per person on the airplane.

Now, let's consider the airshow. There was a grand total of maximum 6 hours or so of airshows per day, average of 3-4 airplanes in the air at all times (rounding to 4 to be nice to you), so a grand total of 6*2*4 = 48 hours in the air during the whole airshow. 45000 persons visited the airshow and had a great time, making for a total of 48/45000 hours per person and which turns into... tada, a massive 3,84 seconds airtime per visitor.

To make it simple, let's make the assumption "all airplanes turns out as much green gases as any other" (your charter aircraft is gigantic in comparison and shiny new with perfect green engines (yeah as if, you freakin mooch going with the cheapest 30 year old crap airplanes on the market and still flying commercially), while "mine" at the airshow are very small, but at the same time very old so probably having a bad efficiency with a big exhaust of gases in comparison to their engine size). So, 1.8 minutes = 108 seconds, divided by 3.84 seconds, 28.125x less gas output per person in comparison to your "yearly trip to the sun".

I got about 50 other reasons why airshows are a good thing and needs to be there, and why you should keep your mouth shut. Please stop throwing stones in a glass house and stop putting your feets in your own mouth.

Now, if you excuse me, I need to visit 420 airshows to use up as much green gases as you have done with your "yearly trips to the sun" -- calculated based on you being old enough to have been on 15 "yearly trips to the sun" vs Göteborg Aero show.

söndag 31 augusti 2008

Crispy burnt hungover wreck


It's been a long and rough weekend. Friday started out easily, just softing at home and preparing for the day after...

Saturday was the big day, Göteborg Aero Show 2008 :-P. It's such a damn long time since I was last at an airshow, but it was awesome. I loved it so much. I've seen all the old nice airplanes, heard a lot of news (well, news to me, I've been out of the loop for a long time now). My sister managed to run into old friends of my father, and we got a vip visit to some really sweet airplanes :P.

We also got to see some really nice airshows. I think in general, it was a very nice show, but there was a few kinks. If I understood it correctly, this was the first show that these people planned so I have full respect if a few things didn't turn out perfect (practice makes perfect after all). Also the people planning it didnt anticipate just how big success the airshow would be, which made for some minor kinks as well. None of this was really a big problem. The biggest problem I noticed was that we had to wait 45 minutes in line for food (they kept running out). Also, the spitfire had some problems with the ignition, so they had to cancel that flight during the saturday schedule, which made me very sad as it's always been one of my favourite aircrafts.

Also, a big big big downer, swedish airforce is so horribly low on funds so they can no longer fly their airplanes properly from what I've heard on the news. It showed at this airshow as they didn't fly the jas 39 gripen at all. They had a rather ... weak display of 3 gripen on the ground, that was it from what I saw (except for a few helicopters as well). Privately funded groups, fantasts and hobbyists did more of a show than the military did.. I'm not blaming the airforce, I'm pretty much blaming the idiots in suites running this country. Damn hippies.

Once we left the airshow, unfortunately had to leave 30-45minutes early due to crayfish party and to get ahead of the lines from the airshow, I realized that I had burnt my face to a crisp pretty much.

I got home, showered, switched clothes, and ran down to go to the crayfish party, met my girlfriend in the door, and she started laughing like a maniac and went on to thank me for preparing so vigoriously the entire day for the crayfish party (even coloring myself for it)...

Either way, we went for the crayfish party, I winded up getting overly refreshed, fell asleep on a clapping chair for almost 45 minutes. See image for a demonstration of what kind of chair it was. I'm still sore today from that :P.

And today, we winded up starting the day with cleaning up a bit in the apartment, doing dishes, and so forth before my mother + sister + kid came for a visit. Nice day in general imho.

Long entry :-).

fredag 29 augusti 2008

Iptables-tutorial explained

So, time to explain whats happened to the iptables-tutorial, it's been rather dead for a long time now. This is kind of meant as an explanation on what and why things has gone downhill with it, but also kind of a try to define for myself what went wrong back then.

By now, it's almost 8 years since I started writing on it. It all started as a short term project, a real tutorial if you wish. Due to the demand, I was rather amused at keeping it up, writing more material and so forth, but with time it took more and more effort to keep up to date and to add all the material I wanted in it. While the tutorial was at it's high, I had 25 000 unique visitors per month on the main iptables-tutorial site alone, and all that traffic generated questions, and lots of them. At times, I received 70+ e-mails with questions per week, which required hours of attention. Also, Apress contacted me at this time asking me to write a book on iptables for them.

Having that burden on top of a project that was originally intended to have fun, learn and to get more experience makes a project much less appealing. Also, at the same time, me and my then girlfriend broke up, leaving me in devastation. In a sense, I lost my muse at the same time as I was the least interested in writing. I spent several weeks trying to get somewhere, but didn't manage to get 2 pages out of me. This is where I dropped the tutorial the first time. I pretty much went MIA.

Either way, after a while (a bit over 2 years to be precise), I decided to give it another try. I had for a long time wanted to start writing again, and got around to it as I had the time and will. To make a long story short, I got too much to do with school and work and life in general for a while, but managed to get version 1.2.0 out before this happened. Another year later, I managed to get 1.2.1 out, and finally 1.2.2 which was the first printed version at lulu.com. Due to several minor problems, which turned out to become pretty large problems imho, I later decided to pull down the print version while getting my life together again so that I could focus on what needed doing again.

This is where the iptables tutorial is at this time and date. I'm not really sure what I'm hoping to accomplish with this post really, more than generally give people an idea what's been going on around the iptables-tutorial and try to explain why it's been ... well, not keeping up with developments in iptables and netfilter.

I'm not exactly certain what will happen in the close future with the iptables tutorial. I'm currently working on a few other projects which are better defined and that should hopefully be possible to "finish" properly.. Ie, once I've done them, they should stay done. Once those projects are done, I might get back to the whole iptables-tutorial.
Going to Säve airshow tomorrow o/

onsdag 27 augusti 2008

Tired of Javascript/CSS

CSS is not my strong side, actually web development isn't at all, yet I have this bad habit of wanting to learn things I don't know since before. That being said, not sure if i got this right. Putting an absolute object (div for example) inside a relative object makes for an unhappy combination. Problem is that the outer container does not resize for the absolute object (depending on how you interpret the standards, I guess this is correct behaviour).

Take the following rather long example:

<html>
<head>
<style type="text/css">
.hump
{
position: static;
width: 400px;
}

.lala
{
position:relative;
background-color:blue;
width: 400px;
}
.hoho
{
position:absolute;
background-color:red;
left:0px;
top:0px;
width:50%;
}

.rofl
{
position:absolute;
background-color:blue;
left:0px;
top:20px;
}

</style>
</head>

<body>
<div class=hump>
<div class="lala">ewrio
<div class=hoho>lala</div>
</div>

<div class="lala">
<div class=hoho>lala</div>
<div class=rofl>hejhopp</div>
</div>

</div>

</body>

</html>

You have two options.

1. Add height attribute to lala (making it static height).
2. Write a javascript to dynamically change height of the area depending on how large content is. I'm currently working on this as I really want this solution.

There is probably a much better solution to this, so if you know of a better way, please let me know!
Could use some help with css positioning. Absolute positioned div inside relative div does not change size of relative div.

British boffins perfect process to make any item '100% waterproof'

http://www.reghardware.co.uk/2008/08/27/new_waterproofing_technology_pioneered_by_uk_firm/

This looks cool, damn that has applications from hell. I wish I came up with stuff like that. Well, more than the general idea of "oh, lets make everything hydrophobic", to the "hm, if we do like this, then maybe we can make anything hydrophobic". Ideas are easy to get, to actually implement and get an idea on how to do it is harder. Maybe if you've spent as much time doing physics and chemistry, as I've spent doing computers, it gets easier... "Turn on the flux capacitor Mr Scott!"

Plusenergi continued

Just called them, money received. But now they want the fees also. I'm refusing. If they had sent the bill to the right address to begin with, this wouldn't have happened.

In other news, making a new linux x86/qt4.4 compile of the tanker demo. Build environment setup, should have a binary able to run on the target platform within a few minutes. I'm having a blast with QT to be honest, as I started coding in it a while ago, and I'm really just starting to "get it". The fast prototyping ability of new graphical user interfaces is awesome, and the customizability with both stylesheets and inherited widgets.. I like it :-). I usually avoid changing widgets, it's a bit of a mess since I'm still rather new to the language, but I will do my best at it soon ;) .

tisdag 26 augusti 2008

Cuckolding electric utility company

Just wanted to say, f***ing electric utility company, they're pissing me off so much right now. Plusenergi has done pretty much every single thing wrong that they can. When we moved here, they tried charging me for the actual apartment, and then my girlfriend for the basement (owned by the landlord). Then it took several phonecalls to get that right.

This time around, they've sent my electric bill to my old apartment. So, they send my bills to the right address for almost a year, then all of a sudden decide that my old address should have it, but still sends the bill for the right electric installation?

Anyways, I got the second notice about electrics last wednesday, paid it asap, and just checking it with my bank, it was paid this friday, and the money was docked. Today, I got a debt collection mail from svea inkasso, so I call them, tell them I've paid the bill, they tell me that they've made a remark about calling to check with plusenergi before taking any further steps (yeah right).

Not satisfied, I call plusenergi directly to ask them what's happened. Oh, they have _hopefully_ fixed my address again, that was the first order of business. Then I went on to ask if the bill was paid, nope, it's not according to them. Double check account numbers, reference numbers and so forth, everything checks out. Their final word "can you call us back tomorrow, maybe the money will be here then".

No wonder Electric utility companies are so doing so freakishly well these days. The people who used to turn into pirates are today turning into representatives and executives of the electricity companies. Whatever you _ever_ do, avoid plusenergi, I've had it with them.

måndag 25 augusti 2008

Refactoring some more lousy webpage code

Keeping promises

Well, I did. I did write today again. Hah! :-)

All work and no play makes jack a dull boy,
All play and no work makes jack a mere toy.

Working again, working on a report of some kind, how to do an embedded linux project properly. It's hard to define. I know how I would love to have it, but defining it in words is not. I know it should not be hard, but it is. A paper that is very good imho, Tips for planning an embedded Linux project. It gets all the errors down that we made, but it doesnt really define what makes a embedded Linux project great, or even good for that matter.

I also read anatomy of a hack earlier, it's some interesting stuff, but I'm not sure this is what I would give out to people who really needs it. I've tried handing that short thing to a few relatives, we'll see if anyone of them gets it.

Also, this is the real kicker today, I love Ted Dziubas writing, it's the best tech stuff I've read in quite a while :-). For an example, read his Cloud computing: A catchphrase in puberty.

I'm turning into a real blogger, ain't I? :-P

söndag 24 augusti 2008

Easy stuff

Ok, I started recoding frozentux.net today finally. It's rather ugly and messy code, so i'm starting by cleaning it up a bit. It's kinda nice getting a goal again, I've lacked a bit of it. Also, I must say, this feels soooo easy. PHP code is a breeze, and way to forgiving, especially without 10+ guys looking over your shoulder once in a while to make sure your code is good enough *cough* .

That said, I'm not planning to use too much cross site stuff or any other heavy stuff, so it will be easy to get it to a working state again. Basically, I'm going for a simpler design, with larger flexibility as I want to add a lot of small code samples and projects to the website in the future (I kinda locked myself down there last time).

Also cleaned the fan over the stove, built more on the model (wow, you can almost see that it's an airplane body right now :P ). I got a lousy glue (so sorry mac and heather, it was an awkward glue you gave me :)), need a new one, and I also need some sandpaper. Taken a walk, looked at an episode of systm. A cool show about mythbuntu tbh.

Workweek ahead. See if i manage to get into a habit of writing here or not?;)

Slow grasswidow evening

What do you do when you are home alone a saturday evening? Personally, I web2.0'd my life (i got facebook, a blog, remember the milk, dipity, evernote, and decided to rewrite/update my webpage). Also, I really got started building the Fokker DR.1.

To update frozentux.net, I screwed around a bit with eclipse pdt. I want to do this since I think the whole site looks pretty awful. I was ok with it "back then", but not any more. I've been using eclipse for a few months to code c, c++, qt and I've grown rather fond of it. My first time with eclipse left me... well, let's just say i went back for a few years to vim and loved it. Still wish there was a decent vim/eclipse plugin as i love vims command/edit mode.

I digress. Basically, what I did was Install subversion, make a copy of frozentux.net in subersion and a few other projects in there. I setup subversion with apache2. I know I suck that haven't done this before. After that, I installed pdt, subclipse and a few other modules in eclipse and got it all working together. I think I might like the subclipse module, but still got a few things I need to find out.

I'm gonna get started on rewriting frozentux today I hope. Now, going for a walk first.

lördag 23 augusti 2008

First entry (a.k.a. I've joined the dark side, I'm blogging)

Ok, I'm blogging? Now what? ;) . Nah, I'm hoping to use this site as a place to collect information about what I'm currently working on etc. Maybe an introduction?

Yes, I'm the idiot behind frozentux.net, yes i wrote the iptables and ipsysctl tutorial stuff a long time ago. It's unfortunately a long time ago, and rather rusty. I grew very tired of it during the last update of the iptables tutorial (even earlier actually, but lets keep it simple). I'm not sure at this point if i will try to get it rolling again, but it is possible, depending on how much work it will be to update it.

Other projects i've been boring myself with as of late:
  • Coding (trolltech qt/qtopia calculator, notepad, other stuff to learn the qt api etc). I love QT to be honest, wonderful so far, and you can do hilarious stuff with the stylesheets. Need this for work.
  • Working on some model aircrafts (a balsa built RC one in the countryside which i only have access to very seldom and a guillow's balsa scale Fokker DR.1 at the moment). I need relaxation from computers once in a while, this is _awesome_ stuff to relax with.
  • Still some general security stuff, been a while since, feels nice to be back on homefield once in a while.
  • Started web2.0'ing my life, Ie I now come with shiny buttons and instead of tcp sockets i come with a http api. Seriously just trying this blogging, twitter, dipity, ping.fm stuff, some stuff will stay, some i'll get bored with. EverNote will stay, _awesome_ stuff. Remember the milk will be investigated... it has potential;).
  • Some testing to do with my HTPC, using ubuntu and mythtv... this will get a lot of attention soon as I got seriously pissed at mythtv some time ago. To those gurus at it, apologies, but it sucks as far as ive seen so far, and it was a while since i did any work on it, but it needs to be revisited. Graphics was horribly buggy, some weirdness with unpacking/loading images etc which took close to 5-10 minutes on startup and so forth.