Articles

Checking whether a class is defined in CSS

Most of modern JS frameworks allow to check, whether an element has a particular class. However, I could not find something in jQuery related to checking, whether ther's a particular class in CSS. So, after googling for a while, I found the function which does this extremely well. I'm republishing it to save your time:

function getDefinedCss(s){
 if(!document.styleSheets) return '';
 if(typeof s== 'string') s= RegExp('\\b'+s+'\\b','i'); // IE capitalizes html selectors 

 var A, S, DS= document.styleSheets, n= DS.length, SA= [];
 while(n){
 S= DS[--n];
 A= (S.rules)? S.rules: S.cssRules;
 for(var i= 0, L= A.length; i<L; i++){
 tem= A[i].selectorText? [A[i].selectorText, A[i].style.cssText]: [A[i]+''];
 if(s.test(tem[0])) SA[SA.length]= tem;
 }
 }
 return SA.join('\n\n');
}
This function accepts an name of class or id(sure, without . or # ). In case it founds something, it returns the citation from CSS. Try it yourself!
 

Replacement for standart Windows Task Manager

 

Using Recovery console to restore and backup system registry

We all know that it's diffucult to make backup of Windows registry. This is because OS prevents direct access to the files, even for reading, so we have to use an alternate tools. But when you are running a Recovery console (as well as any other OS) you can access those files, copy and replace them.

Read more...

 

Putting yourself on a safe ground - installing a recovery console

This tip is suitable only if you are running Windows XP, 2000, 2003 Server, MCE 2005. Windows Vista and 7 do not include this feature - look here for more info: http://windowslive.com/Connect/Post/E8E5CC039D51E3DB-2123982

Windows Recovery console is a tool that helps you to recover your OS from serious errors. In fact, it's a small operating system from Microsoft (but incapable of running any programs, except several built-in commands). It is available from some installation CDs (when booting from them), but as well you can always install it on a hard drive - indo a hidden folder, cmdcons, on a boot partition.

To install it, press Win+R, type cmd, press ok, then type X:\i386\winnt32 /cmdcons (replace X with actual letter of your optical drive). After installation, a new option appears in your boot menu - it's a Recovery console. If a problem occures, you can use it to fix the issues.

 

Using command line to close hanged apps

Sometimes we find ourseleves in situation, in which an app hanged up(especially a full screen one), but we still have control over the machine - we can use start menu, other app etc. However, we cannot see what's going on because of the hanged app (and remove it from running processes in Task Manager (or Process Explorer).

Read more...

 

Choosing a telescope

 
Latest Tweets
Follow us on Twitter