Tampilkan postingan dengan label and. Tampilkan semua postingan
Tampilkan postingan dengan label and. Tampilkan semua postingan

Intel Nehalem Processors and X58 Express Chipsets show up in Taipei for Computex

Minggu, 30 Maret 2014

0 komentar

The crew over at bit-tech are over in Taiwan for Computex and have already spotted some great stuff. The talked MSI into letting them take snap some pictures of Intel’s upcoming “Tylersberg” X58 Express chipset, which is whatthe new Nehalem processor will run on.

They were also able to take some motherboard pictures with the the new triple-channel memory DIMM slots along with the LGA1366 CPU socket.

First, the CPU and its new socket: while the roadmaps say the high-end Nehalem to be launched in Q4 will have up to eight cores, the one MSI had in its office was just a quad-core but with eight threads. The socket is still LGA, but instead of the 775 used on current boards, this one now features 1366 pins and is slightly rectangular – not Pentium Pro rectangular, but simply a stretched out square. The back of the socket now has a metal backplate to brace itself and I’m afraid you’ll be buying a new heatsink too because the socket fittings have changed since LGA775. In fact, the whole area that needs to be exclusively for “Intel CPU use” is now apparently over twice the volume of that compared to LGA775 giving motherboard manufacturers even less space to shoehorn in additional components.

Read More..

If you are using AutoCAD and do not create 3D content then why are you using AutoCAD

Senin, 17 Maret 2014

0 komentar

Is this a fair question to ask?  AutoCAD LT® can do almost everything "regular" AutoCAD® can except for 3D modeling/rendering features and LISP routines, essentially.  Are you waisting your companys resources by not purchasing AutoCAD LT®?  I dont know, ok I do, but, still.  What do you think?  If you arent creating 3D content, why?  If you arent using LISP routines then I ask the same question, why?

Why do you limit yourself?  Why do you pay for tools that you refuse to use?  If you are creating items that only have two dimensions why are you using a three dimensional creation tool?  Many sheet metal fabricators use AutoCAD LT®.  They get it.

Im not trying to be mean here I am honestly curious.  If you purchased a house with three floors would you only use two of them?  At least store stuff in the third floor right?  Have you ever said to yourself or others, "Ive never seen a real need to walk up the stairs to the third floor so I dont use it."  Youre paying to heat/cool it and to protect it from the elements.

Make an argument for purchasing full on AutoCAD® but for using it like its AutoCAD LT®.
Read More..

10 example of using Vim or VI editor in UNIX and Linux

Selasa, 11 Maret 2014

0 komentar

Vim or VI editor tutorial in UNIX

vi editor in unixVI Editor is like notepad in UNIX but it’s extremely powerful and have sophisticated feature to work as complete IDE. No matter which version of UNIX you are working or which flavor you are using you always find either VI editor or VIM there. VI is a very large topic and I am not covering every aspect of it what I am sharing here is some examples of using VI editor in UNIX or Linux. most of the time we use only 10% of VI editor and never know 90% of it , to be frank I also don't know many of VI feature by heart but I always search for it , see people working in VI and learn from there experience as well. after working on VI editor what I found that every day we learn something new in VI editor but we  forget something equally important and there I thought lets document whatever VI commands I have learned so far and using regularly. Idea is to keep this VI Editor tutorial updated with every single useful VI commands I learn and I also ask you guys to contribute with something useful. If you see 10 peoples working in VI editor you realize that they use it differently then use some new VI commands which you are not familiar of and which could improve your productivity as well. so if you would like to know more and more about VI editor I would suggest observe people around you when they work in VIM or VI editor and learn from there experience. Don’t confuse with both VIM and VI, VIM stands for VI improved and has some more feature than VI editor. Many a times you will find that VI command is aliased to VIM to make it default editor in UNIX.
Read more »
Read More..

When a FREE Trip to Autodesk University 2011 and a SpacePilot PRO 3D!

Senin, 10 Maret 2014

0 komentar
One of my favorite peripherals manufacturers is having a contest to give away a free trip to Autodesk University 2011 and a SpacePilot Pro 3D Mouse!  3Dconnexion is offering this trip (and mouse) that will include airfare and accommodations!  What a prize!

To enter this drawing complete the required form that can be found at http://bit.ly/qcWJii.  Submissions will be accepted through midnight U.S. PDT on November 7th, 2011.  Make sure to check out the terms and conditions page before you fill out the forms.  The winner will be contacted by email or phone on November 8th, 2011 and will have 3 days to claim there prize.

Good luck.
Read More..

Dennis Ritchie Creator of C language and Unix has passed away

Jumat, 07 Maret 2014

0 komentar
I just come to know about this sad news that Dennis Ritchie passed away, It is second blow to technology world after Steve jobs who has recently passed away. Dennis Ritchie is the first programming figure I come to know when I started my programming classes in C and C++ and thats why when I heard this news I feel sad about it and suddenly I remember my programming days and I thought about this post to pay my tribute and remember him.


Dennis Ritchie creator of C and Unix passed away
There is lot of Great information available on Dennis Ritchie in web and Wikipedia but two of its main contribution is:

1) C Programming language, which is still number one after Java.
2) His Contribution in UNIX Operating System which is best Server Operating system available.
3) Author of book


Let’s remember this programming genius and pay 2 minute tribute to him, without his C language and immense contribution to programming language, community will never forget him.

May god rest his soul in piece.
Read More..

HOWTO Tor and Proxychains on Ubuntu Desktop 12 04 LTS

Minggu, 02 Maret 2014

0 komentar
(A) Tor



Step 1 :



sudo nano /etc/apt/sources.list.d/tor.list



Append the following :



deb http://deb.torproject.org/torproject.org precise main



Save and exit.



sudo -sH



gpg --keyserver keys.gnupg.net --recv 886DDD89

gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -



apt-get update

apt-get install deb.torproject.org-keyring

apt-get install tor tor-geoipdb vidalia privoxy




Step 2 :



sudo nano /etc/privoxy/config



Append the following line :



forward-socks5 / 127.0.0.1:9050 .



If you are behind NAT or router, you should append the following line :



forward 192.168.*.*/ .



Step 3 :



sudo update-rc.d privoxy disable

sudo update-rc.d tor disable



sudo /etc/init.d/privoxy start

sudo /etc/init.d/tor start




(B) Proxychains



Step 4 :



sudo apt-get install proxychains



sudo nano /etc/proxychains.conf



Change the following line :



socks4 127.0.0.1 9050



To :



socks5 127.0.0.1 9050



Thats all! See you.


Read More..

Difference between trunk tags and branches in SVN or Subversion source control system

Rabu, 26 Februari 2014

0 komentar
SVN or Subversion is one of the popular source control system used in Java world for source code management. There are lot of source control system available e.g. Git, Perforce, CVS, Clearcase, VSS, but SVN has it’s own place among Java developer and open source communities. Knowledge of source control system is must for any professional programmer. New users of subversion often confused between three things trunk, tags and branches. Questions like, what is difference between a tag and a branch in subversion is frequently asked in various Java forums and chat rooms. In this article, we will see what is trunk, tags or branches in SVN and understand difference between trunk, tag and branch. In short, when you first upload your project to SVN it creates a trunk, It's analogous to trunk of tree. this trunk forms the main development line. When multiple developer work on different functionality of project they usually create branch from trunk and after successfully completing that functionality, they usually merge there changes to trunk. On the other hand tag is usually used to create read only snapshot of either trunk or branch, which has been released, for future use. You can think tag as stable snapshot of code at any point, and can be used to as backup or restore. Let's see difference between branch, trunk and tag more detail in next section.
Read more »
Read More..

openSUSE 12 1 Just released and seems to be working

Sabtu, 22 Februari 2014

0 komentar
I am sure you have seen the default openSUSE 12.1 KDE Desktop, so here is a different one.

I remember when openSUSE 11.4 was released and that was probably the most broken release in their history. So broken that I decided there and then that I would be dumping openSUSE for good.

To date I have stuck to my words but for the past few months there have been significant developments in the world of Linux desktop environments. Yes, Gnome (S)hell and Unity.

Those developments have left me with a big problem, long term wise what Linux distribution should I use?

The first step in addressing this problem is to identify what Desktop Environment is available to suit my needs and right now KDE looks promising. I was impressed with Fedoras implementation of KDE in F15, even with Kubuntu 11.04 but both suffer from the occasional quirk. With Fedora being what it is, I can understand the odd quirk but Kubuntu needs to try harder.

Fast forward to Fedora 16 KDE and Kubuntu 11.10, I am finding F16 just too unreliable. You know when a distribution is unreliable when you have to hit the reset button on your PC.

Kubuntu 11.10, feels a little sluggish and rough in a few places but is at least usable.

