Tuesday, May 24, 2016

MongoDB

MongoDB (from humongous) is a free and open-source cross-platform document-oriented database. Classified as a NoSQL database, MongoDB avoids the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas (MongoDB calls the format BSON), making the integration of data in certain types of applications easier and faster. Developed by MongoDB Inc, this tool is free and open-source. As of July 2015, MongoDB is the fourth most popular type of database management system, and the most popular for document stores.

Monday, May 23, 2016

partial (Method)

A partial method has its signature defined in one part of a partial type, and its implementation defined in another part of the type. Partial methods enable class designers to provide method hooks, similar to event handlers, that developers may decide to implement or not. If the developer does not supply an implementation, the compiler removes the signature at compile time. The following conditions apply to partial methods:

  • Signatures in both parts of the partial type must match.

  • The method must return void.

  • No access modifiers are allowed. Partial methods are implicitly private.

namespace PM  {      partial class A      {          partial void OnSomethingHappened(string s);      }        // This part can be in a separate file.       partial class A      {          // Comment out this method and the program           // will still compile.           partial void OnSomethingHappened(String s)          {              Console.WriteLine("Something happened: {0}", s);          }      }  }

Saturday, May 21, 2016

Database Answer

Database diagram for all modules available in this link 



--
With Regards-
Siddu 

Please consider the environment before printing this e-mail

Wednesday, May 18, 2016

Filter an ObservableCollection with a CollectionView in C#

Article regarding how to apply filter condition on Observable Collection

http://jacobmsaylor.com/?p=1270

Monday, May 16, 2016

How do you pass arguments to a Thread that you create

1. Pass data using Lambda Expressions:
  1. static void Main()
  2. {
  3. String m = "yeahh!";
  4. Thread thread = new Thread ( () => PrintToConsole (m) );
  5. thread.Start();
  6. }
  7. static void PrintToConsole (string message)
  8. {
  9. Console.WriteLine (message);
  10. }

In the above example we have effectively passed m into the thread function. Any number of parameters can be passed this way.

2. Another way is to use the overloaded Thread.Start function which accepts ParamterizedThreadStart.

  1. string parameter = "xyz";
  2. Thread thread = new Thread(new ParameterizedThreadStart(PrintToConsole));
  3. thread.Start(parameter);
  4. private void PrintToConsole(object o)
  5. {
  6. String m = (String) o;
  7. Console.WriteLine(m);
  8. }

3. This is the same as (1) but the example is for .Net 4.0 Tasks

  1. Task.Factory.StartNew(() => SomeMethod(p1,p2,p3));

Thread Pool

Creating a Thread is expensive as it requires a few hundred milliseconds to create a new one. Additionally each thread requires atleast around 1MB of data. So instead of creating and destroying a thread each time we could just create a collection of preinstantiated threads and use them instead. Whenever we require a thread we ask thread pool for a thread which we can use and when we are done with it instead of destroying it we can send it back to the collection for recycling. This way we avoid the cost it incurs for creating and destroying threads. This collection of preinstantiated thread is called a Thread Pool.

Code Formater

Paste Here Your Source Code
Source Code Formatting Options
1) Convert Tab into Space :
2) Need Line Code Numbering :
3) Remove blank lines :
4) Embeded styles / Stylesheet :
5) Code Block Width :
6) Code Block Height :
7) Alternative Background :
Copy Formatted Source Code
 
Preview Of Formatted Code