Monday, April 22, 2013

Database driven C# Unit Testing with Visual Studio 2012

Recently I am engaged in C# develop, as a long time C/C++ and Java developer I get used to unit test mostly in Java with JUnit and suites of tools that working with it.  I was then investigate whats available for C# development platform.

I have found Visual Studio has their own unit testing platform/framework build in and it is very powerful.  It has a data drive feature the able to use a table to drive the test, so that it can use part of the whole table to test a method.  The trouble is most example are using MS SQL or XML as its example, but sadly none of my project is using MS SQL and some of the testing I require to utilize MySQL's data to test the unit.

Lucky after I did some search and get some understanding on how it picks up its data source.  I am now able to use MySQL or MS Access database to drive the test.

MS Access as unit test's datasource
Using MS Access is easy, since all the driver are the same the most examples out there.  Some trick that I found are:
1. Access database file can be accessed at the working (debugging) directory, you may want to create the database at the project directory then set the project to copy the database file to the debugging location.
2. The database is able to handle UNICODE, so I can now test my application with Chinese characters as the expected result(s).

Following is the setup attributes for using MS Access 2010:

        [TestMethod]
        [DataSource("System.Data.OleDb",


            "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=TestDB.accdb",
            "db_table", DataAccessMethod.Sequential)]

MySQL as unit test's datasource 
To use MySQL as datasource, you first need to install the MySQL Connector/Net to allow .Net to access the database.
        [DataSource("MySql.Data.MySqlClient",
            "server=localhost;userid=username;password=password;database=TestDB",
            "db_table", DataAccessMethod.Sequential)]


Monday, April 16, 2012

Is that how we collect biometric in a humane way?


To track militants, U.S. is employing technology that never forgets a face.  But will you want to be the one the provide your biometircs in such manner?  I think we need better technology to make this process easier and in a humane way.  

Does we follow the golden rule (One should treat others as one would like others to treat oneself)?  I do not think the officer would like the treatment that his was conducting, if he were the detainee.

I was once a biometric designer as well, sadly we always focus on the technology and forget about the human factors and the practicality.


3M Cogent Awarded Long Term Contract in Supplying High-Resolution LiveScan Booking Stations to Hong Kong Police Force

Source:http://www.businesswire.com/portal/site/3m/index.jsp?ndmViewId=news_view&ndmConfigId=1000941&newsId=20120409005608&newsLang=en&goback=%2Egde_1788701_member_106739118

PASADENA, Calif.--(BUSINESS WIRE)--3M Cogent announced today that it was awarded a 10-year contract to supply high-resolution LiveScan booking systems and biometric identification solutions to the Hong Kong Police Force (HKPF). The HKPF awarded the contract to 3M Cogent based on their proven performance, merit and value proposition. 3M Cogent software and hardware will be used to capture tenprints and palm prints in accordance with the HKPF’s ANSI/NIST standard.

“3M Cogent’s LiveScans will interface seamlessly with other HKPF systems, significantly improving subject booking operations, streamlining the overall arrest processing procedure, and further enhancing our operational efficiencies and crime-solving capabilities.”
Under the contract, 3M Cogent will supply HKPF with ninety-two ruggedized LiveScan booking stations with adjustable cabinets, FBI certified 1000 pixels-per-inch (ppi) livescans for tenprint and palm capture, and ongoing support and maintenance. The LiveScan stations will be deployed into thirty-two HKPF branches and three immigration locations across the Hong Kong Special Administrative Region. 3M Cogent’s LiveScans will enable HKPF to electronically submit fingerprint and palm print records to the HKPF’s backend systems, including the Computer Assisted Palmprint and Fingerprint Identification System (CAPFIS). 3M Cogent was responsible for implementing the HKPF CAPFIS in 2009.

“Implementing new LiveScan systems is imperative to the modernization of HKPF’s biometric identification capabilities,” stated an official with the Hong Kong Police Force. “3M Cogent’s LiveScans will interface seamlessly with other HKPF systems, significantly improving subject booking operations, streamlining the overall arrest processing procedure, and further enhancing our operational efficiencies and crime-solving capabilities.”

