Killer_Typo 82 Master Poster

Come up with an idea
Map out that idea
Decide the target market for said idea
Develop against that target market.

If you want to make a PC Game to hit the steam powered network:
DirectX & OpenGL are two very viable libraries.

If you want to hit the iPhone then you need to know Objective-C

If you want to hit the droid market then you need to know Java.
...etc

Want to end up on the XBOX check out the XNA stuff from microsoft.


There are so many available game engines (Free too!) that picking your starting point is more of what you are comfortable with and what platform you want to end up on.

:) happy coding and cheers!

Killer_Typo 82 Master Poster

If you end up having a lot of items to search over you may want to look at an Inverted Index which is specifically designed for high speed searching of large collections (:

(very-basic) you create an index of all words from your documents, with each word is a table that defines where you will find the word (what document) and the position of the word in the document.

Example from the wiki:

"a": {(2, 2)}
"banana": {(2, 3)}
"is": {(0, 1), (0, 4), (1, 1), (2, 1)}
"it": {(0, 0), (0, 3), (1, 2), (2, 0)}
"what": {(0, 2), (1, 0)
If we run a phrase search for "what is it" we get hits for all the words in both document 0 and 1. But the terms occur consecutively only in document 1.

Using Mapping and Reducing you can create a means by which you can return the most pertinent information first. AKA for each word search you distribute the work load across several asynchronous threads which comb through the inverted index looking for the words and locations.

You can then compile the output and determine exactly where a word is and in which places all of the words appear together or at least a large portion of them :)

Killer_Typo 82 Master Poster

I think it means the author of the book was tired and miss-typed :)

Killer_Typo 82 Master Poster

yes when you call any accessing elements of an image the image is loaded at that time.

If you were to say create a new Image on "/myImage.jpg" and then call image.getWidth() it will return -1 until the image has been loaded.

