Creating Windows tray icons

If you want to add,modify or delete a system tray icon.Follow the below steps:

STEP:1

Go to run and type REGEDIT

STEP:2

Under MyComputer->Select HKEY_LOCAL_MACHINE

STEP:3

Expand the folder SOFTWARE

Step:4

Select and expand the folder MICROSOFT

Step:5

Select the folder WINDOWS and expand it.

Step:6

Expand CURRENTVERSION

Step:7

Double Click the Run

Step:8

In the right side pane,right click the empty area select New->String Value

Type any user defined name and the right click the created name select modify.The below window will come

In that enter the path of your EXE that you want to display as tray icon and click ok.

Have a happy coding..

Permanent link to this article: https://blog.openshell.in/2010/12/working-with-tray-icon-in-windows/

Actually what is .Net ???

.NET provides tools and libraries that enable developers to create Windows software much faster and easier. .NET benefits end-users by providing applications of higher capability, quality and security. The .NET Framework must be installed on a user’s PC to run .NET applications.

The .NET Framework allows you to:

* Apply common skills across a variety of devices, application types, and programming tasks
* Integrate with other tools and technologies to build the right solution with less work
* Build compelling applications faster

Why are you (this blog author) developing in .NET?

The Mini-Tools developers were impressed with the Microsoft .NET technology and development platform and felt it provided the best
environment with which to build and deliver innovative desktop and Web
software for Windows. All of our software is written in C# for .NET on
Windows.

Applications in .Net:

Most of the people getting confused in types of .Net.Mainly .Net has 4 types of application.

1. Web Application

We are telling web application as ASP.Net that allow programmers to build dynamic web sites, web applications and web services.We can create ASP.Net applications by using any languages like C#,VB,Visual C++..which you need to deploy in your web server and used through URL.

2. Windows Application

Visual Basic .NET (VB.NET) is an object-oriented computer programming language that can be viewed as an evolution of Microsoft’s Visual Basic (VB) which is generally implemented on the Microsoft .NET Framework.We can create windows application in any language like VB,C#,.It creates an Exe, that can be install in every machine have UI.

3. Console Application

Console Applications are command-line oriented applications that allow us to read characters from the console, write characters to the console and are executed in the DOS version. Console Applications are written in code and are supported by the System.Console name space. Does not have any UI, Run in Command Prompt.

4. Mobile Application

Mobile applications can now be developed to deliver any types of data, to any user, any place in the world!.Different mobile devices support different programming languages. Some support WAP and WML, some support HTML or a limited version of HTML, and some support both or a different language.To support all types of mobile devices,developers must create one different application for each language.With .NET Mobile, Microsoft has introduced a new platform for developing mobile applications.

Have a happy coding…

Permanent link to this article: https://blog.openshell.in/2010/12/actually-what-is-net/

var args – The magic in Java

Target Audience: Java Developers
What should you know? Core Java

Writing methods for a class gives completeness for your object. But sometimes it seems to be incomplete when you are not sure about the number of arguments for a method. For example if you are writing a method to find summation of 2 numbers, then the method declaration may be like this:

class MyClass{
  public int sum(int number1, int number2){ // expects 2 ints
     return number1+number2;
   }
}

The above code will always accept 2 arguments. What if you need to write code for summation of N numbers, but not passing the arguments in the form of arrays. The solution is you can use the concept of var args. See the following code:

class MyClass{
   public int sum(int... numbers){ // var args
     int sum=0;
     for (int i=0; i<numbers.length; i++)
       sum += numbers[i];
     return sum;
   }
}

Note the 3 dots after the int data type. The three periods after the parameter’s type indicate that the argument may be passed as an array or as a sequence of arguments. Lets look the method invocation part:


class Demo{
  public static void main(String [] a){
     MyClass m=new MyClass();
     m.sum(100,230);
     m.sum(50, 40, 21, 33);
     m.sum(45);
     m.sum();
  }
}

Will it be compile successfully? Yes, it will. The output is
330
145
45
0

The variable length arguments (var args) in a method declaration accepts zero or any number of arguments of a type. The type may be any primitive data type or pre-defined class or user-defined class. But it has some limits. They are:

  • The var arg must be the last parameter in the method’s signature.
  • You can have only one var arg for a method.

Legal

int sum(int... numbers) { } // expects 0 to many ints
void doSomething(Student... s) { } // 0 to many Students
void abcd(char c, int... x){} // expects a char first, then 0 to many ints

Illegal

int sum(int numbers...) { } // bad syntax
void doSomething(Student... s,String... str) { } // too many var args
void abcd(char... c, int x){} // var arg must be last 0 to many ints

Hope this is useful to you, if not post your comments.

Permanent link to this article: https://blog.openshell.in/2010/12/var-args-the-magic-in-java/

How to avoid Conflict in jQuery

Many JavaScript libraries use $ as a function or variable name, just as jQuery does. In jQuery’s case, $ is just an alias for jQuery, so all functionality is available without using $. If we need to use another JavaScript library alongside jQuery, we can return control of $ back to the other library with a call to $.noConflict():

Creates a different alias instead of jQuery to use in the rest of the script.

var $j = jQuery.noConflict();
// Do something with jQuery
$j("div p").hide();

// Do something with another library's $()
$("content").style.display = 'none';

Permanent link to this article: https://blog.openshell.in/2010/12/how-to-avoid-conflict-in-jquery/

404 Page on a Static Site

Here’s a very quick, but very useful trick. You can catch 404 errors (page not found) on a static site and serve up a custom 404 page with a one-liner in your .htaccess file:

ErrorDocument 404 /404.php

The “/404.php” part is the path to whatever file you want to serve up as the error page.

Remember that the .htaccess file works on Apache servers only. I say “static” sites, because if you are using a CMS system already (like WordPress), there is already a system in place for catching 404 errors and this is unnecessary.

Permanent link to this article: https://blog.openshell.in/2010/12/404-page-on-a-static-site/

create windowed applications with no system chrome

To  build a AIR application with custom window(which has your own shape), try the fallowing:

In the <project_root>/src folder, open the XML file named “<your_project_name>-app.xml” and modify the two lines:

<!–<systemChrome>none</systemChrome>–>
to
<systemChrome>none</systemChrome>

and

<!–<transparent></transparent>–>
to
<transparent>true</transparent>

Then in your main page,

<mx:WindowedApplication xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” showFlexChrome=”false”>

<mx:Script>
<![CDATA[
public function startMove(event:MouseEvent):void {
stage.nativeWindow.startMove();
}
]]>
</mx:Script>

<mx:Image id=”mainPanel”  mouseDown=”startMove(event)”  x=”10″ y=”10″ width=”300″ height=”200″
source=”myBg.gif /*path to a transparency image*/” scaleContent=”true” />

Permanent link to this article: https://blog.openshell.in/2010/12/create-windowed-applications-with-no-system-chrome/

Data Storage and Data flow

Data Storage and Data Flow 

SAP NetWeaver BI offers a number of options for data storage. These include the implementation of a data warehouse or an operational data store as well as the creation of the data stores used for the analysis.

Architecture

A multi-layer architecture serves to integrate data from heterogeneous sources, transform, consolidate, clean up and store this data, and stage it efficiently for analysis and interpretation purposes. The data can be stored with varying granularity in the layers.

●      Persistent Staging Area

After being extracted from a source system, data is transferred to the entry layer of the Enterprise Data Warehouse, the persistent staging area (PSA). The data from the source system is stored unchanged in this layer. It provides the backup status at a granular level and can offer further information at a later time in order to ensure a quick restart if an error occurs.

●      Data Warehouse

The way in which data is transferred from the PSA to the next layer incorporates quality-assuring measures and the clean up required for a uniform, integrated view of the data. The results of these first transformations and cleanups are stored in the data warehouse layer. It offers integrated, granular, historic, stable data that has not yet been modified for a concrete usage and can therefore be seen as neutral. The data warehouse forms the foundation and the central data base for further (compressed) data retentions for analysis purposes (data marts). Without a central data warehouse, the enhancement and operation of data marts often cannot be properly designed.

●      Architected Data Marts

The data warehouse layer provides the mainly multidimensional analysis structures. These are also called architected data marts. Data marts should not necessarily be equated with added or aggregated; highly granular structures that are only oriented to the requirements of the evaluation can also be found here.

●      Operational Data Store

An operational data store supports the operational data analysis. In an operational data store, the data is processed continually or in short intervals, and be read for operative analysis. In an operational data store, the mostly uncompressed datasets therefore are quite up-to-date, which optimally supports operative analyses.

Data Store

Various structures and objects that can be used depending on your requirements are available for the physical store when modeling the layers.

In the persistent staging area (PSA), the structure of the source data is represented by DataSources. The data of a business unit (for example, customer master data or item data of an order) for a DataSource is stored in a transparent, flat database table, the PSA table. The data storage in the persistent staging area is short- to medium-term. Since it provides the backup status for the subsequent data stores, queries are not possible on this level and this data cannot be archived.

Whereas a DataSource consists of a set of fields, the data stores in the data flow are defined by InfoObjects. The fields of the DataSource must be assigned with transformations in the SAP NetWeaver BI system to the InfoObjects. InfoObjects are thus the smallest (metadata) units within BI. Using InfoObjects, information is mapped in a structured form. This is required for building data stores. They are divided into key figures, characteristics and units.

●      Key figures provide the transaction data, that is the values to be analyzed. They can be quantities, amounts, or numbers of items, for example sales volumes or sales figures.

