Category: Development

code_swarm

Posted by – 2010/02/14

I’ve been playing with code_swarm and made this video of the Irrlicht Engine’s development history:

Since the video is generated from the SVN version history it starts at the point where Niko gave hybrid and I SVN access (June 2006), so misses out years of development leading up to the 1.0 release.

code_swarm is a really cool tool, one thing which is exciting is the fact it supports MediaWiki. It would be really nice to show a small wiki coming together.. or maybe one day Wikipedia’s entire changelog (we can dream!)

Interpolated list class for Python

Posted by – 2009/12/12

While messing with Python to output some better graphs for my Facebook group scraper I stumbled upon an interesting problem. What happens if you have missing samples, or want to change the sampling frequency half way through your log? Well, you could use a proper math library and have extra dependencies or generate the missing data manually, but the simplest answer I could think of was to write a list class which interpolates between missing values, so you can do something like this:

>>> a = InterpoList()
>>> a[0]   = 0
>>> a[100] = 200
>>> a[200] = 0
>>> a[50]
100.0
>>> a[125]
150.0

And then store the time values as seconds past the epoch. Now I can inject data from multiple sources taken at different frequencies and retrieve an interpolated value for any time, which means more nice graphs like this:

As usual I also decided to share it with the Internet, because I’m nice like that! You can get a copy of the InterpoList module here.

Irrlicht 1.6 Released

Posted by – 2009/09/30

So, we finally released Irrlicht 1.6. This release has lots of bug fixes and plenty of new features for you to sink your teeth into!

I’m sure I’ve missed out lots of stuff, but here’s a summary of the most interesting new features…

More…

Songs in code

Posted by – 2009/09/15

I’m a bit late on commenting on this Twitter meme as it’s over a month old, like all memes it’s a variation of something as old as the Earth and just recently revived. The concept is simple, just write a song lyric or title as a code snippet, set it as your status and share with others by linking the #songsincode hashtag. That’s all.

Someone’s even made a database of all the posts where you can vote on the entries. Most are boring and just consist of lyrics padded out by punctuation, but there are some quite creative, non-obvious ones which use programming constructs to infer the lyrics. Here’s mine

(Hover over the links for spoilers)

class BillieJean : public girl
{ 
  int i; 
  relationship lover;
public: 
  BillieJean(relationship &me) 
  : lover(!me), i(1) {} 
};

spoil

body() { 
  print '<body>' . body() . '</body>'; 
} 
love() { 
  body();
}

spoil

/* mon = 255; tue=wed=0xaaaaaa; */ 
if (friday)
  love.insert(me);

spoil

GET /back.html HTTP/1.1
 
HTTP/1.1 301
Location: /you_once_belonged.html

spoil

Some of my favourites (with slight edits):

video$ kill -9 `ps -ef | grep radio*`

by brozow

int main() {
  return -1;
  get_Satisfaction();
}

by stevecooperorg

$live = ($you==true) ? false : false;

by o_Freud_o

$i = '<HTML><HEAD></HEAD></HTML>';

by whybird

class City : Rock, Roll {};

by alexmdac

try {
  get(WHAT_YOU_WANT);
} finally {
  get(WHAT_YOU_NEED);
}

by rickgrundy

/dev/null << shout();

by plikrg

PHP file list using mod_rewrite

Posted by – 2009/09/14

I’ve noticed that most of the traffic to this site is actually people visiting my permanent and temporary file dumps, which until today were literally a bunch of files dumped in a folder. DreamHost don’t keep my logs for over 30 days and I’d like to incorporate my file dumps into my Piwik stats, so I made a nice fancy file list in PHP. It has nice looking icons courtesy of famfamfam, though may move to stdicon in the future.

Some caveats:

  • The file list currently tracks directory views (via the template) but not yet file downloads, as that requires a Piwik plugin that isn’t final so I haven’t installed it, adding it should be trivial though.
  • As requests are passed through PHP using mod_rewrite it will result in long running scripts on your server, which may upset your shared web hosting provider.
  • Scripts are not yet excluded by rewrite rules! You won’t want to keep other scripts containing sensitive information in dirs under the path.
  • Access to files and folders beginning with “.” will be blocked.
  • It only works on Unices, not Windows servers as they don’t have the “file” command to get the MIME type.
  • You’ll obviously need an Apache installation with mod_rewrite.

To install it, just copy index.php, .htaccess and .filelist/ to the directory where you store your files. You can get the script (without icons) from SVN.

This [e107] page has moved permanently [to gallery2]

Posted by – 2009/09/06

If you do a Google search for some of my really old code, like my Python T9 Dictionary or XBMC IRC MP3 downloader, you’ll notice that my pagerank has been carried over to SVN and the gallery. This is because Google and other search engines take note of HTTP 301 response codes and update their links accordingly.

When I migrated from e107 to WordPress and Gallery2, I replaced download.php with a redirect script which redirects to the gallery, svn or file dumps. The script looks like this:

