« first day (2043 days earlier)      last day (2910 days later) » 

8:00 AM
@Mathematics Lol.. The script is now on page header. instead of on document on load. (It's in javascript setting > Load Type)
 
@choz that's what I thought too, but it doesn't seem to work for me
 
Since you bind the event on the fly.. Your javascript must be loaded before your html. So you can not use LoadType when onLoad
 
oh wait, I needed to reload page
 
@choz timing is not the issue
 
now it works, thanks.. apart from that other error
 
user3119231
8:02 AM
@choz querySelector("input") -- should return the first input it finds
 
user3119231
oh nevermind
 
var UI = UI || {};
UI.Old = {
  init: function() {
    showLatestTime.call(this, new Date().getSeconds())
  },
  showLatestTime(time) {
    document.getElementById('results').innerHTML = time;
  }
};
why am I not able to call my method without function
showLatestTime.call(this, new Date().getSeconds())
to be exact
 
@SomeGuy btw did you get any revert from that guy who tried to hire me due to the timing attack?
 
please wake me up, when you are :)
 
@Mathematics What is UI?
 
user3119231
8:06 AM
User Interface
 
@Maurice thank you..
 
@choz Have you solved the earlier minified code riddle? :)
 
@Sheepy I'm curious; what riddle?
 
@Sheepy Yeah..
 
Great XD
 
8:12 AM
I just realised, there's this includes method to find something in array..
I used to use .indexOf(n)
Or $.inArray
 
yuck
 
@JanDvorak var f=(a,e,b=[],r=[])=>(a.sort().forEach(e=>(r.includes(e)?b:r).push(e)),r.concat((b‌​+"")?f(b):[]));
 
wat
faebraerebrerbfb
 
Yeah. Includes is ES7. But it's in Chrome, Firefox, Safari (9), and have shim. I quite like it.
 
AFAIU, that code is normalizing the element e between the array r and b from the list of elements in a
and that is not a riddle. that's just some random code minified
here is a riddle: var x;. now go make sense out of it and decrypt the secret message
 
8:18 AM
u suck
 
Ok. Not a riddle. Q.Q
 
Lisp: Code is data Haskell: Data is code Ruby: Strings are code JavaScript: Undefined is not a function
3
Thank god my coworkers are not in the office I'm giggling
 
@BartekBanachewicz outdated and v8 specific joke. -7/10
 
V8 specific?
 
error messages are not standardized
 
8:19 AM
@choz Namespace
@choz thanks going to check now
 
spidermonkey has always emitted the name of the function with the message (or the expression lexeme source text) with the error. and v8 has been doing that for a while now.
 
@AwalGarg pfffffff
 
Ah ok.
 
yeah that's not the best of the decisions so far. but it hasn't been much of an issue either ~_~
(I kid. I kid. Terrible job on error handling from all sides, not just error messages.)
 
"Gold badge holders are knowledgeable about the specific subject" incorrect. — Omar 2 mins ago
I love how constructive meta users can be... -.-
 
8:26 AM
I don't see why the spec should not standardize the error messages. That may be a first in programming language. JS will make (another) history! Let's propose it :)
 
Chesterton's fence is the principle that reforms should not be made until the reasoning behind the existing state of affairs is understood. The quotation is from G. K. Chesterton’s 1929 book The Thing, in the chapter entitled "The Drift from Domesticity": In the matter of reforming things, as distinct from deforming them, there is one plain and simple principle; a principle which will probably be called a paradox. There exists in such a case a certain institution or law; let us say, for the sake of simplicity, a fence or gate erected across a road. The more modern type of reformer goes gaily up...
why do you think other languages didn't do it?
 
C# has a spec with standardized error messages, no? I might be confusing it with some other language though
 
prototype vs module/revealing module pattern, which one would you vote for ?
prototype
module
or both
 
both
 
@Mathematics Depends
 
8:31 AM
@AwalGarg I think it's mostly about giving the implementation freedom
 
prototype for actual classes, module for stateful singletons
 
@Cerbrus you can "farm" gold badges
 
@BartekBanachewicz you know what happens when implementations get freedom, right? :P
we get ... drumrolls... browsers
 
user3119231
ba dum ts
 
@AwalGarg the problem with browsers isn't with inadequate standards
it's that they don't give a fuck
 
8:34 AM
Hi guys!
 
@KarelG You can only "Farm" gold badges with quality content.
 
@BartekBanachewicz Was just thinking " is there a program language that has standardized error messages? "
 
and in all js developers writing polyfills instead of boycotting old versions
 
You can't "Farm" them with crap.
'cause you'd get downvoted.
 
user3119231
You would farm downvotes.
 
8:34 AM
Exactly
 
a fair share of the posts that led to gold badges are from (semi-) duplicate questions.
 
you can do 500 edits
 
@BartekBanachewicz for a long while that has been the problem though. It is since only the last few years that whatwg got reformed and mostly implementers took control over the spec itself. Even now that remains to be a major problem, if not the biggest.
 
I have a problem with my React component. I am trying to get its state in the render method, but it is first null, and then it becomes what it should be gist.github.com/barbu110/fe95eb32ed75a63ac04f1b0ab48ecbee and I don't understand why doesn't it have a value from the beginning. I mean, the render method should be called when everything is prepared, right?
 
@Loktar @rlemon gotta gotta
 
8:36 AM
@AwalGarg you wanted hipster culture, there you have it :P
 
Florain, do your best : hide the link
 
@BartekBanachewicz That doesn't get you anywhere when you want to get a gold tag badge
 
oh gold tag badge != gold badge
 
user3119231
rule no.1 in room 17: Don't the fuck click on Flo Margaine's links on friday.
 
Oh, tag badges.
 
8:37 AM
Does anyone here have experience with 21:9?
 
Derp
 
@BartekBanachewicz I wish I had that
 
@littlepootis what about older games
or RTS or MOBA
 
me too. I really want a bigger and wider screen so I can make better use of TWMs
 
I was looking at Dell U3415W
 
8:38 AM
is that ratio not too high ?
(that leads to stretched screen ?)
 
what's "stretched"?
 
@BartekBanachewicz Not sure. The games I play adapt well.
 
yeah well I wouldn't want to limit myself to just sims and shooters
 
@Maurice for Youtube there's YT+ and disable autoplay
 
8:39 AM
"stretched" as when a NPC suddenly became an average american: broad and fat
 
Nice read if you have the time for a short story
 
It's friday today man. I don't trust that link
 
@KarelG uh no, that's terrible
3D games cope well with arbitrary screen ratios
 
No Rebecca, promise
 
Most of the time when gaming I only use my one screen and that kinda feels like a waste
so having one 21:9 could be cool
 
8:41 AM
@Neil Nice, but not short.
 
+ work
+ sims
+ shooters

- mobas
- RTS
- 2d games
- old games
 
@Neil In-case anyone is afraid of clicking it, here is the expansion: ftp.seti.org/phillips/scifi/…
 
@littlepootis "short" story
@AwalGarg I have to use tinyurl.com because otherwise I would have to type a long url by hand (mobile phone)
 
ftfy :)
@Neil skimmed over but really nice indeed. would read again in detail sometime.
 
hi
 
8:51 AM
@ankit_m 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.
 
@AwalGarg yeah, I thought it was cool
Though I know that couldn't be, I do often wonder what would happen if it did
 
9:14 AM
3
A: Images can be pushed outside the boundaries of a post by using nested lists

HynesThis bug has been fixed using @animuson's suggestion: This could easily be fixed by using a max-width: 100%; on images Three years is a long time to wait. Thanks for your patience.

Woah
 
3 years :P
 
user3119231
someone needed some reps
 
A co-worker once resolved a bug that was known for 2 years. The customer didn't know of that "issue". It was documented, but nobody checked it. Until he "had some time", so he fixed the bug and released the update.
 
@BartekBanachewicz I am not sure. So I used "may". But I haven't read a programming language where the error message is specified in the language specification rather than in the (individual) compiler.
 
I usually wait until we switch our architecture stack and then I close all open issues as norepro or obsolete
 
9:25 AM
:P
 
Well, the adblock community celebrated when Firefox fixed a 14 years old bug/rfe.
 
It's hard to keep a product 95% bugfree. Our averages is (as mentioned in december 2015) 94.67%. (We count it by 1 - #function_that_is_involved_in_bug_issue / #total_functions )
 
