Posts

Showing posts from January, 2006

What's the World Coming to with Web Ads?

I just read here about how Google is going to add those absolutely nasty interstitials, expanding and floating ads to its Adsense portfolio. Good God! I avoid any site that has this crap like the plague! How could they possibly expect people to put up with this utter crap and even stay on their site, much less click on one of these doozies! The quote: "Floating ads are ads that either stay on top as the page is scrolled, or ones that "float in" from the side of the page to the center of the page. Expanding ads are those that require user interaction to expand, either with a mouseover or a click. Interstitials are perhaps the most interesting addition to this rich media beta, because they are a format that people love to hate, and that are often more annoying than pop-ups. You have likely stumbled across an interstitial ad - they appear when you click through to read a page, and before they will show you the page, you are bypassed through to a full page ad that you mus

WebService? XML? SOAP? REST? What?

Look! Up in the sky! Is it a bird? Is it a plane? No! It's XML! Er, no -- its SOAP! No, scratch that - its --- its --- well, dang-it! Its Something, ain't it? Interesting because what with all the so-called web "API's" put out by everybody and their little brother these days, its getting harder and harder to figure out what you are dealing with. if it's XML, did it come from a WebService? or is it just a resultset in XML format? Who the hell knows, right? Yahoo's new Web Search API's get called with REST - and return either RSS or some sort of XML resultset. There's XSD schemas for those, but no SOAP -- yikes! This all became even more clear this evening when I was answering a post on the C# MS Newsgroup about how to deal with something that was obviously an XML Document representing a "result" object, but with no SOAP wrapper. The poster was asking essentially, "what's the best way to deal with this?". Not long after,

Hot enough for ya?

Not long ago I wrote an entry about global warming and energy in the wake of rapidly rising oil prices. According to NASA, last year was the warmest recorded on Earth's surface, and all five of the hottest years since modern record-keeping began in the 1890s occurred within the last decade. A spokesman indicated that it was "fair to say that it's the warmest in the last several thousand years." Over the past 30 years, Earth has warmed by 1.08 degrees F, NASA said. Over the past 100 years, it has warmed by 1.44 degrees F. Most scientists attribute the rise to emissions of greenhouse gases such as carbon dioxide, methane and ozone, with the burning of fossil fuels being the primary source. The 21st century could see global temperature increases of 6 to 10 degrees F, which will bring us up to the warmest temperatures the world has experienced probably in the last million years . Yet, we continue to consume ever-increasing amounts of oil and coal, the byproducts of w

SharpDevelop Comin' At Ya, newsgroup spellers and Sparkle!

Mike Krueger (developer of Sharp ZipLib) and his crew have been working hard on SharpDevelop 2.0, the open-source IDE for .NET 2.0, and it looks really nice. The Beta 1 is quite feature - complete, and VIsual Studio.NET developers will find it very familiar to work with. I just checked it out because one of our messageboard posters was complaining that C# Express has no project template for a Windows Service. Well, SharpDevelop does! And that's not all: it has a IL project template if you are interested in getting close to the metal with working breakpoints and a lot more! If you would like to read up more about the features, here's a good recent review . >>>> Snag yourself a copy at Sourceforge.net <<<< NewsGroup Spellers I don't know about you, but I've been frequenting the MS C# language group and also the ASP.NET group. Most of the people in the C# group seem to be able to spell. However, a sizeable number of the posters at the ASP.NET group

Value Types, Reference Types, and writing with clarity!

Recently I served as a technical review editor for a book on C# and .NET. Among other issues, I noticed that the explanation "bullet points" describing "pass by value" and "pass by reference" semantics were not only unclear, they appeared to contradict each other. Quite annoyed, I wrote up a particularly scathing review comment and the authors took my advice (plus, I hope similar advice from other tech reviewers). Unfortunately, when I read the section in the final published copy of the book, I suspect the authors may have jumped from the frying pan into the fire - they added more content , which instead of clarifying the issue and the major points, served to muck it up even more, in my opinion. A clear and unequivocal understanding of value types vs reference types in .NET is of the utmost importance. Therefore, I present my own attempt. Einstein said that a theory should be as simple as possible, but no simpler. With that in mind (and to their credit

Iran plans Holocaust Conference?

Ok, we all know this dood is downright dangerous . But, people need to understand how "holocausts" happen. They don't happen because the German people, or the Japanese people are "evil" in some way. They happen because, usually during bad times, some psychotic power-hungry maniac is able to get into a position of power and is allowed to do his thing unchecked. It's the psychology of crowd madness. It's happened scores of times in recorded history. The people are mesmerized by these evildoers, and they follow. And oftentimes, the rest of the world is apathetic, wants to stay out of the way, or just plain doesn't understand the risk of letting them go unchecked. OK? So now, friends, you are staring a brand new one of these right in the face. I mean, for real, right now, not a game, not a sound bite! A real Hitler, a real Osama Bin Laden. You are watching him on TV, he's out in the open. And, he's both NUTS and DANGEROUS, as in "NUCLEA

Enumerating WindowsIdentity Roles with Reflection

Windows Identity has some properties, but you must use reflection to enumerate the private GetRoles() method: namespace CurrentUser {     using System;     using System.ComponentModel;     using System.Reflection;     using System.Security.Principal;     using System.Windows.Forms;       public class Form1 : Form     {         private TextBox textBox1;         private Container components = null ;           public Form1()         {             InitializeComponent();         }           protected override void Dispose( bool disposing)         {             if (disposing)             {                 if (components != null )                 {                     components.Dispose();                 }             }             base .Dispose(disposing);         }           #region Windows Form Designer generated code           private void InitializeComponent()         {             this .textBox1 = new System.Windows.Forms.TextBox();             this .SuspendLayout(

Activator.CreateInstance Pattern with Interface

This has come up several times already in newsgroup and forum posts, so I thought I would post my "keep it smple" implementation here. What we want to do is be able to load an assembly dynamically, create an instance of a named class, and call a method with parameters. The information we need to do this probably comes out of a database. First, I start with an interface: public interface IMessage { NameValueCollection Parameters { get; set; } DateTime DateTimeCreated { get; set; } bool Success { get; set; } Exception OperationException { get; set; } IMessage Execute(YourClassToProcess yourClass); } The IMessage interface defines a NameValueCollection (which name-values could also be coming out of associated rows in another database table), a bool for Success, and an Exception object. By simply populating a NameValue Collection with our parameter names and values, and assigning this to the IMessage Parameters field, the internal implementation can ge

"There's a BUG in ...." vs User Stupidity and Blanket Statements about .NET

I"ve been doing this .NET thing since they gave out the first BETA at PDC in Orlando 2000. That's nearly FIVE years of toil and learning with the .NET platform. And I mean toil, because early on I had the good sense to completely give up on Visual Basic and go almost 100% with C#. Boy! That was a GOOD decision. And one thing I've learned well, especially from my own mistakes and all the newsgroup and forum posts I've read and answered: If you think you found a "BUG" in .NET, think again, because 99% of the time it's just USER STUPIDITY (and sometimes even arrogance!) that is the real problem. There are plenty of things you can do wrong that will make it "look like" .NET is fubar, and almost without exception, it was YOU, the developer. That's not to say there aren't any bugs - of course there are. But most developers never even run into them. It's very easy, for example, to write a stored procedure that attempts to access a table

Hacker History and You! and Target

Image
Wikipedia's Timeline of Hacker History is an amusing if not frightening look into the psychology of how technology has been - and will be -- misused over the last 35 years or so and into the future. The original meaning of the word "hack" was born at MIT, and originally meant an elegant, witty or inspired way of doing almost anything. Many early hacks took the form of elaborate practical jokes. In 1994, MIT students put a convincing replica of a campus police car on top of the Institute's Great Dome. Of course, there is a lot of notable stuff missing from this piece; in the 1870s, several teenagers were evicted from the country's brand new phone system by enraged authorities. However, it presents a keyhole look from the Universe into the mind of the Hacker. In 1998, an anti-hacker ad ran during Super Bowl XXXII. The Network Associates ad, costing $1.3-million for 30 seconds, showed two Russian missile silo crewmen worrying that a computer order to launch missiles

How to determine if a running ASP.NET App was compiled in Debug or Release Mode?

Recently there was a dotnet.framework.aspnet newsgroup post on this subject. I answered it, but my answer wasn't complete. Here is a short example of how you can definitively tell - AT RUNTIME - if the assembly was built in Debug or Release mode: // in AssemblyInfo.cs: #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif private string buildMode=String.Empty; private void Page_Load(object sender, System.EventArgs e) { Assembly asm = Assembly.GetExecutingAssembly(); object[] objArray=asm.GetCustomAttributes(false) ; foreach (object obj in objArray) { AssemblyConfigurationAttribute conf = obj as AssemblyConfigurationAttribute; if (conf != null) this.buildMode=conf.Configuration ; } Response.Write("Build Mode: " +this.buildMode); } On a lighter note, you just gotta weep to see this on Microsoft's security pages : A Parent's Primer to Computer Slang . --- w00t?

Default ASP.NET Web Administration with SQL Server 2005, and a PreserveProperty Control

The ASP.NET 2.0 machine configuration has a pre-defined connection string for providers which points to the default SQLExpress Edition configuration that ships with Visual Studio 2005. As a result, if you never installed the Express edition and use SQL Server 2005, it won't work. To get the expected 'out-of-the-box' functionality of the Web Site Administration Tool , you can change the machine.config. Here's an example from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config: original: <runtime/> <connectionStrings> <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=DataDirectoryaspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/> </connectionStrings> Adjusted: <runtime/> <connectionStrings> <add name="LocalSqlServer" connectionString="data source=.\YOURSQL2005;Initial Catalog=aspnetdb;Integra

Requiring a login just to read your content?

One of my little pet peeves is how some developer - oriented sites require you to log in in order to read their content, even though they appear to have taken pains to enable Google and MSN et al to index it. Is this piss-poor, or what? I've practically memorized these sites already and when I am searching for something and I see a link to one of these sites, I don't even bother to click on it anymore. These folks are advertising - supported too, and apparently they just haven't "got it"! Apparently they are happier shooting themselves in the foot than making advertising revenue from quality search-engine driven traffic! Then there are the blokes who make you log in in order to download their "precious resources" (zip files of code, usually). What a bunch of HORSESHIT! People don't deep-link to other sites' downloads, they link to the articles! Now, if you have a messageboard, sure I can see the validity of requiring a login so that you can trac