<?php
// lots excluded
$table['4']='http://svn.bitplane.net/misc/trunk/py/py9/readme.txt';
$address = 'http://bitplane.net/';
 
foreach ($_GET as $i => $value)
{
  $index = explode('_', $i);
  if ( isset($index[1]) && isset( $table[ $index[1] ]) )
  {
    $address = $table[ $index[1] ];
  }
}
 
// send 301 (permanent redirect)
header("HTTP/1.1 301 Moved Permanently");
header("Location: " . $address );
?>
<html><head></head><body>
This file has permanently moved <a href="<? echo $address; ?>">here</a>
</body></html>

So when you try to view PY9, you’re redirected to the new location. There’s no excuse for 404 errors when you move your site around, if you care about keeping the web up-to-date then please use a redirect script!

PISG is up again

Posted by – 2009/09/04

Now that I have a reliable shell, #irrlicht once again has an eggdrop bot, which will be useful because we haven’t had any way to add new operators for at least two years. The bot is logging and there’s a cron job to upload PISG output to the stats page. So anything you do say will be taken down and may be used in evidence against you…

bitplane also makes sailors blush, 0.3% of the time.

Oh, shiiii…

Irrlicht 1.5.1 for OSX

Posted by – 2009/08/20

I just uploaded an OSX release for Irrlicht 1.5.1, it includes an installer and installs Irrlicht as a shared libarary (Irrlicht.framework). This will be the first of many platforms supporting Irrlicht as an official, installed shared library.

Update: Now available from the Apple website, though they credited bitplane.net and removed the YASS credit for the screenshot. Next time I’ll submit a shorter description!

Irrlicht 1.5.1 Released

Posted by – 2009/08/06

Yesterday we released Irrlicht 1.5.1. This will be the last 1.5.x release, development is now focused on 1.6 which will move to its own branch over the next week or so and become stable.

Changes in 1.5.1:

- Make sure a missing font does not corrupt the skin.
- Fix getAngle in vector2d as suggested by xray.
  This has only a minor impact on s32 vectors.
- bugfix: CGUIFont::getCharacterFromPos regards now kerning
  (found by Arras)
- Add support for range fog in some OpenGL versions.
- Fix for shadow volume removal, submitted by vitek.
- Avoid using X11 autorepeat to deal with broken X11
  versions.
- Speculars are properly exported into mtl files now,
  instead of corrupting them.
- Binary type loading in attributes fixed.
- bugfix: Use make_lower throughout for spritebank filenames
  (found and patched by Ion Dune)
- STL loader fixed: Right-handedness corrected, normals and
  bboxes are correctly added now.
- bugfix: CUnZipReader::openFile no longer returns true for
  empty files. Corresponding test added.
- Big endian issues in .x loader fixed.
- HSLColor methods repaired.
- copyToScaling fixed.
- Fixed problem with highlighting menus when mouse was
  outside sub-menu area.
- bugfix (2796207): menu acted (wrongly) on left-click down
  instead of left-click up.
- bswap16 fallback macro fixed
- getBaseName fixed to work correct with dots in filenames.
- static method isDriverSupported allows for simple
  check of available drivers.
- Some defines added to check for the Irrlicht version of
  the library.
- Make sure all renderstates are properly initialized
- Wrong size for main depth buffer fixed.
- Fix 3ds shininess to the allowed range.
- Fix loading of Collada files from irrEdit 1.2
- Remove texture pointers after texture clear.
- WindowsCE pathnames fixed.
- Some virtuals are now overridden as expected.
- Incomplete FBOs are properly signalled now
- Update to libpng 1.2.35, fixed issues on 64bit machines
  with system's libpng.
- Fixed wrong grab/drop in setOverrideFont
- Added draw2dRectOutline
- rectf and recti added.
- Fix ALPHA_CHANNEL_REF to a fixed check for alpha==127 as
  expected.
- Fixed OSX device bug where screen size was not set in
  fullscreen mode.
- cursor setVisible changed to be called less often.
- OpenGL version calculation fixed.
- OSX device now supports shift and ctrl keys.
- Fixed ambient light issues in burningsvideo.
- device reset for d3d fixed when using VBOs.
- Fix dimension2d +=
- MD2 mesh loader: Now uses much less memory,
  reduced number of allocations when loading meshes.
- OpenGL render state (texture wrongly cached) fixed.
- Fixed animator removal.
- Changed collision checks for children of invisible
  elements to also be ignored (as they're actually
  invisible due to inheritance).
- Fix terrain to use 32bit only when necessary, make
  terrain use hw buffers. Heightmap loading and height
  calculation fixed. Visibility and LOD calculations updated.
- Some mem leaks fixed
- FPS camera resets the cursor better

Irrlicht nightly builds 2.0

Posted by – 2009/07/20

Irrlicht nightly builds by ConvexTech are back again, not only with D3D9 compiled in to the Win32-gcc builds but we even get VisualStudio AMD64 builds too! A big thanks to Marc Burns for providing this service :-)

I’m hosting a mirror, it’s not much compared the the overhead of compiling the builds, but every little helps, right?