Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jun 19 2020 20:09
    @krisb1220 banned @Gastony
  • May 14 2020 22:39
    @bjorno43 banned @minitechtips_twitter
  • May 14 2020 22:38
    @bjorno43 banned @real-action
  • Feb 01 2020 00:27
    @bjorno43 banned @Ndoua
  • Jan 07 2020 03:10
    @bjorno43 banned @doctor-sam
  • Aug 17 2019 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 2019 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 2019 17:13
    @mstellaluna banned @cmal
  • Jan 08 2019 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
unityredd
@unityredd
Thank you. Trying that now.
vengal
@vengal4327
Hi Guys, I'm getting '$export is not a function' when trying to import modules from another package that I wrote. like when I do
"Import modul_name from package-name". Any idea? I was able to import other packages without any issue.
The project is compiling fine.. but getting this error only when I'm trying to run in browser..
Ken Haduch
@khaduch
@vengal4327 - are there times when you have to use import { module_name } from 'package-name';? I'm just getting to that part in a React course that I'm going through. Still not quite sure when you need the curly brackets, I think it's when there are multiple exported functions?
Tom
@moT01
the curlys are for individual functions
i think they're all defined and ready to use when you put them in curlys
texirv0203
@texirv0203

hi,

using hashtable how to find which number is ocurring how many times for example in 33767999we need to 3 has occurred 2 times, 7 two times and 9 three times

Ken Haduch
@khaduch
@texirv0203 - did you get the idea of my first part / suggestion that I posted in the other room?

@texirv0203 - it was to convert a value that is a number to a string, then split it. That gives you access to an array of the individual digits.

var num = 33767999;
num.toString().split('').forEach(  
    // you write a function here 
);

the function within the .forEach() method would be able to access the individual elements of the array, and build the hash in an object.

