« first day (1750 days earlier)      last day (3197 days later) » 

2:00 PM
Hey guys,
I got this website: betfriend.co
Once u login,
I hve a notifications bar,
which, on click,
Runs that code.
sht
function updateTime()
{

  $.ajax({
       url: "http://betfriend.co/notificationsRead",
       type: "GET",//type of posting the data
       data: "",
       success: function (data) {
         alert('works');
       },
       error: function(xhr, ajaxOptions, thrownError){
          //what to do in error
       },
       timeout : 15000//timeout of the ajax call
  });
}
After testing, it looks like the function is being fired,
and the PHP part works too
But this doesn't.
Is there anything I'm doing wrong?
sup @Andrea
 
hi
 
i tried your xmlHttpRequest
that doesnt work too
What am I doing wrong? ;/
 
!!seen CapricaSix
 
For sure you're wrong on using jQuery...
@Bergi no cap, no seen cap :P
 
@HassanAlthaf is this the same site?
 
2:05 PM
rip cap
 
what page is calling this
what's the actual URL
 
www. or no?
 
2:06 PM
hmm
are you testing this on the live site?
 
Try sending it to notificationsRead.{file ext.}
 
@Andrea ye
@Callum there is no such file.
It's a route.
as soon as a GET request is sent, a method is called
 
@FlorianMargaine Me: I need to view this pdf file, shit I have to download some lame pdf viewer...
Emacs: Hi!
Me: 2.9
 
Hi, does anyone know a test suite made for functional programming?
 
@Bergi Why would it be different?
 
2:09 PM
@HassanAlthaf try the relative path /notificationsRead
 
I want it to test invariants on my code, running some things I give it in every possible order, and checks whether the results are the same.
 
I've tried sending a GET request to http://betfriend.co/notificationsRead, returned a 302 not found
 
nt working. @Andrea
 
where "every possible order" is a bit complicated, with callbacks and stuff :-)
 
2:10 PM
Bergi jscheck.org ?
 
@HassanAlthaf open the web developer console and look at the network tab]
 
@NiklasB. That looks good, but I guess it cannot generate functions (like QuickCheck cannot)?
 
@Bergi Maybe not, but probably you can reformulate your properties such that they don't involve functions
 
@Andrea yh
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
no wonder
 
aha
 
2:15 PM
@NiklasB. Not really, I for example want to test that some callbacks (which should be created on the fly) are invoked in the expected order and only once
 
@Ber
@Bergi sounds like you might need a custom test framework for that
 
@NiklasB. Exactly, so I'm thinking of rolling my own now. But it looks pretty complicated, so I wanted to make sure not to duplicate any work :-)
 
@Bergi Sinon sounds a bit like what you're looking for
 
@Zirak Right, something like Sinon would probably be a part of it.
 
@Zirak emacs 2.9
 
2:22 PM
Now I'm only looking for a thing which looks at my computation dependency graph, and gives me all possible topological orders as executable codes (where the computations are sequenced) :-)
 
Soon, emacs 29 will be a thing
 
Vim is the greatestest, though. It came installed with my OS.
 
Great reasoning
 
Emacs came with my distribution too. I have a custom one.
 
@Florian custom distribution, custom emacs or both?
 
2:25 PM
@Andrea I give up l0
 
