Ant and tiredness

Posted on May 6th, 2009 in SW development, general rant, work related by Juha

A quick reminder for my self. Never, ever anymore use

include name="**/*.jar"

with classpath in application root in ant when working with tomcat and deploying web applications. Get’s things complicated, since it tends to do double entries. Took about 5 hours of work. Geesh,

Jira, Soap and Python revisited

Posted on April 20th, 2009 in Jira, SW development, python by Juha

As things usual, everything does not go as espected. When adding projects to Jira, you usually must set default permission sets and assing users to grops and what not. One especially irritating command (from Python point of view) in Jira’s SOAP api is

addActorsToProjectRole

which is quite useful, a must, when setting group permissions to specific project. When using SOAPpy, the correct way to call the method is:

soap.addActorsToProjectRole(v4=proj,  v1=helper.token,v3=projectrole, actorType="atlassian-group-role-actor",v2=[group])

This add’s group actor, refer to Atlassian documentation to add user-actors to project roles. Remember that you can get project and project roles through soap by using jpypye and casting Python longs to Java.

Don’t ask me why, but this seems to render acceptable xml that Jira’s serverside implementation can read. A bit odd, but Atlassian supports only Java on SOAP side, so probably you’re more safe with Axis.

Another unfortunate thing concerns project creation. (This is to remind myself): WHEN users or groups have been added to project roles, like for giving permissions to delete work logs etc (and this usually concerns the defaul perimission set), we must remove the entries for users by walking through the permiossion set like this:

for y in permissionset[3]:
 
                #print y
                if len(y["remoteEntities"]) > 1: 
                    try:
                       y._placeItem("remoteEntities",None,1)
 
                    except Exception, e:
                        print e
                        pass

permissionset variable holds the Permission-set object, and slot [3] holds the actual permissions. If additional users or groups are added to the permission set, then permission (remoteEntities) will hold those users in a list, which must be “deleted” by assigning None. Otherwise the soap will complain about ‘email’, or ‘name’ fields. So that does it in Python.

False sense of authority

Posted on April 19th, 2009 in general rant, work related by Juha

Authority is something that generally bugs me. What bugs me more, is situations where I’d need some but haven’t got. What irritates me most is the people that have false sense of authority. Unfortunately these people tend to get into semi-high places in workplaces, I think that’s called middle-management. Or marketting, but as we know, sales people are satan’s little helpers. I seriously hope that these are problems only found in big or semi-big companies. Maybe it is so that if the company thinks that it is big, then se semi-big people also think that they’re huge. And that’s the point where I generally generate some attitude problems. Rightfully? Well, sometimes I tend to think so.

Companies, big or small, probably need management culture. At least some kind of line from which the managers and people in charge generally don’t deviate that much. I agree that there can also be positive deviation, but mostly things that I see and have to deal with are pure of arrogance. Our company is actually doing something to minimize these deviations, and it only struck me today when I realized that these ‘values’ are actually focused to management. Probably for all others they’re quite obvious (listening workmates, team spririt, giving value to workmate’s effort…). It’s interesting to see how this will come out, though I’m troubled by the thought that those who should give a shit, will not.

So, the problem, as it seems is the cross-project communication. Expecially in those projects that would need consultancy in areas they’re trying to extend their customer relations. There’s a spot where an “authoritarian” sales man or project lead can do some serious harm by not listening to those that have the bigger experience in area in question. I’m curious to see how these company values would affect these situations, since as it seems, I lack the right badges in my collar to get my advice noted. Sucks, big time.

Jira, SOAP and Python

Posted on April 16th, 2009 in Jira, SW development, python by Juha

Jira is one of my favourite applications currently. Together with GreenHopper it gives a fine way to manage agile projects. It’s really okay, give it a try. But most importantly, Jira has SOAP API, which grants possibility for external integrations. Only sad part is that Atlassian only supports Java clients, and my tool for trade is Python.

One of the most irritating problems when using SOAP through python is the conversion of Python’s long to BigInt in java. As Jira uses long-type in id-fields this causes Bad type exceptions. Fortunately there’s one thing that comes very handy: it’s called JPype: http://jpype.sourceforge.net/, though probably any Python to Java bridge works. Here’s a little bit that does the trick:

