Samuel Goldschmidt

Greenhorn
+ Follow
since Jun 14, 2009
Samuel likes ...
BSD
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Samuel Goldschmidt

Thanks for the helpful suggestions, guys. I've emailed our professor (who was kind enough to reply with useful suggestions) and it turns out that his preferred solution is to introduce an . This was not what I read in the requirements, but it's a valid solution anyway.

It's great to have moral support in times of need, so thanks for your time. Maybe someone else can use this too when stuck.
13 years ago
I could do it that way, but the problem is, the problem description (this is a programming exercise) states quite clearly that we must return an iterator over the same iterator ... .
13 years ago
Sorry, I probably should have posted more code.

Every instance of Tree contains edges, which point to other trees. I want assoc to return an Iterator over the iterators of the trees that the edges point to.

EDIT: Thanks for answering btw! I'm going to bed now, but I'll be sure to read on in a few hours
13 years ago
Hello,

I have an Interface Iter representing an Iterator (it has to be a custom class, not the standard java.lang.Iterators):



and I've got a class which shall have a method returning an Iter which is capable of iterating over Iters, which is iterating over Iters... and so on.
Until now, I've got the following:



But the problem is: How can I create a subtype of Iter which can be returned by iassoc()? I've only got compile-time errors till now, I haven't really got any idea.
Any help would be immensely appreciated.
13 years ago
Well, thanks a lot, Craig! This worked! (Save for the src.getType(), but I just put in src.TYPE_INT_RGB)
g2.drawImage(src, ...) is really cool. I think I didn't know what to do because I didn't know what g2.drawImage(...) does. I used it before to draw BufferedImages on JPanels, but actually it's a function which copies image data to specific memory locations, isn't it?
14 years ago
OK I've got it now. Does someone know how to do it correctly?
14 years ago
What doesn't work is: The saved image is not rotated.
14 years ago
First of all, I've been using openSuSE a lot for many years and have found it intuitive and fast.

Second, regarding your

I've been told that it is possible in Linux to create a 'dedicated' environment that gives all of the processor over to the program.



You can in fact customize your Linux to a point where it's using 640k of ram and 3,2 MB on your hard disk (though it won't look very impressive afterwards), but that requires a lot of expertise.
To make said task of customizing Linux a bit easier, Novell, the company which owns openSuSE, has begun to work on a tool named SuSE studio, which runs in the web browser. Using the tool, everybody with a bit of experience in Linux is able to create a really customized version of openSuSE for himself.
http://susestudio.com/

However, SuSE studio is still in Beta, and to get access, you've got to get an invitation. Well, I'm probably talking too much, just visit the site and find out for yourself.

Cheers,
Sam
14 years ago
Hello community,
I want to load an image from the hard disk, then rotate it by 90° and then save the rotated version to another file. However, the following doesn't work:



Could you tell me what I am doing wrong and/or show me how it's done properly?

Regards,
Sam
14 years ago
Thanks for the hint
14 years ago
JSF is a technology which lets a server dynamically create html pages... The client will probably not even notice that JSF is running on the server (he just gets plain html). You won't get around using JavaScript.
14 years ago
JSF
Hi everybody,

I've advanced rather far in programming an isometric tile-based game in Java. However, I'm really a programmer, not a painter or designer. Creating even the most basic mock-ups of sprites and buttons takes ages for me. Does someone know a place where isometric graphics (sprites, tiles, ...) can be downloaded?
14 years ago
Illegal reference to static field colorMap inside of the constructor

Enum constructors cannot access the enum static fields. However, they can invoke the enum’s static methods that access the static fields. The problem is static initialization has not been done at the time the enum constructor constant constructors are invoked, so using static methods will just see zeros. Constructors can also directly access static final in-lineable constants known at compile time.



Static variables have to be assigned to their values when a class is first called. That is called static initialization.

You may therefore try to access the static field inside the constructor, but... (hint: you will only get a NullPointerException)
Could you perhaps post instructions on how to set up you project? I tried to replicate it in my NetBeans, but didn't get far - if I copy the jsp code into a new "Visual JSF page" or something like that, I just get "markup preceding the root ... must be well-formed" and I didn't know where to put the faces.config.xml
14 years ago
JSF
I've got a strange problem here with my application.
What the application should do: Download the source code of web pages and save them to a local file.
To do this, I use the Apache httpclient library.

My problem:
The downloader is a Swing application created with NetBeans and its GUI Builder.
To download the web page, some lines of code using httpclient are needed.
When the "Start download" button is pressed, the page should be downloaded.
It's just, if I just put the download code in the ActionListener.actionPerformed(...) method of the "Start download" button (which is called when the button is pressed), it doesn't work! The thread just stops mid-flow! On the other hand, if I download something using HttpClient before the Swing application even starts, everything works fine afterwards if the button is pressed! Why does some random code completely detached from the main application influence the result of the latter?

I'm not asking you to solve my problem (but any help would be GREATLY appreciated!). But could you just try out the application for yourself and see if you can replicate the error? I attached a zip file (just rename it to something.zip) to this post containing two folders, which are two NetBeans projects. To build and execute them, you need the following libs (they are very small!):
http://gd.tuwien.ac.at/infosys/servers/http/apache/dist/httpcomponents/commons-httpclient/binary/commons-httpclient-3.1.tar.gz (add commons-httpclient-3.1.jar to your libs)
http://gd.tuwien.ac.at/infosys/servers/http/apache/dist/commons/logging/binaries/commons-logging-1.1.1-bin.tar.gz (add commons-logging-1.1.1.jar to your libs)
http://mirror.deri.at/apache/commons/codec/binaries/commons-codec-1.3.tar.gz (add commons-codec-1.3.jar to your libs).

If you aren't behind a proxy, comment out the lines in DownloaderApp.java following the

// Comment the next section (3 lines) out if you don't sit behind a proxy

comment.

If you would like to investigate further, please look inside DownloaderView.java . The thread hangs after the comment.

Any help appreciated! Thanks in advance,
Sam
14 years ago