« first day (1321 days earlier)      last day (3633 days later) » 

11:05 AM
Anyone any good with angular js? stackoverflow.com/questions/23931846/…
 
@NatZimmermann $http returns an object
...
You can use $q.all with that
eg
var one = $http.get(...);
var two = $http.get(...);
$q.all([one, two]).then(...);
 
@Miszy Thanks! But how would I use that in an array of unknown length?
 
@NatZimmermann What do you mean?
 
@Miszy So I have a for loop like in my question, and I push the result of each one to an array. In $q.all() what argument do I use to include all of the array's promises? Could I use a for loop?
 
@NatZimmermann My questions is: Why do you make several requests to the same API endpoint?
It's always $http.get(url)
 
11:12 AM
@Miszy Ah I just changed it for the example, it's a different url each time
 
Okay
var arr = [];

for (var a = 0; a < subs.length; ++a) {
    arr.push($http.get(url));
}

$q.all(arr).then(function (ret) {
    // ret[0] contains the response of the first call
    // ret[1] contains the second response
    // etc.
});
 
Ok I'll give that a shot, thanks! I'll report back if it works or not
Any reason you use ++a rather than a++?
 
No.
 
@NatZimmermann If you aren't immediately looking at the result value, no reason for one over the other.
 
I mean: yes. In some languages the first one is faster than the other.
 
11:15 AM
a = 42;
b = a++; //b is now 42, a is 43.
c = ++a; //c is now 44, a is 44.
 
Because the postincrementation function has to do a copy of the value, increment the original one and return the copy while preincrementation returns incremented value.
So as a rule of thumb I recommend using preincrementation.
 
@Miszy I wouldn't know about that :P
 
@Miszy Thanks! It worked perfectly!
 
My code generally doesn't have actual incrementations
 
@SecondRikudo actual incrementations? So you don't generally use a loop?
 
11:19 AM
@monners Not one that requires me to increment a variable, no.
 
@NatZimmermann You can accept my answer ;)
 
@SecondRikudo 100% functional, eh?
 
My work is almost exclusively with objects, I loop over iterators, which don't use incremental.
@monners OOP more than functional
 
@Miszy Yeah just had to wait like 30 seconds
 
Although the two have more in common than most people realize.
 
11:21 AM
@DrogoNevets Because it isn't your company?
 
Interesting. I'd love to see your code
 
@Neil its my motorbike
 
@DrogoNevets Oh, nvm
 
@monners I do PHP mostly, when you iterate a "collection" (either an array, an Iterator or a Generator), you use the foreach loop.
And the foreach loop doesn't need a counter
 
I'm suddenly less impressed
 
11:31 AM
Heh, the same applies for JavaScript too
Or Java, or whatever
I also have very little ifs in my code
The only place where I might actually have a loop with an actual counter is at the very very edge of the code, right before I output, or right after I get input
But inside the logic, I have very few ifs or fors
 
foreach is syntactic sugar for for loop in most cases
 
@Neil Not really.
In PHP, numbered arrays are linked lists, so no for loops there
 
@SecondRikudo The main difference being that it guarantees you have a collection of something
 
@SecondRikudo Really? So $x[$n] is O(n)?
 
Does any one know, how they are generating the graphs at https://sublime.wbond.net/ and https://sublime.wbond.net/packages/jQuery%20Snippets%20pack. I mean if anyone knows of some plugin or something that might help me generate the graphs similar to those?
 
11:33 AM
@copy I honestly don't know.
I'm no internal PHP expert.
 
That's hard to believe
 
Hi everyone!
 
@copy You're welcome to ask on the PHP room. We have core devs there.
 
Yeah, hash tables
!!s/linked lists/hash tables/
 
11:37 AM
@SecondRikudo In PHP, numbered arrays are hash tables, so no for loops there (source)
 
Wouldn't surprise me if php creators decided linked lists were superior and used only them where an array would be used
 
@Neil Don't forget that arrays in PHP have no size limit
 
I intrinsically cannot trust a programming language that decides on my behalf whether or not I want an array or a linked list, regardless of whether or not they are right
 
How do you implement that with a normal array? You can make an object that copies the array into a bigger one each time, but I don't know how efficient that is.
 
@Neil It's not a linked list, it's a hash table. Same story as JavaScript, although most engines optimize it and use an array internally
 
11:39 AM
@SecondRikudo You can't, though most times you don't deal with arrays, you deal with vectors
@copy Hash table isn't necessarily optimal either
 
@Neil You should try one of the more well-crafted scripting languages like Python or Ruby then
Of course not, not even close
 
Well I meant for what you're using it for
If you want quick lookup, hash table is ideal
If you don't need it, you probably want a vector, though not always
 
If you want quick lookup by a small number, a plain array is ideal
 
linked lists are better if you want to push and pop a lot, or if you're holding so many values, a continuous array of memory is not likely
a lot of the memory managers in C++ involved linked lists containing blocks of memory
Thank god I never had to program one though
 
@Neil once I had. Not too hard
 
11:44 AM
@JanDvorak It's not hard if you're giving the caller those blocks of memory
If you have to alloc small pieces, it begins to get complicated
Did you have to do it that way?
 
yep
also, performance wasn't an issue
 
Ouch, well I don't envy you
That's usually why you implemented such things in c++
 
I just had a linked list of block headers, where each block could be empty or full. The first empty spot was always given out when asked for space.
 
If I'm not mistaken, you had to write to the memory, otherwise windows would give you a lazy pointer that would get instantiated when you tried to write to it, which wasn't good for the memory manager :P
 
I didn't care about that, but writing to a memory is easy ;-)
 
11:46 AM
My old boss rewrote std::string because he thought he could make it faster 8(
He was right, it was faster. It only caused us to exceed development time by several months
 
@Neil was it? O_O
but hey, several months' not bad
 
@JanDvorak Yeah, for the specific circumstance we were using it for it was
several months isn't bad if you plan for it :)
You wouldn't believe the kind of hell me and my team went through
The actual development wasn't the hard part.. it was the rest.. making it work with the existing program, fixing bugs (sometimes major performance issues)
 
@Neil I see you talking, but all I can think of is rat on cat head. Rat on cat head. Rat on cat head
 
I would consider that a mouse, actually
 
r - white rodent (anonymouse)
 
11:52 AM
It's a rat. Trust me.
 
they usually have the rope-like tail
 
Mice don't get that big.
Plus I owned a rat just like that
 
Maybe you owned a mouse just like that . . .
 
That's definitely a mouse
 
As a widely recognized authority on rodent identification, I can confidently attest to the species of that creature.
 
11:56 AM
*20 minutes later* NO, YOUR MAMMA'S A RAT!
 
12:10 PM
hello all!!!!
 
Help vampire in 3..... 2..... 1......
 
@monners where where we'll drive a stake through it's heart!
 
*shrugs and plunges stake in @vimes1984 heart*
 
@neil harsh....
 
@vimes1984 Apparently your website has been suspended for violation of terms and services
 
12:13 PM
Well you're not actually dead
 
@monners yup :D
 
@vimes1984 You say that like it's a good thing
 
party hard or go home
 
no not a good thing persay not particularly bad either I don't really care either way
it was blog from my angsty youth...
 
@vimes1984 And yet you find it worth sharing
 
12:18 PM
nope
 
@monners Well you did bring it up
 
I didn't ask you to go prying
 
can any one suggest me how to use convert fusion chart with other html to pdf ?
 
@Neil Fair call. Still...
 
@BenjaminGruenbaum It went well, Gilad said he will schedule a more technical interview next week if possible.
 
12:19 PM
@vimes1984 Reading public information isn't prying.
 
@Mosho cool :) What did he ask you about?
 
@kendallFrey yes it does
that pries; looking or searching curiously.
is this beat on me day! all i said was hello all!
 
@vimes1984 So viewing your SO profile is prying?
 
@monners where you looking or searching curiously?
 
@BenjaminGruenbaum the specifics of my situation, and my experience
 
12:22 PM
On the information you published publicly on the internet.
 
and compensation :X
but nothing technical
 
@vimes1984 Are you suggesting that one of those things is a malicious act of unethical prying?
 
@KendallFrey In 20 years, near nothing will be prying technically
 
!!afk uni
 
wow, I had no idea text to speech already worked in html5
 
12:23 PM
@Neil Have you tried using a crowbar?
 
To pry on someone, you'd have to go to someone's house.. something that you could do just as easily using facebook anyway
 
I didn't bring mention malicous or unethical prying is neither
 
var msg = new SpeechSynthesisUtterance("I will not buy this record, it is scratched");
window.speechSynthesis.speak(msg);
 
would like to know what ethical prying is
 
@Neil Dentists do that all the time!
 
12:24 PM
@monners It's not ethical especially when a dentist does it
 
And yet we pay them to do it...
 
The thieves..
 
so hows monday treating people?
 
Is that a poor excuse for a troll?
 
@monners your site could use some minimizing...
 
12:27 PM
@vimes1984 How dare you!
 
I dare i dare!
 
@vimes1984 your site could use some content, less wordpress, and less "unavailable" notices
also, minimizing.
 
@rlemon we've covered that.
 
no it's quite fine thank you
 
Careful not to pry
 
12:28 PM
but I want to pry
 
@monners hahahaha
 
@vimes1984 why is it fine. 30 words or less
 
Here's a crowbar
 
GO!
 
I thought I'd join in the baiting
 
12:29 PM
 
@vimes1984 Eastern European?
 
ugh. fucking watermarks.
 
@monners American?
 
Nope
 
I'm not eastern european either
Welsh
 
12:30 PM
monners is shakespeare
 
Close enough
 
yup you was only of by a couple of hundred miles
 
Douth my ignorance offend thee?
 
nope I like bread....
 
:sigh:
 
12:32 PM
hey!
 
my thoughts exactly
 
@BenjaminGruenbaum in the Liquid paper, they concluded that annotations took 5% of the code size (for a complicated example)
 
@rlemon ok 30 words (1)my (2)site (3)is (4)fine (5)in (6)it's (7)inexistence
 
now, is 5% big or small
 
On that note, I'm going to bed.
 
12:35 PM
no(1) it(2) is(3) not(4) you(5) babbering(5.5 not a real word only worth half) fool(6.5)
damn, you scored better. okay you win.
 
Quitter
 
blathering*
 
for a 20-line function, its signature is 5%
 
@rlemon We really gotta get drunk TS back up and running
 
@rlemon I would have just called me a twat that's one word and it about sum's it up
 
12:36 PM
@BartekBanachewicz Small
 
@vimes1984 There Was A Tiger!
!!s/[a-z]+//g
 
@copy ah, they only counted (now I saw that) the dependent annotations, not the remaining necessary interface type annotations
 
@rlemon @1984 T W A T! (source)
 
eh, close enough.
 
@rlemon better than i could have done
 
12:37 PM
well I think that Benjamin might have a point in that formal specification of liquid constraints is... hard
most of the programmers can't write statically typed code, and requiring that and full dependent annotations...
 
anyone ever installed PonyProg on Ubuntu?
 
@BartekBanachewicz Can't?
Or don't want to?
 
nope
 
@BartekBanachewicz big
 
there website fucking rocks though
reminds me of another one i found a while back
 
12:40 PM
@copy can't. If they could, they would.
 
now, it can be both of "can't because language doesn't allow" and "can't because they are not capable of"
 
now that pages can use speech synthesis - who is interested in a userscript that will read this chat out loud as it goes?
 
@BenjaminGruenbaum I am thinking... shouldn't we acknowledge the fact that there's a place for lower-quality software?
 
how to remove disabled from a button when an radio is clicked?
here's my fiddle. http://jsfiddle.net/29Ae3/1/
 
12:43 PM
@BartekBanachewicz The former would be: Don't want to, and therefore choose a language that doesn't force them to
 
@copy not everyone choose their language freely.
I mean, in a way, people who choose to not use static typecheckers in order to deliver results faster, actively agree that they lose some guarantees.
You accept the fact that the code can potentially contain bugs.
 
Yes, with the advantage of faster prototyping, and some more things
 
Well, prototyping is a good example. Or rather, if would, if the code was later refined with static annotations.
 
quick question: if a DOM node doesn't have a classList, is it because it's a text node?
 
for me, it's a bit silly. Write code that has static errors, run it to test, fix the static errors by the means of fixing runtime errors, ship
at the end of that phase, you're left with code that mostly or fully statically checks, but you don't check that
and then you add more code and break the state again
and then again pay the price of fixing the static errors trough dynamic ones
I am wondering how the fuck this can be more effective in practice.
 
12:51 PM
Are you talking about a specific statically typed language?
Or an imaginary perfect one?
 
@BartekBanachewicz of course, why?
 
@BenjaminGruenbaum dunno, it's a bit... off. I've always tried to write the best quality software.
 
Never underestimate the value of working code :)
 
having to acknowledge the possibility of bugged code being ultimately a better solution because it's provided fast and working is still uh
@copy above? that's a dynamic scenario
@BenjaminGruenbaum what about bugs-to-be-discovered
what about things that will break in the unknown future
 
@BartekBanachewicz then it's not working code.
 
12:56 PM
no, it is.
sometimes there are scenarios you don't test because something
because you don't even think about them
 
Our whole disagreement really amounts to the fact you think that statically typed languages allow me to find those bugs and I disagree.
 
it allows you to find some bugs.
dependent types push that much further
 
@BartekBanachewicz I mean, you're not seriously suggesting that we start using C++ or Haskell, so what is it?
 
I never had a big bug in a dynamic language like JS or Python that would not have happened in a statically typed language.
I had lots of small ones, nut never a big bug.
Hard bugs aren't about having the right type of arguments, they're about having incorrect logic.
 
I am having "oh shit undefined" constantly in JS
 
12:58 PM
Which again - my argument is, you can't reasonably type check behaviors in a way that doesn't make you want to hurl, and I tried Eifel with only the best of intentions, trust me.
@BartekBanachewicz how?
 
Eiffel is an overkill
 
@BartekBanachewicz That has nothing to do with dynamic typing though
 
Like, seriously, how are you having "oh shit undefined" constantly in JS?
 
@copy uh, it does.
 
Not criticism, honestly asking.
 
12:59 PM
@BenjaminGruenbaum I forget to return, for example.
 
@copy @BartekBanachewicz thinks that typing enforces behavior.
 
any help regarding
0
Q: Angular , page loads again and again

Jatt.neti have a simple project of angularjs. Problem after login when i redirected to login.html , it continuously sends request and page is reloaded again and again please help following is code demoangular.js Angular js <script src="Scripts/jquery-1.8.2.min.js"></script>...

 
@BartekBanachewicz lol, really?
 
@BenjaminGruenbaum yes.
 
I forgot to return in Python the other day, printed instead :D That was fun for about 5 seconds until I got a warning and fixed it.
 
1:00 PM
@BartekBanachewicz If you search for an element in a list, you have two cases: The element exists, or it doesn't. You can forget to handle the latter case both in a statically and in a dynamically typed language and get runtime errors of some kind
 
@BenjaminGruenbaum In C++ and Haskell that's a hard error.
 
About the same warning I would have gotten in C#, only C# compiles so much slower than JS executes.
 
in JS that's nothing.
@copy you can't forget that in a static language
 
That's implicit undefined return though, not dynamic typing. You could have had that error just as well in Scala.
@BartekBanachewicz of course you can :D
 
@BenjaminGruenbaum then it's a shitty language.
 
1:01 PM
@BartekBanachewicz in JS that's a typeerror in your test.
 
find :: pred -> [a] -> Maybe a
 
@BartekBanachewicz lol, no it's not, it just returns the last thing since everything is an expression.
 
@BenjaminGruenbaum yes. And its type doesn't fit the function return type, if you forget to return.
 
@BartekBanachewicz sometimes.
 
sometimes, yes.
 
1:03 PM
Also, you can always opt in and annotate in JS if you want to, there exist static analysis tools, you people just usually don't make such mistakes.
 
awww
I missed flags?
 
@BartekBanachewicz I know you can't forget it in Haskell, but … it's Haskell
 
I don't know what to respond to that.
well, maybe that that Java 8 has Optional
C++17 will probably have optional<> too.
 
I find it very enjoyable too, but just not usable for things I want to develop
 
what is blocking you, if I may ask?
 
