Tuesday, March 24, 2009

Happy Ada Lovelace Day!! - Video Blog




This is my contribution to the Ada Lovelace day pledge. In it I highlight Miss Lovelace




and Marissa Mayer of Google:




Sunday, March 22, 2009

Sexiest Bachelor Developer Results!!!

 Hi, this is Sara's friend Erika. Sara asked me to judge her “Sexiest Bachelor Developer” contest because “I am an expert on everything sexy.” I'll take any opportunity to look at cute boys, so here it goes. I hope you like my choices, I wrestled with them for a long time. Not literally. :(


 


 


Third Place



Name: Kenny Lai


Location: Brooklyn, NY


Languages: C#,ASP.NET, SQL


Occupation: Developer, GlobalGrind.com


 


Kenny works for the cool Russell Simmons project called Global Grind. He's from NYC (which gives him an advantage in my book), and he's super cute. Just look at that dapper style!


 


(Sara's note: Awesome pick, Kenny is cool people)


 


 


Second Place



Name: Chris Bolden


Location: St Paul, MN


Primary Language: Java


Biggest Accomplishment: banging out a full blown web based inventory system between climbs at a rock climbing competition


 


Wow, look at this guy's freakin back! I'm a huge fan of guys that work on their bodies, and the fact that this guy is a mountain climber is hot too. I thoroughly encourage this guy to move to the great state of NJ. We have plenty of mountains here!!!!!


 


(Sara's note: yeah, ditto)


 


First Place



Name: Ryan Rose


Location: San Jose, CA


Primary Language: PHP (CORRECTION: Perl)


Biggest Accomplishments: Working for Tivo and setting up a Twitter feed from his washing machine named @PIMPY3WASH


 


I bought my ex-boyfriend a Tivo, he didn't give it back when we broke up. I'm hoping Ryan takes pity on me and sends me one. Even if he doesn't, though, he wins this contest hands down. Look at those model good looks, and those shoes? Great pick. As soon as I opened this email I knew we had a winner.


 


 


(Sara's note: Great pick! Would have been my choice as well, even though he's a PHP (Perl, not as bad!) developer. Taking Ryan's cue for creating social media for inanimate objects I made a MySpace for my microwave you can see here. I still don't really get the point, and now my microwave's addicted to taking kissy-face pictures in the bathroom mirror. THANKS.)



Thursday, March 19, 2009

ASP.NET MVC Translated for the Web Forms Programmer (2 in a series)


Alright, so last week we covered the new Model -> View -> Controller concept (new to us), this week we are going to start building our project. Let's do something that has a real world application, nerds like Rock Band, no? Let's make an application to help us name our awesome bands.


So, step one I downloaded the new MVC framework 1.0 which can be found here. Make sure you have installed the Virtual Web Developer feature in Visual Studio or you will get an error when you try to add this project.


Let's get started.




Ok, so we're going to create our new solution as an ASP.NET MVC Application, we'll call it "RockBandNameGenerator"



Immediately we are prompted to see if we want to add a test project, I thought this was neat. I'm going to add the test project, but we're not touching it today.



In my project explorer I see a few things I'm not used to. Let's go through them on the order they appear:



First thing that pops up we haven't seen before is a folder called Content.This is for your .css files. Ok, thanks MS?



Then we see our controllers, we remember from last week what those were. We are automatically given two of them "AccountControler" and "HomeController". The account controller is for .NET Authentication, it includes Actions like "LogIn", "Register" and other things associated with the .net Membership authentication system. One thing you will notice is that all the actions return an ActionResult. ActionResult is an abstract class that's responsible for sending information to your View. Random Fact: The names of your controllers must be unique (obviously) and they also must end in "Controller." The HomeController is for your "Default" page (called home in the MVC case). They just give you some stuff to mess with. Delete it or use it it's up to you.


 



Next we have our models, and obviously that is empty because we haven't chosen our datasource yet.




Now, what's this? Microsoft is automatically packaging all the JQuery and Ajax libraries. Being an MVC app it there will be a lot of client side scripting, so it's very convenient to have those there.



Now, we move onto our views. As you can see there are multiple .aspx pages. Like the controllers they are grouped by what they are used for. In the Account folder we see a page to change our password, and to log on. In our Shared folder we have all the things that are project wide, like our master pages, our controls, and an error page.



Now we see the remainder of the objects that make up our default MVC application.


For no good reason in the world we have a Default.aspx with some code behind which inherits from System.Page. This was put in for the MVC 1.0 release simply to confuse the crap out of all us. Actually upon further examinatoin it appears to be how the URLs get rewritten. Can someone clear this up for me (I will edit this after so it looks like I came up with it, thanks).



Ok, now for something really important, our Global.asax is the crux of the whole thing here. See that "MapRoute"? Well, that's how the RESTful Actions get mapped. They get called in our application in the aspx pages with the syntax that passes in what controller to use, what action to use in that controller, and any number of parameters you need. You can change the order of these things however you would like. You can list a few routes and they will be in the preference of how they are ordered in your RegisterRoutes method.


Lastly, as mentioned, we have our test project.


So, we've broken down the default structure of an ASP.NET MVC application. Join me for our next installment where we will dig into some code. I'm having fun, are you? No? Well forget you then, I totally am.



Sunday, March 15, 2009

Oh, what a beautiful morning. Oh, what a beautiful day....





Greetings from balmy central jersey. The weather has been preeeeetty nice lately, and for that I am happy. I get my energy from the yellow sun, so the winter makes it rough for my vim-vigor quotient. I really can't wait for the sun, and the beach.... when that spring smell gets in the air it's all I can think about.



My new machine is all set up, and it's super sweet. I'm dual booting in Win 7 and Vista, kind of by accident but it works out well because I'm more comf in Vista and I really wanted to play in Win 7.

Windows 7 is REALLY good looking. The whole thing looks very WPF-y. I haven't messed around enough to give a real review, so I'm going to hold off on that.



Last week I went to the .NET User Group meeting held at Set Focus in NJ. Our local evangelist  Peter Laudati gave a talk on MVC, it was very informative. This week there is a talk in NYC about Iron Ruby I believe I am going to.UPDATE: It's actually Iron Python, iffy now. Should be interesting, I'm trying to get more involved, it's all about staying current.



Things I will be purchasing in the next few weeks:

1. Monitor: working on a desktop means I don't have that extra monitor. I need another 22" (maybe 24") from my desk. Right now I have an "HP w2207h", at least that's what it's saying in the corner. I need the new one to match, so I will likely get another HP, going to snatch that tonight online hopefully.

2. A netbook. Now, this I am not sure about at all. If anyone has any recommendations please let me know. I have no preferences as of brand or anything, just looking <$500 which I'm sure will be easy because pretty much all the ones I have seen are.

3. A new camera. UGH, my camera was stolen this weekend!!! Stinks but it was about 3 years old so I've been needing a new one for a while. I'm looking <$200 for that. I'm not a photog, I just need something to take kissy faced club pictures of me and my friends. If you know of a good one let me know.



Regarding the Sexiest Bachelor Developer Contest: I promised the results THIS WEEK. That was a lie, and I'm sorry. However, it's for GOOD REASON. We are having a guest judge, my good friend Erika Leonardi who is an expert on all things sexy, rate our candidates and decide the contest. It will be published in the next few days. I apologize for the delay but it will all be worth it, I promise.



Hope this finds you all well, enjoy your week (AND your St Paddy's) and for all of you going to MIX, have a blast!



Wednesday, March 11, 2009

ASP.NET MVC Translated for the Web Forms Programmer (1 in a series)


It hasn't really been “What is MVC” for me. I understand what a model, view, and controller are. At least in concept. What I haven't been able to grasp is exactly what it means to me, a web forms developer to create an MVC application. Where would I put my objects? My classes? My methods? My utilities? What about my user controls and master pages? My web services? All these questions made it really intimidating for me to even consider making an MVC application on my own, so I left it to the professionals. Now I feel like I have a much better grasp on it, and it's time for ASP.NET MVC to be broken down “web forms style” so we can all understand a bit better.




 


The Model: Scott Gu's blog says the model is “the components of the application that are responsible for maintaining state “ For us this means our objects and our ORM classes. For me, that was usually a project on my solution called “Data.” That's it! Easy breezy.




 


The View: Ok, I want you to do something that may be hard, so brace yourself. Remember all your code behind files? Forget them. Pretend they aren't there. In fact, do away with your whole idea of a page and let's start over. Have you used master pages? If so, you're familiar with the idea of the “asp:Content” control. The MVC Views that are the equivalent of what we would consider aspx pages are the html controls within the “asp:Content” tag. There is no code behind, only valid html. This means a lot for you, lover of server controls, but we will talk about this later. Get it? An aspx page is now a view, there is no “aspx” and there is no “page” (at least how we understand them). Also included in our views are user controls and the master pages, and other things like RSS feeds. Pretty much anything that renders data to the user. This is making perfect sense for you I can tell, bear with me this will start to clear up.




 


The Controller: Ok, this is where your code behind went, kind of. Instead of methods you need to learn the term “Actions”, because that's what we now call our methods. Instead of putting our control and page manipulating methods in our aspx.cs files which caused postbacks and server calls, we are instead only manipulating objects in these controllers. The cool thing about these “Actions” is that they are fired with URLs in a very RESTful manner, even your parameters are included as part of these URLs. You can have URLs that populate a view, or a URL that does an Action like delete a record. Think of all the great JavaScript possibilities here.


So to recap, Controllers are where the methods (called “Actions”) live that manipulate your objects. These methods (“Actions”) are called by using URLs instead of server based events on your page or control.




 


 


Ok, so, now that we've made it this far let's discuss some of the huge changes that come with an MVC application. One of the first things to jump out is the lack of server controls. I got a little short of breath when I realized I was kissing goodbye my lovely repeaters and textboxes. However, fear not, my friends because this is all for the better. Gone are the bulky server controls and back are the crisp clean <input>, <button>, and <li> tags. For datasets? A simple foreach embedded in the html will iterate through that data and display it just like the server controls you've grown to love (and lean on like a crutch, no? Tell me I'm wrong). With such things as JSON and Jquery out there is no reason to use server controls, the client is so much faster. Remember, every time you do a postback a ninja dies.




 


Something else that is different for a lot of us that I touched on a little above is the lack of many different projects. The Models, the Views, and the Controllers all have their own folders in an MVC project. Also, there are folders for things like scripts, and style sheets, you can also add your own. I found the folder structure to be a bit different than what I am used to, but less bulky. Which makes me notice a bit of a theme here, are you?




 


Ok, so that's enough for this week. Next week we will dip in a little further to the “Actions,” their syntax and how the URLs are mapped. Also, how many controllers to a view? How many objects to a controller? Understanding MVC is not as hard as it seems and soon we will be writing our own applications as fast as you can say System.UI.WebControls.




 




 For more information about ASP.NET MVC here is a book written by Nick Berardi that should be very informative.


(Thank you to Peter Laudati for his talk on MVC this evening which cleared a lot of this up for me.) 

 



Thursday, March 5, 2009

Hello Everyone


How is your week? Mine is well as you find me doing a lot of analog things like writing emails and sending resumes. Part time work on the site doesn't start for a few weeks still, and I am really itching to code. My current game plan is to consult for another project along with mine to supplement income. I think I may pick something up this week whether it's paid or not (not a threat). I would LOVE if it was something new and funky like WPF or MVC.


For now I am watching railscasts(I know!) and I just ordered a new machine so I'm waiting on that (for home office work). At first I went with a new lappy , but reconsidered and went with a desktop with the developer required 8G of RAM. Rarr Rarr Rarr</Tim the Toolman Taylor>. I figure I'll just snag a netbook and remote in to my home machine when I need to be mobile.  I'm looking forward to setting it up, I am REALLY trying to get my hands on a Windows 7 Beta, so if you're not using yours I'll love you forever (I promise!). VS 2008, and I THINK I may get SQL Server 2008, there is no excuse for me to still be using 2005.


The Sexiest Bachelor Developers will be announced NEXT WEEK. There will be the Top 5 announced, with those who place 1-3 winning a "Sexiest Bachelor Developer" tee shirt from GirlDeveloper.com. What a great look for your next nerd conference!


So, enjoy your weekend, I will see you next week!