« first day (2847 days earlier)      last day (2115 days later) » 

12:10 AM
also using old gmail
meeh I only use gmail because well compared to everything else it has minimial adds
 
no ads in Inbox
and it's made by the Gmail team
 
I've never been shown an ad in the gmail interface
and the spam filter is A+
if you have the capabilities of google, there's no point in running ads in your email
they have so much data mining capabilities there, $$ in advertising elsewhere is enough
 
12:53 AM
when connecting react components to redux, is there a trade off between coupling and performance? what i mean specifically is I have chart components like "lineplot", "circles", "graph". and because i don't want to couple those to this specific visualization I render the component when ever my "visualization" changes.
but that causes e.g. the "graph" to update because it needs to render the "lineplot". whereas if the "lineplot" was connected directly to the redux store, than the "graph" wouldn't render in this case. but i don't want "lineplot" to know about my data model for this particular visualization. basically, i'm asking if this is a real tradeoff and how people deal with it?
 
@AlexBollbach ofcourse there is a tradeoff.
 
hmm.. yea i'd agree
i guess the implication is.. is that a common enough tradeoff that people have useful ideas on how to most readily approach it
ideally useful and not too complicated
i have a massive chain of components in my charting library, they all rerender on store updates. because of not wanting to couple them to redux.
makes me a sad panda
 
I would personaly move away from heavy handed frameworks. Have you looked into lit-html
 
you mean react?
i made the charting library so i control that code
 
ya react, angular, vue and all the others
 
1:08 AM
nah i'm too reliant on react
 
I don't personally subscribe to the whole framework fad. They will come and go. By definition frameworks will always make your project more complicated than they need to be. Anyone who says otherwise either does not know or they are not being honest.
frameworks accumulate lots of technical debt. It's almost never talked about because frameworks will make a lot of the initial hurdles easy to overcome. But it catches up to you eventually
 
that makes no sense to me.
why not just program in assembly
 
Your analogy is faulty. There is a difference between a programming language and a framework. A language like javascript expands your ability to express many complicated ideas in a shorter syntax. Frameworks by definition limit your ability to express those ideas. To work with a framework is more like working with assembly but slower and more ridged
 
1:25 AM
it isn't true that a framework can't help you express more complicated ideas. granted a language tends to have a greater expressivity/restrictiveness ration
but i would prefer to script the DOM and use css rather than draw pixels to the screen ever time i need to make a web app.
those are arguably frameworks relative to imperative based graphics code
and even the openGL or 2d drawing code that those frameworks compile down to are frameworks themselves over just working with raw memory buffers
 
1:48 AM
the primary reason react is so popular is because of screen thrashing and a lack of developer know how. Frameworks compensate for that. I think you are conflating what I am saying about expressibility. No one is saying work with buffers or the assembler to draw 1x1 pixels. Although, there is a growing demand by developers to have access to the underlying systems like webassembly for performance, or "buffers" as you would call them. All I am saying is you don't need a lot to do a lot.
 
