Nemaroller.Com

Nemaroller's .Net

Blatant self promotion and more!

Launch of Nemaroller .Net
Welcome to Nemaroller.Net. It took a while before I decided to create my own personal space on the Internet. I've been creating web applicatons for years now which has kept me so busy I simply cringed at the thought of putting more 'programming' time into creating my own site. All the hoppla about blogs never caught on with me. Its just a text journal for god sake's - its not new technology or even new methodology - but mainstream media sure seems entranced by blogging.

Anyway, as I stated, I am a web programmer. Certainly not the most stress-free job. Web technology is horribly cobbled together, and its a royal pain to provide the holy 'rich user experience' companies desire to give their visiting Internet guests. Hopefully, FLASH as a delivery vehicle will gain wider acceptance as more than just an advertisement banner. I see great hope in many companies transforming xml-UI markup into FLASH movies. That would make many developer's lives much easier.

This site's purpose is simply to log my personal opinions on web technology, and programming in general. Additionally, since I am highly politically opinionated, I can guarantee there will be some controversial articles posted here as well.

So enjoy the years ahead - and here's hoping I find enough free time to update this site.

Karl Beyer




Google Android
Google has offered quite a few attractive sums of money for developers to create innovative applications for their upcoming Android Mobile OS. As you may recall back in 2007 the media outlets were speculating Google was entering the mobile phone handset business. The media was a little off track of course; Google is developing their own open platform mobile OS.

I took the time recently to watch the architectural YouTube videos which Google has posted, and overall it looks to be a very viable OS platform. The OS is based on a linux kernel with some of Google's own hand-written C applications, and then finally layered with a JAVA virtual machine and a set of JAVA API classes which allow any JAVA application written on the phone to communicate with aspects of the OS most mobile operating handsets would never allow.



In any event, I have gotten as far as downloading the Eclipse plug-in, and chugging through some of their provided samples. About the worst problem of course is that Eclipse is rather slow, and the emulator for the OS of course takes forever to boot up. Once going, the emulator works acceptably close to real-time, and I am quite excited about creating some applications for it.

The big question is what innovative applications are vialbe on a mobile phone OS, and how much time can I find to create those applications.

.NET Installer Registry and multi-string values

If you happen to be one of those people attempting to add a mult-string value to the target machine registry using the .NET Setup and Deployment Registry viewer, you may have wondered why you cannot add a multi-string value key.

Well, you can.

Simply add a new String value key, and insert the following characters:

[~]

 between each value.

Example: myReader[~]myListener[~]externalReader

Make sure you don't end the value with [~] of course.

 

 


ASP.NET Impersonation
When working with an ASP.NET site with Windows authentication, some developers tend to include impersonalization="true" inside their web.config. Which is fine except that most of the time, the ASP.NET site only needs impersonation to access a few resources.

The most secure way to do this is to simply use impersonalization only when needed, like so:

IPrincipal principal = this.User;
WindowsIdentity identity = (WindowsIdentity)principal.Identity;

   // impersonate temporarily
   using (WindowsImpersonationContext context = identity.Impersonate())
   {

     // do stuff as the client account
   

     //revert to the original thread context
     context.Undo();
   }


You can then leave out the impersonationalization="true" in your web.config.



Electronics

When I was young, my grandfather gave me an Electronic Project Kit from Radio Shack for Christmas. The kit contained 200 plus projects and a step-by-step book that allowed you to build crystal radios, water level alarms, eavesdropping transmitting microphones, etc.

That winter I built just about every circuit in that manual. But, because I was only 9 or 10, I never really understood how it all worked, I could just follow instructions well.

Over the years, I was always interested in electronics, but whenever I approached the subject, I found it became too involved - either due to when to apply what rules, or my short attention span decided there were more pressing matters.

Recently, I got the bug again, and this time, I'm actually making headway in understanding why a smoothing capacitor is useful, or why drawing 2 amps from a TTL circuit will bring your fun to an end quickly.

Since college, I've obviously been involved in software development. I like it generally, however, there is something more sastifying - more concrete - about taking physical electrical components and making objects that actually interact with the physical environment. You could say that I am being bit by the hardware bug more and more.

My wife supports this oddly enough, but of course the things I build are only amusing. As an example, I built a passive IR motion detector that simply counts down from 9 to 0 on a single-digit led display and then buzzes for a few seconds when it detects motion. My wife said not to bring it to work (I did anyway). At the very least, my 4-year-old son had fun trying to sneak up on it anyway.

All that said, I have a very long way to go in becoming proficient, but since it has been such a curiosity for such a long time, it is immensly satisfying when I learn a new concept.

In any event, I will most likely be posting some amateur videos of the circuits I have made - if for nothing other than remembering how I put it together.


Lego is a 4 letter word
So in browsing the open source for Lego Mindstorm NXT's firmware - a bunch of C source code that powers the popular kid's toy - I run into this code gem inside c_armcomm.c:

 // Check for ARM communication
if (ArmTimer >= ON_ARM_TIMEOUT_TICK)
{
 ArmFucked = TRUE;
}


 Now, I know the code author might believe only adults are tinkering with the toy at this level - and therefore was not considering his use of adjectives... but I wouldn't necessarily count on it - and was a little surprised to see it in there - free to see on the web. Check it out here: http://mindstorms.lego.com/Overview/OpenSource.aspx



How about an EmptyResult template please?

One of the shortcomings of a repeater or datalist is the lack of informing a user there are no results. Due to that shortcoming, the solution is usually a label that becomes visible stating no records have been found, while the repeater or datalist itself are hidden.

I never liked that shortcoming. Why hadn't anyone done anything to remedy this?

So, I implemented what I call an EmptyResultTemplate into the Datalist, which will show whatever html markup is written therein to the user when there are no items in the databound control's Items collection. The ASPX markup looks like this:

</HeaderTemplate>

  <EmptyResultTemplate>

   <tr class="dataTableHeader" style="font-style: italic;">

         <td colspan="3" style="width: 475px;" align="center" valign="middle">

               <p>No zip codes have been specified for this city.</p>

               <p>To add a zip code, enter a zip code in the box to the left and click Add.</p>

         </td>

   </tr>

</EmptyResultTemplate>

<ItemTemplate>

<tr class="dataTableRow">


Which results in the following:


It took about 4 hours to implement this functionality, but of course, it took over 4 years for the inspiration to hit. So now, I never have to worry about blank datalists. Head over to the download section for the source, and you won't have to either.