Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Showing results 1 to 40 of 500
Search took 0.09 seconds; generated 1 minute(s) ago.
Search: Posts Made By: Arevos
Forum: Coder's Corner Lounge Dec 30th, 2007, 8:13 AM
Replies: 38
Views: 1,174
Posted By Arevos
Re: Challenging Programming Problem - "Pinball Ranking"

Ah, that makes more sense, then :)
Forum: Coder's Corner Lounge Dec 30th, 2007, 8:12 AM
Replies: 38
Views: 1,174
Posted By Arevos
Re: Challenging Programming Problem - "Pinball Ranking"

I didn't program it in C/C++, I'm afraid. If development time is limited, then I want a language with a little more power. In this case, I was using Haskell.

I also didn't finish my solution....
Forum: Coder's Corner Lounge Dec 30th, 2007, 7:31 AM
Replies: 38
Views: 1,174
Posted By Arevos
Re: Challenging Programming Problem - "Pinball Ranking"

The competition is biased pretty heavily toward imperative programming, then. I'm not sure I'm really a fan of artificial restrictions like this, even if I understand the reasoning behind it.
Forum: Coder's Corner Lounge Dec 30th, 2007, 7:19 AM
Replies: 38
Views: 1,174
Posted By Arevos
Re: Challenging Programming Problem - "Pinball Ranking"

This challenge is more difficult than it looks, because you need to have an O(N log N) for the worst as well as the average case.

The obvious solution is to use a balancing tree structure to store...
Forum: Coder's Corner Lounge Dec 10th, 2007, 12:01 AM
Replies: 13
Views: 416
Posted By Arevos
Forum: Python Dec 9th, 2007, 7:53 AM
Replies: 11
Views: 360
Posted By Arevos
Re: name error

To give a little more detail, when you indent something in Python, you're saying it belongs to a block.


class Foobar:
n = 10 # This variable belongs to the class Foobar

def...
Forum: Python Dec 8th, 2007, 9:43 AM
Replies: 11
Views: 360
Posted By Arevos
Re: name error

Er, you've still got the code tags wrong. Don't encase every line, just the whole block.

I've taken the liberty of doing this for you:

class Ship(games.Sprite):
"""The player's ship."""
...
Forum: Community Introductions Dec 4th, 2007, 3:32 AM
Replies: 17
Views: 796
Posted By Arevos
Re: 30 years old and interested in programming. Wasting my time?

You may be interested in Operating Systems Design and Implementation by Tanenbaum and Woodhull. It's a pretty famous guide on Unix-like OS design, and inspired the creation of the Linux OS we know...
Forum: Show Off Your Open Source Projects Nov 30th, 2007, 6:59 AM
Replies: 4
Views: 416
Posted By Arevos
Re: Small compiler in Haskell

I get what you're saying - I recently wrote a basic Lisp interpreter in Python, and I deliberately avoided all of the parsing libraries.

By the way, the way your program compiles into assembly is...
Forum: Python Nov 29th, 2007, 10:04 AM
Replies: 2
Views: 228
Posted By Arevos
Re: Hacking Around With Module Imports

Have you tried putting the setuptools egg in a directory, and then appending the directory's path to sys.path ?
Forum: Python Nov 28th, 2007, 4:06 PM
Replies: 2
Views: 190
Posted By Arevos
Re: Emulating Behaviour Of "mysql_real_escape_string"

You can stop SQL injections by using parameters, e.g:

cursor.execute("SELECT * FROM users WHERE login = '%s' AND passwd = '%s'", (login, passwd))
Forum: Show Off Your Open Source Projects Nov 26th, 2007, 6:44 PM
Replies: 4
Views: 416
Posted By Arevos
Re: Small compiler in Haskell

Is there any reason why you didn't use Parsec?
Forum: Coder's Corner Lounge Oct 30th, 2007, 10:45 AM
Replies: 5
Views: 231
Posted By Arevos
Re: Checking possible moves recursivley

I rather assumed that the square could move in any horizontal or vertical direction, and that this was more a path-finding problem than a collision detection problem. Otherwise, as you say, you...
Forum: Coder's Corner Lounge Oct 30th, 2007, 5:39 AM
Replies: 5
Views: 231
Posted By Arevos
Re: Checking possible moves recursivley

