0974: "The General Problem"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

User avatar
Someguy945
Posts: 189
Joined: Fri Jul 22, 2011 5:09 am UTC

Re: 0974: "The General Problem"

Postby Someguy945 » Tue Nov 08, 2011 11:25 am UTC

There's an old xkcd comic with a flowchart, showing how if you "do it right" you never finish. Does anyone know which comic I am talking about?

JudeMorrigan
Posts: 1266
Joined: Tue Jan 26, 2010 1:26 pm UTC

Re: 0974: "The General Problem"

Postby JudeMorrigan » Tue Nov 08, 2011 1:49 pm UTC

Someguy945 wrote:There's an old xkcd comic with a flowchart, showing how if you "do it right" you never finish. Does anyone know which comic I am talking about?

This one?

http://xkcd.com/844/

VaebnKehn
Posts: 7
Joined: Fri Jul 04, 2008 3:50 pm UTC

Re: 0974: "The General Problem"

Postby VaebnKehn » Tue Nov 08, 2011 3:48 pm UTC

This is actually a pretty cool math problem. If we had an estimate of how long it would take to complete the "better" method (Tb), and some knowledge about how many times you would ask for the salt in the future (N) as well as the times per salt passing method for both convenient (Tc) and general (Tg) solutions, then the question would simply be: [math]Tc * N > Tb + N*Tg[/math]
Even adding in Gaussian uncertainty on these values doesn't change this, since the sum of Guassians is also Gaussian.

The interesting question (generally called the Ski Renter Problem: http://pages.cs.wisc.edu/~shuchi/courses/787-F09/scribe-notes/lec14.pdf) is: What do we do when we have _no idea_ about [imath]Tb[/imath] and [imath]N[/imath]? What if our adversary sets those values knowing our method? Can we guarentee we don't waste too much time?

Clearly if N = 1 or Tb grows to infinity, we should not work on the "right" solution. However, if Tb turns out to be negligible or N grows to infinity we should have built the general solution. So what does one do?

The answer, as it turns out, is that every time you are asked to pass the salt, you pass it the "stupid" way (Tc) THEN spend [math](Tc - Tg)[/math] amount of time working on building the general method. This guarantees that you never spend more than twice the amount of time on it than you would if you had known the values of N and Tb ahead of time. This is called a 2-approximation and is the best that you can do to use your time efficiently.

chanakrogue
Posts: 15
Joined: Mon Mar 16, 2009 1:26 pm UTC

Re: 0974: "The General Problem"

Postby chanakrogue » Tue Nov 08, 2011 4:53 pm UTC

rabidmuskrat wrote:
chanakrogue wrote:For this matter: Check out http://www.getpaint.net/ ... while I work on a universal replying algorithm for everyone with a similar story in this thread. I just have to work out a parsing algorithm and tie it to the lifehacker database to search and respond with the right software tool to accomplish what the subject was trying to ...


Y'know, in a lot of ways this could really be quite handy. I know you wrote this in a sarcastic manner, but some sort of index on useful tools that is more practically organized than say download.com would be really handy.


I was trying to be helpful .. albeit in a smartass kinda way. Not sarcastic ... agree with your point though. I think you will like http://lifehacker.com/ and http://majorgeeks.com/.

User avatar
PM 2Ring
Posts: 3713
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

Re: 0974: "The General Problem"

Postby PM 2Ring » Tue Nov 08, 2011 5:11 pm UTC

Why is he waiting 20 minutes? My guess is that his dinner partner is Black Hat Guy. It's not prudent to get pushy with BHG...


bkirkman wrote:This is such a wonderful comic that I had to print it out to hang it on the wall. As I took about 30 seconds to copy and paste the image and alt text into Word, my initial instinct was to write a script that will parse XKCD comics and automatically generate a Word doc, formatted with layouts and fonts to my liking or by user selection, to print out and hang on the wall. Wow, this comic definitely hits close to home. I guess if I wanted to print out all 974 comics, it might save some time in the long run.

While you can be forgiven for using Word as the medium for manually assembling the comic for printing, I'd take a dim view of anyone who writes code to convert xkcd comics into a Word document. :)

Seriously, if you do want to play with this, take a look at the sticky in the Coding forum on Getting the most recent comic for suggestions on obtaining comic data via the JSON feed. And rather than using a Word file format, may I suggest PostScript, which is rather easy to generate in a human-readable form, is great for printing, and is easy to convert to PDF (eg, using a GhostScript-based filter), if desired to increase portability.

cream wobbly
Posts: 170
Joined: Mon Aug 03, 2009 3:07 pm UTC

Re: 0974: "The General Problem"

Postby cream wobbly » Tue Nov 08, 2011 5:53 pm UTC

I find the idea that someone would fail within 20 minutes both to recognize the existing general method of passing arbitrary condiments*, and to develop said method afresh, to be hilariously unrealistic. The salt is in a shaker already.

* I.e. a class of conveniently small dispensing containers with different openings that do not have to be washed after each sitting: shakers for small granules and powders (salt, ground pepper, etc.) and medium grounds and granules (seeds, flakes), mills for large granules (salt, pepper), graters for larger stock (nutmeg, parmesan), bottles for both free-flowing (vinegar, soy sauce) and viscous liquids (honey, syrups, mayonnaise, ketchup, mustard). Note that jars with spoons (e.g. for mayonnaise, mustard, wasabi) do not fit this general class because they must be washed after each use.
Last edited by cream wobbly on Tue Nov 08, 2011 5:56 pm UTC, edited 1 time in total.

cream wobbly
Posts: 170
Joined: Mon Aug 03, 2009 3:07 pm UTC

Re: 0974: "The General Problem"

Postby cream wobbly » Tue Nov 08, 2011 5:54 pm UTC

PM 2Ring wrote:Why is he waiting 20 minutes? My guess is that his dinner partner is Black Hat Guy. It's not prudent to get pushy with BHG...


bkirkman wrote:This is such a wonderful comic that I had to print it out to hang it on the wall. As I took about 30 seconds to copy and paste the image and alt text into Word, my initial instinct was to write a script that will parse XKCD comics and automatically generate a Word doc, formatted with layouts and fonts to my liking or by user selection, to print out and hang on the wall. Wow, this comic definitely hits close to home. I guess if I wanted to print out all 974 comics, it might save some time in the long run.

While you can be forgiven for using Word as the medium for manually assembling the comic for printing, I'd take a dim view of anyone who writes code to convert xkcd comics into a Word document. :)

Seriously, if you do want to play with this, take a look at the sticky in the Coding forum on Getting the most recent comic for suggestions on obtaining comic data via the JSON feed. And rather than using a Word file format, may I suggest PostScript, which is rather easy to generate in a human-readable form, is great for printing, and is easy to convert to PDF (eg, using a GhostScript-based filter), if desired to increase portability.


I dunno, HTML works for me.

User avatar
rhomboidal
Posts: 797
Joined: Wed Jun 15, 2011 5:25 pm UTC
Contact:

Re: 0974: "The General Problem"

Postby rhomboidal » Tue Nov 08, 2011 6:08 pm UTC

The other person is probably also developing a robust contingency system involving an intelligent robot that tells you to "Get it your own damn self."

User avatar
neoliminal
Posts: 626
Joined: Wed Feb 18, 2009 6:39 pm UTC

Re: 0974: "The General Problem"

Postby neoliminal » Tue Nov 08, 2011 6:54 pm UTC

The AGILE programmer would have simply thrown a hand full of salt at the guy.
http://www.amazon.com/dp/B0073YYXRC
Read My Book. Cost less than coffee. Will probably keep you awake longer.
[hint, scary!]

User avatar
bmonk
Posts: 662
Joined: Thu Feb 18, 2010 10:14 pm UTC
Location: Schitzoed in the OTT between the 2100s and the late 900s. Hoping for singularity.

Re: 0974: "The General Problem"

Postby bmonk » Tue Nov 08, 2011 8:40 pm UTC

SpringLoaded12 wrote:
JamusPsi wrote:I have been known to mutter, when someone takes a Cartesian path instead of the most diagonal, "Pythagoras hates you."

It applies every time. Cross country or cross lobby. NO EXCEPTIONS.

c < a + b

Do you factor in the type of ground and the topography?

For example, if there's a mountain in your path, it would be faster to drive around it than to climb up one side and then down the other.


Another factor: if you want to avoid treading a path into the substrate, you can use near-optimal solutions, avoiding the most direct route but taking a wide variety of close analogues over time.

Also, I rarely find too many mountains in the way in most lobbies, lawns, and suchlike. There are odd, metallic and plastic hills on wheels in many parking lots, which move from time to time in chaotic patterns, giving me ample opportunity to come up with shortest paths that are more interesting than a simple straight line.

-------------------------


By the way, will someone pass the salt?
Having become a Wizard on n.p. 2183, the Yellow Piggy retroactively appointed his honorable self a Temporal Wizardly Piggy on n.p.1488, not to be effective until n.p. 2183, thereby avoiding a partial temporal paradox. Since he couldn't afford two philosophical PhDs to rule on the title.

dmm
Posts: 33
Joined: Fri Mar 11, 2011 4:34 pm UTC

Re: 0974: "The General Problem"

Postby dmm » Tue Nov 08, 2011 8:54 pm UTC

Several people have commented on the improper method used in the comic to request the salt. However, no one as yet has given the (most) correct method (in English), which is: Would you please pass the salt?
Note that the preferred verb form is "would" not "will." (And certainly not "can." Egads!)
Also note inclusion of the word "please," which is necessary both for politeness and to make doubly clear that the speaker is voicing a request.

Getting back to the comic: As a programmer whose first computer language was Fortran, I got a kick out of this. It amazes me the hoops through which one must jump to do the simplest things in C++ or in Microsoft's latest perversion of Basic.

Example: Below is the ENTIRE Fortran code for a program that writes "hello world" to a file.
open(7,"filename")
print(7,*) "hello world"
(Usually one adds some extra lines to start and stop the program, and to properly close the file, but they're not strictly necessary. And the open and print statements can be made clearer with extra words, and given error handling, but again it isn't necessary.)
So simple. So obvious.

Compare that to:
#include <iostream>
#include <fostream> (or something like that)
using namespace std;
int main() {
declare an instance of an output filestream class;
associate that instance with a filename;
blah, blah, blah, blah
return(0);}

Seriously, what sick mind came up with all that?

User avatar
Revus
Posts: 13
Joined: Fri Aug 27, 2010 5:34 am UTC
Location: North of the 49th parallel. Except not.
Contact:

Re: 0974: "The General Problem"

Postby Revus » Tue Nov 08, 2011 10:00 pm UTC

Just gonna leave this here.

User avatar
cecikierk
Posts: 15
Joined: Sat Mar 08, 2008 5:03 am UTC
Location: Illinois

Re: 0974: "The General Problem"

Postby cecikierk » Tue Nov 08, 2011 10:47 pm UTC

Reminded me of every time I watch TV with my parents, my mom would ask my dad to adjust the antenna if the signal is bad. My dad would take forever and by the time we persuade him to stop the show would be long over. He insists that he is trying to find the optimal angle for every channel.

User avatar
Someguy945
Posts: 189
Joined: Fri Jul 22, 2011 5:09 am UTC

Re: 0974: "The General Problem"

Postby Someguy945 » Wed Nov 09, 2011 2:33 am UTC

JudeMorrigan wrote:
Someguy945 wrote:There's an old xkcd comic with a flowchart, showing how if you "do it right" you never finish. Does anyone know which comic I am talking about?

This one?

http://xkcd.com/844/


Yes, thank you!

User avatar
CatCube
Posts: 38
Joined: Wed Sep 21, 2011 5:28 pm UTC

Re: 0974: "The General Problem"

Postby CatCube » Wed Nov 09, 2011 4:24 am UTC

dmm wrote:Getting back to the comic: As a programmer whose first computer language was Fortran, I got a kick out of this. It amazes me the hoops through which one must jump to do the simplest things in C++ or in Microsoft's latest perversion of Basic.

Example: Below is the ENTIRE Fortran code for a program that writes "hello world" to a file.
open(7,"filename")
print(7,*) "hello world"
(Usually one adds some extra lines to start and stop the program, and to properly close the file, but they're not strictly necessary. And the open and print statements can be made clearer with extra words, and given error handling, but again it isn't necessary.)
So simple. So obvious.


As a civil engineer, I always get a kick out of CS types sneering about FORTRAN, or the like. Seriously, some of us just want the computer to do arithmetic bitchwork for a one-off problem--the kind we could do by hand if we had two months, and if it was somewhat smaller, we'd probably do it in Excel. FORmula TRANslation, despite not being philosophically perfect, works just fine for that, and doesn't require me to learn how the computer works inside. (I like to learn about how the computer works for fun, but for my job I don't give a rat's ass how it ticks.)

ijuin
Posts: 1104
Joined: Fri Jan 09, 2009 6:02 pm UTC

Re: 0974: "The General Problem"

Postby ijuin » Wed Nov 09, 2011 6:53 am UTC

Which just goes to show that FORTRAN is optimized for calculations and not for development of user-friendly applications software or games. Every programming goal has its own optimal language type, and C tries to be the jack-of-all-trades-master-of-none, and it definitely succeeds at the master-of-none part.

User avatar
Pfhorrest
Posts: 5440
Joined: Fri Oct 30, 2009 6:11 am UTC
Contact:

Re: 0974: "The General Problem"

Postby Pfhorrest » Wed Nov 09, 2011 7:11 am UTC

dmm wrote:Note that the preferred verb form is "would" not "will." (And certainly not "can." Egads!)

I would use that verb form, but I won't because of a persistent problem responses of the form "I would, but..."

The only strictly gramatical way to phrase it is "Pass the salt." It's sad that plain imperatives are seen as rude without ungrammatical modifiers, but that seems to be the case. Etymologically, sticking a "please" on it brings us back to a permissive question ("may it please you to pass the salt"), or at best a conditional imperative ("if it please you, pass the salt"), which I guess will have to do for a gramatical polite form.

Languages really need some kind of softening modifiers ("you passed me the salt" -> "[it is my perception that] you passed me the salt", "you pass me the salt" -> [it is my desire that] you pass me the salt"). Works for questions too: "Did I pass him the salt?" -> "[I wonder if] I passed him the salt", "Should I pass him the salt?" -> "[I wonder if] I should pass him the salt". Takes the impressive force out of any speech-act and turns it into a mere expression of the speaker's mind).
Forrest Cameranesi, Geek of All Trades
"I am Sam. Sam I am. I do not like trolls, flames, or spam."
The Codex Quaerendae (my philosophy) - The Chronicles of Quelouva (my fiction)

blowfishhootie
Posts: 486
Joined: Wed Sep 21, 2011 11:13 pm UTC

Re: 0974: "The General Problem"

Postby blowfishhootie » Wed Nov 09, 2011 9:55 am UTC

Pfhorrest wrote:Languages really need some kind of softening modifiers


Better yet - and much more practical - you can get over your super-literal, behind-the-times interpretation of it. Language literally changes constantly. Words and phrases change, lose and gain meaning. Phrases can mean different things from what their individual component words mean separately. And there is absolutely nothing ambiguous or wrong with the sentence, "pass the salt, please," or "can you please pass the salt" or whatever other variation you want to try to pick apart. If someone asks you "can you pass the salt" when you are sitting at a dinner table and your instinct is to think they want to know if you are physically capable of doing so, it's not the person making the request who has the linguistic deficiency.

Context is just as important in language as the actual words that are used. More so, in some cases.

User avatar
PM 2Ring
Posts: 3713
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

Re: 0974: "The General Problem"

Postby PM 2Ring » Wed Nov 09, 2011 10:36 am UTC

cream wobbly wrote:
PM 2Ring wrote:
bkirkman wrote:[...] As I took about 30 seconds to copy and paste the image and alt text into Word, my initial instinct was to write a script that will parse XKCD comics and automatically generate a Word doc, formatted with layouts and fonts to my liking or by user selection, to print out and hang on the wall. Wow, this comic definitely hits close to home. I guess if I wanted to print out all 974 comics, it might save some time in the long run.


[...] rather than using a Word file format, may I suggest PostScript, which is rather easy to generate in a human-readable form, is great for printing, and is easy to convert to PDF (eg, using a GhostScript-based filter), if desired to increase portability.


I dunno, HTML works for me.

You must be using a pretty amazing browser. :) If you print the comic from the HTML, you end up printing all that other stuff that's on the comic page, too. But the main problem is that such a printout doesn't give you the title/alt/mouseover text, so it's hardly satisfactory, since that's an important component of (most) xkcd comics. Note that bkirkman did explicitly mention that he wanted the "alt" text on his printout. If he didn't care about the title text he could've just printed the comic image file, which is just as easy to do within most browsers, and you don't get all that other crap that's on the HTML page.


On another forum I inhabit, there are a few other xkcd fans. Some of them occasionally post links to xkcd comic image files, which I find rather annoying, since you don't see the title text, and you can't easily get to the original comic page from such links.


FWIW, here's an HTML page I wrote that fetches xkcd comics. As well as displaying the comic image and the date it was published, it also displays the title text on the page itself, not just as a tooltip. It also displays the comic transcript (when available). So if you like to print xkcd comics from an HTML file, this may be more useful than using the official xkcd page. :)

Fetch xkcd comics from the JSON feed via JavaScript

User avatar
Magicman
Posts: 11
Joined: Tue Nov 01, 2011 1:18 am UTC

Re: 0974: "The General Problem"

Postby Magicman » Wed Nov 09, 2011 2:00 pm UTC

You must be married...

Kit.
Posts: 1117
Joined: Thu Jun 16, 2011 5:14 pm UTC

Re: 0974: "The General Problem"

Postby Kit. » Wed Nov 09, 2011 4:37 pm UTC

dmm wrote:Getting back to the comic: As a programmer whose first computer language was Fortran, I got a kick out of this. It amazes me the hoops through which one must jump to do the simplest things in C++ or in Microsoft's latest perversion of Basic.

Example: Below is the ENTIRE Fortran code for a program that writes "hello world" to a file.
open(7,"filename")

That's not the Fortran I know.

Besides, in the earlier Fortrans you were not opening files at all. You were just using the file already assigned to your LUN 7 by the OS (about the same as STDOUT in C, or std::cout in C++). But you did not have (*) formats, and you didn't have string literals, so printing strings was very ugly.
Last edited by Kit. on Wed Nov 09, 2011 8:18 pm UTC, edited 3 times in total.

nealh
Posts: 31
Joined: Fri Aug 15, 2008 4:20 pm UTC

Re: 0974: "The General Problem"

Postby nealh » Wed Nov 09, 2011 6:11 pm UTC

My first thought after reading this comic: "Salt-wanting guy is my homework partner who still uses Microsoft word, because of Latex's learning curve."
When will he see the light? :cry:

dmm
Posts: 33
Joined: Fri Mar 11, 2011 4:34 pm UTC

Re: 0974: "The General Problem"

Postby dmm » Wed Nov 09, 2011 8:59 pm UTC

Kit. wrote:That's not the Fortran I know.

Besides, in the earlier Fortrans you were not opening files at all. You were just using the file already assigned to your LUN 7 by the OS (about the same as STDOUT in C, or std::cout in C++). But you did not have (*) formats, and you didn't have string literals, so printing strings was very ugly.


LOL! Sounds like you're thinking of Fortran66 (or maybe unextended 77). We've come a long way, baby. Fortran has become simultaneously simpler and more powerful over the years. Fortran2003-compliant compilers can do almost everything C++ can do (but only if you actually WANT to be that complicated), and can usually do it much more simply. For example, modern Fortran can do matrix math (like Matlab), double precision math, and complex math. It can do pointers, classes, and OOP. All of this is with no special #includes or headers or namespaces or any nonsense like that. It's all built in to the compiler automatically. But you can also write short simple programs in 15 minutes, only once a year or so, if that's what your job entails. You don't have to curse and swear and cry and consult three different manuals just to figure out how to read a series of numbers from an ASCII data file.

IMHO, it is criminal how REAL science departments have allowed computer "science" departments to substitute C++ for Fortran, just because that's easier for them. Writing an OS or word processor? By all means, use C++. Doing science? You should be using Fortran, Matlab, Mathematica, or Python (or LabView, for experimentalists). And if you're doing science and using Excel to make your graphs, I feel very sorry for you. [edit: You wouldn't use Fortran to make graphs. Excel for graphs is just another example of science students being forced to use the wrong tool. Also it's another of my many pet peeves.]

User avatar
PM 2Ring
Posts: 3713
Joined: Mon Jan 26, 2009 3:19 pm UTC
Location: Sydney, Australia

Re: 0974: "The General Problem"

Postby PM 2Ring » Thu Nov 10, 2011 12:34 pm UTC

Magicman wrote:You must be married...

Is that an observation or an imperative? :wink:


nealh wrote:My first thought after reading this comic: "Salt-wanting guy is my homework partner who still uses Microsoft word, because of Latex's learning curve."
When will he see the light? :cry:

Don't get your hopes up - excessive use of MS Word is known to cause permanent cognitive impairment. :)

RogerB
Posts: 35
Joined: Tue Apr 21, 2009 12:20 pm UTC

Re: 0974: "The General Problem"

Postby RogerB » Thu Nov 10, 2011 1:21 pm UTC

This
bkirkman wrote:This is such a wonderful comic that I had to print it out to hang it on the wall. As I took about 30 seconds to copy and paste the image and alt text into Word, my initial instinct was to write a script that will parse XKCD comics and automatically generate a Word doc, formatted with layouts and fonts to my liking or by user selection, to print out and hang on the wall. Wow, this comic definitely hits close to home. I guess if I wanted to print out all 974 comics, it might save some time in the long run.

neatly illustrates this
mivadar wrote:Most of the time when I built a complete solution:
1. I never got to use it (never got past the first stage of the project / work got cancelled / went off in a different unanticipated direction / etc.)
2. Nobody else used it (don't understand / someone else did it, so don't trust / would have been useful X time after I left, but nobody was aware of it having been done, so it was re-done / etc.)

Now, unless I am totally, absolutely, 100% sure that something will be useful in the future, I hack it together.

Recently I realized that even if I do need to use similar solutions later, the total time spent on the hacks is less than a complete solution would have been. :roll:

Nobody knows that the master artisan of great foresight has already passed this way. Actually my boss recently went to a Software Architecture seminar and came back with an acronym for this - YAGNI - You ain't gonna need it.

Also, don't forget http://xkcd.com/951/ you could well be paying yourself less than minimum wage.

User avatar
SirMustapha
Posts: 1302
Joined: Mon Jul 21, 2008 6:07 pm UTC

Re: 0974: "The General Problem"

Postby SirMustapha » Thu Nov 10, 2011 4:14 pm UTC

PM 2Ring wrote:
nealh wrote:My first thought after reading this comic: "Salt-wanting guy is my homework partner who still uses Microsoft word, because of Latex's learning curve."
When will he see the light? :cry:

Don't get your hopes up - excessive use of MS Word is known to cause permanent cognitive impairment. :)


Which is a little bit better than the permanent destruction of social skills caused by overuse of Latex.

Rory
Posts: 20
Joined: Thu Oct 02, 2008 4:42 pm UTC

Re: 0974: "The General Problem"

Postby Rory » Thu Nov 10, 2011 4:22 pm UTC

When I first read this comic, I thought the joke would be that the other guy was wondering if he really can pass the salt. Like, he’s wondering if it would still be considered “the salt” by the time he picks it up, or something philosophical like that.

Kit.
Posts: 1117
Joined: Thu Jun 16, 2011 5:14 pm UTC

Re: 0974: "The General Problem"

Postby Kit. » Thu Nov 10, 2011 9:01 pm UTC

dmm wrote:
Kit. wrote:That's not the Fortran I know.
Besides, in the earlier Fortrans you were not opening files at all. You were just using the file already assigned to your LUN 7 by the OS (about the same as STDOUT in C, or std::cout in C++). But you did not have (*) formats, and you didn't have string literals, so printing strings was very ugly.

LOL! Sounds like you're thinking of Fortran66 (or maybe unextended 77). We've come a long way, baby. Fortran has become simultaneously simpler and more powerful over the years. Fortran2003-compliant compilers can do almost everything C++ can do (but only if you actually WANT to be that complicated), and can usually do it much more simply. For example, modern Fortran can do matrix math (like Matlab), double precision math, and complex math. It can do pointers, classes, and OOP. All of this is with no special #includes or headers or namespaces or any nonsense like that. It's all built in to the compiler automatically. But you can also write short simple programs in 15 minutes, only once a year or so, if that's what your job entails. You don't have to curse and swear and cry and consult three different manuals just to figure out how to read a series of numbers from an ASCII data file.

That's exactly what this comic is about. When people were asking "the Fortran guy" about salt, they were asked to wait for a next standard, where all what they currently want will be put into a neat form.

While the C and then C++ guys just delivered numerous and competing versions of their ugly #includes, the best of which were to be reused in the standards later.

[Besides, when I want to write a short program, I use Perl anyway]

ThemePark
Posts: 450
Joined: Fri Jun 27, 2008 5:42 pm UTC
Location: Århus, Denmark

Re: 0974: "The General Problem"

Postby ThemePark » Thu Nov 10, 2011 9:28 pm UTC

bmonk wrote:By the way, will someone pass the salt?

Yes, someone will. Eventually.

And this is exactly why the RIGHT way to ask is "Would you please pass me the salt right now?" Anything but a yes from the person being asked the question, and you're allowed to punch him in the face.

Leaving out the me results in the person, especially if said person is BHG, passing the salt to someone else or to himself if he really wants to be a fallos symbol. Leaving out right now results in an undefined amount of time before said request is carried out.

It's not often that I feel like acting like a fallos symbol or get the chance, but this was a golden opportunity. Now would you please pass me the pepper right now?

Oh, and it's not directed at you, bmonk, your post just made me think of this.

Also, as a fellow programmer, I find it funny how people are talking about using different languages for different projects. If it's for work or for some project that's important to you and important to code properly, then obviously language choice is important. But other than that, just use whatever language you know the best. Screw whether or not the language is specialized for what you want to do, if it gets the job done. For me that language is Java. The language of choice for my education, for many of my important projects and for whenever I need to hack something together where I don't have to give a damn about good coding styles, design patterns and what not. A dirty hack that gets the job done...well it gets the job done.
I have traveled from 1979 to be a member of the unofficial board Council of Elders. Phear M3

bkirkman
Posts: 2
Joined: Mon Nov 07, 2011 7:35 pm UTC

Re: 0974: "The General Problem"

Postby bkirkman » Fri Nov 11, 2011 4:06 pm UTC

PM 2Ring wrote:
bkirkman wrote:This is such a wonderful comic that I had to print it out to hang it on the wall. As I took about 30 seconds to copy and paste the image and alt text into Word, my initial instinct was to write a script that will parse XKCD comics and automatically generate a Word doc, formatted with layouts and fonts to my liking or by user selection, to print out and hang on the wall. Wow, this comic definitely hits close to home. I guess if I wanted to print out all 974 comics, it might save some time in the long run.

While you can be forgiven for using Word as the medium for manually assembling the comic for printing, I'd take a dim view of anyone who writes code to convert xkcd comics into a Word document. :)

Seriously, if you do want to play with this, take a look at the sticky in the Coding forum on http://forums.xkcd.com/viewtopic.php?f=11&t=3095 for suggestions on obtaining comic data via the JSON feed. And rather than using a Word file format, may I suggest PostScript, which is rather easy to generate in a human-readable form, is great for printing, and is easy to convert to PDF (eg, using a GhostScript-based filter), if desired to increase portability.


I nearly wrote a disclaimer, since I knew I'd catch some serious flack for mentioning MS Word! I should have known :) It's nice to see some master artisans have already gone down this path, so I can save myself the time.

ThemePark
Posts: 450
Joined: Fri Jun 27, 2008 5:42 pm UTC
Location: Århus, Denmark

Re: 0974: "The General Problem"

Postby ThemePark » Fri Nov 18, 2011 1:41 pm UTC

Great, I just realized that I'm about to embark onto this road. I need a sudoku generator that has very specific features, and while I've been able to find some programs that fulfill some of the features I have not been able to find one that fulfills them all. So I could put together a program that does exactly what I want, and although it will take months of my time, I really want to do it. Or I could just use the best of the programs and wait for it to generate a sudoku that fulfills all the requirements, and while that will take a lot of time it still should be faster than programming it myself.

But either way, I'll end up spending days, weeks if I'm unlucky.

Edit: Aaaaaaaaaaaaaaand 20 minutes later, I found an online solver that does exactly what I need. Figures. Problem solved.
I have traveled from 1979 to be a member of the unofficial board Council of Elders. Phear M3

Pingouin7
Posts: 91
Joined: Thu Oct 27, 2011 4:50 pm UTC
Location: ~/

Re: 0974: "The General Problem"

Postby Pingouin7 » Sat Aug 18, 2012 7:39 pm UTC

ThemePark wrote:Great, I just realized that I'm about to embark onto this road. I need a sudoku generator that has very specific features, and while I've been able to find some programs that fulfill some of the features I have not been able to find one that fulfills them all. So I could put together a program that does exactly what I want, and although it will take months of my time, I really want to do it. Or I could just use the best of the programs and wait for it to generate a sudoku that fulfills all the requirements, and while that will take a lot of time it still should be faster than programming it myself.

But either way, I'll end up spending days, weeks if I'm unlucky.

Edit: Aaaaaaaaaaaaaaand 20 minutes later, I found an online solver that does exactly what I need. Figures. Problem solved.


Related-even-though-you-know-already
Dason wrote:
Kewangji wrote:I confess I am actually scared of peanuts, and tend to avoid them, given how lethal they are to some people.

I'm not. I do my part in the fight against peanuts by destroying them with my powerful teeth. Take that peanut! How does being digested feel!?

User avatar
dotancohen
Posts: 47
Joined: Sat Feb 16, 2008 8:18 am UTC

Re: 0974: "The General Problem"

Postby dotancohen » Tue Sep 11, 2012 1:36 pm UTC

I'm still waiting for the follow up to this comic. Obviously we will see the fruit of Mr. General Problem's labor some future day. I was disappointed when a month went by with no follow up. I'll be disappointed if a year goes by without. Maybe a decade? I've sure used General Solution code written a decade prior.

User avatar
mathmannix
Posts: 1445
Joined: Fri Jul 06, 2012 2:12 pm UTC
Location: Washington, DC

Re: 0974: "The General Problem"

Postby mathmannix » Tue Sep 11, 2012 2:37 pm UTC

ThemePark wrote:
bmonk wrote:By the way, will someone pass the salt?

Yes, someone will. Eventually.

And this is exactly why the RIGHT way to ask is "Would you please pass me the salt right now?" Anything but a yes from the person being asked the question, and you're allowed to punch him in the face.


I respectfully disagree. While it would, most likely, be better for society as a whole to parse the question as the polite phrasing of a command/order, as is most likely intended by the person asking, the fact remains that "Please pass the salt." is a command, order, instruction, etc., whereas "Would you please pass the salt?" (or the original from the comic "Can you pass the salt?") is a question. Hence, the question mark.

I submit that the best response would be to first, pass the salt, and then reply to the question with "Apparently, yes." (http://www.xkcd.com/943/) This will satisfy the responder's need for a literal interpretation, as well as the questioner's need for salt.
I hear velociraptor tastes like chicken.


Return to “Individual XKCD Comic Threads”

Who is online

Users browsing this forum: Pfhorrest and 97 guests