Posts

Showing posts from May, 2006

Solving Sudoku in Python

This is a great article about solving sudoku in python. Peter Norvig is a director of research at google and looks to be a pretty smart cookie. I've toyed with writing a sudoku solver in python and the first part of his code mirrored closely to what I was thinking. Build a set of dictionaries where given a cell you can find all the other cells that constrain it (what he calls units and peers). Naming the cells A1, A2 like an excel spreadsheet is very smart and I hadn't though of that (2D arrays are a pain in Python). Putting all the possibilities in each cell (i.e. "123456789") to start and eliminating impossible values as you set the givens is brilliant. In fact, it's so brilliant that I had a hard time following the generator expressions and list comprehensions despite being very comfortable with them. Also, Peter's lisp heritage shows throughout his code. The part that confuses me is where he picks the most constrained cell (for example one that has

Haarg, world!

A six year old writes a computer game with his dad using Python. This article almost brought a tear to my eyes, it's so cute. It's a story where Anthony writes and loves his little python "guess the number" program that he writes pretty much all by himself. Also the article shows how to be a good dad in 2005.

OLTP

Image
The One Laptop Per Child ( OLPC ) group has some new shots of some real prototypes. If you click on the image on the right you can see the keyboard a bit better. There are few things I don't like that much about the keyboard. First they replaced the Zero key with an X for Multiply, probably just a little mistake. There appears to be an Undo key instead of backspace which is not a big deal. What appears a little annoying is that the cursor keys are next to the screen, which might get tiring lifting your arms to that level. If they are going to mess with the standard keyboard layout, why don't they get rid of the caps lock key? Some people feel that the OLPC is just the wrong way to go. I think the confusion is thinking of this as a laptop! (perhaps it's badly named). I think it's more useful to think if of it as a digital book and a digital notebook. What this is, is a way of distributing text books cheaply and saving on paper for written assignments. For some,

State of Fear

I just finished listening to a State of Fear by Michael Crichton . My big problem with the book is that Crichton tries to debunk global warming as unsubstantiated and as fear mongering. On the plus side Crichton does bring up some valid points about uncertainties with climate change, but it is very one sided in the book. I also agreed with Crichton that politicians use fear to gain power - but today it's more "terrorism" than global warming. I also have a beef with Treehuggers who see things only black and white. For example: Nuclear power - evil, DDT - evil Chlorinated or fluorinated water - evil Animal testing - evil All of these all have pros and cons and simplifying things as for or against just doesn't help. All in all I'm dissapointed with the book and the stance it takes. It doesn't help that Bush liked the book and met with Crichton. In order to balance my Karma: An Incovenient Truth - coming to a theater near you. How to Talk to a Global Wa

Dead formats and OpenSource

Wired News has an article about dead formats. It sparked a thought I've had for a while on some old standards that I thought would have died a long time ago, but are still used today. One is the tar format. This way of storing data is very old, yet it is still used quite a bit in the Unix world. With zip (rar, etc.) like program I thought this format would dissapear, but it is still going strong. I have a magnetic tape from the late nineties that I'm sure I could still read since it's stored as a tarball. Another one is TeX , which I wrote my master's thesis with. I thought T E X was great, but that no one except a techie would ever use it since it's so complicated. I looked that programs like Microsoft Word and figured that it would be the future. Yet T E X is still going strong and I could probably still compile my old thesis with no problems. The common theme is that these "products" are open source, there is no company behind them hiding proprie

Weekly del.icio.us bookmarks

Shared bookmarks for del.icio.us user scott_kirkwood MIDAS: Homemade Dorm Room Home Automation System -- Can't see all the videos, very geeky and cool tagged as: [diy electronics howto] Password Gorilla -- Compatible with PasswordSafe which I use, plus it's cross platform (but which version of PasswordSafe?) tagged as: [linux free password security windows] Python Generator Tricks LG #100 -- Nice generators examples + examples of converging to the number PI in a cool way and the prime number sieve is fascinating. tagged as: [python programming] InstallJammer - A free, open source, multiplatform installer and builder - Home -- I was using Inno but perhaps this is better? tagged as: [development linux windows tools] BazAR: A vision based fast detection library -- More research for Renata's program tagged as: [video renata research toread] reacTable* software -- Some good links here, and some C++ code. tagged as: [programming video renata research] The Hardest Lessons f

The fall of Sony?

I've blogged about this before and there are other's making the same noise . I don't like Sony because they are just too greedy. They design their products so that if you buy one, you become compeled to continue buying from them. For example, their DAT tapes drive which only Sony players could play, or their MemoryStick memory which only Sony players can use. Because I'm a computer guy if anyone asks I steer them away from Sony products. It's a little unfair, because the company is quite large and some of their products are fine. But these bad decisions are being made from the top and taints the whole company. I think their PS3 won't be a big seller. It's very expensive compared to the competition, there's nothing innovative with the machine (just faster better graphics) and it has a Blueray drive which nobody is really asking for, and is just driving up the costs. When it comes to game consoles I'm now a Nintendo man. I just went out and bo

Crunchy Frog

Cruncy Frog is quite neat, it's a python web server that you can use to make a python tutorial. You can enter python expressions (even multiline python code) and it'll run the code and show the output in the browser page. The idea is that you can create a tutorial that lives in the browser and where the students can write and test actual python programs. It's looks like it's part of RUR-PLE project, which is near and dear to my heart since I also made a Karel the Robot interpreter. One of my first paid programming jobs was to make (using Turbo Pascal) a (recursive descent) interpreter for Karel programs along with a graphical interface showing the robot's world. The program had a built in text and "world" editor as well. It also mimicked the Turbo Pascal interface as much as possible so that when the students started programming they would already be used it. I remember the hardest part was giving helpful error messages when something went wrong. By

Spyware quiz

According to McAfee, most users are unable to spot spyware on websites. "According to the first-ever Spyware Quiz conducted by SiteAdvisor, a staggering 97% of Internet users are just one click away from infecting their PCs with spyware, adware or some other kind of unwanted software. Even though the threat of spyware has received extensive media coverage, just 3% of the 14,000-plus consumers who took SiteAdvisor?s spyware quiz received perfect scores." You can take the quiz here . From just looking at the screenshots. I think I did alright with 7 out of 8 questions correct. The one I got wrong was the Lyrics site. via Cow's Blog

Forcing users tp change their passwords is not effective

At a company I consult for, they change the password every month. Not on all systems but on at least two (both Windows). It's a pain, what's worse is that changing passwords regularly doesn't work . Here are my pet peeves for usenames and passwords: User names or passwords that can't handle "special" characters. I like to use special symbols like @ or % but a lot of sites don't permit that. User names or passwords that have a limited maximum length. Why can't I have a password thats 200 characters? Passwords that are a fixed length. This actually makes it easier for someone to guess your password. Passwords that can only be numbers, people end up using their birthday or social security number. Passwords that can't be cut and pasted. Banks sometimes do this because they are afraid of keyloggers . I'm not against that if you are checking your account from an internet café, but if you are on a trusted computer why not allow cutting and pastin