satishgaudo.com

Understanding technology

Archive for June 16th, 2009

Apache Virtual Host

The term Virtual Host refers to the practice of maintaining more than one server on one machine, as differentiated by their apparent hostname. For example, it is often desirable for companies sharing a web server to have their own domains, [...]

16 June 2009 at 18:58 - Comments
How I Make $300 a Day Online at 12:15 on 18 June 2009
Hey, nice post, very well written. You should post more about this.

wrapper class for curl

/** *cURL class * This is a wrapper class for curl * $c = new curl; * // enable cache * $c = new curl(array(’cache’=>true)); * // enable cookie * $c = new curl(array(’cookie’=>true)); * // enable proxy * $c = new curl(array(’proxy’=>true)); * * // HTTP GET Method * $html = $c->get(’http://example.com’); * // [...]

16 June 2009 at 13:56 - Comments

function to submit data via socket

/** * sendDataOnSocket * function to submit data via socket * @param string $sContent content to send * @param string $sHost Host name * @param string $sFilePath  file to post data * @param string $sMethod method name * @return string aig response * @access public */ public static function sendDataOnSocket($sContent,$sHost,$sFilePath,$sMethod) { if(strlen($sHost)==0) { return array(1, "Empty Host name"); }else if (strlen($sMethod)==0) { return array(1, "Empty Method"); } $fp = fsockopen($sHost, "80", [...]

16 June 2009 at 13:54 - Comments
pidxfgop at 23:49 on 14 July 2009
thanks . i was searching for this code
lmn_nihez at 13:48 on 14 August 2009
Nice site.

validate xml against xsd file provided

/** * validateXmlAgainstXsd * function to validate xml against xsd file provided * @param string $error error * @return string api response * @access public */ public static function validateXmlAgainstXsd($sXmlPath,$sXsdPath) { // Enable user error handling libxml_use_internal_errors(true); $xml = new DOMDocument(); $xml->load($sXmlPath); if (!$xml->schemaValidate($sXsdPath)) { $aError =self::libxml_display_errors(); $iError=1; } else { $iError=0; } return array($iError,$aError); }   Example of XSD file: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:annotation> <xs:documentation xml:lang="en"> Job specification schema for scheduler.vubites.com Copyright 2010 satishgaudo.com. All rights reserved. </xs:documentation> </xs:annotation> <xs:element name="response" type="responseType"/> <xs:complexType name="responseType"> <xs:sequence> <xs:element name="status" [...]

16 June 2009 at 13:53 - Comments
TifyWheef at 17:10 on 8 July 2009
http://extjs.com/forum/member.php?u=79374 guitar lessons
Debt Settlement Program at 14:23 on 18 August 2009
complex post. due one detail where I contest with it. I am emailing you in detail.

Function to get the mime type of the file

/** * getFileMimeType * returns the mime type of the file * @param string $sFilePath File path * @return string mime type of the file * @access public */ public function getFileMimeType($sFilePath) { exec(’/usr/bin/file -i -b ‘ . realpath($sFilePath), $aOutput); $sType = $aOutput[0]; $aMimeTypeDet = explode(’;', $sType); return trim($aMimeTypeDet[0]); }

16 June 2009 at 13:49 - Comments
Sdanektir at 02:15 on 7 August 2009
OMG…totally!
Vivalkakira at 21:37 on 7 August 2009
Amazing news, thank you!