import SOAPpy
 ...
 
 from jpype import *
 startJVM("C:/Program Files/Java/jdk1.6.0_07/jre/bin/client/jvm.dll", "-ea")
 permissions = self.soap.getPermissionSchemes(self.token)
 
 #Now let's change the id of permission set to Java long from python long:
 permissions[0]._placeItem("id",java.lang.Long(permissions[0]["id"]),1)
 
 #iterate through permission set's child elements and do type conversion:
 for i in permissions[0]["permissionMappings"]:
            i["permission"]._placeItem("permission",java.lang.Long(i["permission"]["permission"]),1)
 
 #now just create the project:
 self.soap.createProject(self.token,"PROJ","Projname","info","http://whatever.fi","lead",permissions[0],None,None)

Basically we just cast the Python long’s used in id-fields to Java long’s and Jira’s is pleased. For serious clients it’s adviced to extend the SOAPpy’s struct class to mimick the actual java objects like remote-permissionsets and so on so we act with custom made objects, but you get the idea from here if you need.

This bit is also posted as a comment to Jira’s SOAP client Confluence page: http://confluence.atlassian.com/display/JIRA/Creating+a+SOAP+Client

About being good

Posted on April 15th, 2009 in general rant, work related by Juha

This is a fresh start. Too tired to start a whole new blog, and since this echoes of the past should not be forgotten, let them just be. And anyway, I still hope that on some day I still have time to do some actual tinkering besides just working. And there it was, the unfortunate word: work. The word that has a pretty much stronger echo in my ears than in the past. Not because my work itself would be glamorous, nooopey. I just have a loan to pay that’s all. So from here now on, I’ll mostly be talking about things in general, and that’s just fine. Today, it’s about being good.

And to be a bit more accurate: to be good at what you do, which kinda intersects with this working thingie, because well, I _want_ to be good at what I do. Also at work. Emphasis on the word: want. It’s not my right to say if I am, but I reserve the right to say _who_ do _not_want_. You see the little difference there? Thought so. In the organization I work for, it’s not so obvious that people want to be good at what they do. It’s probably more a question of “managing” at what they do, and sometimes not even that. And well, it’s sometimes a bit problematic.

I’ve been told that it is a part of the culture at our workplace. That disturbs me. You see, I’m pro multi-culturalism. And this is something that crosses my idealism. That was a joke, and actually I’m not disturbed. I’m just blindly raged. We cannot all be good (except that we can). I’m lousy at quitting smoking, though I sometimes try and manage for a while. This is one type personnel at workplaces actually. One tries and tries, until something new comes up that cannot be understood straight away, so one stops trying.

Again, if you ask my girlfriend if I’m good at cleaning up the house, she’ll say that I’m good at cleaning bathrooms but otherwise I suck. And that’s true, and what’s worse, I don’t have any interest about trying to learn proper ways of cleaning our wooden floor and all nyances alike. But I know I should, because at the moment I’m relying to my girlfriend on doing those things, and that probably irritates her a bit. This is also one stereotype often found from, not only mine, but other workplaces as well: the persons who have been in the house for 5-10 years and if they are forced to do something that does not fit to their expertice, they’re quiet. So quiet that in the last few weeks of the project, other people will have to cover gaps that they left.

There’s also one other version of this hermit: the one that comes to your cubicle every day, asking “how do I do this?”. This is actually quite fine, because I believe that he/she _wants_ to be good and is ready to make some effort. But when the question is phrased like this: “Tell me again, how did we do this last time?”, the condition turns red because the ship is sinking.

It’s about wanting to be good. This is about wanting to be good. About the things I want to learn and understand. This is the purpose of Tinkeridoo.

Something in this YLE Areena thing that stinks

Posted on March 3rd, 2008 in Meta by Juha

This isn’t so much related to gaming, sorry.

Okay, Finnish public television company (don’t know the official name, but we call it YLE), offers some of their series and programs in internet for all people to watch, should you have missed in on broadcasting time. A nice thought, really. The site is called “Yle Areena”, and is quite nice to use. There’s just one thing.

Well, I tend to use Linux. And you guessed right, the streams are some kind of WMV things, capsuled to that you cannot watch them without making some extensive codec magic. That’s just so freaking wrong, if you ask me. Luckily we have the good software called Mimms, which comes to the rescue (this due to fact that watching WMV-streams through some mplayer plugin is generally… well, not so nice, so it is easier to just rip the stream to a file).

I made a python class that handles the ripping for me, and a cgi-interface to that (not so cleanly and nicely done, but does the trick). So here it is. This due to the fact that I have a mythtv setup at home, and a webserver running, so I can just pull a laptop and fill the url from YLE and push a button to have the stream ripped to the mythbox. Nice. The url to use is the “Ohjelman suora osoite” -one.

