« first day (1621 days earlier)      last day (3326 days later) » 

3:02 PM
@dystroy: I am injecting code, but at a higher level. I build a Javascript code as a string, and eventually trap it in vm.runInNewContext().
 
@sdenel 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.
 
Does anyone happen to know what can cause blank lines in the output of uglify-js?
 
@sdenel And you can't change the last expression in order to wrap it in a store(thatExpression) thing?
There are many JS parsing libraries that might help you do it without naive errors
@RoelvanUden I never got blank lines with uglify
 
The expression is not from me, but doing it automatically would answer the question if it is fast enough (I see you are joking my way to ask: I am not a native...)
 
@sdenel I'm from the same country. And I'm not mocking you, I just see you don't know how to ask a question without getting lost in false questions
 
3:05 PM
@dystroy Hm. I'm invoking it from CLI on version 2.4.17 and for some reason I do get them right now. I have no idea why or when this started to happen; I did not have this in another proj
 
0
Q: Anonymous define() module in library's dependencies causes breakage for library's dependents

RetsamI'm working on a library that is used in a number of web applications. The library itself does not use RequireJS - it's written in node, and then bundled with browserify - however, some of its dependents are using a RequireJS shim to include the library. What we've found is that the RequireJS...

^ If anyone has any insight on this it'd be much appreciated.
 
@dystroy Oh, weird! I switched to 2.4.16 and it's fine now.
 
@dystroy: Well, you have your point on the fact that my problem should not have implied using node terminal. I thought the answer would be easier. Let me try to isolate my problem furthermore, and come with a better question.
 
@sdenel Maybe ask here first, at least to check the question is clear ?
 
deal :) thank you!
 
3:10 PM
We don't care too much for rep : if we have a simple answer, you'll be avoided the pain of asking on the main site ;)
 
you made me wonder how long its been since I asked a main site Q
 
I remember the last few times I almost asked a question
But then I figured it out while writing it out
 
its been 985 days since I asked as main site Q
 
@rlemon Almost 3 years
 
Mornin
 
3:13 PM
Well, most of the times I stop before putting the ask button
 
I should utilize main more
 
in Python, 2 hours ago, by Kevin
I want to build the next Facebook. What color should I choose for the laptop that I'll be using?
Hahaha
 
It's been 12 days since I asked a question on Main
3
Q: cgi.SERVER_NAME reverts origin

Sterling ArcherI have two versions of a site, one for spanish, one for english. The spanish subdomain is set via IIS and a C Name (network admin told me, I'm not sure how or what that means), it's not a separate subdomain. es.website.com en.website.com Now, when I use CGI.SERVER_NAME on my development server...

 
But recently I've had reasonably good results when asking SO
 
good results too
 
3:13 PM
Yeah, I tend to use Stack Overflow as my rubber duck a lot.
 
I've spent more time asking than answering in the last month
@SecondRikudo that's it
 
What's the most popular css minifier (the counterpart of uglifyjs :P)?
 
My last question was a +15 :P
also closed
 
@RoelvanUden Less?
 
that's not a minifier
 
3:14 PM
Assuming you're in node environment
@dystroy Can be ---ab---used as such :P
 
My last question was a mess
 
Nah, I use Less. Just to combine third party with my own css for a 'release' minified
 
ffs broken markdown.
 
Also made one person RQ and delete his answer
 
@SecondRikudo well... yes... you're right ^^
 
3:14 PM
And yeah, node environment :-)
 
@RoelvanUden In that case, just pass the format flag to less, and tell it to minify it as well
Has sourcemaps and everything
 
@BenFortune This happens. Even to 100k+ rep users. The key is to learn from the disaster but not to care too much
(source: obvious)
 
@dystroy You can tell from my edits why he did it though. :p
 
@SecondRikudo That's not what I'm after. I want to combine dep.min.css (bundled CSS from bower dependencies) and app.min.css (my LESS output) into a single huge bundle of minified css. I found clean-css and cssmin but I have no idea what the "standard" thing to use is (from a CLI, anyway)
 
concatenating isn't enough ?
 
3:17 PM
@RoelvanUden Uhhh, gulp-concat?
 
I don't use gulp grunt and so forth
 
@RoelvanUden ...
 
@RoelvanUden cat
 
@RoelvanUden task runners? who needs em amirite!?
 
3:18 PM
Promise.all(['file_a.css', 'file_b.css'].map(fs.readFileAsync)).reduce([].join).then(fs.writeFileAsync(fs, 'result.css');
No idea if that works, but it might ^ :D
 
@rlemon exactly!
 
cat dep.min.css app.min.css > bundle.min.css
there ya go
 
I love how all the solutions don't actually do any minification at all. ;-)
 
Now I have to try and see if that works :D
 
@RoelvanUden well, just pipe with less
 
3:20 PM
@RoelvanUden Well, you did say that both of your files are already minified.
 
It appears the problem is... the question itself. The string "var x = true; x;" is indeed not an expression. This will come from the user: but eventually, I should ask the user to give me an expression, should he use a closure for that.
I suggest to let the question on the main site: the answer using "_" is not useful for me, but replies to the question.
 
@SecondRikudo I didn't say that. Where did I say that?
 
4 mins ago, by Roel van Uden
@SecondRikudo That's not what I'm after. I want to combine dep.min.css (bundled CSS from bower dependencies) and app.min.css (my LESS output) into a single huge bundle of minified css. I found clean-css and cssmin but I have no idea what the "standard" thing to use is (from a CLI, anyway)
 
My LESS output does not imply it is minified though.
 
@RoelvanUden it's quite obvious that a file called .min.css is minified, even if you didn't say it.
 
3:21 PM
@RoelvanUden app.min.css does.
 
otherwise don't call it .min.css
 
Well.. it's not. Forget I asked. I'll go back to doing things based from popularity.
 
so.. can you like, run node app and have access to REPL with the context of the app?
 
that's obfuscation :
> Oh no, it's called ".min.css", I won't open it as it's minified
 
3:21 PM
90
Q: import .css file into .less file

Mr Jonny WoodCan you import .css files into .less files...? I'm pretty familiar with less and use it for all my development. I regularly use a structure as follows: @import "normalize"; //styles here @import "mixins"; @import "media-queries"; @import "print"; All imports are other .less files and all wo...

Second answer
 
use at your own risk :D
 
anyone used tty.js?
 
except you, no
 
how do I programatically send commands to the shell from the server?!
 
You're missing an 'i' and another 't'
 
3:23 PM
hot damn, lack of docs is super annoying
 
@rlemon no, it's fun (I wrote a similar simpler thing) but there's really no point
 
well I've found a point for it :P
 
are you just trying to tunnel your shell connection through a browser because they don't want to open you a port for SSH or what ?
 
@rlemon child_process.exec()?
 
@dystroy it is a super long and convoluted scenario -> I need to develop a bandaid solution because the real one is a year off.
 
3:26 PM
@SecondRikudo there's an exec npm somewhere that deals with some issues better than child_process - if you need to execute commands on non-unix machines I'd use that instead
2s
 
so I need to send commands from a node server running tty.js that is pointing to a ssh shell that communicates with a program that talks to another device
like, there is 3 node servers and 5 devices in the chain
it is cray cray
 
yea I don't need that
 
0
Q: How to know the button pressed among buttons in the div in Javascript

Strange90I have a div of 4 buttons, when I click on any button it redirects to the same page for all the buttons, I want to know which button the user has pressed before going to the next page, I've been trying, but couldn't find that. Here is my code : $( "#buttons" ).click(func...

 
shelljs uses tty.js
 
3:26 PM
@MoshMage If your app needs to execute a unix process, unless you need to do very specific thing, you're doing it very wrong.
 
Never thought I'd see $(this).attr('id')
 
@rlemon Can they be combined to shtty.js?
 
But there's 2 answers in there that use it xD
 
0
Q: Jquery round number to 1 decimal place

user3384664I'm not a javascript programmer, but need to make a change in a script to round the answer from the script below to one decimal place. I've tried various solutions I've found here, but I am clearly doing something wrong as none have worked for me. Script is below, any help is greatly appreciated!...

 
@SecondRikudo nah - I'm using it to spawn a find -name file output :) it's more of a b2b tool than anything
 
3:28 PM
@SecondRikudo: that's BAD xD
 
it was written in nodejs because people at the company I work at said, and I repeat, "If you write that in bash no one will be able to maintain it" :(
 
@Cerbrus once again:
Seen today in a #StackOverflow *answer* : $(this)[0].getAttribute('src')
 
@MoshMage Unusable in local environment in Windows.
 
@SecondRikudo nah, everyone uses gitbash here - so i'd be fine with it ;)
 
@MoshMage Until... they don't...
 
3:29 PM
(heck, I actually wrote it in Windows xD)
 
hmm, can some1 explain the "david-programming" tag to me ?
 
Feb 23 at 0:42, by phenomnomnominal
room topic changed to JavaScript: Read this: rules.javascriptroom.com. Before asking inform yourself on the XY problem goo.gl/taIqf | Angular is on topic here stop asking. Don't ask to ask just ask. [cereal] [david-programming] [ecmascript] [es6] [javascript] [we-so-excited]
read context above
 
@SecondRikudo nope; every windows machine here has gitbash. it's like "mandatory"
in quotes because it might be that someone or another uses another console, but it will eventually be the same as a gitbash (or more complete)
 
@dystroy mother of god
 
@Cerbrus ...
I see it now. Thanks! — Radio 36 secs ago
 
3:31 PM
@MoshMage Until, it's not.
 
says they got it, still doesn't fix answer :(
 
find is a dependency on your application that isn't declared anywhere.
If a system for some reason doesn't have find, it will blow up and you'll have a hard time debugging it.
Not saying it isn't good for now
Might not be as good tomorrow :)
 
@SecondRikudo Ah! I understand :)
Well. It'll suck when that happens, but it'll be something that'll keep me entertained :P
 
Blarg, dunno how to nest loop objects in thymeleaf/select2
 
i just red from a newspaper article about a woman trying to marry with a tree because she got nice orgasm experiences with that. A fucking tree ? Or is it Groot ?
 
3:34 PM
anyone here understand how to use quaternions?
 
that's math shit
maybe @KendallFrey
 
Dendrophilia (or less often arborphilia or dendrophily) literally means "love of trees". The term may sometimes refer to a paraphilia in which people are sexually attracted to or sexually aroused by trees. This may involve sexual contact or veneration as phallic symbols or both. One such example is EmmaMccabe who has said that she is in love with, and has plans to marry, a poplar tree named Tim. == References... ==
 
haha indeed it is
 
The tree even has a name?
 
didn't knew that there is a term for it ...
 
3:36 PM
Necrophilia: the uncontrollable urge to crack open a cold one
8
 
@Kippie yes, "Tim"
 
@rlemon: I see that way too much. "Oh I got it now, thanks!" *Completely ignores suggestions*
 
@AnthonyA yeah, sorta
 
I love it when they do actually edit the answer, then. I feel might and powerful, and then retract my downvote and give a standard-issue upvote.
 
@Cerbrus: of course you are right, but thats nothing to get mad about. anyway thats not the problem here. moreover, its that he adds the click listener to #buttons instead of button. Let him learn the logic first, then he can try to switch from jquery to js. — cari 13 mins ago
"Let him learn the logic first, then he can try to switch from jquery to js. "
Wat
That's completely backwards.
 
3:40 PM
oh hey @KendallFrey I talked to you the other day :)
 
jQuery removes all logic in favour of $wat
 
So you suggested I use SLERP
 
@AnthonyA what a coincidence, I also talked to you the other day.
 
but I'm finding thats not what I needed
 
I spoke to myself.
 
3:41 PM
@AnthonyA for eliminating gimbal problems in animation, yes
 
it's wtf hour in the chat...
 
the quaternion itself eliminates the gimbal issue
 
kendall, are you a mathematician, CS'er or IT'er ?
you even know what quaternionshit is
 
just a nerd
 
just a nerd? Nerds are the best kind of person, though. We secretly rule the world from behind a keyboard
 
3:43 PM
you want some ever more mind-blowing shit, try octonians
 
@KarelG well, if you don't know what a quaternion is, have fun with gimbal lock
 
@AnthonyA Well, what you need depends on what you want to do with it
 
so it's a simple concept really
 
quaternions will seem a lot better when you're stuck looking up and spinning circles forever
 
@ssube i know that term from robotics, but heck, you don't have to specialize in everything
 
3:44 PM
my iOS device gets the quaternion value based on its orientation - I need to take that quaternion and convert it to an angle so I can draw it on a screen
I'm trying to make a level app
 
an euler angle, or an axis-angle?
 
@KarelG no, but even dabbling in graphics or games, you pick up the spacial stuff pretty quickly
and most developers, at some point, get that urge to make a game
or a text editor, but that's dumb
 
if you can use a library ...
 
I guess an axis angle would work as well
 
well, um
 
3:46 PM
maybe when I need is a 4dmatric
 
presumably you want to display it in some form
 
*4dmatrix
 
what form is that?
 
no Idea, just see people using it :D
 
um...
if you don't know what you want, I can't help you
 
3:47 PM
has anyone here built a native app using atom-shell?
 
well my question is, how to I properly draw an angle from a quaternion
 
a quaternion is not an angle
it is a 3D rotation
and angle is effectively a 2D rotation
 
Damn, Steve Jobs is alive
And it's raining upvotes on my trivial answer...
 
right, but I need to get values from 3 axis
yaw pitch and roll
 
that would be an euler angle
how are you intending to display it?
 
3:49 PM
that's something i do know
 
just 3 numbers?
 
if the orientation of the device is vertical, facing you
I need to display the x and y values
 
you need to define your terms
 
if the orientation is flat facing the sky, I need to display z and z
 
the crew shall go free
 
3:50 PM
*z and x
 
I don't know what "vertical", "x-" and "z-values" are
 
nobody?
Pirates of the Caribbean joke?
no?
:(
 
can't you get banned for such a joke ?
 
vertical is the typical phone orientation
facing you, as in your hand
 
@dystroy I loved the first movie; johnny depp was fantastic
 
3:51 PM
@dystroy depends. You can get planked depending on the crew.
 
@AnthonyA perhaps you should say exactly what you want to display
 
I'm looking to draw a horizon on the screen, that should always remain "level" regardless of device rotation
 
that's only affected by the z-axis though, right?
 
Talk about an XY problem
 
3:54 PM
in this particular orientation, yes
 
Kendall, i think that you're facing a possible-XY issue
 
if not, you need to be more clear about what you expect to see when the phone is held at an arbitrary angle
 
/goes away
 
well, lets just say yes for sake of simplicity
there are other things that need to be done in other orientations, but lets not go there yet
 
Don't forget the zed
 
3:55 PM
what if the phone is rotated 45 degrees on each axis?
 
If you rotate a phone on the Y angle, the horizon doesn't change.
Same for rotaing it on x.
 
exactly
thats fine for now
 
@Cerbrus uh, same?
what if you flip it upside down?
 
That's z
 
i no longer display a horizon
its a bubble level at that point
 
3:56 PM
whaaaaat
 
wait, no sorry
its still a horizon
if its flat, its a bubble level
 
...
 
:p
 
you mean it's not a continuous display?
 
You're aware there's a billion apps like that already, right?
 
3:56 PM
it changes form based on orientation?
 
yes
and yes
 
So? Let the man learn
 
ugh, so what are the different forms?
 
Not everything has to be sold or distributed. I make tons of shit that's already been done a hundred times before
 
if it is vertical (or upside-down), as depicted in the above image it is displaying a horizon
 
3:57 PM
Nick, you're right. That was kinda rude of me. My apologies
 
@Cerbrus I bet I can be ruder than you
 
if its flat it displays a bubble which moves based on pitch
 
bitch
flagged
 
Noez
 
obviously, 0 pitch means the bubble is in the center
90 degree pitch and its displaying a horizon instead and working off the z axis
 
3:59 PM
So where between 0 and 90 do you change from horizon to bubble mode?
 
45
 

« first day (1621 days earlier)      last day (3326 days later) »