Posts

Showing posts from February, 2007

OpenID Prime Time Redux, now with Microsoft!

"We don't all agree on everything. I don't agree with myself on everything..." -- Rudy Giuliani Not too long ago I opined about whether OpenID was really ready for Prime Time A Short while ago, Microsoft announced a deal with JanRain, VeriSign and Sxip to develop integration between Microsoft CardSpace and the open source OpenID project. In addition, the partners announced that Microsoft would be bringing its anti-phishing technology to the OpenId platform - important, because any time you have an open-source, open-standards Single Sign On infrastructure, you are going to attract the dastardly hackers that attempt to abuse it. I believe that these are new technologies that will have a significant impact on the future of the Internet, identity and single-sign-on (SSO) as we know them. OpenID is an open, decentralized, free framework for user-centric digital identity. It attempts to solve the problem of Web single sign-on - something that Microsoft attempted at first

Dynamically Loading an Image from an External Assembly

This one came up recently in the C# newsgroup, so I thought I'd take a quick crack at it: private void button1_Click(object sender, EventArgs e) { Assembly asm = Assembly.LoadFrom(System.Environment.CurrentDirectory + @"\AssemblyResources.dll"); Stream strm = asm.GetManifestResourceStream((string)asm.GetManifestResourceNames()[0]); Bitmap b = (Bitmap)Image.FromStream(strm); pictureBox1.Image = b; } What you are doing is: 1) Assuming the "external" assembly is a managed assembly, and it's name is "AssemblyResources.dll", and it resides next to the executable (for ASP.NET you would have to use Server.MapPath or some combination of Request.PhysicalApplicationPath, or the like). We load the assembly into the AppDomain using the LoadFrom method. 2)We extract the resource into a stream using the GetManifestResourceStream method. 3) To make it easier to know the exact names of resources (which can be tricky) I use the GetManifestResourceNames method, whic

Microsoft Junking GotDotNet.com site

According to the site: "We are phasing out GotDotNet for the following reasons: Microsoft wants to eliminate redundant functionality between GotDotNet and other community resources provided by Microsoft Traffic and usage of GotDotNet features has significantly decreased over the last six months Microsoft wants to reinvest the resources currently used for GotDotNet in new and better community features for our customersPhase Out ScheduleThe GotDotNet phase out will be carried out in phases according the following timetable: (etc, etc)" Basically what we are saying here folks, is "We don't think there's enough interest in this site, and we think we have other resources that are better, so take it or leave it". Well! Sez who? I've got samples up there that have been downloaded OVER 47,000 times, and I myself have downloaded sample code contributed by others probably a hundred times or more. Yes, I know you've got Codeplex.com. It's very nice - but it

SQL Server: "Don't Reinvent the Wheel" Department

In your travels as a professional software developer, especially when you come into a new position and need to get used to a new enterprise and its programming - related environment - the tools, the programming style, the existing codebase, etc. you get to observe some of the repetitive coding patterns that people resort to in order to solve their problems. One of the most common ones I've observed is where developers do not have a full understanding of how ADO.NET and connection pooling work. It seems almost like instead of seeking out and using best-practices code and techniques, that some people, either through lack of knowledge or just plain being stubborn, feel compelled to "roll their own" DAL and Database layers. Mistakes and poor design often result. Back around 2001, I found the Microsoft Data Access Application Block ("SqlHelper") class, which quickly solved a whole bunch of data access problems for me, and in fact I still use it today - 5 years later

Meet Jack Murtha: Official Saboteur of US peace efforts in Iraq (and parallels to programming)

Since last December, Mr. Murtha has become the hero of the antiwar crowd, and, as we've seen with other such individuals, scrutinizing their behavior is considered disrespectful. Few might recall (since many aren't even old enough to remember) that after the massive 1980 Abscam scandal, Mr. Murtha was named by the FBI as an unindicted co-conspirator. Sez Murtha, "Once we get out of there, it will be more stable in Iraq." Oh, Really? Jack Murtha is an idiot. If he has his way and we get out of there, even many left-wing Democrats agree that all hell will break loose, and we will be in much more danger - not only from Al Queda, but from Iran and other destabilizing influences, than we are now. Newt Gingrich: "It's conceivable that Murtha woke up one day a year ago and said, 'You know, if I don't start bashing America, and bashing the military, and repudiating everything I've stood for my whole life, these guys aren't going to allow me to be chai

FIX: Flash on Windows Vista

Lots of people (me included) have been complaining that Flash (such as for viewing videos on Youtube.com) doesn't work. You go and install Flash again (as prompted) and when you go back to view the video it's like you haven't done anything -- no Flash. Here's the fix: Navigate to C:\Windows\System32\Macromed\Flash Then right-click over both 'Flash9b.ocx' and 'FlashUtil9b.exe', and choose Properties. In Properties choose the "Security" tab. Click on the "Everyone" account (or add it if it isn't there), and the button called "Edit" and then check the box called "Full Control", click "Apply" and do the same with your own Windows local account name. Once you have done this for both files, run the FlashUtil9b.exe and it should install and update and tell you to restart. Do so and you should now find that YouTube and other sites that use Flash now work.

YEESH! FORGET DATAREADERS!

I see so much of this on forums and newsgroups, I almost feel compelled to say "something". It seems that somewhere along the way new .NET developers read (or are told) that the DataReader is the "most efficient way" to get data out of a database. What happens next is they take this 100% literally, and get themselves into all kinds of trouble - blowing up connection pools, trying to do things that you cannot do, and so on. This becomes the idee fixe de-facto method for getting data, no matter what. Yes! The DataReader IS the fastest way to get data out of a database. However, that comes with a price that you need to evaluate. DataReaders hold the connection open. You cannot have a method that just "returns a DataReader" - leaving you to blithely do whatever you want -- unless CommandBehavior.CloseConnection was used in the intial SQL call and you are prepared to call the Close method on your reader. In addition, DataReaders offer only ONE TIME firehose-st

FIREFOX / IE Word-Wrap, Word-Break, TABLES FIX

One of the most annoying things a developer (who would normally delight in writing code, not futzing with markup) can have is getting rendering issues between different browsers. The two biggest players are of course Internet Exploder and Firefart (as I lovingly like to refer to each). In most cases that's going to take care of 98 percent of your total site traffic. IE has had a proprietary "word-break" style attribute for a long time, and this made it into the CSS 3.0 spec. But that doesn't necessarily help you with Firefox right now. Firefox literally - (and I consider this completely idiotic, since it's been in their bug database for FIVE YEARS) does not have a reliable CSS style element to force table cell content to break in the middle of a word in order to stop the content from expanding your table / div off the page or over other content on the page. Here's a partial fix, which will work for most tables and browsers. The style declaration (I call it m

XAML, Expression Blend, and WPF

Microsoft is apparently moving forward as fast as it can with the integrated "next gen" tools like Expression Blend that are XAML - compliant. XAML has a lot of promise, expecially because of it's high level of adaptability to animation, Windows Forms - like controls, play stuff in the browser, and so on. I do a lot of work with Maya on the side. Mostly, I take my digital photographic work and do "digital photo collage" by overlaying photos as the material attributes of various shapes, often 3D replicated with MEL scripting, setting raytracing, refraction, reflection, lighting and other features then doing a master render to a large TIFF file (sometimes 65MB). I have a friend who runs a studio here in Deland, FL and he has an expensive giclée printer , so he can put these out on large - format prints on expensive paper for me (that is, the "good ones", 'cause this can cost $100 a print -- here is a link to a small size one ). At any rate, Thomas

Did Chuck Norris Kill SOA?

It's fun to get a handle on what people are interested in on the web. At my ittyurl.net site , I have a ticker that shows the most popular internet searches for the day,constantly refreshed, and when you click on one, it takes you to the search results for that on my search page -- on site. This is extremely interesting to me because it not only keeps "counts" of the most popular (and recent) searches for everyone to see, it also increments the count every time somebody clicks on one of the searches that are already there. So you get kind of a mixed bag - what people are searching for on the web in general, plus what of my current list of top searches are getting "re-clicked". Here's a sample of a recent top 20: Saddam Hussein runescape fergie aishwarya rai ufc ciara wwe limewire grey's anatomy cross-page postback hi-5 nfl draft britney spears web.config james brown System.EnterpriseServices ASP.NET app beyonce knowles new years revolut

SQLite, ADO.NET, Prepared Statements, Transactions and Enterprise Manager

Anybody who has read some of my "stuff" (particularly, articles at eggheadcafe.com) will know that I am a big aficionado of the SQLite database engine. Open source and Free, extreme portability, blazing speed, no installation, and many other features make this a really competitive solution for almost any project except the largest databases. I don't usually recommend software and add-ons, but recently I came across the SQLITE PRO Enterprise Manager . NOTE: The above link is dead, apparently the guy gave up his domain. I'm posting the below link which is to the 3.61MB download of my original free version on my SkyDrive public folder. Now this is the equivalent of Enterprise Manager for SQLite 3 databases, and it is slick. Import and Export from Access or even SQL Server and the guy even put in a little "blob viewer" so you can look at pictures you've stored in your tables. Oh, and did I mention the price? It's free. Another issue with SQLite that com

FREE LINKS (as in "free beer")

"The significant problems we face cannot be solved by the same level of thinking that created them." -- Einstein Yep. Review my UnBlog and get a free link! Increase your website or blog's PageRank (and ours) by building backlinks. The rules are simple: 1) Write up a review about Peter Bromberg's UnBlog (at least 200 words) containing a link to BOTH my main page and this page , and post it on your blog or website. You can say whatever you want. I hope it's something nice, but it doesn't have to be. 2) Email me a link to your review once it is up (remove the ".nospam" from the email address). 3) I will respond by adding a link to your review (and of course, to your site or blog) on my links post, which will appear as an entry on the sidebar of every page of this UnBlog , as soon as I have a few links to list. Oh - and, I probably don't need to say this, but I will: If you've got offbase content, adult or offensive material, I reserve the rig

D00D! Wake Up, .NET WCF is HERE, man!

Image
"There used to be a real me, but I had it surgically removed" -- Peter Sellers I confess I must have either been asleep at the switch, or Microsoft is just throwing so many CTP's and BETAs at us poor slobs that I got sensory overload. At any rate, WCF is here. They actually released it last November, according to Clemens Vasters , last Nov 8th - and its pre-baked into Windows Vista - all this under the moniker of ".NET Framework 3.0". Even some hosting ISP's have already installed it for their customers. OK, so what is WCF (Windows Communications Foundation) and why should I care, right? Let me try to provide a short, meaningful explanation: Do you think it would be useful to you as a programmer if they took ASP.NET Web Services, Web Service Enhancements, .NET Remoting, Enterprise Services, and System.Messaging, and rolled them all into this new integrated architecture, programming model, and runtime environment and provided a more productive SOA developmen

Stateless Web, ASP.NET and AJAX

One of the most common things in the universe, (besides hydrogen and bureaucrats) is the inability of the uninitiated ASP.NET developer to understand the stateless nature of how HTTP works. This is true not only for ASP.NET, but also for classic scripting platforms such as ASP and PHP. I say this because we at eggheadcafe.com get lots of forum posts that revolve around this subject. Sometimes they center around attempts to write to the filesystem at the browser from server-side code (which is long gone), other times they question how to tell if somebody has closed their browser, and many other variations in between. But the common theme is a misunderstanding of just how disconnected the server and the browser really are in a web application. This disconnectedness and State are the two central issues that web developers face, and are the basis of the evolution of web applications to include IFRAMES, javascript callbacks, the XMLHTTP object, and finally, Remote Scripting ("AJAX&q

IE7 - Vista: "Internet Explorer has stopped Working"

Image
This one was a bitch. All of a sudden for no reason at all, out of the blue, I get this dialog "internet Explorer has stopped working". I didn't install any new software, crap- I didn't do anything! So here I am using FIREFART to go on the internet and find out what to do! Damn! Good thing I've got the sucker on the same machine (I'm not "anti-Firefox", i just don't use it that much except to check my page renderings). The Fix The fix (at least for me): 1) Go into Control Panel, and choose "Internet Options". 2) Under the "Advanced" tab, press the "RESET" button at the lower right: Don't ask me why this happens, or why the fix works. That's a BUG, D00D - I don't care how you slice it!

Boston Mooninite Hoax Device for Sale on EBay

Image
Christopher Budnick, a third-year student at Northeastern University and a member of the Harvard and Northeastern Free Culture student activist group, managed to retrieve one of the recent Turner Broadcasting Cartoon Network promo devices about 2 hours after the public bomb scare -- well ahead of the ATF. Somebody on Wired News got a hold of him, and the following snippet illustrates: "What do you think of the entire panic these caused? Do you think Beredovsky should be held criminally responsible?" "I think it's pretty indicative of the mad culture we live within right now. If we were even lucky enough to be targeted by a mad bomber with the foresight to clearly illuminate, mark, and make public his explosives, homeland security still would have only found 10 of them within the first hour." --The guy wants to help fund a local artist alliance with part of the proceeds, after paying off his student loans. Nice kid, and smart too. We live in an altered state a

Interfaces, Abstract Classes, and Inversion of Dependency

In Framework Design Guidelines (Cwalina and Abrams, Addison-Wesley), the authors have a section in Chapter Four entitled "Choosing Between Class and Interface" that is very revealing about the "behind the scenes" goings on during the development of the .NET Framework. They say that in general, classes are the preferred construct for exposing abstractions, the logical basis of this being that once you ship an interface, the set of members is baked forever - any additions would break existing types that implement the interface. Classes are much more flexible - you can add members to classes that have already shipped, and as long as the method has a default implementation, existing derived classes continue to function undisturbed. They provide an example (although not a very good one) of how difficult it would be to add timeout support for streams. All of the options have substantial development cost and usability issues. It seems that one of the primary arguments for