These are chat archives for FreeCodeCamp/Help

8th
Sep 2018
Supra01
@Supra01
Sep 08 2018 05:34
Is anyone using SSH and windows subsystem for linux?
Niraj Nandish
@Nirajn2311
Sep 08 2018 05:36
I used wsl before but I left it
Supra01
@Supra01
Sep 08 2018 05:38
@Nirajn2311 I see. Were you able to use SSH authentication with github on it?
Niraj Nandish
@Nirajn2311
Sep 08 2018 06:40
I haven’t yet tried using ssh auth with github as I never found out the importance in using it
Supra01
@Supra01
Sep 08 2018 06:41
@Nirajn2311 Ok thank you. Does anyone else use windows subsystem for linux?
Jake
@JakeDVirus
Sep 08 2018 07:05
How to make css width same as height when height is not known (height is set to strectch via flexbox approach)?
Aditya
@ezioda004
Sep 08 2018 07:25

@NeelDVirus Can use vwon both height and width:

.class {
  width: 20vw;
  height: 20vw;
}

But vw is relative to the window/body and not the parent container.

Jake
@JakeDVirus
Sep 08 2018 07:25
@ezioda004 the height is not known
Aditya
@ezioda004
Sep 08 2018 07:27
Right, vw is the view width, if you know the width of the item, then doing xvwfor the height will result the same height as width (only need to know the correct width)
Niraj Nandish
@Nirajn2311
Sep 08 2018 07:30
@ezioda004 instead of setting width height separately , he can use flex grow
psyperl
@psyperl
Sep 08 2018 07:31
<input type=text name=changeWidth value=10 onChange='changeWidth()' title="when you think is not wide enough, please change here"> :trollface:
Aditya
@ezioda004
Sep 08 2018 07:35
@Nirajn2311 flex-growis relative to the other children/items, I dont see how it can make width/height same, if you have any examples, do show.
May Kittens Devour Your Soul
@diomed
Sep 08 2018 07:35
@Nirajn2311 teach me css
I wake up early, around 7 and watch horror till about 9.
psyperl
@psyperl
Sep 08 2018 07:55
did you managed to watch hereditary @diomed ?
May Kittens Devour Your Soul
@diomed
Sep 08 2018 07:57
@psyperl I've seent Hereditary, yes. few days ago
@psyperl JS is still scarier
psyperl
@psyperl
Sep 08 2018 08:00
lol
Aditya
@ezioda004
Sep 08 2018 08:05
:ghost:
May Kittens Devour Your Soul
@diomed
Sep 08 2018 08:06
@ezioda004 you're my favorite JS ghost
Jake
@JakeDVirus
Sep 08 2018 08:08

@ezioda004 below is the code
HTML

<div class="parent">
       <div class="child"> I want to set the height of this element equals to the width (which is equals to the height of the content of it's  sibling, set by `align-items : stretch`) </div>
       <div class="child's sibling">
              some text <br>
              some text <br>
              some text <br>
              some text <br>
       </div>
</div>

CSS

.parent {
    display: flex;
    alighn-items: stretch;
}
Manish Giri
@Manish-Giri
Sep 08 2018 08:08
@diomed :cat:
Untitled.png
@psyperl does this bring back those EJB days memories :wink:
Aditya
@ezioda004
Sep 08 2018 08:09
@diomed JS is scary
psyperl
@psyperl
Sep 08 2018 08:09
@Manish-Giri lol oh man noooo
Manish Giri
@Manish-Giri
Sep 08 2018 08:09
lol
May Kittens Devour Your Soul
@diomed
Sep 08 2018 08:13
hi @Manish-Giri :cat:
Ene Catalin
@EneCatalin
Sep 08 2018 08:14
someone is playing in java
Manish Giri
@Manish-Giri
Sep 08 2018 08:14
:smiling_imp:
@EneCatalin revising some servlets stuff before going back to spring
Ene Catalin
@EneCatalin
Sep 08 2018 08:16
any luck with spring ?
I am terrified I may end on that shit again
REALLY don't wait it
Manish Giri
@Manish-Giri
Sep 08 2018 08:16
lol
had some luck
got thru IoC + DI concepts
Ene Catalin
@EneCatalin
Sep 08 2018 08:17
that doesn't seem much
Manish Giri
@Manish-Giri
Sep 08 2018 08:17
lol
yea
Ene Catalin
@EneCatalin
Sep 08 2018 08:18
especially since they're linked af
Manish Giri
@Manish-Giri
Sep 08 2018 08:18
sometimes its hard to tell the diference
well it uses servlets behind the scenes, so shouldn't be that hard now
i'm wondering what things to put on GH
there's no node_modules that i can just ignore
not to mention that i absolutely hate eclipse, and i just can't get it working on intellij
@EneCatalin
May Kittens Devour Your Soul
@diomed
Sep 08 2018 08:59
@Manish-Giri you know when u're running through the woods, and then you see clearing, and come out , and it's someone's backyard, and trees are filled with stuffed teddybears and other stuffed animals?
there's a perfectly good explanation for that, apparently, and you're not in a horror movie
(unless you're running from monster of course)
YangTao
@doudou20188
Sep 08 2018 09:17
how to use "=>" in javascript ,i don't understand
May Kittens Devour Your Soul
@diomed
Sep 08 2018 09:23
arrow function
Ene Catalin
@EneCatalin
Sep 08 2018 09:27
cat knows what arrow functions do ?
May Kittens Devour Your Soul
@diomed
Sep 08 2018 09:28
knows to recognize it :yum:
Ene Catalin
@EneCatalin
Sep 08 2018 09:29
pretty sure that guy can recognize it too
just speculating though
May Kittens Devour Your Soul
@diomed
Sep 08 2018 09:36
damn bird. you're not even an animal
Ene Catalin
@EneCatalin
Sep 08 2018 09:40
what ?
birds are savage though
May Kittens Devour Your Soul
@diomed
Sep 08 2018 09:47
is anyone here who understand English?
I need a liaison
Ene Catalin
@EneCatalin
Sep 08 2018 09:48
ostrich understands english
like 50% of the time
May Kittens Devour Your Soul
@diomed
Sep 08 2018 09:48
pft. I can do that as well
Rob
@PGFracing
Sep 08 2018 10:45
i notice on my iPhone that when the page loads www.pgfracing.com it has a pixel all the way down right side if I double tap it goes away and the screen works right, however on iPad it loads right, but when I double tap it creates 10 pixels on the right side, not sure what code I have wrong that is causing this, on iPhone and iPad when you double tap it’s supposed to set the screen size to default?
const defaultState = {
  login: false
};

const reducer = (state = defaultState, action) => {
  // change code below this line
if(action.type=='LOGIN'){
 return  state.login 
}
else{
  return defaultState;
}
  // change code above this line
};

const store = Redux.createStore(reducer);
console.log(store);
const loginAction = () => {
  return {
    type: 'LOGIN'
  }
};
i don't understand how to update the login to true
Anand Potukuchi
@anandpotukchi
Sep 08 2018 11:14
hey people
my code :
// the global variable
var bookList = ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"];

/* This function should add a book to the list and return the list */
// New parameters should come before the bookName one

// Add your code below this line
function add (bookList, bookName) {

  let bookListCopy = bookList.slice(0);
   bookListCopy.push(bookName);

  // Add your code above this line
}

/* This function should remove a book from the list and return the list */
// New parameters should come before the bookName one

// Add your code below this line
function remove (bookList,bookName) {
  let bookListCopy = bookList.slice(0);

  if (bookListCopy.indexOf(bookListCopy, bookName) >= 0) {

    bookListCopy.splice(bookListCopy.indexOf(bookName), 1);

    return bookListCopy;
    // Add your code above this line
    }
}

var newBookList = add(bookList, 'A Brief History of Time');
var newerBookList = remove(bookList, 'On The Electrodynamics of Moving Bodies');
var newestBookList = remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies');

console.log(bookList);
Jake
@JakeDVirus
Sep 08 2018 11:19

can someone make the div.child element's width's size same as the height making it a perfect square??
https://codepen.io/neel111/pen/qMVvLx?editors=1100

Extra details, if needed, are stated here https://stackoverflow.com/questions/52233474/how-to-make-css-width-same-as-height-when-height-is-not-known-and-may-differ-he

Anand Potukuchi
@anandpotukchi
Sep 08 2018 11:20
declare explicitly
@NeelDVirus
Jake
@JakeDVirus
Sep 08 2018 11:21
@anandpotukchi The height may vary. So can't set explicitly
Anand Potukuchi
@anandpotukchi
Sep 08 2018 11:22
set height:auto
no that won't work
need to dcclare explictly
@ezioda004
need help with the challenge above
Jake
@JakeDVirus
Sep 08 2018 11:24
@anandpotukchi height is set by align-items: stretch by its parent element. So the height is dependent on its sibling element. Refer to the link given for extra details
@ezioda004 i have provided a demo in the codepen link for my previous question. if you can help somehow
Anand Potukuchi
@anandpotukchi
Sep 08 2018 11:25
why are younsuing stretch
@NeelDVirus I was asking a hint to my question
as far as yours goes @NeelDVirus , why are you siu
what is the goal
@thekholm80
are you onlinw
Jake
@JakeDVirus
Sep 08 2018 11:28
@anandpotukchi I presume there happened a misunderstanding by ur end. I know you were asking a hint. I've already discussed previously with him for my present question so that's y i was addressing him again
Anand Potukuchi
@anandpotukchi
Sep 08 2018 11:28
oh okay
Jake
@JakeDVirus
Sep 08 2018 11:28
@anandpotukchi and what do u mean by "why are u sing stretch". I ain't getting u
Anand Potukuchi
@anandpotukchi
Sep 08 2018 11:29
*using
Jake
@JakeDVirus
Sep 08 2018 11:31
@anandpotukchi it's a flexbox thing. using it to stretch all the child elements height to the 100% of its parent container. So every child element has a consistent height. This may enlighten u about it https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Aditya
@ezioda004
Sep 08 2018 11:37
@anandpotukchi Make the add function return the new array.
In remove function change bookListCopy.indexOf(bookListCopy, bookName) to bookListCopy.indexOf(bookName) and move the return statement out of the if block.
Aditya
@ezioda004
Sep 08 2018 11:49
@Adishjain58 You arent changing the state object when the action.type is LOGIN
You can either make a new object via object literal or use Object.assign() to make a new object, not sure if spread would work on FCC but can try that too
Anand Potukuchi
@anandpotukchi
Sep 08 2018 11:59
This message was deleted
@ezioda004
// the global variable
var bookList = ["The Hound of the Baskervilles", "On The Electrodynamics of Moving Bodies", "Philosophiæ Naturalis Principia Mathematica", "Disquisitiones Arithmeticae"];

/* This function should add a book to the list and return the list */
// New parameters should come before the bookName one

// Add your code below this line
function add (bookName) {
  let bookListCopy = bookList.slice(0);
   bookListCopy.push(bookName);

   return bookListCopy;


}

/* This function should remove a book from the list and return the list */
// New parameters should come before the bookName one

// Add your code below this line
function remove (bookList,bookName) {
  let bookListCopy = bookList.slice(0);

  if (bookListCopy.indexOf(bookName) >= 0) {

    bookListCopy.splice(bookListCopy.indexOf(bookName), 1);


    // Add your code above this line
    }
     return bookListCopy;
}

var newBookList = add(bookList, 'A Brief History of Time');
var newerBookList = remove(bookList, 'On The Electrodynamics of Moving Bodies');
var newestBookList = remove(add(bookList, 'A Brief History of Time'), 'On The Electrodynamics of Moving Bodies');

console.log(bookList);
Aditya
@ezioda004
Sep 08 2018 12:05
@anandpotukchi add function accepts 2 arguments, 1st parameter is bookList
Anand Potukuchi
@anandpotukchi
Sep 08 2018 12:06
oh got it
thanks
Yago Estévez
@yagoestevez
Sep 08 2018 12:08
Has anyone passed the test for the Pomodor clock?
Any advice on this? I'm having a bunch of issues because the tests won't be able to click my buttons even though the ids are correct and the app works as expected
I even tried having a look at the cryptic bundle code but no luck so far...
Oh, and even the simple demo project doesn't pass all the tests.
Anand Potukuchi
@anandpotukchi
Sep 08 2018 12:20
Just put it up
forget the tests
Move on
@yagoestevez
Yago Estévez
@yagoestevez
Sep 08 2018 12:29
Yeah I thought about that, but I hate moving on when I've got the tests red
hheheh
Here. I made the simplest version of it. Removed all the layout so you can see the output in the testing
I don't understand whats wrong here...
Bjorn van de Peut
@bjorno43
Sep 08 2018 13:24
Alright. @bobsbotty is finally back up and running
@bobsbotty
const arr = [[0,1,2],[3,4,5]];
arr;
bobsbotty
@bobsbotty
Sep 08 2018 13:26
@bjorno43 The result of your Javascript code is:
Array
(
    [0] => Array
        (
            [0] => 0
            [1] => 1
            [2] => 2
        )

    [1] => Array
        (
            [0] => 3
            [1] => 4
            [2] => 5
        )

)
Rob
@PGFracing
Sep 08 2018 14:44
any idea why my margin is messed up on the right when you double tap the page on an iPad, doesn’t do this on other websites so it must be my code www.pgfracing.com
Yago Estévez
@yagoestevez
Sep 08 2018 15:06
I don't really know. You have this meta tag, right? <meta name="viewport" content="width=device-width, initial-scale=1"/>
May Kittens Devour Your Soul
@diomed
Sep 08 2018 15:13
something's overflowing it seems
can't vouch you'll fix that before 2nd coming, tho
ANKIT KUMAR
@Ak476024
Sep 08 2018 15:28
Hey anyone know how to built drop-down overlay
May Kittens Devour Your Soul
@diomed
Sep 08 2018 15:35
@Ak476024 drop down what?
Yago Estévez
@yagoestevez
Sep 08 2018 15:52
Hey, anyone know where to find the test bundle raw code? I mean not the compressed code from the bundle.js file
May Kittens Devour Your Soul
@diomed
Sep 08 2018 15:55
@yagoestevez u can always uglify it
Yago Estévez
@yagoestevez
Sep 08 2018 16:02
With vscode i formatted the code, but seems to be uglyfied by bundler
I mean
                  function() {
                    (0, n.clickButtonsById)([e, e, e, e]),
                      a.assert.strictEqual(document.getElementById("break-length").innerHTML, "1"),
                      u(),
                      (0, n.clickButtonsById)([e]),
                      a.assert.strictEqual(document.getElementById("break-length").innerHTML, "4");
                  }
this doesn't look made by humans
lol
And thats pretty easy to follow
Niraj Nandish
@Nirajn2311
Sep 08 2018 16:03
WTF is that 😵😵😵
Its messed up in there
Yago Estévez
@yagoestevez
Sep 08 2018 16:04
I think I found it
Now that looks much cleaner
May Kittens Devour Your Soul
@diomed
Sep 08 2018 16:05
@Nirajn2311 help me with css
:yum:
Niraj Nandish
@Nirajn2311
Sep 08 2018 16:06
@diomed maybe next year when i have experience in it
May Kittens Devour Your Soul
@diomed
Sep 08 2018 16:06
what is xperience
is that a model of phone?
@yagoestevez do you suspect in irregularities and foul play from the side of tests?
Niraj Nandish
@Nirajn2311
Sep 08 2018 16:10
You need a job to get experience but the job requires experience = PARADOX😵😵
May Kittens Devour Your Soul
@diomed
Sep 08 2018 16:11
solution is : become a :cat:
Niraj Nandish
@Nirajn2311
Sep 08 2018 16:11
@thekholm80 Bullseye
@diomed I'd rather be a 🦊
May Kittens Devour Your Soul
@diomed
Sep 08 2018 16:12
you can be any power animal you want. it's your choice in the end
my friend is pangolin
Kyle Holm
@thekholm80
Sep 08 2018 16:12
obviously the only correct answer is red panda
May Kittens Devour Your Soul
@diomed
Sep 08 2018 16:15
S o l s b u r y H i l l
Yago Estévez
@yagoestevez
Sep 08 2018 16:21
@diomed I did the project and the test is failing, but I think I did everything as required so I'm checking what's it expecting me to do exacly
May Kittens Devour Your Soul
@diomed
Sep 08 2018 16:22
well, it says why it's failing
and if you can't figure out why, just ask while @thekholm80 is here
Yago Estévez
@yagoestevez
Sep 08 2018 16:31
Timeout of 5000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Pretty self-explanatory, isn't it? lol
Nah, just fixed that part, but obviously the test output is not very helpful :D
Kyle Holm
@thekholm80
Sep 08 2018 16:32
i, too, always assume my code is perfect and the tests are all broken
May Kittens Devour Your Soul
@diomed
Sep 08 2018 16:33
Kyle Holm
@thekholm80
Sep 08 2018 16:34
:joy:
Yago Estévez
@yagoestevez
Sep 08 2018 16:46
Well, I don't
May Kittens Devour Your Soul
@diomed
Sep 08 2018 16:54
263qsl.jpg
Ene Catalin
@EneCatalin
Sep 08 2018 17:08
that's why we do java
May Kittens Devour Your Soul
@diomed
Sep 08 2018 17:15
corgi6.png
Kranti Nebhwani
@darkphotonKN
Sep 08 2018 17:47
Hey guys, does anyone have an idea where if i animate an object off a page for it to not "stick outside" of the borders or the page / any parent object. Once it's past the borders it doesnt show up
Niraj Nandish
@Nirajn2311
Sep 08 2018 17:50
@diomed that’s why I learn c++
😂😂
Ene Catalin
@EneCatalin
Sep 08 2018 18:03
well cat knows regex, beat that
kamransagheir
@kamransagheir
Sep 08 2018 18:24
any one here know Java?
idk how to define string as variable in it
AbrisM
@AbrisM
Sep 08 2018 18:24
Hi all
Who mentioned Java?
kamransagheir
@kamransagheir
Sep 08 2018 18:24
can any one helo
MEEEEEEEEEE :P
AbrisM
@AbrisM
Sep 08 2018 18:24
Your question for variable?
kamransagheir
@kamransagheir
Sep 08 2018 18:24
@AbrisM @AbrisM
AbrisM
@AbrisM
Sep 08 2018 18:24
I do Java to
Okay, so what happens why it's not working
Is because STRING is an object
if it's a primitive it's not going to be recongnized
kamransagheir
@kamransagheir
Sep 08 2018 18:24
ya I need to define string as a variable
AbrisM
@AbrisM
Sep 08 2018 18:25
so cast it using the toString() method
kamransagheir
@kamransagheir
Sep 08 2018 18:25
and str abc is not working
AbrisM
@AbrisM
Sep 08 2018 18:25
Ah
kamransagheir
@kamransagheir
Sep 08 2018 18:25
str abc;
AbrisM
@AbrisM
Sep 08 2018 18:25
Ya, you have to cast
kamransagheir
@kamransagheir
Sep 08 2018 18:25
how

import java.util.Scanner;

public class BasicInput {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int userInt;
double userDouble;
str userString;
char userChar;

  // FIXME Define char and string variables similarly
AbrisM
@AbrisM
Sep 08 2018 18:25
to convert the primitive to the STRING
Backwards
Try
String userString
String will always be as String, never shorten
kamransagheir
@kamransagheir
Sep 08 2018 18:26

import java.util.Scanner;

public class BasicInput {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int userInt;
double userDouble;
string userString;
char userChar;

  // FIXME Define char and string variables similarly

  System.out.println("Enter integer:");
  userInt = scnr.nextInt();
  System.out.println("Enter double:");
  userInt = scnr.nextDouble();
  System.out.println("Enter character:");
  userInt = scnr.nextChar();
AbrisM
@AbrisM
Sep 08 2018 18:26
primitives will also change from int to Integer when casted to an Object type
kamransagheir
@kamransagheir
Sep 08 2018 18:26
still not workign
AbrisM
@AbrisM
Sep 08 2018 18:27
there's step missing ah, it just disappeared
kamransagheir
@kamransagheir
Sep 08 2018 18:27
which one>
?
AbrisM
@AbrisM
Sep 08 2018 18:27
make sure String is capitalized at the first letter
Now
After you do that, since their reference variables you need to set their state
kamransagheir
@kamransagheir
Sep 08 2018 18:28

import java.util.Scanner;

public class BasicInput {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int userInt;
double userDouble;
String userString;
char userChar;

AbrisM
@AbrisM
Sep 08 2018 18:28
In other words you have to set them equal to something like userChar= 'e';
kamransagheir
@kamransagheir
Sep 08 2018 18:28
still not wokring
AbrisM
@AbrisM
Sep 08 2018 18:28
Otherwise it's just reference variables holding space not but initalized
kamransagheir
@kamransagheir
Sep 08 2018 18:28
String userStr = ""
AbrisM
@AbrisM
Sep 08 2018 18:28
Yes
kamransagheir
@kamransagheir
Sep 08 2018 18:28
will this work?
AbrisM
@AbrisM
Sep 08 2018 18:28
Yes, that will work but it will print with a space inside
Also
kamransagheir
@kamransagheir
Sep 08 2018 18:29
String userString = "";
still not working
AbrisM
@AbrisM
Sep 08 2018 18:29
Make sure to always end the class scope with "}"
Put a letter inside of it, or a sentence
System.out.println("test this here");
and run userString in the parameters, instead of the text without quotes
kamransagheir
@kamransagheir
Sep 08 2018 18:30
Make sure to always end the class scope with "}" ??
AbrisM
@AbrisM
Sep 08 2018 18:30
Yes
If you don't it'll be a syntax error
kamransagheir
@kamransagheir
Sep 08 2018 18:31
I didn't get that line explain it
AbrisM
@AbrisM
Sep 08 2018 18:31
Because it's telling the program to run but not to enclose it
So it doesn't know where the code stops
kamransagheir
@kamransagheir
Sep 08 2018 18:31
String userString = ""} like this?
AbrisM
@AbrisM
Sep 08 2018 18:31
No
kamransagheir
@kamransagheir
Sep 08 2018 18:31
String userString = "userString";
AbrisM
@AbrisM
Sep 08 2018 18:31
} is only used to close and open methods
kamransagheir
@kamransagheir
Sep 08 2018 18:31
like this?
String userString = {}; like this>
?
AbrisM
@AbrisM
Sep 08 2018 18:32
It'll print userString but not the variable userString
No lol
Okay
kamransagheir
@kamransagheir
Sep 08 2018 18:32
kill me lol
AbrisM
@AbrisM
Sep 08 2018 18:32
See this
String userString= ("I am a sample sentence");
System.out.println(userString); //this prints out the variable userString that has been set to the text above
So, if you run the println method
kamransagheir
@kamransagheir
Sep 08 2018 18:33
it don't recognize the "string still
AbrisM
@AbrisM
Sep 08 2018 18:33
It will print out the sentence with userString variable reference
Do you take classes?
"" is for quotation, for sentences
kamransagheir
@kamransagheir
Sep 08 2018 18:33
I'm taking one right now and it is one of the assgnments
AbrisM
@AbrisM
Sep 08 2018 18:33
' ' is for char types like single letters
kamransagheir
@kamransagheir
Sep 08 2018 18:33

import java.util.Scanner;

public class BasicInput {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int userInt;
double userDouble;
String userString = ("sdkjdhs");
char userChar;

  // FIXME Define char and string variables similarly
AbrisM
@AbrisM
Sep 08 2018 18:34
What your code has now
It has references in it
BUT
it does not have states
Which is why it is not working
You have to set the reference variables to a state, aka a data
assign using =
with the variable name
then enclose with "}" at the end for the class scope, which is called BasicInput
and enclose for the main method line
so
userChar= 'e';
userInt= 8;
Like so
kamransagheir
@kamransagheir
Sep 08 2018 18:36
I just need to define it for now thou and it will take userinput
AbrisM
@AbrisM
Sep 08 2018 18:36
Yes
kamransagheir
@kamransagheir
Sep 08 2018 18:36
by usingscnr
AbrisM
@AbrisM
Sep 08 2018 18:36
Yes :)
now set scnr for something, then print out the result using
System.out.println(scnr);
kamransagheir
@kamransagheir
Sep 08 2018 18:37
all rest of the stuff is working fine but only string is not. I got rest of the pieces together

import java.util.Scanner;

public class BasicInput {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int userInt;
double userDouble;
String userString = ("sdkjdhs");
char userChar;

  // FIXME Define char and string variables similarly

  System.out.println("Enter integer:");
  userInt = scnr.nextInt();
  System.out.println("Enter double:");
  userInt = scnr.nextDouble();
  System.out.println("Enter character:");
  userInt = scnr.nextChar();
AbrisM
@AbrisM
Sep 08 2018 18:39
needs other next method for scnr
Afk for a second
kamransagheir
@kamransagheir
Sep 08 2018 18:39
i still don't get it
AbrisM
@AbrisM
Sep 08 2018 18:41
There is a lossy conversion issue with double variable
What is happening
Is that
The double is being converted to an integer, but in doing so it looses info
So it will need to be casted
to Integer
use caste method
Okay
It is working
just need two more statements
So this here:
I have found
Ah

import java.util.Scanner;

public class BasicInput
{
public static void main(String[] args)
{
Scanner scnr = new Scanner(System.in);

int userInt;
double userDouble;
String userString = ("sdkjdhs");
char userChar;

System.out.println("Enter integer:");
userInt = scnr.nextInt();
System.out.println("Enter double:");
userDouble = scnr.nextDouble();
System.out.println("Enter character:");
}
}

Here
AbrisM
@AbrisM
Sep 08 2018 18:46
then use scanner method for char :)
kamransagheir
@kamransagheir
Sep 08 2018 18:49
its the same what I posted thou
AbrisM
@AbrisM
Sep 08 2018 18:49
No, there has been changed
kamransagheir
@kamransagheir
Sep 08 2018 18:49
like what
AbrisM
@AbrisM
Sep 08 2018 18:49
the integer variable was being scanned with double and replaced
Now
for char
You will need to use the findline method
for char input
Tested

import java.util.Scanner;

public class BasicInput
{
public static void main(String[] args)
{
Scanner scnr = new Scanner(System.in);

int userInt;
double userDouble;
String userString = ("sdkjdhs");
char userChar;

System.out.println("Enter integer:");
userInt = scnr.nextInt();
System.out.println("Enter double:");
userDouble = scnr.nextDouble();
System.out.println("Enter character:");
userChar=scnr.next().charAt(0);
}
}

I have removed the "." as it not valid
It should work now :)
By setting charAt at 0, it is telling the scanner method to look specifically for the first letter in sentence
Which is similar to how an Array index works
AbrisM
@AbrisM
Sep 08 2018 18:56
Have they taught Array yet?
Otter
@lambomiura
Sep 08 2018 19:08
@ezioda004 @thekholm80 Thanks for advice. How about AWS API GATAWAY? Could I use it just for returning simple JSON file?
kamransagheir
@kamransagheir
Sep 08 2018 19:10
BasicInput.java:18: error: cannot find symbol
userChar = scnr.next.charAt(0);
^
symbol: variable next
location: variable scnr of type Scanner
1 error
@AbrisM nope! they haven't
AbrisM
@AbrisM
Sep 08 2018 19:15
missing ()
Code above tested and should work :)
next() is method
They will teach, logic and conditionals statements and method lines
Including, inistiation, reference, initalize, constructor, Object type, states, public, private, protected, interfaces, polymorphism, inheritance, sorting, recursion
But most of the above is latter material
For now, it will probably be conditional statements, switch cases, ifs, whiles, and for-loops along with syntax and data types
What book is used?
kamransagheir
@kamransagheir
Sep 08 2018 19:18
zybook
AbrisM
@AbrisM
Sep 08 2018 19:18
is it e-book?
kamransagheir
@kamransagheir
Sep 08 2018 19:19
they don't disclose book name
AbrisM
@AbrisM
Sep 08 2018 19:19
Programming in Java zybook
Are you using seperate IDE, or built-in IDE?
kamransagheir
@kamransagheir
Sep 08 2018 19:21
built in
AbrisM
@AbrisM
Sep 08 2018 19:24
Ah
Sometimes built in IDES have certain settings
See here:
This is same code above but with class name change so it runs
But the script is vanilla. If you use other IDE it should run
kamransagheir
@kamransagheir
Sep 08 2018 19:28
but I need to subit it thou
I chaged the code form yours and see it now

import java.util.Scanner;

public class BasicInput {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int userInt;
double userDouble;
char userChar;
String userString;
// FIXME Define char and string variables similarly

  System.out.println("Enter integer:");
  userInt = scnr.nextInt();
  System.out.println("Enter double:");
  userDouble = scnr.nextDouble();
  System.out.println("Enter character:");
  userChar = scnr.nextChar();
  System.out.println("Enter string:");
  userString = scnr.nextString();
now receiving these 2 errors
BasicInput.java:17: error: cannot find symbol
userChar = scnr.nextChar();
^
symbol: method nextChar()
location: variable scnr of type Scanner
BasicInput.java:19: error: cannot find symbol
userString = scnr.nextString();
^
symbol: method nextString()
location: variable scnr of type Scanner
2 errors
AbrisM
@AbrisM
Sep 08 2018 19:29
It might be issue that the built-in IDE wants to use a specific class-type name
Did they specify this?
Because usually you can name class any name wished
kamransagheir
@kamransagheir
Sep 08 2018 19:30
nopw it was predefined
AbrisM
@AbrisM
Sep 08 2018 19:31
I see
That is reason
Try using the pre-defined name of the class
Then run code
kamransagheir
@kamransagheir
Sep 08 2018 19:34

import java.util.Scanner;

public class BasicInput {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
int userInt;
double userDouble;
char userChar;
String userString;
// FIXME Define char and string variables similarly

  System.out.println("Enter integer:");
  userInt = scnr.nextInt();
  System.out.println("Enter double:");
  userDouble = scnr.nextDouble();
  System.out.println("Enter character:");
  userChar = scnr.next().charAt(0);
  System.out.println("Enter string:");
  userString = scnr.next();

  // FIXME (1): Finish reading other items into variables, then output the four values on a single line separated by a space

  // FIXME (2): Output the four values in reverse

  // FIXME (3): Cast the double to an integer, and output that integer

}
}

AbrisM
@AbrisM
Sep 08 2018 19:37
It wants something different now
Output four values on a single line seperate by space
then output the values in reverse order
cast the double to integer and output result
For this can create a new method
and put the new statements from above into the method
to complete
kamransagheir
@kamransagheir
Sep 08 2018 19:39
but the previous code still has error thou
AbrisM
@AbrisM
Sep 08 2018 19:39
Have you tried link above?
If you run it, it will run
kamransagheir
@kamransagheir
Sep 08 2018 19:41
I think I got it. That's so messed up thou are giving us stuff that they haven't taught us and expect us to solve problems. mo fos
AbrisM
@AbrisM
Sep 08 2018 19:41
Yes, sometimes that happens
Which is understandable
But hint for the next part
What you will need to do
kamransagheir
@kamransagheir
Sep 08 2018 19:41
Yeah! when I submitted it; it showed the results. so it works now. thanks :)
yep
AbrisM
@AbrisM
Sep 08 2018 19:41
Is take the previous variables you have assigned
and re-assign them to new states
Great! :)
The first part, easy
Output four values on a single space, seperate by space
Create four int variables and assign them to a value
Then have System.out.println print the results, with a spacing inbetween
Kranti Nebhwani
@darkphotonKN
Sep 08 2018 19:43
Hey guys, does anyone have an idea where if i animate an object off a page for it to not "stick outside" of the borders or the page / any parent object. Once it's past the borders it doesnt show up
AbrisM
@AbrisM
Sep 08 2018 19:44
" i'm a space inside"
Javascript Canvas problem?
Try defining it within the boundaries of the border
kamransagheir
@kamransagheir
Sep 08 2018 19:45
got it :) thanks. will msg here in case I get stuck simewhere. oping to complete it in 20 mins
AbrisM
@AbrisM
Sep 08 2018 19:45
@kamransagheir then re-assign those values in opposite order. Then, to cast the integer you will need the to method. Once casted, use System.out.println(); to see result
See you :)
May Kittens Devour Your Soul
@diomed
Sep 08 2018 20:34
I'm a :space_invader:
glitz20
@glitz20
Sep 08 2018 22:23
anybody who have used css in react?
Yago Estévez
@yagoestevez
Sep 08 2018 22:37
What do you mean? Styled components?
Or plain css
Or inline styles
glitz20
@glitz20
Sep 08 2018 23:11
@yagoestevez how do you align the component to the right?
 <div className="col-xs-6 right" >
I am doing this right now
but its not goint to right
Aditya
@ezioda004
Sep 08 2018 23:17
Whats "right"? Dont think theres a "right" class in BS, assuming you're using BS from col-xs-6
glitz20
@glitz20
Sep 08 2018 23:32
is there any way to align right in BS in react?
Kyle Holm
@thekholm80
Sep 08 2018 23:34
the same way you would do it without react
Aditya
@ezioda004
Sep 08 2018 23:39
CSS works the same way with/without React. If you want the whole row to be aligned right then you can add justify-content-end on the .row, if you want just the col to be aligned right then you use offset classes like .offset-xs-3 etc