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
*{
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

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
"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.


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.

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?
  • 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
What do i want to improve on for next year & beyond?
  • 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
Favourite moment of the year
  • Coming back to uni after dropping out, or geting my macbook
Biggest Waste of time
  • Pro Evo Tournaments at the SU
  • A Certain individual(s)
Most Rewarding use of time
  • Cooking Dinner for 6 of my friends and watching them devour it with gee
Most constructive use of time
  • Building Downtime in my first week back
Biggest waste of cash/p
  • That Remote control plane
Most shocking news
  • One of my best friends coming out
Favourite Quotes (aka Tunde's section)
  • "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"
Well i'm pretty tired now, so i'm gonna call it a day. But i must say, sitting here writing this list had be cracking up, and smiling the whole way. It's been a great year and to all my people, thanks for the good times, and God Willing we will have so many more next year.

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
#!/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
"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.

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.

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.

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.

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
"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

  • 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

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 ...

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
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

Super amazingprogrammer 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.

Friday, February 09, 2007

Whats new....

Well since the data disaster, i've managed to rewrite a sizible chunk of code for isolation. However, it's hard work, considering i had done it all before. I've also gone backup nuts, and wrote a back script that i keep in the dock.

In other news, i've started on a light Cocoa project. A Cocoa version of one of my favourite games, Dope Wars. As you've come to expect here's the teaser...




Loads of work as you can see Started yesterday, while watching lost. Now although i love Xcode, i hate this whole idea of connecting the program to the UI. I can see the benefits, but i dislike the way it's done. Sure it's kind of similar to the way things are done in visual studio, but still.

Plus i've started learning about assembly on a serious level, so i'm now learning 3 languages at the same time, as well as brushing up on my C skills, to help improve my ideas on all these new fangled languages. Coupled with this i want to do some proper ruby on rails development, and see what all this crap is about in a production like environment.

Lastly, i've discovered that for all my love of computers macs, that i really don't know what i want to do after i leave university. Web development, is exciting, fairly easy and pays ok, but it's not a challenge. I write CSS in my sleep.... Writing kernel/device drivers looks cool, but how often does one need a new camera driver? Software development looks cool, but things take too damn long. And i'm not keen on all this paper designing either, wheres Visio for OS X? Although i plan to work for no one, and do my own thing, i'm not quite sure what yet.

To sumerize in Objective-C ...
Future = [Me whereIsCareerGoing:currentStatus];


Quote of the Day
Am i too nice, or do i just like thinking that?

Lets put the vote to the people

Tuesday, January 30, 2007

I'm a Retard

Why, i wiped my Mac's harddrive, every last kb. Yes i could of recovered it, but i can't be bothered to build up any hope of getting my data back.

So what happened,

I was trying to install the New Microsoft Vista(Which i'm using as we speak). I used the disk utility on the mac osx install dvd to remove my old boot camp partition. i had split it as follows 103 GB for osx, and 8 gb for linux. It had been that way since the week after i got my mac. I was using rEFIt to manage the boot partitions.

I selected the 8 GB parition plus the nix swap space, and erased them. Before i did so, i clicked the little lock, to prevent editing to the osx partition. after wiping the two, i then reformated them as fat32, and thought nothing more of it, one restart latter osx wouldn't boot. thought it must be a partition table issue. So i reboot the install dvd, and went to repair the drive/partition.

Thats when i saw it. Macintosh HD had 55Mb used, instead of 90 Gb!

So what have i lost

Isolation, and Syndication, The new company website. plus all the recent changes to the HTTP library and Diggr for the last couple months. All of my uni work for the last 3 months, plus about 2000+ tracks. And my cracked cs3.

So .... backups are a good thing.

What i can say, is that Vista isn't too bad. They fixed the performance issues that they had with the last version i tried, 5270. It's nice and shiny, and although i haven't got all the drivers, it's still not too bad. After i've reinstalled osx, i'll set up a proper boot camp partition.

Isolation will be rewritten this month (February), Syndication who knows, Diggr is on hold until i can master palm's C api.

HB HTTP lib, i'll release what i have, but it won't work until the nice folks at HB update the runtime environment or the compiler, to fix the stream writing methods.

So if you'll excuse me, i've got a hard days worth of installing and downloading ahead of me.

Monday, January 29, 2007

Finally!!

So Januarys kinda like done, and i still haven't finished my first app. But the good news, is the weirdest part is done, which was handling data/ captured requests between two servers is practically done.

hence rejoice, for i have screen shots, but no code (i kinda like trying to make money thanks)




Now if you excuse i got loads more work todo, plus i need to stare at this powerbook(not mine) in front of me...


Quote of the Day
"So he came up behind you and began kissing you on the neck, ok"

As i said on numerous occasions, teen drinking is very bad