Posts
 
Reputation
Joined
Last Seen
Ranked #490
Strength to Increase Rep
+5
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
7
Posts with Upvotes
5
Upvoting Members
6
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
3 Commented Posts
~40.3K People Reached
Favorite Tags
Member Avatar for TheWhite

I'm trying to get my android app to talk to my java server using a secure socket (where I'm going to exchange the person's username and password and verify it, in non plain text). How do I go about doing something like this? Source code example on the android (client) …

Member Avatar for TheWhite
0
79
Member Avatar for TheWhite

For whatever reason, no speech recognizer is installed in the default android emulator for 2.2 (its the only one I've tried). I would like to be able to test my android app which uses the google speech api in an android emulator. Does anyone have any suggestions for this? There …

0
48
Member Avatar for TheWhite

[CODE] import java.util.regex.Matcher; import java.util.regex.Pattern; public class test_regex { public static void main(String[] args) { String text = "(asdf) (123) (zxcv)"; Pattern p = Pattern.compile("^\\((\\S+)\\) \\((\\S+)\\) \\((\\S+)\\)$"); Matcher m = p.matcher(text); if (m.matches()) for (int i=0; i<m.groupCount(); i++) System.out.println(i+".) "+m.group(i)); else System.out.println("no match"); } } [/CODE] [QUOTE] Output: 0.) (asdf) …

Member Avatar for TheWhite
0
219
Member Avatar for TheWhite

I tried everything could possibly think of to do this and have spent hours trying to figure it out.. I'm trying to take this timestamp: 2011-03-23 00:43:07 which is in GMT zimezone and convert it to a Date that is in my timezone which is 4 hours later. 1. It …

Member Avatar for JamesCherrill
0
5K
Member Avatar for TheWhite

"ps aux" outputs the following as the first line: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND how can I preserve this line if I do a "ps aux | grep <someuser>" so that I can still see the header for each column? In essence, I want …

Member Avatar for thekashyap
0
113
Member Avatar for TheWhite

Is there a way, using java's standard library to replace characters like: &quot; with '"' and &# 39; (i put a space so the site doesn't change it) with ''' in a string? For example, change from: [CODE] String message = "&quot;This &# 39;is&# 39; a test&quote"; [/CODE] to: [CODE]message …

Member Avatar for JamesCherrill
0
193
Member Avatar for TheWhite

Right now, with the manifest file, I am able to create my runnable jar to work with: folder structure: [CODE]libs/thirdpartylib1.jar libs/thirdpartylib2.jar myJar.jar[/CODE] using this manifest: [CODE]Class-Path: libs/thirdpartylib1.jar libs/thirdpartylib2.jar Main-Class: myPackage.myClass[/CODE] Is there any way I can package these jar files into my runnable jar so that I do not need …

Member Avatar for Ezzaral
0
117
Member Avatar for TheWhite

I have never used javascript before, but I know most other programming languages. [CODE] <div id="test"> <p class="location">New Jersey</p> </div> [/CODE] Is there a way to take out "New Jersey" and save it in a variable using javascript and then to remove the <div> who contains the class="location" (its parent?)

Member Avatar for hielo
0
63
Member Avatar for TheWhite

So I just started using C# and am looking into creating a WPF program. I was able to create the window and add in a TextBox of variable name console. How can I make console static such that I can access it statically across all my classes? I tried to …

Member Avatar for kvprajapati
0
92
Member Avatar for TheWhite

[code] public class TEST extends JFrame{ ... blah, blah..... private void launch(){ setBounds(200, 200, 100, 100); setDefaultCloseOperation(EXIT_ON_CLOSE); JPanel greenPanel = new JPanel(); greenPanel.setSize(70, 70); //<---- xNot resize the greenPanel greenPanel.setBackground(Color.green); JPanel yellowPanel = new JPanel(); yellowPanel.setSize(50, 50); //<-- xNot resize yellowPanel in greenPanel yellowPanel.setBackground(Color.yellow); greenPanel.add(yellowPanel); JPanel bluePanel = new JPanel(); …

Member Avatar for Azeerazly
0
198
Member Avatar for TheWhite

so, lets say I have a thread that looks like this: [CODE=java] public run() { boolean active = true; while (active) { //do some action that takes a really long time } } [/CODE] Is there any way I can directly stop and destroy this thread in the middle of …

Member Avatar for ~s.o.s~
0
151
Member Avatar for jk_bscomp

What you want is an executable .jar file... All it is, is all your already compiled .class files Zipped in one icon, which executes the .class which contains your main method... Basically, it's like an .exe file but with a .jar extension, for java...

Member Avatar for nickguletskii
0
162
Member Avatar for TheWhite

I tried everything... I cant find a suitable JSomething to be able to add words to a pane that are different sizes and fonts. I tried JTextAreas but they only allow plain text. JEditorPanes allow HTML but don't seem to let me append single words for some reason. I'm also …

Member Avatar for JamesCherrill
0
91
Member Avatar for TheWhite

I needed a way to have words with different sized fonts in my JTextArea, but apparently only plane text is supported for it. I turned to JEditorPanes which apparently support html which allows different sized fonts, which is great. Now, I need a way to traverse back into the lines …

Member Avatar for TheWhite
0
88
Member Avatar for dansnyderECE

what about using a stringstream and the getline() function with an obvious delimiter?

Member Avatar for dansnyderECE
0
127
Member Avatar for TheWhite

I know how to create a UDP socket and bind it to an ip/port and how to read a stream of data from the socket using recvfrom(), but how can I get the data of a single UDP packet at a time? For example if "data of one packet" was …

0
71
Member Avatar for TheWhite

When I want to load images, locally, I use use: [CODE=Java]ImageIcon qmarkIcon = new ImageIcon("images/mark.gif");[/CODE] When I run the program through eclipse, everything works fine--all the images load like normal, but when I package the executable .jar and run it in a folder without images/*.gif's, none of the images load..... …

Member Avatar for gsteele
0
8K
Member Avatar for TheWhite

One of my programs work with MySQL (Connector/J Driver). The issue is, some of the contents I'm passing into the query string are read from a file that contains several escapable characters. When I try to commit the query (such as an INSERT) with a value that has unescaped characters …

Member Avatar for BestJewSinceJC
0
141
Member Avatar for TheWhite

[CODE]new File("config.ini");[/CODE] 1. When used via eclipse, the correct file is found in the root of the project. 2. When used via a runnable jar, it looks in C:\users\ME\config.ini How do I make it look at the file outside of the jar? New Folder: - program.jar - config.ini

Member Avatar for Ezzaral
0
170
Member Avatar for TheWhite

If I have 2 synchronized methods and 1 calls the other, what exactly happens? If those 2 synchronized methods are in a class, and 2 of those classes are created, each of them calling one of their synchronized methods, what would happen? If those 2 classes extended Thread and were …

Member Avatar for TheWhite
1
157
Member Avatar for TheWhite

so I have 2 methods, 1 with an argument the other without command_hello(String sender); command_hello(); I am trying to invoke the method using just their name: command_hello I can do this by using the following for the method with no arguments: getClass().getMethod("command_hello").invoke(this); Works! Great! But the moment I try getClass().getMethod(cmds.get(cmd)).invoke(this, …

Member Avatar for TheWhite
0
151
Member Avatar for TheWhite

I have a class which extends LinkedList and implements Runnable. I also have a main class which modifies the extended LinkedList. So, the issue is, the LinkedList is being modified by 2 threads: main() in the main thread and run() in the thread which is created from implementing Runnable An …

Member Avatar for TheWhite
0
1K
Member Avatar for TheWhite

I want to parse a string into something like an array: [url]ftp://user:pass@host:portpath[/url] [url]ftp://anon:1234@111.222.333.444:9999/path1/path2/[/url] I read the java docs about using Pattern and Matcher but I keep getting an "IllegalStateException: No match found" error. [CODE=java] import java.util.regex.Matcher; import java.util.regex.Pattern; public class test { public static void main(String[] args) { String s …

Member Avatar for TheWhite
0
433
Member Avatar for TheWhite

Theres a functionality that I need that is not built into the PHP source code. I would like to modify a .c file in the code, recompile, and then be able to execute the php function with the same name as the one I added to the .c in my …

Member Avatar for ShawnCplus
0
75
Member Avatar for TheWhite

I'm still fairly new to C, so I was wondering what would be the fastest way to get a char pointer pointing and ending between 2 different char delimiters? For example: text text (text I need) I need a char * to "text I need"

Member Avatar for William Hemsworth
0
100
Member Avatar for TheWhite

I have 1 package that manages the main JFrame of my application. This JFrame needs to access an image (which is a resource) of another package. I was able to get it to work using: [CODE=JAVA]new ImageIcon(getClass().getResource("../"+packageName+"/icon.jpg"));[/CODE] But this does not work when using a runnable jar (getClass().getResource("../"+packageName+"/icon.jpg")) returns null). …

Member Avatar for majestic0110
0
115
Member Avatar for Ajantis

Threads were a real tease for me cause I learned of them on my own too. 1 thing that will help you understand is that a Thread need only contain 1 function and an optional constructor. [CODE=JAVA] public class MyThread extends Thread { String text; public MyThread(String text) { this.text …

Member Avatar for TheWhite
0
154
Member Avatar for erietha88

You want to open an applet using another applet? It would make sense for an Applet to open a JFrame or a JFrame to open another JFrame, but not for an Applet which opens another Applet.... Applets are for web applications that you can open in your browser. They shouldn't …

Member Avatar for erietha88
0
917
Member Avatar for scias23

Every player has a Hand which could be: A rock, A paper, or A scissor Every player could have: A name, A hand, A number of Wins, A number of Losses, and a choice that will affect his hand/number wins/or number losses. Every game could have: A bunch of players, …

Member Avatar for TheWhite
1
592
Member Avatar for TheWhite

I'm making an app that, when executed will continue to do something in an infinite loop, forever (or until the process is manually stopped). My goal is to create a process with a unique name which will run this application (right now java uses javaw.exe as the same name for …

Member Avatar for JamesCherrill
0
129