Fix the bug (halfway down the pit, almost out of control, later perfect knife)

Source: Internet
Author: User

Just take over the project left some bugs, is a Word document, one by one slowly solve it;

Start with the simple, look for the feeling;

BUG: Exported Word document is garbled (<=b>, <=:p >);

The way to build a Word document is to have 3 template files, which dynamically replace the title and content when generated;

3 files are placed under a directory in the Classpath;

Does not do the cache, each time the realtime IO reads the file, here can optimize;

The problem may be 3 files encoded, manually changed to try;

Change to code inside write GBK;

Retry, no effect;

Modify the file, really is more characters, a lot of low-level errors;

OK, solved, this bug took 40 minutes;

Find another bug, also exported word garbled, and resolved;

There is a new version of information and system description information page requirements;

is to write a about page;

The style of the project is hard-coded, write a static page can be;

Try to write a JSP, found that the left navigation does not come;

Copy a similar page, do subtraction slowly tune;

BUG: Gantt Chart interface shows blank;

Found print a lot of SQL log, is the Logback, the level changed to warn;

<logger name="Org.apache.ibatis.jdbc.ScriptRunner" level="WARN"/>

<logger name="org.activiti.engine.impl.persistence.entity" level="WARN"/>

<logger name="java.sql.Connection" level="WARN"/>

<logger name="java.sql.Statement" level="WARN"/>

<logger name="java.sql.PreparedStatement" level="WARN"/>

<logger name="Java.sql.ResultSet" level="WARN"/>

Can you set a property like Pom.xml, reference it, do not have to change all manually;

OK:

<property name="Ibatislevel" value="WARN" />

Behind references:

<logger name="Org.apache.ibatis.jdbc.ScriptRunner" level="${ibatislevel}"/>

Console.log very useful, methods can be printed out;

The Jsgantt is used here;

Found not finished here, the dynamic task is not processed;

The official website Example http://www.jsgantt.com/#tExamples, can show:

change to dynamic;

Computer card out of Xiang, just 4g! Want to take home spare memory bar to plug it;

This old JS frame changed to dynamic is still a bit difficult;

can only use <%%> block, with El foreach not;

Here is a trick is to write in the <%%> write Java code, eclipse if not prompted, first in the Java code inside to write and then copy into the JSP inside modify;

NM, this sort of anti-human field, pits me a piece;

Some companies want to recruit to write reliable code of the person, but how to find in the process of the interview, it is quite difficult to think about, some people half a bucket of water especially can say, but most of the technical staff will not boast, they know the limitations of technology, there is no perfect technology, no perfect frame, a sentence can be said clearly?

Obviously I will not blow, this is not still writing code now?

But by conscience, not disgusting design and code is the basic requirements, I have more quality requirements, are details, interview and do not know how to say the export;

The last time by a NB smelling of the special sales site of the technical manager, he said with disdain: "I recruit a 2 years of experience and you have what difference?" I speechless;

Say more is a tear;

Keep on working;

The last code that comes out is:

<%new SimpleDateFormat ("mm/dd/yyyy"); if (Tasks.size () > 0) {    = tasks.iterator ();      while (Iterator.hasnext ()) {        = (Task) Iterator.next ();        Out.println ("G.addtaskitem" ("New Jsgantt.taskitem" ("+task.getid () +", ' "+task.getname () +" ', ' "+df.format ( Task.getactual_starttime ()) + "', '" +Df.format (Task.getactual_endtime ())                + "', '" +task.getcolor () + " ', ', 0, ', ' +task.getstage () + ', 0)); );    }} %>

Removed the official website example behind the several parameters;

2015/4/23

Bug: Upload multiple attachments, if the attachment has the same name, error;

Press the Submit button is a GET request, odd strange;

Company computer all kinds of optimization is card ah, memory is too small mishap ah;

The set inside checks for an algorithm that has no duplicate elements, and is used to check for duplicate attachments;

list<string> list =NewArraylist<string>(); List.add ("F1"); List.add ("F6"); List.add ("F2"); List.add ("F3"); List.add ("F4"); List.add ("F3"); Collection<String> cols =NewCopyonwritearraylist<string>(list);inti = 1; for(String string:cols) {Cols.remove (string); if(Cols.contains (String)) {System.out.println ("I=" + i + ", value=" +string);  Break; } I++;}

The first time you write this, do not know how performance? An attachment is certainly not much, temporarily do not consider the performance problem;

Here the business layer logic is a bit of a problem, now the logic is to submit a form, complete data entry, submit things, and then upload attachments;

Should I upload an attachment first?

Bug:ie compatibility Mode, button dislocation, chrome is normal;

Add some div to solve it;

There is a performance problem: Import records of the card Dayton;

The analysis may be a lot of times when the batch is not inserted, but the loop is inserted separately;

for (Fundrecord fundrecord:list) {

Fundrecordrepository.save (Fundrecord);

}

You should instead:

Wrote a test case to process 100 data;

@Test Public voidAddbatch () {LongBegin =System.currenttimemillis (); ArrayList<FundRecord> list =NewArraylist<fundrecord>(); Fundplan Fundplan=NewFundplan (); Fundplan.setid (11L); UserInfo UserInfo=NewUserInfo (); Userinfo.setid (100L); Userinfo.setusername ("UserName");  for(inti = 0; I < 100; i++) {Fundrecord Fundrecord=NewFundrecord ();            Fundrecord.setfundplan (Fundplan); Fundrecord.setrecordfund (i+ ""); Fundrecord.setremark ("Re");            Fundrecord.setcreator (UserInfo);            Fundrecord.setapplicant (UserInfo);        List.add (Fundrecord); }        //Fundrecordrepository.save (list);         for(Fundrecord fundrecord:list) {fundrecordrepository.save (Fundrecord); }                LongEnd =System.currenttimemillis (); System.out.println ("Total:" + (End-begin)); }

The For Loop takes 5960 milliseconds:

The batch method takes 396 milliseconds;

Difference 10 times;

When testing, if the local environment and the test environment database inconsistent, you can synchronize;

Use Sourcetree each time to open the prompt: (detailed solution can refer to Baidu experience)

Sourcetree is loading your SSH key to the agent for authentication

Please enter your passphrase if prompted

Previously in other computers when the first set up will not be prompted, the computer just installed what is the matter?

Although it is possible to press ENTER, it is still a bit uncomfortable;

http://www.sourcetreeapp.com/faq/

Official online seems to have the answer;

Point of no response;

Download Putty-gen.exe

Http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Load

Then click on the button save private key;

Tools-add SSH keys;

Select the file you just generated;

Summarize:

1, first use experience to solve the problem, verify it, no more try another method;

2, performance testing is an experimental science, not to experiment by guessing is not reliable;

Fix the bug (halfway down the pit, almost out of control, later perfect knife)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.