Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Use String.valueOf(int) to convert your int to a string for the writer.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Moving to Networking, as I think this is outside the scope of HTML/CSS.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Is this not simply a variation on your other question here?

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Ankit, many people already took the time to answer this question of yours several days ago:
http://www.daniweb.com/forums/showthread.php?t=365359

If you still have questions, please confine them to that thread rather than simply re-posting this question.

Closed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I would reconsider whether that many timers are needed at all.

Generally a single timer is user for animation. It updates all component locations as needed and then repaints.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

We can just move it :)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As I Lay Dying - The Sound of Truth

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, the first two are adding default parameters and forwarding to the next more complex method signature.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> you will see...that this is only LOGICAL.
No, there is very little actual logic in either of your posts.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

It is the same.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Nope. Show some effort if you expect help with your homework.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> Something cool and hip like Pandora would definitely make the street credibility of MSFT go up for sure.
Or it would ruin Pandora.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

If you want to work with DOM, JDOM is very easy to use.

As far as replacing values found with xpath, you just alter the elements and then write the document model back out to the file.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

The path to your database can be specified in your JDBC connection URL. See the following page about that: http://db.apache.org/derby/docs/10.8/devguide/

Examples are shown on this page

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That's a JVM crash message, not an exception. Check the hs_err log file indicated and search the net for the specific crash info reported there.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Why do you need to start the db as a server at all on a single machine? Do you have more than one client sharing the data?

In your earlier posts, it sounded as if you were wanting an embedded database for use with a single application instance.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Static X - Bled for Days

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I don't think anyone here is going to advise you on how to accomplish such an underhanded goal.

Putting backdoors and such on your client's machines is completely unethical.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> And when a guy goes around raising dead people, then is raised himself...well, that should cause us all to put some weight into what he said!
Definitely.

I always listen carefully to those who have risen from the dead.

You'll want to stand a little back from them when they're speaking, but you should listen very intently.

ddanbe commented: Also love the thing about your cat :) +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You mentioned that it was a jpg. Will it be loading other jpg files based on input or actually altering the image in real time?

If you're loading from files, then JLabel is probably still an easy solution. If you're altering an in memory image and displaying it with Graphics.draw() then you could use any custom component (extend JPanel, JLabel, or JComponent) with an overridden paintComponent() method.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

GridBagLayout would be best.

Use a JLabel to display the picture.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Here's a simple solution: he pays you, you hand him the laptop.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You haven't asked a question. Copying and pasting the assignment is not the same.

From the forum rules:
Do provide evidence of having done some work yourself if posting questions from schoolwork assignments.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Post what you have started with and ask specific question.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Your links are broken.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Then show them the tutorial linked above. Why do they have admin responsibilities if they don't know how to perform them?

Are you deliberately being obtuse or is this really that difficult??

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

This is a technical discussion forum - not a chat about "real love".

Since there doesn't seem to be any technical merit to this thread, I'm moving it to the lounge.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

As already stated above: ask your admin.

You asked for more specific information and it was given to you. If you don't have the permissions to do what you need to do, you obviously have to ask the person who can grant them.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

So far as you assume.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> You CAN know all this for sure. Ask God and he will reveal it to you.
Well, I asked my cat about it instead and he said I would never die so long as he needed feeding and that I would be rewarded eternally for this service.

I think he may be just making crap up to serve his own ends though.

diafol commented: Guffaws loudly :) +0
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> But I'm still reading, so there must be more to it than that.
Maybe not. Maybe it just starts repeating itself ;)

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Much of that "free stuff" is pirated material and discussion of that is off the table here.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

> and I can't get what everyone else supposedly is getting ?!?!?
Well, ask them then.

Be careful how you ask about such things here, as discussion of illegal activity is not tolerated at all.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Please clarify your specific technical questions.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Is it possible that you have included an old version of the Carrot2 jar? Because the archived 2.x version API does not have that constructor for DirLocator. It only has the DirLocator(String) constructor.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

