Sunday, November 11, 2012

The Way It Has Been


The sun is high in the sky on a late autumn morning. The large bazaar is open down the street, and cars and trucks line the road in all directions. A man is calling out, 'Nuts! Walnuts!', and he stands patiently next to his handcart, loaded full of his walnuts.

The call of the muezzin echos through the neighborhoods, the tinny speakers carrying his sad song of joy into the homes of all around him. He sits in a mosque far away from where the speakers beckon the worshippers. He had sipped on some tea to moisten his throat before his song. His Koran was open and on the table in front of him, next to the telephone handset which served as a microphone and sent his voice into many mosques around the district. Though each mosque has their own muezzin to lead prayers, its less discordant to have a single voice heard for kilometers around, rather than the competing discordant sounds of calls. If one wishes to have discordant calls, one can go into the Old Town.

Before the song is even completed, old men begin to wander down to the little mosque, nestled between the apartment buildings here near the heart of the city. At this time of day, the old men are the only patrons of Allah, waiting between television programs and games of backgammon for their call to move and show their faith, the march of those who have no direction, no job, and stay close to home. Only the oldest men cover their head with skullcaps, but none of them are younger than 40 years of age.

Going the opposite direction are women. Some are old and bent nearly in half with age, some are young, many with daughters to help them, but all are walking to the bazaar and most all of them wear the scarf. Many have carts with them to carry back their treasures, which they hope will last through to the next bazaar. If a meal requires onions, and they have no onions, they will not cook that dish until the next bazaar allows them to restock their cupboards. This is the way it is.

There are modern grocers scattered about. Many of the small stores, what we would call mini-marts in the west, sell eggs, juice, fruit, and canned goods. For the modern Turk, one doesn't have to walk far to get the staples needed for a meal. Fresh loaves of bread, with hard crusts and soft crumb, is hanging in baskets and stacked neatly in display cases at every store. But the traditional women of the new city do not like to purchase their goods at a grocer - instead, they tighten their scarf and walk to the bazaar, where fresh goods are brought in from around the surrounding countryside to be sold, bargained for, and traded, as this is the preferred way to purchase food.

There are stacks of tomatos, onions, leafy greens in all shapes and sizes, and the long and mild peppers that the Turks love so much. There are large wodden boxes full of oranges of every shape and size, apples, pears, tangerines, cherries, grapes, and lemons, and even the occassional seller of strawberries. There are walnuts, almonds, pistachios, and peanuts. Roasted and fresh. Sweet, salty, or plain. In the shell, or not. 'Fresh tomatos! The freshest tomatos here! Good price!', you will here at every third stall.

There are people selling sheep, both alive and butchered, and the scent of rotting vegetables and the musk of animal is nearly overpowering. People are packed in, shoulder to shoulder, going here and there, haggling, arguing, laughing, and looking for the best price. No cost is fixed - everything is negotiable, but to get the best deal, you must ask around and listen for the sellers who are trying to offload quickly as you can drive their price even lower.

The bazaar is a three-floor open sided building, dark and oppressive from the outside, even in the midday sun. Once inside, the lighting is adequate to see that you are indeed purchasing an orange instead of a lemon.

There are sellers of leather goods, knock-off designer sunglasses, and the occassional candy and sweet sellers.

By the time one old woman finally reached the bazaar, her husband had already finished praying. After he stands from kneeling for prayers, he straightens his clothes and walks into the courtyard of the mosque. He puts his shoes on and calls out to a group of men. He walks up to kiss his friends and smoke a cigarette. They chat for a while about the latest soccer match, discuss politics, take turns lamenting their pain over the recent death of their friend. A few of them manage to break out some tears, and only one man is heartless enough to say 'He drank too much, he had turned his eyes from Allah.'

His funeral had been the previous day at this same mosque. His body had been prepared and wrapped in linens and put on display as verses from the Koran were read. His widow weeping loudly and crying out her pain and loss. He had no other family, or at least none of them showed up to mourne. This is also the 10th of November, the national day of mourning for the death of the Republic's hero, Ataturk.

After a respectful time of mourning and remembering their old friend, they then walk together to the local game house were the clinking sound of okey tiles and backgammon pieces can be heard drifting through the clouds of smoke and laughter, late into the night. He will rise again with many of his friend in a couple of hours time and walk again to the mosque, to kneel and worship as proscribed in the Koran. He may return home to eat the meal his wife has cooked for him, but he'll return to the game house afterwards to count away the hours until sleep will take him.

Saturday, November 10, 2012

Modern Web Programming in Perl

I created my first webpage back in the late 90's using some silly site generator. Not long after I generated the code, I had to make some changes and the HTML was absolutely AWFUL. I couldn't understand it and it looked nothing like the examples in the book I was reading! This spurred me to learn HTML.

A few years later I was getting proficient with perl and realized I could use CGI to generate HTML! Neat! I wrote some code and adapted a chatter bot I found and soon had a webpage where I could chat with my page, and I didn't have to maintain a bunch of HTML files. The code quickly became a nest of 'if this param or session variable, do this' and I lost interest in the project because it was so difficult to maintain.

I used CGI (and later, CGI::Application) for various projects over the years but have not had to do any web coding for a number of years now. I hadn't bothered to really learn anything new either.

My most recent employment experience had me working on a project that started as a simple perl script and quickly spiraled into a full-fledged back-office web-app. CGI and its family didn't take enough of the complexity out of the code and it quickly became a nightmare to change anything.

I've been using Mojolicious this past year as my stepping stone into modern MVC design. Its quite a nice framework. Dancer and Catalyst seem to be quite popular  but I liked Mojo because all the tools I needed were integrated. I've had problems with some CPAN modules not playing nicely, and I was attracted to the idea that all the web tools I'd need (session/cookie management, config usage, helpers and plugins, DB accessors) were all 'baked in'.

I'm working on a large-ish project now and have been using Mojolicious for it.

One of the quotes on their website says this:

Duct tape for the HTML5 web - Web development for humans, making hard things possible and everything fun.

Fun is a matter of perspective, but its a pleasure to work with, and I quite enjoy it. If you're a perl coder and are looking at Rails with envy, take a look at Mojolicious. It has everything you'd need to quickly get a true MVC app up and running with a minimal amount of effort. The documentation is quite good, ok, its not perfect, but the author and maintainers are quite responsive on the mailing list and there have been no features I couldn't understand or get working without reading through the docs.

Take a look, take it for a spin, its easy to write a 'lite' application and turn it into a full-fledged app. It runs under its own threaded app server (hypnotoad), or can be run with fast_cgi, behind nginx/apache, and is quite flexible. If you end up using it, I hope you enjoy it as much as I have.

Friday, November 2, 2012

The Source of Contentment

I'm reading 'My Name is Red' by Orhan Pamuk. This is the English translation, my Türkçe is nowhere near good enough to read the original. He won the Nobel Prize in Literature in 2006 for this book, justifiably so, it's a beautifully written historical mystery book, its inspiring and haunting with thickly layered themes and perspectives, and takes place in Istanbul in the same neighborhoods where I've spent a few weeks and its answering a question for me - 'What was this place like in the days of the Sultanate?' I've been to many of the locations that this book takes place in, and this is making the book so real in my mind that I feel as if I can hear the sounds of the street vendors hawking their wares.

If you haven't read this book I highly recommend it. 'My Name is Red' is one of the few books I've read recently that absolutely envelopes you with prose and imagery and transports you into a poetic world of the authors creation.

There is a parable being related by a master illustrator as they examine books of illustrations in the treasury of the Sultan's Palace - it made me laugh and stop and think about it for a long while. Below is the story which I have shamelessly typed up from the book - the master is relating this story to two others who are looking at an illustration with him:

"This is the work of Lütfi of Bukhara whose ill-temper and belligerence caused him to leave each of his illustrations half-finished; he fought with every shah and khan claiming that they understood nothing of painting, and he never remained in one city for long. This great master went from one shah's palace to another, from city to city, quarreling all the way, never able to find a ruler whose book was deserving of his talents, until he ended up in the workshop of an inconsequential chieftain who ruled over nothing but bare mountaintops. Claiming that 'the khan's dominions might be small, but he knows painting!', he spent the remaining twenty-five years of his life there. Whether he ever knew that this inconsequential lord was blind remains, even today, a subject of conjecture and source of humor."