Just keep recursing until:

a) You hit a wall
b) You run out of unexplored spaces
c) You hit some internal limit on how far the function should explore

Presumably you're only interested in places...
Forum: Other Programming Languages Oct 25th, 2007, 11:40 AM
Replies: 17
Views: 815
Posted By Arevos
Re: F# coming to a Visual Studio near you!

Considering how primitive most mainstream languages are, I'd say any deviation from the norm is a good idea.
Forum: HTML / XHTML / CSS Oct 21st, 2007, 5:02 PM
Replies: 32
Views: 1,570
Posted By Arevos
Re: Why is CSS such a mess?

Bolded text may carry both presentation and content information, but that's why the humble <b> tag is depreciated. There's no reason why the meaning behind a tag can't be separated from it's...
Forum: HTML / XHTML / CSS Oct 20th, 2007, 5:19 AM
Replies: 32
Views: 1,570
Posted By Arevos
Re: Why is CSS such a mess?

I tend to agree with Dameon on this. CSS is pretty awful at layout. Sure, you can get around it with numerous "two column" techniques, but if CSS was designed properly, then it would be much more...
Forum: Coder's Corner Lounge Oct 19th, 2007, 4:31 AM
Replies: 17
Views: 665
Posted By Arevos
Re: Have you ever broken a game EULA?

EULA's aren't worth the paper they're written on.
Forum: Python Oct 13th, 2007, 8:42 PM
Replies: 44
Views: 2,001
Posted By Arevos
I still can't quite see why you object so...

I still can't quite see why you object so strongly to inheritance, as in many situations it provides a much cleaner solution than the procedural approach. For instance, take the following...
Forum: Python Oct 13th, 2007, 5:27 PM
Replies: 44
Views: 2,001
Posted By Arevos
How much experience do you have maintaining large...

How much experience do you have maintaining large code bases? In my experience, inheritance done right makes maintenance a whole lot easier, especially when dealing with reasonably large...
Forum: Python Oct 12th, 2007, 8:37 PM
Replies: 44
Views: 2,001
Posted By Arevos
You seem to be labouring under the assumption...

You seem to be labouring under the assumption that you need a language specifically created for OOP, which, as DaWei has pointed out several times in the past, is simply not the case.

You can write...
Forum: Python Oct 12th, 2007, 7:06 AM
Replies: 44
Views: 2,001
Posted By Arevos
The "on_" is purely convention. When a verb is...

The "on_" is purely convention. When a verb is called on the Player object, it calls a "on_verb" method on the item being examined. e.g.


me.action("examine", "head") # calls...
Forum: Python Oct 11th, 2007, 1:00 PM
Replies: 8
Views: 1,017
Posted By Arevos
Well, you're practically there, already!...

Well, you're practically there, already! :)

Let's go over what we have so far. We have the Euclidean function gcd, and the Extended Euclidean function ex_gcd.

Given the equation 75x + 42y = 6, we...
Forum: Python Oct 11th, 2007, 12:06 PM
Replies: 8
Views: 1,017
Posted By Arevos
Can't you just ask the user for three numbers,...

Can't you just ask the user for three numbers, e.g.


print "ax + bx = c"
a = int(raw_input("a = "))
b = int(raw_input("b = "))
c = int(raw_input("c = "))

...
Forum: Python Oct 11th, 2007, 11:53 AM
Replies: 8
Views: 1,017
Posted By Arevos
You probably want the Extended Euclidean...

