Browsing articles in "Uncategorized"
Nov
22
2008

Output buffering PHP Apache mod gzip mod deflate

Till recently most of my php scripts were working fine on the servers with instantaneous outputs as and when a echo statement came. One issue that popped a lot on localhost was that of chunky outputs; that is the outputs of big scripts came out in chunks rather than smoothly with every echo or print statement. After some research flush() was found to be the solution for this output buffering issue. So what happened was [...]

Nov
19
2008

Remote Login with Curl PHP

The Curl Library of PHP can be used to open remote web pages and also logging in where a login is required. Code After the curl_exec the login page is opened with login details or simply the login has been done. Now any other url (which is login restricted) can be opened by The option CURLOPT_COOKIEFILE is used to specify a file which stores the cookie data that is received during the process of opening [...]

Oct
13
2008

wxPython stderr/stdout window

While executing a wxpython script if a error occurs then a white window popups with some message, and it disappears fast enough before it can be read. So here is a fix to pause it and read it what and where the error in the code is : app = wx.App(redirect=False)MyFrame(None).Show()app.MainLoop() The wx.App takes this parameter called redirect which can be True or False.It defaults to True for Windows and MacOS. Another argument is filename=(None/) [...]

Oct
12
2008

PHP Script to find visitor’s location

Hello All Here is a simple php script that lets you track the location of the visitor’s on your site. Lets get to the code straight away : So basically what we did was, used the free geo ip api from IPMango The syntax being http://www.ipmango.com/api.php?ip=a.b.c.d where a.b.c.d is the ip address.

Sep
29
2008

Write Excel Files in PHP – Simple and Easy Way

Hi So this time my simple task was to extract some data from some websites and write them into an excel file and submit. So I simply googled up and found a class calledMS-Excel Stream Handler. With it I went really happy as it was very easy and simple to use, with just a include file. After writing and writing excel files suddenly I noticed that some fields in the excel file were messed with [...]

Apr
4
2008

Execute an SQL Script in JDBC

The SQL Script should have comments starting with – or — only on new lines and each command should end with a ; . Reading a sql file and putting all of it in a string variable and feeding to the execute command would result in an exception. All instructions must be executed individually. A proper sql script should have all instructions starting on a newline and all comments on a newline. Start with an [...]

Apr
2
2008

Reading Writing and Saving Configurations to a File in Java

Configuration files are used in applications to store settings, user preferences and other configuration parameters of an application so that. When configurations are changed from within the application these need to be saved so that next time the application starts with these new settings. In Java reading and writing to a configuration is pretty simple and straight forward. A configuration file can store data in many ways. One simple technique is : key=value Apart from [...]

Feb
21
2008

Javascript Optimization Techniques

More and more sites have begun using javascript to implement a wide array of features like DHTML, AJAX and various type of validations and processing Reduce the size of javascript source code The first and the most obvious suggestion for this would be to avoid whitespaces as much as possible. Next, the prototype techniques can be used to reduce the size of you javascript code considerably. document.getElementById is one of the most extensively used function [...]

Jan
13
2008

BSNL Broadband – Connecting 2 computers to the MT882 ADSL Modem

The Huawei MT882 ADSL Modem that you might have received with your BSNL Broadband connection can be used to connect 2 computers to the internet simultaneously since it is a router. It has a USB interface and an Ethernet interface both of which can be simultaneously used but with a few setting changes. First of all one PC must use the usb interface and another must use the ethernet interface via a network adapter. That [...]

Dec
16
2007

Detecting and Confirming browser window close/navigation events

onunload event didnt quite work in mozilla or internet explorer another event called onbeforeunload gives a better desired effect or still better for just a confirmation. This event is available on Mozilla and Internet Explorer but probably not on Opera

Pages:«1234»