Sunday 28 December 2008

Quick Server Solutions

Solutions to help speed up development with not much programming.

TikiWiki

Tuesday 4 November 2008

Remove Red Eye

The following picture is what needs to be enhanced. Clicking on it will reveal there is RED eye issues.

You will need the latest Gimp installed. Believe there is an installer for MS Windows.

Start your installed gimp and load the picture that needs improving. You should be able to click on the image to see a bigger view of the screenshots below.

Steps
Zoom in on the problem area, you can use two ways. You can use the button from the tools dialogue or the pulldown menu which is located at the bottom of the image window.








Select the Rectangle selection tool and draw around the first eye.








Now lets select the 2nd eye, by hold down shift key which will add a PLUS(+) symbol, then draw another selection over the 2nd area.


On the image window, click on the "Filters->Enhance->Red Eye Removal..".








NOTE: This part will require some trial and error.

Adjust the threshold value until the red eye has gone almost and then click ok.
If you not happy with the first attempt, you can use "Edit->Undo" to reset what you have done.
Don't forget to zoom out to really see the difference.
Then save when you happy :)


Result
This is what the picture looks like after removing your first pair of red eyes :) Yes. The guy in the middle is not of this Earth :P The technique explained above has been applied twice on both guys ^^. The red eye is not a horrific at least.


Hmm Think here is another way to do this in Gimp, which is even more manual. I wanted to see what GIMP's filter was like.

Friday 12 September 2008

My Firefox Developer Plugins

These are my Developer Addons

Enjoy

Thursday 11 September 2008

PHP and mail

On the server, you need to install sendmail. If you found you duff configuration and you had to change your hostname details. You wonder how to reconfigure sendmail? You can reconfigure it by running...
sendmailconfig

My Linux Shell Cheatsheet

Find total number of lines in a programming project recursively.
cd /to/some/project/folder/with/loads/of/subfolders
wc -l `find . -name *.php`

Wednesday 3 September 2008

Dojo/JS Error: [somevariable] is not defined

Error: some variable is not defined
Source File: bla.php?sadf
Line: 360

Make sure you name your widgets in the HTML with "jsId". For example:

<select name="somevariable" jsId="somevariable" /></select>

Tuesday 2 September 2008

Dojo/JS Error: unterminated string literal

As of Dojo version 1.1.1, the nice debug console Dojo provides does not properly show where abouts the error occured. So make sure you bring up the Web browser's javascript console also.

Don't forget to clear the javascript console log and re-run your page.

Example Error

The Quotes, at around t=i&id='????' is causing the trouble. Basically cuasing the intoNode to break.
dojo.xhrGet(intoNode('ajaxingredientlist', '/ajax/categories/?ajax=true&mode=l&t=i&id='????'))

Monday 1 September 2008

PHP: Cannot use object of type stdClass

When handling object, you have to remember to retieve LIKE an object, NOT an like array style.

Example Object retrieval:
$varName->someThingToGet


PHP Example
Make sure you just use

echo $response->TransactionID;
NOT
echo $response['TransactionID'];

Zend Framework
[ ZEND_DB Example ]
When handling You must remember to set the db adaptor to fetch object, so anything returned will fetched as a proper object.

$this->db->setFetchMode(Zend_Db::FETCH_OBJ);
$result = $this->db->fetchRow($select);
echo $result->columnNameToFetch;

Friday 15 August 2008

Simple Form Styling (No Tables)

Always wondered how they made forms with no table html( As quoted from here.)

No table code used, but dl,dt and dd.

<dl class="newsletter">
<dt><label for="name">Name:</label></dt>
<dd><input type="text" id="name" value="Enter your name" /></dd>
<dt><label for="email">Email:</label></dt>
<dd><input type="text" id="email" value="Enter your email" /></dd>
</dl>
Style the desired areas, as follows
<style type="text/css">
.newsletter {width: 50%;}
.newsletter dt {float: left;}
.newsletter dd {margin: 0 5em 1em 5em;}
</style>

Thursday 14 August 2008

Movie Poster

This poster is an example of my graphical abilities for a silly competition I devised at OkCupid :P The winner will get one of their desired photos digitally enhanced to the best of my abilities, just one photo.

Description of Work:
This is the only movie poster I have ever made, I made this for an ex-partner's mum. I had to scavenge around the internet for the right images and angles. Took a little while yes :p

The poster could never be very high resolution, because the images were ripped off the internet and were of various sizes.

Big enough to shove in a frame and hang some where at least ^^.

The plane and ship was never by the Golden Gate bridge like that :P

Wednesday 13 August 2008

How NOT to Design


Don't just call it a "thing.com" and a slap a picture on it with a few links in there :P
lmao

Planning and Designing

During my naive young years, I rarely planned or designed. I coded to my hearts content lol. I have decided to rectify that. So I have spent a fair time trying various ways of designing more digitally. Also I have an issue with "pencils" and endless amounts of paper being wasted. I used sketch and jot dot down almost anything of an idea.

They all exercise sharing in a social way. Also they are all easy to browse and publish.

Keeping others posted
Any change done, must be able to give everyone a quick overview of changes rather than individual emails.
Online journal or blog, be sure to let everyone know how use RSS feeds

Master Plan
Must have Brainstorm chapter
Must be easily sharable and editable by anyone
Must be colorful (Use key colors to designate important notes/must reads).
Google:Docs

Databases
Still waiting for MySQL's Workbench for Linux to come out of beta.
DIA (Linux)

Interfaces
One document with many many various layers, each layer represents a different part of the site.
Inkscape

Debating
You don't want everyone accidently deleting other's thoughts just because they hate it. More the merrier, pick out the important ones for planning :P
Emails don't forget to use "Reply to all"
blogs or journal addons (Votes and comments)
Forum

Tuesday 12 August 2008

Testing

Firefox use Linux (Ubuntu is my fav distro).
IE6 use IE4Linux for Linux (Not the beta, but you could though ain't used it yet myself)
IE7 use XP in VMWare Server for Linux

VMWare Server (get version 1, as version2 is a kind disapointing)
I am a lover of virtual machines for testing, just recently had a hefty time installing VMware Server on Ubuntu 8.04, then I discovered this.

Update Patches
When downloading the latest update, keep the defaults, but recompile when it asks for the gcc compiler. You should not need to re-enter the serials, be sure to run the following when updating
sudo cp /lib/libgcc_s.so.1 /usr/lib/vmware/lib/libgcc_s.so.1
sudo cp /usr/lib/libpng12.so.0 /usr/lib/vmware/lib/libpng12.so.0

Another note to remember:
Use Legacy Driver for CD drive, cuz my drive is too new. Even if u have 64bit dual core, don't get greedy with processors, one processor should be enough :P

service pack3 for xp, need more than 3gig+71mb size for partition, better make it 5gigs if you want it to live more (Especially to install updates like ie7) :P

Monday 11 August 2008

My Dev Environment


Programming / On the fly FTP Editing and Saving / Window Management
Read this

Also there is a sneek peak of my latest project, it is about as close as anyone is going to get. Still early days but viciously expanding, also don't want anyone stealing my idea. Only a few close friends know this project and I trust them fully to not disclose any information without checking in with me first :) Even that scares me lol.

This idea has been in head for absolute years, ever sinces I touched learning PHP. I've only a working prototype to show off a snippet of the system. I am now trying to make it a reality. It is all heavily planned and if all goes well....Well lets not get too big head here, who knows it could fail really :P

I am also thankful I have got my programming interests back, it disappeared on me over a year ago. Long story so I won't explain here. Enjoy the pic :P

Wednesday 6 August 2008

Smarty Obsolete

Smarty was made obsolete by proper use of MVC and CSS handling. Also you can cache pages using Zend_Cache.

Heh, as of this date, they moved smarty.php.net to it's domain, lol. Some developers still rely on technology and still need support (Like regular updates), fortunately I am not one of them.

Handy Design Links

Free Fonts
http://www.free-fonts.com/

Less Distracting Links

Soo many links? Grey out the areas that not so important, until hovered over.

As of 2008 SecondLife's website demonstrates this very well.

Tuesday 5 August 2008

Welcome to my Dev Blog

Here you see snippets of code in various languages that has been helpful to me.