If you’re ‘App-y and you know it, make some cash!
Posted in Open Source Software, the web, Coding, e-commerce on July 2, 2010 at 9:14 am
Make some money developing for (your) phone.
If you know Java Script (I don’t) and have some experience developing for the web (I don’t) and fancy a bit of fame (I don’t?) and money (I don’t??) then get yourself over to http://developer.palm.com/
Click on Building you first app “Learn more” then “Install the webOS SDK” then go back and follow the Hello World app. The SDK includes an emulator so you don’t need a phone (yet - see below).
To do clever stuff you’ll really need to know the webOS as well as Java Script - you may need to buy a book but you can find a lot of info with google! Basically the Palm runs java script but exposes it’s API so you can make a lot of other calls as well.
Before you invest hours writing the app that will make your fortune though have a look at
http://developer.palm.com/index.php?option=com_content&view=article&id=1840&Itemid=34
to tell you what is involved in publishing it.
And if you are serious, register as a developer and look through what you need to submit an app. (submit a dummy one and then remove it?). They want company names, tax details, support emails and web sites and the app must be tested on actual hardware so just using the emulator isn’t enough for submission.
Anyway, for now at least, registration as a developer is free (future costs of $99?) and publishing your app is free (was $50 for a chargeable app, free for open source) and money apart how cool would it be to see your app on peoples phones?
Java script on Remote Device? Piece of Cake!
Posted in the company, Coding, Blogs on June 25, 2010 at 3:09 pm
Long time no blog - I’ve been hugely busy as there was a competition to write an app for a new hand held thingy - I guess they see it as an iphone competitor so they want lots of Apps as selling point. How to get lots of Apps, cheaply and quickly ? Offer us daft muggins-iz a prize if we write one - sorry guys it was a closed competition otherwise I’d have invited you all in.
As this was on my time but I could use a bit of “slack” (joke) work time I’ve been up to my eyes day & night. It’s a shame that has left me too busy to write up what I’ve been doing because it has been quite interesting.
Most of the app is in Java Script which I have done a couple of dozen lines of before. Google for Java Script advice is like asking an Eskimo about snow - you get lots and lots but none of it simple enough to understand. It was quite fun really because it took me back to the bad old days.
To start with I don’t know the language, there isn’t any auto complete which I have got used to on stuff I don’t know - type class.m and MS Visual Studio C++ (or in VB / VBA) it will suggest all the methods starting “m” for that class, and show the parameter types - which helps if you are guessing what methods there might be. Also an F12 will take you to a class definition where you can read what methods there are - with maybe a comment about what they do!
Given I don’t know the language a bit of syntax checking could help - “error line 10 class doesn’t have that method” etc. Oh no, I’m back to type it, run it and if it doesn’t like it you get a blank browser! My tactic was to comment off lines until the error went away and then figure out what was wrong. Actually it was worse than that because with some errors the code would run up to that line and then skip out of the method - leaving bits of code un-executed but not telling you which ones!
Finally debugging - no debugger. Well not without installing a load of junk I didn’t want. So no break points, no examining variables, no tracing through executing code. I’ve worked that way before, you need a lot of patience and output debug strings. No out put debug strings - not without installing a load of junk I didn’t want. I ended up using an on screen text box to display debug messages.
Still, it all worked (by hook, crook or bodge) and is submitted so now I’ve got time to blog (between catching up on work and life) but not such interesting things to blog about!
Late binding, run time casting and optional parameters - too clever for their own good.
Posted in Coding on May 26, 2010 at 5:26 pm
Bit of a techie one this, but how C++ handles its run time type casting is clever and useful but can be less than intuitive. This trap, I have fallen into more than once, is an obscure one you may like to ponder and save away for when it bites you. I certainly fixed the problem quicker the second time I encountered it!
class Dad {
virtual void method() { print(”In class dad”);}
virtual void otherMethod() { print(”Do something”);}
}
class Son::Dad { // class inheriting from dad
virtual void method() { print(”In class son”);} // this method is over ridden
}
main(){
class Son son;
class Dad *ptr;
ptr = &son;
ptr->method(); // even though type is Dad, this will print “In class son” because the late binding knows it’s really a “son”
ptr->otherMethod(); // this will print “Do something” because the late binding knows it’s really a “son” but son doesn’t have an otherMethod of its own
}
That’s the kind of things we programmers do a lot - not because we like print out the class names but because the classes we use are more useful - say class Employee and classes Engineer and Salesman that both inherit the basic methods (holiday(), pay() etc.) but do different things for other methods (work(), think() etc.).
Everything is nice until you need to change the code (that could be the definition of my job really!)
You need to add a value to “method” so you change the code to:
class Dad {
virtual void method(int N) { print(”In class dad with value %d”, N);} // add parameter
virtual void otherMethod() { print(”Do something”);}
}
// Son stays the same
main(){
class Son son;
class Dad *ptr;
ptr = &son;
ptr->method(99); // this now prints “In class dad with value 99″ because Son doesn’t have a method called method that takes a parameter so I must want the one in Dad.
}
That should be obvious(!), what has bitten me is when I’ve changed the code to make use of optional parameters:
class Dad {
virtual void method(int N=0) { print(”In class dad with value %d”, N);} // add optional (defaulted) parameter
virtual void otherMethod() { print(”Do something”);}
}
// Son stays the same
main(){
class Son son;
class Dad *ptr;
ptr = &son;
ptr->method(); // this now prints “In class dad with value 0″ !!!!!! No change to Son, no change to this line but the affect is different - ouch!
}
I didn’t write the compiler but what I figure is happening is that because the parameter is optional (defaulted) the code
ptr->method();
becomes
ptr->method(0);
And we are back to “Son doesn’t have a method called method that takes a parameter so I must want the one in Dad.”
Which just teaches us what we should have known already - sometimes you need to be very clever just to be clever.
Classic Rock - Free Duff Slash Download
Posted in music, Coding on March 28, 2010 at 11:09 am
If you like a bit of classic rock you have probably tuned to Planet Rock (http://www.planetrock.com/default.asp) from time to time. It is the only music station I have ever listened to on a regular basis (well, Jazz FM I liked but it shut down the week I got my only working DAB radio!). Most stations are too varied for me - although I have an eclectic taste I am not tolerant, one track I don’t like and I tend to turn off. Planet Rock has a narrow enough range that although it doesn’t play everything I like, I like everything it plays (near enough).
Anyway if you like Slash there is a free download available at http://www.planetrock.com/Article.asp?id=1745507&spid=35830 (I couldn’t find a link from the planet rock homepage, just had to google the site). I say free, you do have you enter your email and reply to a confirmation mail so you may end up with loads of junk mail.
I put Duff in the title as it refused to play in my VB based MP3 player wot I wrote. I dropped it into Audacity and exported it again and no problems. There must be some new MP3 format not supported by my old player (based on the media player object you can import into VB4 if anyone is wants to tell me more).
Oh yes, it also has Duff in the title because the track features Dave Grohl and Duff McKagan - do you see what I did there?
Keeping in time with your phone
Posted in Home, Open Source Software, music, Coding, Blogs, e-commerce on February 18, 2010 at 7:25 pm
You know me - or maybe you don’t, that is the nature of a blog - but anyone who does would know I’m fond of free stuff, love music and quite like gadgets. So,
http://software.aziraphal.com/Metronome.php is a site that make me very happy. A free metronome for any Java phone. A metronome is really useful tool for practising and should be to hand for professional musicians / serious students.
I have an old wind up proper soothing tick-tock job but modern ones run can be set for different tones on different beats and anyway my phone is more likely to be to hand than the metronome is - and weirdly enough the phone is smaller and easier to carry.
If you do any music and have a Java phone you should go get a copy. The guy who wrote it seems a nice chap too - he did say it should work everywhere (in theory) but unfortunately in most cases it’s not very reliable (especially on newer phones where J2ME is almost obsolete and not implemented very well) but I have had no problems just playing system sounds or beeps - midi and wav’s did cause a crash that meant a battery removal reset but I just avoid them now.
The author did give me some more feedback:
It works decent enough on older Nokia’s (most people who let me use their phones for testing had Nokias) that have built-in J2ME MIDP2 java support (as opposed to a client inside Symbian or some other “modern” OS) and was actually usable at slower BPM’s. Judging by some online reviews it was most disappointing to Blackberry owners.
Finally, although it is free it is described as albumware - if you like the tool the author asks you to listen to (and I guess potentially buy) some of his music. A whole new marketing ploy to me and although I probably won’t buy any as it’s not my cup of tea I enjoyed a listen!
QT Sockets - what it says on the tin
Posted in QT, Coding on October 15, 2009 at 11:24 am
char recv[1];
socket.waitForConnected(TM_OUT);
if (!socket.connected())
return FAILED;
if (socket.write(buf, len) < 0)
return FAILED;
if (socket.bytesAvailable())
return FAILED;
if (socket.read(recv, 1)!=1 || recv[0]!=HOST_OK_HANDSHAKE)
return FAILED;
There, I Fixed It: a fine line from ingenuity to insanity
Posted in Funny, Coding, Uncategorized on October 9, 2009 at 9:45 am
If you’ve never been to http://thereifixedit.com/ you’ve missed treat of ingenuity and stupidity. As a fan of Scrap Heap Challenge (http://www.channel4.com/science/microsites/S/scrapheap2008/index.html) this kind of thing is obviously right up my street.
Unfortunately they don’t seem to have a best of, so just browse through the tags - my favourite is There, I Fixed It: Epic Kludges + Jury Rigs ingenuity « which is a bit more positive than http://thereifixedit.com/tag/stupidity/
Maybe I should set up site just for coding kludges, or maybe I should send in a pic of the leaf blower I tried to make by gaffer taping a bag over the outlet of my Dyson.
It’s a fine line from ingenuity to insanity or indeed insanitary http://thereifixedit.com/tag/bathroom/
Security for beginners
Posted in Open Source Software, Coding, Security on September 28, 2009 at 11:13 am
If you know much about passwords / security / etc don’t read on, you’ll only get bored (unless I’ve got it wrong, so feel free to read and correct!). Anyway, I was explaining some basics to someone the other day & though there might be others interested.
Passwords have a long tradition of identifying friends from foe by exchanging a secret data. The problem is, once it’s exchanged in the open it’s no longer secret. Whispering may work but if you have to shout it, put it in a letter or plain text email it isn’t going to stay secret.
Say my password is “3″ (numbers are easier to work with and we know computers turn everything into numbers sooner or later so lets start with them). You know it is 3, you ask me for it and if I give it you, know it’s me - trouble is everyone else overheard it so now its useless..
Instead you pass me a number and I add it to mine and pass it back, if it adds up to what you add it up to it’s still me - you say “5″, I say “8″ you figure out 5+3=8 so yes it’s me. Now any listeners in have got to know or figure out the formula and then calculate my password. If we are using a publicly defined standard formula (which on a computer system we probably are) they know the formula so they can figure out from 5+X=8, X=8-5 that my password is 3. If they don’t know the formula they can probably figure it if they hear enough exchanges.
What we need is a formula that isn’t so easy to work backwards - like a square. You say “5″ I add it to 3, square it and say 64. You do the same calculation and get 64, yes it’s me. Now the listener has to do the inverse function, 64=(5+X)^2, X=square root of (64)-5. Easy with 1 digit numbers or a calculator not so easy with big numbers and just a paper and pencil.
That’s how most security works, don’t exchange the password but mess up some random data with it in such a way that the sender can mess it up them same way and check your answer. Anyone listening CAN figure out the password by reversing the “messing up” process but if we make it complicated enough they will requires years of super computing to figure it out (a figure quoted for RSA 129 digit key is 5,000 years of 1 million instructions per second computing).
A step on from this is public key encryption where I tell you how to mess it up but only I can un-mess it - loosely speaking! http://en.wikipedia.org/wiki/Public-key_cryptography is a bit more accurate
http://www.ephesus.com/Encryption/PGP-Steps.html, and http://home.clara.net/heureka/sunrise/pgpsec.htm seem quite informative too.
Exactly the same - only different
Posted in QT, Coding, Microsoft on August 21, 2009 at 11:47 am
I built a snapshot the other day. That is I created separate copy of all the current source code and built it to give a stable image to some testers. It crashed, just didn’t want to run.
OK, I thought, double check the sources are identical to my development area. Yes & it runs.
OK, I normally build a debug version - the snapshot will be a release build. Build a release build in my development area - it runs.
OK, I build with MSVS work bench but the snapshot is built from the command line so build it from the same command but in my development are. It runs.
Compare the binaries - different sizes, different contents… ?
Clean all objects etc and rebuild everything from scratch in both areas - same results one runs one doesn’t. Do it again in case I got it wrong, check the sources are the same (in case I got it wrong). Do it all over, and again. Phone a friend, search the web, bang head on desk, …
Finally I did what any novice would tell me to do. I switched the PC on and off, then cleaned and re-built the snapshot - it runs.
But why would a build from one command line differ from one in another DOS box (both started from the same Visual Studio command)??? And why didn’t I just try a reset earlier?
In Black and White - Stephen Hawking & the NHS
Posted in Funny, In the news, media, language, Coding, the web, Blogs on August 17, 2009 at 9:43 am
I’m a bit late in slagging Investors Business Daily (and all Americans by implication) in their announcement that Stephen Hawking would be dead if he were British. A great story for national stereotyping (racism?) in that it uses American stereotypes of Brits (accusing us of having a naff health system) whilst conforming to British stereotypes of Americans (being ill informed and assuming anything good must be American). I’m sure the father from Goodness Gracious Me is even now saying “Stephen Hawking? He’s Indian!”.
However, with the power of the web over paper and ink the article has been miraculously changed. IBDeditorials.com: Editorials, Political Cartoons, and Polls from Investor’s Business Daily — How House Bill Runs Over Grandma
A fine example of why software should be released via the web rather than committing to hundreds of CD’s before realising there is a minor glitch.
Maybe all that being able to hand your course work in then get it back and fix it is good training for the real world after all.
Pleas come back and read this entry again next week - I may have changed it to make it more interesting by then…
Tag cloud
Archives
- July 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
Most commented posts
Highest Rated Blog Posts
- PC Advance Required (100%)
- No excuse - it's free to encrypt! (100%)
- Virtualization's Dark Side - or stating the obvious for beginners (100%)
- Tabs - I might change my mind? (100%)
- Which Linux do you drink? (100%)
- Sat Nag (100%)
- How to be a Guitar Hero (100%)
- Home working - a tale of freedom, loneliness and slippers (100%)
- Vertigo (100%)
- Is your back door open? (90%)


