Saturday, December 29, 2012

Why change passwords regularly?

Why do some websites like bank websites and such require us to change our passwords regularly? I fail to see how that makes our account more secure. If a hacker is able to figure out someone's password, they will immediately hack in and do their stuff. So How does changing our password every month make it more secure? It does not. It only makes our lives more difficult.

To make our accounts more secure we should make up strong passwords.

Monday, June 11, 2012

Facebook and IE8

FB stopped working on IE8 on my XP laptop some time ago. What a shame. IE8 is still in use. In fact, most of the hits on my site at are from IE8.

Thursday, April 12, 2012

Useless Comments in Code

How many times have you had to review and change code that someone else wrote, and you get frustrated by the lack of comments in the code, making it a frustrating and time consuming task to figure out how the code works and what it does?

Even more frustrating are comments that don't tell us anything. They just waste more of our time, time that we spend reading them, which becomes totally wasted time.

Here I will add actual wasteful comments that I came across while reviewing code. I have changed the names of variables, etc to preserve confidentiality. I believe that the authors of these comments should be provided with a free noose to hang themselves with.

Useless Comments

//BUG#8741, 10-03-00, some logic is required here
err... doesn't the whole code consist of "some logic"??? hello???
//BUG#8760, 10-11-00
This is great! Now all I have to do is go look up that bug... oh wait, we don't have that database anymore... aaargghh!!!
// BUG#8741, 10-03-00, added bool parameter
Oh ok. Its... like.... I blinked my eye... I turned my head... I peed in the toilet...
memcpy(pDest, pSrc, nCount); // copy data
hmm... really?
// If no data is found
if (tempstr.IsEmpty())
duh!

Thursday, March 22, 2012

PHP file read methods

This web page is, like, total coolness itself, in describing all the ways php can read a file. check it aaowwt:

http://www.ibm.com/developerworks/library/os-php-readfiles/

Problems downloading a large file over wifi

My wife's friend had a lot of trouble downloading a large (125MB) mp3 file onto her laptop from an online class website. I copied the file to my dropbox to see if that would work for her but she still could not download it. Then I suggested she try downloading on a wired computer instead of downloading it on her wireless (wifi) laptop. I suspected that the slower download speed over wifi may be causing timeout problems somewhere in the network route. Guess what, it worked! Now she just has to get her husband to transfer the huge file from her desktop to her laptop.

Sunday, February 19, 2012

gif animation speed problem

animated gif files contain a delay specified after each frame. Unfortunately some browsers tweak the frame rate because they think it is incorrect. Here is helpful informatino for those making animated gifs and want them to animate at the same rate in Mozilla based browsers (FireFox, Chrome, etc) and IE:


Nearly all browsers change 0 ms and 10 ms delays to 100 ms. If a GIF uses delays of 0 ms or 10 ms, it will look identical in Firefox and IE.

IE currently changes 20-50 ms delays to 100 ms. Firefox does not change them.

Friday, January 20, 2012

Apple and the educational e-book business fiasco

The tech world is abuzz with Apple's new iBook app that lets authors create their own interactive e-books. The catch is that the books, if sold (not free), may only be sold via the Apple eco-system.

I believe that educational material needs to be inexpensive and easily accessible to the masses. And it must not be controlled by one company.

Apple needs to promote and assist the publishing industry in developing an open interactive e-book standard for all kinds of textbooks, not just K-12 textbooks. Students should have the freedom to choose the best reader app on the best device they can afford. Those who love the iPad and can afford it will increase Apple's sales in the student world, while those who can afford a lesser expensive tablet or laptop or netbook will not be left out of the educational experience.

Wednesday, January 11, 2012

Visual Studio referenced library namespace problem

Using Visual Studio 2010, I made a WCF Service Library. It took a while to figure out how to test the code. The solution was simple though: 
  • Make a WCF Service Library project, selected form the Visual C# / WCF tab on the New Project dialog.
  • In the same solution space, add a new App project selected from the Visual C# / Windows tab on the New Project dialog.
  • In the Windows App project, Add a Reference to the WCF library project.
  • In the main function of the Windows App, use intellisense to type out the library name space [dot] interface class name and make a new object of the same type.
  • Use any of the exposed methods or properties of the object.

If you need to make a WCF app, which may in turn use the WCF library, there is a problem.

If you use Visual Studio 2010 to build the app then debug it, it just shows the list of files in the folder. If you click the .svc file for the app, it shows you a help page showing you how to generate the client application code to use the WCF app. This is so because the WCF app needs a host. The debugger generates a virtual IIS host. But to invoke the methods of the WCF app, you still need a client app that calls its methods.
So how do you quickly start to debug a WCF app?
  • Make a WCF Service App project, selected form the Visual C# / WCF tab on the New Project dialog.
  • Add a new App project of type Visual C# in the same solution space.
  • Add a Service Reference to the WCF library project. Give it a namespace, say Appname.
  • Use intellisense to type out the library name space [dot] interface class name and make a new object of the type.
  • Use any of the exposed methods or properties of the object.
  • Build the solution and... you get an error of the sort "The type 'Appname' does not exist in the type 'Client.Appname.Client'". What gives?
The problem is due to a bug in the visual studio automatic code generator, and you need to fix it manually:
  • Double click the error to open the Reference.cs file that has the error.
  • Search and replace all error occurrences of Client.Appname with Appname (use your own client and app names). To make sure you are replacing the correct ones, make sure there is a squiggly line under that app name, and remove the stuff starting from the dot before it, back one word.