These are chat archives for FreeCodeCamp/HelpJavaScript

26th
Jun 2018
Yash Pratap Singh
@convexhull
Jun 26 2018 00:44
Why does this code print 3 and not 2 ?
var printNumTwo;
for (var i = 0; i < 3; i++) {
    if(i === 2){
        printNumTwo = function() {
            return i;
        };
    }
}
console.log(printNumTwo());
I looked online and found out that a function expression is called immediately after it is declared. If that's what happening here, then printNumTwo should store 2 as it's executed when i is equal to 2.
Brad
@bradtaniguchi
Jun 26 2018 01:00
@convexhull the i inside the function assigned doesn't refer to the "instant" the function i was assigned, but the current value, since you run the the loop, i ends up as 3. So when you call the function "later" i is 3. Even if you assigned the function at 2
anthonygallina1
@anthonygallina1
Jun 26 2018 01:01
yup
eggsackly
anthonygallina1
@anthonygallina1
Jun 26 2018 01:11
MAGsml.jpg
Joseph
@revisualize
Jun 26 2018 02:29
Yo.
Blauelf
@Blauelf
Jun 26 2018 05:57
Good morning.
Carlos Alfaro
@devbysalas
Jun 26 2018 06:15

Hello guys, I got stuck on this challenge. Any idea why isn't passing?

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches

let ohStr = "Ohhh no";
let ohRegex = /h{3,6}/; // Change this line
let result = ohRegex.test(ohStr);
Blauelf
@Blauelf
Jun 26 2018 06:41
@devbysalas make it more specific. The version with 7 h also contains 3 to 6. Even a single character on either side might be sufficient.
Simon Cordova
@gbsimon87
Jun 26 2018 09:37
Morning
Markus Kiili
@Masd925
Jun 26 2018 09:37
Morning.
Shubham soni
@shubhamsoni2617
Jun 26 2018 11:49
export default is used to create a fallback value for a file or module.
Can anyone please explain?
Casper Beyer
@caspervonb
Jun 26 2018 11:50
Singleton modules basically, e.g if console was a module it would be a default export
Shubham soni
@shubhamsoni2617
Jun 26 2018 11:51
@caspervonb Could you please explain by giving some example?
Blauelf
@Blauelf
Jun 26 2018 12:15
I also wonder what this sentence means.
Casper Beyer
@caspervonb
Jun 26 2018 12:19
Semantically, there is no difference between named and default imports/exports. I'd be better if default imports/exports weren't a thing but they are. Only real use for them IMHO is to export singleton objects like for example the console object.
Blauelf
@Blauelf
Jun 26 2018 12:23
But what does the "fallback" mean in this case?
Casper Beyer
@caspervonb
Jun 26 2018 12:23
Bad advice.
Daniel Simeonov
@dbsimeonov
Jun 26 2018 13:03

can anyone help me with webkit barbel ?

export default class Exercise {
    costructor(query){
        this.query = query;
    }

    async getExercises(){
        try{
            const res = await axios('https://raw.githubusercontent.com/dbsimeonov/fitme-today/master/src/data/exercises.json');
            this.result = res.data;
            console.log(res);
        }catch(err){
            console.log(err);
        }
    }
}

is there something that I'm doing wrong?

Moisés Man
@moigithub
Jun 26 2018 13:08
code looks ok... (u not using ur query variable anywhere .. but it should work ) ...i think
Daniel Simeonov
@dbsimeonov
Jun 26 2018 13:08
something like
import Exercise from './Exercises';

const exercise = new Exercise('upperbody');

console.log(exercise)
Moisés Man
@moigithub
Jun 26 2018 13:09
u not calling ur getExercises() method (which populates ur this.result variable ... so u can output/log result )
soo should be more like...
const e = new Exercise('aaa')
e.getExercises()
console.log(e.result)
Daniel Simeonov
@dbsimeonov
Jun 26 2018 13:13
lol, im so bad. Ok lets say I want to create a function which it will be reusable to extract specific data from the json. Is that the way? I'm failing a lot
Moisés Man
@moigithub
Jun 26 2018 13:18
if u want just a function.. this part should work (no need the whole class, unless u have something else)
    async getExercises(someValue){
        try{
            // probably incorporate someValue inside ur axios query below
            const res = await axios('https://raw.githubusercontent.com/dbsimeonov/fitme-today/master/src/data/exercises.json');
            console.log(res);
            return res.data;
        }catch(err){
            console.log(err);
        }
    }
Nate Mallison
@NJM8
Jun 26 2018 14:41

Here is a fun one, why in my route here is req.body undefined, but req logs as shows the body is there

router
  .route('/findBars')
  .post((res, req, next) => {
    console.log('findbars')
    console.log(req)
    console.log(req.body)
  })

here is the req: https://pastebin.com/u2c4rup6

OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 14:46
Guys how I can make formats for numbers?
Like xxx-xxx-xxxx for phone numbers.
Is it possible?
Guys how I can make formats for numbers?
Like xxx-xxx-xxxx for phone numbers.
Is it possible?
This is freecodecamp btw so please no spoilers.
Help please?
Christopher McCormack
@cmccormack
Jun 26 2018 14:58
@NJM8 got your res and req swapped
Nate Mallison
@NJM8
Jun 26 2018 15:00
ahhhh what a NOOOOOB
thanks
Christopher McCormack
@cmccormack
Jun 26 2018 15:00
haha np
@NJM8 you got a few minutes to test something out for me?
@OGTechnoBoy Can you describe what you are asking? I'm not what you're trying to do.
Nate Mallison
@NJM8
Jun 26 2018 15:03
yup
Christopher McCormack
@cmccormack
Jun 26 2018 15:03
@NJM8 https://github.com/cmccormack/react-boilerplate wanted to have someone else test it out and see if it works
If you're on Windows you may have an issue with node-sass - I'm trying to fix that internally but until then there is a fix at the bottom of the README
Nate Mallison
@NJM8
Jun 26 2018 15:04
Windows! Phhht, what do I look like
Christopher McCormack
@cmccormack
Jun 26 2018 15:05
haha well I develop on both so I get to find all the bugs
both mac and windows, anyway
Nate Mallison
@NJM8
Jun 26 2018 15:05
probably good to do. I have a spare cpu with win7 on it.
Screen Shot 2018-06-26 at 11.06.26 AM.png
Christopher McCormack
@cmccormack
Jun 26 2018 15:07
Wow that was fast
Nate Mallison
@NJM8
Jun 26 2018 15:07
anything else?
Christopher McCormack
@cmccormack
Jun 26 2018 15:07
thanks!
nope that was it
Nate Mallison
@NJM8
Jun 26 2018 15:07
sure thing
Christopher McCormack
@cmccormack
Jun 26 2018 15:07
If you ever get into react you can use it if you like :)
Nate Mallison
@NJM8
Jun 26 2018 15:08
I'll keep it in mind!
Christopher McCormack
@cmccormack
Jun 26 2018 15:08
has more visibility into what's happening than CRA
Jason Luboff
@JLuboff
Jun 26 2018 15:08
Morning
Christopher McCormack
@cmccormack
Jun 26 2018 15:09
@JLuboff yo!
Jason Luboff
@JLuboff
Jun 26 2018 15:09
What up
Christopher McCormack
@cmccormack
Jun 26 2018 15:10
Been working on https://github.com/cmccormack/react-boilerplate this weekend and asking people to test it out :)
quick way to get started with React and a decent webpack configuration
Jason Luboff
@JLuboff
Jun 26 2018 15:11
Neat, I starred it :smile:
Christopher McCormack
@cmccormack
Jun 26 2018 15:11
Awesome thanks!
Those may be my first haha
what have you been up to?
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:12
Is it possible for me to do it like that? I want to log when the hash is changing, but something doesn't seem to work?
function locationChange(){
    if(location.hash === `#${elementStrings.hashBuild}` ){
        console.log(elementStrings.hashBuild)
    } else if( location.hash === `#${elementStrings.hashView}` ){
        console.log(elementStrings.hashView)
    }
}

window.addEventListener('onhashchange', locationChange())
Jason Luboff
@JLuboff
Jun 26 2018 15:13
Working on building up a 2016 Server. This morning I realized that what I thought I had made dynamic...isn't...so need to fix that (I made a seperate table for approvers, but failed to change my code to reflect that). So need to fix that. Trying to figure out how.. may just have to use an Insert instead of a Transaction for my query (and use a loop).
Christopher McCormack
@cmccormack
Jun 26 2018 15:14
@dbsimeonov log your location.hash and your elementStrings in each conditional, see why it isn't working
Nate Mallison
@NJM8
Jun 26 2018 15:14
window.addEventListener('onhashchange', locationChange)
no parens on function to call
just pass function name
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:15
hmm tried like that, still not working, let me console log to see if something is not matching
but even if add else statement console.log(location.hash doesnt seem to work when I change the hash
Nate Mallison
@NJM8
Jun 26 2018 15:15
open your dev tools inspect the element or page, it will show event listeners and what they do
Christopher McCormack
@cmccormack
Jun 26 2018 15:16
what do you mean it doesn't work @dbsimeonov ?
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:16
the event listener doesn't trigger
Christopher McCormack
@cmccormack
Jun 26 2018 15:16
@JLuboff just wipe the whole thing
@dbsimeonov I've never used this, but maybe the new hash is passed to the onhaschange callback, not updated on location?
Blauelf
@Blauelf
Jun 26 2018 15:17
BTW, window.addEventListener('hashchange', locationChange); without on.
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:17
:shipit: @Blauelf you are god
when I googled it, I saw it with on ??
Nate Mallison
@NJM8
Jun 26 2018 15:18
if you add it directly to the element
Blauelf
@Blauelf
Jun 26 2018 15:18
There's no "onhashchange" event. You can have window.onhashchange = locationChange;, but that's the old way of doing it.
what is hash change? url?
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:19
aaa okay, got it
url when you have a id selected
Nate Mallison
@NJM8
Jun 26 2018 15:19
ah, cool
Waiting to hear back on a job I applied to, phone interview went well, fingers crossed! :fire:
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:20
@NJM8 good luck
Christopher McCormack
@cmccormack
Jun 26 2018 15:20
@NJM8 Good luck! Can you say the place?
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:21
I applied for more than 50jobs past 2weeks, and I think I'm not good enough so keep going with my projects :D
Christopher McCormack
@cmccormack
Jun 26 2018 15:21
Make sure you have a good linkedin presence as well, I get hit up a few times a year by big companies via linkedin (not for web dev)
Nate Mallison
@NJM8
Jun 26 2018 15:21
It's a remote VueJS out of Austin
Jason Luboff
@JLuboff
Jun 26 2018 15:22
@cmccormack Hah.. wipe...I'm doing final review on thursday, so NO!
Christopher McCormack
@cmccormack
Jun 26 2018 15:23
@NJM8 are you in Austin?
Nate Mallison
@NJM8
Jun 26 2018 15:23
They asked me to make a to do app, thankfully nothing live or pair programming
nope, but they are ok with remote
Christopher McCormack
@cmccormack
Jun 26 2018 15:23
oh that's great!
Nate Mallison
@NJM8
Jun 26 2018 15:24
Description says local/ work from home but I applied anyways. Not much to lose
Christopher McCormack
@cmccormack
Jun 26 2018 15:24
yeah why not
Nate Mallison
@NJM8
Jun 26 2018 15:24
I nailed all their VueJS questions 100% :sparkles: so I guess they figured it would be ok. I hope, haha
It was kinda weird to do a phone interview. The only way he knows I wasn't googling all the questions is the lack of keyboard clicking in the background, ha
Christopher McCormack
@cmccormack
Jun 26 2018 15:26
Yeah that's why you keep a cheat sheet already up in your monitor :D
Nate Mallison
@NJM8
Jun 26 2018 15:26
@dbsimeonov I applied to 10-15 other jobs as well. Nothing. I signed up for upwork too but looks like a sham.
Jason Luboff
@JLuboff
Jun 26 2018 15:26
I'd say its fairly easy to tell if someone is googling just based on the time it would take them to answer and it wouldn't sound as cohesive
Nate Mallison
@NJM8
Jun 26 2018 15:26
true
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:27
@NJM8 Umm I was expecting to be something like that, especially when I'm applying for a Junior position. 2 of the agencies called me but that was all. Will keep pushing it of course
Christopher McCormack
@cmccormack
Jun 26 2018 15:27
Sooooooooooo Iiiiiiiiiiiiii think that theeeeeeee answweeeeeeeeerrrrr issssssss .... 21?
Nate Mallison
@NJM8
Jun 26 2018 15:27
difference between, "answer" and "uhhh, (click click click), answer"
Jason Luboff
@JLuboff
Jun 26 2018 15:27
I originally started FCC with the idea that I would do stuff on upwork...but never got around to it and heard its overrun to the point that jobs don't pay much
Nate Mallison
@NJM8
Jun 26 2018 15:27
@dbsimeonov Anything local to you? Meetups are good too.
Jason Luboff
@JLuboff
Jun 26 2018 15:28
@dbsimeonov Job searching is funny. You could apply for 100+ jobs in 2 weeks and not hear a thing...but then you'll apply to more and all of a sudden you'll get 5-10 calls
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:28
@NJM8 I live in London, so I guess its lots of demand but lots of people as well. Will start going to meetups definitely
Christopher McCormack
@cmccormack
Jun 26 2018 15:29
Yeah the few meetups I've gone to they usually have several largish companies looking for developers
Daniel Simeonov
@dbsimeonov
Jun 26 2018 15:29
Any specific company other than FCC that might have meetups in London?
Christopher McCormack
@cmccormack
Jun 26 2018 15:30
Check out meetup.org
Stephen James
@sjames1958gm
Jun 26 2018 15:31
Here is Dallas many of the meetups allocate time for announcing jobs and job seeking
Jason Luboff
@JLuboff
Jun 26 2018 15:32
@sjames1958gm :wave:
Stephen James
@sjames1958gm
Jun 26 2018 15:32
@JLuboff :wave:
Jason Luboff
@JLuboff
Jun 26 2018 15:32
It's been a while, how're you?
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 15:34
@cmccormack I'm asking if I could validate a number format
Stephen James
@sjames1958gm
Jun 26 2018 15:34
Good. Busy as work - we got to build a polling app from scratch with Angular 6, graphql and AWS, so that was cool (proof of concept for our annual user's meeting)
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 15:34
Like if it's not this format xxx-xxx return false.
Jason Luboff
@JLuboff
Jun 26 2018 15:34
@sjames1958gm Awesome, new job has been treating you well?
Christopher McCormack
@cmccormack
Jun 26 2018 15:35
@OGTechnoBoy are you using Regular Expression?
Stephen James
@sjames1958gm
Jun 26 2018 15:36
@JLuboff Yes. a good variety of both maintenance and new stuff. Getting to use a lot of what I learned here
Jason Luboff
@JLuboff
Jun 26 2018 15:36
Thats great, glad to hear
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 15:36
@cmccormack No, why? Is it possible to do it with Regular Expressions?
Blauelf
@Blauelf
Jun 26 2018 15:36
How else would you do it?
Christopher McCormack
@cmccormack
Jun 26 2018 15:37
@OGTechnoBoy you can do any pattern matching you want in regex. Some are more difficult than others but it should be possible
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 15:39
Can you give me an example?
I don't know how to do it, really.
Do I put /(0-9-)/
Christopher McCormack
@cmccormack
Jun 26 2018 15:40
@OGTechnoBoy That's part of the challenge, did you do the FCC regex exercises?
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 15:40
or something?
Yes, I did it and I don't think I have ever encountered this situation.
Anyway, thank you though.
Now that I know which method I use, it'll be much easier.
Nate Mallison
@NJM8
Jun 26 2018 15:40
@OGTechnoBoy https://regexone.com/ That is a quick tutorial that should set you up well for regex phone challenge
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 15:41
Thank you!!
Christopher McCormack
@cmccormack
Jun 26 2018 15:41
@OGTechnoBoy the first time I did that exercise I did not use a regex, so it's possible either way
The proper regex will take time to craft, but is probably easier than doing it the other way
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 15:42
I know that it is possible to do that without a regex but I expect that it will use a lot of if conditions, right?
Christopher McCormack
@cmccormack
Jun 26 2018 15:43
@OGTechnoBoy Regex can be complicated, certainly, but well worth struggling through until you understand it better
@OGTechnoBoy and like @NJM8 suggested there are great online tools - maybe break the problem out into smaller problems (how do I parse just the area code?) and test using tools like that
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 15:45
Yes, I thought about doing that but my main issue was how to validate formats.
Nate Mallison
@NJM8
Jun 26 2018 15:46
IRL you would use a validation tool, it can be very complicated. But it's a good exercise to understand how things work. Doing it with regex is a good challenge.
PS, that tutorial may or may not have a challenge that will get you 75% of the way to passing the FCC challenge.... :smile:
@cmccormack You have any trouble with the Yelp api?
UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
Christopher McCormack
@cmccormack
Jun 26 2018 15:49
@NJM8 sounds like you're trying to access a buffer
are you using fetch?
don't forget res.json()
or whatever you are using as your response from the request
Jason Luboff
@JLuboff
Jun 26 2018 15:50
@NJM8 Try using NodeJS's built in util module with the inspect method (that is if you're trying to stringify the object)
const util = require('util'); 

util.inspect(object);
Nate Mallison
@NJM8
Jun 26 2018 15:51
oh, Request failed with status code 410
I think the module I'm using is just outdated. node-yelp-fusion
Christopher McCormack
@cmccormack
Jun 26 2018 15:53
hmm you're still getting a buffer though
or something that's not a proper json response
I just used yelp-fusion
Jason Luboff
@JLuboff
Jun 26 2018 15:55
I also used yelp-fusion
Christopher McCormack
@cmccormack
Jun 26 2018 15:55
@NJM8 using fetch or axios?
oh wait, you're using the api duh
haha
Nate Mallison
@NJM8
Jun 26 2018 15:58
yeah, node-yelp-fusion hasn't been updated in 2 years, trying yelp-fusion
Jason Luboff
@JLuboff
Jun 26 2018 15:58
yelp-fusion worked well for me
Christopher McCormack
@cmccormack
Jun 26 2018 16:00
yeah really easy to setup and use
Nate Mallison
@NJM8
Jun 26 2018 16:01
question about structure, I need to define the yelp.client(apiKey) in routes.js, but dotenv loads everything in the app.js
is there a preferred way to make the dotenv load everything across the app or should I just load it again in routes
or can I define the yelp client in app.js and still access it in routes.js
Christopher McCormack
@cmccormack
Jun 26 2018 16:03
just load it again
you can always pass the variable from your app though if you wanted
I prefer to just load my dotenv from the file that needs it though so I don't have to add parameters to my modules
Nate Mallison
@NJM8
Jun 26 2018 16:05
true
just seems weird to duplicate the code
Christopher McCormack
@cmccormack
Jun 26 2018 16:05
eh
Nate Mallison
@NJM8
Jun 26 2018 16:06
ha, DRY DRY DRY, nah just duplicate that one. haha
businesses[x].distance decimal Distance in meters from the search location. This returns meters regardless of the locale.
needs a freedom parameter for freedom units, WTF is a meter
Jason Luboff
@JLuboff
Jun 26 2018 16:10
A Meter is roughly one freedom yard
Nate Mallison
@NJM8
Jun 26 2018 16:10
haha, fair enough
Distance to bar: ~ 3455 Freedom Yards
Blauelf
@Blauelf
Jun 26 2018 16:11
Freedom yard? Like renaming the Belgian fries to "freedom fries"?
Christopher McCormack
@cmccormack
Jun 26 2018 16:11
I don't really think importing the env file is a DRY issue personally, you can grab that block of code and move it somewhere else and it would still work, even outside of this project, provided you have a .env file, so it IS different
Markus Kiili
@Masd925
Jun 26 2018 16:12
@Blauelf I was just going to write about freedom fries. That is sick.
Christopher McCormack
@cmccormack
Jun 26 2018 16:12
it's a module right
Jason Luboff
@JLuboff
Jun 26 2018 16:12
@Blauelf What the hell are Belgian fries? Give me some of them French fries!
Blauelf
@Blauelf
Jun 26 2018 16:13
@JLuboff Belgian ones are best. With two-step frying process. First short high temperature bath, then long on medium temperature.
Jason Luboff
@JLuboff
Jun 26 2018 16:14
Ah. Interesting. How about Netherland fries? They sure love their fries there...fries and mayo...
yum
Blauelf
@Blauelf
Jun 26 2018 16:17
The Netherlands with their Joppiesaus. But Belgium is king of pommes frites.
Blauelf
@Blauelf
Jun 26 2018 16:22
I might have messed up the order of the temperatures, Wikipedia claims lower temperature comes first. But I go to the Dutchman for fries. And a slice of Bami. Not as good as Belgian frites, though, only one step.
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 17:43
Guys I have a problem
/[(]?[0-9]{3})[-]?[0-9]{3}-[0-9]{4}/g
It follows almost the format
But the problem is that it doesn't match - anymore
it only matches ) but only when not followed by dash(-) exactly like I wanted but when I did that, it becomes no longer matches - anymore.
Any fix for this? I'm a noob in regex.
Christopher McCormack
@cmccormack
Jun 26 2018 17:54
@OGTechnoBoy you need to escape brackets, parens, curly braces if you're actually trying to find them
\(, \), \[, \] etc...
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 17:55
What escape do?
Christopher McCormack
@cmccormack
Jun 26 2018 17:56
You should read over the regex documentation very closely
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 17:57
Oh, ok. Thanks.
It didn't work.
Christopher McCormack
@cmccormack
Jun 26 2018 18:01
you still have to figure it out
keep testing :)
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 18:11
It's impossible to know.
I'm testing for 1 hour.
And I tried everything possible.
Christopher McCormack
@cmccormack
Jun 26 2018 18:12
Break it into simple pieces and get those to pass first
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 18:13
I can't. It's regex.
If I break it into pieces then it will not match anything.
Wait a min. I think I figured it out.
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 18:19
Nope. I didn't.
I tried to try | but it didn't succeed.
Jason Luboff
@JLuboff
Jun 26 2018 18:21

Alright...I got a regex problem that I need some help with. I need to do a negative lookahead (look behind?) ... that is, I want to only match a number if its not preceeded by anoither number.. So

const arr = ['myProp2', 'myProp12'];

If I'm looking for only properties that end specifically with 2 I want to match those, and not match those that end with 12 for example.
So this /2{1}$/ will match the number at the end of input exactly once but will still match 12.

Christopher McCormack
@cmccormack
Jun 26 2018 18:22
can you just do not number followed by number?
Jason Luboff
@JLuboff
Jun 26 2018 18:22
Not sure I follow
Christopher McCormack
@cmccormack
Jun 26 2018 18:22
what are some success vs failure numbers?
Jason Luboff
@JLuboff
Jun 26 2018 18:23
I might just be a bit clouded in mind, but still not sure I understand :joy:
Christopher McCormack
@cmccormack
Jun 26 2018 18:24
what are numbers you want to match vs dont
just some examples
Jason Luboff
@JLuboff
Jun 26 2018 18:25
Ah. It changes. I'm filtering results (what I had messaged you about earlier). So for one loop, I might want only names ending in 2 while the next loop only those neding in 12
Nevermind, figured out a working solution :smile:
/(?!.[0-9]).{1}\.2{1}$/
Christopher McCormack
@cmccormack
Jun 26 2018 18:28
hah great
Jason Luboff
@JLuboff
Jun 26 2018 18:28
I don't quite understand it, but I'll go with it lol
Nate Mallison
@NJM8
Jun 26 2018 18:31
@OGTechnoBoy It took me like 5 hours to do that challenge after doing several tutorials to figure out more regex stuff, it's not easy.
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 18:31
It's okay.
I'm trying to figure it out.
Just tell me, is it efficient to use | in regex to choose the formats?
I don't know but I feel as if I trick myself by doing that
Christopher McCormack
@cmccormack
Jun 26 2018 18:37
you keep saying formats, what do you mean by formats @OGTechnoBoy ?
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 18:37
I mean something like this xxxx-xxxx-xxxx
Christopher McCormack
@cmccormack
Jun 26 2018 18:39
I wouldn't call that a format, but using | is fine if you need to choose between a few different options in that position
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 18:39
I mean, I could do it without | but I'm getting bored of these challenges so I want to finish it quickly
Jason Luboff
@JLuboff
Jun 26 2018 18:45
Why do them if it sounds like you don't care to do them?
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 18:46
Because I want to go to libraries section quickly.
Also "don't care to do them" is a strong word.
I care to do them but not much anymore. If I didn't care for them, I wouldn't be here asking for help, I would have copied someone else's code to finish the challenges quickly but I don't want to solve them that way.
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:18
hello everyone
anyone around that has a bit of knowledge with electron?
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:25
@JLuboff True! Besides, updating that code to PHP7 would be easy for pretty much any PHP dev, ghehe
Christopher McCormack
@cmccormack
Jun 26 2018 19:26
@tiagocorreiaalmeida hey good to see you!
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:28
hey @cmccormack, its been a while how are you? :D
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:28
electron?
Do you mean that awful project to be able to develop desktop applications by using Javascript?
Christopher McCormack
@cmccormack
Jun 26 2018 19:29
@OGTechnoBoy you're pretty negative aren't ya
@tiagocorreiaalmeida good man keeping busy with work
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:29
I'm not negative. It's just that it is pretty pointless.
Just try to use Slack or Visual Code
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:30
no I mean electron gun
Christopher McCormack
@cmccormack
Jun 26 2018 19:30
I use them all the time and they are great cross platform tools I get a lot of work done with
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:30
They will run very slowly .
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:30
but thanks for your info @OGTechnoBoy
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:30
Yeah I heard about electron gun.
Christopher McCormack
@cmccormack
Jun 26 2018 19:30
@tiagocorreiaalmeida haha you making a CRT?
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:31
I guess that's what electron is all about ahah
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:31
Just a question, why you will make Javascript applications while you can make them with C++ which is faster?
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:31
Electron is pretty good to be honest. Discord was made by it, for example
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:31
there's a thing called learning curve and other time
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:31
Yeah but the applications are awfully slow and crush as well.
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:31
make a graphic with it
I see
I code with vs code everyday
and I can't spot a single issue lately
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:32
Then you probably have a good computer.
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:32
no, this is my setup
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:32
setup?
What's that?
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:32
Well, you work with the technologies you know. If it's just one program you wish to make, I wouldn't bother learning a completely new language for it either
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:33
image.png
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:33
Oh.
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:33
:smile:
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:34
Maybe you run some kind of a lite version?
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:34
He is joking :laughing:
That's like Windows 98 there. It wouldn't even run Gitter :P
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:35
@bjorno43 Don't understand me wrong. I would be more than happy to make my first application just by using 1 language without wasting another 2 or 3 years to learn C++. But I don't think that it is a good direction. Programs' performance is important if you want customers. But I could be wrong since I'm new though.
@bjorno43 He could just install a theme.
Christopher McCormack
@cmccormack
Jun 26 2018 19:36
hah 2 or 3 hours
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:36
I normally learn a language in one of those videos that say learn ... in 12minutes or something
2 hours seems too much
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:36
Sorry, I made a typo.
I meant years.
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:36
Whahaha I was like.. whut?
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:37
@tiagocorreiaalmeida I find web languages to be easier than desktop's though.
Moisés Man
@moigithub
Jun 26 2018 19:37
doing a "hello world" app isnt learning
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:39
@moigithub crap .. :worried:
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:39
If you learn a programming language in 12 minutes then you're doing something wrong.
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:40
Try AHK. Should be possible within an hour, ghehe
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 19:40
I really dont have the needs to build desktop applications at the moment im just learning electron for the fun and to do home projects, why wouldn't I learn something that can still be usefull for simple things?
Christopher McCormack
@cmccormack
Jun 26 2018 19:40
@tiagocorreiaalmeida You totally should, don't let anyone tell you you shouldn't
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:40
I just said my opinion.
My opinion is that Electron apps are pretty slow for average computers. I'm planning to learn it soon though.
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:43
I think it's a fair opinion. I develop in C# as well and ye, it's definitely faster than Electron. But than again, Electron uses a language that wasn't made for native app development. So it has to somehow bridge or translate it
Christopher McCormack
@cmccormack
Jun 26 2018 19:45
Different tools for diffferent purposes
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:47
Yeah...I doubt that it is slower than a Java program though.
Christopher McCormack
@cmccormack
Jun 26 2018 19:48
Java is pretty fast nowadays, the JIT is very good
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:49
I dunno dude. I remember one day I installed some Java game and it kept crushing and freezing here and there. It was a nightmere.
Heck, even Slack is stable and prettty fast to that thing.
Christopher McCormack
@cmccormack
Jun 26 2018 19:50
Anecdotal experience isn't necessarily a good reason to approve/reject an entire technology though
I recommend spending a good amount of time working on something to really understand the benefits/drawbacks
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:51
It wasn't an Anecdotal experience. I opened Task Manager and I didn't believe how much resources that program used.
Minecraft on other hand(which is programmed by Java) is pretty fast.
Christopher McCormack
@cmccormack
Jun 26 2018 19:53
The anecdote was a single app experience
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:53
It wasn't a single app experience.
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:54
There's only 1 reason why I hate Java games
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:54
Netbeans was a nightmare to deal with too.
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:54
Cause of the JIT, it's pretty much impossible to write game trainers for them xD
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:54
Trainers?
What is that?
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:55
Little programs that modify the RAM used by the game to give you infinite lives or stuff like that
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:55
That sounds as hacking.
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:56
It is. But it only works on local, single player games. It's not like you're bothering anyone with it and also completely legal ;)
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 19:58
Btw, that reminds me. Is it completely viable to hack by using Javascript?
Bjorn van de Peut
@bjorno43
Jun 26 2018 19:59
Depends on what your goal is. Javascript is client side. So on the client side, you can inject Javascript and mess around with that. But you're not able to actually hack a server with it
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:00
It is a theory but can I make an app in some website that its job is to run some JS code in user's browser to send me his cookies's informations?
I never know if I'm able to do that since It uses server side and I know nothing about servers and stuff.
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:03
Depends. Cookies can have a flag called HTTP only. In that case you can't use JS to steal them as JS has no access to them. But if that flag isn't set, then yes, you can steal them with JS. That's why that flag should always be set unless you actually need the cookie in JS as the server owner
Christopher McCormack
@cmccormack
Jun 26 2018 20:04
I think a site only has access to the cookie store for that domain though
Jason Luboff
@JLuboff
Jun 26 2018 20:04
@tiagocorreiaalmeida Yoo
Ah... that realization when you refactor from 3 loops to a single loop :clap:
Christopher McCormack
@cmccormack
Jun 26 2018 20:07
now figure it out algorithmically so you need no loops!
Jason Luboff
@JLuboff
Jun 26 2018 20:08
Psh... a single .map() is good enough for me
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 20:08
hey @JLuboff, how are you?
Jason Luboff
@JLuboff
Jun 26 2018 20:08
@tiagocorreiaalmeida Doing good, how about yourself?
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 20:08
@JLuboff https://codefights.com/challenge/pFMvFY3BQ683iRvFr make this one wiht one loop :D
all good aswell, how's son?
your*
Jason Luboff
@JLuboff
Jun 26 2018 20:09
He is doing good, growing quick! 7 months old now... crawling everywhere. He can lift himself very easily and starting to try and walk (he'll move his hands...then shuffle his feet lol)
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:09
I heard that there are XSS exploit which can give you the access.
Christopher McCormack
@cmccormack
Jun 26 2018 20:10
Sounds like a good thing to research
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:11
But not a good thing to understand.
Christopher McCormack
@cmccormack
Jun 26 2018 20:12
There's a lucrative career in computer/network security and that's exactly the type of stuff they research
Jason Luboff
@JLuboff
Jun 26 2018 20:12
@tiagocorreiaalmeida btw...too lazy to try that lol (plus too much going on like always)
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:14
@cmccormack Domains have full access to the entire cookie store (except cookies with the HTTP only flag).
@OGTechnoBoy It's definitely a good thing to understand. Learning how hacks work means understanding how to counteract them. Security is imporant. The trick is not to abuse your knowledge
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:16
Actually I learn them because I want to hack with them. Muahahahah!
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:17
That's also a possibility. As long as you do it legal. I've been asked to do penitration testing quite a lot in the past. Fun to do :smile:
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:18
Legal? There are legal hacking,
?
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 20:18
jesus 7 months, I guess we dont evne notice how fast it goes by, have you finished the aplication you where building?
Jason Luboff
@JLuboff
Jun 26 2018 20:18
White hat hacking
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:18
Yup. Companies hire hackers all the time. They ask them to try and hack their systems so they know where they are vulnerable
Jason Luboff
@JLuboff
Jun 26 2018 20:19
@tiagocorreiaalmeida Right? Hah.. I'm doing final review this week for it. Actually fixing an issue on it right now (more dynamic = better!)
@tiagocorreiaalmeida What've you been working on?
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:19
I thought that white hat hackers are the hackers that hack the website and then after destroying it, they send a fix to the exploit to the website owners as a way to salt them even more...
Anyway, what happens if you was a black hat hacker? Would you go to jail if you hacked a simple website(no banks of course)?
Jason Luboff
@JLuboff
Jun 26 2018 20:20
White hat hackers are ethical hackers. Black hat hackers are the opposite.
If caught, yes they can
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:21
No. White hat hackers don't abuse their knowledge. They use it to help. And only with permission
When I just started out, I hacked a small website without permission. Send them an email about the vulnerability and how to fix it. Got a thank you email returned and that's how I started my white hat "carreer", haha
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:23
Wow, that's a awesome.
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 20:24
nice, will it be somehow public? I started working on a new company in May and for now it has all been about node and a bit of linux, also what we build is related to phone calls so there's sip stuff but that's a mess to me :D , at home well we all get tired after a wroking day :D but trying to force myself back into it, this time electron
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:24
But that was like 15 years ago. Back then you could still get away with stuff like that. These days you gotta be more carefull and ask permission first
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 20:24
also learned a bit of python but for some reason which I can't figured out I stopped, but someday I will get back to it
Jason Luboff
@JLuboff
Jun 26 2018 20:25
@tiagocorreiaalmeida Thats awesome, congrats. So you're doing web dev stuff now then?
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:26
But why you will get caught just for hacking a simple website?
Also, will they be able to get you if you used VPN?
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 20:28
@JLuboff software development at the moment
Christopher McCormack
@cmccormack
Jun 26 2018 20:29
You can - someone recently was sentenced to prison for simply changing some values in the url to see what they would get back, they considered that hacking even though it was their own vulnerability
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 20:29
still there's stuff like build api's aswell
Christopher McCormack
@cmccormack
Jun 26 2018 20:29
@tiagocorreiaalmeida I tell everyone that asks me if they should learn python that they shouldn't bother until they have a good reason to.
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 20:30
:D ahaha
atually that's probably the reason I stopped?
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:30
It doesn't matter whether it's a simple website or Google. The offense is just the same. Except that Google will have some better lawyers to make your life missrable, ghehe. And yes, a VPN doesn't garantuee 100% anonimity. If they gain access to the VPN and it turns out to contain certain logs, they still get you. Or they just wait till you reconnect to the VPN when it's under their control
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:31
Oh, then a black hat hacker isn't an option for anyone now that people get caught for doing it.
Tiago Correia
@tiagocorreiaalmeida
Jun 26 2018 20:31
@bjorno43 if you keep telling him that things you will destroy all his dreams
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:31
@tiagocorreiaalmeida Whaha I think so xD
Ah well. He better hears the truth now than start messing around with stuff that he shouldn't and pay the price for it later
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:34
Wow, hacking does seem more dangerous than it seems on internet.
It's between life-and-death situation.
Okay, what about Grey hat hackers? Do they get caught too? Sorry for too many questions. I'm interested in this subject.
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:35
It's not dangerous as long as you do it legal. Why would you want to do it illegaly?
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:35
Well, you know...for fun and well, for REVENGE, I mean for fun, yeah...totally for fun.
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:36
The type of hacker doesn't change the fact that you can get caught or not, lol
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:37
I mean the jobs of the type of hacker more than the type of hacker alone.
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:38
Just don't do it @OGTechnoBoy I assume you're still young and yes, hacking sounds a lot of fun and cool at a young age. But trust me, you're going to regret it if you persue that course
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:39
Oh man...that has totally changed my plans for life.
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:39
lol
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:39
Well, at least I still have the goal of being a white hat hacker, right?
Btw, how much money do you get from your job as a hacker in a company?
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:41
Sure, that's definitely a worthy goal to persue. White hats are usually freelancers. I honestly cant say how much they make as it completely depends on how big the system is, how much needs to be tested and which country you're working in
OGTechnoBoy
@OGTechnoBoy
Jun 26 2018 20:43
Well, as long as I will do my favorite job while having fun and being legal, it's okay.
Now all what is left is to reach the level of a hacker which is not easy lol.
Anyway, thank you a lot for these informations! They were really helpful and it was nice to meet a hacker!
I had fun (:
Bjorn van de Peut
@bjorno43
Jun 26 2018 20:48
You're welcome :)
Kira
@codeymason
Jun 26 2018 21:48
I'm struggling with the Counting Cards assignment. Would anyone be willing to help? Here is the assignment page, for indications. So far, my code looks like this:
var count = 0;

function cc(card) {
  // Only change code below this line
  switch(card) {
    case 2:
    case 3:
    case 4:
    case 5:
    case 6:
     count += 1;
     break;
    case 7:
    case 8:
    case 9:
     count = count;
     break;
    case 10:
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
     count -= 1;
  }

  if count >= 1 {
    return count "Bet";
  } else {
    return count "Hold";
  }
  // Only change code above this line
}

// Add/remove calls to test your function.
// Note: Only the last will display
cc(2); cc(3); cc(7); cc('K'); cc('A');
Kaz Baig
@kbaig
Jun 26 2018 21:50
@codeymason You have to return a string with the count and "Bet" or "Hold"
Would look like "-3 Hold" or "5 Bet"
Jason Luboff
@JLuboff
Jun 26 2018 21:56
@kbaig :wave:
Kaz Baig
@kbaig
Jun 26 2018 21:57
@JLuboff hey boss how's it
Jason Luboff
@JLuboff
Jun 26 2018 21:57
It's going...you?
Kaz Baig
@kbaig
Jun 26 2018 21:59
@JLuboff Boss man is particularly grumpy these days and wants to hear back on the overloaded work he's given me so I'm gonna be at work late this whole week :cry:
Jason Luboff
@JLuboff
Jun 26 2018 21:59
That sucks...hopefully that means overtime?
Kaz Baig
@kbaig
Jun 26 2018 22:00
pshh my company pays 75% of average at most
you think we get OT
Kira
@codeymason
Jun 26 2018 22:00
@kbaig I'm not sure if I know how to return the contents of a variable within a string. In this case, the contents of count.
Jason Luboff
@JLuboff
Jun 26 2018 22:01
@codeymason String concatenation
const myVar = 12;

return 'My variable number is ' + myVar;
Kaz Baig
@kbaig
Jun 26 2018 22:01
@codeymason
var num = 1;
var str = "The num is ";

num + str + "."; // "The num is 1."
Bjorn van de Peut
@bjorno43
Jun 26 2018 22:01
I'm glad to live in a country where my boss wouldn't dare not to pay overtime xD
Jason Luboff
@JLuboff
Jun 26 2018 22:01
@kbaig I'd say thats illegal... assuming you're an hourly employee
Kaz Baig
@kbaig
Jun 26 2018 22:01
@JLuboff no I'm salaried
Jason Luboff
@JLuboff
Jun 26 2018 22:02
Oh well in that case..ya too bad
Kira
@codeymason
Jun 26 2018 22:02
@JLuboff @kbaig THANK YOU. so much info, forgot about that one.
Jason Luboff
@JLuboff
Jun 26 2018 22:03

@codeymason There's a nifty newer syntax too called template strings (or template literals) which is used like so

const myVar = 12;

return `My variable number is ${myVar};`

So instead of ' or " you use backticks ` and then you surround your variable with ${}

Kira
@codeymason
Jun 26 2018 22:06
@JLuboff Oh cool, so in the case of my card counting assignment, that might look like this? return${count} Hold`` ??
Well that wasn't quite what I had in mind.
Can I use \ to include more backticks within code in this chat window just like anywhere else?
Jason Luboff
@JLuboff
Jun 26 2018 22:09
Yes you can use \ to escape with Gitter

So you would want to have

return `${count} Hold`

So only backtick around the string components

Kira
@codeymason
Jun 26 2018 22:11
@JLuboff Thanks. Right, that's what I was getting at. Let me give that a spin.
Jason Luboff
@JLuboff
Jun 26 2018 22:11
Ya I knew thats what you were aiming for. Usually I wouldn't be that blatant with the answer but you had it pretty much he
Kira
@codeymason
Jun 26 2018 22:13
@JLuboff Thanks. Hopefully all your knowledge will eventually Luboff on me.....(sorry)
Bjorn van de Peut
@bjorno43
Jun 26 2018 22:13
When JS starts hinting at PHP.. $(var).. :laughing:
Jason Luboff
@JLuboff
Jun 26 2018 22:14
And here I thought I'd escaped middle school :smile:
Kira
@codeymason
Jun 26 2018 22:14
Not till today
Bjorn van de Peut
@bjorno43
Jun 26 2018 22:14
lol
Jason Luboff
@JLuboff
Jun 26 2018 22:15
Ah... refactored code... feels so good
Kira
@codeymason
Jun 26 2018 22:17
@JLuboff Interestingly, the code works (on repl.it) when I use single backticks to denote the string, but not "". I thought they were interchangeable? Perhaps not with ${x}?
Jason Luboff
@JLuboff
Jun 26 2018 22:18
@codeymason Correct. backticks ` are specifically for template string
Kira
@codeymason
Jun 26 2018 22:18
@JLuboff got it, thanks a lot.
Jason Luboff
@JLuboff
Jun 26 2018 22:18
:+1:
Kira
@codeymason
Jun 26 2018 22:20
Oh, I'm realizing now my mistake. ' and " are typically interchangeable. Not and ". Plus I'm seeing here that in the case of ${}, is the only accepted way.
Damnit.
Jason Luboff
@JLuboff
Jun 26 2018 22:20
:smile:
Kira
@codeymason
Jun 26 2018 22:20
Well clearly that was a backtick I was referring it.
Bjorn van de Peut
@bjorno43
Jun 26 2018 22:22
In PHP that does work though. Variables withing double quotes are acceptable. Within single quotes PHP takes them as literal strings
Kira
@codeymason
Jun 26 2018 22:23
Aw man this journey is a rough one. I went to a meetup a few weeks ago and was talking with a few guys who are seven weeks into a boot camp, and they know about 5x what I do, and I've been going at this stuff for 3 months. It makes it hard to stay the course with self-teaching. Grated, their boot camp is 25 hours a week and I can only afford to spend 10-15.
Christopher McCormack
@cmccormack
Jun 26 2018 22:25
It's a journey not a race
Kira
@codeymason
Jun 26 2018 22:27
@cmccormack True that. My pace hasn't faltered, but my morale definitely took a little hit. I'll get through it, just have to keep putting in the hours. I know i'll make it, and I know it will take a long time. Ups and downs are natural.
Bjorn van de Peut
@bjorno43
Jun 26 2018 22:28
You want your morale to take a hit?
I've been programming for 16+ years and I'm still learning :trollface:
No worries though. As a programmer you always keep on learning. It's part of the job, haha
Kira
@codeymason
Jun 26 2018 22:33
@bjorno43 That's what I like about it!
@bjorno43 That and the fact that what you get out of it is exactly proportional to what you put into it.
Bjorn van de Peut
@bjorno43
Jun 26 2018 22:36
Well that depends on how it's coded.. I know very small codes that produce a whole lot of information and I've once had to write 40+ lines of code for a simple Hello World demo. So no, it's not always proportional :P
Kira
@codeymason
Jun 26 2018 22:36
@bjorno43 I guess what I mean is that I can make what I want of my career. If I put in the time and the effort, I will get where I want to go. If I don't, I won't.
Bjorn van de Peut
@bjorno43
Jun 26 2018 22:37
That's true
Kira
@codeymason
Jun 26 2018 22:37
@bjorno43 And there's no excuse not to when the resources to learn are free and readily available.
Bjorn van de Peut
@bjorno43
Jun 26 2018 22:39
Well that depends on what kind of person you are. I've seen many programmer enthausiast that just werent cut out for it. Programmers require patience and good analystic thought processes. Not everyone possesses those qualities
Kira
@codeymason
Jun 26 2018 22:42
@bjorno43 I suppose I'll see whether I am or not. Only one way to find out.
Bjorn van de Peut
@bjorno43
Jun 26 2018 22:46
@codeymason If it is what you really want, I'm sure you can get there. In my experience, there are 2 types of programmers. Those that want to learn how to do it because they want to create something and are unwilling to pay a programmer for it. And those that want to learn it because they want to create many different things. It's the latter that usually makes it. But first not
Carlos Alfaro
@devbysalas
Jun 26 2018 23:54

Hello guys, I'm stuck with this problem. Any idea why its not passing the test?

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/regular-expressions/specify-upper-and-lower-number-of-matches/

let ohStr = "Ohhh no";
let ohRegex = /h{3,6}/; // Change this line
let result = ohRegex.test(ohStr);