Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
5
Posts with Upvotes
5
Upvoting Members
5
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
3 Commented Posts

47 Posted Topics

Member Avatar for Cudmore

Often we're faced with the need to represent primitive data types as readable/writable bytes that can be sent through a data stream. In Java, there are classes such as DataOutputStream/DataInputStream that can do the work for us, but often a programmer wants to manage the conversions himself (or herself, to …

Member Avatar for subramanya.vl
1
5K
Member Avatar for niamul

Only way I know how to emulate a switch on strings, and this has already been mentioned without example code, is like the following: [CODE=java]void StringSwitch (String str) { if (str == null) { /* If the String is null... */ } else if (str.equals ("Some Possibility")) { /* ... …

Member Avatar for jon.kiparsky
0
2K
Member Avatar for PennyBoki

*squints at code* ..... Haha, silly me. I missed this at first glance. 1) instead of [INLINECODE]*.addActionPerformed(this);[/INLINECODE] use [INLINECODE]*.addActionListener(this);[/INLINECODE] 2) [INLINECODE]e.getSource()[/INLINECODE] returns an [B]Object[/B], and switch statements work with [B]int[/B] values. ;) Might wanna reconsider, with casting and/or an if-else statement.

Member Avatar for cempaka123
-1
208
Member Avatar for ajay_tabbu

Oh my. For one, I think this is how you meant to represent your code: [CODE=java] class Rev { char a[]; char i=3; void str() { for(i='A';i<'D';i++) { a[i]='i'; } } void show() { for(int i='A';i<'D';i++) { System.out.print(a[i]); } } void reversStr() { for(i='A';i<'D';i++) { System.out.print(a[i]); } } } class …

Member Avatar for BestJewSinceJC
0
162
Member Avatar for Cudmore

Hi. I've had this problem with all my ubuntu installations (two, to date), and I can't find my way around it.. Even when I switch to runevel 3, by booting with special options or typing telinit 3.. Even THEN, X server starts up, and that's the ONE thing I need …

Member Avatar for EdwinStarr
0
224
Member Avatar for Ghost

I was thinking the same: wonderfully, unnecessarily large, but, that's how I used to code when I first started out. Make friends with arrays. Your exact program - the logic and all - could be condensed into at least 1/4 that size by working with arrays and more generalized methods, …

Member Avatar for JamesCherrill
-2
133
Member Avatar for Doops

Does (ballX, ballY) represent the center of the ball, or the top-left edge of the bounding square? For one, this if statement looks somewhat "iffy": [INLINECODE]if (ballY < 0 || ballY > (getHeight()-25) && ballX > paddleX && ballX < (paddleX +50))[/INLINECODE] Consider grouping the conditions with parenthesis more.. I …

Member Avatar for mjta18
0
156
Member Avatar for Cudmore

SO, I'm playing around with an idea. I'm trying to convert primitives to and from a char array for file logging. I've got all the details worked out, but I don't understand something.. Take the following case, for example: [CODE]public static byte[] ToByta (short data) { return new byte[]{ (byte)(data …

Member Avatar for Zork'nPalls
0
142
Member Avatar for Cudmore

Heyo My laptop has a webcam and a mic built-in on top. The laptop is XPS M1210 The distro is Kubuntu 2.6.20-16-generic The problem I've had, ever since I bought the laptop and installed beloved Ubuntu, is that while the webcam is not supported, it overheats rapidly while the laptop …

Member Avatar for Sturm
0
2K
Member Avatar for Cudmore

Hey! There has been a question on my mind for a while regarding the JRE and the class loader (or, loading classes into RAM if it's different). Java classes define variable members, methods, and subclasses. I know that when you create a new instance of a class, memory is allocated …

Member Avatar for jwenting
0
160
Member Avatar for TheAdjustment

Have you researched this? Perhaps, and especially for questions such as yours, you should check Google or some other appropriate search engine for results. You seem to know the words "Java" and "Uppercase" well enough. Take a look at this - be amazed: [url]http://www.google.ca/search?hl=en&q=java+uppercase&btnG=Search&meta=[/url] And can you believe that it …

Member Avatar for masijade
0
126
Member Avatar for vinod_javas

[QUOTE]But even then, reverser engineering can still be performed by determined people.[/QUOTE] Yea, like someone in serious need of "homework help". Jars are just another archive-type file.. The purpose is to hold a number of files under a common name, "myfile.jar", to keep organized and to make it easier for …

Member Avatar for jwenting
0
158
Member Avatar for im4tion

One reason for the "no" is that Java uses Java-specific resources.. Take the hundreds of importable classes, for example. Take swing, awt, net, etc, etc, and realize that all of these packages were written in Java and are available only to Java. Of course, almost anything you can do in …

Member Avatar for Infarction
0
156
Member Avatar for talablink

You have to analyze the input one character at a time... [INDENT]Say we have a string: myString Set up a [I]for loop[/I] with a lower limit of 0 and an upper limit of [INLINECODE]myString.length()-1[/INLINECODE] inclusive Read each character one at a time with [INLINECODE]myString.charAt(int index)[/INLINECODE] Analyze the single character. What …

Member Avatar for jwenting
0
317
Member Avatar for kimbokasteniv

Hmmm. I can't be super helpful before I fall asleep tonight, but.. First thing is working with [URL="http://java.sun.com/docs/books/tutorial/java/generics/index.html"]Generics[/URL] Regular expressions? I'm not very good with those.. But you can find [URL="http://java.sun.com/docs/books/tutorial/essential/regex/index.html"]tutorials[/URL] about how to pick them apart / assemble them. Third thing, the for loop, is called a [URL="http://java.sun.com/j2se/1.5.0/docs/guide/language/foreach.html"]for-each loop[/URL], …

Member Avatar for jwenting
0
132
Member Avatar for Cudmore

Hey. My question is, can laptops have startup problems if they're cold? If the answer is No, or They Shouldn't, then I will call the depot and interrogate them as to Why my computer fails to start in the mornings. My problem is, sometimes when I turn on my computer, …

Member Avatar for jbennet
0
91
Member Avatar for kartheeswari_b

Unplug the keyboard. Or write the impossible virus. Not sure what you want to know... Locking, aka, disabling input? Input to the entire system? I dunno if Java can do that. Maybe if there's a panel that retains focus and absorbs all key events.. But probably not.

Member Avatar for jwenting
0
116
Member Avatar for Pauer100

[CODE]import java.io.*; import java.util.*; import Employee; [/CODE] The problem is with [INLINECODE]import Employee;[/INLINECODE] --- you can't import classes from the same package without at least giving the package name/whatever. Just remove [INLINECODE]import Employee;[/INLINECODE] and you should be fine. As long as the classes are in the same directory/package, they're automatically …

Member Avatar for Pauer100
0
139
Member Avatar for itdisc

Is there any way we can filter threads like this from being posted? Or, can they be removed? I'm not sure, but I think DaniWeb could go without such dribble as do-my-homework demands.

Member Avatar for ajay_tabbu
0
110
Member Avatar for Cudmore

My question today is regarding multidimensional arrays, and synchronization.. I'm working on a client/server project and I'm not sure about the theory of an idea I came up with: I have an array: [INLINECODE]Object[][] myArray = new Object[256][];[/INLINECODE] It is an array of arrays. The length of myArray is 256 …

Member Avatar for Cudmore
0
766
Member Avatar for Cudmore

Hi! I'm looking to learn something today, and I have just the question. In writing a recent program, I found no Java method suited to compare two byte arrays. Maybe the method exists, or maybe not. In any case, this is a learning expedition, and I came up with a …

Member Avatar for jwenting
0
123
Member Avatar for Cudmore

Hi. I'm not sure where this belongs, but it'll be fine here. I came up with an idea for a website/service.. It's a really good idea. I've searched, and searched.. I've found nothing like my idea in existence. I think it has a lot of potential at becoming a popular …

Member Avatar for jwenting
0
111
Member Avatar for Cudmore

So I've run into this situation a million times in my "learning career" and I've always found a long way around the issue so as not to risk throwing unnecessary exceptions.. Let's look at a simple example... [CODE=java]boolean IsEnabled (JPanel MyPanel) { return MyPanel.isEnabled(); }[/CODE] Throws java.lang.NullPointerException if null is …

Member Avatar for jwenting
0
362
Member Avatar for Cudmore

[B]Hey![/B] This is a "style" question. Is there some defined custom for the order in which parameters are given to a function, or does it depend entirely on the programmer's stylistic preference? What if the developed software should be released to other programs to incorporate in their own programs? Obviously …

Member Avatar for WaltP
0
102
Member Avatar for Cudmore

I installed Ubuntu Linux this morning and got java jdk 1.5.0_09 installed, along with Eclipse, and then I imported a project I've been working on into the Eclipse workbench. All configuration is fine, as far as I can say. My problem: The program I am working on uses the Enum. …

Member Avatar for jwenting
0
395
Member Avatar for Cudmore

I found this odd... Sometimes, and only sometimes, when I turn of on my laptop and log in, my sound system fails to function. No tune is played at startup, xine can't initialize sound drivers, etc. Then if I restart my system everything usually works fine. Why is this? Does …

Member Avatar for John A
0
89
Member Avatar for fdrage

I think I may know what you're talking about, as I faced the apparent issue myself just last week. It was quite something. If I've misunderstood and all the following information is unrelated, then I guess I'm just practicing my explanatory skills. Basically, you have Nodes, and each Node can …

Member Avatar for iamthwee
0
120
Member Avatar for Cudmore

Hey! So, I have a laptop installed with both Windows and Linux. Linux comes first, logically, so its partitions fill up the first 90 Gigs of my HD. Windows comes at the Very end, filling the remaining 30 Gigs. Interestingly enough, Linux reads and writes from its partitions silently, but …

Member Avatar for jbennet
0
68
Member Avatar for SyLk

I hardly understand what you're doing or why, but here's the recursive solution.. Recursion is unnecessary and stack-dangerous, by the way. ([COLOR="DarkRed"]StackOverflowError[/COLOR]s are ugly). Using a StringTokenizer is also unnecessary. I've included two examples, one is Your way, and the other is My way. Your Way (Recursive and using a …

Member Avatar for Cudmore
0
124
Member Avatar for freesoft_2000

I think the proper way to escape Quotes is "Here is some [COLOR="Red"][B]\[/B]"[/COLOR]Text inside Quotes[COLOR="Red"][B]\[/B]"[/COLOR]" :rolleyes: And no. It's not platform-independent.. That would be the File Separator, which is "\" in Windows and "/" in Unix (as an example).. In Java, [B]\[/B] always escapes the following character.

Member Avatar for Cudmore
0
81
Member Avatar for Cudmore

Hi! Here's my scenario: I have an application that utilized the DatagramSocket class. I also have a favorite Port number that I would like it to connect to Every time I load the application. One problem with my application is that it's highly threaded, and under basic circumstances, it doesn't …

0
77
Member Avatar for Cudmore

So I've been having a problem with Gaim, the chat client, on both of my systems. Actually, I've reinstalled linux on them both atleast once, and each additional time I install Gaim, I get the same problem. It random crashes shortly after MSN login... Mostly when my mouse moves over …

Member Avatar for John A
0
84
Member Avatar for Cudmore

Heyyyy Hopefully this isn't the time-old question, and we can get some new input here.. I've lsted some of the most common email providers (which have their own chat services) and I would like to know what the Intelligent people choose as their service-of-choice. I'm looking to upgrade from Hotmail/MSN …

Member Avatar for FireSBurnsmuP
0
146
Member Avatar for Cudmore

Hi there y'all. I recently purchased a beautiful little laptop, and of course, Linux was the first thing that had to be installed. However, I'm having trouble getting everything to work properly. Among the trouble is that of installing support for my wireless WiFi card (internal "Dell Wireless 1500 Draft …

Member Avatar for Cudmore
0
218
Member Avatar for Cudmore

Hiii I'm going to document a [I]very[/I] frustrating issue I've been experiencing here, and I encourage you all to read it and give any advice you can. I would really appreciate that, a lot. You'll understand after reading... I recently bought a new laptop, for $3000 -- the XPS M1210. …

Member Avatar for John A
0
265
Member Avatar for Cudmore

Hiii I'm going to document a [I]very[/I] frustrating issue I've been experiencing here, and I encourage you all to read it and give any advice you can. I would really appreciate that, a lot. You'll understand after reading... I recently bought a new laptop, for $3000 -- the XPS M1210. …

Member Avatar for Cudmore
0
122
Member Avatar for Cudmore

I hope this isn't too lame a question, but I have to ask... Is it necessary to rebuild ALL of the modules each time I want to rebuild the kernel? It takes an awfully long time, and very few modules are needed to be updated, yet they're all rebuilt. Is …

Member Avatar for John A
0
109
Member Avatar for Cudmore

So. I'm having an issue. I'm building an application that loads class files as extensions during runtime. I'm doing this, becuase I want my application to be able to grow in the future without having to recode and recompile the main source.. So, I plan to make seperate class files …

Member Avatar for Rotak
0
249
Member Avatar for Cudmore

Sooo.. I'm having media problems. This has been an ongoing problem, and no matter what I try, I can't seem to fix it. I can't get AmaroK or Kaffeine to play [U]anything[/U]. They're using the Xine engine, because it has oh-so-many great reviews and I thought it'd be a good …

Member Avatar for Cudmore
0
102
Member Avatar for Cudmore

Sooo... I just started designing the GUI for an application that I'm writing.. And, well, I can't get either the awt.TextArea OR the swing.JTextArea to work properly. Here are snapshots of both, along with the problems I am experiencing. If anyone can resolve these problems, please let me know.. I …

Member Avatar for Cudmore
0
258
Member Avatar for Cudmore

This is irritating me so bad, I have spent three hours aimlessly trying to get JScrollPane to work on my JList and I can't figure it out.. here is the code, please make the scroll bars work! :sad: [CODE]public class ChatServer extends JPanel { private JList lstUsers; private JScrollPane scroller; …

Member Avatar for jwenting
0
1K
Member Avatar for Cudmore

Hey y'all! I'm fairly new to internet programming, and I'm surrently developping my first socket app in Java.. Now I have a question... I wrote a simple chat client to learn the commands, it uses a datagram socket (that's what I want to stick with for now) and sends/recieves messages.. …

Member Avatar for Cudmore
0
182
Member Avatar for Cudmore

Hey!! Ahh, all day I've been trying to learn something new, so reading over tutorials I compiled my first socket app!! The only problem is, it isn't working the way I would like it to, and I was hoping you gyus could help me figure out the problems.. I appologize …

Member Avatar for perniciosus
0
217
Member Avatar for Dee_Dee

Hmmm, looks like dee_dee is quite new at this.. are you learning it in school?? Lets fix a few things here... mostly it's correct.. [CODE] #include <iostream> [COLOR=Red]using namespace std; // (replaces the prior 3 lines)[/COLOR] [COLOR=Blue]// #include <iomanip> // what is this junk? lol[/COLOR] [COLOR=Red]bool [/COLOR]anyNegative(int a[], int arraysize); …

Member Avatar for SpS
0
266
Member Avatar for Chinjoo

[QUOTE=Narue]There are plenty of better examples (much better) out there already. [url=http://www.eternallyconfuzzled.com/tuts/bst1.html#traverse]For example[/url]. :) [/QUOTE] Cool tutorial! :cheesy: I read it all (believe it or not) and now I'm interested in this type of classification and currently writing my first binary search tree app.. And, thus, I'll probably be looking …

Member Avatar for Cudmore
0
389
Member Avatar for Cudmore

You heard me, I want to know your guys' techniques for converting data types without using additional headers (such as studio.h). Are there any tricks or intrinsic methods? Can I write my own method? I simply don't like adding unnecessary headers becasue I don't use 95% of the crap that …

Member Avatar for Cudmore
0
196
Member Avatar for Cudmore

Hey! I'm learning C++ and pointers are pretty new to me, I can work with them a little but [I]still[/I] don't see the point to them.. ok, well, I do.. For example, passing variables byReference! But that's the only good I see comming from pointers (yup, I'm a n00b).. [B] …

Member Avatar for Cudmore
0
137

The End.