Welcome to Honest Illusion Sign in | Help

Browse by Tags

PropertyBagTextWriter (Stream into Dictionary)

It’s been too long since I posted since .NET code, and I’ve been itching to. (Actually, I really want to write more about politics, but I figured if I don’t show some code soon, I’m gonna lost my techy audience) Fortunately, I’ve got a backlog of things
Posted by James | 1 Comments

Mathematical Proof that Birthers are Fools (and Jerome Corsi is a Con-artist)

Jerome Corsi is a right-wing writer, known mainly for writing hatchet-job books about Democrats. His Swift-Boater opus “Unfit for Command” was a important factor in John Kerry’s loss to GW Bush. It was completely discredited too late. His latest book
Posted by James | 0 Comments
Filed under: ,

I am NOT a stalker.

Yesterday, I as was stepping out of Penn Station on my way to work, I noticed that the woman walking a few steps ahead of me appeared, from the rear at least, rather pretty. And as we started to walk up 8th Avenue, it seemed that our routes to work overlapped,
Posted by James | 1 Comments
Filed under: ,

Get an ApplicationBarIconButton by name (Redux)

Yesterday, I read a blog post on getting an ApplicationBarIconButton by name . The author made a couple minor errors in the code, which I was going to leave a comment about, except his comment page is broken. So, another excuse to write something for

Creating an Entity Framework connection from another one.

Database connection strings used to be simple. Well, simple, once you learned the arcane syntax, But, at least they had stayed the same for about a decade. But with the EntityFramework, they took on an even more arcane “connection string – within –a –connection

And Now For Some Politics… What If John McCain Had Been Elected?

Ok, after three technical articles in a week, it’s about time to branch out a bit, and talk a bit of politics. Over at AssociatedContent, which is apparently part of the “Yahoo! Contributor Network”, they seem to let just about any yahoo sign up as a
Posted by James | 0 Comments
Filed under:

Automating Retry on Exception

Every so often, you run across some action, which just fails, where the best response it to just try it again. This is particularly true when dealing with an external source, like a database or web service, which can have network or other temporary problems,
Posted by James | 0 Comments
Filed under: , , , , ,

The Evolutionary Guide to C# Lambda Syntax

Originally (.NET V1.1), we had to explicitly create a Delegate object to wrap a method reference to use it as a callback method, and that method had to named. button1.Click += new EventHandler(button1_Click); // : // : void button1_Click( object sender,
Posted by James | 2 Comments
Filed under: , , , , ,

Running An Async Event Handler on the UI thread (with lambdas and extension methods!)

So, it’s been a freakishly long time since my last post here. I’ve been trying to get better… I even wrote out a list of topics I wanted to write about. So, let’s start talking about them. As we do more and more work in our applications asynchronously,
Posted by James | 0 Comments
Filed under: , , , , ,

Naked Came The Null Delegate : Chapter 1 – “I, Disposable !”

Slowly, as the rest of his coworkers drift off towards home, Seymour Sharpton, continued on in his cubical. He didn't mind. He was trying to look busy, but was really just writing on his Facebook wall. As the hours ticked by, he knew you'd soon be able
Posted by James | 4 Comments
Filed under: ,

Lambda Expressions as Properties

Peter recently caused a bit of a stir with his article “ Sometimes an enum is not the best idea ”. In it, he had a very specific problem: When an enum is passed to a method as an Object, and that method converts it to a usable value by calling ToString(),
Posted by James | 6 Comments
Filed under: , , , , ,

Portable Areas for Castle Monorail, Part 2

In our last episode, we discussed the PortableAreaController base class, which makes it simple to create a portable area using Monorail. In this installment, we put that class to use. For the purposes of this example, the controller isn’t going to do
Posted by James | 1 Comments

Portable Areas for Castle Monorail

Recently I had read a blogger comparing Castle Monorail with ASP.NET MVC. He chose ASP.NET mainly because it supported Portable Areas while Monorail did not. As a supporter of Monorail, I was very offended by this, and decided to correct the problem.
Posted by James | 1 Comments

Some Better-Written Custom String Methods using C#

In my daily web-surfing, I often stumble upon snippets of C# code posted by people. Usually, I can tweak it a bit. Sometimes, I can tweak it a lot. I usually post a quick comment to the site offering it. Today, I came upon some code that was so bad ---
Posted by James | 2 Comments
Filed under: , , , , ,

A ViewComponent extension for Castle MonoRail, Part II

This was intended to be a two-part article. It was just after I published the original article, I noticed that I’d left out a large part of ViewComponentEx. We continue….. protected bool RenderOptionalSection(string section) protected bool RenderOptionalSection(string
Posted by James | 0 Comments

A ViewComponent extension for Castle MonoRail

I’ve been rewriting my website, njtheater.com, (very slowly) as a Castle MonoRail application. Along the way, I’ve written a number of ViewComponent and other elements. Many of these were of general use, so I’ve added them to the CastleContib project,
Posted by James | 1 Comments

#songsincode : The Turtle’s “Happy Together”

(Me + you) && (you + me) var nomatter = dice.toss(); assert (it != null) me.Only1(you); assert(you == me.Only1()); (Me + you).happy = so; (more on the meme here ) Share this post: Email it! | bookmark it! | digg it! | reddit! Readability Stats:
Posted by James | 0 Comments

Code Tune-Up: Shuffling a List

Over on CodeProject, I spotted an article by Mahdi Yousefi called " Creating an ASP.NET captcha using jQuery and s3capcha”. public static List<int> shuffle(List<int> input) { List<int> output = new List<int>(); Random rnd = new
Posted by James | 0 Comments
Filed under: , , , , ,

A (somewhat) New jQuery plug-in: Wizard

As I slowly rewrite NJTheater.com, one task that I was trying to move from a MSAccess application to a webpage would be made much easier if put in a wizard form, with the user being led through the steps. Since I was using jQuery throughout the site,
Posted by James | 1 Comments
Filed under: , ,

Posts from Comments: QuickDataBind

You may have noticed that I don’t write on this blog much. But the thing is I do write a lot on the inter-webs about technical matters --- I just don’t to it here. Usually, I find something interesting on someone else’s blog, and then write an improvement
Posted by James | 0 Comments
Filed under: , , , , ,

Washington vs. Hollywood.

With the pending appointment of Judge Sonia Sotomayor, someone pointed out that if she is approved, there will have been in 120 years, 111 Supreme Court Justices, of whom, only three were women and only two were African American, with all the rest being
Posted by James | 0 Comments

Men & Women & Careers in IT.

(Ok, this is the third time I'm writing this. The first time it was in the comment form of a blog. For some reason, it just swallowed the message without posting it, blanking the editbox, and then giving an error saying the edit box was empty. So, I tried
Posted by James | 11 Comments

Sex & Computers & Rock & Roll : The Cycle of Creativity

Ok, there is actually no sex in this article. The title is merely a tribute to the great Ian Dury & the Blockheads. But there will be computers and Rock'n'Roll. Recently a question of StackoverFlow.com asked about "breaking the rules" of programming.
Posted by James | 1 Comments

Predicted

Way back into March, my best friend Chris and I made our predictions for the presidential election . Since the election is now over (mostly), it's time to review have well we did: Chris's Prediction James's Prediction Actual results President McCain The
Posted by James | 0 Comments

jQuery.growl Documentation

Right now, I'm in the midst of a long-running project to rewrite my other website, NJTheater.com (beta at njtheater.org ). In the process, I've discovered jQuery, the hot new javascript library that all the kids are using today. One of it's key selling
Posted by James | 6 Comments

Fun Fact: To the Moon, Alice, to the Moon!

I really should bring the subject matter here back around to computers..... Lately (if you consider the last year & a half "lately"), I've been working on a project on my laptop using VisualStudio (usually on the train to work). Every now & then
Posted by James | 0 Comments

Yep, I'm a socialist....

I haven't posted here in a while, so I figure I'll go back to the old "generate content by taking online quizzes" trick. You are a Social Liberal (66% permissive) and an... Economic Liberal (20% permissive) You are best described as a: Socialist Link:
Posted by James | 0 Comments

Contribute to open source, get a shot at a free book

David Ward has an interesting contest . Having three copies of Advanced ASP.NET AJAX Server Controls to give away, he's created a project on CodePlex , and is offering the books to people to who contribute the most to it. One can contribute code or documentation
Posted by James | 0 Comments

Billions & Billions

Recently I got a chain email from a friend, showing the magnitude of a billion. A billion seconds ago it was 1959. A billion minutes ago Jesus was alive. A billion hours ago our ancestors were living in the Stone Age. A billion days ago no-one walked
Posted by James | 0 Comments

Lists: Filter, Map and Reduce - and the Magic of IEnumerator.

I have this bad habit. I will frequently stumble upon a blog post describing some new technique, to which I will post a brilliant comment offering an improvement, which, of course, will get lost in the flotsam and jetsam of the blogosphere. I have to
Posted by James | 1 Comments

Dev102's Challenge #13 : Brackets

Many people skipped last week's challenge (like I had planned to). As it turned out, I was the only blogger to responded. For this week's challenge, they've gone back to a platform-neutral algorithm question: Your input is a string which is composed from
Posted by James | 2 Comments

Dev102's Challenge #12 : Managed & unmanaged

My solution(s) for last week's challenge were cited, but, only as an "honorable mention" / "also run". This week's challenge is a different sort of animal. Not that it is particularly difficult --- actually I suspect it's quite easy --- it's just that
Posted by James | 1 Comments

Dev102's Challenge #11 - Summing Numbers

My answer was acknowledged as correct for last week's challenge. So, let's see if we can make it two in a row. This week : Given a list of n integers and another integer called m, determine (true / false) if there exist 2 numbers in that list which sum
Posted by James | 1 Comments

Dev102's Challenge #10 - The Missing Number

I didn't actually skip last week's challenge for Dev102. I did write up a solution. I just forgot to post it. It was wrong anyway. Well, no sense it looking backward... This week's : Your input is an unsorted list of n numbers ranging from 1 to n+1, all
Posted by James | 1 Comments

DEV102's Programming Job Interview Challenge #8

I skipped last week's DEV102 challenge . I didn't think my answer was right. Turns out that it was. I was assuming that it had a limitation that would disqualify it. I assumed that my solution would only work if you placed the coins in a tight grid with
Posted by James | 1 Comments

DEV102's Programming Job Interview Challenge #6

Another week, another C# interview question from the good folk's at Dev102.com -- Although I use the term "good folks" advisedly, as this week they did not even acknowledge the solution I posted for last weeks puzzle (which was both correct, and, I believe,
Posted by James | 0 Comments
Filed under: , , , ,

DEV102's Programming Job Interview Challenge #5

DEV102 announced the correct responses to last weeks challenge today. Since I announced in my blog I got a prominent spot in their post, which is good considering I was one of about 10,000 correct answers and I gave it rather late in the process. Hopefully,
Posted by James | 0 Comments

DEV102's Programming Job Interview Challenge #4

The folks at Dev102.com are offering weekly programming challenges, where they offer questions, and let bloggers post about them. I meant to write an answer for last week, but never got around to it. Just as well -- my answer would have been wrong. SO,
Posted by James | 1 Comments
Filed under: , , , , ,

The Need for Common Search Keywords.

if you ever tried to Google something like "how to write a linked list in C#" you may have noticed a problem. Most search engines have trouble dealing with the pound sign (hash/number sign/octothorpe). You run into the same problem search for information
Posted by James | 1 Comments

How can I easily log a message to a file for debugging purposes?

Today, either Bloglines.com or blogs.MSDN.com blinked, and suddenly I'm seeing old entries on the 'C# Frequently Asked Questions' blog as new. No one has posted anything there in over two years. Anyway, reading the most recent message, it offered a method
Posted by James | 0 Comments
Filed under: , , , ,

Predictions

My friend Chris is, like me, a staunch Democratic. Unlike me, he's also an incredible pessimist. In 2006, he made what he called his "optimistic" prediction for the midterm election: The democrats would gain 3 Senate seat, 10 house seats, and 3 governorships.
Posted by James | 2 Comments

Joins - LINQ's critical, overlooked feature.

As i was planning my rewrite of NJTheater.com I looked at a couple different Object-Relationship Mappers (mostly code generators which examined a database schema and produced one class per table to read and write rows to it. All seemed particularly lacking
Posted by James | 1 Comments

My Second CodePlex Project : State Theater

Well, as I promised months ago, I've created my second CodePlex project. Actually, I created months ago, while this site was down (as the artist I am, I think I'll refer to that as it's "black period"), But now that I'm back, I guess it's time to make
Posted by James | 0 Comments
More Posts Next page »