Posts
 
Reputation
Joined
Last Seen
Ranked #2K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
~14.2K People Reached
Favorite Tags
Member Avatar for albertkao

How to display text string with Javascript on screen? This is my test page: [CODE]<html> test <script type="text/javascript"> docwrite(1); document.write('hi'); docwrite('hello'); </script> docwrite(2); <script type="text/javascript"> function docwrite(x) { document.write(x); } </script> </html> [/CODE] I saw only "test docwrite(2);". I want to see "test 1 hi hello docwrite(2);" with " 1 …

Member Avatar for priakant
0
3K
Member Avatar for albertkao

This SQL operation will get the desired Proposal_ID. [CODE]SELECT P.Proposal_ID, AVG(c.Task_Good_Idea) AS Average FROM proposals P, proposal_appraisal c LEFT OUTER JOIN users b ON (c.Evaluator_ID = b.User_ID) LEFT OUTER JOIN submission_status d ON (c.Primary_Evaluation_Status_ID = d.submission_status_ID) WHERE (P.Proposal_ID = c.Proposal_ID) AND P.Proposal_ID >= 931 AND d.Submission_Status_ID = 2 GROUP BY …

Member Avatar for hielo
0
97
Member Avatar for albertkao

Given the following two SQL operations: [CODE]select prod_Id, P.proposal_id, P.institution_Name from proposals P group by P.proposal_ID having mark >= 50 order by P.proposal_id desc select prod_id, P.proposal_id, PA.evaluator_ID, U.user_Given_Name, U.user_surname from users U, proposals P LEFT outer JOIN proposal_appraisal PA ON (P.proposal_Id = PA.proposal_id) where PA.evaluator_ID = U.user_id group by …

Member Avatar for d5e5
0
93
Member Avatar for albertkao

How to calculate an average and use that average to select some data? e.g. for this query and its result. [CODE]select Proposal_ID, Mark, AVG(Mark) AS Average from proposal where (Proposal_ID >= 931) GROUP BY Proposal_ID 931 20 22.2222 935 30 22.2222 936 30 21.1111 967 30 25.5556 968 30 20.0000 …

Member Avatar for smantscheff
0
109
Member Avatar for albertkao

I print the following webpage with Firefox & Chrome: [url]http://en.wikipedia.org/wiki/Final_(Java[/url]) Both hardcopies of the long line "public static final double PI = 3.141592653589793; // this is essentially a constant" is cut off. i.e. the line does not wrap around. Both Firefox & Chrome display that line on screen in one …

0
50
Member Avatar for WASDted

DaniWeb plans to interview Bjarne Stroustrup, the designer and original implementer of C++ and the author of many books on C++. This is truly a treat and rare opportunity for us as a community to talk to the father of C++. As the new editor-in-chief of DaniWeb's News and Reviews …

Member Avatar for AuburnMathTutor
2
705
Member Avatar for albertkao

I want to optimize the following small integer program in speed. My g++ compiler version is 4.3.4 on 32 bit linux. Please suggest or comment the following ideas. Some ideas are: 1. use compile flag such as -O3 2. rewrite the bigger function with function object [CODE]#include <algorithm> #include <cstdlib> …

Member Avatar for Rajesh R Subram
0
105
Member Avatar for albertkao

Pressing the enter key of the following page (created by JSP) submit page more than once. Both alert popup boxes appear as expected: alert('i ' + i + ' elem[i].checked ' + elem[i].checked); alert('alarmgroup ' + alarmgroup + ' rowsPerPage ' + rowsPerPage); appear. However, then this alert appear again, …

Member Avatar for fxm
0
151
Member Avatar for albertkao

Pressing the enter key at the jsp page receive extra invalid data at the ProdController.java. The alertgroupStr receive "unack" as expected. However, I do not understand why alertgroupStr receive the extra invalid "null" later. Debug log: 11:14:52,187 DEBUG com.systems.monitoring.war.ProdController:54 - alertgroupStr unack ... 11:14:52,187 DEBUG com.systems.monitoring.war.ProdController:54 - alertgroupStr null ProdController.java: …

