« first day (1648 days earlier)      last day (3283 days later) » 

9:04 AM
I have a project in which there is a requirement of both pre-compile and post-compile of templates
I am doing post-compilation using lodash
I am planning to do pre-compilation using gulp
would that be good?
 
I'm assuming two different template engines?
Otherwise that sounds messy
 
no, lodash is template engine
but gulp is a task runner
 
I know what they are. Why do you need to compile the templates twice?
 
suppose, I have a dropdown whose code is same in all the templates
I want to keep it as entity so that I can reuse the same again in all the templates
this can be done using pre-compilation of the templates
The pre-compilation will add that entity/module's code in the templates wherever necessary
 
So the dropdown is a partial?
 
9:08 AM
means?
 
strictly speaking, stackoverflow.com/questions/14184447/… is off-topic correct?
 
yes
 
Would've thought partial is self-explanatory. It's a snippet of code, that can be included
 
> Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
 
came across that when search for way to validate from my page if my firefox extension is enabled in it.
for plug-ins, it is easy just navigator.plugins, but extensions are proving to be tricky
 
9:13 AM
@BenFortune yes it is partial
 
9:59 AM
Strictly speaking, off topic yes, but I think we as humans (well, you are humans; I am a sheep) can make intelligence decision on what tends to attract opinionated answers, and what are useful questions.
 
Anything can attract spam. it's mostly a matter of how plausibly deniable it is.
 
user2985029
sometimes certain posts look like they were posted for no other reason than to accommodate spam
 
how can I bring all changes from one branch to another branch within the same repository in Git ? Like Cherry-Picking ?
 
git cherry-pick branch-name
or really, git merge branch-name
 
Cool. My adblocker on Gmail reads ">1K"
 
10:04 AM
@FlorianMargaine so I would call cherry-pick from the destination branch and target the branch I want to pick from ?
 
@jAndy why don't you just merge the branch?
 
@FlorianMargaine I don't want to merge all changes, only from a specific commit
 
> how can I bring all changes from one branch to another branch
rephrase then
 
its like we're having different states of our software, version branches etc.
so far I'm working with good ol' patch files
which pisses me off
 
if you want to bring a single commit
go to the branch you want to merge the commit to
and git cherry-pick commit-hash
 
10:06 AM
yea that sounds promising
 
which will merge the commit into the current branch
 
You want to bring a change (not all) from one branch to another branch.
 
fatal: bad object 9a21ac204a05be5cbfab9882a039b4caf7935cea
if I call cherry-pick from the destination branch
 
what did you type?
 
git cherry-pick hashfromabove
 
10:10 AM
git show 9a21ac204a
what does that show? ^
 
do I have to specify the src brnach somehow
 
@jAndy No
 
fatal: ambiguous argument '9a21ac204a': unknown revision or path not in the working tree.
 
are you sure that it's the hash of the commit in the other branch?
 
10:11 AM
eehh thats what git log told me on the src
commit 9a21ac204a05be5cbfab9882a039b4caf7935cea
Author: andreas.goebel <andreas.goebel@interred.de>
Date: Tue Apr 21 11:51:59 2015 +0200
 
in the same repository right?
 
yes..
and I have multiple checkouts
 
what?
multiple checkouts = multiple repositories in git
if you don't push the commit to the other repository, it won't work
that's what the "decentralized" part means in DVCS
 
@jAndy By "multiple checkouts" you mean the commit is on a remote location?
 
I have multiple checkouts in different folders from the the same repo
 
10:14 AM
each repository is standalone
 
@jAndy Okay, but each repo is standalone
They aren't inherently connected.
 
yeah you did something like git clone --branch foo bar; git clone --branch baz bar
then you committed something in foo, and you want to cherry-pick a commit into baz
 
its like one remote-repo and multiple local repositories
so I can't cherry-pick over those ?
 
@jAndy yes, and you need to push/pull to send commits
you cherry-pick commits
if the commit doesn't exist in the current repo, it won't work
 
which is the case then
 
10:17 AM
each checkout is a different repository
so, no, it's not the case
 
is there any ... option via git to have a "-cherry-pick-from-remote-repo" ? :P
 
no
you fetch the commits of the other repos
then you'll be able too
that said, it's not very hard
 
but then I'd fetch all the commits/changes no ?
 
git fetch /path/to/other/checkout; git cherry-pick 9a21ac204a05b
yes, so?
it wouldn't merge them
they'd stay in the other branch
 
I definitely don't want to merge/fetch all changes/differences there
ah alright
I'm still on noob-level with git, excuse my dumbness :P
 
10:19 AM
you suck at git for someone with 100k rep :D
 
that makes no sense :P
only problem left then is.. that the cherry-pick would still also grab some files (for instance the patch-file) which shouldn't be in the master
but that's just a problem of the general workflow here, that patch files are still required
 
@jAndy do you want a clean history?
I.e. a single commit without the patch file?
 
well I could just fetch/-cherrypick before I create the ascii patch file
 
You cherry pick a commit
 
then I couldn't
^^
 
10:27 AM
You can rewrite commits in git... If that's your thing
 
@jAndy aside from git pull, git push and git fetch all git commands operate on the local repo only
 
Found a (midly) fun question this morning
1
Q: javascript eval() method is degrading the performance while filtering

Ronak BhandariI am creating a string of where clause from an array of filters. var where_clause_string = "(((true && ['SACRAMENTO','CITRUS HEIGHTS'].indexOf(raw_data[i]['city']) > -1) || (false && [].indexOf(raw_data[i]['city']) === -1)) || false)"; var raw_data_length = raw_data.length , filtered_data = []...

 
user2620028
wow .... really
 
I've seen many code that use eval as property accessor, so yes, really.
 
is there any data analytics open source lbirary?
 
10:41 AM
@dystroy wait what?
 
@Sajeetharan Many, if that's all your requirements. You need to be more specific.
 
@phenomnomnominal Yes, it's partly a XY problem, but assuming he has no choice I could reduce from 2-3 seconds to 70-100 ms the computation time.
 
But the actual code in the eval...
 
@phenomnomnominal It's obviously something badly built server side from some data
 
@Sheepy i need to provide drill down and data summary
 
10:43 AM
@phenomnomnominal I guess the code is generated. But still, it is ugly...
@Sajeetharan And JavaScript, I suppose? Or do you mean Java?
 
Yeah it's cray.
 
@Sheepy Javascript only
 
@Sajeetharan highcharts.com/docs/chart-concepts/drilldown First result from a google search on JavaScript data report drill down
 
@Sheepy am already using highcharts, what i actually want is not the visualization, something like jspivot does
 
@Sajeetharan I am thinking, if server side can generate a condition, it should be able to make a function instead of a string.
@Sajeetharan Like this? nicolas.kruchten.com/pivottable/examples (2nd result from googling highchart jspivot)
 
10:52 AM
@Sheepy yes exactly, am already implementing the above , is there any other library like that?
 
@Sajeetharan Search PivotTable.js alternative. I got quite a few.
 
11:10 AM
um
 
@Inquisitive 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.
 
3 answerers, none read the question...
0
Q: How to capture "ReferenceError: Can't find variable"

gurehbguiI have the following Code: if(AdMob) { ... } Then I get the error: ReferenceError: Can't find variable AdMob How to capture this error that I don't see it in the console?

 
the question is horrible by the way
 
@dystroy FGITW in action over there :)
 
@Neoares yes, it's unclear
 
11:20 AM
I recall that PHP has a standard deferred answer for these error messages...
226
Q: PHP: "Notice: Undefined variable" and "Notice: Undefined index"

Pekka 웃I am running a PHP script, and keep getting errors like: Undefined variable: user_location in C:\wamp\www\mypath\index.php on line 12 Line 12 looks like this: $greeting = "Hello, ".$user_name." from ".$user_location; What do they mean? Why do they appear all of a sudden? I used to use this...

362
Q: Reference - What does this error mean in PHP?

hakreWhat is this? This is a number of answers about warnings, errors and notices you might encounter while programming PHP and have no clue how to fix. This is also a Community Wiki, so everyone is invited to participate in adding to and maintaining this list. Why is this? Questions like "Headers...

I am on the fence whether they are good or suitable for SO...
 
better than the alternative
 
True, so true...
 
Does anyone know why I cant access for example my css files when I use socket.io but if I use the http-server node module it works fine?
Top of my app.js:
var express = require('express')
, app = express()
, http = require('http')
, server = http.createServer(app)
, io = require('socket.io').listen(server);
 
11:38 AM
@Sheepy ok thanks, i will have a look
 
@user2248441 You dont have a static file handler
 
It happened to me, but can't remember how I solved it
 
@RoelvanUden ah ok, so http-server is necessary as well as socket.io/express right?
 
hi guys, i am having a xml node as below
<Address>This is my link yahoo.com follow this one</Address>
for this node i want to add hyperlink to yahoo.com how can i do it in javascript can you guyz help me
 
