Topic Wiki

Training
Codecademy.com offers hand on courses for  various coding languages including HTML, JavaScript, CSS, and more. FREE
TreeHouse.com 8)
w3schools.com
regex

Resources
Browser compatibility
Can i use

To test/show-of your skills
html - css - js
http://codepen.io/pen/
http://jsfiddle.net/

My sql
www.sqlfiddle.com

Editor
notepad-plus-plus.org/

android development
http://developer.android.com/sdk/index.html

js librery
http://greensock.com/ nice animation
getbootstrap.com/css/ responsive layout
jquery.com do more write less

Free Books
http://it-ebooks.info/

Test client browser version
http://browser-update.org/
« Last edited by yesitsme on May 17, 2015, 11:13:37 AM »

Author Topic: Programming for Beginners  (Read 106987 times)

Offline Aerial Dag

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Jun 2013
  • Posts: 1046
  • Total likes: 78
  • DansDeals.com Hat Tips 7
    • View Profile
  • Location: MS Desert
Re: Programming for Beginners
« Reply #360 on: July 28, 2016, 01:23:36 PM »
Thanks.

Flatiron's Learn-Verified.

Did you do their online course or on campus? I know python basics (I too used DDMS for a project. A few years ago I built a python script to text me when DDMS had certain keywords like 'mistake' etc) but want to learn RoR to better understand my company's website. Would you recommend Flatiron?

Offline etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Re: Programming for Beginners
« Reply #361 on: August 01, 2016, 06:48:28 PM »
Anyone know how to set up keyboard shortcuts with Javascript? I need some help with a tampermonkey script.

TIA!
Workflowy. You won't know what you're missing until you try it.

Offline AnonymousUser

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Feb 2013
  • Posts: 3001
  • Total likes: 13
  • DansDeals.com Hat Tips 0
    • View Profile
Re: Programming for Beginners
« Reply #362 on: September 13, 2016, 04:21:12 PM »
Does anyone have experience with Node and Express?

Offline BAHayman

  • Administrator
  • Dansdeals Lifetime Platinum Elite
  • **********
  • Join Date: Mar 2010
  • Posts: 1939
  • Total likes: 28
  • DansDeals.com Hat Tips 0
    • View Profile
Re: Programming for Beginners
« Reply #363 on: September 13, 2016, 06:24:59 PM »
Does anyone have experience with Node and Express?
I've worked with both. Have a question?

Offline bubbles

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Jul 2011
  • Posts: 5060
  • Total likes: 20
  • DansDeals.com Hat Tips 67
    • View Profile
Re: Programming for Beginners
« Reply #364 on: September 13, 2016, 06:39:17 PM »
Anyone know how to set up keyboard shortcuts with Javascript? I need some help with a tampermonkey script.

TIA!
still need? I set some up. I can send it over when I get to a computer if needed

Offline etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Re: Programming for Beginners
« Reply #365 on: September 13, 2016, 06:46:19 PM »
still need? I set some up. I can send it over when I get to a computer if needed
Still needed, thanks! Looking forward to seeing your sample
Workflowy. You won't know what you're missing until you try it.

Offline AnonymousUser

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Feb 2013
  • Posts: 3001
  • Total likes: 13
  • DansDeals.com Hat Tips 0
    • View Profile
Re: Programming for Beginners
« Reply #366 on: September 13, 2016, 06:58:30 PM »


Have a question?
A bunch.
Can I contact you through some sort of IM, like Whatsapp, Hangouts, etc.?

Offline yesitsme

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2014
  • Posts: 5020
  • Total likes: 2237
  • DansDeals.com Hat Tips 4
  • Gender: Male
    • View Profile
Re: Programming for Beginners
« Reply #367 on: September 13, 2016, 11:16:11 PM »
Anyone know how to set up keyboard shortcuts with Javascript? I need some help with a tampermonkey script.

TIA!
Your post caused me to create this topic http://meta.stackoverflow.com/q/334494/4535386
["-"]

