Sunday, 2 August 2009

Gimp Extrude? Blargh!

This was my 1st attempt using Inkscape and it involved my nice bought typeface being "Put on Path" of a bezier curve then copied and moved down a little with the two layers being filled with different colours:

First attempt

My 2nd attempt - after trying and trying and finally failing to find a Extrude Filter for The GIMP (thus the "Blargh!") - involved a different program's extrude function but with the same two colours but it is ever so much better:

Second attempt

The 3rd, and I think final, attempt used the same programs extrude function but with lighting effects. Much better and will hopefully stand out ever so much more:

Third attempt

And here, just because I like animations, is all three combined with the power of The GIMP:

All three attempts

What is the Hex value of "MAILBOX RED" from B&Q? After taking a picture of the paint with the lid off and checking the hex value using the dropper tool it looks to be #FF2718, or rgb(255, 39, 24), and not #FF0000 as I was expecting.

Forth attempt

Gold is apparently #FFD700 (rgb(255, 215, 00)) or #FFCC33 (rgb(255, 204, 51)).

Gold:

Fifth attempt with gold

UMM Gold:

Sixth attempt with UMM gold

Last one for now:

What it should look like!

Sunday, 26 July 2009

Perfect Water Filtration System for a Live-A-Board

In Thursday's Guardian IT supplement there was a fantastic article about Dean Kamen. I sort of remember a little about his water filtration system, which is apparently now code-named Slingshot, on an online video and I was fascinated by it, not least because the water on the boat was so undrinkable at the time! Try as I might I couldn't find out anything about it but it now seems as though the reason was is that it was a prototype and not available. The idea of having something with about the same mass as the water tank on the boat but that would create unlimited water from a source as oft-times filthy as the Cam was cool! It didn't seem as though it'd take much in the way of electricity either!

Then After looking at his website I came across his Sterling Engine design. All of my power and water requirements met in two handy packages... except... again it's a prototype!

There are plenty of cowpats on Stourbridge Common now that we've a load of bullocks grazing (It's why I have to leave my shoes outside). How cool would it be to get them all drying out in the beautiful Cambridge summer sun and burn 'em to reduce greenhouse gas emissions from the methane... not to mention saving the diesel I use going up to the end of Stourbridge common or Jesus Green every fortnight to fill up with fresh, potable, water. Could even use the Sterling Engine to provide for my limited electrical needs? I guess, what with it providing heat, I could cook with it and get rid of the Calor gas? Though we're doing pretty well on that front as it goes, at least until it goes up in price again.

Tuesday, 21 July 2009

Shadowed A

I'm trying to do a drop-shadow in Inkscape, but not any old drop-shadow... it's be easy to use Gimp... or perhaps not for the effect I'm looking for. This tutorial comes close but what I'm after is something like narrow boat sign-writing; An almost 3D effect where each letter is flat face towards us but has been extruded from below - if you see what I mean?

I've bought a lovely typeface called Modesto Expanded that would work a treat but just now I've no joy finding an example of the effect I want except the Grace Darling image on the Vimart Signwriting site.

Sunday, 19 July 2009

Install Flash to Portable Firefox without Admin Privileges

I run Portable Firefox from Portable Apps on a fairly regular basis but when I find myself on a machine where I haven't got Admin privileges I need to run another program (in this instance 7-zip), again from Portable Apps.

I download http://fpdownload.macromedia.com/get/flashplayer/xpi/current/flashplayer-win.xpi, open the flashplayer-win.xpi with 7-zip and extract the flashplayer.xpt and NPSWF32.dll files to the \FirefoxPortable\Data\plugins folder. Start up Firefox again and all should be well and you can browse YouTube to your hearts content.

I've learnt this trick from a number of sources and used to use it to get the now defunct Adobe SVG plugin to work nicely with Firefox... I did however refresh my memory using the answer posted on Acid-Labs: Installing Flash in Portable Firefox with no installer... particularly the one by Vishwesh Sharma (No. 12).

This got me thinking about installing the Adobe plugin in Firefox 3.5 and, despite following the instructions from 2006, I couldn't get it to work... such a shame Adobe stopped updating it as it's scripting support was excellent.

Wednesday, 15 July 2009

Brute force TrueCrypt when you sort of know the password.

So a friend asked me to generate all possible combinations of two words, he uses two words as passwords and mixes up the capitalisation of those words so that if he has the two words "apple" and "pears" as possible passwords then he could have something like "aPpRe"... there are loads of possibilities but not as many as there could be because each letter position would only have 4 possible letters. For example the third letter can only be "p", "P", "a" or "A". Mathematically we're looking at four possible outcomes for a one letter password, sixteen for a two letter word, 64 for a three letter word... 256... 1024... 4096... 16384... 65536... 262144... 1048576 for a ten letter password.

Doing it by hand is just about possible if you're only looking at a 3 letter combination but otherwise...

Seeing as I'm relearning Java I thought I'd have a crack (after getting lots and lots of help from comp.lang.java.help - I did say relearning!) and after trying to get my head around recursion and realising I'd done something with it years ago using JavaScript to parse an OWL file representing the management structure of an organisation I came up with the following file:

WordComb.java:

public class WordComb {
  public static void main (String[] arguments ){
    if (arguments.length != 2) {
      System.out.println("This program requires two arguments, please try again.");
    }
    else {
      if (arguments[0].length() != arguments[1].length()){
        char spaceChar = ' ';
        int argOne = arguments[0].length();
        int argTwo = arguments[1].length();
        if (argOne < argTwo) {
          for (int a = argOne; argOne < argTwo; argOne++){
            arguments[0] = arguments[0]+spaceChar;
          }
        }
        else {
          for (int a = argTwo; argTwo < argOne; argTwo++){
            arguments[1] = arguments[1]+spaceChar;
          }
        }
      }
      char[][] words  = {arguments[0].toLowerCase().toCharArray(),
                         arguments[0].toUpperCase().toCharArray(),
                         arguments[1].toLowerCase().toCharArray(),
                         arguments[1].toUpperCase().toCharArray()};
      char[] combo = new char[words[0].length];
      fill(combo, words, 0);
    }
  }
  public static void fill(char[] combo, char[][] words, int col) {
    if (col < combo.length) {
      for (char[] row : words) {
        combo[col] = row[col];
        fill(combo, words, col+1);
      }
    }
    else {
      System.out.println(makeString(combo));
    }
  }
  public static String makeString(char... word) {
    return String.valueOf(word).trim();
  }
}

All that needs is a little command-line redirection and you've a nice file to feed into your TrueCrypt cracker of choice...

Monday, 13 July 2009

Caravan Boat

A bit of a break here while I cogitate Java arrays.

Being a boater I'm always interested in these types of images:

Caravan Boat image
Caravan Boat image

The first links to the original article, I'm afraid that I've lost the source for the 2nd but I think I saw it on a LJ image trawl.

Saturday, 11 July 2009

for looping to infinity

I've an a 2-dimensional array that is best represented in the following tables; it has an arbitrary number of "columns" but only ever 4 "rows".

I need to produce the following "Possible" results programmatically.

+-+     Possible: a, A, x, X 
|a|               (4 * 1 = 4 possibles)
+-+
|A|
+-+
|x|
+-+
|X|
+-+

+-+-+   Possible: ab, aB, aX, aY, Ab, AB, AX, AY, 
|a|b|             xb, xB, xX, xY, Xb, XB, XX, XY
+-+-+             (4 * 4 = 16 possibles)
|A|B|
+-+-+
|x|y|
+-+-+
|X|Y|
+-+-+

+-+-+-+ Possible: abc, abC, abz, abZ, aBc, aBC, aBz, aBZ,
|a|b|c|           ayc, ayC, ayz, ayZ, aYc, aYC, aYz, aYZ,
+-+-+-+           Abc, AbC, Abz, AbZ, ABc, ABC, ABz, ABZ,
|A|B|C|           Ayc, AyC, Ayz, AyZ, AYc, AYC, AYz, AYZ,
+-+-+-+           xbc, xbC, xbz, xbZ, xBc, xBC, xBz, xBZ,
|x|y|z|           xyc, xyC, xyz, xyZ, xYc, xYC, xYz, xYZ,
+-+-+-+           Xbc, XbC, Xbz, XbZ, XBc, XBC, XBz, XBZ,
|X|Y|Z|           Xyc, XyC, Xyz, XyZ, XYc, XYC, XYz, XYZ
+-+-+-+           (16 * 4 = 64 possibles)

I've been trying this now for about 2 days and I think about it and think about it and finally think I've got there but then try it out and it crashes and burns... I've tried rotating the array as well to no joy (perhaps that warrants further investigation?)

Help solicited here.