« first day (2680 days earlier)      last day (2460 days later) » 

00:17
wait. there are two people who prefer golfing in Attache?
@ConorO'Brien :| you can pretty much tell who's who by the languages they use
ok so who here is the heretic using 4 spaces with JS (note: i don't expect an answer, it's anonymous anyway)
@PhiNotPi *a quartata
And some by age and/or combination of language and age (in the case of Adám)
ngn
ngn
@Zacharý how do you know it's not me? :)
⎕IO←1
ngn
ngn
@Zacharý ah, ok... :)
There's a reason ngn/apl is ⎕IO←0
00:26
@Zacharý what's the reason
@ASCII-only lol yeah basically
IDK,
@ConorO'Brien e.g. the only two people in the world who use Charcoal anymore :P
(AKA creater and user)
@quartata absolutely
ngn
ngn
00:30
@ASCII-only I think having a choice for ⎕IO is bad. 0-indexing makes more sense (to me), so I allowed only 0. It also makes APL easier to implement.
Mean: 22.25, Median: 17.5. Whoever said the mean what higher than the median, you were right.
@ngn :P but doesn't that mean it doesn't comply to spec
@ASCII-only That's a little (not a lot, though) like getting BASIC to conform to spec :P
ngn
ngn
@ASCII-only what spec? there's the APL2 spec but it's behind a paywall
@ngn wait what :|
ngn
ngn
00:31
and who cares, I only wanted to teach myself how to implement languages :)
@ASCII-only You don't expect everybody to program in K+R C, do you?
@ngn That's pretty much RAD's purpose as well.
Is the stddev sample? It should be.
Can you sort them?
ngn
ngn
@ASCII-only yes, APL has a spec (it's an ISO standard, not by Dyalog) but you have to pay to download it! it's ridiculous
@Zacharý like the graph?
Yeah, insert a column that's just the ages sorted
@ngn well of course the spec is not by Dyalog >_>
00:37
wut.
ngn
ngn
@ASCII-only I wanted to say that explicitly because people often mix up "APL" and "Dyalog APL" because of Dyalog's current monopoly in the APL market
Someone's programming language of choice is Pyth. Not Python, Pyth
@Zacharý what about it
if malty was here that'd make sense
more builtins + less typing
00:38
._.
pretty sure some of the mods use CJam/Pyth for algorithm-heavy scripts often
But it isn't their favorite golfing language ._o
well clearly because the age of ASCII golflangs has gone :P
sighs rip
besides MATL
(And J/K if you're being lenient)
00:40
not a golflang :P
"if you're being lenient"
What's dead: GolfScript
@Zacharý ?
re: charcoal verbose mode, both of the people that use it use it for basically every submission >_>
Yeah, it is pretty useful
The age distribution is definitely skew right as all heck
00:51
@Zacharý of course. this comes up every time TNB talks about ages :P
If we get rid of those outliers and 33 year old: I think it'd be skew left
@Zacharý outliers?
Median +- 1.5*IQR
(Dataset, not people)
ngn
ngn
the best thing about tnb: you're chatting with someone and you're thinking this must be a maths professor or someone with 20 years of experience in the industry, and suddenly they are like "cya guys, gotta do my homework" ...
14
@ngn yeah Dennis is one of the few people here with a (primarily) math degree IIRC?
ngn
ngn
00:59
@ASCII-only I've no idea
@ngn He probably is.
I'm pretty sure he's the only professor though
iirc both Wheat and 0' have/are working on math degrees
*Hat
And who is that latter person?
somebody who isn't in TNB too mcuh
ngn
ngn
@Riker Leaky Nun too, according to his profile
01:05
right
When was the last time he/she was in here.
0'? idk
in contact regularly tho
01:21
Anyone know how to do this better:
  this.health = maxHealth
  this.maxHealth = maxHealth
  this.attack = attack
  this.selected = false
  this.nameColor = nameColor
  this.manaCost = manaCost
  this.name = name
  this.inHand = inHand
  this.deck = deck
  this.manaManager = manaManager
ti's javascript inside of a class constructor
@FreezePhoenix just pass in an object, and do Object.assign(this, opts)
well hmm. idk if that would work
Writes up a test class
It works...
and its still an instance of the class...
Don't use classes /s
@Zacharý praytell why?
"/s"
I'm in ImportError hell
@FreezePhoenix of course :P it just copies properties over
@Zacharý how
Night everybody...
@ASCII-only I don't even know.
It keeps saying RAD_IO is not defined. But I imported the file that contains it in about every file.
@FreezePhoenix one thing. if you're using a new enough version of JS then you can do ({health, foo, bar}) in the arglist and that should restrict properties copied to the ones in the arglist
@Zacharý paste the file that contains it?
I'll just upload it to bitbucket, I've finished implementing some atoms anyways
@ASCII-only Here. Whenever I try to run RAD_Main.py without line #8 of RAD_Atoms.py, Python freaks out
01:35
@Zacharý which files import atoms
@Zacharý :| where did you go
@Zacharý circular dependency
Anonymous
Don't do from RAD import * in RAD_Defaults.py
The reason why namespaces are one honking great idea is because they delay the resolution of a name
If you do from asdf import x x has to be well defined already
Anonymous
Yeah, doing a lot of global stuff and doing import * everywhere is bad
@Mego That'll break RAD_MISMATCH
01:41
If you import asdf then do asdf.x it's not a problem
Star imports are even worse since they hide this from you
They grab whatever is currently available which may not be what you expect
@Zacharý well just don't circular import
use a sane language
well actually
you can circular import
just don't do it at the top level
@ConorO'Brien have you seen what circular imports are like in Node lol
Anonymous
Circular imports are perfectly fine in Python unless you also use from x import * everywhere
01:44
Downgoat literally couldn't work on Cheddar for like a month because of one
1 min ago, by Conor O'Brien
use a sane language
I got it fixed now.
@ConorO'Brien Yes. sane languages wouldn't break on circular imports
@ConorO'Brien fair. The problem really is that it offers from at all
Anonymous
01:45
If you just do from x import y or import x, you will be perfectly fine, because x.y won't be evaluated until you need it
I just axe * from all the RAD_Defaults imports
Ruby has less problems because it doesn't offer that
@Mego Already done
@Mego from x import y will break if y isn't defined yet
Anonymous
@quartata That's true, but if used sparingly, you can avoid issues
01:49
@Riker Nice profile pic. I'm flattered.
thanks man
it's all you
is it weird if DJ calling my mind a disturbing place is probably the best compliment I think I've ever gotten
8
kinda yes
since I think you taking that as a great compliment is weirder than your mind
well it's not actually the best compliment but it's certainly the most interesting
(It's actually all TW [inspiration, at least])
02:06
@quartata but isn't that basically just sugar for import x; y = x.y?
can anyone golf this:
for [ js_source in static/lib/axtell~*.js ]; do
  JS_SOURCES+=(-F axtell.vihan.org$js_source@$js_source)
done

command "${JS_SOURCES[@]}"
I feel there should be some syntax shorthand to avoid the loop but not sure of how that would work personally
@ASCII-only it is, but it resolved x.y right away
@quartata doesn't that mean from is better :P
Anonymous
@ASCII-only No. from x import y creates a copy of x.y in the global namespace. So if you do import x; x.y = something, the value of y within the x module is modified.
Thats also true
Anonymous
02:09
58
A: Use 'import module' or 'from module import'?

Michael Ray LovettThere's another detail here, not mentioned, related to writing to a module. Granted this may not be very common, but I've needed it from time to time. Due to the way references and name binding works in Python, if you want to update some symbol in a module, say foo.bar, from outside that module,...

> basically
my point is that offering from is a good thing :|
Anonymous
The copying is quite important, and is often the source of headaches - modifying x.y unintentionally causes confusing bugs
Anonymous
Offering from x import y is a good thing. Offering from x import * is a trap
._.
@Mego (obligatory meme)
Especially since __all__ is such an ugly hack to get it to play nice
02:12
@Mego IMO in a sane language import * would work too
It can't possibly
It can only import what it already there
In the event of a circular dependency that's nothing
Anonymous
The two choices you have for import * are a) what Python does, and b) what C does (dumping the entire source file in-place)
Since the module hasn't been fully evaluated yet
@Mego But C has includes
That require complete paths
@Mego which only works because once something is included it's in the same scope
So you never have to include something twice
02:14
@quartata can't you lazy load, then resolve all circular imports after the rest of the modules are finished loading
Anonymous
@Pavel That's what I'm talking about. Also complete paths are completely unrelated to the discussion at hand
Anonymous
@ASCII-only Possibly, but that's not how it was designed. I expect that would cause more complications and newbie headaches while not solving all of the problems.
@ASCII-only It would be quite the surprise
@quartata ?
@Mego C's #include doesn't allow globs, right
You can't specify *, it doesn't make sense
You can't specify it anywhere
02:15
@Pavel but C doesn't have namespaces...
If a module depends on the side effect of importing another
so all includes are star includes
Anonymous
@Pavel Yeah, but that doesn't really matter. from x import * in Python is basically just #include <x.h> in C, except with different semantics.
Which sounds gross but is actually quite common. SmokeDetector has one, where importing a module registers a bunch of commands
@quartata well you can make it consistent behavior + add a warning
a lot of the time a module doesn't depend on side effects too. so IMO sometimes it should just work
02:19
@ASCII-only I think I can do 1 + '1' === 2
I would say that eager loading is a more expected behavior
If you really wanted to wait, you'd use a regular import
Assuming you're aware of the semantics at all
Most people won't care and the former is much easier to implement
@FreezePhoenix ?
how
is this Perl or JS?
JS
you can tell because of the strict equals
@FreezePhoenix :| this is a terrorist group
JS
Autocorrect strikes again
02:22
@quartata well that would work too. eager load first module as far as possible, load second module until part the first module needs is defined/load first module until part the second module needs is defined, finish loading second module, finish loading first module
My writing direction seems reversed on jsbin...
That's a pain.
@FreezePhoenix :|
@ASCII-only the following should work:
@FreezePhoenix just backspace until you delete the control char that's doing that
@ASCII-only no it's worse the keyboard is messed up in jsb i & I'm on mobile.
02:26
@FreezePhoenix refresh?
Nope
The following produces this result(I think... I can't test on mobile apparently...):
@FreezePhoenix use jsfiddle then. or glitch. or TIO
String.prototype = Number.prototype
Hacky though
@FreezePhoenix u wot
at least object.assign?
No...
That wouldn't work
Array.prototype === []
Object.prototype === {}
02:36
@FreezePhoenix what are you trying to do?
Get this: 1 + "1" === 11
Yes
That is in fact not a thing
It doesn't work anyhow.
1+"1" is "11"
@FreezePhoenix yeah doesn't work
to make it work you'd need to override operators
and there's no way to do that
02:40
I know
How are you guys?
03:08
[] + []
Array(16).join("String" - 1) + " Batman!"
@ASCII-only well you can sort of...
@Downgoat yeah. sort of but not really
@Zacharý you just watching that video?
@user202729 you are in the wrong place. Try SO
No, I remember it from about two-three years ago when I watched it
@user202729 stackoverflow.com
Wait silly me nvm...
03:14
Do you think this can make a good atomic code golf? I have a linear time solution, but with high constant factor.
@user202729 couldn't you use a threshold to decide which algorithm to use :P
03:31
CMC: given two integers A and B, output the first 9 terms of an arithmetic or geometric progression containing both integers.
I once had the DND black razor...
And then the DM had me give it away...
Jelly, 5 bytes. Take input in reverse order.
there is no order technically. the sequence just has to contain both inputs
theoretically, some sequences are totally valid no matter the input
ok, amendment: within the first 9 terms
03:34
@NathanMerrill "arithmetic or geometric"...
hmmm...well, except for negative numbers
@user202729 right, I was just thinking 0,1,2,3,4,5
J equivalent: ]+i.@9*- (8 bytes)
erm
huh
TIL @ treats right nouns as constant functions
can someone link me to TNBDE?
03:57
@NathanMerrill min(a, b), min(a, b) + 1, ... :P
04:38
Q: for(int i=3;i-->0;)myvector.pop_back(); or myvector.erase(myvector.end()-3,myvector.end()); ?
04:50
Latter for performance I'd suspect
You'd have to try
Or myvector.resize(myvector.size()-3)?
Harder to read
.erase is certainly the easiest to read
I'd write an extension method (if C++ supports those), I like to seperate out even really small chunks.
@Pavel Extension method? Like Javascript assign-to-prototype?
I don't JS
04:56
@Pavel total overkill for erasing the last 3 elements
@quartata Not for 3, but for an arbitrary amount
If this was C# I'd call it SkipLast
that's what erase does
helped a guy with his Java homework on reddit, after 1 hour I realized he has no clue what he's doing
Ideally there would be a function that only takes a single int which in this case would be 3.
but he followed everything for an hour
just typing arcane symbols into the compooter
now i'm depressed
but now I'm not because I vented
@ConorO'Brien since november 2017
05:00
What the hell is going on with freenode
I'm being shown as the only one connected to all the channels, and I can repro on multiple devices and networks
@FrownyFrog close as "lack minimal understanding"
@FrownyFrog :|
and then there's me: yesterday doing an assignment (in java) i started two days before it was due and i was like "this is terrible" so i added features hidden behind a CLI flag
(that's almost certainly going to cost me marks. oops.)
if (countryName.equals("Canada")) {
    medalsCanada = athleteArray[i].getMedalCount();
    medalsCanada = 0 + medalsCanada;
}
in what world is he not trolling?
wat
wat indeed
on a side note, this kinda looks like two of the assignments from my uni (both in languages other than Java so not the same assignment). i guess it kinda makes sense here because the 2018 CWG was like 100km away
05:41
@ConorO'Brien BrainFlak, 55 bytes: tio.run/##SypKzMzTTctJzP7/…
And by 55, I mean 56 obviously
 
2 hours later…
07:52
@ASCII-only (where) are you seeing the results?
08:19
@FrownyFrog Why 0+ :/
10 hours ago, by Conor O'Brien
08:35
C++ CMC: Take a vector v and a number i as input, return the i'th element (0-indexing) from the end of v.
(for example f(v,0) == v.back())
For Jelly: Ṛị@
@user202729 but C++
Or <something here>ị.
@user202729 :| something here
@ASCII-only Well because my CMC was intended to be C++, so it specifies 0 indexing, but Jelly has 1 indexing...
@user202729 why are you answering in Jelly though :P
@user202729 looks like there's mo builtin method, so here
08:46
@ASCII-only No way to click on the link on half screen....
@user202729 half screen?
The browser window takes half of the screen.
Coincidentally it's also exactly the length of the chat message.
@user202729 why does that not let you click the link :|
that's a tiny screen
So when I try to hover over the link the flag/star/reply menu appears.
golf pls...
Fun thing is there is a builtin method. Not exactly builtin, but shorter than that.
@ASCII-only 1280×800.
@user202729 anything less than Full HD is small
that is actually tiny
i used to have a $400 laptop. it had a 1366x768 screen (as is standard for low-end laptops nowadays)
08:53
> nowadays
hi
@user202729 how about this reasoning?
@user202729 let each node in a graph represent a different n-b bit string. We connect two nodes if that can't both come from the same n bit string. Now we find the largest clique in the graph
About the challenge? It seems that LP is a good way to estimate a lower bound (to help brute forcing), but I remember trying to implement simplex algorithm twice and failed twice.
@user202729 Doesn't that answer the question?
Not exactly failed, but I gave up before I finish it.
...
Sounds reasonable.
It's only a lower bound.
doesn't my method give you the exact correct answer?
and its complexity is far better than we had before
09:00
Unfun fact: None of the numbers in the cumulative sum of 1,1,2,3,4,5,6,7... is/are(?) divisible by 3.
I thought I had a bug in my code... :/
@StewieGriffin "are divisible" -> "is divisible" :)
@Anush it's "are"
none is short for not one
not one of them is....
Largest clique is ... well, still NP-??? (I can't understand complexity theory), but better than set cover.
@Anush maybe it was once upon a time, but not anymore
09:02
@ASCII-only ah..well I disagree
@user202729 it is np-hard but way better than we had before
and also there is lots of library code for it
if that helps
@Anush But is it correct...
@user202729 See en.wikipedia.org/wiki/… section "Finding maximum cliques in arbitrary graphs"
lookup dict Both should be correct.
I believe so and we can try it using our favorite graph library (e.g. igraph)
Believe is not enough...
@user202729 [](auto v,int i){return v.rbegin()[i];}
@user202729 ok let's try to prove it. First: the set of all n-b strings is sufficient to cover all n bit strings with b bits deleted by definition
@user202729 so the set of nodes in the graph is sufficient
the idea is that, for each n bit string we are choosing exactly one n-b string as its "representative"
of course many different n bit strings might get the same representative
@Zacharý Late reply: I think Luis Mendo is an associate professor too...
so there are two things we need to check.. a) every n bit string actually gets a representative, that is they actually cover all the n bit strings and b) there wasn't a smaller set of representatives that would also have covered all the n bit strings
09:43
@StewieGriffin I think his last name is Tomás
so, it's Mr. Tomás, not Mr. Mendo
Had a panic moment there and thought I'd locked myself out of my computer because I broke my lightdm greeter :P
@StewieGriffin not in maths apparently
@Mayube 10/10 great
yeah it's a polytechnic
also you're back yay (I remember seeing that you were back a few days ago in the transcript)
tfw you forget linux can totally run without an interface. Had to boot in recovery mode, log in as root from the commandline, and fix the config file
I am back!
Henlo
I see you've improved your avatar too
oh hey I passed 5k rep when'd that happen
09:50
> improved
Not sure if it's an improvement....
^w^ is better than ><> for an avatar imo, especially given afaik he didn't create ><> :P
I'm also finally rewriting braingolf because boy is that interpreter a pile of trash. Unfortunately progress is slow because I'm bad at programming
true, some worse than others
Finally solve it........
At least it's linear time and operations. Constant factor is about 14. HUGE.
(I was talking about this)
10:09
@Mayube yeah I didn't
@Mayube :|
@user202729 constant factor?
@user202729 if you mean operations the i'd only consider like >1k huge :P
10:41
0
A: Sandbox for Proposed Challenges

user202729 Is this hard enough? Should I convert to block sort? Should I keep the fastest code part? I have a linear-time linear-space solution, but it has huge constant factor, besides it's not easy to implement. It's possible to reduce the constant factor but then it's even harder to implement. ...

0
A: Sandbox for Proposed Challenges

LyricLyDivide two strings code-golf string One day, I saw the challenge to multiply two strings and I thought I might be able to do one better. That challenge was fake. It was elementwise maximum. It was not real multiplication. So I set out to make something real. Real division between two strin...

@NewSandboxedPosts :/ Next time I will never put sandbox notes at the top of the post.
Py: I've got a file a that imports all required modules to work, and each of those modules imports a and uses each other module. PyCharm doesn't warn about anything, but when I execute it I get name '...' is undefined. What I'm doing wrong? :v
Execute what?
@Soaku post code pls
wait, i brb
10:49
@Soaku if it says name is undefined then you're almost certainly just not importing whatever you're using
@ASCII-only In my case, in one file I use the class String, I'm importing the importing module, which imports it at the end
what errors

« first day (2680 days earlier)      last day (2460 days later) »