Ken Haduch
@khaduch
you could also take that same array, after the .split() and use a for loop to access the elements. I'm not sure what your level of exposure is to various code functions in JavaScript.
texirv0203
@texirv0203
@khaduch hey how to build hash...I have never used hash before :(
Ken Haduch
@khaduch

@texirv0203 - in this context, I would say that you need to make this "hash" as an object. Each key/value pair in the object will be a key consisting of one of the digit values in the string, and the value would be the number of times that it occurs in the number. So you would want to end up with an object, for your example digit string, that looks like this:

{3: 2, 6: 1, 7: 2, 9: 3}
3: 2
6: 1
7: 2
9: 3

Are you familiar with creating objects in javascript?

Daniel
@DanJP2016
anybody using vim?
Ken Haduch
@khaduch
@DanJP2016 - I haven't used it in a long time!
Daniel
@DanJP2016
cool, I was wondering how to set it up for python and javascript or if it was even worth using it over sublime or vscode
Ken Haduch
@khaduch
@DanJP2016 - try this article: https://realpython.com/blog/python/vim-and-python-a-match-made-in-heaven/ - seems like that author thinks it's a great thing!
Evan Kalvis
@evan17gr
anyone familiar with python?
Devin Miller
@edwin0258
@evan17gr Yes
texirv0203
@texirv0203
@khaduch no...how to achieve it :(
Evan Kalvis
@evan17gr
it doesnt print anything
Devin Miller
@edwin0258
ok, one sec.
Evan Kalvis
@evan17gr
alright thanks!
Devin Miller
@edwin0258
@evan17gr Ok, I've got it printing something, not sure if it was you need. (You had an infinite loop before by the way)
n = int(input("Enter a positive integer to retrieve all the values of the Fibonacci series that correspond to this input : "))
def fib(n) :
  v1 = 0
  v2 = 1
  while n > 0 :
    for i in range(n):
      v1,v2 = v2,v1+v2
      print(v1, v2)
    n-=1
fib(n)
Evan Kalvis
@evan17gr
alright cheers i ll try to make it work
Devin Miller
@edwin0258
:thumbsup:
Tyler Del Rosario
@TylerDelRosario
Hey, I'm trying to run sudo install learnyounode -g in the cloud9 terminal in my blank workspace and it doesnt work :/
Devin Miller
@edwin0258
It should be npm install learnyounode -g I think @TylerDelRosario
Tyler Del Rosario
@TylerDelRosario
@edwin0258 same error occurs module.js:471 throw err;
Devin Miller
@edwin0258
hmm, let me try it myself. One min. @TylerDelRosario
@TylerDelRosario Did you change the workspace before you tried installing in any way?
Tyler Del Rosario
@TylerDelRosario
nope its a blank
Devin Miller
@edwin0258
Can you screenshot your cloud 9 interface? @TylerDelRosario
nvm I can open your workspace on my side.
Ken Haduch
@khaduch

@texirv0203 - these are some basics about how to make an object that you need to use for this hash / number counter.

var myObj = {}; // initialize an empty object
var anyNum = 8;
myObj[anyNum] = 1; // after this, the object should have an entry with a key of "8", value of "1"
myObj[anyNum]++;  // after this, the object should have an entry with a key of "8", value of "2"
anyNum = 5;
myObj[anyNum] = 1; // after this, the object should still have the entry for "8" and a new entry with a key of "5", value of "1"
myObj[anyNum]++;  // after this, the object should have an entry with a key of "5", value of "2"

if you take that code and experiment with it, for example in a browser devtools console, you can see what's happening. Or you can go to http://pythontutor.com/javascript.html and plug it in, and run it.

@texirv0203 - that's showing the basics of what you will eventually want to have coded to solve your problem - getting the individual values into a variable where you can use them to accumulate your data in the object.
Rodney Chism
@rodchsm

I have some questions but one question at a time.

In my CSS, the .navbar-brand img connects to my logo in the top left corner of my bootstrap navbar. Its off center in that corner. Does anyone know how to position the logo correctly? Let me know. Thanks

https://codepen.io/rodchsm/pen/xPdzeb/

Thats the navbar-brand img selector in my CSS
Devin Miller
@edwin0258

@rodchsm

.navbar-brand img {
    height: 50px;
    margin-top: -15px;
}

Try this. Because there is a lot of padding in actual image I had to use a negative margin.

Ken Haduch
@khaduch
@rodchsm - I got it to center just by cleaning up the code in your CodePen - removing the <html>, <head> code into the proper places in the CodePen interface. Then it works...
@rodchsm - here is a link to the CodePen that I edited from yours and forked.
Rodney Chism
@rodchsm
@khaduch thanks.
CamperBot
@camperbot
rodchsm sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 3496 | @khaduch |http://www.freecodecamp.com/khaduch
Rodney Chism
@rodchsm
@khaduch i will check it out after this
@edwin0258 how did you figure out there was a lot of padding in the image
Ken Haduch
@khaduch
@rodchsm - I"m not sure what in particular might have been causing the issue. It was just my first impression to move the external libs into the proper places for CodePen's template-based system.
Devin Miller
@edwin0258
I opened the image by iteself. It's ok though, I think @khaduch 's solution is better. @rodchsm
Rodney Chism
@rodchsm
@edwin0258 @edwin0258 I have one more question. Why isnt my .backgroundheader image fitting all the space. In other words, why is the full image of the picture not show up to cover the h1 and the button. Is there a solution?
Ken Haduch
@khaduch
@rodchsm - what might have been going on is that when you include the links for the CSS and JS code in the HTML panel is that CodePen will generate the HTML page and things will get loaded in the wrong order. For example, your custom CSS will get loaded in the <head> section, but then the HTML section will be inserted into the output HTML code and probably conflict with your custom settings. By putting the external CSS in the CSS config panel, things get loaded in the proper order. You might be able to see what is going on if you load your page as it is now, and do a "View Frame Source" for the output panel.
Devin Miller
@edwin0258
@rodchsm Only way I can think of is to remove background-attachment and add background-position with a value of center. But in order to cover the area you've specified it has to cut off some of the image.