@user2248441 No. http-server is JUST a http server with static file handler. Express is just some fancy sauce over a http server, and provides a bunch of handlers (and your own, as routes etc). Just add a static file handler ;p
 
11:44 AM
I have a div. I add a blur event handler to it and a click handler. In the click, I create a textarea inside the div. When I click the inner textarea, the div's blur event is called - even though it's inside the div. Does this make sense to anyone?
 
@RoelvanUden http://stackoverflow.com/questions/12307174/how-to-enable-static-files-and-less-support-when-hosting-a-nodejs-app-within-i

Something like what happens here? This seems to be what I need
 
@user2248441 That's it. Read the express docs and connects static senchalabs.org/connect/static.html
 
@RoelvanUden thanks for the help <3
 
@Zirak Okay, mom.
(That could really be something my mom said)
 
Honey, Zirak is your mom.
 
11:49 AM
@SomeKittens Haha good point
@Zirak That was pretty cool! I love things like that
@rlemon Hahaha brilliant
 
someguy is talking to invisible people again
 
@KimPossible I think I heard Kendall somewhere
 
Who's KimPossible?
 
Hey guys...to anyone using IndexedDB...do you call the open() method prior to each transaction, or just open it once and then use it? Roamed around the internet and seen examples of both...
 
@Kippie She's right there
Can't you see her?
 
12:03 PM
No, only you can see your imaginary friend
 
Also, I'm horrible at regex. Anyone here know how I can filter out all non alphanumeric characters from a string?
 
replace /[^A-Z0-9]+/gi with ""
 
Right...
silly me was working with negative lookaheads and stuff
or at least trying to work with it
not that I know how any of that works
 
THE
function multiplier(factor){
return function(number){
return number*factor;
};
}
var twice=multiplier(2);
console.log(twice(5));
//￿10
this is so strange
from book eloquent JS
 
12:09 PM
wait until you get to currying
 
I love curry
 
THE
oh
 
currying is sexy
 
This is curry behind a rice dam, which I cam across earlier today: demilked.com/dam-curry-rice-damukare-japan
 
THE
Lol yeah but what about my question ?
 
12:11 PM
what question?
 
You didn't have a question. You merely stated you found it "strange"
 
THE
why on earth this function would ever be needed and i don't really get how calling var twice = multipler gives 10
 
@THE twice is a function that multiplies a number by 2, as you can see from the above line
 
because miltiplier returns a function, and ypu asign this function to twice
 
THE
@Neoares ahhh that makes more sense
i don't like such nested things
my brain gives up when goes into this depth
 
12:13 PM
yes, this code was a bit weird
that*
 
I have plenty of code like that
 
because you are weird
 
@THE It's unfortunate that so many languages have to use nesting to accomplish currying
 
JK
 
Yeah, but in your case, the code probably makes more sense.
This is a bad example, because why wouldn't you make a "multiply" function that just accepts 2 arguments?
 
12:14 PM
But JS does have a slightly more readable way to do the same thing
 
exactly
 
@Kippie Because partial application is useful
 
@KendallFrey I'm not trying to deny that, but in such a trivial example, it just seems odd and out of place
 
function multiply(x, y) { return x * y; }
var twice = multiply.bind(null, 2);
 
You can't do that
 
12:16 PM
@Kippie partial application of multiplication is useful in many places
@Kippie what did I miss?
 
Nothing
 
THE
@KendallFrey nice
 
@THE not particularly, but it'll do
I prefer twice = (*2)
 
@THE GAME
 
THE
but why this is not better and simple

function multiply(x, y) { return x * y; }
console.log(multiple(2,5))
 
12:20 PM
@THE because it's not the same thing
 
THE
that's what I am trying to understand
 
maybe you don't need to multiply two numbers
maybe you need a function that will multiply a number by another number
 
.bind(thisArg, arg1, arg2, arg3 /*, argN */)
 
thank you @rlemon, you're a very good documentation
 
of course in this case is not necesary... in fact you can do x*y
 
12:22 PM
did you write this yourself?
 
hi guys
 
Misread your name as LoveAndHerpes...
 
@FlorianMargaine and you're a terrible QR Code
 
but you have to extrapolate that function to a complex one
 
@rlemon 2.9
 
12:23 PM
How much time do you think it takes, to understand roughly 41% of Node.js + Express.js?
 
All of them
 
@AndrévonKugland 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.
 
more precisely 2*π
 
great first message, @AndrévonKugland
 
