I moved this blog to http://hallcrash.spacesocket.com/Blog
I wanted more options and the downloadable version had them.

I moved this blog to http://hallcrash.spacesocket.com/Blog
I wanted more options and the downloadable version had them.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/03/17/inheritance-with-mono-and-c/
I wanted more options and the downloadable version had them.
This entry will cover polymorphism with C# and Mono. Yes, that’s right. The original AssociationExample that has been explained and modified in previous posts has now been ported from VB to C# and is compatible with the Mono framework MonoAssociationExample.zip. This example is a testament to the portability of the code itself. Logically, it can run on any web server regardless of platform or data store. Making cross platform code management a dream come true.
There are very few logic changes between the VB and C# versions, and the only changes that the Mono framework caused was due to reflection. I will explain the changes in detail in this post.
First, the Mono Framework will need to be installed on the computer the development will be done on. This can be obtained by pointing your browser to the Mono download website. Download and installing the the windows version of “Mono for Windows, Gtk#, and XSP”. It will install, by default, in the “E:\Program Files\Mono-2.2″ directory. It is important to note that two Windows environment variables will need to be added. To add them, open the “System Properties” application of your computer and select the “Advanced Tab”. There will be an “Environment Variables” button, click it to add the following Variables:
1. “MonoLibPath”=”E:\Program Files\Mono-2.2\lib\mono\2.0″
2. ”MonoPath”=”E:\Program Files\Mono-2.2\bin”. 
The computer will have to be restarted after saving the changes. I used the zipped project template files from this Chris Cyvas Blog post about using Mono with Visual Studio 2008. The Mono project templates won’t be needed to run or view the MonoAssociationExample included in this post. They are only needed when starting a project from scratch.
A few notations about installing Mono and “getting it to play nice with Visual Studio”. It’s not easy. Don’t mix Microsoft Framework references with the Mono compiler, the compiler will crash. Visual Studio will add references to the Microsoft framework automatically when adding controls from the toolbox. When it is expected, you learn to work around it. The debugger does not work when compiling the project using the Mono compiler. It does not create the project debug definition file(PBD). So, Visual Studio cannot “attach” to the project. The Mono development team has a compiler that will work with the Visual Studio debugger, but it is still in Beta. I used the HTTPContext.Current.Response.Write(); method of debugging on this project. It isn’t pretty but, it is effective.
If testing the AssociationExample on a Linux or Mac, proper steps must be taken so that the installed web server can handle ASP.NET and Mono and permissions will act differently in different environments. I will not dive into them here because they are massively complex. I have the MonoAssociationExample working on an inexpensive Linux hosting site from the nice people at SpaceSocket: http://hallcrash.spacesocket.com/. All I had to do was use the publish option in Visual Studio to the hallcrash.spacesocket.com FTPs public_html folder and add write permissions to the XML files via the cPanel. Everything worked flawlessly.
The solution is a Visual Studio 2008 solution, and framework 3.5 should be selected in the project properties. It is using the Mono framework. So, that number means nothing to the Mono compiler. One of the Mono references has the version number ”3.5″. Visual Studio prompts the user to automatically upgrade the project because of the version and it will not build un-upgraded. It makes no difference in this case. Using the upgrade option will add a bunch of non-Mono-compatible entries into the web.config and also add a few references to the Microsoft framework. They will have to be removed.
Exploring the examples references will reveal what may look like normal Microsoft framework references, but they are not. All the references in this project are to the Mono framework. The PATH property of the reference reveals where the reference file is located.
Unlike the original AssoicationExample, the project type is a “Web Application” not a “Web Project” it is important to note that in this Project type the “App_Code” folder is not needed. In-fact, it causes problems if there is code in the App_Code folder so I just named the code folder “Classes”.
Since the project has been converted from VB to C#,there are different ways to define generic classes. The “Of” keyword does not exist, and is not needed. The types in the TypeList have to be defined in a different way using the where keyword.
There are very few differences between the two projects. All the differences are in the abstract classes. Those changes to reflect into the normal classes. First, Since the “App_Data” folder cannot be obtained by using the “AppDomain.CurrentDomain.GetData(“DataDirectory)” method because, it won’t return the proper value on a Linux server. It was replaced with an application setting. The value is stored in the Web.config file and retrieved via the Properties.Settings.Default.App_Data_Folder property. This value will need to be mapped to the server by using the Server.Mappath method so it will return the full path of the directory. The Activator.CreateInstance method did not work as expected on the Mono framework. To work around this the newObj method was declared abstract and a new abstract method, GetObjFromRow , was defined and because C# is really, really strict about return types, a new abstract method, ConvertToIDType, was defined forcing them to be defined in the inheriting class and the logic was implemented there (the abstract and virtual keywords in C# are the same as the MustOverride Overridable keywords in VB, respectively).
alt=”abstract2″ width=”548″ height=”175″ />
Another noted issue found when running the deployment on a Linux box is a GUID Type casting error. This was resolved by changing the All the GUID Data Types in the BaseObject DataSet to String, and Adjusting the GetByRow and SetByRow methods to convert the ID property to string and back again.
Constructors had to be defined for each inheriting class. The base constructors were not inherited. The rest of the business logic is exactly the same, only the language has changed.
There are more features in this version, like, required fields and input type validation.
The UI has a small architecture change. The defined control events were not being handled correctly using the Mono framework. So, the navigation links were moved out of the ucNavagation control and the Cancel button does not function. I am still working on the event problems.I only gave myself 8 hours to convert the project to C# and Mono and I used up all that time.
It is important to note the “override abstract void GetByRow” method. If this method is not defined in the BaseXMLAssociation class the C# compiler will compile the code but, it will throw a non descriptive error when running.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/03/17/inheritance-with-mono-and-c/
I wanted more options and the downloadable version had them.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/03/17/inheritance-with-dot-net-part-2/
I wanted more options and the downloadable version had them.
Please read Part1 before continuing with this part. This instruction will explain how to add an Associated Categories to the AssociationExample from Part1 using the Association Tool.
With the project open, the first step is to add the CategoryAssociation.xml file to the “App_Data” folder. Following the
suggestion from part one, name the XML document, DataTable and object using the same name. Right clicking on the “App_Data” folder and selecting “Add New Item..” from the context menu will display the add new item dialog. Select the XML file option and name the file CategoryAssociation.xml. This will create the
file.Open the file in the Visual Studio editor, The DocumentElement root element will need to be added. Then save and close the file.
Next, the CategoryAssociation DataTable needs to be added to the BaseObject DataSet. The BaseObject DataSet is in the “App_Code\DataSets” folder within the
Solution Explorer. It is named BaseObject.xsd. Double clicking this file will open the DataSet Editor. Selecting “Data” from the file menu and then select “Add–>DataTable” from the “Data” context Menu. By default this adds a DataTable to the DataSet named “DataTable1″. Rename this table in the property editor to CategoryAssociation. With the newly renamed CategoryAssociation table selected, the same “Data” file menu will expose the add column command. Using the “Add–>Column” Command, add three columns named “ID”, “CategoryID” and “ChildCategoryID”. Select all of the columns added and in the property editor, change the DataType to GUID. Save the DataSet by using the save button on the file menu, and close the DataSet.
Now the CategoryAssociation class needs to be added. Creating the file will be the same steps as creating the XML file.Right click on the “App_Code” folder and “Class” should be selected in the add file dialogand the file name should be CategoryAssociation.vb. Visual Studio will add some code to the file by default.
The class definition needs to be edited and an “Inherits BaseXMLObject” statement needs to be added. After typing “Inherits” on the next line of the class definition, press the space-bar and Visual Studio will display a list of objects that can be inherited. As the letters that spell BaseXMLAssociation are typed the SmartSence will begin to show its magic.
Select the BaseXMLAssociation by using the up or down arrow and press the space-bar. Visual Studio should automatically start SmartSensing the TypeList. After declaring the TypeList,(OfGuid, BaseObject.CategoryAssociationRow, BaseObject.CategoryAssociationDataTable, Category, Category, CategoryAssociation) the CategoryAssociation class should look like the following image.
At the end of the declaration, pressing the return key will cause Visual Studio to automatically write code to handle any MustInherited declarations in the inherited class. In this case, only the GetByRow function appears. Adding the logic to the GetByRow, a property is an easy task. The row parameter will contain all of the columns defined in the CategoryAssociation DataTableExtracting. Putting those values into the object is all that has to happen.
The pChildObject property needs a Public accessor. Naming this property to reflect the object it represents is important. Copying this property from one of the other objects that inherit the BaseXMLAssociation and renaming it “Category” is a fast way to create the property.
The logic of the SetByObject function is exactly the opposite of the GetByRow function. It is a good idea to get the IDs via the object itself, since the only way to set the object is via the public object.
There is one more function that needs to be written. The GetbyCategoryID function. Again, like the Category Property, this function can be copied from one of the other objects that inherit the BaseXMLAssociation. This time changing the types used in the function.
Now that this class is complete, all that is left is to add the AssociatedCategories and UnAssociatedCategories properties to the Category class and the business logic will be complete.
Before the UnAssociatedCategories property can be complete, a GetUnAssociatedCategories function will need to be created. This function is the same as the GetUnAssociated function only the types are different.
Now the UnAssociatedCategories property can be written.
Now that the business logic is complete, it would be a good idea to save everything and close all the working windows because, the UI editor can be created. The quickest way to create the editor would be to copy one of the other association editors, then scanning the VB CodeFile and changing the types to the CategoryAssociation Type and the name to something relative. Remember to rename the copied file to ucAssociatedCategories.ascx and to rename the class name in the CodeFile to “ucCategoryAssociation”. The inherits statement in the ucAssociatedCategories.ascx “@Control” declaration will need to be updated with the new class name as well.
The Inherits declaration will need to have its TypeList altered to use the CategoryAssociation type.
The HTML source of the ucAssociatedCategories.ascx will need to be updated to reflect the data that it is connected with.
The binding methods need to get data from the correct place.
The Add and Remove events need to be updated to cast the CommentObject as the correct type.
The Save function needs to save the correct objects.
And that will finish the ucCategoryAssociation. The last two steps of the walk though. Edit the ucCategoryContent.ascx. This page will need to be in the design mode of the editor. Drag the file ucCategoryAssociation.acsx from the Solution Explorer onto the ucCategoryContent.ascx in the design editor.

