« first day (3142 days earlier)      last day (1823 days later) » 
00:00 - 12:0012:00 - 22:00

12:08 PM
may has said neigh
 
12:18 PM
she was just biding her time
gotta end may with a bang
I want her replacement to be named June
 
exactly my thoughts
meh, not a surprise.
 
yo
My css isn't really working...
 
*waves*
 
:/ the color wont change :/
 
12:34 PM
you can change it in script or use css linear gradient
 
Morning folks
 
what would linear gradient do though
 
btw, you need to correct your css selector
#pbar{ background: green; } should turn it in green
morning shrekkie!
 
im pretty sure i tried it and it made the progress bar work in 2 directions.
 
This is incredible - twitch.tv/videos/428831817##
GAAS (Grandma as a service)
 
12:41 PM
the only thing is that it makes it green if i make the color blue.
how do i change that?
 
private static final GREEN = Color.BLUE;
solved
oh, dang, this is javascript chat not java chat
I have too many tabs open
 
as a side note: why are you use progress for that? it isn't semantic
use <meter>
 
I couldn't get <meter> to go down :|
i guess i should try again.
 
you don't have to put it down. You only have to change its value
 
12:52 PM
like this
 
im either retarded or retarded but i changed it to meter added optimum high and low and it worked perfectly
oh
im trying to do stuff by myself now but ig ill look at that
 
when someone gives you an example, you can still "do things by yourself" very easily. don't copy and paste my code. read it, see what I do, adapt it to your project
 
examples are very helpful. just don't always assume they're a drop in solution
 
im going to read up on foo because you did a much simpler version of what i do for random chances.
i have to type out the same thing like 10 times in an array the way i do it ew
 
12:56 PM
if you want a random number between a range
 
yea. what is foo a property?
 
Math.floor( /* floors the number, so no ugly decimals */
  Math.random() * ( maxValue - minValue ) /* get the offset from minValue  */
) + minValue; // add back the min value
@ThomasTallman it's the element. console.log is your friend here
 
brain gears stop
 
recently.. like 3? years ago browsers started to implicitly create element references in the dom from your element ids
it's 'stable', but generally regarded as bad practise for anything but example code like I showed
 
> read it, see what I do, adapt it to your project
that advise should be applicable for a lot developers
 
1:00 PM
oooh
 
EVEN IF I have a drop in solution. I re-write it in my own style and with my own hands. I'll split view and just copy the logic over
a) styles don't conflict
b) I have a greater understanding of what I'm copying
 
If it's a small snippet, I'll write it in my own way, reading the initial code and interpreting it my way
 
yeah thats hard to understand :/
 
I think something should be said for staying consistent
 
now for some reason the damn meter bar is going in from both sides
 
1:09 PM
if I ever have to touch it directly, I'll probably re-write it
if I just import it and use it indirectly.
well no issue there
 
If i'm doing arr.foreach( (item, index) => {stuff then return foo} ), can I pass in some extra value to consider in the processing?
 
its because i centered it
 
return foo? @Erics
 
I don't think that'll be doing what you expect
 
1:14 PM
hello guys anyone online?
 
@Behar 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.
 
how do you view the console in jsfiddle lmao
 
it's a regular console.
 
1 message moved to Trash can
@Erics Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
and what do you intend on the return in forEach to be doing?
you're in a new function scope. it's exiting that. nothing gets returned from the forEach.
 
1:17 PM
var num = some_function();
arr.foreach ( function (item,index) {
  if (num > item.value) {return this_function(item.value)} else {return num}
});
 
and your outer function doesn't care
if you want to alter the values of arr, use .map
if you want to just loop it and return from the parent function for..of
 
@Erics .forEach expects a consumer function. It does not do something with the return value. You can combine .filter (only map is sufficient) and .map to achieve your goal
 
rlemon in your code what exactly does the +1 do? now i understand that the *24 makes it chose a random number between 1 and 24.
 
hmm ... I have an array name "att", and there's a global flag "do_sim", and I'm building a new array "acts" of objects where one element is "init". The value of init is either a constant value if do_sim, or is a new random value if do_sim is false.
 
and foo.value is the meters max. and your subtracting the random value from it
wow
i just understood that
 
1:20 PM
Math.random() is a number between 0-1 inclusive.
 
math.random generates numbers between [0, 1[
 
so Math.random() * 24 will give me a number between 0 and 23
adding +1 gives me 1-24
 
so multiplying it with x gives [0, x[
 
0 to almost 1
 
ooooooooooh
well ill be damned
 
1:21 PM
@rlemon uh math.random()*24 can give you 23.99?
 
in context, the number is floored
 
oh bugger ... just realised 'initiative' is not spelled 'inititative', which is why console was throwing errors. And I stared at that code for 10 mins.
 
Oh missed that (quite a way up :P).
 
ok
i have one question though... what is Number
 
!!> Number("123")
 
1:28 PM
@rlemon 123
 
now, go to google and search "mdn + Number"
 
@rlemon fix !!mdn
thank
 
how about no
find a js api
and maybe
otherwise can't
google shut down public search api
 
@JonSud What you have is an Array of category. You need to tell Normalizer that you give it an array: normalize(categoriesData, [category]);
 
from what im getting is that Number makes foo.value a number
 
1:30 PM
correct
 
because i remember you said it only works with numbers
Oh
it all makes sense now :P
 
@rlemon Where does devdocs get their stuff from?
 
probably a proxy?
if I wanted to setup something on my server I could probably do it
but eh
 
@ThomasTallman eh, I was mistaken. <meter>.value does return an int. I'm so used to all attributes returning strings.
so in this specific case I don't need to convert
but it doesn't hurt anything
 
1:33 PM
yeah
how did u get the id foo without document.getelementbyid
 
I already mentioned implicit references
they exist in all major browsers, but are bad in real code.
<div id="foo"></div> - creates an element called foo in your js automagically and references that element.
it's great for quick demos. it's not great for real code because it's confusing and can be easily overridden
@BenFortune get Cereal to bust out his Ruby skills and steal the scraper
 
so your saying i should use document.getelementbyid
 
@ThomasTallman yes
or document.querySelector
I lean more in favour of that recently
selectors for everything
 
Wait, devdocs loads a local cache into your localstorage doesn't it? Could we abuse that?
 
1:40 PM
performance impact is moot, and it's consistent
 
Oh neat, how long has chrome console had top-level await
 
2 years or so
depends on how long it took to move out of canary
 
What do y'all use for auto-generator documentation from jsdoc?
I used github.com/neogeek/doxdox but I think it could be better
 
user1596138
2:08 PM
0
Q: Can't change object property for Vue component (a true anomaly)

JinrenA strange anomaly. An object/component property this.gridTiles does get set correctly when I do the "undo" action first. But then when I perform the "redo" action (see code below), I'm unable to set this.gridTiles to the new value! It seems to be holding on to the old value. this.gridTiles is an ...

 
user1596138
> A true anomaly
 
such anomaly
 
user1596138
I am using React Hooks and just not seeing the point
 
user1596138
I know readability is largely about familiarity but this just seems downright difficult to read/follow. The traditional state use is extremely verbose and obvious
 
2:35 PM
I did a project using only hooks too, to test. Can't always see the point. Less class so less shouldComponentUpdate/componentDidUpdate but else... :/
 
2:48 PM
@dievardump Correct. but how I denormalize it back?
0
Q: Why denormalize not return nested object?

Jon SudI use denormalize from normalizr package as the following code: import { normalize, schema, denormalize } from 'normalizr'; const categoriesData = [ { id: 1, name: 'category-1' }, { id: 2, name: 'category-2' }, { id: 3, name: 'category-3' }, { id: 40, name: 'category-40' }, ]; const su...

 
3:04 PM
@rlemon well what is the addeventlistener thing???
 
I'm not your personal google
stop trying to get me to be that
"mdn + addeventlistener"
 
o/
 
wait why does the number sometimes increase by one instead of decrease?? XD
 
I don't know. you haven't provided any code.. again
 
!!magic
 
3:16 PM
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
 
the same code you privided earlier
provided*
no different
i was just wondering. i already used this for my code because i liked the idea of random damage. and it worked out just fine. the only problem is that the number increases sometimes
 
Why does what number increase by 1?
 
its supposed to subtract from a number from 0-24
 
if you're talking about the value.. Math.floor( Math.random() * 24 ) + 1 will never result in a negative.
 
well
press the button
youll see
sometimes it increases for no reason
 
3:18 PM
it does
however
it's never "for no reason"
 
I just ran down it three times. didn't see that
saw it hit 0 twice.
 
i saw it hit 101
 
wait
if it hits 0 it adds 1
thats why.
 
eh
 
so remove the +1 and make the multiple 25
 
3:20 PM
that doesn't make sense does it?
 
do browsers implement bedmas differently?
 
it does
 
how can it hit 0 from 100 if the max it can go down is 24?
 
because on chrome I'm never seeing it go up
 
i'm using chrome
 
3:20 PM
but another thing i dont understand is how to make it so that the number doesn't go into the negatives
 
the only way that would be possible is if it's grouping unexpectedly. but a few () will solve that
 
grouping unexpectedly
well
 
@ThomasTallman why the +1?
 
the declaration of foo.value was out of place so it didn't work properly. my bad
i removed the +1
it was casusing problems
 
yup, my bedmas was off.
 
3:24 PM
actually the correct thing would be to make it -1
 
@ThomasTallman only because it was being parsed as ( val - otherval ) + 1 instead of my intended val - (otherval + 1)
 
true.
now i need to find out how to make text like CRIT appear and dissapear. would that be done with setTimeout or setInterval?
 
neither
 
opacity, display: none, visibility: hidden
 
Keyframe animations
 
3:29 PM
i would do it with an element per crit
so you can have a stream of moving "Crit!" messages
 
how would i do that?
 
no idea
 
lemme search up keyframe animations
 
> Write my game for me
 
user8729657
Time to buy terraria.org today :)
 
3:39 PM
eh, it's an okay game
but yea, don't try to go at it blind. it needs a wiki
 
user8729657
Dam, it's that difficult to understand at first eh?
 
Ola chicos
0
Q: Can't display special german characters in typeface for Three.js

SuisseI downloaded Roboto.ttf font and used typeface.js to convert the font to .json and load it with Three.js var loader = new THREE.FontLoader(); loader.load( 'fonts/Roboto Mono_Regular.json', function ( font ) { var geometry = new ...

 
there's 0 hints at how to do stuff in game
no keybinding hints, no nothing
 
@OvieTrix there is a bunch that is intuitive. I logged like 200 hours before I opened the wiki
but there is also a bunch they just don't tell you
the game is 10X better knowing those things
 
user8729657
@rlemon, I'm so going to buy it now after I hit ribfest in the GTA.
 
3:45 PM
good stuff. hit me up if you have questions.
I have a few hours in the game
 
user8729657
cool
 
user1596138
4:01 PM
@OvieTrix What now? GTA ribfest?
 
GTA = greater toronto area, not grand theft auto
 
user1596138
I was going to say that sounds really disappointing lol
 
our rib and beer fest should be coming soon
it's usually disappointing tho
 
user8729657
Why?
 
4:02 PM
the good booths have 30minute lines
 
user1596138
I think all the ribfests pretty much have the same vendors
 
@AiraBanazadeh 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.
 
user1596138
In our general area anyway. I see some on that site that come to ours
 
Anyone knows about invariations on binary search?
 
user1596138
4:03 PM
We have Tacos Tequila and Margaritas Fest coming up
 
user8729657
Thats awesome you could talk to folks in line! @rlemon
 
user8729657
like some women or business people
 
user1596138
I was born with the wrong ethnicity but I now identify as a bean fosho
 
user8729657
Taco fest is even more better than Ribfest
 
user8729657
@Jhawins, music drinks and women thats the best :)
 
user8729657
4:05 PM
and tacos
 
just be transracial
 
user1596138
Exactly
 
4:31 PM
Find my anagram checker function below . I need a better solution for my anagram function or any improvisation .

anagramCheck = (str1,str2) =>{


var arr1 = str1.split('');
if(str1.length === str2.length) {
for (var i = 0; i<str2.length; i++){
if(arr1.indexOf(str2[i]) !== -1 && arr1.length>1){
arr1.splice(arr1.indexOf(str2[i]),1)
}
else if(arr1.indexOf(str2[i]) !== -1 && arr1.length === 1){
arr1.splice(arr1.indexOf(str2[i]),1)
return true
}
else{
return false
}
}
}
else{
return false
}
}
console.log(anagramCheck('friend','finder'))
 
@ReNinja 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.
 
user1596138
We don't write homework answers for people
 
user1596138
If you really want to cheat it's incredible straight forward to google.
 
user8729657
4:51 PM
@JBis, I heard you where going to do some work for me for $40 CAD
 
user8729657
but brb
 
5:06 PM
 
abc = 1
 
Is there a way programmatically disable the X round button when hovering the bottom in full screen mode?
 
1 message moved to Trash can
@HelloWorldPeace 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
1 message moved to Trash can
@HelloWorldPeace Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
        if (condition) {
          // do something
        } else {
         // do something else
       }
    // --- VS
    if (condition) {
      // do something
    }
    else {
     // do something else
   }
is there a reason why the former is used more often than the latter?
I know, google is your friend .... just curious on personal opinions
 
5:23 PM
lol
 
actually i'm just looking for validation, dislike writing the first syntax but am trying to maintain a style guide
 
user8729657
I dont get it
 
6:01 PM
@OvieTrix ?
 
6:23 PM
the latter is ugly
 
yeah the second one looks bad.
it's a waste of space and it doesn't associate the if with the else very well
 
7:09 PM
I actually prefer the second
I like having closing curly braces alone on their own line
 
ndugger's preference is even more evidence that it's wrong
 
I like my code to have room to breath so it's easier to read quickly
> waste of space
terrible argument
 
why do you use the opening brace on the same line as the if
 
Have you seen codebases where people are concerned about "wasting space"? It looks like someone vomited on the IDE and it's hard to read because it's all crammed together
 
there's a difference between golfing and avoiding needless vertical expansion
anyway I think my main problem with this particular code is that it doesn't choose one or the other
either put the braces on their own line or don't
 
7:12 PM
What is the point of even caring about "needless vertical expansion"? It's not like he's throwing down tosn of blank lines
It's a really weird thing to care about
 
user1596138
Taking examples to the most extreme end is always fun
 
@forresthopkinsa this style of braces, where the closing brace is on its own line is referred to as Stroustrup style, referencing the coding style of the creator of C++
 
the amount of code that you see in your viewport can change pretty dramatically between braces-on-their-own-line style and typical JS style
 
In computer programming, an indentation style is a convention governing the indentation of blocks of code to convey program structure. This article largely addresses the free-form languages, such as C and its descendants, but can be (and often is) applied to most other programming languages (especially those in the curly bracket family), where whitespace is otherwise insignificant. Indentation style is only one aspect of programming style. Indentation is not a requirement of most programming languages, where it is used as secondary notation. Rather, indenting helps better convey the structure of...
 
user1596138
The main thing is to be consistent. EVen if you're being weird
 
7:14 PM
^
 
I think we're all agreed there
 
user1596138
No I don't agree yet
 
oh oh ok
apologies
 
no, no
I believe that
 
user1596138
I agree
 
7:15 PM
if (...) {

}
else {

}
is consistent
closing braces are consistently on their own lines
 
it's weird but not inconsistent
 
the content in front of the opening brace acts as the "label" or explanation of the following block
I find it weird when people put the else on the same line as the closing brace
 
user1596138
I am going to pose a non-programming but PC building question. You are warned
 
give your code room to breath
 
user1596138
As soon as this is done because I don't want to disrupt..
 
7:16 PM
function ()
{
  ...
  if
  {
    ...
  }
  else
  {
    ...
  }
}
 
user1596138
Just don't use braces.
 
there's breathing room
exactly
 
user1596138
if (thing) stuff(), a = true; else notStuff(), moreStuff();
 
much better
 
everyone is wrong except for me
 
7:21 PM
you should make an opinionated code formatter
like prettier but completely non-configurable
 
no
 
user1596138
Didn't Crockford or someone already do it
 
that gives the code room to breathe
 
user1596138
And got shit all over
 
cockford is an old coot
 
user1596138
7:22 PM
Lol what ever happened to that crack pipe he was smoking at MidwestJS? "Seif" protocol or something
 
user1596138
Oof, that was more critical than I intended to be
 
7:48 PM
let the criticism flow through you
 
 
2 hours later…
9:37 PM
0
Q: How to position a popup based on the cursor click (without using jQuery)?

mie.ppaI am trying to create a Firefox extension, where I want a popup to appear next to some text which is double clicked. As I am placing this code as my extension's content script which will be loaded on ANY website, I have tried to not use jQuery for this task. I have seen and implemented the answe...

 
@mie.ppa 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.
 
00:00 - 12:0012:00 - 22:00

« first day (3142 days earlier)      last day (1823 days later) »