Back Online

July 20th, 2010 .

Hey all,

So switch the server from a windows box to a linux box and got all the servers working again! It took me a while to do, but was pretty much straight forward in the end. Just that the permission system is really annoying sometimes on Linux.

Services switch from W2L:
* teamspeak
* web
* dbms
* version repos

Chryzo

EasyMYP version 2.6 – Release

August 19th, 2009 .

EasyMYP version 2.6 is released!

It adds / improves the following list of features:

  • Dirties up the code a bit more due to it being beta and having new functionalities
  • A tree view is now available to peak into the archives
  • You can extract anything you want from the tree view by using a simple right click
  • Drag & Drop files in the application to load them, no need to go through the menu anymore!
  • Drag & Drop items from the archive tree to the file system tree!
  • Huge speed increase in lots of places
  • Multi threaded the extraction of files in order to separate read and write operations
  • Last but not least: Persistent options!

Still learning loads of stuff when working on functionalities for this application, so keep them coming!
The application can be found at: EasyMYP on GoogleCode

EasyMYP version 2.6

July 7th, 2009 .

EasyMYP version 2.6 Beta is up and about!

It adds / improves the following list of features:

  • Dirties up the code a bit more due to it being beta and having new functionalities
  • A tree view is now available to peak into the archives
  • You can extract anything you want from the tree view by using a simple right click
  • Huge speed increase in lots of places
  • Multi threaded the extraction of files in order to separate read and write operations
  • Last but not least: Persistent options!

Still learning loads of stuff when working on functionalities for this application, so keep them coming!
The application can be found at: EasyMYP on GoogleCode

Hyper-V, corrupt virtual machine ?

June 6th, 2009 .

A while back, i had a proof of concept on a hyper-v virtual machine. Said machine, one day, crashed (hypothesys being that the antivirus scanned or tried to write some place not possible due to physical disk limitations). On reboot the machine would not start and the admin told me it was corrupted or something and i had lost the data of the machine.
Since the application was a POC, i did not really care but my boss was still intent on getting the data back…
So i started to take a look into how I could get the data back. So, I downloaded WinImage to read VHD files. Though I could open my file, all my data was absent :( . Searching a bit more I got an AVHD file but could not open it with WinImage. Thus I found that Hyper-V disk files are split into 2:

  • VHD: contains the image before boot of the VM
  • AVHD: contains the modifications of the VM, you may have more than one

Those files are not merged until you actually shutdown the VM… pretty annoying. To merge the files, it is pretty easy. You do not need a Hyper-V server, I was fortunate since my admin was stubborn enough to keep telling me I could not get the data back. You can simply use Virtual PC 2007 and the disk wizard utility.
Once the files were merged I was able to get the data back without any corruption whatsoevre.
And, since the VM config file was corupt, I asked the admin to reload the merged disk into a new server. Only problem is that the new server was not seen as the old one and I got into some authentification poblems with the application on the domain.

So, to end this post, if you have corrupt files, first merge the VHD and AVHD files. Check if you can open them through windows 7, server 2008 or WinImage. As for the server not rejoining the domain, I ll let some AD expert answer if it is possible or not. I think so, but I may be Wrong.

And as a last note, before increasing the size of a disk in Hyper-V, you need to merge the VHD and AVHD files!

In the hope this may help other people

LUA: Classes and Instanciations

April 27th, 2009 .

If, like me, you tend to be a bottom up learner you usually never read the manuals except when you need to. And this is, for once, one of these times. Only reading the class parts of the manuals/wikis (IE: http://lua-users.org/wiki/SimpleLuaClasses and http://www.lua.org/pil/16.1.html ) is actually not really enough to be able to make classes always work as you want them to.
If you also tend to adapt examples to your requirements (no need to reinvent the wheel), here it might actually go wrong. In the examples given in the two previous link, the writers tended to forget about the differences between metatables and tables completely confounding me :) .
In the example below:

function Account:new (o)
o = o or {} — create object if user does not provide one
setmetatable(o, self)
self.__index = self
return o
end

self equals Account and the metatable of Account is also Account which creates an infinite loop which needs to be treated if you try to save / dump the instanced variables.
To solve this, use instead the following syntax:

function Account:new (o)
o = o or {} — create object if user does not provide one
setmetatable(o, {__index = self})
return o
end

When you retrieve the saved variables don’t forget to set the metatables to what they should be too :)

And if I am totally wrong in what I just posted, I ll be glad to be corrected. I really do have a hard time with the Lua OOP model, guess I still have lots to read / learn.

WordPress Xslt Processor plugin – follow up

April 18th, 2009 .

So, a user of the plugin asked me on how to make the plugin also have parameters for the xsl file. And I ended up coding it because it seemed simpler that way.

This this post servers as much as a test bed as a presentation of the different kind of options one can use:

So lets start with the most basic way to use this plugin:

Use:

[XmlProcessor wp-content/plugins/CPT_XslProcessor/example]

Result

[XmlProcessor wp-content/plugins/CPT_XslProcessor/example]

or:

[XmlProcessor xml=”wp-content/plugins/CPT_XslProcessor/example.xml” xslt=”wp-content/plugins/CPT_XslProcessor/example.xsl”]

Result:

[XmlProcessor xml="wp-content/plugins/CPT_XslProcessor/example.xml" xslt="wp-content/plugins/CPT_XslProcessor/example.xsl"]

Now, lets say you want to add options to the xsl file:

Use:

[XmlProcessor wp-content/plugins/CPT_XslProcessor/example params=”default_param=this is the replaced default parameter”]

Result:

[XmlProcessor wp-content/plugins/CPT_XslProcessor/example params="default_param=this is the replaced default parameter"]

or:

[XmlProcessor xml=”xml_filepath” xslt=”xslt_filepath” params=”default_param=this is the replaced default parameter”]

Result:

[XmlProcessor xml="wp-content/plugins/CPT_XslProcessor/example.xml" xslt="wp-content/plugins/CPT_XslProcessor/example.xsl" params="default_param=this is the replaced default parameter"]

And that should actually be working now :)

LUA and overloading

April 7th, 2009 .

I am coding some mod in LUA for some game and I hit a snag and it actually took me quite some time to solve it due to several functionalities not available through LUA to control some of the interface elements and thus transformed the snag into lots of small snags to get what I wanted to work.

But the last snag I hit, after clearing the others, was really annoying, in the API there was a function like: removeSmthg(ID) but also removeSmthg(NAME). And being unfamiliar with the language as always I forgot that LUA doesn’t handle type-based function overloading, so only one of the function actually worked… the one I was not using. Once I found that out, it ended up being quite easy to actually do what I wanted at the start.

And because it is blogged, I should remember it next time!

WordPress Xslt Processor plugin development

April 5th, 2009 .

Need

If any of you actually read my about me page, you know that this blog ended up being more than foreseen. Thus I required to have more liberty in some of the things i wanted to do.

Typically you may have a resume in a pdf or document format. How do I include such a document inside the theme of WordPress ? How do I include content from a webservice / an xml document in WordPress?

To answer part of this need, I made a request on the wordpress forum to no avail and I ended up coding it. Fortunately the WordPress API is very well made though the documentation is a bit lacking in some places. In WordPress you can have:

First I tried using filters but due to the encoding and escaping done by wordpress my regular expressions would not work. I loaded my prefered IRC client and connected to the #wordpress channel on freenode. Lots of help and advice there and information too. Taking their advice into account I used Shortcode which actually remove all the requirements for parsing the code yourself. WordPress provides the Shortcode API for that.

What about the Plugin ?

The plugin that I am now using takes an XML and XSLT files, process it and output to the window. For an example of how to use it see my “resume” pages.

If you want to use this plugin, you can find the latest version on WordPress: XslProcessor

(At the time of this note, the code is not yet uploaded. Approval from WordPress has not yet been received)

Hope you find it as usefull as I do.

ASP.Net, XML, XSL-Transform

March 23rd, 2009 .

Here is a quick way to use ASP.Net to show some XML documents. One will find information such as Reponse.Write and stuff like that. Those information are for older version of ASP.Net when the xmlDocument was not implemented yet. So here is what one need:

In the aspx page, use the xmlDocument control:

<asp:Xml ID=”xmlDoc” runat=”server”></asp:Xml>

In the code page, use the following code in the page_load section:

if (File.Exists(Server.MapPath(e.Filename))){

xmlDoc.DocumentSource = Server.MapPath(e.Filename);
xmlDoc.TransformSource = Server.MapPath(“SC-SD-Transform.xsl”);
}

And it should be working fine now. You can also use events and such if you would rather not put it in the page_load section.

Shaman King

March 22nd, 2009 .

The manga Shaman King was stopped in April 2008. However it restarted in march 2009!

If you don’t know about Shaman King, it is the story of people who can see spirits and interact with them. Every 500 years a fight occurs among all the Shamans to decide on their King. The king being the shaman that can interact with the great spirit, the one to which every soul on earth goes back to when their body dies.

If you want to read it online you can always go to: http://www.onemanga.com/Shaman_King/

Have fun!