Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I need to a have a CHAT WINDOW in my business website.
Please how can I achieve this?

You don't mention what language you are using for your site, but you might want to look into Joomla if you are willing to consider something PHP-based. It has a ton of modules available, including chat and forums.
http://www.joomla.org/

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I will give you a website address:

Could you kindly have a look, my idea is most probably like this

http://www.pms.ifi.lmu.de/software/jack/docu/doc/VCHR-Manual.html#sec:Using

Ah, yes for that you will have to use the Graphics2D api to draw your graphs. There isn't any standard component for things like that. As for the constraints, you need to design classes for those based upon whatever optimization methodology you are employing. The tutorial link for 2D Graphics should get you started with the visual part.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, really you just need to run queries on the database for any records that conflict with the constraints. Those records can then just be shown in a table or list. For that matter, the entire schedule could be shown in a table with conflict cells higlighted by color or something.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Not sure if you are storing the ID as a number or a string in the db, but if it is a number then drop the single quotes in the where clause. Other than that the SQL look just fine.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
F:\JAVA\Java Files\Lab3\DellCustomer.java:3: cannot find symbol
symbol  : class Stirng
location: class DellCustomer
    public static void main(Stirng[] args)

Just a spelling error - I think you mean String.
^

F:\JAVA\Java Files\Lab3\DellCustomer.java:5: cannot find symbol
symbol  : constructor Customer(java.lang.String)
location: class Customer
        Customer neel = new Customer("Neel Smith");
                        ^

Look again at your Customer class constructor and compare that to the constructor (parameters) that you are using.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Being jewish isn't that bad, then you could eat gefilte fish and lox. Maybe you would have a chance of being a big comedian too!

I didn't imply that being Jewish is bad, just that I'm not Jewish.

I figure they probably would allow me to eat gefilte fish and lox too if I were inclined, but I've never asked them (nor would I know which "them" I could ask to impart upon me the permission of all Jewish to consume a particular preparation of fish).

I think Richard Pryor did okay for himself without being Jewish as well.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Hrmm, well I guess it bears similarity to Ezra, but it's just a made up name I used for a game character for awhile =P

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ham sandwich? Here I thought you were jewish. Corned beef on rye sounds better!

I'm not Jewish in the least - atheist, in fact. What gave you the impression that I was Jewish?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ham sandwich and chips at work - same as yesterday... and the day before... and the day before... and, yeah, well you get the picture.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Surely the util.Calendar stuff should contain something relevant?

Yea, a combo of Calendar and DateFormat, though not very intuitive unfortunately:

Calendar now = Calendar.getInstance();
         System.out.println(new SimpleDateFormat("EEEE").format(now.getTime()));
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Free speech is, of course, one of the core foundations of our contry and I would not presume to infringe on anyones decision to exercise that right...but I believe that with that right should come the responsibility to exercise it responsibly...

Responsibility seems to be a fading concept these days.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Maybe you would find an idea by using the search feature of the forums - there are about 2 million posts for "final year project" help...

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I can't see what you are wanting to accomplish with this code

foreach ($nvalue as $key => $value){
$nvalue[]=$value;
}

the following shows your array is just fine as it is

foreach ($nvalue as $key=>$value){
 echo $key."=".$value."<br>";
}

Why are you overwriting the array values?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

File.lastModified()
You can't get creation date without using native code though.
http://mindprod.com/jgloss/lastmodified.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Unless you are parsing XML streams, you would find it simpler to use the DOM parser, which uses a Document model instead of the event-driven stream parsing of SAX.

Info on using both types of parsers is here:
http://java.sun.com/xml/tutorial_intro.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need J2ME:
http://java.sun.com/javame/index.jsp

(and why are you advertising the links at the bottom of your post?)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You just need to save the class in a file called PayrollApp.java. It works just fine. I'm assuming your file name does not match the class name.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Only if they must be stored as strings. If you provided sample input and output and indicated what you need to do with the output, it would be helpful in answering the question.

If it is only a matter of displaying them with leading zeros to the user then there are several formatting methods availble for that (i.e. String. format , Formatter , DecimalFormat )
Example:

int x = 123;
         int y = 23;
         DecimalFormat df = new DecimalFormat("0000");
         System.out.println(df.format(x));
         System.out.println(df.format(y));
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Erm maybe because 08765 isn't an integer?

Exactly. If you really need leading zeros then you have to create that String representation yourself - which will undo the whole point of converting in the first place.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

i love holland.....

... and ... ?

I'm a hot woman from Holland

No... you aren't.

Hey, are you that on your pic? What is your age?

If he are that on his pic, he age are what his is.

i'm sorry i'm new here.

I'm sorry you are new here too.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I don't know - but it has nothing to do with PHP so perhaps you should post such general ponderings over in the Geek's Lounge?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, the draw method will draw between the two points you enter, so perhaps part of the issue is actually with the coords you are supplying, but perhaps you are looking for something like

