Archive for August, 2012

Working with ZingChart

Monday, August 27th, 2012

WebDevel.jpg

Today I've started working with a new javascript charting library called ZingChart. It looks pretty complete, and certainly has a lot of charting styles, plus it's touting it's speed with large data sets, so that's nice. But as with anything like this, the learning curve is steep because the graph has to be configured in javascript, and it's always a lot of work to know not only How to do something, but also What's possible to be done.

Compounding this is that the documentation and the examples have contradictory information - I mean not even close! I spent several hours on trying to just get a nice pie chart going. But in the end, all the knobs are there and we don't have to worry that there's something we simply cannot do.

As an interesting note, they include the complete jQuery library in their 'resources' directory. It's something I've read a lot about, and it was available when I was doing my last web development work a few lifetimes ago, but we didn't use it because the Google Visualization Toolkit was more than enough for what we needed, and the need just didn't arise.

But it's interesting that it's all there. Very nice looking graphs.

Odd that they don't have a table. Guess I'll have to fall back to Google Visualizations for that.

Updated Resume and Web Site

Monday, August 27th, 2012

cubeLifeView.gif

I've been at The Shop about six weeks, and I thought this morning it was about time I updated my resumes and my web site. It's something I like to keep up to date because going back and figuring out what you did when, and for whom, is one of those things that you have to do when you're looking for a new position, and that's typically a pretty stressful time. There's no need to add to the stress by figuring all this out when it's possible to do it a little at a time, when it's all fresh in your memory.

So I took the time to update my three resumes, and the four web pages as well as my WordPress 'About me' page. I had updated LinkedIn a few weeks ago as I was still getting a lot of interest on that front, and it was only fair to shut that down by posting the new position.

It's really quite nice using the tools I have for this: Pages and Coda, as I really only need to write the text once and then I can just move it from document to page to document and simply reformat it. Sweet tools. But hey… it's a Mac - it's gotta be sweet!

All done and it only took me a few minutes for everything. Love to stay up to date.

Really Hitting the Wall on this LKit Feature

Saturday, August 25th, 2012

LKit Language

I'm trying to implement user-defined functions in LKit. and I'm having a really hard time with it. I'm not at all sure how to handle things with this addition - especially since I want to have recursion and pass-by-value work as you'd expect in a lisp-based language. The parsing of the code isn't the problem - that I've got figured out. But when I compile the code into an evaluation-tree, it's going to point to variables - some of which are defined outside the user-defined function, and some of them are the arguments to the function.

If they are the arguments, then we can't really have a static evaluation-tree… I'd have to have some kind of dynamic evaluation of the arguments for each invocation. It's getting to be a lot harder than I'd expected.

Now it's true that this was something that I didn't even attempt in my previous version of the code, but I was really hoping for something more this time. I'd even thought that I could bang out this function definition code today. Not so fast, it seems.

I need to handle the question of a calling stack. Really. I need to be able to "dive into" the evaluation of a function and then return to where I was. This is really a different layer than what I'm doing now, and it's going to take some significant time to think about it.

Well… maybe my next vacation.

Updating my WordPress CodeHighlighterPlus to GeSHi 1.0.8.11

Saturday, August 25th, 2012

wordpress.gif

I was looking for something to do as a good excuse not to solve this problem in LKit today, so I dug into the latest news on GeSHi and the version I'm running on currently is 1.0.8.6, but 1.0.8.11 is out, and the language count is now above 200. Nice. Not that I usually write in more than 200 languages, but the odds that APEX code, for instance is supported goes up as the number increases.

Anyway, the first thing was to download the GeSHi package and place it into my repo for CodeHighlighterPlus. It's basically the root of the repo, but I hadn't realized that in the last time I updated GeSHi.

The only thing I needed to watch out for were those few edits that I made to geshi.php the last time, and those were pretty easily isolated. I'd repeat them here, but the fact is with the repo on GitHub, you can just go there and get everything you need. Simple.

The new language support is:

