These are chat archives for FreeCodeCamp/Help

31st
Jan 2015
Mark Howard
@iheartkode
Jan 31 2015 00:23
var express = require('express');
var request = require('request');
var url = require('url');
var app =  express();



app.get('/tweets/:username', function(req, res) {
  var username = req.params.username;
});

options = {
  protocol: "http:",
  host: 'api.twitter.com',
  pathname: '/1/statuses/user_timeline.json',
  query: { screen_name: username, count: 10}
}

var twitterUrl = url.format(options);
req(twitterUrl).pip(res);

app.listen(3000);
// watching the codeschool express part of node.  It says no module found "request" in the videos his works fine and I have the exact code.
Cannot find module 'request'
Justin Rogers
@yaskyj
Jan 31 2015 00:25
Did you install request with npm?
Mark Howard
@iheartkode
Jan 31 2015 00:27
lol the video did not say to
Justin Rogers
@yaskyj
Jan 31 2015 00:28
Freaking videos.
Mark Howard
@iheartkode
Jan 31 2015 00:28
He just added the require
it's codeschool
Justin Rogers
@yaskyj
Jan 31 2015 00:28
npm install require --save
Is this in the browser?
Mark Howard
@iheartkode
Jan 31 2015 00:29
did it
that is so frustrating
yea
codeschool,com
Justin Rogers
@yaskyj
Jan 31 2015 00:29
I've done it plenty so far.
Received that error, I mean.
Mark Howard
@iheartkode
Jan 31 2015 00:31
Finally it works
He teaches you to write code for twitter then says well since the new api you need to auth so this is useless.. really why not teach something else????/
Justin Rogers
@yaskyj
Jan 31 2015 00:35
You can always play around with the Reddit api. It's really straight-forward.
Mark Howard
@iheartkode
Jan 31 2015 00:35
Cool
thanks @yaskyj
Justin Rogers
@yaskyj
Jan 31 2015 00:39
np
Alex Dixon
@alex-dixon
Jan 31 2015 00:40
@terakilobyte had to walk away from comp and about to do so again but just wanted to say thanks for suggesting filter. very helpful and elegant :+1:
Nathan
@terakilobyte
Jan 31 2015 00:41
:)
enjoy!
Harames @PKMNinja is on challenge 39
Julie Myers
@BlueOceanView
Jan 31 2015 00:53
@PKMNinja Wow, you are just cruising along on those challenges.
Bin Ury
@teddy-error
Jan 31 2015 02:07
debug(typeof NaN);
--> number
:rage3:
Alex Dixon
@alex-dixon
Jan 31 2015 02:23
@teddy-error lol
debug(NaN === NaN);
—> false
Darryl Dixon - Piece Digital
@piecedigital
Jan 31 2015 02:53
Bin Ury
@teddy-error
Jan 31 2015 08:05
Array.prototype.largest = function(){
  return this.reduce(function(a,b){
    return (a > b) ? a : b;
  });
};
function largestOfFour(arr) {
    return arr.map(function(x){
      return x.largest();
    });
}

