Monday, November 30, 2009

IIS 6 – Viva the Application Pool

IIS 6 changes the processing model significantly in that IIS no longer hosts any foreign executable code like ISAPI extensions directly. Instead IIS 6 always creates a separate worker process – an Application Pool – and all processing occurs inside of this process, including execution of the ISAPI dll. Application Pools are a big improvement for IIS 6, as they allow very granular control over what executes in a given process. Application Pools can be configured for every virtual directory or the entire Web site, so you can isolate every Web application easily into its own process that will be completely isolated from any other Web application running on the same machine. If one process dies it will not affect any others at least from the Web processing perspective.

In addition, Application Pools are highly configurable. You can configure their execution security environment by setting an execution impersonation level for the pool which allows you to customize the rights given to a Web application in that same granular fashion. One big improvement for ASP.NET is that the Application Pool replaces most of the ProcessModel entry in machine.config. This entry was difficult to manage in IIS 5, because the settings were global and could not be overridden in an application specific web.config file. When running IIS 6, the ProcessModel setting is mostly ignored and settings are instead read from the Application Pool. I say mostly – some settings, like the size of the ThreadPool and IO threads still are configured through this key since they have no equivalent in the Application Pool settings of the server.

Because Application Pools are external executables these executables can also be easily monitored and managed. IIS 6 provides a number of health checking, restarting and timeout options that can detect and in many cases correct problems with an application. Finally IIS 6’s Application Pools don’t rely on COM+ as IIS 5 isolation processes did which has improved performance and stability especially for applications that need to use COM objects internally.

ref:west-wind

Saturday, November 28, 2009

MVS SYSTEM CODES-S804

The storage needed to execute the program was not available.

1. The region parameter did not specify enough storage.
2. The region parameter was omitted, and the default storage amount was too small to run the correct program.
3. Block sizes were increased or buffers were added, and the region size was not increased.
4. A logic error caused excessive storage to be obtained but not freed.

1. Increase the region size.
2. Look for logic errors which may cause excessive f calls to other programs or requests for storage.

Ref: www.ibmmainframes.com

Thursday, November 26, 2009

Encrypting e-mail

Encryption means scrambling the text of your message to a seemingly gibberish combination of letters and numbers, so that anyone who reads it en route can make no sense of it. Only the recipient is able to decrypt the message.
Using public keys is the most common form of encryption. This requires the use of two keys - a public key and a private key. The private key resides on your computer and you share the public key with the recipients to which you wish to send encrypted messages. When you wish to send the message, you encrypt it with the public key. On the other end, the recipient needs its own private key and your public key to decrypt the message. Since the message is decrypted using your public key, it proves that you sent the message. You can encrypt messages as well as attachments.
If you use Outlook as your e-mail client, encryption is built into it via digital IDs, which enable you to encrypt your message and digitally sign it as well. You can also use the popular public-key encryption system, PGP (Pretty Good Privacy), with Outlook itself and with other e-mail clients. This utility is available as freeware on Source: www.pgpi.org.

Tuesday, November 24, 2009

IIS 6 – Viva the Application Pool

Although IIS 6 application pools are separate EXEs, they are highly optimized for HTTP operations by directly communicating with a kernel mode HTTP.SYS driver. Incoming requests are directly routed to the appropriate application pool. InetInfo acts merely as an Administration and configuration service – most interaction actually occurs directly between HTTP.SYS and the Application Pools, all of which translates into a more stable and higher performance environment over IIS 5. This is especially true for static content and ASP.NET applications.

An IIS 6 application pool also has intrinsic knowledge of ASP.NET and ASP.NET can communicate with new low level APIs that allow direct access to the HTTP Cache APIs which can offload caching from the ASP.NET level directly into the Web Server’s cache. In IIS 6, ISAPI extensions run in the Application Pool worker process. The .NET Runtime also runs in this same process, so communication between the ISAPI extension and the .NET runtime happens in-process which is inherently more efficient than the named pipe interface that IIS 5 must use. Although the IIS hosting models are very different the actual interfaces into managed code are very similar – only the process in getting the request routed varies a bit.

