Showing posts from 2010

Making a multi-choice quiz application in

I was very interested the quiz that is in w3schools I decided to try to create one in use a database and Viewstates to manage the quiz .It is very staigtht forward and self explainatory .If you are interested, I can always explain it .

Here is the final view
I use Linq to SQL classes
Finally i create simple Quiz manager to insert,update and delete questions for the quiz.I use a detailsview control because its very optimal for such funtionality

Here is the source code for the quiz i made.
using System; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Collections; public partial class _Default : System.Web.UI.Page { //create variables you will need to use in the application ArrayList quizHistory = new ArrayList(); QuizDataContext qz = new QuizDataContext(); int questionNum = 1; int score = 0; int totalQuestions; Random generator; prote…

Loose Design with Interfaces

I am very interested in design patterns but i have not really had it easy trying to understand how they work .Anyway i think i am getting better in understanding them. I read this wonderful post from this blog Software-design-patterns-for-everyone It helped me understand some patterns better . The truth is that practice makes perfect ."I have to write my own game engine using patterns to learn patterns".Very possible as everything else is, if the goals are realistic to attend .

I am currently reading been reading Professional ASP.NET MVC 2: NerdDinner and in the book there is use of a couple of patterns like repository patterns ,dependency control and others (still reading ) .The was one aspect that caught me and i think it was very interesting It was about loose design with interfaces that can make test driven development(TDD)easy .Objects are not to be passed as parameters just what they do is passed as parameters .After understanding it i decided to try to implem…

Why I should learn ASP.Net MVC .

There has been lot of talk on the internet about web form and the new framework MVC .I have read a couple of them and watched to a couple of videos that was done by the creators themselves who all work at Microsoft.I have watched Scott Hanselaman's videos on making of the Nerd-dinner portal and even downloaded the book and source code to play with it.

After reading all these blogs and various views about the two frameworks and reading the book Professional ASP.NET MVC 2 about the creation of the Nerd-dinner portal i came to the following conclusion
MVC is just an amazing framework that is good to use if you want control in your application.
It is very easy to turn my applications to be mobile phone adapted and it you can keep on expanding it the way you want and great of all it is easy to do test in MVC.

There is a clear separation of concerns MVC(Models,Views and Controllers)

Nice SEO urls.that are search engine friendly.

There is more work to be done when devel…

The Singleton pattern in C#

Singleton Pattern:Example One
Thread safe example
It is created at the beginning of the application and this makes it thread safe.
The static part of the instance is private and the public Singleton can be gotten using GetInstance() that returns an instance of this class hence making sure that only one instance of the object is created in the application current state for example a shopping cart on a webpage.
using System; /// /// Thread-safe singleton created at first call /// namespace Singleton { class Singleton { private static Singleton instance = new Singleton(); private Singleton(){} public static Singleton GetInstance() { return instance; } public double Total { get; set; } public string UserName { get; set; } } }
Here is how you make a call on the Singleton class :
Singleton single = Singleton.getInstance(); single.UserName = "Ngala" ; single.Total = 345.00 ;…

TekPub - Concepts

TekPub - Concepts
I love watching videos from Microsoft Mix . These videos are very enriching and one gets to know about current and future products of Microsoft .You get to see all these great videos(some of them) from the guys themselves that develop these products. I happen to have fallen on Rob Conery presentation on the MVC Store Front. Its just amazing and I really feel in love with the scripting aspect of his application. So I though to myself to see if this guy offers more. Luckily he had a website called Tekpub that publishes videos tutorials. The quality is really good. For now I am watching all his videos on key concepts in software. He demystifies them and I feel like I can start using all these knowledge the next time I want to build an application. The truth is interfaces are powerful in design of software and knowing how to use them makes you build really groundbreaking and flexible applications. Here are the key concepts he talks about and show us life code exampl…

A paddle and ball game in Javascript

As a web developer you just have to know and write some javascript to add some extra feeling and functionality on your web applications .I am not a declared web developer but since i love the web it will be nice to be able understand its own key programming language . Here is where I start .I am building a small paddle and ball game .I am not starting from the basics because I already understand the basics in programming. What I wish to accomplish is to be able to link css to javascript ,move objects on the screen and let it work on all browsers. I wanted to do it with jquery but I feel like I am cheating on myself on my goal to learn the main scripting language for the web. Just some raw Javascript will make me happy.I know i will learn events in javascript,functions definitions,timing,key game concepts and others as I develop the game.
To start the development of this game .They are certain important objects that have to be defined.Anyway lets imagine how the player will play the …

Scott Hanselman - What Great .NET Developers Ought To Know (More .NET Interview Questions)

On The Value Of Fundamentals In Software Development

On The Value Of Fundamentals In Software Development
Great post above for beginners and even for experts. I decided to follow this rule and truly you become more productive and bettter

Computer Programming

Is Programming an art ? May be its an art when it comes in designing bigger programs and crafting a solid system architecture.What do you think?