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.2K 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
218
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
116
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
197
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

Hello everybody!!! Can someone help me on how to create an executable file on java? I made some applications in java but my problem is, I need to compile my program everytime I want them to run ... What I want is to compile my program once and then just …

Member Avatar for nickguletskii
0
161
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

I'm trying to figure out how to get a string from an array starting at some given position. Say we have an array that's arbitrarily long and my string starts at location 1000. If I wanted to get a string from a file I would simply use something like getc …

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
169
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
156
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

Hello people! I am working a little with JAVA programming. And I have a couple of assignments left. When they're both done, I graduate! :) However, I'm not fully familiar with threads. So I don't know how to solve these problems. I thought that perhaps someone could lead me in …

Member Avatar for TheWhite
0
154
Member Avatar for erietha88

I have these code below for the button : [CODE] import java.awt.*; import java.applet.*; import java.awt.event.*; public class Coba extends Applet { Button button1; public void init() { Font font = new Font("TimesRoman",Font.BOLD,16); setFont(font); button1 = new Button("Level Easy"); resize(250,250); LevelEasy lvleasy = new LevelEasy(); button1.addActionListener(lvleasy); //button1.addActionListener(this); add("Left",button1); } private …

Member Avatar for erietha88
0
914
Member Avatar for scias23

i'm thinking how to do this since last week. i can make a rps game in java, BUT not in OO way. just the simple ones. what i want to do is a rps game - the OO way. i planning this program to have two options, play with player …

Member Avatar for TheWhite
1
591
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