The dynamic programmer
Programming
We will mock our Firebase database to test our storage service.
Replacing local storage with Firebase was very easy due to our architecture and the ease of use of Firebase.
Upgrading our tv series application to version 5
We will be adding validation to our form and displaying errors to the user.
We are able to add and list records, not we need to be able to edit and delete those records.
We will use localStorage to store and load our data so it persist between sessions.
We will improve on the previous refactoring where we removed dependencies on the framework.
The default application template comes with standard for linting, but I have been using eslint latelly and really like it.
In this post we will refactor the elements to reduce their dependency on the library.
In this post we will build a simple application with choo that list a series of tv shows, we will look at how to use the choo-cli and how to do some testing.
A personal interpretation of our need for UI components in web development and the story so far.
HyperTerm, the hackable terminal, another tool running on top of electron.
A quick note about the differences after hearing this terms confused multiple times in the same week.
The mix task test.watch doesn't run the migration as mix test does.
Ecto (or Phoenix) automatically add created and update field to your models.
A series of notes while I play (once again) with Elixir.
Use the brand attribute.
Hope this may save some time to somebody out there.
Yesterday Scott Gu post again about the MVC framework. Don't miss his post about Passing View data from controllers to view.
I am an enthusiast of Test Driven Development but sometimes I have the problem that is difficult to know how to start testing. The problem usually is, very ambiguous requirements provided by the client.
In this second part we look at the factory methods to handle the different request and the formatters classes.
If you haven't look at it, take a look at the Subsonic project, is really cool and can generate a ORM infrastructure faster than any other framework I tried out there. It also provides a cool HTTPHandler to expose those objects.
I'm working in an application originally programmed in 200 by only one developer. I really clever guy that put in place quiet a bit of base code. The original design of the application is not all that bad, but several waves of developers have done maintenance on it.
WM 11 and Firefox don't like each other very much. The infamous squishy bug is plaguing the web. It's almost impossible to find a custom player around the work as it's suppose to with WM embedded in Firefox.
I have been playing with the new version of Flex and I'm very impressed with it's possibilities. I did try Flex when it was first released and even when I like it, the price tag and the needs to install an specific server to use it discourage me.
I really like the Hacks series form O'Reilly, these are very simple references books. They present a problem and a solution in the form of quick articles and they are usually based on common issues for that technology.
The art of reducing strokes, combining commands and improving your life as a developer.
Microinteractions are all those little things we deal with in a daily basic. Every piece of software and hardware have a good number of them. You should read the book if you want to understand how to make your users life significantly better.
I often get asked how to model HTTP APIs to change status on objects when we try to manage all our permissions based on the end points and HTTP verbs available.
A new single use module to consume oEmbed providers.
Notes from another great Codemash.
PhoneGap in the morning, build you own application in the evening.
Don't you love OSS? I got the first pull request for curling that increase the buffer size for curl.
A simple module that implements authentication using a private/public key scheme.
A very simple wrapper to run curl in a child process.
When working on Restify or ExpressJS applications you usually see a file structure based on routes, models and views. I prefer a more modular approach.
My own validation library for .Net that introduce a simple DSL to make validation of arguments and method calls easier and less annoying.
When building widgets that be embedded on third party pages, JavaScript is not the only consideration or even the most important. CSS clashes are as important.
This script has a nice feature that make it very easy to keep the global namespace clean.
More refactorings and initial support for the users endpoint in version 0.0.6.
The array module is part of the Erlang STLIB. They work a bit differently that you would expect.
We already saw Tuples and lists in Erlang, time to check on records and how we can use them to structure the data in our programs.
Strings in Erlang are represented as a list of characters, but don't despair the String module is here to help you with all your string manipulation needs.
In version 0.0.5 I added support for changesets and followers.
I added last night access to the src endpoints of the API that allows you to get the content of files and folders.
The last time we explored the functions of this modules that can be used to dynamically executed Erlang code. This time we will look at more common file operations like opening, reading or writing.
Listening to .Net Rocks earlier today Carl Franklin joked about exposing a calculator as a REST web service. It's so silly that I had to try.
After some time playing with Dart is time to come back to Erlang. This time I will explore the functions in the file module that allow to dynamically execute code from files.
Take advantage of expression evaluations to dynamically change the includes in your views.
On why libraries are here to stay and, at the same time, is good to remember the power of pure JS.
Complex web applications will rarely need only one view per screen. Using includes help to separate concerns in your Angular.js apps.
Sometimes we really need to check for a given version of IE, this snipped will work to detect anything less than IE8.
Just released a very simple node.js module to access the BitBucket API. Early version allows to list repositories or get a single repository and work with Issues.
A little language with lots of appeal that should not be relegate to the browser but enjoy in the back end as well.
Thinking out loud on these two different ways to approach the problem of building software.
A not very articulate collection of thoughts on shipping, architecture and development practices.
What it took me (a programmer), to redesign the site and incorporate some responsive elements.
A good book to get you up and running with Phone Gap and JQuery mobile.
Light Table is at the moment a concept for a different way to work with code.
Published by O'Reilly this very short book attempt to explain what is Dart and why you may want to use it.
Tail and body recursive functions are at the heart of every Erlang program.
UI patterns for iOs, Android and other mobile devices by Theresa Neil.
There are a myriad of directives you can use in your Erlang modules, even define your owns.
Responsive Web Design is more than a buzzword, is almost a necessity for any site that wants to reach the mobile and tablet market.
Erlang code is divided in modules. Each module contains attributes and functions. Modules (and functions) are the building blocks of any program in Erlang.
If you do anything with MongoDb this two books are a must have in your library.
Variables are immutables. Comparison can be performed between any type. Typing is dynamic and some data conversion is performed.
In almost any language working with lists or data is a fundamental part of programming. Let's see how lists work in Erlang and some of the tools we have to work with them.
5 or 6 years ago I started to learn Erlang for the first time. I read a book, follow an online tutorial and them I move on with other projects. It's fair to say that I didn't learn much at all.
During the weekend I decided to go ahead and get the Windows 8 consumers preview release installed on my side laptop. It has been a nice experience so far.
Introducing HTML 5 by Bruce Lawson and Remy Sharp is one of those books that I would recommend to any web developer out there.
Dates are a pain. So I started to put together time traveller to try to alleviate that paint while working on node.js.
JavaScript has the usual try catch construct. In node, that's not always enought.
I have been playing with node.js for the last year and half, maybe more, but for the last three weeks I have been doing real work with it. We are developing a new product and we decided to give node a try. These are my findings and my experience so far.
On how using MVC 3, NuGet, MvcScaffold, EF code first, Git and AppHarbor make me have fun again using the Microsoft stack.
We put Cucumber in our test, use a capybara to automate the browser and we pickler our stories.
I'm afraid my notes don't make justice to the presentation.
A high level introduction to Ruby (IronRuby) and how to use it to enhance your projects in .net.
Adam Goucher gave a good presentation on the use of Selenium for web automation. These are my notes taken during the session.
I decided to completely isolate Luca from the HttpRequest object and define my own. The main advantage of this approach is that having a pure javascript object, mocking and stubbing is extremely easy, making testing a breeze.
As a first simple example of using Luca I wanted to write a simple web service that returns json or plain text.
I decided that my first Windows Phone 7 application should be a Pomodoro timer. It's a fairly simple thing to do and useful at the same time.
The JavaScript engine allows for the use of .Net objects inside JavaScript, but I wanted to completelly abstract Luca from anything related to the HttpContext.
I wanted a very simple framework more like Sinatra than Rails. Something that make very easy to put together some simple Restful websites. And I wanted to use JavaScript to write my code and be able to run it inside .Net and IIS. But first I needed to find my JavaScript engine.
Today I started to put together a list of books that I will like my team to read. The list started to grow so I have to do some triage. Here is the result.
HTML 5 is way more than the highly tooted video tag or the use of canvas, it provides new tags for a more semantic representation of documents.
This is a very quick post where I highlight my findings on why the new lambda syntax has been introduced on Ruby 1.9 and what are the use cases for it.
I heard about NSubstitute on episode 26 of Talking Shop down under. It sounded like an interesting framework with some interesting ideas, so I took it for a spin.
I remember the time when WebMatrix was this tiny little web editor done in .net that the crazy guys like me used to edit their first asp.net pages (without code behind and moving away from classic asp).
Last Saturday I had the opportunity to assist the first WindyCityDb. A one day, single track conference on databases technologies that are usually grouped under the NoSql umbrella. In general the conference was very good.
The title kind of tell it all. I started to use pickle now for filling up and managing my test with cucumber. Fill up data, etc. Pickle creates some step definitions for you to make things easy, what it's much appreciated.
I have been researching node.js and the ecosystem around it. Yes, node has an ecosystem, a very vibrant one if I may say. Today I tried a simple web framework that resembles Ruby's Sinatra by the name of Express.
Installing node.js First, you need a supported OS, like Linux, Mac or Solaris. I will be doing the install on Ubuntu.Go to the node.js download page download the Gzipped file and extract in a folder of your choice in your disk.
Some background information. I'm not a complete newbie to Linux. 12 years ago or so, while still doing lots of IT work I used to admin two Red Hat servers. FTP, file sharing, email, proxy and web servers.
In the previous post on this series we manage to get our Insert and a basic Select methods working. Today we need to implement the mapper class for Post.
Last Friday I was showing some of the guys at the office how to write user stories with the Gherkin language to been able to use them in either Cucumber or Specflow as executable specifications.
Yesterday we created our first method in the MongoDbProvider, our implementation of BlogProvider. We created a few supporting classes, but we don't have test for those classes.
The code in this post is of demo quality and should not be taken as production ready code. It's a first take on the project and will evolve during a series of posts. Blogengine.net is an open source blogging platform written in asp.net.
If you use Github (Git) or Bitbucket (Mercurial) you are familiar with the ability to fork a project into your own repository in those sites.
If you, like me, haven't been able to go to PyCon don't despair. The videos of the sessions are available at blip.tv.
I recently posted about how to integrate Git with Visual Studio. Of course Git is not the only DVCS out there. Mercurial is another source control system similar to Git that is having more and more relevance.
I started to use Git seriously 5 months ago when I sign up for my Github account on September 1st 2009. Before that I was a very happy subversion user. One of the things that I really like about Git is the speed.
Last week I wrote about using cucumber to test your web applications outside in. In the post I showed a simple example (actually comes with cucumber) to open a browser, go to a site and perform some actions.
On my new project I want to start using end to end testing. The idea is to write an specification run it against an outer interface. Gui, Web service, etc. It fails. So you start implementing the feature using TDD until the Spec pass.
Probably you are aware of Edgecase Ruby Koans. In case you aren't, let me introduce you to them.
Since I started using Git a few months ago, and particularly GitHub since last September, my life have been good in DVCS land.I used to be a Subversion user and I was happy*, maybe because I didn't know anything better.
Kazi Manzur Rashid has a post about registering Areas dynamically after the registration of other routes and the problems this has since the order the routes are registered is very important.
I try to be pragmatic in my approach to development and one of the things that change the most are the tools I use to deliver software. There are several reasons why I change tools so often.
The NoSql movement is gaining more and more momentum. A year or two ago I took a look at CouchDb but this time I wanted to try MongoDB.
Post from the business insider on a real world use of MongoDB.
Some time ago I heard about the intent of putting together a package manager for .net ala gems or pear. I wasn't aware that this project was actually under way. The name of the project, Horn.
The other day at the office my boss took a look at our configuration files and he expressed his concern about breaking DRY with all the ConnectionStrings. One for Ado.Net, one for NHibernate, one for our caching db and another for Log4Net.
Hopefully gone are the days were you considered ok the use of single letter names for your variables or your arguments and you are giving informative names to all the artifacts in your code.
Gestalt, the new js library release by the MIX Online labs, takes a dependency on jQuery. They use it to do some Dom manipulation (locate tags, modify the Dom). But what happens if you already use prototype.js in your application?
One new feature in the code editor is the ability to put sticky notes in the code while debugging. This sticky notes are actually attached to a given variable and you can see the actual value of it in the note (similar to using the watch window).
A few hours ago I saw a Tweet by @shanselman about having Ruby and Python scripts tags in your html pages.
I have been playing at home for the last few days with different migrations strategies for db development. The one that I like the most so far is Migrator.Net. Here are the things I really like.
Pronghorn is still a work in progress and the architecture+design is changing very fast. At this moment the main focus is on the ViewEngine because...
This post have been inspired by the talks about controllerless actions. This is NOT an alternative to that. Controllerless actions is an interesting concept that should be study. Actually Jeffrey Palermo has a concept implementation.
When creating a Silverlight application that will be used as a widget, you need to make sure that it will work in a cross domain scenario.
One of the main reasons I got ReSharper originally was for it's ability to do micro code generation. This is a functionality that I found very useful when doing test first development.
In the context of this article every time I mention Linq I'm actually talking about Linq To Objects. Although Linq has a very handy method on FirstOrDefault<T>.
If you ever played with some language that have the Tuple type I bet you miss it in .Net. Well 4.0 adds it. Let's see what the ubiquitous Wikipedia have to say about it.
A very good presentation with lots of code to learn and appreciate some of the niceties of ActiveRecord.
You can get all the videos (110)
Common List E-book (free online) Apparently you can also download it from the Apress website's book page but the link was down for maintenance when I tried.
I want to be positive in this post. So I will just mention this once. The framework is very extensible but It's more difficult that It should. I guess that the problem is not really with the framework, but me trying to make it do something that is not in the spirit of it.
I have been silent lately because I have been working on a project based on ASP.NET MVC. The idea is to have the bare minimum to create highly configurable sites.
Exploring why the detractors of TDD that seen it as a waste of time are just plain wrong.
In a previous post I mention about a fix to been able to open a new window both in IE and Firefox using the Lightweight Test Framework.
This is a quick post. In the samples for the framework the test are written in the same system to test.
As I mentioned in a previous post I have been playing with the Microsoft Lightweight Test Automation Framework. The Lightweight framework handle alert and confirms without any problem, both in IE and Firefox out of the box.
I have been playing with the Microsoft Lightweight Test Automation Framework, that's a mouthful for the Microsoft's Web testing framework.
If you have been following this blog, you probably saw a few posts about what's going on behind closed doors once you submit your code to the mercy of the compiler.
As you know some types are not nullable like int, decimal, double or DateTime. So if for some reason we need a null int we need to use the nullable types. To define a nullable type we use the question mark notation like this int?, decimal?...
Today I move the code of LaTrompa.Validation into it's own package, with no external dependencies (besides the framework of course). I added a class to validate XmlNodes.
An exercise on improving code we found in a project that we want to use.
If your team is comprised by more than one developer you should have some coding guidelines and standards in place. (I can make the case to have this guidelines even if you code along but that can be another post).
I enjoyed this chapters as well, specially chapter 6 and 7 about extending the framework and preparing your site so it scale. Some of the code examples are using a previous (old) version of the framework. I hope they will be updated for the print version.
I don't remember if I read this on Clean Code or Refactoring or maybe I just hear it somewhere, but It's so true. It's not that you can't change the code and that you can't apply refactoring techniques.
If you ever wonder what the compiler does to make the auto properties work let's take a look at the code the way Reflector sees it.
Stefan Tilkov is one of the guys behind the fabulous info.com and is a big REST proponent. The talk is titled REST, an alternative to Web Services.
In part 1 I talked about using the facade pattern or a wrapper to avoid dependencies to third party libraries. In the second part I talked about taking care of custom exceptions defined in those libraries and how to shield you client code from...
I try to practice TDD most of the time these days. I don't write new code without a test first. A few years ago write the test first was something that I understood from an intellectual point of view but it sounded impractical.
In this post I wrote about wrapping log4net (as an example) in your own logging class and define an interface for the log object that better reflects your domain.
On episode 20 of the Elegant Code Cast Matt Heusser talks about testing in general and the role of QA in an agile team.
I have been playing with both Ruby and Rails for maybe two years. Never doing anything really serious, like an external project for a client. I kind of know my way around it when I need it, but I still consider myself a Beginner.
I just finished a complete re write of my validation framework. This re write was due to feedback received from some of my co workers so I owe to them my thanks.
You can find this new ORM framework at http-//code.msdn.microsoft.com/XGENOORM. Starting with it is fairly easy. Just add a reference on your project to the very small (32K) dll (only one!) and you can start playing with it.
The people from Infusion came last Tuesday Jan 13th to present Surface and Surface development. They bring a Surface (device?, table?) and they walk us through some of the things you can do and what you need to develop for the Surface.
Methods and Tools its a free online magazine
Herding code interview with Chad Myers and Jeremy Miller on FubuMVC
If you use Cruise Control.Net you may want to take a look at this project. CC.Net Community PlugIns
Besides programming against Interfaces and using Dependency Injection to reduce coupling, there is another practice that can/should be used when you consume an external library.
If you into DSL's (Domain Specific Languages) or are interested on them, take a look at this DSL book, work in progress by Martin Fowler.
I found this project on CodePlex called xVal. It's Steve Sanderson's take on validation for the ASP.NET MVC framework, more to the point on how to use validation across tiers (validate on the server side, present errors to the client, etc....
Chad Myers goes on in this rant on professionalism.
Once in a while I like to browse around Codeplex to see what's new and if I found anything interesting. Today I found this Gem of a project called Catharsis. To be able to use it you will need VS 2008 with SP1.
I was going to write a post about this but my thoughts are exactly the same as Fredrik Normen's. For example, one thing that creeps me out is seen think like this in the Controller.
Every time I wrote validation this code I think, I should write a library to do this for me. So I went ahead and wrote this simple class. The idea is to use the Introduce Assertion Refactoring in this cases and write this code in this way. ...
My previous post got me thinking, what are the things I will considered as minimum requirements for me to work in a project even when I have serious constrains on time?
In my machine at work I can't install ASP.NET MVC (it installs but fails to install the project templates, I don't know why and I haven't had time to look into it).
Pronounced Sharp Architecture, this is a solid architectural foundation for rapidly building maintainable web applications leveraging the ASP.NET MVC framework with NHibernate.
We have been looking forward to implement Kanban for a while and after a few delays we put the board up today. We decided to define our pipeline using five columns.
On Dec 10 the IronPython team made available the version 2.0 on Codeplex. Go download it now and start playing! ...
YAGNI is short for You ain't gonna need it. It keep people like me to over design systems. Now, every time that I start to write some piece of code I always have that said in mind. You will be surprised how many times I found myself telling me, YAGNI.
Test your site on multiple versions of IE.
I consider extension methods one of the most interesting features of the .Net framework. I like it so much because It brings some of the strength of JavaScript into the framework. The possibility of write stuff like this.Have fun!!!
In the last few days two of my favorite pieces of software released new versions.
First let me said, thanks for this post.I always sustained that you can't do modern web development without using JavaScript. I never understood when in some user group presentation or a Microsoft product launch somebody drag and drop a control ...
A few weeks ago Jeffrey Palermo published his notion of an Onion Architecture. The first time I saw it was during his MVC presentation at DevTeach Toronto and I really like it.
I look at the table of contents and I knew that I have to have it. I ordered two copies right away, one from my team and one for my personal library. The book came two weeks ago and I'm loving it.
Yesterday I listened to show 115 of Scott Hanselman podcast Hanselminutes, the title was Finding passion for Software.
I was helping a colleague at work to debug an old classic asp script that uploads an image to the server, create some folders if they don't exist and copy the image on those folders.He was having a permissions denied error.
I was creating for the 10th time today a nant build file from Visual Studio when I came to the realization that I needed to automate the process a bit more. So I created an item template to include build files. You just need to copy this zip file...
During Scott's Hanselmann presentation on Dynamic Data at the TVBUG he show a little trick that I didn't know about and I want to show it here.It always annoy me that every time you click run in a web application using VS it runs using ...
Notes on Beth Massi and Scott Hanselmann presentations at the TVBUG.
Testing is fundamental to get your code into shape and to be sure that what you are doing is behaving as expected. New methodologies like Test Driven Design (TDD) point to that goal.
Jeffrey Palermo posted about replacing the ViewData on the MVC framework with a generic container called SmartBag. The advantage is that the container will return an object of a given type, so no more casting and also no more using string keys...
We are changing our template system at work and my boss ask me to look around for a css parser class. The class needed to load a bunch of css files and parse them to be able to get a value from an attribute of a given key.
I have been working in different companies where the practice of an Agile methodology is in place, but in most of them the part that is always left behind is pair programming and/or code review.
I have found some controversy in some post in the wild where I demonstrate how to extend the string object. Sometimes the controversy is around the examples presented. So I decided to make my own example with methods that I wish were included in the framework.
I keep searching for the right IDE for my Ruby and Ruby on Rails adventures. I keep changing and playing around with the ones I had and lately I keep using NetBeans 6.0. Yesterday I decide to try again and after looking at The usual suspects, I found Eclipse for Rails...
The Javascript library Prototype make use of prototypes to extend some internal JavaScript objects like the Array. One of the extension methods that I find myself using the most is the each method.
Microsoft have a set of videos available to learn about the new features on SQL server 2008. You can find links to those videos here. Another set of videos give helpful information on the new features of VS 2008.
If you are learning Ruby or if you just wander what is all of that about there are a few free online books that you should jump into. Mr. Neighborly's Humble Little Ruby Book is a free e-book from the guys at infoq.com
There was something that I wasn't happy with my template system, so I decided to improved it. The algorithm used was wrong, I was checking for all the properties and/or fields of the object instead of check for the variables in the template first...
Prototype is one of the most popular javascript libraries out there and one of the features I really like is the template implementation. When you create an Ajax application there are multiple opportunities to use templates in the client side.
They talk about LINQ and the changes needed to support it in c#. There is a very interesting point on Extension methods a feature that fascinate myself and scare me a little bit. It's so cool that I know that we will overuse it at the beginning.
It's very interesting to notice that 2.0 won't be fully compatible with the previous versions of Rails, I don't have nothing important or too complicated written with Rails so I don't expect to have too much trouble upgrading but I will like to see what is the response of the rails community to this.
This is a cool example of using LINQ to query and filter an array. I like this use of LINQ.
I have been using DooDads, a free, open source ORM architecture for a while now. I like that I can easily use it with any database structure, not matter how bad it is.
I have been reading a lot about how this framework will better be used in brand new developments. I agree that you won't migrate an existing site to this framework.
The CTP release of the Microsoft MVC framework is available with the ASP.NET 3.5 extensions.