Posts

Showing posts from July, 2013

dblite: sqlite3 for nodejs made easy

OK, I know, the well known sqlite3 module is cool and all the glory to it ... well, it didn't work in my case :( The Why node-gyp is great but it's not as portable and does not scale as I'd like to. If you try to use sqlite3 via npm in Arch Linux ARM , as example, even if the native sqlite library is there and usable that won't work ... moreover ... What really bothers me is that node-gyp does not update within the system as any other system package would do. You need to rebuild, recompile, re-do everything, even if you distributed a specific linux version that trust the package manager for updates and does not want to bother users with build tasks. This is quite common in embedded hardware and related Linux distro so I've asked myself: why on earth I cannot simply pacman -Syu once in a while and just have automagically built for me the latest version of sqlite3 , the one the whole system is using and trusting anyhow, together with any other update including

Why REST is so important

Image
This post is dedicated to REST, an architectural style of shaping webservices and the most misunderstood concept in the history of IT. This post is addressed to you who is designing webservice apis not being fully aware what REST actually means. I'm trying to give you the idea. This post is also addressed to you who think to know what REST means, when in reality you have no clue, just yet. Yes i have met such people in the past - plenty of them. It's not going into the details of the Richardson Maturity Model , and it's not gonna make you a REST expert. There are plenty of guides on the web for that: slides, youtube videos, blogposts, books and more. Rather than going into the details, i'm going to link some good resources at the end of this post. So lets start with The meaning of REST Representational State Transfer. This sentence is not only what REST stands for, it is also the tiniest possible description of what REST actually means. Didn't get it? Read it aga

T-SHIRTS IN THE STORE

Image
hey some left-over tour t-shirts are now in the web-store. Limited sizes and designs, so get em while you can! FOR INTERNATIONAL ORDERS, PLEASE BE IN TOUCH PRIOR TO ORDERING AS ADDITIONAL SHIPPING COSTS WILL APPLY

IE8 Is More W3C Standard

I know I am probably late for this party but I am re-exploring here and there Desktop web development and developers approach to common Desktop problems. Pointless to mention that IE8 is probably the biggest one so here I am with some good news! W3C DOM Level 2 Implemented In IE8 You read that properly, including custom bubbling events ! This is how much this ambitious but overall slim project is about, trying to harmonize IE8 and IE8 only so that we can focus more on standard W3C DOM API without requiring any external library at all unless necessary. Tests To The Rescue If you don't believe it or you would like to try it in a real IE8 (no simulated) browser, here the interactive link that will work with all modern Desktop and Mobile browsers plus IE8 thanks to the mentioned library. The test is interactive in the meaning that at some point an action, a real one from the user, is expected such a click , an input focus or an input blur so that all tests, synthetics and not, a

OH YAH.... B

Image
hey hey we're playing a last minute show with our friends METZ in Boston Thursday at the Sinclair. It's free. Also, for those of you in New York City --- there's a great show going down Saturday night with some friends from out of town and some friends from in town. I'll be there, and so should you. fb invite:   https://www.facebook.com/ events/636598266352525/?notif_ t=plan_user_joined

Spring MVC - @RequestBody and @ResponseBody demystified

In this post i want to dig into spring mvc a little, revealing what happens behind the scenes when a request is converted to your parameter object and vice versa. Before we start, i want to explain the purpose of these annotations. What are @RequestBody and @ResponseBody for? They are annotations of the spring mvc framework and can be used in a controller to implement smart object serialization and deserialization. They help you avoid boilerplate code by extracting the logic of messageconversion and making it an aspect. Other than that they help you support multiple formats for a single REST resource without duplication of code. If you annotate a method with @ResponseBody, spring will try to convert its return value and write it to the http response automatically. If you annotate a methods parameter with @RequestBody, spring will try to convert the content of the incoming request body to your parameter object on the fly. Here is an example @Controller @RequestMapping ( value = "/

eddy.js - A Bold Approach

Not the first time some project of mine ends up in JavaScript Weekly , however this time something different happened since eddy.js reached my top 5 projects list in my personal Github repo in about a week since my first tweet and I've never even blogged about that and: This. Is. Awesome! eddy.js In A Nutshell JavaScript is the easiest event driven programming language I know and every library out there knows this too! jQuery , node.js , these are just the most successful JavaScript API out there and mostly based on event driven development , either with asynchronous API and libraries behind or based on DOM behavior as jQuery is for sure. eddy.js aim is to bring the ease of an event driven application everywhere , hopefully matching everybody taste in both DOM and server side world too! Fairy Tales ... Less! Let's face reality: except for switching the light on or off where .switch() is most likely the most semantic and probably a better method name you could think a

HEAVY HEADS

Image
new tour dates on the right with friends Purling Hiss, Pampers, Fuzz, CCR Headcleaner, and more... let's check it out.

Some JS Descriptor Trick

I am back home for 20 minutes after 10 days of vacation in Italy and already bored so which better way than talk about some wizardish trick about JS descriptors? (yes, they were showing again the great wizard of OZ in the United Airline flight from Frankfurt ... thanks for wondering...) The Recycling Trap Descriptors can be recycled without problems and reused to define same things here and there. However, there is an undesired side effect about recycled descriptors: these works with constant/static values, getters, or setters, but are unable to change behavior in their lifetime. var propertiesDescriptor = { shared: { value: Math.random() } }; Above descriptor is just a basic example where Object.defineProperties({}, propertiesDescriptor) will pollute the empty object with always the same random value. var a = Object.defineProperties({}, propertiesDescriptor), b = Object.defineProperties({}, propertiesDescriptor); a.shared === b.shared; // true ! Describe A Descriptor W

Modern Web Development

In the last few years web technology has lived through rapid growth and heavy change. We went from frames to table layouts, to column layouts, to responsive layouts. From html4 to xhtml & flash to html5. From heavy server to rich client. From rpc to soap to rest. From sql to nosql and big data. From MVC to MVP and so on. In the following post i want to describe what has become state-of-the-art from my perspective. A Backend is a REST api  Every backend should be seen as a REST api and every controller as another resource. You want to analyze your problem domain, find your resources and design proper paths for them. They become the M in your MVC Architecture. Developing a webapplication first, and adding an extra REST api later on has to be considered an antipattern. If you do make a REST api, you want to consequently use it yourself, making your frontend its first consumer. This procedure allows you to smoothly add different kinds of clients later on, such as a mobile app or even