December 26, 2008

Get it while it’s hot: Evernote Web Quickstart for C#

Filed under: DotNet, Development, Informatics | Lindsay @ 12:37 pm

As a slightly late Christmas present to other C# web developers out there I’m releasing a project I put together that is a reference implementation with everything you need to get started with the Evernote web API for .Net 3.5 in Visual Studio 2008. The project has several helper wrapper classes to make your life easier: one for OAuth authentication, one for accessing the Evernote User and Note stores and a base page to use on any .ASPX page that automatically handles the OAuth plumbing for you.

This code is released under an MIT/X license so feel free to use and modify it as you see fit. At the very least it should provide a good example and launching point for your own projects.

To get started grab and unzip this Evernote note export file:
Evernote Web Quickstart Download Link

Once you’ve unzipped the .ENEX file it open your Evernote client and go to File > Import > Evernote Export Files… and import the note. You’ll find a zip file with the project source code as well as illustrated instructions for project setup steps.

If you have any questions please leave a comment or contact me at EvernoteAddict at Donaghe dot com.

Enjoy!

Update - If you don’t have a premium subscription you may not be able to import the note since it has a zip file attachment… you can get the code here instead.

» » » » » » » » » »
, , , , , , , , ,

May 26, 2008

Hello World 2.0

The new standard starter project for any web-based code library is creating a Flickr gallery widget. It’s Hello World 2.0.

April 19, 2008

Creating Partial Views in ASP.Net MVC

Filed under: HowTo, DotNet, Development, ASP.Net MVC | Lindsay @ 6:56 pm

I have been coming up to speed with ASP.Net MVC recently and I have to say that it makes me very happy, warm and fuzzy. I had been out of the Microsoft camp of web development for almost a year and a half and using Ruby on Rails in the mean time. Now that I’m “back in the saddle again” with Microsoft technologies, I’m ecstatic that I can use ASP.Net without WebForms, Postbacks and ViewState. The MVC framework is so much cleaner and easier to follow in my opinion. Yeah, it might not be popular with a lot of ASP.Net developers because you have to do more HTML from “scratch” and don’t have the crutch of server controls but that gives you so much more control over what’s going on and takes the “magic” out of it. And it’s also much easier to test (TDD, baby!) and debug when you really understand what’s going on under the hood because you wrote the engine.

So anyway, I’m playing with ASP.Net MVC which is still only in a “Preview 2“, meaning there’s lots more to come. But I want to use it now and there was some functionality missing that I really wanted: the ability to render a view in a view, basically to have the ability to do a Rails-style partial view. I figured out a way to do it by creating an extension on the ViewPage class, though there’s a bit of a hack involving getting the view directory route.

using System;
using System.Linq.Expressions;
using System.Web.Mvc;

namespace Lindsay
{
        public static class Extensions
        {
                public static void RenderPartial<T>(this ViewPage vwp, Expression<Action<T>> action) where T : Controller
                {
                    T controller = Activator.CreateInstance<T>();
                    System.Web.Routing.RouteData rd = new System.Web.Routing.RouteData();
                    // must include the controller name without "Controller" to match
                    // the Views subfolder name there has to be a cleaner way to do this…
                    string viewFolderName = controller.GetType().Name.Replace(“Controller”, “”);
                    rd.Values.Add(“Controller”,viewFolderName);
                    controller.ControllerContext = new ControllerContext(new RequestContext(vwp.ViewContext.HttpContext, rd), controller) ;
                    var ex = action.Compile();
                    ex.Invoke(controller);
                }
        }
}

I know there’s probably a way to use ViewLocator, or maybe some way to figure out which route to use and avoid the controller name hack but I haven’t been able to do that yet and this works for my standard circumstances. If anyone knows a better way please let me know!

To use this, put the code above in it’s own class and then use the namespace in your view to call it from. The call should look similar to this:

<% @Import Namespace=“Lindsay” %>
<% @Import Namespace=“MyMVCApp.Controllers” %>

<div>
         <% this.RenderPartial<MyController>((mc => mc.MyAction(myData))); %>
</div>

Partials are a hotly debated topic, but personally, I don’t see how you can really create an Ajax website without them. There is an implementation of “View Components” using ComponentControllers in the current ASP.Net MVC, but it requires you to use a specialized controller and also put your views in a special folder structure. I want to keep my controller code for an entity in one controller as well as all my views in one place and be able to use them as pieces of a page (through Ajax) or a whole page if I prefer. Creating the RenderPartial extension does that for me. Maybe someone else will find it useful as well.

In the spirit of full disclosure: I had the idea to create this extension when I found this solution to fix a bug with RenderComponent. Ironically, modifying that for RenderPartial allowed me to no longer have to use my view components!

» » » »
, , ,

May 24, 2006

It’s a Fugture!

Filed under: Development, My Life, General Geekiness | Lindsay @ 9:44 am

Yesterday a friend of mine coined a new term that will be one of my favorite words for a while. I was doing some testing of a functional area of the website we’re working on and found some unexpected behavior that at first I thought was a bug but on more thought, and realizing that it had some benefits, determined it might actually be a feature that we just didn’t document very well for the user.

I IMed my friend who’s managing the project and explained my thoughts…

Friend: interesting… what’s the cross between a bug and a feature? beature? fugture?
Lindsay: heh.
Lindsay: I like fugture
Lindsay: or fug for short :)
Lindsay: beature is too much like beautiful… and a fugture is anything but beautiful!!

So it’s all Fugtures now, baby!

New terminology can make old problems into their own solutions! Instead of spending hours working out the fixes for the mile long list of change requests you inherited with maintaining someone else’s old code, just tell the client that it’s fine the way it is…call it Fugture-Rich!

Too bad it doesn’t really work that way… oh well, back to searching for some more fugs to squash.

» » » » » » » »
, , , , , , ,

May 15, 2006

Technical Interview 2.0

Filed under: Development, Brainstorm, General Geekiness | Lindsay @ 2:27 pm

I read a great article by Kathy Sierra of “Creating Passionate Users” fame this morning. She brought up the point of how glib talking people usually get their way more often then their less-articulate counterparts. While it is not always true that the fast-talkers are wrong, the problem comes in when the deep-thinkers are overlooked when they might be right.

Kathy’s article was in the context of making business decisions, having meetings about development issues and deciding on a course of action. But the discussion made me think about another conversation I had recently with a developer friend about interviews for development jobs.

It seems as if technical interviews are definitely stacked in favor of the glib. Considering the fact that many of the best developers (at least in my experience) are often the introverts and don’t like to rush into things headfirst, they are at a disservice with the typical method of interviewing.

It usually goes like this:

  • You get the “Tech Screen”: a 30-45 minute phone barrage of very specific (to the point of “Trivial Pursuit”) questions on code syntax, platform terminology and even IDE menu options. Under pressure, its often difficult to recall that kind of information, and questionable whether much of it is worth knowing off the top of your head. That’s what Google, intellisense and your ability to point and click are for. Frankly, I’d be suspicious of people who do know the name of the 3rd item under the Tools->Debug menu as either being obsessive compulsive or “cheating”. And just because you do know all of the trivia doesn’t mean you have problem solving skills.
  • If you can get past that stage you’re typically brought in to interview in a conference room with one or more people warily (or wearily, depending on how many interviews they’ve already done that day) staring at you from across the table who briefly explain some super difficult business problem that has plagued them for several years and expect you to come up with a watertight solution with about 10 seconds of forethought. Either that or you get the “Mensa from hell” type of “logic” problems involving gas stations and blenders that you may or may not have the worldly experience to figure out in the limited amount of time you have to spit out your answer. Cross your fingers, turn on the glib and buzzwords and hope your stream of consciousness answer is somewhat acceptable.

