« first day (1838 days earlier)      last day (3125 days later) » 

3:00 PM
@Kevin If yours takes a different approach, posting it is perfectly fine.
 
Ok, I have done so.
I think I can smallify further if I can get rid of those loops. Pretty sure PIL has an image_map method somewhere...
 
Cabbage all, bugrit
 
No, I'm mistaken. Image.eval(image, func) exists, but it passes the pixel color to function rather than the coordinates.
 
Allow us to set the default view in new-nav. I'm still not sure how I like the latest new-nav, some cool ideas but seems a bit too complex.
 
I believe you can move p[i,j]=1-c(f(i),f(j),2) onto the same line as the inner loop.
Should save you two bytes.
You can also save a bunch of space putting keywords next to brackets.
 
3:03 PM
@Kevin halp halp Python 2 o.O
 
DSM
Ouchy morning cabbage for all.
 
@Kevin bpaste.net/show/8a052b4f40a8 that gets you down to 321.
 
DSM
Very rainy, so I had an umbrella. I'm very cheap, so it's a 2$ dollar-store umbrella. Very windy, so umbrella broke, and I had to hold it at a weird angle to prevent getting wet. Weird angle meant I couldn't see what was in front of me, which is why I walked right into a loading truck at a hospital. (Yes, a hospital.) Cut my hand all to bits.
 
Oh no. :(
 
DSM
As usual, in order for something bad to happen a whole chain of things had to happen first, any one of which not happening would have spared me. :-/
 
3:07 PM
Think on the bright side, free health care! (if necessary) :P
 
You can also shorten the ternary by putting the options in a tuple and using the check to index into it.
Eg, ('False', 'True')[True] will return 'True' and it's shorter.
 
Ooh, I can use frombytes instead of img.load
 
@MorganThrapp unlike a ternary, though, this doesn't short-circuit and will always evaluate both expressions
 
DSM
@Programmer: if you think "publicly funded" == "free", I can pretty much guess your voting habits. :-)
@MorganThrapp: is this another golf?
 
@DSM I know it's not "free". I actually choose to vote for no one because politics is a joke, but that's my opinion.
 
3:12 PM
@MorganThrapp I don't think I can do the tuple trick here because the ternary is inside a recursive function, so I depend on the short-circuiting to prevent an infinite loop.
 
DSM
@Kevin: maybe I misread. Is this your golf instead?
 
Yes, I have written a golf answer here
 
DSM
x**2 -> x*x, 0.5->.5.
 
Good thinking.
 
DSM
Can you do the bitwise-boolean shift?
 
3:21 PM
I should, yeah
Or maybe not. Apparently expr & not expr is a syntax error?
 
DSM
Try ~ for not.
(Although you'll have to check the precedence, I can never remember how that works.)
 
Works like a charm.
Oops, I never smallified dx and dy. That's four chars right there.
 
@Kevin Ahhh, gotcha. Good point.
Also, I don't know what you're using to get your byte count, but I'm getting 263 not 268.
 
DSM
Me too.
 
It's notepad++ being dumb and counting newlines as two chars.
 
3:29 PM
@Kevin Use this
 
DSM
Python 2 and Windows? Kevin.. I mean..
 
I can't justify the extra four characters that Python 3 would require
 
DSM
Storing .5 is a net loss, it looks like.
 
Namely, adding raw_ to input
I think that's as small as I can get it without radical structural changes
 
Anonymous
Hello guys, is nesting try/except with each other a bad idea?
 
Anonymous
3:36 PM
while foo = bar:
    try:
        response = urlopen(...).read().decode('utf8')
        data = json.loads(respose)
        for i in data:
            try:
                cursor.execute()
            except Exception as e:
                print(e)
    except Exception as e:
        print(e)
 
Yeah, I don't see anything obvious. You're almost 100 bytes under the other guy, nice!
 
@samayo There's nothing inherently wrong with nested try/except, no
 
@samayo Perfectly normal. It's designed to work that way.
 
Anonymous
Oh, good to know. I was a bit worried there
 
Not really a question, more of seeking a blessing from the elders.
 
Anonymous
3:37 PM
I also think it is better than using one try/except for various tasks, like checking URL and database with one try/except seems wrong
 
It's a question of the form, "does this seemingly innocuous approach have any horrible drawbacks that I am not aware of?", the answer to which is occasionally "yes"
ex. Q: "Can I write a text adventure by putting each room in its own function?" A: "Yes, if the user will definitely end the game before navigating 999 rooms and hitting the maximum recursion depth"
 
I may or may not have done exactly that. Unfortunately 12 year old me was a sloppy developer and didn't store his code in a repo.
 
@Kevin I expected an animated gif as the bonus…
 
Have we got a dupe target for "smooshing a sequence of integers into sequential runs"? This guy could use it, although it wouldn't be a perfect dupe since he has multiple sequences.
 
user559633
@davidism you're a linux-as-a-desktop guy, do you dual boot to play games?
 
3:45 PM
Fix-the-driver is the only game Linux needs. Endless hours of fun!
 
circle-based fractals are a bit harder to do "infinite zoom" gifs of, since there's usually a "focal point" where a bounding box centered on that point can see primitives from every level of the fractal at once, no matter how small the box is.
I don't know if that makes any sense, but just interpret it as "it would be a pain in the butt"
 
Did you see my SVG answer? :P
 
user559633
(happy to talk about this in rec.sopython.social so it doesn't pollute room/6)
 
Instead of rendering just increasingly smaller iterations of the main image, I would have to do that and render increasingly larger iterations.
@poke +1 for vectors. Us pixel-based answerers haven't captured the shape's true essence.
 
:D
 
3:48 PM
Circles shouldn't be made of tiny squares. It's just wrong.
 
Btw. I really had issues positioning those circles. What is the Y coordinates of the circles above the center? (relative to its size)
 
If the big circle has radius one, and is centered on the origin, the upper smaller circle has center 0, sqrt(3)/4
That was also the part I had the most issues with.
 
which “big” are you referring to, and what is the “upper smaller circle”? :P
There are three circle sizes: 1, 2 and 4.
(or 1/4, 1/2, 1 if you want)
“size” being the radius.
 
Using radiuses 1/4, 1/2, 1, with the circle of radius 1 being centered on the origin, the highest circle of radius 1/2 has a center at (0, sqrt(3)/4)
I didn't need to manually find the positions of the 1/4 radius circles, since I did a recursive thing. I guess the highest circle of radius 1/4 would be at 3/2 * sqrt(3)/4???
 
Request: Can you render the same circle, but instead of cropping the circles, they just overlap and when they do they invert the dodge/burn?
 
3:55 PM
@Kevin Thanks, I think that helps.
 
@QuestionC, I think you can do that by changing "and not" to "xor"
 
Thanks.
 
That’s… not so pretty.
 
DSM
It looks like a lot of billiard balls in a pile.
 
3:58 PM
Don't project your unrealistic beauty standards on it.
Lots of people like 180 degree symmetrical thick unibrows.
 
DSM
Fortunately I have a meeting I need to prepare for, and there's not enough time to accomplish anything else useful, so I can justify trying to find a few more characters somewhere.
 
I'm rather pleased at the aesthetics of the grayscale values corresponding to " " and "~", the highest and lowest non-escape-sequenced printable ascii characters.
It takes the edge off of the harshness of 0x00 and 0xFF
 
@Kevin I like how you can start to "see" the equalateral triangles in that.
 
DSM
Umpteenth itertools.collect question.
 
Anyone else having issues with the new question feed not displaying the "x new questions" dialogue?
 
DSM
4:11 PM
Am I the only one who just uses the main page?
 
How do you filter on tags then?
 
DSM
I use the "favourite tags" and "ignored tags" lists.
 
I pretty much always use stackoverflow.com/…
 
Huh. I do a search for [python] or [python-2.7] [python-3.x] or [delphi-5] or [delphi] or [delphi-7] or [sql-server] or [pycharm] and watch the newest tab.
 
DSM
My ignored tags list has dozens of entries. So my main page has interesting questions in yellow, ordinary questions unmarked, and no Java questions. :-)
 
4:18 PM
I thought for all the latest Python related questions, it was easier to just watch Martijn's answers :p
 
@DSM but then you occasionally miss out on the amusing off topic question tagged with 5 different languages
 
The two from last night were amusing. Some guy posted a want ad and then posted a eulogy for his cat.
 
poor pussy
 
Better luck in his eight remaining lives.
 
@Kevin what if that wasn't the first?
 
4:29 PM
better luck in his n-1 lives unless lives == 0 then RIP?
 
while cat.lives_remaining > 0: ...
 
with -1 meaning its a zombie
 
I suppose from a statistical standpoint, any random cat is more likely to be on its final life than its first.
Assuming that all cats learn from their deaths and become more careful in subsequent lives. Then the first life would be the shortest, and the last one the longest.
 
Benford's law would suggest that 1 is the most likely lives remaining, too (or that 1 is the most likely life to be on...)
 
OTOH there may be confounding factors. If a cat lives healthily to 18 on his first life, then dies due to an old person's disease, is he likely to live another 18 years before getting another one? Or is it more likely he'll get one a month from now?
 
4:35 PM
What if it dies because @JonClements caught it?
 
Does expending a life restore the cat to top physical condition? Are we using Time Lord rules here?
@jonrsharpe Good point. A persistent threat, such as a vicious dog or being trapped under a heavy object, may cause the cat to expend all of his remaining lives before escaping danger.
 
Maybe cats nine lives operate Harry August style.
 
Unless the regeneration energy can be weaponized, which there is precedent for.
 
That look he gives you while you shit... it's because he knows how you should have died.
 
If we use the Harry August model, it's unclear how the saying became popular to non-cats, since we can't observe the phenomenon.
Instead of "cats have nine lives" it would be "8/9ths of cats have a strange knack of anticipating major future events"
 
4:40 PM
I'm guessing it has been passed down since ancient Egypt. They kind of fetishized cats and death rituals.
 
I suppose a cat could communicate the fact to a human non-verbally.
 
Through disdain, most probably
 
cbg all
 
"What's that Mr Wiggles? Mets to win 2015 World Series?" "Miau miau miau"
 
Egyptian scribe apprentices may have transcribed such disdain as practice, giving ancient linguists plenty of material with which to derive a translation
 
4:53 PM
@jonrsharpe I think you're confusing "chasing" and "killing"
 
Then I have some heartfelt apologies to make
 
5:05 PM
You'd put a whole new spin on the ITV show "The Chase" :)
 
5:26 PM
♪ Seems he was never satisfied ♪
♪ Chasing girls like butterflies ♪
I have some code where it parses argv to get some filenames and eventually my code does this...

`with open(args.infname) as input_file, open(args.outname) as outputfile:`
I would like to modify my program so if I pass - as a filename, it reads on stdin/stdout. But is there a way for me to do that without tossing the with block?
I could do it without a with, but automatic resource management seems like the right way.
 
I think you'd have to write your own context class for that.
class FileOrStdin:
    def __enter__(self, filename):
        if filename == "-":
            self.file = sys.stdin
        else:
            self.file = open(filename)
        return self.file
    def __exit__(self, type, value, traceback):
        if self.file is not sys.stdin:
            self.file.close()
 
I'm really new to that stuff. Is with open('foo.txt'): the same as
 
Something like that. disclaimer: not tested etc etc
 
x = open('foo.txt')
with input_file as x:
 
I guess so.
 
5:41 PM
As far as I know, yes.
 
@Kevin just caught myself wanting to upvote (class FileOrStdin) and not finding the up-arrow...
 
class FileOrStdin:
    def __init__(self, filename):
        if filename == "-":
            self.file = sys.stdin
        else:
            self.file = open(filename)
    def __enter__(self):
        return self.file
    def __exit__(self, type, value, traceback):
        if self.file is not sys.stdin:
            self.file.close()
There, I think that's what it needs to be.
 
Thanks for pointing me in the right path. In this case I can get away with with sys.stdin as input because I don't use the pipes after they get closed.
 
Interesting, I didn't know stdin could be a context manager.
I guess it makes sense.
 
It works, but closes itself at the end of the block. I'm sure __enter__ returns self
 
5:47 PM
In that case you could do `with sys.stdin if filename == "-" else open(filename) as file:
Uh, assuming the precedence works out the way I assume it will
 
Yep
Interestingly, you can do this when __enter__ returns self.
with my_file:
  # Do stuff with my_file
  pass
# my_file closes
 
6:03 PM
what's the dupe target for "I didn't pass a tuple to db.execute, I just put one parameter in parens"?
 
I have seen many with s/db.execute/Threading's args parameter/
Haven't got any handy though.
 
Is it true that screen scarping sometimes referred to as terminal emulation ?
 
Cross-posting from reddit: a fun little programming puzzle.
I'm curious if there are more solutions than the one I came up with.
@direprobs Those are different things.
I wonder if there's a solution for two robots on a plane.
 
6:18 PM
Got the same answer. Infinite plane?
 
Yeah.
 
I strongly suspect you can transform the plane to a linear problem by mapping it like this...
 
@MartijnPieters edited your answer to make it generally applicable to "TemplateNotFound, didn't name it templates or put it in the right place" (actually, you already had the alternative in another answer).
 
But come to think of it, you can't write a finite program that will eventually reach any arbitrary point on the plane, if you only have the instructions from the 2d version plus "up" and "down".
 
there's probably a better way to explain "the templates directory should go next to the module as described by app.name", but that might be getting to techincal
 
6:21 PM
Er, it's hard to express the mapping, but you can generally map plane to lines arbitrarily. You just have to sculpt the path right.
 
It's easy to move in one direction forever, but you can't "spiral outwards forever" unless you have a counter.
 
Oh, true
 
So "no" for the original instruction set on a plane, "maybe" if you have a register of unbounded size and a "jump if equal to zero" instruction
 
@Kevin sorry for delay... I got that from this page: techopedia.com/definition/16597/screen-scraping
 
Maybe something like "spiral outwards, and every time you reach a new tile, return to your point of origin. When you find the other parachute, sit there forever"
 
6:27 PM
"Screen scraping is sometimes referred to as terminal emulation."
Correct me if I'm wrong, the term screen scraping has two meaning, one referring scraping a website, extracting its contents
 
I don't agree with the definition of "screen scraping" given on that page. It's too narrow. "Screen scraping is the process of collecting screen display data from one application..." agreed. "...and translating it so that another application can display it. " No, the application does not need to necessarily display anything.
 
Also according to that page: "For example, screen scraper software is available to take the output from a legacy application running on an IBM mainframe and use it as input for an application running on a PC. "
FWIW, I was doing this in 1983
 
Example: I wanted to cheat at a basketball videogame written in flash. I wrote a screen scraping application that would scan for the position of the ball and the net, and place the cursor at the exact point needed to get a score.
The application had precisely 0 display elements. All it did was move my cursor.
 
Except that most of our customers used ASCII terminals, not PCs. (At the start.)
 
You should be able to just turn 2d space into a linear path. It's pretty similar to the bijection proof between R and 2R
 
6:32 PM
@PatrickMaupin What's a "PC?" I'm submitting this via punch card.
 
So let me define it as I understood it from other sources, screen scraping also could mean an application that manages another application usually a legacy application.
 
Perhaps some screen scraping applications are terminal emulators, and some terminal emulators use screen scraping, but there are members of both sets that don't belong to the other set.
 
But yea, can't imagine a way make that path without some level of Turingness.
 
Definitions are malleable. We definitely didn't have a screen we were scraping from.
It was all RAM. Had around 540K of RAM on a Z80 for doing 8 terminals.
 
@direprobs That doesn't seem like a useful explanation. Sure, some screen scrapers manage other applications, but many don't. Some screen scrapers have GUIs with green buttons, but that doesn't help you identify what kind of applications are screen scrapers.
 
6:34 PM
And another meg or so of ROM.
 
Some dogs rescue people from mountains. If an animal does not rescue anybody from a mountain, does that mean it isn't a dog? If you are rescued from a mountain, does that mean the rescuer is a dog?
 
I was hoping for the Swedish Bikini Team.
 
@Kevin very logical
 
@PatrickMaupin that makes you the dog. :)
 
Mountains are tricky. You think you're in Switzerland and then all of a sudden you're in Italy.
 
6:36 PM
Oxford cbg
 
hahaha
 
You never should have befriended that door.
 
@RobertGrant cbg
 
@davidism: I just saw! Thanks. :-)
 
I would define a screen scraper as "a program that takes a picture of the screen". What it does with that information is immaterial.
 
6:37 PM
Or parses it
 
@PatrickMaupin so what's your definition for the so called screen scrapper ?
 
Probably using the fact that the screen was written in something that uses fixed width labels
 
Screen scrapper: a program that pipes the screen to /dev/null
 
Now there's an interesting tangent. Suppose a program doesn't "take a picture" of the screen. Instead, it uses the OS' API to iterate through all open windows, and extracts textual data from every native button and label element they contain. Is that screen scraping?
 
@MartijnPieters although I missed an older question that got a few more views: stackoverflow.com/q/10792755. I think I'll just leave it separate.
I like the question and answer on yours better, and there's a better dupe for "I changed the __name__ of my app".
 
6:39 PM
I don't know if it even needs the screen. Anything that reads information that isn't intended to be digested by a program should be a screen scraper.
 
@Kevin that's more like how screen scraping works for stuff like "modernising" "legacy" applications
 
I'd call that memory scraping.
 
If it reads from stdout...
 
Separate but related quotation mark-denoted cynicism
 
@direprobs Seriously, though, I think Kevin's definition is fine.
 
6:40 PM
Aside #2: arguing about semantics is fun, but determining the One True Definition of screen scraping isn't going to be useful unless you need to fill in a blank on a CS final exam.
 
Aside #J: what was aside #1?
 
I suppose you could view the terminal emulation I did over 3 decades ago as (a) constructing a virtual screen and then (b) scraping it. Most of the secret sauce was in the difference engine which continually refreshed the output screen based on knowing what it currently displayed vs. what it needed to display.
 
Whoops, I called the first one a "tangent"
 
Or if it comes up at trivia night.
 
@Kevin No it's not about an exam or HW
 
6:41 PM
Tangents are kind of like asides. Geometrically, they are aside the circle.
 
So let me wrap up the story and you correct me if you feel I'm wrong
 
There's a story?
 
I guess finding the definition of <thing> is useful outside of an academic context if you just want to make sure you're understood by your peers when you use <thing> in a sentence.
 
@Kevin Oh, you mean like item<thing>whatchamacallit ???
 
Otherwise you'll end up in pointless arguments, for example whether Python has "strong typing" or not. Surprise, there is no universally agreed upon definition of "strong"!
 
6:44 PM
Python's typing lifts heavy weights off of my shoulder. Therefore it is strong.
 
(Personally, I just go by whatever is in the "typing discipline" box on Wikipedia's Python page)
 
>>> item = 0
>>> thing = 1
>>> whatchamacallit = item
>>> item<thing>whatchamacallit
True
 
A screen scrapper could refer to an application that works as a layer of another application.
 
@direprobs I already told you -- a screen scrapper is a program that pipes the screen to /dev/null
 
A screen scrapper sounds like something that destroys your monitor.
Or at least fights it.
 
6:46 PM
Language tip: a "scraper" is a thing that scrapes. A "scrapper" is a thing that scraps.
 
@MorganThrapp hahahah
like that
 
Man this codeine is working great.
 
DSM
@Kevin: nice.
 
I'm still coughing but it doesn't hurt so much.
 
forget about that, it sucks indeed to define the term itself as it makes no sense
 
6:49 PM
In the UK you may encounter screen scarpers, although it's not clear to me what those would look like.
 
DSM
In London you're always on CCTV. I could see wanting to run away quickly.
 
One who wants to flee a CCTV is a "screen scarperer". The thing he does in the presence of a CCTV is a "screen scarper"
 
@Kevin they're probably kind of people that capture a disease called scrapo-philia, it's a symptom where an individual can't stop scrapping until s/he is sent to dev/null
 
7:06 PM
I'm bad at math, so I need a sanity check
 
I thought a "scrapo-philiac" was a type of hoarder.
 
nevermind, rubberducked it
 
DSM
Many mathematicians are crazy, so being bad at math is on balance a good sign, sanity-wise.
 
doing a codewars kata that returns the number of integer partitions for a positive integer n
 
I'd much rather be around a scrapophiliac than a scrapiephiliac.
 
7:08 PM
e.g. foo(4) -> 5 because there are 5 ways to write the number 4 as a sum of whole numbers (including by itself)
 
@AdamSmith That's a difficult problem.
 
1+1+1+1, 2+1+1, 2+2, 3+1, 4
I thought it would be easy-ish to do recursively, but since 2+1+1 is considered the same sum as 1+1+2, it's not as easy as I previously hoped
 
I spent a reasonably insane amount of time trying to figure that out in relation to a PE problem.
 
(otherwise foo(n) = foo(n-1) + n)
 
Small hint: hover for spoilers
 
7:12 PM
@AdamSmith care to share which one? :)
 
sheesh that's a small hint indeed :P
 
DSM
You're on the right track, recursion is a fine way to do this. :-)
 
excellent. Starred for tonight :)
 
DSM
> So I have missed the past week of my programming course unfortunately. And I have an assignment due where I need to make a wheel of fortune game, and I know nothing about Wheel of Fortune. So I was wondering if anyone knew how or where to find help with this.
 
7:13 PM
wikipedia -- wheel of fortune
now you know about wheel of fortune. Go write a program
:D
 
That actually sounds quite hard, if you're implementing every single element of the show.
 
"Just do hangman and take the C"
 
Free spins and bankruptcies and collecting cardboard letters for the bonus round and small talk with Pat Sajak...
 
It sounds like he needs to implement Wheel of Fortune for teacher-defined values of Wheel of Fortune.
 
If it's just "hangman with limited ability to guess vowels", that's easier.
 
7:15 PM
I should still be able to do foo(n) = foo(n-1) + 1 + k if I can get k, which would be every combination that doesn't have a 1 in it. Maybe just generate those with itertools.combinations?
 
Think he could pass off the Atari version?
 
and does that still work for large n?
bleh whiteboard time
 
I'm not convinced that would work for larger numbers. Ex. with foo(6), 2+4 and 4+2 are repetitions of one another, but neither contains 1.
 
right -- generate those with len(set(map(sorted, itertools.combinations then
:P
because the rest of the partitions should be the partitions of n-1 with an extra 1 added on
the only "new" ones would be n and any combination that doesn't have a 1
I feel like it's a halfway solution, because nothing is making 1 special. What I really need is some way to find all the overlapping sets in foo(n) and foo(m)
foo(n) -> (j, *foo(n-j)) for j in range(1, n+1), but that creates a ton of duplicates.
 
@AdamSmith I can't see the kata (would have to sign up), but FWIW, that's A000041
 
7:24 PM
half-joking approach: find the first couple values of foo manually, then plug them in to the OEIS to find the fastest formula
 
DSM
That's why the OEIS exists. #eic
 
@Kevin How do you think I found the A number?
Where's the joke?
 
Whoops, I composed that message before you posted yours
It was sitting in my text area for a while while I tried to see if it would actually give a useful result.
 
Ah. I haven't read closely enough to figure out if it's useful. Just thought that we've killed enough words about nomenclature recently that it would be handy to have a common starting point.
 
Well I define "useful" in this context rather loosely as "has an entry in the OEIS at all", so mission accomplished
 
7:30 PM
Hey up all
 
DSM
Cabbage for Fizzy.
 
Fizzy how are the projects coming along?
 
I have a library which annoyingly prints to sys.stderr when it encounters an exception I expect and handle. Any way to nip that in the bud?
 
import sys; sys.stderr = MyStream?
 
@Programmer sorry?
 
7:34 PM
jazzhands, you fool!
 
He beat me to it
 
we're all waiting
 
Oh I see. Unfortunately I've been busy the past two weekends.
I have many projects, so when asking random questions out of the blue, please be specific.
 
DSM
Since most kinds of busy are better than being busy in front of a computer, that's not necessarily a bad thing.
 
@Kevin Pollyanna that I am, I assumed there would be an entry in the OEIS for this particular sequence, so I read more than that into "useful."
 
7:38 PM
Got it! I think
I've gotta test
bah maybe not
 
9
A: The rudeness on Stack Overflow is too damn high

Martin JamesThe excessive rudeness has been discussed numerous times before, but there seems to be no answer to it. No matter how many times downvotes are applied, questions closed and comments supplied, more and more rude and insulting questions are posted. Questions with no error messages. Questions wit...

This answer is gold
 
It's a lot like how owners will come to resemble their pets.
@PatrickMaupin I suppose the most useful it could possibly be is if the page had a closed-form solution that runs in O(1) time. I don't think it does, though.
 
Agreed, it doesn't seem to.
Which, of course, is what makes the problem more interesting.
 
I see a lot of ellipses and sigmas. That just screams "O(N) or worse"
 
I haven't given it much consideration, but on first blush I think it's probably much worse.
 
7:52 PM
so if f(n) = f(n-1) + k where k is any unique solution with no 1 operand
hmm
 
The implementation I wrote is O(N^2)-ish, which isn't terrible for Ns below 1000 or so.
 
I'm stuck on this approach I'm envisioning. I wanna figure it out so bad lol
 
As I said, I haven't really thought about it that much, but it seems unlikely there would be a solution under O(n log(n)).
 
I think I'm near the optimal minimum for iterating through all ordered partitions, but there may be something better for just getting the total number of ordered partitions.
 
@Kevin don't think there's a better solution that that, move one direction, when parachute found run the same drection
 
7:57 PM
I suppose not. But I'd be interested in seeing worse solutions, too. (for the robot parachute problem, not the partitioning problem)
 
anyone know a good way to find the revision history of a file?
 
Is the file in source control?
 

« first day (1838 days earlier)      last day (3125 days later) »