Entries Categorized as 'Web work' (RSS feed)
Google has recently added a super mega cool feature to Gmail - multiple inboxes. For me, it was an instant boost in productivity and huge improvement in the way I handle email. However, while I was sharing my excitement with friends and co-workers, I’ve received quite a few cold looks and “so what?”s.

So, what’s so cool about multiple inboxes? Here is how I enjoy them so far.
I’ve setup forwarding on all my email accounts so that all messages end up in the single Gmail account of mine. This means that I have the same mailbox for personal emails, work emails, blog related emails, spam, and so on and so forth. All that email is handled with a multitude of labels and filters. And overall it works pretty well.
However, there was a little annoyance in my daily routine. As part of my job I have to review and monitor Subversion commits from several programmers that work in our office. Commit notifications come to me in the form of emails, and since they are rather high priority, they are labeled automatically, but not archived. They stay in the main inbox until I read and archive them manually. Also, as part of my consulting work for another company, I have to go through their commits as well. These too are labeled separately, but end up in the main inbox. And, additionally, I am using Gmail as a task manager for things that should be done eventually. For that I have emails with tasks, labeled separately, and starred. Not a huge mess, but not the ideal solution, especially when it mixes up with direct messages from work and friends.
Once Gmail got the multiple inboxes feature, I modified my filters to archive commit messages from both companies automatically (but not mark them as read). Then I created three additional inboxes - one for tasks, and two for commit messages. The tasks inbox lists all starred messages with a certain label. Commit inboxes list messages with labels for each company. Now I have my main inbox for direct messages from friends and work, and the rest of the things that I need to keep an eye on are right there, in front of me, but re-organized a bit to give me some breathing room.
With this new feature I can keep my main inbox message count much closer to zero, while still have some lose ends in case I need to argue over a commit or keep a few more things on the task list. Excellento!
Big thanks to Gmail team - well done.
Tags: email, gmail, productivity
During the last few month I’ve been explaining software engineering to management types quite a bit. Most of the “bosses” that I talked to weren’t technical at all, so I was trying to stay away from famous concepts, examples, and terminology as much as I could. Of course, that required some sort of substitute for concepts, examples, and terminology. I’ve tried analogies from different unrelated areas, and was surprised as how good cooking was fitting the purpose.
Before I go any further, I have to say that I am not a cook and that I don’t know much about cooking. But. I know just about the same as any other average human being. Which, sort of, moves me into the same category with my targets, or “bosses”, as I called them before.
Here are a few examples that worked well.
[Read more →]
Tags: analogies, Business, communications, cooking, food, Programming, software engineering
Posted in All, Technology, Web work on
December 9th, 2008
·
Comments Off
Many of us, Gmail users, have been waiting a really long time for this, but now the wait is over. Gmail blog announced task manager / todo list in Gmail via Labs extension.
We put your tasks in the same kind of window as chats, so they’re visible while you’re scanning your inbox, reading mail, or searching (and in Settings, too!). Just pop your list out into a new window to use Tasks outside of Gmail.
To enable Tasks, go to Settings, click the Labs tab (or just click here if you’re signed in). Select “Enable” next to “Tasks” and then click “Save Changes” at the bottom. Then, after Gmail refreshes, on the left under the “Contacts” link, you’ll see a “Tasks” link. Just click it to get started.
Excellent news for this morning.
Tags: gmail, productivity, tasks, TODO, tools, webservices
Google updated the design and interface of the RSS feed aggregator - Google Reader. Here is a really small screenshot of how it used to look (stolen shamelessly from Google Reader front page - it seems like they forgot to update it):

And here is a really small screenshot of how it looks now (I made this one, you can make your own):

In my opinion, the old interface was much better. Colors and borders helped to visually separate the sidebar from the main content area, as well as news items from each other. The new design is much “separated”. Also, there are a few minor quirks and bugs here and there, which will hopefully get fixed in the next few days. However, one thing is great about this new release - speed. The new Google Reader is much faster than the old one. Extra responsiveness can’t hurt, especialy thos of us who go through hundreds and thousands of posts in a fast paced manner.
Tags: atom, feeds, google reader, rss, tools, webservices
WI’ve spent most of the last week getting into, around, and out of the issues related to interoperability of Oracle and PHP. Before you start laughing, cursing, and blaming, Oracle wasn’t my choice of the database for this specific project. It’s just the company already had it installed and working for the background, and there needed to be some integration with the front, which is of course MySQL and PHP based.
First thing I do, obviously, is visit PHP.net to check for the prefix of the functions that I need for Oracle. Through out my experience with PHP, that’s about the only thing I need to know to start working with the new database. Oh, and the PHP module installed to provide those functions. Oracle interface for PHP is called is called OCI8. All you need to do now is install the oci8 module.
Here comes the first trouble. oci8 is not provided as a pre-compiled package for Fedora Linux. There is an alternative yum repository - Remi, which has oci8 RPMs, but first of all, the oci8 module is compiled against somewhat outdated Oracle headers (version 10.2.0.4 instead of the latest 11.1.0.1), and it also needs to replace your native PHP and MySQL packages. I tried that, and it sort of worked, but I wasn’t happy. So I got my Fedora packages back and decided that I need to compile oci8 myself.
In order to compile oci8, one needs to download Oracle InstantClient (basic package) and some header files (devel package). These can be downloaded from the Oracle web site, for free, minus the time for the registration. The little trick here is that during oci8 compilation process, the includes are searched from locations which do not include the one from Oracle RPM. I did a simple symlink of the includes folder to where Oracle headers were, and compilation went on just fine. (Hint: otherwise you’ll get a whole lot of Zend related messages and a fatal error). Gladly, I only had to do this path correction on the Fedora 9 machine. My production server with Red Hat Enterprise Linux 5 compiled oci8 without any problems all by itself.
Update: more detailed instructions on the actual installation can be found here and here.
Now that oci8 installed and configured, I spent some time figuring the correct way to specify the DSN. Oracle uses some weirdly name file (tnsnames.ora) in some weird location, but luckily there is a way to go around it. More so, I recommend that you remove tnsnames.ora file altogether, since it can add to your troubles. For example, if you mix spaces and tabs as whitespaces in that file, you are screwed. So, just get rid of it. The way you specify DSN is directly in the PHP script, and you use the syntax like so: “//hostname.or.ip:port/dbname“. Intuitive, I know.
Once you’ll get connected to the server, you have a whole bag of surprises waiting for you. That is if you are too used to working with MySQL. First is the syntax. Oracle is using PL/SQL, so you wipe the dust of from that really old Pascal textbook that you have somewhere. “begin :result := some.procedure.call(:param1, :param2); end;” - that sort of thing. Secondly, you’ll be happy to know that prepared queries are supported. So your workflow will slightly change. Perl programmers will feel more at home here. oci_bind_by_name() and oci_execute() are your friends here. Oh, and while you are at, get familiar with the types of the parameters, because they are important. And don’t forget that you’ll have to bind each and every variable in the query, or get a fatal error. And since you are learning something here, get ready for the oracle errors. The most frequent one you’ll get would be something like “Failed to retreive the error message for ORA-12345″, where 12345 would be a number of the error. So you’ll google for ORA-12345 and ORA-54321 and ORA-XYZZZ a lot. But than you’ll have a wrapper library and you’ll be OK.
Update: as was noted in the comments, PL/SQL is just an option, not a requirement. Also, most of the headaches of the above paragraph could be avoided by using one of the PHP frameworks. I personally haven’t yet tried the framework yet, since I’d like to see things working directly first. Especially since we are not in the test mode only.
The bigger surprise is still waiting for you though. You are very likely to discover that OCI8 implementation for PHP is very slow. And I do mean extremely very slow. I couldn’t believe that it could be slow, so I went into the source code and OMG! It is really slow. The slow part is around fetch_all() against fetch_row(). Basically, it’s always row by row and never all, even if you tell it how many rows you need fetched.
In my case, I have the server a bit far away, and there is a possibility to get many rows back. So even for a simple query with 140 rows in results I was getting 20 seconds execution time. Oracle was serving results fast, the network was OK, machines on both sides were powerful and all, but it was still taking 20 seconds or more.
I am still trying to find the solution to this issue, but so far it seems that the current way I do it will be the way to do it. And the way I do it now is the following. Never ever run direct SQL queries. Everything goes through a stored procedure. The results are returned all in a single row. And that single row has the BLOB (CLOB actually) with all results in one single XML. Fetching works good enough to get it, and then parsing is done with one of the billion XML parsers for PHP.
In my case MiniXML worked pretty good until bigger results started coming in. That’s when I learned an important lesson. MiniXML parses XML with a regular expression. PHP has a couple of settings in the configuration file that limits the size of the memory and recursion during regex parsing - pcre.backtrack_limit and pcre.recursion_limit. If you really want to kill your server, set these to -1 (instead of default 100000) and try a regex against a 1 MB XML file. Enjoy, cause it won’t be long before everything goes down. I didn’t feel like changing from MiniXML so we just implemented some limits in the queries and stored procedures on the Oracle side, and add a few checks in PHP fail rather than crash the system.
So, to some it up, here is my experience with Oracle and PHP from the last week:
- I had to register on Oracle web site to download packages
- I had to re-learn my long forgotten compilation skills
- I had to go read some C
- I had to step on the “re-inventing the wheel” path more than once
- I am parsing XML when working with the database
- I had a head ache more than twice
- I didn’t have much fun
- After all, it works. Sort of.
One last point in this saga is about Googling. Ask me any question, and I do mean any question, about MySQL. Heck, even PostgreSQL. And the answer is just there, on the first page of Google results. In any human or programming language. For any operating system. You’ll be sorted out and working in less then a minute. Then, try asking even the simplest of the simplest questions about Oracle and PHP. Sometimes you’ll find something. Some other times, you won’t. The overall feeling I have is that not a lot of people are using Oracle with PHP, and those of them who do are in their majority not very happy.
Now I’ve joined the army.
Tags: databases, oracle, PHP, Programming, Sysadmin, web