Archive for the 'coding' Category

Children learning Computing

Just read an interesting article on BBC News pointing out that in the UK less and less children are learning how to programme computers and more and more children though are learning to be end users, I slightly disagree from what i have seen in all honesty. When I twas a child i hadn’t even heard of such things like computer code etc. I had no idea at all with the exception of what a word processor was maybe.

Today children seem a LOT more educated in subjects related to computing, even if these subjects are not in detail, the concept of what a computer does and there importance is a message well received.

News article here:  http://news.bbc.co.uk/2/hi/technology/7324556.stm

Re: Dot Net is sexy

This post is a reply to Chris’s post (found here ), which spawned from Kieran’s post (found here )

The original post compared programming languages…but not in the traditional sense where one compares the actual syntax, performance, support, openness or usability etc. but comparing the amount you get laid correlated with the programming language one ‘codes’ in!

Chris makes a fair argument saying .NET is the language of sex i must say, as all my colleagues who I work with are also all in relationships (although…almost all of their relationships started prior to them using .NET, but lets leave that out for the purposes of humouring ones-self d:). And One of them is a girl! yes, a female!

Is it the parent child architectural structure of windows programming having an affect on humans mind as we are predisposed to reproduction…?

Is it like Dan Zambonini said, that programmers working with tools visually like those admin people use (including hot secretary’s and receptionists (; ) bridges the gap between genders in the workplace?

studies are needed to try and answer these big questions… d:

Thanks for the mention Chris, particually impressed you went to the effort to get a pic of me and my sexy friend lol  :D

Visual programming language

A friend in the video games industry has made me aware of a new programming language that is in beta release at the moment named ‘Processing’. It is a language based on Java and is purely Object-Oriented in the sense it only uses Java’s inner classes not any static classes/structures.

Processing is an open source programming language and environment for people who want to program images, animation, and interactions – aimed at graphics artists and such.

From a brief glance at the IDE it seems to be similar to Microsoft’s GDI+ library provided for C# of the .NET suite but slightly more mathematically based like VRML, with transformations, matrix-es etc. provided for you as black-boxes. This means you can code semi-complex moving graphics that look very sweet, very easily.

I am impressed at first glance, when I get time I shall dig further and report back!

home page for the language: http://www.processing.org/

wikipedia page: http://en.wikipedia.org/wiki/Processing_%28programming_language%29

running example:

processingExample1

Example of the ide (click for larger image):

processingExample2

asp tags not visible by XHTML DOM structure?

I am using ASP.NET. I have a text box with an image adjacent to it. When this image is clicked on a model box pops up with a pretty calender. When the user clicks on a date the model box closes and the text box now contains the date – this all works, I have implemented it several times on several web pages for consistency.

The problem comes with the Text Changed event of the text box, it doesn’t fire! It doesn’t fire at all until a post-back occurs! This is a problem for me because I want to add seven days to the date that has just been populated in the text box and display the new date in a label underneath the text box, as soon as the date is visable - a simple thing I want to do, so you would think!?

I have thought about the problem and and after many debugging sessions trying to figure it out I have decided to use Java-Script as you can specify the ‘OnChange’ event for a text box which solves the problem, well half solves it.

I have managed to get the event to work as it displays an alert box on text changed, hurrah! But I have spent several hours trying to use the getElementById and getAttribute functions of the DOM to get the text property of the text box and put the contents in the text property of the label – with no luck.

I have downloaded a java-script debugger that works in Fire-fox and it tells me that the getElementById returns no value. I tried the same code with a <p> instead of a <asp:TextBox> and it works, therefore the problem must be: the asp tags do not work/are not readable with the XHTML DOM structure of the page. Bugger. I have spent an hour browsing forums + google for answers with no luck.

I am annoyed that I cant fix this seemingly simple problem that the client needs. It is past 5pm on a Friday, i am calling it a week.

Any help appreciated.

fluid looking ‘advanced’ code

When reading code I do love to see things done in more compact ways compared to over many lines, it just looks so fluid and sexy.This is the same in spoken languages too, when reading “Grande DeCafe Caramel Machiato” it gives the reader (psychologically) a different imprssion of the item compred to “Medium cofee with some caramel in it and no caffeeene”. Which would you rather choose? Be honest d:I have put the advanced in quotes within the header becasue its not really advanced at all! It does the same thing!

 This post was inspired by the following line of code just written at work:

DateTime validateDate = DateTime.Parse(((TextBox)Page.Controls[0].FindControl(“ContentPlaceHolder1″).Controls[0].FindControl(sourceControl.ControlToValidate)).Text;

layering on a web form

How nice would it be to have layers on an ASP web form?

“What do you mean”, I antisapate you thinking…

well here is a simple example i keep annoyingly coming across, when wanting to have a required field validator and a custom validator validating one field on a web for they must be placed side by side, or below each other which leads to a messy form if you have many fields each having two validator controls… So using layers (the same concept photoshop has) would enable me to have one required field validator with Zorder 1 and the other 2 meaning both can be at the same position on the page (assuming these validations are mutually exclusive otherwise hungarian may occur lol).

If this deature were present on the next major release of ASP.NET, all I can say is WOW – what amazing possabilities! semi-transparwent images on top of each other….etc… this is needed for web apps to be true web apps IMO.

asp.net breaking the ‘rules’

coding today at work I came accros a data control you can place on a web form that contains properties. These properties are used to connect to a data source (sql, xml… etc…). You can then link this control to a grid and hay presto you got a 3 (or n)-tier application architecture, in dangerously potentially 1 or 2 tiers… tut tut tut.

A layered architecture is there for a reason, to make it easy to extend code, read code, modify code amongst many other useful reasons. Although this method of data access is easy to code at first, in the long run (90% of the time) this will not be very benefitial and you wiull have to recode or make things difficult at a later date.

naughty naughty.

alcohol and coding ay

Experements needed people!

xkcd comic strip

Add a comment to apply…

lol