Friday, May 14, 2010

Creating library project in flex

Creating library project:
  • Open Flex builder 3
  • Navigate to File->New->Flex Library Project
  • In the New Flex Library Project dialog
  1. Enter the project name as "FirstLibProject"
  2. Click on Next
  3. Select the Classes tab
  4. In the Main source folder item click on Browse
  5. In select Source folder dialog select the project
  6. Click on New button
  7. A new folder will be added under the projects
  8. Click Ok
  9. Select the checkbox for the src folder (All the classes in this folder will be included in library swc)
  10. Click on Finish button
  • Create an mxml component under src folder by right clicking on src folder and name it "LibrarySample.mxml"
  • Create an Action script class under src and name it as "LibraryAS.as"
  • In the bin folder a swc file will be created by name FirstLibProject.swc

In our mxml if we want to use these Files which we created above we can include the swc file to our project.


Including the swc file in a project:
In the project "Xyz" which we want to include the swc copy the swc which we created above:

  • Copy the FirstLibProject.swc to some path (c:\lib)
  • Open the project "Xyz" in Flex builder
  • Right click on the project "Xyz" (in navigator view) click on Properties
  • Select Flex Build Path in the Properties dialog
  • Select Library path tab
  • Click on Add SWC and browse for C:\temp\FirstLibProject.swc and click Ok
  • In this project we can use the classes LibrarySample and LibraryAS

Wednesday, May 12, 2010

Find in CF

Finds the first occurrence of a substring in a string, from a specified start position. The search is case-sensitive.
A number; the position of substring in string; or 0, if substring is not in string.
Syntax:
Find(substring, string [, start ])

Parameter Description
substring A string or a variable that
contains one. String for which to search.
string A string or a variable that contains one.
String in which to search.
start Start position of search.

Program :


#find("the",stringToSearch)#

#find("the",stringToSearch,35)#

#find("no such substring",stringToSearch)#



Source :
http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi80.htm#wp1104451

Monday, May 10, 2010

MVS SYSTEM CODES-S813

The data set name in the JCL did not match the data set name on the tape.

1. The JCL volume serial number was wrong.
2. The data set name in the JCL was misspelled.
3. The wrong tape was mounted.
4. The incorrect data set sequence number was specified in the label parameter.
5. The data set does not exist on the magnetic tape. Verify that the JCL is correct, and resubmit the job.

Ref: www.ibmmainframes.com

Saturday, May 08, 2010

How to find out Version Of Oracle Application in Unix-2

c. Class file version
Step 1. Go to the UNIX box
Step 2. Go to the class file location
$strings -a grep Header

d. Apachhe Version
Step 1. Go to the UNIX box
Step 2. Go to the $iAS or $IAS_CONFIG_HOME
Step 3. Then go to Apachhe/Apachhe/bin directory
Step 4. run the following Command
$httpd -version

The output will be
bash-2.03$ httpd -version
Server version: Oracle HTTP Server Powered by Apache/1.3.19 (Unix)
Server built: Jan 26 2005 11:06:44 (iAS 1.0.2.2.2 rollup 5)

Thursday, May 06, 2010

How to find out Version Of Oracle Application-1

Whenever you are working in oracle application you will face some situation where you have to know the version of the products you are using in your Oracle Application. Though the env file help you a lot to reduce the need of the versions as it makes the system user friendly. In some issue solving cases such as upgrade, patching or some specific issues you must have to know the versions.

The products we are using can be of almost three types -
1. Components related to Application
2. Components related to Database
3. Components related to some useful utilities and OS

Components related to Application:
a. The version of the oracle application.
Step 1. First open the Oracle Application Frontend
Step 2. Open any form session in it
Step 3. Go to help
Step 4. Click on "About Oracle Application"

b. Version of Oracle Application Forms or Reports.
Step 1. Go to the UNIX box
Step 2. Go to the $CUSTOM_TOP location
Step 3. Then go to /11.5.0/forms/US/
Step 4. Run the following command

Tuesday, May 04, 2010

Call a class private method from another class

while googling, i have came accross a interesting thing, these blog is just to share the information with you all.
Here i am calling private method method1() in PrivateMethodClass from another class CallingMethod. the below is the source code, which i tried.

Source Code:
PrivateMethodClass.java

package com.src;
public class PrivateMethodClass {
private void method1(int a,int b){
System.out.println("Var:a:"+a+"::Var b:"+b);
int c = a+b;
System.out.println("Var c:"+c);
}

public void method2(int a,int b){
System.out.println("Var:a:"+a+"::Var b:"+b);
int c = a+b;
System.out.println("Var c:"+c);
}
}

CallingMethod.java
package com.src;
import java.lang.reflect.Method;
public class CallingMethod {
public static void main(String[] args) {
Class klass;
try {
klass = PrivateMethodClass.class;
PrivateMethodClass pmc = new PrivateMethodClass();
Class[] param = {Integer.TYPE,Integer.TYPE};
Method m[] = klass.getDeclaredMethods();
int c =0;
int a[] = {1,2};
for(int i=0;i System.out.println("Method name is "+m[i].getName());
m[i].setAccessible(true);
m[i].invoke(pmc,1,2);
}
} catch (Exception e) {
System.out.println("Exception::"+e.getMessage());
}
}
}

