« first day (2075 days earlier)      last day (2876 days later) » 

6:00 PM
@JossieCalderon nothing surprising here
 
@JossieCalderon I prefer the 2nd solution
 
What is the 2nd solution?
 
@BrianHVB I mean... if you feel it's easy go for it.
 
Oh, the second answer. Aye.
 
No, I'm asking what the simplest solution is. The one I proposed or something else?
 
6:01 PM
well... you don't know a "something else" solution yet, so the current solution is the current simplest
 
I'm new to web programming. Have done some research and seems no easy way to directly access mySQL from within client-JS............lol, I'm asking if anyone knows of an easier way
 
If it's a throwaway, it doesn't matter how you do it
 
@JossieCalderon a better way is to provide that in the arg list name
 
stuff learned / time is roughly constant
 
function foo(arg1 = 'myDefaultString', arg2 = 0, arg3 = { default: 'object'} ) {

}
// call
foo();
foo('hai');
foo('hai', 22);
 
6:04 PM
@BrianHVB You don't really want client side code to be able to execute arbitrary SQL code in your database
 
db query strings should never be handled on client side
even if you use validators, whitelist, ...
 
Not a throwaway. Will eventually expand to other areas, but for now, I need something that can be implemented quickly. With all of the various JS frameworks around, I'm asking if it is fairly simple to learn enough NodeJS to get a basic 2 table database set up
Hmm, I understand the reason for that. Although this will only be used internally
 
I misread "domed" as "doomed" and I was wondering why it seemed that way to you. — Jan Dvorak 10 secs ago
 
you can use node.js
 
@BrianHVB Then I'd suggest to make it so that you can rework it later
 
6:06 PM
client (plain javascript + ajax) <------ --------> server (node.js + database)
that covers usually most of the basic javascript things
there are plenty node.js database drivers. just google these
 
so if i draw a circle on a canvas using the context, i'm not able to access the width and height of the circle?
it's gone forever?
 
Hmm, ok. So framework wise, learn jQuesry on the client side, and Node on the server side, or is there anything else I need?
 
@JossieCalderon access?
 
@JossieCalderon unless you mirror it somewhere
 
drawing is just setting pixels, there's no circle to retain information
 
6:07 PM
@JossieCalderon construct your circle object and save it.
 
if you want that, you need a scenegraph
 
yeah, like if i have NPC_Circle[0] How do I get the width?
 
and use the object to draw ur circle
 
@ssube technically it's setting a path.
 
NPC_Circle[0].width ?
if the object is { x: ..., y: ..., radius: ... }
then get 2x radius
 
6:08 PM
No one pounced on @BrianHVB for jQuery? I'm disappointed.
 
Lol, it it not used or suggested anymore?
*is
 
May I pounce on Brian's typo?
 
@BrianHVB Node isn't a framework (as far as I'm concerned), and jQuery is bad... so no.
 
@JanDvorak which is immediately rasterized
 
a lot of developers don't like it because a lot of other developers poorly use it.
 
6:09 PM
@KevinB also it's slow
 
@ssube The path, or the resulting stroke/fill?
 
@KevinB meh, it's also less relevant nowadays
 
@BrianHVB True. It's still used very often, but it's mostly pointless these days as the DOM is pretty consistent between browsers. You'll likely end up with jQuery, and that's find, but it's a utility library on the side and you shouldn't be using it as your main "framework". Because it isn't.
 
there is barely cross browser issues when you compare it to 5 years ago
 
@JanDvorak all of it
 
6:11 PM
Right, and none of those things make it "bad"
 
@KarelG Uncaught TypeError: Cannot read property 'width' of undefined
wait
sorry
 
it depends of your object man :|
 
i never returned anything from the function
 
Dear Android Studio: Please don't request elevated privileges under the title "windows command prompt". It confuses the tech savvy.
 
i cannot smell that
@JanDvorak i want to see a ss of that
i was like "heh??"
 
6:12 PM
@JanDvorak please don't use windows. It confuses the tech savvy.
 
