jgiam.com

Just another WordPress weblog

Archive for February, 2006

Why is ice slippery?

without comments

And no, contrary to popular belief, it isn’t because of the pressure exerted by the blades of the skates. The New York Times has more. (Requires login)

Written by Jon G

February 22nd, 2006 at 9:13 am

Posted in Cool Stuff

Tagged with ,

Most Unusual Buildings On Earth

without comments

I never knew there were such unusual looking buildings in the world

Written by Jon G

February 21st, 2006 at 7:55 pm

Posted in Cool Stuff

Tagged with , ,

Love-quotes

without comments

Got this in an e-mail. They are from the book Lovesick: The Best Quotes About Love and Sex by Bruce Lansky

“Love is a word consisting of two vowels, two consonants, and two fools.” – Jeff Rovin

“Love is what happens to men and women who don’t know each other.” – W. Somerset Maugham

“Love is the only disease that makes you feel better.” – Sam Shepard

“Love: one game never postponed on account of darkness.” – Anonymous

“Love is much nicer to be in than an automobile accident, a tight girdle, a higher tax bracket, or a holding pattern over Philadelphia.” – Judith Viorst

“A guy knows he’s in love when he loses interest in his car for a couple of days.” – Tim Allen

“When you’re in love, it’s the most glorious two-and-a-half days of your life.” – Richard Lewis

“The only place you’re sure to find love is at the end of a letter from your mother.” – Bruce Lansky

“I can see from you utter misery, from your eagerness to misunderstand each other, and from your thoroughly bad temper that this is the real thing.” – Peter Ustinov

“Love is a fire. But whether it is going to warm your heart or burn down your house, you can never tell.” – Joan Crawford

Written by Jon G

February 11th, 2006 at 9:04 am

Posted in Hardy-ha-har

Tagged with ,

Simple Syntax Highlight

without comments

I found out that using ‘<’ and ‘>’ within <pre> tags was illegal. So I started looking for a way to convert program code into HTML.

Later on, for my tutorial for my programming module, it involved putting code into a Microsoft Word file. Doing so was tedious. If I copied and pasted from my editor into Word, the text would be pasted as normal text, and Word would format it in, for example, Times New Roman. Plus, the syntax highlighting that was in the editor was gone.

So now, I wanted something that could syntax highlight my code as well.

I came across GeSHi – Generic Syntax Highlighter. It was exactly what I wanted.

I hacked up a simple interface so I could paste code and convert it easily, and so, created Simple Syntax Highlight. You can choose the language (I only added the more common ones), whether to display line numbers, use CSS, and display HTML source. This solved both my problems, since now I could paste my code in valid HTML in my webpages, and I could also paste my code into Word with a fixed-width font, and syntax highlighting.

I called this “Simple Syntax Highlight” because I intend to create a database-driven site in future, to store converted codes, maybe a comments-system as well. But that won’t be anytime soon, as I have my Uni work to cope with.

I welcome any feedback. If you spot a bug, do let me know as well.

Simple Syntax Highlight – http://jgiam.com/geshi/

Written by Jon G

February 7th, 2006 at 8:40 pm

Posted in Techie Corner

Tagged with