:(
 
why tho
its internal server error
lo
cuz
laravel
not js
i told my friend no
lol
 
English, please
 
but yh you can
@JanDvorak I beleive I am talking in english bro. :D
 
I believe you are talking in txtspk
 
2:27 PM
txtspk?
og
*oh
i see.
 
@Bergi "custom distribution" as in bare Debian + custom Debian packages, including some that just install all the dependencies I need (including emacs)
 
@Bergi you want tests or contracts?
 
@BenjaminGruenbaum Not sure about the difference but I guess "constracts" sounds better
The test cases should be generated more or less by themselves, and the constracts would specify invariants about the codes that are executed
A bit like abstracted asserts, being called from generated sequences of computations
 
> HipChat lets you bring the office with you wherever you go. Work from home, the train, your kid's soccer game, your neighbor's cousin's bat mitzvah, you get the idea. ~ hipchat.com
That's...that's so sad
 
I like the new color picker in chrome dev tools. Almost new.
 
2:37 PM
"Of course I'm coming to your soccer game son, I'll just work there and completely ignore you"
 
@Zirak don't they already do that?
 
1 min ago, by Zirak
That's...that's so sad
 
Contracts in functional languages are tricky.
 
I thought the powerful type system that Haskell has is a pretty good contract by itself?
 
2:50 PM
@AwalGarg What an intelligent young man
 
ikr. totally stumped.
 
> intellegent
I lost it
 
@uselesschien I just realized we can further flatten the installation by not doing anything special for github at all. Just create a function to extract a github like url and a flag/separate command for github. this way it can be used with bitbucket or really any other provider out of the box.
why we need to cater to github is still ... not justified.
 
I'm not sure I understand why

> higher-order functions do not support assertion-based contracts. Because predicates on functions are, in general, undecidable, specifying such predicates appears to be meaningless

Does the paper expand on that (I've only checked the abstract)?
 
We will be starting out Q&A read-only test in a few minutes.
 
3:06 PM
@JanDvorak The example given in the paper is g : (int[> 9] → int[0,99]) → int[0,99]. 'The contract’s domain states that g accepts int → int functions and must apply them to ints larger than 9. In turn, these functions must produce ints between 0 and 99. The contract’s range obliges g to produce ints between 0 and 99.' You can model some contracts with a static type system, but not ones such as that. @Bergi
Tim Disney implemented contracts using CoffeeScript based on that paper. It doesn't appear to be actively maintained though, and I can't comment on how useful it is.
 
@KingMob Ah, so it tries to model these contracts with the type system, and then tries to prove them. That of course is indeed undecidable.
 
pubs.opengroup.org/onlinepubs/9699919799/idx/maths.html O_O TIL this is part of the POSIX standard.
 
@KingMob noted; how about an Int99?
 
Well, the paper says the problem is that the function g should also accept functions with stricter contracts, without contracts, that process external data or depend on context. Plus the function passed to g could then be passed to another function .... Nightmare.
 
3:14 PM
@KingMob Possibly unrelated, are you familiar with D's template/function constraints: dlang.org/template.html#Constraint
 
POSIX is such a simple standard to read. Why can't all (hey es ~_~) be similar :(
 
Read-only Denver data center failover test is starting now.
 
@KingMob contract.coffee looks interesting indeed, but appears to be a coffeescript dialect only and not very useful for testing my JS code
 
compile your js to coffee and test :-P j/k
 
@Zirak No, but I'll take a look. Thanks.
 
3:29 PM
i didn't read all of the previous conversation, but is flowtype.org relevant here? it's type annotations (like typescript) for JS.
 
@KingMob Right, sweet.js for the rescue :-)
they do mention github.com/sefaira/rho-contracts.js though which is in pure js :-)
 
@KingMob does it count as a contract if you throw for inputs outside the range?
 
@Bergi Oh, that looks interesting.
 
@AwalGarg Curses! It looks really interesting, hope there's an answer
 
3:39 PM
I can answer that one. No.
I didn't know there was a 'skeptics' stack exchange.
 
@JanDvorak Dunno. I'm not sure how you enforce it matters in principle.
 
@Luggage how?
 
How what?
 
I mean how can you say that? source? logic?
 
that yelling at a tree makes it fall down? I've lived on earth for a few decades.
 
3:41 PM
I once set my neighbour's house aflame by thinking about matches all day
 
@Luggage Have you tried yelling at a tree?
 
And then I ran with some scissors, which caused my Great Aunt Betty which lives in a farm to the north to lose an eye
 
I don't want to get into details, but yes. :)
The comments have some logical theories, like compacting of ground form lots of foot traffic
but they are still weak.
 
if tree roots were that sensitive there would be a lot more problems in all parks
But if you're stance is that I can't PROVE that yelling at trees is not harmful, of course I can't. There are lots of things we can't prove incorrect but just assume are incorrect due to never being able to prove the DO happen.
 
3:43 PM
@Zirak lmao. can't reproduce the situation here though
 
@Luggage According to the Q., 30 days of focused yelling, along with all your friends.
 
ohh, focused yelling. that changed everything
 
That's the problem with kids these days, their yellings aren't focused
 
if there is any truth to the tree dying there there is a cause other than 'negative energy'
 
Related question: Does plants that live in houses with people with a tendency towards profanity die younger?
 
3:45 PM
zirak swallowed a clown today
 
Back when I played WoW my plants died but that's the whole correlation/causation problem again
 
And if it turns out to be true than I, for one, think causing a tree to suicide from excessive bullying is wrong :)
try posting naked pictures of the tree online
 
@ivarni Fuck no :P The profanities would imply more speaking, I think, so more CO2 for it to breath. If anything, I'd expect the plants in my house to be invincible.
 
We're bringing all traffic back to New York (exiting read-only) now.
 
But if we assume that cursing at a tree can make it die from negative energy, would performing strip-teases in front of it make it grow faster?
 
3:49 PM
@ivarni Get away from that hole in the tree...
 
tree is life, tree is love
 
I tired to find a cartoon related to this topic... I've seen things...
 
how do you access the properties inside of an object when you are in the middle of declaring it?
 
You don't
 
really?
so Lightbox.prev is impossible
 
4:00 PM
Yes
Do it after the object declaration
 
i'll have to declare it after var Lightbox = {};
okay
 
take with with you.
 
with(Lightbox) { this.next = ..; };
do you mean?
 
This is a good use for a constructor
 
sure
but variable declaration will work as well
 
4:02 PM
buuut i don't want to turn Lightbox into a class, if that's what you mean Lugga
since i'm only ever using one instance of it
 
so? one instance or not, it's still a decent way to organize code
 
@Luggage ic
oh i was just trying to keep in line with 'one instance: object, many instance: class'
but this is great, thanks man :)
 
I'd contain it into a function at the very least
And actually at the very most
 
if you hate classes, then just:
makeLigh.. right, what Zirak said
 
@Luggage Rather than passing two parameters I'd probably prefer to pass an object literal as that makes it a bit easier to understand if you only see the call to new Lightbox
 
4:06 PM
whatever works for you
 
no, i don't hate classes, just heard that expression and have been trying to use that
 
I hate classes, let's hate together
 
classists
 
the 'classes' are a way to define "this is the code i run when i create this object" and avoiding them because you only need one instance is pointless
 
And why is my quest for monkey prostitution pinned
 
4:07 PM
but in this case a function makeLightBox() would do the same
 
138
Q: Self-references in object literal declarations

kpozinIs there any way to get something like the following to work in JavaScript? var foo = { a: 5, b: 6, c: this.a + this.b // Doesn't work }; In the current form, this code obviously throws a reference error since this doesn't refer to foo. But is there any way to have values in an ob...

 
@Bergi ewewew, the top answers are disgusting hacks
 
@Bergi thanks, but some of those solutions look horrible :c
 
(top two ones)
 
@Callum In that case I don't get why w10 is more expensive than w8...
 
4:08 PM
I can't help, but at least that question is our canonical reference :-)
 
and .init() is just a non-standard way of making a class
 
when you can buy w8 and upgrade to 10
 
var Lightbox = (function(){ function Lightbox(){} /* things */ return Lightbox; })();
 
yup, that'll work.
 
4:09 PM
my cat thinks I'm up to something
 
well thanks all!
 
@catgocat Stop masturbating
 
so many solutions ^^
 
@AaronHarding you can also inline the lightbox as an anon function so no need to IIFE
 
@AwalGarg how would you do that?
 
4:11 PM
@Zirak Don't worry, I put my cat outside when I beat the meat
 
var Lightbox = function() { .. }; ?
 
Lightbox = new function () { ... }
 
@AwalGarg No, ew
 
what's the new for?
 
4:11 PM
Stop the ugly
Why so much ugly
Just write a function
 
the new ujst executes the function, same as you IIFE
but its even less clear
 
@Luggage haha
 
I like classes and I don't like tht.
it uses the new operator in an odd way.
well. less idiomatic
 
@Zirak no you just don't like hacks.
 
@Luggage how do you define your js classes?
also brbrb i've got to make some food for my girlfriend
thank all though ^^
 
4:13 PM
these days, es6
 
Make some for me
 
vegetable risotto?
 
class LightBox
{
    constructor(container) {
    }
}
 
Sure, I'm up for some Italian
 
4:14 PM
@Luggage and you compile to es5?
 
@AwalGarg: NO!!11 (sry wrong link at first)
 
yea.
 
@Zirak italian?!
 
babel all the things
 
Can we have an empty constructor?
 
4:14 PM
it's just vegetable stock, risotto, and miscellaneous vegetables
 
@AaronHarding Italian
@Callum No, if you have an empty constructor, the world will explode
 
@Luggage well perhaps i should look into it then, i haven't started with es6 yet
 
@Zirak Shit. Sorry. I'd get under a table or something...
 
anyway really brb, bbl
 
@AaronHarding Give me food
 
4:15 PM
@AaronHarding stay here
 
@Zirak could you tell me why you have "monkey prostitution" in your search history? Sounds a bit dodgy...
 
@Callum See the transcript around that time
 
search history: "sex monkey legal", "fine sex monkey"
 
@Callum he... likes monkeys. that way. and goats.
@Zirak btw I rescued your goats room the other day. and the goats didn't even thank me.
had I not been making something which I don't remember now, your goats would have been frozen by now
 
speaking of goatse..
 
4:19 PM
lol
 
Wow. Goatse and "Safe for work" in the same sentence..
 
it's a puppet..
 
That's no way to treat Kermit!
 
[goat.SE]?
 
Though I have to say, he and Miss Piggy are kinkier than I thought
 
4:24 PM
How do I see Zirak's search history and transscript?
 
work for the nsa
 
won't hire me :(
 
Doesn't matter.
 
aha recent => transscript. sorry can't help my curious mind.
 
crl
user image
4
 
@Zirak Italian? Pasta? Pizza?
WORK ON THE SPECS INSTEAD!
You useless piece of yellow smiley
 
@FlorianMargaine I am a product of my environment!
 
Time * Environment = Zirak
 
5:13 PM
I think my fan might be gubbed...
Either that or the temperature sensors are.
 
I doubt its the sensors
what does it usually run at under load?
my 290x's will get up to 92 or so C
and thats actually ok for them
wrong gpu
get afterburner or hwinfo, see what the fans running at
 
can someone help me out with this: codepen.io/Feners4/pen/EjONEe
 
5:29 PM
@feners what about it?
 
@towc I've been trying to display my data..
but have not been successful..
 
100
Q: Can "doubt" sometimes mean "question"?

Dennis WilliamsonI often see questions on Stack Exchange sites which I presume are written by non-native English speakers who use the word "doubt" in place of the word "question". Is this a case of misunderstanding the correct meaning or are people being taught that this is correct usage?

this explains a lot
 
@feners what can I do about it?
 
@towc can you point me out what might be my issue?
My method, from what I know, should be working..
 
@feners I'm not even sure what are you trying to do
 
5:33 PM
^
I looked at it as well couldnt tell what you were trying to do either.
 
tell me "it should..." and "instead, ... happens"
 
@towc display usernames with their display pic.. but nothing actually displays..
right now now I've been trying to get just the usernames at least so I could move forward from there..
 
I wish this was possible: const { subsetOfObject: {prop1, prop2}} = object
 
@feners I don't know enough angular to answer that question, don't pull your hopes up on me
@Mosho reason?
 
I keep having to do that
making an object containing some keys of another object
or Object.prototype.pluck or whatever
 
5:39 PM
const object = { subsetOfObject: {prop1, prop2}}; // or is it something else? I'm not sure I get what you mean
can you actually do const {zirak:2.9} = object in any language?
 
object = {prop1: 1, prop2: 2, prop3: 3};
 
problem?
 
I want an object with just prop1 and prop2
 
you just remove prop3?
 
why would I do that
 
5:42 PM
because that's what you said you needed...
 
what if I want 2 out of 20 keys
 
I don't get it
object2 = { prop1: object.prop1, prop2: object.prop2 }?
 
@Mosho switch to haskell and everything is a "const"
 
I didn't say anything about const
@towc exactly, that's awful
 
var object2;
with( object ) {
   object2 = { prop1: prop1, prop2: prop2 }
}
?
not sure if that actually works...
but it should
even if it's evil
or
 
5:45 PM
that literally makes me sick
 
Ewww, over your device?
 
[ 'prop1', 'prop2' ].map( function( key ) { object2[ key ] = object[ key ]; } );
?
 
you forgot declaring object2
also shit
 
well, I thought you're grown up enough to declare an object :P
@Mosho certainly cleaner?
I mean, as clean as you can get
without making anyone vomit
 
that's why I said "I wish we could..."
 
5:48 PM
@Mosho May I ask what you are trying to achieve?
 
a subset of an object
 
@catgocat he wants to conquer the world
 
@Mosho What do you mean?
Give an invalid example.
 
in es7/2016 you can do const {propToDrop, ...objectWithoutPropToDrop} = object
invalid example of what
 
oh I see
 
5:50 PM
which I guess works, but you declare all that shit you don't need too
 
I don't think that's really practical.. I normally just use const for requiring modules or defining values in top of my files
 
this has absolutely nothing to do with const
 
if you are using const { .. }, then 1) you already have the object (then just use const name = value . 2) you are getting the object from a function - I wouldn't use const for that
this is my point of view tho
 
we are talking about js, right? const means it can't be reassigned after declaration
 
...
 
5:54 PM
but, as I said
2 mins ago, by Mosho
this has absolutely nothing to do with const
 
what has nothing to do with const ?
 
anything I said
 
5 mins ago, by Mosho
in es7/2016 you can do const {propToDrop, ...objectWithoutPropToDrop} = object
 
I used const because I use it everywhere
 
sees conversation, grabs popcorn
 
5:55 PM
/me gets confused
/me forgets previous conversation
/me like never happened
 
just replace it with let
or even var
or window.
anyway, thanks for the wonderful input on the matter
 
@Zirak steals popcorn and runs away ready to rule the world
 
Why is it only Firefox supporting default parameters?
 
@Zirak do you speak haskell
 
5:57 PM
@Mosho Anyway...there's no overly elegant way. Imagine it's your dream world - what would the syntax look like?
 
@cal because they are the only ones that implemented it
 
genius
 
hurr durr
 
Like short property names, as in var foo = 4; var obj = { foo, obj2.bar }
 
I would love that
but it's another issue
 
5:59 PM
My syntax would be fuckingWork(/\* No inputs because it just works \*/), and it does exactly what I want it to do.
 
kind of
 
Where is Cap??
 
@towc morning bb I'm standing right now cuz I can't sit anymore
 

« first day (1750 days earlier)      last day (3197 days later) »