Nov 11

GO: Google Launches Its Own Programming Language

General 26 Comments »

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

One of the core philosophies of Google, and one of the reasons it has been so successful, is efficiency. It’s about both being as efficient as possible when serving search results and processing data and creating product that push the limits of efficiency for the user (as an example, Google’s trying to make communication more efficient with Google Wave).

Maybe that’s why we’re not surprised that GoogleGoogle is finally looking to tackle the underpinning code that runs the web. Today the search giant released Go, an open-source development language that Google believes will combine performance with speed, and one that the company probably hopes will reshape the development and software industries in its favor.

Go is based on the C programming family, one of the most widely used programming language trees in the world. However, the twist is that incorporates elements of Python (a preferred development language within Google) and the Pascal/Modula/Oberon family to make faster and more dynamic programs.



[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tags:

Jul 27

Hi,

Today I encountered an error in which I was having problem of showing contents of <div> tag on the top of a flash movie. I am using div tags as menu to show the menu on hover events. It was working fine till I get a flash movie beneath the menu. In case of flash movie my menu started to disappear behind the flash movie. After doing lil search on google I found the solution which is given below:

You just need to provide the following parameter to the object tag which is displaying the flash movie.

<param name="wmode"value="transparent"/>

I have found this solution after some googling. Here is the link from where I got this solution.

http://www.ravinderweb.com/page/Working-with-Div-and-Flash-Movie.aspx

So follow the above link if you are interested in complete description.

Regards,

Shahid



[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tags:

May 25

Filewatcher

C# | General | Tips and Tricks 119 Comments »

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
 

Working with FileSystemWatcher Class

  

Hey, if you are here to find the answer of this question "how to make sure in Created event of the Filewatcher that the file which is just created is completely copied?" then you are at the right place..

FileSystemWatcher class listens to the file system change notification and raises events when a directory, or file in a directory, changes.. In this article I’ll discuss

fileSystemWatcher1_Created(object sender, FileSystemEventArgs e)  event of FileSystemWatcher class. Working with this event is easy. You just need to capture this event and then write your code in it. BUT there is a problem in this event which is that the Created event is fired immediately as soon as the path of the file is created in the observing directory. This can be clearly explained with the help of a following scenario: I want to observe a Directory say C:\\Test. I wrote a window service which uses the FileSystemWatcher class to observe that directory. I want to pass any new file which is created in this directory to another method which processes this file. Suppose my file’s size is large (e.g. 500mb). In my window service the Created event of the FileSystemWatcher is triggered as soon as the file’s path is created in the directory, but file is not copied completely in the directory. How to solve this issue? .Net does not provide any method or event which can tell me that the file is written completely.  I tried to solve this problem and though I achieved my task, but this is not a good solution.  In the Created event I made a thread. So for each new file a new thread will be created, so we can serve each new file without any delay. In that particular thread, I tried to open the file. If file is opened successfully, then it means that file is copied completely and is available for processing. If not, then try to open the file again. Repeat this process until the file is available. Here is the code: 

void fileSystemWatcher1_Created(object sender, FileSystemEventArgs e)

{   

       Thread _MyThread = new Thread(new ParameterizedThreadStart(this.PerformActualTask));    

       object[] Parameters = new object[] {e. FullPath };    

       _MyThread.Start(Parameters);

 

private void PerformActualTask(object parameters)

  

 //The parameter for this thread body   

 object[] Parameters = (object[])parameters;  

//Full path of the newly created file  

string _SourceFile = (string)Parameters[0];  

int WaitBeforeGiveUp = 300;  

while (true  

     

 try     

        

  //Try to open the file        

  FileStream fs = File.Open(_SourceFile, FileMode.Open);       

  {         

   //We are here because file is successfully opened         

   fs.Close();      

   //Now perform operation on that file      

   }    

 }    

 catch (Exception ex)   

       

  //If exception occured then decriment the wait before give up and ask the thread to sleep       

  if (--WaitBeforeGiveUp > 0)       

        

    // file is not available yet      

  }     

 else     

         

   //if waiting time expired.         

   // SHOW GIVE UP MESSAGE     

 }      //cause the thread to sleep     

 Thread.Sleep(1000);   

} 

}

  

In the code I made some changes which are that I tried to open a file for a particular period of time. If file opened in that period then kool, else I stored a msg in the event viewer that I have given up.     



[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tags:

Mar 31


[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tags:

Mar 25
 

Why Girls Don't Marry Software Guys !

 
 
  
 


[KickIt] [Dzone] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Tags: