« first day (1494 days earlier)      last day (3460 days later) » 

12:01 AM
@joshhunt i think im not understanding you, the path is calculated outside settimeout, the code inside settimeout would make the movement, but in the fiddle i posted, for being short code so you dont have to read much lines, i subsituted the movement with write innerHTML
 
12:11 AM
@user3470815 what's the difference between the two paths?
 
you mean between the first one , and the second one?
 
yes
 
one is the path of cells to follow from the point of origin a cell position 0x9, to get to the cell 3x8 . and the second one is to get from the point of origin, to the the second destiny cell it should go to 5x6 (When talking cells i mean html table cells)
 
1:04 AM
angularjs .. i have followed the example : stackoverflow.com/questions/19122942/… for sorting tables and no matter what i do, still by default the table is sorted descendinly
regardless of whatever i want to do
i even tried to sort the records ascendinly on the backend sql and still it shows as descending when the ajax call is made
 
@JoeSaad Do you have a fiddle, or something?
Though I don't know Angular, so I don't know why I asked.
 
@Retsam i'll try to put on in a fiddle fast.. i have no idea what is going on.. it looks so weird as if there's an issue in rendering
 
@Retsam i couldn't duplicate it in a fiddle.. but i just found the solution here: stackoverflow.com/questions/26928273/orderby-predicate
Thanks a lot anyways!
 
Hi all. Anyone know how to stop Node from returning straight away and instead wait until I've handled a POST request's payload so I know if I should return 200 or 400?
 
@BanksySan Not without seeing your code.
 
@SomeKittens Here's the question: stackoverflow.com/questions/26985096/…
It seems like such a simple thing, however, it's async, which is bad in this situation. How do peeps get around this?
 
1:51 AM
When is the examination finished?
 
It's done here: request.on('data', function(chunk) { });
However, ... response.write('Yup!'); response.end(); is run before this function has executed.
Currently, it just sets the validation variable to false.
 
@BanksySan Yep. JS is reading from top to bottom.
When it gets to request.on, it makes a note for later.
then it hits response.write('yup') and writes 'yup'
then it gets back to the aforementioned note
 
@SomeKittens Indeed... However, peeps must be able to delay responding until a result is determined. How's that done?
 
@BanksySan Well, the request is finished in the note for later.
 
@SomeKittens So you are saying to move response.end() into the data event handler?
 
2:02 AM
@BanksySan correct.
 
Is that method even guaranteed to run? A GET doesn't have a payload.
 
Sounds like a great opportunity to read the docs.
 
Or, just try it out...
Thanks for the pointer, that's enough for me to get going again.
 
 
1 hour later…
3:14 AM
Hey all, having some trouble posting to an Express route via jQuery, anyone mind taking a look at my question? Very new to Node/Express so probably something easy. :) stackoverflow.com/questions/26985821/…
 
4:01 AM
Hi. I have some problem to ask you. Can you help me ? My problem about print function in done function.
 
