These are chat archives for FreeCodeCamp/Help

28th
Nov 2018
Ghost
@ghost~5b53da7dd73408ce4fa1d2e5
Nov 28 2018 00:45
Aditya
@ezioda004
Nov 28 2018 01:22
@coderkarma You should select Javascript React as file type, can select that by clicking on the bottom left side where it says "Javascript" and prettier should format it correctly.
glitz20
@glitz20
Nov 28 2018 01:38
hey guys how can I send data from form(with selection option) to database?
links to any example?
Philip Durbin
@pdurbin
Nov 28 2018 01:41
@glitz20 the language doesn't matter?
glitz20
@glitz20
Nov 28 2018 01:41
oh sorry its in react
@pdurbin
Philip Durbin
@pdurbin
Nov 28 2018 01:43
But React doesn't talk directly to the database, does it?
glitz20
@glitz20
Nov 28 2018 01:43
I am using node.js
Philip Durbin
@pdurbin
Nov 28 2018 01:44
ah
glitz20
@glitz20
Nov 28 2018 01:44
I donot know how to assign the selected value in the form to a specific state
Karma Drukpa
@coderkarma
Nov 28 2018 01:46
@ezioda004 bottom left side of what ?
Aditya
@ezioda004
Nov 28 2018 01:47
@coderkarma Excuse me, bottom right of VSC.
Jomaree Lawsin
@jl88s
Nov 28 2018 01:48
d
Karma Drukpa
@coderkarma
Nov 28 2018 01:55
here's my vscode setting, I might have mess up with settings that's why prettier formater doesn't work properly
can you take a look on settings
Aditya
@ezioda004
Nov 28 2018 02:00
Its not prettier setting
Screenshot (170).png
The file type should be appropriate.
You can see I've selected "Javascript React"
Karma Drukpa
@coderkarma
Nov 28 2018 02:09
@ezioda004 alright I did selected #"Javascript React" now.
glitz20
@glitz20
Nov 28 2018 02:10
@ezioda004 any idea on forms in react
Aditya
@ezioda004
Nov 28 2018 02:12
@coderkarma Yep, now try to prettify it and it should work.
@glitz20 What about it? It works the same way with/without React.
glitz20
@glitz20
Nov 28 2018 02:13
so I have form where user can select from option. How do I assign the selected value to a state, so that I can send it to database?
Aditya
@ezioda004
Nov 28 2018 02:16
Do you have .onSubmithandler?
Karma Drukpa
@coderkarma
Nov 28 2018 02:16
@ezioda004 it seems working now. thanks.
glitz20
@glitz20
Nov 28 2018 02:17
yeah I do
Aditya
@ezioda004
Nov 28 2018 02:20

Okay then the easiest way would be to have onChange handler too, that updates the state, so for example you have:

<form onChange = {this.onChangeHandler} onSubmit = {this.onSubmitHandler}>
  <select >
    <option value = "value1">Value 1 </option>
    <option value = "value2">Value 2 </option>
  </select>
</form>

and your onChangeHandler would look something like this:

onChangeHandler = e => {
  this.setState({
    selectValue: e.target.value
  });
}
Now onSubmit you can send the state.
glitz20
@glitz20
Nov 28 2018 02:24
what if I have multiple forms?
would there be multiple selectValue?
Aditya
@ezioda004
Nov 28 2018 02:28

In that case you could use name attribute instead:

<option name = "firstName" value = "value1">Value 1 </option>

this.setState({
  [e.target.name]: e.target.value
})

This way you can reuse the onChangeHandler with multiple forms.

glitz20
@glitz20
Nov 28 2018 02:49

                    <form onChange={this.handleForm} onSubmit={this.handleSubmit}>
                        <select >
                            <option name = "val1" value="value1">1</option>
                            <option name ="val1" value="value2">2 </option>
                        </select>

                        <select >
                            <option name="val2" value="value1">1 </option>
                            <option name="val2" value="value2">2 </option>
                        </select>
                    </form>
@ezioda004 I did it like this, but it is not changing the state
 handleForm(event) {
        this.setState({ [event.target.name]: event.target.value });
    }
