« first day (2322 days earlier)      last day (2640 days later) » 

10:01 AM
Hi there, I'm working on an angularjs project, there are almost 6 HTTP function to get data from 6 different tables, is there any way to write http method once and reuse it for all other tables?
directive or class kind method?
 
morning
 
10:22 AM
morning~
 
morning
 
evening
 
how can i share demo code to chat room
?
any link
 
jsfiddle.net
jsbin
paste + ctrl-k
codepen
spam it in the C++ room
 
ctrl-k not working
 
10:32 AM
it's working just fine
but if you want to share a executable demo, please use one of the pages mentioned
 
put code first, then ctrl-k
no need to select it
that's only in questions I think
 
humblebundle is going to make me fucking poor
 
It's not as good as it used to be
 
Can someone help me?
 
10:48 AM
@AbhishekPandey is there a good reason to want different https?
just make a function to prepare that xhr, then run it on 6 different requests, then send them to different urls
 
I just don't want to rewrite http function for each and every table/requests.
@towc how can I do this?
Any example?
 
for( var i = 0; i < 6; ++i )
  xhrs.push( createPreparedXHR( '/tables-' + i ) );
 
@BenFortune I will definitely get the Civ and the Arduino + RasPi bundle
 
and in createPreparedXHR you return an xhr that is sent to something relative to the parameter url, and sets headers and your onload function and stuff
 
@GNi33 I have monthly which is pretty good, but the actual bundles they do aren't that good anymore.
One of the best ones they did was the EA/Origin bundle.
 
10:58 AM
I haven't always followed them this closely
what was in the EA bundle?
 
@towc OK, lemme try
 
Never been a big fan of indie games tbh
 
I mean, don't actually use that structure. Maybe don't send it yet, only send it after you have them all defined with a .onload by iterating over xhrs
 
@BenFortune good bundle, yeah. I probably wouldn't have got it though
lots of typical "EA" shooter games, that I simply not enjoy anymore
and Burnout Paradise is horrible :D
 
11:03 AM
BF1 is pretty great.
Haven't enjoyed an old war shooter since CoD:WaW
 
if only people spent the time they beg for people to solve their problems on solving the problem
 
@BenFortune yeah, I haven't played Battlefield in a long, long time
same goes for Civ, so I'm actually super excited about the civ bundle ;)
 
Haven't played 6 yet, but heard great things about it
Might buy it actually, didn't realise it had 6 in it
 
11:18 AM
most people are saying that V + all the DLCs is the best Civ yet
it doesn't have 6 in it though, it has a 20% off coupon for VI
 
Oh haha, thought it was cheap
 
well, VI is brand new, I didn't expect it to be in there
but the 10$ for V + all DLCs is a steal still
and I think the Civ titles age really well
it's more about the overall gameplay in these
 
Does anyone here have experience with userscripts in Chrome?
I'm trying to include jQuery like this
http://stackoverflow.com/q/859024/2407212
But it is not working
 
Greasemonkey is firefox
 
Syntax should be the same though
 
11:24 AM
Fair enough
42
Q: Trying to load jquery into tampermonkey script

JonahI am writing a script which logs into my college network when the login page is loaded. The code looks as follows // ==UserScript== // @name My Fancy New Userscript // @namespace http://use.i.E.your.homepage/ // @version 0.1 // @description enter something useful // @match <Col...

 
11:44 AM
@GNi33 I kind of took that as a slap in the face, lol
 
:o :D
 
@GNi33 there was a big sale before on steam. Even rlemon posted a link to a german portal to get civ5 complete for -90%
there will be another one coming if you're patient :)
 
Ok really
 
I'd rather call them Orval, Chimay, Westmalle, etc...
 
11:51 AM
Do you guys prefer short variable / method names or really long descriptive ones?
 
I prefer short descriptive names
 
Im being told at work that very descriptive ones are better, no matter how long they get
 
@DenysSéguret all fairly easily available here ^_^
 
@Asperger your variable name should contain its whole definition. Usually you serialize the class in the name (and repeat)
 
They edited: currentRotationX to:
currentRotationXAngleInDegrees
 
11:52 AM
@Asperger descriptive. Use minifier after
 
is the second name better than mine?
 
@KarelG must've missed that
 
gotcha link ya if I see that again
 
but I think the humblebundle is a very fair deal
 
seems really long. Especially the word "angle" seems unneccesary for a rotation
 
11:53 AM
@Asperger I wish more languages had dimensional variables
 
@Asperger By no way is it a complete answer but you should read that: lysator.liu.se/c/pikestyle.html
 