@BartekBanachewicz It's hard to say, I can't model things in a functional way when it comes to IO
It's not complicated compared to other languages
 
I think that Promises are showing that functional IO paradigms are usable.
 
Also, writing some things the "imperative" way is shorter, easier and more readable. For instance swapping two elements in a list
 
@copy well, haskell doesn't really prevent you from writing imperative code
do is essentially an imperative block
one might say that imperative programming is in the core of Haskell :P
 
I think the difference between @BartekBanachewicz and @copy in this discussion is that @copy has actually written code in Haskell :P
 
1:13 PM
and I haven't?
that's new.
 
That's implied from the sentence. I believe.
 
Irony?
 
I'm not sure, there has to be a clever linguistic name for it.
It's not just subtext, there is a better name for this.
 
lemme even change that link to point a finger
 
@BenjaminGruenbaum By the way, I have implemented Minesweeper in Haskell
It sucked
 
1:17 PM
@copy I thought it blew
 
@BartekBanachewicz So apparently, it's a "Conversational Implicature"
 
you had to really work on insulting me, heh :P
 
No, I was genuinely curious how that's called :P
 
I think it's called a paraprosdokian
25
Q: Is there a name for this type of insult: "I am friends with many manly men. And Gary."?

MrHenIs there a term or word appropriate to describe the trick of using a general term and then explicitly adding a specific term to strongly imply that the specific is not part of the general? The trick I see never uses a negation or a word like "except." It simply "adds" something at the end as a sl...

The classic example of a paraprosdokian is: "I've had a perfectly wonderful evening, but this wasn't it." — Groucho Marx
 
EL&U is a really shitty site to be fair, most linguists I know make fun of it from time to time :P
It might actually fit here though
 
1:22 PM
Meh, I'm no linguist
 
@BenjaminGruenbaum it's a great breeding grounds for indian spam, though.
 
@JanDvorak then again, so is Stack Overflow.
Boy, you really stuck to those holiday hats @JanDvorak
 
@BenjaminGruenbaum You know, I hate spam.
 
@JanDvorak its alright once you get used to it and realise its that or dog food
granted the only difference is one is labeled dog food the other isnt, but allows you to pretend its not dog food
 
I think I'd prefer to live on a staple of ramen to spam
I think it is cheaper as well
 
1:26 PM
!!google ramen
 
aside from the appearance of spam, I'm pretty sure you'd get tired of it quickly enough
 
Salmon is good too, but I can't eat it more than once a week (assuming I could afford it)
 
atm i think im eating spam, my motorcycle maintenence bill is eye watering
 
I read that wrong.. I read "my motorcycle maintenance bill nye watering" and went "wha?"
 
1:33 PM
oh dear, someone get @Neil some glasses
 
@DrogoNevets why would I need molasses?
 
** shakes head in despair **
 
@Cereal 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.
 
user1596138
@rlemon :)
 
Who's **** did you have to suck to get unbanned?
also, o/
 
1:41 PM
banned? Jhawins? Why?
 
huh??
 
user1596138
@rlemon AndrewBarber is actually a really nice guy.
 
ohh he is. :)
most mods are pretty chill
 
@Jhawins what did you do?
 
except that @ThiefMaster guy. he's a reall jerk
 
user1596138
1:43 PM
He just didn't realize that it was all jokes at first. And then told me I should probably crank it down a bit haha
 
@Jhawins how long were you banned for?
 
user1596138
!s/'s.*/ jerks off a lot/
 
user1596138
@DrogoNevets Like an hour or two lol.
 
user1596138
Was going to be 7 days :(
 
what for?
 
1:46 PM
Swearing
 
@Jhawins naughty naughty
did you manage to hear about my bike and it being poorly?
 
how reliable is document.body.addEventListener("online" ... or ("offline" ...?
should i try to implement offline web app support with THAT, or by checking for HTTP codes?
 
!!caniuse ononline
 
caniuse: ononline
 
i see that. but, i feel better just setting a filter when checking my HTTP response code.
would something like
if (resCode >= 400) { //handle offline }
work?
is that a proper filter? too inclusive? not inclusive enough?
 

« first day (1321 days earlier)      last day (3633 days later) »