« first day (2836 days earlier)      last day (2304 days later) » 

Anonymous
01:03
@Downgoat This is going to sound ridiculous, but I am trying to print out a file containing a formatted large database backup.
02:27
Is there a reason the Sandbox is missing from the side bar?
It gets removed every so often
mods need to put it back
02:47
SE isn't supposed to have perma-featured meta posts. The Community user automatically unfeatures posts after a month.
Anonymous
Also the sidebar doesn't update very quickly - there have been instances where meta posts have been unfeatured, but still showed in the sidebar for nearly a month
03:21
@Mego did you end up finding one?
Anonymous
@ASCII-only Not yet
:/ seems harder than it sounds to find anything that doesn't load the entire file in
wonder if the official adobe software would support that
Anonymous
Writing my own PDF converter might be simpler
Anonymous
@flawr Out of curiosity, have you written a Haskell solution for Dirichlet convolution? If so, what's your byte count?
@Mego that... doesn't sound simple at all :P
hmm. this might help?
Anonymous
03:34
@ASCII-only wkhtmltopdf was the first thing I tried. It reads the entire HTML file into memory.
:/
well. i guess it kinda makes sense
sometimes the stylesheet comes after the HTML, so your only choice really might be to make your own
alternatively, convert the backup into some format other than HTML instead, and then convert that to PDF :P
Anonymous
@ASCII-only That's an acceptable solution for me, if you have an idea of how to do it without memory issues
I guess there isn't any streaming HTML to PDF converter just because CSS is a pain. But, what you may be able to do is split the HTML into small chunks, and try to somehow figure out which elements were and were not printed on the first page
@Mego What format is the raw backup in? (or at least, what database engine is it using)
Anonymous
@ASCII-only In this case, it's pure HTML, no CSS. It's just <html><head><title>something</title></head><body><pre>13 GB of SQL statements</pre></body></html>
Anonymous
@ASCII-only MySQL, output by mysqldump
03:43
oh, so just a text file basically?
Anonymous
Yep
i mean
it seems like you can just dump that straight in a PDF
Anonymous
I stuck some HTML around it for basic formatting and to try to use wkhtmltopdf before I realized the memory issue
after adding proper PDF headers/footers and escaping properly
brb lunchtime for me
Anonymous
Confession time: I have no idea how PDFs work
03:45
well i barely have any idea too :P
btw. why pdf to view a text file anyway?
Anonymous
To print it, naturally
Anonymous
I guess some background on this stupid prank might be helpful :P
Anonymous
Earlier this month, one of my coworkers accidentally dropped a production database. As a prank, the rest of the devs are going to pool money together to ship him a box containing the printed out backup of that db from that day (the one that we used to restore the db), on the anniversary of the dropping.
Anonymous
We've found a service that will print and ship the backup, but it needs to be in PDF format first.
04:02
that... sounds really expensive :P
be back in a couple of years just reading this
Anonymous
@ASCII-only Yeah but worth
wait. it's 13gb. it doesn't contain any personal/restricted information right
@ASCII-only oh my O_p
@Mego hmm. actually. i'd try printing a random line of formatted text (then two etc.) then just taking the header/footer from there
and see what line breaks turn into in the pdf
@Downgoat monocle?
Anonymous
@ASCII-only Correct. We have a script that strips out all PII when we download a backup.
04:07
also. random question. in a theoretical language where everything is a literal, identifier or paren, should foo+ be treated as 1 or 2 identifiers
@Mego nice. but... how do you restore that then :thinking:
Anonymous
@ASCII-only Is + an operator (i.e. a valid token by itself)?
Anonymous
@ASCII-only The backups have the PII. Our tool strips the PII when downloading them. You can also just manually download them, with PII intact.
@Mego hmm. well... assume identifiers can double as keywords if there is a rule set up using it as a keyword (e.g. foo @+ bar turns the identifier + into a keyword)
@Mego ah, makes sense
but yeah:
Anonymous
@ASCII-only Then I'd say 1 identifier, if I understand you correctly
4 mins ago, by ASCII-only
@Mego hmm. actually. i'd try printing a random line of formatted text (then two etc.) then just taking the header/footer from there
@Mego hmm. just wondering if that may make things like foo+bar (1 identifier) potentially confusing to the reader
or maybe it should be allowed but not recommended?
Anonymous
04:11
Depends on the tokenizer
04:26
@Downgoat yes. always :/
@Mego depends?
@dzaima oh turns out /foo/y + setting lastIndex seems to be the best way?
 
2 hours later…
06:12
anyone know a golfier way to make numbers behave like longs in python than n%2**64
06:28
@ASCII-only I'd just switch to Py3. Why do you need it?
@Bubbler anagol :P
also, this is a problem in both python 2 and 3
any import that might fix this would be too long
07:29
that seems golfy enough
@Bubbler why, can you do better in Py3?
07:53
@FrownyFrog Py3 has no distinction between int and long IIRC
@Bubbler Py2 ints are longs, but Py2 longs aren’t
so switching to Py2 would give you longs (that are called int)
and they don’t overflow anyway, they just switch type
 
1 hour later…
09:15
@Mego not yet
@Mego has anyone?
oh sorry, you're talking about PDFs, not PDEs
09:41
dj's assumption of the k-th p-rough number not exceeding k*p was asked on math se math.stackexchange.com/q/2983364
09:53
hey folks, is there a challenge about the distance between 2 cells in a hexagonal grid?
 
2 hours later…
12:28
@user202729 thanks
 
4 hours later…
16:38
CMC: output 콧웆빔똑귽ꘘ鹢雛较衚腠窕珹涌李愿孟單倬䫙䖵䃀㯺㝣㋻⻂⪸⛝⌱ᾴᱦ᥇ᙗ᎖ᄄມ౭੨࢒۫ճЪ̐ȥũÜ~OO~Üũȥ̐Ъճ۫࢒੨౭ມᄄ᎖ᙗ᥇ᱦᾴ⌱⛝⪸⻂㋻㝣㯺䃀䖵䫙倬單‌​孟愿李涌珹窕腠衚较雛鹢ꘘ귽똑빔웆콧
17:41
Does it make sense to be allowed to cast generic parameters? e.g.: class A<T> { func foo() -> Int { return t as! Int } }
18:12
0
Q: Multiples of 3 or 5

Eduardo HoefelIf we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. For a given input n, find the sum of multiples of 3 or five between 1 and n. Test cases 10 => 23 100 => 2318 1000 => 233168 This challenge was first a...

18:45
@EriktheOutgolfer Jelly, 13 bytes: 47ŻÄ‘Ṛm0×+32Ọ
@Mr.Xcoder hm, we don't usually edit winning criteria into challenges
I'm not sure why I added that tag either (??)
My bad, reverted.
yeah, that's why I didn't even try to find a dupe
The increments of the code points of those characters differ by 47, don't they?
referring to my CMC?
18:49
I've already posted my Jelly solution :P
(which was an accident, btw)
The link doesn't work btw because you copied the output to the argument :P
ah, sorry :P
it was what I had in a tab since a few hours ago
btw, some more feedback for (1, 2) would be nice
0
A: Sandbox for Proposed Challenges

Nathan MerrillConcentration (or Memory or Match) is a game where players pick pairs of cards and try to find matches. The rules are as follows: Two of each number from 1 to N are added to the deck. The deck is shuffled and placed face-down (hidden). The player selects a card. The card is revealed. The pla...

come on, ms. Irony...
19:12
0
Q: Sum square difference

Eduardo HoefelThe sum of the squares of the first ten natural numbers is, 1² + 2² + ... + 10² = 385 The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)2 = 55² = 3025 Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is ...

19:25
@NewMainPosts @DJMcMayhem Try this one in Brain-Flak.
and try to get at most 73 bytes :P
(well, 72, actually)
I'm down to 72 now
yeah... at least 70 is a rounder number
@EriktheOutgolfer 60 bytes (Python)
I could golf it I think but I don't have time rn
19:48
@NewMainPosts Similar enough to this to be closed as a dupe?
Probably not
The fact that they are consecutive is hugely useful
They're consecutive in both challenges. The only difference is a range with one variable endpoint and a range with two variable endpoints.
Oh hm
My brain-flak answer definitely doesn't port but idk
I'd definitely hammer
Adapting my Jelly answer takes one byte.
19:52
Man this is why I think the definition of dupe really sucks. It is really language dependent.
@Dennis it actually takes zero bytes
just uppercase the r
Edit distance, not addition of.
You can golf a byte off though
and then remove the µ
so, edit distance = 2
Good point.
19:54
@PostLeftGhostHunter Sure. I'll have to pretend you haven't answered yet though :P
It might be a while before I can take a look at it though
0
A: Sum square difference

ShaggyJapt -x, 9 8 5 bytes Ç*°Z² Try it