This will conclude the lesson. If everything was done correctly, the project should build and the category editor should have the category association tool and it should be able to add and remove associations.
If you don’t know how to test the project, just hit the play button on the top most tool bar.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/03/17/inheritance-with-dot-net-part-2/
I wanted more options and the downloadable version had them.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/03/05/inheritance-with-dot-net/
I wanted more options and the downloadable version had them.
Inheritance/polymorphism is a very powerful way to code. Using this generic style of programming will save every programmer hours of coding time, less code and fewer problems.
This simple example shows how to leverage inheritance in a strongly typed language. It associates two different objects, leveraging polymorphism and generics.
Start by downloading the example: AssociationExample.zip .
Visual Studio 2005 or Visual Studo 2008 are required for the AssociationExample. If you don’t have Visual Studio, Microsoft offers an Express Edition that is free. Just make sure to get the “Web Developer” edition.
The AssociationExample uses VB.net using Visual Studio 2005. You can use Visual Studio 2008. It will prompt you to upgrade the project which is fine.
This Example has also been porten to C# using the Mono framework. The MonoAssociationExample is working on an inexpensive Linux hosting site from the nice people at SpaceSocket: http://hallcrash.spacesocket.com/.
Part 2 Of this example can be found here.
In the AssociationExample, XML files are used for data store. This solution was used for 2 reasons:
1. It is a fantastic way to isolate a database. If the project can move freely between XML, Access, SQL , MySQL, Orical or even FileMakerPro or Fox Pro, the project can be distributed/installed in many different environments, and act the same way.
2. It’s portable. After downloading and extracting the example project it will be working out of the box. No data imports or configurations needed.
In this post, the AssociationExample will be explained in detail. The next post will include a walk-through of creating an association using inheritance will be provided.
Let’s begin…
To open the project extract the files in the AssociationExample.zip to a folder easily remembered. Open the Visual Studio “Web Developer” edition. Select “Open Web Site…” from the file menu. Then select the folder the files were extracted to and click the “Open” button.

The project files will load into the Solution Explorer.
The App_Data Folder will contain a few XML data files. This example will explain how to objectize data in this folder. The App_Code folder contains the Business Logic and Data Access Layer. There are several VB files and a DataSet in the folder. The rest of the files in the project are UI files.
Notice the DataSet named BaseObject. This DataSet will be responsible for
isolating the database. In the case of this example, the DataTables within the DataSet will load data using the ReadXML method of the DataTable. All the DataTable names correspond to the XML file names. While naming DataTables, classes or data files, its a good idea to name them in this identical fashion. It helps when debugging.
The next step is to deal with the code base of the project: the BaseXMLDataObject Class. Every class that needs to access XML data will be using this class. This is the most important part of the project because all business objects inherit this class.
In the definition of the class , the declaration “Of“ is after the class name. This specifies that it
is a generic class. After the generic declaration a TypeList is defined. A TypeList
is used to define types throughout the class. These types are reflected through the inheriting class. This basically means that the inheriting class will contain all functionality of its base class with the types defined in the TypeList.
There are two integerated layers within this class. The ”Data Access Layer”(DAL) and the ”Business Object Layer”(BOL). They each do very different things.
The purpose of the DAL is to send queries to the data source and return data in a DataTable of DataTableType, the DataTableTypehas been generically defined in the TypeList. For example, if the DataTable type is defined as “category”, the base class will return the data in the “category” DataTable.
The BOL converts the data from a DataTable row to the ObjectType that has been generically defined in the TypeList. It also can return a List of ObjectType if so needed.
The Product class is an excellent example on how to implement the BaseXMLDataObject class. The “Inherits” statement can inherit from any class, but if that class has the generic declaration and a TypeList, the types in the TypeList are required to build the class. The Override Operator is very powerful in this implementation.
If a method defined within the BaseXMLDataObject is not sufficient, it can be overridden in the inheriting class and have the same name. When the base class calls that method, the overridden method is used. For instance, in the Product class the Save() method is overridden and all child objects are saved along with the product object. The Category object is using the BaseXMLDataObjet in exactly the same way. The difference is the types that are used in the TypeList of the generic constructor and the types that are used within the Category class. The main differences are the datapoints.
The product class data points are “Name” and “Price” and the Category class data points are “Name” and “isRoot.” Since the ID data point will be the same for all objects that use the BaseXMLDataObject, the ID property is declared in the BaseXMLDataObject class. ID property of the base class is set via the SetByRow method of the inheriting class along with all the other properties. The SetByRow and GetByObject functions are important overridden functions. They convert the DataTable rows returned by the DAL into the object needed by the BOL and vice verse.
Another base class is the BaseXMLAssociation class. This class is used to connect two objects that are defined in the project. An important design feature of this class is it can connect two different objects that could use two dif
ferent data connections and types, further isolating the database. This means that three different database types can be used and this base class will connect all three and objectize the association.
This class represents a one to one relationship. This object will contain one parent object and one child object. The child object is a protected variable that could(should) be a MustOverride ChildObject Property. This practice was not enforced on this property, so the name of the property could ”read” more like the object it was representing. This approach only makes the dot notation clearer. This class also implements the BaseXMLDataObject. So in declaring the TypeList, the types that are needed to define the BaseXMLDataObject class are also in this type list. This class also uses reflection to create a new parent object by ID in the “newObj” function.
The AssociationExample shows how to implement this class in two ways, accomplishing the same task: associating products and categories. A duel association method was used. The two association classes are CategoryProductAssociation class and the ProductCategoryAssociation class. This association could have been done in one class, but for the sake of clarity, separating them is easier to understand.
Since both CategoryProductAssociation and ProductCategoryAssociation classes are seemingly identical apart from the child object name and the XML document property being reset in the new constructor, I’ll explain the ProductCategoryAssociation class. This class has only one function, the GetByProductID function. This function selects all items in the ProductCategoryAssociation XML file and filters out all information that does not have the proper ProductID. It then returns a list of itself. The GetByProductID function is used in the product class, and it fills the AssocatedCategory property.
The architecture here is important. When writing code to access the information contained in the DataSource, the properties that connect the objects together to reveal the dot notation can cause an infinite loop. All the properties in the business object layer will check to see if the property is “nothing” before trying to load it. This will allow the following code to be written without creating a stack overflow:
Product.AssociatedCategories(0).Category.AssosiatedProducts(0).Product.AssociatedCategories(0).Category.AssosiatedProducts(0).Product
Up until this point, only the architecture of the BOL and the actions of the DAL have been explained. Both of these tools together allow access to the data in a very safe non-injectable manner and list object data and their associations in a repeatable way. Moving on to the UI will explain how to use the tools to view and edit data. No user credentials are required to use the AssociationExample.
The product list is easily displayed using a gridvew and adding edit and delete buttons.
The product list is bound using two easy lines of code:
GridView.DataSource = (new Product).GetAll()
GridView.DataBind()
The GridView must also be defined in the ascx with all the necessary datapoints. The edit and delete links are a special kind of link button that remembers the Product that it needs to edit or delete. The delete button, for example, uses the remembered value and deletes that value from the XML data store. The edit button takes the remembered value and sets up the edit control and displays that control. The add product link does exactly the same thing as the edit link button, functionally, but it creates a new product and uses that new product to set up the edit control.

The custom link button is included in the project. It is used mostly every where an action is used on an object. The object is stored in the property “CommandObject”. In this case, the stored object is the DataItem of the GridView. When the “Edit” link button is clicked, the EditItem event is raised, the “Sender” is converted to the custom link button and the CommandObject property is extracted and cast as a Product type, which is then passed into the “Edit” function to set up the product editor. It look like a small amount of code to set the editor up, though most of the work is being performed by the BOL , DAL, and the polymorphic base classes, with a little help from the ViewState.
The product content editor
is where the product data points are exposed for modification. The association tool is also exposed here to associate categories. The action of this editor allows the user to edit the values and modify the associations and the values. Nothing will be saved to the datastore until the save button is clicked. PostBacks may occur.
It is probably a good idea to explain another MustInherit class, the BaseAssociationControl. There are 2 properties and 4 functions in this base class. 
The two properties save changes to the association list, adding or removing associated objects. Two of the functions add and remove objects to the lists and the remaining two functions merge the currently existing associated list with the lists that are saved. This class is used by two controls: ucProductCategoryAssociation and ucCategoryProductAssociation. These controls set the BaseAssociation type in the BaseAssociationControl TypeList to the type they are displaying. The BaseAssociationControl then reflects those types in its properties and functions.

The type list declaration, as with the BaseXMLDataObject class, will write code for the programmer. It is allowing the programmer to use this tool to merge lists of
any type and to add and remove objects of that type to the list. Before binding the lists to a GridView, the lists must be merged. As explained previously, the category and product objects expose the Association and Un-Association object properties. These lists will have to be merged using the BaseAssociationControls merge functions. When adding or removing to the lists, the BaseAssociationControls AddAssociation and RemoveAssociation functions must be used or display errors will confuse the user. Remember, the changes to these lists are not committed to the data store until the save button is clicked.
This concludes the explanation of the AssociationExample. The next post will explain how to add CatagoryCategoryAssociations. It should take a mid-level programmer about an hour to add the CatagoryCategoryAssociations class and wire it up to the GUI. This is coverd in Part2.
Notes about the Architecture for the example:
This application should use the ”Web Application” project type, and it should even go as far as separating Business Objects and Data Access into different Projects, but for the purpose of this example a ”Web” project was used in order to allow the free version of Visual Studio to run and edit the example. The one layer approach was used to convey inheritance because over complicating the project will make understanding what is actually happening difficult.
This Project uses XML so the DAL uses the ReadXML and WriteXML methods of the DataTable. In the SQL Server implementation, it would use the Load method of the DataTable. Also, it is possible to store all the data in a single XML file and use the DataSet ReadXML method. The multiple file approach needs to be very clear about what is happening. If the data source changes, all that needs to be done is change the inheritance of the class to BaseSQLDataObject, or something similar. The data access layer of the class would need to change or be written. Because an XML datasource is used, all data is loaded into the DataTable and a query is applied to filter the results using the Select function of the DataTable. It is also possible to use XSL and XQuery if you want to get fancy with an XML datasource. Again, too complex for this example.
The Activator.CreateInstance function is used in the BaseXMLAssociation class. This is not a preferred approach. It was done this way to pass the ID parameter into the constructor. The generic “{new}” type list declaration is limited to a parameter-less constructor.
If an AJAX update panel is added to the Association controls, they will operate in a more user friendly manner. Since System.Web.Extentions are not easily configured, it was left out to make the project setup easier.
The architecture of the MustInherit BaseAssociationControl is not necessarily needed. It is easier to use the uniqueID of the control to hold the ViewState values. In this way, more then one control could be operational on the same page.
The AssociationExample truly deletes the row. In enterprise level applications it should be flagged as deleted, but never actually deleted.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/03/05/inheritance-with-dot-net/
I wanted more options and the downloadable version had them.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/02/07/licence-plate-scanning-controversy/
I wanted more options and the downloadable version had them.
The other day, I was driving to work, minding my own business, and obeying the rules of the road. I entered a school zone and checked my speed. It was 25 MPH, the posted limit. Around a corner, in his car, was a town police officer. I guessed he was checking people’s speed. That might have been his original goal but, just a few miles further down the road I found him following me with his lights blazing. Being a law abiding citizen, I pulled right over. The officer quickly made his way to my car and asked only for my license and registration. No insurance. I gave it to him quickly as I asked why I was stopped. After looking at my license he told me, to my surprise, it was suspended. Rolling through my head are the words misdemeanor, tow, and impound charges. I am in shock, how did this happen with no notification? The officer was going out of his way to be polite. He saw a razorblade on my dash board and pointed it out to me asking: “Do you have any other weapons in the car other than that razor?”. I said no, and I explained the razor was there because I had just changed the registration sticker in the window. He explained that committing an AUO (aggravated unlicensed operation) is probable cause for searching the car. Remembering a law class I had taken at a university, I knew he was correct, he had to arrest me for a misdemeanor. The officer asked me to step out of the car and empty my pockets. I did and as I pulled out a wad of fifty dollar bills, the look in his eye went from, polite to quizzical. I knew he would spend some time in the car looking around. The officer allowed me to keep all my gear and he put me in the back of his car un-cuffed, how nice. I snapped these pic’s with my cell phone.
Before the officer closed the door, he asked me to call someone within a 10 minute radius to drive my car or it would be towed. I thought, what a nice guy! I didn’t want to pay an impound charge, so I called a coworker who happened to be working from home and lived just around the corner. The phone rang 4 times and I got his voicemail. I was in a pinch, I didn’t want my car towed and the one guy who could help me was probably in the bathroom. The officer was done ravaging though my car and had returned to his driver’s seat. I told him I could not contact anyone and he began to book me in the car. He asked me questions like “do I have any gang affiliations”" and “are you a Nazi?” After the booking, he began to show me the equipment in the car. I was very interested in the software he was using and he then showed me the License Plate Scanner that had told him my license was suspended. It showed me the name of the town court that suspended it. I explained that I had not a clue why they suspended it. I asked if the device could tell me. He said no. This is where I broke! I exclaimed loudly “What a WILD Disconnect!” Then, my phone rang. It was my coworker, asking why I had called him. I explained the situation as briefly as I could and he and his wife and 3 of his kids came to my rescue. The officer even checked my coworker’s license to be sure he could drive, the officer let me go on my own recognaissance and gave me a ticket and a court date for less then 2 weeks away.
Further investigation revealed that I had an outstanding overdue vehicle inspection ticket from 2 years ago. I think I had paid it; I am looking though my bank history to figure it out now.
I am not mad at the officer for performing his job, he could have made it a lot worse. I am angry at the court and the DMV for not informing me that my license was suspended. I am also angry at the License Plate Scanning device. In all reality I SHOULD have been booked, and my car SHOULD have been towed. If I was in a busier town or I had an officer of a different demeanor, I would have been in a world of hell for at least 24 hours, trying to make bail, figuring out where my car was, and funding its release. It is easy to accuse someone with all the technology at the officer’s disposal; to prove innocence has not the same technology in place. It is horrific. Though, I do appreciate the in car booking, I am sure that isnt a statewide thing.
Yet there is ANOTHER problem here. I own 2 cars that are registered to me. My wife can drive either one. She could get pulled over endlessly, hour after hour because she is driving my car, and this “License Plate Scanner” informs an officer that the owner of the car has a suspended license, but she is committing no wrong to get pulled over. This is probably worse for a person who has DUI, may be in jail with a suspended license, and the wife or other family member is driving a car registered in the offenders name. In this case it is harassment.
I sent an email to my assemblywomen. Explaining that it’s not a crime to have a suspended license, nor is it a crime to drive someone’s car that has a suspended license. And since the officer has to “assume” the diver is the owner, the officer will be wrong 50% of the time, since the DMV statistics show that 50% of the people with a driver licenses don’t have cars registered to them. Isn’t it crazy that I have a better chance of her accidently coming across this post than her actually reading my letter!
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/02/07/licence-plate-scanning-controversy/
I wanted more options and the downloadable version had them.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/02/07/the-g1-has-video/
I wanted more options and the downloadable version had them.
I am one of those nerds that use an HTC G1 cell phone. I really like the phone, other then the usual battery time gripe; that most really good smart phones have because, of CPU power and memory requirements. The G1 comes stock with a 3.0MP Camera BUT, really crappy camera software and NO video capture. After a few weeks, I was able to install SnapPhoto , for free, via the Android Market. This application trumped the original cam includeing many useful camera options one needs, even turning them all off (important). But as for video, no app existed.
Last night, while browsing the market I FOUND ONE, as probably did everyone else. It’s primitive, I don’t know what format it is recording in cause it names all the video files with the JPG extent ion. I soon hope to post videos to my blog from my G1, if I can figure out where the application is storing them.
SWEET!
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/02/07/the-g1-has-video/
I wanted more options and the downloadable version had them.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/02/06/bc30456-dataitem-is-not-a-member-of-systemwebuicontrol/
I wanted more options and the downloadable version had them.
warning, untranslated geek speak ahead:
I encountered the BC30456: ‘DataItem’ is not a member of ‘System.Web.UI.Control’.” error today.
I was using an asp:textbox to hold a value and an object. Then, using the onTextChange event to save that value in a viewstate list for updating later.
I hear some of you are saying “NOOOO, FUNCTIONAL NIGHTMARE!!” you’d be right, sep’ I planned on using Microsoft AJAX extensions to handle the postback. That is when I encountered the “BC30456″ error. I searched around a little and found pretty much nothing to solve the problem. The Container.DataItem is NOT available the in the AJAX update panel, ever.
After reading some documentation I found that I might be able to use an alternative way to get the DataItem.
I changed the TextBox from:
<asp:textbox runat=”server” ID=”txtItemValue” CommandObject=’<%# container.DataItem %>‘ />
To:
<asp:textbox runat=”server” ID=”txtItemValue” CommandObject=’<%# DataBinder.GetDataItem(container) %>‘ />
this fixed the problem.
If you are wondering where the CommandObject property came from. I overloaded the original TextBox control with a custom control that inherited from the original TextBox control and added the CommandObjectproperty; saving the value to a viewstate variable. Below is an example of a that custom control:
<DefaultProperty(Text”), ToolboxData(“<{0}:TextBox runat=server></{0}:TextBox>”)> _
Public ClassTextBox
InheritsSystem.Web.UI.WebControls.TextBox
End Class
I do this to minimise database hits. This particular approch is used to upgrade underperforming legacy code. Normally, if I am programming a new dataview, I like use overloaded gridviews, or the like, that I overload the datasource property in the same “kinda” way to persist the data.
I hope that helps someone out.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/02/06/bc30456-dataitem-is-not-a-member-of-systemwebuicontrol/
I wanted more options and the downloadable version had them.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/01/29/bail-out-fail-out/
I wanted more options and the downloadable version had them.
What is the problem with the bailout? Well there are a lot of money problems with the bailout. Simple math will explain that all of the economic stimuli added together divided by the US population equals about six thousand dollars per American, not necessarily tax paying Americans. Only 138,893,908 of the 303,824,640 Americans file personal income tax returns. So, that adds up to $11,721 per personal tax payer, but they are not 100% responsible for the bill. We can add in 100% of the small businesses and corporations of America (27,486,691) totaling 166,380,599 taxable entities , bringing the bill to $9,784 per taxpaying entity. This number is still incorrect because some of the taxpaying businesses received bailout money. These businesses are required to pay it back, or so they say. I haven’t seen a contract between the government and these banks yet. And it is apparent that they already took some money and are doing as they please anyway. Also to be subtracted are the filers whom recive 100% or more back on their personal returns.
I can’t get my head around how the banks are still not giving the money they took to anybody, it is deposited in the treasury. Gaining interest, day after day, that the taxpayers have to pay as well.
Here is how I see the stimuli packages: Since Americans aren’t spending money, and they can’t get a loan to spend money. The government will take a loan and spend the taxpayers money. But, in doing so, they are choosing what the taxpayer needs to buy. AND they will take their money back later, either from the borrower or the taxpayer. Even if the taxpayer has been foreclosed upon, cars repo-ed , and school loans in default.
dont get me started.
I moved this blog to http://hallcrash.spacesocket.com/Blog
this artical : http://hallcrash.spacesocket.com/Blog/2009/01/29/bail-out-fail-out/
I wanted more options and the downloadable version had them.
I am finally getting around to writing a blog. I hope I can entertain some people with some meaningful content.
I am working from home today because we are iced in, it snowed like 5 inches yesterday and after shoveling my driveway it started freezing rain. I think a quarter inch of ice is all over my driveway and sidewalk. This causes us problems because when melting the ice we can’t use calcium chloride to speed the melting of the ice because, we farm a large portion of our property organically. Don’t let the organic pickle companies tell you that the calcium chloride they put in their jars is organic. It dose occur naturally but, it is very rare.
This weekend I will try and take you though changing the passage side axle in a Honda accord, a water pump and timing belt in a CRV, and polymorphing VB programming, if I have the spare time.