background preloader

Programming Java

Facebook Twitter

7 algorithms and data structures every programmer must know - Coding Security. In programmers life algorithms and data structures is most important subject if they want to go out in the programming world and make some bucks.

7 algorithms and data structures every programmer must know - Coding Security

Today, We will see what they do and where they are used with simplest examples. This list is prepared keeping in mind their use in competitive programming and current development practices. 1. Sort Algorithms Sorting is the most heavily studied concept in Computer Science. Merge SortQuick SortBucket SortHeap SortCounting Sort More importantly one should know when and where to use them. Sorting by price, popularity etc in e-commerce websites 2. Binary Search (in linear data structures) URLConnection sample program in Java. Creating a git repo for Eclipse project and Pushing to Github. How to Load and Save a Document to Database - Aspose.Words for Java - Documentation.

JAXB Example - Arjun Web World. Jaxb lets you bind xml objects to java objects.

JAXB Example - Arjun Web World

This is required when data exchange between 2 systems occurs. Here is a simple demo of JAXB marshaling and un-marshaling of data. Create a maven java project. Now create an xsd file to represent employee information. You can create and xml which has the employee data and reverse engineer your XSD document from the xml or you can create the XSD document to start with. The xsd file you create should be under /src/main/resources as this is the default path the maven plugin looks at to generate the java source files. Read / Write Metadata - Excel POI Example. We have seen so much on working with actual data in POI so far.

Read / Write Metadata - Excel POI Example

In this post, I would like to touch a bit on the metadata. A document is never complete without adding suitable metadata and Apache POI offers a plethora of options to set metadata against a document. We will discuss how to read and write metadata into Excel workbooks using Apache POI in Java with simple working examples in this post. We will focus on XLSX document types. For Office 97 – 2003 formats, we will provide another post that would explain how metadata can be extracted / written.

Metadata in Excel spreadsheets can be classified into three major categories; Core Properties: These are defined in org.apache.poi.POIXMLProperties.CoreProperties and include the following properties that you can read / set against: Beginning XML - Chapter 2: Well-Formed XML. Well-Formed XML We've discussed some of the reasons why XML makes sense for communicating data, so now let's get our hands dirty and learn how to create our own XML documents.

Beginning XML - Chapter 2: Well-Formed XML

Conversion of CSV to XML with JAVA. Reading from and Writing to a URLConnection (The Java™ Tutorials > Custom Networking > Working with URLs) The URLConnection class contains many methods that let you communicate with the URL over the network.

Reading from and Writing to a URLConnection (The Java™ Tutorials > Custom Networking > Working with URLs)

URLConnection is an HTTP-centric class; that is, many of its methods are useful only when you are working with HTTP URLs. However, most URL protocols allow you to read from and write to the connection. This section describes both functions. Reading from a URLConnection The following program performs the same function as the URLReader program shown in Reading Directly from a URL. However, rather than getting an input stream directly from the URL, this program explicitly retrieves a URLConnection object and gets an input stream from the connection. The output from this program is identical to the output from the program that opens a stream directly from the URL. Again, if the program hangs or you see an error message, you may have to set the proxy host so that the program can find the Oracle server. Section_6_2_1-A-Survey-Of-JAXB-Annotations.html — Project Kenai.

6.2 A Survey Of JAXB Annotations 6.2.1 Top-level Elements: XmlRootElement A class that describes an XML element that is to be a top-level element, i.e., one that can function as an XML document, should be annotated with XmlRootElement.

section_6_2_1-A-Survey-Of-JAXB-Annotations.html — Project Kenai

Its optional elements are name and namespace. By default, the class name is used as the name. This annotation corresponds to an xsd:element construct being used at the outermost level of an XML schema. @XmlRootElement( name="doc" ) public class Document { @XmlElement protected Foo foo; // ... } Mark A. Ziesemer: XML and XSLT Tips and Tricks for Java. 1.

Mark A. Ziesemer: XML and XSLT Tips and Tricks for Java

Get the latest versions Starting with Java 1.4, the Java runtime has included a default XML parser and transformer implementation as part of the Java API for XML Processing (JAXP). Overview (JDOM v2.0.6) Excel Add-in for Exporting Data to XML. Install and Configure Apache Tomcat Web Server in Eclipse IDE. CSVReader - jcsv - A simple example that shows several ways to read a csv file - Simple CSV library for Java. Consider you have the following CSV file: Holger;Schmidt;35Max;Mustermann;17Lisa;Stein;19 Each line represents a person.

CSVReader - jcsv - A simple example that shows several ways to read a csv file - Simple CSV library for Java

Each person has a first name, a last name and an age. Nothing exciting this far... It is very easy to parse this csv file using jCSV. The first thing to do, is to read the csv file and translate it into java objects, so that the data can ba used in your program. There are currently three ways to do this: parse the data as a String array create Java objects using the CSVEntryParser create Java objects using an annotated class Each of these approaches is useful for specific situation, Schedule XForm data mailings. Using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq;

Schedule XForm data mailings September 11, 2002 Introduction Think about how many times a day you use forms, electronic or otherwise.

On the Web, forms have become commonplace for search engines, polls, surveys, electronic commerce, and even on-line applications. Nearly all user interaction on the Web is through forms of some sort. This ubiquitous technology, however, is showing its age. Poor integration with XML Limited features make even common tasks dependent on scripting Device dependent, running well only on desktop browsers Blending of purpose and presentation Limited accessibility features A new technology, XForms, is under development within the W3C and aims to combine XML and forms. JAXB hello world example. JAXB, stands for Java Architecture for XML Binding, using JAXB annotation to convert Java object to / from XML file. In this tutorial, we show you how to use JAXB to do following stuffs : Marshalling – Convert a Java object into a XML file.Unmarshalling – Convert XML content into a Java Object.

Technologies used in this article Working with JAXB is easy, just annotate object with JAXB annotation, later use jaxbMarshaller.marshal() or jaxbMarshaller.unmarshal() to do the object / XML conversion. Rhino - How to append xml nodes (as a string) into an existing XML Element node (only using java builtins)? Java CSV - java code samples. Opencsv - csv (comma-separated values) parser library for Java. Java program to Login a website using url and to download a file (Open Source Projects forum at JavaRanch) Java FTP example - Change working directory. Details Last Updated on 20 August 2013 | Print Email While working with a FTP server using Apache Commons Net API, it’s important to keep in mind that many operations are working based on the working directory (or current directory), such as create directories, upload files, download files, … Remember this rule: Pathname that starts with slash “/”, is considered as absolute path.

Pathname that does not start with a slash is considered as relative path. The FTPClient class provides the following method to change working directory: boolean changeWorkingDirectory(String pathname) where pathname represents path of the directory to change, which can be either absolute or relative. ChangeWorkingDirectory(“/upload”) Parse CSV files in java - How To Do In Java. A CSV file is used to store tabular data in plain text form. To identify and separate different data tokens in file, a delimiter is used.

These files are used by consumer, business, and scientific applications. Among its most common uses is moving tabular data between programs that natively operate on incompatible formats. This works because so many programs support some variation of CSV at least as an alternative import/export format. Parse excel data to xml using java. Java: How to read and write xml files? Java XML Tutorial. In Java JDK, two built-in XML parsers are available – DOM and SAX, both have their pros and cons. Merge Two XML Files in Java. How to define multiple namespaces using DOM? (XML forum at JavaRanch) Writing Out a DOM as an XML File (The Java™ Tutorials > Java API for XML Processing (JAXP) > Extensible Stylesheet Language Transformations)

Connecting to the Web: I/O Programming in Android. O far all the previous articles in this Android series have been concerned with location-based services and the use of Google Maps for mapping applications. How do I create a Login Module? - Web Tutorials - Moving a File or Directory (The Java™ Tutorials > Essential Classes > Basic I/O)

You can move a file or directory by using the move(Path, Path, CopyOption...) method. Java Tutorials. Android Studio Tips Of the Day - Roundup #6. This is the sixth roundup of my Android Studio Daily Tips that I post on Google+ You can take a look at the previous post here. About Keymaps Android Studio provides different keymaps (the mapping between shortcut keys and an action). You can see which keymap you are using in Settings->Keymap. It wouldn’t be practical to list the shortcuts for every keymap so the following will be used: Windows: Default Linux: Default OSX: Mac OSX 10.5+ Install Android Development Tools. Coding Starts Here. Connecting to the Web: I/O Programming in Android. Regular Expressions. Learn Java Simply Full (Part 3/3)

How to Develop Android Apps Online Course. Lesson 1: Create Project Sunshine with a Simple UI (5-8 hrs) Start by installing Android Studio, you’ll create your first project with a simple list-based user interface. You'll then build and deploy it to virtual and actual devices. You’ll also discover what makes mobile - and Android in particular - a unique environment for app development. Android Studio, Gradle, and debugging toolsUser Interface and Layout managersListViews and Adapters. Programming in Java using the MVC architecture. Introduction. Java Serialization. Serialization helps us to save and retrieve the state of an object. Java I/O Tutorial. Introduction to Programming in Java: An Interdisciplinary Approach. Learn Java the Hard Way. Java Programming Exercises. Upload and Download Files with JDBC to SQL Servers.

Java Threads. Android Studio App Development. 5 services en ligne pour créer rapidement une page Web. Android Code Examples & Snippets. How to use GitHub with Android Studio. Egit - How to push a new project in Github from Eclipse? Tips and Tricks: Using Eclipse with GitHub. How do you sync projects to Github with Android Studio? Classroom - Udacity. Udacity - Learn Programming. Zlib Home Site. Java Collection Interfaces. Java Exception Handling. JAR Search - Aspose github repositories. .JAVA, NET Component Packs for Excel Word PDF PowerPoint Barcode Flash Report.