Posts
 
Reputation
Joined
Last Seen
Ranked #711
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
5
Posts with Upvotes
3
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
5 Commented Posts
~36.0K People Reached
About Me

Finishing my CS master thesis in system development. Working as a java consultant at Know IT Objectnet in Oslo, Norway.

I program java, python, php and do some web development.

Interests
Music, computers
PC Specs
Dell xps M1730, T9300 @ 2.5GHz, Windows Vista (urk), 2x Nvidia 8800M GTX in SLi.
Favorite Tags
Member Avatar for shinoske

I'm not sure, but I think the reason why the txt-file is empty, is that you have redirected standard-output to the textfile, and the compiler prints all error-messages in error-output. if you redirect with 2> instead of > you get the error stream. example: [icode]javac *.java > output.txt 2> error.txt[/icode] …

Member Avatar for Swap_1
0
135
Member Avatar for Stefano Mtangoo

from: [url]http://www.crummy.com/software/BeautifulSoup/3.1-problems.html[/url] [quote] In Python 3.0, the latest version of Python, SGMLParser has been removed. The only parser that's part of the Python 3.0 standard library is HTMLParser, a simpler parser that's much worse at processing malformed HTML. In the meantime, an excellent new HTML parsing library called html5lib has …

Member Avatar for vegaseat
0
981
Member Avatar for txwooley

You have to use the x and y values for it to have any effect. [code=python] Box((20 + x, 20 + y), 100 + x, 100 + y) #the house [/code] if Box takes x1, y1, x2, y2 as arguments the code above should work

Member Avatar for shasta90
0
587
Member Avatar for ramjeev

It all depends on what you are doing. If you are starting B.jar from A.jar as a new process, it's quite simple. Just kill the process. If you launch the two programs seperately from the OS, I don't think you can do it in plain java. I think you can …

Member Avatar for valatharv
0
4K
Member Avatar for kartal

If you use PyDev ([url]http://pydev.sourceforge.net/[/url]) you should get everything you need.

Member Avatar for patrickwang
0
259
Member Avatar for einhachi

1. The SerialUID thingie You can make this go away permanently if you go into eclipse-preferences->java->compiler->errors/warnings and change "Serializable class without serialVersionUID" to Ignore. It's not a good idea to get used to creating a serialUID without knowing why it's there in the first place. May cause you a bunch …

Member Avatar for painless
0
180
Member Avatar for action_owl

Can python: - Read text files? Check - Connect to a server? Check - Update a html-file? Check - Serve web-pages? Check - Anything that any other programming language can do? Check :)

Member Avatar for vidaj
0
141
Member Avatar for coolmind259

Check your httpd.conf file in the apache installation. Search for mod_rewrite and uncomment the line. Then you should be able to use it. Xammp has mod_rewrite disabled by default

Member Avatar for vidaj
0
452
Member Avatar for EvanPM

To do this you have to know how to convert a number from one base to another. If you take a look at [url]http://www.cut-the-knot.org/recurrence/conversion.shtml[/url], it has a decent explanation. You can iterate over a string like a list, so you can extract each character. Then you can convert that character …

Member Avatar for vidaj
0
148
Member Avatar for ero100@live.com

One more thing, it's common practice for ISP's to block port 25. So if you are trying to set up a mailserver from your home connection, you might be out of luck. ISP's block port 25 to make sure people don't spam, or have viruses/crapware that uses their computers to …

Member Avatar for cwarn23
0
146
Member Avatar for Undermine

You have to convert the string from the input to an integer. [code=python] x = int(input("Enter a value: ")) [/code] Remember you have to catch the exception that will be raised if the input is not a number.

Member Avatar for Undermine
0
78
Member Avatar for Vihaio2012

Is this what you are after? If you change your repeat function to [code=python] def repeat(f, n): totalFlips = 0 for i in range(n): results = "" while not results.endswith('hth'): results += f() totalFlips += 1 print("It took {0} flips to find HTH".format(len(results))) return totalFlips [/code] If you call this …

Member Avatar for vegaseat
0
110
Member Avatar for mbabaali

There's an extra '}' at line 77. Don't know if that's the problem. You should also make use of the mysql_error() to see what's wrong. Add this after the insert: [code=php] if (mysql_affected_rows($conn) != 1) { die(mysql_error()); } [/code]

Member Avatar for somedude3488
0
196
Member Avatar for besktrap

First off, to include a file in a different folder, you don't have to change your current working directory. A folder in python is called a package, and the file in that folder is called a module. To correctly create a package, you have to create a file called __init__.py …

Member Avatar for besktrap
0
10K
Member Avatar for Dart82