int left = Math.min(x1, x2);
int top = Math.min(y1, y2);
int right = Math.max(x1, x2);
int bottom = Math.max(y1, y2);
canvas.draw(this, color, new Line2D.Double(left, top, right, bottom));

??

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You will of course have to implement a paging mechanism if your results exceed rows*columns and you will need to get all of the items into a single array before you generate the <tr> and <td> elements. The following example code shows how you can generate the table you want

<?php
$data = array("a","b","c","d","e","f","g","h","i","j");
$rows = 4;
$itemCount=count($data);
echo "<table>";
for ($row=0; $row < $rows; $row++){
    echo "<tr>";
    for ($itemIndex=$row; $itemIndex < $itemCount; $itemIndex+=$rows){
        echo "<td>".$data[$itemIndex]."</td>";
    } 
}
echo "</table>";
?>
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, you don't say where you are in the learning process, but wanting to do a graphical game is a bit beyond the basics. I'd recommend something text-based from the console before you get into Swing and 2D graphics.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You're right - you didn't follow number 3 correctly. Your code is adding the new coordinates to the old when all it needs to do is set them

x1 = xNew1;
         y1 = yNew1;
         x2 = xNew2;
         y2 = yNew2;
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

hi everyone
i have a very a very basic question in mind .. i wanted to discuss ..

Difference Between these?

String s1= new String("java") ;
String s2="java" ;

Strings are immutable in Java and the String class maintains a pool of String objects that have been created. Using a String literal, as with s2 above, the String class will return the reference of the existing String, so all references to equivalent String literals will point to the same String object. When you create the String with the new String("java") constructor, you will actually get a new copy of the String "java", not the reference from the String pool. The following fragment of code will demonstrate this

String a = "java";
         String b = new String("java");
         String c = "java";
         System.out.println("a==b : "+(a==b));   // false
         System.out.println("a.equals(b) : "+(a.equals(b)));   // true
         System.out.println("a==c : "+(a==c));   //true

what for 2 different classes are there in garbage collection?

System.gc and runtime.gc ( both are doing the same job)
what is their individual role?

please anyone explain me....

They are effectively the same. This is stated in the API documentation for the two methods.

The call System.gc() is effectively equivalent to the call:
Runtime.getRuntime().gc()

The method System.gc() is the conventional and convenient means of invoking this method.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

See bold red comments in the code:

I having a small problem with the output on the Your CD's side, they are only viewable if I double click inside the pane, then they show up, almost like the pane is on top. How can I fix, I have tried moving things around and changing the TextArea to a TextField, but to no avail.