I mean a rotation value is ALWAYS an angle. Why heck add that inside the variable name. What I hate is the overall "noise" all those words create.
 
as far as I can see it should be the complete edition in the bundle
 
@Asperger not always
Sometimes rotations are quaternions
 
@KendallFrey so its not bad or noobish to add long names?
 
11:56 AM
If you can describe something with a short name, do
 
for example: initiateStringToDelegateDictionary
 
That's probably a very bad name
 
@Asperger no, quite the opposite actually
 
As you might have read in the link I gave, it depends on the context (and scope). If it's a very local context, the content is usually obvious with a short name. In a global one, it might be necessary to have a little more precision in the name.
 
How would you name a hashmap where you save function pointers / delegates where the key is a string?
@DenysSéguret yes good link
 
11:59 AM
Why do the types matter?
 
Because they do? Or dont they? Not sure
 
@Asperger depends. When those functions are renderers, I'd usually call that variable just "renderers". It's more about the purpose than the type.
 
@Asperger I would name it according to its purpose
 
To be honest naming conventions are so much harder than writing code....omg
 
@Asperger that's a well known fact (quotes abound about that)
 
12:00 PM
@DenysSéguret so im not alone! good to know
 
The more I get experience, the shorter my names are. Partly for bad reasons (i.e. I have more conventions that some other devs might not know)
 
But then how would you call something like: Hashmap someStuff<string, MethodPointer> with the purpose to call a function based on string input: someStuff["function1"]()
(a non js example)
 
Such a variable is usually visible in a very small scope so the name should just be something like "renderers" or "kitchenCleaners" (depending on what the method do)
If it's visible in a big scope there's a problem in your design
 
Thank you all so much for the useful information
 
The type should rarely be part of a variable, unless it's necessary to disambiguate (e.g you have both warriorsArray and warriorsMap in your small scope)
 