If I understand your code correctly, you have two lists. One list called english_to_german where you store the words in "pairs", i.e. index 0 is the english word, and index 1 is the german translation. And the other way around in german_to_english The way you can do this with a …

Member Avatar for Dart82
0
94
Member Avatar for gbrokaw
Member Avatar for gbrokaw
0
135
Member Avatar for ihatehippies

Well, you have to mount it properly in the OS. Then you should be able to access it like any other drive.

Member Avatar for vidaj
0
90
Member Avatar for yemu

You could also use a dictionary with the labels as keys and results as values. Then you can sort the keys and access the value through the dictionary. I think that's cleaner than using three lists. Just my $0.02, though

Member Avatar for vidaj
0
2K
Member Avatar for vidaj

Hi, In my current project I'm trying to compose some objects at runtime based on a string containing the object-configuration. Based on the "Favour composition, not inheritance" pattern, but done runtime. My usecase: I have a downloader that downloads web-pages. The downloader is configured with a set of request-handlers and …

Member Avatar for vidaj
0
103
Member Avatar for jmil2

Here a function that creates a 3xn matrix. [code=python] def create_3n_matrix(n): return [[[None for x in range(n)] for x in range(n)] for x in range(n)] [/code] calling [icode]create_3n_matrix(3)[/icode] creates the following: [code] [[[None, None, None], [None, None, None], [None, None, None]], [[None, None, None], [None, None, None], [None, None, None]], …

Member Avatar for adam1122
0
8K
Member Avatar for katamole

Classes are excellent in this case. That's what they are there for - organizing data :) Consider using a base class for Animal, and subclass the other animal if you know the value at compiletime. Or use a subklass where you fill inn the attributes at load-time. I included some …

Member Avatar for katamole
0
400
Member Avatar for tivrfoa

From the module [icode]inspect[/icode]'s documentation: [icode]inspect.getsourcelines(object)[/icode] Return a list of source lines and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of the lines corresponding to the object and the …

Member Avatar for vidaj
0
181
Member Avatar for stevnlon

You have to implement the run() method so the thread can actually do something, or wrap your code in a Runnable and pass that to new Thread(myRunnablePassangerObject).start() Maybe this can help you on your way: [url]http://www.javaworld.com/javaworld/jw-04-1996/jw-04-threads.html[/url]

Member Avatar for stevnlon
0
2K
Member Avatar for jameswoodhouse

[QUOTE=jameswoodhouse;848714]$sql = 'SELECT * FROM cartable';$finalurl = '<a href=''.$row['carwebsiteurl'].''>'.$row['carname'].'</a>';echo $finalurl; Now it just shows a blank page, no errors though!!!![/QUOTE] Just to check, you have actually executed the query, right? And fetched the result with mysql_fetch_assoc?

Member Avatar for vidaj
0
200
Member Avatar for kssi89

Thought I could give some input in how to look at the problem in a different way. 1. Don't use <font> tags. Ever. Really. Never ever. They are evil. Use classes and css instead. 2. Why use mysql_result and save each in a variable? mysql_fetch_assoc does what you want, and …

Member Avatar for komang80
0
151
Member Avatar for smb3d

Your image is not actually sent to the brower when your script ends. The browser downloads the html, finds a <img>-tag, and uses the url in the src-attribute to request the image from the server. So it's two separate requests. What you could do, probably, is to intercept the request …

Member Avatar for smb3d
0
149
Member Avatar for max.yevs

I know this is a solved thread, but I thought I should clearify the second question about why 3^2 is 1 instead of 9. The exponential operator in python is **, as correctly given above. The ^ operator, however, is XOR (exclusive or). This operator works in the way that …

Member Avatar for adam1122
0
105
Member Avatar for leegeorg07
Re: 2to3

open a terminal and go to your code directory. type in the following: [code]python path_to_2to3.py yoursourcefile.py[/code] The tool will then output all the changes that it can perform. If you want to write the changes back to the file, use this command instead [code]python path_to_2to3.py -w yoursourcefile.py[/code] Take a look …

Member Avatar for leegeorg07
0
195
Member Avatar for docesam

Another reason to stay away from 3.0 is that there's (AFAIK) no mysql access libraries yet. Libraries for pretty much everything is pretty scarce for python 3.0. But, check out what's new in python 3 vs 2.x and try to code as close to 3 syntax as possible. It makes …

Member Avatar for Mearah
0
164
Member Avatar for shaun.b

When you open your csv-file, you use the mode "w+b". Any reason you're opening the file as a binary instead of a regular text-file? Anyway, if you want to append text to a file you have to use "a+" (or "a+b"). If you take a look at [url]http://docs.python.org/library/functions.html#open[/url] it says: …

Member Avatar for adam1122
0
194