@user3001046 Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
print function is happen 2 time
first time , it's happen before columnize function finish
second is happen when i cancel print then columnize is working and finished print function is call again. How to show print function when columnize function is done
this is my code
<script>
$(function () {
var content_height = 856; // the height of the content, discluding the header/footer
var page = 1; // the beginning page number to show in the footer
function buildNewsletter() {
if ($('#newsletterContent').contents().length > 0) {
// when we need to add a new page, use a jq object for a template
// or use a long HTML string, whatever your preference
$page = $("#page_template").clone().addClass("page").css("display", "block");

// fun stuff, like adding page numbers to the footer
 
ASR
Hi can any one help me here jsfiddle.net/fmawb9zk/4
?
 
4:22 AM
I have a serious problem. I wrote a slim scroll plugin which works fine. but sometimes when the surrounding elements or text are selected and then the scroll bar is dragged. the plugin breaks.
                     ^
which event should I use which ignores the text selection when I am on the scroll bar element?
 
5:10 AM
@ASR do you care to explain your problem?
 
ASR
@RahulDesai got resolved thank u.. actually i am validating phone number using google libphonenumber
 
5:51 AM
hi guys .. anyone there ?
 
@Sajal Yep, good morning.
 
you are blessed, @Sajal
 
Yay, I'm gonna throw him into the river of Gandis.
 
6:06 AM
lol
 
m59
@SomeKittens oh snap.
My answer is gone again, and I can't find it at all.
So uncool.
 
@argentum47 I am on it :)
 
Finished Downloading
 
the default theme breaks though.
 
6:11 AM
Oh Snap
 
it happened twice to me
 
Firfoxxxx!! :(
 
@JesusChrist thanks :) GM
 
then it starts looking like the regular Firefox
the only good thing I found is that it has a link to WebIDE in the toolbar
 
6:13 AM
the developer tools is all what I need
 
Ehm, the standard firefox don't have the dev. tools?
 
These are nu
 
What about debugger, console, and all that stuff?
 
@JesusChrist it does but this one has it in the toolbar, next to the search box
its there too
 
6:14 AM
Stop being nostalgic Jesus, this is 21st century
 
can anyone please tell me some solution for this
0
Q: Testing javascript function within angular scope using jasmine

Alex ManI have created an application in angularjs, i have learned writing jasmine unit test cases for angularjs, but the problem is that in my application i am having both angular scope methods as well as normal JavaScript functions, when i wrote test case for that function i am getting the following ex...

jsfiddle.net/3oyg5Lt8 its a javascript jasmine test, but failing for local functions
 
eh!! its very black
 
@argentum47 Here at Nazareth we still use the Netscape browser
 
just hope that it stays black :P
 
need some help with this. when click on a div append a div below it. These divs contain images and texts and are so aligned that if it has big image then 3 post will come in a row or if small images then even 4 posts can also come in a row. My need is to append a div below the clicked one.
 
6:18 AM
So the ide is for writing firefox oz appz. I will make an irc client. and become the hokage of the app store
 
this is he reference link : visitstockholm.com/en
 
@Sajal ehm, and what's the problem are you experiencing?
@Sajal append the div by modifying the DOM tree.
 
@JesusChrist i cannot find a logic to this :(
 
@Sajal Do it yourself, using the examples, it's not that hard, really.
 
did you checked the reference link. if the row has a big image then this div is appended after the whole section.
 
6:21 AM
0
Q: use javascript to add div to page

Jay42I have a javascript that checks for navigator.platform and if linux armv6i (raspberry pi) I need it to add two divs (onscreen keypads) to the HTML page this is my javascript logic: function systemdetect() { systemname=navigator.platform; if (systemname.indexOf("Linux armv6l")!=-1) { syste...

 
@JesusChrist i want to do it myself just not getting the logic. Appending a div is simple. just check the reference once.
 
@Sajal please give the link again
 
@JesusChrist thanks. visitstockholm.com/en
 
@Gru wassup
This is 2014 AG. After Gru(enbaum)
 
@m59 what answer?
 
m59
6:24 AM
Only viewed 90,000 times. Not worth keeping around, I guess.
 
6:35 AM
@Sajal I think div is just aligned to an image height.
 
@JesusChrist yes. What we can do is get the max height and width of current row elements and then using width we can ount how many elements can be adjusted in a row then after the div, we can append new div. But problem is how we can know the element clicked is in which row ?
 
6:48 AM
@Sajal maybe they simply put them in a table.
 
@JesusChrist no but in table that structure cannot be maintained.
 
@Sajal well otherwise it's not that hard I think.
 
What are you trying to do?
 
@JesusChrist anyway thanks for your effort. :)
@Meredith check this reference - visitstockholm.com/en. Need the js logic for appending the div below.
 
# of tiles = # of rows * 5
Place the big tiles, fill in the blanks with 1x1 tiles
 
7:33 AM
Released stable version of scroll plugin :D
^ please file issues if you find any
 
can anyone please help me for one of my angularjs doubt
 
8:07 AM
gninrom doog
 
@AlexMan Don't ask to ask. Just ask.
 
I want to become a detective
fuck there is nothing in programming
 
@Mosho Happy Birthday :)
12
 
Happy birthday @Mosho! Get @BenjaminGruenbaum to offer you a beer
 
Holy shit! It's your birthday :O?
We should definitely go out to a beer tomorrow.
cc @SecondRikudo
 
8:20 AM
@BenjaminGruenbaum shame him at work
 
I'm not at work today, I'm at work tomorrow.
 
Send him flowers
 
Morning everyone
 
lol, from "anonymous fan"
Send him an express delivery of completely standard socks to the office :D
 
Haha
 
8:24 AM
not sure if real or not ^
 
Saw that on HN a few days ago
 
lol m$ certs so ez even 5yo get it lul
 
m$ r shit, linux rulz
3
Posted this on this FB wall:
 
hi all
 
8:35 AM
I cringe everytime I see code with variables starting with $
this is just uh.
this is a fundamentally terrible abuse of the naming to convey information that should be passed to the compiler.
what's even worse are linters that operate on names tagged as such, treating them differently
and effectively you create a language inside of language
 
@BartekBanachewicz had an argument yesterday with a PERL lover :D
 
I don't think you can get a reasonable argument with a Perl lover
 
He had arguments for $, in PERL you have other tokens that start a variable name, it's kind of like hungarian notation.
 
yeah, those are called sigils
 
(I hate it too, I think it's pretty stupid - also I don't think it's a huge deal)
 
8:37 AM
> huge deal
what is a huge deal then? I think this showcases a peculiar flaw of reasoning of a lot of people
hungarian notation isn't dumb just because it's weird naming; it's a much deeper problem
 
honestly I think both have their reasons. Visually separating variables from other keywords kinda makes sense.
 
I will make my own programming language, which will rule over all!
 
@BartekBanachewicz semantics.
If the semantics of variables are broken it's a lot worse. I'd rather use a JS without variable shadowing and redeclaration and with $.
I totally get what you mean, $ before variables is definitely smell. PHP does it because it made writing the initial parser easier :P
 
@AwalGarg how it will be different from other programming languages that will rule over all?
@FlorianMargaine why does that have to be done inside of the source code instead of letting the syntax highlighter do that? It's all backwards
@BenjaminGruenbaum What do they signify in Angular?
 
@BartekBanachewicz syntax highliting variables is actually pretty hard to do. Many IDEs don't know how to highlight them. Same color? Differing ones? Group them? etc etc
 
8:50 AM
@FlorianMargaine Here, unfortunately, we go back to static typing; IDEs for statically typed languages don't have problems with that. Also, if you need a "$" before, you need a visual distinction, right? Well then, colour is perfect. Or italics. Or underlines.
 
@BartekBanachewicz just saying that visual distinction isn't bad.
 
@FlorianMargaine I'm saying that it's bad if it is contained within variable names your compiler doesn't understand. Ironically Perl treats variables that start with a different sigils differently.
 
@BartekBanachewicz why is it bad?
 
What Perl does? It isn't.
I lack name for that... Significant Naming, perhaps?
That's not bad per se, I agree.
What's bad is using $name for jQuery variables (IMHO, but that, again, exposes the flaw of JS, not the method in particular)
 
uh?
that's just a naming convention
 
8:55 AM
@FlorianMargaine I think it's a much worse annotation than type.
Consider:
var a = 5; // language a - dynamically typed
var a = 5; // language b - statically typed

// let's improve the a-code a bit
var $a = 5; // $ signify ints from now on - uh.
var intA = 5; // maybe like that? well, uh.
var ia = 5; // yay hungarian

// what you can't do?
int a = 5; // obviously
var a = 5; // the same as language b, but with lower guarantees.
 
@RoelvanUden sorry for the delay ...went for the lunch
 
replace "int" with jQuery and you get my problem with that
 
this is the question @RoelvanUden
0
Q: AngularJS - jasmine test cases for user defned lodash functions

Alex ManI have created an application in angularjs and lodash, the application is working fine, Also i have also learned writing test cases for angular js, Now the problem is that i have created my own lodash methods which i am using in angular controller, can anyone please tell me how to write test case...

@RoelvanUden i am defining some user-defined lodash functions.....how to write test cases for that using jasmine
 
@BartekBanachewicz in Angular?
 
@BenjaminGruenbaum I was looking at Angular code using it and that prompted this discussion actually.
 
9:03 AM
Oh, you mean $stuff in Angular? It's "this is framework stuff, use it with caution" - it's like _ for private, they use it in their static analysis tests. It's not required but they have tried both ways and found people find the $name easier than ngName
 
why not ng.name?
oh, wait, it's passed to functions.
 
Because it's modular, things are injected by name, in order to save code-repetition Angular uses variable names for depencency injection. Angular also has a global injector (bad)
 
I don't like that design choice, but I see why they'd made it - when you go read a code if it starts with $ you immediately know where the docs are, where the tests are etc. Of course what they should have done was static analysis, problem is no IDE or editor let you do that when they started and a lot of people use sublime or other thin editors.
You'd actually want control+click to go to definition. Angular DI is really nice though, they solves a hard problem in a very hacky but very useful way.
 
"hacky, but useful" - incidentally that's what MVVM seems to me
 
9:07 AM
Angular is not MVVM, also - I disagree, also I agree.
MVVM has some inherent problems (it doesn't scale well), but it is indeed very useful.
Also - that's not really related here since Angular doesn't implement MVVM
 
@BenjaminGruenbaum I know. I was just hacking around WPF yesterday, and now you used that phrase it came to mind
 
guys, i'm parsing an attribute, in which i get the "scale" value (something like "1.3000 or 1.2000"), but this is Not a Number (NaN value)... i have to "convert" it to an int...
tried "parseInt(myNaNvalue)" but still "NaN" result...
 
@Julo0sS you can't represent NaN in an int
 
@BartekBanachewicz guy who came up with MVVM said it doesn't scale :D
 
@BenjaminGruenbaum frankly I see it as another shitty design pattern right now, altough I think I don't know enough about it
 
9:10 AM
I think it's in practice a very nice pattern that can be made to scale if you can separate orthogonal components well into encapsulated oopish components. I would not use it for lots of stuff. WPF is pretty good though.
 
@BartekBanachewicz somehow, i got it as an int value before i put it into "scale" attribute of the svg... so, it was first an integer, and then, as i get it back from a "string" attribute, it's interpreted as a NaN...
 
MVVM is not a design pattern, it's an architectural pattern. Also, compared to all other technologies WPF is one of the easiest ones to use for UI.
 
@Julo0sS well then, your values are wrong.
@BenjaminGruenbaum which is exactly the same, albeit concretized
an architectural pattern is a pair of (design pattern, its application)
 
No, it's a lot more vague.
I disagree, a design pattern dictates design - actual components and their relationships. An architectural pattern usually indicates the broad layers of a subsystem or a system itself.
It's not a good argument, by some definitions you're probably right and it's not an interesting argument since it's about how patterns are defined.
 
yeah it's a boring argument
talk about haskell vs lisp instead
(hint: haskell sucks)
@BenjaminGruenbaum how's the contest going?
@BenjaminGruenbaum did you learn lisp?
 
9:15 AM
Going good, we needed 100 likes and there are 78 so far.
Clojure, it's fun.
I don't know it very well.
 
no, the value "was" good... i "calculated" the scale value from the default one (1) and the mousewheel event, which gives me a value like "1+0.x", here in my example it was 1.3000... (so it's a float or something, but at that time, it was not really important) then i put it into a tag attribute this way : ...setAttributeNS(null,"transform","scale("+myScaleValue+")");
so, the value is there "as a string"...
Later, i need to get it back, so i get the attribute : ...getAttribute("transform")...
And parse it to get the value into "(" - ")"... what i get there is a string that looks like "1.3000
 
@BenjaminGruenbaum I am not inclined to press this further too.
@FlorianMargaine lisp is too powerful to be useful :)
 
@BenjaminGruenbaum it's a usual feeling when starting a language
 
That's a good feeling to have :)
 
and.. I don't like clojure... too many [\[\]{}]...
 
9:18 AM
Clojure is the most practical lisp nowadays, though, no?
 
where are my parens!#@!1
@BartekBanachewicz yes and no
the usual argument is that it can reuse java libs
but abcl can do that already...
it just had more hype than CL
 
@FlorianMargaine come on, they really do clutter code. (now you know how ($) works, you are obliged to agree :P)
 
@FlorianMargaine I know it's not lispy of me but I'm loving ->
 
@BartekBanachewicz nah... I understand how haskell works, doesn't mean I like it
I like the model of evaluation
@BenjaminGruenbaum heh
 
@FlorianMargaine lazy-by-default?
 
9:21 AM
I don't really like everything-lazy-by-default
 
a.k.a. why Haskell functions aren't functions :P
 
@BartekBanachewicz no... choosing when a function is evaluated
 
@FlorianMargaine um
how is that not the same?
 
lazy evaluation, you let the compiler choose for you
non-lazy, you choose when to evaluate
 
well //cc @BenjaminGruenbaum
this is literally prelude :P
 
9:24 AM
Not sure how that has anything to do with what I said ("by default") but sure :P
 
@BenjaminGruenbaum I think giving the compiler more room for optimization is good
also there are drafts of StrictByDefault extension
 
@BartekBanachewicz sure, and languages do that, C# does it with Lazy<T>, F# with lazy, so does scala. I don't think it models our default intent very well.
 
@BenjaminGruenbaum I typically want my code to produce values when I need them, or, in other words, I don't want to have to think about when they are produced
there we go.
 
I dont feel like working today.
 
You keep arguing against something I didn't say: I don't like how it's the default, in a lot of languages it's opt in.
 
9:27 AM
yawn
 
@BenjaminGruenbaum You also have never produced an example of where it's bad
I haven't had a single problem with it so I really don't get your gripe
 
@BartekBanachewicz where laziness is bad?
 
@BenjaminGruenbaum well I do know where it's bad, because I've seen numerous codebases with bangs littered all over them; but those are mostly high-perf situations. You were saying something about web dev and I don't see how it could apply in your usecases
 
I don't recall complaining about laziness in web. I use laziness all over my code in C#, and I use it when I code in other languages. I don't think it's not valuable - to the contrary - I greatly value it.
I just don't think it's the obvious mental model of how I reason about things. That's true for other things in Haskell too.
 
@BenjaminGruenbaum that's because you're used to constructing other models. That doesn't mean haskell is counterintuitive :)
 
9:35 AM
I'm a 'classic' Haskell client. I do math at least as much as I code. I think in mathy functions, I like functional aspects of coding etc. I like haskell and find it intuitive in some aspects - it's just some stuff is harder to reason about.
 
like what?
 
hi all
 
I mean your experience seems to be strangely different from mine
After I started really using it, going back to "classic" OOP feels extremely weird
it all seems really complicated compared to the simple data definitions and functions on them
 
write C :)
 
yeah, right :P
 
9:38 AM
well, C is just that: simple data definitions and functions on them
 
except the only data definition you are able to create are integers, structs of integers and arrays of integers, which are actually stored as integers
also it's all unbelievably cluttered with memory management
 
uh?
are you saying that char is just a hidden int?
 
what uh? Have you never programmed in C?
@FlorianMargaine it's an int of different size, wow. How (un)helpful.
 
well, it's the same in haskell if you reason that way. Or in any language.
 
@FlorianMargaine ADTs aren't ints.
 
9:40 AM
@BenjaminGruenbaum I honestly don't know I would be able to today
 
I'm pretty sure they are behind the scene
 
I'll know later today
 
if you just use the typing system, you don't see them as int
 
@FlorianMargaine you don't see that. In C you are behind the scene
 
27 secs ago, by Florian Margaine
if you just use the typing system, you don't see them as int
 
9:41 AM
yeah, and C doesn't really have a type system
 
@BartekBanachewicz can't argue with that
 
@BartekBanachewicz ok...
 
@FlorianMargaine try writing an Either type in C.
(yes, it's an incomplete type)
everything you can do is return integers and act basing on their values
 
@SecondRikudo talking about tomorrow
(we're)
 
9:43 AM
sure, you can model the same behaviour with that, but it's either unsafe or again, awfully cluttered
 
Tomorrow's awesome
 
@BartekBanachewicz no one likes "classic oop" but old people and undergrads :D
@SecondRikudo Great, talk to Mosho
 
@BenjaminGruenbaum that includes this MVVM gimmick
at least for now
 
@BenjaminGruenbaum Does he have Hangouts? Or is he not one of the cool kids?
 
mmvm trick is not a classic oop trick for what it's worth.
 
9:44 AM
unless I conclude it's The Big Thing
 
@FlorianMargaine anyway memory management is enough to make this unbearable vOv
 
9:52 AM
@FlorianMargaine altough C can be funny
 
@BartekBanachewicz you're missing the terminating char
 
Guys, is Flurry better than Google Analytics?
 
yes/no/maybe
 
@FlorianMargaine yeah that was the broken version. lol C.
it would be a compile-time error in Idris :P
 
I don't even know the name
 
10:06 AM
@FlorianMargaine Idris is eager-by-default, purely functional, statically and dependently typed language similar to haskell
 
sounds boring
 
Pls help...
console.log(typeof(event.offsetX)); // "number"
console.log(typeof(parseFloat(scale))); // scale is at beginning a string containing a float value like : "1.3000". Type of returns now "number" with parseFloat
console.log((event.offsetX)*(parseFloat(scale))); // "NaN"

what am I doing wrong?
 
I think I'll be porting numpy to JavaScript. What do you think?
 
@FlorianMargaine Why? Dependent typing is very interesting.
@BenjaminGruenbaum what for?
 
A university project. Also I think it could be really good to be able to use it in Node, also I think that it would force me to understand numpy better
 
10:19 AM
isn't numpy mostly C extensions?
 
@BenjaminGruenbaum that assumes it's good to use node in the first place, no?
 
yeah
@BartekBanachewicz it assume there is a use case of people using Node or being most familiar with it and want to be able to do ML preperly
 
ML
who said ML
 
@BenjaminGruenbaum you want to do C++ modules for node?
 
A lot of people use numpy for ml.
 
10:22 AM
@BenjaminGruenbaum whoosh
 
@BenjaminGruenbaum a simple module if you want an introduction
 
@BartekBanachewicz not that ML
 
Thanks, appreciated.
:p
 
(it's not a finished module, far from it. But it has the bindings.)
 
10:24 AM
It's still useful to look at, I have to understand how numpy is built to begin with. If I can use emscripten and run it in the browser that'd be fun
 
@BenjaminGruenbaum @FlorianMargaine @BadgerGirl thanks :>
 
@Mosho do people in the office know?
 
yeah, we are having lunch
 
@BenjaminGruenbaum make sure they know
 
@Mosho cool, say hi
 
10:31 AM
fb ratted me out
 
heh, cool
 
definitely up for a beer
hmm, when did I lose owner status :O
 
@Mosho I'll update you on that tomorrow :P
 
:o
 
Hi guys, small question >.<. I'm trying to select an option(points) in the element 'polygon' of svg's. I've tried to do it like so but of course it's incorrect, could anyone tell me how I should do it instead?

var points = value.options[polygon.selectedIndex].points;
Oh and value is a variable that holds the value of an input field
 
10:44 AM
right
 
@DavidH did you try to debug?
 
I'm pretty sure i'm doing it incorrectly, am I not?
So i'm not sure if debugging even has effect
 
no idea. But debugging would let you know what you could do.
 
I've moreso tried to look up how to actually do it
But i'm kind of certain that i'm doing it wrong
 
I mean... do you know how to use dev tools debugger?
 
10:57 AM
You mean console.logging for mistakes or checking on which line the mistake has been as well as fixing it?
 
!!tell DavidH google chrome developer tools debugger
 

« first day (1494 days earlier)      last day (3460 days later) »