Thursday, October 30, 2008

Interesting...

For me, blogging is a fun diversion. I do track my stats, respond to comments, and post often. I wouldn't call my blog any where near a "professional" blog. If it was, I'd spell check and read things thrice before posting, get a real code poster, and put more effort into posting items that tend to get the most hits. I would also keep my politics to myself, as most coders (the majority of my hits) aren't interested in what I have to say, and probably not politics in general.

So in the history of my blog, I've only ever got one negative comment before today, and that is when I hot linked to some one's image. They didn't like it, I delinked, and everybody was good. Interestingly though, now that I put my "friends don't let friend's vote democratic" link up, I've gotten a few more negative post, not about politics, but about technical stuff. I think it is "pay back" for my obvious political stances.

Just an interesting observation on human psychology.

Well, the anti-democratic side bar stays up till after the election. Not that this is an endorsement for McCain, but I just can't see giving the democratic party another chance at electing activist judges, not funding our military, further ruining the schools, limiting free speech, letting 80k abortions a year happen, redefine marriage, etc... Sorry, can't do it, no matter how much I'm at odds with the repubs some times. I even worked for the repubs in college but I saw their version of corruption first hand so I quit.

So a lot of people want change, and again I'm not saying the repubs are the answer, just that the dems aren't. Change might come, but be careful what you wish for.

Wednesday, October 29, 2008

The Shape of Things To Come?

A lot of us have heard about RIA's (Rich Internet Applications). They are the way of the future, though even with broad band speeds I think the responsiveness of RIAs needs to be as snappy as desktop applications for RIAs to really take off. They are getting close.

We now have Silverlight, Flash/Flex, and improvements in Javascript/Javascript Frameworks to make things start to happen. Many visionaries have invested a lot of time in Flash/Flex/Actionscript because they see this as the way of the future. Here is one minor example or a RIA that just came online.

http://www.windowshop.com/ (Amazon run shopping site that uses Flex I believe).

Another trend is the blending between the desktop and the web. Adobe Air is an example, and now Yahoo has come out with their own plaform.

http://browserplus.yahoo.com/

Grrr...I swore off yahoo 'cause they pissed me off, but I guess I will have to check it out.

Some even argue that RIAs are Web 2.0, and that Web 3.0 will be the "game web" (virtual reality, game like interfaces, big use of 3D, increased responsiveness). This is where I'd like to be developing, but just like VRML in the 90ies (which still lives, kinda) user acceptance of this type of stuff isn't quiet there yet, and probably won't be for a long time. Too bad, because developing these technologies could be actually easier. Hacking out websites using a combination of HTML/JavaScript/Server Script/Action Script etc... tend to be complex and take a lot of time. Gametech, though complex, could produce through competition some really good Web 3.0 tools. There are some great start ups working on this (I can't for the life of me right now remember my favorite one, which right now is Mac only on the dev side, I was going to post a link to it), so I keep watching and hoping.

Monday, October 27, 2008

First Known Glow Cat Created

Scientist created a glow in the dark cat.

http://today.msnbc.msn.com/id/27338236/?GT1=3001

soapUI: Nice Web Service Testing Tool

In my saga of abandoning WCF and regressing back to an ASMX web service for a current project I had a very knowledgable web service person from a telecommunications company send me an invaluable tool for testing webservices.

http://www.soapui.org/

The cool thing is you can mock web service request, or even send soap request to a webservice through soapUI. The tool has a gazillion features that I haven't even scrated the surface of yet.

I highly recommend it. At first you will open it up, be a little bummed that it is written in JAVA, and you will come to an inteface without knowing really how to proceed. Download a WSDL from a web service and save it, then in soapUI create a new WSDL project and load your local version of the WSDL. You will see how valuable the tool can be.

There is a Pro version with more features, though I haven't checked that out.

SAC is Back, Kind Of

The Air Force is establishing a new nuclear strike command.

http://www.spacewar.com/reports/US_air_force_to_establish
_new_command_for_nuclear_forces_999.html

Saturday, October 25, 2008

Friday, October 24, 2008

Great Game Demographic Site

I stumbled upon the daedalus project today -

http://www.nickyee.com/daedalus/

There is an RSS feed, and there is some pretty interesting data. I hope Nick continues to add more.

Stored Procs vs Dirty SQL

Every once in a while I stumble across a blog that says stored procs are no longer the way to go in database development. I believe I see this for a few reasons

1) This view is often exposed by younger developers who, though extremely talented, do not have heavy enterprise data manipulation experience.

2) Advocates of this view typically are heavily into auto code generation tools, which don't play well with stored procs.

Here is an example of the type of scare crow testing I see (make a weak comparison, beat it up, then declare your opinion superior).

http://www.blackwasp.co.uk/SpeedTestSqlSproc.aspx

Wow, a select statement is almost as fast with dynamically generated SQL then with a stored proc, and even in some cases, a stored proc might be slower.

Well, if you work with data heavily on a regular basis, you wish you were writing select statements all day :) The case of comparison here is bogus. If select and basic CRUD on a single table is all you are using SQL for, you probably shouldn't talk about how your are an expert on the intricacies of SQL performance.

In my enterprise experience, it is not uncommon for a query will pull back data from five or six tables, which often times aren't tables at all but subqueries themselves. CRUD operations sometimes spam five or six tables. Putting all your code in a stored proc allows you to have a single place to change things, and often times updating the database in an enterprise environment is a lot easier then touching production code. I also don't believe that these types of queries are faster with dynamic sql. The dynamic SQL must be generated on a webserver or a client, so you take a hit there that isn't often factored into test data. Execution plans are generated at query runtime, while a stored proc has its execution plan cached. Big performance boost. Though, as pointed out, sometimes dynamically generated plans might run slightly faster. With complex SQL operations, I doubt that though. You also are slightly more open to SQL injection attacks by building your app using dynamic SQL, but if you know what you are doing you should be able to avoid vulnerabilities there. Stored procs also aren't invulnerable to attack either, they just tend to be more so. Also by using dynamically generated SQL you are loosing out on the CLR integration into SQL Server (if using MS tech), and depending upon what you are trying to accomplish using CLR stored procs might be a powerful, fast option that you are passing up.

So, if you are fortunate enough to be able to pull off simple queries for your application, and you have a robust app that is responsive and meets your client's needs, good for you. Keep at it. I'm not a huge fan of code generation tools, as it seems like when you go outside of the vanilla, you end up spending a lot of time and effort getting your non-vanilla task done. If you know the base tech really well, typically you already have a library of code that acts almost like a code generation tool. Plus there is the additional learning curve of a code generator, do I want to spend all the time learning something that's features might be included in future versions of visual studio? Or will my code gen tool be around five years from now? What if I want to pass my code of to a junior developer? Will I have to spend time teaching them, or allocating time for them to learn, a code gen tool that might be eclipsed by another tool that is more in vogue that wasn't around when my base code was written? But that is neither here nor there. Separate discussion.

I've written dynamic SQL apps before, and they have worked well. If your app works well with dynamic SQL and using dynamic SQL allows you to gain efficiencies by using your code gen tools, good for you. Keep at it. But save your lectures about stored procs being dead, because depending on your environment, they are far from dead. Often times stored procs are the only practical way to go.

Wednesday, October 22, 2008

More Media Bias

Once again, our "unbiased" press at work.

McCain coverage mostly negative-

http://www.politico.com/news/stories/1008/14829.html

Reporter rips press-

http://www.ldsmag.com/ideas/081017light.html

Dems want to muzzle opposing view points all in the name of "fairness"-

http://www.breitbart.tv/html/203333.html

And then we have our bogus polls trying to manipulate voters-

http://online.wsj.com/article/SB122463210033356561.html?mod=djemEditorialPage

The result of all this? Declining consumers of their crap-

http://www.drudgereport.com/flashnf.htm

Libs, so righteous in their cause that distortion and manipulation are valid tools to achieve their ends. Sad.

Monday, October 20, 2008

More MOD UFO Files Released

The British Ministry of Defense released some more UFO files today.

Main story-
http://www.thesun.co.uk/sol/homepage/news/ufos/article1830761.ece

Alledged Photo (most likely a fake in my view)
http://www.thesun.co.uk/sol/homepage/news/ufos/article1830727.ece

Sabre Ordered to Attack a UFO (most likely a legit story in my view)
http://www.thesun.co.uk/sol/homepage/news/ufos/article1830727.ece

A more recent Jet's brush with a UFO
http://www.thesun.co.uk/sol/homepage/video/article307898.ece?channel=Sky+News&clipID=1347_SUN10799

Somewhere in the links there is a story about some person who was going to marry an alien. This story is easy to dismiss as the person having serious problems. From my experience, this story is probably LEGIT, at least from the perspective of the person describing the encounters. However, the beings are not aliens, they are must older, and more malevolent.

Thursday, October 16, 2008

Teleflip is Dead?

Well, it looks like Teleflip.com is down. This is a shame because Teleflip made sending SMS messages through email very easy. Say you wanted to text someone, you could just email the person's phone number like so.

13335551212@teleflip.com.

The only drawback was that teleflip put a small plug at the end of the SMS message, which took up about 10% of the available message characters. But hey, what do you want for free?

I hope this is a momentary outage, but I have a feeling teleflip will not be coming back. Sometimes a good thing for free ends up being a bad thing for the business offering the free service.

