Recently we were looking for ways to do rapid building of prototype pages during our UI development. I still remember my first web project when I built an air ticket reservation system over a decade ago. Back then, we were concatenating HTML / Javascript inside servlet code to crank out the UI. The joy of building a cool new system was quickly offset by the frustration in dealing with escape / unescape single double quotes for multiple layers of Javascript inside Java code. Over these years, things evolved a lot in trying to address this separation of logic and presentation issue. We had JSP, Strut, Velocity, FreeMarker etc. They were running toward that goal with one getting closer than the other. But logic code still mingles with HTML/CSS . If not used cautiously, they can still yield spaghetti code faster than developers can chew.
Archive for JavaScript
Popcorn – Data Driven Testing with JSON
Are you looking for a quick, easy and flexible way to create JSON objects to test your JSON service? Or maybe a tool to mock server responses to test some JavaScript browser code? If so, you might be interested in Popcorn.
Popcorn is a JavaScript embedded DSL design to generate any kind of JSON object. It comes with a basic set of generators for most common JavaScript types, and combinators to build new generators for any kind of data. With Popcorn thousands of test cases can be expressed in just few lines of code, which makes it a great driver for data-driven test engines. Let’s go for a quick tour.
Fuzzing in JavaScript, an exercise in monadic computation
As I mentioned in a previous post, following is an introduction to monadic computation in JavaScript. The intent of this post is to demonstrate many advantages of monadic abstraction by implementing a concrete example from ground up. The theory behind monads I will leave to other online tutorials.
Full Post »
Monadic parser in JavaScript
After exploring Haskell for some time, I find myself often adopting functional concepts in my daily work. The exposure to functional programming has even affected the set of tools and frameworks I use. For example, having to parse a custom data format I first tend to search for a Parsec clone implemented in the currently used language. This time it was for JavaScript, but a quick Google search did not reveal any relevant projects. Therefore following is the initial attempt to a probably first general purpose parser library for JavaScript, ‘p4js’.
Full Post »
JSON, XML, performance
JSON is far better than XML! Less code to transfer – faster parsing – happy user. Right ? Hold that thought for a minute…
GeoIP tracking with Google APIs
If you want to track visitors to know where they are coming from, the normal un*x’ish way of doing this is to grab maxmind‘s geoiplookup (or apt-get/rpmfind) and then run it against the web server logs. That’s so not Web 2.0. *ugh*
JS3
You know about LAMP and I’m sure you know about RoR, not to mention countless other web application frameworks. I would like to introduce you to JS3 (since we are on an acronym roll here) which is turning out to be my favorite way to build applications. I’ve built apps for a long time now with MFC/ATL, Swing and WEBRick, mainly because I like to visualize things in order to understand. And when your prototypes start looking like the real meal deal and the lines start getting blurrier, you know you’ve hit home run.
http://www.pcapr.net
Wow, time sure flies when you are writing code.
Lots to blog about, but this one will be short. We just launched http://www.pcapr.net, a place to upload, view, edit, comment and yes, transform pcap’s. All you need is a browser. Registration is currently by invite only, but we hope to open that up soon.