I don't use it, but i'm not against new devs using it to get their feet wet with client-side dev
 
@KarelG If you mean screenshot - sorry, too late. But you can reproduce it by installing the Android SDK on a Win10 device
 
So do I need anything special client-side, or is the current pure JS enough to work with Node? I do need to do some DOM manipulation of the List elements
 
errr, do you say that jQuery should be used by someone whom is new in javascript ?
 
@KevinB Compared to what we have now, jQuery is an especially inefficient way to manage the DOM. Templates of almost any sort, from Handlebars to React and crazy binding stuff, tend to be cleaner and more efficient. It's pretty hard to justify jQ when the other options are all-around better.
 
6:13 PM
@BrianHVB js does that.
 
the client-side doesn't know or care that node is on the backend.
 
It's also incredibly easy to pick up and get going with
 
@Luggage Not even through some weird HTTP headers?
 
@KevinB So is Handlebars
 
@JanDvorak maybe, but that's api-dependent.
 
6:14 PM
You'd be hard pressed to find something jQ actually does better than one of the other big libs.
 
@ssube animation?
Better method names?
 
@JanDvorak jQ animation is notoriously slow.
 
@BrianHVB lean toward any "template" library instead of just "changing the html" (a.k.a mutating the DOM) in piecemeal fashion like so much jQuery-based code does.
 
Like, insanely slow.
 
It's not about which library does it the best or the fastest when you'r learning to write code.
 
6:15 PM
I will need to communicate with the Node server using some form of Ajax, since I won't be able to send any page requests
 
Otherwise compsci courses wouldn't start with visual basic
 
they don't start with VB anymore
 
Also, everything has to run inside a single DIV element contained within the template of another page. I have no direct access to the page
 
well, that's in my case
 
Java and JS and C are pretty common
VB, not so much
 
6:16 PM
@ssube Do you suggest to replace $style.text(..) with style.textContent= for a performance boost?
 
@JanDvorak no, use an animation library that understands batching changes.
 
I batch my changes while building the new stylesheet each frame
I even use [].join instead of repeated concatenation.
 
greensock.com/jquery is stupid marketing shit
but it has some good numbers
 
@JanDvorak, @Luggage Thanks for the feedback and suggestions
 
@ssube "december 2012"
 
6:18 PM
yeah, gsap is older
now we have createjs.com/tweenjs and bouncejs.com and stuff
 
hehe, jQuery on 3000 dots just kinda sits there.
 
the point is that jQuery uses immediate-mode animations and is incredibly slow compared to any modern option
 
I'm not disagreeing with you on that
 
they could have fixed that part
but if it works, then why touch it ? :P
 
@KarelG batching is complicated. They can't just replace an immediate backend with a batching one without frontend changes.
 
6:20 PM
not with that attitude
 
I came so close to getting that exact thing to work for NWN and it just doesn';t
 
@ssube The task is: I have either a list of 5 selectors or 20 elements that I want to update the background color of on each frame. Right now I generate the CSS, then push it into a style element with jQuery.
 
when there's no final render call to terminate the frame, it's impossibleh
@JanDvorak that's not really animation, m8
 
debounce the other calls
 
performance while tweening is the problem with animations
 
6:22 PM
replacing a code isn't "batching"
 
Then I guess GSAP won't help me?
 
you only have to change the method body of a function that does the animation
just to clarify: i don't know the whole internal structure. Not sure if it's a spaghetti mix of functions or a lasagna mix ones
 
I've just realised I'm building the final CSS by repeated concatenation. How much time can I save by switching to join and by leaving out unused selectors?
 
@KarelG it has it's own queue, the updates are batched with self.requestAnimationFrame
 
@JanDvorak why not just template your CSS?
@FilipDupanović RAF != batching
Batching in the context of the DOM means creating a detached node, making all your changes there, and swapping it for the attached/visible node in the RAF callback.
It triggers a single paint/reflow, which is jQ's biggest problem (it touches each node, one at a time, causing millions of individual box draws).
 