The Output Result:
Method name is method1
Var:a:1::Var b:2
Var c:3
Method name is method2
Var:a:1::Var b:2
Var c:3

Source: http://vishalnjain.blogspot.com/

Sunday, May 02, 2010

MVS SYSTEM CODES-S913

An error occurred in opening a magnetic tape data set.

1. The error occurred during open or end-of-volume processing. The data set was password protected, and a correct password was not entered.

2. The error occurred in opening a checkpoint data set which was concatenated to a non-checkpoint data set.


1. Supply the correct password, and resubmit the job.

2. Eliminate any concatenations of checkpoint and non-checkpoint data sets.


Ref: www.ibmmainframes.com

Saturday, May 01, 2010

MVS SYSTEM CODES -SA13

An error occurred in opening a tape data set.

1. The file sequence number was wrong on a multi-volume tape data set.

2. The file sequence number was wrong, or it was less than that of the first data set on the tape.

3. The volume serial number was wrong.

4. The job which wrote the tape did not write all the data sets.

Steps:
1. Verify that the JCL is correct, and resubmit the job.

2. If the desired data set does not exist on the tape, recreate the tape.
Ref: www.ibmmainframes.com

Friday, April 30, 2010

Value restricions

Some primitive value besides a conrete data-type may have a predefined set of values. And the value can be set only to one of that variants, like enumerations. XML schema allows us to restrict the value of a given type by a set of enumerated values. From the other hand we can restrict some value by defining its min/max bounds:

http://www.w3.org/2001/XMLSchema">




























source: java-tips.org

Wednesday, April 28, 2010

DataBase Links

A database link is a pointer in the local database that allows you to access the data on a remote database.
For example: If we want to access the database of a different server other than the one we are working on. we cannot access that database directly if we don’t have access.In such cases we use Database links to access the remote database.
There is no special syntax fort using these Dblinks.we should just add that link after the table name as shown below.

Select * from emp where emp_id=’1111111’;

This is the actual query.using this query we should access the remote database to which we don’t have access.In this case you can access that remote database if it has a DBlink available to connect to our database.

For Example if GOAT is the Dblink used to access the database of Goat,then the above query should be given in this way

Select * from emp@GOAT where emp_id=’1111111’

In this way by using DBlinks we can access remote databases.

Monday, April 26, 2010

Tired of including configuration files in your scripts

I am often tired of including configuration files in my scripts. Even if it is a single file it becomes important to include that file in our scripts otherwise we wont get the necessary variables set. Once when I started searching for a workaround for it, I found that we can configure it right in one place and say PHP take care of this headache.
Yes, We can do it.

1.Place all your configuration files in one folder in the server. Say "DOCUMENT_ROOT/config/lib"
2. Create a new file with a name preinclude.php
3. Declare or include (again include ) all your common variables, config files in this file.
4.In the DOCUMENT_ROOT folder create a .htaccess file
5. Write the following code in this:

# Code starts here
php_value auto_prepend_file "path to include directory/preinclude.php"
# Code ends here

We can include whichever file which we feel should be executed before each and every file execution here.

Saturday, April 24, 2010

Advantage of SYNC Class

The SYNCHRONIZED clause is sometimes used with USAGE IS COMP or USAGE IS INDEX items. It is used to optimize speed of processing but it does so at the expense of increased storage requirements.
The word SYNC can be used instead of SYNCHRONIZED.
The SYNCHRONIZED clause is used to explicitly align COMP and INDEX items along their natural word boundaries. Without the SYNCHRONIZED clause, data-items are aligned on byte boundaries.
Example: 01 TWO-BYTE PIC S9(4) COMP SYNC.

Thursday, April 22, 2010

Optimize SOAP Messages

As we all know SOAP content is nothing but a XML.Though XML is descriptive, sometimes it might be typically larger due to the volume of tags. So given the case,if you have any performance problems in using SOAP XML's, consider using Message Transmission Optimization Mechanism (MTOM), which builds on XML-binary Optimized Packaging (XOP). XOP provides a more efficient serialization of XML by using MIME encoding. MTOM uses XOP to encode portions of SOAP messages,while still presenting an XML Infoset to the SOAP application.

Another, more recent alternative is to use XFire. XFire is an open source,standards-compliant SOAP framework that uses the latest technologies, including a StAX parser, to boost SOA messaging performance. As i spoke about StAX,i will give a brief intro about that here…

StAX:Streaming API for XML:
StAX
is a parser API that falls between the tree-navigation DOM and push event-based SAX interfaces. It works serially on an XML document as SAX does, but it allows tokens to be pulled by the application.
Again, unless your performance is unacceptable, you should be fine with regular XML SOAP messages. However, if you are providing services to a large community of clients, you may need to boost your performance using one of the above mentioned alternatives.

Tuesday, April 20, 2010

Show data with JTable

This Java Swing tip illustrates a method of showing data in database in a JTable. JTable act as a output for the database. The developer may use this to display a part of data (for example data generated form a query) to the user in a table. The table gives user an impression of database.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
public class DatabaseTest extends JFrame {
JTextField hostField;
JTextField queryField;
QueryTableModel qtm;

public DatabaseTest() {
super("Database Test Frame");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(350, 200);
qtm = new QueryTableModel();
JTable table = new JTable(qtm);
JScrollPane scrollpane = new JScrollPane(table);
JPanel p1 = new JPanel();
p1.setLayout(new GridLayout(3, 2));
p1.add(new JLabel("Enter the Host URL: "));
p1.add(hostField = new JTextField());
p1.add(new JLabel("Enter your query: "));
p1.add(queryField = new JTextField());
p1.add(new JLabel("Click here to send: "));
JButton jb = new JButton("Search");

jb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
qtm.setHostURL(hostField.getText().trim());
qtm.setQuery(queryField.getText().trim());
}
} );

p1.add(jb);
getContentPane().add(p1, BorderLayout.NORTH);
getContentPane().add(scrollpane, BorderLayout.CENTER);
}
public static void main(String args[]) {
DatabaseTest tt = new DatabaseTest();
tt.setVisible(true);
}
}

Source: java-tips.org

Sunday, April 18, 2010

Creating a Confirm Dialog Box

The easiest way to create a Yes/No/Cancel dialog box is to use showConfirmDialog(Component, Object) method of JOptionPane class.
The following example uses a confirm dialog box with a text message and stores response in the response variable:
int response;
response = JOptionPane.showConfirmDialog(null, "Should i delete all files?");


source: java-tips.org

Friday, April 16, 2010

Restarting Windows Without Restarting Your PC

A modern PC with Vista Home Edition takes about one and a half minutes to boot. An older machine with XP is about the same. That’s 30 seconds for the PC itself (the BIOS) to boot up, plus a minute for the Windows operating system to boot. Sometimes, you need to reboot Windows (e.g. when installing new software), but there is no need to restart BIOS, too. However, the default is to reboot both. (That’s called doing a “cold boot,” rather than a “warm boot.”) There’s a trick that works on both XP and Vista to get it to do a warm boot instead, thus saving you 30 seconds per cycle.
The trick is to hold down the SHIFT key when invoking the restart.
Select Start. Select “Shut Down…”. Change the drop-down combo box under “What do you want the computer to do?” to “Restart”. Hold down the SHIFT key while clicking on the “OK” button.

Source: www.masternewmedia.org

Wednesday, April 14, 2010

Lotus notes: Change your password

In my previous article about lotus notes, we have seen how to configure an email account in Lotus notes.Today we will look into the topic, how to change the password of your Lotus notes account.
Open the Lotus notes client,1. Go to File-> Security-> User Security2. In the 'User Security' window, go to 'Your Login and Password Settings' section3. Click on the 'Change Password' button4. Change Password Pop up window is displayed 5. Type the new password, then reenter the new password and click OK6. A popup message box is dispayed "Your Password Change succeeded".
Now you can access your email with your new password.

Monday, April 12, 2010

AS/400 Tips 17

Retaining Customization
It is often required or desirable to customize certain system attributes from how they are set out of the box. For example, you may want to change certain command defaults from the IBM-shipped defaults.
When you do an O/S upgrade however, you'll find that your changes were erased. Unless you kept very good documentation, you'll be hard pressed to remember which changes you made.
A good workaround to this is to create a CL source member that contains all the commands you've customized your system with. Keep the source member up to date and include thorough comments.Compile this member into a program, and simply run the program whenever you've done an upgrade.

Source: http://midwareservices.com/tipstricks/windows.htm

Saturday, April 10, 2010

AS/400 Tips 18

POP UP COMMNAD LINES
It's pretty common to be several programs deep in an application when you suddenly have the need for a command line. There's any easy way to allow this without having to back out or switch to a different session.
Program QUSCMDLN is the IBM supplied API to call a command line. No parameters are required. You may want to add a function key to your application programs (perhaps F21) to call this program.
If you don't want to go through this much work, simply change your user profile (CHGUSRPRF) and set QUSCMDLN as your attention key handling program.

Source: http://midwareservices.com/tipstricks/command_lines.htm

Thursday, April 08, 2010

Turn off Indexing to speed up XP

Windows XP keeps a record of all files on the hard disk so when you do a search on the hard drive it is faster. There is a downside to this and because the computer has to index all files, it will slow down normal file commands like open, close, etc. If you do not do a whole lot of searches on your hard drive then I suggest turnning this feature off:
1. Control Panel
2. Administrative Tools
3. Services
4. Disable Indexing Services

Source: www.tweakxp.com
Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory