Sie sind auf Seite 1von 5

TECHNOLOGY NEWSLETTER

October 2011 Issue #2

(IGATE PATNI INTERNAL CIRCULATION) TECHNOLOGY REVIEW BOARD - RBC-BLR-ENT. APPS,CHANNELS,IWM IGATE PATNI, BANGALORE

Editors Talk
The world of technology is continuously changing and modern technology is like a steamroller ... "You are either part of the steamroller or you are part of the road! So TRB Newsletter is also changing and changing for better. Greetings to all!!! We are presenting the second edition of TRB News letter - Tech Talk, which we have remodeled based on constructive feedback received for previous edition. We have included more technologies into the spectrum for a bigger and wider range of audience for the Tech Talk. Enjoy reading.

Inside This Issue


Editors Talk . 1 Steve Jobs The Apple CEO 1 Introduction to jQuery Mobile 2 New Features in .NET Framework 4.0 3 Regular Expression . 3 Multiple row insert & Fetch in DB2 .. 4 Svcutil Tool . 4 Quiz .. 5 The world has lost amazing creative genius Steve Jobs

(1955-2011) The Apple CEO. His creations iPod, iPad, Not to forget, thank you all for your participation in the tech iTune, Mac .etc are incredible and the world cannot forget quiz. The names of winners are published in the Quiz Section. his contributions. TRB Teams tribute to one of the legendry Congratulations to all winners... May your tribe increase... iNnovators of this era.

Steve Jobs The Apple CEO (1955 2011) Born : February 24, 1955 San Francisco, California, U.S. October 5, 2011 Palo Alto, California, U.S.

By Jaison

Died

Occupation: Co-founder and CEO Apple Inc. Years active: 19742011 Board Member of: The Walt Disney Company Apple, Inc.

Signature: Dont let the noise of others opinions drown out your inner voice. - Steve Jobs

Youth (1955-81) Young Steve grew up in a valley of apricot orchards - Silicon Valley. Steve Jobs was fascinated by electronics, and thats why, in 1969, he met with a computer whiz kid who shared his interests in electronics: Stephen Wozniak- commonly known as Woz. Steve and Woz quickly became friends even though Woz was five years older. He then spent a lot of time learning about Eastern mysticism and adopted strange diets, fasting or eating only fruits: it was his hippie period. He even traveled to India with a friend to seek enlightenment at age 19. After Steve came back to the Valley, he focused on Wozs work on a computer board. Woz was attending a group of early personal computer hobbyists called the Homebrew Computer Club, where he got the idea of designing his own computer. Steve Jobs saw that many people were interested in his friends brilliant work and so he suggested they sell the board to them. Apple Computer was born. Macintosh (1981-95) Macintosh was in development since 1979 and its concept was a computer as easy to use as a toaster. Steve Jobs recruited brilliant young engineers in his Mac team calling them pirates, unlike the rest of the company, the Navy. Apple was his life. Steve bought Pixar during these days. Yet his main passion was still to make great computers. In September 1985, he announced to the Apple board that he was going to found a new company, called NeXT, to build an advanced computer for higher education and scientific research. He was going to take with him some of the best engineers and salesmen from the Mac team. Apple disapproved and threatened to sue him. It was at that point that Steve left his company for good. NeXT was not able to sell those computers since they were expensive.

Page 2

Tech Talk

Comeback (1995-2001) Pixar productions Toy Story cashed in on the media hype surrounding the first computer-generated animation movie of all time. It worked wonders: Steve Jobs, who owned 80% of the company, saw his net worth rise to over $1.5 billion - five times the money he had ever made at Apple in the 1980s! Steve was back to the company that had thrown him out a decade earlier when Apple took over NeXT.

i Revolutions of Steve Jobs:


iPod revolution - music player the size of a cigarette box with brilliant user interface and click wheel, its fast FireWire connectivity and its ability to sync with iTunes seamlessly. iPhone revolution - Who can forget the iPhone. The first of the kind. It revolutionized the design of a mobile phone, giving the touch feature. iPad revolution A hardware which acts like a bridge between a phone and a laptop. Few Excerpts on Steve Jobs: He is on his iWay to invent iHeaven Anonymous 3 apples changed the world - Anonymous Eaten by eve One that fell on Newton's head Given to the world by Steve Jobs Life is smoother since we can touch instead of push Times of India It had been an insanely great honor to work with his long-time rival and Apple Inc. co-founder. Bill Gates Introduction to jQuery Mobile By Imtiyaz and Wajid

jQuery Mobile is a simple and lightweight JavaScript framework for mobile web development that work across smart phones and tablets. The jQuery Mobile framework builds on top of jQuery core and provides a number of facilities, including HTML and XML document object model (DOM) traversing and manipulation. Basic features of jQuery Mobile include General simplicity: The framework is simple to use. You can develop pages mainly using markup driven with minimal or no JavaScript. Progressive enhancement and graceful degradation: While jQuery Mobile leverages the latest HTML5, CSS3, and JavaScript, not all mobile devices provide such support. jQuery Mobile supports both high-end and less capable devices, such as those without JavaScript support, and still provide the best possible experience. Theming: The framework also provides a theme system that allows you to provide your own application styling. Browser support: Not all mobile devices provide support for HTML5, CSS 3, and JavaScript. JQuery Mobile supports both high-end and less capable devices, such as those without JavaScript support. Progressive Enhancement consists of the following core principles. Supported jQuery mobile platforms Apple iOS: iPhone, iPod Touch, iPad (all versions), Android: all devices (all versions), Blackberry Torch (version 6) & Palm WebOS Pre, Pixi, Nokia N900 (in progress) Syntax of jQuery jQuery Mobile relies on HTML5 data-* attributes to support the various UI elements, transitions, and page structure. For eg : to display button following is the syntax <a href="index.html" data-role="button" data-icon="info">Button</a> The JavaScript object jQuery is also referred to as $. The jQuery Mobile framework extends jQuery core with mobile plug-ins, including the mobile, or $.mobile, which defines several events and methods. There are several events that you can bind using the bind() or live() method. In general, a page structure should have the following sections: Header bar, Content & Footer bar The HTML head section loads three important jQuery Mobile components jQuery Core library The core jQuery library jQuery Mobile library The mobile-specific part of the jQuery framework jQuery Mobile CSS The CSS that defines the core jQuery Mobile UI elements. It defines the transitions and different UI widgets, such as sliders and buttons, and makes heavy use of Web kit transforms and animations. <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.css" /> <script src="http://code.jquery.com/jquery-1.4.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script> Resources Learn all about the jQuery Mobile framework.(http://jquerymobile.com/) Explore jQuery Mobile documentation and demos: http://jquerymobile.com/demos/1.0a2/) articles, APIs, and demo code.

Page 3
New Features in .NET Framework 4.0

Tech Talk
By Vadivel

The Microsoft .NET Framework 4 launched many new features for enabling developers to create applications faster than ever and fully compatible with the older versions of .NET Framework. Some of the New Features C# in the .NET Framework Version 4.0 is as follows: Dynamic Language Runtime The dynamic language runtime (DLR) is a new runtime environment that adds a set of services for dynamic languages to the CLR. To support the DLR, the new System.Dynamic namespace is added to the .NET Framework. Dynamic Support Visual C# 2010 provides support for late binding to dynamic types by introducing a new type, dynamic. This addition enables many new scenarios, including simplified access to COM APIs such as the Office Automation APIs, to dynamic APIs such as IronPython libraries, and to the HTML Document Object Model (DOM). Office Programmability Access to COM interfaces, including the Office Automation APIs, is greatly enhanced by the addition of named and optional arguments, the dynamic type, indexed properties, and optional ref modifiers. Type Equivalence Support You can now deploy an application that has embedded type information instead of type information that is imported from a Primary Interop Assembly (PIA). Covariance and Contravariance Several generic interfaces and delegates now support covariance and contravariance. For more information: http://msdn.microsoft.com/en-us/library/dd799517.aspx New Command-Line Options The /langversion command-line option causes the compiler to accept only syntax that is valid in the specified version of C#. The /appconfig compiler option enables a C# application to specify the location of an assembly's application configuration file to the compiler. Big Integer and Complex Numbers The new System.Numerics.BigInteger structure is an arbitrary-precision integer data type that supports all the standard integer operations, including bit manipulation. The new System.Numerics.Complex structure represents a complex number that supports arithmetic and trigonometric operations with complex numbers. Parallel Computing The .NET Framework 4 introduces a new programming model for writing multithreaded and asynchronous code that greatly simplifies the work of application and library developers. References: http://msdn.microsoft.com/en-us/library/ms171868.aspx http://msdn.microsoft.com/en-us/library/bb383815.aspx Reduce code complexity using Regular Expression By Raghavendra

Regular Expressions are patterns of characters which are used to perform certain useful operations on the given input. The Java 2 Platform, Standard Edition (J2SE), contains a new package called java.util.regex, enabling the use of regular expressions. This will be helpful for complex business logics and can be used to replace if checks if its properly implemented. Few of the common scenarios are identified below. Below is a sample example on Simple word replacement validation Removal of control characters from a file File searching Grabbing HTML Tags (capturing content between the tags<>) email validation explains on how the Regular Expression replaces the multiple lines of code with few lines.

Page 4
Few Common expressions (examples): email address validation using Regular expression: //Initialize reg ex for email. String expression = "^[\\w\\.-]+@([\\w\\-]+\\.)+[AZ]{2,4}$"; CharSequence inputStr = email; //Make the comparison case-insensitive. Pattern pattern = Pattern.compile(expression,Pattern. CASE_INSENSITIVE); Matcher matcher = pattern.matcher(inputStr); If(matcher.matches()){ isValid = true; } return isValid; Name Date US zip code Canadian postal code Time Regular Expression /^\d{1,2}(\|\/|\.)\d{1,2}\1\d{4}$/ /(^\d{5}$)|(^\d{5}\d{4}$)/ /^\D{1}\d{1}\D{1}\d{1}\D{1}\d{1}$/ /^([1-9]|1[0-2]):[05]\d(:[05]\d(\.\d{1,3})?)?$/

Tech Talk
Format mm/dd/yyyy 99999 or 99999-9999 Z5Z-5Z5 orZ5Z5Z5 HH:MM or HH:MM:SS or HH:MM:SS.mm m 100, 100.00, $100 or $100.00 By Renu Mehta

Dollar Amount

/^((\$\d*)|(\$\d*\.\d{2})|(\ d*)|(\d*\.\d{2}))$/

Multiple rows insert and fetch in DB2 Application programming

We can really reduce number of database accesses using multiple rows insert or fetch, and hence improve the performance of application in a significant manner. Inserting multiple rows We can insert multiple rows of data into database from host variable arrays that have been declared and populated in the application program. DB2 determines the attributes of the values based on the declaration of the array. Example: INSERT INTO DSN8810.ACT (ACTNO, ACTKWD, ACTDESC) VALUES (:HVA1, :HVA2, :HVA3 :IVA3) FOR :NUM-ROWS ROWS HVA1, HVA2, and HVA3 are host variable arrays .ACTNO, ACTKWD, and ACTDESC are the columns of table. The declared dimensions of each host variable array may be different but the number of rows inserted in database will always be equal to the value of host variable NUM-ROWS which must be less than or equal to the dimension of each host variable array. IVA3 is the host variable array for null indicators for column ACTDESC. It must have at least as many entries as its host variable array. Fetching multiple rows You can retrieve multiple rows of data by using a row-set positioned cursor. Declaring a row-set positioned cursor Example: DECLARE C1 CURSOR WITH ROWSET POSITIONING FOR SELECT EMPNO, LASTNAME, SALARY FROM DSN8810.EMP FETCH statement with the ROWSET keyword, the cursor is positioned on a row set in the result table. That row set is called the current row set. Declare the dimension of each of the host variable arrays to be greater than or equal to the number of rows that are to be retrieved. Retrieving 20 rows from a row-set positioned cursor Example: FETCH NEXT ROWSET FROM C1 FOR 20 ROWS INTO: HVA-EMPNO, HVA-LASTNAME, HVA-SALARY: INDA-SALARY Updating/Deleting all rows of the current row set: The following positioned UPDATE and DELETE statements use the WHERE CURRENT OF clause and will update/delete all rows in the row set: UPDATE DSN8810.EMP SET SALARY = 50000 WHERE CURRENT OF C1 DELETE FROM DSN8810.EMP WHERE CURRENT OF C1 Updating a specific row of the current row set: The following positioned UPDATE and DELETE statements use the WHERE CURRENT OF cursor FOR ROW n OF ROWSET clause and will update/delete the specified row (in the example, row 5) in the row set: UPDATE DSN8810.EMP SET SALARY = 50000 WHERE CURRENT OF C1 FOR ROW 5 OF ROWSET DELETE FROM DSN8810.EMP WHERE CURRENT OF C1 FOR ROW 5 OF ROWSET

Tools & Utilities

By A R Brunda

Svcutil (ServiceModel Metadata Utility Tool): The ServiceModel Metadata Utility tool is used to generate service model code from metadata documents and metadata documents from service model code. This utility is one of the options to create proxy class at the client side to access the Web service. It creates the proxy using the metadata information from the Service.

The Svcutil can create proxy from, MEX metadata endpoint ( WCF service ) Metadata of the assembly Or, WSDL (Web Service Description Language) and XSD (XML Schema Definition) documentation. Available with .Net Frameworks: 3.0, 3.5 and 4.0. Windows SDK installation location: <<Windows Directory>>:\Program Files\Microsoft SDKs\Windows\v6.0\Bin.

Page 5

Tech Talk

Common Options: /target :< output type> The target output for the tool: code, metadata or xmlSerializer. /directory :< directory> Directory to create files in (default: current directory) (Short Form: /d) /svcutilConfig :<configFile> Custom configuration file to use in place of the app config file. This can be used to register system.serviceModel extensions without altering the tools config file. /noLogo Suppress the copyright and banner message. /help Display command syntax and options for the tool. (Short Form: /?) Usage Syntax : 1) With WSDL and XSD files : a. > SvcUtil.exe <WSDL Path> <.XSD Path> [If you have multiple XSDs referenced, give all of them separated by space]. Note : The SvcUtil.exe requires you to pass the .XSD files as parameters along with the input. It does not take the .XSD by itself even if you have given referenced it in the WSDL document. Others Common Usages : svcutil http://service/metadataEndpoint -Generate client code from a running service or online metadata documents. svcutil /dconly http://service/metadataEndpoint - Generate Data Contract types from a running service or online metadata documents. svcutil /t:metadata http://service/metadataEndpoint - Download metadata documents from running services svcutil myAssembly.dll - Generate metadata documents for Service Contracts and associated types in an assembly svcutil myServiceHost.exe /serviceName:myServiceName - Generate metadata documents for a service, and all associated Service Contracts and data types in an assembly svcutil /t:xmlserializer myContractLibrary.exe - Generate serialization types for XmlSerializer types used by any Service Contracts in the assembly Tips and Tricks : If the namespace declared for the data contract in the WSDL is something like http://My.Namespace/ and you wanted it to map to My.Proxy. Here is the switch for svcUtil: 1. svcUtil /n:http://My.Namespace/,My.Proxy, Else one can use : 2. svcUtil /n:*, <custom namespace> : To switch all the WSDL namespaces to custom namespace. While using VS command prompt, point to current directory before running svcutil.exe, say : C:MyProxy>svcutil *.wsdl *.xsd /language:C# /o: NewProxy.cs. Else use \d option to set a default directory.

Quiz
The 2 winners who sent the correct answers to the last month Crossword puzzle are Mahesh MajjigepuraShivegowda and Suganya Pandian. Congratulations to the Winners!! Answers for the last month Crossword

Questions for this month Edition Mainframe:


1) At what stage, operator can change the class and priority of a submitted job. Send Your Answers to renu.mehta@rbc.com

Common:
1) Which of the below syntax is correct to Ignore the certain section of the XML Document? a) <CDATA> Text to be ignored </CDATA> c) <PCDATA> Text to be ignored </PCDATA> 2) What are the two soap: binding element Attributes? a) Style attributes b) Transport attributes c) Both 1 and 2 d) Message attributes Send Your Answers to uday.bhaskar@rbc.com b) <! [CDATA [Text to be ignored]]> d) <xml: CDATA [Text to be ignored]>

For any Suggestions/Feedbacks/Contributions please contact chandra.jambunathan@igatepatni.com/sushant.kumar@igatepatni.com

Das könnte Ihnen auch gefallen