Search Results

Showing results 1 to 40 of 66
Search took 0.01 seconds.
Search: Posts Made By: vidaj
Forum: Java Jul 1st, 2009
Replies: 17
Views: 773
Posted By vidaj
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...
Forum: Python Apr 28th, 2009
Replies: 4
Views: 302
Posted By vidaj
If people would specify their questions better, it would be easier to answer them. I.e. "I want to do <insert stuff here>. What can python offer over <insert some other programming language here>...
Forum: Python Apr 27th, 2009
Replies: 4
Views: 302
Posted By vidaj
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

:)
Forum: PHP Apr 27th, 2009
Replies: 12
Views: 1,293
Posted By vidaj
RewriteEngine On
RewriteRule ^(.*)$ index.php?req=preview&pro_name=$1


That should (probably) do the trick. You should create a good structure for your URLs if you want to have URLs for anything...
Forum: Python Apr 27th, 2009
Replies: 1
Views: 514
Posted By vidaj
To do this you have to know how to convert a number from one base to another. If you take a look at http://www.cut-the-knot.org/recurrence/conversion.shtml, it has a decent explanation.

You can...
Forum: PHP Apr 26th, 2009
Replies: 6
Views: 426
Posted By vidaj
It's not that weird, actually. | is a bitwise-or, so it create a result with all the bits that are set in !$_POST['username'] and !$_POST['pass'] and !$_POST['pass2']. If the number this creates is...
Forum: PHP Apr 26th, 2009
Replies: 5
Views: 682
Posted By vidaj
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...
Forum: PHP Apr 26th, 2009
Replies: 6
Views: 426
Posted By vidaj
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:

if...
Forum: PHP Apr 26th, 2009
Replies: 12
Views: 1,293
Posted By vidaj
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
Forum: Python Apr 26th, 2009
Replies: 3
Views: 382
Posted By vidaj
Is this what you are after?

If you change your repeat function to

def repeat(f, n):
totalFlips = 0
for i in range(n):
results = ""
while not results.endswith('hth'):...
Forum: Python Apr 26th, 2009
Replies: 5
Solved: print error
Views: 544
Posted By vidaj
You have to convert the string from the input to an integer.

x = int(input("Enter a value: "))

Remember you have to catch the exception that will be raised if the input is not a number.
Forum: Python Apr 25th, 2009
Replies: 4
Views: 660
Posted By vidaj
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...
Forum: Python Apr 24th, 2009
Replies: 2
Solved: Big For Loops
Views: 258
Posted By vidaj
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...
Forum: Python Apr 23rd, 2009
Replies: 5
Views: 429
Posted By vidaj
Maybe http://www.py2exe.org/ is what you are looking for?
Forum: Python Apr 23rd, 2009
Replies: 1
Views: 308
Posted By vidaj
Well, you have to mount it properly in the OS. Then you should be able to access it like any other drive.
Forum: Python Apr 23rd, 2009
Replies: 7
Views: 754
Posted By vidaj
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....
Forum: Python Apr 21st, 2009
Replies: 9
Views: 644
Posted By vidaj
If you want to have the help-pages, I can't help you.

If you just want to see the docstring for a function you're using, just mouse-over the function and wait a second before a pop-up pops up...
Forum: Python Apr 21st, 2009
Replies: 9
Views: 644
Posted By vidaj
If you use PyDev (http://pydev.sourceforge.net/) you should get everything you need.
Forum: Python Apr 21st, 2009
Replies: 3
Views: 262
Posted By vidaj
Worked like a charm :D

Changed the regex to use negative lookbehind and lookahead to match the +, and a new regex to match the list of references.

Thanks for your input :)

I'll post the...
Forum: Python Apr 21st, 2009
Replies: 3
Views: 262
Posted By vidaj
Ooo.. That might work :) I'll poke around in my code and see if I can get it to work. Thanks :)
Forum: Python Apr 21st, 2009
Replies: 3
Views: 262
Posted By 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...
Forum: Python Apr 19th, 2009
Replies: 1
Views: 299
Posted By vidaj
From the module inspect's documentation:

inspect.getsourcelines(object)
Return a list of source lines and starting line number for an object. The argument may be a module, class, method,...
Forum: Python Apr 19th, 2009
Replies: 7
Views: 1,238
Posted By vidaj
Here a function that creates a 3xn matrix.

def create_3n_matrix(n):
return [[[None for x in range(n)] for x in range(n)] for x in range(n)]


calling create_3n_matrix(3) creates the...
Forum: Java Apr 19th, 2009
Replies: 9
Views: 720
Posted By vidaj
Hehe. I really want to help you, but it's darn difficult. If you can either
- Fix the code so it's in [code=java] tags (and make sure the code compile)
- Attach the java files

I tried to...
Forum: PHP Apr 19th, 2009
Replies: 13
Views: 848
Posted By vidaj
First you have to connect to your mysql_database with your username and password, and select the database you want to use.

Then you create your query (the select statement) and send that query to...
Forum: Java Apr 19th, 2009
Replies: 9
Views: 720
Posted By vidaj
It's quite hard to see what's going on, since you only posted a part of your code. We can't see what's going on outside the methods, who is calling the methods, when they are called etc.

One...
Forum: Java Apr 18th, 2009
Replies: 9
Views: 720
Posted By vidaj
final int[] fromStop = {1, 2, 3, 3, 4, 5};
final int[] toStop = {3, 4, 5, 1, 2, 3};

List<Passenger> passengers = new ArrayList<Passenger>()
for (int i = 1; i < Main.PASSENGERS; i++) {
bus...
Forum: Java Apr 18th, 2009
Replies: 9
Views: 720
Posted By vidaj
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...
Forum: PHP Apr 18th, 2009
Replies: 13
Views: 848
Posted By vidaj
Just to check, you have actually executed the query, right? And fetched the result with mysql_fetch_assoc?
Forum: PHP Apr 18th, 2009
Replies: 8
Views: 617
Posted By vidaj
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...
Forum: Python Apr 17th, 2009
Replies: 5
Views: 332
Posted By vidaj
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....
Forum: Python Apr 17th, 2009
Replies: 4
Views: 304
Posted By vidaj
Another option that doesn't involve messing with the server configuration, is to keep track of the last created temp-file. Save this in a file or database or something. Then, when you create a new...
Forum: Python Apr 17th, 2009
Replies: 4
Views: 304
Posted By vidaj
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...
Forum: Python Apr 17th, 2009
Replies: 11
Views: 552
Posted By vidaj
My bad, you're quite right. Forgot for a moment that python doesn't treat numbers as boolean values (true if > 0, else false). In afterthought - that's a really stupid assumption to make :$

My...
Forum: Python Apr 17th, 2009
Replies: 11
Views: 552
Posted By vidaj
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 ^...
Forum: Python Apr 17th, 2009
Replies: 2
Solved: gasp errors
Views: 258
Posted By vidaj
You have to use the x and y values for it to have any effect.


Box((20 + x, 20 + y), 100 + x, 100 + y) #the house

if Box takes x1, y1, x2, y2 as arguments the code above should work
Forum: Python Apr 16th, 2009
Replies: 11
Views: 426
Posted By vidaj
open a terminal and go to your code directory.

type in the following:
python path_to_2to3.py yoursourcefile.py

The tool will then output all the changes that it can perform.
If you want to...
Forum: Python Apr 15th, 2009
Replies: 16
Views: 545
Posted By vidaj
Not really. If you try to code as close to 3.0 standard, you can use the 2to3 converter tool to convert most of your code when you upgrade your python version.
Forum: Python Apr 15th, 2009
Replies: 16
Views: 545
Posted By vidaj
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...
Forum: Python Apr 15th, 2009
Replies: 4
Views: 481
Posted By vidaj
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+"...
Showing results 1 to 40 of 66

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC