« first day (1592 days earlier)      last day (3246 days later) » 

2:00 PM
@Rainbolt you could install a browser extension such as Imagus to show images when hovering over. It comes in use in other places too :)
 
Well, I'm using Collections.sort so it's not my mergesort, it's the library's ._.
 
Oh, I see
 
What comes out of it? Is the "sorted" list in the exact same order as the original?
"Doesn't sort" could mean a few things.
 
@Geobits GOOD IDEA
 
2:14 PM
Oh, so return thisLong - thatLong doesn't work with longs
Because compareTo returns an int and you might accidentally wrap around when you try to convert
@Compass Ok, so I just implemented the logic from your friend and found that my list of objects did not sort at all.
[-2984990665945965758, 8007777253927337067, 6017403796917550899, -8319492675305266938, -1974614842160663373, -7475941312107594453, 6984756601187698770, -6409319350170508176, 2394843995449090561, -3011597354772439812]
[-2984990665945965758, 8007777253927337067, 6017403796917550899, -8319492675305266938, -1974614842160663373, -7475941312107594453, 6984756601187698770, -6409319350170508176, 2394843995449090561, -3011597354772439812]
BUILD SUCCESSFUL (total time: 0 seconds)
Then, I modified the compareTo() to return -1 when it is supposed to, and it sorted correctly
 
@Rainbolt Does the non-working version still work when all the items are longs which would fit in an int?
 
    public int compareTo(Foo f) {
        if (l > f.l)
            return 1;
//        if (l < f.l)
//            return -1;
        return 0;
    }
That's the non working version
And I don't know what "Does the non working version still work" even means
 
I think it matters more if the result of a-b would fit into an int. Even if both a and b do.
 
I'm not using a - b. I'm using the logic that Compass described earlier
 
I know, I thought he was asking about your earlier message where you were talking about overflow.
 
2:25 PM
@Rainbolt My wording is appalling. I meant does it consistently not work, or are there cases for which it still works
 
If there are, my rng isn't doing a good job at finding one.
    class Foo implements Comparable<Foo> {
        public static Random rng = new Random();
        long l;
        public Foo() { l = rng.nextLong(); }
        ...
    }
 
I'm guessing that since the default sort order is usually ascending, the < comparison is used more often than the > internally, so it not working without a reliable one makes sense.
The only question is why would it not work now when it (apparently) worked for years.
 
I think Compass has two problems. First he needs to fix his comparator. And then he needs to figure out why each machine behaves differently.
 
Agreed for sure. No excuse to let that comparator stay there unless there's a damn good reason to.
 
Some things you just fix because that's how itshould be
(My supervisor on the other hand might disagree with me)
 
2:30 PM
@Rainbolt It because he thinks it is a wait of time, as it is actually working. Supervisor are actutally more (often) obsessed with short term results than reducing maintenance time cost
 
We had an item in our css that made all iframes look a certain way. Then we started using a reporting tool that made heavy use of iframes, and so I modified the css to only apply to a specific class. He asked me "Did you break any iframes?" and I could only say "I dunno, but if I did then they need to be broken so I can find them and give them a proper class."
 
An actually, a lot of IT dev are doing things thiw way...
 
It's not just IT, it's been happening for a long time in a lot of areas.
 
(saw in a PL/1 source 4-level nested conditions that were copy paste many times because they didn't want to had the statement in the existing condition block)
 
@Rainbolt thanks i think it's a Java issue that recently came out, so I'm going to verify java versions through regression and then document it as such
er the sort breaking is a result* of a Java change
problem on my end, not java's XD
 
2:32 PM
@Geobits I prefer speaking of IT only, because that's what I know :)
 
@Compass Glad you found it. And also glad the problem isn't within Java's sort function because that would be scary.
 
I would never assume sort is broken
especially when its my comparator
if its java's comparator, then #ffffffff
 
@Katenkyo My previous job (military avionics) was much better about thinking long-term, but they've learned they have to be if they want to keep flying the same planes for 50+ years.
 
be afraid, be very afraid: envisage-project.eu/…
 
If you told me the F-14 was built in the 1970s I would be like NOWAAAY
the difference 30 years can make for aircraft @.@
 
2:34 PM
My boss makes me explain the long term benefits to him. It's not that he can't see it so much as he trusts his developers to know what they are talking about
He's a really harsh person when you ask him to do a code review
 
@Geobits Haha, it should have been nice to work there !
 
It was, except all the planes were so damn old :D
 
Planes built before MS-DOS x_x
 
Wow I made Telerik spit out a stack trace :(
 
its okay, this navy ship uses floppy disks for firmware upgrades!
 
2:36 PM
Mostly 60s-70s models. Have you ever worked on 40+ year old wiring harnesses? It's crazy.
 
It actually posted the entire stack trace inside of a report viewer and totally bypassed our custom error page
I'm just about fed up with this HTML5 buzz word (especially since HTML6 is close) and the stupid reporting tools that look so great on their website but look like shit on ours.
Our CEO sees these awesome demos and thinks we can make websites that looks exactly like the demo.
 
Just Web 3.0 that shit.
 
While also adhering to requirements that stretch the boundaries of what these tools can even do
Ok /rant off. This is what we get paid for I guess.
 
I personnaly prefer a sober site to a funky animated one.
 
wait what
HTML6?!
I AM NOT READY
 
2:40 PM
@Katenkyo Tell that to SE :(
 
Funny thing about HTML specs (and also new releases of JavaScript) is that nobody uses them if no browser supports it, and no browser supports it if nobody uses it. So how do these things catch on? I don't know.
 
Nerd-fueled rage at the browsers until they relent?
 
=.=
 
I guess an open source browser implements it because someone decides to, and then the other browsers have to catch up
 
hi all
 
2:44 PM
I met a guy at a conference last week (that's why I was missing all week) who was fanatical about JavaScript. And the more he talked about it, the more I couldn't understand why anyone would want to use it.
 
@Geobits Sticky following votes aren't so annoying I think, but I wouldn't like it to go further than votes
 
@Lembik Hi
 
manged to get +1 for my question :)
I am so proud
 
javascript is a nice language for when you want to code and don't feel like compiling or actually playing nice with reality
 
I learned that JavaScript has === operator because == does things that nobody would expect
 
2:45 PM
I have a feeling I won't like it, based on the discussion there. Unfortunately, I'm not in the activated group, so I don't know for sure.
 
@Geobits me neither, but i'd like to see it
 
=== != ==
 
I like being able to see buttons from the bottom of a post, and not having to scroll back up. It's only the jarring animation that's a (small) problem
 
He presented a list of five comparisons and asked us to write down what each would evaluate to. Not a single person in the room got them all right (and admitted it), and there were maybe 200 of us there.
 
@Rainbolt === compare by type and == compare by value, right?
(I hate web dev :))
 
2:47 PM
=== is "compare by value without help" and == is "compare by value with help"
 
@Rainbolt Is it the other way round?
 
@Rainbolt and what is "help" if I dare ask...?
 
@trichoplax I like having the visual indicator/separator between posts when scrolling through a bunch of them. I think with them moving it'll be harder to scan/skim.
 
'' == '0'           // false
0 == ''             // true
0 == '0'            // true

false == undefined  // false
false == null       // false
null == undefined   // true
 
yes, the one thing that is creepy about javascript is how == is not friendly
 
2:47 PM
That's what I mean
 
That's not very helpful help.
 
@Geobits Maybe they should introduce a bolder separator if they keep the moving buttons
 
but a lot of other things for javascript are kinda nice for when you want to just do something simple without all the boilerplate that... say Java asks you to add
 
That might help. I wish I was part of the testing group so I could give a more informed opinion. Right now it's like someone telling me they're going to move my cheese but not doing it.
 
CxF5
 
2:49 PM
Yea who needs boilerplate to establish scope. Just don't ever use var outside of a function and you'll be fine.
 
does it really have === ??
where/how can I look this up?
 
yes javascript has ===
 
Actually, the only part of web dev I liked, was doing a struts WAS designed project, with the middle tiers in java
 
its not a joke
 
@Lembik Some people recommend using it exclusively, and never relying on ==.
 
2:49 PM
682
Q: Difference between == and === in JavaScript

Shiva Possible Duplicate: Javascript === vs == : Does it matter which “equal” operator I use? What is the difference between == and === in JavaScript? I have also seen != and !== operators. Are there more such operators?

 
w3 schools has actually improved its javascript page
 
wow!
 
amazing
 
@Rainbolt I see you're right now. It took me several minutes to work out that I was wrong, and now it's too late to edit my post...
 
Incoming soon : ==== and !===
 
2:51 PM
==== should obviously check to ensure value, type, and pointer are all equal ;)
 
@Geobits sounds amazing !
 
I suppose ===== should also check variable name and scope. So a thing is only ever ===== itself in the most literal way.
 
imgur under heavy load :(
 
where ==== would check duplicates
 
Right
And ====== is just never true.
 
2:54 PM
@Geobits no, it would check the thread it runs in :)
 
Well since imgur won't let me upload, I just have to tell my story :(
 
Or the thread who created it
 
Oh, I thought that counted in scope for =====.
 
Equals Can Mean Anything Script
 
I typed in "quadruple equals" and Google suggested that I was searching for "javascript quadruple equals"
 
2:55 PM
Oo
 
Oh, there we go:
 
Ho, and don't forget the closure !
 
@Geobits it's not sorting at all XD I just need to figure out why java wasn't sorting it
 
time to hand-write merge sort
 
2:58 PM
if I define something like f = function(){var a=0;function(){return a++}}
 
@Compass So that's why they make you do it in interview
 
@trichoplax actually all my interviews when i explain a sort method
they look at me and say "You could have also said Collections.sort"
 
lol
 
And I just sit there and go =.= what a cop-out answer
 
nevermind, it is covered by the pointer thing
 
2:59 PM
@Compass It's not a cop out answer IMO. Sometimes you want to make sure someone won't go to the trouble of handwriting a sort if they don't need to ;)
 
I tend to start with "Do you want the Collections.sort answer or do you want to see me write it myself?"
 
@trichoplax it would be a little bit like chicken
 
Never had an interviewer get mad for asking
 
@Katenkyo needs http:// to make the link work
 
@Geobits all my interviews were extremely technical
 
3:00 PM
I've had two people ask me to do a sort in person, and one via email. On the email one I just wrote two versions and submitted both
 
@trichoplax thanks :)
 
@Katenkyo no problem :)
 
@Compass An even better reason to make sure you find someone who knows not only how to be technical, but also how to just get it done.
 
@Katenkyo That's terrifying
 
almost done with my submission
 
3:02 PM
@trichoplax It's something !
 
It's not terrifying if you read the whitepaper instead of just the esolangs summary: isotropic.org/papers/chicken.pdf
6
 
@Geobits I'm sure my interview woudl have sucked if I had just said "It's on StackOverflow!"
 
@MartinBüttner I'm thinking of a class of marbelous devices where the value of the marble affects what the device does, rather than being useful as a variable coming out of the device, so the output would mostly just be marble-vs-nomarble
 
@Geobits Are you trying to kill me???
 
a "teleport X squares upwards" device would implement arbitrary delays of 0-255 ticks
 
3:04 PM
Marbelous?
 
@trichoplax check this one, much more readable because it is in chinese !
 
Is that a real word?
 
"Would you like the Collections.sort answer or shall I go ahead and implement it in chicken?"
 
@Compass Should be Marvelous for a real word :)
 
3:05 PM
@Compass some folks here designed an esoteric language based on marbles in a rube goldberg machine
 
That is so sway o.O
 
Oh my. Another word I don't know
That's two in two days
Yesterday I learned thirsty
 
My roommate brings home all sorts of words since he teaches high school. It makes me feel old
 
@Rainbolt I found the issue
Java 7 decided to redesign sort
 
3:08 PM
Well, time for me to leave you there, hafta go. See you tomorrow guys !
 
Bye :)
 
there is a legacy sort
but you have to request it
else it uses comparabletimsort
Thanks, Java 7!
 
@Compass Is someone at your work place making you go through the painstaking process of solving this mystery? Or are you just going at it for fun? Congrats on solving it either way.
 
Yes.
We need to know why it happens.
So we can release it into PROD
we can't replicate it in QC so we can't ask for a patch fix because we can't guarantee it's a fix
 
Oh, tell your boss you want a test environment that is identical in every fashion to actual production.
 
3:11 PM
we have one
 
Explain how it will save him money down the road because bugs like this won't make it into production
 
i cant replicate it on that either
 
how can i make this with less brackets
0
A: Visual Long Multiplication

Agawa001C (330 b) int main(char*a){int i,j,r,k,c,h,o,e=15,m=99,A=0,B=0,*C,L[m][m],G[m],*g=G;for(C=&A;(c=*a-48)+48;C=!(c+6)?&B:&(*C+=(*g++=c+1)),a++);for(i=B-1,j=0;j<(r=A+B);i--,j++)for(k=0,o=4*!!((*(g-=!*g))---1);k<*(C=(h=i<0)?&B:&A);k++)L[abs(i)+k][j+k-2*k*h]+=o/(3*h+1)*e;for(i=0;i<r*r;i++)printf("\n%c...

 
we "have" I should say
 
Does it have the wrong version of Java on it?
We just had the same problem actually. We released a version of our product not knowing that it was dependent on .NET 4.5. Our documentation lists .NET 4 as a prerequisite.
 
3:13 PM
I don't know what versions of Java are running on our environment servers. I put in a request to get them.
 
@VisualMelon this is my attempt to get more insight into the probability of different trees in my challenge: math.stackexchange.com/questions/1316839/…
there's a great answer there that might actually be valid
combining that probability with the mutation improbability graph will probably produce a perfect answer to my challenge.
 
my thinking is it's just the product of the probabilites of each edge, divided by (n-1)!, times the number of ways to make said tree, which I have a formula for
(can ignore the (n-1)!, same for everything, and can use a spanning tree to get a good upper bound for a brutal search, is my best (working) idea so far)
(I say working, I don't know if it works, but it's the only thing I have any confidence in)
 
@Rainbolt yup, I'm compiling in 6, servers compiling in 7. Gah.
Luckily I can fix it pretty easily. Normally would have gone under the radar with using a new optimized sort, but with this lazy sort, things borked.
 
3:46 PM
So to recap for anyone who cared: JRE6 used Merge Sort. This only needs a comparator to return 0 for <=, and 1 for >
JRE7 uses Timsort, which is a combined merge/insertion sort that creates sorted buckets, from what I've read. That needs -1 for < and a poorly created comparator will break it. QED time to go to lunch :D
 
4:05 PM
@trichoplax I'd prefer Chicken one
@Compass umm. are you saying timsort is not that great ?
 
I heard timsort is that great
Unless you think a petrol engine is not that great because it will break if you put coal in it ;)
 
@trichoplax I must admit, I did not understand his line at all :D
 
@Optimizer It makes more sense in the context of the problem solving that happened in the previous chat
 
(at the first go)
 
I read it as "if a comparator was designed to meet the bare minimum necessary for the old method, then it won't work with the new method, which has stricter requirements". Not really anything "bad" about either method.
 
4:09 PM
How are we supposed to argue with you being sensible??
 
You're not. Optimizer will by default, but llamas are stubborn like that :P
 
We're not really arguing (apart from Optimizer, who always is for fun)
 
You don't mess with a llama!
 
Not twice!
 
Out of curiosity, were you born a llama, or were you Kuzco'd into it?
 
4:11 PM
@Optimizer I don't really know chicken. I just said something at random while reeling from Geobits' link at the top of the starboard
@Geobits I'm not sure where to put the apostrophe to indicate your possession of something. Geobits'? Geobit's? Geobits's?
 
@trichoplax same here ("just said something")
 
@Geobits a secret untold
a mystery unfold
still the secret remains
 
@trichoplax EL&U might have a different opinion, but I don't care at all about which is used. I'm fairly sure Geobits's is "right", though I normally just use Geobits'.
 
I'll stick with the shorter version then
 
4:15 PM
I'm gonna go with the Kuzco version then.
 
4:43 PM
0
Q: Copy array with no variables or extra memory usage

NumberFourIm curious to see some other ways to make a copy of a fixed array, which potentially use no extra variable or memory and has as small code as possible. Here's my attempt in C: #define ARRAY_COPY(x,y,n) for(*(x)=n;*(x);(*(x))--) (x)[*(x)]=(y)[*(x)]; \ *(x)=*(y); The l...

 
5:14 PM
@Rainbolt comment ninja
 
We might want to think a little harder before we blindly send people to SO and CR
 
@AlexA. ^
 
Now I will plug my answer that nobody liked, which would clearly have helped us avoid this issue: meta.codegolf.stackexchange.com/a/5041/18487
 
@Sparr i was surfing thru ur proposed SE section , i discovered out very very wierd orientations
 
I wonder if anyone has empirical evidence that most of our off topic questions actually belong on Stack Overflow.
 
5:20 PM
u said ur program shouldnt print empty chars
 
@Agawa001 empty characters?
 
I'm passing stdin through a Thread and Queue in python to get non-blocking input, and I can't figure out how to detect EOF.
 
u said ur program shouldnt print empty chars
 
woo! first commits to marbelous in 10 months. github.com/marbelous-lang/marbelous.py/commits/master
 
@Agawa001 do you mean spaces?
 
5:22 PM
@MartinBüttner ^^ not related to turing completeness, I'm just bringing the repo up to date with stuff I never committed. But I still do want to get us at least up closer to TC-ness
 
@Sparr as I said to Nathan, recursion might actually make it TC
because that does allow you an infinite amount of storage
although it might be more like PDA, since recursion only gives you a single stack
 
yes , spaces after end of diagram
 
That's a fairly standard rule that basically means "I want the answer and just the answer".
 
spaces after the end are fine (provided they don't go beyond the bounding box). but your submission had spaces within the diagram.
 
why is that forbidden
 
5:25 PM
It doesn't meet the expected output?
 
uhh... I don't know. because it doesn't look as nice? because that's how I set the challenge?
yeah, what Geobits said
 
If I said "output 'Hello world'", I wouldn't expect 'H e l l o w o r l d'.
 
i cant understand this quite enough
You may print trailing whitespace but it must not exceed the diagram's bounding box.
is my submission violating this rule ?
 
I'm not even sure why you are printing those intermediate spaces. it actually costs you a character to add those spaces in. just remove the space from the format string.
@Agawa001 you actually are. there are three columns of trailing spaces that shouldn't be there.
 
oh , i must narrow the nethermost loop
to tighter bounds then
 
5:30 PM
(and remove that space from the format string)
 
can u propose any other fitting ascii character instead of space?
 
I don't understand
just remove it
"\n%c " --> "\n%c"
 
i think u miss how does C works like , C terminal cant just move cursor there and type another \ or / or x , there must be a permeating character between
 
?
 
oh wait
that space
urrr
and costs me excessive byte :D
fixed
the inversed sight is rooted problem thu , cant be fixed in a minute
 
5:39 PM
@MartinBüttner I had completely forgotten about recursion's storage capabilities...
 
@Agawa001 you're still printing one space past the bounding box. can you somehow just reduces the range of the horizontal loop by 1?
 
@Optimizer no i think timsort is great! It just broke my app!
 
@MartinBüttner that should cost me two bytes
i know there should be some brackets to get ride of somewhere
im certainly sure
 
alright, so what about the reverse order of digits
 
thats another issue (would take much time)
 
5:52 PM
@AlexA. (Speaking for myself, not for the company.) I don't believe that the site icon will ever be PPCG. 1. it's way too long, and 2. nobody in the company calls the site PPCG.
 
i ll deal with it tomorrow
 
@Agawa001 could you just traverse the input string in reverse?
 
@MartinBüttner string crossing is done twice , once from right to left , then way round
so i think its nt something to handle in a hour
 
@AlexA. This proposal has the most promise, though: meta.codegolf.stackexchange.com/q/788/3
 
and im tired for now , i leave it tomorrow
thx thu
 
5:55 PM
@MartinBüttner #programming on freenode seems to think recursion makes us TC, even with the tight bounds on storage and code in our language
 
@Sparr Of course. Recursive algorithms can be CPS-transformed. ;-)
 
6:10 PM
Are you creating a language?
 
@C0deH4cker Marbelous has already been created :)
 
0
A: Sandbox for Proposed Challenges

Vi.Captcha cops-and-robbers Cops develop a captcha algorithm in minimum bytes. Robbers tries to implement a recognizer that recognizes 90 of 100 generated captchas.

 
Ah, looks fun!
 
People have already posted a few answers in Marbelous on PPCG
 
Does it require spaces between the bigrams, or is that just for clarity?
 
6:21 PM
just for clarity
intepreter allows 0,1,2 spaces
 
is marbelous designed to be human-readable?
 
@Compass to an extent.
 
>_>
 
because we have a limit on the size of keywords
its really tough
but we tried to pick smart keywords
and we added comments
 
6:35 PM
I feel like ReSharper should be able to pick up on this:
    var s = "";
    for (var i = 0; i < 10; i++)
    {
        s += ".";
    }
    Console.WriteLine(s);
I just wrote that to test if it would detect string concatenation in a loop and suggest that I use Stringbuilder instead
 
6:46 PM
@Compass with whitespace between columns, small marbelous programs should be easy for a human to interpret in their head.
well, easy for humans who can do that with some other language already :)
 
Does anyone know what sort of number system this is, that Randall uses for page numbers in xkcd volume 0?
1
2
10
11
12
20
100
101
102
110
111
112
120
200
1000
1001
...
It's like ternary, but he skips straight from 2(0)^n to 1(0)^(n+1)
(might make a nice challenge)
I guess I should check oeis
 