“We are pleased that HKPF has decided to build upon our current relationship,” commented Matt Pepe, Chief Operating Officer of 3M Cogent. “HKPF’s decision re-affirms 3M Cogent as an industry leader in providing biometric identification solutions. Under 3M’s corporate leadership, we are committed to providing world-class, innovative biometric products, systems and solutions to our customers through our continuous investment in research and development.”

For more information, visit http://www.cogentsystems.com/LE_overview.asp

About 3M Security Systems Division
3M Security Systems Division, including 3M Cogent, is a trusted partner and industry leader in delivering end-to-end, innovative security solutions to businesses and governments worldwide—helping to ensure the security of people, documents and goods. With an unmatched mix of leading technologies in biometrics and credentialing as well as expert systems integration and support, 3M applies its knowledge and products to array of security applications, including secure border management, counterfeit and fraud resistant ID and passport document issuance, biometric identification for governments and law enforcement agencies, and identity solutions for commercial enterprises. 3M Security Systems technologies are used in over 100 countries around the world.

About 3M
3M captures the spark of new ideas and transforms them into thousands of ingenious products. Our culture of creative collaboration inspires a never-ending stream of powerful technologies that make life better. 3M is the innovation company that never stops inventing. With $30 billion in sales, 3M employs 84,000 people worldwide and has operations in more than 65 countries. For more information, visit www.3M.com or follow @3MNews on Twitter.

3M is a trademark of 3M Company.

Contacts

Karwoski & Courage Public Relations
Brooke Baxley
612-342-9817
b.baxley@creativepr.com
or
3M
Connie Thompson
3M Public Relations
651-733-8914

Friday, July 15, 2011

StereoPhoto Maker a MPO 3D Photo conversion tool

Last time I was trying the MPO Toolbox, it was a command prompt tools that may not be useful to everyone.  Now I found another excellent free good tool call StereoPhoto Maker.  It has a nice and easy to use GUI. I had successfully tested this program with my varies of my MPO files.  It can cross convert different 3D picture formats.

Following is the image that I produce with StereoPhoto Maker, the image was from my Panasonic DMC-ZS10 Camera with its manual 3D mode.  This program make the MPO file that contain two images into a color anaglyph image.




You can get the program from the author's web site : http://stereo.jpn.org/eng/stphmkr/index.html

Ref: http://www.wikihow.com/Make-3D-Images-Using-StereoPhoto-Maker

Thursday, July 7, 2011

Morgan Stanley Data Breach Hits Investors

Mcken's Comment: Morgan Stanley has lost 2 CDs with 34,000 personal information on it.  The information includes clients' names, addresses, account and tax identification numbers, the income earned on the investments in 2010, and for some clients Social Security numbers. Morgan Stanley's letter said: "The data was saved on two CD-ROMs that were protected by passwords, according to the letters, but the CDs were not encrypted".   
No encryption, but protected by password!  What does it mean?  Password protection on a CD without encryption?  I can only translate it as: no encryption and the data is on the CD in clean and waiting for someone to look at.
This news seems suggest to us that they do not even understand if there is anything that protecting the CD. Protected by password mean nothing without it associated to a system that protecting the content.  If they use a password protected ZIP, then we can say it is encrypted.  But in the text, there is not context of how that password is for!  I expecting Morgan Stanley should do better to explain what was happening and what kind of protect if any exist on those CDs.
There are two sources:

[07/05/2011] Personal information belonging to 34,000 investment clients of Morgan Stanley Smith Barney has been lost, and possibly stolen, in a data breach. According to two letters sent to clients, and obtained by Credit.com, the information includes clients’ names, addresses, account and tax identification numbers, the income earned on the investments in 2010, and—for some clients—Social Security numbers.
The data was saved on two CD-ROMs that were protected by passwords, according to the letters, but the CDs were not encrypted.

