« first day (1622 days earlier)      last day (3317 days later) » 

8:08 PM
This question deserves more upvotes: stackoverflow.com/q/29286018/1348195
@SecondRikudo oh yeah you're right my bad
fwiw - when I realized I was implementing checked exception I was like "wtf am I doing"
pretty much me at that point.
 
@BenjaminGruenbaum Your meme is bad, and you should feel bad.
 
Declaring: I kicked SecondRikudo
(not out of the room, IRL, next time I see him :D)
 
@BenjaminGruenbaum Looking forward to it.
 
@BenjaminGruenbaum don't kick, falcon punch him in the kidney
 
8:18 PM
That works :D
 
I really hope this bird runs all night
that would totally make me happy on a friday morning
 
!!afk beer
 
@BenjaminGruenbaum is TypeScript popular? (saw it via that question)
 
... he just went afk
 
@royhowie BenjaminGruenbaum is afk: beer
 
8:22 PM
oh, I didn't see that—wasn't paying attention
 
Yes, but I don't use it - also still here for like 3 minutes waiting for friend to pick me up
typescript is pretty popular in microsoft shops - personally I prepare flowtype, that said Angular 2.0 runs on TS
 
anyone in here used Morris charts? or just cares to help me figure out how to control the labels? chat.stackoverflow.com/transcript/message/22325950#22325950 start reading here down till the end of the block (not much)
if I could just get an understanding of when it decides to float vs non that would be great. furthermore I would like to put those labels in a custom position on the document
morrisjs.github.io/morris.js/lines.html the docs here were not as helpful as I had hoped
 
TS works really well if you're building via gulp
 
@BenjaminGruenbaum I like vanilla JS so much… especially when mixed with node. Maybe I'll try this out, though.
 
it, and the closure compiler, get really slow if you're building on the cli
 
8:26 PM
I use vanilla too - well, I use babeljs
It transpiles ES6
 
    Hi there. I've got 2 scripts which load just fine when I load them in using 2 seperate scripts, in between:

    <script type="text/javascript">(function($){$(document).ready(function(){$
    $(function() {
...
   ;});})(jQuery)</script>

&

    <script type="text/javascript">(function($){$(document).ready(function(){$
$(function(){
...
    ;});})(jQuery)</script>

However, I could I combine both scripts into 1 script? Also: would it be advisable to combine the 2 into 1? If not, then it's perhaps not worth the trouble now.
 
they should both run
 
!!afk beer
 
@JanDvorak Seperately, they do; but how do I combine them into 1? Or is it not worth to combine them into 1 script?
 
probably not
 
user1596138
8:29 PM
@VincentVerheyen You haven't posted any code (that means anything)
 
(function($){$(document).ready(function(){$
$(function(){
2
.... I ...
 
user1596138
Err. I'm saying maybe you should show us the code that isn't working instead
 
@Jhawins I understand, but I'm just trying to display the wrappings. The contents run fine when loaded seperately. --- The actual code would be quite long. Also: in JSFiddle I was able to run them both into 1 script, but not on my website.
 
user1596138
@rlemon lol oh shit I didn't see the first line
 
@VincentVerheyen are you really nesting $(function(){ inside of $(document).ready ???
 
8:31 PM
@rlemon | Well, actually, good point. On JSFiddle, I'm not: I just start with:

$(function(){
 
ok, because they are the same thing
and that looks super bad
 
But on my site, yes. --- Ok :) Thanks, didn't realize. =)
 
won't binding to doc ready in a doc ready handler fail, by definition?
 
@ssube don't think so
 
the event has already fired and the list of handlers should be cached
 
8:32 PM
jQuery.voodoo handles it
 
What'd I miss?
 
@SomeKittens know Morris charts?
 
Perhaps I'll leave the merging for now hé. If it doesn't bring more load to load 2 of them seperately ...
 
@rlemon nope
 
four levels of nesting is far worse than loading two functions instead of one
 
8:35 PM
I'm looking for a responsive easy to drop in line chart plugin that I can update live.
Morris does it all, but the one thing I wanna change they don't document
 
What do you mean with updating live?
 
I'm not paying 600 for a licence for one chart
 
whatever you do, don't fucking touch highcharts
it crashes safari, screws up the axis in most other browsers, and can't handle time correctly
 
I'll just fight with morris
I just hate projects with shitty docs
 
8:39 PM
their support is also atrocious
 
morris or HC?
 
oh, and the docs are mostly wrong
 
I just use highcharts for free, you know. They have an api.highcharts.com/highcharts
 
HC
when they actually bothered to document something, the docs are usually incomplete, and occasionally plain wrong
 
I'm selling it in part of a webapp, to stay legal I would need a single dev lic and they charge too much
 
8:40 PM
highcharts is one of the worst libraries I've had the pleasure of working with, and I've spent all day on Grails dependency management
 
worse than w3s?
 
@rlemon So for a single script, that I've added in between:

<script type="text/javascript">(function($){$(document).ready(function(){$
$(function(){

I clearly have duplicated some wrappings, as you mention. What you suggest then? Just:

<script type="text/javascript">$(function(){
 
yes
 
Ok, thanks, I'll try this.
 
@SterlingArcher d'awwww
 
8:45 PM
Like that, it stopped working on my Drupal site, I'll try with:

<script type="text/javascript">(function($){$(document).ready(function(){$

only then.
 
@rlemon hahaha
 
...
 
that little bastard.
 
I smell a troll
 
seen it, awww'd
 
8:46 PM
@VincentVerheyen you've went from bad to worse
 
I'm an idiot. How the heck can i solve this? This is a super basic question too and I'm embarrased to ask.. just having a brain fart moment.
 
you need to keep noConflict wrapper
 
        // lol.. this is so bad.
        if (this.state.SearchResults &&
            this.state.SearchResults.Criteria &&
            this.state.SearchResults.Criteria.VerificationLevel) {
 
@Loktar coffeescript
 
8:46 PM
I don't want it to throw an error if I attempt to access a deeply nested property
 
(function($) {
  $(function() {
     // all of your shit goes in here. stop double wrapping she isn't that dirty
  });
}(jQuery));
 
wait.. so there is no one liner I'm missing here
 
@rlemon :) ... I'm pretty lost hé. I have really no clue.
 
I assumed it was something incredibly easy I was just forgetting lol
 
koalaesce.get(this, 'state', 'SearchResults', 'Criteria', 'VerificationLevel')
 
8:47 PM
@Loktar look at @ssube's lib
 
it can be a one-liner
either remove the linebreaks, or use a library
 
jQuery(function($){...})
 
yeah but I mean it requires a lib, which is totally fine, just glad I'm not as ridiculous as I thought :P
 
paste fail
 
8:48 PM
damn nice, thanks guys
Ill check both of those out
/me heads out to get a haircut
also <3 the js chat :P
 
(function($) { ... })(jQuery);
 
@SterlingArcher won't wait
 
@JanDvorak yea that is probably better :P
 
@SomeKittens why would you need all that awful syntax for brackets and stuff?
 
w3schools is still considered an iffy source for js/css/html questions, correct?
 
8:50 PM
mildly put
 
@JanDvorak okay, so, was my comment here out of place?
 
nope
You can edit the answer
 
yeah, but the example is the one from w3schools
so if it's used, there should be attribution
 
the example (from w3s) is bad anyway
just DV
the code snippet shows poor practices
 
You can comment on the example specifcally
 
8:53 PM
that fits the requirements for a downvote rather well
 
I would never use oninput anyway
 
innerHTML is the big problem, since it opens all kinds of script injection attacks
 
Sorry guys, I just can't figure it out. I can spend hours on this. Any help would greatly speed things up @ jsfiddle.net/vincentverheyen/tk0aq0yz What's the elegant solution? :) ||| Only regarding the wrappers. I know the contents are pseudo-science. :)
 
@rlemon so what about answers that are direct copies of w3schools examples?
 
8:55 PM
if cited, just down-vote if they are bad. if not cited, flag for plagiarism
 
doubly downworthy
 
in this case I can see 3-4 issues with the code. so I downvoted.
 
Is "OP is rude in the comments" a good dv reason?
 
not IMO.
Definitely not the reason to give when the answer is factually wrong, also.
 
we're encouraged to be cordial
 
8:57 PM
It's much more useful to say "the code is bad because X and Y" than try to punish the poster.
(because, yknow, the code is bad)
 
comment history shows she is quite self-entitled and rude overall
 
if they posted thorough, correct answers and were still a butt about it, then maybe you flag or cite the code of conduct
if they post bad or questionable answers, though, you can just DV there and let the rest be
 
if the answer is correct but rude, edit
 
best solution for correcting someone is to point the mistake and provide constructive solution to the mistake.

I.E. It is not appropriate to use W3Schools because they frequently present poor development practices. Rather you should use MDN as they provide useful examples and are more accurate to the specifications
just hounding someone for their mistake is rude and disrespectful
 
that has been said
she responded with "I have no interest in your opinions"
she is being rude and disrespectful, not us
 
9:00 PM
flaggable comment
 
@itanex look at the comment I left:
 
At that point, just ignore, flag and move on. The battle cannot be won.
 
>Perhaps I worded that too strongly. It's a general sentiment among the SO community that w3schools isn't the best resource. I hate to spew platitudes, but w3fools. You are indeed free to link to whichever source you choose, but consider linking to more powerful/reliable resources, like the mdn or the web platform docs, in the future
to which she responded with the quote @rlemon just quoted
 
@royhowie you are aware that w3fools doesn't list any problems anymore?
in fact, it hardly has anything
 
9:02 PM
@ssube oh wow. "W3Schools still has issues but they have at least worked on the primary concern developers had." much more insipid than it previously was
 
my biggest problem is the canvas filter on her avatar
I hate that filter, and anyone using it in their avvy should be banned.
 
w3schools is still full of bad practices or outright wrong information.
 
@ssube that actually just happened. I clicked her profile b5 and it was not that picture.
 
How do I add a user to the _user table in db when attempting to register a user? I am using Couchdb and Nodejs. Can anyone point me in a direction?
 
Do we know why __ proto __ is deprecated?
 
9:05 PM
@ssube @JanDvorak i'm not witch hunting... but this is just bad. stackoverflow.com/a/29173970/829835
!!afk home time
 
PUBLIC SERVICE ANNOUNCEMENT: __proto__ IS NOT DEPRECATED. IT'S STANDARDIZED.
5
 
@FlorianMargaine what's the difference?
I guess people use things that are deprecated, but avoid things that are standardized.
 
@ssube could be the reason why IE6 is still used in some enterprises still, even though its support and supporting OS have been EOLed for over 2 years now
 
welp, someone brought up IE. Time to go home and drink.
3
@rlemon most of that user's answers are less than ideal, looking at them. Some are simply wrong, others aren't very specific.
 
@ssube rlemon is afk: home time
 
9:09 PM
Bottomline, should it be used moving forward for new browsers?
 
I don't remember that being part of the jsr protocol
 
is there a way to query for the lowest-score accepted answer?
 
@royhowie yes
 
@FlorianMargaine oh snap!
 
9:22 PM
is there a CSS bug in the rendering of this stack snippet. Was about to close the tab from before and that odd spacing at the top caught my eye.
 
Is it ok to use Stylus.js over SASS?
is stylus popular enough? Will it stay around? (well you can't know that but what do you think?)
 
@marcel
 
I would recommend that the tool you use be your preference. If you prefer the Stylus workflow and syntax over that of SASS or LESS for that matter, use it. ....
 
well thx, but the thing is I havent used either
 
9:29 PM
how is the keyword var related to scope
 
but actually I prefer SASS syntax... so I might just use that
 
However, as a professional contractor I prefer to not focus on a single one as my clients usually have already dictated this decision
if you have a choice in the matter use the one your strongest with.
if you have a choice in the matter, but are handing the code off, use the one that the client will not be hindered by because only 5 people in the world actually use it
I have used SASS, LESS and Stylus, I prefer raw CSS. yeah im an old man Most of my clients prefer SASS
 
Well I'm not a contractor and I'm pretty sure our clients don't even know what CSS is, I guess I'll just use SASS and see how it goes
 
@itanex Did you use DICSS?
@FlorianMargaine BUT IT'S STILL JUST AS CRAPPY
 
@lovetolearn var explicitly calls out that the variable is being defined at that line, in that scope of your code.
 
9:34 PM
Thanks for your input @itanex
 
@SecondRikudo >:(
 
np
 
@lovetolearn Nothing. var defines a variable.
If you call a variable without defining it first, JavaScript will assume you meant that variable on the global object (usually window)
 
DICSS? i had to google that one
 
Could anyone still help me with the wrappers of this javascript (http://jsfiddle.net/vincentverheyen/6jmvycmd/)? If I try to deploy it on my website, the colours of another chart get the colors of the appended chart ... Could anyone assist me in finding better wrappers that don't conflict, for this script?

P.S.: I know the contents are pseudo-science.

The problem dissapears when I load the appended chart in between:

<script type="text/javascript">(function($){$(document).ready(function(){$(function(){
 
9:36 PM
A defined variable (basically) only exists in the scope it was defined in and all nested scopes.
So
 
not completely true
 
function something() {
    var foo = 42;
}
// foo not available here unless returned
However
 
@SecondRikudo a variable is implicitly available within the sub scopes of a scope as well, this is called hoisted
-- generally
 
function something() {
    foo = 42; // Sets the global foo. Equivalent to window.foo = 42;
}
// foo available here as foo or window.foo
@itanex That's not exactly what hoisting is.
 
@SecondRikudo You're pedantic and not even right
 
9:38 PM
true... its part of the general concept.
 
Hoisting means that all variable definitions are implictly moved to the top of the current scope.
 
function something() {
var foo = 42; // availble to this scope only
function somethingElse() {
console.log(foo); // outputs 42
}
}
 
(So if you var something = 42 in the middle of the function, it's equivalent to var something at the top of the function, and something = 42 where you originally put it)
@copy Feel free to interject then.
 
@copy counter-point?
 
No, that'd just make the situation worse
 
9:47 PM
@SecondRikudo my explanation might be too short and attempting to simplify it for you. the first few point in this page is much more clear, with examples, on answering just what var does
 
Hello! Has anyone experience with jasmine and writing tests for addEventListener?
 
Hello!!! Excuse me for the unrelated question, but is anyone familiar with matlab?
 
negative for me
 
@iamemmanouil about all you can do is use something like sinon to check the function was called.
 
It's been quite awhile since I messed with MATLAB, but I have used it.
 
9:50 PM
if you want to test the actual event, you're talking about something more than jasmine
 
@Retsam @itanex So could I ask you something?
 
@phenomnomnominal Can I fake it somehow? Found a couple of articles but nothing worked. I opened a question if you can have a look...
0
Q: Jasmine test, addEventListener

iamemmanouilI'm trying to write a test using jasmine. It's for an angular app where I'm opening a window using $window.open and then settings a couple of event listeners. Here is controller: $scope.login = function() { LoadingService.show(); AccountsService.setPro($scope.pro); if ($scope.pro)...

 
@iamemmanouil you probably want to use protractor
 
I've managed how to mock things like google maps and other stuff but this one is a real pain
 
@evinda I haven't used MATLAB in over a decade and that was for a course I took
 
9:52 PM
oh, hmm
 
@itanex A ok, no problem...
 
@evinda You can ask, but no guarantee I have an answer.
 
I'd have two separate tests, one that checks that addEventListener is called, then another one that tests the inner workings of the handler.
 
@copy Answer to my emojis?
 
answer her emojis dude
 
9:54 PM
Yeap trying to test the inner bit
 
@copy yeah dude answer her emojis
 
Where's my phone?
 
preferably with more emojis
 
I'm hungry
 
@Retsam
Consider the initial value problem
y'=f(t,y(t)), a<=t<=b
y(a)=y_0

The formula for the backward Euler method is given by the formula:

y^(n+1)=y^n+h[rho*f(t^n, y^n)+(1-rho)f(t^(n+1),y^(n+1))]

for a uniform partition of [a,b] with step h=(b-a)/N with rho=0.

At each step we will have to solve a nonlinear equation for the computation of y^(n+1). This can be done with the use of Newton's method, which is defined as follows:

Let g(x) be a function and x* a root of it, which we want to approach. Given an initial approximation of the root, x_0, we define the iterative procedure x_(k+1)
 
9:57 PM
Soon I'll be back and I'll make you chicken wings
 
@Retsam I am facing difficulties implementing Newton's method for our case
 
yo whats up
anyone could point me in the right direction for this, it would be amazing please :) github.com/jxnblk/plangular/issues/57
 
@copy Have you answered @BadgerCat's emojis yet?
 
@iamemmanouil dont use an anonymous function
 
@Zirak Yeah
 
10:00 PM
You the man.
 
@phenomnomnominal you mean for this bit authWindow.addEventListener('loadstart', function(e) { right? So that I can call it later?
 
@iamemmanouil so have function loadstart (e) { ... } somewhere, so you can expose it so it can be spied on, then authWindow.addEventListener('loadstart', loadstart);
 
They were very important i.stack.imgur.com/BI5v9.jpg
 
@phenomnomnominal That's a nice idea that will definitely work
I guess I will also have to set it to scope in order to call it from the test...
 
@iamemmanouil alternatively you could somehow add it to a service that you inject
 
10:08 PM
Hmm yes didn't think of that
That's "better" than setting a function to scope.
 
yep, because then you'd test the public function on the service, and here you would just test that the event listener got added
also, $scope is generally bad
 
@phenomnomnominal $scope is bad?
 
@SomeKittens instead of a controller
especially since they're getting rid of it in 2.0
 
argg i'm really bored
 
youtube.com/channel/UCpV7D0LoRbYhdx2G-whWyog this kid is pretty cool. if anyone is into hand made weapons (knives slingshots bows etc)
 
10:16 PM
im trying to decide if learning angular is worth the effort
i somewhat dont get the point
 
@Rooster I would only if you realize what problems it solves for you.
Don't do it just because it's hype.
 
well, I look at it and think mostly, its pretty easy to do what this does myself already, but understand it would shorten the amount of time to do some of those
but it seems like a negligible amount of time
i guess its kind of like any framework
I kind of want to understand the hype though
so I can decide if I want to be a hater
;P
basically my opinion begins and ends based on its website / basic demos
 
Go ahead and try it then.
 
i dont really know what to make with it though is my main problem :/
thats my big excuse when it comes to a lot of web stuff though to be honest
well stuff in general
 
@Rooster start by making a todo app :P
 
10:27 PM
ah, I wanna make something fun though :)
 
But: it doesn't yet. If we waited to hit "publish" until everything was here, we might be writing this in 2015. So we're ....... LOL
ahhhh! that actually does seem fun! thanks!!! @SomeKittens
 
What's the best way to turn something that is either a promise or an object into a promise?
oh duh. Promise.resolve
 
10:47 PM
hey
anybody know why assigning something to $scope in angular in ajax response is not working?
 
@ScottSelby it does
 
its not hiding an element that uses ng-show="showThis"
 
it should
 
I'm hiding and showing just fine with a button , but then after jax I set to false and it never hides
 
you probably need $apply
or some other way to trigger a digest
 
10:49 PM
I figured something similar to knockout's applyBindings()
just $scope.$apply(); ?
0
Q: angular - hiding form

Scott SelbyI have a <h4> that has an item Title, if you click on the title then it turns into a textbox with submit and cancel buttons. I have all that working , my problem is Trying to hide the form after the ajax reguest html: <div class="col-xs-12" ng-show="editThis"> <div class="col-xs-8"> <...

 
@ScottSelby I prefer $applyAsync
it's new in 1.3
 
I'm using 1.2.3
 
then $apply
6
A: Angular: $resource update fire PUT request on second call only

pkozlowski.opensourceIt is hard to say for sure without seeing live code example but I presume that you are using AngularJS from the 1.1.x series (so called "unstable branch"). If so, the problem you are facing is linked to the new feature in AngularJS - HTTP request interceptors introduced in version 1.1.4 (this com...

 
no brackets ? ()
 
this seems like a reasonable explanation
 
10:52 PM
its not a function?
 
it is
I just wrote its name :P
 
k , I have another answer , someone suggested not to put it in success callback , but write another .then() and put it in there
i'll see
 
11:11 PM
Question: I have to have a ng service object initialized with an external web service call and need to fully resolve the response into the app.run point of entry, as additional app startup code needs this information as well.

Here is an image:
http://www.gliffy.com/go/publish/image/7644707/L.png

I can write a SO Question for it, but don't know how to properly verbalize my question.
 
11:28 PM
@itanex so you need to make an async call during the angular configure process.
 
yeah, basically i am working with a server to server authentication process (not my choice) and I need to have my angular startup phases collect the user details that can be provided to it after the authentication process.

Because i need to build specific route table definitions and such for each user role type among other things
 
In our app, we have a regular service that queries the backend for a user and returns a promise. Any code that needs to worry about the user object .then's the promise.
but it sounds like you need more granularity that that
 
well i dont want the 35 billion user role and permission checks to have to use a then() to get the data
obviously some exaggeration is present
 
Are you sure it's under app.run and not app.config?
 
he's prepared for Zombie Apocalypse :P
 
11:34 PM
I currently have the code processing in app.run still a bit new to the more practical aspects of NG so if in BP™ it should be at the app.config i have the power to move this all there
 
3
A: Angular.js - running a service function before anything else?

Maxim Shoustin I would like to make the initial AJAX call before all the controllers get called In Angular method run is fired before any controller is called var app = angular.module('myApp',[]); app.run(function($rootScope){ // ajax call and other stuff } In run method you can do any job like login...

 
So first off I am doing it all right with app.run
how can i write the service to behave as the $http promise having been resolved and ready to go? Let me toss this into shiftEdit
 
I just sent a Kerbal flying 3300m in the air
(he survived the landing)
 
Kerbal?
 
11:55 PM
@SomeKittens here is my code fragments
 

« first day (1622 days earlier)      last day (3317 days later) »