« first day (3273 days earlier)      last day (1679 days later) » 

12:02 AM
Their signature play is the three-point combinator, a recursive offense which is guaranteed not to halt and continues accumulating points until the buzzer.
2
 
 
10 hours later…
10:10 AM
> Other suggestions the president has privately floated: Fortifying the border wall with electric spikes “that could pierce human flesh” and “a water-filled trench,” which would naturally be “stocked with snakes or alligators.” Trump has also suggested shooting migrants who throw rocks at immigration officials and “shoot[ing] migrants in the legs to slow them down,” src
Oh Trump
if it is allowed to throw rocks to them, then it is allowed to throw rocks at him
 
 
2 hours later…
12:02 PM
Im trying to create an infinitely calculative calculator in codepen codepen.io/SkylerSpark/pen/eYOwNaJ
and Im going to try using eval() to create variables per calculation
and then delete them using DOM
is this the most efficient way of doing this
im honestly still trying to get it to run the equation first
 
Wouldn't the if statement in fNum(t) allow any number through? Is that what you want?
 
Im probably going to make a regex check that checks my string for only numbers, spaces, and %, *, /, ., +. - etc
yes I want it to allow any number
3.4, 298132, 12345 etc
Ill switch to regex to make it easier later on
just trying to get it functional at the moment
Unfortunately I think writing my own calculation system would take too much space
so Im just resulting in using eval()
Im sortof clueless how to do it, or how to even write this "more than 2 calculations" calculator, but Im going to just jump straight in and figure it out.

and yes I know I could totally make a much easier calculator using buttons, forms, and pure HTML, but today im doing JS, so oh wells
 
12:37 PM
might just use a sandboxed javascript interpreter
 
 
1 hour later…
1:41 PM
@TaylorSpark don't take this the wrong way, it took me a while to get this lesson myself actually, but being more restrictive and limiting is usually a good thing when it comes to programs
accepting anything with numbers means you're letting people punch in phone numbers and things that you're probably not prepared to deal with in your program
you can always make it accept more input at a later date :)
 
2:23 PM
its alright, I shortened and rewrote the whole thing
I dont really care though, no one would bother "hacking" my eval on my little noob project
Im too paranoid
I shortened it to a simple onclick and function system
but now Im using regex to check the string INSIDE of the function (Its a locallly scoped variable, making it harder to "modify" per say, and hence allowing me to use eval with atleast a small sense of security
 
well yeah, just giving general advice
 
But now im stuck with an error
 
yeah, that's generally a bad idea too :P
 
its saying my function is missing 2 arguments
but it has no arguments
 
the only way to guarantee security is by creating a whitelist, and not a blacklist
 
2:25 PM
And its giving the error in my HTML file
Uncaught TypeError: Failed to execute 'evaluate' on 'Document': 2 arguments required, but only 0 present.
    at HTMLButtonElement.onclick (VJrxxOGDRemr:50)
 
well what are you passing?
apparently it wants arguments
 
im simply calling onclick="evaluate()"
Heres the function:
function evaluate() {
 variableSet = eqn.value;
 var safeGuard = variableSet;
 if (!/[1234567890.+-\/* ]/g.test(safeGuard) == true) {
  var exit = eval(safeGuard);
  eqn.value = "Output: " + exit;
 } else {
  alert("Dont try to exploit eval()!")
 }
}
I never put any arguments in it
 
hmm, that's weird
maybe evaluate is a function which already exists?
 
Im going to change test function at some point, I actually forgot that test just looks for the characters, and desnt actually look for ONLY those characters
 
you don't get errors of that type for functions that you yourself write
 
2:29 PM
might be, its a common math name, Illl try changing it
 
alert("Dont try to exploit eval()!") is a giveaway that you are using eval
 
if anything you don't pass the arguments, and it gets called with "undefined" passed as the arguments
 
Ill change its name to something else while im at it, and test to make sure its alright
 
also there is only one letter difference between eval and evil.. think about that!
 
haha your right
Yup that was the issue
I guess javascript has a function already called evaluate, maybe its a long term version of the eval() function itself
possible
 
2:32 PM
I actually did a check for window.evaluate and didn't see anything
but maybe it exists in other browsers
ya never know with that sort of thing
another reason why global variables/functions should be avoided whenever possible :)
 
its possible its a function built into a library or codepen itself, as thats what Im using
I know codepen's pen exporter (cpdn.io) is full of libraries
 
How do I set up a spyOn for a fake ZoneService, I just want to test one of it's methods?
import { TestBed } from '@angular/core/testing';
import { FiltersService } from './filters.service';
import { ZoneService } from 'app/zone/zone.service';
import { Zone } from 'app/zone/zone.model';

describe('FiltersService', () => {
  beforeEach(() => TestBed.configureTestingModule({}));

  it('should be created', () => {
    const service: FiltersService = TestBed.get(FiltersService);
    expect(service).toBeTruthy();
 
3:28 PM
Does anyone see anything wrong with my clear function?
var eqn = document.getElementById("inpOut");

function calculateText() {
 var safeGuard = eqn.value;
 if (!/[1234567890.+-\/* ]/g.test(safeGuard) == false) {
  var exit = eval(safeGuard);
  eqn.value = "Output: " + exit;
 } else {
  alert("Place valid math in the input!")
 }
}

function clear() {
 document.getElementById("inpOut").value = '';
}
Its not functioning how it should
it should clear the input's data after calculating
the calculator works, but clear doesnt set the value
Calculating say.... 3 * 2 will place Output: 6 in the input
I also tried eqn.value = ''; but that didnt clear the input either.... its almost as though the calculating function is preventing it from being edited outside of the function
 
3:50 PM
i mean
it's impossible for clear to affect calculateText while calculateText is currently running
given that calculateText doesn't call clear
 
I triedd to run clear before calculate text and it still isnt effecting the input
this doesnt make sense...
 
No two things run at the same time
therefore it should be easy to step through the code with a debugger to figure out what is wrong.
Don't guess!
 
I deleted the calculate function, and tried it again, still no effect..

I logged each value and it seems to be working perfectly, no errors, but the value still isnt showing up?
 
Is the value not showing up an indication that it isn't changing?
or an indication that the change isn't rendered?
 
possibly
it seems to be changing the value, but not rendering it
 
3:58 PM
or an inditication that the value changed, and then immediately changed back?
debug it
stop guessing
 
ok
I wish i could do breakpoints in codepen
like I can with C# in visual studios
 
i'm pretty sure you can
F12
it runs in the browser like any other code you put in the browser, and can have breakpoints
 
thats just the debug log, ive already tried logging values to see any problems, but they are all expected change
 
nah
you jus thaven't discovered the sources tab then
:p
 
,-.
ok..
 
4:00 PM
go to sources, find the code in question, and it'l let you set breakpoints
you could also use debugger; statements
 
Its funny how my buttons in html running the same code as function clear will edit the input
 
especially useful if you can't find the code in the sources tab, as it will take you to it
 
but function clear wont
onclick="eqn.value += '1'"
 
order of operations is everything
running it outside of that of course works
because why wouldn't it
 
hmm... I have all my variables at the top, globally scoped, and my clear function is near the bottom
by order it should TECHNICALLY work fine
nevermind, I just realised (dumby moment) that i could literally just use an onclick on the clear button too that does the same thing
works fine now...
Wow im dumb :D
2
I should give myself more credit though, im in the middle of an arithmetic class and I caught a cold... Im surprised I have the energy to type right now...
 
5:00 PM
> thinks jquery is better than javascript
> has all global variables
 
5:39 PM
How can a website read the permissions on my chrome extension?
Like it denies access to the site based on my permission list of my extension. That shouldn't be possible, should it?
 
5:56 PM
?
probably some form of ducktyping
 
looks like it might be something else
I'm adding headers to something. 'extraHeaders' needed to be there apparently. now I have to go figure out why the headers aren't showing up serverside... "security"
 
 
2 hours later…
7:54 PM
@KevinB wat
 
8:14 PM
Wat wat
 
in the but
 
Hello o/
 
just got back from short vacation
visited DC for the first time
 
Nice!
How was it?
 
8:26 PM
It was a lot of fun, was very cool to see the Capitol and such
I hadn't heard of the Botanical Gardens there before but whoa that was great
Air and Space museum, also very cool
Library of Congress feels like stepping into the Pantheon
the Washington Monument just finished five years of construction and only finally reopened earlier this year, so it was cool to be able to see that
 
user8729657
Lucky!!! I want to see the air and space museum "Air and Space museum, also very cool"
 
yeah it was good
 
Is there a reason monospace is different on Chrome vs Safari? Shouldn't they both use font installed on system?
Safari | Chrome
 
I'm pretty sure that when you only supply a font family, it's up to the UA to decide what font in that family to use
 
guys i'm getting cors error on an scoket.io server any idea how to resolve it ? i tried using both cors library or mentioning it explicticitly
any idea how to resolve it ?
 
8:40 PM
have you tried reading CORS documentation until you understand why it exists and how it works
that would be a good start
 
i have done it rest api but sokcet.io is something new
@forresthopkinsa i know it exists for security reasons but on socket it's a bit different
 
@forresthopkinsa UA?
 
user agent
 
oh
thanks
 
8:45 PM
fucking iOS and their godamn toolbars
 
@Atulkumar Only a little bit different. Do some reading. If you already get HTTP CORS then WS CORS will take you like five minutes to grok
 
okay thanks for the guidance @forresthopkinsa
 
Sure. The bottom line is that you only need enough CORS rules to get your websocket to the Protocol Upgrade phase of the websocket process
it's an HTTP-101 response iirc
once you're past that point it should work, unless socket.io ends up using its fallback socket mechanisms
don't know enough about s.io to say what causes it to engage those
 
9:24 PM
@forresthopkinsa you know the "genius" programmer meme?
can't find any reference to it anywhere, hbu?
 
I don't think I know it?
 
like someone who could have used JSON.stringify but instead reinvents it. That'd qualify as a "genius" programmer
maybe it's not a well known "meme"
usually it's implied that the thing they made to replace the standard thing they didn't know about is buggy and definitely worse than the easy/standard tool
 
9:59 PM
hmm sounds reasonable but I don't think I've seen that as a meme
was it an image macro?
 
I don't know. I meant meme in like the literal definition. I think there were articles about it in the past.
 
Ah gotcha
I mean, image macros are still memes by their literal definition, they're just a very distinct variation of it
 
no, I mean the scientific definition lol. like something the spreads.
 
"an element of a culture or system of behavior that may be considered to be passed from one individual to another by nongenetic means, especially imitation."
 
10:08 PM
That's why they're called that
The image is the thing that spreads
The captions are the modifications
Copypastas are memes, image macros are memes
et cetera
 
yeah, I'm just trying to say I don't recall images attached to it. Just a commonly understood thing to call a coder a "genius"
 
yea I get you, I've heard similar things for "rockstar"/"ninja" coders -- that is, they've gained a negative connotation
though those are different from what you're talking about
 
yeah, I'm thinking of like 10000000 lines of assembly to reinvent json or something stupid like that.
 
I just wish I could find an article or something that describes it
 
10:12 PM
let me know when you find what you're looking for
yea
 
okay. I'll keep looking. Reddit is my next stop
 
 
2 hours later…
he's not thinking of an image macro
¯\_(ツ)_/¯
 

« first day (3273 days earlier)      last day (1679 days later) »