At some point before F16 and Kubuntu 11.10 I came across Mandriva 2011, I like what they have done with KDE but usability wise they need to make it more reliable. Perhaps when they release their LTS version by the end of the year things will be better.

Hold on, who are you trying to kid, its French. But the Russians now have their hands on it. (Perhaps not then)

There are of course many more KDE distributions out there but I cant be bothered to try everything. At the end of the day I want something that works, is easy to setup and has good support.

So the quest continues or do I eat my own words and give openSUSE another chance?

I am currently running it from a Live USB, inital observations are that it is quite nippy, probably due to their desktop kernel tweaks. The Live CD / USB also comes with useful software such as Firefox, LibreOffice and GIMP which makes it a better option over Fedora and Kubuntu.

I think for now I will just continue to monitor the forums and internet as I need my system for some important work. On that note if you are wondering what operating system I am using for this important work, Ubuntu 10.04 LTS.
Read More..

JDBC Interview Questions and Answers

Jumat, 21 Februari 2014

0 komentar
The JDBC questions and answers covered here are an extension to the frequently asked questions covered in "Java/J2EE Job Interview Companion" book. The questions discussed below are generally asked in online JEE technical tests.

Q. What will be the out put in the following scenario where the table "Course" has the following records



and the code that is used to access the database is as follows.


    public void executeSelectQuery(Connection con) {
PreparedStatement ps = null;

try {
ps = con.prepareStatement("SELECT COURSE_ID, NAME, COURSE FROM COURSE");
ResultSet rs = ps.executeQuery(); // read from database

rs.absolute(0); //moves the cursor to the given row number

rs.relative(2); //moves the cursor by 2 rows


while(rs.next()){
Integer id = rs.getInt("COURSE_ID");
String name = rs.getString("NAME");
String course = rs.getString("COURSE");
System.out.println("id:" + id + ", name:" + name + ", course:" + course);
}

}
catch (Exception e) {
System.out.println("ERROR executing query: ");
e.printStackTrace();
}
finally{
try {
ps.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}





A. The above code should thrown an exception "java.sql.SQLFeatureNotSupportedException: feature not supported".

The cause for this exception is in line where you prepare a statement. You are basically creating a cursor here.

ps = con.prepareStatement("SELECT COURSE_ID, NAME, COURSE  FROM COURSE");

The above method by default values for the resultSetType and resultSetConcurrency.  So, the above line is equivalent to

ps = con.prepareStatement("SELECT COURSE_ID, NAME, COURSE  FROM COURSE", 
ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY );


The JDBC API definitions for the  resultSetType and resultSetConcurrency are as follows

resultSetType 
  • TYPE_FORWARD_ONLY: The result set cannot be scrolled; its cursor moves forward only, from before the first row to after the last row. The rows contained in the result set depend on how the underlying database generates the results. That is, it contains the rows that satisfy the query at either the time the query is executed or as the rows are retrieved.
  • TYPE_SCROLL_INSENSITIVE: The result can be scrolled; its cursor can move both forward and backward relative to the current position, and it can move to an absolute position. The result set is insensitive to changes made to the underlying data source while it is open. It contains the rows that satisfy the query at either the time the query is executed or as the rows are retrieved.
  • TYPE_SCROLL_SENSITIVE: The result can be scrolled; its cursor can move both forward and backward relative to the current position, and it can move to an absolute position. The result set reflects changes made to the underlying data source while the result set remains open.
resultSetConcurrency 
  • CONCUR_READ_ONLY: The ResultSet object cannot be updated using the ResultSet interface.
  • CONCUR_UPDATABLE: The ResultSet object can be updated using the ResultSet interface.

Q. What will be the output for the following code snippet for the same "Course" table?

public void executeSelectQuery(Connection con) {
PreparedStatement ps = null;

try {
ps = con.prepareStatement("SELECT COURSE_ID, NAME, COURSE FROM COURSE", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY );
ResultSet rs = ps.executeQuery(); // read from database

rs.absolute(0); //moves the cursor to the given row number

rs.relative(2); //moves the cursor by 2 rows


while(rs.next()){
Integer id = rs.getInt("COURSE_ID");
String name = rs.getString("NAME");
String course = rs.getString("COURSE");
System.out.println("id:" + id + ", name:" + name + ", course:" + course);
}

}
catch (Exception e) {
System.out.println("ERROR executing query: ");
e.printStackTrace();
}
finally{
try {
ps.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}


AResultSet.TYPE_SCROLL_INSENSITIVE type will allow the cursor to scroll forward or backward.

The output will be

id:3, name:paul, course:JSF
id:4, name:jonathan, course:Hibernate
id:5, name:james, course:Spring
id:6, name:Lewis, course:JDBC

The cursor will scroll to the first record when rs.absolute(0); is executed. It will scroll another 2 records when  rs.relative(2); is executed. When it gets to the while(rs.next()){ ...} loop it will start printing from third record onwards. You can practice different scenarios with the JDBC Tutorial.


Q. What is RowSet? What is the difference between RowSet and ResultSet? What are the advantages of using RowSet over ResultSet?

ARowSets are a JDBC 2.0 extension to the java.sql.ResultSet interface. Guess what, it makes life a lot easier for all JDBC programmers. No more Connection objects, statement objects, just a single RowSet will do everything for you. RowSet object follows the JavaBeans model for properties and event notification, it is a JavaBeans component that can be combined with other components in an application.

The ResultSet has an open connection to the database whereas a RowSet works in a disconnected fashion. It has the following advantages over a ResultSet.

  • Since a RowSet works in a disconnected mode, especially for "read-only" queries, it would have better performance in a highly concurrent system.
  • Rowsets have many different implementations to fill different needs. These implementations fall into two broad categories, rowsets that are connected and those that are disconnected. 
  • Rowsets make it easy to send tabular data over a network. They can also be used to provide scrollable result sets or updatable result sets in special cases when the underlying JDBC driver does not support them.

RowSet disadvantages.
  • Rowset keeps all the data from the query result in memory. This is very in-efficient for queries that return huge data.

There are 3 types of RowSets. The JdbcRowset 

JdbcRowSet is a connected type of rowset as it maintains a connection to the data source using a JDBC driver

JdbcRowSet jdbcRowSet = new JdbcRowSetImpl();
jdbcRowSet.setCommand("SELECT * FROM Course);
jdbcRowSet.setURL("jdbc:hsqldb:hsql://localhost/mytestdb");
jdbcRowSet.setUsername("sa");
jdbcRowSet.setPassword("pwd");
jdbcRowSet.execute();

CachedRowSet and WebRoeSet are disconnected types of rowsets as they are connected to the data source only when reading data from it or writing data to it.

ResultSet rs = stmt.executeQuery("SELECT * FROM Course");
CachedRowSet crset = new CachedRowSetImpl();
crset.populate(rs);


WebRowSet wrs = new WebRowSetImpl();
wrs.populate(rs);
wrs.absolute(2)
wrs.updateString(1, "JNDI");


Q. What is Metadata and why should you use it?
A. JDBC API has 2 Metadata interfaces -- DatabaseMetaData & ResultSetMetaData. The  meta data means data about data, and provides comprehensive information about the database as a whole. The implementation for this interface is implemented by database driver vendors to let users know the capabilities of a Database.

ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM TABLE2");  
ResultSetMetaData resultSetMeta = rs.getMetaData();
int numberOfColumns = resultSetMeta.getColumnCount();
boolean b = resultSetMeta.isSearchable(3);


Q. What are database warnings and why do you need them?
A. Warnings are issued by a database to inform user of a problem which may not be very severe. Database warnings do not stop the execution of SQL statements. Warnings are silently chained to the object. You need warnings for the reporting purpose. Warnings may be retrieved from Connection, Statement, and ResultSet objects.

SQLWarning warning = conn.getWarnings();  
QLWarning nextWarning = warning.getNextWarning();
conn.clearWarnings();
...
stmt.getWarnings();
stmt.clearWarnings();
...
rs.getWarnings();
...


Read More..

Difference between linked list and array data structure in Java Programming

Kamis, 20 Februari 2014

0 komentar
Array and linked list are two fundamental data structure in programming world. Almost all programs use Array in some form or other, which makes it increasingly important to learn array and linked list. Difference between linked list and array data structure is also a popular data structure question, frequently asked in various programming job interview. This makes it even more important to learn and understand difference between an array and a linked list. Well there are lot of difference between these two starting from how they store data, to how you retrieve data from them. Main difference comes from the fact that array elements are stored in contiguous memory location, which makes it easy to retrieve them in quick time, while linked list elements are scattered through out memory, where one element knows address of other, it makes it hard to retrieve element from linked list in quick time. Some of the differences which we saw in ArrayList vs LinkedList also applicable at data structure level, because ArrayList is backed by array and LinkedList is internally backed by double linked list in Java. In this tutorial, we will learn differences between these two fundamental data structure in more details. Once you know the difference, you can make a concise choice of which data structure suits your need better. Since both of them offers distinctive advantage over others, in terms of speed and flexibility, You can make an informed choice based upon your need.
Read more »
Read More..

Java Preorder Tree Traversal recursive and iterative flattening of tree

Senin, 17 Februari 2014

0 komentar
The Logic and Datastructure Essentials chapter of my book "Core Java Career Essentials" covered a lot of questiomns and answers on different data structures and where to use them with lots of diagrams and code snippets. This blog post covers just the  Preorder Tree Traversal with code snippets. The preorder tree structure is a very popular Java coding interview question:


The left nodes are traversed before the right nodes.

Q. How will you fltten a preorder tree in Java?
A.

Step 1: The TreeNode class can be decalred as shown below.

 
package com.mycompany.app14;

public class TreeNode
{
private int value;
private TreeNode left;
private TreeNode right;

public TreeNode(int value, TreeNode left, TreeNode right)
{
super();
this.value = value;
this.left = left;
this.right = right;
}

public int getValue()
{
return value;
}

public void setValue(int value)
{
this.value = value;
}

public TreeNode getLeft()
{
return left;
}

public void setLeft(TreeNode left)
{
this.left = left;
}

public TreeNode getRight()
{
return right;
}

public void setRight(TreeNode right)
{
this.right = right;
}

}


Step 2: Test class to construct the tree structure using the TreeNode class and traverse the tree bothe recursively and iteratively to printhe values in the Preorder.

 
package com.mycompany.app14;

import java.util.ArrayDeque;
import java.util.Deque;

public class Test
{
public static void main(String[] args)
{
TreeNode root = createOneTo6PreOrderTree();
printTreeRecursively(root);
System.out.println("---------------------------------");
printTreeIteratively(root);
}

private static TreeNode createOneTo6PreOrderTree()
{
TreeNode leaf3 = new TreeNode(3, null, null);
TreeNode leaf4 = new TreeNode(4, null, null);
TreeNode leaf6 = new TreeNode(6, null, null);

TreeNode node5 = new TreeNode(5, leaf6, null);
TreeNode node2 = new TreeNode(2, leaf3, leaf4);

TreeNode root1 = new TreeNode(1, node2, node5);

return root1;
}

/**
* traverse the tree recursively and print
*
* @param TreeNode node
*/
private static void printTreeRecursively(TreeNode node)
{
//Exit condition for recursion
if (node == null)
{
return;
}

System.out.println(node.getValue());

printTreeRecursively(node.getLeft()); //recurse left node
printTreeRecursively(node.getRight()); //recurse right node

}

/**
* Achieved using a Deque (LIFO)
*
* @param TreeNode node
*/
private static void printTreeIteratively(TreeNode node)
{
Deque<TreeNode> s = new ArrayDeque<TreeNode>(6);
s.push(node); // push the root node

while (!s.isEmpty())
{
node = s.pop();
System.out.println(node.getValue());

//stack is LIFO, so push the right node first
if (node.getRight() != null)
{
s.push(node.getRight());
}

//stack is LIFO, so push the left node last
if (node.getLeft() != null)
{
s.push(node.getLeft());
}
}

}
}




Step 3: The iterative approach represented diagramatucally for better understanding. Shows how the numbers are pushed and popped.



Step 4: Output

 
1
2
3
4
5
6
---------------------------------
1
2
3
4
5
6


Read More..

How to Find Runtime of a Process in UNIX and Linux

Minggu, 16 Februari 2014

0 komentar
So you checked your process is running in Linux operating system and it's running find, by using ps command. But now you want to know, from how long process is running, What is start date of that process etc. Unfortunately PS command in Linux or any UNIX based operating system doesn't provide that information. But as said, UNIX has commands for everything, there is a nice UNIX tip, which you can use to check from how long a process is running. It’s been a long time, I have posted any UNIX or Linux command tutorial, after sharing some UNIX productivity tips . So I thought to share this nice little tip about finding runtime of a process in UNIX based systems e.g. Linux and Solaris. In this UNIX command tutorial, we will see step by step guide to find, since when a particular process is running in a server.
Read more »
Read More..

5 Difference between Application Server and Web Server in Java

Jumat, 14 Februari 2014

0 komentar
Application server and web server in Java both are used to host Java web application. Though both application server and web server are generic terms, difference between application server and web server is a famous J2EE interview question. On  Java J2EE perspective main difference between web server and application server is support of EJB. In order to run EJB or host enterprise Java application (.ear) file you need an application server like JBoss, WebLogic, WebSphere or Glassfish, while you can still run your servlet and JSP or java web application (.war) file inside any web server like Tomcat or Jetty.

What are difference between application server and web serverThis Java interview question are in continuation of my previous post on interviews like Top 10 Spring interview questions and  Top 10 Struts interview question.  Here we will see some difference between application server and web server in point format which will help you to answer this question in any java interview.
Read more »
Read More..

Apache Camel and Spring with properties file to move files

Rabu, 12 Februari 2014

0 komentar
This is an extension to the camel tutorials


This highlights  the use of a properties file to configure polling folder, destination folder, file pattern to look for, done file name, etc.

Step 1: The applicationContext.xml file is as shown below, and please note that "org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer" is used configure the properties file.

  <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">

<context:component-scan base-package="com.mycompany.app3" />

<context:annotation-config />
<context:spring-configured />

<task:annotation-driven />

<bean id="bridgePropertyPlaceholder"
class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:*.properties</value>
</list>
</property>
</bean>

<import resource="classpath*:route.xml" />

</beans>





Step 2: The properties file myapp.propertieswill be something like

myapp.in.dir=C:/temp/simple/input
myapp.in.file.pattern=AK(TAX|PROPERTY|TRADE).CSV
myapp.out.dir=C:/temp/simple/output
myapp.out.file.pattern=GBST_${file:name.noext}_${date:now:yyMMdd}_${date:now:HHmm}.${file:name.ext}

Step 3: Note that properties from the myapp.properties are referred with "{{ }}" double curly brackets. The Apache camel file language expressions are denoted with ${} as shown above to extract file name, file extension, etc.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

<routeContext id="myapp" xmlns="http://camel.apache.org/schema/spring">
<route id="myappFilePolling" >
<from uri="file:{{myapp.in.dir}}?include={{myapp.in.file.pattern}}&delay=5000&initialDelay=5000&readLock=rename&move=archive&moveFailed=error&doneFileName=${file:name}.END" />
<to uri="file:{{myapp.out.dir}}?fileName={{myapp.out.file.pattern}}" />
</route>
</routeContext>

</beans>


Step 4: Finally, the route.xml.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p" xmlns:c="http://www.springframework.org/schema/c"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

<import resource="classpath*:myapp.xml" />

<camel:errorHandler id="defaultErrorHandler" type="DefaultErrorHandler" />

<camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="defaultErrorHandler">

<routeContextRef ref="myapp" />

<dataFormats>
<zip id="myZip" />
</dataFormats>
</camelContext>

</beans>

Read More..

5 books to learn Spring framework and Spring MVC for Java Programmers

Selasa, 11 Februari 2014

0 komentar
Spring and Spring MVC is one of the most popular Java framework and most of new Java projects uses Spring these days. Java programmer often ask questions like which books is good to learn Spring MVC or What is the best book to learn Spring framework etc. Actually, there are many books to learn Spring and Spring MVC but only certain books can be considered good because of  there content, examples or the way they explained concept involved in Spring framework. Similar to  Top 5 books on Java programming we will some good books on Spring in this article, which not only help beginners to start with Spring but also teaches some best practices. In order to learn a new technology or a new framework, probably best way is to start looking documentation provided and Spring Framework is no short on this. Spring  provides great, detailed documentation to use various features of Spring framework but despite of that nothing can replace a good book. Luckily both Spring and Spring MVC got couple of good titles which not only explains concepts like Dependency Injection and Inversion of Control which is core to spring framework but also gives coverage to other important aspect of Spring. Following are some of the good books available on Spring and Spring MVC which can help you to learn Spring.
Read more »
Read More..

Scala vs Java Differences and Similarities between Java and Scala Programming language

Senin, 10 Februari 2014

0 komentar
Scala is new generation JVM language, which is generating popularity as alternative of arguable one of the most popular language Java. It's not yet as popular as Java, but slowly getting momentum. As more and more Java developers are learning Scala and inspired by Twitter, more and more companies are using Scala, it's future looks very bright. To start with, Scala has several good feature, which differentiate it from Java, but same time it has lot of similarities as well e.g. both Scala and Java are JVM based language, You can code Scala in Java way and Scala can use any Java library, which in my opinion a great decision made by designers of Scala. Since tremendous works has already been done in form of open source framework and library in Java, it's best to reuse them, rather than creating a separate set for Scala. Out of several differences, one of the main difference between Scala and Java is it's ability to take advantage of Functional programming paradigm and multi-core architecture of current  CPU. Since current CPU development trend is towards adding more cores, rather than increasing CPU cycles, it also favors functional programming paradigm. Though this differences may not be significant, once Java 8 will introduce lambdas, but it might be too early to comment. Apart from functional programming aspect, there are many other differences as well. One of the obvious one is improved readability and succinct code. Java is always on firing line for being too verbose, I thing Scala does take care of that and code which took 5 to 6 lines in Java, can be written in just 2 to 3 lines in Scala. Well Grounded Java Developer has some nice introduction on JVM languages like Scala, Groovy and Closure, which is worth reading.  In this article, we will see such kind of similarities and differences between Scala and Java.
Read more »
Read More..

Installation advice Dual booting Windows and Linux with 2 disk drives

Minggu, 09 Februari 2014

0 komentar
Dual booting between Windows and Linux on a single drive is very common and for the most part problem free. However, when it comes to dual booting with 2 disk drives things can be made more complicated than necessary.

I deliberately said can be made as oppose to are more... because the technique most people use and which I have witnessed time and time again on the internet is the direct cause of many headaches.

Well no more, I am going to tell you how to create a fool proof dual boot setup featuring 2 disk drives.

The biggest mistake you can make (bad practice)

Most of the problems in a 2 disk dual boot setup are caused by having your Windows disk drive as the Primary disk drive on your system and the intended Linux drive as the Secondary drive on the system.

With this disk setup, when attempting to install a Linux distribution it will always default to automatically suggesting to install or installing the Grub bootloader to your Primary Windows disk drive.

It is important to note that the reason why Grub wants to install on your Windows drive is because it is the Primary drive on the system.

Assuming you proceed with such a setup the end result is potentially for the majority of users a bad result.

Why is installing Grub on the Primary Windows drive in a 2 disk dual boot setup bad?

/dev/sda ---- > Windows --- > Primary Disk ---- > Bootloader (Grub boot files on /dev/sdb)
/dev/sdb ---- > Linux ---- > Secondary Disk ---- > No Bootloader

If you were to disconnect your Secondary drive or it fails, your Windows operating system will be unbootable because the Secondary drive contained files required by the Grub bootloader to boot the system.

In the opposite situation, if you disconnect the Primary drive or it fails, the Linux operating system will be unbootable because no bootloader is present.

Therefore the biggest disadvantage with this setup is the system is dependant on the presence of both drives. Should either of the drives cease to be present or function you cannot boot into Windows or Linux.

Most Linux distributions do allow you to change the default grub installation settings, and if you plan to keep your Windows drive as the Primary drive on the system make sure you install grub to the Linux drive, /dev/sdb.

It is far more advantageous to have each drive independent from one an other and capable of booting on its own.

But there is a better more fool proof way!

If you want to ensure avoidance of the possible problems the above setup can cause there is a very simple solution. Physically make your Windows drive the Secondary drive on the system and your intended Linux drive the Primary.

By doing this, distributions such as Ubuntu, Fedora, openSUSE will always default to installing the bootloader (Grub/Grub2) on your Primary and intended Linux drive. You can therefore blindly install a distribution and your Windows drive will remain untouched.

SATA port 1 > SATA port 2

If you have two SATA hard disk drives, connect your intended Linux drive to SATA port 1 and your Windows drive to SATA port 2. This will permanently make your intended Linux drive the Primary disk drive in the system.

If you are still on IDE drives, remember that the Master end of the cable is the Primary, and that IDE channel 1 takes priorty over IDE channel 2.

Additional guidance for Ubuntu 11.04 users


During the installation choose the "Something else" option and create your partitions manually.

Ubuntu 11.04 - Creating a 2 disk dual boot setup

In the above screenshot, I have placed my intended Linux drive in SATA port 1 and my Windows 7 drive in SATA port 2.

The Ubuntu installer has identified my intended Linux drive as the Primary drive on the system (/dev/sda) and has by default suggested installing the boot loader to /dev/sda.

My Windows 7 drive therefore by default remains untouched.

So if you are the forgetful type or want to ensure no mistakes, making your intended Linux drive the Primary drive on the system will help.
Read More..

break continue and label in loop – Java program example

0 komentar
break and continue in Java are two essential keyword beginners needs to familiar while using loops ( for loop, while loop and do while loop). break statement in java is used to break the loop and transfers control to the line immediate outside of loop while continue is used to escape current execution and transfers control back to start of the loop. Both break and continue allows programmer to create sophisticated algorithm and looping constructs. In this java tutorial we will see example of break and continue statement in Java and some important points related to breaking the loop using label and break statement. break keyword can also be used inside switch statement to break current choice and if not used it can cause fall-through on switch. Well break is not alone on breaking switch case you can also sued throw keyword on switch case.

This Java tutorial is next in series of articles in looping like 4 ways to loop Map in Java and How to loop on ArrayList in Java. If you are new here and haven’t gone through those articles then you may find them useful.
Read more »
Read More..

Problems And Solutions Norton Internet Security

Sabtu, 08 Februari 2014

0 komentar

The internet is fraught with lot of malicious code. Even a casual internet surfer can very easily lose an expensive hard drive of his unprotected computer. Norton Internet Security software which is made by Symantec Corporation is among the most popular security programs, it defends your computer from any host of internet dangers. However, every program has its own good points and bad points, even with the best program that you trust most for keeping your computer safe. Norton Internet Security comes with a secure firewall but there are some problems that you should watch out for. In this article you will get to know about some common problem that you face with Norton Firewall.

Mac Security Update

Nortons firewall with the Internet Security 3.0 has caused little problems with a specific update to Mac OS X in 2003. When the July 14, 2003, update was actually applied, some computers could not reboot, and thus the only way to salvage all those computers was to boot it from any other another device, such as the other operating system installation disc. Users with old versions of this software should be little cautious while updating their computer system.



Blocking Internet Access

The Norton firewall will sometimes block certain websites or JavaScript, thinking they are a threat. It can also block browsers. If you receive an error reading "Server not found," Norton may be blocking your browser. "Connect attempt failed" may indicate it is blocking the website you are trying to view. These errors and JavaScript problems can be fixed by adjusting settings inside Norton.

Flaw Requiring Patch

The older versions of the Norton Security program had some flaws which may allow hackers to actually infiltrate your computers. This also included the firewall program. Symantec Company issued a patch through its Live Update service later in the year 2004 in order to fix this issue. If you are also concerned about your version of Norton program then you can also apply the patch through LiveUpdate or even manually.

Solutions

If the Norton Internet Security is not allowing you to access some websites then you can adjust the privacy settings of your computer. You can also change the strength of Norton firewall or you can even disable it temporarily to get access. If Norton Internet Security still continues to give you problems even after being temporarily disabled, in that case you can set the Norton program to start manually. This prevents Windows of your system from loading the program whenever the computer is started.

Article Source: http://EzineArticles.com/7187577
Read More..

Database Website to Run and Practice SQL Query Online for FREE SQLFiddle

Kamis, 06 Februari 2014

0 komentar
Other day, I was looking for a website to execute SQL query online, since I have uninstalled Microsoft SQL Server because of memory and CPU constraint and I don't want to install it again, just for executing another query. Also, installing database is pain, it takes time and eats up lots of resources e.g. RAM memory, CPU etc; Given so many database to work with e.g. Oracle, MySQL, Sybase, PostgreSQL and SQLLite, it's not really possible to have all of them in your poor laptop. Fortunately my search leads be to this wonderful site called SQLFiddle, this is what exactly I wanted. This site offers support for lot of popular databases, allows you to build your database schema online and execute SQL query on the fly. I couldn't have asked more, It's a great resource to learn and practice SQL queries online. Apart from many sweet feature, it also allows you to share your problem with community. If you are writing a complex query and stuck in middle, looking for help, you can create your schema on SQLFiddle and can share with your query to any forum or question answer website like StackOverFlow or any forum. Having a collection of online database, just makes running SQL query a fun. You can understand, how happy I am to know about this site, which let me to run and practice my SQL queries online, that I am sharing with you guys. To be frank, there is not many online site, where you can practice SQL query in your favorite database. I was looking for online website to test SQL query from long time, but couldn't find anything like SQL Fiddle, May be I am not aware if couple of them like SQLFiddle already exists, but this  a site every programmer, database administrator, SQL beginners and SQL Experts must bookmark, a great tool in SQL developer and any programmers armory.
Read more »
Read More..

Copyright © 2010 Computer Tips and Trick | Powered By Blogger