2014年2月8日星期六

Class generic problem

For example: I have a class Abc
There is a Map, Map > mapping = new HashMap > ; ( ) ;

Class c = Class.forName (className) ;

if className The class is inherited Abc , it will execute the code below
mapping.put ("xxx", c); / / here is the problem

do not know if people understand what I mean, of course , if not generic , then it is not so much "dust " of the
------ Solution ---------- ----------------------------------

Since generics compile inspection , if without the usual cast with such wording is not compile the . We can use java generics only done at compile time checking features as long as we let the compiler can not check on the line, this time without a strong turn uses reflection to call put the best.

package test;

import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

public class Test {

public static void main(String[] args) throws ClassNotFoundException {

Map<String, Class<Test>> mapping = new HashMap<String, Class<Test>>();

String className = "xxx.xxx.xxx"; // 这里具体是什么并不重要

Class<?> c = Class.forName(className);

Method method=Map.class.getMethod("put",Object.class,Object.class);
                method.invoke(mapping,"a",c);
                System.out.println(mapping);
}
}

------ For reference only ----------------------------------- ----
One might argue that such a solution
map.put ("xxx", (Class) c );

But the problem is "(Class ) c", forced conversion, it's not back to the way the non-generic ?
------ For reference only -------------------------------------- -
did not understand what mean.
------ For reference only -------------------------------------- -?
> represents a generic , generic to Abc this subclass or for itself (Abc) type.
------ For reference only -------------------------------------- -
public class TestG {

Map map = new HashMap ();

so can not it
------ For reference only ----------------------------- ----------

package test;

import java.util.HashMap;
import java.util.Map;

public class Test {

public static void main(String[] args) throws ClassNotFoundException {

Map<String, Class<Test>> mapping = new HashMap<String, Class<Test>>();

String className = "xxx.xxx.xxx"; // 这里具体是什么并不重要

Class<?> c = Class.forName(className);

mapping.put("a", c);
}
}

Finally mapping.put compile errors , how to adjust, do not use cast
------ For reference only ---------------- -----------------------
here to do a display conversion
if (c instance of Class ) {
Class abcC = (Class ) c ;
mapping.put ("xxx", abcC);
}

2014年2月7日星期五

Hibernate problem

My program select statement can be issued , but will not issue a delete and update statements , nor error , neighborhoods you probably why.
This is my program
package com.zhg.oa.base;

import java.lang.reflect.ParameterizedType;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

@SuppressWarnings("unchecked")
public class DaoSupportImpl<T> implements DaoSupport<T> {

@Resource
private SessionFactory sessionFactory;

Class<T> clazz;

public DaoSupportImpl() {
// 使用反射技术得到T的真实类型
ParameterizedType pt = (ParameterizedType) this.getClass()
.getGenericSuperclass();// 获取当前new的对象的泛型的父类类型
this.clazz = (Class<T>) pt.getActualTypeArguments()[0];
}

protected Session getSession() {
return sessionFactory.getCurrentSession();
}

@Override
public void save(T entity) {
getSession().save(entity);
}

@Override
public void delete(Long id) {
Object obj = getById(id);
System.out.println(obj);
if (obj != null) {
getSession().delete(obj);
System.out.println("====================");
}

}

@Override
public void update(T entity) {
System.out.println("====================");
getSession().update(entity);
System.out.println("==============================");
}

@Override
public T getById(Long id) {
if (id == null) {
return null;
} else {
return (T) getSession().get(clazz, id);
}
}

@Override
public List<T> getByIds(Long[] ids) {
return getSession().createQuery( //
"FROM " + clazz.getSimpleName() + " WHERE id IN (:ids)") //
.setParameter("ids", ids)//
.list();
}

@Override
public List<T> findAll() {
return getSession().createQuery( //
"FROM " + clazz.getSimpleName()) //
.list();
}
}

------ Solution ------------------------------------- -------
can send select, the greatest likelihood is that the relationship and transaction .
------ For reference only -------------------------------------- -
    public void delete(Long id) {
        Object obj = getById(id);
System.out.println(obj);
        if (obj != null) {
            getSession().delete(obj);
System.out.println("====================");
        }
    }
    @Override
    public void update(T entity) {
System.out.println("====================");
        getSession().update(entity);
System.out.println("==============================");
    }

these two codes , " ============ " All energy output, but the delete and update statements directly ignored, there is no data in the database changes
----- - For reference only ---------------------------------------

Well, yes forgot to add affairs , and preceded by the @ Transactional just fine , thank you
------ For reference only ---------------------------------------

How to add a menu to the window ?

