« first day (2008 days earlier)      last day (2842 days later) » 

5:01 PM
If you guys want to see a horror show, look at Imgur today. It's upvote-everything-in-usersub-so-the-front-page-has-to-see-what-kind-of-crap-we-d‌​eal-with-day.
What's curious though is that most of it is face-related, which isn't really typical of usersub. Maybe it's because posters decided to be extra creepy today.
 
ಠ¯ಠ
 
Oof, dare I look
Oh, that wasn't nearly as bad as I was anticipating.
That's just mostly content aware scale
 
another game suggestion: concrete jungle. Its a deck-builder mixed with city planning. (Yes, it costs money)
 
why so many shitpost at 29th july ಠ_ಠ
 
@TùxCräftîñg what are the shitposts?
 
5:08 PM
on imgur
 
@El'endiaStarman what is typical? (I don't do anything on Imgur)
 
You know, we have static strong-typed languages like Java, dynamic strong-typed languages like Python, and dynamic weak-typed languages like JS....
but we don't really have any static weak-typed languages.
That sounds like it would be fun
 
@NathanMerrill It's not usually so creepy-heavy, more of a mixed bag of all kinds of things.
 
@quartata so a: int = 4; a: string = "4" is valid?
 
@NathanMerrill No, but a: int = 4; b: Puppy = new Puppy(); a + b is
Oh, well...
I guess that would be valid too in that it would coerce the string to an int
 
5:15 PM
wait, what's weak typing?
oh, so if I have a function(s: Str), I can pass an integer to it?
 
Weak typing is where any type can be treated as any other type; it doesn't attempt to force type safety when using values
But static typing implies that a variable can only be one type
 
So how would a weak+static language work?
Aren't c/c++ mostly weak+static?
 
I'm pretty sure it would try to type coerce at compile time
which, yes, sounds like C/C++
 
I would consider C++ to be strong typed, no?
C is more weakly typed
 
nah, I'd consider it weakly typed just like JS
given, it doesn't automatically try to convert strings into integers
but there are lots of other conversions that can happen (and you can write your own)
that said, most languages will have some form of implicit conversions
 
5:22 PM
Yeah, even Java will do implicit toStrings in some parts
 
hmmm...is python even strongly typed?
 
Yes, it is.
But not statically typed
 
there aren't any implicit conversions anywhere?
 
No, "3" + 3 doesn't even yield 33
 
Magic methods take care of everything
ie the __str__ functions
 
5:24 PM
oooh, in python what happens if you do .3 + 3 ?
 
does it implicitly convert 3 to a double?
 
Well, 3.3.
 
@NathanMerrill The only implicit conversions I can think of are stuff like the integer 3 being converted to float 3.0 upon addition with another float.
 
But it only really has one number type
 
5:25 PM
right, but how does it get there?
 
Although, I guess that's not exactly true
 
nah, there's definitely an integer type and a float type
 
It does have different magic methods for int and float
@NathanMerrill Well, internally. It's written in C after all
 
right, but it you get the python type of .3 is that the same as 3?
 
@quartata The integer and float types aren't just internal. I don't think it's possible to add a small float to a big int without losing precision (or rather, it errors, I think).
 
5:27 PM
yeah, python reports them as different types
type(4) -> <class int>
type(.4) -> <class float>
 
>>> 10**1000 + 0.1
Traceback (most recent call last):
  File "<pyshell#171>", line 1, in <module>
    10**1000 + 0.1
OverflowError: int too large to convert to float
 
@El'endiaStarman Fair
 
that said, I actually think that it is strongly typed
 
Yeah, I think very few languages are completely strongly typed.
It's not a black-or-white thing
 
because what's happening with 3+.3 is that the float.__add__ function is getting called with an integer
and then it explicity tries to convert the integer into a float
the conversion happens after the function call, which means that its not implicitly converting
actually, how does JS do its implicit conversion?
 