0
88
Member Avatar for albertkao

My javascript function setHw is not called by pressing the return key in all of the following pages. Please help. [CODE]<div id="rowPerPageDiv"> <form name="tagform" action="Hw.htm" method="post"> <input type="hidden" name="currPage" value="0"/> Rows Per Page<input type="text" name="rowsPerPage" id="rowsPerPage" value="20" onsubmit="return setHw()"/> <input type="button" value="Apply" onClick="setHw()"><br> </form> </div>[/CODE] [CODE]<div id="rowPerPageDiv"> <form name="tagform"> <input …

Member Avatar for rajarajan2017
0
107
Member Avatar for albertkao

I want to implement JavaScript Internationalization. However, JavaScript does not have the property file mechanism (which is available in Java). I am thinking of using the Java property file mechanism in Javascript. Is it possible? I had implemented Java Internationalization with the Spring framework message. e.g. [CODE]<spring:message code="menu.administration"/>[/CODE] How do …

0
64
Member Avatar for albertkao

My program should display '*' when entering a password to a text box by a user. How to do that?

Member Avatar for thalz
0
77
Member Avatar for albertkao

How do I recursively remove all the directories and files which begin with '.'? My test program rmdir.py does not do the job yet. Please help. Code: #!c:/Python31/python.exe -u import os from shutil import * root = "C:\\test\\com.comp.hw.prod.proj.war\\bin" for curdir, dirs, files in os.walk(root): print (curdir) print (dirs) for d …

Member Avatar for sergb
0
185
Member Avatar for albertkao

I want to walk a directory and ignore all the files or directories which names begin in '.' (e.g. '.svn'). Then I will process all the files. My test program walknodot.py does not do the job yet. Please help. [CODE]#!c:/Python31/python.exe -u import os path = "C:\\test\\com.comp.hw.prod.proj.war\\bin" for dirpath, dirs, files …

Member Avatar for jice
0
3K
Member Avatar for albertkao

I want to call a C++ program from PHP with apache server on Fedora 12 linux. testprog is put in the same directory of the test php program. I see the output of exec('ls -lrt') but not exec("testprog"). Please help. The following are my php and cpp test programs. [CODE]<html> …

Member Avatar for mutirelover
0
2K
Member Avatar for albertkao

How to recursively walk directory & rename files & directories with Python 3.1 on windows? [CODE]#!c:/Python31/python.exe -u import os path = "test" for (path, dirs, files) in os.walk(path): print (path) print ("-----------------") if "monitoring" in path: dst = path.replace("monitoring", "managing", 10) print (dst) os.rename(path, dst) print ("path----") for file in …

Member Avatar for griswolf
0
2K
Member Avatar for albertkao

The group button in my form is set to "unack". The Spring HwController receive the correct group "unack" when the "apply" button is clicked. However, the HwController receive the null group when the cursor is moved to the text box and press the <Enter> key. Only the data from the …

Member Avatar for albertkao
0
216
Member Avatar for albertkao

My controller.java encounter an input string: "undefined". Please help. [CODE]public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { int rowsPerPage = 20; String rowsPerPageStr = request.getParameter("rowsPerPage"); logger.info("rowsPerPageStr " + rowsPerPageStr); if (rowsPerPageStr != null) { rowsPerPage = Integer.parseInt(rowsPerPageStr); }[/CODE] My jsp page use javascript as follows: [CODE]window.location = "hwdisplay?rowsPerPage=" + …

Member Avatar for javaAddict
0
418
Member Avatar for albertkao

I want to keep the value of the user input (e.g. text box value) displayed after page refresh by a javascript. The following test web page is used. The alerts appear before and after the page refresh as expected on all browsers (FF, Chrome, Opera & IE). The input value …

Member Avatar for albertkao
0
161
Member Avatar for albertkao

How to store variables in the jsp page scope with the spring 2.5.x framework? This has compile errors. [CODE]import javax.servlet.jsp.PageContext; @Override public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception { PageContext pageContext; Object o = pageContext.getAttribute("com.mycompany.pageId");[/CODE] Description Resource Path Location Type The local variable pageContext may not have been initialized …

Member Avatar for albertkao
0
119
Member Avatar for albertkao

Why the following code has the error: 'document.mainform.unknownHw' is null or not an object? function setUnknownHw(unknownHw) { document.mainform.unknownHw.checked = unknownHw; } <div class="special"> <form name="mainform" id="mainform" action="display.htm" method="post"> <br><br><input type="checkbox" name="unknownHw" onClick="setdbUnknownHw(this)">Unknown Hw <input type="submit" value="Apply" onClick="setdbRowsPerPage()"><br> </form> </div>

Member Avatar for almostbob
0
279
Member Avatar for albertkao

How to use "c:if" to test for the boolean true? These does not work: [CODE]<c:if test="${model.value == 'true' }"> <c:if test="${model.value == "true" }"> <c:if test="${model.value == true }">[/CODE]

Member Avatar for albertkao
0
138
Member Avatar for albertkao

After the apply button is clicked, the data entered by the user disappeared in the text form. How to keep the data appearing on the text form? The server use jsp and the Spring framework and the client use the Prototype javascript library.

Member Avatar for Airshow
0
101
Member Avatar for albertkao

I like to have a sleep or delay function in javascript. The Prototype library 1.6.1 has a delay function. It is working well in Firefox or Chrome but not IE 7 on windows XP. Please help (I cannot use newer version of windows). [CODE]function sleep() { } sleep.delay(0.1);[/CODE]

0
73
Member Avatar for albertkao

To ensure my program keep the client preference after page refresh, do I do this: [CODE]var value = Cookie.get('key'); if (value == null) { // get the client preference // ... // save the client preference Cookie.set('key', 'uservalue'); } // use the client preference[/CODE]

0
66
Member Avatar for albertkao

My table columns are sorted by the Tablekit library (millstream.com.au/upload/code/tablekit/). The user can click the columns to toggle the sort order either ascendingly or descendingly. I can save the current sort order (preference) in the server. After the page is refreshed, the web page is sorted by the original sort …

0
73
Member Avatar for albertkao

After clicking the checkbox, I like to get the value of the checkbox submitted. Why the following page always get the value "20" for checkboxChoice and checkboxvalue no matter which checkbox I clicked? Please help. [CODE] <tr> <td> <div class='fg1'> <input type="checkbox" name="checkboxChoice" value="20" checked onclick="submit()"> Choice </div> <input type="hidden" …

Member Avatar for Airshow
0
116
Member Avatar for albertkao

How to store some strings at the client side for firefox, chrome & IE? This code works on firefox & chrome but does not work on IE - no alert window appears. [CODE] var key = "localorder"; localStorage.setItem(key, 'asc'); alert('localorder ' + localStorage.getItem(key)); [/CODE] This code does not work on …

Member Avatar for Airshow
0
73
Member Avatar for albertkao

I use the Tablekit library and Prototype javascript framework on firefox, chrome & IE8. The columns in this table can be sorted by the Tablekit library. [CODE]<script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript" src="js/tablekit.js"></script> <body> <div id="mainmenu"> ... </div> <div id="content"> <table class="sortable resizable"> <thead><tr> <th class="sortfirstdesc">ID</th> <th>Date</th> <th>Time</th> </tr></thead> </table> </div> …

Member Avatar for Airshow
0
356
Member Avatar for albertkao

I want to set the value to <td><div class='urg5'>High</div></td> in JTSL. [CODE]I tried <c:set var="ack" value="<div class='urg5'>High</div>"/> <c:out value="${ack}"/> Page source of the JSP web page is &lt;div class=&#039;urg5&#039;&gt;High&lt;/div&gt;</td> i.e. special characters appear. instead of <div class='urg5'>High</div>[/CODE]

Member Avatar for albertkao
0
87