Slide Over Picture Preview

Remember saw Mac OS X built in features, where you can have a folder that having many pictures inside, and we can simply drag the mouse over the folder from left to right, to see all available pictures inside it. I try to somehow achieve that in a web page.

The first challenge is to get the mouse coordinate on the images itself, rather than relative to the screen. An useful codes provided by JavaScript is being handy, to attachEvent to the object.

Here is how to attach event to the respective custom function MouseMove, MouseUp and MouseDown:

IMG.attachEvent("onmousemove", MouseMove);  
IMG.attachEvent("onmouseup", MouseUp);  
IMG.attachEvent("onmousedown", MouseDown);  
IMG.attachEvent("onmouseout", MouseUp);

Which mean when ever mouse is moving on top of the IMG, it will trigger the MouseMove function.

The second challenge is to preload all the images before we can swap them on the “preview” mode. It is going to take a time to loading if we do.

Read more ... →

November 16, 2009 · Stephen Saw

AMD Phenom II 7 GHz!

Some dude in Finland had made an incredible overclock, extreme cooling system, and they just made a world record, 7GHz with AMD Phenom II.

But I’m still Intel guy after all :p

November 16, 2009 · Stephen Saw

ASP.NET 2.0 Changing Active Directory User’s Password

I have a project, to create a web interface to let user login to and change their Active Directory(AD) password. Never been touching the AD for my life, this being the great explore for me to deal with AD object in .NET framework.

To be able to access to AD, we will need to include a reference to our project, to include a System.DirecotryServices dll into our web project. In order to use the DirectoryEntry class, an imports statement will be needed, as following,

Imports System.DirectoryServices

To keep things simple, as I promised myself before I start the project, giving a visit to MSDN, I learnt that the LDAP path to the AD is something like this: LDAP://litwareinc/CN=Users,DC=litwareinc,DC=com , the litwareinc will be the domain name and the DC=com will the the .com thing (yes, I guess it). From the Internet, I learn a method to be call to change the password will be ChangePasswordand SetPassword. The SetPassword is the method that act as administrator, which does not need to specify a old password, so the suitable method for my case will be the ChangePassword.

First to create a DirectoryEntry object, I will need to provide the path to our AD, which is the LDAP://litwareinc/CN=Users,DC=litwareinc,DC=com, after that we need to invoke the ChangePassword method from the DirectoryEntry object, it will looks something like this:

Dim deObj As New DirectoryEntry("LDAP://litwareinc/CN=Users, DC=litwareinc, DC=com", UserName, Password, AuthenticationTypes.Secure)
deObj.Invoke("ChangePassword", New Object(){OldPassword, NewPassword})

First run, the above codes threw me an exception Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)). after doing some trial and error, realized that I need to specified the user’s display name at the path, e.g. I want to change the name for user Amy Alberts, which using AmyA as login name, and my AD path should be LDAP://litwareinc/CN=Amy Alberts,CN=Users,DC=litwareinc,DC=com.

The question came, people won’t input their full name when they login, how do I retrieve the full name based on the login ID? From Object Viewer, I found something useful, DirecotrySearcher, which allow me to set filter on the DirectoryEntry object created previously. OK, solved first problem, yet another came, what is the filter string looks like? Another wild guess (no harm from guessing), it will search by the properties, or maybe part of the key in the path. To find out list of the properties available, I will need to cycle through the DirectoryEntry’s child and print it out (day 2 of the project, which is the state I start coding, I don’t have Internet access, have to do it the hard way :S).

Read more ... →

November 12, 2009 · Stephen Saw

Asus Eee Keyboard

My favorite motherboard company is working on their new Eee PC product line, the Eee keyboard, there are few computer manufacturer that came out with desktop set that integrated the CPU into a LCD, and Asus is doing something different, they integrate the CPU into the keyboard.

Well, is a nice polished keyboard, backlit, with a dumb power off button somewhere near the backspace key, waiting for sweet accident to happen, but I guess it could be turn off. The nice thing about this is the touch screen, but wouldn’t it tiring if one have things that he/she need to monitor on the mini screen while working on something else on the LCD, he/she will probably get tired looking up and down all the time, but is cool if one can run some cool apps there.

The idea is good, but one have to buy the LCD separately, it has good mobility, but personal opinion, I will rather go for a decent laptop.

November 6, 2009 · Stephen Saw

Don’t Let Hacker Strip You

Having fooling around with SSLStrip for few days, and felt its potential in stripping information from the network packets, I tested it on myself few times, and I success every time.
Well, for HTTPS (SSL) site, the URL will shown in HTTPS, but when the hacker is sniffing around the network and waiting to strip off the secure connection data, the “s” is gone from the URL , which left HTTP, so if someone is careful enough will not going to login, but who know, not everybody check the URL before login (not sure if there is way to keep the HTTPS in URL while stripping the data).
Well, there is a add-on for FireFox, the SSLPasswdWarning, it shows a warning popup when it sense that something is wrong with the page, here is the screenshot:

FireFox showing SSL waring dialog
SSL warning

Note that in this example, the URL underlined with red color line, is HTTP, Gmail is using HTTPS, but not HTTP, so the SSLPasswdWarning sense something wrong with it, and warn the user. Hope to find other protection for other browser soon.
Stay safe!

update: Apparently it will show warning on every login that without HTTPS.

November 5, 2009 · Stephen Saw

Cairo, Windows Shell

Long waited before it goes public beta, Cairo Shell caught my eye on it’s sleek and simplicity looks over default Windows shell. But the public beta is nothing much. Screenshots here:

Cairo desktop
Cairo desktop

Cario folderstack
Cairo folderstack

The bar on the top is something like the bar in Ubuntu, where we can access to programs, shortcuts, time, and system tray (which crash the program always when I do a lots of right click there). It also use its own desktop icon, which can’t be rearrange, but it do have using custom context menu, which look nice, but didn’t serve much purposes.

Bottom part of the screen is the dock, but not exactly, it doesn’t allow rearrange, it doesn’t blink or jump when get active windows such as receiving new messenger message, it also doesn’t allow much to be done with the item there.

I noticed that in setting page, several items had been disabled, I guess is due to it is still in beta stage. This is pretty much everything of this beta, I love the color, but not the the whole thing at the moment, there are few more shell alternative out there, but I didn’t try those because they not really caught my eye.

October 29, 2009 · Stephen Saw

Hug A Developer Today

Appreciate developers, by supporting their product and be understand that develop a good product is not easy 🙂

October 29, 2009 · Stephen Saw

Going Deep Inside with Javascript

Came across a problem where I need to get the text value from the open source editor plug-in for web page, FCK Editor, the problem is I can’t use server script that came with the editor, because we need to do some data populating using Javascript.

The editor is using a lots of script, styles and it uses iframes, it is a iframe on our page, and inside itself, it got it’s own iframe, and it does not use text area or text box to do the text editing, it store the text we key inside body tag, this can be easily find out by using IE8, Safari or Chrome’s developer tools, and drill into the element.

The FCK Editor used 1 iframe, beside the one contained the whole editor. In order to retrieve the text value by using Javascript, we have to go in two frames and get the innerHTML of the body tag.

Here is it:

window.frames[0].window.frames[0].document.body.innerHTML;

The first frames[0] is to get the FCK Editor in our page, since our page only having one frame, which is FCK itself, the second frames[0] is the first iframe used inside the FCK Editor.

That snippet will return the text in the FCK Editor. Having fun with Javascript 🙂

October 27, 2009 · Stephen Saw

Give Your Brush a Live with LiveBrush

LiveBrush, a new product that created based on Adobe Air, is a very nice designing tools, with it, one can create a very nice looking design, and it looks stunning, even people who without designing sense can create nice design with it. Quick look on my design:

LiveBrush design
LiveBrush design

I used few of my favorites brush to create the simple piece of design. One nice thing about LiveBrush is, the the design is came with the brush, just pick up a brush, and start draw, and those nice effect will just simply come out automatically, without needing a good artistic touch on it!

Of course, with free version, the canvas size is limited, and brush set is fewer, the upgrade price is around USD30, which is far more cheaper than other Adobe products, is a nice and worth piece of tools for people who use to do this kind of design, specially those who use Photoshop.

Have tried with my Wacom tablet, unfortunately I didn’t see any setting that let me to set pressure sensitivity, and it also doesn’t work with pressure by default, besides, it also not work really well with the tablet, for some reason, when I draw, it doesn’t come out, and when I change brush or did something else, the stroke suddenly came out of nowhere, duh! But it still a nice nice tools, hope it will come in handy one day on my web design 🙂

Get LiveBrush here. Connection required to install, and Adobe Air will be installed along with LiveBrush.

October 26, 2009 · Stephen Saw

Vista Update Error 57A

Since Windows 7 launched, my Vista Sp2 show faces, it don’t want to get few update installed, keep on showing me error 57A, after few times trying, it just won’t install. So I head up to Microsoft update catalog site here , and download the update and install manually.

During install, it show me error that I don’t have permission on some registry key, giving me hell lots of craps number, so referring back to my earlier post, I manage to getting it installed, but it still showing me in Windows Update, but I can now install using Windows Update. Good to go! 🙂

October 26, 2009 · Stephen Saw