You probably want the Extended Euclidean Algorithm (http://en.wikipedia.org/wiki/Extended_Euclidean_Algorithm). There's some useful pseudo-code down at the bottom of the linked Wikipedia article.
Forum: Python Oct 11th, 2007, 6:07 AM
Replies: 44
Views: 2,001
Posted By Arevos
As DaWei says, you'd encapsulate the conditionals...

As DaWei says, you'd encapsulate the conditionals in the object itself. For example:


class Room(object):
def __init__(self, description):
self.description = description
...
Forum: Community Introductions Oct 8th, 2007, 12:05 PM
Replies: 10
Views: 362
Posted By Arevos
Many (but not all) of the objections people raise...

Many (but not all) of the objections people raise against VB only apply to versions previous to VB.NET, so you should be fairly safe. There's very little difference between coding in VB.NET or C#...
Forum: Python Oct 7th, 2007, 12:48 PM
Replies: 44
Views: 2,001
Posted By Arevos
When you have a small number of conditions in...

When you have a small number of conditions in Python, one uses an if-statement. But if there are a large number of conditions that follow a common pattern, it's easier to use a dictionary:

commands...
Forum: Python Oct 7th, 2007, 6:02 AM
Replies: 44
Views: 2,001
Posted By Arevos
Don't belittle yourself; adapting your way of...

Don't belittle yourself; adapting your way of thinking to a different programming technique is extremely difficult. Recently I've begun to delve into functional languages, and it initially took me...
Forum: Python Oct 6th, 2007, 9:23 AM
Replies: 44
Views: 2,001
Posted By Arevos
Pretty good, but if you want to label your...

Pretty good, but if you want to label your directions as "w", "e", "n" and "s", why not do something like:


foyer.exits["w"] = kitchen
kitchen.exits["e"] = foyer

me = Player(foyer)

while True:
...
Forum: Python Oct 5th, 2007, 12:51 PM
Replies: 44
Views: 2,001
Posted By Arevos
It's my belief that you're thinking a little too...

It's my belief that you're thinking a little too directly, nisim777. You've created some code to build a specific adventure game, when what you really want to do is to take a step back and consider...
Forum: Python Oct 4th, 2007, 1:05 PM
Replies: 44
Views: 2,001
Posted By Arevos
If you want to post the procedural code up...

If you want to post the procedural code up somewhere, I'm sure there are a few developers here on the forums who could come up with some good suggestions about a OO redesign.
Forum: Coder's Corner Lounge Oct 4th, 2007, 1:03 PM
Replies: 6
Views: 286
Posted By Arevos
Interesting. But it looks like it's released...

Interesting. But it looks like it's released under a "read-only" license, which makes it somewhat dangerous to read. If you don't download the source, and then happen to write a piece of code that's...
Forum: Python Oct 4th, 2007, 12:29 PM
Replies: 44
Views: 2,001
Posted By Arevos
Perhaps you should try designing a simple...

Perhaps you should try designing a simple adventure game in the procedural style you're used to, then to try designing an identical game using an object orientated philosophy. This will give you an...
Forum: Python Oct 4th, 2007, 6:57 AM
Replies: 44
Views: 2,001
Posted By Arevos
Object orientation is more a philosophy than a...

Object orientation is more a philosophy than a certain piece of language functionality. Objects group together related functions and objects into a single package, allowing the developer to organise...
Forum: Python Oct 1st, 2007, 12:26 PM
Replies: 4
Views: 294
Posted By Arevos
Some additional useful code: >>> xs = ["2",...

Some additional useful code:


>>> xs = ["2", "13", "3"]
>>> xs.sort()
>>> xs
['13', '2', '3']

>>> ys = map(int, xs)
>>> ys
Forum: Ruby Sep 26th, 2007, 10:49 AM
Replies: 2
Views: 428
Posted By Arevos
You can only split a string, not a number. "gets"...

You can only split a string, not a number. "gets" returns a string, but "to_f" turns it into a number (or to be more exact, a float). Get rid of the "to_f" for this line.
Forum: Coder's Corner Lounge Sep 23rd, 2007, 5:58 PM
Replies: 8
Views: 231
Posted By Arevos
Excite Truck is also pretty good, and lots of fun...

Excite Truck is also pretty good, and lots of fun in 2 player mode.

I'd be interested to know if anyone knows of any good multiplayer games for the Wii. I haven't found anything that beats Wii...
Forum: Coder's Corner Lounge Sep 19th, 2007, 10:10 AM
Replies: 25
Views: 603
Posted By Arevos
It's all very well to say that "most serious...

It's all very well to say that "most serious studies" support your argument, but I notice you don't actually provide references to any of these.

I could equally claim that there is a positive...
Forum: Coder's Corner Lounge Sep 18th, 2007, 2:22 PM
Replies: 25
Views: 603
Posted By Arevos
It's not arbitrary; rather, it's a recursive...

It's not arbitrary; rather, it's a recursive definition. A human being is self-aware; that is, it is capable of conceptualising its own existence. I believe that human lives are important, because...
Showing results 1 to 40 of 500

 
Forum Jump



DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:52 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC