Filed Under (Others) by admin on 04-02-2010

A code view theme for dreamweaver based on zenburn low contrast console theme more info on zenburn official site.
To use in dreamweaver here are the Instructions:
1. Download file here
2. Go to C:\Documents and Settings\\Application Data\Adobe\Dreamweaver CS3\Configuration\CodeColoring
3. Backup first the original Colors.xml rename it as Colors-back.xml
4. Then paste our downloaded Colors.xml file
Filed Under (mediawiki) by admin on 02-02-2010
Images on a MediaWiki wiki will by default, link to the description page
Here is a work around that when you click an image it will link to an ariticle
[[Image:Wiki.png|50px|link=MediaWiki]]
Note: The code above will work in mediawiki version 1.14 and above only
——————————————————————————————————-
Here is the workaround for older versions
Edit the Common.css
.imagelink_somename a {
width:100px;
height:100px;
display:block;
text-decoration:none;
background-image: url("http://fullurltoimage")
}
In your wiki code:
<div class="imagelink_somename">[[Some link| ]]</div>
——————————————————————————————————–
Or try the quick way
<div style="position: relative; width: {{{width}}}; height: {{{height}}}; overflow: hidden;">
<div style="position: absolute; top: 0px; left: 0px; font-size: 100px; overflow: hidden; line-height: 100px; z-index: 3;">[[{{{link}}}| ]]</div>
<div style="position: absolute; top: 0px; left: 0px; z-index: 2;">[[Image:{{{image}}}|{{{width}}}|{{{link}}}]]</div>
</div>
More workarounds found at mediawiki docs
http://www.mediawiki.org/wiki/Help:Linked_images#link.3D_Syntax_available_since_version_1.14
Filed Under (mediawiki) by admin on 28-01-2010
Edit the LocalSettings.php
add the notes:// protocol
where you find this line (add it as an array item)
$wgUrlProtocols = array( 'http://', 'https://', 'mailto:' ,'notes://');
Filed Under (php) by admin on 25-01-2010
Tagged Under : php
The mt_rand() function is a drop-in replacement for rand().
It uses a random number generator with known characteristics using the Mersenne Twister from the php docs website
I somehow noticed php rand() has a pattern, So I dug up the php docs for a better rand function and end up discovering this neat random function
Use mt_rand()
<?php
echo mt_rand() . "\n";
echo mt_rand() . "\n";
echo mt_rand(5, 15);
?>
Output
1604716014
1478613278
6
Filed Under (php) by admin on 22-01-2010
Tagged Under : php

I was able to figure out how to run Simple_html_dom php library on codeigniter
Download the simple html dom library here simple html dom
I copied the file Simple_html_dom.php to
/system/libraries
Then in my controller I call it using
require_once(’Simple_html_dom.php’);
To use it, I initialized it using this line
$html = new Simple_html_dom();
Load a page or link using the line
$html->load_file(’http://www.google.com’);
and parse or find elements using this line
$html->find(’table tr td’)->plaintext;
works fine and fits right to what I needed to do.
Filed Under (Others) by admin on 04-01-2010
Visit google today and see an animated logo of a falling apple

http://www.google.com
Newton himself often told the story that he was inspired to formulate his theory of gravitation by watching the fall of an apple from a tree.
Cartoons have gone further to suggest the apple actually hit Newton’s head.
GRAVITY……… and there goes the apple
Filed Under (jquery) by admin on 27-12-2009
Tagged Under : jquery
Filed Under (Others) by admin on 15-12-2009
Tagged Under : icon

You’re busy coding finishing your web app, you need to put a santa icon or coffecup icon , though google might help save you’re search time.
Youre hoping there is website out there with enough icon archive ready for download and use.
www.iconarchive.com is the answer
From their website:
The Icon Archive is a categorized collection of high quality desktop & web icon sets. We currently host over
27,300 icons in 971 sets from 226 icon authors. Icons can be used for Windows (XP, Vista, etc.), Macintosh (OSX, OS) and Linux (as PNG Files). Copyright of icons belong to original authors. Public usage license can be found on each icon set page.

What impressed me with the site
– quick find on icons.
– rare icons like (ex. giraffe or toaster). is available
– They have apps icons, icons we see usually on apps (save,add,delete update,trash bin).
– quick download, right click save, you’re done, copyright applies read copyright first.
– FILE FORMAT is only at png some have .ico but most of the time I will need a transparent png for my web app buttons or tool bars
Filed Under (Others) by admin on 15-12-2009
syntaxhighlighter by Alex Gorbatchev.
clean
simple
and easy to use,
install it then you’re of to go
what i like the most are the color themes
Here is an example:
<?php
$os = array("Mac", "NT", "Irix", "Linux");
if (in_array("Irix", $os)) {
echo "Got Irix";
}
if (in_array("mac", $os)) {
echo "Got mac";
}
?>
Download at wordpress.com:
http://wordpress.org/extend/plugins/syntaxhighlighter/
Filed Under (mysql) by admin on 10-12-2009
Tagged Under : mysql
Lets say we have this table the ORDERS TABLE
ID customer ordered
—————————-
1111 – John – pizza
2222 – Pete – salad
3333 – Rach – pizza
4444 – Maxx – pizza
5555 – Zigg – rice
1212 – Vinc – salad
4545 – Grac – sushi
1313 – Mark – cake
2424 – Phils – salad
We only want to show items which has been ordered more than 2 times here is our query
—————————————————————————————————————————
SELECT *,count(ordered) as cnt FROM ORDERS group by ordered having cnt > 2
—————————————————————————————————————————-
result:
1111 – John – pizza
3333 – Rach – pizza
4444 – Maxx – pizza
2222 – Pete – salad
1212 – Vinc – salad
2424 – Phils – salad
We use here the having keyword
note: having will work if you have group by on your query