Tuesday, December 7, 2010

Assembly - .NET 4.0

Assemblies are designed to simplify application deployment and to solve versioning problems that can occur with component-based applications.

Benefits:
  • Versioning Problems
  • An End to DLL Conflicts
Contents:
Static assembly can consist of four elements

  • Assembly manifest

  • Type metadata.

  • Microsoft intermediate language (MSIL) code that implements the types.

  • A set of resources.




Assembly manifest:
  • contains all the metadata needed to specify the assembly's version requirements and security identity, and all metadata needed to define the scope of the assembly and resolve references to resources and classes.
  • can be stored in either a PE file (an .exe or .dll) with Microsoft intermediate language (MSIL) code
  • Assembly manifest (Assembly name, Version number, Culture, Strong name informationGl

Global Assembly Cache(GAC):
  • stores assemblies specifically designated to be shared by several applications on the computer.
  • share assemblies by installing them into the global assembly cache only when you need to.
  • There are scenarios where you explicitly do not want to install an assembly into the global assembly cache.
  • deploy an assembly into the GAC by using an installer designed or a developer tool- SDK Gacutil.exe
  • Assemblies deployed in the GAC must have a strong name.

Thursday, December 2, 2010

Access Modifiers- C#

1. public - Access is not restricted.
2. internal - Access is limited to the current assembly.
3. private - Access is limited to the containing class.
4. protected - Access is limited to the containing class or types derived from the containing class.
5. protected internal - Access is limited to the current assembly or types derived from the containing class.

Access modifiers are not allowed on namespaces. Namespaces have no access restrictions. If no access modifier is specified in a member declaration, a default accessibility is used.

Members - "Default member accessibility" - "Allowed declared accessibility"
class private public, protected, internal, private, protected internal
interface public None
struct private public, internal, private
enum public None

the accessibility domain of a nested type cannot exceed that of the containing type.

Tuesday, March 9, 2010

Enterprise crawler

When we need to read data from storage.
  • crawleradmin --offline --getdata aa2: http://cmb1u123.cmb1.fast.no:30000/niran/sitemap/sitemap.xml
read data from meta storage.

crawlerdbtool -m viewraw -d data/store/aa2/data/6

ey (raw): 'http://cmb1u123.cmb1.fast.no:30000/niran/sitemap/c.html'

(0, 0, {1: 1268106394, 2: 0, 3: 'text/html', 4: 'ykA\xd1_\xaf;\xba@r\x94\xa2\xc8o\x8f~', 5: None, 6: ('aa2/data/6', 113539, 65539), 7: [('http://cmb1u123.cmb1.fast.no:30000/niran/sitemap/sitemap.xml', 1073741824)], 8: 'HTTP/1.1 200 OK\r\nDate: Tue, 09 Mar 2010 08:12:26 GMT\r\nServer: Apache/2.2.9 (Unix) PHP/5.2.6\r\nLast-Modified: Tue, 06 Oct 2009 14:11:21 GMT\r\nETag: "2bbf9-59780-47544cdfd5440"\r\nAccept-Ranges: bytes\r\nContent-Length: 366464\r\nConnection: close\r\nContent-Type: text/html', 9: 'deflate', 11: 'Tue, 06 Oct 2009 14:11:21 GMT', 12: '"2bbf9-59780-47544cdfd5440"', 13: 0, 14: None, 15: None, 16: (1, 1, 1), 17: 0, 18: [], 19: None, 20: 0, 21: None, 22: 0, 23: {'sm': {'priority': '0.8', 'lastmod': '2005-01-01', 'changefreq': 'monthly'}}}, 0)


Wednesday, November 18, 2009

Python Tutorial

http://www.tutorialspoint.com/python

Examples of High-Level languages

  • Java
  • C
  • Python
  • Scheme
  • Prolog
  • C++
  • C#
  • Java Script
  • Ruby
  • Lisp

Tuesday, August 18, 2009

ESP web service

http://localhost:16089/adminserver/webservices.jsp

Thursday, August 13, 2009

.NET framework 2.0 introduces a new boundary called the Application Domains

Each application running within its main process boundaries and its application domain boundaries. So, you can think of the application domain as an extra shell to isolate the application and making it more secure and robust.

The above is not the main advantage of application domains. The main advantage is the ability to run several applications domains in a single process or application. All of this is performed while maintaning the same level and quality of isolation that would exist in separate processes, without the need of making cross-process calls or switching between processes.

Advantages

You may ask, why should I create more than one application domain within my application?

The following advantages of application domains answer this question.

  • In terms of isolation, code running in one application domain can not access code or resources running in another application domain.
  • In terms of security, you can run more than one set of web controls in a single browser process. Each set of them is running in a separate application domain so each one can not access the data or resources of the other sets. You can control the permissions granted to a given piece of code by controlling the application domain inside which the code is running.

  • In terms of robustness, fault in code running in one application domain can not affect other applications although they all are running inside the same process. Individual application domain can be stopped without stopping the entire process, you can simply unload the code running in a single application domain.

So, from the above advantages, you can observe that by using application domains you can create rather robust .NET applications. It increases isolation, stability, and security of your application.

Friday, April 3, 2009

Analyze a Core dump

  • Core dumps are often used to diagnose or debug errors in computer programs.
  • A core dump consists of the recorded state of the working memory of a computer program at a specific time, generally when the program has terminated abnormally.
  • include the program counter and stack pointer, memory management information, and other processor and operating system flags and information.
  • On UNIX-like systems manual dumps may be forced by kill -6 or gcore [2]. kill -6 dumps a thread dump.

Friday, March 20, 2009

smbclient

default samba configuration file located at /etc/samba/smb.conf

smbclient

default samba configuration file located at /etc/samba/smb.conf

Sunday, March 8, 2009

Common Object Request Broker Architecture

This is about the CORBA, which is used to use communicate with feeder and contentdistributor.
So I need to find out what are the reason for it.

  1. enables software components written in multiple computer languages and running on multiple computers to work together.
  2. CORBA uses an interface definition language (IDL) to specify the interfaces that objects will present to the outside world.
  3. CORBA then specifies a “mapping” from IDL to a specific implementation language like C++ or Java. Standard mappings exist for Ada, C, C++, Lisp, Ruby, Smalltalk, Java, COBOL, PL/I and Python.
  4. Benefits :

  • Language Independence
  • OS Independence
  • Freedom from Technologies
  • Freedom From Data Transfer Details
Others:

Corba Location (CorbaLoc)


Corba Location (CorbaLoc) refers to a stringified object reference for a CORBA object that looks similar to a URL.
eg:
corbaloc::160.45.110.41:38693/StandardNS/NameServer-POA/_root

So this is the END.


Sunday, February 1, 2009

Web Crawler

http://en.wikipedia.org/wiki/Web_crawler

RBSE [3] was the first published web crawler. It was based on two programs: the first program, "spider" maintains a queue in a relational database, and the second program "mite", is a modified www ASCII browser that downloads the pages from the Web.

Tuesday, November 11, 2008

NFS share

vi /etc/exports

/etc/init.d/nfs restart

Tuesday, October 28, 2008

How do I set my java classpath?

How do I set my java classpath?

Problem

Linux uses Red Hats java package instead of the Sun jdk.

Reason

The java interpreter from the standard Red Hat installation is placed in /usr/bin, which is in the path where Linux search for executables. This will be used be default if you don't specify otherwise.

To find the java classes, you also have to set the java classpath to point to the java kit you want to use.

Solution

Set your PATH and CLASSPATH environment variables to reflect which java kit you want to use.

In the ITU Linux machines in 2003, the following java kits are installed: jdk1.3.1 and j2sdk1.4.1. They are placed in /usr/java.

To use jdk1.3.1, add the following lines to the file ".bashrc" in your home directory:

export PATH=/usr/java/jdk1.3.1/bin:$PATH
export JAVA_HOME="/usr/java/jdk1.3.1"
export CLASSPATH=.:/usr/java/jdk1.3.1

If you want to use the j2sdk1.4.1, replace jdk1.3.1 with j2sdk1.4.1 and it should work.

netstat

Examples

netstat

Displays generic net statistics of the host you are currently connected to.

netstat -an

Shows all connections to the server including the source and destination ips and ports if you have proper permissions.

netstat -rn

Displays routing table for all ips bound to the server.

netstat -an |grep :80 |wc -l

Display the amount of active connections on port 80. Removing the pipe and wc command would display each connection.

netstat -natp

Display active Internet connections. See document CH001079 for an example of output.

Monday, March 31, 2008

Google Summer of Code 2008

Improved Dynamic Configuration/
Process Control
Project



Project Background

==================

The eXist is an Open Source native XML database, which is provides a powerful environment for the development of databases and web applications based on XQuery and related standards. The eXist supports many popular XML query languages such as XQuery, XPath, and XSLT.

The problem is how to configure the database parameter at runtime. Some of those parameters can be changed while the database is running, others will require the db to be stopped and restarted.

The goal of the project would be to provide a common interface to dynamically configure the database parameter at runtime. We must need to use Programmatic Configuration like as via Java Management Extensions (JMX).

Currently eXist provides some interfaces via Java Management Extensions (JMX),which are only exports a limited set of read-only services. In this project, I’ll hope to create a common interface to dynamically configure of the database instance at runtime, which is providing write access to configuration properties. Also it will be able to view all running queries or jobs, and modify their access permissions for specific users.


Deliverables: The eXist configured via JMX

1. The whole configuration setting access via JMX, which is ability to change at run time.

  • Db-connection setting (database, files, cache Size)
  • Pool setting
  • Recovery setting (sync-on-commit, group-commit)
  • Watchdog setting (query-timeout)
  • Default-permissions setting
  • Number of transactional connections and non-transactional connections
2. View all running queries or jobs, and their access permission for specific user.


You can find the complete doc of my GSOC 2008 proposal here.

Tuesday, February 19, 2008

ISO/IEC 16022

Bar code symbology specifications

Anyone want learn or interesting about the Data Matrix(SEMACODE) , please you follow this ISO/IEC 16022 standard. That's document include efficient algorithm for encode the data matrix and Reed-Solomon error correction. So anybody want content of the ISO/IEC 16022 standard, I would like to give help to you.

Saturday, February 2, 2008

Access the Win32 API in .NET

Windows exposes lots of functionality in the form of Win32 API. Using these API you can perform direct operation in windows, which increases performance of your application.API is a set of predefined Windows functions used to control the appearance and behavior of every Windows element. Every user action causes the execution of several or more API function telling Windows what's happened.
  • using System.Runtime.InteropServices;
In .NET we can call Win 32 API using platform Interop Services, which resides at System.Runtime.InteropServices namespace, Which is useful when you are interacting with external application.

  • [DllImport("User32.dll")]

This statement will import the user32.dll in your program after that you can make use of its function in your program.

  • public static extern Int32 FindWindow(String lpClassName,String lpWindowName);

Before using any external function in .NET you have to declare that function in your program. In above statement we are trying to use FindWindow function of User32.dll.While declaring such a function we prefix extern keyword with that, which indicate that the declared function is an external function.

eg: FindWindow, EnumChildWindows, EnumWindows, ..etc


This is example, I have done sample Console application in .NET. Here you can see message box with "
Hello World!".Windows functions used to control the appearance and behavior of every Windows element like as massage box.

using System;
using System.Runtime.InteropServices;


namespace ConsoleApplication1
{
class Program
{
// Use DllImport to import the Win32 MessageBox function.
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int MessageBox(IntPtr hWnd, String text, String caption, uint type);

static void Main()
{
// Call the MessageBox function using platform invoke.
MessageBox(new IntPtr(0), "Hello World!", "Hello Dialog", 0);
}
}
}







Friday, February 1, 2008

Application of Reed–Solomon error correction

The code was invented in 1960 by Irving S. Reed and Gustave Solomon, at the MIT Lincoln Laboratory. Reed-Solomon codes are used for error correction.

Reed-Solomon codes are block-based error correcting codes with a wide range of applications in digital communications and storage. Reed-Solomon codes are used for many application.

  • Storage devices
  • 2-D bar code
  • Wireless or mobile communications (including cellular telephones, microwave links, etc)
  • Satellite communications
  • Digital television / DVB
  • ADSL, xDSL
Reed Solomon codes are a subset of BCH codes and are linear block codes. A Reed-Solomon code is specified as RS(n,k) with s-bit symbols.

This means that the encoder takes k data symbols of s bits each and adds parity symbols to make an n symbol codeword. There are n-k parity symbols of s bits each. A Reed-Solomon decoder can correct up to t symbols that contain errors in a codeword.