Thursday, June 30, 2011

Knockout.js - I wish I found this sooner

Knockout.js is probably one of the best JavaScript Libraries I have found since jQuery. The library allows you to create object dependencies on properties. You can also use it with jQuery templates to produce quick and easy fully featured grids with CRUD capability that blows away anything else that I have tried.

I just finished up an MVC project where we were using jQuery to perform CRUD functionality with Modal Dialogs. I wish I had Knockout to make it everything clean up nicer. It would made it easy to follow in code. Now, I have a mess jQuery mappings, and mapping methods. A pain to keep everything straight.

For a simple example checkout this page demonstrating HTML controls using Knockout.js. One final word on knockout, is that Steve Sanderson has done a great job with the getting started documentation and allowing you to quickly implement knockout on a page. I had turned one of my pages into a readonly only grid in seconds with an ajax call, jQuery template, and 10 more lines of html and javascript! Awesome!

Monday, June 13, 2011

ASP.NET MVC 2 - Creating Reports from Report Server

So after two days of search and trying many solutions, all I want to do is kick myself right now. My boss comes to me today, and points me to a solution and says..."See if this will work."...ok.

I felt 10 foot nothing. I tried everything from making multiple nested master pages to use one with ASP.NET WebForms and use another for ViewPages. Argghhhhhh!

Here it is ...

Simple add an iframe tag to your view pointing to the source of your report on your report server.


iframe id="report" title="Product Report" height="600" width="800" src="http://your.server.com/ReportServer/Pages/..."


I mean com'on! What a waste of time and you have dive about 3 or 4 google pages deep to find that. My weekend would have been a lot better had I found that earlier.

Saturday, June 11, 2011

Quick and dirty iPhone to Server testing.

I wish I had found this information sooner. In Matt Stoker's class for iPhone Development, he discusses a tool called MAMP. MAMP gives you the ability to provide you with a quick and dirty "server" on your machine without having to worry about how to setup Apache, PHP, and MySQL. Place the MAMP folder in your applications directory, and double click MAMP. BAM! Your machine is now running MySQL, PHP, and Apache instantly. This was great to find, because awhile back I was looking at how to setup a test environment for an iPhone application to talk to a server without having to have something on the internet, or waste another 1 - 2 days to get a server up and running with the AMP (Apache, MySQL, PHP) approach. I happen to waste about 4 - 6 hours trying to figure out how to setup an AMP, but I tried to do it on a virtual machine, and be able to reach the virtual machine. I found out this was out of my knowledge base, so I gave up.

Check it out if you are having problems trying to contact a web service or url on a server out in the "cloud".

Thursday, June 9, 2011

Development Hiatus

Getting ready for iOS 5, and brushing up on Objective-C and iOS development in general.

I have been on hiatus from iOS development, because of my regular 9-5 job doing .NET development. Until recently I didn't have a reason to get too involved in it, but now I have been contracted by a company to create a application that will hopefully go viral within the next year .

They took a risk on my skills as a developer only because they liked my professional thinking, and in this business I try to stand apart from the norm. I like engage the customer in the project, and make sure that they are following the same path that I am. I don't want an unusual surprise to hedge the path, and they we are caught in a scramble to make up for lost time. Not doing projects right now because you don't think someone has a good idea, is not really a policy that I want to adhere to. I think everyone has an idea somewhere. Now, lets be clear, I am not going to help someone that has decided to build an app in which a user clicks a button and it does nothing, or something so ridiculous that it defies common sense.

I am here to help people with ideas.

Great tutorial for iPhone Development for Free!

Matt Stoker owns a tech company, but also teaches at University of Utah. University of Utah has put out a iTunes U course that he has been teaching the last 2 semesters. It is the best resource I have found for learning iPhone Development from the ground up. He makes sure that he teaches you from basic to beginner. Unlike most books out there, Matt does not start by developing with XIB files. He takes you through the manual process of layout objects on a screen and manipulating everything in code. It was a great experience to go through this course so far. I am only half way through the course, but I am so glad that I was able to take the time to go through it all.

iTunes U Course

See Matt Stoker and his company here.

Enjoy!

Wednesday, September 1, 2010

SQL - User Defined Table Types

So a very interesting feature in SQL Server 2008 is user-defined table types. This is basically a custom variable type. Similary to a typedef in C. You can create user-defined table type as so...


create type CustomerUdt as table
(
Id int,
CustomerName nvarchar(50),
PostalCode nvarchar(50)
)


and then utilize that in a stored procedure like so...


create procedure InsertCustomerInfo
(
@CustomerInfoTvp as CustomerUdt readonly
)
as
insert into [Customers]
select * from @CustomerInfoTvp


this will do a bulk insertion for you... very nice!

the schema that you setup in the user-defined table type has to be the same as [Customers] in the example above.

This works best in the case where you are make multiple calls to the database for each row of data to separate tables. You can combine user-defined table types in one stored procedure like so...


create procedure InsertNewOrder
(
@OrderTvp as OrderUdt readonly,
@OrderDetailTvp as OrderDetailsUdt readonly
)
insert into [Orders]
select * from @OrderTvp
insert into [OrderDetails]
select * from @OrderDetailTvp


That makes one call to the database. Easy peasy.

iPhone Development - Day 11 Review

I have resumed my studies utilizing the Apple documentation. Whoever thought that documentation from the creators would be so easy to understand and read? It might also because I have attempted to read three books now on the subject with little help, but the documentation clears up some techniques and concepts. We'll see how this goes ... great a separate attempt at this stupid project, of course I am excited to learn mobile development, but damn, is it this hard for real?