Having an output flag to print the sum of the result instead of the result seems sketchy.
Essentially one level of MetaGolfScript.
lol that's been a long-time Japt feature
Doesn't affect sketchiness.
0 bytes in jelly eun ṖÄḋḊḤ. ṖÄḋḊḤ is clearly a command-line flag.
happy competition :P
Our consensuses seem kind of loose about this
20:02
wohoo 68 bytes!
So close to 5 bytes in Pyth but it's shifted by 1 -_-: sm**t
@Mr.Xcoder Looks like dirty code to me.
Lol :)
And to correct the indexing I need 4 full bytes ಠ_ಠ: sm**tdddS
@Mr.Xcoder eww.
the shame of code golf
:P
@Mr.Xcoder actually, you can do it in 8 bytes
sm**dhdh
20:13
@Mr.Xcoder What does the dddS do?
Occasionally I wonder what to do if the natural APL solution to a problem at work looks… indecent. Luckily, it hasn't happened yet.
7 bytes: sm*^hd2
@EriktheOutgolfer I am perfecty aware, I was just frustrated that m maps on U and not on S implicitly
@cairdcoinheringaahing Breakdown: sm**tdddS -> sm...S: map with d on [1...n] and sum, *tdd -> d(d-1), *...d -> d(d-1)d=d^2(d-1)
@Mr.Xcoder ...such is Pyth :P
that's actually useful sometimes
Usually it is helpful but sometimes it's a complete PITA
20:23
@Mr.Xcoder I forgot Pyth is prefix :/
As a fix I had the alternate 7-byter sm**hdh
0
Q: The inverse Collatz Conjecture

Eduardo HoefelI think the Collatz Conjecture is already well-known. But what if we invert the rules? Start with an integer n > 1. Repeat the following steps: If n is even, multiply it by 3 and add 1. If n is odd, subtract 1 and divide it by 2. Stop when it reaches 0 Print the iterated numbers. Test case...

@NewMainPosts This time I've added the appropriate tag because of the last rule
20:44
@cairdcoinheringaahing Your puppo is finally back, nice. I <3 that profile picture
@Mr.Xcoder Thanks :P
 
1 hour later…
21:48
We have a rather clear (+22/0) meta consensus that we don't want Project Euler ect. questions.
Regarding the recent Sum square difference question, has this ever been enforced?
 
1 hour later…
22:57
Does it make sense for a Goat[] to be directly castable to an Animal[] where Goat extends Animal
@Downgoat only in a read-only situation
Kotlin does this the best
with in parameters and out parameters
@NathanMerrill :V Kotlin does this the same way C# does it and C# did it first
wait... C# has this?
how did I not know this
Yeah it has in and out keywords for type parameters
They're pretty much only used in the standard library and by framework authors, covariance/contravariance isn't something most regular users worry about it
which is the way it should be :)
if you don't have to worry about covariance and contravariance, your life is way simpler :)
yeah, I'm reading it right now
it looks pretty identical
Also, "In" and "out" is way easier to read than "extends" and "super"
"extends" is factually right, but it is still really to reason about
huh...so C# did it in 2010 (C# 4). And Kotlin was release in 2011 (I believe with the feature to boot)
So, either Kotlin saw it and added it really fast (a year) or there must have been a different language that really made it popular
@Pavel huh interesting
seems like with covariance/contravariance it'll be easy to introduce casts that have high runtime overhead though :/
@NathanMerrill The entire wikipedia page on co/contravariance uses C# as the example with a small note mentioning java arrays.
yeah, I didn't learn it from wikipedia
I was introduced to the concept by Java, and Kotlin was the language that taught me the better way of doing things
Neither did I, but that's just something I just found
The idea itself comes from category theory
23:18
C# is a rather recent language for me
oh yeah, the concepts have been around for a long time. You can get really deep in type theory
that doesn't mean that they get implemented by languages though, so I'm still wondering what caused the sudden surge of interest
seems like a PITA to implement too O_o the more I think about it
All of type theory is PITA to implement
that is true
let us abolish all types
@NathanMerrill I'm pretty sure C# 4 introduced System.Linq, and the system of IEnumerable chaining and first-class functions is made much more usable if you have co/contravariance
@flawr Perl?
23:21
@flawr I didn't say it wasn't worth it
hehe:)
Why do you have a christmas hat
It's november
It's early november
the stores in my area already started with christmas stuff a few weeks ago
@Pavel 3.0 was actually linq
Yeah but they're wrong
23:22
but you are absolutely right, it's the next natural step after linq
23:40
@Pavel actually here the red hat (or more like the red hood) has become a symbol of st. nicholas, which is celebrated at december 6.
@flawr That's still over a month away
anyway, I'm still looking forward to it:)

« first day (2836 days earlier)      last day (2304 days later) »