My 10GB disk on my VirtualPC was nearly full to overflowing so I went looking on how to resize the virtual disk. There’s a free product that does this for you, but to quote an old song “I waved that thing all over the place, my boomrang won’t come back”. In fact I was using the app correctly but not understanding what the app actually did. This guide showed me the way.
It’s been a while since I posted, so what has been keeping me busy?
Work, it’s getting easier – I think I am getting into the VB6 mindset, but I still hate VBA with a passion. When is the nice .NET extension becoming available? Is it already, and could Reporting Services save our souls (not to mention our sanity)?
Space is coming along very slowly. Any time I sit down to work on it I have to spend about an hour refreshing my mind on what I have done – and I only have about 40 mins to do it in.
Had my birthday: One of my presents was an iPod from Mrs Bear – which gave me a lovely opportunity to hate iTunes all over again. This time I accidently deleted my play list, there is no undelete and then it synced it – wiping it. I’ve installed iTunes 9 but I don’t hold out any hope for them fixing all the problems with it. Another present is an ant farm – so along with my Sea Monkeys you could say I have Surf’n'Turf.
Another side effect of my birthday was my the choice of venues for a meal. Since I’ve always wanted to eat there I picked Kaminaki and had some of the nicest fish I have ever eaten, and definately the nicest pitta bread ever. All this and despite the grumblings of some of my friends.
…but not kissing. That would be like kissing a red-headed cousin or something.
As you do with anything programmig related you jump straight in at the deep end. In this case I wanted to take SVG input, and output a JPG, from PHP.
So taking a look around there wasn’t much to choose from:
- GD for PHP can take and output practically anything, but not SVG. And unfortunately its vector object model doesn’t seem to be as expressive as SVG is. There is GD::SVG, which is a perl module. Perl is enabled on the server (we have a horrible perl script for backing up the DB every hour but that is another post) but I’d rather not mess with a language I know nothing about.
- Call ImageMagick and have that do the conversion for us. While actually not that difficult, the cost of starting ImageMagick for each image is prohibitive – while you won’t get 300 people all trying to convert images at the same time, it is possible to get 10 or so clumped together.
- Call Batik to handle the conversion. I’ve used Batik and, if you ignore the first time cost of starting a JVM, it is wonderfully responsive. Unfortunately it is written in Java and Space is written PHP.
I know Java better than Perl, I decided to go with the Batik option. This means enabling the PHP-Java extension, which is simply editing the ini file to uncomment out the line that reads extension=php_java.dll.
In addition to that you need to edit the [Java] section of the ini file. And that is where things get problematic. If you read the scant information on installation you will find that the last known installation was with Java 1.4. I have Java 1.6.14. I found a pretty detailed instructions on the O’Reilly site for Java 1.2. Shouldn’t be too different should it? So I configured it as best I could and ran a simple test program:
<?php
ini_set(“display_errors”, “1″);
error_reporting(E_ALL);
$systemInfo = new Java(“java.lang.System”);
print “Total seconds since January 1, 1970: “.$systemInfo->currentTimeMillis();
print ” Java Version: “.$systemInfo->getProperty(“java.version”);
?>
The output was Fatal error: Unable to load Java Library C:\Program Files\Java\jdk1.6.0_14\jre\bin\client\jvm.dll, error: The specified module could not be found. in C:\Develop\projects\zerosumgames\php\map\htdocs\java.php on line 6 which is never pleasant. So I pushed and poked with the ini file settings – there are only 4 variables so there isn’t much to play with, but nothing would make it work.
So it sat on a back burner for a few days, nagging at the back of my mind: What if I used the JVM that they used themselves? That should work shouldn’t it? So I rooted around on Sun’s site and found what I was looking for: An archive of the all the old JDKs!
So I grabbed the last 1.2, 1.3 and 1.4 JDK’s (after reading very, very carefully Suns EOL agreement) and began by installing Java 1.2 and configuring the ini file:
java.home = "C:\Program Files\Java\jdk1.2.2\bin"
java.library = "C:\Program Files\Java\jdk1.2.2\jre\bin\classic\jvm.dll"
Bingo the output was Total seconds since January 1, 1970: 1248652639311 Java Version: 1.2.2.
Java1.3 went on – and worked too. This is exciting as Batik needs a Java 1.3 runtime (or compatible) to work: Total seconds since January 1, 1970: 1248652802706 Java Version: 1.3.1_20
What about Java 1.4? This gives Batik a speed increase and allows Batik to use additional features (though I don’t really care about mouse-wheels): Total seconds since January 1, 1970: 1248652920024 Java Version: 1.4.2_19
You beauty! So why doesn’t 1.6 work? Surely it is possible? I know the JVM has moved from the classic folder into a client and server folder, but the internals must surely be the same. I pointed at the correct location, but are there any other 1.6 JVMs beside the client and server ones? Well there is the one that exists in jre6 folder put that produces the same error as before.
And finally 1.5? Well I never tried that one – I have a working PHP-Java bridge – and now I need to move on to bigger & better things.
While researching this post I came across Image_Canvas which might do what I want it to and entirelly in PHP – no Java required. However the problem with the documentation is that it isn’t very thorough and your are pretty much on your own. If I get stuck with Java & Batick then I will probably take a closer look but until then…tada!
My employer of nearly 3 months is slowly moving to VB.NET. However a lot of their ‘legacy’ apps still need to be maintained and extended to support new methods, etc.
This involves VB6 and VBA. I was always in the position that VB6 was a mickey-mouse program for throwaway apps but not really suitable for real dev work – I was an elitist C++ programmer basically.
My view has shifted – you can really write large enterprise class apps in VB6. But one thing I can’t seem to shake off is the contempt the people who wrote VB6 IDE had for their users. Having used VC6 for a number of years you get used to certain things: Like if you start editing a file that isn’t checked out it will ask you if you want to start editing and then when checked out your caret is where you want it to be.
Not in VB6. You are informed that the file is locked. So you then have to right click on the file and manually check it out. But now the file closes itself and reopens with you looking at the top of the file.
Should I mention the 255 control limit? Who picked that as a number? (As an aside why is Excel 2003 limited to 1026 rows? Why 1026 and not 1024? Is that a typo?)
“Out of memory error”. I have 4gb in my machine. Why am I out of memory and why does that stop you from saving my last 15 minutes of careful debugging work? Why must you lose my break points?
And the mouse wheel doesn’t work.
This isn’t to say VC6 was all roses – far from it – but it makes you wonder if the VB6 team actually a) used it for anything b) gave a damn.
Found a solution to Eclipse problem – and it doesn’t involve Netbeans!
Get this…wait for it…You simply copy multiple version over the top of each other!
That’s right. Grab the latest J2EE version as that comes with all the bells and whistles that you will probably need. Extract it your program files directory. Then pop over to the PDT and grab the latest of that one too if you want to do PHP development. Now extract that over the top of your previous install and agree to all the messages. Start Eclipse and hey presto! you can now develop Java and PHP apps and have access to the database stuff you will also need!
Installation of eclipse add-ons to current installs is still shit.
Here’s a hint: WRITE A FUCKING INSTALLER THAN CAN INSTALL THE PREREQUISITES FOR ME. Don’t tell me that org.eclipse.ltk.core.refactoring is missing – install it for me. I don’t know where it is and it is certainly not in the DLTK section because I am trying to install the entire damn tree just to get rid of the error messages.
Life continues.
Slowly getting used to the way my new employer does things. It’s a little more strict than previous places but this is the largest organisation that I’ve worked for under one roof. Using VB after a break of 5 years is a real pain but apparently it is only going to be for a short time. There are plans to rewrite (why do I cringe when I hear that word?) the apps in VB.NET. Oh joy of joys. Between now and then I can try and wheedle my way into getting C# used. Meanwhile I am learning to swim again by being thrown in at the deep end. As a plus I don’t have to get up/leave so early and I get home an hour earlier too.
While this is going on I am still working on Space. Or rather trying to get Space to work on a local VM. There is little point in pushing forward with changes when the changes are so hard to implement, and the only way to test is on a live system. That’s just folly: If something breaks then we start to lose real money. Better to make a VM and play safely in there.
That means learning Linux. Which I have now installed a dozen times. Even the book on the subject doesn’t work the way it is supposed to. Fortunately I am savvy enough to figure out my way around where the book misses out one of the hyphens in –dport.
With learning comes confidence so I went and reinstalled selecting server as the install option and doing everything manually. However with Virtual PC as my VM I kept getting the ‘i8253 too high – resetting’ all the time which made working in Vim a nightmare. So I decided to give VirtualBox a try.
Oh my God! How fast is it compared to Virtual PC!?. It just rips along. The boot is a blur, the install of the OS is twice as quick and UI is feels more responsive. As a plus I haven’t seen the i8253 bug yet.
Just finished my first week back in work and though it wasn’t a full week, does give one some confidence once again.
However, the job isn’t my ideal one – working with mess that is classic VB (could be worse might be PHP) – but it is a job all the same.
Write code.
Test in Firefox: Works. Test in Chrome: Works. Test in IE: Fails.
Edit code.
Test in IE: Fails.
Edit some more.
Test in IE: Works. Test in FireFox: Fails.
Tweak a few more lines.
Test in IE: Fails. Test in FireFox: Fails. Test in Chrome: Fails.
GIVE ME SOME STANDARDS!!!
I’ve just run into one of jQuery’s thornier issues.
While creating a map viewer for the S:GTC I found my code worked in FireFox and Chrome perfectly but refused to budge in IE7. Some of you may know that the map in Space currently only works correctly in IE6 – not good when most of the planet uses something other than. I thought with standards being pretty much standard these days and the bits that are not yet standardised being abstracted away by jQuery (and the ilk) I thought it would be plain sailing.
Until I tried to get the value of background-position. Turns out that IE doesn’t support background-position for getters but supports background-position-x (and -y obviously). So you can suppose that concatenating the strings would get us to the point where we want to be. Yes? No.
In my humble program I need values. Pixel values. I don’t want em, %ages and I certainly don’t want it as a string. What use is that to me? Okay I can create a big switch statement for top, bottom, left, and right but what about center? To cope with that I’d have to check ahead to see what it is and then convert accordingly. So much for ‘Write less, do more’.
There is a whole raft of information on the Net about this very issue and I’ve ran into it after a couple of weeks but amazingly no one has offered a viable solution. There’s a handy test to see it in action. View it in your favourite browser and then check it out in IEx. That’s right Microsoft hasn’t fixed IE8.
Personally I am so frustrated with the whole situation that I feel like browser-sniffing for IE and banning them outright – not just inform them that they have a substandard browser. If all devs did that then MS would have no option but to fix it. Sod backwards compatibility – if you rely on a bug to work then expect the fix to ‘break’ your mark up. Eventually standards really would be standard, people would learn to write compliant code and dirty hacks be a thing of the past.
Older »
Next Page »