In 2.0, Generics were added. If you haven’t played with generics before, they are a way of declaring a type for an object for the compiler, such as a list, without having to use the System.Object class. In this way, you can have strongly typed lists instead of a list of objects that you must then typecast when you pull them back out.
If you think of generics outside the programming world, you might think of generic medicine. It is medicine that has the same effects as the name brand stuff, but isn’t attached to any brand. Generics in programming are like this. They aren’t bound to a type, but share the same methods and classes.
Here are a few examples of the List object from System.Collections.Generics. The list is exactly as it says. You add items to the list that are the same type as you delcare, and then access them using a zero-based index. It’s similar to the ArrayList from System.Collections, but the return type of the items is not System.Object that must be typecast.
Read more »
November 27, 2007
Posted by
Broken Bokken |
.Net |
.Net, .Net 2.0, .Net Dojo, ASP.NET, C#, ChangeType, Convert, Generic Return, Generics, IConvertible, Programming, Return Type, System.Collections.Generic, Technology, TypeCast, typeof |
1 Comment
Have you ever gone to a website where you have to click to activate a flash control? This is only an issue if your users use IE. A blaring example of this is to open any wordpress page that has Youtube video on it. You have to click it before you can actually click it to start it playing. Microsoft was forced to enable this on their browsers, but there is a very simple solution to the problem that only a few website developers seem to implement.
According to the W3C, IE was used by 57% of the people browsing the internet. If you are using flash on your site and you are not using a workaround for activation, you are annoying over 1/2 your user base. Lucky for you, I have compiled the solution into a simple ASP.NET 2.0 control that you can use. Don’t like ASP.NET? You can take the principals of the workaround and apply them to any language.
The basis for the workaround is that any flash tags written via javascript are immune to the ActiveX activation. The problem that I discovered while building this control is that all browsers behave differently when it comes to javascript. My first version of the control used <noscript>…</noscript> tags to show the control normally if the user has javascript disabled. The problem we found is that Safari does not support noscript tags. On Safari on a mac, no flash would appear. So, I reworked the control to detect the browser version. If it is any version of IE, it uses javascript to write the flash and <noscript>…</noscript> as a backup. For all other browsers, the ActiveX activation is not a problem, so I just write the flash out normally, thus eliminating the pesky javascript issues.
Read more »
November 20, 2007
Posted by
Broken Bokken |
.Net |
.Net, .Net 2.0, .Net Dojo, ActiveX, ActiveX Activation, ASP.NET, Click here to activate, Embedded Resource, Flash, Flash Activation, Programming, Technology, Web Control, Web Development, Workaround |
2 Comments
Looking for something new and delicious? I found a great recipe for beer can chicken, which I altered a little bit since we don’t drink beer. The recipe initially came from Steve Raichlen, a chef who appeared with Bobby Flay on the Food Network. The rub portion of the recipe is only altered a tiny bit, but Steve deserves the credit for what my wife and I think is the best chicken ever. In order to do this recipe you either need a grill with a hood tall enough for a chicken standing on end, or else you can use the oven. If you have a meat thermometer, it will come in handy.
Read more »
November 19, 2007
Posted by
Broken Bokken |
Recipes |
beer, beer can chicken, chicken, Food, grill, grilled chicken, pop, pop can chicken, Recipe, soda |
No Comments
I was working for a client who wanted an easy way to build dynamic reports. They wanted to be able to easily alter the reports, with the option to save them off to Excel. Now, I could have used a GridView to show the data and written out the Excel sheet, but I think Grid Views are overrated and over used as reporting tools. So, I started looking at the Microsoft.Reporting namespace. This namespace provides similar functionality to Crystal Reports. The only problem: my data was stored in Oracle. I started by picking apart how the ReportViewer works to see if I could somehow import the data dynamically. Logically, I thought the Sql 2005 reporting services was essentially building a report based on a dataset selected from the database. Here’s what I discovered.
Read more »
November 14, 2007
Posted by
Broken Bokken |
.Net |
.Net, .Net 2.0, .Net Dojo, ASP.NET, Charting, Charts, Crystal Reports, Dynamic Reporting, LocalReport, Microsoft.Reporting, Programming, RDLC, Reporting, Reporting Services, Reports, ReportViewer, Sql, Sql Server, Sql Server 2005, String to MemoryStream, Technology |
No Comments
I was fortunate enough to enjoy a weekend of sitting around and doing nothing. I noticed the History Channel was having one of their “We’re All Going to Die” weekends, which I suppose is better than 72 hours of Hitler, since it was Veterans Day weekend. One of the dooms day shows they were playing was “10 Ways the World Will End”. One of the ways is an asteroid, of which they discussed that Apophis will dip below our satellites as it passes through earth orbit on April 13, 2029 (Friday the 13th). Then, if it continues on it’s path as expected, it will hit the earth and kill us all. Only a handful of people are actually preparing to defend the earth against Apophis. They believe that by flying a ship close to it, the gravity of the ship will be enough to pull Apophis off course so that it won’t hit us. This theory is untested, and scientists only think it will work. But that’s not the the odd thing that came to mind.
Read more »
November 13, 2007
Posted by
Broken Bokken |
Life |
Apohpis, Armageddon, Asteroid, End of Days, Life, Religion, Revelation, Space, Thoughts |
No Comments