6:26 PM
that's not what the RAF callback is for, but you're welcome to apply DOM updates that way
jQuery updates DOM attributes, instead of relying on host animation
 
@ssube The set of selectors is changing, so I'm not sure what you mean
 
@JanDvorak then templates probably don't make sense
@FilipDupanović lol what do you mean RAF isn't for updating the stuff being rendered?
 
Royal Air Force
 
i've been coding since 4am
it's 2:28pm
 
O_O
Weird work hours
 
6:28 PM
@JossieCalderon some of my best work was done during a 40 hour stint fueled by coffee and cigarettes
 
I can't recommend nicotine consumption
 
I was unemployed at the time, so I took a few days and just slammed out half of the features COM had
 
(-_-) ....zzzZZZ
 
It scares me that people are not able to read simple well defined errors. — Quirk 1 min ago
 
I work whenever I'm awake...I cannot take time off, I've tried.
I was supposed to workout at 6AM and skipped it to program JS
 
6:36 PM
0
A: Javascript: Array of arrays into two arrays

Suren SrapyanUse this and don't ask again this kind of questions. var mainArray = [[apple,3],[orange,8],[blueberry,2][pumpkin,7]] var fruits = []; var numbers = []; mainArray.forEach(function(arr){ fruits.push(arr[0]); numbers.push(arr[1]); });

le sigh, cv-pls
 
@ssube been a problem lately :/
 
@ssube at least he's nagging the user :-)
 
heard of a colleague that there was a student doing intership for 12 weeks, in order to get his grade. He even was unable to solve obvious error messages. Yet at the end, he got graded, even if his work was not appraised and used anymore.
@ssube loser deleted his post
 
> Here is the code ,
 
Pretty impressive scores
 
6:46 PM
@KarelG 3 of the 7 answers on that Q have been deleted
 
yeah, i see it now
 
78
Q: Show current close votes to low-rep users who are considering answering a question and to the OP

Sotirios DelimanolisIn a continuing effort to bind Stack Overflow users to my will attempt to improve this site, I suggest we show accumulated close votes prominently to users that don't have the corresponding privileges. Primarily in cases of duplicate, unclear what you're asking and why isn't this code working c...

I'm tempted to open a new meta post asking for a prompt when you're answering something with 3+ CVs, but meh
 
i understand that was an awful question, but how is it too broad, or off topic for "why isn't this code working?" when there clearly isn't any code that couldn't be working?
 
no effort has been done
 
@KevinB that's exactly what it's off-topic. The body of the cv reason explains it.
 
6:49 PM
The answers are equally as bad; no explanation, no understanding of the issue, just a code dump... "here is the code" bullshit.
 
> Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.
 
right, but this question isn't seeking debugging help.
 
> must include the ... shortest code necessary to reproduce
 
> Questions seeking debugging help...
 
there is no MCVE, it's somebody asking for handouts
 
6:50 PM
@KevinB I vote too broad. "how do I add numbers" is too broad. there will be every possible outcome
 
One of those terrible answers that just says "Here is the code" has +1 right now... I bet he got his friends to upvote him.
 
we can't help them debug their code unless they post it
 
they don't have code to debug
 
if they have no code, then it's the most off-topic it can possibly be
SO is not a "please write my code for me" service.
 
but that's becoming a trend :/
 
6:51 PM
I'm sure there's a meta post where the moderators go into that in depth, but it's pretty well known.
Now, language-lawyer questions do kind of fall outside of that, since they're about the spec and not the code. But they're usually good questions with extensive, well-researched answers.
 
@ssube /thread
 
@ssube any question can be ansered with a pearl
 
!!afk unknown
 
@JanDvorak nah, I've closed some really bad ones recently.
 
Even those can be answered :-D
There's a four hour grace period
 
