Ruslan Ulanov’s Codeshack

The developer’s notebook

Mobile Web Best Practices 1.0

Posted in CSS, HTML, JavaScript, mobile by Ruslan Ulanov on the August 7th, 2008

The World Wide Web Consortium (W3C) has recently published a document called Mobile Web Best Practices 1.0.

This document specifies Best Practices for delivering Web content to mobile devices. The principal objective is to improve the user experience of the Web when accessed from such devices.

It’s a good step toward making the Web accessible to millions of small screen devices, not blessed with a combination of iPhone’s hi-res LCD and a powerful Safari browser. :)

The document is available from W3C’s web site http://www.w3.org/TR/2008/REC-mobile-bp-20080729/

Unlocker for “in use” files

Posted in Utility by Ruslan Ulanov on the July 31st, 2008

How many times have you had to completely reboot Windows to get Explorer or some other greed process to let go of a file you needed …

Unlocker really rocks.  It integrates into the right click menu and can show you what processes have a lock on a file.  You can shutdown the process (preferred) or simply unlock the file.  Not only is it free, but the author provides a comparison matrix against 19 other utilities that unlock files and it is apparent he has put some thought into making his comprehensive!

Obviously you have to be circumspect about ending processes to release a file lock - but I’ve seen Windows Explorer hang on to a file until reboot when it isn’t really using it. 

Visit Site

Source: http://desktopengineer.com

MS Patterns & Practices

Posted in C/C++, VB.NET by Ruslan Ulanov on the July 31st, 2008

Microsoft has assembled a nice library of best practices for all sorts of applications from Web Applications and Services to Desktop and Mobile Applications.

Quoting the site…
Microsoft patterns & practices was created to meet the demands of architects and application developers seeking guidance on how to apply Microsoft’s array of products and technologies to common application development scenarios and technical challenges. Microsoft patterns & practices are Microsoft’s proven recommendations for how to design, develop, deploy, and operate architecturally sound application for the Microsoft platform.

Check it out in Microsoft patterns & practices Developer Center.

18 Ways to Kill Your Process

Posted in C/C++ by Ruslan Ulanov on the July 31st, 2008

Advanced Process Termination utility from Diamond Computer Systems Pty. Ltd. provides 18 unique process attacks:

  • 2 kernel-mode termination techniques
  • 12 user-mode process termination techniques
  • 2 suspension techniques
  • 2 fatal crash techniques

This arsenal makes APT ideal for testing the resistance of software to termination attacks, testing the configuration of your own security programs, as well as allowing you to terminate stubborn software that simply refuses to die.

Kernel Kill #1 - Attempts to terminate the process from a driver using the kernel-level ZwTerminateThread function against every thread in the target process.
Main functions: ZwTerminateThread (ntoskrnl.exe)

Kernel Kill #2 - Attempts to terminate the process from a driver using the kernel-level ZwTerminateProcess function against the target process.
Main functions: ZwTerminateProcess (ntoskrnl.exe) (more…)

Fixing IE6/IE7 style issues

Posted in CSS, HTML by Ruslan Ulanov on the May 27th, 2008

Check out Cascading Style Sheet Compatibility in Internet Explorer 7 article at MSDN.

It explains how to address IE7 compatibility issues in CSS.
In short, there were several bugs in CSS parser of IE6. Some CSS constructs (filters) that were applied by IE6 are ignored by IE7 and above - like “* html”. We could take advantage of these broken filters to create IE6-specific rules.

For example, first define a style that will look fine in IE7:

#box { top: 2px; }

then (below that rule in CSS file) use CSS filter “* html” to override it with IE6 style:

* html #box { top: 4px; }

This second rule will be ignored by IE7 and above, but will fix the problematic style in IE6.

There’s another approach to fixing IE6/IE7 issues - it’s conditional comments.

Consider the following code that should be placed in the HEAD section of HTML:

<!–[if IE 6]>
<link rel=”stylesheet” type=”text/css” href=”/css/ie6.css” />
<![endif]–>

The <!–[if IE 6]> and <![endif]–> tags are used to filter out content that will be parsed by IE6 browser only, any other browser will ignore anything that’s inside these tags.

For more info see About Conditional Comments on MSDN or more user-friendlier explanation at  Quirksmode.

IRT.org Knowledge Base

Posted in CSS, HTML, JavaScript, VBScript by Ruslan Ulanov on the May 5th, 2008

IRT.org has a nice collection of FAQs on DHTML, JS, Java, CSS, etc.

http://www.irt.org/faq.htm

Use CSS to create an image map

Posted in CSS, HTML by Ruslan Ulanov on the April 29th, 2008

TechRepublic.com has an article on using CSS to create an image map. Nice and simple technique though it won’t work if you need to define complex shapes (like state boundaries on the map of USA, etc.).

Javascript equivalent for PHP’s functions

Posted in JavaScript by Ruslan Ulanov on the March 13th, 2008

Mr. Kevin van Zonneveld has a nice collection of PHP functions ported to JS.

For example sprintf:

(more…)

mredkj.com

Posted in JavaScript, VB.NET by Ruslan Ulanov on the March 13th, 2008

A good JS and VB.NET resource with unpronounceable name at http://www.mredkj.com/index.html

Dynamically loading an external JavaScript or CSS file

Posted in JavaScript by Ruslan Ulanov on the March 6th, 2008

To load a .js or .css file dynamically, in a nutshell, it means using DOM methods to first create a swanky new “SCRIPT” or “LINK” element, assign it the appropriate attributes, and finally, use element.appendChild() to add the element to the desired location within the document tree. It sounds a lot more fancy than it really is. Lets see how it all comes together:

 (more…)