Deprecated: Function set_magic_quotes_runtime() is deprecated in /nfs/c01/h08/mnt/2939/domains/cidamon.com/html/blog/textpattern/lib/txplib_db.php on line 14
Cidamon: Blog
  • Get Keys of Dictionary data in c#
    06 November, 2010

    A very simply way to collect the keys of a dictionary object to iterate through them is given bellow –

    List<string> keyList = new List<string>(myDictionary.Keys);
    for (int i = 0; i < keyList.Count; i++)
    {
        int myInt = myDictionary[keyList[i]];
    }
    
  • Dictionary, Hashtable and HashSet
    06 November, 2010

    First of all HasSet is different then Dictionary and Hashtable cause it does not allow duplicate value and elements inside a HashSet cannot be accessed through indices, only through an enumerator (which is an iterator).

    Now the difference between Dictionary and Hashtable is though Hashtable takes in a key/value pair, but...

    more..

  • HashSet in dot net 3.5
    06 November, 2010

    HashSet has been introduced in framework 3.5. It inherits the ICollection interface. HashSet cannot be accessed through indices, only through an enumerator.
    HasSet is modeled upon mathematical set. It has methods such as Union, Intersection, IsSubsetOf, IsSupersetOf.
    Add method of HashSet is boolean unlike List. HashSet allows only unique...

    more..

  • Simple use of sqlplus
    14 September, 2010

    Bellow are the steps required to execute a sql script using sqlplus

    Start listener
    $ lsnrctl start

    Login to sqlplus
    $ sqlplus username/password (if using sys then “sys/password as sysdba”)

    Start the database
    sql>startup

    Turn on spool...

    more..

  • Wordpress – disabling Nofollow option in links
    07 July, 2010

    First go to settings->Privacy settings. Select the following option -

    “I would like my blog to be visible to everyone, including search engines (like Google, Sphere, Technorati) and archivers”.

    Then go to appearance->editor and select Header.php. Here...

    more..

  • oracle pl/sql sample
    25 June, 2010

    Here is a simple example of using pl/sql in oracle

    – To enable output
    SET SERVEROUTPUT ON;
    – declare necessary variables
    DECLARE
    caseNumber    NUMBER;
    name    VARCHAR(200 BYTE);
    grade    VARCHAR(1 BYTE); 
    BEGIN
    – Lets consider we have a package named “SamplePackage” and it has a procedure named
    – “SampleProc” which has...

    more..

  • Sql Query to pull table name and column name
    15 April, 2010

    If you are looking to get all table name and column in a oracle schema you can use the following query

    SELECT * FROM DBA_TAB_COLUMNS WHERE OWNER = 'schema_name' ;
    

    If you want to get column names of a specific table then you can use the following query

    SELECT * FROM DBA_TAB_COLUMNS...

    more..

  • image resize function (transperant)
    26 April, 2009

    Found a great function for image resize in php. It requires php >= 4.3.0.
    I found the source in
    http://www.akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/

    <?
    function resize($img, $w, $h, $newfilename) {
        #
        //Check if GD extension is loaded
        #
        if (!extension_loaded('gd') && !extension_loaded('gd2'))...

    more..

  • Simple use of CURL
    05 January, 2009

    Here is a very simple structure of how to use curl with post method –

    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,'http://example.com/target.php');
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);	
    curl_setopt($ch, CURLOPT_POST , 1);// setting up to use post method
    curl_setopt($ch, CURLOPT_POSTFIELDS, array("fieldName1"=>"data1","fieldName2"=>"data2"));							
    $content = curl_exec($ch);
    curl_close($ch);
    
  • Stop cron job from sending output email
    04 January, 2009

    I created a cron job which needs to run every 5 minutes. So it was sending me 12 emails per hour and my inbox got overwhelmed by email pretty soon. I had plesk control panel and plesk won’t let you leave email field empty so I started to look...

    more..

« Older