largestArr = largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);
debug(largestArr); --> 5,27,39,1001
debug(largestArr == [5,27,39,1001]); --> false
Not sure what exactly is happening here. Looks like map is maybe not returning an array?
Alex Dixon
@alex-dixon
Jan 31 2015 08:06
@teddy-error Believe answer must be in form of an array
Bin Ury
@teddy-error
Jan 31 2015 08:07
I can solve the bonfire in other ways, but i still want to know what is happening in here
Alex Dixon
@alex-dixon
Jan 31 2015 08:09
Right. I remember earlier you said map shold return an array...
Very nicely written...
Bin Ury
@teddy-error
Jan 31 2015 08:10
map returns a new array based on the return of the callback on each element of the parent array
thanks :)
Alex Dixon
@alex-dixon
Jan 31 2015 08:13
Uhm...
Bin Ury
@teddy-error
Jan 31 2015 08:13
function largestOfFour(arr) {
    return new Array(arr.map(function(x){
      return x.largest();
    }));
}
Tried this to no avail
Alex Dixon
@alex-dixon
Jan 31 2015 08:13
What did it return
Bin Ury
@teddy-error
Jan 31 2015 08:13
--> 5,27,39,1001
--> false
Alex Dixon
@alex-dixon
Jan 31 2015 08:16
So I copied and pasted into jsbin and it returns an array...
Bin Ury
@teddy-error
Jan 31 2015 08:17
what the almighty shit, then
:s
Alex Dixon
@alex-dixon
Jan 31 2015 08:17
Lol. Are you using JSC in sublime or something
Bin Ury
@teddy-error
Jan 31 2015 08:17
yeah
Alex Dixon
@alex-dixon
Jan 31 2015 08:18
Only thing I changed was debug to console.log
Bin Ury
@teddy-error
Jan 31 2015 08:18
that solution wouldn't work on Bonefire without moving the largest prototype into the body of map within largestOfFour
I guess Bonfire does not like overriding built ins
or something
@terakilobyte
maybe ill move it to a node build system
Alex Dixon
@alex-dixon
Jan 31 2015 08:20
Yeah. I guess top secret British intelligence frowns on that. Nicely done though. I wrote some god forsaken thing for that one
I guess everything checks out except for it returning string instead of array
No big deal hahah
Bin Ury
@teddy-error
Jan 31 2015 08:24
haha. I've been reading a lotttttt of javascript code lately in Eloquent Javascript. It helps
[ 5, 27, 39, 1001 ]
false
with node build
console.log(typeof largestArr); --> object
Alex Dixon
@alex-dixon
Jan 31 2015 08:25
...
Oh and um….on JS bin it’s an array with those values and false also
Bin Ury
@teddy-error
Jan 31 2015 08:37
[1,2,3] === [1,2,3] --> false
o
guess uh
no array comparisons for us
Alex Dixon
@alex-dixon
Jan 31 2015 08:38
omgwtfbbq
Bin Ury
@teddy-error
Jan 31 2015 08:39
you just have to iterate through both arrays and compare each element individually i guess
Alex Dixon
@alex-dixon
Jan 31 2015 08:40
good to know
Bin Ury
@teddy-error
Jan 31 2015 08:40
because reasons!
Alex Dixon
@alex-dixon
Jan 31 2015 08:40
dat string tho
teddy-error @teddy-error is going to cry self to sleep. goodnight
Alex Dixon
@alex-dixon
Jan 31 2015 08:42
:shipit:
Ammar Ali Shah
@AmmarAliShah
Jan 31 2015 09:05
for(i = 1; i < 21; i++ ){
    if(i % 3 === 0){
        console.log("Fizz");
    }
    else if(i % 5 === 0){
        console.log("Buzz");
    }
    else if(i % 3 && i % 5 == 0){
        console.log("FizzBuzz");
    }
    else{
        console.log(i);
    }
}
@ksharifbd ^
Alex Dixon
@alex-dixon
Jan 31 2015 09:07
try
```
i % 3 === 0 && i % 5 === 0
i % 3 === 0 && i % 5 === 0
…yeah
Kamal Sharif
@ksharifbd
Jan 31 2015 09:08
(y) @alex-dixon
Ammar Ali Shah
@AmmarAliShah
Jan 31 2015 09:08
@alex-dixon no luck
Kamal Sharif
@ksharifbd
Jan 31 2015 09:08
I forgot it too :P
It works @AmmarAliShah
Alex Dixon
@alex-dixon
Jan 31 2015 09:11
@AmmarAliShah Maybe it’s short circuiting because if the first two conditions are true then it will go with those
Kamal Sharif
@ksharifbd
Jan 31 2015 09:12

''' for (i=1; i<=20; i++)
{
if(i%5===0 && i%3===0)
{
console.log("FizzBuzz");
}

else if(i%3===0)
{
console.log("Fizz");
}

else if (i%5===0)
{
console.log("Buzz");
}

else
{
console.log(i);
}
}
'''

Alex Dixon
@alex-dixon
Jan 31 2015 09:12
^ :shipit:
Kamal Sharif
@ksharifbd
Jan 31 2015 09:12
Try this @AmmarAliShah
Point @alex-dixon
Ammar Ali Shah
@AmmarAliShah
Jan 31 2015 09:15
@ksharifbd that works
thanks :smiley:
Kamal Sharif
@ksharifbd
Jan 31 2015 09:16
as @alex-dixon said, short circuiting
Alex Dixon
@alex-dixon
Jan 31 2015 09:17
:smile:
Kamal Sharif
@ksharifbd
Jan 31 2015 09:18
But. Ammar's code work on Eloquent JS console. http://eloquentjavascript.net/07_elife.html
Alex Dixon
@alex-dixon
Jan 31 2015 09:20
Oh wow. Haven’t gotten that far yet. That project looks fun
Ammar Ali Shah
@AmmarAliShah
Jan 31 2015 09:22
@alex-dixon on which challenge are you right now?
@ksharifbd codecademy requirements
Kamal Sharif
@ksharifbd
Jan 31 2015 09:23
Yeah! Codecademy can do this.
Alex Dixon
@alex-dixon
Jan 31 2015 09:23
@AmmarAliShah 35
Ammar Ali Shah
@AmmarAliShah
Jan 31 2015 09:25
@alex-dixon I'm just going through 30
Alex Dixon
@alex-dixon
Jan 31 2015 09:26
@AmmarAliShah Awesome. Which one is that?
Ammar Ali Shah
@AmmarAliShah
Jan 31 2015 09:27
Alex Dixon
@alex-dixon
Jan 31 2015 09:31
Oh :smile:
Nathan
@terakilobyte
Jan 31 2015 12:25

@teddy-error I'll look into the prototypes, as it works for custom objects. It may be a security thing. On another note, why recreate the wheel?

function largestOfFour(arr) {
  // You can do this!
  return arr.map(function(elem) {
    return Math.max.apply(null, elem);
  });
}

largestOfFour([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

Good solution though! ;)

Briana Swift
@brianamarie
Jan 31 2015 13:34
Hello! Is there a way to go through a string and remove all of the [","] characters? Or, is there a way to turn an array into a string and have it omit the [","
] character?
Nathan
@terakilobyte
Jan 31 2015 13:37
yeah
arr.join(' ')
with one space
will join the elements of an array together with a space between them instead of a ,
Briana Swift
@brianamarie
Jan 31 2015 13:39
what if I don't want a space either?
Nathan
@terakilobyte
Jan 31 2015 13:40
well now you're just getting picky ;)
then it'd be just .join('')
with the empty string
if you want to go through a string, the str.replace() method is great
I'll let you look that up on MDN
Briana Swift
@brianamarie
Jan 31 2015 13:42
awesome. thank you! I knew that join was the way to go, but I couldn't figure out what to put in the ()
Nathan
@terakilobyte
Jan 31 2015 13:42
remember you can always experiment in the developer console
open it and type [1,2,3].join('')
or w/e else you want
Evan Davis
@davisec52
Jan 31 2015 15:12

Good morning, everybody! I'd apprciate some help understanding differences in "for" constructions. To solve a coderbyte problem, I needed a construction that would order elements in an array by frequency of occurence. After head banging and trial and error, I managed to get the code sample below, which works.

My question is why does the "for var i of arr" give different results than "for var i in arr".


function order(arr) {
    var counter = [];
    for(var i of arr) {
        if(!counter[i]) {
            counter[i] = 0;
        }
        counter[i]++;
    }
    return Object.keys(counter).sort(function(a, b){return counter[a] < counter[b]});
}
order([4, 4, 4, 6, 2]);


=> [ '4', '2', '6' ]  // result using "for var i of arr"

Here is the second sample, using "for var i in arr".


function order(arr) {
    var counter = [];
    for(var i in arr) {
        if(!counter[i]) {
            counter[i] = 0;
        }
        counter[i]++;
    }
    return Object.keys(counter).sort(function(a, b){return counter[a] < counter[b]});
}
order([4, 4, 4, 6, 2]);

=>[ '0', '1', '2', '3', '4' ] // result using "for i in arr"
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:05
@davisec52 for..in is used for looping over the properties of objects
@davisec52 when you use it on an array, it will loop over the indices of the array, which are 0, 1, 2, 3, 4 (as in arr[0] = 4, arr[3] = 6 etc), hence the result: it sorts the indices
@davisec52 the for..of loop is actually experimental and not widely supported (it's part of ES6) but it is/will be used for looping over the values of elements in an array
@davisec52 a better approach that will work everywhere today is either a simple for-loop ( var i, x; for ( i = 0, x = arr.length ; i < x ; i++ ) { // code } )
Evan Davis
@davisec52
Jan 31 2015 16:10
@wdgreg Thank you. I tried a for-loop but for whatever reason couldn't get a result.
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:10
@davisec52 or the native forEach method on arrays, now widely supported virtually everywhere ( arr.forEach(function(element){ //code }); )
Briana Swift
@brianamarie
Jan 31 2015 16:10
This code is returning the number of characters in the string, and I want it to return only the number of vowels in the string. Am I missing just a small bit of code or do I need to reformat this solution?
function VowelCount(str) { 
  var vowels = 0; 
  for (var i = 0; i <str.length; i++){
    if (str[i] = "a"||"e"||"i"||"o"||"u"||"A"||"E"||"I"||"O"||"U"){
      vowels ++
    };
  }

  return vowels;    
}
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:12
@davisec52 it's probably worth it to refactor your code to use either a for-loop or forEach because even though your code works, this is how you're 'supposed' to do it. if you run into problems, just post here and someone will get to you eventually :)
Cristián Berríos
@crisberrios
Jan 31 2015 16:12
try vowels++;
Evan Davis
@davisec52
Jan 31 2015 16:13
@wdgreg I didn't realize the for-of was non-standard.
Cristián Berríos
@crisberrios
Jan 31 2015 16:13
@brianamarie also, the if condition is wrong
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:14
@brianamarie also, this is easier with regex -- try /[aeiou]/i.test(str[i])
Evan Davis
@davisec52
Jan 31 2015 16:14
@wdgreg I think I remember reading that it was experimental. Coderbyte accepts it :)
Cristián Berríos
@crisberrios
Jan 31 2015 16:14
@brianamarie it should be == or ===
Briana Swift
@brianamarie
Jan 31 2015 16:14
ah! thank you guys!
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:14
@brianamarie oh yeah! watch out for putting = in an if statement! those are really hard to debug..
nice catch @crisberrios I always overlook that :)
Cristián Berríos
@crisberrios
Jan 31 2015 16:15
@brianamarie and it can evaluate only one condition, so it should be == "a" || str[i] == "b" and so on... better to refactor as wdgreg said or at least use a switch(str[i]) with cascading cases
Briana Swift
@brianamarie
Jan 31 2015 16:15
changed it to this, still having same issue of returning number of characters. hm...I know I could do it with regex but now I want to figure out what's wrong with this lol
function VowelCount(str) { 
  var vowels = 0; 
  for (var i = 0; i <str.length; i++){
    if (str[i] === "a"||"e"||"i"||"o"||"u"||"A"||"E"||"I"||"O"||"U"){
      vowels++
    };
  }

  return vowels;    
}
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:16
@davisec52 yep, it's probably accepted in modern versions of firefox and chrome, but better to wait until it's more commonly accepted. you can check MDN or caniuse.com
Briana Swift
@brianamarie
Jan 31 2015 16:16
ah gotcha!
Cristián Berríos
@crisberrios
Jan 31 2015 16:16
:thumbsup:
Evan Davis
@davisec52
Jan 31 2015 16:16
@wdgreg I will look at rewriting it with a for-loop or for-each. Thank you.
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:16
@brianamarie try if (str[i] === 'a' || str[i] === 'e' || .....etc)
Briana Swift
@brianamarie
Jan 31 2015 16:17
Yay! Thank you @wdgreg and @crisberrios!
:clap:
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:18
you could also do str[i].toLowerCase() === 'a' etc... that way you don't have to test for the upper case letters
Evan Davis
@davisec52
Jan 31 2015 16:29
@wdgreg Not quite sure how to order the arry by frequency of the element. Can't get beyond the indice list.

function mNm(arr) {
    var counter = [];
    var i, x; 
    for( i = 0, x = arr.length ; i < x ; i++ ) { 
        if(!counter[i]) {
            counter[i] = 0;
            }
            counter[i]++;
        }

    return Object.keys(counter).sort(function(a, b){return counter[a] < counter[b]});
}
mNm([4, 4, 4, 6, 2]);

=> [ '0', '1', '2', '3', '4' ]
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:33
@davisec52 the logic inside the for loop is a bit off and the problem is that you're checking whether counter[i] exists - if you think about this, you'll see it's never going to exist whatever your array is
@davisec52 what i would do here is create an empty object
Evan Davis
@davisec52
Jan 31 2015 16:34
@wdgreg Yep, I know at some point I've got to come to grips with logic.
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:34
@davisec52 then loop over the array and check if the item occurs in the object, if it doesn't, then add it and give it a counter of 1, and if it does, increment that counter by 1
Evan Davis
@davisec52
Jan 31 2015 16:34
@wdgreg {} as opposed to []?
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:34
Yep
Evan Davis
@davisec52
Jan 31 2015 16:34
though both are objects?
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:35
@davisec52 think about it this way, if you have an object { apple: 0, pear: 1 }
eh, and that object is called 'fruit' or whatever, then fruit.apple or fruit['apple'] is going to be 0
Evan Davis
@davisec52
Jan 31 2015 16:35
index and value
Cristián Berríos
@crisberrios
Jan 31 2015 16:36
@davisec52 any restrictions for the input? Like digits only, or single characters, etc.?
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:37
that gives you something to sort another array on that holds all your elements -- note that this is just one way to solve it, there might be better ways
@davisec52 and the return statement of your code is always going to return the indices in this case - to sort an array arr, just do arr.sort()
Evan Davis
@davisec52
Jan 31 2015 16:38
@crisberrios @wdgreg I'll try to work with your suggestion on using {}. I didn't realize that the difference could be significant.
@crisberrios No real resitrictions, though the problem calls for digits.
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:40
@davisec52 i'm suggesting the object because it allows you to store both the value and the frequency -- you could do it with an array too I guess but that would have to be an array of arrays and that would get complicated
Evan Davis
@davisec52
Jan 31 2015 16:41
@wdgreg That's something I didn't understand--that {} would store data differently, allowing both value and frequency.
Cristián Berríos
@crisberrios
Jan 31 2015 16:42
@davisec52 if you "KISS", and the input is only digits, then you can make an array of 10 slots [[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6].....[0,9]] and just increase the position corresponding to the digit and then sort based on frequency
of course, making it general for any character is better, but think of solving what's being asked
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:44
Yep, an object gives you the option to do { word : frequency , word2 : frequency } with just arrays you'd have to do [ [ word, frequency ], [ word, frequency ] ] because it wouldn't work with just one counter like in your original code (because you need a counter for every word)
Evan Davis
@davisec52
Jan 31 2015 16:44
@crisberrios My code sample using "for var i of arr" worked for arrays of letters as well as numbers.
@wdgreg I see what you mean about it becoming much for complicated.
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:47
@davisec52 can you post that for..of solution again? I'm not sure how it would work correctly with only one counter
Evan Davis
@davisec52
Jan 31 2015 16:47
@wdgreg moment . . .
@wdgreg

function order(arr) {
    var counter = [];
    for(var i of arr) {
        if(!counter[i]) {
            counter[i] = 0;
        }
        counter[i]++;
    }
    return  Object.keys(counter).sort(function(a, b){return counter[a] < counter[b]});
}
mNm([4, 4, 4, 6, 2]);
Cristián Berríos
@crisberrios
Jan 31 2015 16:49
@davisec52 instead of counter[i] you could use counter[arr[i]] and store array values instead of index
@davisec52 and instead of [] use {} as suggested before
Evan Davis
@davisec52
Jan 31 2015 16:50
@wdgreg @crisberrios Oops, the function name "order' is different than the function call "mNm"
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:51
@davisec52 ohh I see
@davisec52 you're actually using the array as an object there because in javascript arrays are in fact objects
@davisec52 that's why it works. like, if you do var arr = [] and then do arr['apple'] = 1 , you can then get arr.apple = 1, but if you do a console.log(arr) you'll see the array looks empty
Evan Davis
@davisec52
Jan 31 2015 16:54
@wdgreg yes. I do a lot with trial and error. I don't always understand the results. I work on that as I go.
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:54
actually it won't look empty, it'll tell you that apple is in there, but it will look kind of like an object
Evan Davis
@davisec52
Jan 31 2015 16:54

function order(arr) {
    var counter = {};
    for(var i of arr) {
        if(!counter[arr[i]]) {
            counter[arr[i]] = 0;
        }
        counter[arr[i]]++;
    }
    return  Object.keys(counter).sort(function(a, b){return counter[a] < counter[b]});
}
order([4, 4, 4, 6, 2]);

=> [ '2', '4', '6', 'undefined' ]
Gregory Scheerlinck
@greg-js
Jan 31 2015 16:58
Well there are still a few kinks in your code. first thing is you should change the for..of into a regular for. secondly, you shouldn't use object.keys there
Banun Idris
@mininsomniac
Jan 31 2015 16:59
hey everyone
Evan Davis
@davisec52
Jan 31 2015 17:03
@wdgreg Not sure how else to get the result, otherwise.
Gregory Scheerlinck
@greg-js
Jan 31 2015 17:05
@davisec52 well lemme take a look at the coderbyte myself, which one is it?
Evan Davis
@davisec52
Jan 31 2015 17:06
@wdgreg Easy challenge MeanMode
@wdgreg I've actually got a working solution using my frankencode.
frankencode construction.
Gregory Scheerlinck
@greg-js
Jan 31 2015 17:08
Oh right I thought that one was pretty tough too, it's for finding the mode right? lemme check how I approached it
and hey, your code worked, it's just that you didn't quite do it the way you're supposed to :)
Evan Davis
@davisec52
Jan 31 2015 17:09
@wdgreg I hope to come to understanding
@wdgreg but I am at the very beginning stages of figuring out js
Gregory Scheerlinck
@greg-js
Jan 31 2015 17:10
right okay, well, what I did was this: I kept an array for holding all unique numbers and another one for frequency (you could also use an object and combine these two as discussed earlier)
you don't actually have to sort the array, you just need to find the element with the highest frequency, so I kept another variable 'highest' and initialized it with value -1 (because that's what you return if there isn't one)
with that maybe you can figure out a good solution? loop over the array, check if it occurs in your array of unique elements, if not then push it in and adjust the frequency
Evan Davis
@davisec52
Jan 31 2015 17:12
@wdgreg Here is the full solution I came up with.

function mNm(arr) {

    var total = arr.reduce(function(a, b){return a+b});
    var mean = total / arr.length;
    console.log(mean);
    var freq = order(arr);
    var mode = freq[0];

    if(mean == mode) {
        return 1;
    }
    else
    {
     return 0;
 }  

}

function order(arr) {
    var counter = [];
    for(var i of arr) {
        if(!counter[i]) {
            counter[i] = 0;
        }
        counter[i]++;
    }
    return  Object.keys(counter).sort(function(a, b){return counter[a] < counter[b]});
}
mNm([4, 4, 4, 6, 2]);
Although, I think your's is much more elegant.
@wdgreg I'll see if I can work with your description and come up with something less clunky.
Gregory Scheerlinck
@greg-js
Jan 31 2015 17:13
yep and don't worry, you'll learn the differences between the loop approaches soon
I have to run though, but if you want to check out my solution later, here's the link
Evan Davis
@davisec52
Jan 31 2015 17:14
@wdgreg Many thanks! I hate to do this, but I've got to sign off as well. Thank you for the link!
Gregory Scheerlinck
@greg-js
Jan 31 2015 17:15
@davisec52 and if you're wondering, i didn't solve it in 1 minute, I just made an edit afterwards
and i'm not claiming mine is the best solution, it's just one of many possible approaches, and again, yours worked too :) anyway good luck and talk to you later :)
Evan Davis
@davisec52
Jan 31 2015 17:18
@wdgreg gotcha. I've spent hours upon hours on some of the challenges.
Gregory Scheerlinck
@greg-js
Jan 31 2015 17:18
@davisec52 no worries, one in particular had me stumped for days and prompted me to go take a class on algorithms ;-)
But i'm off, good luck and keep on coding :)
Banun Idris
@mininsomniac
Jan 31 2015 17:22
hey @wdgreg whenever you have he time I'd love to know what class on algorithms you took if it was online!
Gregory Scheerlinck
@greg-js
Jan 31 2015 17:23
@mininsomniac ha you caught me just in time! it's the one on coursera taught by Tim Roughgarden
@mininsomniac it's much gentler than the other one on coursera which is better but way more difficult. but the soft deadline for the first homework is monday so be quick if you want to join!
Nathan
@terakilobyte
Jan 31 2015 17:24
cs50 is a great class to learn algorithmic thinking
on edx
Banun Idris
@mininsomniac
Jan 31 2015 17:25
I just started cs50 in an attempt to do exactly that! thanks you guys, that's super helpful
ive been convinced im just lost or on the wrong track
thanks @terakilobyte and @wdgreg
im off to learn