Search found 157 matches

by Guff
Fri Jul 09, 2010 4:51 pm UTC
Forum: Individual XKCD Comic Threads
Topic: 0764: "One Two"
Replies: 348
Views: 73943

Re: "One Two" Discussion

Comic: funny.
Title text: amusing.
Ensuing discussion of title text: hilarious.
by Guff
Wed Oct 28, 2009 7:35 pm UTC
Forum: Coding
Topic: What to learn: Perl, Python or Ruby?
Replies: 41
Views: 4996

Re: What to learn: Perl, Python or Ruby?

Monika wrote:Ruby's syntax is a bit unusual ... are there other languages with an "unless" statement?

Perl.
by Guff
Tue Oct 27, 2009 10:34 pm UTC
Forum: Religious Wars
Topic: Am I the only one on here that can't stand Python?
Replies: 184
Views: 36857

Re: Am I the only one on here that can't stand Python?

poohat wrote:...and the py3k changes to map/filter/etc are silly.

Uh, how so?
poohat wrote:also too many functions are implemented as object methods when they should be global functions

Wait, what?
by Guff
Thu Oct 22, 2009 2:25 am UTC
Forum: Religious Wars
Topic: Coding Fonts
Replies: 117
Views: 31287

Re: Coding Fonts

Anti-aliased fonts for coding gives me the shivers. It's just so wrong. I want to be presented with a 8x12 or 8x16 bitmap font, not some fancy pants subpixel hinted junk. Bah, who needs dot matrix displays? Real Coders use 7-segment displays. And Extreme Coders use incandescent 7-segment displays .
by Guff
Thu Oct 22, 2009 1:00 am UTC
Forum: Religious Wars
Topic: Coding Fonts
Replies: 117
Views: 31287

Re: Coding Fonts

littlebuddy wrote:LIBERATION MONO

High-five.

Editor is Geany.
I find themes with dark backgrounds are generally more readable for me, but very dark themes are tools of the devil.
by Guff
Fri Sep 04, 2009 7:29 pm UTC
Forum: Religious Wars
Topic: Am I the only one on here that can't stand Python?
Replies: 184
Views: 36857

Re: Am I the only one on here that can't stand Python?

I don't think I could ever take a language seriously when a key element of the language is whitespace indentation for defining code blocks. (seems too much like one of those silly instructors saying "now this is how things should always be done so that they can be readable" trust me, I've...
by Guff
Tue Jul 14, 2009 4:59 pm UTC
Forum: Mathematics
Topic: Post your interesting/challenging/fun integrals
Replies: 53
Views: 9698

Re: Post your interesting/challenging/fun integrals

Can you simplify the argument by showing that the integral is equal to \displaystyle 6 \sum_{k=1}^{\infty} \frac{1}{k^4} , by any chance? Well, yeah, that is pretty straightforward, given that \zeta(s) = \frac{1}{\Gamma(s)}\int_0^\infty \frac{t^{s-1}}{e^t - 1}dt which is straightfor...
by Guff
Sun Jul 12, 2009 9:00 pm UTC
Forum: Mathematics
Topic: Post your interesting/challenging/fun integrals
Replies: 53
Views: 9698

Re: Post your interesting/challenging/fun integrals

Irresistible Integrals has some great ones. One pretty integral is \int_0^1 \ln{\Gamma(x)} dx = \ln{\sqrt{2\pi}} But I think maybe that would be a little more involved than what you're looking for. If they've dealt with infinite sums, then the Sophomore's dream might be more approachable: \...
by Guff
Sat Jul 11, 2009 3:42 pm UTC
Forum: Mathematics
Topic: On a binomial coefficient identity I'm too stupid to prove
Replies: 4
Views: 1300

Re: On a binomial coefficient identity I'm too stupid to prove

Oh, well now it seems obvious. :oops:

Thanks, guys.
by Guff
Sat Jul 11, 2009 8:52 am UTC
Forum: Mathematics
Topic: On a binomial coefficient identity I'm too stupid to prove
Replies: 4
Views: 1300

On a binomial coefficient identity I'm too stupid to prove

Alright, so somewhat recently I got the idea to see how much re: trig identities and whatnot I could prove with starting out by defining sine by its power series. Then I got kind of sidetracked and tried to work out the series representation for \sin^2 x by representing it as the Cauchy product of t...
by Guff
Wed Jun 24, 2009 4:18 am UTC
Forum: Coding
Topic: Coding Competition sqrt(5)/2: BF strings
Replies: 53
Views: 5381

Re: Coding Competition sqrt(5)/2: BF strings

Okay, I've gotten nowhere in terms of optimization. I'm still stuck with a variation on the ultra-naive version posted earlier, which means the output is, well, about four million characters long. I'm relatively certain that would not take first place. Edit: Another thing, do the carriage returns at...
by Guff
Tue Jun 23, 2009 12:17 am UTC
Forum: Coding
Topic: Coding Competition sqrt(5)/2: BF strings
Replies: 53
Views: 5381

Re: Coding Competition sqrt(5)/2: BF strings

MHD wrote:Is wrapping allowed?
quintopia wrote:You may NOT assume a wrapping implementation of BF. Use non-wrapping computations only.
by Guff
Mon Jun 22, 2009 10:19 pm UTC
Forum: Coding
Topic: Coding Competition sqrt(5)/2: BF strings
Replies: 53
Views: 5381

Re: Coding Competition sqrt(5)/2: BF strings

quintopia wrote:So yes, the first 250 is really the first 241. Deal with it.

Well uh, that could be a problem if your 500 lines aren't really 500.
by Guff
Mon Jun 22, 2009 5:50 pm UTC
Forum: Coding
Topic: Coding Competition sqrt(5)/2: BF strings
Replies: 53
Views: 5381

Re: Coding Competition sqrt(5)/2: BF strings

quintopia wrote:If you're planning on participating, please post, because, if it's only gonna be cosmo, I may as well, just postpone the whole thing.

Okay, well I think I'll give it a shot.
by Guff
Sat Jun 20, 2009 7:42 pm UTC
Forum: Coding
Topic: Coding Competition sqrt(5)/2: BF strings
Replies: 53
Views: 5381

Re: Coding Competition sqrt(5)/2: BF strings

I don't even know brainfuck :( Uh, dude, it only makes use of 8 characters. Only 7 of which would even be relevant to this competition. There's hardly anything to "know" about brainfuck. This is more of an optimization thing than a brainfuck thing. Hell, this is an extremely unoptimized s...
by Guff
Thu Jun 04, 2009 4:34 am UTC
Forum: Computer Science
Topic: Wolfram|Alpha
Replies: 77
Views: 10489

Re: Wolfram|Alpha

This is sort of funny/weird. It seems to have no idea what's happening here. http://www71.wolframalpha.com/input/?i=World+consumption First it thinks that I'm talking about tuberculosis. Then it goes off to say that 100% of people die of tuberculosis. No, it's actually right. People living in this ...
by Guff
Thu Jun 04, 2009 1:50 am UTC
Forum: Coding
Topic: Project Euler
Replies: 411
Views: 159730

Re: Project Euler

That's way too many keystrokes, guys.

For [imath]\pi(n)[/imath]:

Code: Select all

(p:^:_1)2e6


For problem 10:

Code: Select all

x:+/i.&.(p:^:_1)2e6


I should really try actually learning J some day.
by Guff
Sat May 30, 2009 6:16 am UTC
Forum: Coding
Topic: Programming logic question (Java)
Replies: 10
Views: 925

Re: Programming logic question (Java)

InkL0sed wrote:Clone is not a reliable method though, I wouldn't advise using it.

Mind explaining why, for us non-Java people?
by Guff
Thu May 28, 2009 6:17 am UTC
Forum: Coding
Topic: My Personal Python Help Topic
Replies: 6
Views: 867

Re: My Personal Python Help Topic

Second question: Is it possible to refer to an external python program function? External meaning from another file. Yes. If the other script is in the current working directory or your PYTHONPATH (if you've never dealt with environment variables, there's likely instructions out there explaining ho...
by Guff
Thu May 28, 2009 5:26 am UTC
Forum: Coding
Topic: My Personal Python Help Topic
Replies: 6
Views: 867

Re: My Personal Python Help Topic

First off, the method you're using is very inefficient, and your upper bound for i is too low anyways. Try reading up on Euclid's algorithm, then how that relates to least common multiples. To answer your actual question, though, I'm not entirely sure what your line of thought is. list([range(2,21)]...
by Guff
Sun May 24, 2009 4:39 am UTC
Forum: Coding
Topic: Problem with Euler problem #3 in python
Replies: 40
Views: 3368

Re: Problem with Euler problem #3 in python

You, sir, name? wrote:If the sum of digits is divisible by B-1 in base B, then the number as a whole is divisible by B-1.

And even more generally, iff b % m == 1 and the sum of the base-b digits of n is divisible by m, then n is divisible by m. Which is actually pretty easy to demonstrate with modular arithmetic.
by Guff
Sun May 24, 2009 4:05 am UTC
Forum: Coding
Topic: Python Problem
Replies: 17
Views: 1563

Re: Python Problem

Berengal wrote:To be able to assign to a global variable in a function you need to declare it global, like 'global x'.

Also, don't do this unless you absolutely have to.
by Guff
Fri May 22, 2009 5:02 am UTC
Forum: Coding
Topic: Quick Lisp question
Replies: 6
Views: 677

Re: Quick Lisp question

Dawgs, I wouldn't ask if I found it on google. (which I didn't, as I googled "Lisp car" and "Lisp cdr" which didn't explain much other than how to use them) And thanks. Dawg, the Wikipedia article that explains it in the first section is the second result for both of those searc...
by Guff
Thu May 21, 2009 5:16 am UTC
Forum: Coding
Topic: Problem with Euler problem #3 in python
Replies: 40
Views: 3368

Re: Problem with Euler problem #3 in python

Oh boy, that's a bit of code for this problem.

I'm not exactly sure what your line of thought is here, and in my sleep deprived state I can't make much sense of your method. Mind explaining it?
by Guff
Sat May 09, 2009 1:51 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034776

Re: Coding: Fleeting Thoughts

Is that python? I have no clue what exactly "_= ZOMGWTF! " means. _ is a valid name in Python (in the interpreter it normally has the value of the last evaluated expression, though it can be reassigned as is the case here). Really, it's not quite as complicated as it looks. Obfuscated to ...
by Guff
Fri May 08, 2009 10:49 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034776

Re: Coding: Fleeting Thoughts

Just this: _=(lambda(l):("".join(map(lambda(s):chr(int(s,36)),l))))(['11','14','2N','15', '37','W','2Q','33','38','38','30','2T&#...
by Guff
Sun Apr 26, 2009 4:05 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034776

Re: Coding: Fleeting Thoughts

So I've been buying more old books for cheap off the internet. One that I found was Programming in Prolog, from 1981. Hey, it was 75 cents before shipping, alright? This language is a total mindfuck to me. No, not a brainfuck. Brainfuck's difficulty comes from its absurd minimalism. Prolog is, well,...
by Guff
Sat Apr 25, 2009 3:26 pm UTC
Forum: Coding
Topic: python program ideas for beginners?
Replies: 10
Views: 9866

Re: python program ideas for beginners?

err, when I attempt to run that program, nothing happens. Isn't def WebHelp(): supposed to be def main(): or something of that sort? No, Python scripts don't need 'main()' functions. It's not doing anything because if you just run that code, all it does is define webHelp(). It doesn't actually run ...
by Guff
Tue Apr 21, 2009 2:16 am UTC
Forum: Coding
Topic: Your perfect language?
Replies: 87
Views: 8076

Re: Your perfect language?

mrbaggins wrote:Am I the only person on the planet that cannot STAND python?

No, but my personal experience suggests that most of said group doesn't really know what they're talking about. The rest are just kind of annoying to be around.
by Guff
Wed Apr 15, 2009 10:49 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034776

Re: Coding: Fleeting Thoughts

I haven't checked it thoroughly, but could it be that you are splitting a number of odd length just right-of-centre, and so padding the right half? This would insert an extra zero bit in the middle of the number when the results are assembled again. You must make sure that when you split a number o...
by Guff
Wed Apr 15, 2009 9:44 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034776

Re: Coding: Fleeting Thoughts

So, what do you get when you uncomment # print(p_1, p_2, p_3) >>> multiplications.split_bits(7,8) ((1, 3), (2, 0)) >>> multiplications.karat_multiply(7, 8) 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 2 0 2 2 0 16 88 So split_bits does work for (7, 8). Not sure where the 16 for p_3 is coming from, though. My pyth...
by Guff
Wed Apr 15, 2009 9:02 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2034776

Re: Coding: Fleeting Thoughts

As someone who just discovered you can get lots of cool computer science books for cheap on the internet, not so long ago I read about Karatsuba's algorithm for multiplication. I think I actually understand it. Problem: trying to write it in Python is driving me insane. Yeah, sure, under the hood Py...
by Guff
Sun Apr 12, 2009 4:45 am UTC
Forum: Coding
Topic: Your perfect language?
Replies: 87
Views: 8076

Re: Your perfect language?

I've been mulling this question over for months now. Thing is, whenever I think of a feature I would really like, I realize that Haskell's already done it. The issue is that I have yet to actually feel compelled to use Haskell for anything, instead just falling back on Python for most things.
by Guff
Sat Apr 11, 2009 3:19 am UTC
Forum: Coding
Topic: Contest #3
Replies: 97
Views: 8602

Re: Contest #3

No, I didn't. I use Python 3. 8) Seriously they changed how input works? Uh, yeah. raw_input -> input, and the old input is gone. Granted, you can still replicate it with eval(input()). And print is a function now, not a statement. Quite frankly, I love it. Consistency and non-silly ways of impleme...
by Guff
Sat Apr 11, 2009 3:10 am UTC
Forum: Coding
Topic: Contest #3
Replies: 97
Views: 8602

Re: Contest #3

import re def run(expression): blar = list(filter(bool, re.split(r'(\+|-|\*|/|\^|\?|\d{1,5})', re.sub\ (r'\s', '', expression)))) return {'?': lambda x, y: "what hath god wrought", '+': int.__add__, '-': \ int.__sub__, '*': int.__mul__, '/': lambda a, b: ' r'.join((str(a//b),\ str(a % b))...
by Guff
Sat Apr 11, 2009 12:39 am UTC
Forum: Coding
Topic: Contest #3
Replies: 97
Views: 8602

Re: Contest #3

You, sir, name? wrote:Where do I collect my cookie?

Yeah, but, but...

God damnit. :evil:
Though, yours doesn't handle division in the manner specified.
by Guff
Sat Apr 11, 2009 12:10 am UTC
Forum: Coding
Topic: Contest #3
Replies: 97
Views: 8602

Re: Contest #3

Python code for obvious solution: #!/usr/bin/python import sys; s = sys.stdin.read(11); x = int(s[0:5]); y = int(s[6:11]); z = s[5] if (z == '+'): print x + y elif (z == '-'): print x - y elif (z == '*'): print x * y elif (z == '^'): print x**y elif (z == '/'): print x/y,'r',x%y else: print 42 Too ...
by Guff
Thu Apr 09, 2009 1:21 am UTC
Forum: Coding
Topic: Import problem with Python
Replies: 24
Views: 2020

Re: Import problem with Python

ashgray wrote:That just gave me another SyntaxError.

If you want help, we kind of need the actual output from the interpreter so we can see what the problem is.
by Guff
Mon Apr 06, 2009 10:37 pm UTC
Forum: Coding
Topic: Import problem with Python
Replies: 24
Views: 2020

Re: Import problem with Python

Works for me when input directly into the interactive interpreter for 2.6.

What line is the syntax error on? Perhaps you just need to add a newline?
by Guff
Mon Apr 06, 2009 5:00 am UTC
Forum: Coding
Topic: xkcd coding contest #2: NOPscotch
Replies: 87
Views: 6192

Re: xkcd coding contest #2: NOPscotch

Since I'm not (and never really was) in the competition to get a good long path, I'll go ahead and post my submission early. If you can manage to get something out of this that improves your own code, god help us all. I wrote NOPscotch: Web 2.0 Edition. It uses a del.icio.us account...

Go to advanced search