Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

A tertiary expression is evaluated like so:
(logical expression) ? (value if true) : (value if false)
So given your values of p and q, you can use them each with an expression such as

p ? 1 : 0
q ? 1 : 0

Tertiary expressions can be used most anywhere that a variable could be used, though in many cases you will need to surround them with parens to force evaluation before the rest of the expression. Example:

p = false; q = false
  System.out.print((p ? 1 : 0) + "\t" + (q ? 1 : 0) + "\t");

I am not necessarily saying that is the best way to accomplish changing your program to use 1 and 0 instead of true and false, but tertiary expressions are a way to return 2 different values based upon a logical expression.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I think that is best up to you to decide for the exercise.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Have you browsed the forums at all? This question is asked all the time in one form or another.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Just use a tertiary expresssion:
int value = booleanVar ? 1 : 0;

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I agree, marijuana should be legalized. Salem already posted most of the reasons for this and I agree with them. Alcohol is far more harmful than marijuana will ever be.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Brian Lumley's Necroscope is another good vampire series.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Take a look at the "icobundle" utility here:
http://www.telegraphics.com.au/sw/

I think it will do what you want.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No. Random letters will rarely if ever generate executable code.

Though one thousand monkeys typing on one thousand typewriters...
:)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'll make the assumption that the email you sent had reasonably proper punctuation and spelling, unlike your posts (which walk a fine line of understandability)... :icon_wink:

hehehe... These were my thoughts as well :P

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If he did Pearl Harbor then I doubt I'll make any effort to see this one. Pearl Harbor was absolutely abysmal.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I didn't care for Rice's romanticized version of the vampire. I didn't even bother finishing Interview With A Vampire, it just didn't appeal to me. I think Salem's Lot was the best vampire book I've read.

It is definitely a great book. While Koontz is enjoyable to read, I'd push It up the list before Koontz any day :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Take peter_budo's advice. You need to ask this question in the iReport forum. The error is originating in one of the iReport classes as can be seen from the stack trace.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This is the exact question that I answered in your other thread:
http://www.daniweb.com/forums/thread82407.html

Please do not make multiple threads for a single question. You now have three threads for the same thing and it only causes clutter and confusion.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This is the exact question that I answered in your other thread:
http://www.daniweb.com/forums/thread82407.html

Please do not make multiple threads for a single question.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, King can certainly crank out the pages. :)
The Stand and It both came in over 1100.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sorry, you're reaching a bit too far past my Java networking/internet skills for me to be of much additional help.
I glanced at the page source for the login and there are several hidden form fields in addition to the account number and password. No idea what you would need to do for those.

It would be easier to just pull the csv text from Yahoo! :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Post what you have so far. If you have been paying attention at all in class then you should have an idea how to write something in pseudo code. The forums are for getting help - not a magical homework completion service.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your question isn't very clear. You want to convert an array of a specific type, like String[], to an array of Object[] ?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use the Split method (member of String) to split the string on commas. The Split method will return an array of Strings.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