5:32 PM
@NathanMerrill @Downgoat might know.
 
hmmm, JS doesn't have magic methods like python, so its a bit more complicated
 
@NathanMerrill There's a big long thing in the specification for it, one second
 
JS dont have magic method because JS is implicetely magic
 
@NathanMerrill with 3+0.3, is that calling float.__add__ or int.__add__? Since the int is first in the operation, wouldn't it call ints magic method?
 
@JustinTervay maybe? doesn't really matter IMO
 
5:33 PM
Basically it only happens when you're using an operator not a function
 
@TùxCräftîñg valueOf and toString are the magic mehods
 
You're right, it doesn't, I was just curious, since I've been picking up python lately
 
@Downgoat That's specifically for user-defined objects
note abstract operation in the specification
it's not actually a function
it just happens
 
@quartata not userdefined objects rather all non-primitives
 
@quartata I'm lost.
 
5:36 PM
@NathanMerrill basically
 
@Downgoat Sorry, basically what I meant
 
@JustinTervay 3 + 0.3 is subtly different from 0.3 + 3, though they give the same result. I think that the former will call int.__add__ and the latter will call float.__add__, but it's also possible that the former calls float.__radd__ ("right add") and/or the latter calls int.__radd__.
 
I guess my question is "Does JS say "oh! were're adding two primitives, lets cast one of them before we add them", or does the add function take care of it?"
 
@NathanMerrill The former.
 
5:39 PM
then, I'd definitely consider JS to implicitly cast
 
@LeakyNun I think I celebrated prematurely, as I've been grappling for a while on what I thought was a stack overflowing error but seems to be an arity error instead :/ Either way, the current parser is not equipped to tackle the challenge
I'll try to fix it and add as noncompeting later
 
interestingly, "hello"+4 could work in python and still be strongly typed (according to my definition)
which, according to everywhere I read, is hugely debated
huh, now that I think about it, any form of toString method is basically saying "hey, cast yourself to a string"
but you never see any toInt() methods
 
Python has int(val)
Which is a toInt()
 
oooh, you're right
it has magic methods for all of the types
man, they really got it right
there's even a __coerce__(self, other) for non-primitives
 
anyone know how i can store a hexagonal grid?
for regular grids there is 2d arrays but for hexagonal ones :/
 
5:47 PM
Hexagony makes it easy to store a hexagonal grid @TùxCräftîñg
 
still use a 2d array
 
@TùxCräftîñg in all seriousness a 2d array works
 
there are a couple of ways of numbering
 
H H H H H
H H H H
H H H H
lol there goes my formatting
 
5:49 PM
I had to do this recently, and the above article showed me three different ways to do it
 
@RohanJhunjhunwala Ctrl+K
@NathanMerrill that is one of my all-time favourite articles on the entire internet
 
I actually really like hexagonal grids for strategy games.
 
i am trying to implement a CA on hexagonal grid
 
that reminds me that I was planning to work on a Hexagonal Life simulator...
 
@NathanMerrill @MartinEnder: That is a very well done webpage. Fantastic work.
@quartata Oooh, have you ever played Slay?
 
5:56 PM
@El'endiaStarman he's got a few other interesting ones (e.g. pathfinding and procedural terrain generation) but this one is the best I think (at least out of the ones I've seen)
 
very interesting page
 
@MartinEnder out of curiosity, how does hexagony represent hexagons?
 
axial coordinates IIRC
with the centre at (0,0)
 
I'm taking a course in Assembly in a couple of weeks, any suggestions?
 
for what
 
5:58 PM
assembly is the best language
 
the memory model was a bit trickier, I think it stores also an axial coordinate along with one of three values indicating the NE, E or SE edge of that hexagon
 
I did axial as well. The nice thing about axial is that vectors are constant from square to square
er, hexagon to hexagon
 
cell to cell? :P
 
@mınxomaτ "concepts of computer systems" course
 
6:01 PM
@JustinTervay I know. You asked for suggestions. Suggestions for what?
 
i wanted to type a URL in firefox i have typed i<url>
 
yeah I think axial is the easiest to work with, and for some computations you can easily recover the cubic coordinates whose symmetry sometimes helps
 
right, but the biggest advantage of offset is that are more user friendly IMO
 
I've always done axial for hexagonal grids.
 
I expect that if I increase the Y value, I go up
 
6:02 PM
@mınxomaτ Just getting used to working with Asm. No clue what I'm in for.
 
and the X value, I go right
but that's not true of axial
 
@JustinTervay Just take the course then :D. They'll probably introduce literature and exercises in the first session.
 
HALP
a<CR><TAB>b<CR>c
in vim
the c is at the first column ;_;
 
@NathanMerrill yeah, that's a fair point
 
Le sigh. And the iterative solution in PowerShell winds up being shorter yet again.
 
6:06 PM
@mınxomaτ I suppose; friends I've talked to haven't really.. enjoyed.. working with Asm. (an understatement)
 
@JustinTervay I'm biased because I love ASM (I wrote several assemblers and even a book on learning it). But IMO ASM is really easy once you get over the first few obstacles. If you have a pretty good idea of how computers work in general, it should be no problem.
 
and there is nothing wrong in my vimrc AFAICT
 
:31372982 apparently, deleted messages still maintain the reference (at least in the JS)
hmmm, but I can't reference them
out of curiosity, did that highlight a line on your side?
 
I like my new app switch icon. :3
 
@mınxomaτ That's good to hear. I'm confident in ability to grasp the concepts of it but the lowest level I've gone is a semester with C, so it's still quite new to me
 
6:13 PM
@NathanMerrill Yeah, IIRC it works via classes added (or removed) from the elements.
So deleting a message doesn't remove the fact that a certain message had been referred to.
 
@El'endiaStarman No.
wus dat
 
Demo only has one level though.
I'd like to recreate it eventually and make it totally free so you don't have to pay $20 for a Win 95/98 game. :P
 
Oh, cool.
 
@El'endiaStarman I think it's JS. I'm trying to add hover state in chrome, and it isn't changing anything
 
@NathanMerrill Could be, yeah.
 
6:18 PM
13 mins ago, by TùxCräftîñg
a<CR><TAB>b<CR>c
plz help
 
<-- not a vimmer.
 
the amount of "vim help needed" on this channel reinforces my decision to not use vim
 
@NathanMerrill s/nnel/t room/
s/on/in/
 
@NathanMerrill vim is good, it have a builtin for rot13 ¯\_(ツ)_/¯
 
@TùxCräftîñg Did you try :set ai? If that doesn't work something else is set badly and we'd probably need to see your vimrc files.
Maybe throw in a :set nopaste? I can't recall if that overrides it or not.
 
6:26 PM
set ai resolved my prolem ._.
 
0
Q: Linear combination of two vectors

Greg MartinExecutive summary Given input representing two vectors and their respective "weights", produce output that also represents the weighted sum of those vectors. Challenge The input will consist of one or more lines of the following characters: exactly one occurrence of the digit 0, which repres...

 
@NathanMerrill ... ಠ_ಠ
 
Isn't that like the first result if you google "vim automatic indent"? :P
 
I'm an idiot.
You'll never guess why this line of code doesn't work:
var gameElem = document.getElementById(game);
 
that edit made it obvious
game is an invalid ID
 
6:39 PM
No, there's an element called "game".
 
and you forgot the quotes -_-
 
@TùxCräftîñg Yup.
 
a thing like this happened to me one time, but the problem was because i have forget to put a letter in uppercase
 
Spent ages of SO scraping trying to work out why window.onload wasn't working.
 
People here may be interested to know that Tesla's Gigafactory (soon to be the largest building in the world by area) has its grand opening today!
5
 
6:41 PM
Hmm...
 
huh
how to paste a text in cmder in vim without stopping it?
 
@HelkaHomba That place is huge. (Understatement. :P)
 
@TùxCräftîñg Have you tried pressing all the buttons?
 
@wizzwizz4 ¯\_(ツ)_/¯ brainfucked up vim
 
6:43 PM
Might be a valid strategy for Brainfuck
 
@TùxCräftîñg Never used cmder, but did you try right-clicking?
 
@FryAmTheEggman same effect, suspend vim
 
That's uh, an odd behaviour for an emulator...
 
and my compose key dont work too >_>
 
@TùxCräftîñg Have you tried turning it off and on again? That often seems to fix things that weren't built for programming in.
 
6:47 PM
@TùxCräftîñg Try this stuff: stackoverflow.com/a/11489440
 
E433: No tags file
E149: Sorry, no help for registers
Press ENTER or type command to continue
huh
and the "* and "+ registers dont work :/
 
Actually, did you try ctrl-Q?
 
do nothing :/
 
Idk then, that's all SO easily offered, and I usually just use vim on *nix :P
You could try searching more carefully over SO or the vim SE and then ask a question on one of them if you still can't find anything.
 
sadly i dont have a *nix system (i love the "bios policy" :/)
huh i have typed u and this have undo my change and idk how to fix it D:
 
6:56 PM
You can either use p or P to re-paste it, or use ctrl-R to redo the last undo.
 
Already at newest change
bah just to retype it ¯\_(ツ)_/¯
 
Well if you overwrote your state you can't redo it :P
 
i have tryed p before C-R so it have pasted a quote
 
Oh, whoops, p doesn't work with undo, my bad.
Dunno why I thought that... >_<
 
>_<
now a regex problem: map\[([^\]]+)\] dont match map[x,y] :/
huh it work on regex101 but not on vim
i am starting to think that vim sucks ಠ_ಠ
 
7:08 PM
vi is evil but vim is not. Why exactly?
 
¯\_(ツ)_/¯
 
@TùxCräftîñg you need to escape + when used in vim as a quantifier
 
E486: Pattern not found: map\[([^\]]\+)\]
 
@TùxCräftîñg Did you try :set paste?
 
@TùxCräftîñg :help magic
Its with escapes
 
7:12 PM
map\[.\{-}\] works for me, must be something else in all that escaping...
 
E433: No tags file
E149: Sorry, no help for magic
huh logic
 
@Downgoat :help magic?
 
@Martin Ender thanks, I did not know ^k works here
H H H
 
@TùxCräftîñg Did you install the full run time?
 
7:13 PM
@TùxCräftîñg your vim is borked. What OS?
 
@Downgoat Windows
 
makes sense
 
@TùxCräftîñg ok well escape parens to use as capturing group
 
OK, I apparently can't brain.
 
7:16 PM
Or Just use sno rather than s
 
^^^ Yeah I just realised you didn't do that, too.
 
to use capturing groups i need to escaoe parens ಠ_ಠ
 
I'm working on a lengthy script, and so want to use the write-progress with the -secondsremaining parameter so whoever is running it knows an estimate of time remaining. I have the timespan from "now" to when the script started, and the percent complete, but I can't seem to brain in my head to translate those into how many seconds remain. Can anyone assist?
 
@TùxCräftîñg no
you can disable magic
 
anyway vim sucks at regex ¯\_(ツ)_/¯
 
7:19 PM
@TimmyD TimeSoFar * (1 - percent)?
 
@TùxCräftîñg no it doesn't you just need to disable magic
 
No wait that's wrong, hang on a sec :P
 
@TùxCräftîñg Start pattern with \V
or do set nomagic
 
anyway :s/map\[\([^\]]*\)\]/map[hash(\1)]/g only match the first occurence idk why
 
7:22 PM
@FryAmTheEggman Yeah, that's what I had (with the division) and it seems to result in elapsed time, not remaining.
 
@TimmyD (Time / percent) - Time
 
@TimmyD (Time / percent) * (1 - percent)
 
I think that's right?
 
> a = []
[]
> a[2] = 1
1
> a[3] = 2

> a
[ , , 1, 2 ]
> a
1, 2 ]
> a
, 2 ]
> a
1, 2 ]
> a
[ , , 1, 2 ]
> a
1, 2 ]
> a
[ , , 1, 2 ]
>
node dont really like this kind of arrays :/
 
> a
1, 2 ]
wat
 
7:24 PM
@El'endiaStarman Woo, that looks like the right formulation. Thanks, El!
 
the worst is
> a
, 2 ]
 
And now that I see it, it makes sense, too. Figure out how much time per percentage, and then multiply by how many percentages remain.
 
Mine is equivalent to that, right?
 
@TimmyD Yeah. Alternatively, realize that totalTime * percent = time, so I divide to get the total, then multiply by the other part.
@FryAmTheEggman Yours seems like it would always be negative, and even if you flip it around, you'll still always have a result that's less than Time.
Hmm. No wait, it is equivalent, I think.
 
10 / (.1) - 10 = 90?
 
7:28 PM
(time / percent) * (1 - percent) = time * (1 - percent) / percent = time * (1 / percent - 1) = time / percent - time
Yes, they are equivalent.
 
Ah thanks, I was afraid I was worse at maths than even I suspected ;)
 
^^ My current PPCG rep; that is, at least until 100 rep's worth of serial voting is corrected
 
@FryAmTheEggman For cryin' out loud, I swear I looked in the Sandbox before I posed that comment.
 
7:30 PM
Happens to everyone :P That said they never responded to me, so I'm not sure if that really counts as using the sandbox properly ;)
 
@LegionMammal978 Who has been serial voting?
 
@zyabin101 idk, just ~4 hours ago someone quickly upvoted 10 of my answers
 
@El'endiaStarman Can confirm. Works out to the same visuals when running.
 
This actually looks really cool:
3
A: Make a sprite-sheet from all the Stack Exchange sites' favicons

