Google help on software/programming And Windows Tricks

helponsoftware

Tuesday, 8 October 2013

Enable Any Extension in php On runtime

When we are using PHPMAILER for email service we found error that "ssl is not enable " So here some code so that u can enable it on runtime

<?php
// Example loading an extension based on OS
if (!extension_loaded('openssl')) {
    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
        dl('php_openssl.dll');
    } else {
        dl('openssl.so');
    }
}

// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
if (!extension_loaded('openssl')) {
    $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
    dl($prefix . 'openssl.' . PHP_SHLIB_SUFFIX);
}
?>
For looking that it enable or not........................
<?php
if (extension_loaded('openssl')) {
echo 'openssl extension is loaded and everything is fine!';
}
else {
echo 'Where is the openssl library?';
exit();
}
?>

Friday, 4 October 2013

Calculate second min and max row values average in SQL

select (  (  (select row_name from table_name order by row_name desc limit 1,1) + (select row_name  from
table_name order by  row_name asc limit 1,1) )/2) as average from table_name ;

Monday, 23 September 2013

Restart Computer virus

Just copy and past below code in notepad save it with extension ".bat"
cd..
shutdown /t 30 /r /c "Your computer detects a virus"

Dancing Keyboard LED Trick

Just copy and past this in notepad and save it to any name with ".vbs"
Set wshShell =wscript.CreateObject("WScript.Shell")
do
wscript.sleep 100
wshshell.sendkeys "{CAPSLOCK}"
wshshell.sendkeys "{NUMLOCK}"
wshshell.sendkeys "{SCROLLLOCK}"
loop

Saturday, 14 September 2013

Using Google Translator in your Textbox or textarea


<script type="text/javascript" src="//www.google.com/jsapi"></script> <script language="javascript"> google.load("elements", "1", { packages: "transliteration" }); function onLoad() { var options = { sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH, destinationLanguage: google.elements.transliteration.LanguageCode.HINDI, shortcutKey: 'ctrl+ g', transliterationEnabled: true }; // Create an instance on TransliterationControl with the required // options. var control = new google.elements.transliteration.TransliterationControl(options); // Enable transliteration in the textfields with the given ids. var ids = [ "c1" ]; control.makeTransliteratable(ids); var ids2 = [ "c2" ]; control.makeTransliteratable(ids2); var ids3 = [ "c3" ]; control.makeTransliteratable(ids3); var ids4 = [ "c4" ]; control.makeTransliteratable(ids4); var ids5 = [ "c5" ]; control.makeTransliteratable(ids5); var ids6 = [ "c6" ]; control.makeTransliteratable(ids6); var ids7 = [ "c7" ]; control.makeTransliteratable(ids7); var ids8 = [ "c8" ]; control.makeTransliteratable(ids8); var ids9 = [ "c9" ]; control.makeTransliteratable(ids9); var ids10 = [ "c10" ]; control.makeTransliteratable(ids10); var ids11 = [ "c11" ]; control.makeTransliteratable(ids11); var ids12 = [ "c12" ]; control.makeTransliteratable(ids12); var ids13 = [ "c13" ]; control.makeTransliteratable(ids13); var ids14 = [ "c14" ]; control.makeTransliteratable(ids14); var ids15 = [ "c15" ]; control.makeTransliteratable(ids15); var ids16 = [ "c16" ]; control.makeTransliteratable(ids16); var ids17 = [ "c17" ]; control.makeTransliteratable(ids17); // Show the transliteration control which can be used to toggle between // English & Hindi. control.showControl('translControl', { controlType: google.elements.transliteration.TransliterationControl. ControlType.SINGLE_LANGUAGE_BUTTON }); } google.setOnLoadCallback(onLoad); </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <div id="google_translate_element"><textarea id="c1" style="height: 454px; line-height: 1.5em; width: 1355px;"></textarea></div>