Archive for the 'Interesting Stuff' Category

Self-professed Programmerholic

Early this year, disturbed by some ideas made me open notepad and started to whip up my first “web application” of the year.

A simple countdown DHTML page - a combination of html, javascript, css and dom - was created. The purpose was simple, to create a count down in different units (ie. years, months, weeks, days, hours, mins, seconds, ms) to my ORD date. A windows xp wallpaper is added as the background, then use Active Desktop to cover the entire desktop background, with the time remaining running continuously like magic. (css was used to create a bar chart to show percentage of time remaining in my whole ns, and the working hours left when run.. well i thought this could be improved to be come a booklet or wordpress plugin too)

This addiction to programming led me to coin the description “programmerholic” on my msn nick. This may give the impression of my love for programming, but it meant time, brain cells, effort were much used to compensate of my technical limitations. The byproducts are frustrations, messy coding but yet hopefully some working code, practicality and satisfactions.

Here’s another example how I’m program impulsively in a spurn of moment. My 2nd program of 2007 - another javascript “software” to solve a puzzle using brute force to find a solution to the many different combinations.

One weekend, I saw a link to a difficult Russian puzzle over at digg.com, a tessellation puzzle where 5 pieces were needed to be arranged into a confined area. The popular game called Tetris was invented by a russian, which makes me feel that they are very good with shapes.

Later that day, my friend searched “russian puzzle” and we eneded trying to solve another puzzle called 8 Queens - to place eight queens on a chessboard so that no queen attacks another over at http://sakharov.net/puzzle/.

This is a interesting puzzle, something which may not seem difcult, as you try to place the last few chese pieces on the board, you’ve find that its not so simple. Simple mathematics shows that there were going to be many combinations, but I knew the human mind was good enough to process and filter them quickly to get the answer. However, knowing that writting a script or program would spoil some fun, I did otherwise with the following reason

- We were having headaches that we didn’t really have concentration and patience to solve the puzzle
- Lazy to solve it the “normal human way”
- The computer could come up results faster and better than we do
- Computers are good at crunching numbers, which was what I was going to make it do

Therefore, I type the following into a html file (you can try it too), load it in the browser, and within seconds gave me 92 solutions (considered the board can be rotated 4 times, 23 solutions. with mirror images, perhaps less than 23 unique solutions with at least 1 solution non mirrorable pattern). Note: for the numbers displayed, each digit refer to the position of the queen- i thought using number could make a good data structure too.

return “have fun”; /* end of my post now for now.. */

solvequeens.htm
————————
<script>
function valid(situation, level, position)

{
 
 for (var x=0;x<level;x++)
 {
  digit = Math.floor( situation / Math.pow(10,x)) % 10
  // check column

  if (position==digit) return false;

  // check diagonal
  left = position - x - 1

  right = position + x + 1
  if ((left>0) && (left==digit)) return false;
  if ((right<10) && (right==digit)) return false;

 }

  return true;

}

function solveQueen (situation, level)

{

 //alert( "Solving " + situation + " " +level)
 if (level==8) {
    sn ++;
    document.write
 ("Solution " +sn + " found! "+ situation +"<br/>")

    //alert ("Solution found! "+ situation)

    return true
 }

for (var x=1;x<=8;x++)
{
 if (valid(situation, level, x)) {

    //alert(situation+ " "+ x1)
    //solveQueen ((situation + x *
Math.pow(10,level)), level+1) // reverse number "data structure"

    solveQueen (situation * 10 + x , level+1)
 }
 

}
 // end solvequeen
}

sn = 0
alert("start")
solveQueen (0,0)

alert("end")
</script>

$103.40 Shopping Spree

at Queensway IKEA plus $16.20 taxi back home, with the help of my father and cousin to carry the stuff up to our home.

Ikea Stuff

Includes,
Tall Shelf $29 FLARKE N BOOKCS
Super Pinkish $35 SNILLE CHAIR
4 90cents Bokis Book-Ends
Zip-able Strikt Cd box with Lid
Simple Lyclig box with lid
Simple Fixa Tool Box - 3 Sharp Trojka nn Scissors
Black with Zig-zag OMSORG SHOEHORN
5 White FLYT MAGAZ Holders
5 Brown Coloured Lingo Magazine File Holder

A little shopping therapy feels good.

Bible on your Symbian Phone