 This post last edited by proof1 on 2014-01-29 21:30:45
window as follows :

import javax.swing *;. import java.awt *;. import java.awt.event *.;

public class Test implements ActionListener {
public static void main (String [] args) {
JFrame win = new JFrame (" Practice " ) ;
win.setSize (900,900);
win.getContentPane () setBackground (Color.BLACK).;
win.setVisible (true);
}
}


want to add to the window menu bar . For example, a simplified example : file ( open exit ) view ( single-screen , full-screen )
reference code :
JMenuBar menubar = new JMenuBar ();
JMenuItem anItem;

JMenu menu1 = new JMenu (" File" ) ;
anItem = new JMenuItem (" Open "); menu1.add (anItem); anItem.addActionListener (this);
anItem = new JMenuItem (" Exit "); menu1.add (anItem); anItem.addActionListener (this);

JMenu menu2 = new JMenu (" View" ) ;
anItem = new JMenuItem (" single screen "); menu2.add (anItem); anItem.addActionListener (this);
anItem = new JMenuItem (" fullscreen "); menu2.add (anItem); anItem.addActionListener (this);

menubar.add (menu1);
menubar.add (menu2);


How to add a menu bar to the window ? Please use two ways
One is to add code directly in the menu window .
Another is to clear structure , so the menu independent . Create a new menu category , then add a menu to the window object .
------ Solution ---------------------------------------- ----
Okay, I admit here to help you receive points . I learn C + +, , JAVA ignorant .
------ Solution ---------------------------------------- ----
not learned where ,
------ For reference only ------------------------- --------------
help it. Thank you.
------ For reference only -------------------------------------- -
expert help . Come on .
------ For reference only -------------------------------------- -
JMenubar jmb ;/ / Just one , multi- language switch
JMenu jm ;/ / View Favorites Tools Help File
jmb.add (jm);

JMenuItem jmi;
jm.add (jmi);


classes can inherit jmi
JCheckBoxMenuItem
JRadioButtonMenuItem
ButtonGroup
usage and swing almost
------ For reference only ----------------------------- ----------
closing minutes

spring + struts + security of open source projects ( there are pictures and the truth )



Source Download : http://blog.csdn.net/shadowsick

Top articles have detailed the end of the article as well as a source Download
------ Solution ----------------------- ---------------------
interface is very comfortable
------ For reference only --------- ------------------------------
what circumstances ? ? ? ?
------ For reference only -------------------------------------- -
I got to try

How to write a lot of two-way relationship here ? Seeking to rationalize the idea

model : customers, orders , rooms , schedule



The first process:
guests submit an order to form an order object , order room contains objects object , the client object , schedule objects.

now proposed :

room objects

public class Room
{
private long id;

private String name; // 房型名称

private Float price; // 挂牌价
private Float realPrice; // 现售价格

private int breakfast; // '1':'含早餐','0':'无早餐'

private String info; // 简介


target customers


public class Customer
{
private long id;

private String realName;
private int gender; // '1':'男','0':'女'

private String identity; // 用户身份证号
private String nationality; // 用户国籍
private String address;

private String phone;
private String email;


schedule object


public class Schedule
{
private int id;

private Date orderDate;

private Date beginDate;

private Date endDate;







rationalize these comparisons , the corresponding hbm has also been established.



problem is now [ Order objects:


public class Book
{
private int id;

private Room room; // 客房

private Customer customer; // 客人信息

private Schedule schedule; // 日程


hbm not very clear that how to write , the idea is a bit of :
middle of the table is to use as many relationships in the Orders table .
but rooms can not be deleted ( the total amount of room on the hotel all that much ) , guest information can not be deleted ( guest history data ) , the schedule may be to clear ( schedule over several years of data can be deleted in the second schedule stages of development time and mobility might be a relationship , schedules and room objects in addition to a relationship , it will also provide tables and dining a relationship , a relationship and meetings arranged . )




These are now the first self- written program processes card to order here.





============================================== ============================================

An order may contain multiple clients , you need two people to live two guest information , guest information so I will change the order later collection.


out of the process to see outside.

a customer will contain multiple orders , an order will also contain a number of customers. ( Speaking here only for the room , do not take account of Meetings Orders )







============================================== ================

So I think the point here is his knowledge of the leak , do not write this hbm file , or modeling wrong.


two objects -many relationship , I would write , but how to write three objects -many relationship , accurately say how to form an intermediate table .
table structure like this :

middle table ID \ room table foreign key ID \ Guest Information foreign key ID \ schedule a foreign key ID








============================================== =========================
but I do not think I'm wrong , because I found the time to write and schedule an object when the object collaboration room when you can achieve control daily housekeeping work in this business ( that is a total of 20 such as Double , 1 enough 20 between the time can not be sold , the 2nd had 12 points after restored to 20 )

------ Solution ------------------------------------ such examples --------
many online ah , can be referenced .
help you find the two :
http://ryxxlong.iteye.com/blog/626416
http://www.blogjava.net/wujun/archive/2006/04/08/39956.html
------ Solution ------------- -------------------------------
suggest you look at the last hibernate document best practices , does not recommend the use of multi- for many , unless absolutely necessary !
------ Solution ---------------------------------------- ----
personally think that it is not necessary to configure this relationship . In the table there is any relationship to each other only save id on it, I need to use to get the associated record according to id .
In addition , 6th Floor, said contrary to hibernate learning purposes, this really does not. Really, the project is how quick and easy how to , but if you do it faster and better than using hibernate , then why do you have to use it too , because you are in the project using the hibernate it? To improve the efficiency of the tool . Like Xiao Ming and Zhang apart than the two 10 m yuan , each have a car , do not say it because a car , you must drive to go?
------ For reference only -------------------------------------- -
are not many relationships , should not go to room table , guest tables, schedules three table relationships


Instead, three relationships were established : Doula
Orders table with room table ( order date corresponds with a different room , an order can only be developed under a single chamber. )
Orders table -many table with guests
Orders table and the schedule of many-
------ For reference only -------------------------- -------------
Well, I now want to understand the point, seems to be the order of business logic , it is basically impossible to insert mounted directly SPRING Well , only in the business layer first realized the insertion schedule to get the schedule 's OID then insert orders.


But the order object is not to waste in order to remove what should be assembled when the object of it . Attempt. . . . . Later posted to another question or knot .


scholarship END SSH2 integrate two days , please do not place more than a professional guide ! ! !
------ For reference only -------------------------------------- -


Thank you , friends, and relive it again -many

look relatively late , hope do not mind, to go before the New Year . . . .
------ For reference only -------------------------------------- -



friend so, give a very simple example yesterday I tried to write it:

Users
team

A user can be in multiple groups, one group can have multiple users
============================================== =
database has users \ user_group \ groups of three tables

operations will be conducted as follows :
delete users watch users while removing user_group tables and user-related records, but to be able to keep groups table corresponds to the organization ;
delete groups table tissue while removing user_group tables and records related to the organization , but to be able to keep users table users ;
============================================== =
I think this is a typical many.

Now I'm confused a little something like this:
I can write two hbm, realized the middle of the table is automatically generated , but the operation can only be achieved when my own part of the operation , this is the place incomprehensible .

code is as follows :


<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="bean.Group" table="groups">

<id name="id" column="id" type="long">
<generator class="increment"></generator>
</id>

<property name="groupName" column="group_name" type="string"></property>

<set name="users" table="user_group" cascade="save-update">
<key column="group_id"></key>
<many-to-many class="bean.User" column="user_id"></many-to-many>
</set>

</class>

</hibernate-mapping>





<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="bean.User" table="users">

<id name="id" column="id" type="long">
<generator class="increment"></generator>
</id>

<property name="username" column="username" type="string"></property>
<property name="password" column="password" type="string"></property>

<set name="groups" table="user_group" cascade="save-update">
<key column="user_id"></key>
<many-to-many class="bean.Group" column="group_id"></many-to-many>
</set>

</class>

</hibernate-mapping>






 //添加数据:正确实现添加内容
 User user1 = new User();
 user1.setUsername("zhangsan");
 user1.setPassword("123456");

 Group group1 = new Group();
 group1.setGroupName("组一");

 user1.getGroups().add(group1);
 group1.getUsers().add(user1);

 UserDAO userDAO = new UserDAOImpl();
 userDAO.save(user1);

//测试二:删除用户,可以实现删除中间表记录
// UserDAO userDAO = new UserDAOImpl();
// User user1 = userDAO.findUserById(1);
// userDAO.removeUser(user1);

//测试三:删除组,不能删除组,也不会删除中间表相关记录
// GroupDAO groupDAO = new GroupDAOImpl();
// Group group1 = groupDAO.findGroupById(1);
//
// System.out.println(group1);
//
// groupDAO.removeGroup(group1);



Now my difficulty is in the actual development is how to deal with such problems ?
because I can not hbm to manage this relationship , but only manage each corresponding model Tim excision investigation, and then go to their calling in the business layer dao to complete three different functional requirements .
something to do so I was very relaxed , but always felt that this is not contrary to hibernate for learning purposes ?


------ For reference only ---------------------------------- -----



Thank you, I have access to official documents , where you say , understand !
official recommendation : split into two many, most of the time need to connect the table to add additional information.

And this is what prompted my page perplexing question .
At this point, the front solved the same problem !


Do not use exotic association mappings:
Practical test cases for real many-to-many associations are rare. Most of the time you need additional information stored in the "link table". In this case, it is much better to use two one-to-many associations to an intermediate link class. ;. In fact, most associations are one-to-many and many-to-one For this reason, you should proceed cautiously when using any ;. other association style
------ For reference only ------------------------------- --------



Well , thank you, I understand, I previously thought hibernate in addition to help complete object into the database , but also reflected in the hbm possible mutual relationship, and by substituting treatment hibernate .

now, although not express it, but it seems more aware of the point .


============================================== =============
chose this because it finished SSH2 integrate learning , if disarray side processing , write well hbm file , the next step would not be able hbm file as a resource into the spring configuration file.

past six months I have to look for a solution.

more than a year before he wrote a lot of code that can be said for generations .
front from the beginning of writing HTML + CSS + JS start
Later in the maintenance of soft , U8 database SQL SERVER2000
background and then later write ASP code and the kind of language mixing ( to launch late simply pull a body, they did not write my own method modified ) After
PHP and then later saw the video section , starting with a simple MVC pattern to write , but too fragmented (perhaps as a mature language has its own solution , but I did not stick to it ) .
Later that because of the mobile client , write your own copy or imitate a android client to the unit used ( in which the video made ​​strong Java the language ) , due to the presence android client , their scope of work expand again , multilingual maintenance as a person who is largely my burden , but also understand what they do best is to deal with that piece of content.

( front than I'm good , because they belong to a perfectionist , always in front of their own are unable to meet their own doing now want to think, so give up ; database side , then put it crudely , Stuck cases , also so many things ; so that business last block of )

So six months looking at Java tutorial, I locate their position further , try to use other aspects of the mature thing to do instead of their own , after reading the SSH2 integration can be said to be excited , because finally find their focus a .

java web reading serial data problems

Now I have a project need to use : read data from peripherals can scan the bar code , and then displayed in jap page. .


write a separate program that reads , application runs in myeclipse using java, data can be read ,
But once in a servlet , an error occurs. . .
say two words below it . .
portId = CommPortIdentifier.getPortIdentifier ("COM1");
System.out.println (portId.getName ());

put it on when the main function or as a java application running unit tests with Junit do is to find COM1 serial port of the machine, and then print out the name of the serial port , but these two words will appear in the wrong place servlet
java.lang.NoClassDefFoundError: javax / comm / CommPortIdentifier
these words are wrong, why not run in a servlet it? ? ?

want to read on the web to display data how to do ? looking for a day , out of the whole online search is the problem, there is no answer . . . .
I have three files that are copied to the appropriate folder , so the reading of that class can be run as a java application , but would not be placed in the servlet . . . .

or to individual ideas ? ? What other way can read serial data ? ? ?

seeking answers ! ! Thank
------ Solution --------------------------------------- -----

this is the little package.
jar package to the WEB-INF/lib directory of the project.
------ Solution ---------------------------------------- ----
upstairs that right, there is no definition, can not find java.lang.NoClassDefFoundError! Contain the library functions can be
------ Solution --------------------------------- -----------
such a test:
.
1 javax.comm.CommPortIdentifier.getPortIdentifie look at the main function call : each parameter (CommPortIdentifier.java 105) This line of execution
2 in the servlet execution , the same look javax.comm.CommPortIdentifier.getPortIdentifie.: each parameter (CommPortIdentifier.java 105) This line of execution. .

see what's not to like? Remove the cause of the details . .


------ Solution ------------------------------------ --------
http://www.blogjava.net/hgq0011/archive/2007/03/23/105726.html

------ For reference only ---------------------------------- -----

I've tried.
javax.comm.CommPortIdentifier comm.jar package in this class
placed under tomcat 's lib will be given after
javax.comm.NoSuchPortException
at javax.comm.CommPortIdentifier.getPortIdentifie (CommPortIdentifier.java: 105)
this newspaper is no serial port COM1 is definitely yes , but as a java application execution is possible to read the serial port . .
------ For reference only -------------------------------------- -
dynamic link libraries which need it? Canadian system32 directory.
------ For reference only -------------------------------------- -

morning came, and turn on the computer running again in despair , even better - !
really detailed , so fine I do not know why. .
Although I restart the computer yesterday, in addition to such other tomcat, myeclipse are restarted before. . . Engineering republish n times . .

Thank you again , although I do not know Why, but at least it is good. .
Nobody has points ^ _ ^
------ For reference only ------------------------ ---------------

solve this anthology little fake ah. Oh
------ For reference only ------------------------------------- -
LZ hello , I also get the project done java web serial data , but now have no idea , whether pointing or two ?

Android database switching problem

new one , for the first time in the post .
recent idiom guessing game to get hold of the crazy encounter bottlenecks. That is, when the correct answers , and how to the next checkpoint , switch the currently displayed word
------ Solution in the database ------------------ --------------------------

  
  
First off is written out, but got it first off , I do not know how to switch to the second hurdle , update the display font  

font few words written directly to the file , the second hurdle when reading files, update interface
------ For reference only -------------- -------------------------
you this hurdle should not have written it?
------ For reference only -------------------------------------- -
first hurdle is to write out, but got it first off , I do not know how to switch to the second hurdle , updated font
------ For reference only display ------ ---------------------------------



First off is written out, but got it first off , I do not know how to switch to the second hurdle , updated font
------ For reference only display ------ ---------------------------------
you can add what you QQ? I guess the idiom also learning android game , would like to ask some questions about your
------ For reference only ---------------------- -----------------



you can add what you QQ? I guess the idiom also learning android game , would like to ask you some questions

Brother came , helpless to solve


public class SomeThread implements Runnable
{
public void run()
{
System.out.println("sleep...至 not runnable状态");
try
{
Thread.sleep(9999);
}
catch (InterruptedException e)
{
System.out.println("I'm interrupted...");
}
}

public static void main(String[] args)
{
Thread thread = new Thread(new SomeThread());
thread.start();
thread.interrupt();
}
}


main () function in this code :
Thread thread = new Thread (new SomeThread ());
Why someTread This class is not defined yet finished , you can instantiate it?
------ Solution ---------------------------------------- ----
no "definition" finished on the citation does not matter , the key is the time to run the referenced class has been defined over.

here with the C language, you first write a function declaration , then you can use a function definition can be written on the back .

public class SomeThread << equivalent function definition line C , the other code can be directly used SomeThread the symbol with the code which is in what position or not.

------ Solution ------------------------------------ --------
you say that the recursive method not finished defined how it can be called a
------ For reference only - -------------------------------------
class did not have defined referring ?
------ For reference only --------------------------------------- < br> who is with you that there is no fixed definition of finished, this is the definition of an anonymous class
------ For reference only ------------------------------ ---------
same question , defining the mean? Thread class , implements runnable interface can be used
------ For reference only --------------------------- ------------

------ For reference only ---------------------------------- -----
I know you want to ask is how this action occurred in the instance of the body of a class definition .
do not think this is too complicated, ignore the position , do not put yourself go around just fine.
------ For reference only -------------------------------------- -
new SomeThread () has been constructed object. Then passed as a parameter to the function
------ For reference only ------------------------------- --------
variables declared in the storage stack , using the new keyword to create an instance of the heap , but this is an anonymous object is created directly on the heap would be finished , no need to re- stack create , save resources not it
------ For reference only ------------------------------- --------
is a temporary object , the finished thing gc directly recovered
------ For reference only --------------- ------------------------
landlord meant to say it the fifth floor ?
If it is, it seems a dead end , if as you say , so-called ' class declaration finished ', seemingly not so defined , in line with the class declaration , jvm will handle ,
- ---- For reference only ---------------------------------------
anti- Granville Shield encryption, no one has solved , and he tried to decrypt the ways the Internet to no avail. .
------ For reference only -------------------------------------- -
new SomeThread () has new
------ For reference only ------------------ ---------------------
I do not think you understand the operation mechanism of java , after the class finished compiled into bytecode file is . class document , this is what you said defining the class , and when jvm running bytecode files already loaded this . class file class and initialize static variables which something, as if there is a main method on entry procedures execute the statement.
so did not know you did not understand

jsp submit data using FCKeditor individual man garbled


backstage after the written text, the front display is: ATM-QX3000 power lines · micrometeorological online monitoring system line "road " has become a black spot .

Note : to modify a lot of places did not use, such as tomcat 's server.xml in urlencoding is utf-8 is useless , friends help us to see what the problem is .
------ Solution ---------------------------------------- ----
LZ unified with utf-8 format, the fckeditor.js, also use utf-8 encoding mode save a try.
I do not know the default encoding mode is not utf-8
------ For reference only ----------------------- ----------------
recently csdn few people , ah, long time did not see. ? ?
------ For reference only -------------------------------------- -
brother I have encountered , I think it should be a lot of people encounter , ah, how in Baidu and Google almost invisible this problem ah ? ! !
say all right , garbled words , I remember what the " what ", " No " , and so on and so on, this problem can be really interesting in the future, not the overall content garbled , but individual text is garbled , fck these individual words to compile , for example , of what " it " , to compile into "ô" , and quickly solve ah
------ For reference only ------------ ---------------------------
really have not encountered this problem , the landlord can try another version.
------ For reference only -------------------------------------- -
floor
fck do with you now , you can try enter "what" and "future " to see what effect ? ! ! !
------ For reference only -------------------------------------- -

I used, and the future is not garbled . This is what " it " = ô
------ For reference only ---------------------------- -----------
before I use it like a good way to go , then I do not know what the place would not be modified . Fck does not support the latest version of the IE browser .
------ For reference only -------------------------------------- -
latest version of IE support is not very good in IE can not upload pictures, but now the majority of Internet users are using IE, so this problem is solved slowly . Well everyone who has met or know, to help guide the next .
------ For reference only -------------------------------------- -
that is the garbage problem , how do you spread the value of the background , what is js js if it is passed by value plus encodeURIComponent () wrapped about
------ For reference only ---------------------------------------
post by value , not all garbled, individual characters garbled.

------ For reference only ---------------------------------- -----
if it is passed by value plus js encodeURIComponent () wrapped about
------ For reference only -------------- -------------------------
pro, do not say the upstairs , post return value.

------ For reference only ---------------------------------- -----
spread to the background, what sub- code , print to see how !
------ For reference only ---------------- -----------------------
time has passed backstage chaos . ( Individual words garbled ) , which put the first man in the editor input is good, such as ( line ) , you click on the source code, click on the word line of the road came back into the black specks on it. Editor own coding problems. First use is in no way ckeditor4.0, but the new version upload pictures piece , only with Firefox or Google to upload . Injury problems continue to ah.

------ For reference only ---------------------------------- -----
fckeditor default is UTF-8 encoding , and I project using GBK encoding, well before all significant , with a more than a year only to find the problem.


------ For reference only ---------------------------------- -----
LZ best they unite
------ For reference only ----------------------- ----------------
really is no uniform coding problem , only to see today did not bear stickers. Results posted in quickly .
------ For reference only -------------------------------------- -

executorService = Executors.newScheduledThreadPool (1) on a thread of it this way makes sense it?

executorService = Executors.newScheduledThreadPool (1);

above , on one thread only, it is also necessary to use the thread pool , direct new thread and then start not enough , there is the difference? Seeking advice.
------ Solution ---------------------------------------- ----
Note that threads in the pool can be reused , and what new Thread , exhausted gone.

1 ex useful , only one thread can be restricted to work .
------ Solution ---------------------------------------- ----
create threads and destroying threads are the need of time. Performance is not high , read this article
------ For reference only ---------------------------------------
run in the thread pool it may still be safe , and if on a thread, then why open the thread it? In the main thread ran not?

Spring scattered points ! I wish you all the Horse has everything !

bulk of the scattered points , and I wish you a new year all wishes come true and good luck !
------ Solution ---------------------------------------- ----
everyone at home New Year, people lacking, happy New Year !
------ Solution ---------------------------------------- ----


Happy New Year , who said no one came forward to the
------ Solution -------------------------- ------------------
happy New Year , happy New Year friends phone
------ Solution ----------- ---------------------------------
Hey, leaving the front row . 14 years of the first one , oh
------ Solution ---------------------------------- ----------
xinniankuaile
------ Solution - -------------------------------------------
happy Year of the Horse

hey , my kind of hard to force the party has already begun to work. . .
------ Solution ---------------------------------------- ----
happy New Year ah , the landlord is certainly in Beijing now ! ! Haha ! !
------ For reference only -------------------------------------- -
happy New Year ! I wish you a successful career , onward and upward , rolling in money ~ ~

Bs development life can only do CRUD ?

too depressed to work every day are repetitive CRUD
------ Solution ------------------ --------------------------
if the additions and deletions to consider the efficiency and performance , there is a lot of content you can learn. I suggest you start from the basic algorithm.
------ Solution ---------------------------------------- ----
CRUD is the vast number of books in the world system are doing things , this is not your fault
you have to do something very core , the next step is how to do !
want finally , think if thousands , tens of thousands, hundreds of thousands , millions of people online at the same CRUD with you
system , you do not crash is very good !
------ Solution ---------------------------------------- ----
found
You're asking the wrong question, my friend.
Don't blame the CRUD for all the bullshit that is often associated with it.

(Reminder: CRUD stands for Create Retrieve Update Delete, and is the underlying philosophy for the database applications that run the world ; we live in, the 90% of the iceberg that most hackers never see or even think about).

I've been doing CRUD for 33 years and it's been an incredible ride. I credit my CRUD work for putting me in the right hand 5% of that bell curve, ahead of the rest of my fellow hackers who have built so little of substance.

Sure, I've built apps that move people and things to the right place, and also have done a lot of "reports here, manage documents here, upgrade calender software here", but what job doesn't have some crap work go to along ;? with the gravy I've never seen any good job without it's share of maintenance, refactoring, testing, process, and meetings ; with drones.

I've also build software that generates other software, invented new frameworks, and devised algorithms that dramatically improved the way we make and build and move the stuff that's probably in your cubicle right now. I've taken cool academic theory from my pure mathematical background to build software that has blown away the posers everywhere around me. And you know what? You do that just once, and every champion in the enterprise runs to you with their giant budgets to solve their CRUD problem du jour with your "genius".

Believe me, you don't have to work at "Intel, Google, Apple, or NASA" to "change the world ". You're just as likely to be a cog in the wheel at those places as anywhere else.

You can change the world from where ever you're at, and in fact, if you're working on a CRUD app, I think you're actually in a better position to do it. You just have to ask a better question.

My suggestion: "How to you escape the shackles and bullshit of your CRUD job and use all those great resources in your head to turn that job on its side and change the world from right where you're at? "

Find the answer to that question. It may be easier than you think.


------ Solution ------------------------------------ --------
upstairs positive solution. Ide light to do the windows platform to put forward what's it mean to you CRUD
1 have time to study under the data structures and algorithms , try them with C / Java to write out
doing development , the most important algorithms
If you only do something with API jdk provided , the road will be very narrow

2 put java programming ideas read , write code , which allows a more solid basis for Java
3 look at the book Design Patterns , many companies are now asking those who love stuff

4 can take your technology involved in-depth understanding of the next

5 see Linux book, as a programmer is not a senior Linux unskilled

6 to see a high-performance , distributed Hadoop cloud computing cluster continuous integration , etc.

7 at least learn a scripting language , outside of Shell, you can look at Python. Many large cattle use it to write gadgets

PS: Java programmers to engage in a solid first base or the most important.
PPS: BS development , then the front end is very important , javascript cattle fork with people who would be a good mix of yo , after all, most companies do not have a dedicated team of JS





------ For reference only ---------------------------------- -----
with no meaning ah
------ For reference only ---------------------------------------
do you have any fun seeking to share ah
------ For reference only ---------------------------------------
-. - Looks like a lot of other things
------ For reference only ---------------------------------------
country can ask Taobao, Baidu classmates and see what they're doing . explore Perspective
------ For reference only ------------------------- --------------
Unfortunately , there is no
------ For reference only ------------------ ---------------------
have ah, because your business is too simple bar
If you could be a BS OA system , called for the document to have a server management
documents such as OA Well certainly missed
then ask for a variety of common document formats, such as : doc, pdf, txt, html can be full-text search
you consider how to achieve it with BS
------ For reference only ------------------------- --------------
dare to ask the landlord to repeat some time.
------ For reference only -------------------------------------- -
half a year , but can not see the direction
------ For reference only ------------------------- --------------
  The reply was deleted administrator at 2014-01-18 10:30:31

------ For reference only ---------------------------------- -----
white questions : what is BS?
------ For reference only -------------------------------------- -
yourself looking for something to learn .
------ For reference only -------------------------------------- -
[
BS is despised
------ For reference only ------------------------------- --------
indeed, I have done a long time CRUD , and do enterprise-class applications , inevitably operate the database , it needs to CRUD,
------ For reference only ---------------------------------------
Thank you , I have a feeling find their own things to learn
------ For reference only ---------------------------------- -----

------ For reference only ---------------------------------------

If you can do the amount of data on a million CRUD , all companies will be paying you .
------ For reference only -------------------------------------- -



you happy?
------ For reference to mention only ---------------------------------------
CRUD is a portal system website also CRUD. The key is that you do CRUD on how well , if the amount of data on a million CRUD, your system can run steadily , then it is very good.
------ For reference only -------------------------------------- -
addition to CRUD, without some details of things ? Such as interactive front interface and background , and some puzzle solving
------ For reference only -------------------------- -------------
you wait , I see if I can find , the last on a foreign forum , someone also said your words, not to spray too . . .
------ For reference only -------------------------------------- -
not the four core operation . Downstairs say what ?
------ For reference only -------------------------------------- -
do CRUD year of drifting ~ ~
------ For reference only ---------------------------------------
drifting brother joined the line , I do not know what is the way ah !
------ For reference only -------------------------------------- -
now you definitely not six months ago you
------ For reference only ------------------------- --------------
because you know less ! ! ! bs I did a year ago , cs also almost a year, had little contact with CRUD ! ! ! I write only logical business !!!
------ For reference only ------------------------------- --------
all businesses need to deal with data that help users to manage data. Of course, some other functions , but it is also the main data . That data is CRUD , SQL so many years of data operations are still only INSERT, DELETE, UPDATE, SELECT. All data are based on the system as a basis . Regardless of uploading and downloading , importing and exporting , including opening PDF, DOC and other documents , and so on ... that does not require data to support it? So do not blame only the CRUD, because those are the core of the system of things. C / S structure is not also one of those thing. Your long way to go , come slowly . If you feel depressed now , I suggest you wrap it.
------ For reference only -------------------------------------- -
have no need CRUD work, such as game development, some of the client software development. . .
------ For reference only -------------------------------------- -
this is not bs cs thing is to abstract information processing , if these four simple operation running again, not an easy thing
------ For reference only - -------------------------------------
learn about design patterns Well , most oa system are like , how to melt into your design ideas you need to learn is just how long do mechanical crud • • • • • •
------ For reference only ----- ----------------------------------

head , all the business logic from not open this four .
someone said above , I only do business , you do not need to use the four operations to achieve ?
------ For reference only -------------------------------------- -

i cant understand all, but i know he says CRUD is an important thing which can even be the center of the world.
------ For reference only ---------------------------------------
perfect!
------ For reference only -------------------------------------- -
landlord can only say that the system is too simple to do , and almost a graduate -level design
Or your boss everything good design , you charge only when the role of a Muppets
------ For reference only ------------- --------------------------
is that programming with the outside world as exciting world . Like you think that person's life , just as eating and sleeping . Funny
------ For reference only ------------------------------------- -
still a lot to learn it, that did not change direction on ideas, learn linux, data structures, algorithms that.
------ For reference only -------------------------------------- -
If you want to be a senior , you want to be thorough grasp of things , things will be a multi- enough job of . Programmers to learn things too much, just a programmer CRUD Zhaomaohuahu early journey.
------ For reference only -------------------------------------- -
12306 CRUD not also do , so magical a site in CRUD what we have to say it

L scattered points

finally has a small star , and rushed for so long easy, thanks to the support of the Friends of the altar you !
------ Solution ---------------------------------------- ----
top, the way the next day to complete the task replies .
------ Solution ---------------------------------------- ----
support Ah , I've been inexplicably deducted a bunch of points, and have not washed after the star power of
------ Solution ---------- ----------------------------------
Congratulations technology advances .
------ Solution - -------------------------------------------
Kung Hei Fat Choy , red envelopes there is not ?
------ Solution ---------------------------------------- ----
Congratulations ~ ~
------ Solution ----------------------------- ---------------
Congratulations entered star
------ Solution ------------------ --------------------------
Congratulations , you're still stuck
------ Solution ---- ----------------------------------------
Congratulations
I'm not washed up a year ago , after only wait continued his efforts.
------ Solution --------------------------------------------
Congratulations , csdn upgrade how liter Yeah ?
------ Solution ---------------------------------------- ----
four stars in the effort.
------ Solution - -------------------------------------------
top ah ; see posts do not return is not a good habit ah
------ Solution ---------------------------- ----------------
Congratulations
------ Solution - -------------------------------------------
Congratulations ah. A star passing
------ Solution ----------------------------------- ---------
stickers will look the way I have a few heart. .
------ Solution ---------------------------------------- ----

points can also be deducted Yeah ?
------ Solution ---------------------------------------- ----
you say you want to escape , but why are doomed to settled .
------ Solution - -------------------------------------------

------ Solution ----- ---------------------------------------
congratulations
------ Solution - -------------------------------------------
Congratulations Congratulations ah ah
------ Solution ---------------------------------------- ----
Congratulations great God
------ Solution - -------------------------------------------
Congratulations , we also wearing pants too!
------ Solution ---------------------------------------- ----
Congratulations ah , hoping to stick to it , oh !
------ Solution ---------------------------------------- ----

- ----- Solution --------------------------------------------

Congratulations
------ Solution ----------------------------------- ---------

------ Solution --------------------------------------- -----
points the way to pick up Star efforts
------ Solution - -------------------------------------------

------ Solution ----- ---------------------------------------
Congratulations , then points !
------ For reference only -------------------------------------- -

points can also be deducted Yeah ?   Technical area has managed to score in the post moved to non-technical area , was penalized a
------ For reference only ---------------------------------------
Congratulations ~ ~ good man ! !

JAVA and sentiment analysis

graduation design done on sentiment analysis , such as: the input sentence , judgment or criticism praised . Experts who have nothing to disclose what information and technology ?
------ Solution - -------------------------------------------
this a bit difficult, first word , then estimated to be combined with contextual semantics. . .
------ Solution ---------------------------------------- ----
this idea I have is for the landlord reference : Get the input string , and then parse the string , and then create a string array , the array included all the words used to describe the mood of people , word , phrase , and then provide an array of strings each string and input is compared to criticize or judge praised ...
------ Solution ---------- ----------------------------------
the whole into a thesaurus related words starting treatment ah
------ Solution ------------------------------------------ -
thesaurus does have to have it, a simple method is to give each word and the word given different positive and negative values ​​( expressed emotion )
------ For reference only ---- -----------------------------------
  The reply was deleted administrator at 2013-03-19 09:55:04

------ For reference only ---------------------------------- -----
really need to do this thesaurus , the Internet and look it ,
------ For reference only ------------------ ---------------------
it, in which to get hold of the database to determine the thesaurus . This should be no problem
------ For reference only ---------------------------------- -----
impossible to be completely accurate , this is the difference between humans and computers. Of course, these can only say at the time of reply . Come on . You can also go directly Baidu input word , and then returned to find Baidu parsing and analysis. This is also a way to Kazakhstan.
------ For reference only -------------------------------------- -
I also do this, we can explore to explore each other . Currently I have achieved based on the emotional part of Naive Bayesian analysis , but the analysis is poor, still thinking of ways to improve .
------ For reference only -------------------------------------- -


accuracy analysis about how much? I am also an issue of positive and negative sentiment analysis determined that the Internet to find some open source framework for Chinese support is not very good . Now want to write a sentiment analysis program that can give me some advice?