12:06 PM
Im honestly suffering to death due to naming conventions :(
@DenysSéguret what about prepositions? To, Of, For etc
 
Look at the code around yours (i.e. in the same ecosystem)
 
kitchenCleanersOfCastle
 
@Asperger does that look useful and not a burden when you read some code ?
 
Indeed. It doesnt seem bloated but unneccesary when given:
 
Don't forget that when you read the code, you take time enoncing it in your head. If your variable is long to read, it's harder to get a figure of the whole
 
12:09 PM
class Castle { int kitchenCleanersOfCastle; }. Maybe im mistaken though.
 
I would probably alt-tab to some chat before the end of that name
 
@DenysSéguret would you say currentRotationAngleInDegrees is a good name then? The variable stores the current angle of a rotation in degrees or is it bloated?
 
Why do you
1. store angles in degrees ?
2. feel the need to precise it's degrees ? Do you have other units in the same code unit ?
of course it's most probably a bad name
currentRotation seems enough
 
@DenysSéguret no I dont have other units as class properties. I just use the name of the variable and well convert it to radians inside a method for use in a trig function
 
Should obviously be fCurrentRotationAngleInDegrees
 
12:17 PM
Factory
 
Delegate
 
Deprecated
 
til gists can onebox
(nvm the contents)
 
So we have fCurrentRotationXAngleInDegrees VS currentRotationX
 
12:35 PM
eh, keep it currentRotationXInDegrees to find a compromis
 
I am using console.log to print a value, and the value prints fine - but I get an "cannot read property of undefined" error on the same line!!
matrices.js:86 1 (this is the value, and its printing fine)
matrices.js:86 Uncaught TypeError: Cannot read property 'shineDamper' of undefined
 
What's on line 86?
 
you're using something.shineDamper while something doesn't have that function/name on the prototype chain
 
12:54 PM
its strange because it's giving me the value, then giving the error
 
1 message moved to Trash can
@snowy500 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
 
Ok, this is basically the code: hastebin.com/agacuponem.js
 
yes I have similar code that works fine, but in another place it breaks :(
 
well then show the exact code that doesn't work
 
1:01 PM
you may have scoping issues if "it breaks on another place"
 
1:17 PM
I just notice the profiling results next to the code in Chromium. Why did nobody tell me!
 
I sent you a memo.
must have got lost in the mix
 
damn. Just phone me when I don't answer to your fax telling me you sent me a memo
 
what's your pager number?
 
911
 
Joke apart, this is very very cool
 
1:28 PM
why this not returning all h4 from this article
$("h4")
 
Because it's not jQuery
Use $$("h4")
 
because querySelector only returns one value
^^
in Chrome console $ is qs, $$ is qsa
unless jQuery overwrites $
 
mmmm never knew that, let me try again thanks guys
well I want to get list of all headings though
 
what are some useful git log commands ?
 
@FlyingGambit how git going to help here
 
1:32 PM
@FlyingGambit I'd say that the command in itself is already pretty useful
 
@FlyingGambit check its doc ...
it has many options.
 
git log --graph --pretty=format:\%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\ --abbrev-commit --branches
 
@DenysSéguret what is it then
 
I use git log -1 to check last commit
 
2 mins ago, by rlemon
in Chrome console $ is qs, $$ is qsa
 
1:33 PM
@Mathematics why don't you trust rlemon ?
 
@rlemon sorry I totally forgot that you answered it :|
 
I am making a GIT document so newbies could use it in future, so I thought I would ask here to know which commands you people use mainly , example git log -auth="Flying"
 
how can you "forget" that
 
To be honest I never directly use git log command, I only use scm breeze aliases
 
git add -A .
git commit -am 'HAAAAANNNNNDDDSSS!!!!'
git push -f
 
1:34 PM
learn them to use documentations ...
 
(for example gl or gla)
 
@rlemon what qsa stands for though
!! google qsa
 
querySelectorAll
 
I learned the git commands myself. I even had to learn others how to use git stash
 
@FlyingGambit Wow, I wonder why nobody has ever done that before
 
1:35 PM
 
I'm not sure this is common behavior with git. SVN maybe but not git
I know I don't break my repos and I'm no wizard
 
@OliverSalzburg Its for my office, they asked me to do that before I leave
 
@DenysSéguret The amount of "I" in the sentence should be a clue to the core issue here
 
why this isn't working :(
var r = document.getElementsByTagName("h4");
for(int i=0; i<= r.length; i++)
{
	console.log(r[i]);
}
 
@DenysSéguret Thats crazy
 
1:37 PM
@FlyingGambit So download one of the 1000 cheat sheets and change the color scheme a bit
 
@OliverSalzburg LOL
 
@Mathematics for (int ...
Please look at your console!
 
grrr, me C# dev... let me try var :)
 
for( const h4 of document.querySelectorAll('h4') ) {

}
 
@rlemon very nice
 
Why don't you use $$ now that you know it exists ?
$$("h4").forEach(a=>{console.log(a)})
 
morning everyone
 
(and yes, $$ isn't technically an alias for qsa)
 
@DenysSéguret huh? it is the exact same.
 
try forEach on qsa
 
1:42 PM
and it works.
nodeList has forEach
 
oh damn, this changed...
 
.
holy crap clipboard
I highlighted a paragraph
> $$(selector) returns an array of elements that match the given CSS selector. This command is equivalent to calling document.querySelectorAll().
I suppose the only difference is if it actually returns an array
or if the docs are just misleading
 
@rlemon don't write this when it's not some kind of porn link, all the guys who looked at the history of your comment are disappointed now
 
The smartest dev used to flock to Microsoft. Now? So Microsoft developed a coding AI.
 
1:45 PM
> Called DeepCoder, the software can take requirements by the developer, search through a massive database of code snippets and deliver working code in seconds
 
so, I was right (apart the part about the forEach, I hadn't received that memo either)
 
so it'll just copy-paste from SO for me?!
shweet
@DenysSéguret then google docs are misleading
 
@rlemon it's funny when you think that a lot of people on SO do just that
 
I received a job offer from a startup trying to apply AI to code in order to make AI code... Didn't answer...
 
google is the worst.
 
1:47 PM
@rlemon "equivalent" is just a little ambiguous
 
@DenysSéguret You should. It's the future.
 
I guess they didn't want to be too verbose
@Sheepy I don't think so
 
$x() is nice. if you like that xpath kinda thing
 
The day AI will write code, it won't be the in the languages which were designed for humans. At least I don't want to bet on that
 
$x('//h4')
 
1:49 PM
@DenysSéguret They will replace the copy and paste jobs. But it won't replace all programming for the foreseeable future. The positions will shift to higher end programming tasks.
 
isn't that just programming tho?
we've always delegated shittier tasks to a compiler/interpreter or in this case an AI
we will still need to work with it to get gainful results
@KendallFrey freaking 12c here today.
T shirt weather
:D
 
AI is one of those things that develop slowly but not exactly as we expected so we don't recognize it
I reckon modern optimizing compilers do something that you could call AI
 
@KendallFrey They named it wrong, that's what turn most people off ! however it does what it should
 
1:59 PM
oops
 
@BenFortune RIP not really: we knew for a long time collisions would happen. It's interesting to see a "practical" solution but I'm not sure it impacts many serious programs
(for git, it's ok, Florian found this: web.archive.org/web/20120701221418/http://kerneltrap.org/…)
 
@BenFortune Hasn't SHA-1 been obsolete for a number of years now?
 
yes, it's obsolete, because math people had predicted it would happen
I think about something: it could be interesting to see whether Microsoft's wrapper of git downloading content on demand handles that correctly...
 
does git use SHA-1?
 
2:03 PM
rot26
 
Does that attack make it insecure?
 
but the earlier version is assumed to be the right one, so if you use git normally, you can't change an old file
(see this)
 
> Nine quintillion (9,223,372,036,854,775,808) SHA1 computations in total
ha ha
 
that's why I wonder whether the microsoft thing doesn't make an insecure usage of git
(wouldn't surprise me...)
 
eh that project did made lots of computations to find a collision
> 9,223,372,036,854,775,808
 
2:07 PM
that's 2^63
curious
 
yeah
 
probably an approximation
 
Why not approximate to round base-10?
I suspect that that number of calculations guarantees a collision
 
they actually found it at 9,223,372,036,854,775,802 but ran 6 more tests to get a nicer number
 
not that the collision was found on that nth calculation
 
2:14 PM
sha1 calculates inputs with max 2^64 to end with a 160 bit output
Somehow I expect an approximation of 2^64 instead of that one
I can be wrong about sha1's input ...
 
Now that I think about it, 160 bits should take ~2^80 calculations on average to find a collision
So it's only 100,000x faster to do 2^63
 
but you can see that a collision may happen... the input size is greater than the output one
ah rlemon, my desktop notificiation is turned on
I SAW IT
And drank a coffee at that moment.
:/
 
37 mins ago, by Florian Margaine
@BenFortune 20 mins too late http://chat.stackoverflow.com/transcript/message/35801066#35801066
40 mins too late
y'all suck
 
ouch :(
 
uh damn
 
lol, there is a branch at our work that i completely forgot
 
branch: fix_SQL_injection
 
2:37 PM
Checking out files: 100% (16452/16452), done.
 
branch: remove_production_passwords
 
that was seriously behind
 
branch: what-everyone-should-be-working-on
@KarelG is currently like "uuuuhh...."
 
branch: branch
commit -m "commit"
 
branch: oak
 
2:40 PM
it has pull merge conflicts :/
WIZARDRY
 
also known as just merge conflicts
you have a nice mergetool configured?
I suggest p4merge, the one from Perforce. It's free and easy to configure in git.
 
@SterlingArcher i.imgur.com/gQp0sID.gifv
 
LOL
didn't expect that
 
@Luggage didn't knew this one. What do you need to install ? The whole " P4V: VISUAL CLIENT" ?
BTW Gdiff in fugitive (in vim) is cool
 
yea.. it used to be a separate d/l. I'm saddened that you have to d/l some larger installer with other junk.
hopefully you can choose which parts to install, at least.
 
2:46 PM
you also have to register...
 
crap.
that's new since i d/led it last
 
@Loktar crazy. arstechnica.com/gadgets/2017/02/… marathon runner cheats - busted by her smart watch.
 
doesn't looks confirmed to me
(but I'm not into marathons)
 
> Seo's completion time has since been deleted from the Fort Lauderdale A1A Half Marathon's results page.
 
I just had to explain the conflict markers to a co-worker
he thought that "HEAD" is the master while the sha hash his version was
tss
 
2:51 PM
@rlemon I'm not sure I understand this but I trust you
 
@DenysSéguret they removed her time from their results listing. I would think that means they accepted that she cheated and negated her times for the race
wildsideonline.net/results/2017/a1ahalf.php is linked at the bottom of the article
 
@rlemon Ctrl+f "Seo" doesn't show anything
 
that's the point
she's not on the list anymore
 
ah, I see
 
@rlemon LOL
> He paid for a higher-resolution version of the photos, and they showed a running-distance tally on the wrist hardware's screen: 11.65 miles. Even factoring in a margin of error, that measure is well short of a half marathon's 13.1 mile total.
 
2:55 PM
ENHANCE!
 
i've added angular 2 to a .net mvc project via angular-cli. when i try to build the project now in VS, i get an error which seems to be caused by VS trying to build the TS files (instead of webpack). any ideas?
 
@im1dermike That has more red flags in it than China
 
go on
 
It's been a while since I used VS, but I remember it's "compile on save" feature getting in the way sometimes.
 
2:59 PM
@DenysSéguret heh
 
if( x === true ) {
  return true;
} else if ( x === false ) {
  return false;
} else {
  return x;
}
 
it's like the people doing that:
... yeah, that ^
 

« first day (2322 days earlier)      last day (2640 days later) »