Search found 34 matches

by whaatt
Thu Jul 04, 2013 4:09 pm UTC
Forum: Coding
Topic: The Red Spider Project
Replies: 246
Views: 189563

Re: The Red Spider Project

So yes, work relative to the project root. If that directory doesn't exist in your copy you probably didn't run setup.py. Actually, for some reason, setup.py creates all of the other directories, like /extbin and /bin , but /work doesn't show up. Is there something more to be done, or are individua...
by whaatt
Wed Jul 03, 2013 11:11 pm UTC
Forum: Coding
Topic: The Red Spider Project
Replies: 246
Views: 189563

Re: The Red Spider Project

So yes, work relative to the project root. If that directory doesn't exist in your copy you probably didn't run setup.py D'oh! That's it. And the xkcd-fetch.py source code was pretty useful to figure out the Red Spider root directory stuff in Python. Thanks everyone for the help; I've submitted a p...
by whaatt
Wed Jul 03, 2013 4:46 am UTC
Forum: Coding
Topic: The Red Spider Project
Replies: 246
Views: 189563

Re: The Red Spider Project

So I finally got around to coding this up today, and I've uploaded what I've done at my GitHub fork . I ended up going with LXML for the parsing, particularly since, as Xanthir helpfully noted, LXML supports the cssselect module for using CSS selectors. As for the caching mechanism: There is a cache...
by whaatt
Sun Jun 30, 2013 12:29 am UTC
Forum: Coding
Topic: The Red Spider Project
Replies: 246
Views: 189563

Re: The Red Spider Project

As far as the caching of quotes is concerned, I think the best way to go is to scrape the website once to create an offline cache for when the user is disconnected from the internet, but use the online random url for the actual quote to display whenever the user is connected. You can give the user ...
by whaatt
Thu Jun 27, 2013 9:58 pm UTC
Forum: Coding
Topic: The Red Spider Project
Replies: 246
Views: 189563

Re: The Red Spider Project

You'd have to do some really fancy coding or rely on an xml library as a dependency, but it should be possible to get a random forum page, scrape for text boxes and grab things from them. how you classify 'witty' is up to you, but using quotes in signatures might be a good place to start. Might jus...
by whaatt
Fri Jun 21, 2013 6:40 am UTC
Forum: Coding
Topic: The Red Spider Project
Replies: 246
Views: 189563

Re: The Red Spider Project

Hi everyone, I haven't lurked around these forums in a while and only now saw this project, which I think is really cool. Sorry if this is OT, but here's my idea, for whatever it's worth: a command that is reminiscent of the fortune command on some old Unix boxes, except that all of the fortunes are...
by whaatt
Fri Jun 21, 2013 6:09 am UTC
Forum: Coding
Topic: Multi-line Anonymous Functions in Python
Replies: 32
Views: 41679

Re: Multi-line Anonymous Functions in Python

But there's still added namespace clutter, particularly if the named function is used no more than once in the style of a callback or something. For most things, this might not be significant, but in a larger program, maybe something to think about. The function would be locally scoped so it is no ...
by whaatt
Thu Jun 20, 2013 8:10 pm UTC
Forum: Coding
Topic: Multi-line Anonymous Functions in Python
Replies: 32
Views: 41679

Re: Multi-line Anonymous Functions in Python

But the fact that you can define a named function anywhere the hell you like, that its a valid statement anywhere, makes it unnecessary. I guess. But there's still added namespace clutter, particularly if the named function is used no more than once in the style of a callback or something. For most...
by whaatt
Thu Jun 20, 2013 3:09 am UTC
Forum: Coding
Topic: Multi-line Anonymous Functions in Python
Replies: 32
Views: 41679

Re: Multi-line Anonymous Functions in Python

wiped out by the syntactic in convenience of losing syntax highlighting, autoindentation, etc. within a string; not to mention the other disadvantages (like runtime and lack of compile checking until you try to run the function). I completely agree, particularly about the syntax highlighting. But t...
by whaatt
Wed Jun 19, 2013 10:35 pm UTC
Forum: Coding
Topic: Multi-line Anonymous Functions in Python
Replies: 32
Views: 41679

Re: Multi-line Anonymous Functions in Python

I hate to revive an old thread, but I recently revisited my efforts at this, and created something that functions effectively as an anonymous function, at least marginally in the style of JavaScript. The code is still at the GitHub repository I linked to in my first post. from mu import mu as f foo ...
by whaatt
Mon Aug 27, 2012 2:56 am UTC
Forum: Coding
Topic: Multi-line Anonymous Functions in Python
Replies: 32
Views: 41679

Re: Multi-line Anonymous Functions in Python

Thanks for all of the feedback everyone. Also, you can use triple quotes("""...""" or '''...''') to enclose text including newlines, so you could pass a multiline string to your function without needing special syntax and processing. This would be even more readable, si...
by whaatt
Sun Aug 12, 2012 6:42 am UTC
Forum: Coding
Topic: Multi-line Anonymous Functions in Python
Replies: 32
Views: 41679

Multi-line Anonymous Functions in Python

I was just wondering if there were any implementations of Python that had support for true anonymous functions. RIght now, the lambda construct is only sufficient for simple, singular expression needs (e.g. callbacks), and as far as I know, there are no current plans to include multi-line lambdas in...
by whaatt
Fri Oct 22, 2010 3:23 am UTC
Forum: Mathematics
Topic: Help a kid with Calculus!
Replies: 55
Views: 4612

Re: Calculus (more specifically Integral Calculus)

Dason wrote:You're right but 314man already brought that up.


I should've figured that somebody on these forums would have gotten to it already. :D
by whaatt
Thu Oct 21, 2010 11:17 pm UTC
Forum: Mathematics
Topic: Help a kid with Calculus!
Replies: 55
Views: 4612

Re: Calculus (more specifically Integral Calculus)

tckthomas wrote:Why would the derivative of sin(3x^2+1) become 9x*cos(3x^2+1)?


Hmm... forgive me if I am seriously spacing out, but isn't the derivative of sin(3x2+1) equal to 6x*cos(3x2 + 1) NOT 9x*cos(3x2 + 1) ?
by whaatt
Thu Aug 05, 2010 9:26 pm UTC
Forum: Logic Puzzles
Topic: What is the question? (cypher)
Replies: 12
Views: 2647

Re: What is the question? (cypher)

3. I do not understand the question properly. It'd seem to me that, to answer the question, you firstly need to decrypt it.. but that might be just me. Never mind, I get what you are trying to say. Edit: An interesting thought, the first half of the cipher text is *primarily* composed of number...
by whaatt
Thu Aug 05, 2010 9:14 pm UTC
Forum: Your art and links
Topic: xkcd comic-strip-style
Replies: 2
Views: 2333

Re: xkcd comic-strip-style

Hmmm.... It's pretty good. A couple suggestions -- use an xkcd-like font: http://antiyawn.com/uploads/Humor-Sans.ttf , and think of an "alt-text" for your comic. Oh, and a couple grammatical fixes -- the first sentence should read: "There's a guy in town that came from the future.&quo...
by whaatt
Thu Aug 05, 2010 1:46 am UTC
Forum: Logic Puzzles
Topic: What is the question? (cypher)
Replies: 12
Views: 2647

Re: What is the question? (cypher)

I have a few questions:
1. Does it have to do with the keyboard?
2. Do duplicated numbers next to each other have significance (e.g. 444)?
3. Do we need the cipher key?

Thanks!
by whaatt
Wed Aug 04, 2010 5:17 pm UTC
Forum: Your art and links
Topic: Terminal
Replies: 3
Views: 2189

Re: Terminal

i just typed "xkcd" and the comic of the day showed up i'd like it, but you could put some "help" in there to see the codes or something like that... good job ;]... Thanks for the feedback, when I upload the latest version soon I will likely include basic commands in a help comm...
by whaatt
Mon Aug 02, 2010 6:25 pm UTC
Forum: Serious Business
Topic: Anthony Weiner on Republican delaying tactics
Replies: 10
Views: 2501

Re: Anthony Weiner on Republican delaying tactics

This guy IS great. But the problem lies in the fact that we have a (de facto) two party system. partisan voting system. In George Washington's Farewell Address , he warns against abuse of political parties, which is exactly what is going on right now. If all elections were non-partisan, and ...
by whaatt
Sun Aug 01, 2010 5:17 pm UTC
Forum: Forum Games
Topic: Count to a Million
Replies: 95008
Views: 7493868

Re: Count to a Million

30466.
by whaatt
Sun Aug 01, 2010 5:16 pm UTC
Forum: Forum Games
Topic: Ban the person above you
Replies: 20286
Views: 1195174

Re: Ban the person above you

Banned for banning banners who ban banners.
by whaatt
Sun Aug 01, 2010 5:14 pm UTC
Forum: Forum Games
Topic: Hugs!
Replies: 30338
Views: 1756154

Re: Hugs!

aHVncyBldmVyeWJvZHk=
:D
by whaatt
Sun Aug 01, 2010 4:58 pm UTC
Forum: Your art and links
Topic: Terminal
Replies: 3
Views: 2189

Terminal

