Paul.Esson 53 Junior Poster

It may be that you are missing some librarys that are required for running, If your using visual studio 2008 try creating an installer ( I can't remember where this is in VS2008, but It is definitely there somewhere and hopefully should create and installer that contains all dependancys.

It may also be a file that you a referring to being relative to the build directory.

Paul.Esson 53 Junior Poster
if(txtUser.Text == "MJ12" && txtPass.Text == "Roswell1947")
{
//need help here!
}

I am guessing that you want to create another windows forum at this point.

so you may want to do something like this

if(txtUser.Text == "MJ12" && txtPass.Text == "Roswell1947")
{
	// Create instance of the mainForm class
	Form nextForm = new MainForm();
}

You would have to create a new form and in the case name it MainForm, this will then load the next form when they enter the correct sername and password.

Anyhow good luck and I hope this helps you.

Paul.Esson 53 Junior Poster

You can send it as a Multipart email with plain text and HTML.

you can find instructions from sun here

All you have to do is add both BodyParts, specifying the mime type of both parts.

Paul.Esson 53 Junior Poster

GCJ can be located at http://gcc.gnu.org/java/, Is able to compile java into bytecode or a native executable ( don't know if this works on win32 tho ).

Launch4J is another GPL option http://launch4j.sourceforge.net/, a small JVM that ships with your software.

Paul.Esson 53 Junior Poster

you may have better luck if you send the email as hypertext or have a html attachment.

try just enclosing the url in tags as such

String text=" Hello welcome,
click <a href=\"http://192.168.1.21:8080/tarka/resentemail.jsp\"> here</a> to enjoy ";

see how something like that works.

I don't know what class you are using but I would assume that you can send a HTML attachment, That will be displayed correctly in most mail applications and then any links you send will be displayed correctly.

Paul.Esson 53 Junior Poster

You where using the findInLine(String patten) method. This takes a patten and returns the matching string ( Using regular expressions )

so if i Used for instance findInLine("[YN]") it would ignore every other char in the line except for Y or N and return a string with only the chars Y and N so if the original string was "Hello How Are You, Never Better ?" it would return YN

Paul.Esson 53 Junior Poster

Yes, if you look at the API documentation for the Scanner class it says the following about the find InLine method

Attempts to find the next occurrence of the specified pattern ignoring delimiters. If the pattern is found before the next line separator, the scanner advances past the input that matched and returns the string that matched the pattern. If no such pattern is detected in the input up to the next line separator, then null is returned and the scanner's position is unchanged. This method may block waiting for input that matches the pattern.

so we have not asked the scanner for the nextLine() and since there are no more occorances of . on the same line it will return a null object.

All you are doing with your patten as well is getting the entire string on that line, therefor you don't really need to use a patten.

So I hope this helps, If you want to use the patten matching you will still need to advance the line with nextLine

Paul.Esson 53 Junior Poster

try replacing boysScanner.findInLine(".").charAt(0) with boysScanner.nextLine().charAt(0);

Paul.Esson 53 Junior Poster

I does not work when I compile it either.

You will find that the method boysScanner.findInLine(".") is returning NULL when you call it the second time. I don't know if this is because of how our consoles work ( mine is within eclipse ) or if there is some other reason for this. The boysScanner is not waiting for a keybord response it seems before executing the boysScanner.findInLine()

Paul.Esson 53 Junior Poster

How about having a method that thakes 2 params

1. How many iterations left.
2. Current String.

Something like ( but prolly not since i have just done this in my head and it would as always be bug ridden. )

string palindrome(String currentString, int iterations){
	iterations--;	

	Random r = new Random();
	char newLetter = alpha.charAt((int)r.nextInt(26));
	currentString = newLetter + currentString + newLetter;

	if ( iterations != 0 ){
		currentString = palindrome(currentString , iterations);	
	}
	return currentString; 
}

then when you call it you would do something like

String myPalindrome = palindrome("", 10);
Paul.Esson 53 Junior Poster

Your application is working for me, You do not prompt the user to enter the annualInterestRate, Although this is the first value you require.

You also prompt again for the annualInterest later, Perhaps you should only ask for this once.

Other then that it appears to be working fine, As well as I can tell, I am promted for my balance then my interest rate, then the applicaiton tells me how much interest i will make in a year and then pops it up using a dialog box.

Paul.Esson 53 Junior Poster

in unix

export CLASSPATH=newclasspathhere:$CLASSPATH

in windows

set CLASSPATH=newclasspathhere:$CLASSPATH

same deal with PATH varible

Paul.Esson 53 Junior Poster

You defined annualInterestRate twice

The variables number, symbol and letters are not defined before you attempt to use them with nextDouble also nextDouble does not take any params.

Paul.Esson 53 Junior Poster

Hi I know this post has not been updated for awhile, but I am facing the same exact problem like the original poster! Anyone knows of any update to this question?

I would still suggest using nohup atleast if the user closes the terminal you will still be processing.

You can use nohup as follows so your users can see the output of your script.

nohup ./test.sh | cat
Paul.Esson 53 Junior Poster

After I was completly wrong, I sent an email off to my dad, He has some experiance programming in assembler
Here is his response

sll $t0, $s0, 31
srl $s0, $s0, 1
srl $s1, $s1, 1
or $s1, $s1, $t0

Mips assembler is in the form
opcode destination source2 source1
Haven't used the MIPS but I do have the manual.

It's a macro
$t0 is a temp register
$s0 and $s1 will be source registers for a 64 bit value. $s0 is the
high 32 bits.

sll $t0, $s0, 31

Puts the low bit into the top bit position of $t1 assuming the shift
count is one based.

srl $s0, $s0, 1

s0 is shift right one and top bit position is zero.

srl $s1, $s1, 1

Remove the bottom bit of $s1

or $s1, $s1, $t0

or in bottom bit from $s0

It's a 64bit right shift $s1 is the low 32 bits, $s0 is the high 32 bits.

Paul.Esson 53 Junior Poster

I have a block of MIPS code that implements a pseudo-instruction operating on the values from two registers. The problem is i am having trouble undertanding what it does. The code is:

sll $t0, $s0, 31
srl $s0, $s0, 1
srl $s1, $s1, 1
or $s1, $s1, $t0

I think it is a divide by 2 checker? If any one can help me out with what it does, that would be great.
Cheers

I have little knolage of assembler but here is my thoughts

sll $t0, $s0, 31

We are shifting whatever is in $s0 left 31 places, assuming we have a 32 bit register.. this will mean that if the lowest bit is 1 then the result will be
10000000000000000000000000000000 and if the lowest bit is 0 then result 00000000000000000000000000000000 this will be put in the register dictated by $t0....

srl $s0, $s0, 1

shift whatever is in $s0 right 1 and assign it to $s0.. I don't see $s0 being used again.. therefor don't have a clue why we would do this...

srl $s1, $s1, 1

whatever is in $s1 will be shifted right 1 placed back into $s1

or $s1, $s1, $t0

or the two values together then place them back into $s1.
so since we have shifted s1 right one, Its highest bit will be 0, therefor the highest bit of the future s1 depends on the lowest bit of $s0.

Thefore what this appears to do, is if s0 is even, the resulting …

Paul.Esson 53 Junior Poster

Haven't been on here for ages....

cna i get a mail of the code please.

No.

But thanks for bringing me back to DaniWeb :)

