Problem: When try to store Chinese to mysql database, ??? was stored.
Solution:
– set names utf8;
– set character set utf8;
– set database field’s Collation to be “utf8_general_ci”
Here is a Java puzzle from Neal Gafter’s presentation. Which one is correct, a, b, c or d? The answer is d. There are 3 defects in this program: 1. Apparently, there is no “break” in the switch statement. 2. nextInt(2) will only return 0 or 1. 3. ‘P’, ‘G’, ‘M’ are Chars, not Strings. … Read more
Here I summarize the design patterns used in Eclipse platform. Understanding design patterns used in Eclipse is the key for understanding Eclipse platform. Eclipse architecture has a clear layered structure. Each layer is independent to each other but interactive with each other. To better understand a framework, it is a good idea to start from … Read more
Problem: When try to store Chinese to mysql database, ??? was stored.
Solution:
– set names utf8;
– set character set utf8;
– set database field’s Collation to be “utf8_general_ci”
You may be curious about how a framework works? A simple framework example will be made here to demonstrate the idea of frameworks. Goal of a Framework First of all, why do we need a framework other than just a normal library? The goal of framework is defining a process which let developers implement certain … Read more
What is the difference between a Java Library and a framework? The two concepts are important but sometimes confusing for Java developers. 1. Key Difference and Definition of Library and Framework The key difference between a library and a framework is “Inversion of Control”. When you call a method from a library, you are in … Read more
This Diagram is from Addison Wesley’s “Eclipse Rich Client Platform 2nd Edition”. It demonstrates the relations between window, menu, perspective, views, etc. In brief, window is the whole application view and it has one page. The page has its own editor and view instances, and uses the perspective to determine its layout. A view is … Read more
Update on 2020/10/07: This list was created nearly 10 years ago. The new list is available here. This article summarizes the most popular and widely used Java libraries for a variety of different applications. 1. Core Apache Commons Lang – Apache’s library that provides a host of helper utilities for the java.lang API, such as … Read more
This example belongs to Eclipse JDT Tutorial Series. I have talked about how to parse a Java method, how to parse a sequence of statements. Now let’s see how to parse a Java project. This example use Eclipse JDT ASTParser and Java Model. Since Java Model has to be used inside of a plug-in, the … Read more
The API document only list the description of class, interface, and methods. If you want to trace back to the original implementation code by clicking “F3” button in Eclipse, then source file need to be attached. The source file under window is here: C:Program FilesJavajdk1.6.0_24src.zip http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/org.eclipse.jdt.doc.user/tasks/tasks-115.htm
This is a classic interview question which confuses novice Java developers. In this post I will use an example and some diagram to demonstrate that: Java is pass-by-value. 1. Some Definitions Pass by value: make a copy in memory of the actual parameter’s value that is passed in. Pass by reference: pass a copy of … Read more
So we have solutions for every general problem/topic. Can we find alternative solutions to address the same problem?
Code tangling and code scattering impact software in many ways:
1. Poor traceability – Simultaneous implementation of several concerns make it hard to trace requirements to implementation.
What is Aspect-Oriented Programming(AOP)? By using the diagram below, the concept can be understood in a few seconds. The cross-cutting concerns problem First take a took at the diagram below, and think about what could be the problem. In the diagram above, it is easy to see that log related actions are everywhere. It causes … Read more
Full-text search mechanism
Lucene’s API interface design is relatively generic, which looks like the structure of the database: tables -> record -> field. Many traditional applications, files, and databases can be easily mapped to the storage structure of Lucene / interface. Overall you can see Lucene as a database system to support full-text index.
This tutorial belongs to Eclipse JDT Tutorial Series.
I will explore how we can compute fan in i.e. find all the methods that call a particular method (all callers of a method).
In Eclipse, one can right click on a method and choose “open call hierarchy” and eclipse shows all the methods that call the selected method and all the methods that are called from the selected method (callers and callees of the selected method).
We can programtically find callers and callees and I will explain how I have done it.
There are a couple of different ways that I know:
Someone says that programming language is also a language. This is true. Beyond this, during a software development life cycle different kinds of natural languages are added for various purposes, such as requirement analysis, comments, bug reports, etc. Since there are common features between natural language and software related data, a lot of research in … Read more