It’s amazing that any introvert developers get hired!

A developer’s job is about solving problems, but not instantly. Its about learning new technologies and methodologies to solve those problems if you don’t already have the appropriate knowledge. Its about becoming aware of your environment and working within those constraints. And its about efficiency: using whatever tools you can find to save you time, reusing things you and other people have developed to keep you from reinventing the wheel and leveraging whatever knowledge resources (search, books, friends) you have available to you to get the job done. But all of that takes time, and those skills are not accurately measured in the typical kinds of interviews that I and other developers I know have been exposed to (or given!).

Wouldn’t it make more sense if you were given a set of reasonable project requirements with the tools and environment you’d be using at your potential employer (see virtualization) and access to whatever personal tools you’d use if you were working there (ie, internet access, IM, phone, your library of code snippets, your favorite books), and allowed to take 8-24 hours to complete the project to the best of your ability. Then your potential employer could review your work and call you in for a code review so you could justify your choices. Someone who got through that process in good standing would stand a lot better chance of being successful in your company in the long run. It would give people a chance to be judged on what they DO and not what they SAY. And it would get rid of the fast-talking BSers.

“But what if you had your buddy code the whole thing for you?”, the interviewers might say. It doesn’t really matter if the code review process is implemented well. Since one more aspect of development is to be able to understand code that other people write, its still an appropriate test of someone’s ability. Who cares if you really wrote it if you can step through each part and thoroughly explain it to the interviewer’s satisfaction. If there’s still a question of aptitude, the interviewee could expand some functionality during the course of the interview. I have a whole network of developer friends with different areas of expertise that I call on when I need help with some concept I haven’t had to deal with before. And they call on me when I have knowledge that they need as well. We share code snippets all the time. It’s another tool. It’s another method. It’s just part of being a good developer. But in the end it’s all about whether the interviewee really understand the code that they’re presenting. If they didn’t write it this time but they understand and can explain it, they’ll be able to write it next time.

I would rather have someone come onboard at my company who had already demonstrated their capability with problems similar to what they will be expected to work with in my environment than take the chance that the silver-tounged person who knew all the answers can’t produce. That’s the risk you take with the standard tech interview process that’s all based on talk. Time for a newer approach!

» » » » » » » » » » »
, , , , , , , , , ,

May 12, 2006

Dabble DB: All the cool kids are doing it…

Filed under: Development, Reviews | Lindsay @ 9:52 pm

A few weeks ago I got a beta invite to Dabble DB. I tried it out and I was simply blown away. I haven’t been so impressed with the comprehensive usefulness and ease of use of an online application in a long time.

Its so easy that my nine year old son, Avynn, was able to create a database to track his test scores for the Accelerated Reader (AR) program at school with minimal assistance from me after we had a 15 minute conversation about what a database is. He created a table (termed a Category in Dabble) of books and one of his AR test scores, set up the relationship between the tables and created a view that grouped and totaled the results by quarter (displayed below). It took us about 45 minutes to build including the painfully slow data entry skills of a third grade typist!

Avynn's AR Database on Dabble

I had already played with Dabble DB for a while before the experiment with my son and managed to create a database application to maintain a customer database for a friend of mine with 6 tables each with relationships, some with more than 1 per table, and 11 views with grouping and aggregation in under 4 hours. It’s something that my friend would easily be able to make immediate use of and easily add any missing data fields and relationships. The orientation, learning curve and jotting notes for feedback took up the majority of the time I spent on it. I could easily recreate the entire application in about 1.5 hours if I needed to do it again. I was amazed at how easy it was.

Here’s part of the email I sent back to the developers (Avi Bryant and Andrew Catton) after that project:

First I want to say thanks for the invite! And second I want to say OH MY GOSH this is an awesome application! I am so very impressed. And I’ve beta tested a lot of things. This is the most useful, functional and well thought out beta I have seen maybe ever, especially among the class of app it is. Relational databases are not easy things to create and maintain, but you guys have done a really excellent job making it simple, quick and even fun (in an extremely nerdy way)!

