Wednesday, April 07, 2010
WPF
WPF (Windows Presentation Foundation) is really kicking my butt! Whew! I'm just glad that the Internet is full of people that selflessly (I would like to think) shares their code solutions to problems that they've encountered. Without their help, I'd be totally LOST! God bless them all!
Friday, March 05, 2010
SkinPut.
http://www.youtube.com/watch?v=g3XPUdW9Ryg
This is a good idea. I wonder when inventors will start utilizing facial gestures to control devices. Now, that would be something. To 'sleep' my computer all I have to do is imitate a yawn, and presto! the computer goes to 'sleep'. Fascinating.
This is a good idea. I wonder when inventors will start utilizing facial gestures to control devices. Now, that would be something. To 'sleep' my computer all I have to do is imitate a yawn, and presto! the computer goes to 'sleep'. Fascinating.
Saturday, February 27, 2010
Meaningful code comments...
Nothing frustrates me more than looking at someone else's code and searching for that elusive bug that killed part of the application.
The code I looked at yesterday is undocumented and did not use any of the standard naming conventions for C# which makes it doubly hard! Well, to be truthful there was some comments here and there but the way the comments were written is what ticks me off. Here's a sample:
Did you see what I meant?
The comment alone wasn't very helpful, at all!
It could have been written in this manner:
Code comments should say 'why' it is written that way and the code itself shows 'how' it's done.
The code I looked at yesterday is undocumented and did not use any of the standard naming conventions for C# which makes it doubly hard! Well, to be truthful there was some comments here and there but the way the comments were written is what ticks me off. Here's a sample:
// If index @ 0 not equal to mLinks count
if (ckbSkip.Checked
&& mLinks.SelectedItems[0].Index != mLinks.Items.Count - 1)
{
mLinks.Items[mLinks.SelectedItems[0].Index + 1].Selected = true;
mLinks.SelectedItems[0].Selected = false;
}
Did you see what I meant?
The comment alone wasn't very helpful, at all!
It could have been written in this manner:
//if user wants to skip to next mfg
//and we are not at end of list, go ahead
if (ckbSkip.Checked
&& mLinks.SelectedItems[0].Index != mLinks.Items.Count - 1)
{
mLinks.Items[mLinks.SelectedItems[0].Index + 1].Selected = true;
mLinks.SelectedItems[0].Selected = false;
}
Code comments should say 'why' it is written that way and the code itself shows 'how' it's done.
Monday, February 22, 2010
Fake Flash Memory Products
If you are planning to bid or buy a flash memory product (USB sticks, SD cards, Sony sticks) from eBay or other auction sites, be warned! There are literally thousands of sellers out there selling fakes. Advertised as 16GB or 32GB, their true capacity is actually somewhere between 1 or 2GB. Be specially wary of sellers from Asia (China, Hong Kong, Singapore, etc) that sells USB drives. They are priced so low you might be tempted to bid for one.
If you do, test it immediately! One of the software tools that has been around and is very reliable is H2testw v1.4. It was created to specifically test for counterfeit USB drives. At the end of the test it will output the following:
The media is likely to be defective.
1.9 GByte OK (4044672 sectors)
14.0 GByte DATA LOST (29483136 sectors)
Details:14.0 GByte overwritten (29483136 sectors)
0 KByte slightly changed (< 8 bit/sector, 0 sectors)
0 KByte corrupted (0 sectors)
1 MByte aliased memory (2048 sectors)
First error at offset: 0x000000007b6f0000
Expected: 0x000000007b6f0000
Found: 0x00000003ff260000
H2testw version 1.3
Writing speed: 4.44 MByte/s
Reading speed: 14.3 MByte/s
H2testw v1.4
Make sure you save this output so that you can offer it as proof that the USB you just paid for is a fake. If you bought the item from eBay report it immediately by opening a case against the seller and offer as proof the output from H2testw v1.4. Do not leave a positive/neutral feedback to the seller nor should you return the item to the seller. Otherwise, the seller will just re-list it back on eBay.
For more details head over to SOSFakeFlash.
If you do, test it immediately! One of the software tools that has been around and is very reliable is H2testw v1.4. It was created to specifically test for counterfeit USB drives. At the end of the test it will output the following:
The media is likely to be defective.
1.9 GByte OK (4044672 sectors)
14.0 GByte DATA LOST (29483136 sectors)
Details:14.0 GByte overwritten (29483136 sectors)
0 KByte slightly changed (< 8 bit/sector, 0 sectors)
0 KByte corrupted (0 sectors)
1 MByte aliased memory (2048 sectors)
First error at offset: 0x000000007b6f0000
Expected: 0x000000007b6f0000
Found: 0x00000003ff260000
H2testw version 1.3
Writing speed: 4.44 MByte/s
Reading speed: 14.3 MByte/s
H2testw v1.4
Make sure you save this output so that you can offer it as proof that the USB you just paid for is a fake. If you bought the item from eBay report it immediately by opening a case against the seller and offer as proof the output from H2testw v1.4. Do not leave a positive/neutral feedback to the seller nor should you return the item to the seller. Otherwise, the seller will just re-list it back on eBay.
For more details head over to SOSFakeFlash.
The Life Cycle Of A Programmer
source: http://librenix.com/?inode=38
** primitive languages used an obsolete numbering system called 'base ten' which somehow encouraged programmers to create date bugs related to the value 11111010000 (?)
- binary age(*) 0 > 1 (baby): learns structure of first language
- 1 > 10 (toddler): walks, learns many keywords of first language and significance of context, develops philosophy of life
- 10 > 100 (little kid): violates rules of language, is housetrained (usually)
- 100 > 1000 (brat): violates intent of language, starts school to learn new ways to abuse language
- 1000 > 10000 (big kid): reaches physical maturity, reverts to subset of language with local variations -- causing parsing errors among programmers of all other ages
- 10000 > 100000 (trainee): reaches mental maturity (usually), learns new languages, starts to work (usually), marries (maybe)
- 100000 > 1000000 (programmer): reaches emotional maturity (usually) and begins to decline physically, works, dreams of times of no work both past and future, divorces (usually), remarries (maybe)
- 1000000 > 10000000 (curmudgeon): forgets languages, declines in usefulness; almost all programmers are retired during this age range, although in the past some remained working well into this range to deactivate millenium(**) bugs in their older code
- => 10000000 (zombie): this is currently not possible due to the age field having been defined as a signed char; while negative ages are not logically possible, it is believed that the negative range was once used for returning errors from age-related functions and this definition has been retained for historical compatibility (the language committee apologizes for any inconvenience this may cause)
** primitive languages used an obsolete numbering system called 'base ten' which somehow encouraged programmers to create date bugs related to the value 11111010000 (?)
Wednesday, February 17, 2010
2010 CWE/SANS Top 25 Most Dangerous Programming Errors
Cross-site scripting and SQL injection are the 1-2 punch of security weaknesses in 2010. Even when a software package doesn't primarily run on the web, there's a good chance that it has a web-based management interface or HTML-based output formats that allow cross-site scripting. For data-rich software applications, SQL injection is the means to steal the keys to the kingdom. The classic buffer overflow comes in third, while more complex buffer overflow variants are sprinkled in the rest of the Top 25.
Source: http://cwe.mitre.org/top25/index.html
Source: http://cwe.mitre.org/top25/index.html
Wired on Apple's iPad
Wired on Apple's iPad. Pretty cool video below.
Makes me wish that I have one right now!
It also makes me wonder if Wired is giving this away for free (I must be hallucinating) or charging me a whole lot of money to view their stuff on the iPad. Even the New Your Times is in a quandary as to how much to charge for the iPad version of the paper.
Makes me wish that I have one right now!
It also makes me wonder if Wired is giving this away for free (I must be hallucinating) or charging me a whole lot of money to view their stuff on the iPad. Even the New Your Times is in a quandary as to how much to charge for the iPad version of the paper.
Subscribe to:
Posts (Atom)
