• Breaking News

    Wednesday, August 22, 2018

    Learn how to "learn" Python (or any programming language) learn programming

    Learn how to "learn" Python (or any programming language) learn programming


    Learn how to "learn" Python (or any programming language)

    Posted: 21 Aug 2018 10:32 AM PDT

    Hi folks, I have some original-content for you where I talk about how to learn a programming language. For context, I am an ex-Google Tech Lead / full-stack engineer who has learned probably 10+ languages in my lifetime. I specifically about Python here, but the methodology can be applied to any language really. The short of it is to follow a methodology in which you steer away from short-form tutorials/videos/books, and instead follow the official guides. There are a number of reasons behind this, but the main one is that the continuity of work helps you maintain forward progress -- I find that tutorials & articles always assume you have zero basic knowledge and go from there, and that the middle/advanced material then becomes extremely sparse with tons of "knowledge-gaps" making it difficult to achieve confidence. There are a number of other tips I share, so please have a look and let me know your thoughts / feedback! Good luck!

    https://www.youtube.com/watch?v=5mJ_Qftw2_0&lc=UgyghnrmfblNHEhpqR54AaABAg

    submitted by /u/patrickshyu
    [link] [comments]

    Free Live-Streamed SQL Class

    Posted: 21 Aug 2018 05:38 PM PDT

    If you are keen to learn SQL, you may find this live-streamed class happening next Sunday at 5:30pm EST/ 2:30pm PST useful:

    https://letslearn.corsizio.com/c/5b68917d20deaecfd821d854

    It is hosted by a programmer called GPal who runs live programming classes weekly. Here's a library of previous content https://www.youtube.com/channel/UCTi-WYGi8UHheU2MfVSvqLg

    I attended a few of his classes over the past few weeks and I like the pace and discipline the classes provide. Wanted to share in case others are keen to pick up SQL. Best of Luck!

    submitted by /u/StarFishMd
    [link] [comments]

    C++ projects exercises

    Posted: 21 Aug 2018 03:59 AM PDT

    I'm looking for websites that provide exercises which ask the user to create projects in C++. The only website I've been using so far is LeetCode but I mostly use it for algorithm design exercises only.

    I started trying to come up with personal ideas, like developing classes to coordinate a parking lot but I always feel like I'm making easy things when what I want is to actually spend some time thinking how to build things up.

    Additionally, if these exercises also gave me some restrictions (ie: you have to use this or that pattern, you have to use hash tables, you can't use arrays etc), that would be great. I want to get out of my comfort zone.

    Thanks!

    submitted by /u/kn0bbulo
    [link] [comments]

    Where should null pointer checks be placed?

    Posted: 21 Aug 2018 08:59 PM PDT

    Assume we have two functions and a pointer. These two functions will call this one pointer. There is another third function that calls these two functions. Where should the null pointer checks be placed?

    void A() { // do something with pointer _p } void B() { // do something with pointer _p } void C() { A(); B(); } 

    Should a check be placed in function C before calling functions A and B, in the beginning of both functions A and B, or both? Placing it in function C will reduce the number of checks (albeit minimal), however it could also depend whether or not functions A and/or B are used outside of function C.

    If a pointer is used anywhere, should it be required to place a check before using the pointer even if there is already a null pointer check placed beforehand?

    submitted by /u/Eurim
    [link] [comments]

    This is dumb, but as someone who started to learn programming today I don't know what is wrong here

    Posted: 21 Aug 2018 09:50 PM PDT

    So, I just read my first pages on programming with JavaScript and did some stuff that are stupid but for me were pretty cool and satisfying, then I came up with the idea of a dice and tried to display the numbers on the browser (I know it's stupid) but after reading a bit on the "Math" tab, I gave it a try and now I can't figure out what's wrong. I need some help to learn from my mistake. This is how it's looking so far:

    var dice = (Math.random() *6);
    var round = Math.round(dice);

    if(round >= 1){
    document.write(round);
    }else{
    document.write("1");
    }

    I have the if/else thing because I didn't want to have 0 as a result. I'm either getting a blank page or 1 as a result when refreshing the page. If there's any way I can fix this or other ways I can do it let me know. Thank you in advance!

    And btw, I looked "dice on JavaScript" up and all I saw was too complicated and fancy for me to understand yet.

    submitted by /u/charck2
    [link] [comments]

    Forgive me for being newbie but if you are learning HTML what is the process for just starting to make your own webpage and to keep it up on the internet for testing?

    Posted: 21 Aug 2018 08:51 PM PDT

    My topic pretty much covers it. Thanks for any help

    submitted by /u/TyraelTrion
    [link] [comments]

    Do any programmers here take antidepressants?

    Posted: 21 Aug 2018 08:35 PM PDT

    How does taking them effect you?

    Is there any "brain fog" when you take them?

    How well does it help when learning something new?

    I feel like I'm about to go talk to a psychiatrist soon because the way I feel lately, zero motivation, overwhelming sense of dread, anxiety, crappy memory, are all hindering my ability to be an effective programmer. Especially the motivation aspect.

    submitted by /u/braido87
    [link] [comments]

    for loop

    Posted: 21 Aug 2018 08:12 PM PDT

    Hi Everyone , i am doing a program on lehman's primality test . now i am using a for loop to test on all numbers before my chosen number whether it will have a gcd of 1, if yes it prime. but i have a problem . for some numbers like 27 it is not a prime. so my test will not be as accurate cos from numbers 2-26 some gcd are 1 some are not.

    how do i do a loop wherein i still tests numbers 2-26 but if one of them doesnt have a gcd 1 i will print out not prime . but i only want to print it out ones. is that possible ? im using c++

    submitted by /u/paulpv278
    [link] [comments]

    Is a class of "INTRO TO COMPUTER/INFOR SCIENCE" worth taking?

    Posted: 21 Aug 2018 11:31 PM PDT

    Can someone give a summary of the class? I think I'm' tech-savvy, but don't know much about programming.

    Is it worth taking the class or straight to programming language class that my community college offers?

    submitted by /u/Wow_Space
    [link] [comments]

    React Google Maps Rendering Weird

    Posted: 21 Aug 2018 11:30 PM PDT

    SCREENSHOT:
    https://imgur.com/a/9ciahCT

    Does anyone have any idea why my Google maps looks like this no matter what npm package I use?

    I believe I have the API in the script in index.html.

    The only error I get currently is this:

    Uncaught Ob {message: "initMap is not a function", name: "InvalidValueError", stack: "Error↵ at new Ob (https://maps.googleapis.com/m…eCOcPZk3_fTr6mc_NnG1L96u4&callback=initMap:164:56"}

    I cant seem to think of why... Thank you for your time!

    submitted by /u/NewbiusCoder
    [link] [comments]

    Java book recommendation

    Posted: 21 Aug 2018 11:29 PM PDT

    I've tried a few java books but all of them remind me of my boring math books from high school. They explain the syntax but not how to implement it. I am looking for something with a lot of interesting examples and projects

    submitted by /u/rikitard
    [link] [comments]

    Learning by DOING?

    Posted: 21 Aug 2018 05:16 PM PDT

    So ive worked with HTML and CSS for two weeks now through normal courses. I get tired of regurgatating the code on these courses. So i decided i wanna just tackle each FCC project and any issues i come across too google and/or ask for help. Ive always heard the best way to actually learn code is by actually coding and facing the real world problems you face.

    Thoughts? Advice?

    submitted by /u/steviethe1st
    [link] [comments]

    Do you guys have any resources for learning programming that would benefit a more visual learner?

    Posted: 21 Aug 2018 10:57 PM PDT

    Just like the title says. I learn a lot more when I can visualize what I'm programming moreso than just seeing text on a screen. I know inevitably that's what the job is, but do any of you know of more visual sources to help me conceptualize what I'm dealing with?

    I've tried googling this, I get a lot of Visual Basic and Visual Studio stuff. I don't want to learn Visual Basic lol

    submitted by /u/ManInBlack829
    [link] [comments]

    Why preorder traversal is not enough to check if a tree is subtree of binary tree?

    Posted: 21 Aug 2018 10:57 PM PDT

    I'm doing preorder traversal to build a string representation of a tree and then checking if it is a substring of string representation of a binary tree.

    While I'm doing so, what scenarios I can miss?

    What happens if I have non-unique values in my tree?

    submitted by /u/ryancyrus
    [link] [comments]

    Invitation to a community to get you started in programming or get better at it (C#)

    Posted: 21 Aug 2018 10:52 PM PDT

    Hello everyone! Have you ever tried to learn programming and dropped it because it seemed too hard? Maybe you don't even know what to begin with, feeling intimidated by myths that you need to be gifted to even start learning it? Maybe you just want to learn clean code? Maybe you want to learn or get better at C#? If you are any of the following, I would like to invite you to join our community- C# Beginner's Inn! Our Discord: https://discord.gg/vWE4Pc9 There you will find lesson material written by me about C# basics, Object Oriented programming principles. There I offer weekly live coding lessons on Discord, 1 for people who haven't programmed at all and 1 for people who have some experience. Lessons are being recorded, code posted on history channel. If you have any programming questions, me and some other experienced programmers are there to answer daily. Our community is from all over the world, but prime time is 9PM EEST.

    Last but not least--everything is free!

    A little bit about myself: I am a C# dev, who has bachelors degree in Software Systems and 2 years of professional experience. I am 24, from Lithuania. My real name is Almantas but I prefer being called Kaisinel.

    submitted by /u/Kaisinell
    [link] [comments]

    I'm a Beginner/Intermediate Swift Developer seeking more experienced/professional Swift Developer for occasional help/suggestions/and input about the language & xCode.

    Posted: 21 Aug 2018 10:34 PM PDT

    I have no formal back in Computer Science but I understand the basics and logic of Swift. I've published three apps, worked on several more, yet feel as though my progression has plateaued a bit recently. Therefore, I'm looking for a willing individual help me along my own Apple programming path in their free time, mainly with OOP and Swift concepts.. I'm not looking to take over your life and all your free time, but if you're already working on code yourself and need an "easier" breather, the circumstances would work out best for both of us. Feel free to message me directly or provide suggestions on how to find a mentor!

    Thanks!

    submitted by /u/GD0x
    [link] [comments]

    What to learn for native GUI ?

    Posted: 21 Aug 2018 10:20 PM PDT

    Trying to make something with Electron.js or NW.js feels gross, I want to learn a language with decent native gui binding or libraries to build fast and native looking GUI. I need some language/library that is mostly cross platform for desktop (linux, mac and windows). What should I learn ?

    [ Also: I heard about Qt, but I hear it's pain to work with, results often becomes ugly -- both in code and gui, is it true ? ]

    submitted by /u/-___I---I-___
    [link] [comments]

    Is using "headfirst php&MySQL" with bitnami WAMP stack a good idea?

    Posted: 21 Aug 2018 10:20 PM PDT

    i am trying to create a web appication and i have learned html and css with the help of headfirst book but i am finding it difficult to learn php and MySQL with headfirst book.I am using Bitnami WAMP stack and the instructions and outcome shown in the book doesnot match with layout and instruction in the WAMP stack and it is make me more confused. i am turning toward reddit to help me out ,should i be using another server service or is the instruction in the book are outdated ?

    submitted by /u/enormousgiganticDICK
    [link] [comments]

    (Help) Cracking the Coding Interview Big O, Example 3 Explanation

    Posted: 21 Aug 2018 10:13 PM PDT

    (Edit: will remove the imgur link next time I have access to a machine to properly format the code , sorry about that, originally from here: https://amp.reddit.com/r/learnprogramming/comments/7nxyhn/im_reading_cracking_the_coding_interviewwhy_is/)

    I'm really embarrassed to admit that I've spent two hours on this & tried many times at the whiteboard to figure it out but I'm completely stuck.

    If you have an understanding of this stuff where it's clear/intuitive in your head I bow down to you— I'd much prefer to hand wave this away & pretend I "get it" to avoid embarrassment but of course I definitely want to "get it" before proceeding further since I know making progress comes from understanding/mastering the basics.

    In the BigO practice/warmup section (6th edition) MacDowell's Example 3 asks us to determine the runtime of "printUnorderedPairs" whose code looks like this:

    http://imgur.com/UFv0A6A

    (Ingests an array & there's an outer loop & inner loop but the twist is that the inner loop starts with int j=i+1)

    Question: MacDowell has an explanation I don't understand that it's O(n2) but my analysis says O(n) can someone please show me where my understanding is going wrong?

    My faulty analysis: I think it's O(N) because stepping through the code with the following sample input: printUnorderedPairs([1,2,3])

    The outer loop (i=0) Inner loop (j=i+1 = 0+1 == 1) Prints arr[0] & arr[1] or (1,2)

    Continuing...j++ i=0, j=2; prints arr[0] & arr[2] or (1,3)

    J now is 3 which is NOT less than array length so the inner loop doesn't proceed

    We increment i to 1 & j=i+1==2

    i=1, j=2; prints arr[1] & arr[2] or (2,3)

    j++ & J then equals 3 which is not LESS than array length so the inner loop doesn't proceed

    i=2,j=2+1=3, 3 is not LESS than array length so the inner loop doesn't proceed

    In other words, the only printing I see for array input of [1,2,3] is: (1,2) (1,3) (2,3)

    I see only 3 operations there. I'm finding just three operations which here equals the number/length of elements in this input array & my erroneous conclusion is that this accordingly takes O(n) work.

    MacDowell discusses a bunch of stuff involving summing stuffs with N-1 + N-2 ++...2+1 which converges to the sum of 1...n-1 which becomes N(N-1)/2 which becomes O(n2). I don't follow the reasoning there at all.

    She then says to look at what the code is doing (which is how I approached it) & says that there are n2 pairs & that "roughly half of those will have i<j & the remaining half will have i>j. This goes through roughly n2/2 pairs so it does O(n2) work."

    I didn't follow her second explanation either

    Does anyone have any advice/tips where I'm going off the rails?

    Thanks for your time & for any insights!

    Embarrassed

    submitted by /u/confused20182019
    [link] [comments]

    Trying to do the 'Angular Tour of Heroes' but I do not understand how I open the actual source code to go through the tutorial step-by-step

    Posted: 21 Aug 2018 09:20 PM PDT

    I've downloaded the angular cli, started a new project, and served and rendered the first page of the app, but idk how to access the source files to follow along and do the tutorial. There are no fucking directions anywhere on how to do this. I want to throw my computer out the window.

    Here's the url to the page: https://angular.io/tutorial/toh-pt0#angular-components.

    submitted by /u/Nwpjnfvttekbskcosbwv
    [link] [comments]

    [JAVA/ECLIPSE PHOTON R] Hotel Occupancy Calculation - Termination Problem

    Posted: 21 Aug 2018 09:14 PM PDT

    Hi all -

    I am currently doing a small project, the question asks me to write a piece of code that calculates the occupancy rate based off of inputs of the user. Basically the question is:

    Write a program that calculates the occupancy rate for each floor of a hotel. The program should start by asking for the number of floors in the hotel. A loop should then iterate once for each floor. During each iteration, the loop should ask the user for the number of rooms on the floor and the number of them that are occupied. After all the iterations, the program should display the number of rooms the hotel has, the number of them that are occupied, the number that are vacant, and the occupancy rate for the hotel. Do not accept a value less than one for the number of floors. Do not accept a number less than 10 for the number of rooms on a floor.

    I have it all functioning, except I have a problem with the initial run. If I execute the code and enter a number above zero, the program terminates. However, if I enter a zero as my initial value, it returns the error message as it is supposed to, then it continues on with the program as normal. I get the functionality I was after in the end, I just am not sure what is preventing it from functioning if the first value entered is above Zero - anybody know how to fix this problem.

    My code is below:

    import java.util.Scanner;

    public class HotelOccupancy\16705483 {)

    public static void main(String\] args) {)

     ^(int floor, rooms, occupiedRooms, totalRooms = 0, totalOccupiedRooms = 0;) ^(double occupancyRate;) ^(Scanner in = new Scanner()[^(System.in)](https://System.in)^();) ^(System.out.println("Enter the number of floors:");) ^(floor = in.nextInt();) ^(while (floor < 1) {) ^(System.out.println("The number of floors must be at least 1 or above.");) ^(System.out.println("Enter the number of floors:");) ^(floor = in.nextInt();) ^({) ^(for (int count = 1; count<= floor; count++) {) ^(System.out.println("Enter the number of rooms in a floor " +count+ ":");) ^(rooms = in.nextInt();) ^(while (rooms < 10) {) 

    System.out.println("The number of rooms must be at least 10 or above.";)

    System.out.println("Enter the number of rooms in a floor " +count+ ":";)

    rooms = in.nextInt(;)

     ^(}) ^(System.out.println("Enter the number of occupied rooms in a floor " +count+ ":");) ^(occupiedRooms = in.nextInt();) ^(totalRooms = totalRooms + rooms;) ^(totalOccupiedRooms = totalOccupiedRooms + occupiedRooms;) ^(}) ^(System.out.println("Total number of rooms = "+totalRooms);) ^(System.out.println("Total number of occupied rooms = "+totalOccupiedRooms);) ^(System.out.println("Total number of vacant rooms = " +(totalRooms - totalOccupiedRooms));) ^(System.out.println("Total rate of occupancy = "+((double)totalOccupiedRooms/totalRooms));) ^(}) ^(}) 

    }

    }

    Any and all advice is welcome, thanks in advance :)

    submitted by /u/lebootaku
    [link] [comments]

    How to handle loading and unloading of javascript in a single page app

    Posted: 21 Aug 2018 09:09 PM PDT

    I have a single page app.

    Almost every view i load has custom Javascript/Jquery and I load it by doing the following:

     $(document).ready(function(){ $.getScript('/assets/js/sales/estimate-handler.js'); }); 

    This works great.

    What I am worried about is the variables that are set in one view remain in the (?stack/heap?) indefinitely.

    1. couldn't this be a cause of poor performance as more and more variables are set and stored?
    2. This could cause a conflict or improper values

    So how can I manage this or discard all objects associated with a certain view once a new view is loaded?

    submitted by /u/swiftpants
    [link] [comments]

    What is a good IP camera for embedding in a webpage?

    Posted: 21 Aug 2018 08:51 PM PDT

    I am working on a personal project with Philips Hue bulbs and want people to be able to control bulbs in my house from a webpage. I have this part working. The next step is to be able to show people that their actions on the webpage actually affected my bulbs. I'm looking for an inexpensive webcam that has a built in webserver so I can embed the feed into my website. The quality doesn't have to be amazing, I'd even take 480p.

    I have a Samsung Smartcam that I use for a security camera, but Samsung patched out the local webserver in favor of their cloud offering.

    If anyone has experience in this area, I'd be really grateful. I'm even okay with buying some sketchy camera from AliExpress if it will work.

    submitted by /u/WeededDragon1
    [link] [comments]

    How do I stop giving up?

    Posted: 21 Aug 2018 08:21 PM PDT

    Hey guys,

    I'm thinking about getting into coding again, for the second time. I initially started with python, but I felt as if I wasn't learning much, so I switched to front end web developing. I was going into javascript, but I stopped halfway. The burnout got to me and I felt like my codes were shit and unorganized. I want to get back into programming, primarily focusing on website / app development. Any tips on how to stay on track, or just general programming advice? Thanks in advance for anyone who replies.

    submitted by /u/ManofNorth
    [link] [comments]

    Do I need to change my mindset? (details inside)

    Posted: 21 Aug 2018 08:07 PM PDT

    To set some context, I'm currently a hobbyist developer and I don't have a specific type of app that I want to make. I'm interested in most platforms, and I end up bouncing between language to language trying to make different things like mobile apps, games, and web apps. I'm already learning web development at a course, and I plan to use that for my career, so I'm free to just build anything that I find fun to build.

    Recently I decided I want to focus on Python, because I was tired of jumping between languages and not finishing anything. Python is my favorite language, and personally I can't develop in other languages because I don't find them fun. But now I think I'm falling into the trap where I only ever use one language and refuse to use other languages.

    Since I'm only making apps for fun, does this matter? I still want to use Javascript for web development if that will advance my career, but I can't force myself to touch C#, Java, C++, Swift, etc. On top of that, most of the projects I want to make can be built in Python, meaning web apps (Flask), 2D games (Pygame), 3D games (Panda3D), mobile apps (Kivy), and desktop apps (Tkinter).

    Is this still a good mindset, or should I make a better effort to learn other languages?

    submitted by /u/MakorenWasTaken
    [link] [comments]

    No comments:

    Post a Comment