Anyone know of something similar?

Sad: The Left's Quest for Victory Destroying Voter Confidence

Here are a few headlines from Drudge-

Ohio elections chief asks US Supreme Court to intervene; dispute over voter registration...200,000 have discrepancies...

SEATTLE: 24,000 Felons Getting Ballots, Despite Eligibility Questions...

You KNOW this is all generally related to activist lefties trying to win at any cost. The price of their victory might be our republic.

I'm not saying the right doesn't engage in questionable practices at times, but they are the JV team when it comes to this type of stuff compared to the left. And the stories of corruption and tampering are generally buried in the media. The bigger news sources will only start talking about this now that Drudge has highlighted it.

Basic: A Recursive Function to Find All Control ID's in a Control

Sometimes you might have a control that has a lot of other controls burried in it. Here is a small very basic recursive function to find all the control id's. I'm posting it more for my reference. Just pass in a string builder and an int.

void RecurseFindControls(Control c, ref System.Text.StringBuilder sb, ref int iLevel)
{
if (c.ID != null)
{
sb.Append ( c.ID +
"[" + iLevel.ToString () + "];" );
}
if ( c.Controls.Count > 0 )
{
iLevel++;
for ( int j = 0 ; j < c.Controls.Count ; j++ )
{
RecurseFindControls ( c.Controls[ j ],
ref sb, ref iLevel );
}
}
}

Tuesday, October 14, 2008

Flash Cookies

For all you paranoid folks out there who are worried about cookies, here is something that will make you spill your milk too. Flash also has a version of cookies, and guess what? They don't expire, and they can contain unlimited amounts of data.

Here is a link where you can remove Flash cookies on your system, albeit one at a time.

Flash Cookie Remover

Source: Slashdot-

http://yro.slashdot.org/article.pl?sid=08/10/14/1656251&from=rss

Friday, October 10, 2008

Radgrid Column Name Changing

At work I ran into a scenario where we couldn't use our customized Radgrid which handles localization behind the scenes. So I had to use the standard Telerik Radgrid. Here is a link to how to deal with columns-

http://www.telerik.com/help/aspnet/grid/grdusingcolumns.html

For some reason changing the header text as suggested in the example for me didn't work. I need to change the header text names at runtime due to the headers need to be translated into the viewing clients language. But in fooling around I found a neat trick that did work. It might not be too efficient, but it got what I wanted to get done done.

My Radgrid was bound to a sqldatasource. So I added a new selected event handler on the Page.Init like so-


protected void Page_Init (object sender, EventArgs e)
{
myDataSet.Selected +=
new SqlDataSourceStatusEventHandler (myDataSet_Selected);
}
void myDataSet_Selected (object sender, SqlDataSourceStatusEventArgs e)
{
foreach (GridColumn column in myGridView.Columns)
{
if (column.UniqueName == "some name" )
{
(column
as GridBoundColumn ).HeaderText =
"whatever the translated text is";
break;
}
}
}


It works! Hope this helps someone.

Monday, October 06, 2008

For Reference: Getting a Datatable Programmatically from a DataSource

I've used this before (that is, pulling a datatable directly from a datasource), but always forget how when I need to. So for reference.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=228386&SiteID=1

Just remember to update your datasource paramaters.


DataView view =
(DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
DataTable table = view.ToTable();
DataSet ds = new DataSet();
ds.Tables.Add(table);

Friday, October 03, 2008

Misadventures in WCF

Well, I started off on a simple task of creating a test WCF service hosted in a windows service that was secured by https and was compatible with older clients.

Here were my hurdles. I'll come back and post links to each step.

1) Getting a WCF Service Working
2) Getting a Windows Service Working
3) Getting my WCF service class working in a Windows Service
4) Getting SSL working
5) Getting basicHTTBinding anonymous username/password working

Here is where I started running into trouble

6) Getting XML enums to serialize correctly in WCF.
7) Possibly needing to flatten WSDL files
8) WCF clients can connect to the mex and discover the service, but displaying the description or the WSDL in a web browser returns 400 or 415 errors (could be related to #7).

So, I decided at least for now to say "f it" and drop the project. Instead I will use an ASMX old school service hosted on IIS.

So far the WSDL issues went away, the challenge will be testing SSL (since I don't have IIS running on my box). I will give myself bonus points if I get the ASMX service working with SSL in a Windows Service, but that is a low priority at this point as time is a'wasting. I get super bonus points when if I'm done and have any time left, I can circle back and get the WCF working.

The lesson here? WCF is great...going forward. If any part of your tech lies in the "legacy" realm, <sarcasm>like Java or non MS clients </sarcasim> don't listen to all the folks towting how great WCF is and how it is backwards compatible, go ASMX.