Sunday, November 8, 2009

Restrict users to specified programs or applications in WindowsXp

-Login as an administarator
-Run Policy editor ( start - run - gpedit.msc )
-Navigate following folder...
Local Computer Policy\User Configuration\Administrative Templates\System in the left pane
-Now double click the option Don't Run specified Windows applications in the right pane.
-Now select the Enabled and click Show button
-In the Show Contents dialog box type the name of the application (.exe file name) which you want to allow user not to run under List of Not allowed applications statement.
For eg. type iexplore.exe not to allow Internet Explorer to run.
-If you want to add more applications then type their names under the first one and so on.
-Click OK button.
-Click Apply and then OK button in Run only specified Windows applications window.
-Close Local Group Policy Editor window and you are done.

More on Policy Editor...
How To Use the Group Policy Editor to Manage Local Computer Policy in Windows XP

Thursday, July 2, 2009

Re: Divya Bhaskar noted my Open Source efforts

Divya Bhaskar a leading Gujarati Daily took note of my Open source efforts a part of Social-Eduction Projects.

My FireFox Add-Ons "Income Tax Calculator" now goes to public...

Divya Bhaskar...
http://epaper.divyabhaskar.co.in/bigwin.aspx?url=EpaperImages\01072009\Aa123-large.jpg&eddate=7/1/2009&pageno=3&edition=45&prntid=113913&bxid=966&pgno=3

My Add-on link...
https://addons.mozilla.org/en-US/firefox/addon/10095

I am very much thank full to column writer Mr.Himanshu Kikani for taking my efforts to public and also appreciate his creation http://cybersafar.com/

Sunday, June 28, 2009

Re: LOAD DATA INFILE selective column

I want to import data from Local file(CSV) to Mysql 5.0 table with only selected column.

My PHP code is... as per Mysql5.0 syntax
$query="LOAD DATA LOCAL INFILE '". @mysql_escape_string($tmpupfile) . "' INTO TABLE item_master (item_code,item_desc) FIELDS TERMINATED BY '" . "," ."'";

It gives syntax error.

Following works fine... put column(field) list at the end.

$query="LOAD DATA LOCAL INFILE '". @mysql_escape_string($tmpupfile) . "' INTO TABLE item_master FIELDS TERMINATED BY '" . "," ."' (item_code,item_desc)";

Thursday, June 18, 2009

Writing Blog in Hindi

आप हिंदी, गुजराती, मराठी और अन्य भारतीय भाषा में आसानी से लिख सकते हे|
इसके लिए आप http://www.google.com/transliterate/indic/Hindi की मुलाकात ले |
वहा से कॉपी कर के अपने ब्लॉग में पेस्ट करे और कोई भी UTF-8 एडिटर में एडिट केरे !
धन्यवाद सह,
कार्तिकेय

Saturday, June 13, 2009

Fatal error: Cannot redeclare _pear_call_destructors()

I was using PEAR HTML_Quick_forms and using my ISP PEAR.php and Quickform.php I got following message..

Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in /home/myusername/myuserincludes/PEAR/PEAR.php:765) in /usr/lib/php/PEAR.php on line 796

Solution:
I made following change in Quickform.php...
line
require_once 'PEAR.php';
replace with line
require_once 'PEAR5.php';

just force to use PEAR5

You may also change PEAR.php by adding if (!function_exists("_pear_call_destructors()")){
before line
function _pear_call_destructors(){
also add } after end of Function.

Tuesday, April 21, 2009

JavaScript Dynamic content Generation Problem

if you generate dynamic content through JavaScript by
document.write('<html><head><h2>'+ varHeading +'</h2></head><body></body></html>');
this page will works fine but if you generate more dynamic content from this page onward it will not display anything without any error.
Solution:
every phase should end with document.close();

MYSql 5 GROUP BY query not support Field Name "div"

in MySql 5 query...
SELECT std,div,rollno,marks FROM result_data GROUP BY std,div
gives Error...
Error is due to field name div
Solution: Change Field Name div -> divi or other.

It works fine with MySql 4.

Wednesday, April 1, 2009

readonly not works in JavaScript DOM

DOM- Javascript if you are using...
document.getElementById("idTest").readonly=true;
it will not work.
we have to use readOnly instead of readonly
correct is...
document.getElementById("idTest").readOnly=true;

Friday, March 20, 2009

csrcs.exe virus remove manually

1. Go to Task manager and stop csrcs.exe Process ( csrss.exe is windows Process )
2. Go Command Prompt and go to system32 folder and change attrib -r -s -h csrcs*.*
3. Delete all csrcs*.* including dll and exe
4. run regedit and find entry for csrcs. mostly it will find two entry. delete them.( Pl be careful while edit registry.

local mdb data export to website backend mysql

Problem: Laboratory Machine connected with rs232 update .mdb file on Local computer. We have to fetch this data from web page (web site running on service provider IIS/Apatche server) and send it to website Back-end MySql Server so everyone can use same data world wide.
Solution: Webpage in native PHP. write Javascript embedded into it with ADODB object...
var obj = new ActiveXObject("ADODB.Connection");
fetch data and assign it through document.getElementById and import to input tag name by same ID.
HTML:
input name=i1 type=text
JS:
document.getElementById("i1").value = jsVar;
PHP:
$PhpVar = $_GET["i1"]

To fetch Data from Local .mdb you can use systemDSN ODBC

var cObj = new ActiveXObject("ADODB.Connection");
var rS = new ActiveXObject("ADODB.Recordset");

rS.CursorLocation = adUseClient;
cObj.CursorLocation = adUseClient;

var iStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/userdata.mdb";
var adOpenKeyset = 1;
var adLockOptimistic = 3;
var adCmdText = 1;
var adUseClient = 3;
cObj.Open(systemDSN_Name) // or use cObj.Open(iStr)
var grStr = "SELECT * FROM table1 WHERE uid=12"



recSet.Open(grStr,cObj,adOpenKeyset,adLockOptimistic,adCmdText)
recSet.AddNew;
var id = rS.Fields("Name").value;
Important:
To Access SystemDSN from another Machine on your Intranet Pl share Folder with FullAceess(Read-Write) on which your .mdb file reside. If this ignore you will get Error: File already in use
Settings for IE:
access Data Source across domain - Prompt/Enable.
ActiveX Control/Script running - Prompt/Enable.