Aditya
@ezioda004
Nov 28 2018 02:51
@glitz20 Is the handleForm binded?
glitz20
@glitz20
Nov 28 2018 02:53
yeah it is
@ezioda004
kinopotato
@kinopotato
Nov 28 2018 02:59
does anyone have any experience using google sheets as a database?
Philip Durbin
@pdurbin
Nov 28 2018 03:09
As a tsv file, yes.
kinopotato
@kinopotato
Nov 28 2018 03:10
I'm considering using google sheets as my ghetto backend to make a payroll system. what do you think?
Bjorn van de Peut
@bjorno43
Nov 28 2018 03:43
@kinopotato File operations are a whole lot slower than database operations. You should never ever use a normal text based file like a database. It's not intended to be used like that. Not to mention it's probably very insecure
idris
@idris12
Nov 28 2018 04:04
hello
Claudio Restifo
@Marmiz
Nov 28 2018 04:10
:wave:
Marc
@MWBauer
Nov 28 2018 04:22
Hey all
Please somebody be here
I need a moment's help
Bjorn van de Peut
@bjorno43
Nov 28 2018 04:23
Just because someone is here, doesn't mean they're able to help ;-)
Marc
@MWBauer
Nov 28 2018 04:23
lol Too true
But this is easy. I just can't think of how to report a selection from a dropdown into the html.
Bjorn van de Peut
@bjorno43
Nov 28 2018 04:24
Perhaps it would be easy if you explained it in a way that we understand what you mean, ye :P
Marc
@MWBauer
Nov 28 2018 04:26
Sorry. I have coded a dropdown asking a person to select a State in which they live. I'm trying to build a box and report the choice.
Bjorn van de Peut
@bjorno43
Nov 28 2018 04:26
Oh, so you want to show the selection somewhere inside the HTML?
Marc
@MWBauer
Nov 28 2018 04:26
yes
Bjorn van de Peut
@bjorno43
Nov 28 2018 04:27
Well you're going to need Javascript for that
Marc
@MWBauer
Nov 28 2018 04:27
I have js
Would you like a copy of my codepen?
https://codepen.io/MBauer/pen/qQMgXE
Amit Patel
@AmitP88
Nov 28 2018 04:28
hey guys, I'm working on a tic tac toe game with an AI and I need a little help. I'm trying to merge the playersMoveBoard array and the computersMoveBoard array into the displayedBoard array. All empty spaces should be in the displayedBoard array, along with any filled cells in both the playersMoveBoard and computersMoveBoard. I've been working at this trying all sorts of stuff and looking at stackoverflow, but it seems like no matter what I try I can't get displayedBoard to look how it should
tictactoe.png
Bjorn van de Peut
@bjorno43
Nov 28 2018 04:29

Basicly you create an onchange event for your <select> element. Like <select onchange="myJSFunction()">. Then the myJSFunction() gets the select value. Something like:

function myJSFunction(){
    var value = this.options[ this.selectedIndex ].value;

And lastly you use JS to set the value of the HTML box to that value

Marc
@MWBauer
Nov 28 2018 04:31
Right. Then...how do I tell html to display the index?
it's just been so long since i've done much of this that I just can't think of how it's done.
Aditya
@ezioda004
Nov 28 2018 04:32
@AmitP88 What do you mean by merge?
Like can you give an example?
Bjorn van de Peut
@bjorno43
Nov 28 2018 04:33
You don't need html to display an index? Just something like:
<select onchange="myJSFunction">
    <option value="state 1">State 1</option>
    <option value="state 2">State 2</option>
    ...
</select>
Marc
@MWBauer
Nov 28 2018 04:34
I have that.
Amit Patel
@AmitP88
Nov 28 2018 04:34
@ezioda004 well I mean, any filled cells from playersMoveBoard and any filled cells from computersMoveBoard should be pushed in displayedBoard at their respective index, and any empty cells from both playersMoveBoard and computersMoveBoard should be pushed in displayedBoard at their respective index as well
I'll see if I can write an example
Aditya
@ezioda004
Nov 28 2018 04:36
@AmitP88 What if theres a clash? Like say at 0 index the player has a O and computersMoveBoard also have that?
Amit Patel
@AmitP88
Nov 28 2018 04:37
tictactoe.png
@ezioda004 yeah, I've thought about that too. I'm hoping that since the computers move takes place straight away after the player clicks on a cell, that that may be avoided
Aditya
@ezioda004
Nov 28 2018 04:39
@AmitP88 Ok - so what should be the output of the above screenshot for displayedBoard?
Amit Patel
@AmitP88
Nov 28 2018 04:39
it's in the comments in the red box
on the right hand side
Aditya
@ezioda004
Nov 28 2018 04:39
Oops, I was zoomed in
Ok then you can just use a .map()?
Amit Patel
@AmitP88
Nov 28 2018 04:40
so map over one array and nest another map for the other array within it?
glitz20
@glitz20
Nov 28 2018 04:40
@ezioda004 I cannot see the state of val1 and val2 in codepen
Amit Patel
@AmitP88
Nov 28 2018 04:41
I tried implementing this as well: https://codeburst.io/comparison-of-two-arrays-using-javascript-3251d03877fe, but I ended up making displayedBoard have 81 indeces instead of 9
idris
@idris12
Nov 28 2018 04:41
so i want the background to full show this image
i have added cover positioning and all that still no luck
its suppose to look like that
Amit Patel
@AmitP88
Nov 28 2018 04:42
I've tried nested for loops (outer loop for playersMoveBoard, inner loop for computersMoveBoard), but that resulted in having the whole board filled with the player on just one click
idris
@idris12
Nov 28 2018 04:42
landingpage.jpg
nvm i fixed it
Aditya
@ezioda004
Nov 28 2018 04:46
@AmitP88
const player = ['X', '', '', '', '', '', '', '', ''];
const comp = ['', '', '', '', 'O', '', '', '', ''];
player.map((val, i) => val == '' && comp[i] == '' ? '' : comp[i] == '' ? val : comp[i]); //   ["X", "", "", "", "O", "", "", "", ""]
Claudio Restifo
@Marmiz
Nov 28 2018 04:46
@AmitP88 I don't get the issue. Mind explaining it a bit deeper?
I mean, why choosing to have two data sets for the board, instead a single one?
I cannot see the benefit of having a player and a comp array.
Aditya
@ezioda004
Nov 28 2018 04:47
@glitz20 <h2>Selected {this.state.select1} {this.state.select2}</h2>
@Marmiz Yeah same, I'm not sure how hes implementing the AI's move
Amit Patel
@AmitP88
Nov 28 2018 04:48
@Marmiz well I mean, I'm using react + redux to make an unbeatable tic tac toe using minimax algorithm. The way I was coding, it ended up having to be this way
Aditya
@ezioda004
Nov 28 2018 04:48
I did with the minimax algo, so that used a tree therefore only 1 state array
Amit Patel
@AmitP88
Nov 28 2018 04:50
I was trying to make it use just one array for both the player and computers moves, but the way react + redux works, you have to return a new state, and idk, it just ended up being that way
Claudio Restifo
@Marmiz
Nov 28 2018 04:50
ain't usually a tree with minmax?
like a ramification of all possible scenarios starting from where the board is?
Amit Patel
@AmitP88
Nov 28 2018 04:50
I'm sure my whole project will need a refactor after it's done, but I was doing it to learn how redux works in react
Aditya
@ezioda004
Nov 28 2018 04:50
@AmitP88 Does the above code I posted works for you?
Amit Patel
@AmitP88
Nov 28 2018 04:50
@ezioda004 still working at implementing it. one sec
Claudio Restifo
@Marmiz
Nov 28 2018 04:55

@AmitP88 Redux implement a shallow comparison, that means that if you want to trigger a re-render your "data" (or portion of) needs to be fresh. This means you need methods that returns new.

For instance:
push returns the new length or index (idk) and add in the same data.
map returns a new array.

But this doesn't mean you cannot use push in Redux (if you are more confortable with it)

Amit Patel
@AmitP88
Nov 28 2018 04:57
@Marmiz ah I see, so it's all about using methods that only return a new modified array
@ezioda004 it works :)
tictactoe.png
Claudio Restifo
@Marmiz
Nov 28 2018 04:58
for example @AmitP88 :
const oldarr = [1,2,3]
return [...oldarr, 4];