7:04 PM
he also skips 121 and 122?
 
well that's what I mean
he skips from 20 to 100
so he also kips from 120 to 200
 
ahh
 
i assume it's related to after 111, a 2 clears all rows o_o
er all columns
so it'd go 1111, 1112, 1120, 1200, 2000, 10000
 
indeed
sandboxed it
 
lies! the bot would obviously have let us know by now if you had. :p
 
7:21 PM
0
A: Sandbox for Proposed Challenges

Martin Büttnerxkcd-Style Page Numbering code-golfnumbersequencebase-conversion Randall Munroe's book "xkcd, volume 0" uses a rather odd number system for the page numbers. The first few page numbers are 1, 2, 10, 11, 12, 20, 100, 101, 102, 110, 111, 112, 120, 200, 1000, 1001, ... This looks a bit like ter...

 
@Sparr there you go
 
7:41 PM
@Martin Reference solution? forums.xkcd.com/viewtopic.php?f=11&t=46142
 
@Geobits I'm wondering if I should require fast processing of sufficiently large input to avoid just counting up ternary naively.
(I've got a reference implementation like that in CJam)
 
K, was just curious if you had something handy, it was just the first result for searching "xkcd volume 0 page numbers".
I'm not sure how feasible it is to calculate without counting up, honestly, but I haven't looked at it much.
 
7:58 PM
my idea would be to just count in ternary and filter out strings that match /2.*1/
/2.*[12]/ that is
 
Is there a way to convert it to a linear recurrence relation? (like the Fibonacci sequence)
 
i think so ._.
 
In that case it has a closed form, although that might not help in golfing since the coefficients may require a lot of digits...
 
sure. f(x) is f(x-1) incremented until it doesn't contain 2.*[12]
 
8:13 PM
I'm not sure that's linear recurrence...
It looks like the number of terms in the recurrence would keep increasing so there wouldn't be a fixed way to write it
 
ahh
 
I was so amazed when I first heard about the closed form formula for the Fibonacci numbers and remembering that made me want to find a similar approach here but I'm pretty sure it can't work like that
def fib(n):
    return ((((5**0.5)+1)/2)**n - (-(((5**0.5)+1)/2))**(-n)) / 5**0.5
 
8:30 PM
Needs more parens :P
 
Some are redundant but I left them in for symmetry...
 
that form parallels the fact that fibonacci numbers follow the golden ratio.
 
yes I just replaced phi with the root 5 formula rather than define it separately
(phi**n - (-phi)**(-n)) / 5**0.5
It looks much nicer on wikipedia
 
@Lembik your probability problem is solvable with dp
 
Any problem is solvable with Dr. Pepper
 
8:36 PM
idk how interested i am in optimising it though
i mean, python is not the ideal language since your scoring method is based purely on speed
maybe a golfing score is better?
but with the requirement that it has to have a similar speed to what i posted
 
there are too many ascii art challenges lately :(
something like 1/4 of new challenges are ascii-art
 
Does that mean we have too many AA challenges or too few other challenges?
I have a non-AA challenge in the sandbox that I can't decide whether to time limit or not. Other than that it's ready to post (I think)
4
A: Sandbox for Proposed Challenges

trichoplaxWorst Case Manhattan Exclusion code-golf geometry grid packing Imagine a W by H grid of squares that wraps toroidally. Items are placed onto the grid as follows. The first item can be placed on any square, but subsequent items must not be within a Manhattan distance R of any previous item (als...

 
I think I figured out the formula for the xkcd page thing
A bit bloated
 
8:51 PM
And I had gone and convinced myself it was impossible...
 
function f(n) {
o = 0;
for(i = 0; i < n; i++) {
s = o.toString(3);
k = s.length;
b = 0;
for(j = 0; j < k; j++) {
if(s[j]==2)
o = o + Math.pow(3,k-j-1),b=1;
}
if(!b) o++;
}
return o.toString(3);
}
ew
well it's javascript
its not pretty
 
if it was pretty it wouldn't be golfed enough...
 
basically, it's a lot of base conversion, and if any digit is 2
it propagates upwards
 
We have a fire drill coming up any minute now and it's pouring down rain :(
 
@MitchSchwartz Well... that's very impressive!
 
8:54 PM
thank you :)
 
Could you post an unoptimized python solution with an explanation?
 
And to make things worse, the CEO's wife and some other guy are exempt from the fire drill. So if there's actually a fire, they'll have no idea.
 
@MitchSchwartz I think it's awesome enough to deserve a special bounty :)
 
@Compass Sounds like it should work. Now you just need to test it and golf it...
 
also I could run it in pypy... which might help
 
8:55 PM
the test works
for(i = 0; i < 30; i++) {
console.log(f(i)-0);
}
easy enough :P
 
actually that solution is the way i originally wrote it, i didn't change it at all
 
@MitchSchwartz I will be very interesting to read your explanation too
 
Cause of death: Exempt from fire drill
 
I have to ask.. do you have a phd in CS/Math?
 
well i feel there is not much to explain, you just need to know what (a,b,s,t) stand for
 
8:57 PM
@Compass just golfing then - nice work
 
@MitchSchwartz How did you come to realise it could be solved by dp?
I am also looking forward to running your code :)
 
Any last minute feedback on Manhattan Exclusion before I post?
 
well intuition. it felt like you could re-use results
 
your python is a little too smart for me to understand quickly.. do you know the time complexity?
 

« first day (1592 days earlier)      last day (3246 days later) »