Try this out in debug, call image.getWidth() and debug that line, if you call it again after a second or so (probably less, but it's a decent enough buffer) the image will finally be loaded.

It's an asynchronous process so that you don't go new Image("some massssssive image") and end up waiting a long time for it to display.

Using ImageBuffers and MediaTrackers are great alternatives since you can get the images immediately. These also allow for smarter handling of the images, which is really what most people want.

Killer_Typo 82 Master Poster

Then it is not a primary rule for basic bean specification? I have not learned getter and setter methods in object oriented programming.. Now only i am hearing.

In Spring (beans) the primary purpose of a bean is to abstract you away from the class and encapsulate the code and allow it to be populated via another means. You can load your class variables up using a spring bean file. The underlying code is usually a class of basic getters/setters with some implementation.

As for getters/setters

Getters and setters allow you to wrap data elements with meaningful code that the callers of said method would never need to know.

For Example

public class foo { 
  public int width;
  public int height;
  public Image image;

  public foo() { } 

}

By exposing those elements directly your user has no inclining into the manner in which they should be connected together. Is that width and height for something else, is that width and height of the image?

By exposing your code via getters and setters you can write impl code that will allow callers to use the methods without worry of the underlying happenings of the class.

public class foo { 
  private int width;
  private int height;
  private Image image;

  public foo() { } 

  public void setImage(Image i) { 
    image = i;
    width = image.getWidth(null);
    height = image.getHeight(null);
  }
  public int getWidth() { 
    return width;
  }
  public int getHeight() {
    return height;
  }
  // Here we …
Killer_Typo 82 Master Poster

Using a MediaTracker is definitely a good idea: a MediaTracker will allow you to pre-load images on a loading screen and bypass any issues you may encounter with loading images on the fly - such as awkward display issues and not being able to get dimensional information on the image until after it has been drawn to the canvas.

Killer_Typo 82 Master Poster

Programming is not just something you do, it is a passion. If programming is not a passion you are not going to find a magic pill or answer that will get you on track.

In 10 years if you feel you haven't gained much then you should assess why you are doing it in the first place.

Part of the problem with coding is that it's easy to lose focus and never finish a product. A lot goes into creating the perfect application, that one sweet bit o code that when all compiled together makes your pants fit just a little bit tighter.

Spend some time researching what you want to do and dedicate yourself to it. Get yourself hyped up and psyched out. You want to be passionate about whatever you are creating or it will show in the work (lack luster results). You need a clear plan of attack, from what the program is, down to how it will work.

You need to think about:
User Experience
User Interface
What the program does
How the program does it

Component-ize your work, set clear goals and meet them. Don't just say, "I want to create a video game" and get frustrated when you don't meet the goal, that goal is too generic and doesn't really allow you to feel the fruits of your labor.

Example:
"I want to create a side scroller like mario"
What should the …

Gribouillis commented: great +13
Killer_Typo 82 Master Poster

turns out I need to force python to run in 32bit mode, just needed to set the flag in python (can be found in man python for the *nix users).

Once that was set all went well, still can't run the app that was created, but I think I need to force the app to run in 32bit mode as well. :)

Killer_Typo 82 Master Poster

Trying to build a simple python script on my mac, but the mac is 64 bit and apparently does not want to play nice. Does anyone know of any workarounds or if I am missing something?

command i am running is python setup.py py2app -A

output is:

error: argv-emulation is not supported for 64-bit executables

thanks!

Killer_Typo 82 Master Poster

http://en.wikipedia.org/wiki/Wake-on-LAN <-- check that out, you'll need a system that supports WoL (wake on lan) requests.

If you check out http://www.jibble.org/wake-on-lan/ you can find a java example of doing exactly what you are asking (or similar).

By the way, that link above was the first result from google when searching: "java wake on lan" ;)

Killer_Typo 82 Master Poster

really need to know what the line is and what error you are seeing.

Let it blow up and then post the logs here.

Killer_Typo 82 Master Poster

quick question - when it starts up the new emulator do you make sure to unlock the emulator? It starts up as a new phone so you have to actually slide to unlock to get into the phones interface.

Sometimes if you wait to long before unlocking or closing out an already running instance of your activity you can get strange errors like that.

Also post the contents of your logcat, if there is any contents, there may be more issues that you cannot see.

Killer_Typo 82 Master Poster

what is the specific setup of your application?

I've worked on development where the front end was C++ and the back-end was Java. We used RPC calls between the two systems to communicate which amounts to defining an HTTPServlet and using the post methods to pass back and forth serialized packets of information.

If one of the pieces if already compiled into DLL's you will probably want to go the JNI route then.

Killer_Typo 82 Master Poster

my guess would be the manner in which they transfer messages and or the protocols / policies the technologies refer to.

We use an XMPP server for our instant messaging at work and it runs great.

I have not had any direct contact or use with JMS; although, from reading up on it, it sounds like a very solid piece of technology. I guess it comes down to personal preference and maybe reading up a bit on each of the technologies and finding the solution that works best for your situation.

Killer_Typo 82 Master Poster

is this on the android platform or windows me platform or...?

the java platform (or runtime environment) itself is not enough information to go on. Normally you would want to setup a test loop and press the key in question, trying to capture whatever code was passed as part of the key event.

Killer_Typo 82 Master Poster

EDIT:

Sorry - this is assuming you are talking about the android platform which it seems you may be with those method names and specific buttons in question. Really though - it would really help to know what platform or api level you are on.


if you look at your onKey(Up/Down/LongPress) event there is a KeyEvent event parameter.

Look at the event - or simply call the KeyEvent class.

there is:

KeyEvent.KEYCODE_VOLUME_DOWN
KeyEvent.KEYCODE_VOLUME_UP
KeyEvent.KEYCODE_CAMERA

you will probably need to override the up and down events for these keys anywhere in your application where an activity needs to override them.

Killer_Typo 82 Master Poster

In the android environment all files are created in MODE_PRIVATE!

Each application is run by its own user: any files created by an application can only be accessed by that particular application. Setting MODE_PRIVATE to the file is simply an option available as you can set files to be public-accessible.

However, if a user has root access to their phone they can CHMOD or simply pull the file off of the device. From an applications perspective, this is unlikely to happen as they would have to know the package namespace (com.google.etc.yourapplication) of another application as well as have the proper system access to change file permissions for which it does not have access - which is a permission reserved for ROOT and I believe applications are run as regular users and not root users.

Killer_Typo 82 Master Poster

yes - also, make sure you (depending on your IDE if you are using one) do a clean / build of your code to ensure that there are not any old files from a previous build being packed into the JAR.

Killer_Typo 82 Master Poster

I have quite a few ideas, but more importantly - what are yours and how much effort have you put into this?

Do you know the math for finding means and medians? That is the place to start ;)

Killer_Typo 82 Master Poster

I got bored and started some scripting the other day in PHP, this is just a sample that i wrote, just uncomment the part of script that you would like to see. IE remove the /* and */ around a certain area. i know its not great, but some beginners might find this a little helpful.

Killer_Typo 82 Master Poster

http://www.eapps.com/

I've used them for quite some time, good pricing and a TON of control over the server. Great service and a ton of FAQ documentation to cover some of the various tasks one would setup: Tomcat, Glassfish, SSH, SFTP...etc

Killer_Typo 82 Master Poster

when I graduated from college I wrote a multi-threaded database administration tool. Has lots of use if you cover more than just a SQL entry pane. If you include functionality like, creating, removing, updating, adjusting tables...etc

Killer_Typo 82 Master Poster

Ending up being able to solve this one. Debugged the servlet used for the connection to the JUnit window. Found it was using the wrong port (for some reason it was placing it a single digit below the correct port) and stepped through each iteration of the servlet doConnect() method adjusting the port each time.

Once I did that JUnit testing began to work as normal; hopefully however, it will continue to do so next time I start up eclipse :P

Killer_Typo 82 Master Poster
Could not connect to:  : 50404			
java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
	at java.net.Socket.connect(Socket.java:520)
	at java.net.Socket.connect(Socket.java:470)
	at java.net.Socket.<init>(Socket.java:367)
	at java.net.Socket.<init>(Socket.java:180)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.connect(RemoteTestRunner.java:560)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:377)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

has anyone run into this issue and or find a fix? I've not been able to get much from google. I have been running unit tests no problem them wham it poops out :P.

I've tried restarting, disconnecting the network cable, starting up a new instance of eclipse, disabling the windows firewall...etc

However if I run a "mvn test" on the project from the command line all goes well as expected >_<

Killer_Typo 82 Master Poster

I think there were some issues with tb_create, mostly I hadn't gotten it working at the time lol.

but you are more than welcome to have at it. This is a pretty old thread so you should count your lucky stars I even found the source for this!!

<?php
$host = "localhost"; //location of the mysql
$name = ""; //user name for logging into mysql
$pass = ""; //password for logging into mysql

$TBname = "$_POST[TBname]"; //name of the table for Creation
$DBname = "$_POST[DBname]"; //name of the database for working in


    $connect = mysql_connect($host, $name, $pass) or die(mysql_error());
    mysql_select_db($DBname) or die(mysql_error());
    
    $sql = "CREATE TABLE $TBname ("; //creates the table

    for ($count = 0; $count < count($_POST[field]); $count++)
       {
        $sql .= $_POST[field][$count] . " " . $_POST[type][$count];
            
            if ($_POST[auto_increment][$count]  == "y")
              {
               $additional = "NOT NULL AUTO_INCREMENT";
              }
            else
                {
                 $additional = "";
                }
            if ($_POST[primary][$count] == "y")
              {
               $additional .= ", primary key (" . $_POST[field][$count] . ")";
              }
            else
                {
                 $additional = "";
                }
            if ($_POST[length][$count] != "")
              {
               $sql .= " (" .$_POST[length][$count] . ") $additional ,";
              }
            else
                {
                 $sql .= " $additional ,";
                }
       }