Sunday, November 22, 2009

MVS SYSTEM CODES-S806

A module requested by the program could not be found.

1. The module requested did not exist in the data sets specified in the STEPLIB or JOBLIB.
2. A JCL STEPLIB or JOBLIB DD statement was missing or incorrect.
3. The module name was misspelled.
4. An I/O error occurred in searching for the module in the library directory.

1. Verify that the correct program is being requested.
2. Ensure that the appropriate STEPLIB or JOBLIB DD statements are in the JCL.
3. If necessary, recreate the data set.
Ref: www.ibmmainframes.com

Friday, November 20, 2009

AS/400 Tip 2

Data Areas are chunks of memory to hold a few control values. A typical use is to keep track of the last invoice number for a system.

To create a data area, use the command
CRTDTAARA (Create Data Area).
For example, to create a 100 character data area named LASTINV#:
CRTDTAARA DTAARA(MYLIB/LASTINV#) TYPE(*CHAR) LEN(100)
Now, load the first 10 positions with the value "AA12345678" with the CHGDTAARA (Change Data Area) command
CHGDTAARA DTAARA(QTEMP/LASTINV# (1 10)) VALUE('AA12345678')
Look at the value of the data area with DSPDTAARA (Display Data Area):
DSPDTAARA MYLIB/LASTINV# A CL program can retrieve the value with RTVDTAARA.
An RPG program uses the "IN" operation to retrieve the value and the "OUT" operation to change it. There is a special Data Area known as the LDA (Local Data Area). It is 1024 characters and is associated with a job. So, any display session has an LDA associated with it. Not only that, when a job is submitted to run in batch, the LDA gets sent with the job so the batch job can read the LDA of the display session that submitted it.

View and change your LDA by using *LDA instead of a data area name:
DSPDTAARA *LDA CHGDTAARA DTAARA(*LDA (1 10)) VALUE('AA12345678')
Using the LDA is considered by many to be an obsolete style. Older programs use the LDA to store and pass parameters.

Source: http://www.texas400.com/b400tip1.html

Wednesday, November 18, 2009

AS/400 Tip 1

Converting an AS/400 database file to a CSV file
You may find yourself in a situation where you want to run a Query on a file, save the information to a database,and then convert that information to a Comma Separated Variable (CSV) file. This is especially true when you need the data to be used in a "spread sheet" format like Excel.
The simplest way to do this is to copy the information from the data file to your newly created CSV file.

Enter this command:
CPYTOIMPF FROMFILE(*LIBL/DTAFIL) TOFILE(USER999/CSVPC)
Hit Enter, and then again 3 times and you have now created a Comma Separated Variable (CSV) File.
Remember that you need a 'destination file' before you can use this command. To create a 'destination file', you will need to use the Create Physical File command. To create a file named CSVPC that is 200 characters in length, type in the command:
CRTPF FILE(USER999/CSVPC)
Hit F4 to prompt the command, and type in the record length you need, for Member, be sure to name it CSV.

Source: http://www.texas400.com/b400tip23.html

Monday, November 16, 2009

CHARSET Statement

The CHARSET statement specifies the contents of one or more of the character segments of a library character set module. A library character set module consists of header information followed by 64 character segments. Each character segment contains the character's 6-bit code for a WCGM location, its scan pattern, and its pitch. You can use the INCLUDE statement to copy an entire module, minus any segments deleted using the DELSEG keyword. In addition, you can use the CHARSET statement to select character segments from any module named with a library character set ID or the GCM keyword. The CHARSET statement can also specify the scan pattern and characteristics for a new character.

The CHARSET statement must always be followed by a NAME statement, another CHARSET statement, or one or more data statements. The CHARSET statement must be preceded by an OPTION statement with the DEVICE parameter if you want to create library character set modules in the 3800 Model 3 compatibility mode module format. The CHARSET statement can be preceded by an INCLUDE statement. More than one CHARSET statement can be coded in the operation group. The operation group can include CHARSET statements that select characters from existing modules and CHARSET statements that create new characters. The CHARSET statement, preceded by an INCLUDE statement, can be used to delete one or more segments from the copy of an existing module to create a new module.

A CHARSET statement with no operands specified, followed by a NAME statement that identifies a library character set module, is used to format and print the module.

Source : http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dgt1u104/7.5.7?DT=19990113105507

Saturday, November 14, 2009

INCLUDE Statement

When an IEBIMAGE operation group is used to create a new module, the INCLUDE statement can identify an existing image library module to be copied and used as a basis for the new module. When the operation group is used to update an image library module, the INCLUDE statement identifies the module to be referred to and must be specified.

When the INCLUDE statement is coded in an operation group, it must precede any FCB, COPYMOD, TABLE, GRAPHIC, or CHARSET statements.

Only one INCLUDE statement should be coded for each operation group. If more than one is coded, only the last is used; the others are ignored.

You can code an INCLUDE statement for an FCB module only if the DEVICE=4248 parameter is specified on the OPTION statement. Either 3211 format or 4248 format FCBs may be included. IEBIMAGE tries to locate the 4248 format FCB first; if it is not found, IEBIMAGE looks for the 3211 format. You cannot copy a 3800 FCB module with INCLUDE.

Source : http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dgt1u104/7.5.8?DT=19990113105507

Thursday, November 12, 2009

Different ways to shut down your PC

There are so many different ways to turn off your Windows XP computer, let's look at some of them:
1. The standard approach - click the Start Button with your mouse, then select the Turn Off menu and finally click the Turn Off icon on the Turn Off computer dialog.
2. Press Ctrl+Esc key or the Win key and press U two times - the fastest approach.
3. Get the Shutdown utility from Download.com - it adds the shut down shortcuts for you. Else create them yourself using approach (4).
4. Create a shutdown shortcut on your desktop. Right click on the desktop, choose New Shortcut and type shutdown -s -t 00 in the area where you are asked to specify the location of the program file. Now you can just double click this icon to turn off the computer. The best location would be your quick launch bar.
5. Press the Win key + R key to open the run window. Type shutdown -s -t 00. [s means shutdown while t means the duration after which you want to initiate the shutdown process]. If some open processes or application won't let you turn off, append a -f switch to force a shutdown by closing all active processes.
6. Win+M to minimize all windows and then Alt+F4 to bring the Turn Off computer dialog.
7. Open Windows Task manager (by right clicking the Windows Task bar or Alt+Ctrl+Del) and choose Shut down from the menu. Useful when the Windows are not responding.
8. open task manager - click on shutdown - hold the ctrl key and click on Turn off, pc will be turned off in 3 secs. Fastest method other than hard shutdown.

Tuesday, November 10, 2009

Create and Format an Excel in Asp.net

A simple code snippet to create excel and write some date to cell from C#.
Step 1: Add reference to " microsoft excel 12.0 object library " in the project.
Step 2: Include the namespace " using Excel = Microsoft.Office.Interop.Excel; "
Step 3: In the click event of export button:
string strCurrentDir = Server.MapPath(".") + "\\";
Excel.Application excel = new Excel.ApplicationClass();
excel.Visible = false;
Excel._Workbook workbook = excel.Workbooks.Add(Missing.Value);
Excel.Sheets sheets = workbook.Worksheets;
Excel._Worksheet exlSheet = (Excel.Worksheet)sheets.get_Item("Sheet1");
summarySheet.Name = "Report Name";
Excel.Range headerRng = (Excel.Range)exlSheet .get_Range("A1", "B1");
headerRng.MergeCells = true; headerRng.Value2 = "Report Header";
headerRng.Font.Bold = true;
headerRng.Font.Name = "Arial";
headerRng.Font.Size = 18;
headerRng.WrapText = true;
headerRng.HorizontalAlignment = Excel.Constants.xlCenter;
headerRng.Interior.Color = System.Drawing.Color.Gray.ToArgb();
headerRng.Borders.Weight = 3;
headerRng.Borders.LineStyle = Excel.Constants.xlSolid;
headerRng.Cells.RowHeight = 30;
headerRng.EntireColumn.AutoFit();

workbook.SaveAs(strCurrentDir + "ExportReport.xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookNormal, null, null, false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlShared, false, false, null, null, null);

Sunday, November 08, 2009

Verifying a connection between the AS/400 and RPM

To make a TCP/IP connection to RPM, the TELNET command may be used. To verify a connection, perform the following telnet test.
  • At the AS/400 command prompt, type TELNET and press F4
  • In the Start TCP/IP TELNET (TELNET) screen, press F9 to view "all parameters."
  • In the Remote System field, type *INTNETADR. Enter the IP address of the RPM host in the Internet Address field.
  • Locate the Port parameter and enter 515, then press Enter.

If RPM is configured to relax the 'port in range' requirement, this will input-inhibit the session if a connection is made. Close RPM (Windows 9x) or restart the RPM service (RPM Elite/Select) to release the AS/400 session. Then restart RPM and check the RPM log for new message.

If RPM is not configured this way, a new message should be displayed in the RPM log stating:
Client port xxxx out of range
Although this message is a warning, it verifies that a connection was made to RPM at port 515.

Source: http://www.brooksnet.com/faq/101-11.html

Friday, November 06, 2009

Finding and displaying hyperlinks in a web page

The Java application written below uses regular expressions to find and display hyperlinks contained within a Web page. After compiling the file, you should save a Web page to the same folder that contains ShowLinks.class.

import java.io.*;
import java.util.regex.*;
public class ShowLinks {
public static void main(String[] arguments) {
if (arguments.length < 1) {
System.out.println("Usage: java ShowLinks [page]");
System.exit(0);
}
String page = loadPage(arguments[0]);
Pattern pattern = Pattern.compile(" Matcher matcher = pattern.matcher(page);
while (matcher.find()) {
System.out.println( matcher.group(1));
}
}

private static String loadPage(String name) {
StringBuffer output = new StringBuffer();
try {
FileReader file = new FileReader(name);
BufferedReader buff = new BufferedReader(file);
boolean eof = false;
while (!eof) {
String line = buff.readLine();
if (line == null)
eof = true;
else
output.append(line + "\n");
}
buff.close();
} catch (IOException e) {
System.out.println("Error – " + e.toString());
}
return output.toString();
}
}

java-tips.org

Wednesday, November 04, 2009

Compressing a Byte Array

This Java tip illustrates an example of compressing a Byte Array. Developer may compress a byte array with the help of Deflater class.
byte[] input = "compression string".getBytes();
Deflater compressor = new Deflater();
compressor.setLevel(Deflater.BEST_COMPRESSION);
compressor.setInput(input);
compressor.finish();
ByteArrayOutputStream bos = new ByteArrayOutputStream(input.length);
byte[] buf = new byte[1024];
while (!compressor.finished()) {
int count = compressor.deflate(buf);
bos.write(buf, 0, count);
}
try {
bos.close();
} catch (IOException e) {
}
byte[] compressedData = bos.toByteArray();

java-tips.org

Monday, November 02, 2009

What is Adobe Text Layout Framework

The Text Layout Framework is an extensible library, built on the new text engine in Adobe Flash Player 10, which delivers advanced, easy-to-integrate typographic and text layout features for rich, sophisticated and innovative typography on the web. The framework is designed to be used with Adobe Flash CS4 Professional or Adobe Flex®, and is already included in the next version of Flex, code named Gumbo. Developers can use or extend existing components, or use the framework to create their own text components.

Together with the new text engine in Flash Player 10 and AIR 1.5, the Text Layout Framework delivers multi-lingual, print-quality typography for the web, including support for:
  • Bidirectional text, vertical text and over 30 writing systems including Arabic, Hebrew, Chinese, Japanese, Korean, Thai, Lao, the major writing systems of India, and others.
    >Selection, editing and flowing text across multiple columns and linked containers, and around inline images
  • Vertical text, Tate-Chu-Yoko (horizontal within vertical text) and justifier for East Asian typography
  • Rich typographical controls, including kerning, ligatures, typographic case, digit case, digit width and discretionary hyphens
  • Cut, copy, paste, undo and standard keyboard and mouse gestures for editing
  • Rich developer APIs to manipulate text content, layout, markup and create custom text components.
Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory