dracoblue.net

Refreshing workspace to recover changes ... crash

Since I am using

lunareclipse-plugin + eclipse 3.2 for lua development, I sometimes face the problem (when my pc got switched off too early when trying to hibernate) that eclipse does nothing but crashing when I try to start it.

Log states something like that:

!ENTRY org.eclipse.core.resources 2 10035 2009-06-30 22:19:06.772
!MESSAGE The workspace exited with unsaved changes in the previous
session; refreshing workspace to recover changes.

... and crashs.

I managed to make it working again, by heading to the workspace directory.

workspace.metadata.plugins\org.eclipse.core.resources and removing the file

.snap.

In Eclipse, Lua by DracoBlue @ 2009-06-30 | 91 Words

DJson 1.6 released

Today I want to announce a new release of DJson. The 1.6 is now using a different method to create the cache-file, which allows running multiple djson-scripts (like filterscripts) at the same time.

Also it features a method to define own DJSON_MAX_STRING (before include of djson), if you need really big content.

The internal djson cache allows a maximum of ~ 70 characters (255-filenamelength-keylength-170) for a value, if DJSON_MAX_STRING is set to just 255.

Head over to the official

DJson page or directly to the djson 1.6 download.

In DJson, open source, pawn by DracoBlue @ 2009-06-21 | 89 Words

urlencode in Pawn

When creating new REST-ful API for GTAT (based upon my pwncurl and a lua backend) I had to implement the method urlencode in pawn.

So I took a look at the specification in RFC 1738 to get information about what characters need to be encoded.

RFC 1738: Only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.

Since I really want to be sure that all is encoded properly and %xx encoding is

Continue reading ...

In dutils, pawn, pwncurl by DracoBlue @ 2009-06-20 | 243 Words

Morph css background-position in Internet Explorer

If you try to set the CSS-property

background-position in Internet Explorer (I tested with 7) and even use that with Mootools' morph/tween-functions, it will not work.

You can workaround that issue, if you set also background-position-x and background-position-y (actually ignored by my Firefox 3.0).

This is the code, I use at koala to move the background upwards.

$('body').morph({
	'background-position':'0 -140px',
	'background-position-y':'-140px',
});

In CSS, Internet Explorer, JavaScript, Mootools by DracoBlue @ 2009-06-16 | 66 Words

Renaming a file in Pawn

If you are using pawn (for instance in san andreas multiplayer) and want to rename a file, you'll not find a method like frename.

You can either use my

dutils (pawn only solution) or a plugin (like Yless' YSF) to add frename to your functions.

If you want to make a plain pawn solution, and don't want to use dutils, here is how I made it.

There are two steps.

First you'll need fcopy (copies the file):

ohnd=fopen(oldname,io_read);
nhnd=fopen(newname,io_write);
new buf2[1];
new i;
for (i=flength(ohnd);i>0;i--) {
    fputchar(nhnd, fgetchar(ohnd, buf2[0],false),false);
}
fclose(ohnd);
fclose(nhnd);

And then you'll need to remove the old file.

fremove(oldname);

Remember, that on linux those methods will not work (since fputchar is bugged on linux). You need to use the pawnonly frenametextfile and fcopytextfile from

dutils for that.

In pawn by DracoBlue @ 2009-06-13 | 131 Words

Page 25 - Page 26 - Page 27