6:54 PM
I also wasted a bunch of time writing a good LL answer to a meh question: stackoverflow.com/questions/37863741/… :(
 
Here, have a cookie
 
So, I went to buy new discs for disc golfing, what the fuck happened to the prices?! $25 for a mid range driver, and $15 for a putter?!
 
What's a disc golfing?
 
throwing frisbees at people instead of dogs
 
frisbee
 
6:56 PM
cute
 
This is the worst abuse of the map method I've ever seen. You're not even returning a value to map to... — ndugger 14 secs ago
 
@ssube You're thinking of ultimate frisbee. Disc golfing is golfing with discs, but instead of a hole, you're trying to get it into a basket at the end.
 
Dude posted his answer twice to try to get out of having downvotes...
Downvote, wat? so many haters LOLS! — U r s u s 2 mins ago
 
I thought this was for drying pets. Put inside and spin up.
@ndugger downvoted for saying "haters"
and "lols"
 
@ndugger flag it
 
7:01 PM
That entire thread is a clusterfuck of terribleness
 
ask a guy who just deleted two classes and left everything as functions because he forgot to include "typeof" keyword in his checks for undefined variables anything
 
@ssube I'd rather he get twice the amount of downvotes
 
lol he's nuts
 
why can users delete their answers?
stupid answers should left visible so that people would think first before posting an answer
 
@KarelG it's useful when you're wrong and don't want to look like too much of a fool
 
7:04 PM
lock it out then, so that it doesn't get down/upvotes
 
that's not a thing, but you could suggest it
 
don't think it can be locked yet
at least not by normal users
 
unless it's been deleted, you can vote on it
even the 20k/mod locks don't prevent that
75
Q: Can I have a dump of rude/abusive comments?

Petter FribergWe already know it is possible for a machine to be taught to classify comments automatically. This incredible post used machine learning techniques with an initial training on known good and flaggable comments in order to classify any comments. One of the answers of that post mentioned that it w...

 
oh my fucking god
i did it
@KarelG it's been done
 
In my opinion, the issue is that users are answering questions that they either know to be bad, or that are just bad and they don't know the rules well enough. If a question is bad enough that you expect it should be closed, you should not add to the clutter by answering it. — ndugger 18 secs ago
 
7:12 PM
if Jan wants to waste a bunch of rep downvoting everything he can find, who are we to stop him?
not moderators, that's who
 
about that dump of comments
 
I downvote bad answers on bad questions as well.
 
a ML algo should work independently of the data input
 
@KarelG but how will you train it initially?
 
with self constructed data.
that doesn't take a day to construct one.
 
7:16 PM
@ssube Thanks for the support. I think I'll just continue having given up all hopes on SO and the humanity.
 
@KarelG but those aren't realistic comments
 
It's National Aboriginal Day! Join us in celebrating First Nations, Inuit, and Métis peoples. #NationalAboriginalDay https://t.co/eB3fBizjqN
it's lemon's day
 
> A few people on meta have no chance of capturing the full gamut of creative insults the wider community slings around
 
I think this chat could contribute, and if not, the lounge has a great reserve
 
@JanDvorak of sexual assault jokes? That's about all the lounge has.
also, @KevinB, for reference this Q is very similar to the previous one but they actually tried something (even if it didn't make sense). That makes it significantly less bad.
 
7:20 PM
The last time I was in lounge was when they shouted at me for flagging an image full of racist assaults and antisemitic imagery.
 
I don't see how that's any different
 
> they actually tried something
 
it's less clear than the other
 
they didn't just show up and ask for somebody to write code for them
it was wrong, sure, but SO is for code that doesn't work
 
so, it's a debugging service then
 
7:22 PM
that's exactly what SO is supposed to be
codereview is for when your code works, programmers is for when you don't have code yet, and SO is for debugging code or the spec
 
No, SO isn't here to debug your code, it's to answer the questions you get when you debug your code.
 
^
but otherwise, yes. He should have taken his Q to programmers SE to get an understanding of the concept that he's trying to achieve
then he should have written code
 
@ssube what am I not getting? jQuery computes the next properties and updates the elements before returning from the RAF call... and that should block the next repaint
 
@FilipDupanović jQ has nothing to do with RAF and operates in its own update loop, which updates elements individually.
it is the antithesis of batching
 
what stops you from using jquery to update a detached dom frag, and inserting it into the dom once? how is that any different from what you're suggesting?
 
7:26 PM
@KevinB that works for general updates, but not so much for animations.
 
@ssube it has it's own effect scheduler, elements have an effect queue and it's tick is synced with RAF; between two ticks, everything is updated in a single pass
 
You'd have to pull the whole node tree out of the DOM before jQ updates them, then put them back.
and it doesn't have hooks to do that
 
@FilipDupanović are you arguing for the merrits of jQuery? You can't win this battle.
 
I'm not getting something; what's the difference between removing a node, updating it, adding it back and simply updating it in the same execution block?
 
@FilipDupanović the number of repaints that happen
remember, we're talking specifically about batching, which only applies to multiple nodes
 
7:29 PM
there is one repaint
with several different areas that have to be repainted
 
@ssube I don't see where he tried anything in that question other than array1[0]. he simply listed what he has and what he wants.
 
@KevinB that is what he tried. It may not make sense (that's why there's a question about it, obviously it's not right), but it was something.
That other question, they didn't try anything at all.
 
in PHP, 16 mins ago, by NikiC
This JS beauty came up at work chat today... 😱 https://t.co/woV9DYT0Nm
noice
 
By "JS Beauty", I expected the picture to be of me.
 
@ndugger but then
 
7:36 PM
that url is hideous
 
it's apparently a hard picture to find
 
Guys :| why do a lot of developers like to use "magically" named files? IE, "if you name your file this specific way, it does something different"?
 
@corvid that's not a thing
 
because of autoloading, for magic file discovery/enforcing consistency
 
@corvid because they are bad, lazy people
 
7:37 PM
@ndugger in meteor it apparently is, why can't they trust me to do anything for myself? :|
 
it was a fad with some Java runtimes in the late 2000s
"convention over configuration"
 
oh jesus christ... magic strings...
Don't do that
 
kind of a push-back against Spring's infinite XML files, so they decided that instead of manually configuring everything, you just set up a few magic files
 
I don't get why they don't just have an entry file that imports every file, and then execute that, instead of having some wonky convention for it.
 
conventions are good, but automagic powered by conventions was overcompensating
 
7:39 PM
So, what is the desired middle ground?
 
@corvid well, thankfully that's how ES6 modules work; all the imports and exports have to be statically resolved
 
You don't need a middle ground; don't use magic strings or numbers
 
@JanDvorak specify the name of the config file but assume the contents follow a preset structure, for example.
The problem with Spring was that you had an XML file for each little thing and had to load and parse them yourself, then feed them into the runtime.
 
So stacks like Grails went hard the other way, where you just put a file in with the right name and it evaluated your file (even Config.groovy) as actual code.
 
7:40 PM
I spent like a half an hour just trying to get my tests to load, only to find out you have to name them some ~magical way~ that makes everything work, and if you name them that way, they automatically load... but if you import them to a file, it does absolutely nothing... so counter-intuitive.
 
It's equally bad, maybe moreso because then your config file actually gets executed.
 
@ssube sounds like fun with user-uploadable files
 
You should settle somewhere in the middle, where the user can decide what file to load, but you require it include certain pieces of data.
 
That... sounds too reasonable
 
@ssube it changed later on, you could have used objects to configure the runtime
 
7:42 PM
@JanDvorak potentially, yeah. You botch one upload form, let them enter /opt/app/config.groovy as the path, and they can easily put in a whole class.
@FilipDupanović that was too little, too late.
 
and decorators came and you could have had a viable XML-less configuration
 
even then, have you seen the sheer volume of annotations you need on a full blown spring app?
 
*annotations xD
 
it's more tedious and error-prone than feeding in a dozen XML files
so Grails and RoR, especially, just assume things will be somewhere
 
yeah, but I guess lots of them became standard at some point
 
7:43 PM
it's great until you want to do something slightly unusual
 
I think overrideable defaults are the way to go. Like in webpack, it uses webpack.config.js by default but you can also specify exactly what to use
 
I'm partial to the env['CONFIG_PATH'] || './config.json' sort of style, where you provide sensible defaults and allow them to be overridden
 
By way of providing a config file full of default settings?
 
@JanDvorak something like that. Typesafe's config library does a beautiful job of merging multiple files.
So you literally provide reference.conf and let your users provide their own partial file.
 
7:45 PM
good old plain and simple process environment
 
someone said on SO that Google released a kernel patch to allocate more bytes for the process' environment so that they can fit in their configuration
 
Hiera does the same thing when you're looking up data for Puppet, so you can set up trees with an increasingly detailed description of how the machine should be provisioned
garylarizza.com/blog/2014/10/24/… (@Luggage, if you're looking at ansible/puppet, you might want to check out that blog)
 
> “Application servers in production use one version of java, and those in dev use a different version”
hem.
 
@FlorianMargaine some people like doing bad things
 
7:50 PM
@ssube there is bad things and suicidal things
 
we technically run different versions, because our RPMs depend on Java and we pin to the release, not the patch
it has yet to bite us, though, since RH is pretty conservative about their updates
 
Will do.
 
different patch versions because they're provisioned at different times is mostly fine, really
also, you run java, so you're already doomed anyway
speaking about this
 
Gameplay of the Skyrim Special Edition leaked:
 
@FlorianMargaine mmmm yep
 
7:52 PM
@ssube what's the minimum RAM amount you can use for a java web server?
like, something usable
for a couple of users
(i.e. staging server)
 
@FlorianMargaine the good ones, embedded-type stuff, you can get away with 256MB if you're lucky
512MB is usually plenty
 
@ndugger So instead of a Daedric helm, you wear a bike helmet?
 
@ssube nah, stuff like Play! or w/e last trend it is
 
@Megaplex Something like that, yeah
 
@ssube ouch.
 
7:53 PM
@FlorianMargaine Well, it depends on whether it's running itself or in a container.
 
@ssube ?
 
@SterlingArcher You in here?
 
what kind of container are you talking about?
 
The containers are heavier, although Jetty can run in 128-256
 
@TylerH kinda
 
7:54 PM
ok
 
Java web containers, the J2EE stuff
 
@SterlingArcher Codename Duchess just go renewed for 3 more seasons (!)
 
the jetty, something-bear, and something-fire ones are all super light
 
@ssube thanks, that's better
 
7:55 PM
we run our integration tests against a real version of the app running under jetty, iirc
 
10 seasons and a movie!
Well, we can work on the movie later, but...
 
the smallest thing we offer is 128MB, and we're wondering if we can offer a java-based hosting
 
Spray and the other stuff tend to be heavier, but whether they actually use that is up to the app
if you disable hot reloading, that cuts the footprint quite a bit
 
the RAM amount that java uses is defined/fixed at startup, right?
 
my smallest working (load-serving) server could run in 128mb until I added Shiro auth and Guice DI and stuff
@FlorianMargaine ehhhhhh, not really. There are min and max flags, which are initial allocation and maximum allocation provided to the VM's generations.
Actual max is 120-150% of the max flag
 
7:57 PM
@ssube ok, then the process gives or takes more or less of the system's virtual memory?
 
Java 8 made that better by putting the class (code) memory space into the GC generations, so it stopped being excluded.
@FlorianMargaine roughly. The minimum is an actual minimum, the max is more vague.
375
Q: What are the Xms and Xmx parameters when starting JVMs?

PankajPlease explain the use of Xms and Xmx parameters in JVMs. What are the default values for them?

 
@ssube I guess my question is more like, can it play with swap fairly nicely? as in, sometimes going into swap but then coming back?
 
huh, the default max is 256
@FlorianMargaine the VM itself, sure. You'll have the usual performance problems, but that's about it.
a 256mb VM with a 128mb JVM is tight, but not impossible
 

« first day (2075 days earlier)      last day (2876 days later) »