Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
13% Quality Score
Upvotes Received
1
Posts with Upvotes
1
Upvoting Members
1
Downvotes Received
12
Posts with Downvotes
4
Downvoting Members
11
1 Commented Post
0 Endorsements
~42.7K People Reached
Favorite Tags

141 Posted Topics

Member Avatar for johndoe444

Here is the code copied from w3schools ([url]http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_suggest):[/url] [CODE]<html> <head> <script type="text/javascript"> function showHint(str) { if (str.length==0) { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4) { …

Member Avatar for bharathivkmani
0
12K
Member Avatar for johndoe444

Hi, I wrote this code as is from the JNDI tutorial from sun website. But I am getting this exception while running it: [CODE]import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import java.util.*; /** * Write a description of class FirstJndi here. * * @author (your name) * @version (a version number …

Member Avatar for PoonamV
0
1K
Member Avatar for johndoe444

Hello, I wanted to see whether 2 directories are identical in terms of content. So what I did was tar the directories and then md5sum-ed them and then compare but the hashes were not identical. I tried to go inside each directory and md5sum-ed each file of each directory and …

Member Avatar for johndoe444
0
111
Member Avatar for johndoe444

In my office I have two machines connected two networks - one has IP say 21..... and another has IP say 25... Now the thing is that both of the machines can access Internet. But there is a problem pinging among each other. I have been told that has been …

Member Avatar for the_carpenter
0
158
Member Avatar for johndoe444

In the J2EE tutorial from sum site, it is often mentioned this term. For example, the timersession example: "Because it's a business method, setTimer is exposed to the local, no-interface view of TimerSessionBean and can be invoked by the client." Thanks.

Member Avatar for swosh
0
157
Member Avatar for johndoe444

Hi, This is more generic actually. In nunit tests we want to refer to the original project classes. Now if the test classes are under the project directory as in the original source code then they might import the namespace of the source code through 'using'. But then the problem …

0
62
Member Avatar for johndoe444

These two seems to be doing the same kind of thing. What is the difference here? Thanks

0
57
Member Avatar for johndoe444

I have this question. Why do we need flyweight design pattern when we can accomplish the same thing using static variables. The static variable (of a designated class for storing global states) can be used to save states dynamically and which can be accessed by different objects anywhere and anytime. …

Member Avatar for Rashakil Fol
0
105
Member Avatar for johndoe444

I was wondering how we can build a remote application where the user interface created using windows form will be running at the client side and the application logic will be running in server side. Sort of like web application but the user interface would be running in stand alone …

0
72
Member Avatar for johndoe444

Why would we need the director pattern? The builder can itself execute the whole construction process instead of going through the director. [CODE] class Pizza { private String dough = ""; private String sauce = ""; private String topping = ""; public static abstract class Builder { private Pizza pizza; …

Member Avatar for Rashakil Fol
0
173
Member Avatar for johndoe444

If class A has a virtual method and then class B which is subclasses A, overrides that method. Then class C subclasses B. So now C is supposed to inherit B's overriden method, and not A's virtual method. Then if C wants to override B's one it can't because B's …

Member Avatar for Zinderin
0
168
Member Avatar for johndoe444

They listed the design patterns in their book. But did they really invent the design patterns or summarized the works of others in their book? If the later is true then why are they called GOF patterns which credits them for others works?

Member Avatar for pritaeas
0
85
Member Avatar for johndoe444

The syntax seems mysterious. Please help here. [CODE]int? count = (from cartItems in storeDB.Carts where cartItems.CartId == shoppingCartId select (int?)cartItems.Count).Sum(); return count ?? 0;[/CODE] Thanks

Member Avatar for Geekitygeek
0
161
Member Avatar for johndoe444

In the following: [CODE]public ActionResult Index() { // Create a list of genres var genres = new List<string> {"Rock", "Jazz", "Country", "Pop", "Disco" }; // Create our view model var viewModel = new StoreIndexViewModel { NumberOfGenres = genres.Count(), Genres = genres }; return View(viewModel); }[/CODE] Why was var genres and …

Member Avatar for Geekitygeek
0
115
Member Avatar for johndoe444

Hi, I came across this code snippet: [CODE]new { genre = genreName }[/CODE] I am not sure what is the name of this thing and how this thing works? Thanks

Member Avatar for kvprajapati
0
100
Member Avatar for johndoe444
Member Avatar for johndoe444

Why do we use formCollection? Why can't we just use Request.QueryString instead? Thanks

0
69
Member Avatar for johndoe444

In the add view dialog there is a field called view content. what is the purpose of this field?

0
60
Member Avatar for johndoe444

I created a php script: [ICODE]#!/usr/local/bin/php <html><head><title>PHP Test</title></head> <body> <?php print( "Hello World<br />"); ?> </body></html> [/ICODE] created an htacces file [ICODE]AddHandler cgi-script .php DirectoryIndex index.html index.php [/ICODE] changed the permission [ICODE]chmod 711 hello.php chmod 644 htaccess [/ICODE] This does not work: [url]http://xyz/~username/hello.php[/url] By making the hello.php to hello.txt the …

Member Avatar for itanum
0
346
Member Avatar for johndoe444

Hi, In j2ee web application, an web application is packaged with deployment descriptor web.xml in war (zipped) format. And then the application is deployed to the web application server so that the server can communicate with the outside world. Now for asp.net the application has to be deployed to the …

0
64
Member Avatar for johndoe444

I wrote this basic web app using jsf. My templates were jsp not jsf. And in the faces-config.xml and everywhere else I used jsp and nowhere I used jsf. But surprisingly it (the servlet container) is being able to correctly locate the thing (jsf files) it is looking for. How …

0
84
Member Avatar for johndoe444

hi, In this example: [CODE]public void init() throws ServletException { bookDB = (BookDBAO) getServletContext() .getAttribute("bookDB"); if (bookDB == null) { throw new UnavailableException("Couldn't get database."); } }[/CODE] As it is not instantiating the BookDBAO instance and the connection with entity manager is done in the constructor: [CODE] public class BookDBAO …

Member Avatar for johndoe444
0
100
Member Avatar for johndoe444

I have experience and knowledge in java web application development. How similar is asp.net and c#? How long would it take to master c# and asp.net? If I want to prepare for interview in c#/asp.net. Is it possible to prepare without having any experience? What would be the strategy for …

0
76
Member Avatar for johndoe444

I just used: ant ant deploy and it gave me following error: [code=text] deploy: [echo] localhost [echo] 8080 [echo] order [echo] C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\bp-project\ma in.xml/../../../../../../bin/asadmin.bat [echo] order [echo] SQL92 [exec] Deprecated syntax, instead use: [exec] asadmin --port 4848 --host localhost deploy [options] ... [exec] com.sun.enterprise.admin.cli.CommandException: remote failure: Excep tion while loading the …

Member Avatar for ~s.o.s~
0
312
Member Avatar for johndoe444

Hi, I tried to deploy the books example. But in the deploy descriptor it says: [CODE]<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>books</display-name> <listener> <listener-class>com.sun.books.listeners.ContextListener</listener-class> </listener> <servlet> <display-name>books</display-name> <servlet-name>books</servlet-name> <jsp-file>/books.jspx</jsp-file> </servlet> <jsp-config> <jsp-property-group> <display-name>books</display-name> <url-pattern>*.jspx</url-pattern> <el-ignored>false</el-ignored> <scripting-invalid>false</scripting-invalid> <is-xml>true</is-xml> </jsp-property-group> </jsp-config> </web-app>[/CODE] The only jspx file is books.jspx. After the application is …

0
75
Member Avatar for johndoe444

Hi, I was trying to j2ee web service example helloservice. When I was building the simpleclient I got the error: [CODE]wsimport-client-generate-nosecure: wsimport-client-generate-nojvmargs: [echo] C:\glassfishv3\glassfish\docs\javaee-tutorial\examples\bp-project\ma in.xml/../../../../../../glassfish/lib/endorsed [echo] helloservice.endpoint [echo] build/generated/wsimport/client [echo] build/jar [echo] http://localhost:8080/helloservice/HelloService?WSDL [wsimport] Consider using <depends>/<produces> so that wsimport won't do unnece ssary compilation [wsimport] JDK's tools.jar was not …

Member Avatar for peter_budo
0
215
Member Avatar for johndoe444

Hi, I thought I have mastered fighting segmentation fault thanks to the assistance of you guys. But still in this days I am getting seg fault. And there is no clue at all. I am writing a suffix tree using a trie. Here is the trace of segmentation fault: [CODE]aba …

Member Avatar for UncleLeroy
0
147
Member Avatar for johndoe444

[CODE]set_child_at (node=0x7fffffffe080, child=0x61e250, index=1) at 10679.c:319 319 if ((*node)->count_children == (*node)->m) (gdb) p *current_node $3 = (trie_node *) 0x0 (gdb) n 324 index = hash_insert((*node)->hv, index, (*node)->m, (*node)->m1); (gdb) n 325 (*node)->children[index] = child; (gdb) p current_node $4 = (trie_node **) 0x61e270 (gdb) p *current_node $5 = (trie_node *) 0x0 …

Member Avatar for gerard4143
0
125
Member Avatar for johndoe444

[CODE] set_element* make_set(int key) { set_element* node = (set_element*) malloc(sizeof(set_element)); node->parent = node; node->rank = 0; }[/CODE] In the above code there was no return statement and the function was used like this [CODE]elem1 = make_set(f1);[/CODE] And the code was working as expected. This is very funny. I am not …

Member Avatar for gusano79
0
103
Member Avatar for johndoe444

problem with this code: [CODE]parseIcmPage url, '<ul id="topListFilter"', '<div id="footer">' def parseIcmPage(url, start_point, end_point) data = getHtmlPage url s = data.index(start_point) e = data.index(end_point, s) len = e-s list_str = data.index[s, len] puts list_str, '\n' end[/CODE] [CODE]icm.rb:42: warning: don't put space before argument parentheses ./util.rb:121:in `index': wrong number of arguments …

Member Avatar for craiggles
0
230
Member Avatar for johndoe444

Hi, I am getting this exception: [CODE] javax.naming.directory.InvalidAttributeValueException: [LDAP: error code 21 - ob jectClass: value #0 invalid per syntax]; remaining name 'dc=jndiTest' at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source) at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source) at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source) at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source) at com.sun.jndi.ldap.LdapCtx.c_createSubcontext(Unknown Source) at com.sun.jndi.toolkit.ctx.ComponentContext.p_createSubcontext(Unknown Source) at com.sun.jndi.toolkit.ctx.PartialCompositeContext.createSubcontext(Unk nown Source) at com.sun.jndi.toolkit.ctx.PartialCompositeContext.createSubcontext(Unk nown Source) at …

Member Avatar for johndoe444
0
144
Member Avatar for johndoe444

I have say a loop. At the beginning of the loop I want to fill a very large array which is an array of structures. Is there way like memcpy to fill the array without going through for loop. I figure using memcpy instead of for loop would be a …

Member Avatar for johndoe444
0
170
Member Avatar for johndoe444

[CODE] public class FirstJndi { public static void main(String[] args) { String name = args[0]; Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory"); try { // Create the initial context Context ctx = new InitialContext(env); // Look up an object Object obj = ctx.lookup(name); System.out.println(name + " is bound to: " …

0
32
Member Avatar for johndoe444

Say I have 2 columns of data. I want to display headers like "hour(24 hour)" and "Power(KW)" and then followed by a number of rows with 2 columns(hour and power). The hour should be under "hour" header and properly aligned and similarly for power. I want that all the data …

Member Avatar for quuba
0
108
Member Avatar for johndoe444

I want to know how to check gracefully whether 2 sets are distinct or has at least 1 element in common. I don't want to find the common elements. Just knowing whether there is intersection or not is sufficient. May be I can do this using retainsAll but it changes …

Member Avatar for ~s.o.s~
0
123
Member Avatar for johndoe444

[CODE] Set s = new HashSet(); if (s.retainAll(anotherSet)) { ... } [/CODE] now it anotherSet is null the code is showing nullPointerExcpetion. How can I make retainAll work whether anotherSet is null or not?

Member Avatar for ~s.o.s~
0
65
Member Avatar for johndoe444
0
46
Member Avatar for johndoe444

The following example is taken from GWT tutorial ([url]http://code.google.com/webtoolkit/doc/latest/tutorial/codeclient.html):[/url] [CODE]private void addStock() { final String symbol = newSymbolTextBox.getText().toUpperCase().trim(); newSymbolTextBox.setFocus(true); if (!symbol.matches("^[0-9A-Z\\.]{1,10}$")) { Window.alert("'" + symbol + "' is not a valid symbol."); newSymbolTextBox.selectAll(); return; } if (stocks.contains(symbol)) { newSymbolTextBox.selectAll(); return; } int row = stocksFlexTable.getRowCount(); stocks.add(symbol); stocksFlexTable.setText(row, 0, symbol); Button …

Member Avatar for JamesCherrill
0
102
Member Avatar for johndoe444

I installed J2EE SDK in windows 7 machine. But I can't seem to find the location of quite a things. In the J2EE tutorial, they mention there is something called J2EE_HOME. I don't seem to find it. There was a previous installation of J2SE sdk in program files. That is …

Member Avatar for johndoe444
0
84
Member Avatar for johndoe444

I was debugging a program and following is the snapshot: [CODE]81 while (j < len_y && suf_arr[j].word[0] == c) (gdb) 184 if (suf_arr[j].len > 1) (gdb) n 186 memcpy(temp_str, suf_arr[j].word+1, suf_arr[j].len-1); (gdb) n 187 ind = search(suf_arr, temp_str, len_y); (gdb) print suf_arr[j].word $13 = 0x7fffffff96d2 "bbit" (gdb) print suf_arr[j].word+1 $14 …

Member Avatar for UncleLeroy
0
2K
Member Avatar for johndoe444

I see that there is only source that can be downloaded. As I don't have the root privilege, I can't compile and install apache. What alternative is there that would not require compiling and installing apache?

Member Avatar for JRM
0
72
Member Avatar for johndoe444

I have some web page which contains accented words (in french/italian etc) which I need to parse/extract and display. But the internationalization is not being taken into consideration so crazy characters are being shown. I searched in google for ruby internationalization but came up with rails internationalization. As you know …

Member Avatar for kallin
0
113
Member Avatar for johndoe444

I logged into a computer which is not mine. I know there is apache installed because when I type whereis apache it shows /etc/apache it has only a few files. I need to know where the htdocs directory is and also where http.conf file is. How do I accomplish this? …

Member Avatar for griswolf
0
264
Member Avatar for johndoe444

Say I have an xml document contained in the variable xmlDoc Now if I send that to the server using [ICODE]xmlHttp.open("POST", url, true); xmlHttp.onreadystatechange = handleStateChange; xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;"); xmlHttp.send(xmlDoc);[/ICODE] How is the serverside php code going to handle this? As form data are retrieved as fn = _POST["firstName"] if the …

Member Avatar for johndoe444
0
74
Member Avatar for johndoe444

I tried to use some online resources. All of them covers this much: 1. How to create xmlHttpRequest in cross-browser fashion. 2. How to define onreadystatechange function 3. how to call open and send 4. how to receive and use responsetext and responsexml 5. how to do the server side …

Member Avatar for johndoe444
0
119
Member Avatar for johndoe444

[CODE]for (i = 0;i < e;i++) { // take the excuse scanf(" %[^\n]", excuses[i]); excuse_count[i] = 0; while (sscanf(excuses[i], " %[a-zA-z]", word) != EOF) } [/CODE] The input was My dog ate my homework but at the while loop word is getting the word "My" in each loop. In case …

Member Avatar for johndoe444
0
567
Member Avatar for johndoe444

[CODE]template<class type> struct _binary_search_tree { type key; struct _binary_search_tree* parent; struct _binary_search_tree* left_child; struct _binary_search_tree* right_child; }; template<class type>void tree_insert(_binary_search_tree<type>** tree, type key); int main() { char number[10]; _binary_search_tree<char*> root; tree_insert(&root, number); }[/CODE] [QUOTE]compile error: 755.c:182: error: no matching function for call to ‘tree_insert(_binary_search_tree<char*>*, char [10])’[/QUOTE] Thanks.

Member Avatar for caut_baia
0
85
Member Avatar for johndoe444

I just copied and pasted all the things that has been happening from the shell here: [CODE]lin309-05:~/workspace/acm$ gdb a.out GNU gdb (GDB) 7.1-ubuntu Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute …

Member Avatar for johndoe444
0
5K
Member Avatar for johndoe444

If the string is input from stdin: [CODE]scanf(" %s %d", R, &n);[/CODE] then is it possible to get the length of R as a by product from scanf as it already has scanned through the input? As you can see there can be spaces in front and after words and …

Member Avatar for sourabhtripathi
0
337
Member Avatar for johndoe444

[CODE]// this is overkill Date now = new Date(System.currentTimeMillis()); [/CODE] Why is this overkill?

Member Avatar for jwenting
0
144

The End.