and what does morty have to say on the matter
anyway any1 know how you spread-update an object while using map, or a loop
e.g. {...object, keysToUpdate.map(k => { someProp: false })
normally i can update an object with a "dynamic property key" like {....state, [expression]: { propToUpdates: "newValue" } }
but what if i want to update multiple keys like that where the keys come from an array from a map call for example
 
if it's an array of maps, you can use your map syntax with Object.assign
 
actually forget map, just the array part.
{...object, [arrayOfKeysHere??]: {prop:42} }
 
is that a computed property for {prop:42}. Do you have actual code I can see
 
the question is can i use an array for my dynamic property keys in a spread update
so you can do this {...objectToUpdate, [expressionOfKey]: { propertyToUpdate: "value" } }
but that is static insofar as "expressionOfKey" is a single value
i could do.. {...objectToUpdate, [expressionOfKey]: { propertyToUpdate: "value" }, [anotherExpressionOfKey]: { propertyToUpdate: "value" } }
but what i want to do is [expressionOfKey, anotherExpressionOfKey], making it "dynamic"
 
1:57 AM
it depends on the order of operation. does the computed property get resolved before the operation
 
the array would be the set of keys i want to update
so it'd be like [resolvedExpressionForKey, resolved...]
might be ["name", "age"]
 
as long as those names are computed before the assigment than yes
 
this doesn't work - {...a, ["b": { isActive: true }, "a": { isActive: true }] }
var keysToUpdate = ["b": { isActive: true }, "a": { isActive: true }] // or compute dynamically
var updatedA = {...a, keysToUpdate }
 
I can't make sense of your code.
 
2:28 AM
i think i'm being pretty clear. i'm asking if Object Spread Syntax can support spreading in keys that are in an array.
 
arrays dont have keys, so no
 
technically they do
 
well what about an array of objects then
i don't care how it is done specifically but if the spread keys can be the result of a computation and not statically typed in at compile time
e.g. to update 26 keys you'd have to say {...state, ["a"]: ...., ["b"]: ..., ["c"] ..., ["z"]: ...}
when Object.keys()... would be much simpler, to state an obvious case
 
 
2 hours later…
4:23 AM
How can I use material.io in simple html, css, js
 
4:33 AM
<link rel="stylesheet" href="https://unpkg.com/material-components-web@0.38.0/dist/material-components-‌​web.css" /> for css <script src="https://unpkg.com/material-components-web@0.38.0/dist/material-components-w‌​eb.js"></script> for js
put those tags in your html
then you can do stuff like github.com/material-components/material-components-web/blob/… to attach Material handlers to nodes
 
@Ikari I will try. Thanks once again
@Ikari can you please provide me side nav link. Please
@Ikari both css and js link not work
 
4:48 AM
what's the error that you are getting?
and do this after the dom and the mdc script is loaded:
mdc.drawer.MDCPersistentDrawer.attachTo(document.querySelector('.mdc-drawer--persistent'));
 
@Ikari demoReady is not defined
 
5:03 AM
wat
where did you get demoReady in your code?
 
Actually, it is reactJS error but material.io do this
 
1 message moved to Trash can
@ShubhamKandiyal 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
 
demoReady(function() {
        var btns = document.querySelectorAll('.mdc-button:not([data-demo-no-js])');
        for (var i = 0, btn; btn = btns[i]; i++) {
          mdc.ripple.MDCRipple.attachTo(btn);
        }
        document.getElementById('toggle-disabled').addEventListener('change', function() {
          var isDisabled = this.checked;
          [].forEach.call(document.querySelectorAll('button'), function(button) {
            button.disabled = isDisabled;
          });
        });
      });
 
wait
are you using react?
 
no
simple html, js and css
but Not able to found any material.io documentation for simple html, js and css
 
5:13 AM
:/
just a second
 
okay
@Ikari hi, are you there?
 
yes
 
@Ikari PLease help
 
tumbleweeds
 
everything is there in the docs btw
just give em a read
 
5:27 AM
where is demoReady called or rather passed to?
 
@Ikari Thanks
 
6:03 AM
hi All , i have something to ask , is any one idea about what is Logo in search engine:
{
"@context": "http://schema.org",
"@type": "Organization",
"url": "http://www.example.com",
"logo": "http://www.example.com/images/logo.png"
}
what is the purpose of the script and where can we place this ?
 
@GayathriMohan Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
am sorry @Ca
@CapricaSix
 
hi @SurajRao , do u have any idea what is the purpose ? and where to post the JSON script ?
 
in the html with script tag as specified in the link..
 
6:12 AM
inside head or body tag ? @SurajRao
 
> JavaScript notation embedded in a <script> tag in the page head or body. The markup is not interleaved with the user-visible text, which makes nested data items easier to express, such as the Country of a PostalAddress of a MusicVenue of an Event. Also, Google can read JSON-LD data when it is dynamically injected into the page's contents, such as by JavaScript code or embedded widgets in your content management system.
Its in the guide
You need to do some leg work on it.. I havent actually used it
 
6:28 AM
mhm papertrail is out of service
 
7:06 AM
@KevinB you know there's a chat shortcut for that photo right :D?
You used it?
 
7:38 AM
A new bridge got opened in Vietnam
(google terms: Ðà Nang golden bridge)
I like it. A nice approach.
 
My sister is there right now :)
Are you in Vietnam?
 
no
 
8:10 AM
what is the name for that math symbol that means "for all"? It has a V ish shape with a horizontal line in it
"turned A". OK
lol
Turned A (capital: Ɐ, lowercase: ɐ, math symbol ∀) is a symbol based upon the letter A. Lowercase ɐ (in two story form) is used in the International Phonetic Alphabet to identify the near-open central vowel. This is not to be confused with the turned alpha or turned script a, ɒ, which is used in the IPA for the open back rounded vowel. It was used in the 18th century by Edward Lhuyd and William Pryce as phonetic character for the Cornish language. In their books, both Ɐ and ɐ have been used. It was used in the 19th century by Charles Sanders Peirce as a logical symbol for 'un-American' ("unamerican...
had to laugh
 
9:01 AM
@KarelG it's literally called "forall"
At least commonly
 
9:27 AM
just like technically the name of a hash is octothorpe
 
@BenjaminGruenbaum only on an empty base object
I want sugar for Object.assign(x, y, z), not only Object.assign({}, x, y)
@phenomnomnominal which hasn't landed yet. I want it now
 
give me some sugar, baby
 
@towc so replace the object's reference? Or do you explicitly need to mutate it? (In that case I actually like the fact there's no sugar for it)
 
and sure, babel helps, but last time I checked there actually wasn't a consensus on quite a few details of the pipeline. Maybe we should embrace lack of consensus, like with libraries
@BenjaminGruenbaum mutate it
I find x.prop = 1; x.other = 2 syntax to be kind of awkward, for one
then it would be nice to customize Error and other non-spreadable objects without creating another class
then declaring images with an src in a single expression without creating lambdas or other functions
enclosed mutations are a good thing, expecially when the surrounding apis are antiquated
reduce object accumulation statements would also look much prettier, without people arguing that you're creating a new object, and others that the engine can optimize for that
let's just have the best right away, without having to think too much about it
 
9:49 AM
@towc So which is better in your opinion: a language feature which allows a programmer to do the same task in two different ways, or a language which offers only one way to accomplish that same task?
I'm guessing the latter
 
if you're arguing that, you'd be arguing against destructuring, spread, rest, lambdas, const/let, even arrays/strings
all functional array methods, for loops (against while loops), {} object syntax...
classes
 
*looks at neil * ¯\_(ツ)_/¯
 
almost everything in JS is redundant, but we still use them because they're practical and give us more power
 
make the code more readable
 
10:14 AM
The recommended solution to hide the Tabbar of the TabNavigator for a certain screen when using an inner Stacknavigator with React Navigation is to wrap a StackNavigator around it and use that one.
Now I have the problem that the params are not passed from the outer StackNavigator to the screen in the TabNavigator (I take an image from the StackNavigator screen and want to use it in a screen in the TabNavigator). I use setParams on the navigation of the screen under the SN and params is undefined in the TN. Any suggestions?
github.com/react-navigation/react-navigation/issues/… was the only one which I actually understood but it does not work either (gives params: undefined as well)
 
10:36 AM
@towc Unfortunately that's a very subjective issue
 
@Neil point is that your argument, explained that way, is invalid
 
lol
what point was I trying to make, pray tell?
 
python just has less ways to do the same things, but it definitely has way more than 1 way of doing the same thing
 
I was just trying to get your opinion
I just said I thought it was a subjective issue, meaning there is no right or wrong
 
I thought you were trying to say that it's kind of pointless to introduce more syntax that does the same thing that other things do
with "only one", I think you're wrong, for high-level programming languages
if you said "not many ways", then sure
I can accept that
but I haven't seen many serious languages that offer a shitton of ways
 
10:42 AM
@towc No, honestly I tend to think the opposite
 
then I'm not sure why you asked the question. I clearly said I wanted more things
 
I wanted to pinpoint it
 
well, you tried :P
 
Yeah, I tried ._.
 
10:54 AM
Using NavigationActions instead of a selfcrafted object did the trick.
Oh! Because I messed up the string that changed since the creation of the comment :)
 
another feature I'd love is conditional chains that don't require you to declare variables
 
I just want getters to implicitly return
 
let stream = new Stream()
  .query(q => q.something());

if (pagination) {
  stream = stream.offset(offset).limit(limit);
}

stream = stream
  .order(something)
  .fetch()
  .then(...) // and you never use 'stream' again
this is kind of awful
I don't know what a good syntax would be for it, but maybe
new Stream()
  .query(q => q.something)
  .(pagination ? super.offset(offset).limit(limit))
  .order(something)
  .fetch()
  .then(...)
there's definitely some better syntax, but at least it's not horrifying and unnecessarily creates mutable unneeded variables that pollute the scope and confuse the reader
 
11:09 AM
new Stream().query(q => q.something).if(pagination, s => s.offset(offset).limit(limit)).order(something).fetch().then()
idk
 
and that reminds me, sometimes I want if-expressions that do nothing if nothing happens, and I find it kind of dumb that if I do something else, I can use an actual expression in lambdas, but if I don't (which is a simpler case), I need to create a code block and use return
@Cereal again, if you want to extend the library, but that's almost never going to happen, and makes otherwise great things go abandoned, and reduces the quality of all future JS code
 
what
 
or are you suggesting using .if as the syntax extension?
 
a method that conditionally runs a proc and returns itself otherwise really doesn't seem like a breaking change?

I don't understand
No it's a method
 
what's that from?
I can't tell if you're commenting from what I'm saying
because it sounds like what I want
it's not a breaking change, but you're not going to convince all libraries to add those methods
it's overhead
it's boilerplate that the libraries have to implement
which is almost never a good thing
 
11:14 AM
@towc or just use async iterators?
 
how would you use async iterators to fix this problem?
 
It doesn't exist, you were talking about wanting something and I thought you were trying to think of a way to do that
so I was offering a suggestion that you could write a method to do it
 
Async iterators are basically good pull streams
 
@towc eww
 
@Cereal right, but not for every chainable library. I'm not going to modify all of them
@KarelG it is eww, but it's better than the first thing
 
11:15 AM
yes true
 
you really shouldn't be using all of them at once =p
 
but as benjamin has pointed out, you could do it differently
 
Also, look at how linq does this.
 
linq is a godsend for C#
but towc
why do you not have a .skip and .limit ?
might help with your pagination. But even then, if you implement a sorta pagination tool, then you should fetch a subset from the db and not all of em to retrieve a part of it
@BenjaminGruenbaum do you know a good use case for Promise.race ?
 
@BenjaminGruenbaum oh neat. Still, it requires going back and changing all the outdated libraries
 
11:21 AM
I was aware of it but did not paid much attention to it because I could not figure out an use case. I did not even use these once it was available. I was going .all all the way
 
and I'm still not sure how exactly they solve the conditional
@KarelG well, it was just an example. The last scenario that kind of made me mad about that is generating pq code for a minor search engine, where the query changes structure depending on certain parameters. I'm currently leveraging bookshelf's .query to generate a chain of queries using knex. Later on I'll probably have to adopt another structure, sure, but for now it's fairly simple, and I'm not sure what requirements might change in the future
but I had some other similar cases in other parts of this project
 
I have still doubts with the current iterator mechanism
I rather to have
while(it.hasNext()) {
  // use it.next() to work with next element
}
than
const {value, done} = it.next(); // in a loop with stop condition if done is true
it leads to some sluggish code
 
11:43 AM
No reason why it should be slower
Not saying it isn't mind you
 
Hi I faced issue with bootstrap typeahead. I am accepting html template as a typeahead dropdown value so when I am type "60" it will search with "&#60" likewise for "62" it will search item for "&#62" so return my html without "<" and ">"
 
ho guys how can i code that my website changes something if its loaded on ios? Something like : if (device = ios) {changebody.innerHTML }
 
12:00 PM
@Delidragon use navigator.platform maybe
I would get a nice long list of possible values which could be returned from that before I'd use it seriously
Also consider that that information can be absent completely
 
thx i try it :)
 
@KarelG for( const value of it ) doesn't satisfy you?
 
12:16 PM
actually, iterators should give you a means to go back and forth
hard to accomplish this in a loop
unless you use the regular for loop
(just adjust the index in that case)
 
how would you handle generators then?
hold on to the previous values?
for the entire duration of the loop?
 
the js iterator is different than what you see in C# or java
 
are we not talking about JS?
 
it is tied with the generator function
 
@KarelG Timeout?
@KarelG that is fundamentally wrong since between the hasNext call and the next call someone else could have changed the iterator's state.
You can do .Next() which returns just if there was a value and .Current like .net or other stuff.
 
12:28 PM
@KarelG You have several database servers which are all updated.. you ask them all to return data and use the data of the first to respond
sort of an edge case, admittedly
 
that is hard to maintain actually
other db's are doing that same task that got queued up
so waste of resource unless you have a functionality to remove it from the queues
 
meh, I never said it was a good idea
But if you needed to do that, you'd have no good way without race
Maybe you want to ping all the servers to find out which is fastest
There's a practical application which isn't "bad practice"
 
12:54 PM
ah that pinging can be an useful use case yes
 
1:11 PM
someone an idea why this not work: window.onload=function(){
        if (navigator.platform = iPhone) {
            document.body.innerHTML = "hallo";
        }
    }
 
What is the value of iPhone?
 
for starters, = is not comparison, it's assignment
 
Also that ^
Maybe mostly that :D
 
well, could be both
assigning to platform would not throw, but would cause unexpected results.
if iPhone isn't defined, it's a ref error and nothing works.
 
@Delidragon Also I don't think 'iPhone' is a valid platform assuming you did everything properly
 
1:21 PM
it very well could hold the string for the UA he needs to check
but UA sniffing is lame, at best.
@Delidragon why do you need to know it is a iphone?
 
also not reliable
 
is there a feature you want to explore on that platform?
 
I eventually binned that attempt and decided to not give a fuck anymore which platform a user is using
 
@rlemon So he can transform the content of the page to "hallo" obviously
duh
 
@KarelG if I need something, I go as far as feature detection and no more.
I don't care about which browser, I care what it can do for me
 
1:23 PM
also, screw IE, even if it works
 
no, that's a childish attitude
 
and a joke
 
but one too many people take seriously.
 
there are enough toolkits to support IE in best possible way :P
 
you're hurting users because you hate a companies product.
 
1:25 PM
Hi guys, I've been struggling for four days now with redux. I managed to get a store in my application. I can dispatch to it and the reducer function is called. I'm expecting my simple count object to be updated. I think it does in the store but for some reason my async pipe doesn't render anything: Counter = {{counter$ | async }}
 
relevant to the assignment thing:
 
of I take off async I get [Object object]
 
+1 @ towc
 
@KarelG it's called a star
 
I was using ng2-redux but I switched to @ngrx/store to see if this resolves the problem but I'm still getting the same result
 
1:26 PM
@towc not sure if it is star-worthy
 
Any help would be greatly appreciated. Does anyone in here know the basics of how to get up and running with redux?
 
I don't really care, but +1-ing seems to take more effort and appreciation than starring
 
@rlemon i need to know if its an iphone cause i have this strange issue which just is on iphone so i try to say. If my webpage is open on an iphone pls load something else
 
Is there any way I could escape the dash in a variables' name?
 
@Delidragon it would be more reliable to identify the issue and solve it
 
1:28 PM
y i know but i cant fix it my brain already death here is the issue stackoverflow.com/questions/51651353/…
 
if it's an interesting issue, we might even help :P
 
@VioAriton for an object property you can
 
Went to the whatwg room trying to figure out one of my own problems and ended up with this: https://github.com/whatwg/html/issues/3875

Opinions?
 
@VioAriton but for something declared with const/let, you can't use the actual - char
 
oh okay
I've a ajax response that contains data.redirect-link
guess I will just change it
 
1:30 PM
@BenjaminGruenbaum looks useful enough to consider. how often does sugar make it in?
 
I don't think I ever use delays in my code, if not for testing/mocking
occasionally to let the event loop play out during intensive clientside calculations, before I learnt about web workers
 
delays and intervals are useful
 
only thing I can imagine them being useful for (outside of testing/mocking) is animation loops, and there's already a neat api for that
 
polling
debounces
 
recovering from lost connections, scheduling reads (polling), scheduling writes, etc.
there are a tonne of valid reasons to wait for things, or wait to do things
 
1:33 PM
@BenFortune do you ever debounce with actual setInterval/setTimeout? I always compare time instead
and not sure what you mean by polling
 
Long polling, for when you don't have access to websockets
Database polling, when there aren't change events
 
@rlemon for reconnecting, it sounds like you might prefer to have setTimeout either way. But yeah, it's getting more reasonable
 
@towc I always use setTimeout.
 
this proposal is a promise replacement to that
did you read it?
 
Is it crazy how saying sentences backwards creates backwards sentences saying how crazy it is?
7
 
1:34 PM
Start the timeout on keydown, cleartimeout and set a new one when another keydown is triggered
 
@BenFortune setInterval is exactly for that. Unless you want to be a while (true) { await sleep(1000); doStuff() } kind of guy
 
@towc But what if your database call is slower than your interval?
 
@BenFortune and then you might have weird hard to debug race conditions
 
Then you'd use a setTimeout after you have the result
@towc What? So you have a long running setInterval checking the date?
That sounds unnecessary. Especially since it's running when it doesn't need to be
 
I've narrowed my ngrx problem down I think. The problem is this line: this.counter = this.store.select(s=>s.counter);
always returns undefined
 
1:37 PM
@BenFortune on the next keypress, I check whether the new date is within a certain distance from the last date, and I cancel it
unless we mean different things with debouncing
 
with the async pipe
 
@towc So you're still using setTimeout
 
@BenFortune not at all
 
So what are you cancelling?
 
I am a bit at a loss here... I am using a FlatList in React Native to display images that are taken. The idea is to take an image, have the application return from the camera view while passing the source for the image as navigation param which works. I have this.state.images=[] to keep track of sources for images to display.
Now when taking an image, the ListEmptyComponent hides but I don't see my Image. Looking in the debugger, I noticed that the dimensions of FlatList > VirtualizedList > ScrollView > View are 360 x 0. Any ideas why that might happen? I have flex:1 on the FlatList and sur
 
1:39 PM
let lastQuery = 0;
const interval = 1000;
on('keydown', (e) => {
  const now = Date.now();
  if (now - lastQuery >= interval) {
    runQuery();
    lastQuery = now;
  }
})
this is in the context of running a search query after certain "delays" on input
 
lol what
 
The ScrollViews dimensions are 360 x 294.333 :/ This makes no sense to me...
 
You need a final keydown to fire off your request
which isn't a debounce at all
 
well, right. Then I'd do something like this:
 
fc apple
 
1:42 PM
yeah ok you need timing functions. I could swear I had other systems before that worked without timing functions
I'm likely misremembering
oh, I definitely used the code above to debounce user input in games, where you don't care if there's one last thing
you just can't shoot for 100ms after the last shot
 
You need one last thing, that's the point of a debounce, right?
 
I guess it depends on the context. Would you call the game thing a debounce?
I would have, but now I'm having doubts
 
Not really, that's just a delay
or a timeout...
A debounce is firing something after the user's actions has finished
 
like a cumulative delay?
 
I think he's conflating debounce with throttle
 
1:45 PM
I guess that makes sense
probably
 
yeah
throttle, that's the word I was looking for
 
wow I managed to get it working but it looks weird... like this...
this.counter$ = this.store.select(s => s.counter["counter"]);
 
@rlemon sorry, got a phone call - honestly I have no idea
I asked about it in the whatwg irc channel and they were positive so I opened it
 
TIL that the French word for “paperclip” is “trombone”
 
that reminds me of the shakespear double entendre I learned about the other day. en.wikipedia.org/wiki/Much_Ado_About_Nothing#Noting
 

« first day (2847 days earlier)      last day (2115 days later) »