Stefan Wagner

Ranch Hand
+ Follow
since Jun 02, 2003
Stefan likes ...
Scala Postgres Database Linux
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Stefan Wagner

I get the same problem on Eclipse Juno (4.2):

Most answers I found report that this is the case if your assertion doesn't compare Strings, but my is a String. Unfortunately it is null, and if it isn't, the comparison works as expected.

This works for gnu-find. Your find might differ.

Instead of piping, it is often, but not always, a good idea, to use one of the switches: -exec, -execdir, -ok, -okdir. It isn't trivial to use, but powerful.
11 years ago

srikanth sankurthi wrote:which command is used ot view file in linux.

Which kind of file? Java-source/textfile, (less, cat, gedit, nano, mcedit, vi, emacs), image (eog, gimp, ...), video (vlc, mplayer, gxine, ...), pdf (xpdf, evince, acroread), zip, mp3, rar, xml, ...
11 years ago
I can confirm this error with JDK javac 1.6.0_26 on Linux, and got rid of the error with deleting all classfiles in that directory.

I don't have a JDK-1.4 since about 5 years.
12 years ago

Luigi Plinge wrote:Nice solution Stefan. Here are my comments if you're interested.

Yes, thanks for your feedback.

I have to excuse myself by stating, that I solved Euler011 in Feb.2009, and I don't know, which methods where present then, and what was introduced later. Afaik, 'max' wasn't available then.

In your regex, if you put a "+" after your bracket expression, i.e. "[\n\t ]+", this will match 1 or more instances, so you don't need the trim or filter for length > 0. I thought you had to double-escape control characters but it looks like you don't have to with \n or \r or \t (but you do with \s).

Well - Sting.split and [...]+ is from Java, and old enough. That simplifies much, while it isn't measurable for such a small grid. The method returns immediately on my old 2Ghz Laptop. And _.toInt is too more elegant.

It's normal in Scala code to make your indents 2 spaces, because you get more nesting with closures, and chaining functions means that lines tend to be longer. 8 is certainly overkill.

Yes, I've given up my resistance to two-blank indent, and code to the Scala standards, when coding Scala now, but either I use 2 or 8 - nothing in between.
The problem with tabs is, that the REPL tries to autocomplete, if it finds a tab, so tabs aren't usable there. But I never got problems with 8-pos indentation either.

If you use curly braces instead of parentheses in your for-statement, you don't need the semicolons.

Yes. On the other hand - is there a problem with semicolons? They're more easy to type on a german keyboard than curly braces.

I was a bit confused by your maxProduct method because "max" is a function defined in List, until I realised it was a variable. From what I've read, it's better to avoid using vars, unless you have a good reason.

Well - I have a good reason, I want to find the max, and there is no problem, until you find one. Of course, the max-call you use is more elegant, but I think it wasn't available 2009, but a roll-your-own function to use in a fold would have been possible over then too.

12 years ago
12 years ago

So save this, compile it, run it:

13 years ago

Chandrasekaran SanthanaKrishnan wrote:anirudh jagithyala,

I did that exactly as you have said.

Its not working.

'Not working' is a poor error description. What didn't work? Did you get an error message? Which? How did you experience that it didn't work? What result did you expect, what did you get?

Note, that you just use one form, and it's the second:

Backticks are deprecated (Ommm, Ommm) because you can't nest them easily. Since classes should wear uppercase initials, you call `java Test`, not `java test`.

Note too, that the initial code was wrong in multiple ways:

* should be public
* named with capital T
* main method is empty - so nothing happens
* sample-method returns a String, but does no output.
13 years ago

Rahul Sudip Bose wrote:
3 Is there any serious competition to MS in the "office" front ? Long time ago, open office did not seem good enough to me.

What did you miss in concrete?
13 years ago

Sanjeev Ba wrote:
var1=`java Test`

Backticks are deprecated. Instead use $(...). You can nest it easily, and it is better readably.

13 years ago

Tim Holloway wrote:If you lose the root password, that's a bigger problem, since you need to be logged in as root in order to issue the passwd command in most cases. To recover from that problem, you'd have to shutdown the machine, boot up into single-user mode (which doesn't require a login) and reset the root password. Then reboot into the normal operating runlevel.

On ubuntu, there is no root login by default. All you do you do as user via sudo, and for sudo you need your own password.

However, you're right in the advice to do a (S)uperuser boot. You do it by booting from grub an entry, marked as ... (recovery mode)

13 years ago

Bhakthavatsala Reddy Boggula wrote:Hi Stefan Wagne, Thanks for your post ..but what are the code tags, please explain clearly.

You pick a bit of code (with indentation, please) (will not be visible if not in code tags, as here:).

public MyAuthenticator(String user, String pass) {
username = user;
password = pass;

You mark it with the mouse, and hit the button No. 8 from left in the somehow red border of this field, named 'Code', and, voila!

13 years ago
I'm not sure how RedHat manages memory, but afaik, tmpfs is something different from swap, and for free memory you need, if something from an harddrive, then swap.

Swap isn't measured and reported with df but with 'free':

To search for your swap space, you may use fdisk -l with sudo (sda3 on my system):

13 years ago
Can you please edit your initial post and insert some blanks, to allow the layout to break your very long line, please?

Did you, as EFH suggested, check, whether chmod had the desired effect?

13 years ago