Previously, I mentioned Java Bible for MIDP mobile phones (Jolon’s Go Bible), then PocketPC Bible for PDAs/*DAs (Pocket e-sword), now something not that old, but Bible for your Smartphones (Anything better than Symbian 60, which is almost any new handphone nowadays)

The software I’m using is the free, open source software named

S60Bible or Symbian Bible

Its a port/derivative from the palm bible+ which uses palm portable document.

Now, this software like other bible software, is just the engine and therefore you need to find and download the “Bible Databases” to work. (If you don’t, you will need to write or use others’ tools to create them)

Here are some links which you should be able to get more than what’s necessary.

Palm Bible Plus Premade Bibles

theChan Website of Ported Christian Bible

McLean Ministries
Other versions of symbian bible including for UIQ and more bible to downloads.

Tips
Also note, you can install commentaries too, and use the select bible function to switch between bibles/commentries. The commentaries I am using- Clark, Wesley, Matthew Henry, Geneva

Change the font to something which you can get use to

Configure the key bindings to fully control the software. I have tune my to somewhat the keys of “Go Bible”. I use left and right to scroll line-by-line, while up and down for page-by-page, 1 and 4 for next/previous verse, others for history, bookmarks, books.

I usually still using the midlet version of the bible, then switch task to s60bible to look up references.

Well, its just not good enough knowing of good software. Its time to start using and read the Bible!

Some interesting facts about the bible.

  • 66 books (39 OT, 27 NT) written over 1600 years by 36-40 different people in 3 different languages (Hebrew, Greek, Aramaic)
  • has been translated to over 1300 languages, more than 500 million copies sold in 2002 alone, and over 6.5 billion copies have been printed since 1450.
  • 7 wonders (its formation – written by different people in different places over a long period of time; its unification – one book; no contradictions; its age – most ancient of all books; its sale – best seller of all time; its interests – read by everybody, young and old, learned and unlearned; its language – a literary masterpiece despite some of its books being written by uneducated men; its preservation – most hated but preserved till today!

Other free, good software I have on my s60 phone (n-gage classic)

AutoLock - To auto-lock phone auto specified time to prevent accidental keypresses and save backlight (battery life! maybe phone bills, irritation and noise too)

OGGPlay - To play ogg files on ur phone!

DictionaryForMIDs / Oxford Dictionary Midlet - using a translation midlet engine, orginally for chinese to english i think, but it makes a powerful dictionary and tool

msvDriveE - Uses memory card to store messages. Means you free up space on ur internal memory, have much for space for storing sms, able to receive big bluetooth attachments (OBEX objects), and send files thru bluetooth bigger than ur internal memory (> 2MB)

Side track again to some interesting software I seen for pocketpc recently.

Midlet Manager - For running java/midp software on windows mobile.
Dicty - Dictionary
Shortcuts - for switching off screen, restart.. etc etc..

Music at the Bar

Three notes walk into a bar:a C, an E-flat, and a G. The bartender says he doesn’t servce minors. So the E-flat leaves and the C and G have a fifth between them.

Found this in last month’s Reader’s Digest (March 06) “Laughter, The Best Medicine” section.

I read this somewhere else, in some magazine?

A guy shows his friends his newly moved in apartment.

They ask whats the Gong and hammer items in bedroom.

“Its a talking clock”, he replied.

He wacks the hammer producing a thunderous clash.

“Knock it off! Its one in the morning!”, came a shout from the wall beside.

More Sudoku

This is another article due for posting for a long time, but I always never want to click the “Publish” button.

This 2nd post on Sudoku of mine will attempt to show you more ways to waste time on it, or nicer said, give the grey cells a little more workout. Some of these puzzles I would be touching on, each have a capacity for give you something to think about a few hours, 1 or 2 days, or maybe more. One of it can keep you occupied for your guard duty, another for all the waiting and travelling time, and one to keep you headaches. In some of my completed puzzles, the byproducts is lots of numbers scribbled all around the paper, which reminds me of John Nash in “A Beautiful Mind” scribbling codes all over the place.

Web Sudoku
This sites gives you countless of classic 9×9 sudoku. Chose one of the 4 level of difficulties, you can play online and time yourself, or just chose to print to keep some copies to work on in your free time. This site is a fravorite amoung my campmates.

Killer Sudoku
A guy was sitting on my right in the train, holding a book and a pencil. I glanced at it, and I thought, another Sudoku lover? I wanted to break a conversation with him, then noticed that the puzzles was not really what I seen before. I silently observed a little more, peeked at the title which was something like “Killer Sudoku published by Times”, then got down the next stop. I did a search, I soon I was introduced to a new dimension to killer sudoku.

The completed killer sudoku puzzle complies with the classic soduku rules. The difference is in its clues, instead of prefilled numbers, the clues are sums of the numbers covering specified boxes in the sudoku. What I like about variation is that you get to use mathematics (each box or row sums to 45, try adding 1 to 9). When you figured enough boxes, you would like to use the classic sudoku logic and methods to complete the puzzle.

Visit killersudokuonline for dozes of puzzle each week. Puzzles come in flavours of easy, medium, hard, mind-bending. Also of interest found on that webbie would be the “Great Than” sudoku. In each small 3×3 grid, you only know which is bigger in number of 2 boxes side by side.

My favorite site for sudoku would be DJ Ape .Net - The Home of Perfect Sudoku. You get daily sudoku and killer sudoku. You would be able to learn of different solving techniques and other brainteasers time to time. You might be able to find these other variants of sudoku too.

Butterfly sudoku
5 Sudokus intersect at the corners, or more accurately, 4 sudokus intersecting the corners of a center sudoku, forming a big sudoku which shapes like a butterfly. If you see a X across the diagonals, each diagonal contains 1 -9 uniquilty. This is a important clue to solving some the puzzles.

Samurai sudoku
Upsizing the 9×9, you get 12×12, but its actually 4 overlapping 9×9 sudoku puzzles.

These are more variations, esp if you mix variations together, eg. Butterfly-Samurai-X, Harakiri-X (2 Butterflys linked)

Kakuro
Now this is another puzzle, not a sudoku in my views, but I think shares the same creator and simlar rules of sudoku. It looks and works more like a crossword puzzle, you get clues (sum of numbers) for horizontal and vertical (right and down) “words” (number sequences which each digit can appear once only).

I first came across this on a book title in Kinokuniya, and later I spotted it appearing in The New Paper daily. Its quite fun, a little like a killer sudoku, and it can take you hours playing, but for me I prefer killer sodukus (maybe i just love the squarish grids and the familarity).
Well, if you are interested, the net is always full of Kakuro

I was hoping I could release my Sudoku Solver Midlet version 2 with this post, together with instructions, but I’m afraid that would be the next time.

[update:March 26 Sunday] I was working on my Harakiri X Sudoku on the mrt train. A gal (about my age I think) approached me asking where I got it from (she must be bored with the classic puzzles too). Sensing another Sudoku fan, I gave her the links mention above and introduced some variations too. Well now that I think, maybe I should have gave her the link to my blog too.