• Breaking News

    Wednesday, July 25, 2018

    If this is a dumb or common question I'll remove it - Am I actually learning or am I just copying stuff down? learn programming

    If this is a dumb or common question I'll remove it - Am I actually learning or am I just copying stuff down? learn programming


    If this is a dumb or common question I'll remove it - Am I actually learning or am I just copying stuff down?

    Posted: 25 Jul 2018 06:37 PM PDT

    I recently began coding and I'm enjoying it quite a bit. I enjoy the feeling when things just sort of click "Oh, that makes sense!" and that sort of thing.

    The thing that worries me is this question: Am I actually learning to code or am I just copying stuff down I see? I feel like I need some way to show my self that the things I'm doing are actually sticking. Like a test for vocabulary or syntax or whatever. I'm very new to c++ but I've tried coding in other languages, each time I ask that same question. Ultimately it makes me question my entire learning process, and so I quit.

    Is there any way to show myself that I am learning and not just sort of copying text? How do you get concepts to "stick"?

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

    Looking for a quote I read in a cs book that went "strive to make the computer more than it is now" or something like that. Does anyone know the exact quote?

    Posted: 25 Jul 2018 06:43 PM PDT

    Usually I absolutely hate quotes, but this one stuck with me. I was reading a cs book, that I think was pretty well known. and one of the first pages had a quote that went something like "strive to make the computer more than it is now". It wasn't exactly that but it was close. I don't think strive was in it. The idea was that by doing development you are making the computer more of a tool than it was before or something along those lines.

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

    I am not understand the concept of "containers" exactly. I am specifically referring to Java swing...

    Posted: 25 Jul 2018 10:18 AM PDT

    I have seen the word "container" before in HTML but I still did not understand what is was when learning HTML a few years ago. Now me learning Java GUIs, I am seeing this same word over again and I am not fully understanding what is a container and why do I have to do something like this:

    private void createComponents(Container container) { this.output = new JTextField("0"); this.output.setEnabled(true); this.input = new JTextField("0"); container.add(this.output); //referring here container.add(this.input); //referring here container.add(createPanel(output,input), BorderLayout.SOUTH); //this calls another method I have created that is not included in this post } 

    What is going on what I call container.add() and why do I have to do it? I looked this up and it still is a hard to understand concept to me. All I know is just that I have to do it and I don't know why. Thanks for the help!

    EDIT: Typo in the title: "I am not understanding...",

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

    Learn Git in 20 Minutes (Beginner Friendly)

    Posted: 25 Jul 2018 09:11 PM PDT

    Hey guys. I wanted to post my lasted video on learning Git, since Git is one of the most important skills any new developer can learn, but many developers neglect to ever learn Git. I know because I was one of those developers. It is also fairly simple to learn and understand, after you grasp the basics concepts. In this video I try to explain all of the basic concepts of Git as well as show how Git is used in an example. Let me know if this is useful to any of you that have yet to learn Git. https://youtu.be/IHaTbJPdB-s

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

    Learning Python. Could someone explain the Panda's .map() function, and lambdas?

    Posted: 25 Jul 2018 03:04 PM PDT

    Hello everyone!

    I've ventured into the world of learning Python and have decided to also pick up some data analysis using python. The concept of lambas and the .map() function were thrown in together although I know they are two separate concepts.

    I'm going through learning some Pandas on kaggle, and I'm at the point where they introduced the .map() function, and I'm having a tough time understanding it. What, why and when would you use the .map function?

    For example, I can apply logic with this bit of code on a dataframe:

    """ Let's assume the following Dataframe has the following columns: State Date Received Company Submitted via Zip code Conflict duration ID Status """ complaints = pd.read_csv('xxxxxxxx.csv') logic = complaints.loc[((complaints['State'] == 'NY') | (complaints['State'] == 'NJ')) & \ (complaints['Submitted via'] == 'Postal mail'), 'Date received'] 

    How would the .map() function work to provide extra results?

    Also, I know that lambdas are basically a quick(?) way to define functions, but the syntax always screws me up lol could someone explain lambdas too?

    Sorry I didn't want to come off as asking too much in one post, I would greatly appreciate any help!!!

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

    Our devs have spent months making our site "html5 compatible"...what does this mean? What am I missing?

    Posted: 25 Jul 2018 06:39 PM PDT

    I just started a new job, and while I'm a front-end dev, I work on the creative/business side, separate from the dev side. Everyone I work with has very little technical knowledge, but they keep stressing that everything MUST now be compatible with HTML5. Apparently their large dev team has spent "months" updating the "broken" sites to be "compatible" with the "new" HTML5. It's making me question my own tech knowledge! As I understood it, HTML5 is not THAT new, has been standard for a while now, and is backwards compatible. I've honestly never written anything other than HTML5? Are they pulling the business side's leg? Is there some new wave requiring all sites to be "updated" to HTML5? Our site is fairly simple, so I'm confused about how it's taking months and what exactly they're changing? Are they literally just switching out tags?

    Please enlighten me! Thanks!

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

    I need help with direction.

    Posted: 25 Jul 2018 04:53 PM PDT

    So I've spent the last few years learning basic concepts I've read books, I've coded some websites, and few small programs. I've worked in HTML, CSS, JavaScript, Python, T-SQL and PHP. I by know means have a grasp of any of these. I'm about to embark on another year of part time work so I have time to develop. But I lack direction. I seem to pick projects that are too big and get complicated quick and soon get discouraged because of lack of progress. Then I end up back at tutorials or something because it's like candy. So whats that where I can gradually progress and build my portfolio of projects so I can get a job. Thanks

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

    Creating Website with Code

    Posted: 25 Jul 2018 11:58 AM PDT

    Okay; so I know what my domain name is (going to register it once my website is ready), I know which company I'm going to go with to host it and I've written all the HTML and CSS without any bugs. The problem is I'm self learning and I'm confused on how exactly sql and php plays a role in my website.

    I need to create a data base that'll store usernames and passwords and other details about their account - now do I make several different data bases for these things or just one giant one - and how do I link this to the code I've already written (written text box's and stuff in html for them to write data in but it has nowhere to go).

    Furthermore, how do I create a database of images so that I can use them in my html code without having to reference ones from other peoples webpages?

    I'm using Sublime to code and am also hoping to one day link in python code into it all as well

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

    Group discord for beginners?

    Posted: 25 Jul 2018 08:17 PM PDT

    Anyone down to join a discord I made for fellow noobs?

    I'm starting from completely 0 programming background so I figured this would be a cool way to keep each other motivated and working!

    PM for the link

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

    Node.js difference in third party modules and core modules.

    Posted: 25 Jul 2018 09:34 PM PDT

    Hi, I'm a CS student in college. I want to make a project in Node.js to compare the third party modules and core modules performance by making an app once with only using the third party modules and once with only using core modules.

    I want to know if it's a good idea or not. My plan is to use mocha and unit test the apps and use the test completion time as the measure of performance.

    Please let me know if it sounds good or just gibberish.

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

    Which statically-typed language is closest to Python's speed for writing small scripts?

    Posted: 25 Jul 2018 08:46 AM PDT

    Maybe a bit of a poor title, but I couldn't think of a better way to describe what I meant. The appeal of Python to me is that it's quite quick to write small scripts with -- good standard library to lean on, lots of good reliable packages with simple interfaces, established solutions to many common problems, you know.

    I'd like to learn more about static typing and statically-typed languages, and was wondering which statically-typed language would come closest to that experience. TypeScript seems very modern and nice with how thoroughly it supports so many concepts, but the JS ecosystem is very web-focused; I was looking for libraries relating to manipulating document files, looking at video data and so on and didn't find much. Go I like the idea of because it's a simple language that compiles static binaries and has quite good performance -- I like the idea of being able to compile my little things down and send them to someone with "here, run this", you know, no fuss with "you must have X runtime and Y libraries installed and then run this and that for setup and oh, it worked on my system, is this in your PATH?" But it's sort of too simple and barebones, in my admittedly short time playing with it I found myself manually writing a ton of stuff that would just be there for me in Python/Ruby/JS.

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

    Explain iterators and vectors to me like I am five.

    Posted: 25 Jul 2018 05:42 PM PDT

    I still do not quite understand iterators and vectors. So I was hoping somebody could explain it to me. If you cannot explain it in a very basic manner a regular explanation will do.

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

    Certifications, Job Search, Resume build up

    Posted: 25 Jul 2018 08:08 PM PDT

    I was wondering what certifications, skills, languages and bodies of work will look appealing to employers looking at a student right out of college with a Major in MIS and Computer Science? I want to build up my resume and my skill set well enough that an employer does not have to think twice about hiring me. I am a hard worker, will be a Junior in college come next fall and currently have a lot of time on my hands.

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

    how do you deal with the frustration from not knowing how to solve something?

    Posted: 25 Jul 2018 05:19 PM PDT

    I've been trying to learn python for a while now. So a few weeks ago, I decided to start doing some of Codewars' tasks and i've realized that i'm pretty much shit at this and it's so frustrating.

    Even the things that appear so easy to me at first, once I start writing the code I stop because I can't do anything or even when My code works it's too long and ugly.

    I know that no one was born knowing this stuff but it's frustrating that at this point I can't handle that stuff.

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

    What happened to Codeschool?

    Posted: 25 Jul 2018 09:17 AM PDT

    Does anyone have an update on what happened to the codeschool courses now that it's integrated with plural sight? Did they kill it off? I can't seem to find any courses other than videos on plural sight.

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

    Please help me convert my Python script to C++

    Posted: 25 Jul 2018 07:02 AM PDT

    I have a BMI calculator, it asks a user to choose between metric or imperial measurements, then calculates your BMI using the correct formula.

    My code in Python 3:

    bmi = 0.0 w = 0.0 h = 0.0 def Classification(bmi): if bmi >= 30: return "Obese" elif bmi >= 25 and bmi < 30: return "Overweight" elif bmi >= 18.5 and bmi <25: return "Normal" else: return "Underweight" print("BMI Calculator \n") print("Choices: \n 1. Weight in pounds, height in inches. \n 2. Weight in kilograms, height in meters. \n") choice = int(input("Enter 1 or 2: \n")) if choice == 1: h = float(input("Enter your height in inches: ")) w = float(input("Enter your weight in pounds: ")) bmi = w / (h ** 2) * 703 print("Weight:", w) print("Height:", h) print("BMI:", round(bmi, 1)) print("Result:", Classification(bmi)) elif choice == 2: h = float(input("Enter your height in meters: ")) w = float(input("Enter your weight in kilograms: ")) bmi = w / (h ** 2) print("Weight:", w) print("Height:", h) print("BMI:", round(bmi, 1)) print("Result:", Classification(bmi)) else: print("Invalid choice") 

    I am (slowly) learning C++, I especially struggle with { } and just thinking in a C++ way, I like learning from examples but I find it difficult to get examples in C++, mostly I only find snippets but I want to learn from full scripts, can someone please convert my code more or less if it won't take too much?

    Thank you.

    P.S. Are there good free reading sources other than http://www.learncpp.com/ ?

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

    [C] Trying to create a writeable buffer of structs

    Posted: 25 Jul 2018 07:06 PM PDT

    Hey everyone, I've got a problem that's been confusing the hell out of me. I'm trying to read the system fstab, and use the fstab structs to create a new fstab with updated fields. I'm using the following (minified) code on both DragonFly BSD and HardenedBSD to accomplish this:

    #include <fstab.h> #include <stdio.h> #include <stdlib.h> #include <string.h> /* necessary on Linux */ #include <bsd/string.h> static size_t genfstab(const char *fstab, const char *label, size_t fscount) { int written; struct fstab *current, *newfstab; /* create a buffer of fscount fstab structs */ if ((newfstab = calloc(fscount, sizeof(struct fstab))) == NULL) { return(0); /* intended return value should always be > 0 */ } for (written = 0; written < fscount; written++) { current = getfsent(); snprintf(newfstab[written].fs_spec, FSTAB_MAX, "%s-%s", current->fs_spec, label); /* repeat for other struct members */ } endfsent(); return(written); } 

    However, attempting to actually run this code results in a bus error, and creates a core dump. I've done some tests using memset(&newfstab[0], 'A', sizeof(*newfstab));, which works as expected, but doesn't do anything useful (I can't think of a single situation in which an fstab would benefit from a line of all 'A's). Going through with gdb and lldb hasn't really helped determine what's happening other than potentially trying to write to a NULL pointer, but that's not the case per the test with memset(3).

    I've done some work along these lines before, using getfsstat(3), which worked using the same notation as in the for loop in this example, so I'm not sure why this is causing bus errors. Any help or pointers in this regard would be greatly appreciated. Y'all are an awesome community.

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

    POSTing ajax from html form to python script and back again

    Posted: 25 Jul 2018 09:15 PM PDT

    I've posted this on stackoverflow but have not been able to get anyone to help.

    I am wanting to POST user inputted data in an html file to a Python script with AJAX and have the Python script return it so that it shows up in a specific div in the html file. This is being done on a webhost with Python 3.5 installed. I've done simple <form action="blah.py"> stuff and it worked, but wanted to try out AJAX instead.

    HTML

    <!DOCTYPE HTML> <html> <head> <title>AJAX Test</title> <script src="http://code.jquery.com/jquery-3.3.1.js"></script> <script> function test() { var message = $('input[name=message]').val(); $.ajax({ url: "/cgi-bin/hello.py", type: "POST", data: {"text" : message}, success: function(response){ $("#div").html(response); } }); }; </script> </head> <body> <form> Enter Message: <input type="text" name="message"> <input type="submit" value="submit" onclick="test()"> </form> <div id="div">Input data should show up here after being processed in python script</div> </body> </html> 

    Python

    #!/home/user/virtualenv/test/3.5/bin/python import cgi, cgitb cgitb.enable() data = cgi.FieldStorage() print "Content-Type: text/html\n" print data 

    When I type a message into the input box and press the submit button, nothing happens. I am new to this so I feel like I am probably not understanding how this works. Any help would be appreciated! Also, nothing shows up in the developer console so I'm having a hard time figuring out what I'm doing wrong.

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

    JavaScript setTimeout() recursion not making sense..

    Posted: 25 Jul 2018 08:43 PM PDT

    function x() { console.log('a'); setTimeout(x(), 2000); } setTimeout(x(), 2000); 

    Why doesn't this code wait 2000ms between printing 'a's?

    (warning: it will freeze your tab)

    I apologize in advance for apparently being dumber than rocks.

    edit: I don't know why the last line isn't formatting properly.

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

    dual ccie, ready to get my hands dirty on Python especially for scripting purpose

    Posted: 25 Jul 2018 12:59 PM PDT

    Any help or pointers will be highly appreciated, or if you can share any notes, even after dual ccie seems like it is tough to survive if you don't know network automation.

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

    Finding Target Sum in Array Using Recursion

    Posted: 25 Jul 2018 07:42 PM PDT

    Given an array of ints, is it possible to choose a group of some of the ints, such that the group sums to the given target?

    groupSum(0, [2, 4, 8], 10) → true (10 is target sum) groupSum(0, [2, 4, 8], 14) → true groupSum(0, [2, 4, 8], 9) → false

    Could someone please give me a hint as to how to solve this? I have tried for a while and am struggling.

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

    .on() method in jQuery

    Posted: 25 Jul 2018 06:40 PM PDT

    Hi Guys, I'm currently using jQuery in JavaScript and encountering a rather weird issue. This is my program:

    <script src="[https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js](https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js)"></script>

    <script>

    $(document).ready(function(){

    $("p").on("click", myFunction());

    });

    function myFunction(){

    document.getElementById("demo").innerHTML= "clicked"

    }

    </script>

    <p id=demo>Click this paragraph.</p>

    I was expecting that the output would be "click this paragraph." and then I would click the paragraph and myFunction() would be executed, yet I'm finding that myFunction is executed the second the page loads, like it's being read from $(document).ready...

    Any help would be greatly appreciated!

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

    Are neural networks extremely vital for programming these days or is the direct method still acceptable?

    Posted: 25 Jul 2018 10:14 PM PDT

    I find training/making neural networks very exhausting compared to just forming a software that just fills the task by already knowing without any randomizing/error making

    That's just how I prefer to work, would it be a problem later on?

    submitted by /u/Bored-hoe900
    [link] [comments]

    Java segment tree optimization

    Posted: 25 Jul 2018 09:42 AM PDT

    I have a seg tree problem https://dmoj.ca/problem/ds3 and my code currently works, but it tles half of the test cases.

    https://pastebin.com/CMswMsMa

    My code keeps traversing the tree until it finds a node where the starting index and ending index are equal to the query's range, if there is no such node, it just searches all of the leaf nodes inside query range. Is there a search algorithm for this question?

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

    No comments:

    Post a Comment