Hey everybody, Inspired by the UniXkcd April Fool's joke, I decided to create my own *nix/CMD-like terminal in PHP and JS. And once I get around to having enough time, I want to turn it in to a logic puzzle. Before that, however, I wanted comments on the UI. The terminal is located at http://www.ska...
by whaatt
Sat May 29, 2010 10:05 pm UTC
Forum: Logic Puzzles
Topic: How to confirm if someone is your "future you"?
Replies: 96
Views: 14986

Re: How to confirm if someone is your "future you"?

"Did you meet me a year ago, claiming to be me?"

Although this might mess up somehow in all of the recursiveness going on.
by whaatt
Sat May 29, 2010 9:54 pm UTC
Forum: Logic Puzzles
Topic: Not as easy as 1 2 3
Replies: 56
Views: 14244

Re: Not as easy as 1 2 3

First ask: Assuming that I am thinking of either 3 or 6, is your number greater than mine? If 'yes' - they are thinking of 7, 8, or 9. If 'no' - then they are thinking of 1, 2, or 3. If 'I don't know' - they are thinking of 4, 5, or 6. Then ask: Assuming that I am thinki...
by whaatt
Sat May 01, 2010 10:14 pm UTC
Forum: Logic Puzzles
Topic: Dodgeball
Replies: 17
Views: 3332

Re: Dodgeball

But the answer to the actual problem contradicts this, specifically, Albert doesn't try to hit Caleb. If further to this Bob isn't going to hit, then Caleb doesn't need to. I concede, that this isn't an equilibrium if the payout for winning is high enough ( or the payout for losing isn't that low),...
by whaatt
Wed Apr 28, 2010 12:54 am UTC
Forum: Logic Puzzles
Topic: Dodgeball
Replies: 17
Views: 3332

Re: Dodgeball

Good job for getting the puzzle... I could calculate his exact chances, but I don't feel like putting in that much effort at the moment. Calculated: If it ends up being between Albert and Bob, Albert's chances are (1/2) + (1/16) + (1/128).... = (4/7). If it ends u...
by whaatt
Tue Apr 27, 2010 9:30 pm UTC
Forum: Logic Puzzles
Topic: Dodgeball
Replies: 17
Views: 3332

Dodgeball

Here's a puzzle that I solved once, and then solved again later. I'll post hints if asked. (sorry if this has already been posted) Albert, Bob, and Caleb invent the following dodgeball-like game: All three players stand in a triangle and can each throw the ball once on their turn. If a player hits h...
by whaatt
Tue Apr 27, 2010 9:19 pm UTC
Forum: Forum Games
Topic: Count to a Million
Replies: 95008
Views: 7493868

Re: Count to a Million

28967
by whaatt
Tue Apr 27, 2010 9:17 pm UTC
Forum: Logic Puzzles
Topic: An Alien Code?
Replies: 16
Views: 4037

Re: An Alien Code?

Can you say whether the image is supposed to be "read" right to left, left to right, top to bottom, etc...?
by whaatt
Sat Apr 24, 2010 6:11 pm UTC
Forum: Coding
Topic: PHP Ackermann's Implementation
Replies: 10
Views: 3056

Re: PHP Ackermann's Implementation

Thanks for the replies, by "It doesn't work", I mean that it just randomly cancels execution of the program and depending on the browser, displays "This page cannot be displayed." Since you're trying to display the answer in a browser, I'm guessing the browser is simply timing o...
by whaatt
Sat Apr 24, 2010 12:23 pm UTC
Forum: Coding
Topic: PHP Ackermann's Implementation
Replies: 10
Views: 3056

Re: PHP Ackermann's Implementation

Another Edit : I need to find the sum of all the Ackermann values (m,n) where 0 <= m <= 6 and 0 <= n <= 6 and give my answer mod 14^8. If anyone sees any faster ways could you could hint to it :D. Edit : The built-in BCmath module is probably what I need. I'll try it out and see if it works. Thanks...
by whaatt
Sat Apr 24, 2010 2:42 am UTC
Forum: Food
Topic: Your last meal.
Replies: 56
Views: 37946

Re: Your last meal.

Hmm. This is a toughy. Probably a burrito.
by whaatt
Sat Apr 24, 2010 1:18 am UTC
Forum: Coding
Topic: PHP Ackermann's Implementation
Replies: 10
Views: 3056

PHP Ackermann's Implementation

Edit : Just so you know, I am self-taught up to this point, so please forgive any silly errors :D ..This is also my first post on here. Arggh. :? I've been trying to create an implementation of Ackermann's function in PHP (for Project Euler, if you must know), and it works for small(ish) numbers, b...

Go to advanced search