Tuesday, October 18, 2011

What is EDI ?


Electronic Data Interchange, or EDI, is not a new technology and in fact has been around since the late 1960s. While EDI has benefited enormously from advances in technology, eg the introduction of the internet, EDI is not technology dependant. There are preferred ways to implement EDI in a company, but there are many approaches to choose from. The approach chosen should be driven by a company’s business needs, not a particular implementation or technology.
In its simplest form, EDI is the computer to computer exchange, between two companies, of standard business documents in electronic format. There are two key elements in basic EDI. First, electronic documents replace paper based ones. Second, the exchange of documents takes place in a standardised format. Using these two basic concepts, any business can enter the world of EDI and begin taking advantage of the speed and economy of electronic commerce, or e-Commerce.
aboutEDI

In today’s fast-paced business world, your business may already be moving in this direction, customers or suppliers may already be approaching you to begin trading information electronically. For the newcomer to EDI, it may seem a very confusing subject area.
So what is a document? A document is any form of communication, usually paper based, sent between two companies, examples include:
  • Purchase Orders
  • Invoices
  • Shipping Notices
  • Export / Import Notices
  • Carrier to carrier waybills
  • Funds transfer
  • Design specifications
  • Health insurance claims
EDI is essentially a data processing concept which is independent of communication protocols or transmission media. EDI is a logical outgrowth of the standard computerisation going on within companies over the last few decades. With EDI, the type of electronic communication between departments within a company can now easily be extended to reach out to other companies or trading partners.
EDI replaces human readable, paper or electronic based documents with machine readable, electronically coded documents. With EDI, the sending computer creates the message and the receiving computer interprets the message without any human involvement at all.
Before learning about what makes up an EDI system and how to implement one, it is important to look at an example that highlights some of the key differences between traditional paper document transactions and EDI. One of the first places where many companies implement EDI is in the exchange of a purchase order, (PO). In the traditional method of processing a purchase order, a buyer or purchasing agent will go through a fairly standard procedure to create a purchase order, consisting of the following steps:
  • A buyer reviews data from an inventory or planning system
  • The buyer enters data into a screen in the purchasing system to create a PO
  • The buyer waits for the PO to be printed, usually on a special form
  • After the PO is printed, the buyer mails it to the vendor
  • The vendor receives the PO and posts it in their order entry system
  • The buyer calls the vendor periodically to determine if the PO has been received and processed
When you add up the internal processing time required by the sender and receiver, and then add a couple of days in the mail, this process normally takes between three and five days. This assumes first that both the sender and receiver handled the PO quickly and that at every point along the way there were no errors in transcribing data from a form to a system.
ABOUTedi

Now consider the same document exchange when a company places its purchase orders electronically using EDI:
  • The buyer reviews the data and creates the PO, but does not print it
  • EDI software creates an electronic version of the PO and transmits it automatically to the sender within minutes
  • The vendor’s order entry system receives the PO and updates the system immediately upon receipt
What took up to five days with paper and the postal system has just taken less than one hour. By eliminating the paper handling from most of the stages of the process, EDI has the potential to transform a traditional paper based process to look like this:
EDI mailbox

The major benefits of implementing EDI within your business are discussed in more detail in the ‘Benefits of EDI’ section of this Microsite but in summary EDI can help improve speed and accuracy of transactions, reduce costs and it provides improved flexibility when interacting on a daily basis with your trading partners or customers. To find out how to implement an EDI system, please choose the ‘Implementing EDI’ button from the menu above.

Saturday, July 30, 2011

Dialog Box in JAVA

import javax.swing.JOptionPane;

class dialogbox{

    public static void main(String args[])
    {
        JOptionPane.showMessageDialog(null,"Helloo","THE Title",0);
        JOptionPane.showConfirmDialog(null,"Is it Okkk??","Confirm");
       
    }

}

Tuesday, June 28, 2011

Motorola launches Xoom tablet in India

Motorola Mobility became the latest entrant in India as it launched the Xoom tablet in 3G and Wi-Fi priced at Rs 32,990 and 39,990 respectively on Tuesday.

"Motorola Xoom will delight customers with its ease of use, speed and vivid graphics," Motorola Mobility mobile devices business country head for sales and operations (India and South West Asia) Rajan Chawla said.

The Indian tablet market has heated up over June with more than half-a-dozen handset makers launching their tablets.

Motorola Xoom will compete with the Apple iPad and Samsung Galaxy Tab , recently launched BlackBerry PlayBook and Chinese manufacturers such as HTC, Huawei and G'Five. Homegrown brands such as Spice and Olive that have launched tablets at competitive price last year may enjoy the first mover advantage over the rest.

Canadian phone maker Research In Motion launched the PlayBook in India last week, which will be available at Rs 27,990 for 16 GB memory, Rs 32,990 for 32GB and Rs 37,990 for 64 GB.

Chinese handset maker HTC plans to launch Flyer at Rs 39,890 in the Indian market. It's competitor G'Five announced a price point of sub Rs 10,000 in May for its tablet that would run on Android and Windows platforms, slated to hit the market by June-end.

Huawei launched the light and slim MediaPad this month and would launch its tablet S7 in India between July and September.

According to the International Data Corporation, sales in the tablet market are expected to increase more than fourfold in the next two years. While sales in the tablet PC segment in India are expected to touch one million units over the next 12 months, say analysts.

Monday, June 20, 2011

CAN - Controller Area Network

Controller Area Network (CAN) electrical systems began to appear in new vehicles in 2003. Since then, more and more vehicles have been equipped with CAN systems, until 2008 when virtually all passenger cars and light trucks sold in the U.S. were CAN-equipped.
As a vehicle owner or do-it-yourself mechanic, you need to know how CAN has made the electrical system in late model cars and trucks much more complicated than ever before. CAN allows various modules and systems to share data and interact in ways that where previously impossible.
So what exactly is CAN? It is a communication standard that allows the various modules and computers in a vehicle to talk to one another via a common "data bus" circuit in the wiring system. Think of it as a high speed party line that allows data and commands to zip back and forth from one module to another. This allows the Powertrain Control Module (PCM), antilock brake/traction control/stability control system, electronic steering, electronic suspension, automatic climate control system, keyless entry system, lighting control modules and dozens of other systems and modules to all be interconnected electronically.
The Development of Controller Area Networks for CarsCAN was created in 1984 by the Robert Bosch Corp. in anticipation of future advances in onboard electronics. The first production application was in 1992 on several Mercedes-Benz models. Today you will find it on all new vehicles.
automotive controller area network

CAN DiagnosticsIf you don't know the difference between a CAN data bus and a school bus, you're not alone. Even many professional mechanics are not yet up to speed on CAN diagnostics. Troubleshooting a late model CAN car is really no different than troubleshooting any late model OBD II vehicles. You need a scan tool to read out fault codes and other sensor data, and you need a scan tool that is CAN compliant. That means it has the proper software and hardware to communicate with the vehicle at higher speeds.
Older scan tools (namely, most of those made before about 2006) lack the circuitry to talk to a CAN system. Some older scan tools have the right hardware, and can be upgraded with new software. But in most cases you will need a newer scan tool that is CAN-compliant to do onboard diagnostics.
Most inexpensive scan tools designed for the DIY market are on-e-way tools: they can read codes and data, but they cannot send commands to the vehicle that are necessary to run all kinds of system self-tests. That degree of sophistication is reserved for more expensive professional level scan tools or factory scan tools. In addition, the software in a typical DIY scan tool (even if it is CAN-compliant) can usually only access powertrain codes. It can't talk to the ABS system, climate control system, electronic steering or suspension systems, climate control system, airbag system or other onboard electronics. In other words, it is a very limited tool. For advanced diagnositics that go beyond sijply reading powertrain fault codes and sensor data, you need a professional level tool or a factory tool. The latter can be quite expensive, costing thousands of dollars -- plus annual software updates that can add hundreds more. So if you need advanced diagnostics, the only option for most motorists and DIYers is to take your vehicle to a repair shop that has the proper diagnostic equipment.
How Information Moves Around in a CAN System
Like many current vehicles, information in a CAN-equipped vehicle is shared over a serial data bus. The bus is the circuit that carries all the electronic chatter between modules (nodes). The bus may have one wire or two. If it has two, the wires are usually twisted to cancel out electromagnetic interference. The speed at which the bus carries information will vary depending on the "class" rating of the bus as well as the protocol to which it conforms.
A data bus with a "Class A" speed rating is a relatively slow, low-speed circuit that typically carries less than 10 kilobits (10 Kbps) of information per second. A data bus that operates at Class A speeds is limited to simple command functions like operating power mirrors, power seats, power widows, power door locks, remote trunk releases and lights.
A data bus with a "Class B" rating, by comparison, may operate from 10 Kbps up to 125 Kbps, depending on the operating protocol (SAE J1850 or Europe's ISO 9141-2). This is fast enough to carry more complex information and time-sensitive data. Systems that may may share a data bus with a Class B rating include electronic instrumentation, electronic transmission controls, security systems, and climate control.
Class C is currently the fastest data bus rating. Class C systems can operate at speeds up to 1 megabits per second, which is up to 100 times faster than a typical Class B data bus. Many of the vehicles that are currently using a Class C data bus are operating at speeds of around 500 Kbps, which is fast enough for powertrain control modules, air bag modules, and fast-acting antilock brake and stability control systems. Eeven faster CAN systems are coming with "class D" ratings of over 1 megabytes per second. And some applications such as onboard entertainment systems require even higher speed audio and video streaming.
One thing to keep in mind about the CAN standard is that CAN as well as other protocols such as SAE J1939, GMLAN, OBD II, SAE J1587 and LIN have more to do with the way information is formatted, transmitted and received than how fast it is sent. This means the automotive engineers who design the onboard electronics for CAN-compliant vehicles are free to choose any operating speed they want (up to one megabits per second) as well as the type of bus conductor (one wire, twisted paired wires or a fiber optic cable). On most cars today, a high-speed data bus is needed to handle the volume of information going back and forth between all the onboard electronics.
In 1995, GM introduced its own "Class 2" data bus to handle communication between modules. The system ran at a speed of 10,400 bits per second (10.4 Kbps), which was more than adequate for vehicles a decade ago. In 2004, GM moved to their next generation data bus system which they called "GMLAN" (GM Local Area Network). Introduced on the Cadillac XLR and Saturn Ion, GMLAN added the capability to operate at two speeds on two separate buses: a low speed (33.33 Kbps) bus and a high speed (500 Kbps) bus.
The low speed side of the GMLAN system operates on a single wire bus to handle body-related control functions, while the high speed bus uses two wires to carry data between the powertrain, transmission and antilock brake modules. A "gateway" node connects the high speed bus and low speed bus, and allows information to be shared back and forth. For example, the radio (which is connected to the low speed bus) may adjust volume based on engine speed and vehicle speed (from the high speed bus) to offset road noise.
Mercedes also uses several different bus speeds on their vehicles. Depending on the application, there may be a high-speed 500 Kbps CAN-C bus for the powertrain, transmission and ABS modules, and a slower-speed 83 Kbps CAN-B bus for the body control functions. On some Mercedes cars, there may be as many as 30 modules on the CAN-B bus. Up to model year 2002, all communication between the CAN-C and CAN-B bus went through the electronic ignition switch (EIS) module. After 2002, a new "gateway" module handles the inter-bus communications as well as onboard diagnostics via a CAN-D bus.
automotive bywire systems .


How CAN Data is Sent and ReceivedIf your eyes haven't glazed over yet, here's how data is sent and received in a CAN system. Every module (node) that is attached to the data bus network is capable of sending and receiving signals. Each module (node) has its own unique address on the network. This allows the module to receive the inputs and data it needs to function, while ignoring information intended for other modules that share the network. When a module transmits information over the network, the information is coded so all the other modules recognize where it came from.
Data is sent as a series of digital bits consisting of "0's" and "1's". If you looked at the data on a scope, you would see a square wave pattern that changes between a high and low voltage reading. The low voltage reading usually corresponds to the "0" while the high voltage reading corresponds to the "1". The actual voltage readings will vary depending on the application and protocols the vehicle manufacturer is using, but most operate in the 5 to 7 volts range.
The CAN standard requires a "base frame" format for the data. What this means is that for each distinct message sent or received by a module on the network, there is a beginning bit (called the "start of frame" or "start of message" bit), followed by an "identifier" code (an 11 bit code that tells what kind of data the message contains), followed by a priority code ("remote transmission request") that says how important the data is, followed by 0 to 8 bytes (one byte equals 8 bits) of actual data, followed by some more bits that verify the information (cyclic redundancy check), followed by some end of message bits and an "end-of-frame" bit.
Still with me? There's more! One of the tasks of any network system is to keep all the messages separated so they don't collide and garble one another. Usually the body control module or instrument cluster module is assigned the task of managing the network traffic. When it sees a message coming over the bus, it looks at the first bit in the data stream. If the bit is a "0", the message is given priority over the others. This is called a "dominant" message. If the first bit is a "1" it is given a lower priority (a "recessive" message). Thus, the highest priority messages always get through to their intended destinations but the low priority messages may be temporarily blocked until the traffic eases up.
automotive bywire systems

CAN FaultsCAN-compliant vehicles are just as vulnerable to electronic faults as older vehicles. Though CAN systems use fewer wires and fewer connectors to save weight and cost, they also use more modules and more complicated modules. Communication problems can occur if module connectors become corroded or loose, if wires become grounded, shorted or break, or system voltage is below specifications. Some modules may even forget their settings or locations if the battery is disconnected or goes dead.
On some Chrysler minivans, for example, the automatic climate control system will quit working if battery power is lost. This happens because the electric stepper motors that control the position of the blend doors forget their locations. The system has to be put into a "relearn" mode to re-establish all the motor locations and settings.
Various kinds of problems can occur on other CAN-equipped vehicles when the battery is disconnected or goes dead. The modules in the CAN system require a certain amount of voltage for their Keep Alive Memory settings. If this is lost, the module will forget these settings and may not function properly until it has time to relearn the lost data. In some cases, this requires a special relearn procedure using a scan tool because the module can't do the relearn by itself. And on some vehicles, the module may go to sleep and not wake up until it is pinged by a scan tool or the main gateway module (usually the body control module). Relearning procedures typically require a factory scan tool or a professional level aftermarket scan tool.
One of the features of CAN and other network systems is that modules can send and receive "ok" signals to let the main control module know if they are working or not. In theory, this makes diagnostics easier. On the other hand, it also means that one misbehaving module may generate enough noise to disrupt the entire network causing a complete shutdown of the vehicle!
When a serial bus communication problem occurs, it will usually set a "U" diagnostic trouble code (DTC) and turn on the Malfunction Indicator Lamp (MIL). Depending on the fault, the vehicle may or may not start, or it may only operate in a "limp-in" mode with limited capabilities. Loss of communication between the engine controller and transmission controller (code U1026 on a GM, for example) may put the transmission into a limp-in mode where it will only operate in one or two gears.
Loss of communication codes may indicate a wiring problem on the bus, or a fault with a module. Isolating the fault may require unplugging modules one at a time until the fault is found. Just remember that all modules on a bus network need three things to function properly: power, ground and a serial data connection.
When diagnosing bus or module communication problems, you usually start by checking for voltage at the module, then the ground connection, and finally the data line. If all three are good but the module isn't working, the module needs to be replaced.
On GM applications, a code U100 or U1255 means a general loss of communication on the data bus. With a Tech 2 scan tool, you can go to Diagnostic Circuit Check, then Message Monitor to see a list of active modules and compare it to the list of modules that are supposed to be on when the key is on.
To minimize the parasitic current drain on the battery when the vehicle is off, a "sleep" signal is sent to the modules on the network. Some may remain on for a short period of time after the ignition is switched off (air bag module, for example), and some may never go to sleep (anti-theft module and keyless entry receiver, for example) but most are put into a sleep mode to save battery power. If the sleep signal is never sent, or a module fails to recognize the sleep signal, it may remain active and pull power from the battery. Depending on the current draw, this may run down the battery if the vehicle sits for a period of time.

Sunday, June 19, 2011

JavaScript Example







My First Web Page

This is a paragraph.






JavaScript ebook - JavaScript For Dummies




* Responding to reader feedback, the author has thoroughly revamped the book with more step-by-step coverage of JavaScript basics, an exclusive focus on Internet Explorer, and many complete sample scripts
* Updated to cover JavaScript 1.5, the latest release of this popular Web scripting language
* Using lots of examples, including a sample working Web site, the book shows how to create dynamic and interactive pages, build entire sites, and automate pages 

From the Publisher
JavaScript For Dummies, 4th edition:

Explains JavaScript and how it differs from java, HTML, and other Web programming tools

Describes what users can do with JavaScript that they can't do with HTML

Outlines how JavaScript, the platform-independent scripting language, works with the latest versions of Netscape Navigator 5 and Microsoft Internet Explorer 5.5

Includes an important overview of Object-Oriented Concepts and the JavaScript language

Shows users how to "team up" JavaScript with Java, C++, OpenDoc, and Common Gateway Interface (CGI) to create powerful multimedia applications

Describes how to build a quickie Web page using HTML tags

Shows users how to create a Java applet and run the applet from the Web page

Covers JavaScript's forms so users can easily enter data and receive feedback

Guides users as they write and debug their own JavaScript programs 

Download Ebook





Saturday, June 18, 2011

Apple iPhone 5


Apple has apparently started to cut down on the orders of Philips-sourced LED flash components, called Lumileds according to Apple tech website, Apple Insider.
A person familiar with Apple's supply's chain has told the site that Apple has greatly reduced orders for the Philips LED flash components over the past 30 to 60 days.

The source added that this may be due to the fact that Apple will not use the component in the forthcoming iPhone 5, while other leads point to a new supplier, possibly based in Taipei, that may instead be adopted.



While the camera and the flash modules on the iPhone 4 are part of the same component, it appears that Apple will separate both for the fifth generation iPhone 5 in order to improve the quality of pictures and reduce the dreaded red-eye effect.
Other reports have pointed out that Apple is going to use an eight-megapixel camera for the iPhone, a jump in pixel count that will allow it to close the gap on certain rivals like the Nokia N8 and some future Android-based smartphones that will even have 12-megapixel or higher camera resolution.
Taiwanese manufacturer Omnivision is rumoured to be the big winner in the allocation of OEM/ODM contracts, being set to acquire 90 per cent of orders.

Tuesday, June 7, 2011

Technology Question And Answer



1. 
Which company created the most used networking software in the 1980's
A.MicrosoftB.Sun
C.IBMD.Novell


Ans: Novell
Novell (based in Provo, UT) created NetWare which is still one of the most used PC networking systems in the world.







2. 
Which of the following operating systems is produced by IBM?
A.OS-2B.Windows
C.DOSD.UNIX


Answer: Option A
Explanation:
IBM also created it's own version of DOS called PC-DOS.nn




3.
What does DOCSIS stand for?
A.Data Over Cable Service Interface Specification
B.Data Over Cable Security Internet Std
C.Data Over Cable Secure International Stds
D.Data Over Cable Service Internet Standard

Answer: Option A
Explanation:
DOCSIS was developed by CableLabs. A standard set for Cable equipment to ensure compatibility across all DOCSIS networks.






4. 
Which one of the following is a search engine?
A.Macromedia Flash
B.Google
C.Netscape
D.Librarians’ Index to the Internet


Answer: Option B
Explanation:
A search engine is a program that searches for Web documents with keyword (s) you specify. Yahoo!, Google, and AltaVista are just three examples of search engines that have been created to help you find information on the Web.



5. 
Which is the best search tool for finding Web sites that have been handpicked and recommended by someone else?
A.Subject directories
B.Search engines
C.Meta-search engines
D.Discussion groups


Answer: Option A
Explanation:
Subject directories tend to house fewer—sometimes more relevant—sites than those found through search engines. Sites in a subject directory often have been handpicked by editorial teams or specialists in a particular field.

Tuesday, May 31, 2011

File Handling In C

Hello Friends,

File Handing in C language is one of the most important topic. The program which written below will make one file and you can write your data as you wanted.

Example:

#include<conio.h>
#include<stdio.h>

void main()
{
      FILE *f1;                    // File pointer variable declared
      char c;

      printf("Enter Data\n\n");

      f1=fopen("DATA","w");  // File DATA created and ready to write

     while((c=getchar()) != EOF)
     {
             
                 putc(c,f1);

     }
     fclose(f1);
     printf("\n\nYour Data in File:\n\n");

    f1=fopen("DATA","r")                // File will open in read mode

    while((c=getc(f1)) !=EOF)
   {
            printf("%c",c);
   }

 fclose(f1);

getch();

}

Monday, May 23, 2011

Top 10 Universities for Computer Science

The University of Texas at Austin Department of Computer Science is recognized as one of the top 10 computer science programs nationally and internationally. The department enjoys close ties with other groups on the UT Austin campus engaged in computing research, namely the Department of Electrical and Computer Engineering, the Institute for Computational Engineering and Sciences, and the Texas Advanced Computing Center.

Computing Science at the University of Glasgow was ranked as the top department in Scotland and as one of the top five departments in the UK in the Times Good University Guide 2010. It was also rated as one of the top 10 computing science departments in the UK in the Research Assessment Exercise 2008.

The Department of Computer Science (DCS) at the University of Toronto is among the top-ranked computer science departments in North America, and it is the only Canadian university ranked in the global top 10 for the subject in ARWU 2009. It offers a wide array of research opportunities and programs of study.

Ranking of World's Top 10 Universities for Computer Science:


1 Stanford University
2 MIT
3 University of California, Berkeley
4 Carnegie Mellon University
5 Princeton University
6 Cornell University
7 The University of Texas at Austin
8 University of Toronto
9 California Institute of Technology
9 University of Southern California

Saturday, May 21, 2011

T Y BCA

College Reopen - 16th June 2011, 10 a.m.

Result (4th SEM) - In First week of June




Visit my second website: www.thewebdream.com

Saturday, May 14, 2011

AJAX


Introduction - What is AJAX?

AJAX, or Asynchronous JavaScript and XML, is a fancy way to use JavaScript and XML to communicate with a web server without refreshing the web page. You can visit this web page for more information about AJAX; it has a good list of links.

Why use AJAX?

There are a couple of reasons to use AJAX in lieu of the traditional form submission. The first is that it is very light weight: instead of sending all of the form information to the server and getting all of the rendered HTML back, simply send the data the server needs to process and get back only what the client needs to process. Light weight means fast. The second reason to use AJAX is because (as the logo in the link above makes clear) AJAX is cool.


Asynchronous JavaScript + XML (AJAX) is essentially a branding term for a bundle of common web technologies. These include JavaScript, DHTML and a utility object called XMLHTTP. The short story is that in combination, these tools reduce the need for web browser applications to reconnect to a web server every time additional data is downloaded.

Not to be left behind, Microsoft has announced project Atlas for ASP.NET 2.0 and for ASP.NET 1.1, we already have Michael Schwarz's Ajax.Net.
According to one Atlas project member, “What we’ve set out to do is to make it dramatically easier for anyone to build AJAX-style web applications that deliver rich, interactive, and personalized experiences. Developers should be able to build these applications without great expertise in client scripting; they should be able to integrate their browser UI seamlessly with the rest of their applications; and they should be able to develop and debug these applications with ease.”
Atlas is being developed on top of ASP.NET 2.0 and is slated to contain the following components:

Atlas Client Script Framework
The Atlas Client Script Framework is an extensible, object-oriented 100% JavaScript client framework that allows you to easily build AJAX-style browser applications with rich UI and connectivity to web services. With Atlas, you will be able to write web applications that use a lot of DHTML, JavaScript, and XMLHTTP, without having to be an expert in any of these technologies.
The Atlas Client Script Framework will work on all modern browsers, and with any web server. It also won’t require any client software installations, only standard script references in the web page.
The Atlas Client Script Framework will include the following components:
  • An extensible core framework that adds features to JavaScript such as lifetime management, inheritance, multicast event handlers, and interfaces
  • A base class library for common features such as rich string manipulation, timers, and running tasks
  • A UI framework for attaching dynamic behaviors to HTML in a cross-browser way
  • A network stack to simplify server connectivity and access to web services
  • A set of controls for rich UI, such as auto-complete textboxes, popup panels, animation, and drag and drop
  • A browser compatibility layer to address scripting behavior differences between browsers.
ASP.NET Server Controls for Atlas
For ASP.NET applications, a new set of AJAX-style ASP.NET Server Controls will be developed and the existing ASP.NET page framework and controls will be enhanced to support the Atlas Client Script Framework.
The Atlas Client Script Framework will fully support ASP.NET 2.0 client callbacks, but will enrich the level of integration between the browser and the server. For example, you will be able to data bind Atlas client controls to ASP.NET data source controls on the server, and you’ll be able to control personalization features of web parts pages asynchronously from the client.

ASP.NET Web Services Integration
Like any client application, an AJAX-style web application will usually need to access functionality on the web server. The model for connecting to the server for Atlas applications is the same as for the rest of the platform – through the use of Web services.

With ASP.NET Web Services Integration, Atlas applications will be able to access any ASP.NET-hosted ASMX or Indigo service directly through the Atlas Client Script Framework, on any browser that supports XMLHTTP. The framework will automatically handle proxy generation, and object serialization to and from script. With web services integration, you can use a single programming model to write your services, and use them in any application, from browser-based sites to full smart client applications.


Thursday, May 12, 2011

HTML Color Values


Color Values

HTML colors are defined using a hexadecimal notation (HEX) for the combination of Red, Green, and Blue color values (RGB).

The lowest value that can be given to one of the light sources is 0 (in HEX: 00). The highest value is 255 (in HEX: FF).

HEX values are specified as 3 pairs of two-digit numbers, starting with a # sign.

Examples:


Color Values

ColorColor HEXColor RGB
#000000rgb(0,0,0)
#FF0000rgb(255,0,0)
#00FF00rgb(0,255,0)
#0000FFrgb(0,0,255)
#FFFF00rgb(255,255,0)
#00FFFFrgb(0,255,255)
#FF00FFrgb(255,0,255)
#C0C0C0rgb(192,192,192)
#FFFFFFrgb(255,255,255)

Monday, May 9, 2011

C Programming - File management in C


C supports a number of functions that have the ability to perform basic file operations, which include:
1. Naming a file
2. Opening a file
3. Reading from a file
4. Writing data into a file
5. Closing a file

  • Real life situations involve large volume of data and in such cases, the console oriented I/O operations pose two major problems
  • It becomes cumbersome and time consuming to handle large volumes of data through terminals.
  • The entire data is lost when either the program is terminated or computer is turned off therefore it is necessary to have more flexible approach where data can be stored on the disks and read whenever necessary, without destroying the data. This method employs the concept of files to store data.

File operation functions in C:

Function Name
Operation
fopen()
Creates a new file for useOpens a new existing file for use
fclose
Closes a file which has been opened for use
getc()
Reads a character from a file
putc()
Writes a character to a file
fprintf()
Writes a set of data values to a file
fscanf()
Reads a set of data values from a file
getw()
Reads a integer from a file
putw()
Writes an integer to the file
fseek()
Sets the position to a desired point in the file
ftell()
Gives the current position in the file
rewind()
Sets the position to the begining of the file

Defining and opening a file:

If we want to store data in a file into the secondary memory, we must specify certain things about the file to the operating system. They include the fielname, data structure, purpose.

The general format of the function used for opening a file is

FILE *fp;
fp=fopen(“filename”,”mode”); 

The first statement declares the variable fp as a pointer to the data type FILE. As stated earlier, File is a structure that is defined in the I/O Library. The second statement opens the file named filename and assigns an identifier to the FILE type pointer fp. This pointer, which contains all the information about the file, is subsequently used as a communication link between the system and the program.
The second statement also specifies the purpose of opening the file. The mode does this job.

R open the file for read only.
W open the file for writing only.
A open the file for appending data to it.

Consider the following statements:

FILE *p1, *p2;
p1=fopen(“data”,”r”);
p2=fopen(“results”,”w”);

In these statements the p1 and p2 are created and assigned to open the files data and results respectively the file data is opened for reading and result is opened for writing. In case the results file already exists, its contents are deleted and the files are opened as a new file. If data file does not exist error will occur.

Closing a file:

The input output library supports the function to close a file; it is in the following format.
fclose(file_pointer);

A file must be closed as soon as all operations on it have been completed. This would close the file associated with the file pointer.
Observe the following program.

….
FILE *p1 *p2;
p1=fopen (“Input”,”w”);
p2=fopen (“Output”,”r”);
….

fclose(p1);
fclose(p2)

The above program opens two files and closes them after all operations on them are completed, once a file is closed its file pointer can be reversed on other file.

The getc and putc functions are analogous to getchar and putchar functions and handle one character at a time. The putc function writes the character contained in character variable c to the file associated with the pointer fp1. ex putc(c,fp1); similarly getc function is used to read a character from a file that has been open in read mode. c=getc(fp2).

The program shown below displays use of a file operations. The data enter through the keyboard and the program writes it. Character by character, to the file input. The end of the data is indicated by entering an EOF character, which is control-z. the file input is closed at this signal.

#include< stdio.h >
main()
{
file *f1;
printf(“Data input output”);
f1=fopen(“Input”,”w”); /*Open the file Input*/
while((c=getchar())!=EOF) /*get a character from key board*/
putc(c,f1); /*write a character to input*/
fclose(f1); /*close the file input*/
printf(“nData outputn”);
f1=fopen(“INPUT”,”r”); /*Reopen the file input*/
while((c=getc(f1))!=EOF)
printf(“%c”,c);
fclose(f1);
}

The getw and putw functions:

These are integer-oriented functions. They are similar to get c and putc functions and are used to read and write integer values. These functions would be usefull when we deal with only integer data. The general forms of getw and putw are:

putw(integer,fp);
getw(fp);

/*Example program for using getw and putw functions*/
#include< stdio.h >
main()
{
FILE *f1,*f2,*f3;
int number I;
printf(“Contents of the data filenn”);
f1=fopen(“DATA”,”W”);
for(I=1;I< 30;I++)
{
scanf(“%d”,&number);
if(number==-1)
break;
putw(number,f1);
}
fclose(f1);
f1=fopen(“DATA”,”r”);
f2=fopen(“ODD”,”w”);
f3=fopen(“EVEN”,”w”);
while((number=getw(f1))!=EOF)/* Read from data file*/
{
if(number%2==0)
putw(number,f3);/*Write to even file*/
else
putw(number,f2);/*write to odd file*/
}
fclose(f1);
fclose(f2);
fclose(f3);
f2=fopen(“ODD”,”r”);
f3=fopen(“EVEN”,”r”);
printf(“nnContents of the odd filenn”);
while(number=getw(f2))!=EOF)
printf(“%d%d”,number);
printf(“nnContents of the even file”);
while(number=getw(f3))!=EOF)
printf(“%d”,number);
fclose(f2);
fclose(f3);
}

The fprintf & fscanf functions:

The fprintf and fscanf functions are identical to printf and scanf functions except that they work on files. The first argument of theses functions is a file pointer which specifies the file to be used. The general form of fprintf is

fprintf(fp,”control string”, list);

Where fp id a file pointer associated with a file that has been opened for writing. The control string is file output specifications list may include variable, constant and string.

fprintf(f1,%s%d%f”,name,age,7.5);

Here name is an array variable of type char and age is an int variable
The general format of fscanf is

fscanf(fp,”controlstring”,list);

This statement would cause the reading of items in the control string.

Example: 
fscanf(f2,”5s%d”,item,&quantity”);

Like scanf, fscanf also returns the number of items that are successfully read.

/*Program to handle mixed data types*/
#include< stdio.h >
main()
{
FILE *fp;
int num,qty,I;
float price,value;
char item[10],filename[10];
printf(“Input filename”);
scanf(“%s”,filename);
fp=fopen(filename,”w”);
printf(“Input inventory datann”0;
printf(“Item namem number price quantityn”);
for I=1;I< =3;I++)
{
fscanf(stdin,”%s%d%f%d”,item,&number,&price,&quality);
fprintf(fp,”%s%d%f%d”,itemnumber,price,quality);
}
fclose (fp);
fprintf(stdout,”nn”);
fp=fopen(filename,”r”);
printf(“Item name number price quantity value”);
for(I=1;I< =3;I++)
{
fscanf(fp,”%s%d%f%d”,item,&number,&prince,&quality);
value=price*quantity”);
fprintf(“stdout,”%s%d%f%d%dn”,item,number,price,quantity,value);
}
fclose(fp);
}

Random access to files:

Sometimes it is required to access only a particular part of the and not the complete file. This can be accomplished by using the following function:

1 > fseek

fseek function:

The general format of fseek function is a s follows:

fseek(file pointer,offset, position); 

This function is used to move the file position to a desired location within the file. Fileptr
is a pointer to the file concerned. Offset is a number or variable of type long, and position in an integer number. Offset specifies the number of positions (bytes) to be moved from the location specified bt the position. The position can take the 3 values.

Value Meaning
0 Beginning of the file
1 Current position
2 End of the file.