Getting Geeky

This past week or so I was busy getting seriously geeky.

First, there’s the background. There’s a push among the foreigners in my city of Ulsan to have some city services, particular emergency services, cater to the foreigners. Without going into too much detail, Korea imports thousands of teachers like me – people with university degrees and speak English. They do not require us to speak Korean. However, the society here is, despite the enormous effort to teach English, surprisingly unable to communicate in English.  A recent rape of a teacher here has prompted a lot of the foreigners to wonder how they’d deal with an emergency. Koreans can call 119 (Fire) or 112 (police) but unless you speak Korean it won’t do much good for a foreigner to call – all you’ll get is frustrated.

So, as part of my role of city reporter and techno-geek for my other website, UlsanOnline.Com, I had to get into some serious programming. I’ve dabbled in stuff since we started the site, particularly in the menus, and layout. But this time I had to bring out the big guns. None of my cohorts on this site are technical. In fact, few foreigners here are. None are technical to my level – no brag, just fact – I have a degree in computer science. So, I have to strut my stuff here and at least let you, Dear Readers, get a taste of my technical prowess.nerd

First was to create a survey. We hope to use the survey as data that the foreigners are ill-served in Ulsan. The local police are aware and on board, provided we can prove there’s a need. The survey itself, can be found here.

(Unless you live or lived in Ulsan DON”T CLICK THE SUBMIT BUTTON!!!! )

It’s pretty. Sure. It’s just some forms that are easily created in HTML. No big deal. But I put in javascript code to validate the data – each field must be filled out, numbers in some, not in others. If you said other, then expect some text, etc., If you want to see the gyrations I went through, go to the survey and then on your browser click on “View” and click on “Page Source” and you’ll get the actual code I wrote to create that survey and validate the data.

But wait – there’s more. To get the 10 Ginsu knives, I had to save the data from all those submit button clicks. That means a database. We were out of databases on ulsanonline.com and would need to upgrade (that means pay $) to get more. But on this server, martypants.us, on which you are reading now, I have scads of database headroom available.  So I created a new database here javascript_logoand wrote the code to move data from the submit button click on the ulsan computer to this computer. Then I had to write code on this machine to stuff the answers from that survey into a database.   My Ginsu knife code cuts the survey into bite size pieces and puts them into tiny slots, each in their respective places.

But wait, there’s more! To get the handy tomato slicer, I had to write code to get the data back out. That’s another page that pulls the data out in tabular form so one can make charts, graphs, understand trends, etc., – essentially slice and dice the data like the handy tomato slicer.   phpThat page actually lives on this server, as does the database.  To get a peek at the data, still in its early days of foreigners completing the survey, click this link.

In summary, I wrote HTML/CSS code to do layout and pretty work. I used Javascript code to validate it. I used PHP code to cross transfer the data and stuff the database. I used SQL code to create the database and accept the data into a mysql-logodatabase. Then I used PHP, SQL  and HTML again to pull the data back out for viewing.

And if anyone actually understands any of this, then you, too, get the 10 Ginsu knives.

And that, has been the extent of my week in Korea.

Happy Thanksgiving to everyone back home!