●      Characteristics are sorting keys, such as product, customer group, fiscal year, period, or region. They specify classification options for the dataset and are therefore reference objects for the key figures. Characteristics can contain master data in the form of attributes, texts or hierarchies. Master data is data that remains unchanged over a long period of time. The master data of a cost center, for example, contains the name (text), the person responsible (attribute), and the relevant hierarchy area (hierarchy).

●      Units such as currencies or units of measure define the context of the values of the key figures.

Consistency on the metadata level is ensured by your consistently using identical InfoObjects to define the data stores in the different layers.

DataStore objects permit complete granular (document level) and historic storage of the data. As for DataSources, the data is stored in flat database tables. A DataStore object consists of a key (for example, document number, item) and a data area. The data area can contain both key figures (for example, order quantity) and characteristics (for example, order status). In addition to aggregating the data, you can also overwrite the data contents, for example to map the status changes of the order. This is particularly important with document-related structures.

Modeling of a multidimensional store is implemented using InfoCubes. An InfoCube is a set of relational tables that are compiled according to an enhanced star schema. There is a (large) fact table (containing many rows) that contains the key figures of the InfoCube as well as multiple (smaller) surrounding dimension tables containing the characteristics of the InfoCube. The characteristics represent the keys for the key figures. Storage of the data in an InfoCube is additive. For queries on an InfoCube, the facts and key figures are automatically aggregated (summation, minimum or maximum) if necessary. The dimensions combine characteristics that logically belong together, such as a customer dimension consisting of the customer number, customer group and the steps of the customer hierarchy, or a product dimension consisting of the product number, product group and brand. The characteristics refer to the master data (texts or attributes of the characteristic). The facts are the key figures to be evaluated, such as revenue or sales volume. The fact table and the dimensions are linked with one another using abstract identifying numbers (dimension IDs). As a result, the key figures of the InfoCube relate to the characteristics of the dimension. This type of modeling is optimized for efficient data analysis. The following figure shows the structure of an InfoCube:

You can create logical views (MultiProviders, InfoSets) on the physical data stores in the form of InfoObjects, InfoCubes and DataStore objects, for example to provide data from different data stores for a common evaluation. The link is created across the common Info Objects of the data stores.

The generic term for the physical data stores and the logical views on them is InfoProvider. The task of  an InfoProvider is to provide optimized tools for data analysis, reporting and planning.

Data Flow

The data flow in the Enterprise Data Warehouse describes how the data is guided through the layers until it is finally available in the form required for the application. Data extraction and distribution can be controlled in this way and the origin of the data can be fully recorded. Data is transferred from one data store to the next using load processes. You use the InfoPackage to load the source data into the entry layer of SAP NetWeaver BI, the persistent staging area. The data transfer process (DTP) is used to load data within BI from one physical data store into the next one using the described transformation rules. Fields/InfoObjects of the source store are assigned to InfoObjects of the target store at this time.

You define a load process for a combination of source/target and define the staging method described in the previous section here. You can define various settings for the load process; some of them depend on the type of data and source as well as the data target. For example, you can define data selections in order to transfer relevant data only and to optimize the performance of the load process. Alternatively, you can define if the entire source dataset or only the new data since the last load should be loaded into the source. The latter means that data transfer processes automatically permit delta processing, individually for each data target. The processing form (delta or entire dataset) for InfoPackages, that is the loading into the SAP NetWeaver BI System, depends on the extraction program used.

Permanent link to this article: https://blog.openshell.in/2010/12/data-storage-and-data-flow/

Fixing libmysql.dll issue in Rails

While working on rails with mysql as database you may got error like this “This application has failed to start because libmysql.dll was not found. Re-installing the application may fix this problem” while executing the code ‘rake db:create’. If that so, then fallow the fallowing steps:

1. type the command in the console

gem install mysql

(this is for windows, if you are  using linux os add sudo at the beginning)

2. Copy the libmysql.dll found in the mysql installation directory (mysqlbin) and paste it in your ruby installation directory (rubybin).

3. Restart the server.

thats all, it will work now.

Permanent link to this article: https://blog.openshell.in/2010/12/fixing-libmysql-dll-issue-in-rails/

Importing data from CSV File

Here is an example to importing data from csv file into MySQL table.

LOAD DATA INFILE “/home/mysql/data/file_name.csv” INTO TABLE table_name FIELDS TERMINATED BY ‘,’ LINES TERMINATED BY ‘\\n’;

Permanent link to this article: https://blog.openshell.in/2010/12/importing-data-from-csv-file/

Find duplicate repords in Table

Here is an example to find duplicate records from the table.

select address, count(address) as cnt from mailing_list group by address having cnt > 1 order by cnt;

Permanent link to this article: https://blog.openshell.in/2010/12/find-duplicate-repords-in-table/