Patrick RobertsJavaScript (ES6), 691 687 680 663 646 bytes fetch(new Request('//crossorigin.me/http://stackexchange.com/sites')).then(r=>r.text(t=(d=document).body.appendChild(c=d.createElement('canvas')).getContext('2d')).then(a=>(d=new DOMParser(c.width=320).parseFromString(a,'text/html'),s=[...d.querySe...

(The result not the code)
 
It throws an error for me
 
7:40 PM
Needs es6
Try it in the latest version of Chrome
I don't know if it works in Firefox
 
Oh yeah I almost definitely don't have that here
I'm at work on IE11 ;_;
Awful, awful browser.
 
@quartata I tried in Chrome. Might be blocked somehow by our webfilter. Can I get a screenshot from someone?
@BusinessCat Boo on you. IE is great and does all things. Except that. And that. And that. And don't even ask about that. But it's still great. ;-)
 
It looks cooler if you see it in progress :P Someone could probably make a gif though
 
@LegionMammal978 Could've been a coincidence...
 
7:47 PM
@FryAmTheEggman Pwetty!
 
@wizzwizz4 10 upvotes within ≤90 seconds? Unlikely.
 
(It's not mine it's from the post quartata linked)
 
@LegionMammal978 90 seconds? Sounds more like automation!
 
^ Isn't that only just shy of 1 vote per 10 seconds? Surely a human could accomplish that :P
 
Especially since it happened right after you said you were close to 10k rep in chat
 
7:49 PM
@FryAmTheEggman That's pretty cool! Thanks for sharing.
 
Wait, no, the timestamps say it was within 331 seconds
So ~33 s/vote
 
@LegionMammal978 More realistic.
 
Anyone reckon what a Nitrogen Yard is?
 
@FryAmTheEggman Only if said human had yottabyte/yoctosecond connection speeds, the newest quantum gaming supercomputer and very, very fast reflexes. Or, you know, a mouse.
 
@HelkaHomba idk, Google only gives up fertilizer links
 
8:03 PM
Maybe some form of on-site composting?
 
so cute
 
I mean, suppose you have a cafeteria for those ~6500 employees (likely) ... food waste through a composting process will yield a good chunk of nitrogen without a lot of effort.
 
@HelkaHomba first time i've heard that in context of spacecraft :P
 
@HelkaHomba Nitrogen... Is that a programming language?
 
8:07 PM
@wizzwizz4 No it's an Element
3
 
@HelkaHomba It's crazy that the currently building is only about 15% of the full size...
 
8:24 PM
@wizzwizz4 TS
 
oh i am not the only one that use DDG :3
 
@wizzwizz4 Theoretical star.
 
@flawr :(
 
8:28 PM
@Downgoat Should you star something if it is important but very sad?
 
Can anyone else confirm if the formulation on this Hofstadter answer works?
 
I didn't try it but IDEone uses gcc, should work there based on the ?: which is a gcc extension.
Oh, they have a link to IDEone in the answer ._. Well, yes it works in gcc
 
Sorry -- I took the same formulation and just plugged it into my iterative PowerShell solution ... and it works.
That's what I was more asking.
 
Oh, you wanted someone to try in PS?
 
Not necessarily, but if using that same formulation works in JavaScript or Python or whatever.
Like, is it an alternate method of defining the sequence
 
8:34 PM
Oh, uh, it's the same recursive formulation? There's no difference beyond some hacky UB
 
Dennis, I think, posted an iterative solution first
 
Managing a stack within recursion is harder than I thought.
 
@FryAmTheEggman I don't immediately see how $b[$_-$b[$_-1]] is the same as $b[$_---$b[$_]] ...
 
(I don't know PS, so I'll explain the C code)
 
8:39 PM
I think I may have actually been the first iterative solution on that challenge.
 
a(n---a(n)) is equivalent to a(n-a(n-1)) because it gets parsed as: a((n--)-a(n)). The n-- returns n, but later decreases the value of n by 1. Therefore, when it gets called again later it's the same as n-1.
 
Ah yeah, I see now. I'm pretty sure that's UB in PowerShell, too, since this is different than how post-decrement usually functions.
Interestingly, even encapsulating the $b[$_] in parens doesn't change behavior.
Even though that's "supposed" to evaluate first.
 
Is it? They are on different sides of a minus sign, so the order shouldn't matter, as long as both have higher precedence than minus, I guess (?).
 
I've learned that operator precedence in PowerShell can be ... slightly fluid.
 
8:50 PM
Documented-as-written, $b[$_-- - ($b[$_])] with $_=3, say, should result in first doing a lookup of $b[3].
 
Really? That seems weird. I'd assume the default is do lhs argument first, then rhs. Why would the parens change that?
 
@Optimizer Challenge idea: Draw random non-intersecting line path on blank image. In every step choose a random length from a to b and random angle from c to d respective to the last angle. Draw a black line with that length at that angle stemming from endpoint of last line (or origin if it is first). Exception is that if new line intersects with path, backtrack and retry with new randoms. Repeat until N segments are drawn.
e.g. N = 18 output might look like:
 
@FryAmTheEggman I'm just saying as documented. I think what's actually happening is what you've just described.
 
What I meant was, are you sure you're reading it correctly? :P
 
8:55 PM
> You can use enclosures, such as parentheses, to override the
standard precedence order and force Windows PowerShell to evaluate
the enclosed part of an expression before an unenclosed part.
In many instances, the parens can be a completely separate pipelined expression, and is usually treated as such.
 
That's my point, I don't think the parens will affect that. What you have is <expression>-<expression> and I don't think what you are reading applies to <expression>-(<expression>).
 
Mmm, maybe. I'll need to play around with it some more. Thanks for your insight.
 

« first day (2008 days earlier)      last day (2842 days later) »