@KarelG How do you measure that? That would mean you know about all the bugs at any given time, wouldn't it?
 
yes known bug
 
I am more amused at "function involved in bug issue".
 
9:30 AM
:p
 
But if you know about it, you would fix it, if you already know the function it's in
 
user3119231
0
Q: How do I resize different images to fix in the navbar

Kaushik GopalanI have a requirement where the same page can be used by different firms(our clients) and the image on the navbar must be their logo. Now, the logos that I am testing with are all of different size and dimensions. I tried some ways like setting max height, max width etc, but since the logos thems...

 
didn't know that ad block injects 1~4MB CSS data. That must be a huge style sheet
 
@KarelG It contains inline images for their own ads
 
you must be joking ?
 
9:35 AM
I didn't check, but it's ABP we're talking about
 
> Don't trust atoms, they make up everything
 
It is more than the rules. Browser will transformed the css rules to make it faster to process, and something else.
Sorry that was a link to the problem instead of the fixing. But it's not hard to find the news. Not many 14 years old bug got fixed.
 
@FlorianMargaine it's nice to hear a joke on chemistry periodically
 
"Current filter lists for Adblock Plus have around 50 thousand filters which (along with supplemental data like filter hits) require around 60 MB of memory." - 2014-05-15
 
Did you guys hear that oxygen got together with magnesium? OMg
 
9:39 AM
Transform that 60MB, copy the list and the transformed data to every tab's iframe and history cache, and it's not hard to hit several GB...
 
Nitrogen was then like, what's so great about Magnesium. Go out with me, oxygen, but oxygen said NO
 
@Sheepy it keeps it once
 
@FlorianMargaine You mean the list? Firefox made a copy for every frame because of how it process CSS. That's what the 14 years old bug is about.
 
Did you know you can write JavaScript in emoticons? It starts with flipping table and is full of mood swings.
 
9:51 AM
@Sheepy oh.
@AwalGarg why does it take String instead of [Char] ~~
that's just not a drop-in replacement
 
@FlorianMargaine aren't they both same? (I just started with haskell two days ago so dunno)
 
they are
 
@KarelG why is the doc different then?
I don't know haskell, but I would've thought it was a pretty good language and String would be unicode-aware while [Char] wouldn't.
 
@FlorianMargaine y u trollin me :(
 
String adds additional functions above array functions
 
9:57 AM
dunno, I thought haskell was a good language. Sorry.
 
:ⁿ|
 
I just hope that after learning haskell I don't become like those assholes who keep belittling every other language without knowing them at all.
 
I don't belittle every language. Ruby is still awesome.
 
See I didn't even say you are an asshole!
 
yay ^_^
 
10:01 AM
@AwalGarg nah, that's Lisp
it's not belittling though, it's just ignoring
they're just not at the same level
 
@JanDvorak what does that mean
what are actual classes, do you want to give an example please ?
 
@Mathematics function Foo() {} Foo.prototype.foo = function(){}; foo = new Foo(); foo.foo();
 
As in, stateful objects with methods
 
I know the syntax, just don't understand the point
 
Though, you can use a module pattern for these as well
function Point(){var ...; return {...}}
 
10:05 AM
prototype vs module, only real difference I could understand is that,

you can access all members of prototype as they are public, whereas module won't let it's private members being called outside of it
 
what does the ~ operator do?
 
bitwise complement
 
@deostroll it's called "tilde"
you can easily google it, that way
 
function perfect(x) {
    var p = 1;
    do {
        var root = Math.pow(x, 1 / p);
        var best = ~~root === root ? p : best;
        p++;
    } while (root > 2);
    return best;
}
basically this is testing if the number is a whole number or not...but how does it do so...
 
@deostroll google it.
 
10:09 AM
Quiz Time....

if we have n foo objects, each foo object can have n bar objects

we have id of bar which is unique, what would be the easiest way of getting bar object by id ?
 
!!tell Mathematics google what is the point of object oriented
 
^--
 
@Sheepy I already know ?
 
I think you just said you don't understand the point of "class"?
 
If you understand OO programming, then then you should be able to solve your problem yourself don't you think ?
 
10:11 AM
@Sheepy no I said I don't understand how prototype is for classes and module for stateful singletons
@KarelG I am not sure where that comment is coming from and where it would go
 
I am creating a new language. Everything in it will be of a single type: a data-structure which serves the purpose of all data-structures ever, functions, event emitters, expressions, statements, numbers, strings, operators, macros, special keywords, monads, etc.
 
@Mathematics I don't, either. Some people use prototype as class and some use module with singletons, but they are not the same thing, so you don't have to treat prototype as class and you don't have to always put singleton in module.
 
I can't believe I am reading this...

Sorry for this answer, but you need to pass data into url, only in URL, try to see if your lib can retrieve information from posted data....
how can one pass data into url ?
 
Having all of these things in one type as first class citizen gives maximum freedom.
 
@Mathematics Do you think it means data uri?
!!google data uri
 
10:14 AM
@Sheepy I am not sure what it means, it is coming from this answer
 
Ok. Caprica is not with us. Must be busy conquering the world.
 
0
A: How to reflect URL back to query builder

Daniele PratelliSorry for this answer, but you need to pass data into url, only in URL, try to see if your lib can retrieve information from posted data. Here an example, create form to page and post data, so you can send many types of data and all filters you need. var form = document.createElement("form"); v...

 
@Mathematics +1
@Mathematics creating another index
 
@Mathematics 100 rep ending in 48 minutes.... hmm.....
 
this isn't related to OO at all @Sheepy @KarelG
@AwalGarg sounds almost like Lua.
 
10:16 AM
I think conversation mixed up lol, earlier today I was talking about prototype pattern vs module pattern, then Quiz time started lol
 
@BartekBanachewicz lua doesn't have first class event emitters and continuations and call/ccs. IIRC it doesn't have macros either.
 
@BartekBanachewicz looping through objects to find a given object with provided id ?
 
my language will be best language
 
@KarelG if you do that, you suck
Lern 2 DBs
 
Who says that i use objects for that ?
 
10:17 AM
you did
 
No
 
@BartekBanachewicz Well I only had the statement "what are actual classes" and "I know the syntax, just don't understand the point" to work with at the time.
 
oh wait there was another question above
 
Bartek, I forgive you.
* touches your front head *
 
@KarelG that still kinda sucks
 
10:20 AM
@Mathematics Ok. I think the answer means composing a url that feed OData with form data... which I don't think is what you want. But I do not know it enough to answer your question, sorry.
 
0
Q: LIferay: How to minify CSS and JS file included in jsp

DramorianI am using multiple css and js files in one of my Liferay portlet. CSS and JS files included in liferay-portlet.xml file are automatically getting included in page. Apart from files mentioned in XML file I am using external CSS and JS file using Link and Script tag. How can I minify these files...

 
@BartekBanachewicz yes, but he asked for a how-to. It reminds me to EF with LINQ in ASP.NET. Or JavaEE :/
 
10:39 AM
@FlorianMargaine @Loktar get down!
 
wow to get attention people are adding there questions as answers :L
 
11:01 AM
any mod here ? my question is hacked...
 
Guys, my opinion is that this question is too broad. Should we close it ?
0
Q: In JavaScript, is prototypal inheritance slower in performance than class-based in Smalltalk?

Richard EngMy understanding is that in prototypal inheritance, you always search up the prototype chain during runtime, but in class-based Smalltalk, the method lookup is already "wired" in.

 
@DenysSéguret are you a mod ? or have similar privileges ?
 
@Mathematics No. I'm just a peasant
 
you mean peanut ?
 
I'm the lowest class there is, no privilege or nothing. Let me plow in peace.
 
11:06 AM
lol lowest class with diamond in pocket (aka rep) :P
 
@ajax.actionlink (...) in this method what are ajaxoptions
 
@HarshilShah 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.
 
@Mathematics hacked?
 
@littlepootis yes, this guy posted his question on my bounty question, now everyone think it's related to my question when it's not
 
He questioned your bounty question?
 
11:14 AM
@Mathematics links ?
 
how to sample up audio?
 
@Abhishrek wow, I didn't do that for a long time
 
I have some code I wrote years ago, that downsamples a webaudio stream
to make it 16Bit 16000hz Wav
 
that's not really PCM though
 
I should have said DSP* my bad :P
 
11:24 AM
@Mathematics Flag it and wait for it to trickle through the review queue.
 
on the server I want to now up sample it to 44100 so that I can mix it with an mp3
I thought of doing linear interpolation but that will destroy the audio quality (although I accept that Audio quality is gone to hell in the 48000 -> 16000 downsample anyway, but why do more damage?)
 
up sampling is always fun
 
Is prototype slow? My comment: "MDN has a page that talks about how JS engines optimise prototype property access... Kind of like how everyone should search before asking on SO in theory, but in reality it rarely happens."
 
I still want math for this: var best = ~~root === root ? p : best;
 
@deostroll "If root is an integer, best is p, otherwise keep best as best."
 
11:27 AM
Positive integer?
 
My mistake. Corrected. Thanks.
 
anyone know what is ajaxOptions ? and what is its use in @ajax.actionlink method
 
Thats is what I don't get...root is an integer part...
on mdn you've something like: 11111111111111111111111111110110 (base 2) = -10 (base 10)
how is that...
 
Don't think about it in binary. Leave that to... those who write compiler and language specification.
 
^
@Sheepy followup on the js mixing audio thing
it works okayish
if the samples are 16 bit signed int
 
11:32 AM
okay, if there is something like an unsigned int on a 32-bit architecture, does it mean that all 32 bits are used to store the number...?
 
@Abhishrek Ah. Ok. Hmm. I think 32 bit signed int should work at similar performance?
 
although the native land mixing is about 4x faster
I guess SIMD or something that is available to c-land?
@Sheepy should :P but I don't have 32 bit integers :D I only have 32 bit floats or 16 bit integer
Encoder(node-lame) can't encode 32 bit ints for some weird reason
 
Ok. Yeah, double is slow. single is faster - sometimes 4x faster. Int always fastest - many times faster.
 
Mhmm
I will just write a libuv module next week to boost this performance
 
4x faster doesn't sound like SIMD, though. Unless that's double vs int.
Perhaps you can try asm.js, then you may get native speed ;)
 
11:35 AM
^ That is what I thought
node supports asm.js ?
also it blocks the event queue which is unacceptable :P
 
I heard that you can run it on Node, that's all :/ As for event loop, I think this is something you can do in workers, no? :)
Put the data in typed arrays, transfer ownership, get typed array back. Should be quick and simple~
 
on node there ain't no workers
    // mp3in -> throttle -> decoder -> throttleChecker -> mixxer -> encoder -> network
    // auxin -> resampler ----------------------------------^
 
Oh? Google tell me this: npmjs.com/package/webworker-threads
 
@Sheepy IIRC benji ranted about the module
 
Now I want to rant on Node... even I only have experience of it exploding on my ES6 code. Well may be that is all the reason I need to rant on it.
 
11:41 AM
I will try it :P
 
Anyway. Thanks for the update!
 
I wish I could just use libresample x|
 
You get a okeyish solution there. So you can explore better solution with a peace of mind :D
Got to go now. See you next week everyone!
 
@AwalGarg tinyurl.com/h45hdlw another good read. Like flowers for algenon, but better (no Rebecca)
 
Do you guys have any idea of How php parses javascript timestamp?

//$d['start'] = 1463943600000 Javascript displaying date 24/05/2016
$timestamp = $d['start'] / 1000;
$date = new DateTime();
$date->setTimestamp( $timestamp );
debug( $date->format('Y-m-d'));//2016-05-22
exit;
 
11:51 AM
hey guys!

we are building an React Application, which is both React Native and accessible as an Website. we use an node.JS RESTful API as our Communication Layer.

How would you make sure all the changes made by the server are up-to-date in the App?
- without manually refreshing
- without Pulling the Data every x minutes
- without using RESTful Websockets
 
@BasheerAhmed miliseconds since 1.1.1930 or so
 
@ChiefORZ beats me
Websockets would be my pick
 
@ChiefORZ non-restful websockets. Long polling. Pull data every seconds / hours. Raw TCP over Flash or Java.
 
@JanDvorak Any solution? I didn't get it..!
 
I'm sorry, was there something about your code that needed solving?
 
11:56 AM
@JanDvorak Yup I need the same date as in javascript
like mentioned in the question
 
@JanDvorak non-restful websockets sounds like the best from all worlds! thank you very much for this helpful input
 

« first day (2043 days earlier)      last day (2910 days later) »