// clean up the end of the string
$sql .= ")";

$result = mysql_query($sql, $connect) or die(mysql_error()); // execute the query

if ($result)
  {
   $msg = "<p>" . $TBname . "has been created</p>";
  }
echo "Adding $TBname to $DBname ....Done<br />";
echo "Creating fields in $TBname ....Done<br />";
echo $msg . "<br />"; 
echo "<a href=\"http://localhost/dbadmin/db_management.php\">Return …
Killer_Typo 82 Master Poster

^ No, he's saying only to print out the character the first time it is seen.

RealThinkers, what you should do is make an array of 26 booleans, one for each letter in the alphabet. True means it has been seen, false means it hasn't. Then when you see a character, if it is a letter, check the corresponding index to see whether or not it has been seen yet. Make sure to set it to 'seen'/true after you see the char for the first time.

hah I had missed his

it count character only once

Killer_Typo 82 Master Poster

While you do not need to use the DOM API to handle the XML, it is recommened. Just going through and deleting the last line and appending what you think is right can result in poorly formed XML documents.

If you are having troubles understanding the DOM API please feel free to post your code and ask questions, there are plenty of us here to help.

The basic idea of working with DOM is to:

Get your Document
Load your XML into it
Manipulate/create the tree
Save the document

Adding / removing nodes is very easy and you can build a tree as deep as you need.

Killer_Typo 82 Master Poster

only the alpha characters?

so H3ll0 Wor7D would print out:

H
l
l
W
o
r
D


that's easy enough to do using regular expressions.

the [a-zA-Z] searches for all characters within the range of a-zA-Z. You can then use the regexp to output the matches...etc

Killer_Typo 82 Master Poster

a quick search of the forums produced:

http://sourceforge.net/projects/jzjkit

which points to:
http://developer.k-int.com/projects.php?page=jzkit2


where I am sure you can find all of the answers to your questions :)

Killer_Typo 82 Master Poster

>I found the best book to be google
Yes but sometimes you need a flow to what you are reading which is hard to get given the fact that you are looking up different articles written by different authors scattered all over the internet.
Also when you read different articles by different authors you would sometimes find them contradicting each other a bit, because every author has hos own style, his beliefs his own "best practices" etc,
I am not saying that this isn't a good way, yes it is, but for a beginner not a preferred way to begin with.

as a beginner my first C++ book was a C++ primer that covered basic loops and pointers, I know pretty much dig through google for the rest. WHile many articles can seem to contradict eachother it evens itself out in the end. Nothing wrong with a large amount of code exposure. In my experience I have found pocket references and super thin primer style books to be the best. Heck - even a Java Spark CHart rocks, it's straight to the point and easy to follow. It's only 2 pages :P

I may be an exception to the rule, but I find books to be better suited as a backup. The books I prefer to keep in my library are cook books and pocket references who knows, maybe I am just a bit weird ;)

>Given a good compiler (NetBeans or Eclipse)
These …

Killer_Typo 82 Master Poster

you need to preappend

cmd /c

my example I tested:

package redirectconsoleoutput;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author Michael
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main( String[] args ) {
        // TODO code application logic here
        System.out.println("Attempting to redirect the output of one java app to another");
        String s = null;

        try {
            Process p = Runtime.getRuntime().exec("cmd /c java -jar \"D:\\Users\\Michael\\Documents\\NetBeansProjects\\SortedSetReWrite\\dist\\SortedSetReWrite.jar\" > \"D:\\SortedSetReWrite.txt\"");

            BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));

            BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));

            // read the output from the command

            System.out.println("Here is the standard output of the command:\n");
            while ( (s = stdInput.readLine()) != null ) {
                System.out.println(s);
            }

            // read any errors from the attempted command

            System.out.println("Here is the standard error of the command (if any):\n");
            while ( (s = stdError.readLine()) != null ) {
                System.out.println(s);
            }

            System.exit(0);

        } catch ( IOException e ) {
            System.out.println(e.getMessage());
            System.exit(-1);
        }

    }
}
Killer_Typo 82 Master Poster

I found the best book to be google and the best tutorials to be whatever the mind can conceptualize into the digital world.

I have been writing software since the 6th grade (C++ and Java more recently) and I must say I learned the most when I took every day computing tasks and wrote applications to solve the problems.

Java is a very neat language in that you can very easily get up and running with it given you've got the time and patience to do so (almost contradictory I know haha :P )

Given a good compiler (NetBeans or Eclipse) you can begin serving JSP and servlet based applications almost immediately and can go spiraling up from there.

So to make a long bloated story short, find something you like to do on your computer or something you find boring enough - and write a solution to it.

I started with files manipulation: moving files, searching for content, manipulating contents...etc and progressed from there. I've since dived into servlet applications, image meta data manipulation, service bus implementations, student loan calculators, database administration applications, multi-threaded apps, web sniffers / harvesters...etc

You never know where the fingers will take you :)

Killer_Typo 82 Master Poster

I'm still not sure what you are asking, are you trying to determine if each position in a given string is a digit (numeric)? If so then what was stated above will do just fine. If not what is the purpose of comparing a gigantor number such as xyz...512 characters to an integer.

In your example loop you would simply loop up to the size of the the string and not necessarily the position.

IE: if you need to compare each position in a string to determine if it is in fact a digit you would want something that loops up to the string.length and then use the [] accessors to determine if a specific point is a digit IE: is string a digit.

Killer_Typo 82 Master Poster

I couldn't imagine any bit of competent help being not worth while, but then again I've been surprised before.

However, the fact that he offers it in 6DVDs or VHS tapes makes me wonder when the last time he kept up on anything was.

The description really doesn't get all too specific with what is actually covered so I kind of wonder if it's just a sam's teach yourself the basics of C/C++ only in cheezy video form.

So I guess what I'm saying is, no I probably wouldn't purchase those videos, but that doesn't mean you can't gain benefit from them.

Killer_Typo 82 Master Poster

You can guess it from his question!

I really don't think he's given enough information for anyone to try and say what the error is.

considering the .NET framework is automatically downloaded on newer OS's and in fact comes pre-installed with newer releases of XP/Vista CD's it would be fairly safe to say that any newer system would have the required framework.

Now that is not to say it's not impossible for him to find someone without the .NET framework but it is a bit foolish to spit out an answer without first knowing what is really wrong ;)

that's a bit of troubleshooting 101.

Nick Evan commented: Yup. Crystal balls aren't my hobby either +6
Killer_Typo 82 Master Poster

.net framework missing!!

while that may be, we cannot assume that it's due to that. we need more information, such as the error he is getting.

scru commented: N/A +0
Ramy Mahrous commented: bad reply +0
Killer_Typo 82 Master Poster

.NET only works on windows and you need to use Visual Studio for it

you dont need to use the visual studio environment for .NET but it sure does make coding a hell of a lot easier :P

Killer_Typo 82 Master Poster

post up some of your source and the exact issues are that you are having.

Killer_Typo 82 Master Poster

fastest/funnest way (for me at least):

find a friend or ask your parents for a very simple program that they would like to see

* Temperature calculator
* Recipe Program (for saving drink mixes...etc)
* Number guessing game (hi-low game is very simple)
...etc

Once you have found an application you think you will enjoy writing, lay out the framework for the app or just dive right in (being new you will probably just dive right in :) )

The most important thing is to get yourself motivated or you will not enjoy what you are doing.

I work with Smalltalk on a daily basis (VERY VERY old programming language)

To help stir the daily boredome of using an ancient language/distro (we are using VisualWorks 1994-95 release) I dig into the innerworkings of the runtime enviornment and innerworkings of the language itself and upgrade /modify the image.

The end result is that I can find something positive in what I do and enjoy the language that much more.

Be motivated, and find a group of people you can talk with about programming.

There is always dani web and we are always here to help within reason :)

Killer_Typo 82 Master Poster

I use Microsoft Visual Studio Professional

if you are just starting out i would recommend the express versions.

I've dabbled around in other IDEs and with other compilers but i happen to like the MS Vis-studio IDE /Compiler the best.

The MSDN Library microsoft offers is very compiled as well.

Microsoft all around has taken very good care of it's programmers.

Killer_Typo 82 Master Poster

thanks for your reply, I knew about that, trouble is when I create my windows forms they do not look anywhere near as professional as microsofts. do you see what I mean ?

well the developers at microsoft have years and years of experience in UI design, and are more then likely NOT using C# or the .NET framework to develope applications for their OS.

with time and practice your applications UI will improve;however, don't expect the high end interfaces seen on applications that were developed by large parties of people, it takes a lot of work and collaboration to get something like that.

Killer_Typo 82 Master Poster

cool because i like starwars otherwise i am not sure of it's purpose.

Killer_Typo 82 Master Poster

you could however generate positive values and multiply by -1 :)

Killer_Typo 82 Master Poster

Aside from the major syntax and naming issues:

thats because your array of 20 looks like

Rudolf00000000000000
--------------------

// each 0 is actually a null character

where as the array you specify looks like this

Rudolf
------
Killer_Typo 82 Master Poster

check out http://support.microsoft.com/kb/319257

it really should be as simple as Console.Clear()

Killer_Typo 82 Master Poster

hi, thanks for your reply.............is it really that simple? Thanks

why not give it a shot ;)

System.Console.WriteLine("hello world");
System.Console.clear();
System.Console.WriteLine("Hello world again");

give it a shot.

Killer_Typo 82 Master Poster

System.Console.Clear();

Killer_Typo 82 Master Poster

thanks for your answer,


my mistake, yes the code compiles but the 3 statements have different bahaviours....


yes, but according to this

//Program creates char d, sets it equal to lowercase letter
//Converts it to uppercase and outputs it
#include <cctype>
#include <iostream>
 
using namespace std;
 
int main()
{
    char d='a';  
    d=toupper(d);
    cout<<d;
}

it should print the character not its ascii value.... I found the code here...

this statement is entirely different from what you have in your code.

/* 
toupper returns an INT value
toupper(a) will return 65 the ascii value for an uppercase A
*/

// the following statement will output the ascii value for the character
cout << toupper(a);

// the following statement will cast the INT value to the equivalent CHAR value
cout << (char) toupper(a);

Notice how i had to cast the output from the toupper function to char to get the character output.

By default the return type of toupper is INT not CHAR so to output the results directly will output an integer value not the character equivalent.

The reason your code works (whether or not it throws a warning) is because there exists an implicit cast from INT to CHAR.

So a user can create a CHAR and assign an int value to it.

/* for the following examples the compiler will automagically cast the INT values to CHAR without the use of an explicit cast*/
char mychar = 65;
cout …
n.aggel commented: thanks! +1
Killer_Typo 82 Master Poster

What effort have you given this?

Can you post any code?

Some great tutorials have been posted that should get you started.

Killer_Typo 82 Master Poster

your code worked and compiled fine for me (besides a typo in your post)

what exactly are you referring to as not working?

cout<<toupper(*pos)<<" "; //without cast it doesn't work, why?

while it does work the output from it may not be what you are expecting. the output from toupper is int not char, so when it is cout'ed the result is going to the ascii equivalent for the character.

*pos=toupper(*pos); //and this also doesn't work
cout<<*pos<<" ";

*pos is pointing to the character that the iterator is on (my wild guess) so it can be cast back to char without an explicit cast.

but it compiles and runs fine on my end :)

but if you are wondering my output from running this:

A 65 A
B 66 B
C 67 C
. .. .
Y 89 Y
Z 90 Z