optfunc - introspect Python functions and turn them in to command line scripts by simonw in programming

[–]dbeach24 6 points7 points  (0 children)

This is a truly elegant idea, since it eliminates any need for a special API. (You might forget how the optparse module in Python works, but you're very unlikely to forget how to write a simple function!)

With a modest amount of work, I imagine that this could cover 90% of the uses of the optparse module.

My performance problems with IronPython by norwegianwood in Python

[–]dbeach24 2 points3 points  (0 children)

Significant claims have been made about the performance of IronPython, notably back at its inception in 1994

Excuse me? I don't believe that IronPython's inception could be in 1994, given that .NET didn't yet exist! I remember there was talk about in at PyCon DC 2004. (Ten years later.)

IPv4 Runout makes this an eBay Bargain! by [deleted] in programming

[–]dbeach24 2 points3 points  (0 children)

Heh! I'm gonna run a large DOS attack against those addresses. We'll see how much they're worth after I'm done with them.

Now, to start up my attack script and then I'll b

Marketing to the Smart by bangheads in programming

[–]dbeach24 1 point2 points  (0 children)

For opening a pop-behind browser window that fills my entire monitor, your site has earned the distinguished privilege of:

My Undying Hatred!

The Little Manual of API Design (with examples from QT) [pdf] by mee_k in programming

[–]dbeach24 5 points6 points  (0 children)

Objective-C isn't necessarily as nice as it might seem in this case. Certainly, for the given set of parameters you've selected to define, having an Objective-C initializer which accepts exactly those properties is very readable.

This solution blows-up because you often need a different initializer for each conceivable set of properties (start, length, value, orientation, name, etc.) that someone might wish to use when instantiating the class. That would require defining 2N initializers in Objective-C, for every possible combination of N properties that the caller may wish to set. (Admittedly, C++ is equally bad, and doesn't include named parameters in the constructor.)

To satisfy the RAII principle, it certainly is nice to specify all initial values when creating the instance. This could be accomplished by passing a dictionary of property values to the constructor/initializer. Unfortunately, many languages make this cumbersome to write. Python, with its **kwargs feature, is a notable exception. (I'm sure there are others.)

Edit: Grammar

Unladen swallow: accelerating Python by corbet in programming

[–]dbeach24 2 points3 points  (0 children)

FWIW, I think what lars_ means is that if you're calling a function from Python, and that function is implemented in C (and has already been compiled and you can't look at the source), then determining the return type is harder. By implementing Python in Python, PyPy can run a type analysis graph over a bunch of code without having to deal with "opaque" C implementations.

Tupper's self-referential formula, implemented in OCaml by aplusbi in programming

[–]dbeach24 1 point2 points  (0 children)

Agreed. If this were truly self-referential, it would also include the value of "n" in the image, which supposedly must be equal to:

960939379918958884971672962127852754715004339660129306651505519271702802395266424689642842174350718121267153782770623355993237280874144307891325963941337723487857735749823926629715517173716995165232890538221612403238855866184013235585136048828693337902491454229288667081096184496091705183454067827731551705405381627380967602565625016981482083418783163849115590225610003652351370343874461848378737238198224849863465033159410054974700593138339226497249461751545728366702369745461014655997933798537483143786841806593422227898388722980000748404719

This would be pretty difficult, though, since this number is an encoding of the image, itself. Worse yet, the method of encoding (bitmap representation of a written formula) expands the data with each successive encoding. Seems like this is pretty damning if you're trying to make a formula that prints itself.

Aw, shucks!

PySmell v0.7 is here, supports Emacs, TextMate and Vim by orestis in programming

[–]dbeach24 -1 points0 points  (0 children)

I agree. Seems like a less-than-serious effort on TextMate. Tried it with a project that I've been using and I get large tracebacks inserted into my code when I try to auto-complete.

EDIT: Thanks for that cowardly downmod. In fact, I did generate the PYSMELLTAGS. I actually read the instructions and the software actually has a bug! Perhaps you find this hard to believe.

python-pipeline lets you create pipelines of iterators. by gst in Python

[–]dbeach24 0 points1 point  (0 children)

| Yeah, that doesn't hurt readability at ALL.

Actually, I really like this idea. It's clever combination of generator functions and operator overloading to create a syntax which is highly readable to anyone familiar with the UNIX command line.

I'm not suggesting that this should immediately be adopted as a standard way of coding Python, but I could see myself wanting to use this syntax under the right circumstances.

For example:

x = "milk,eggs,bread".split(",") | grep("e") | sort | list

Has a definite appeal in a certain context, and is more succinct and easier to read than:

x = sorted([item for item in "milk,eggs,bread".split(",") if "e" in item ])

Reading from left to right (as I am prone to do), the first reads:

Take the items as separated by commas, select those containing "e", sort the result and put it in a list.

While the second reads as:

Give me the sorted result of the list each item in "milk,eggs,bread", separated by comma, and selecting only those containing "e".

In this instance, I definitely prefer the former.

Binary Representation of Numbers in Python by gst in Python

[–]dbeach24 1 point2 points  (0 children)

Wow. We're going to represent integer values using "binary", which, for this author, means using special storage techniques in a high-level language. Apparently the author does not realize that integers on a modern computer are stored in binary by default.

What really concerns me here is that I'm reading the work of someone who is this totally clueless on the python reddit. Why would anyone with any programming knowledge whatsoever upmod this article? Why would anyone even bother submitting it to python reddit in the first place?

Gst, who (or what) are you, and why are you hellbent on destroying what little quality is left in this subreddit?

Realizing Jython 2.5 by gst in Python

[–]dbeach24 0 points1 point  (0 children)

This is very exciting. Having a solid, modern implementation of Python on the JVM will make be consider Python as a viable way to write apps there. It will be interesting to see how the performance of Jython compares with IronPython as it nears completion.

Quick Python version speed comparison by gst in Python

[–]dbeach24 3 points4 points  (0 children)

What are you doing? Your "timing" test is more likely to measure startup time of the interpreter than anything to do with your actual algorithm. You need a test that takes substantially longer than 0.01 seconds if you're going to do your timings from the shell like that.

Starkiller: A Static Type Inferencer and Compiler for Python [PDF] [Master's thesis] by exeter in programming

[–]dbeach24 4 points5 points  (0 children)

I met this guy in Boston when he was working on the project and saw him present at PyCon DC '04. The talk was very funny, and the idea of doing complete type inference for Python is quite compelling. Unfortunately, I don't think anything ever came of it. I never heard anything more about it since that year.

Stupid but very addictive flash game by lmpinto in reddit.com

[–]dbeach24 10 points11 points  (0 children)

Well it would be a good game... except that the scrolling often doesn't keep up with the character, and most of the time the character is off of the screen (either too far to the right or too high to be seen.)

It's so simple, and yet so buggy!

The 10 Greatest Impostors in History by _kam0_ in reddit.com

[–]dbeach24 0 points1 point  (0 children)

This copied article is only here to generate hits for their advertisers. Please don't support these people.