« first day (2110 days earlier)      last day (2836 days later) » 

2:00 PM
don't get me started on TFS
 
@Neil Everyone know's General Tsao's chicken.
 
@Luggage You should come to the C# room. We love bashing TFS.
 
Team Fortress Server
 
Total Fucking Shit
 
I always think 'team fortress', too.
I sometimes say it.
 
2:00 PM
For you younger generations, that was a spaceballs reference. ;)
 
Everyone here knows spaceballs
 
God I hope this is fake
 
I know this is hardline, but I think any developer that says "eww, commandline" should be fired. Out of a cannon.
 
@SterlingArcher If there are visually male pokemons, I want to see that
 
@SterlingArcher this is why I live like a hermit... people are retarded
 
2:02 PM
@Luggage I agree
 
@KendallFrey machoke?
 
I don't see a dick on my screen yet
 
I think a lot of the types of problems we have come from trying to simplify the unsimplifiable
 
no bulge.
 
2:03 PM
You're right though, no bulge. Clearly a powerlifing fem
Lookit those deltoids tho
 
yea, where are the Pokemon that need to wear long shorts because their balls hang real low?
 
that's just a crossdressing male--still male
 
Testimon
 
I rent a co-work space at another software company. They are doing a standup right now. In a walk-in safe. This is an old bank building.
 
2:06 PM
Maybe not the smartest thing to say
 
nope. :)
 
I laughed lol
 
Dumb question: is it bad practice to wrap a react container in multiple decorators to bind state? Eg: say I want to use connect and reduxForm
 
Not sure what reduxForm is
 
Garth Algar: Did you ever find Bugs Bunny attractive when he put on a dress and played a girl bunny?
Wayne Campbell: No.
[cracks up laughing]
Wayne Campbell: No.
Garth Algar: Neither did I. I was just asking
 
2:09 PM
How about lola bunny?
 
the bunny part seems more worrying than the dress
 
don't lie
 
@ndugger we already have the human version of Lola bunny
Supposedly that scene was entirely improvised
 
wat
 
Mike Myers was genuinely laughing
 
2:12 PM
1 message moved to Trash can
@Lynob Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
@Lynob that's not JSON
 
@Lynob not to be pedantic, but to correct your terminology, that's not JSON (which is a string), but a JavaScript Object Literal.
We need @CapricaSix to spot people calling JS objects JSON and correct them :)
 
consider it json, my app is complete, there's a small bug
ok consider it json
 
No.
How about you consider it JS.
 
ok i consider it js
 
2:14 PM
hey, any visual impressive statistics library anyone could recommend..?
 
In any case, what it is isn't relevant. Just check the length of your array.
 
@ErikLandvall like graphing? Have you tried d3?
 
@Lynob it's not my intention to shame you for using the wrong word, but to correct you since I assumed you would want to sound liek you knew what you were talking about at some point.
 
@ssube seen it, never tried it
 
2:16 PM
@ErikLandvall it can do most graphs and there are libraries on top of it for more types. Might be what you need.
 
@Luggage its ok
 
@ssube alright, sweet, thnaks..
 
@ErikLandvall d3 give you the tools to make your own graphs 'from scratch' but it's not as hard as it sounds and there are lots of examples. There ARE some higher level libraries, though (highcharts, nvd3, etc) that abstract that away, but I recommend d3 if you can.
 
highcharts is pretty broken (their docs are especially bad), but some of the wrappers around d3 are good
 
Personally, I use react to make SVGs, but I use d3.js for some of it's handy functions (axis, etc).
I think that's the best/most flexible.
yea, none of the chart libraries really blew me away.
and even plain d3 has some documentation issues. The d3 v4 thing is confusing. lots of examples are in d3 < 4.0
 
2:21 PM
I have about 7years of experience, I think I manage ;) but I have a look at the others as well.. thanks
 
like this?

<div ng-if "Object.keys(vm.parent.getAllPermissions(category)).length >=3;">
or do i have to put it in a controller
 
getAllPermissions is an array. so you only need to check it's length.
unless you need to look at and check for duplicates in the getAllPermissions[i].key field.
 
ok but am i passing it correctly to ng-if?
 
no idea. I don't Angular.
 
ok thats fine thanks for your help
 
2:27 PM
1 message moved to Trash can
@Michael Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
I have created some .js files with various functions. Some of these functions need to contain url references to actions or methods in my Controller (asp.net mvc). For example:

in an Jquery Ajax function:
return $.ajax({
url: '/secure/home/User/Lookup',
dataType: 'JSON',
data: { someVar: someVar }
});

Is there an alternative to hard-coding the URLs?
 