Offline etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Re: Programming for Beginners
« Reply #368 on: September 14, 2016, 10:21:36 AM »
Workflowy. You won't know what you're missing until you try it.

Offline JoeyShmoe

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Nov 2014
  • Posts: 1276
  • Total likes: 254
  • DansDeals.com Hat Tips 0
  • Gender: Male
    • View Profile
  • Location: Lakewood
Re: Programming for Beginners
« Reply #369 on: September 14, 2016, 11:02:40 AM »
I don't get it
Look at the end of the of the post, @yesitsme tried to search for tampermonkey and the result was blank instead of some info about it.
DDF A-Z Link Extension
Chrome
Firefox
Info

Offline etech0

  • Dansdeals Lifetime 10K Presidential Platinum Elite
  • *******
  • Join Date: Dec 2013
  • Posts: 12861
  • Total likes: 3316
  • DansDeals.com Hat Tips 1
    • View Profile
  • Location: not lakewood
  • Programs: DDF
Re: Programming for Beginners
« Reply #370 on: September 14, 2016, 12:30:17 PM »
Look at the end of the of the post, @yesitsme tried to search for tampermonkey and the result was blank instead of some info about it.
oh :)
Workflowy. You won't know what you're missing until you try it.

Offline Cholentfresser

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Mar 2009
  • Posts: 1920
  • Total likes: 50
  • DansDeals.com Hat Tips 1
    • View Profile
Re: Programming for Beginners
« Reply #371 on: September 14, 2016, 02:58:51 PM »
A bunch.
Can I contact you through some sort of IM, like Whatsapp, Hangouts, etc.?

Any reason you don't post it here so others can chime in as well?
In order to understand recursion, you first need to understand recursion.

Offline AnonymousUser

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Feb 2013
  • Posts: 3001
  • Total likes: 13
  • DansDeals.com Hat Tips 0
    • View Profile
Re: Programming for Beginners
« Reply #372 on: September 14, 2016, 09:12:15 PM »
Any reason you don't post it here so others can chime in as well?
It wasn't just one question, I needed to be able to have a back and forth conversation with someone, and a forum isn't the best platform for that.
However, I'll summarize it in case anyone is interested, or has any other suggestions.

I was trying to make my Node / Express REST API server as modular as possible and follow MVC, so I split it into a bunch of files:
server.js
db.js
routes.js
controllers/controllers.js
models/models.js

I needed to get a reference to the DB connection in models.js in order to query the database. However, since models.js is in a separate folder, using
Code: [Select]
require('./db') wouldn't necessarily return the same instance that was originally instantiated.

After some Googling, it looked like there were 2 options:
1. Dependency Injection (DI), which meant passing a reference to either the connection, or something containing it as a parameter to models.js. However, this was  a bit clunky, since I had to refactor all the modules into functions, and the connection had to be passed along db.js -> server.js -> routes.js -> controllers.js -> models.js.
2. Global variables or singletons, which are discouraged.

After some back and forth, @BAHayman suggested storing a reference to the connection in app.locals, and then the HTTP method calls in controllers.js have access to that through req.app. Then I just passed it to the individual methods in models.js as a parameter.. Not as clean as I had hoped for, but it seems like the best method given the situation.

Offline Cholentfresser

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Mar 2009
  • Posts: 1920
  • Total likes: 50
  • DansDeals.com Hat Tips 1
    • View Profile
Re: Programming for Beginners
« Reply #373 on: September 14, 2016, 09:29:03 PM »
You sure "require" doesn't give you the same instance? I was under the impression that it does.
In order to understand recursion, you first need to understand recursion.

Offline AnonymousUser

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Feb 2013
  • Posts: 3001
  • Total likes: 13
  • DansDeals.com Hat Tips 0
    • View Profile
Re: Programming for Beginners
« Reply #374 on: September 14, 2016, 11:24:42 PM »
You sure "require" doesn't give you the same instance? I was under the impression that it does.
You are correct if the 2 modules that instantiate it are in the same folder. If not, they could return different instances.

https://stackoverflow.com/questions/10306185/nodejs-best-way-to-pass-common-variables-into-separate-modules#comment49587993_10316422

Offline Cholentfresser

  • Dansdeals Lifetime Platinum Elite
  • *******
  • Join Date: Mar 2009
  • Posts: 1920
  • Total likes: 50
  • DansDeals.com Hat Tips 1
    • View Profile
Re: Programming for Beginners
« Reply #375 on: September 14, 2016, 11:48:53 PM »
You are correct if the 2 modules that instantiate it are in the same folder. If not, they could return different instances.

https://stackoverflow.com/questions/10306185/nodejs-best-way-to-pass-common-variables-into-separate-modules#comment49587993_10316422
I hear ya. FWIW, I think the DI option seems pretty clean.
In order to understand recursion, you first need to understand recursion.

Offline AnonymousUser

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Feb 2013
  • Posts: 3001
  • Total likes: 13
  • DansDeals.com Hat Tips 0
    • View Profile
Re: Programming for Beginners
« Reply #376 on: September 15, 2016, 03:20:06 PM »
Is there any reason to render views client-side with frameworks like Angular or Backbone, as opposed to doing everything on the server?

Offline yesitsme

  • Dansdeals Lifetime Presidential Platinum Elite
  • *********
  • Join Date: Dec 2014
  • Posts: 5020
  • Total likes: 2237
  • DansDeals.com Hat Tips 4
  • Gender: Male
    • View Profile
Re: Programming for Beginners
« Reply #377 on: September 20, 2016, 12:44:09 AM »
Where's php 6, windows 9, IPV5?
they all went into hiding..
["-"]

Offline AnonymousUser

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Feb 2013
  • Posts: 3001
  • Total likes: 13
  • DansDeals.com Hat Tips 0
    • View Profile
Re: Programming for Beginners
« Reply #378 on: September 20, 2016, 11:08:27 PM »
I'm having issues setting up Express routers.

Code: [Select]
//this works
router.route('/deals/:id')
    .get(function (req, res) {
            res.send("/deals/" + req.params.id);
        });
    });

//this doesn't work
router.route('/deals/')
    .get(':id', function (req, res) {
            res.send("/deals/" + req.params.id);
        });
    });

With the second way, Express throws an error
Code: [Select]
Error: Route.get() requires callback functions but got a [object String]The docs (http://expressjs.com/en/4x/api.html#router.METHOD) say that the parameters for router.METHOD() are (path, [callback, ...] callback). However, from this error it looks like path doesn't belong there.
Unless router.route().METHOD() is different than router.METHOD()?
Am I missing something?

Offline AnonymousUser

  • Dansdeals Presidential Platinum Elite
  • ********
  • Join Date: Feb 2013
  • Posts: 3001
  • Total likes: 13
  • DansDeals.com Hat Tips 0
    • View Profile
Re: Programming for Beginners
« Reply #379 on: September 21, 2016, 01:05:56 AM »
I'm having issues setting up Express routers.

Code: [Select]
//this works
router.route('/deals/:id')
    .get(function (req, res) {
            res.send("/deals/" + req.params.id);
        });
    });

//this doesn't work
router.route('/deals/')
    .get(':id', function (req, res) {
            res.send("/deals/" + req.params.id);
        });
    });

With the second way, Express throws an error
Code: [Select]
Error: Route.get() requires callback functions but got a [object String]The docs (http://expressjs.com/en/4x/api.html#router.METHOD) say that the parameters for router.METHOD() are (path, [callback, ...] callback). However, from this error it looks like path doesn't belong there.
Unless router.route().METHOD() is different than router.METHOD()?
Am I missing something?
Apparently it looks like router.route().METHOD() is indeed different than router.METHOD(), and it does not take a path as a parameter, just callbacks.
https://github.com/expressjs/express/blob/master/lib/router/route.js#L186