- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 7
- Posts with Upvotes
- 5
- Upvoting Members
- 6
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
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) … |
|
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 … |
|
[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) … |
|
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 … |
|
"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 … |
|
Is there a way, using java's standard library to replace characters like: " 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 = ""This &# 39;is&# 39; a test"e"; [/CODE] to: [CODE]message … |
|
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 … |
|
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?) |
|
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 … |
|
[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(); … |
|
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 … |
|
Re:
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 … |
|
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 … |
|
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 … |
|
Re:
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 … |
|
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 … |
|
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..... … |
|
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 … |
|
[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 |
|
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 … |
|
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, … |
|
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 … |
|
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 … |
|
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 … |
|
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" |
|
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). … |
|
|
Re:
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 … |
Re:
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 … |
|
Re:
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 … |
|
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 … |