« first day (3743 days earlier)      last day (1198 days later) » 

1:49 AM
 
 
5 hours later…
7:02 AM
Why doesn't this code render the map correctly? It simply calculates the map div height to be 0px
@model MapModel

<head>
    <script src="https://polyfill.io/v3/polyfill.min.js?features=default"></script>
    <script src="https://maps.googleapis.com/maps/api/js?key=<my api key>&callback=initMap&libraries=&v=weekly"
            defer></script>
    <style type="text/css">
        .map-div {
            height: 100%;
        }
        html,
        body {
            height: 100%;
            margin: 0;
            padding: 0;
        }
    </style>
    <script>
        let map;
        function initMap()
 
user14987072
Hey guys I have a question about ajax, so my problem is that I have a selector for active and inactive data, the problem is that the active data is shown but when I switch into inactive, it doesn't show but it is been recorded into database. I figured I need to have an ajax in my selector but the problem is how, I can't think of solution. Thanks in advance
 
@キチ-san Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
user14987072
Here is my code
 
@キチ-san Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
user14987072
 here is my javascript code
function thisReload(params) {

    let doSelect = $(params).val() == 1 ? "Active" : "Inactive";
    if (doSelect) {
        // alert(doSelect);
        $("table tbody tr").hide()
        $("table tr").find(".status_checks:contains(" + doSelect + ")").closest("tr").show()
    }

    $.ajax({

    });
}
 
9:39 AM
Hi! I am curious about the NumberFormat behaviour for 4 digits:

```
form = new Intl.NumberFormat('de-DE');
form.format(12345); ==> 1.234 // with a dot
form = new Intl.NumberFormat('es-ES');
form.format(12345); ==> 1234 // without a dot
```

This happens to me in Chrome's console
 
Rob
@fedorqui'SOstopharming' stackoverflow.com/a/59250342/563532
 
9:57 AM
@Rob good one! Then stackoverflow.com/q/58430460/1983854 should change the duplicate target to the one you mention
 
Rob
The current target seems to be better, as the one I found specifically asks about currencies
Though the answer is the same
 
mmm true
there is quite a lot of fun with es-ES numbers:

1234 --> 1234
12345 --> 12.345
1234567 --> 1.234.567

So it creates groups of tree unless the length is 4
@Rob I changed the title a bit, so it is easier to find. Maybe they should be marked duplicate one of the other
also, stackoverflow.com/q/58991370/1983854 uses that may confuse, since it is from php, not sure what is the way to handle (I would go with )
 
10:26 AM
bleh i18n
 
I had one problem and added i18n.

Now проблема 二 عندي
(now I have two problems: eng, ru, ch, ar :P)
 
10:43 AM
when a marketing boy is requesting to have some i18n on an (existing) feature, I always would have some headaches with it :P
@fedorqui'SOstopharming' btw, are you ok? 😉
 
@KarelG yeah i18n is a bit of Hotel California: you can get into there any time you like, but you can never leave
it always seems easy but then many things start happening
@KarelG haha kind of
 
it's rare to see a high rep user here. so I went to check your profile
gold badge on ? I'm impressed. I live in terminals. So you could be one of the god's I should worship
TIL @L and other related string modifiers for bash 5.1
 
I am not very much into chat, but decided to come from time to time
lately I am on Vue.js, so I need quite a lot of JavaScript and keep checking SO for every little thing
so to me, you JS pros are the ones to worship :P
 
gods worshipping each other. that's a nice recipe for disaster?
 
@KarelG yes! Bash 5.1 release had plenty of useful tools like this one
 
10:57 AM
> cc. When run from a -c command, `jobs' now reports the status of completed jobs.
FUCKING FINALLY
 
@KarelG most probably. I would add a worship for waffles (I just checked your profile, yummy)
I recently noticed I have many badges, but not the Outspoken. It looks hard to get stars in chat
@KarelG that's also a good one, yes
 
Hey folks, I'm trying my luck again asking this once more. Does anyone have any idea what is wrong in the code here? I'm receiving this error: `Invalid hook call. Hooks can only be called inside of the body of a function component.`

All hooks are inside the function, so I can't figure out what is wrong..
https://codepen.io/yotking789/pen/VwKVvXp?editors=0010
 
@fedorqui'SOstopharming' I rarely go answer questions. Many of these does not spark my curiosity to answer them because it's high likely being asked before. Or shows a lack of effort. I'm not really akin to be a servant, specialized in spoon feeding
 
@KarelG it depends on moments in life. I learnt a lot from Bash, Awk, Sed and others by answering questions
but I agree spoon feeding is not the way to go. If you notice you've answered the same answers many times during a period of time, you are probably getting it wrong
 
yeah I have to admit that such thing happens with me as well. But thing is, I already know many things before it gets asked :P
 
11:01 AM
better use time to generalize, create cannonicals, etc
 
@Yotam there are various causes that leads to this warning
 
@KarelG I'm new to React Native so I'm having some hard time to understand
 
do you use ESLint?
 
No
 
AFAIK React's ESLint covers inappropriate use of hooks (usually within loops or recursive calls) and tells it to you
 
11:05 AM
So its kinda like typescript?
 
See ESLint as a dude behind your shoulder that only start to yell (errors) / whispers (warnings) in your ear when he sees your syntax is not following the rules of the "game"
it does not only check syntax, but also patterns and other elements behind the scene
i suggest to start with this guide; reactjs.org/warnings/invalid-hook-call-warning.html
There is a link to an ESLint config you can use
 
Thanks I will use that
 
> qq. The `kill' builtin now supports -sSIGNAME and -nSIGNUM, even though conforming applications aren't supposed to use them.
@fedorqui'SOstopharming' Do you know the history of this one?
(or background, not sure which terminology is appropriate)
 
@KarelG nope, it would be a matter of digging through the mail list
 
well ok. That's a weird bit.
🤨
 
11:26 AM
it may be somewhere in lists.gnu.org/archive/html/help-bash or lists.gnu.org/archive/html/bash-announce, even though I could not find any important reference at first glance
 
 
2 hours later…
1:10 PM
@ShrekOverflow I lurk here a bit still 😅. I am in Sweden again now, but I was home in NZ most of 2020 and it was lovely.
 
@phenomnomnominal are the swedish fish better in sweden?
 
I'm an idiot vegan so I cannot answer than
But they have a fish here that smells so bad it is illegal to open inside
 
Yeah also not vegan
 
ah
real fish smells horrible
 
1:18 PM
Surströmming (pronounced [ˈsʉ̂ːˌʂʈrœmːɪŋ]; Swedish for ''sour herring'') is a lightly-salted fermented Baltic Sea herring traditional to Swedish cuisine since at least the 16th century. The Baltic herring, known as strömming in Swedish, is smaller than the Atlantic herring, found in the North Sea. Traditionally, the definition of strömming is "herring fished in the brackish waters of the Baltic north of the Kalmar Strait". The herring used for surströmming are caught just prior to spawning in April and May. During the production of surströmming, just enough salt is used to prevent the raw herring...
 
> just enough salt is used to prevent the raw herring from rotting while allowing it to ferment
🤮
 
1:33 PM
surstromming
I only have heard stories from it
 
Hello everyone!!
hope you guys are doing fine?
I have a curious question, would it be possible to capture a warning from a react-app build? in a CI test?

I want to set up a github action that would fail if the react app being built has a warning from the build process
 
@BobbyAxe yeah, that should be possible. What are you using to build your react app?
 
npm run build
how would I got about it, cause most times I end having to fix all those little warnings and it gets annoying because it does not directly affect the app the devs never bother to clean up
 
@BobbyAxe look in package.json what is the build script?
 
@JBis it is "react-scripts build" command
 
1:50 PM
Not 100% sure then. You'd probably have to eject it, and it's not worth it for that.
 
okay thanks, will give it a few tries and see what I come up with
 
 
1 hour later…
3:10 PM
Hello
 
 
2 hours later…
5:39 PM
there's not readonly in typescript, to mark a function argument as invariant?
 
hello
 
6:13 PM
@paul23 huh?
 
Found the wording Readonly instead of ReadOnly in flow (different capitalization, made i hard to google)
 
flow sucks
it was obsolete from inception
 
.. I strongly prefer it over typescript
 
why
 
Typescript is really awkward as it doesn't really help with the guarantee. There are numerous situations where typescript just "bails", and you lose strong type safety.
 
6:17 PM
What do you mean?
 
Doesn't help that the community bails even more times and adds any type in lots of places.
Don't have a direct example but quite often I notice that to get things working in typescript the formal solution is to just use a "more generic type", instead of carefully describe the actual type
Flow has as design idea to be very very formal in its description, thus if you notice something is covered by flow you know it is typed correctly. With a strong type guarantee.
Typescript just doesn't make such claims.
 
Not in mood to debate it right now but considering flow doesn't follow things from a couple lines up makes it basically useless for me
 
It does though? In practice I find it actually does this better, except where it is indeed not possible (often due to readonly state not being used and then co/contravariance problems).
 
tbh the entire FAQ is an argument against Flow
And you don't have worry about community bailing when there is none ;) I've seen one project using flow.
 
6:33 PM
Yes this is the problem with typescript: I might modify an object during its lifetime and typescript has no guarantee this doesn't happen. Things like:
foo(arg: {val: number}) {
    Object.assign(arg, {somenew: 1}); // uh oh...
}; //not sure if there are side effects......

const myObj: {val: number} = {val: 0};
foo(myObj);
console.log(JSON.stringify(myObj));
 
@paul23 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
 
thats just shitty code
 
...
I do not know what happens in foo. That's written by someone else. So I depend on my type system to provide type security.
 
and you also trust that the "someone else" doesn't do something stupid
you could craft something that would break flow's "guarantee" also
 
Sure, but they have defined those things formally as "bugs in flow"
typescript doesn't give that guarantee.
 
6:36 PM
99.5% of time that isn't an issue
 
btw above code isn't really "alien": react has that setup in a lot of code.
As does jest, material ui and a lot of things.
 
a function shouldn't change the structure of an object received as a param without making a copy
@paul23 that's interesting, i'd like see where. Still maybe shitty code.
 
addVal(a: number[]) {
    a.push(2); // remember that arrays are just objects with numeric keys.
}
 
@JBis quick question. Is there anyway you can prevent page scrolling with JS. I try it with CSS and it works in an IDE but of course SharePoint wants to be a b****. So I figured I would try JS to see if thats possible.
 
And react uses Object.assign everywhere to build the dom. To keep track of how the dom is structured. If you strip the magic away react is a series of Object.assign() to the virtual dom.
 
6:40 PM
Tried overflow-y: hidden; and of course doesnt work lmao...
i.stack.imgur.com/Cet6J.png look at how much unnecessary white space there is
 
Couple things. If you are trying to stop scrolling because there is "extra space", you should figure out why there is extra space and fix it. Not cover it up. If you are stopping scrolling for another reason (e.g. a modal) you should be able to use css, try * { overflow: hidden } just for testing. Does that work?
 
Trust my I have tried. Everything is in the body of HTML there is no footer or anything, so there shouldnt be any extra space. And I made sure to define in my CSS and nothing. I am thinking it is something related to SharePoint so I am waiting to hear back on my sharepoint stackexchange question.
I tried *{overflow: hidden;} and it hid all of the SharePoint toolbar buttons so I could not save or edit anything on the page
So I had to remove
 
open up dev console, click the target, and click the white space, what eleement is selected?
@bigchungus this isn't a solution its at test
 
I did, it is
some insanely long SharePoint div.
 
thats your issue
fix that
 
6:50 PM
the name of the div is long is what I meant
like 100 characters long
 
figure out why its taking up so much space
 
I am so close haha it altered the top and removed some of the top white space... but not the bottom.
 
7:22 PM
Its like whatever I do to counter it, SharePoint overrides it. Ive noticed this on other pages
 
7:39 PM
quick question about react router, is it possible to use history.push to change the url from "home_page/first_page" to "home_page/second_page"?
when I tried to do it, it just becomes "home_page/first_page/second_page"
 
8:03 PM
yes
though your react stuff could be interfereing
 
 
3 hours later…
10:47 PM
cant change the volume

  var audio = new Audio("onmessage.mp3")
                    debugger
                    audio.volume = 0.1;
sounds the same
 
11:05 PM
console.log(audio.volume)
 

« first day (3743 days earlier)      last day (1198 days later) »