Jose C Gomez on March 26th, 2009

This may make me sound like I am antiquated and behind the times, and in this aspect you are probably right. Since I started messing with programming quite a few years ago, I’ve tried to make the programs I write as user friendly and as easy to maintain as possible. Recently I have adopted a few things I’ve picked up from others like making the methods in my programs accessible through web services when it has merit and things of the sort.

One of the things I have always done is provide extensive config files in XML format in order to alleviate having to modify the code when simple things change such as passwords, database names, host addresses etc. This has in my opinion always been a great venue to ensure maintainability and stability. But the big issue always was XML..

XML (Extensible Markup Language) is a general-purpose specification for creating custom markup languages.[1] It is classified as an extensible language, because it allows the user to define the mark-up elements. XML’s purpose is to aid information systems in sharing structured data, especially via the Internet, [2] to encode documents, and to serialize data; in the last context, it compares with text-based serialization languages such as JSON, YAML and S-Expressions. [3]
more…


The problem I’ve always had with XML is parsing the file; although the support for it and the built in tools have improved greatly over the past few years it still requires considerable amount of code in order to gather the data in some languages (C#), and another considerable amount of code in order to update or change the data in the file. When I was learning Object Oriented programming a while back we were introduced to the concept of Serialization

In computer science, in the context of data storage and transmission, serialization is the process of converting an object into a sequence of bits so that it can be stored on a storage medium (such as a file, or a memory buffer) or transmitted across a network connection link. When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of references, this process is not straightforward.
more…

But like the Wikipedia definition above says “this process is not straightforward”, you used to have to define Interfaces and formats and if your object had any kind of list or array in it, you couldn’t use it unless you wanted to spend a considerable amount of time making it work.

While I was working on the practice projects I grew to hate Serialization and had not used it since. Yesterday in a fit of rage, because my XML config file was being stubborn I stumbled across an implementation that used a Serialized object for storing configuration. I was baffled by the ease in which this was accomplished and I immediately implemented it. Now it its extremely easy to add and remove config parameters from my program and at the same time I don’t have to worry about someone deleting or changing the config file since it is stored in binary and gets re-created if deleted.

In order to serialize an object your class must be declared as [Serializable] . After you have done this, the below example will take care of the serialization for you.

//Serialize an Object
FileStreamfs = new FileStream(@”prog.conf”, FileMode.Create); //Create new File where the object will live
BinaryFormatter bf = new BinaryFormatter(); //Create new BinaryFormatter to Serilize Object
bf.Serialize(fs, YOUROBJECT); //Serialize Object
fs.Close(); //Close File

//Deserialize
FileStreamfs = newFileStream(@”prog.conf”,FileMode.Open);  //Open File Containing Serialized Object
YOUROBJECT obj = (YOUROBJECT) (new BinaryFormatter().Deserialize(fs));
fs.Close(); //Close File

Remember to include the System.IO and System.Runtime.Serialization.Formatters.Binary libraries.

Share:
  • Digg
  • del.icio.us
  • Facebook
  • Slashdot

Tags: , , , , , ,

Jose C Gomez on March 16th, 2009

While listening to Net@Night from the TWIT Network I was introduced to Blib.fm, the best way I can describe it is Twitter for music. You go to the site and type the name of your song and or favorite artist and it plays it for you. At the same time the site pairs you up with people of similar musical taste and you immediately begin to get their blips, that is the music they are playing / searching for. This is extremely fun as you discover new music and songs you didn’t know you liked, its a new way of sharing music and getting to know people.

Share:
  • Digg
  • del.icio.us
  • Facebook
  • Slashdot

Tags: , , , ,

Jose C Gomez on March 11th, 2009

Facebook has rolled out its new home to a limited number of users. It seems to be doing it in phases like every other company does these days. The changes aren’t very significant. They seem to be wanting to compete with TWITTER because the only new thing they offer is “live streaming” of posts and status changes from friends.

You’re looking at the real-time stream of posts from your friends and connections. Control the stream using the filters on the left. To hide posts from friends in this stream, click the “x” in the upper-right corner of a post. Learn more.

My fiance was one of the lucky first to be changed over and I am using her account to write this, it seems to me that either they haven’t turned the service fully on or they are missing the boat completely. I used my personal account to make an updated and I expected it to show automatically on her home page since its supposed to be a live stream. I waited several minutes and saw no change, I had to refresh the page for it to pull up the new status changes and updates. So far I am not very impressed although I must say that the change is small enough to get by without much trouble unlike the beacon feauture and the terms of service.

Here is a screens-shot of her profile after the change.

[singlepic=25]


How do you like the new change? Did it work as advertised?



Share:
  • Digg
  • del.icio.us
  • Facebook
  • Slashdot

Tags: , ,

Jose C Gomez on March 3rd, 2009

I really haven’t had much time to update lately. I am busy with work and the wedding plans and somehow this keeps getting pushed aside. I will try to make more time to update. I got several topics I’d like to cover, things I’ve ran across and I think deserve some attention. But right now is not the time so I will get back with you later.

Share:
  • Digg
  • del.icio.us
  • Facebook
  • Slashdot

Tags: , ,

Jose C Gomez on February 19th, 2009

Spanking ShakespeareI just finished reading Spanking Shakespeare by Jake Wizner and I must say that this is one of the best books I’ve read in a long time. Smart funny and a bit sarcastic. It recounts the story of Shakespeare Shapiro’s last year in high school, a witty senior that is a very talented writer. He is writing a memoir about his life as a year long assignment due before graduation in it he tells us about his family and his roller coaster social life. Buy it and read it I know you’ll love it.


Share:
  • Digg
  • del.icio.us
  • Facebook
  • Slashdot

Tags:

Jose C Gomez on February 12th, 2009

nova

HAVANA (Reuters) -- Cuba launched its own variant of the Linux computer operating system this week in the latest front of the communist island’s battle against what it views as U.S. hegemony. The Cuban variant, called Nova, was introduced at a Havana computer conference on “technological sovereignty” and is central to the Cuban government’s desire to replace the Microsoft software running most of the island’s more…

Cuba has always had a reputation for not allowing freedom of information and such, but with the launch of their new Linux Distro and now allowing regular citizens to obtain PCs, they are getting a lot closer to what would be considered freedom of information.

According to Hector Rodriguez, dean of the School of Free Software at Cuba’s University of Information Sciences, about 20 percent of computers in Cuba, where computer sales to the public began only last year, are currently using Linux

Being born and raised in Cuba i find it exciting that my country is finally moving up in the technology world, I love the initiative they have taken and I have faith that they will reach the goal of having Linux on the majority of the PCs they run.

Hector Rodriguez Dean of the School of Free Software and the University of Information Sciences is my cousin, I talk to him on a regular basis and I have just contacted him to get me more information about what the distro is based on and see if I can get my hands on a copy. I’ll post more updates as the become available to me.

But on a personal note and in contrast with the philosophy we have in this country I find it absurd and ridiculous that all our government and educational institutions have been standardized on Windows to the point that there are people out there that have no idea there are other operating systems available.

Can you imagine the amount of money that Schools and Universities would save if they are made the push to go open source. I am not saying get rid of windows but at least go open source with some of the apps used, replace MS Offie with Open Office and Photo-shop with Gimp these two replacements alone would account of millions of dollars in savings a year. We complain about the budget deficit but refuse to do simple things to help out.

This may be weird or odd but I think we should follow in Cuba’s foot steps when it comes to this.

Share:
  • Digg
  • del.icio.us
  • Facebook
  • Slashdot

Tags: , ,

Jose C Gomez on February 12th, 2009

tgi_fridays

TGIF has a copuon for a buy one get one free entree available on their site at the following link.

http://www.tgifridays.com/promos/bogo_coupon.aspx?fromeTarget

The site takes a few seconds to load but its totally worth it. Take someone out for dinner on Friday night!

Enjoy!

This coupon was found on slickdeals.net


Share:
  • Digg
  • del.icio.us
  • Facebook
  • Slashdot
Jose C Gomez on January 31st, 2009

wikipediaharmThis morning I was doing a search on google for a wikipedia article and I was surprised when I saw a google warning stating that this site may harm my computer. I wonder if its a google bug or if someone inserted bad code into a wikipedia article.

Edit:

Apparently any site you search for in google is being marked as malicious. I guess that clears up my question.

Everyone panic, google is broken woman and children first… Bah! everyone for themselves!

Edit:

Google has fixed the problem as of 10:18 AM. Everyone back inside… it was a false alarm.

Share:
  • Digg
  • del.icio.us
  • Facebook
  • Slashdot