• Breaking News

    Wednesday, June 5, 2019

    Pro tip: If you keep track of your unsuccessful attempts at solving problems (and make note of why it didn't work), you're way more likely to learn from them! learn programming

    Pro tip: If you keep track of your unsuccessful attempts at solving problems (and make note of why it didn't work), you're way more likely to learn from them! learn programming


    Pro tip: If you keep track of your unsuccessful attempts at solving problems (and make note of why it didn't work), you're way more likely to learn from them!

    Posted: 05 Jun 2019 07:32 PM PDT

    I've seen a lot of posts along the lines of "I always struggle to think of the best way to solve problems", so I just wanted to share a strategy that's helped me a lot with my general reasoning skills for programming:

    While trying to solve a problem, I like to jot my thoughts down on paper before I start writing any code either in pseudo code or really close to it. I keep a 'programming journal' on my desk just for this. I like to come up with a general approach here before I move to my computer so I have some direction. After a while, my approach either works out or I get as close as I can before I peak at the solution. Instead of just saying, "ahh yeah that makes sense" and moving on, I like to also jot down the correct approach after my own initial approach and make note of the key differences and what parts I went wrong with. I used to struggle with writing super unnecessarily complicated programs, but this really forced me to pick apart my bad habits and learn why they were bad habits.

    I find that this is especially helpful for problems that illustrate some underlying concept (e.g. how to implement a certain algorithm or how to work with a particular data structure, etc).

    This approach is great because it forces you to focus on the actual problem more than the code itself, which is often a source of frustration for those new to programming. Just felt like sharing!

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

    Need to learn HTML+CSS and JavaScript for new job...

    Posted: 05 Jun 2019 12:23 PM PDT

    So I am working in IT for a SaaS company. Currently handle and support all of their IT functions in the company. As the customer base starts to pick up on the software side, they asked me if I was interested in sort of a "dual role" where I could help out doing some of the software support.

    Our software is a web development tool - so a lot of the support deals with HTML+CSS and JavaScript questions and troubleshooting.

    My question for you guys is, realistically, how long do you think it will take me to learn the basics of HTML+CSS and JavaScript. I am going to start off doing Tier 1 support so I don't need to be a full blown full stack developer by the end of the week.... but I would like to know what my timeline is like to learn everything and feel comfortable with it. How long did it take you to learn? I have VERY light coding experience so I'd almost be starting from scratch.

    I wanted to know so I can give my employer a timeline when I'd be ready to take on some more tasks! I'm looking to study maybe 1-2 hours after work a day and more on the weekends.

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

    [Python] Anything I could improve to make it more efficient?

    Posted: 05 Jun 2019 12:09 PM PDT

    Hey.

    Is there anything that I could improve in my current code? You can find the source on my github here: https://github.com/AAigars/OCR-Dice-Game

    Thanks.

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

    I wrote my first program from what I've learned in Python so far. What's something fun you would add?

    Posted: 05 Jun 2019 01:47 PM PDT

    The title says it all. I picked up a book on Python and have been learning. This is my first attempt to learn any programming language. You can find the code here. I'm new, so are there any fun questions I should try adding to make this a little more unique? I'm really enjoying this journey so far.

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

    Self Taught Dev

    Posted: 05 Jun 2019 01:38 PM PDT

    How many hours should a self taught dev spend learning how to code a day? Like being self taught there really isn't a guide to follow so its hard for me to know if im doing good or bad.

    Some questions i have •) Like i said how many hours should a web dev spend a day on coding.

    •) How long should one spend on learning how to code to start applying for jobs at the minimum.

    •) How much is too much coding, I started to think I'm spending too much time of learning how to code.

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

    Powerful Drag and Drop languages.

    Posted: 05 Jun 2019 09:42 PM PDT

    So I have used Scratch a lot and while it is good I would like a more powerful D&D. Are there any free ones around?

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

    Do I need a degree?

    Posted: 05 Jun 2019 05:54 PM PDT

    I am a little bit afraid of the idea of telling a potential employer that I'm a self-taught developer and have no formal qualifications.

    Does it make sense?

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

    How do I start with AI?

    Posted: 05 Jun 2019 09:58 AM PDT

    Before I just ask for help I just want you to know my background, I am a sophomore high school student who is really passionate about programming. I started learning Python at Codeacademy about 2-3 months ago and I absolutely loved the experience. After I finished the course, I just went out of my way to learn a few modules, did some personal project(nothing complex, just simple ones), and started researching about other things to do.

    Then, I stumbled across Machine Learning and Artificial Intelligence, and I quickly loved the prospect of those technologies and I was eager to learn them. Except, every single tutorial I found was too advanced and involved things like trigonometry, calculas etc.

    So how do I start learning Artificial Intelligence as a kid?

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

    What's the coolest Python program out there that you know of?

    Posted: 05 Jun 2019 07:30 PM PDT

    Looking for some inspiration for Python programmers who want a real feel for what Python is truly capable of. What, in your opinion, is the best use of Python out there?

    submitted by /u/_the-dark-knight_
    [link] [comments]

    Python script eating RAM (obspy subclass)

    Posted: 05 Jun 2019 11:28 AM PDT

    Hello!

    I'm working on a package to automate some seismic relative travel time picking that works with the [obspy package](https://github.com/obspy/obspy/wiki). It's coming together slowly but I noticed when I run through several earthquakes the RAM just always increases through the duration of the script (ex. system is using 1gig ram at start of script and by the end it might be using 7gig ram).

    Here are two links to code. One is the actual script that is eating the ram (testst.py) and the other is the beginnings of the package. Evstream subclasses an obspy Stream object. I'm assuming I probably messed up the subclassing somehow and that is causing the runaway ram issue. Essentially, the code goes to an earthquake directory containing seismograms,

    creates a stream object and processes the event, then proceeds to the next directory and repeats the process.

    [testst.py](https://gist.github.com/khomman/e4fe06cdbe8ac7a73d3e3c89fb88b77d)

    [evstream.py](https://gist.github.com/khomman/9de4d16f47cb60423c29366e87684e0a)

    I've never had to track down an issue like this and I'm not sure exactly why things aren't being garbage collected. Any insight on how to debug this in the code, where to look or things to read would be appreciated. I came across the objgraph library and that led to me explicitly deleting stream objects at the end of each loop iteration. However, that didn't work and the script still eats ram. The objgraph output is showing tons of dicts still floating around.

    dict 512968

    weakref 267604

    list 102142

    cell 91449

    method 79213

    function 68239

    tuple 58197

    CompositeGenericTransform 55133

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

    Resources to help study Android dev?

    Posted: 05 Jun 2019 01:27 PM PDT

    Does anyone have some good resources for learning android? I have an interview next week and I would like to get the basics down before then.

    I know Java very well but for some reason have never thought to make an Android app.

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

    I feel like I am hearing a lot about data oriented design however I can't find any source that describes it to my liking.

    Posted: 05 Jun 2019 05:49 PM PDT

    What exactly is data oriented design and where can I read more about it? It seems like very useful information to know.

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

    Question about scraping complicated data.

    Posted: 05 Jun 2019 01:50 PM PDT

    I am trying to scrape all antibiotics and their spectrum. If you go to first the link below, you'll see 8 buttons. Then if click ANTIBACTERIAL -> CLINDAMYCIN then it will take you to the second link below which contains a "spectrum" section that needs to be scraped.

    Basically i have to automate this for all antibiotics BUT then i need it in JSON format so i can make a link between the spectrum and its corresponding antibiotic. But as you can see the spectrum is always in a different page. All these buttons are dynamic too. What are some good ways of getting this thing done?

    So ideally i want all these antibiotics and their spectrum organized in json format and nested in the way they are in the page so i can work with them.

    Thanks for the help.

    1. https://www.hopkinsguides.com/hopkins/index/Johns_Hopkins_ABX_Guide/Antibiotics

    2. https://www.hopkinsguides.com/hopkins/view/Johns_Hopkins_ABX_Guide/540131/all/Clindamycin

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

    Sum and average of dice rolls

    Posted: 05 Jun 2019 11:20 PM PDT

    ## # A program that simulates dice rolls and provides the average and total for the rolls # # Import random number generator from random import randint # Input how many times user will roll dice numberOfRolls = int(input("How many times will you roll the dice? ")) COUNT = numberOfRolls # Generate 2 random numbers between 1 and 6 as many times as the user set for input while numberOfRolls >= COUNT and COUNT > 0: d1 = randint(1, 6) d2 = randint(1, 6) SUM = d1 + d2 COUNT = COUNT - 1 total = (d1 + d2) + SUM average = SUM / numberOfRolls # Display the total of the roll after each roll print("You rolled a " + str(d1) + " and a " + str(d2)) # Print the total of all the rolls and the average of all the rolls print("Your total for all of the rolls is " + str(total)) print("Your average for all of the rolls is " + str(average)) 
    submitted by /u/abigfuckingnope
    [link] [comments]

    Node.js linking to GUI and input

    Posted: 05 Jun 2019 01:26 PM PDT

    Hi,

    Sorry, if this question is super beginner, I'm trying to learn programming so I decided to start a personal project of mine. I am creating a web automation tool coded in node.js using google's puppeteer, but I was wondering how I could link that to a GUI and change variables based on what the user inputs in the GUI. I was researching online, and it seems like electron.js might work for that, but I'm not sure if that's the best solution.

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

    Lost in the morass of webdev -- keeping it simple, how should I write a chat program?

    Posted: 05 Jun 2019 10:59 PM PDT

    I've done very little webdev, and basically no "heavyweight" webdev (in the sense of using NPM, any of the various frameworks, etc.).

    I want to write an app where I think the communication I need can be boiled down to a chat service. Here's what I want:

    • A kind of "no login" operation like is used at a lot of sites today, where all you need is the code to a room and you're put into that room. (e.g. https://example.com/chat/room/nt239et or https://example.com/chat?room=nt239et)
    • The server can intercept and modify messages before passing them on, in case that blocks an approach. (E.g., it should be able to make each message entirely uppercase before sending it out, to pick something silly.)
    • I don't need and don't really want any kind of persistence. Each room should track who is in it so it can display that information and I want a panel where I can see all currently active rooms, but I don't need the rooms to keep infinite chat history or anything like that.
    • Ideally, I'd like this to be runnable on cheap shared hosting, but that's not critical.

    I have a little prototype I wrote using websockets, but it doesn't have separate rooms -- just everyone who connects gets everyone else's messages. When thinking about how to fix this and looking around, I found some other stuff like WAMP and Autobahn and that makes me wonder if I should be using those. Or are they overkill? Old hat and there's something new and shiny? Are they even relevant?

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

    What to make for "personal project"

    Posted: 05 Jun 2019 06:44 PM PDT

    I see tons of advice on this thread saying to build a personal project, but I have no idea where to even start or what to even make. Any advice on how to get an idea?

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

    [C++] Advice on how to make my game run to completion using a loop?

    Posted: 05 Jun 2019 10:16 PM PDT

    I have an 8x8 board. I have an 'x' piece in row 0, column 3. I'm trying to move it across the board onto the final row 7.

    The problem with my code is that I don't know how to construct a main method that will allow me to keep moving my x over and over again until it hits row 7.

    My main method, as of right now, just lets me move 'x' one place. Then it resets back to the beginning of the game for the next iteration of the loop. I can't move forward past 1 turn.

    How do I change my loop/main method so I can keep playing my game, moving 'x' repeatedly until it moves to row 7?

    fb.debug() is just an ability to visualize the 8x8 board with my 'x' piece on it.

    int main() { int a = 0; while (a < 8) { FBoard fb; //8x8 board object fb.debug(); //visualize the board state gameState = UNFINISHED; //status of game int x1, x2; cout << "Please enter two coordinates for x pieces: " << endl; cin >> x1 >> x2; fb.moveX(x1, x2); //moving my 'x' piece function //checking if my game win conditions have been met if(gameState==O_WON) cout << "O_WON" << endl; if(gameState==X_WON) cout << "X_WON" << endl; if(gameState==UNFINISHED) cout << "UNFINISHED" << endl; //visualize board again after 'x' has been moved fb.debug(); cout << "****************************" << endl; a++; } return 0; 
    submitted by /u/lotyei
    [link] [comments]

    Amateur question: Is the Source code of a Webapp visible to everyone?

    Posted: 05 Jun 2019 04:14 PM PDT

    When I press Control + U. is that the source code of the website? so can everyone see the source code of a web app?

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

    Tips for Fantasy Football program to make it more "professional" for lack of a better term?

    Posted: 05 Jun 2019 09:56 PM PDT

    Hey all. Short version, I've got one semester of Community College coding under my belt.

    I run a fantasy football league that's sorta the opposite of typical: we're looking for the worst players. Every week, we put in our four 'worst' quarterbacks and four 'worst' defenses, we get them selected based on a rotating waiver system, and the people who do worst win. It's good fun.

    Since I'm on summer break, I finally had time to start applying coding to this. I want to use this project as a way to learn valuable concepts I might not have touched on in my coding class so far

    For instance, I made a program my first GUI program where I can enter everybody's four picks for QB and four picks for DST every week, enter the week, and based on waiver priority, it assigns the applicable teams to each player. I learned a teeny bit of PHP to write a script so that now I have individual links for each player to select their teams weekly that my program will cull from automatically. I started writing a bot with selenium that would do the legwork of assigning each player to each team on ESPN, but I'd rather not risk getting my ESPN account banned for botting (I had it auto-log in and make the first drops, a satisfying proof of concept.)

    Issues though: for instance, my php script writes the weekly picks to a plaintext file that I parse in my main Java program. There are still improvements to be made to the main program, of course, and such.

    Does anybody have any ideas on stuff I could 'work on' on this project that would expose me to useful concepts while improving the project itself? The project works just fine as is, however...

    For instance, I was thinking of ditching plaintext and working with some sort of other format, maybe a simple database format or even a simple csv format... are there any formats that would be worth using to begin learning on that would make for some useful future knowledge while improving the program?

    Would encryption be useful, perhaps, encrypting the players' picks and unencrypting them at run time before I assign the teams? Is there a certain library or method I should use for this to expose myself to for the future?

    I'm already starting working on as much data validation as I can, even the stuff that seems almost unnecessary to make the program more robust and useful.

    Things like that: I'm still very much a newbie and was looking to use this program as a means to continue to improve particularly over the summer break and maybe make this system something I could release into the wild because I think my 4-player bad-QB-bad-DST league is something that would interest folks.

    Thanks in advance, and apologies if the question is vague. I just want to make this program as robust and useful as possible to get used to things. Should I maybe start down the path of github to start learning version control? Etc. I know there's so many options ! Thanks

    edit: this is all in addition to just improving the code. My code is ghetto fab at the moment, and I continue to rewrite it to make it more elegant.

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

    Guidance on what to do next?

    Posted: 05 Jun 2019 09:48 PM PDT

    Hey everyone , I am a CS undergrad in my 2nd year. I have been learning networking in my college as a part of curriculum so far have read the book "Data Communication and Networking" by Behrouz A Fourouzan which recommended textbook from college. So I think I now have a pretty much a big picture on networking but I would like to learn more about how the things are getting implemented ? Because it seems to me that the book only covered theoretical part of subject and that too not in deep. So if anyone can recommend me any resources , it will be very helpful. Thanks .

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

    How serious are github dependency security vulnerability notifications?

    Posted: 05 Jun 2019 09:39 PM PDT

    GH blew up my inbox by sending this notification for every repo I owned. Are these a big deal or do you guys normally ignore them?

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

    IoC container example with C#

    Posted: 05 Jun 2019 11:45 AM PDT

    I found this article that an example about how to write an IoC container in C#. I thought it is a short interesting read https://nearsoft.com/blog/writing-a-minimal-ioc-container-in-c/

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

    Why overload a method instead of just writing a new method? (C#)

    Posted: 05 Jun 2019 06:43 AM PDT

    As I understand overloading a method is having the same method and method name but with different parameters. I don't understand why. Isn't the amount of code written going to be the same (bar the difference in parameters) What benefit is for example having 3 methods all called add() that except different parameters and thus produce different results as supposed to having three separate methods add1(), add2(), add3().

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

    No comments:

    Post a Comment