12:24 PM
!votekick
 
Guys, just kick him.
 
C++, that heap of scrap
 
@R.MartinhoFernandes hu ho. I guess he's already spammed the lounge?
 
He's doing the rounds trying to ignite language wars, I guess.
 
flagged as offensive :(
 
12:24 PM
He's an android coder ^^
 
@FlorianMargaine Yep. Kicked him, came back a minute later with more "Blah blah C++ sucks". Kicked again, shows up on JavaScript room...
 
in Lounge<C++>, 22 mins ago, by André von Kugland
C++ is a bloated language, hard to learn, hard to debug. Today, when Java already has the same performance as C++, there is no reason whatsoever to use it.
 
@R.MartinhoFernandes so, like Bartek?
 
there is space for everyone
 
@FlorianMargaine Bartek is interesting
 
12:25 PM
@LoveAndHappiness but what if they are really really fat
there might not be
 
@rlemon kek
 
@dystroy I know :P I was kidding
 
@rlemon Book extra seats.
 
C++, along with F++ is great for real world application... 'course for web... there is other stuff, just as good... but what do I know...
 
12:26 PM
@LoveAndHappiness well you never heard of cppcms? cppcms.com/wikipp/en/page/main
 
damn, TIL all of my JS isn't "real world"
 
Can't we all just agree that C# is the best language ever invented?
 
nope.
Damn freaking nope.
 
@R.MartinhoFernandes You know F++ is used by F-22 fighter jets, right?
 
I'm pretty sure REBEL is that
 
12:27 PM
@LoveAndHappiness doesn't the space station use COBOL or something stupid?
 
And C++ by Mars's Curiosity.
 
@LoveAndHappiness and arduino robots use node.js, that doesn't mean anything
 
I don't think "used in" is a valid determination of how good a language is
 
@LoveAndHappiness If you have a basis of JS and HTTP learning express and shizzle is trivial. It will only take you a few hours, maybe a day.
 
@RoelvanUden It thx Roel.
 
12:28 PM
$ mv ie-hacks.css spartan-hacks.css
2
 
On a sidenote: Do you ever feel, like really knowing your craft? I've been WebDeveloping for at least 6years, and still strougle with everyday new concepts. Does it ever just make "click" for everything?
 
@LoveAndHappiness that happens when you try to understand how things work
 
Nah, I just import * from 'jQuery' and off I go.
 
@LoveAndHappiness Once you've got the solid base down, logic just make sense. Different ways to jot things down really don't matter much at all. A new language just takes a bit of time to understand the internals, but then it's straight forward again.
 
they day I stop thinking "god, I know nothing" is the day I've fooled myself into thinking I know anything.
 
12:31 PM
@FlorianMargaine yeah... yet it get really deep... like OSI-Model 7 deep. Ok, not really required, yet I am learning every day and I hope that it someday decreases, so that I can apply more than I learn, but fluently.
 
But learning new stuff all the time is the good thing about being a developer, why would you want that to end?
 
Be very happy with the days you feel like you've learned something.
They become ever more scarcely.
 
@ivarni for productivity...
 
Hum... You still need to escape the backslash in template strings? How disapointing
 
A message for technical recruiters: http://javascriptisnotjava.io
 
12:41 PM
This looks like beating a dead horse. It seems to me this message would have useful 5 years ago
 
Java Image:
JS Image:
 
WHO SITS LIKE THAT?
 
@dystroy Hm. Babel's REPL transpiles `\\` to "\\"
But fails on `\`
 
WHO DOESN'T SIT LIKE THAT?
 
/me raises hand
oh wait..
 
12:43 PM
tries sitting like that
That's really weird
 
You're all java developers, that's why it feels weird to you
 
my hand goes behind my head, not over it
 
Can someone please explain? veryman.expert
 
@dystroy buuuuuurrrrrnnnn
... ahem
 
@dystroy says the only java dev
 
12:46 PM
I feel caught
 
you just do it to show off ;)
 
no no no pic is several days old tho
 
Who even took the picture?
 
probably a hot secretary or client walked by and Andy casually decided to "show mah gunz"
 
@SomeGuy your mom
 
12:48 PM
selfmade, but for a totally different reason
 
@SomeGuy why do you think she got out of under the desk?
 
He wants to show off his shiny vegan muscles
 
gnah if I want to do that I'm sitting here without a shirt
 
lol
 
haha
 
12:50 PM
which is my usual dress in the office
 
@FlorianMargaine Hahaha
 
I just put a shirt on from time to time
 
> Do I Need to Learn Javascript to Be Able to Use It?: No.
 
- all jQuery users
It wouldn't be so bad if employers knew the difference
 
1:17 PM
Hey guys, with all the new ES6 features being supported by browsers I was wondering when V8 and spidermonkey will support tail call optimization.
Do any of you have an idea when tail call optimization will be available in JavaScript engines?
@BenjaminGruenbaum You have subscribed to the ES6 mailing list right? Perhaps you might know when TCO will be supported in V8 and Spidermonkey. =)
 
6 to 8 weeks
 
The only time I even use spidermonkey is when I open Tor
 
I don't use tor. I'm doing nothing illegal and I don't live in China.
 
Tor? are you 4chan?
 
Morning
 
1:22 PM
9chan*
 
@AaditMShah Yes, I think
The thing that was blocking TCO was arguments.callee, and that will be gone
 
@AaditMShah Babel-node offers TCO
Its not actually TCO but the concept is there
 
I don't use Tor either... fbi pls
I just open it... then close it...
 
Tor is pedophiles' browser
 
uhh, no
well, that may be true
but no
 
1:29 PM
noob u sobre know shet
 
sobre?
 
dont*
 
get englished pls
 
jajajaja
 
iPhone autocorrector sucks
such as ur mom
 
1:30 PM
wrong channel, calm down
 
 
Children, be calm
 
@AaditMShah it's not really a priority, but babel does it already and I use that so I actually rely on TCO often
Well, "often" is an overstatement, but I do rely on it.
 
Hey y'all, sorry to interrupt the chat but does anyone know (or know where I can find more about) how SO implements websocket updates relating to specific user? Like updating your rep count or inbox?
Is it tied to IP? or some kind of tokenization
 
It's tied to a connection
 
1:38 PM
watch the network tab
 
@JanDvorak there is a case for using Tor even if you don't do any of those things - though it's not secure so there's that
 
@BenjaminGruenbaum What is this syntax?
  _function: while (_again) {
    _again = false;
    var i = _x;

    if (i = 0) {
      return 0;
    }_again = true;
    continue _function;
  }
It's not in an object context.
 
@SecondRikudo this is a labeled continue
 
!!tell SecondRikudo mdn label loop
 
Don't know who this bloke is, with the web2.0-looking shite, but I like his brain lea.verou.me/2015/04/jquery-considered-harmful
 
@SecondRikudo it's used in languages like C to simulate state transition since control flow isn't clear often - for example for cleanup - they made it to Java (minus the goto) and to JavaScript
It's a pretty useless statement
This is effectively a classic way to transition a tail call form to a loop - labels let you do that exact transfer instead of unwinding an actual stack
 
You need it to break out of an outer loop
Doesn't happen so often though
 
Yeah, in code that doesn't have tight performance requirements I almost never nest loops anyway.
 
1:46 PM
You should probably refactor in that case
 
@BenjaminGruenbaum It doesn't work with two functions tail-calling each other though, IIRC
 
whoever uses labeled loops in ecmascript should get shot
 
@copy neither does TCO in ES6
 
But TCO in general does, doesn't it?
 
@BenjaminGruenbaum GOTO
:P
 
1:48 PM
There are a gagillion ways to define TCO, and then there are languages who actually support generalisations of TCO and not "proper plain TCO" (like Haskell)
So it depends on whom you ask
"Tail recursion modulo con"
 
What generalisations of TCO does Haskell support?
 
> Implementing tail call elimination only for tail recursion, rather than for all tail calls, is something significantly easier. For example, in the Java Virtual Machine (JVM), tail-recursive calls can be eliminated (as this reuses the existing call stack), but general tail calls cannot be (as this changes the call stack).[10][11] As a result, functional languages such as Scala that target the JVM can efficiently implement direct tail recursion, but not mutual tail recursion.
41 secs ago, by Benjamin Gruenbaum
"Tail recursion modulo con"
 
☻ ☻
 |
===
 
cons, as in :
69
A: Does Haskell have tail-recursive optimization?

AndrewCHaskell uses lazy-evaluation to implement recursion, so treats anything as a promise to provide a value when needed (this is called a thunk). Thunks get reduced only as much as necessary to proceed, no more. This resembles the way you simplify an expression mathematically, so it's helpful to thin...

Also ^ not as big of a deal in a lazy language
 
So, bad news for functional languages compiling to ES6
 
1:56 PM
yup
 

« first day (1648 days earlier)      last day (3283 days later) »