http://www.credit.com/blog/2011/07/morgan-stanley-data-breach-hits-investors/

Window Productivity Keyboard Shortcuts

Function Keys
F1 : Help
F2 : Rename
F6 : Focus cursor on URL in browser

Window Key +
Windows + R = Launch Exec
Windows + E = Launch Windows Explorer
Windows + D : Minimize all windows, again will restore windows
Windows + M :  only minimizes
Windows + Shift + M : Restore previously minimized windows
Windows + L : Lock the computer
Windows + Tab : Window 7 : Cycle between windows
Windows + Spacebar : Quick peek at the desktop
Windows + Left or Right Arrow : Auto resize the active window
Windows + Shift + Left or Right Arrow : move the active application to left or right monitor
Windows + [#] : Press Windows + 1 to launch the first pinned app in your Taskbar (from left to right). Windows + 2 launches the second one, Windows + 3 launches the third one, and so on
Windows + T : Cycle pined apps that opens
Windows + (+/-) : Zoom in or out with magnified view



Control Key +
Ctrl + Tab in a browser :  go to next tab
Ctrl + Shift + Tab in a browser : go to previous tab
CTRL + Shift + Esc  : Bring up task manager
CTRL + K: focus on the search bar in Firefox
CTRL + G: in a browser, search on the page for the last term you searched
CTRL + W: [Browser] close the current tab
CTRL + [#]: [Browser] Go to that number tab
CTRL + number : [Browser] go to tab #number (eg : Ctrl + 1 (top of the Q) = go to tab 1)
CTRL + W : close the tab/window
CTRL + R : [Browser] Reload the tab
CTRL + Backspace : Delete entire words
CTRL + 0 : [Browser] Return to normal zoom
CTRL + T : [Browser] Open a new tab
CTRL + Shirt + T : [Browser] Reopen closed tab
CTRL + L : [Browser] Focus Cursor on URL/Search Field
CTRL+A: Select all the items

CTRL + ESC : Open Start menu
CTRL + C : Copy
CTRL + X : Cut
CTRL + V : Paste
CTRL + Z : Undo
CTRL + Y : Redo
CTRL + B : Bold
CTRL + U : Underline
CTRL + I : Italic



ALT Key +
ALT + Tab : Go to next Application
ALT + Shift  + Tab : Go to previous Application
ALT + Prt Scr : Take a screenshot of the active window only




References:
http://mashable.com/2011/07/06/keyboard-shortcuts-windows/#176617-Lock-the-computer
http://support.microsoft.com/kb/126449
http://www.gizmodo.com.au/2011/07/the-10-coolest-windows-shortcuts-you-never-knew-about/

Tuesday, June 28, 2011

Most Popular passwords

Has been working in data security field for so long I always remember one password lesson that I have learn when we were back to those day we only able to using only 4 digit pin, the most common PIN beside birthdays and telephone number related then the next popular pin numbers are same digits 0000 to 9999 and continue digits 1234, 2345, 9876 etc. World haven't changes that much, even up to now, a lot of banks still allow only 4 digit pins. I always wonder why they still restricting that length of the pin, while the ANSI X9.8 PIN block standard is allowing up to 12 digits. Unless they are using some really old standards, that were over 20 years old! But then the popular pin or password still have not change much, its all blame on human nature!

So here is the list, I gathered from the book Perfect Passwords, Mark Burnett 2005.  Caution that hackers will using these popular passwords to attack your account!  Make your password hard to hack by combining upper and lower character, numbers and use words that are not in dictionaries.



NOTop 1-100Top 101–200Top 201–300Top 301–400Top 401–500
1123456porschefirebirdprincerosebud
2passwordguitarbutterbeachjaguar
312345678chelseaunitedamateurgreat
41234blackturtle7777777cool
5pussydiamondsteelersmuffincooper
612345nascartiffanyredsox1313
7dragonjacksonzxcvbnstarscorpio
8qwertycamerontomcattestingmountain
9696969654321golfshannonmadison
10mustangcomputerbond007murphy987654
11letmeinamandabearfrankbrazil
12baseballwizardtigerhannahlauren
13masterxxxxxxxxdoctordavejapan
14michaelmoneygatewayeagle1naked
15footballphoenixgators11111squirt
16shadowmickeyangelmotherstars
17monkeybaileyjuniornathanapple
18abc123knightthx1138raidersalexis
19passicemanpornosteveaaaa
20fuckmetigersbadboyforeverbonnie
216969purpledebbieangelapeaches
22jordanandreaspiderviperjasmine
23harleyhornymelissaou812kevin
24rangerdakotaboogerjakematt
25iwantuaaaaaa1212loversqwertyui
26jenniferplayerflyerssuckitdanielle
27huntersunshinefishgregorybeaver
28fuckmorganpornbuddy4321
292000starwarsmatrixwhatever4128
30testboomerteensyoungrunner
31batmancowboysscoobynicholasswimming
32trustno1edwardjasonluckydolphin
33thomascharleswalterhelpmegordon
34tiggergirlscumshotjackiecasper
35robertbooboobostonmonicastupid
36accesscoffeebravesmidnightshit
37lovexxxxxxyankeecollegesaturn
38busterbulldogloverbabygemini
391234567ncc1701barneycuntapples
40soccerrabbitvictorbrianaugust
41hockeypeanuttuckermark3333
42killerjohnprincessstartrekcanada
43georgejohnnymercedessierrablazer
44sexygandalf5150leathercumming
45andrewspankydoggie232323hunting
46charliewinterzzzzzz4444kitty
47supermanbrandygunnerbeavisrainbow
48assholecompaqhorneybigcock112233
49fuckyoucarlosbubbahappyarthur
50dallastennis2112sophiecream
51jessicajamesfredladiescalvin
52pantiesmikejohnsonnaughtyshaved
53pepperbrandonxxxxxgiantssurfer
541111fendertitsbootysamson
55austinanthonymemberblondekelly
56williamblowmeboobsfuckedpaul
57danielferraridonaldgoldenmine
58golfercookiebigdaddy0king
59summerchickenbroncofireracing
60heathermaverickpenissandra5555
61hammerchicagovoyagerpookieeagle
62yankeesjosephrangerspackershentai
63joshuadiablobirdieeinsteinnewyork
64maggiesexsextroubledolphinslittle
65bitemehardcorewhite0redwings
66enter666666topgunchevysmith
67ashleywilliebigtitswinstonsticky
68thunderwelcomebitcheswarriorcocacola
69cowboychrisgreensammyanimal
70silverpanthersuperslutbroncos
71richardyamahaqazwsx8675309private
72fuckerjustinmagiczxcvbnmskippy
73orangebananalakersnipplesmarvin
74merlindriverrachelpowerblondes
75michellemarineslayervictoriaenjoy
76corvetteangelsscottasdfghgirl
77bigdogfishing2222vaginaapollo
78cheesedavidasdftoyotaparker
79matthewmaddogvideotravisqwert
80121212hooterslondonhotdogtime
81patrickwilson7777parissydney
82martinbuttheadmarlbororockwomen
83freedomdennissrinivasxxxxvoodoo
84gingerfuckinginternetextrememagnum
85blowjobcaptainactionredskinsjuice
86nicolebigdickcartereroticabgrtyu
87sparkychesterjasperdirty777777
88yellowsmokeymonsterforddreams
89camaroxavierteresafreddymaxwell
90secretstevenjeremyarsenalmusic
91dickviking11111111access14rush2112
92falconsnoopybillwolfrussia
93taylorbluecrystalnipplescorpion
94111111eaglespeteriloveyourebecca
95131313winnerpussiesalextester
96123123samanthacockfloridamistress
97bitchhousebeerericphantom
98hellomillerrocketlegendbilly
99scooterflowerthemanmovie6666
100pleasejackoliversuccessalbert
Source: Perfect Passwords, Mark Burnett 2005