www.nickhodge.com

microsoft, munging and on being a mercurial iconoclastic professional geek.

Archive for the ‘c#’ Category

T40T, 6th June 2008 to 9th June 2008

without comments

Csharp kitteh

(kit­teh codez: ./;;;;;;;;;;;;;;;;;;;;)

Time to start C# famil­i­ar­isa­tion, this long week­end is the week­end to start. My guide is the book: “Pro C# 2008 and the .Net 3.5 Plat­form” writ­ten by Andrew Troel­son

Hav­ing last been semi-professional in Java about 10 years ago, there are many sim­il­ar­it­ies. But lots of new plat­form learn­ings. Unix shell, paths and com­mands are dif­fi­cult things to dump.

Just ensur­ing I under­stand the fun­da­ment­als before I jump into the deep end of the BCL and other .Net goodness

So, some new things:

  • using the Visual Stu­dio Com­mand Prompt to pre-setup paths
  • @*.rsp files for input to csc.exe (to replace com­mand lines)
  • Con­sole.* and Envir­on­ment.* for command-line/console style apps; along with return values
  • Escape char­ac­ters vs. @”sss” ver­batim strings
  • Narrowing/Widening data­types at com­pile time (short/ints)
  • out, ref, params (leave params as last argument)
  • oper­ator over­load­ing (sans gen­er­ics), arrays, simple objects, enums’
  • structs on the stack, vs ref­er­enced types on heap
  • Nul­lable types (using ? at the end of the type declar­a­tion, ?? as default over­ride if value is null)
  • Objects, default constructors
  • con­structor chain­ing using this. keyword
  • Encap­su­la­tion using prop­er­ties (auto get­ters and set­ters, or Accessors and Mutators)
  • par­tials (one class across mul­tiple *.cs files)
  • class dia­grams; same 3 base things of OO pro­gram­ming (encap­su­la­tion, inher­it­ance and poly­morph­ism)
  • base class construction
  • nes­ted classes
  • vir­tual, over­ride in poly­morph­ism; as keyword + null test in polymorphism
  • SEH. Struc­tured excep­tion handling
  • The heap, gen­er­a­tions as a method of mark­ing objects as “more likely to stick around” in System.GC
  • Final­ize. Final­ize when unman­aged (ie: Pin­voke) objects
  • Dis­pose. call Dis­pose on an object that imple­ments IDispos­able (if x is IDisposable…)

Inspecting ur classes

New fea­ture of Visual Stu­dio 2008, LOLCAT edi­tion. CATROSPECSHUN OV UR CLASSEZ

Written by Nick Hodge

June 8th, 2008 at 6:47 pm

Posted in c#,t40t

Our Valuable Virtual Meta-verse Future

without comments

In 1988 Mitchell Waite sent me a small paper­back to read: Ver­nor Vinge’s True Names. I was a mere, lowly Hyper­talk pro­gram­mer from Adelaide, South Aus­tralia. He was an import­ant person.

This book has stuck in the neur­ons, and now the vir­tual is becom­ing real. It really goes to show how hard sci­ence fic­tion depicts a future that cur­rent liv­ing humans will not see. Based on some work I was doing to Tricks of the Hyper­talk Mas­ters, cre­at­ing what would be now known as a “skin” over Com­puServe; the book was just sci­ence fiction.

True Names pub­lished in 1981, describes a world called “Other Plane” were people inter­act online. The premise of sep­ar­at­ing your online from your phys­ical inden­tity; and the concept of a future Sin­gu­lar­ity per­vade my per­sonal world-view today.

Thanks Mitch.

Now, what does this have to do with today?

Second Life. It’s more than the tech­no­logy; it is also about the plat­forms involved. It is also how it impacts real people: such as Dave Wal­lace. Second Life is what I visu­al­ised as “Other Plane”

Watch the first half of this video: Jim-Cory-SecondLife.wmv, Lang.NET Sym­posium.

The first half of the video is light on tech­no­logy; but heavy on the eco­nom­ics, and wider-world impacts of the vir­tual world. The user cre­ation rate (Write­ness in the Read/Write equa­tion) is over 60%; com­pared to the web which is less than 10%.

A key reason seems to be the eco­nomic value attached to vir­tual objects scrip­ted in Second Life. As items in the Second­Life vir­tual world are intel­lec­tual prop­erty; an item can be cre­ated, sold and purchased.

Ensur­ing that intel­lec­tual prop­erty is val­ued is going to be one of the toughest chal­lenges for upcom­ing generations.

Is the script­ing in Second Life the new HyperCard?

Written by Nick Hodge

September 21st, 2006 at 5:04 pm

Watching the Language Wars

without comments

Today, at least in the US, it is Programmer’s Day.

Maybe it should be called “Inter­na­tional Pro­gram­ming Lan­guage Peace Day”. The level of advocacy for vari­ous pro­gram­ming lan­guages reaches rhet­or­ical heights last seen dur­ing the one of the not-so-successful 18th cen­tury revolutions.

When not speak­ing to humans, other pro­gram­mers to read­ing the latest advocacy on their lan­guage of choice: pro­gram­mers stitch together the wild thoughts of oth­ers to munge data into inform­a­tion.

Pro­gram­mers are the people who use com­puter lan­guages, in their vari­ous forms, to get com­puters to do cool things. From bliken­lights to cool online maps: there are a pyr­amid of pro­gram­mers respons­ible for your com­puter exper­i­ence. A pro­gram­mer is behind the “ding” in the lift you used this morn­ing; and the soft­ware that val­id­ated your ticket on the bus ride to work.

The beauty of com­puter lan­guages is that they never seem to stag­nate: like mod­ern, spoken lan­guages: they evolve as the world changes. Except those that are aban­don­ware.

Microsoft has recently released my cur­rent favour­ite pro­gram­ming lan­guage, Python, as a CLR/.net lan­guage: Iron­Py­thon. This imple­ments Python as a dynamic lan­guage on the CLR engine.

C# is the lan­guage of imple­ment­a­tion for CLR, as is Sun’s Java is for the JVM. A# (Ada), B#, D# F# (OCaml), G# (Gen­er­at­ive lan­guage), J# (Jsharp), P# (Pro­log), L#. More sharps than Beeth­oven.

The lan­guage wars has returned to an old field: dynamic lan­guages. The grand-daddy of dynamic lan­guages, LISP, has received some recent pos­it­ive PR. One per­son, Paul Gra­ham, is the poster mil­lion­aire for LISP. Laz­arus of LISP.

This week, Sun Microsys­tems par­ried Microsoft’s Iron­Py­thon by hir­ing the team behind JRuby. The aim here is to imple­ment the Ruby dynamic lan­guage on the Java Vir­tual Machine (JVM). Some months ago, this team was able to get a Ruby on Rails work­ing on the JVM.

Whilst the big lan­guage guys battle it out, is Erlang the next Ruby, or is it just a vik­ing proto-language with the best non-pun name? The Erlang com­munity is start­ing to come out of their tele­phone exchanges.

No lan­guage has deemed to have arrived in the 21st Cen­tury until there is a web frame­work writ­ten around it. C# is ASP.NET, Python has Dyango, Ruby has Rails, Erlang has Jaws, Scheme has Magic… and so it goes on.

This broken thing called Javas­cript that has been reborn with AJAX, and is receiv­ing daily blood trans­fu­sions of new features.

All of these lan­guages just remind me of my per­sonal all­time favour­ite lan­guage love of my life: Hypercard’s Hyper­Talk. As Hyper­card is no longer sold, and “Clas­sic MacOS” is a battle to get going on my Mac­Book Pro — sadly it is a lan­guage as use­ful as Cornish.

So, for a short period of time it is back to one of HyperTalk’s chil­dren: Applescript. Bas­ketweav­ing for the mind.

Written by Nick Hodge

September 14th, 2006 at 8:47 am

SVG,C#

without comments

What a strange day. Spent the morn­ing doing “sales man­age­ment” stuff (part of my new job) and the after­noon look­ing at SVG, C# and debug­ging SOAP/Webservices style com­mu­nic­a­tion with the Adobe Graph­ics Server.

Cari poin­ted this out: Pho­toshop Cam­era Raw and JPEG2000 plu­gins for Pho­toshop 7.0. These are pur­chaseable down­loads from adobe.com. Cam­era Raw gives you much greater con­trol when load­ing images from Digital Cameras.

For a while there, the world began and ended on Monday Decem­ber 2, 2002. Sorry about that. Cod­ing error my end. Been a lot of that lately on my end. Thanks Mark.

Written by Nick Hodge

February 20th, 2003 at 12:00 am

Posted in c#,photoshop,svg