/**
 * Write a description of class CD here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class CD
{
    //The purpose of this class is to create the object of the CD with a title, category,
    //rating, artist
    private String artist;
    private String title;
    private String category;
    private int rating;
    public CD()
    {
        //constructor
        artist = "";
        title = "";
        category = "";
        rating = 0;
    }
    public CD(String _title, String _category, int _rating, String _artist)
    {
        //for ease, allow a constructor that asks for 
        //all information at the beginning
        
        title = _title;
        category = _category;
        rating = _rating;
        artist = _artist;
    }
    //methods to retrieve information
    public String getArtist()
    {
        return artist;
    }
    public String getTitle()
    {
        return title;
    }
    public String getCategory()
    {
        return category;
    }
    public int getRating()
    {
        return rating;
    }
}

 
 
/**
 * Write a description of class CDTester here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.border.EtchedBorder;
import java.io.*;
// The purpose of this class is to …
peter_budo commented: Great debuging machine ;) +6
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You are missing an open paren "(".

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ok, I think I know what is causing your issue. Check your db.conf file for the root_path property. If you left it set to the default 'jvm' then you need to change that to use "configuration" as below

# root_path - If this is set to 'jvm' then the root
#   path of all database files is the root path of the
#   JVM (Java virtual machine) running the database
#   engine.  If this property is set to 'configuration'
#   or if it is not present then the root path is the
#   path of this configuration file.
#   This property is useful if you are deploying a
#   database and need this configuration file to be the
#   root of the directory tree of the database files.

root_path=configuration
#root_path=jvm
iamthwee commented: spot on! +11
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You'll have to read from one file and write what you want into another. As you scan your input, when you find line.startsWith("Acknowledgement") then keep reading lines but don't write any data until you get to the line.startsWith("Introduction").

I hope you aren't stripping copyrighted material of all copyright and acknowledegment info and presenting it for download though...

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You don't even need the new File("") part - the method is static.

for(File drive : File.listRoots() )
    System.out.println(drive);

:)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well, your question barely makes sense given the code that you posted (which needs code tags too). Maybe this example of writing to a file will help http://www.exampledepot.com/egs/java.io/WriteToFile.html

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As I understand your requirement, you only need an array coffee[numberOfAisles][numberOfBins]. I don't think you need to have a different number of bins per aisle, so you can create the array directly from the two questions without looping.

You will need to loop the array when you total the weight. Which you currently are not doing.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You need to reset index and tmp before scanning each line. Also you don't have any checks on index vs strLine.length() so if you did have a line with no spaces in it you will get an index out of range.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That's not much of a question. Care to be a little more specific?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Actually swing is the base of Java graphic, because when you work on swing you have to cover all the fundamentals. So it is good to start.

By yourself working, it will take little more time to do your work successfully.

I understand the connection you are making, but one can make UIs with Swing without having to directly use any of the Graphics or Graphics2D methods. Only when he gets into wanting to produce charts and graphs would he need to learn the Graphics2D API.

That is the reason that I mentioned them separately. They can be treated as two independent subjects basically.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

there is this code

$var1='done'
header("Location: index.php?$var1");

and now want to pass the value in the variable $var1 and store it in another variable in index page

Ok, to do that you will need to change your redirect url a little bit. Variables are passed with a name and a value, so you would send it like so:

header("Location: index.php?var1=$var1");

In your index page, you retrieve it from the request like this

$var1 = $_GET['var1'];
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ok, think about the operations that need to be performed to add, modify, and delete:
Add: Create a new product object and place it in your array. Since your array is currently full, you will have to make it larger.
Modify: The easiest. Just replace the values of the current product object with the values from your fields.
Delete: Remove an object from your array. There are a couple of ways to handle this, but probably easiest to shift all objects in positions higher than current index down and make the empty position at the end = null. Deleting things in this way will leave nulls in your array, which your navigation operations will probably need to check for and skip over.

I don't know if your classes have gotten to collections yet, but the things you are doing are easier to implement with a List. Look at the javadocs for ArrayList (or Vector would work too) and this tutorial is a very basic example of using it: http://www.anyexample.com/programming/java/java_arraylist_example.xml

peter_budo commented: This one is a realy difficult case ;) +6
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Hi Eiolin

I know a good resource of solving these types of issues.
<url snipped>

Hope it's helpful to you!

[wilkin]

I don't think advertisements were what he was looking for... and that site has to be the most ridiculous I have seen in a long time! Thanks for the laugh anyway! :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Session ID should be a unique hash for every session. If that is stored as a cookie with no expiration on the visitors machine it should suffice.

(demanding "Solve it!" is just plain rude as well and may leave you solving your own problems without help)

iamthwee commented: He said "slove it", that's not rude :) +11
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I think you want to increment "countChar "instead of "count" in this statement

if(Character.isWhitespace(NB.charAt(i)))
 {
   ++count;
 }

:)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Well spotted adding of Action Listeners is my mistake, I did not take it out when I edited code last time.I'm used to top level event handling insted of dkdeleon68 anonymous...

Well, he can do it either way: with the single listener that checks the source of the ActionEvent and operates accordingly, or with a separate listener for each component - but having both is probably causing the confusion right now. It's probably best to pick one way and stick with it at this point :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I assume you have already tried scrollPathToVisible (TreePath path), which will ensure that the path is visible, but not necessarily at the top. You will probably have to play a bit with scrollRectToVisible (Rectangle aRect) and creating a Rectangle that produces the desired result. Beyond that you could work directly with the JScrollPane and JViewport to position it at a desired coordinate. That will take a bit more experimentation with the various relative dimensions of the selected node and the containers.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Two free online books:
Main Page - Practical PHP Programming
PHP Essentials - Techotopia

Since you have been programming before, those should get you up to speed pretty quickly. For specific examples of many things try http://www.goodphptutorials.com

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Store the session id, or other uniquely assigned number, in a cookie.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Thanks. That's what I thought too. I just spent some time looking around, and I didn't see anything. I tried moving the selection call to the end of the constructor, but that didn't work. Oh well, I guess I'll just make a note of it to one day play around with it again - if there's time.

Thanks for your help.

- Bryant P.

Ah, you have the call in the constructor? I was fiddling with some demo code to verify my suggestions and I did have some problems with selection behavior when the call was in the constructor - it just would not work correctly. When I moved that same code to a button it worked just fine. You may want to try moving the selection code to another method that executes after the component is fully constructed and rendered.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Hi
I am looking on Graphics JAVA API. Where i can create an UI and interact with it, kind of Graphs, Charts etc.,

The graphs and charts can be done with the 2D Graphics api. The tutorial posted above by eranga262154 is a good start to working on that.

The UI itself involves using the Swing packages. Tutorials on using Swing can be found here: http://java.sun.com/docs/books/tutorial/uiswing/index.html.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

HI
Iam ready to do this project. Please send your requirement to this email id : <email address removed>

Regards
Deepak Xavier

This thread is not seeking someone to complete this work. It is merely discussing some technical questions that the original poster has. Please do not hijack threads offering to solve them for pay. This is not the forum for that.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Not really. If "path" terminates at that directory node, then setSelectionPath(path); should leave it selected. Are you certain that your TreePath actually ends at that node, not above or below it? Is nothing else resetting or clearing the selection path? Those are the only things I can think to check.