Why I did not apply for a job in big cities

September 2nd, 2010

One of the comments on YouTube I really liked:

Glad to see the container is not made of a recyclable material. The higher the landfill the sooner we can climb up it to get to fresh air!

New York Times article.

Delivered

September 1st, 2010

On school revolution and language evolution

August 20th, 2010

Sir Ken Robinson suggests a new model for education, away from linearity and conformity, while Jan Thomas and Sebastian learn three languages in a natural way.

I admire Sir Ken for the way he presents his ideas. An ounce at a time, realising, perhaps, that this is the maximum dosage that can be swallowed. I also hate him for the same reasons. Don’t we deserve more than a tease of what he sees as the way forward?

Recursive thinking by a four-year old

August 18th, 2010

We were having dinner and JT asked for help to put butter on his chapati (Indian bread). This conversation ensued.

- I thought you could butter the chapati yourself.
- I need help.
- When do you think you could do it on your own?
- When I am 10.
- When will you be 10?
- After I am 9.
- When will you be 9?
- After I am 8.
- When will you be 8?
- After I am 7.
- When will you be 7?
- After I am 6.
- When will you be 6?
- After I am 5.
- When will you be 5?
- After I am 4.
- That will be in 3 months time.

The difference that 617 meters make

August 17th, 2010

Santa Cruz de Tenerife is at sea level. La Laguna is 30 minutes away with train at altitude 617 m. The latter is five degrees colder. Odaly’s university is at La Laguna, but now we are reconsidering where to live. 18 degrees is far more pleasant than 13 degrees.

MS Encarta 10 years later

August 14th, 2010

I am throwing away old disks, but before I do I see if they are worth keeping. I just installed MS Encarta 2000, but it would not run. When I went to the control panel to remove it this is what I saw:

When I start up the Add/Remove Programs applet, it shows a number of programs, then has a huge amount of empty space between two entries (we’re talking dozens of page down keystrokes to find the next one), then some more entries, and another huge gap.

How to undelete a program if it is not listed in control panel and the folder does not have a file called uninstall.exe?

I searched the Internet and found this solution:

here is the actual location in the registery that helped me [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{5783F2D7-0101-0409-0000-0060B0CE6BBA}] the key was called “DisplayIcon”

When I went down this folder I found, lo and behold, MS Encarta and MS Reference (or whatever it was called) and one of the keys was called ‘Undelete file’ (or something of the sort). I ran both undeletes and the gap in Add/Remove Programs was gone!

The page that helped me.

Computers for seniors

August 14th, 2010

Per Øyvind Heradstveit, a famous political reporter in Norwegian TV, did a lot to give seniors ICT skills, partly through the webiste http://www.treffpunkt.no. Heradstveit died in 2004 and the site seems to have died with him.

When I search for the url or his name I get few pages as a result. I found a newspaper article from 1999 and a Wikipedia entry, but little more.

So what is a poor guy supposed to do? Think about it if you like before reading on.

The answer:

Internet Archive is a non-profit digital library offering free universal access to books, movies & music, as well as 150 billion archived web pages.

Here is the site from August 04 2003.

Why the interest? Two things, I am fascinated by how one individual can move mountains and how the mountains stop moving without him. Secondly, as an ICT educator I am interested in how seniors can attain ICT skills.

Some images are more corrupt than others

August 10th, 2010

Today I tried to make a Visual FoxPro report with images of teachers and students. I did not want to store the images in tables, neither did I want to store their file names in tables. All I wanted was to use the images as they were stored in a folder on the hard disk.

As I did not get it to work I posted a cry for help here.

I use vfp9 sp2 and winxp.

The cursor for the report has two field: id and lastname.

SELECT id, lastname FROM teachers02 INTO CURSOR cur_temp
SELECT cur_temp
SET SYSMENU OFF
npages = 10
REPORT FORM report1 TO PRINTER PROMPT PREVIEW Range 1, npages
SET SYSMENU ON

In a folder I have images of the teachers named id.jpg, so the teacher with id = 3 has image 3.jpg.

In the detail band I have a textbox for the id, a textbox for the lastname, and a Picture/Ole control for the image. For the image;s control source property I have: MYUDF().

PROCEDURE MYUDF()
LOCAL cid
cid = ALLTRIM(STR((cur_temp.id)))
MESSAGEBOX(cid)
** image path
LOCAL imgpath
imgpath = app_path + 'images\'+cid+'.jpg'
** check if image exists
IF ADIR(arr_temp,imgpath) = 0
 MESSAGEBOX(imgpath + " does not exist")
 imgpath = app_path + 'images\7xx.jpg'
ELSE
 MESSAGEBOX(imgpath + " does exist")
ENDIF
&& imgpath = app_path + 'images\7xx.jpg'
MESSAGEBOX(imgpath)
RETURN imgpath

If the image does not exist the image 7xx.jpg will be shown.

I have stepped through the MYUDF and it behaves as it should, i.e. till it has executed for the first page. cid is 1, 3, and 4, and it finds out correctly if 1.jpg, 3.jpg, and 4.jpg exists or not, and the correct imgpath is returned.

However, after it has run for the first page (three images) it displays the error: Picture too big, corrupt or in wrong format.’

If I change the last lines of MYUDF to:

imgpath = app_path + 'images\7xx.jpg'
MESSAGEBOX(imgpath)
RETURN imgpath

it works perfectly, i.e. if one is happy with showing the same picture for all the teachers. :)

What am I doing wrong?

Due to Internet searches and intensive trying and failing, I found the solution. I discovered that corrupt files can be mad OK with a little bit of careful attention.

Searching the Internet I found a workaround.

Using the free IrfanView - File - Batch Conversion/Rename… I checked Batch conversion, set JPG as output format and in Options for output format unchecked all the check boxes (from what Internet told me the EXIF data should be removed). I used as input files my folder of jpg images, set Files of type to JPG and clicked Add all to have the input files ready. Four output directory I chose an empty folder. Then I clicked Start Batch and all jpgs that before was vfp-corrupt were now accepted.

Problem solved!

My udf is now simply:

PROCEDURE MYUDF()

LOCAL cid as string

cid = ALLTRIM(STR(cur_temp.id))

LOCAL imgpath as string

imgpath = app_path + ‘images\’ + cid + ‘.jpg’

** check if image exists

IF ADIR(arr_temp,imgpath) = 0

imgpath = app_path + ‘images\missing.bmp’

ENDIF

RETURN imgpath

In case you didn’t know

August 9th, 2010
Click the image to see the video

Click the image to see the video

… only termites, naked mole rats and certain insects like ants and bees construct social networks as complex as those of human beings. In that elite little club, humans are the only ones who shop …

It’s better to go on a vacation than buy a new couch … - More

Students with the same nick name

August 8th, 2010

I am working on a school administration program in Visual FoxPro 9. To recognise students sometimes only the nick name is wanted. But what if two students have the same nick name? How does one tell who is who?

This code says who share the same nick name:

select nname, COUNT(id) as x from students WHERE statusid = 1 group by nname HAVING x > 1

This was the result:

Alex 3 Anna 2 Anushka 2 Ben 3 Benjamin 2 David 2 Grace 2 Harry 2 Jack 2 James 4 Jan 2 Jason 3 John 2 Kevin 3 Lily 2 Mai 2 Max 2 Nan 2 Nancy 2 Nicky 2 Nuk 2 Peter 3 Philipp 2 Ploy 3 Pop 2 Poppy 2 Sabrina 2 Sam 2 Sarah 2 Tan 2 Vanessa 2 Vishal 2

But how does one only find those who share the same nick name who are in the same tutor group.

SELECT id, nname, formid ;

FROM students as a ;

WHERE (statusid = 1 ;

AND nname in ;

(SELECT nname FROM students WHERE id <> a.id AND formid=a.formid and statusid = 1)) ORDER BY formid

The code worked like a dream:

id nname formid 457 Ben 4 458 Ben 4 297 James 5 523 James 5 194 James 12 200 James 12

There are 2 Bens in the form with id 2, 2 James in 5, and 2 James in 12.

When I extracted the nname I added the first character in the last name of those students who shared last name. For one form group it looked like this.

Luckily enough the first letter of the last name separated the students. But what if it had not? The next step of improvement is to find all who share the same nick name, give them a character from their last name, see who has the same name now, give those another character in the last name, and so on till no one shares the same name.

It should not be too difficult to program. A loop is all that is needed.

If this problem crops up in many situations one could even write a general function for field1, field2, and table1. Lo and behold, someone has probably already written one. :)