/** is the same as */
const copy = oldarr.slice(); // make a new copy
copy.push(4) // push into it
return copy // return the new updated array
Amit Patel
@AmitP88
Nov 28 2018 05:00
@Marmiz ah I see. Yeah, I've gotten used to using the spread op to return the new updated array, but I'll keep the other methods in mind for returning new
Aditya
@ezioda004
Nov 28 2018 05:01
or oldarr.concat(4)
Amit Patel
@AmitP88
Nov 28 2018 05:06
hmmm, I need to fix my minimax (it's allowing me to win). Thanks @ezioda004 and @Marmiz ! :)
Claudio Restifo
@Marmiz
Nov 28 2018 05:15
:+1:
Bjorn van de Peut
@bjorno43
Nov 28 2018 05:35
Pff, I need a designer, lol
Claudio Restifo
@Marmiz
Nov 28 2018 05:37
put some color in it.
#design
Bjorn van de Peut
@bjorno43
Nov 28 2018 05:40
:joy:
I'm always like: I can make it work! But making it look good.. that's whole different matter!
Especially cuz it needs to look good on every major browser and devise (damn mobile users)
Claudio Restifo
@Marmiz
Nov 28 2018 05:44
eff mobile. Release an App :smirk:
Bjorn van de Peut
@bjorno43
Nov 28 2018 05:47
I'm not gonna learn how to make an app :P
Bjorn van de Peut
@bjorno43
Nov 28 2018 06:16
Hmm. I'm getting a v.includes is not a function on Object.values(this.userlist[currentRoom]).some(v => v && v.includes(this.username)). Anyone an idea?
YangLiu
@Helloworld1986
Nov 28 2018 06:24
Excuse me, I use "font-size" to change character size, but it doesn't work, would you please finger out my grammer false, thanks.
p {
font-size: 16px;
}
<p>养动物</p>
Bjorn van de Peut
@bjorno43
Nov 28 2018 06:36
Alright, I know the cause of the issue.. just not how to solve it. v is an object, not an array. That's probably why it doesn't work
Aditya
@ezioda004
Nov 28 2018 06:39
@bjorno43 Do you know what v can be?
Bjorn van de Peut
@bjorno43
Nov 28 2018 06:42
@ezioda004 Ye. v is the user object. It contains data like username etc:
{"3":
    {
        "username":"icecub",
        "proimg_name":"621499787",
        "proimg_mime":"png",
        "userlvl":"Eigenaar",
        "userlvlnr":"5",
        "gender":"Man",
        "hidden":false
    }
}
Aditya
@ezioda004
Nov 28 2018 06:43
So v is this whole object?
Bjorn van de Peut
@bjorno43
Nov 28 2018 06:44
Yes. Well, multiple objects. v is each user object. Hence the some function
Aditya
@ezioda004
Nov 28 2018 06:45
Its indexed based? Could you use index to access? Like .some((v, i) => v && v[i].username.includes(this.username))?
Bjorn van de Peut
@bjorno43
Nov 28 2018 06:46
Lemme check, but I think it's not
No it isn't. v[i] is undefined
Aditya
@ezioda004
Nov 28 2018 06:48
Hmm, I'm not sure how you'd dynamically access "3"
If possible can you show the whole array that Object.values() return?
Bjorn van de Peut
@bjorno43
Nov 28 2018 06:49
Ye that's kind of the issue. I think I need to loop through each object, then hasOwnPropterty on username and check its value. Something like that
Erm, I could, but I think that's quite a bit of data.. one moment
Bjorn van de Peut
@bjorno43
Nov 28 2018 06:54
@ezioda004 It returns:
[
  {
    "username": "icecub",
    "proimg_name": "621499787",
    "proimg_mime": "png",
    "userlvl": "Eigenaar",
    "userlvlnr": "5",
    "gender": "Man",
    "hidden": false
  }
]
Array 0: object: username etc
That's for a single room though: console.log(Object.values(this.userlist[currentRoom]));
Aditya
@ezioda004
Nov 28 2018 07:02
@bjorno43 So its possible that username cant be there in all objects?
Bjorn van de Peut
@bjorno43
Nov 28 2018 07:03
@ezioda004 No it's not. username will always be there in each object
Aditya
@ezioda004
Nov 28 2018 07:03
Oh then why'd you use v && v.includes?
Bjorn van de Peut
@bjorno43
Nov 28 2018 07:04
I just copied it from the old code, lol
Aditya
@ezioda004
Nov 28 2018 07:04
Lol, I thought it was checking for undefined values
So I think this should work .some(v => v.username.includes(this.username))
Bjorn van de Peut
@bjorno43
Nov 28 2018 07:05
No it's my "roomlist" buildup. You have: "Current room" / "Joined Rooms" and "Available Rooms". The current room lists the room you're looking at. The joined rooms the ones you're in and the available rooms all the others. This perticular check is to list the rooms you've joined but aren't watching
Aditya
@ezioda004
Nov 28 2018 07:05
Presuming this.username is what I think it is
Bjorn van de Peut
@bjorno43
Nov 28 2018 07:06
Yup, that worked
Aditya
@ezioda004
Nov 28 2018 07:07
Great!
Bjorn van de Peut
@bjorno43
Nov 28 2018 07:08
Thanks a lot!
Aditya
@ezioda004
Nov 28 2018 07:09
:sparkles:
Claudio Restifo
@Marmiz
Nov 28 2018 07:19
@Helloworld1986 have you put the style declaration inside the <style> tags?
Aditya
@ezioda004
Nov 28 2018 07:21
@Marmiz @bjorno43 I recently got my first full time job as React, Redux dev :D
Claudio Restifo
@Marmiz
Nov 28 2018 07:22
:sparkles: :sparkles: :sparkles:
CONGRATS @ezioda004
:wine_glass: :balloon: :cake:
Aditya
@ezioda004
Nov 28 2018 07:23
Thanks to ya'll!
Claudio Restifo
@Marmiz
Nov 28 2018 07:23
You deserve it!
I wish it will fulfils, enrich and makes you wake up every morning with a simile :smile:
Aditya
@ezioda004
Nov 28 2018 07:24
Very kind of you! I just hope I'm able to browse memes at work :smile:
Claudio Restifo
@Marmiz
Nov 28 2018 07:25
90% of the job is finding the right meme to reply on chat to bug reports and feature requests
Aditya
@ezioda004
Nov 28 2018 07:26
Lmao
Claudio Restifo
@Marmiz
Nov 28 2018 07:27
pro tip: make a shortcut for the "ain't nobody got time for that" meme
you'll need it
Bjorn van de Peut
@bjorno43
Nov 28 2018 07:28
@ezioda004 Congrats m8! :cake: You've earned it!
Aditya
@ezioda004
Nov 28 2018 07:29
@Marmiz Lol, they are migrating a big app from Angular to React and to Node from Java, its gonna be really hectic initially, but I'm hoping things will clam down after a while
@bjorno43 Thank you :smile:
Claudio Restifo
@Marmiz
Nov 28 2018 07:30
Aditya
@ezioda004
Nov 28 2018 07:37
Lol I'm so the coke guy
YangLiu
@Helloworld1986
Nov 28 2018 09:07
@Marmiz I have used "style" to declaration the "font-size", and bug is solved, thanks!
Supra01
@Supra01
Nov 28 2018 09:15
Has anyone got API keys to work with gatsby.js and netlify?
image.png
I put my key here but key doesn't work on the live site
but locally it does
Kaz Baig
@kbaig
Nov 28 2018 09:20
@ezioda004 Congrats!!!
Supra01
@Supra01
Nov 28 2018 09:39
Oh wait lol I figured it out
Aditya
@ezioda004
Nov 28 2018 09:46
@kbaig Thank you! :)
Niraj Nandish
@Nirajn2311
Nov 28 2018 11:09
@Marmiz @bjorno43 I recently got my first full time job as React, Redux dev :D
@ezioda004 congrats, :tada: :confetti_ball:
when’s the party
huangqing
@huangqing1641568165
Nov 28 2018 11:23
hello
Aditya
@ezioda004
Nov 28 2018 12:51
@Nirajn2311 Thanks! I havent started it yet, maybe after I start the job :wink:
Jim7894
@Jim7894
Nov 28 2018 13:03
Unity C# After have got the object y size bigger how to switch it back to it's normal size after some seconds?
BuntyBru
@BuntyBru
Nov 28 2018 13:09
@ezioda004 Congrats mate
BuntyBru
@BuntyBru
Nov 28 2018 13:48
I used some functions to make changes to the scrollbar
but now when i am opening my application on Internet Explorer, i find that it is back on there
Is there any way in CSS through which i can change the design based on browser?
Zaza
@ForkInSpace
Nov 28 2018 14:06
@BuntyBru What's the frontend stack ? do you use autoprefixer ?
Kelechi Chinaka
@ke1echi
Nov 28 2018 14:11
congrats @ezioda004
Zaza
@ForkInSpace
Nov 28 2018 14:13
@BuntyBru maybe a good starting point https://autoprefixer.github.io/
Aditya
@ezioda004
Nov 28 2018 14:16
@BuntyBru @ke1echi Thanks!
sweetycy
@sweetycy
Nov 28 2018 14:41
name属性为indoor-outdoor。
你的两个单选按钮中的每一个都应该嵌套进它自己的label元素中。
确保你的每一个label元素都有一个结束标记。
应该有一个indoor单选
BuntyBru
@BuntyBru
Nov 28 2018 14:42
@ForkInSpace overflow-y:auto saved the day
sweetycy
@sweetycy
Nov 28 2018 14:42
不懂咋个设置 求指教
BuntyBru
@BuntyBru
Nov 28 2018 14:42
I am using angular as aframework
@ForkInSpace
Another problem has come up. Dropdowns are not working on Safari
Zaza
@ForkInSpace
Nov 28 2018 14:45
normally using autoprefixer is a good idea for supporting diff browsers and for making sure that things don't break across browsers
Mr-L
@Hao-Lv
Nov 28 2018 14:46
@cmccormack Thank you very much! I will try again.
BuntyBru
@BuntyBru
Nov 28 2018 14:52
@ForkInSpace
I have never used autoprefixer
maybe next time
As currently i was supposed to deploy the application
Now at the last moment this Safari issue came up :(
Zaza
@ForkInSpace
Nov 28 2018 15:05
I see. in that case I guess try to manually autoprefix the css attributes with issues
Zaza
@ForkInSpace
Nov 28 2018 15:12
and good luck
thekindlyelk
@thekindlyelk
Nov 28 2018 15:16
why am I still getting constant gitter popups even though I disabled notifications unless I'm directly mentioned
oh nvm the settings are per room not global
Niraj Nandish
@Nirajn2311
Nov 28 2018 15:18
@ezioda004 which company are you working for?
Aditya
@ezioda004
Nov 28 2018 15:24
@Nirajn2311 I havent accepted the offer but until I join I shouldnt spill out the beans yet
Niraj Nandish
@Nirajn2311
Nov 28 2018 15:42
@ezioda004 :thumbsup:
Kyle Holm
@thekholm80
Nov 28 2018 17:15
@ezioda004 congrats on the new job
Aditya
@ezioda004
Nov 28 2018 17:18
@thekholm80 Thank you Sir Kyle
Henry
@GitHub-Henry
Nov 28 2018 17:55
@ezioda004 just saw the news, congrats
Aditya
@ezioda004
Nov 28 2018 17:59
@GitHub-Henry Thank you!
Jake
@JakeDVirus
Nov 28 2018 18:41
why the shrink is not working after the width gets below the content width? https://codepen.io/neel111/pen/pQxKwV
in my real work the context is an image, the quirk is same. So solving the above codepen shrink issue might solve my real-work shrink issue. So What am i missing?
Smootimus
@Smootimus
Nov 28 2018 18:52
@thekholm80 :wave:
@ezioda004 :wave:
@Nirajn2311 :wave:
Kyle Holm
@thekholm80
Nov 28 2018 18:54
@Smootimus :wave:
Smootimus
@Smootimus
Nov 28 2018 18:58
How goes
Aditya
@ezioda004
Nov 28 2018 18:59
:wavy_dash:
May Kittens Devour Your Soul
@diomed
Nov 28 2018 19:53
@ezioda004 working for Microsoft India
@IliyanDimitrov what is it?
Aditya
@ezioda004
Nov 28 2018 19:55
@diomed Yeah, my first project is to make typescript with no types
May Kittens Devour Your Soul
@diomed
Nov 28 2018 19:55
are you advertising yourself here, boi? @IliyanDimitrov
Aditya
@ezioda004
Nov 28 2018 19:55
@IliyanDimitrov Yeah thats advertisement - not allowed
IliyanDimitrov
@IliyanDimitrov
Nov 28 2018 19:55
Need an opinion
ok didn't knew that
will delete it
sorry
May Kittens Devour Your Soul
@diomed
Nov 28 2018 19:56
my opinion is you have too much planets around that sun
Aditya
@ezioda004
Nov 28 2018 19:58
Seems like agar.io
May Kittens Devour Your Soul
@diomed
Nov 28 2018 20:01
@IliyanDimitrov design me a t-shirt
Christopher McCormack
@cmccormack
Nov 28 2018 20:01
@IliyanDimitrov np read this when you get a chance
May Kittens Devour Your Soul
@diomed
Nov 28 2018 20:10

Aditya is a pokemon!

Aditya
@ezioda004
Nov 28 2018 20:29
I can vouch that
Danny
@dannybrown37
Nov 28 2018 20:38
Anybody willing to help me figure out why my header is not 960px like the rest of my content? https://codepen.io/dannybrown37/pen/NELRgb
Been struggling with this for a while now
May Kittens Devour Your Soul
@diomed
Nov 28 2018 20:41
@dannybrown37 coz u put position:fixed
apparently
Danny
@dannybrown37
Nov 28 2018 20:42
Weird. Tests require it to be fixed, but thanks for pinpointing the problem. Now I can start to troubleshoot...
@diomed thank you
May Kittens Devour Your Soul
@diomed
Nov 28 2018 20:43
@dannybrown37 width:100%;
maby
Eric Weiss
@eweiss17
Nov 28 2018 20:43
Our customers all say we are the best company. Honest! .... hmmm
I guess i trust that
Danny
@dannybrown37
Nov 28 2018 20:44
haha :D
May Kittens Devour Your Soul
@diomed
Nov 28 2018 20:44
Murica
Danny
@dannybrown37
Nov 28 2018 20:44
perfectly reasonable, yes?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 20:45
as someone who works for Veridian Dynamics, I know we are the best company
Karma Drukpa
@coderkarma
Nov 28 2018 20:46
👋
Eric Weiss
@eweiss17
Nov 28 2018 20:46
I believe it is because header is origianlly display block
which has the def of " Displays an element as a block element (like <p>). It starts on a new line, and takes up the whole width "
you switched it to flex
which I do no believe defaultly takes up the entire width
May Kittens Devour Your Soul
@diomed
Nov 28 2018 20:47
isnt it coz of position : fixed?
I mean when I remove that it widens
Eric Weiss
@eweiss17
Nov 28 2018 20:47
maybe
Most of the time, absolutely positioned elements that have height and width set to auto are sized so as to fit their contents.
May Kittens Devour Your Soul
@diomed
Nov 28 2018 20:48
apparently this one guy translated app to Redneck and IDK what to think about world anymore
Eric Weiss
@eweiss17
Nov 28 2018 20:49
picky, but i'd avoid using main as an id, as main is a html tag
Danny
@dannybrown37
Nov 28 2018 20:50
@eweiss17 thanks for that tip, didn't realize that was a practice to avoid but it makes sense and is easy enough
So when I try to add width: 100% to the fixed toolbar it goes way too far. What am I not understanding here?
Eric Weiss
@eweiss17
Nov 28 2018 20:55
because it is 'fixed' It Doesn't see the rest of the page
width 100% is really pretty much saying, fill the parent element
fixed = no parent element
if you assign that header to also width 960 px then it does what you would want
Danny
@dannybrown37
Nov 28 2018 20:56
I can set width to 960px to get what I actually want, but that doesn't help with responsive design
May Kittens Devour Your Soul
@diomed
Nov 28 2018 20:56
basic lesson here is - don't listen to :cat:
Eric Weiss
@eweiss17
Nov 28 2018 20:56
indeed
i may have been wrong on some of what i said ...
Danny
@dannybrown37
Nov 28 2018 20:58
max-width: 960px combined with width: 100% seems to work!
Thanks for helping me work through it @eweiss17 and @diomed
Eric Weiss
@eweiss17
Nov 28 2018 20:59
worked out in the end... haha
Zaza
@ForkInSpace
Nov 28 2018 21:04
Hey guys anyone working with wordpress here?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 21:05
yes, me. but not with php part of it
xD
Zaza
@ForkInSpace
Nov 28 2018 21:06
lol
ok
Danny
@dannybrown37
Nov 28 2018 21:06
yeah, same. If it's a question about the UI or installing plug-ins I could probably help, but I haven't gone deep on the tech side of WP
Zaza
@ForkInSpace
Nov 28 2018 21:06
Ever tried react with WP?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 21:07
not even people who work with php wanna go into php part of wp
Zaza
@ForkInSpace
Nov 28 2018 21:07
I bet :D
I have a client who needs a project on CMS and as much as I don't like CMSs its out of the question so I thought I'd do it with wordpress because I have done few simplistic, static websites with it
Love how everyone went silent :D
May Kittens Devour Your Soul
@diomed
Nov 28 2018 21:09
that happens here. not a lot of people here
what do you need to build for him? simple page or something special
Zaza
@ForkInSpace
Nov 28 2018 21:11
product catalogue and few static pages later on to be turned into an ecomm website
May Kittens Devour Your Soul
@diomed
Nov 28 2018 21:11
ah heck. that seems like smth for wp. yeah
Zaza
@ForkInSpace
Nov 28 2018 21:14
That's what I thought
what about react for state management ?
Aditya
@ezioda004
Nov 28 2018 21:16
React is better for view and small state
Zaza
@ForkInSpace
Nov 28 2018 21:19
@ezioda004 what you mean its for small state?
not suitable for my use?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 21:21
it's for Andorra or San Marino. smth like that
Malta maybe
I hope that doesn't make sense.
Aditya
@ezioda004
Nov 28 2018 21:22
@ForkInSpace Sorry I didnt follow the whole conversation but React is good for updating view and having small local state for the UI, if you need anything anything more complex, like a state for the whole app then consider something like Redux
@diomed It doesnt
May Kittens Devour Your Soul
@diomed
Nov 28 2018 21:28
@ezioda004 thanks. can may I send you some html to troubleshoot?
Manan Shah
@mananshah51
Nov 28 2018 21:39
I had one questions in my head, if you struggle with any Algo or DS for a long period of time (couple of hours), and even after getting some hints you are not able to figure things out, is is good to have a look at the Solution ?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 21:41
@mananshah51 no - first ask @JLuboff or @ezioda004 for a part you can't figure out
Jason Luboff
@JLuboff
Nov 28 2018 21:43
@mananshah51 I've taken days to complete FCC algo's when I first started. Hell...I take days just to figure out my own algo's for my apps lol
Manan Shah
@mananshah51
Nov 28 2018 21:44
@JLuboff So I should keep on trying and not look for answers, right ?
May Kittens Devour Your Soul
@diomed
Nov 28 2018 21:46
depends how much time do you want to spend on algos before you die
Manan Shah
@mananshah51
Nov 28 2018 21:46
@diomed Hahah.
Jason Luboff
@JLuboff
Nov 28 2018 21:47
@mananshah51 Yes and no. I would recomend asking for help here, showing code and what your problem is. Usually someone is able to help
Manan Shah
@mananshah51
Nov 28 2018 21:48
@JLuboff Sounds Good. I would do that. Thank you so much for your help.
Zaza
@ForkInSpace
Nov 28 2018 21:49
I think its alright to look at some hints what not. Not advocating that you constantly look up others solutions without putting solid effort in solving it on your own. However, practicing and looking for hints can help you think algorithmically and get better at it if not good. (disclaimer, I suck at algos and practicing daily )
Manan Shah
@mananshah51
Nov 28 2018 21:50
@ForkInSpace Sounds good thank you so much for your feedback.
Aditya
@ezioda004
Nov 28 2018 22:01
@diomed I'm to sleepy, maybe tomorrow
codeloopy
@codeloopy
Nov 28 2018 23:37
* Need Advice: what do u guys do when super stuck, after reading documentations and multiple samples and even som YT videos on a particular algorithm?
and we’re talking after hours of running in circles trying different things and still not getting it to work.
Binyamin Aron Green
@b3u
Nov 28 2018 23:39
Take a good break, and come back later with a fresh mind.
Jason Luboff
@JLuboff
Nov 28 2018 23:40
@codeloopy Have you tried asking in here?
codeloopy
@codeloopy
Nov 28 2018 23:41
@JLuboff yeah from time to time, but I feel I have a pretty good grasp on things and then seems like I don’t HAHA
is not like ima quit or anything … but feels like a kick in the nuts if u know what I mean
Jason Luboff
@JLuboff
Nov 28 2018 23:42
Sometimes you need outside perspective. Hell..sometimes you just need to tell someone out loud or via chat what your problem is and something clicks
codeloopy
@codeloopy
Nov 28 2018 23:43
At what point (if at any) do u ‘give up’ and search for an answer or hit that dreaded hint button
cool @JLuboff … makes sense