Paul.Esson 53 Junior Poster

Hello everyone,


I want to use javax.comm to do serial cable communication on Linux platform. Currently, I can not find enough learning materials (tutorials and samples) from searching the net. Could anyone help to recommend some good ones?


thanks in advance,
George

Your quite lucky the newest version of the javax.comm libarys come with linux support now, so you don't need rxtx. If you look at the javax.comm package it provides some examples of code using the API.

I used it to make a simple application for sending SMS's through a GSM modem. It works quite well.

But anyway check out the API Specs

http://java.sun.com/products/javacomm/reference/api/index.html

and then check out the two examples
simpleread

http://java.sun.com/developer/releases/javacomm/SimpleRead.java

and
simplewrite
http://java.sun.com/developer/releases/javacomm/SimpleWrite.java

Paul.Esson 53 Junior Poster

Your problem contains the ans.

cout<<::x;

Paul.Esson 53 Junior Poster

Try

#include <iostream>

int main(){
        while((std::cout << "Hello World"<< std::endl) == 0){}

}

I would assume that like most things cout would return a +ive int if it has success :)

Paul.Esson 53 Junior Poster

why dont u send the program to me as an attachment to my mail id

A coupe of reasons

a. Rashakil Fol's post
b. it takes in total 3 lines of code

value = myList.front();
myList.pop_front();
myList.push_back(value);

