Tuesday, June 25, 2013

Add line Endings to File C#.

If the file has no carriage return and you to want read the records by its record length then use this code snippet.



  char[] buf = new char[bytesToCheck];   
  sr.Read(buf,0,bytesToCheck);   
  string toTest = new String(buf);   

Tuesday, April 23, 2013

WPF Has Accumulated Multiple WPF XML Namespaces over Time



WPF Has Accumulated Multiple WPF XML Namespaces over Time It’s practically a given that real-world WPF XAML will choose to use the WPF XML namespace as the default namespace, but it turns out that more than one XML namespace is mapped to the main WPF types in the various System.Windows namespaces. WPF 3.0 shipped with support for http://schemas.microsoft.com/winfx/2006/xaml/presentation, but WPF 3.5 defined a new XML namespace— 
http://schemas.microsoft.com/netfx/2007/xaml/presentation—mapped to the same WPF types. (WinFX was the original name for a set of technologies introduced in the .NET Framework 3.0, including WPF,WCF, and WF. That term was abandoned, hence the change in namespace.) WPF 4 has once again defined a new XML namespace that is mapped to the same WPF types:http://schemas.microsoft.com/netfx/2009/xaml/presentation.Despite all these options, it is best to stick with the original http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace because it works in all versions of WPF.(Whether your content works with all versions of WPF is another story, as to do so it must stick to features present only in WPF 3.0.) Note that Silverlight also supports the http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace to make it easier to use XAML meant for WPF inside a Silverlight project, although it also defines its own alternative namespace, http://schemas.microsoft.com/client/2007, which is not supported by WPF. The XML namespaces are confusing. They are not schemas. They do not represent a closed set of types that were available when the namespace was introduced. Instead, each version of WPF retrofits all previous namespaces with any new assembly/namespace pairs introduced in the new version. Therefore, the winfx/2006 namespace effectively means “version 3.0 or later,” the netfx/2007 namespace means “version 3.5 or later,” and so on. However,WPF 4 accidentally excludes some namespace/assembly pairs from the netfx/2009 namespace,which makes using omitted types (like TextOptions) pretty challenging! When loose XAML is loaded into Internet Explorer, it is loaded by PresentationHost.exe, which decides which version of the .NET Framework to load based on the XML namespaces on the root element. If the netfx/2009 namespace is present it will load version 4.0, otherwise it will load whichever 3.x version is present.


at Page.28

Wednesday, April 17, 2013

Thursday, March 7, 2013

OnKeyUp event in ASP.Net

How about the text entered by you in the textbox (ASP.NET) should be postback and the every entered char should be read in Code Behind class.\

It might be used for look up instantaneously in DB.Table.

This is done by calling the OnKeyUp event.

Sample code snippet.

   protected void Page_Load(object sender, EventArgs e)  
   {     
     TextBox1.Attributes.  
             Add("onkeyup",Page.  
             ClientScript.  
             GetPostBackEventReference(TextBox1, ""));      
     Response.Write(TextBox1.Text);  
   }  

Wednesday, March 6, 2013

PINNING


PINNING

It is possible to hand out a raw pointer to a managed object. But to do so, you effectively need to the tell the CLR the object should not be moved in memory while something(for example, a native code component used in interop) holds on to the pointer. The task of doing this is called pinning and
is a specialized concept typically used only in interop scenarios.


Few topics on Memory allocations during the constructor call.








Sublime Text


Sublime Text is a sophisticated text editor for code, markup and prose.
You'll love the slick user interface, extraordinary features and amazing performance.

Download link- http://www.sublimetext.com/

Thursday, February 7, 2013

UML introduction

The four of the most common diagrams

  • Class diagram
  • Object diagram
  • Sequence diagram
  • Package diagram 
It is not methodology. It is, on the other hand, a precise diagramming notation that will allow program designs to be represented and discussed. As it is graphical in nature it becomes easy to visualize  understand and discuss the information presented in the diagram. However , as the diagrams represent technical information they must be precise and clear- in order for them to work- therefore there is a precise notation that must be followed.

UML Class Diagram:

A class name consists of -
  • a unique name (conventionally starting with an uppercase letter)
  • a list of attributes (int,double,boolean,String etc)
  • a list of methods

________________________________
                      Class name
________________________________
                      Attributes
________________________________
                     Methods()
________________________________

Attibutes and Methods visibility modifier are shown as 
+  public
-  private
#  protected
~ package



A class diagrams can make use of keywords, notes and comments.
A class diagram can show the following information:-


  • Classes

- attributes
- operations
- visibility

  • Relationships

- navigability
- multiplicity
- dependency
- aggregation
- composition

  • Generalization/specialization

- inheritance
- interfaces

  • Keywords


  • Notes and Comments











1.What is Dependency ?

2. What is Simple Association?

3. What is Bidirectional Association?

4. What is Aggregation?





5. What is Composition?

Inheritance.







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