In recent months I've seriously considered getting into mobile application development. My platform of choice has been symbian thus far. However yesterday something dawned on me. Most people don't understand that modern phones are miniature computers hiding in pink cases. As such the idea of additional applications is moot. However what everyone is now seeing is that the internet on mobile devices is possible. In this crazy online world of ours that means one thing web 2.0!
So from today, i'm gonna put some fuel into creating mobile web 2.0 applications. I have a vague idea of where i'm going, but only time will tell.
In other news, this is my 250th post, meh.
I'm slowly becoming myself again, best reflected by the fact that i have time to write this monologue!
Plus i got the 24" in the end, Benq fp241. ....
Well until another time
Quote of the Day
Caption
The musing and sometimes not so wise words of Jonathan Dalrymple, Global Traveller, Programmer, Financial Rocket Scientist, Conspiracy Theorist, Part-time comedian, full-time funny man and whatever else i randomly decide to do.
Wednesday, October 31, 2007
Tuesday, August 07, 2007
Database Table Size Calculations
As a professional Developer, every once in a while you'll need to create a Database, for one reason or another. It's always nice to apply structured thought to your design process and work out your proposed database size before who release it upon the unsuspecting database server.
It's kinda obvious to do, but just in case heres how i do it.
First create your data dictionary. In my case it was for a questionnaire management system, (QMS, might release it as OSS when i'm done).
i wanted to dynamically generate a new table for each questionnaire, so i need to work out the system limits before hand.
first we would have our "user id's"
id - UInt
hostName - 128 byte (unicode 64 character string)
ip addr = 15 bytes (it's ip v6)
assocQuestionnaire = 4 bytes aka 32bit unsigned integer
then depending on the questionnaire you could have upto 32 questions/ comment, (32 columns). These could then store upto 1024 characters so thats basically double in UTF-8, so 2048 bytes, bringing in each row at almost 65Kb, now the company i work for has 40 000 members of staff, so lets assume they all anwser the same questionnaire (Great advertising for me), the database would swell to 2.5 Gb!
Well i think thats sight over kill, so by tweaking the the system to only implement the larger fields when requested by a user, and assuming that they only want one comment field per questionnaire, we get a much more wholesome figure of 100 Mb.
So to summerize the formula is
sum( column types ) * num of rows.
Remember this is only an estimate, and doesn't account for the master tables or relationships or any of that other RDMS goodness. So it's a guide not, E=MC2
Jonathan
It's kinda obvious to do, but just in case heres how i do it.
First create your data dictionary. In my case it was for a questionnaire management system, (QMS, might release it as OSS when i'm done).
i wanted to dynamically generate a new table for each questionnaire, so i need to work out the system limits before hand.
first we would have our "user id's"
id - UInt
hostName - 128 byte (unicode 64 character string)
ip addr = 15 bytes (it's ip v6)
assocQuestionnaire = 4 bytes aka 32bit unsigned integer
then depending on the questionnaire you could have upto 32 questions/ comment, (32 columns). These could then store upto 1024 characters so thats basically double in UTF-8, so 2048 bytes, bringing in each row at almost 65Kb, now the company i work for has 40 000 members of staff, so lets assume they all anwser the same questionnaire (Great advertising for me), the database would swell to 2.5 Gb!
Well i think thats sight over kill, so by tweaking the the system to only implement the larger fields when requested by a user, and assuming that they only want one comment field per questionnaire, we get a much more wholesome figure of 100 Mb.
So to summerize the formula is
sum( column types ) * num of rows.
Remember this is only an estimate, and doesn't account for the master tables or relationships or any of that other RDMS goodness. So it's a guide not, E=MC2
Jonathan
Saturday, August 04, 2007
Display Madness
For once i have a little time, which makes a huge change. In the last hour or so i've been exploring my options around getting a new display to help support my Mac lovin life style. However what should be a joy filled ride through the online e-commerce world, is turning out to be a little less simple then i had imagined.
I have a budget of around £600.
My current setup is two 19" @ 2560 * 1024
However there is a major problem with my current setup, My Blackbook only supports one display. However with a little box from matrox it can support two, but at a maximum resolution of 1024 * 768 each or 2048 * 768.
Current i share the setup with my nix box, but that is getting axed (Yes blu-ray is dead/dying) in favor of consolidating all my development onto one physical machine, and running nix, solaris, windows via parallels.
Now normally i would the following choices given the price.
2 x 22" displays (3360 * 1050)
1 x 24" display ( 1920 * 1200)
1 x 27"
1 x 26"
Now two 22's would be nice, not only cause because it's big but it's also a Jay-z song(well in reverse)!
Now based on current machine specs i've actually got three choices
1 x 24" display ( 1920 * 1200)
1 x 27"
1 x 26"
These are all below my current resolution, so maybe it's the machine that needs changing ...
Ok, lets do the math
Macbook pro (legit) £1149 with student discount
2 22" displays £ 500
matrox dual head to go £140
total £1700!
sweet price point, not. What makes it worse, is that i love the macbook's form factor and would hate anything bigger. ie MB pro.
Plus for that price i could get a mac pro which i have often considered and drooled over with phil. (the computer not phil).
The other solution is to build a osx86 machine, however as developer, and with Leopard coming doing all my work on a unsupported, illegal, in-frequently updated, hacked platform strikes me as dumb.
So that leaves the single units
All of which mean i lose about 1/2 million pixels, and a couple of inches.
Heres the price breakdown
24" £430
26" £ 500
27" £ 680
So on price the 24" is a winner models in that range, that have 8bit color panels, good response times, and adjustable stands, and multiple inputs are ...
Dell's 2407wfp
Benq's 241 wp ( HDMI included!)
On the 26"'s there is one that i know of
Acer 2604
It's got a crapy stand, and no Digital inputs, infact it's only got a VGA input
And then there is 27's
Dell 2707wfp
Which is basically the 24" dell with a phat-er panel and no rotation. And a pixel pitch closer to a 19" lcd (0.294 vs 0.3)
Now we consider the pros and cons of the 24 vs 27
1. I have personal issues with spending seven bills on a lcd display, that i don't really need while people starve to death, and go to war over food.
2. The pixel pitch of the 27 is ideal, the high pixel pitch of my 19's is why i sprang for them over the 17"'s.
3. No rotation, how do i show off those cool XGL effects without being able to rotate the display as well!
4. Both give me less working resolution then i have currently.
Conclusion...
I'll wait to see if apple brings out a super notebook next week, that razor thin macbook pro that all mac geeks dream about, and if it's what i want i'll upgrade.
BTW
i recently bought my name (www.jonathandalrymple.com) as well as a couple of domain names for some projects that are in the pipeline.
I have a budget of around £600.
My current setup is two 19" @ 2560 * 1024
However there is a major problem with my current setup, My Blackbook only supports one display. However with a little box from matrox it can support two, but at a maximum resolution of 1024 * 768 each or 2048 * 768.
Current i share the setup with my nix box, but that is getting axed (Yes blu-ray is dead/dying) in favor of consolidating all my development onto one physical machine, and running nix, solaris, windows via parallels.
Now normally i would the following choices given the price.
2 x 22" displays (3360 * 1050)
1 x 24" display ( 1920 * 1200)
1 x 27"
1 x 26"
Now two 22's would be nice, not only cause because it's big but it's also a Jay-z song(well in reverse)!
Now based on current machine specs i've actually got three choices
1 x 24" display ( 1920 * 1200)
1 x 27"
1 x 26"
These are all below my current resolution, so maybe it's the machine that needs changing ...
Ok, lets do the math
Macbook pro (legit) £1149 with student discount
2 22" displays £ 500
matrox dual head to go £140
total £1700!
sweet price point, not. What makes it worse, is that i love the macbook's form factor and would hate anything bigger. ie MB pro.
Plus for that price i could get a mac pro which i have often considered and drooled over with phil. (the computer not phil).
The other solution is to build a osx86 machine, however as developer, and with Leopard coming doing all my work on a unsupported, illegal, in-frequently updated, hacked platform strikes me as dumb.
So that leaves the single units
All of which mean i lose about 1/2 million pixels, and a couple of inches.
Heres the price breakdown
24" £430
26" £ 500
27" £ 680
So on price the 24" is a winner models in that range, that have 8bit color panels, good response times, and adjustable stands, and multiple inputs are ...
Dell's 2407wfp
Benq's 241 wp ( HDMI included!)
On the 26"'s there is one that i know of
Acer 2604
It's got a crapy stand, and no Digital inputs, infact it's only got a VGA input
And then there is 27's
Dell 2707wfp
Which is basically the 24" dell with a phat-er panel and no rotation. And a pixel pitch closer to a 19" lcd (0.294 vs 0.3)
Now we consider the pros and cons of the 24 vs 27
1. I have personal issues with spending seven bills on a lcd display, that i don't really need while people starve to death, and go to war over food.
2. The pixel pitch of the 27 is ideal, the high pixel pitch of my 19's is why i sprang for them over the 17"'s.
3. No rotation, how do i show off those cool XGL effects without being able to rotate the display as well!
4. Both give me less working resolution then i have currently.
Conclusion...
I'll wait to see if apple brings out a super notebook next week, that razor thin macbook pro that all mac geeks dream about, and if it's what i want i'll upgrade.
BTW
i recently bought my name (www.jonathandalrymple.com) as well as a couple of domain names for some projects that are in the pipeline.
Thursday, July 19, 2007
CSS research
I'm completely knackered, but research is my life. One of my many clients wanted a semi transparent div. Now i say div, but they just want it to look shiny.
Basically then want an element with appox 20% opacity. Easy right, use a PNG. But that cancels out all ie versions apart from 7. How about a gif instead, you dont get alpha transparency! Well genius how about css, great, there are ways to do it on webkit, gecko, and ie, however they apply the same amount of transparency to their children.
the trick here is to think outside the box, literary...

Thanks to relative positioning, i made a solid div below my transparent div, and moved it over the transparent div, creating a the above effect. The cool things is that by modifing the z-index you can create a ghosting effect!
Best of all, there are no images used to create the above, (well apart form the obvious background pattern on the body), more testing is needed, but i think i might be on to something here.
The CSS
The html
Now if you excuse me, i'm off to bed
Basically then want an element with appox 20% opacity. Easy right, use a PNG. But that cancels out all ie versions apart from 7. How about a gif instead, you dont get alpha transparency! Well genius how about css, great, there are ways to do it on webkit, gecko, and ie, however they apply the same amount of transparency to their children.
the trick here is to think outside the box, literary...

Thanks to relative positioning, i made a solid div below my transparent div, and moved it over the transparent div, creating a the above effect. The cool things is that by modifing the z-index you can create a ghosting effect!
Best of all, there are no images used to create the above, (well apart form the obvious background pattern on the body), more testing is needed, but i think i might be on to something here.
The CSS
*{
text-align:center;
margin:0;
padding:0;
}
body{
background: url("pattern.gif");
}
div#wrapper{
margin:0 auto;
width:70%;
text-align:center;
padding:1em;
}
div#panel{
opacity: .50;
height:200px;
background: #ddd;
width:100%;
margin:0 auto;
}
div#wrapper p{
padding:1em;
background: #000;
color:#fff;
width:90%;
position:relative;
margin:0 auto;
top:-180px;
z-index:1;
}
The html
Transparent div
content goes here
Now if you excuse me, i'm off to bed
Labels:
Code,
css,
Development,
research,
web development
Introducing Absolution
Yes i'm alive, it may have been months since the grand plans of facebook widgets and such, but i'm back. Today i'm unleashing on the world something new(ish), A PHP framework. Now don't get me wrong it's no piece of cake, but it's not meant to be. Absolution place in the world is on shared hosts, and B grade websites, where speed of development is more important than MVC patterns and OO principles.
Well OO is always good but you know what i mean.
Currently it consists of 4 classes, that contain helper functions, that enable you to do things like print an un ordered list from a sql query in one line of code!, get a pre-sanitized variable from the query string with one line, even filter out bad characters with one line.
I plan to add more classes, and more functionality, as the framework grows up, however it's 0.01 alpha at the minute! Eventually i want this to grow into something like prototype for PHP, a lean, mean framework machine.
Also i think this place could do with a redesign, ajaxian styleee, now if only i had time.
Till another time
Quote of the Day
My love of Jquery is starting to give me a reputation
Well OO is always good but you know what i mean.
Currently it consists of 4 classes, that contain helper functions, that enable you to do things like print an un ordered list from a sql query in one line of code!, get a pre-sanitized variable from the query string with one line, even filter out bad characters with one line.
I plan to add more classes, and more functionality, as the framework grows up, however it's 0.01 alpha at the minute! Eventually i want this to grow into something like prototype for PHP, a lean, mean framework machine.
Also i think this place could do with a redesign, ajaxian styleee, now if only i had time.
Till another time
Quote of the Day
"We knew that when we gave it to him, that it was never gonna end up as just a simple webpage!"
My love of Jquery is starting to give me a reputation
Sunday, June 03, 2007
Reverse Engineering: Facebook poking
Since i declared Poking war on all my facebook friends, i've been thinking of doing some R & D. So i'm developing a Greasemonkey Script that would enable me to reply to all the pokes simultaneously.
Well thus far, heres what i've discovered.
A poking request is made by sending the user id of the person you wish to poke to a php page.
http://(networkName).facebook.com/ajax/poke.php?id=(userID)
with this request, goes a cookie with your login credentials.
As you can see i did this on my mac, using Firefox to take advantage of firebug. If you drop in the refer url it will take you that persons profile page, i imagine that this is also checked to stop spam bots, however i plan to fake the refers in the application, so that shouldn't be a problem.
Therefore in essence to automate the process, all you need to do is create an array of the users that you wish to poke, and loop though them sending your credentials each time to ensure that it is accepted by the server.
While i was poking around i also discovered that FB uses a modified version of Apache 1.3.37 (they suffix it with "fb1"). Whether this is an edit to the string, or actual modification, who knows?
Anyways, when i stop working 7 days a week, or going to bed at 2:15 am, i'll but together a small java app to take advantage of this.
Now if you think this is a lot of work, it isn't really, i got a http request class already built and fully functioning thanks to my work on isolation. So just gotta reverse engineer some more, and apply this concept.
Let the poking war continue!
Quote of the Day
Caption
Well thus far, heres what i've discovered.
A poking request is made by sending the user id of the person you wish to poke to a php page.
http://(networkName).facebook.com/ajax/poke.php?id=(userID)
with this request, goes a cookie with your login credentials.
Host: solent.facebook.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.1) Gecko/20061223 Firefox/2.0.0.1
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Proxy-Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Referer: http://solent.facebook.com/profile.php?id=511999790
Content-Length: 70
Cookie: login=[Login credentials etc. Need to workout the encoding on these]
Pragma: no-cache
Cache-Control: no-cache
As you can see i did this on my mac, using Firefox to take advantage of firebug. If you drop in the refer url it will take you that persons profile page, i imagine that this is also checked to stop spam bots, however i plan to fake the refers in the application, so that shouldn't be a problem.
Therefore in essence to automate the process, all you need to do is create an array of the users that you wish to poke, and loop though them sending your credentials each time to ensure that it is accepted by the server.
While i was poking around i also discovered that FB uses a modified version of Apache 1.3.37 (they suffix it with "fb1"). Whether this is an edit to the string, or actual modification, who knows?
Anyways, when i stop working 7 days a week, or going to bed at 2:15 am, i'll but together a small java app to take advantage of this.
Now if you think this is a lot of work, it isn't really, i got a http request class already built and fully functioning thanks to my work on isolation. So just gotta reverse engineer some more, and apply this concept.
Let the poking war continue!
Quote of the Day
Caption
Monday, May 28, 2007
Because i have time
Remember that facebook widget i spoke of?
Well it's actually in the oven, now and should be ready soon-ish, just have to work out how to communicate with the REST API that facebook uses, and i'm quids in.
Heres a screenshot of it running live in safari, and i built it based on a dashcode generate file, rather than actually using dashcode. Always more fun getting your hands dirty.
Well it's actually in the oven, now and should be ready soon-ish, just have to work out how to communicate with the REST API that facebook uses, and i'm quids in.
Heres a screenshot of it running live in safari, and i built it based on a dashcode generate file, rather than actually using dashcode. Always more fun getting your hands dirty.
Saturday, May 26, 2007
2006/ 2007; A year in review.
Alas the academic year is at an end, so i thought i would look over my highlights for the year. Fortunately, for once there weren't too many down-ers, which makes a change. In the last year, i've "grown" as a person, changed a lot socially. One thing i've developed is an extremely are head, the sheer number of compliments i've started getting, is messing with my head, resulting in a chemical reaction, often known as "Big head syndrome".
So what did i like about this year?
Jonathan "Lawman" Dalrymple
So what did i like about this year?
- Facebook!!!!
- Jaimini
- Cooking
- Chasing Women * (Not as bad as it sounds, honest)
- Strictly Exclusive
- Ocean & Collins
- Nokia E61
- OS X
- Java
- Black Macbook
- My Poster (you know the one ;) )
- Chocolate Bourbons
- Group Dinners
- Tunde (Even if he's a waster)
- Jai & Nick's Co*K Blocking
- Eating Popcorn for dinner
- Plagiarism ( I'm innocent )
- Easter ;)
- Luke, OG
- Stupid Flat Games
- PHP
- Linux
- Comic Life
- Steph B.
- That Monday at OC, well both actually.
- A night in Portsmouth
- Working with Schuster
- Getting my Old Job, back on both counts
- Stupid sleeping habits
- Erykah Badu
- Robin Thicke
- Mos Def
- Dave Chappelle ;)
- My nickname, Lawman
- Chasing Women (what, they're first years, they need help...)
- My Personal Cleanliness, mainly my room
- Number of publicly available software projects (One is a joke for a software developer)
- My relationship with God (not the best at the moment)
- Income (could be better considering my skills)
- Grades (Too much coasting!)
- Language skills, 10 isn't enough, i need more
- Language, ones that other people know, like spanish etc
- general knowledge, i'm getting dumb
- Electronics , don't get it twisted with software
- act my age, yeah i'm 20 not 30 during the day and 14 at night.
- Stop speaking like a LDN kid
- Remove in'it from my vocabulary
- Improve the jokes, (long time coming)
- Start sleeping at normal times
- Coming back to uni after dropping out, or geting my macbook
- Pro Evo Tournaments at the SU
- A Certain individual(s)
- Cooking Dinner for 6 of my friends and watching them devour it with gee
- Building Downtime in my first week back
- That Remote control plane
- One of my best friends coming out
- "It's all, real stainless steel" Tunde
- "TASTE!!" Tunde
- "Fail" Anwar/ UMZ!!
- "Mrs. Lawman" Jai, Nick, Lester and whoever else was there
- "Lebanon is in africa" Tunde
- "I sleep on my stomach, with both arms under me, with my hands between my legs" Jaimini
- "I'm in the same place(diva) every week" Steph
- "Wasteman"
Jonathan "Lawman" Dalrymple
Friday, April 20, 2007
I know i can count, but i'm not sure about my mac
So in a moment of boredom, i opened up my trusty text viewer, and had a look at some files. Namely a RTF, and a Text File.
First off, i now understand why programmers love plain text files so much. First off, there are no bytes wasted on headers. It's straight into the data, no messing and no playing.
So here is the test stub
This was a little bash script i wrote to help compile my coursework.
Not to remember the basics, each character is equal to a single byte, or 8 bits. FF is therefore equal to 255.
The plain text file is 8KB, with 204 characters. My maths tells me that should be equal to 204 bytes. But for some reason, my mac accounts another 1300 + bytes!!
Mean while the Rtf file is 4KB, with 561 bytes, which is the exact number of characters in the file. But wait you say, there are only 204 characters in the file. Correct, so whats the other junk ....
I only went through it briefly, but it appears to show the font types, and colors for the file.
But my question to the world is, why on earth is the text file twice the size, but yet still halve the number of bytes in the hex editor?
First off, i now understand why programmers love plain text files so much. First off, there are no bytes wasted on headers. It's straight into the data, no messing and no playing.
So here is the test stub
#!/bin/bash
## Coursework mass compilation
cd ~/Desktop/OOTM
javac TerminalInput.java
javac Deck.java
javac Player.java
javac Game.java
javac CardGame.java
## Run the application
##java CardGame
This was a little bash script i wrote to help compile my coursework.
Not to remember the basics, each character is equal to a single byte, or 8 bits. FF is therefore equal to 255.
The plain text file is 8KB, with 204 characters. My maths tells me that should be equal to 204 bytes. But for some reason, my mac accounts another 1300 + bytes!!
Mean while the Rtf file is 4KB, with 561 bytes, which is the exact number of characters in the file. But wait you say, there are only 204 characters in the file. Correct, so whats the other junk ....
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420
{\fonttbl\f0\fswiss\fcharset77 Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\ql\qnatural\pardirnatural
\f0\fs24 \cf0
I only went through it briefly, but it appears to show the font types, and colors for the file.
But my question to the world is, why on earth is the text file twice the size, but yet still halve the number of bytes in the hex editor?
Saturday, April 07, 2007
Social Discovery
Call me socially inept, but i just realized something. You can tell when someone likes you or enjoys your company, when they start doing random things, without just cause. Now depending on what they do, you can then determine whether or not they are trying to get close to you, or in fact kill you.
Ie. I do random things for people all the time, however i personally rarely have random things done for me. Which clearly shows i'm dis ... Right let me rethink that.
But you get the point, however the caveat to this, is that you can begin to think that every random act of kindness, has a meaning. If your a pretty young lady, then it generally does. If your me, then most likely not, however every other one might have some significance.
Quote of the Day
Can't beat viki, you really can't
Ie. I do random things for people all the time, however i personally rarely have random things done for me. Which clearly shows i'm dis ... Right let me rethink that.
But you get the point, however the caveat to this, is that you can begin to think that every random act of kindness, has a meaning. If your a pretty young lady, then it generally does. If your me, then most likely not, however every other one might have some significance.
Quote of the Day
"Look, it's my favourite Drunkard, top of the evening too ya"
Can't beat viki, you really can't
Friday, April 06, 2007
Useful Email validation
Got some javascript, for the coders out there. Not my finest work but quite neat.
This validates a email field, combined with a simple input field as shown.
However it does it in a funky AJAX way, allowing the user to see where exactly they have put a foot wrong.
it checks the following
The 6 character mimumim was calculated using the following logic,
1 = one character for username
2 = one character for the @ symbol
3 = one character for the domain
4 = one dot/decimal to seperate the domain from the TLD
6 = two characters for TLD and ccTLD.
First improvement, that one should make, is enable both the input field, and result field to be supplied as function arguements, however in my case (internet computing assignments), this is only getting used once.
Last but not least it's Released under the GPL, so use it and abuse it.
This validates a email field, combined with a simple input field as shown.
HTML
"<"input id="emailInput" class="halfSize" type="text" value="Place Replay to Email here" name="replyTo" onkeyup="validateEmail( this.value);" />
However it does it in a funky AJAX way, allowing the user to see where exactly they have put a foot wrong.
it checks the following
- Address is longer than 6 characters
- There is a @ symbol present
- and there is a "." within the domain section of the email
The 6 character mimumim was calculated using the following logic,
1 = one character for username
2 = one character for the @ symbol
3 = one character for the domain
4 = one dot/decimal to seperate the domain from the TLD
6 = two characters for TLD and ccTLD.
First improvement, that one should make, is enable both the input field, and result field to be supplied as function arguements, however in my case (internet computing assignments), this is only getting used once.
Javascript
function validateEmail( pEmailObj ){
var pEmailString;
var retVal;
var returnObj = "emailValidStatus";
var whereIsSymbol;
//Setup
pEmailString = pEmailObj;
document.getElementById(returnObj).style.background = "#bf3a3a";
document.getElementById(returnObj).style.color = "#fff";
document.getElementById(returnObj).style.padding = "2px";
//Go Down a level after each check
if(pEmailString.length > 6){ //Check length
if( (whereIsSymbol =pEmailString.search(/@/)) > -1){ //Check for @ symbol
//Find the dot after the @ Symbol
var lastDot = pEmailString.indexOf( ".", whereIsSymbol)
if(lastDot != -1){ //Check for . after @ symbol
document.getElementById( returnObj ).style.background = "#71ba43";
retVal = "Valid!";
}
else{
retVal = "Invalid: Bad Domain";
}
}
else{
retVal = "Invalid: Missing @ symbol";
}
}
else{
retVal = "Invalid: Too short";
}
document.getElementById( returnObj ).innerHTML = retVal;
}
Last but not least it's Released under the GPL, so use it and abuse it.
Friday, March 30, 2007
Latest Project: Facebook Widget
To help me with my face book addiction, i've decided to make a dashboard widget, strangely enough it's for the said website, facebook. A bit more useful than the search widget that currently resides on the internet, and a lot more simple than the famed Isolation project.
After 20 minutes in photoshop here it is

ETA, is about a week i hope, besides how hard can it be ...
As i see it have to translate part of the current offical Java API to Javascript, and parse some xml. Thats the hardest part, the actual widget design should be simple. Development starts in about week, after the java work is done. ^_^
But i think i've announced too much vapourware so i need to start delivering
I'm off to bed, some of us have to work you know.
After 20 minutes in photoshop here it is

ETA, is about a week i hope, besides how hard can it be ...
As i see it have to translate part of the current offical Java API to Javascript, and parse some xml. Thats the hardest part, the actual widget design should be simple. Development starts in about week, after the java work is done. ^_^
But i think i've announced too much vapourware so i need to start delivering
I'm off to bed, some of us have to work you know.
I love to function
While working on my piece of piss Java assignment, i came up with a neat little random number generating function. It's a mirror of a function that is commonly used by Objective-C developers, and allows you to have random numbers but within a range. I've casted the result before i return to the calling routine, so you simply change or remove the cast to get the primitive of your choice, as it's all Floating point arithmetic.
It's even does a little debugging line, so you can see the number of attempts till it succeeds. Released under the GPL 2.0, For use in non-commercial products yada yada. When i can be asked i'll write a Javascript, and C version, and if i feel really nice a VB version.
Update: With me having banned myself from facebook for a while, i thought i would make myself more useful and covert the java to ECMA script, of Javascript for lesser clued up, wasn't hard just replaced primitive declarations with var ^_^.
PS. I didn't test the javascript version, so don't count on it to work straight off the bat.
Java
private int randomIntWithinRange(int pLow, int pHighest, boolean pDebug){
boolean acceptableValue = false;
double possibleValue;
double finalValue = - 0.1;
int attemptsTillSuccess = 0;
//If the value is not acceptable continue
while(!acceptableValue){
possibleValue = Math.random() * (pHighest * 10);
if(possibleValue >= pLow && possibleValue <= pHighest){
finalValue = possibleValue;
acceptableValue = true;
}
else{
attemptsTillSuccess++; //How many times
}
}
if(pDebug){
System.out.println("" + attemptsTillSuccess + " attempt(s) till success"); //debuging
}
return (int)finalValue;
}
It's even does a little debugging line, so you can see the number of attempts till it succeeds. Released under the GPL 2.0, For use in non-commercial products yada yada. When i can be asked i'll write a Javascript, and C version, and if i feel really nice a VB version.
Update: With me having banned myself from facebook for a while, i thought i would make myself more useful and covert the java to ECMA script, of Javascript for lesser clued up, wasn't hard just replaced primitive declarations with var ^_^.
Javascript
function randomIntWithinRange( pLowest, pHighest, pDebug ){
var acceptableValue = false;
var possibleValue;
var finalValue;
var attemptsTillSuccess;
while(!acceptableValue){
possibleValue = Math.random() * (pHighest * 10 );
if(possibleValue >= pLow && possibleValue <= pHighest){
finalValue = possibleValue;
acceptableValue = true;
}
else{
attemptsTillSuccess++; //How many times
}
}
if(pDebug){
Document.write(attemptsTillSuccess + " attempts till success"); //debuging
}
//Damn loosely typed language!!
return Math.round(finalValue);
PS. I didn't test the javascript version, so don't count on it to work straight off the bat.
Labels:
Code,
ECMA script,
GPL'd work,
Java,
Javascript,
Programming
Wednesday, March 28, 2007
Facebook is the nuts!
Get one, i love it.
I've got in contact with people from my primary school
One of my cousins
Couple people from secondary school
Basically for someone enjoys "trying" to be social, it's amazing.
Quote of the Day
Dave Chappelle
I've got in contact with people from my primary school
One of my cousins
Couple people from secondary school
Basically for someone enjoys "trying" to be social, it's amazing.
Quote of the Day
"I'm sorry charile murphy, it was an accident i'm having too much fun."
Dave Chappelle
Sunday, March 25, 2007
A Guy, A Mac, and a Linux Distro
So, it's that time of year again. Everyone's disappeared to their various corners of the uk, and i'm left here to contemplate life on earth.
So many people have asked, why have i decided to stay here on my own, simple i got a lot of work to do, plus i wanna take advantage of the gym.
Heres what i got to do in the next three weeks
Quite a lot of stuff if you ask me. I'm only working at maplin on the weekends, so i'm gonna try and give this thing my full attention. In my eyes these three weeks will make or break my course, prehaps in yours too ...

Now if you excuse i have to contemplate whether or not to get a facebook or not.
Quote of the Day
Nice going sony, you get a grown man to fork over £425 quid, and then shaft him and give him no games.
So many people have asked, why have i decided to stay here on my own, simple i got a lot of work to do, plus i wanna take advantage of the gym.
Heres what i got to do in the next three weeks
- Database fundamentals Coursework
- Internet Computing Assignment
- Computer Architecture Coursework
- OOTM Assignment Assignment
- Learn x86 assembly
- Finish the Fat Cheetah website
- Write & Design a reusable PHP CMS
- Write & Design a reusable PHP forum
- Apply for loads of Jobs
- Do someone else's assignment
- Cook various people dinner
- Revise for networking
- Buy and play with a Treo 680
Quite a lot of stuff if you ask me. I'm only working at maplin on the weekends, so i'm gonna try and give this thing my full attention. In my eyes these three weeks will make or break my course, prehaps in yours too ...
Now if you excuse i have to contemplate whether or not to get a facebook or not.
Quote of the Day
PS3 buyer"I need an optical cable for my PS3"
Me "Cool, how is it?"
Customer"Don't know didn't get any games."
Nice going sony, you get a grown man to fork over £425 quid, and then shaft him and give him no games.
Saturday, March 24, 2007
Saturday, March 10, 2007
Ones to Watch
Now that i'm back at home, if only for a couple of days, i have the opportunity to try out the finest TV shows from our brothers across the pond.
Firstly 30 Rock,
Number 1, it's got a Baldwin in it, so that caught me. Second it's got the head writer of Saturday night live, writing and staring, Tina Fey.
This two things mean that it can only be good. Thus far I've only seen four episodes, but it is very funny, clean and stupid.
I would highly recommend this if you like family guy or american dad, and no it's not a animated series.
Next up, The Apprentice Season 6 : LA
No it's not the uk version, it's Donald Trump doing what can only be described as good tv. Watching the first episode now.
Nothing like watching wasters try to shoot each other down
Firstly 30 Rock,
Number 1, it's got a Baldwin in it, so that caught me. Second it's got the head writer of Saturday night live, writing and staring, Tina Fey.
This two things mean that it can only be good. Thus far I've only seen four episodes, but it is very funny, clean and stupid.
I would highly recommend this if you like family guy or american dad, and no it's not a animated series.
Next up, The Apprentice Season 6 : LA
No it's not the uk version, it's Donald Trump doing what can only be described as good tv. Watching the first episode now.
Nothing like watching wasters try to shoot each other down
Wednesday, March 07, 2007
20 in 8
Nothing much to say, except that in 8 days i'll reach that milestone age of 20 years old. How about that. Jonathan at 20, i should really do the whole dave chappelle thing, and make comparisons between me at 20, 14 & 8. Would be quite funny i think, i think i'll make that bus post.
Plus i'm going back to hemel this weekend to link up with the old crew, till another time ...
Plus i'm going back to hemel this weekend to link up with the old crew, till another time ...
Tuesday, February 27, 2007
Too Badu for you
In the last couple of days i've been listening to a lot of Erykah Badu, and man is she good. In my book shes, like the musical sister Jill Scott never knew about.
Sadly not all is well. I discovered that Ashley, from such famed posts as "meet my friends", lost his mother to Cancer, plus the ex-partner of one of my work colleagues has been in hospital for a while. To them i wish them all the best, and hope for a speedly recovery, as for Ashley my heart goes out to him, and i pray that his mum made it to heaven.
In business news, Isolation is on hold while i do some contract web design work, Ajax and the usual lark. But in even bigger news, i;ve join the "Fat Cheetah" Revolution. Fat Cheetah is a three man company destined to take over the world. It comprises a quality graphic designer; Paul, a classy Web Developer/Application Programmer; me and a Shark Tunde. The perfect blend.
If you live or work in the southampton city area, you'll be hearing from us!
Oh, while i'm here
March 13th, @ Bambuu Bar Come down and see Heartless Crew in action
A One Promotions & Fat Cheetah event
Thats about it for a round up, i'm try to save money to pop another Gig of Ram in that black plastic thing over there (writing on my nix box), Was ill for the last week, and had apple juice and popcorn for dinner, plus Jai quit smoking.
Quote of the Day
We love him really
Sadly not all is well. I discovered that Ashley, from such famed posts as "meet my friends", lost his mother to Cancer, plus the ex-partner of one of my work colleagues has been in hospital for a while. To them i wish them all the best, and hope for a speedly recovery, as for Ashley my heart goes out to him, and i pray that his mum made it to heaven.
In business news, Isolation is on hold while i do some contract web design work, Ajax and the usual lark. But in even bigger news, i;ve join the "Fat Cheetah" Revolution. Fat Cheetah is a three man company destined to take over the world. It comprises a quality graphic designer; Paul, a classy Web Developer/Application Programmer; me and a Shark Tunde. The perfect blend.
If you live or work in the southampton city area, you'll be hearing from us!
Oh, while i'm here
March 13th, @ Bambuu Bar Come down and see Heartless Crew in action
A One Promotions & Fat Cheetah event
Thats about it for a round up, i'm try to save money to pop another Gig of Ram in that black plastic thing over there (writing on my nix box), Was ill for the last week, and had apple juice and popcorn for dinner, plus Jai quit smoking.
Quote of the Day
Lights dim
Anwar "Where did nikya go?"
Somone else "Don't worry i can see his teeth"
We love him really
Monday, February 12, 2007
Looking for work
i code in the loads of langauges, and i do contract work for cheap. If your interested conact me, and don't try the line that you couldn't find my email address, half the population of nigeria knows it, so for you it should be a peice of cake.
Websites
Bespoke Developement
Debugging
Scripting
what ever, call me
ps. I haven't lost my job, just looking to move up.
Quote of the Day
Yeah, because we come across 18 + digit binary numbers in our day to day lives
Computer architecture can be fun, honest.
Subscribe to:
Posts (Atom)