you should prolly check to see that the list isn't empty first and of corse make the list and varible value , you can then use value, If your doing this in muliple parts of your program.

Its prolly advisable to make a function to do this for you, How far you want to go with this is upto you ( make a template if you will so it can take any type of varible and spit out a value.

If it is infact for an assignment and they havent told you to use any of the standard template libary, they may infact not want you to and if that is the case I would try the following.

1. Create a Linked list

Use an object or a struct ( what ever takes your fancy ) with a varible containing the data and a pointer to another struct of the same type.

Now if your doing a round robin kinda algorithem you may want the lists to be in a nice loop, so insted of having a start and an end you don't.

then make some kinda way of remembing where you are in the list (another pointer to a element) and then change …

Paul.Esson 53 Junior Poster

I did this in my C++ programming assignment.

I just used a STL list and poped from the front
and pushed to the back.

Paul.Esson 53 Junior Poster

Im not to certain, would depend on your terminal. there might be a way of stopping ppl closing the window in certain terminals.

Paul.Esson 53 Junior Poster

good stuff and good luck :)

A good thing to try with that code would be to attempt to write a word count.

Paul.Esson 53 Junior Poster

Try chucking a boot cd in and running a fsck on your hard disks
fsck.ext3 /dev/hda3 (or whatever depending on file system and where your linux disks are)

Paul.Esson 53 Junior Poster

have a look at www.perlmonks.org its a really good perl site

@args = ("command", "arg1", "arg2");
    system(@args) == 0 or die "system @args failed: $?"
Paul.Esson 53 Junior Poster

casting is what you need to do.

trying to get a apple out of an array of apples

Apple myApple = (Apple)appleArray[1];

when you put something into an array it is treated as an Object (as in the class object) as opposed to as the class Apple to look at it like it was an apple again you would have to cast it.

Hence the "(Apple)" I hope this helps..

also try to use the code tags (it make it much easyer to read), cheers I hope this helps.


NVM casting dosn't seem to matter with an array odly enuf


but im pritty certain that class member varibles will default to private and therefor be out of scope for reading outside of the class.

Paul.Esson 53 Junior Poster

Can't use VB.NET... ADO.NET is really easy to work with IMO

anyway, if you want to use vb6 have a look at the DB tutorials here
http://www.tutorialized.com/tutorial/SQL-in-VB/3889

Paul.Esson 53 Junior Poster

if your using .NET the answer is yes, absolutly indeedie. Microsoft wont shut up about there interopertability..

the whole exchange of varibles is spost to happen using the CLR (commen language runtime)

Implement a Java .NET class (If your lucky you can use the standard java api with this but i have never used java and .NET together so i wouldn't have a clue)

then use that class in your C++ program.

Good luck anyway, if that dosn't work do a google for "java .net interoperability"

this may help

http://www.alphaworks.ibm.com/tech/eclipsewinforms?open&ca=daw-rss-s8&S_TACT=104AHW63&S_CMP=AWRSS

from the sound of what I have read on the net you might have some troubles.

Paul.Esson 53 Junior Poster

if someone able to provide source code of any of clone like gaim . i need code for messanger that can work on yahoo
thanks

goto http://gaim.sourceforge.net/ click downloads then download one of the packages that say Gaim 1.4.0 (Source)

Paul.Esson 53 Junior Poster

there is no real way to stop a user from closing a window using a shell script.

but if your worring about your shell script being half way through something when they close the window.

use

nohup

this makes the process not honour hang up signals

NOTE: you will no long output stuff to the tty, so if you want user imput its prolly best to do as follows, run a process asking for the imput without nohup then run another process accepting the input from the command line with nohup.


I havent checked this but you may also be able to run a function as nohup, I don't know.

Paul.Esson 53 Junior Poster

Best to ask in the JavaScript fourm.

your looking for something client side not server side

Paul.Esson 53 Junior Poster

try SOL.akn.doc

(word documents have the .doc extention, windows hides known extentions)

Note: you will have a lot more luck saving something in notepad and opening the .txt since .doc is a binary format not a text format, it will basicly just output junk

also if you don't want windows hiding extentions in explorer go to
Tools > Folder Options > View and unselect "Hide extentions for known file types"

Paul.Esson 53 Junior Poster

try SOL.akn.doc

(word documents have the .doc extention, windows hides known extentions)

Note you will have a lot more luck saving something in notepad and opening the .txt since .doc is a binary format not a text format, it will basicly just output junk

Paul.Esson 53 Junior Poster

dcs_jr84 - You are right, that fixes the problem up :)

Let's Play Tic-Tac-Toe!
        Current Player: X               Current Player: O

                |               |
                |               |
X               |   X           |
                |               |
-----------------------------------------------
                |               |
                |               |
O               |   O           | O
                |               |
-----------------------------------------------
                |               |
X               |   O           | X
                |               |
                |               |
 Player 2 wins.

I am the WINNER !!

Paul.Esson 53 Junior Poster

I don't know what your doing wrong with the DVD buring, but my advice would be to send them over the network via windows networking to the windows machines.

Paul.Esson 53 Junior Poster

Both use rpm software packages...I have Fedora 3

RPM the worst package management system apart from slackware's.

Linux is really lacking good package management and RPM is right at the bottem of the barrel

Paul.Esson 53 Junior Poster

Hmm, well also Apple are moving over to intel next year so the machines price will drop a fair bit..

Note, you make one assumption, that a 1.8ghz G5 has the same computing power as a 1.8ghz P4. Clock speed isn't really the only thing that matters with computers, for instance a G5 has the altavec extentions (there spost to be damn good at vector processing) while the p4's do not.

I would say that a 3.2 ghz p4 would be a faster machine, But really unless your considering running Linux the construction of the operating system will have a large impact on speed as well.

Paul.Esson 53 Junior Poster

Work for yahoo on there messanger development team.

Its not a open sourced application, so your not going to get the sourcecode from anywhere exept for if its leaked.

There are open source messager clones that the source code is avalible for tho

Paul.Esson 53 Junior Poster

Im starting to catch up :D, i feel spesh

Paul.Esson 53 Junior Poster

woohoo 1 WU in less then a day !

Not a very big one though, only worth 69

Paul.Esson 53 Junior Poster

Sheesh oviously, This post is only a week old :P, anyway 2 folding clients on my Duel AMD 64 and also folding on my 2800+

Paul.Esson 53 Junior Poster

you guys still folding

Paul.Esson 53 Junior Poster

Interesting how this has been done in two different ways, one with exclusive or operator and one with addition and subtraction.

In java we could also use, XOR in the same way.

int a, b;

a ^= b;
b ^= a;
a ^= b;

Ok, so I have a little challange now. Bit of fun.

Today we are going to swap the nibbles around in a byte
so the byte 11101010 will turn into 10101110.

can use as many varibles as you wish, but there must be a varible at the end that contains the swapped byte.

Paul.Esson 53 Junior Poster

Or perhaps use Perl .NET for the perl part ?

http://aspn.activestate.com/ASPN/NET

Paul.Esson 53 Junior Poster

I was more looking for different approches people have used.

They way I ended up doing it wasn't very nice.

But I was thinking more like perhaps using a factory design pattern, but the real problem with something like that is the way my initial console application was created. The console UI created all the object as opposed to a say Runner class constructing the console UI and deligates being used to pass messages. Really when I look back this would have been the best way todo things, but sadly this wasn't how things where done.

Paul.Esson 53 Junior Poster

I was wondering if there is anyway to make Windows Forms do certain tasks whenever its shown ?

- Thanks in advance Paul

Paul.Esson 53 Junior Poster

What kinda appoch would people here take for tacking a gui on an already existant console program.

Paul.Esson 53 Junior Poster

Outputs a space dilimited file with the field names at the top.

Might be worth opening it with Excel or Openoffice calc using space delmimnation... Might be abit neater

Paul.Esson 53 Junior Poster

I think it should be in java.prof.

-prof Starts Java runtime with java(1) profiling
enabled. By default, this puts profile
results in the file ./java.prof. This option
only works with java_g.

-proffile Starts Java runtime with java(1) profiling
enabled. This form of the option allows the
user to specify a different output file for
the profile information. For example, the
option -prof:myprog.prof enables profiling
and puts the profile results in the file
myprog.prof rather than in the default file
./java.prof.