So you have read `The Dark Tower' serie by Stephen King?. What do you think of them?. Where you happy with the ending?.

Yes, I enjoyed the series. The end was not exactly what I was expecting though. I'll leave it at that in case others here are reading it or are going to :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Did you enjoy Deception Point?. I presume you read it, since he doesn't have many and you read three.

No, I've not read that one yet. I've read 'Angels and Demons', 'Da Vinci Code', and 'Digital Fortress'. I'll probably pick up Deceptoin Point sometime from the used bookstore.

I've also read nearly all of Dean Koontz's, Stephen King's, Clive Barker's, and Robin Cook's novels.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sorry, my bad. I derailed this thread.
I really liked Digital Fortress by Dan Brown; same author that wrote The Da Vinci Code.

Yes, Digital Fortress was a pretty decent story. The only issue I have with Dan Brown's books, at least the three I have read, is that they are somewhat overly formulaic in the plot elements and development. Even so, they are at least an interesting read and he does have a good imagination for conspiracy fiction.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

But it's war! Look at Iraq, and the war on terror.. we have not done as well as we though. Why? Mostly because the damn media is there defiling the troops. They always portray everything in a negative light. If we were to send the media away, and let the military handle things their way.. who knows- maybe the war would be over tomorrow. They could torture, kill, destroy anything they wanted.. eventually we would destroy the terrorist networks.

Hook, line, and sinker.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It is impossible for us to do anything about the CIA, though. They are a secret organization run by the government. So long as the government is kept in check, all of its programs should follow into place as well.

I basically just believe the government should be constantly checked by the people to ensure that no civil liberties are lost. The CIA, however, is trying to ensure the American citizens are not harmed by other nations. I am a strong believer of allowing the military (including the CIA, NSA, etc.) to do whatever necessary in order to ensure our safety. If the military is torturing other people b/c they believe those people may be a threat to national security then so be it. I don't find anything wrong with that at all (unless the people being tortured are American citizens). The CIA should be allowed to do whatever they want to accomplish their goal (within a limited boundary, of course).

I don't think I am explaining my views efficiently.. they are not contradictory. I just view the CIA and government operating in different realms of limitation.

The people picked up off the streets, held without charges for long periods of time, and interrogated mercilessly when they have done nothing wrong whatsoever may tend to disagree with you.

I am not saying the agencies should be prevented from making investigations effectively. I am saying that giving them a blank check do "do whatever the hell they want" in the …

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well i can't spell first off :P
And most smokers are genuine nice people like yourself, who do care for others around them, but a proportion of smokers are just plane idiots who don't give a care in the world, and when they puff the smoke out, it goes right into your face. It's those sort of people that i just want to punch in the face quite honestly! And i'm not violent!

I understand that and figured that you did as well. I posted to call attention to the overly broad generalization.

Personally, I will not smoke in the home or car of a non-smoker even when they tell me it's fine to do so. I decline to sit in the smoking section of a restaurant when I am with non-smokers. I can wait until I am outside. I don't think this makes me special or a saint - I think it's just consideration of those around me.

Lack of consideration is a human trait - not a side effect of smoking.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I'm not saying the CIA can't become corrupt.. only that b/c they are so secretive, the American citizens would not even know if any CIA members did anything against the law. Because of this secrecy, it is pointless to suggest their corruptness... we can only hope that they are still on our side ;)

It is far from pointless to question things done in secret and merely hoping they are doing the right thing does little to ensure it.

I would just encourage you to think about the contradictory nature of the two positions you espoused. They cannot work together. Oversight and accountability are inherently necessary to preserve the freedoms you value.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

To put it in a way that you can understand it better: The effects of government decisions are directly related to all citizens, and can easily be traced to the government. The CIA operates under anonymity, and thus, its decisions do not affect us all, and neither can they be traced directly to th CIA.

I understand it perfectly, which is why I am trying to get you to understand the innate conflict of your statements.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

So, an agency that is directly under the control of the government - and no one knows what that agency does - should be able to do whatever they like.

Re-read your post and tell me if that is not exactly what you state.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I do agree that we should be careful with how the government interacts with our lives. As in 1984, the government first restricts small liberties which virtually do not affect its people. Over time though, these restrictions became fascist until the government was no longer run by the people. Also, I'd like to mention the movie "I, Robot". Hah.. A somewhat interesting and exciting movie. But it brings about a good point. The computer program who tried to take over the entire human race used the logic that humans' worst enemies are themselves.. and it is best to protect humanity from itself. While such logic is truly 'undeniable' it is also inhumane, and against what we as a society want. We should be very careful how the government handles civil situations.. we do not want to end up under complete control of totalitarian rulers.

From the CIA thread:

personally think the CIA is kick-a$$, and should be allowed to do whatever the hell they want.. So long as America is not attacked I really don't care how the CIA handles their business. I think it would be awesome to work for them.. or the NSA.

Do you not see how these two viewpoints are completely at odds with one another? You can't have it both ways. Choose wisely and keep these things in mind when elections and key legislature votes come up.

Quoting Ben Franklin:
"They who would give up an essential liberty for temporary security, deserve neither …

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well it is just general curtsy to stub it out while eating, what about asthmatics? No one thinks of the suffering they have to go thorough near smokers. And also why do all the smokers have to smoke in the door way to places?!? I want to get into a store without getting a puff of toxic crap in my face.

Rather liberal uses of "no one" and "all" there don't you think? Some of us "smoking fools" do actually consider those around us and make every effort to keep our smoke away from non-smokers. Keep that in mind before you make ignorant blanket statements about "all smokers". Some of us do actually afford others common courtesy (not curtsy) - even those who most likely do not deserve it.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually, none of the responses even touch on the nature of the original post.

I am also married to a lovely wife. But due to the American Immigration policy I have been separated from my wife for last 18 months. I could not bring her with me after marriage since current immigration laws prohibits spouses and kids of lawful permanent residents(Green card holders) to bring them right away after marriage. The law do not consider them "immediate relative".

The issue is that spouses and children are not considered immediate relatives. Personally, I can't think of any way in which they would not be considered as such.

I am not supporting an effort to change it necessarily, but I did want to emphasize the distinction. This is a technicality of our current legal immigration rules and has nothing to do with illegal immigration.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Just curious, but when you say you have 'failed miserably', do you mean those you have found were of lacking quality or have you been unable to attract candidates at all?

I will somewhat echo what kmillen stated about environment being a very large factor in retaining a quality development staff. It can be difficult to get an accurate gauge of the work environment when evaluating a potential position. If your current employees like their positions, ask them what they like about the environment and stress that in your candidate search. If the current employees hate it, perhaps you should find out why and make some adjustments before you find yourself filling those positions as well :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your question is not very clear at all. You wish to know how to open and view a text file in Java?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ah, much better ;)

I disagree, though. When LOTR came out, it isn't like the literacy rate was significantly lower than what it is now..

It was written in the 50's and I am fairly certain that literacy rates were much lower.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

No, people were more literate back then than they are now. I give the above-quoted text as evidence.

It is a compelling argument....

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

... they don't choose to inhale smoke, and they do not enjoy the atmosphere. But, hell.. if every restaurant is like that what can you do? Who doesn't enjoy the occasional trip to a restaurant for good food?

Non-smokers in the absence of smoking bans?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Smoking in public is banned in the UK.

I assume this is indoor public areas? Any allowances for pubs?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Did you look at the code in your demo folder? Getting the data into a JTable is really not too difficult and you should be able to modify those examples pretty easily to meet you needs.

You can fill a DefaultTableModel very easily by supplying a vector of the column names and a Vector of Vectors containing the data for each row. After the model is filled you call JTable.setModel() to make it use the model you generated.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Hmm.. but where do I enter my username/password?

You will probably have to send those as a POST request and store the cookie or session ID that is returned by the server. Take a look at the page source to see if they are using a form for login and what parameters are being sent. I'm just speculating here, as I've never played around with http and web requests all that much.

As far as the ssl connection, see the following Sun info on Secure Socket Extension:
http://java.sun.com/j2se/1.4.2/docs/guide/security/jsse/JSSERefGuide.html

No, I downloaded the full version.. the YahooStock.java program still doesn't execute. Even with the libraries that were installed.. I think there is a problem with it finding the libraries..

What editor are you using? You will need to add them to the project classpath and how to do so is specific to the editor.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You have defined 'columns' locally inside a try-catch block and are attempting to use it in another block. Move the declaration outside the first block so that it is visible to the second.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As I mentioned in the last sentence of my post (as well). ;-)

Yep =)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You might want to look at JFreeReport.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ah, hell..

Anyone know how to connect to a https website? I've got a username and password, but I have not a clue in the world as to how to code for this.. I've checked online, but to no avail :(

This is a short example I found over in another forum (I've never used HTTPS myself):

import java.net.URL;
import java.io.*;
import javax.net.ssl.HttpsURLConnection;

public class Test
{
    public static void main(String[] args) throws Exception
    {
        String httpsURL = "https://your.https.url.here/";
        URL myurl = new URL(httpsURL);
        HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection();
        InputStream ins = con.getInputStream();
        InputStreamReader isr=new InputStreamReader(ins);
        BufferedReader in =new BufferedReader(isr);

        String inputLine;

        while ((inputLine = in.readLine()) != null)
            System.out.println(inputLine);

        in.close();
    }
}

Also, on that JScrape:http://www.apsquared.net/JScrape.html

The program doesn't work for me.. I think there is a problem with the custom libraries.. how do I load them so I can import them properly?

I assume you downloaded the "Lite" version? All of the libraries they mention are freely available, however on the site there is a "JScrape Full" link to download a version that includes all of the third party libs.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ahh... now this makes sense :) Thank you.

I want to use pixel locations because my next project is a game where I draw images and they get moved by the keyboard. Therefore, I think it is easier to use a NullLayout and use pixels.

I still have one more question, however. When I run the game, the buttons do not appear. They do not appear unless my mouse moves over them. Why?

Try adding a call to validate() or repaint() after you have added all components. Since you are using Null Layout, the mechanisms for notifying the container to redraw itself may not behave in an expected manner. When you mouse over something, the window redraws the portion behind the mouse cursor, so this is probably what is causing the buttons to become visible.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Nicotine rivals heroin in terms of addictive power. This in itself makes it difficult to just stop. The rest of equation comes from the psychological adaptations ingrained into the smoker - the "self-brainwashing" if you will. Until someone has smoked for a period of time, they cannot know the extent to which it can become ingrained into your life: your mundane daily routines, self-image, stress coping mechanisms, sense of satisfaction, and many other areas we don't usually consciously give a lot of thought to.

Do not discount the difficulty of giving up nicotine for most people. Many of us smokers keep smoking wishing we could quit; that one day we would just magically stop. We can quit of course, but it really screws with your head for a few weeks and is very stressful.

Personally, I've been "seriously going to quit" for about nine months now - and the quit date stays the same - "soon".

Keep in mind, every smoker eventually quits.

In the same vein that all bleeding stops - eventually...

~s.o.s~ commented: "all bleeding stops - eventually..." - That was deep :( +23
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I would hardly call that evidence.. perhaps the smokers where you live are nice, but the ones here in texas are rude.. The evidence needs to be documented and places from all over the USA tested.. or else it isn't valid statistical data..

So you have performed statistical research on the rudeness of Texas smokers then, right? I mean, without that documented evidence, some might think it was merely anecdotal... :wink:

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, there are a ton of Java tutorials out there online and which one you will find most helpful depends on your programming background and the authors of course. As a starting point, I would recommend the Sun Java tutorials at http://java.sun.com/docs/books/tutorial/.

If you need more then a web search on "Java tutorial" will yield more links then you will probably ever want to read.

If you run into specific questions about material you read but do not understand, feel free to post here for additional clarification.

Good luck and have fun!

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you've got Firefox (I don't know about support else-browser), you might be interested in the Groowe Search Toolbar. I use it for Wikipedia sometimes, but Clusty is my default.

There is another pretty handy Firefox add-on called "Research Word" that allows you highlight a word in the browser, right-click, and search for it in several different place like Wikipedia, Google Definitions, Dictionary.com, etc.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, if you must use fingerprint scanning then I would imagine that the hardware probably includes software for the management of prints and matching. I can't be of much help though on suggesting that hardware, sorry =(

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I would imagine that you have inconsistent versions of the jar files. It seems to see the class fine, else you would get a NoClassDefFound error. NoSuchMethod errors occur when the program can't find a matching method signature on the class. If you have installed any new jars or tried to swap different jars into your installation, there is probably an API conflict.