Put it in a variable?
 
@Lynob don't forget to assign the condition to the ng-if (you're missing an =)
 
const partialUrl = '/secure/home/user/lookup';
// some time later
   url: `${baseUrl}/${partialUrl}`
@Michael something like that?
 
I guess it's literally on topic:
 
2:31 PM
@poke @ssube thank you. That sort of works. but it makes the .js files not really able to function on their own
 
@Michael put the whole $.ajax() call in it's own file/module along with all the others and just reference that. If it's only ever 'hard-coded' in one spot, then it's ok.
 
> Unbelievable GPS Hack! You won't believe what happens next!
 
var myApi = require('./myApi');
myApi.lookupUser(someVar).then(...);
 
@Michael they won't really be able to, since you need to supply the base URL somewhere anyway
 
2:32 PM
@SterlingArcher my grandmother sends her seal of approval
 
*seel
 
@ssube right. makes sense. Thank you all for the succinct advice @Luggage @poke
 
@Michael You could fetch the URLs to call from some web service… but then you would need to hardcode the URL to that web service too… :P
 
caterpie: GO!
 
@ssube seal is correct there
 
2:36 PM
@poke HATEOAS ?
 
I was more thinking of a simple config endpoint, but yeah, sure, why not
 
> So you take your schema and you mash it up with the data, then you take the documentation and you put that at the end, then you leave out half the data and replace it with metadata...
 
Hi, how are you guys? I have a question, can I use relative URLs in an AJAX request? I'm trying url: '../ajax/smash.php', but I give me a 404 error," '/ajax/smash.php' doesn't exist"
 
@nanilab Welcome to the JavaScript chat! Please review the room 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.
 
@nanilab yes (in general) so it sounds like maybe your page it already at the top level
 
2:40 PM
@nanilab Yeah, you can use relative URLs. They are evaluated relative to the current URL though, so maybe you’re somewhere else?
 
/index.html + ../ajax = /ajax
 
I understand, thank you guys
 
I highly recommend ajax. Cleans toilets in no time at all
 
is it the stuff that steams when it touches water?
 
2:44 PM
hi all
 if (WUUtilService.isNetworkAvailable()) {
                $timeout(function() {
                    //var username = "mobiliser" + "secret";
                    $rootScope.loading = true;
                    config.headers = {
                        "timeout": "Timeout",
//                        "common":{
//                                "Authorization" : {
//                                    "CHANNEL_SERVICES_USERNAME" : "mobiliser",
//                                    "CHANNEL_SERVICES_PASSWORD" : "secret"
i am creating headers using $http
 
@Mahadevan ?
 
God dammit why can't I ever eat goldfish without fucking up
2
 
how can you eat goldfish with fucking up?
 
@SterlingArcher oy...
 
can some body tell me is this way we need to create config header user name and password
 
2:46 PM
@poke So what about the case in which the root of the URL isnt always the same.
For example. In my dev environment when I debug. The url root is just "http://localhost:#####/home/user/lookup" but if i run from a test or production server the url root changes to "http://domainname.com/secure/project/home/user/lookup"
 
@Michael Well, as covered just a few moments ago, you can use relative URLs.
Or simply deploy separate configurations depending on your environment.
 
@SterlingArcher I think I prefer to leave off the context
 
/home/user/lookup is shared, the rest is the base URL (that should come from your config)
 
@ssube right. so how do u specify relativity?
 
2:48 PM
In C# I think I use a ~
 
amazing
 
~/
 
@Michael you don't need to specify it
 
oh I kinda see what you mean.
hmm let me try that
 
@SterlingArcher thank you
 
2:49 PM
if the path starts with a protocol, it will be absolute (for real absolute). IF it starts with a slash, it's absolute relative to the origin. If it doesn't, it's relative to the current page.
 
time is relative, both because it affects space and because it doesn't start with a slash
 
@Neil T.A.R.D.I.S.
 
@Neil how do you know it doesn't start with a slash?
 
~/ is ASP-speak for "relative this this app's root", which is an artificial construct.
 
@ssube Spelled "time" not "/time"
that would just be odd
 
2:53 PM
@ssube phantom slash?
 
time could have started with a slash, like somebody cutting open a giant water balloon
we weren't there, we can't know
 
So now kinda unrelated I'm getting a Uncaught TypeError: Lookup is not a function.

The way I have it setup is Lookup is a function inside its own file:
$(document).ready(function () {
function LookupLDN(nameDotNumber, lookupUrl) {/*logic here*/}
}
and the function caller is in a different file:

$(document).ready(function () {  return LookupLDN(nameDotNumber, '/User/Lookup')}
 
yep, that won't work
 
Maybe there is a great dominion that started it all
 
@ssube what did i mess up?
 
2:55 PM
LookupLDN is only a function within the document.ready handler
 
I screwed up the scope?
 
JS uses function scoping, so names don't escape the surrounding function
 
first, ask yourself why you are wrapping everything in $(document).ready(function () {
 
because I think I want all the files to encase logic with $(document).ready(function () {}
so that it only runs when ready?
 
just put your scripts at the end of the body..
 
2:56 PM
I do.
 
@Michael no need
 
but just incase someone else places them elsewhere
 
You just don't want to call a function before the document is ready
 
right. so what If someone tried loading one of these script files at the head.
 
I got a question regarding provinces/states - ISO 3166-2
 
2:58 PM
@Michael so long as it is syntactically valid, no worries
 
@Michael only wrap your startup functions in the document.ready, not the rest of the code
 
is it in the standard to use the codes with hyphen? (e.x. CA-AB)
 
make sure you only call the code from within startup
@fayzaan country codes with a hyphen are typically for locale
en-US, en-GB, etc
 
I see, I guess when I read the JSON file, it seems to not have the keys stringified
so then it breaks in JS
 
you might have a JS file then
 
3:01 PM
well, I use jquery ajax to read the file, and when it parses it...it seems to remove the string from keys?
 
@ssube hmm. I dont think I really have "startup" functions. Just a file of shared functions, and a file of logic that may call functions.
So in my case there isnt need to worry?
 
like instead of "AL-BR" im getting AL-BR: "dksadj"
 
@Michael the second one would be your startup stuff, then
@fayzaan yes, because JS doesn't quote keys
 
well, no, jquery doesn't remove the string from keys, it parses it from a json string to an object.
 
@Michael in short, worry about what is being executed and when
 
3:02 PM
@ssube so if I encapsulate the function callers in Document.Ready() then scope will be screwed up again?
 
Function declarations are always fine
 
@Michael no. If you wrap the function declaration, things will get screwed up. If you wrap the call, you're fine.
 
ahh. okay, I understand. sorry about that! thank you!
 
is there a simple way to fix this? or should I just change the json files using a script to use underscore instead? like AL_BR
 
@fayzaan I'm not sure there's anything wrong.
When you JSON.parse a string, the quotes around the keys will be lost.
 
3:04 PM
right, but then when I try to iterate through that object, React throws an error
 
what do you mean by it breaks in js?
 
ok nevermind..
it works ><
sorry everyone
must have been something else lol
 
probably was caching
 
Some linters look like they try too hard to justify their existence. Those "implicit type conversions" are standard, efficient and explicit enough practices. — Denys Séguret 1 min ago
What('s your opinion on those linter rules, guys ?
 
While static analysis tools are immensely valuable, some of their rules tend to be paranoid. Turning those off (I prefer to do so at the project level) is not a bad idea. — ssube 14 secs ago
 
3:07 PM
Seen. And I agree. eslint is a must for all my projects, but not all the rules
 
the tool should have all of the rules that are potentially useful and allow you to pick the ones you want. That was the problem with jslint
 
Wow.. All the JS questions today.
So the other day I found out that .js files are cached by the browser, so often when I publish changes to .js files the users may not pull down the current version.

I learned that you can force a cache refresh with ctrl + f5, but average users wont know to do that.
I also learned that I can appened a small query string to the end of the script source (eg. <script src='~/somefile/.js?update1'>) the browser recognizes this as a different file and pulls it down instead of using the cache.
 
Yes, in larger apps I've often seen that automated: reading out the js version(s) from manifests like package.json/bower.json or even from a comment in the file itself, and appending that to the src attribute of the <script>
 
Surprisingly enough there's still no better general solution to that old and simple problem
 
That's what we do as well
 
3:22 PM
service workers, but support is sketchy
 
interesting. fair enough
 
you have full control over the cache and you can update the script and manage migrations
 
@Michael we hash the contents of the file and append that to the name, then use redirects or symlinks to point you at the latest file
ideally the index will have the name-hash baked in, so we just prevent the client from caching the index at all
using the hash instead of a version means that files that don't change won't be replaced
 
@ssube for now I guess i'll stick with maunal filename changing.
but back on relative urls, you said:
Back on relative urls:
/home/user/lookup is shared, the rest is the base URL (that should come from your config)

using / works on my local machine because the root is nothing except the domainname.com but on our test server the root isnt really the root.
The base url will become something like domainname.com/secure/project
 
then you should take the part that varies and put it in your config file (outside of the code)
 
3:27 PM
you mean like the webconfig file?
 
yeah, the environment should handle that
 
or what do you mean by config file?
 
what are we talking about here... node?
 
@GNi33 asp.net mvc
 
so, in our setup, we have an index.html and config.json in each bucket
that's an "environment" or application, everything else (the hash-named files) are in a shared static bucket
 
3:30 PM
@ssube so how are you defining that in your config though?
because its variable?
 
{
  "api": {
     "base": "http://api.company.com"
  }
}
 
okay, i'll have to find something equivalent for the xml web.config file
 
ugh
my son went to the hairdresser
his new haircut makes him look like a little boy, not a baby :(
 
@FlorianMargaine make a new one?
 
@ssube that's the plan
 
3:37 PM
@FlorianMargaine actually? Didn't you just have this one?
 
Our planet can't sustain current human breeding rates. The responsible thing to do is to adopt.
 
@ssube for now, yes
 
@FlorianMargaine is it a man-bun?
Silence means it's a man bun
 
3:55 PM
@SterlingArcher ~~
 
tildes represent man bun
 
it's not-not a man bun
 
it's ok, my hair isn't quite long enough yet for a man bun, but I'm curious as to how I'd look
 
hello
 
Plus at the gym it would help keep my hair out of my eyes
 
4:00 PM
Please no spam
 
so I got another issue..the json file has text with accent's, but when I read the file, in the response I have a bunch of ? for where the accent was...
i tried setting contentType to charset=UTF-8
is there something else I need to set on the ajax request?
 
make sure the charset is consistent all the way through
if you lose it at any point, the characters are gone
 
you mean from the ajax response onwards?
 
setting the contentType in the ajax options won't change how the browser interprets the response... that setting is for telling the server how to interpret what you are sending.
 
oh
 
4:04 PM
all the way through, from when you load the JSON on the server to when you parse it on the client
 
well, thing is...this is a file locally on the client side
 
silly I can't do this from mobile.
 
not server side
the file itself, seems ok
its just after I got response from server
i mean
 
5:04 PM
I know that some of you used the video feature of Miaou, so please note that it's back (I had to rewrite many things due to WebRTC API evolution)
 
> sexcam
 
@littlepootis It was probably used like this but unfortunately I can't intercept the streams, it's webrtc.
Though... In many cases it now goes through my own TURN/STUN server so maybe I could ?
In fact no, probably not :\
 
Talk went fine, but I spoke quickly because I was told I have 10 minutes less :D
Other than that pretty fine, I think
We'll know when we'll have video.
 
@Neil Time definitely began as a particle slashfic
 
@BenjaminGruenbaum what was your talk about?
 
5:12 PM
Async iterators
 
and kittens
 
5:25 PM
-1
Q: i want to remove capture automatcly

provash sarkerI want to remove capture automatically from http://indianvisa-bangladesh.nic.in/visa/ this server (Get Appointment page) I am using this code var elem = document.getElementById("capt"); elem.parentNode.removeChild(elem); var elem = document.getElementById("captcha"); elem.parentNode.removeC...

 
5:40 PM
SO... what happened cca one hour ago regarding docs.so and the chat?
 
The bans?
 
I've heard thus far
 
Let me dig a bit deeper into the q comments
I've tried to peek around the transcript, but the SO chat has always been a bit ungreat and I haven't noticed anything outright offensive. I guess I'm not very good at peeking around.
 
Users were suspended? Great.
 
5:52 PM
Well, I believe you've been amidst the shooting gallery.
 
I'm just going to avoid docs for the next 2 months
 
So, may I ask for a little bit of first-hand witness?
 
users were being unconstructive and wouldn't stop when asked.
 
Did they miss they were asked?
 
@JanDvorak careful not to start cross room drama again.
0
Q: How to split json value into index format?

user3663481I have one json value in that json file three movie's name. JSON data are dynamic data. I want to calculate percentage on WinProbability field. In JSON data one more field is WinType. I want data convert into fillowing for 0 = Percentage of WinProbability 1 = Average of RATING name = Unique n...

 
6:04 PM
I'm fucking up my sql syntax....
INSERT INTO foo (id, value) VALUES ($0, $1) ON CONFLICT (id) DO UPDATE SET value = foo.value + $1;
> syntax error at or near "ON"
 
s/DO//?
 
heh
!!> 1<<-1
 
@JanDvorak no dice, tried that first.
 
@towc -2147483648
 
fun
 
6:05 PM
@towc cute. Your point?
 
just found it funny
 
Right operand of shift operators is taken mod 32
 
I mean, why does that amuse you?
@copy 2^32
 
because I'm that kind of messed up?
dunno
 
oh, fine then.
 
6:06 PM
was just funny
 
@JanDvorak No, read what I wrote
 
oh, right, sorry
But really, don't shift by a negative amount
 
"Using the Async and await feature in ES7+ can make working with promises easier." :|
 
if it's stupid, don't do it
 
@cswl Haskell has had that feature in '98
before that, even
 
6:09 PM
@JanDvorak Simpsons did it first
 
JS won't have that in ES2017.
 
@ssube Linky?
 
@JanDvorak Ah, so I'm not the only one doing this
 
Not the only one doing Haskell? Probably, I guess.
 
No, pointing out how "Haskell did it first"
 
6:11 PM
@KendallFrey nope, you're in company.
 
Oh.
\o/
 
Okay, I understand that this works (function(arg){ return arg * 2; })(4)//8 , but I don't understand why. Is there a quick synopsis I can read?
 
can you elaborate?
 
@SuperNoob break down what you've written there
add whitespace
 
Okay, I underrstand that (becomesAfunction)(getsEveluated) works, but I guess I don't undertand the 'mechanics' of it
 
6:16 PM
Can you elaborate?
You call a function by sticking parentheses next to it
 
in the first parentheses, you have an expression that returns a function; that's followed by a call which passes 4 as an argument
 
@JanDvorak, I cannot. Which is what I'm looking to figure out.
 
*evaluates to
@SuperNoob What is it that you're trying to figure out? ;-)
 
Check out IIFE on docs.so .. wait.. don't
 
Ah. I should think of it as thismeansnothing, but (thismeansnothing) is function
 
6:18 PM
^ good one
 
@SuperNoob not quite
 
@SuperNoob next to it, not around it
 
it's not that it becomes a function, you can just declare functions inline
so you're declaring a function (Without a name) and immediately calling it
 
@JanDvorak, just trying to understand javascript a little better
 
like I said, break it out onto multiple lines with some whitespace and it will make far more sense
 
6:19 PM
@ssube, got it. It just applies a private scope, which evaluates--if that evaluation is a function you can concat (arg) to now evaluate that new function with arg
 
You don't need parentheses around a function, though you'll usually find some. far func = function(x){return x} doesn't have any but there's still a function.
 
@SuperNoob scope has nothing to do with it
parens just group (they don't scope, though, that's fairly different)
groups are evaluated left-to-right
 
_=_=>_ doesn't have any parens at all.
 
so (1+2)+(3+4) will become (3)+(7) will become 10
like math, you just work through the parens
so it declares a function (with no name, so you can't use it later), then the first group of parens returns that function
 
_=_=>_ just blew my mind, *function =_=> *
Okay. I got it, I was just letting the magical look of it confuse me.
 
6:22 PM
It just assigns the function _=>_ to the variable _.
 
@SuperNoob that's why one liners aren't always a good thing
 
I even went as low as rewrite x!=~~x to x != Math.round(x)
 
@ssube, no doubt, I wasn't planning on using it, I was just trying to understand parens and evaluation.
 
@JanDvorak x % 1 === 0 doesn't work?
 
@SuperNoob parens do very little
 
6:24 PM
Sometimes it's worth using those. (function($){...})(jQuery)
@copy Nice one, I think I'll use it. Thanks.
 
AMQP is awesome
 
> How to ruin any young aspiring web protocol: "wasn't that proposed by the creators of w3schools?"
 
Can react detect "componentWillReceiveContext", for if context changes?
 
6:44 PM
i see no such method in the react docs under "Component Specs and Lifecycle".
 
@corvid getChildContext is called when props/state changes
any children will then receive that context
 
@RocketHazmat that has slightly different behavior if 123 is falsy and 0 isn't. — Jan Dvorak 14 secs ago
 
Oh okay, I am trying to make a component that mounts, connects, and then passes a small subsection of it's API to all children down the tree.
 
but.. components only get shouldComponentUpdate() and if that returns false, a context change is ignored. See the very bottom on this page under "known limitations": facebook.github.io/react/docs/context.html
 
6:48 PM
there is a componentWillReceiveProps
it passes in new props
but, if you're just using props directly and passing props directly down to children, then they will update from the parent anyways
 
@SterlingArcher I thought that was going to end in sex.
> ... we were both sweaty and he had a huge smile on his face.
 
I mean...
 
This is basically what I have. It's a pretty generic socket connection component.
 
@littlepootis That reminds me of the doc proposal for JSON Object..
 
6:57 PM
There were several :/
He edited the title to..
> Parsing javascript object in Javascript
 

« first day (2110 days earlier)      last day (2836 days later) »