I’ve been playing with it for a few hours today, setting up a project that I’ve had in mind to do for a friend of mine and I’m amazed at what I have after my relatively small amount of effort. During the whole experience, I kept saying, “well, X is cool, but I wish it could just do Y… that would make it even better.”, and to my amazement, after poking around a few minutes more, I’d find that I can do Y!! I started out with a big list of enhancements and by the time I was done whittling out the stuff that was there anyway, I’ve only got 5! You guys rock!

Dabble DB came out of beta last week and I think that it is a great alternative to anyone who’s now using more than one Microsoft Excel spreadsheet or a Microsoft Access database to keep track of their information. Dabble DB is friendly enough that anyone who can handle creating a spreadsheet and certainly someone who’s using an Access database can easily set up their own Dabble applications. Heck, if my son can do it, then just about anyone can! No longer will small business owners need to rely on their brother-in-law’s programmer friend to set up a small database for them. As one of those potential programmer friends, that’s probably not good news for me wanting to pick up some side work, but oh well, more time for my own pet projects. Of course Avynn’s leet database services are for hire if you need them after all!

» » » » » » » »
, , , , , , ,

February 17, 2006

Building a better link trap

Filed under: FutureSpec, Informatics, Brainstorm | Lindsay @ 3:11 pm

I’m on an informatics kick lately. I’m working on a new PIM system that I’ll proably blog about soon but I’ve also been thinking about bookmarking. I am a compulsive bookmarker. I save almost everything. And most of the time I save it more than once depending on what it is because there’s not a single bookmark service that provides everything that I need. So I’m going to ask for one today!

If you’re a developer out there that wants an idea to work on to build the better bookmarking site, this post is for you!! If you’re a bookmarking service user like me, and you have suggestions for features that I didn’t ask for, please leave a comment! Hopefully someone will take a hint and build the ulitimate bookmark service and everyone will be so happy that all the world’s problems will be solved and we’ll live in peace forever after. Well, maybe not. But a better service would be nice.

The Basics

Listed to avoid forgetting the obvious, these are features/abilities that already exist in many if not all of the services out there right now.

  • Save a URL with a title and description (duh!)
  • Tags may be associated with the bookmark (hierarcy is dead!)
  • A page listing all my bookmarks in archive
  • Filter my own archive by my tags
  • Search my bookmarks by description text and tags
  • A page that ranks bookmarks by popularity
  • A page that lists the latest public bookmarks
  • Subscribe to my archive by RSS

The Not-So-Basics

These are abilities and features that are either not as common, or that I’ve seen in some services but not others. Here’s where some differentiation begins.

  • Store private bookmarks
  • Store a copy of the page privately so that if the site goes away you have a personal copy of the info
  • Store parts of a page instead of or as a supplement to the whole page: to clip parts of a page
  • When saving a bookmark, choose whether to store a copy, the clip, just the url or any combination of the three.
  • Store optional keywords. These differ from tags in that they have words or phrases that are specific to that single bookmark to help you find it later. If you’re a tagger and you have hundreds of tags that you’ve only used 1 or 2 times, those are really keywords. Having keywords would help us unclutter our tag clouds. Tags are for generalization and classification, keywords are for uniqueness.
  • The save post page should have an easy alternative to typing for me to be able to add tags to my post, a suggestion feature maybe, clickable tag list
  • Search on text in your saved copies (full text search of the bookmarks, in other words)
  • Limit the scope on your searches to entire user base, just personal, and search “within” a tag
  • A public API to write programs to manipulate my archive
  • Subscribe by RSS to any and all bookmark lists (mine, tag filter, searches, popular, latest, etc).
  • A way to easily “copy” a bookmark on any page of the service site to my own archive
  • A page with “suggested” bookmarks based on bookmarks that I already have that people who bookmark the same things as me have bookmarked that I haven’t
  • A page with a list users who bookmark a lot of the same things that I do as a suggestion to subscribe to them because we have common interests
  • Export my archive in an XML format that contains ALL the data that is in my archive
  • Export my saved pages in a zipped format
  • Sort my archive listing by Date or Title (alpha), or by the domain of the url.
  • Create “groups” of users to share/suggest bookmarks with
  • Subscribe to another user’s bookmarks
  • Subscribe to tags
  • View a bookmark’s history (other subscribers and their comments)
  • Other users may comment on my bookmarks
  • View all comments and descriptions for a bookmark/url (mine and other people’s) on one page
  • Create topic lists/directories of bookmarks that others can add to and comment on. Different from groups of users…
  • Rate my bookmarks

The Killer Features

Here’s where your new service will stand out from the pack (and it’s a large pack!)… These features are either rare or I have never seen anywhere. Offer these and you will have the edge on all the other services out there.

  • Storing copies of the IMAGES from a bookmarked page! This is my number 1, absolute need to have requirement for a bookmarking service that I have only seen one place offer and it was a personal storage site, not a bookmarking service. Services that currently store copies of pages only store the HTML. I NEED THIS!! There’s no other way to preserve picture tutorials and inspirational website design type pages.
  • When storing a bookmark to the first page in a series, a way to easily associate the rest of the pages in that series with the original bookmark (instead of necessarily creating a new bookmark for each page in the series). Saved copies should include the whole series, and the link should only show up once listed in my archive even though it points to multiple pages
  • Enter markup into the description field: to be able to add links and lists in HTML format to the description
  • Search by root url. If you want to see all the links you have for cnn.com, for example.
  • A page for a bookmark to view my rating, the average rating of the same url for the people in my user groups, and the average rating of all ratings for the same url across the entire user base
  • Create personal notes. This would just be a convenience, basically a bookmark post without a url, but something you can add a title and tags to.
  • Create a native post automatically on my blog with the items that I have bookmarked that day
  • Create a native post on my blog for every bookmark I save with a tag that I specify (allowing me to choose what items get posted to my blog instead of just the full day’s posting)
  • Filter my bookmarks with tag queries (AND/OR/NOT/Like)
  • Choose what delimiter I want to use when typing in tags: if I like space delimiters, or commas or semi colons, or whatever… or just have the UI be smart enough to parse them however I enter them as long as I am consistent with what I use
  • Meta tag my tags. I want to be able to set up tags to be for source, object type, for, action, etc. Not sure how to do this easily, but it’s my wishlist so I can ask for it anyway
  • Allow linking to files and resources other than web files, such as files on my computer, so that I can add descriptions and tags to these files and find them easily (these bookmarks would automatically be private since they’d only work if you were on that computer)

Anyone got any other great ideas? I’ll update this list as people suggest things that I like! And if someone out there decides to build this PLEASE, for goodness sake, let me be an alpha/beta tester!!

» » » » » » » » » » » » » » » »
, , , , , , , , , , , , , , ,

December 28, 2005

I want to go!!!!

The Future of Web Apps: “One-day conference focusing on the development technology you’ll be using tomorrow.”

… sigh. Too bad I don’t live in London! :(

December 21, 2005

How to configure WordPress on an IIS 6.0 shared host

Filed under: HowTo, WordPress, Development, Systems Engineering, Configuration | Lindsay @ 11:10 am

I have a confession to make. Linux intimidates me. And I am also afraid of using a hosting service other than my favorite, Crystal Tech, because they have given me outstanding service for more than 6 years. So when I decided that I wanted to start blogging again and was convinced that WordPress was the best option, I knew that I needed to find a way to make it work on my account at Crystal Tech.

(more…)

» » » » » » » » » » » » » »
, , , , , , , , , , , , ,