That all looks reasonable to me. Assuming you don't have any custom classes named File or DirLocator within that same package, I would wonder if some other issue is preventing the Eclipse parser from correctly seeing that constructor. It's obviously there and is public.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Post the import statements for your class.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try using H2 or JavaDB instead. Both are embedded databases that do not need to be separately installed.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Try H2 if you want a local embedded database for use with Java.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Additionally, the Acceptable Use Policy is linked at the bottom of the forums.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Moving this over to the JSP forum. I think you'll find a more familiar audience there.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Don't use table.setValueAt() for adding data to a table. Add the data to your table model and fire a tableChanged event.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

You can squash it down a little bit if you want

String req = "java,C++,Assembly,Lisp";
        String qualifications = "Java,C++,C,php,assembly,mysql,html,power designer,photoshop";
        List<String> re = Arrays.asList(req.toLowerCase().split(","));
        List<String> skills = Arrays.asList(qualifications.toLowerCase().split(","));
        int counter = 0;
        float perc = 0;
        for (String require : re) {
            if (skills.contains(require)) {
                    counter++;
            }
        }
        System.out.println("REquirements " + re);
        System.out.println("tech  " + skills);
        perc = counter / (float) re.size()*100;
        System.out.println(perc + "%");

but your approach is essentially fine as it is.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@mKorbel: The original example I hacked this together from had no components except the panel.. setBounds() was convenient to make the frame actually have non-zero dimensions. setLocation() does not do the same :P

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Yes, that should be fine for the graphics panel, though you don't need a repaint() in the constructor. If you want the graphic panel on the left, you'll have to add it to the WEST section and you'll need to use setPreferredSize() to size it if it contains no components of it's own. Small example thrown together from another old example of drawing

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.Timer;

public class LinePanel extends JPanel {

    Timer animationTimer;
    float angle = 0f;
    int lineLen = 60;
    int x = 20;
    int y = 20;
    int moveX = 2;
    int moveY = 2;
    double angleChange = Math.PI/20;

    public LinePanel() {
        animationTimer = new Timer(30, new LineAnimation());
        animationTimer.start();
        
        // setting preferred size here because empty panels won't have any inherent size
        setPreferredSize(new Dimension(100,100));
    }

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2d = (Graphics2D)g;
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

        double dx = Math.cos(angle) * lineLen;
        double dy = Math.sin(angle) * lineLen;
        g2d.clearRect(0, 0, getWidth(), getHeight());
        g2d.setColor(Color.BLUE);
        g2d.drawLine((int)(x - dx), (int)(y + dy), (int)(x + dx), (int)(y - dy));
    }

    class LineAnimation implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            angle += angleChange;
            x += moveX;
            y += moveY;
            if (x < 0 || x > getWidth()) {
                moveX *= -1;
                angleChange *= -1;
            }
            if (y < 0 || y > getHeight()) {
                moveY *= -1;
                angleChange *= -1;
            }
            repaint();
        } …
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

I think you've jumbled your components a bit. ResistorColorCodeGraphics extends JFrame and you're attempting to add that to another JFrame? You can't put frames in frames.

ResistorColorCodeGraphics should extend JPanel and should override paintComponment(), not paint().

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

Sounds like that is exactly what you should be asking your hosting provider.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

See How to Write a Key Listener. Check the key code and increment your positional variables based on that. Repaint as needed.

Be mindful about focus issue with key listeners. The listener will only receive events if that component has the focus.

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

* Are the strings the same length?
* If yes, does sum(string1) == sum(string2)
* If yes, strings are a match.

Unfortunately that won't work either. "arxvt" and "zzyfb" will still be equivalent under that approach.

I agree with Norm's assessment above. Split the string, normalize the case, and compare the occurrences since you would probably want a 100% on these two cases as well: "java, c++" vs "C++,java".

Ezzaral 2,714 Posting Sage Team Colleague Featured Poster

@\007: If you are you referring to the numerical value of each character, that won't be of any help. The added char values of "aaabb" and "zzyz" are the same. I wouldn't call them equal though.

Or am I misunderstanding what you mean by the integer values of each?