And remember to confugre cgi things right from htaccess or from apache if you use it like that.

Areena Ripper

NOTE: There’s some shitty streams that this class isn’t capable of ripping yet. Sorry about that.

Permanency and some database magic

Posted on February 3rd, 2008 in Neverwinter nights, tinkering by Juha

For a long time I have had the urge to take a closer look at the database systems developed to Neverwinter nights. I have had the impression that the build-in database system isn’t actually so good for permanent worlds, and that’s what were aiming at. I thought there would be some hack that would have somehow added ‘native’ support for most common database types, but I was wrong. Fortunately I found a solution from Nwn2x.

I have to say that I don’t like it. Meaning, that this is something that should have been added to nwn natively, and from the start. But it seems that the Nwn2x solution does the magic of adding database functionality as smoothly as it can be done: by adding an extra layer to the server process. This is something I don’t like, but the need for databases overcomes this uncomfortableness.

And this seems to work. I like the idea of having some kind of IPC between neverwinter nights and some other application. I can now use mysql-database for these needs. More common use would be saving of some permanent variables of course, which would allow better plot developement, but this IPC thing is so much stuck to my mind that I have to do some tinkering related to that. Besides that speaking signpost I made for demo purposes today, that’s not exactly sensible. But feeding the input for the sign post from WWW-form is cool :)

Anyway, need for database connectivity in Neverwinter nights? Check the NWN2X, the linux version works fine, even if it is a bit outdated.

NWN webgui: new version, first test

Posted on February 2nd, 2008 in Computer games, network games, tinkering by Juha

My NWN webgui didn’t actually pass with flying colours from the first test with several players. I noticed that more than one time the status query didn’t work, but fortunately I have a hunch why. I also fixed at least twice the saving routines, that handle the directory moving from one place to another when game is saved. It now pretty much depdends on five second delay, rather than checking when the actual saving has ended. But wwwwwwell… I can cope with that delay, though it has to be corrected. Whew.

NWN webgui: first pictures

Posted on January 28th, 2008 in Neverwinter nights, tinkering by Juha

Again, some minor achievements on webgui tinkering-project. I decided to post some lousy pictures, I really am not good with these CSS thingies, or html-stuff at all. Found out that the subprocess-module in python is a given gift for IPC-thingies, even though I had to do some “not-so-fancy” stuff for non-blocking fifo:

infile = os.fdopen((os.open(settings.pipe_in,os.O_RDONLY | os.O_NONBLOCK)))

I guess there would be a nicer alternative, but that does it anyway. Cleaned up the scripts a bit, so the “new” version is a bit more better on the performance side (it used to do some stupid polling to the server itself, now it just checks that the process with the pid exists).

anyway, here’s a picture with the server running:

nwnguion1.JPG

And here’s a picture when the server is dead:

nwnguioff1.JPG

Try not to mind the debug stuff shown. This will probably never be so finished that I’d have the courage to publish this :)

Something to look forward to: Final Fantasy Crystal Chronicles: The Crystal Bearers

Posted on January 27th, 2008 in Wii games, network games by Juha

Final Fantasy: Crystal Bearers

Indeed, I’m a bit of a fanboy what comes to Square Enix. I’ve played a few games of Final Fantasy series, that japanese styled RPG, and enjoyed. Even if the storyline doesn’t vary much, and doesn’t give many plot alternatives, the mood is downright correct all the time. They know how to do that, aye.

I bought Crystal Chronicles for Gamecube, and I liked the actionbased design. Again, the mood was right, though single player game started to get very boring. I never understood the need for integrating game boy to multiplayer mode, so I really don’t have any experience about that. Too bad, my guess is that it would be very much fun. At least a bit more much fun that Baldur’s Gate II on gamecube, which we have been played much with V. And that has been good fun.

Wikipedia article says that the Wii version will focus more on single player. I’m not sure what to think of that. Right now Wii suffers from lack of good network games, and this would have had good potential for being kind of an ice breaker in that matter. Hard to think much more fun, than gather a crystal caravan from your friends and go exploring a magical world that Square Enix has made. I just a bit afraid that they’ll screw that up, by making some kind of hack & slash vs. based network system.

I actually wonder why wii is suffering from lack of network games? Or good games at least. I should really take some time to study the network gaming framework for wii, if that would reveal some stupid things, which actually wouldn’t surprise me. All in all, I have the impression that 7th generation consoles could have really good network gaming possibilities. I’ve heard that Xbox live is good enough framework for good multiplayer fun. Why would Nintendo be any worse?

Next Page »