« first day (2956 days earlier)      last day (1999 days later) » 

7:28 PM
0
Q: Discord Bot Smash or Pass

Queen Excuse my idea of a bot! if (message.content.startsWith (prefix + "sop")) { number = 3; imageNumber = Math.floor (Math.random() * number) + 1; message.channel.send ({files: ["./smashorpass/" + imageNumber + ".png"]}) + message.channel.send("Smash or Pass?") if (message.con...

 
user4639281
I have no reddit
 
I have very low rep here
!!stat forresthopkinsa
 
@forresthopkinsa You (https://stackoverflow.com/users/2172566/forresthopkinsa) have 450 reputation, earned 0 rep today, asked 4 questions, gave 23 answers, for a q:a ratio of 4:23.
avg. rep/post: 16.66. Badges: 0g 9s 16b
 
4/23
 
!!stat neoares
 
user4639281
7:33 PM
!!stat TinyGiant
 
@Neoares You (https://stackoverflow.com/users/3337752/neoares) have 386 reputation, earned 0 rep today, asked 13 questions, gave 15 answers, for a q:a ratio of 13:15.
avg. rep/post: 13.78. Badges: 0g 8s 20b
@TinyGiant You (https://stackoverflow.com/users/4639281/tiny-giant) have 13056 reputation, earned 8 rep today, asked 8 questions, gave 503 answers, for a q:a ratio of 8:503.
avg. rep/post: 25.54. Badges: 6g 38s 55b
 
but on reddit I have 4,031 points
it's much easier to get points on reddit than SO lol
 
@SterlingArcher Well help the man.
 
I'm not familiar with the discord API
 
@3d-printing-folks: how do you remove prints from the bed when using tape? It sticks so well the print won't come off easily. Do you scrape the whole thing on each print?
 
7:34 PM
@KevinB why do you say
 
wha
 
@FélixGagnon-Grenier I usually do. It's not worth messing with it because you'll end up messing up the tape anyway.
 
wh
!!stat KevinB
 
@forresthopkinsa Kevin B (https://stackoverflow.com/users/400654/kevin-b) has 84825 reputation, lost 2 rep today, asked 7 questions, gave 2311 answers, for a q:a ratio of 7:2311.
avg. rep/post: 36.59. Badges: 11g 134s 155b
 
7/2311
 
7:36 PM
There's a very dangerous trick you can try if you want through. If you use a glass plate right after you're done printing put the whole glass plate in the freezer.
It will pop itself off or be very easy to pop off, but I'm sure this can also shatter the plate, so.
 
how many more answers do i need to bring that to 1:x
 
user4639281
@Allenph wouldn't that create a large amount of tensile stress in the printed piece if it had not yet cooled?
 
user8729657
Is this a Jquery selector to traverse through the dom classes/ids? ('#profile > div.trn-profile.dtr-profile > div ')
 
@TinyGiant If anything I would expect it to be compressive because its the outside that shrinks first.
Regardless it's worked for me.
 
user4639281
 
user4639281
7:38 PM
@Allenph tensile stress can be compressive, can't it?
 
user8729657
Cool
 
user4639281
Like the Prince Rupert's Drops, it makes it more resistant to flexing, but less resistant to fracture
 
By definition, no. I don't think so.
 
yeah I don't think I will be removing that and putting it in the freezer
 
Works really well. Other than that I just usually pull the tape off. If you try and use a spatula you'll ruin the tape and have to replace it anyways, so it's better to just pull the whole shebang off.
They have some matts that are way better than glass and tape though if you want to shell out some dough.
 
7:41 PM
@TinyGiant source?
 
@KendallFrey github.com
lots there.
 
git fukt
 
caps going down for a while.
reorganizing my computers.
 
user4639281
 
uhoh
 
7:45 PM
@TinyGiant The only mentions of "fracture strength" mention how strong it is, which is not what you said
 
That was an interesting thing I didn't know about though.
I wonder if you could do fusion that way.
 
with prince rupert drops?
 
By using low temperature to rapidly compress a container.
 
!!welcome CapricaSix
ha! FREEDOM
 
typically rapid compression is done via high temperature, not low
 
7:53 PM
facebook messenger is down for me, anyone else?
 
user4639281
@KendallFrey I may have said it wrong
 
Using low temperatures to fuse materials together has the problem that materials become more inert the lower the temperature. Thus when the temperature raises again the materials would just be "mashed" not fused.
 
@KendallFrey Yeah. I know. But was just wondering. My suspicion would be that the center of whatever you were compressing would end up getting hot.
 
user4639281
I don't use Facecrack
 
thermal contraction probably isn't nearly effective enough to get any significant effects though
 
user4639281
7:55 PM
From what I understand it depends entirely on the material.
 
Or are you talking about fusion as an energy providing method? As in fuse two deuterium into a helium atom?
 
user4639281
Brass for instance behaves very differently to steel when heated and cooled
 
...
 
@KendallFrey Yeah. I doubt it.
 
@KendallFrey Thermal stress is very very strong and used in the strongest applications.
 
7:56 PM
Hi
 
🚽
 
I wonder if it's enough to trigger a fission bomb. I bet it could be
 
@TinyGiant facecrack? do you say "winblows" and "micro$oft" and "shillary clinton" too? insubordinate and churlish
 
@paul23 doesn't provide much energy though, since it's over a very small range
 
@FedericoFiaSare o/
 
user4639281
7:57 PM
I use Winblows unfortunately
 
I need opinions about Nestjs and relationships
 
In real life we use it in bolting boats and ships: the metal sheets are slightly heated so that the holes for the bolts become slightly bigger. Then a cooled bolt is put into it. If the temperature settles the bolt is really jammed shut and you can't get it out other than by drilling.
 
it's posible?
 
@KendallFrey Fission bombs do not work by pressure. The reason they need the pressure is to push the two fissile cores together at such a rapid rate that they become critical at the maximum contact to get a high yield and efficiency.
 
@TinyGiant hahah called it
 
7:58 PM
@KendallFrey did you watch?
 
Or actually using the residual stress in concrete/metals: by inducing stress due to cooling a material becomes "stiffer" in certain directions.
Pre-stressing is often used in the wings of an aircraft or in buildings to prevent bending. (You'd create the stress in the opposite direction on which you expect it to bend).
 
@Allenph I know. I'm thinking a shrinking neutron reflector, or slightly crushing the core, just enough for criticality
@ShrekOverflow yeah
 
user4639281
One, two, three, four, I declare a techno-religious thumb war!
 
vim > emacs
3
 
user4639281
Spaces > Tabs
 
8:01 PM
tabs for indentation, spaces for alignment
 
@KendallFrey I'm sure it would work but that would be sooooooooo dangerous.
 
ok: ie > firefox
 
@paul23 whoa
 
user4639281
/facedesk
 
no opinions allowed
 
8:01 PM
@Allenph More dangerous than any other near-critical fissile mass?
 
@KendallFrey so what did you think?
 
I'm attempting to use refs to call a child method from the parent component (i know it's an antipattern, but i'm using it for a reusable modal component).
 
I think Lewin is taking ElectroBoom a tad bit too seriously and is being offended way too much
 
onSubmit = () => {
  this.modalChild.current.getSelectedOptions();
};

<TaxpayerSelector ref={this.modalChild} />


export class TaxpayerSelectorContainer extends React.Component<ComponentProps> {

  getSelectedOptions = () => { ... };

  render() { ... }
}

const connected = connect(mapStateToProps, mapDispatchToProps)(TaxpayerSelectorContainer);

export { connected as TaxpayerSelector };
 
@KendallFrey Yeah. Absolutely. Because you could accidently set off the bomb by leaving it in the shade too long.
 
8:02 PM
I'm seeing a this.modalChild.current.getSelectedOptions is not a function error.
 
@ShrekOverflow The KLR that he describes seems to be so specific as to be generally worthless (which he points out)
 
@Allenph Just what are you planning to make?
 
user4639281
Probably because it's not a function where you're trying to call it
 
@Allenph I'm pretty sure it wouldn't be that sensitive
 
That was hyperbole but it would for sure be sketchy unless it was huge and bulky and the amount of space between the neutron reflector and the core would have to be huge.
 
8:04 PM
getSelectedOptions() is a public function as seen above, no?
 
user4639281
You should try logging the object that you're accessing to the console
 
@Allenph I don't think the amount of space would really matter, since it would have to be nearly critical in any case
 
user4639281
console.log(this.modalChild.current)
 
I'm guessing it would probably fizzle though
as it wouldn't have the pressure
 
1 sec
 
8:08 PM
@KendallFrey I was talking about the popcorn point
 
Kirchhoff's Loop Rule, yes?
 
ok then
 
user4639281
Doesn't look like it's a function to me. Looks undefined
 
now waiting for electroboom's response video
 
the question is then why is it undefined?
 
user4639281
8:09 PM
No idea
 
@KendallFrey Yeah. That was my point. In order to achieve criticality it would already have to be really really close.
 
user4639281
I don't have much experience with React
 
My point is "it would for sure be sketchy unless it was huge and bulky and the amount of space between the neutron reflector and the core would have to be huge" is wrong
It's sketchy regardless
 
user4639281
I'm going to hazard a guess and say that something isn't what you think it is.
 
user1596138
haphazard?
 
user4639281
8:19 PM
halfassered
 
user1596138
^ That fits
 
not quite
 
user1596138
Is it normal for you to be able to extend benefits to a partner you simply live with? Or did I just luck out
 
user1596138
 
@KendallFrey Rofl. Good point.
 
8:22 PM
Got a question
Why use redux store in angular, if you can save data in services easily and manage states that way?
 
user4639281
I'm wondering why people use Angular.
 
@TinyGiant Because I was told to.
:D
 
i don't know why i used it
but i don't plan to do it again
 
@TinyGiant So what are people like you use today?
 
user4639281
JavaScript
 
8:30 PM
react if it is warranted, otherwise just javascript or typescrpt
 
9:01 PM
but isnt it sort of reinventing the wheel creating spa application without using exisitng framework like react or angular
 
user4639281
Depends on if you need an entire wheel or not.
 
You are building a big system, why not use react or angular
 
who said it was a SPA
lol
 
user4639281
If you're only using two spokes from a 500 spoke wheel, then you probably would be better off just making some spokes.
 
because the context was SPA frameworks
why use angular if you dont target building an SPA app
 
user4639281
9:03 PM
Why use Angular?
 
i don't see where that context was set
 
re-organized my office
got rid of 7 power bars
apparently I need to work on my power/cord efficiency
 
user1596138
And played factorio
 
no
 
user1596138
Who tf is on my steam friends list
 
user1596138
9:04 PM
It say rlemon is playing factorio
 
because it's on at home
 
@rlemon This is when you remember the complex series of breakers you had set up.
 
user1596138
Nice
 
user1596138
I had a friend using a 30ft extension cord plugged into a power strip... From an ungrounded outlet
 
@rlemon the ultimate lazy bastard
 
user1596138
9:06 PM
Running his computer and PS4. he say "The power strip has a surge protector" lmao
 
ohh, it might even be paused
I was playing last night, then got side tracked, then went to bed
 
user4639281
Here's a trick. If you put a GFCI outlet inline before any other outlets on that line, they will all be GFCI
 
user1596138
Yea that was a pain in the ass in my old garage
 
user1596138
The first outlet was a GFCI and I'm out there trying to run a welder :'(
 
user1596138
Thf tho, better to blow the GFCI than the breaker where I'd have to call maintenance for a key
 
9:13 PM
1
Q: How do you approach or salvage a question with sexist overtones?

Sterling ArcherI came across this question today, and I knew it would cause some sort of flagging. Now, let's assume for a moment that this question was valid, well written, and aside from the code/purpose, all together a good question. Would a flag still be valid there for the content/purpose of the code? Wi...

If anybody feels they can contribute feel free
 
@LuckyKleinschmidt You know how you solve that problem?
 
user1596138
@Allenph Whch one? I had 3 problems there lmao
 
@LuckyKleinschmidt Powering the welder.
 
user1596138
Is the answer "Don't use a 20amp welder on a 15amp circuit"?
 
Nope. Get a long piece of like 10 guage wire and wrap it around an iron dowel.
 
user1596138
9:17 PM
In the ground?
 
Then hook that up to your welder. Then go hold that coil as close to the transformer on the power pole as you can.
 
user1596138
oh shit
 
user1596138
Ever thrown flourescent lights at power lines? Like real power lines... Running across fields...
 
user1596138
The environment doesn't seem too stoked on it but god damn is it cool
 
user1596138
Wait why tf does that work? Shouldn't they need to be grounded
 
9:20 PM
You are the ground.
 
user1596138
You throw them
 
user1596138
And they explode
 
user1596138
Mid air
 
Rofl. I've never thrown them. I've held them before.
 
user1596138
Yea I had them setup alongside my jacob's ladder for awhile that looked pretty cool. Same idea
 
user1596138
9:21 PM
My dad however would throw them at power lines in the field out front lmao
 
user1596138
If you find glass in your corn I'm sorry
 
I'm actually not sure why that works. @KendallFrey?
 
user1596138
Yea I'm thinking maybe my memory is wrong... That just doesn't make sense
 
fluorescent lights exploding near high-voltage lines?
 
I don't know what I walked into here but apparently JavaScript got way cooler while I was doing other stuff.
 
user1596138
9:24 PM
Like the ones that buzz even as you drive under them. Not some residential lines
 
yeah
the EM field around the wires is enough to inductively light the bulbs
 
Electrical fields are magnetic fields and vice verse.
 
I don't know why they'd explode though
 
What Kendall said
 
user1596138
Yea they'll light up for sure. Even if you just stick one end in the ground underneath the lines
 
9:25 PM
@MikeTheLiar Well, yeah. I think we're all on the same page there.
I didn't think about the gas being an inductor. But yeah. That's why.
 
I don't know if it's the gas itself
 
user1596138
I mean. you're ionizing the gas so I guess it
 
Actually that still requires a ground.
 
If you Unionize the gas it'll have to pay dues
 
user1596138
Don't they still use mercury in those? We had a factory for those in my tiny home town. I have a lot of equipment from there
 
user1596138
9:28 PM
Like oscilloscopes and bigass variacs lol
 
I bet it's similar to a tesla coil. The bulb just forms a more efficient pathway to ground than ionizing the air to make its way down.
 
tesla coils are actually a good way to light fluorescent bulbs inductively
 
user1596138
Basically any arc is
 
user1596138
My NST lights them up crazy bright when they're held near it
 
I'm not actually sure if it's magnetic or electric excitation though
more precisely, whether it requires AC or not
 
9:30 PM
@KendallFrey Same diff.
 
user1596138
You can light it up from the center of the bulb and that won't necessarily light to the ends.
 
user1596138
So I would say it is magnetic (in the sense you are saying)
 
Weird, that would make me think electric
 
user1596138
There is nothing but gas in the middle of the tube.
 
right
 
user1596138
9:31 PM
Oh I gotcha
 
user1596138
I was sure it required AC
 
user1596138
But have no basis
 
@LuckyKleinschmidt When I was a kid everyone was getting rid of CRT TVs and so I used to take the big giant capacitors out of those things.
 
user1596138
@Allenph Those will kill u
 
Then we'd charge them up.
And if you charged them high enough you could throw or shoot them and they would explode.
Yeah I'm aware.
 
user1596138
9:32 PM
I have overcharged my fair share of capacitors lmao they will blow up right on the bench
 
@KendallFrey I'm surprised this guy is not dead.
 
he's immortal, obviously
 
user1596138
Or electricity is actually just a little bitch
 
10:20 PM
🚽
 
10:43 PM
-1
Q: When to use filter() versus : in jQuery?

TJS13I'm reviewing some JavaScript/jQuery fundamentals and am curious over the use of filter() and the : What's the difference between them? Why do these lines of code work: $("li").filter(":even").css("background-color", "red"); $("li:even").css("background-color", "red"); $("p").filter(".intro"...

 
Need help with this code...
// Get data.yaml content and store on "convertYamlToJson"
$(document).ready(function() {
	$.get("data.yaml", function(data) {
		convertYamlToJson = jsyaml.load(data);
	});
});

/*
	1. On key press... [OK]
	2. Read all lines and store on "lines" [OK]
	3. For each valid code statement (using match/exec) [OK]
		4. If the code have child...
			5. Get all the child and convert to code
			6. Append to the "codeOutput"
		7. Else...
			8. Convert it to block (using yml's cmd_codeblock)
			9. Append  to the "codeOutput"
data.yml:
---
- cmd_name: alert
  cmd_regex: alert\(.*?\);
  cmd_codeblock: |
    <li class="commandBlock cmd_alert">
      <i class="material-icons drag">drag_indicator</i>
      <i class="material-icons close">close</i>
      <span class="block">Mostrar mensagem: <span class="editable"></span></span>
      <span class="code">alert(<span class="editable"></span>);</span>
    </li>

- cmd_name: if
  cmd_regex: if \(.*?\) \{[\s\S]+\}
  cmd_codeblock: |
    <li class="commandBlock cmd_if">
      <i class="material-icons drag">drag_indicator</i>
i need to put all the regex matches on the console, but only the first match is being returned
can someone help me please?
 
i don't know if i really understand the problem.
 
ok, let me explain it better...
 
In other words, you've described the symptoms
 
i have a yaml db, with data of some commands
 
10:56 PM
you expected it to log n times, but it instead logged 1 time
Have you determined any possible reasons for that?
Have you confirmed that the first $.each is actually happening more than once?
 
i think the $.each will log everything
or won't?
 
that depends on what "everything" is
 
cycling through every regex match
 
I assume it's an array, but i'm not sure
 
"everything" = all the matches found on the textarea
 
10:57 PM
well, no
that match happens on the inner $.each
i'm asking about the outer one
 
ohh, this one will get all the data from "data.yaml" file
 
What are we iterating over though?
yaml isn't a thing in javascript, you're converting it to something else
like an array or an object
 
i'm using a yaml->js library to convert
 
console.log(convertYamlToJson);
 
the "convertYamlToJson" is actually the yaml file converted into a js object
 
11:00 PM
Right
but that's ambiguous
it could be an object, it could be an array of objects,
there's no standard there, it's whatever the library does with it
 
it's better for maintaing a scalable database outside js
otherwise, it would be a hell to fix a bug on a js code with a huge object on it
 
gosh
console.log it
lol
 
(5) [{…}, {…}, {…}, {…}, {…}]
0: {cmd_name: "alert", cmd_regex: "alert\(.*?\);", cmd_codeblock: "<li class="commandBlock cmd_alert">↵  <i class="ma…rt(<span class="editable"></span>);</span>↵</li>↵"}
1: {cmd_name: "if", cmd_regex: "if \(.*?\) \{[\s\S]+\}", cmd_codeblock: "<li class="commandBlock cmd_if">↵  <i class="mater…↵  <ul></ul>↵  <span class="code">}</span>↵</li>↵"}
2: {cmd_name: "else", cmd_regex: "else \{[\s\S]+\}", cmd_codeblock: "<li class="commandBlock cmd_else">↵  <i class="mat…↵  <ul></ul>↵  <span class="code">}</span>↵</li>↵"}
 
k, and inside that first $.each, comment out the inner $.each, and add:
console.log(this.cmd_name, lines.match(new RegExp(this.cmd_regex)));
that will give you the cmd_name, along with the matches that its regexp found
if any
 
it's working
but...
 
11:06 PM
If it finds a match in one of the commands, and you expected it to find multiple matches for that one command, you need the global flag
 
it's only returning the first match
 
so that it will find multiple matches per regexp
 
k, going to try this
just a /g flag?
 
console.log(this.cmd_name, lines.match(new RegExp(this.cmd_regex, 'g')));
iirc
 
which one is better in this case, match or exec?
 
11:08 PM
dunno
not much into regular expressions
 
man
you're a fucking genius
thank you a lot
 
np
 
Hi guys can anyone help me with and Angularjs question?
 
Might be able to help with a javascript or typescript issue, which your problem is very likely to be
 
@KendallFrey That guys channel is actually full of good info.
CC @LuckyKleinschmidt
 
11:19 PM
@BenjaminGruenbaum Your talk on fear and imposter syndrome was fantastic and helped me a lot, thanks for sharing and being open (pun intended) about it.
 
ok, the thing is I'm trying to get a directive able to handle an <input type="file"> validation inside a <form> given that AngularJS doesn't have support for this...It kind of works to check if a file is submitted, but I also have an <textarea> in the form so when I submit a file and the form gets state $valid=true just by typing into the <textarea> makes the form become invalid even though I haven't set a validation for the <textarea>
there's a working plnkr of what I just said
 

« first day (2956 days earlier)      last day (1999 days later) »