4cs            dot            lscript        pycon
6502acme       e              lsl2           pys60
6502kickass    ecmascript     lua            python
6502tasm       eiffel         m68k           q
68000devpac    email          magiksf        qbasic
abap           epc            make           rails
actionscript   erlang         mapbasic       rebol
actionscript3  euphoria       matlab         reg
ada            f1             mirc           rexx
algol68        falcon         mmix           robots
apache         fo             modula2        rpmspec
applescript    fortran        modula3        rsplus
apt_sources    freebasic      mpasm          ruby
arm            freeswitch     mxml           sas
asm            fsharp         mysql          scala
asp            gambas         nagios         scheme
asymptote      gdb            netrexx        scilab
autoconf       genero         newlisp        sdlbasic
autohotkey     genie          nsis           smalltalk
autoit         gettext        oberon2        smarty
avisynth       glsl           objc           spark
awk            gml            objeck         sparql
bascomavr      gnuplot        ocaml-brief    sql
bash           go             ocaml          stonescript
basic4gl       groovy         octave         systemverilog
bf             gwbasic        oobas          tcl
bibtex         haskell        oorexx         teraterm
blitzbasic     haxe           oracle11       text
bnf            hicest         oracle8        thinbasic
boo            hq9plus        oxygene        tsql
c              html4strict    oz             typoscript
c_loadrunner   html5          parasail       unicon
c_mac          icon           parigp         upc
caddcl         idl            pascal         urbi
cadlisp        ini            pcre           uscript
cfdg           inno           per            vala
cfm            intercal       perl           vb
chaiscript     io             perl6          vbnet
cil            j              pf             vedit
clojure        java           php-brief      verilog
cmake          java5          php            vhdl
cobol          javascript     pic16          vim
coffeescript   jquery         pike           visualfoxpro
cpp-qt         kixtart        pixelbender    visualprolog
cpp            klonec         pli            whitespace
csharp         klonecpp       plsql          whois
css            latex          postgresql     winbatch
cuesheet       lb             povray         xbasic
d              ldif           powerbuilder   xml
dcl            lisp           powershell     xorg_conf
dcpu16         llvm           proftpd        xpp
dcs            locobasic      progress       yaml
delphi         logtalk        prolog         z80
diff           lolcode        properties     zxbasic
div            lotusformulas  providex
dos            lotusscript    purebasic

Then it's time to check it all into GitHub and then pull it down on the servers and see how it goes.

After the pulls were done, all was well, and things are looking very nice. Success!

The Important Demo was a Success

Friday, August 24th, 2012

trophy.jpg

Well… we just got out of the important demo that was coming up and it was a wonderful success! Everything went off according to plan, all the data was there, and it was just bad enough to keep people on their toes in the audience. I mean with figures like a potential deal value of $3.2mil for a single merchant - well, it's clear that we need to work on limits as well.

Still, it all went well, and while we may not have had the very top brass in the room, the point was that it's all running in production, end-to-end on production data, and from this point on we'll just be able to tweak the process and verify that it's still running. Very nice.

Good way to end a week, that's for sure.

Good Intentions and Real Development

Friday, August 24th, 2012

cubeLifeView.gif

We're in the final hours for a big demo with the Top Brass, and I'm trying to get things done, but I go to check on a run being done on the UAT box, and I find out that someone has started another copy! Now I know he didn't mean to mess me over, but he did. And I know he didn't mean to trash 30 mins of my work, but he did.

It's all that:

The road to Hell is paved with good intentions - Proverb

I know what it's like to be doing the best you can. I really do. I remember being on a Class A softball team, and I was lucky to get hits and play catcher. I was clearly outclassed. But this is a job, not a recreation. This is where you're supposed to be good - not just want to be good.

When I asked him if he'd started running things, he was honest and upfront, but said "Doesn't it check against that?" Of course not! Why would it? Well… now I have the answer to that question - I needed to write it for guys like him.

There was another exchange I had with someone… I had someone show me the following javascript:

  function(doc) {
    var filter = function(doc) {
      return doc.meta.label == "QuantumLead.results" &&
             doc.otcs.length > 0 &&
             doc.merchant.category != null &&
             doc.merchant.sales_value > 0;
    };
 
    var key = function(doc) {
      return [
        doc.meta.execution_tag,
        doc.meta.division,
        doc.merchant.category,
        doc.merchant.sales_value
      ];
    };
 
    var value = function(doc) {
      return {
        name:        doc.merchant.name,
        sf_id:       doc.merchant.sf_id,
        sales_value: doc.merchant.sales_value
      };
    };
 
    if (filter(doc)) {
      emit(key(doc), value(doc));
    }
  }

I asked him why he chose to write it that way. Just what the motivation was for the specific structure. His response was that this was about clarity and maintenance. To me, it seems awfully complex for something that I'd have written as:

  function(doc) {
    if (doc.meta.label == "QuantumLead.results" &&
        doc.otcs.length > 0 &&
        doc.merchant.category != null &&
        doc.merchant.sales_value > 0) {
      var key = [ doc.meta.execution_tag,
                  doc.meta.division,
                  doc.merchant.category,
                  doc.merchant.sales_value ];
      var value = { name:        doc.merchant.name,
                    sf_id:       doc.merchant.sf_id,
                    sales_value: doc.merchant.sales_value };
      emit(key, value);
    };
  }

When I asked him if he really thought that his was clearer than mine, he said "Yup", and so I let it drop. After all, there's no reason to make a big deal over this. But again, this is not what I'd call a good format, but hey… I'm trying to be more flexible and I'm no code enforcer here.

I know they mean well… they really do. But it's stuff like this that is exactly why, in the past, I've stepped up and simply pushed folks like this aside.

I'm trying to be better.

Google Chrome dev 23.0.1243.2 is Out

Friday, August 24th, 2012

Google Chrome

This morning the Google Chrome Team upped the major version number to 23.0.1243.2 with a pretty decent set of release notes. The inclusion of the V8 3.13.1.0 javascript engine, and updating WebKit to 537.6 are both really nice.

I was wondering if the least-significant updates of late meant that we'd be seeing this, but I really thought they'd just hit a plateau. Guess not, and that's great.

I can say that the refresh of a page is amazing. Very nice, and this release just keeps moving the bar up. It's nice to see forward progress on Chrome.

Facebook Fixes iOS App

Thursday, August 23rd, 2012

Facebook

Today the big news from Facebook is their new iOS app, and it's speed. Well… given the speed of the old one, Safari would have been as fast, so I can't see how they could make it any slower. But, as much as I dislike Facebook, the guys that wrote this app knew what they were doing.

It's an amazing update. Really. The speed of updates and scrolling is what you'd expect from a nice iPhone app. It's smooth, easy, and doesn't have the horrible lags and fits and stalls that the previous version had.

I have to admit… it's a significant update. Hats off to those developers.

CouchRest Bug – Using a Proxy to Get to CouchDB

Thursday, August 23rd, 2012

CouchDB

Because we have several data centers - including boxes at EC2, the standard set-up at The Shop is to have several proxies - forwarding all traffic through a port to a datacenter. So all traffic to the eastern EC2 center leaves my laptop on port 1234 (for instance). This means that when I want to use the CouchRest ruby client for CouchDB, I need to do something like this:

  require 'couchrest'
 
  CouchRest.proxy('http://localhost:1234/') if use_proxy?
  @db = CouchRest.database('http://whackamole.east:5984/hammer')

to connect to the hammer database on the whackamole.east server in the east EC2 datacenter. Not hard, but there seems to be a catch in there somewhere.

For when I try this, I get about 2000 of 4000 documents saved and then I get this problem. A nasty stack trace that appears to be about some timeout, and then an attempted reconnection. What's very interesting is that it has to be in the proxy handling code of CouchRest.

Why?

Because when I do a simple port forwarding on my box to the database server on the other box, and use that port - thus bypassing the need for the proxy setting, everything works. Also, if I run it on a box in the east EC2 datacenter so that I don't need a proxy, then everything works.

I need to dig into the proxy code. I'm not exactly sure what I'll find, but it's gotta be there.

CouchDB is Really Quite Amazing

Thursday, August 23rd, 2012

CouchDB

I've used mongoDB for a while, and it's a decent document database, but I've now been using CouchDB for a day or so, and I have to say that CouchDB beats mongoDB hands down! There just isn't any comparison - even though there may be slightly different targets, I'm not convinced that you can't do everything in CouchDB that is a "strength" of mongoDB.

The one thing that mongoDB has, that I wish CouchDB had was a nice CLI. It would be really nice to be able to do ad-hoc queries against CouchDB on the command line, but as a point of fact, you can do all that with a Temporary View… and get what you need. It's a close point, and certainly a mater of taste.

But for everything else, CouchDB is a far better implementation of a document database. The views are a fantastic feature. Their speed and power is really very impressive. I can't imagine that this is all running on my laptop. It's really pretty neat.

I think I've found my new document database - CouchDB. Fantastic!