• Breaking News

    Saturday, February 1, 2020

    What have you been working on recently? [February 01, 2020] learn programming

    What have you been working on recently? [February 01, 2020] learn programming


    What have you been working on recently? [February 01, 2020]

    Posted: 01 Feb 2020 08:04 AM PST

    What have you been working on recently? Feel free to share updates on projects you're working on, brag about any major milestones you've hit, grouse about a challenge you've ran into recently... Any sort of "progress report" is fair game!

    A few requests:

    1. If possible, include a link to your source code when sharing a project update. That way, others can learn from your work!

    2. If you've shared something, try commenting on at least one other update -- ask a question, give feedback, compliment something cool... We encourage discussion!

    3. If you don't consider yourself to be a beginner, include about how many years of experience you have.

    This thread will remained stickied over the weekend. Link to past threads here.

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

    Some tips for posting on /r/learnprogramming

    Posted: 01 Feb 2020 01:47 PM PST

    Tell us your background

    • How old are you roughly?
    • How long have you been programming or trying to learn?
    • What skill level do you think you're at?

    Be more specific about details

    • What language are you studying/programming in?
    • When you say you're struggling, give examples of what you've been struggling with. Don't just say "Am I just stupid?" Say, "For example, they were covering selection sort, and I was just baffled what was going on". I know quite frequently it's just a feeling, and it's hard to recall specifics, but specifics help.
    • Write down what you understand and what you don't understand.

    Everyone is different

    These aren't tips, but observations of posters.

    • We don't know how long it will take you to be a good programmer. That's like asking someone how long will it take to be a good basketball player. In that scenario, you know some will definitely be better than others. Admittedly, you just need to be good enough, rather than very good at programming, esp. if you don't program much outside of work.
    • Also, being self-taught is hugely different than being a CS major. You're going to pick and choose things, and probably ignore stuff that is too hard for you, or tackle things that are too hard because you don't realize it's too hard.
    • There's generally no a-ha moment where you go from not getting it to getting it unless you have a mentor that is filling you on details you're missing. It takes time. Again, it's helpful if someone can give you advice.
    • There's always someone that seems to get it more quickly than you, because that's the person you pay attention to. Understand there are also people that don't get it as quickly as you, but you probably don't pay attention to them.
    • If you're a self learner, you might want to see if there's someone you can work with. Sometimes bouncing ideas back and forth can help. Of course, you have to be learning the same things.
    submitted by /u/CodeTinkerer
    [link] [comments]

    How to Advance Beyond the Boundaries of College Programming?

    Posted: 01 Feb 2020 11:37 AM PST

    Hello All,

    I am currently in college as a computer science student. While I have enjoyed my time thus far, I feel the courses have not been stimulating enough with regards to programming. I am a junior (3rd year of 4) and I have barely scratched the surface of programming. How would you recommend I advance my skills to where I feel I am an asset to an employer? My scope is far wider than programming, however, I am interested in expanding specifically my programming skill set, hence why I'm here. To add, my 'main' language is C++.

    Thanks!

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

    I don’t know how to continue

    Posted: 01 Feb 2020 04:23 PM PST

    So I have been learning JavaScript for a few months now and know the basics. I have completed like all the projects you can think of, although I still feel like I don't understand things. Most of the things I have done with JavaScript have been creating things with the web and making existing things responsive so I have not practiced the math side of js. Is there a site where I can do this? Thanks.

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

    Why is Python so popular among beginners?

    Posted: 01 Feb 2020 11:14 PM PST

    Why is Python so popular among beginners? Is it because it sounds like a snake, and snake is kind of cool?

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

    What kind of paid work is closest to making a GUI with Tkinter using python?

    Posted: 01 Feb 2020 07:09 PM PST

    I'm looking to get paid work in the I.T industry one day, but I've got no idea what direction to go in.

    I post a screenshot of my most complicated work, a GUI using Tkinter, coded with Python.

    It's just for some game I play, it isn't even finished yet.

    Another program I wrote stores data onto a CSV file, the program that creates the GUI opens the SCV file, and displays it's content like so, with the 10 most recent items at the top, the next 20 after that.

    B & C are just placeholders for something I'll do later, most likely list all items based on their locations.

    Screenshot

    I would be stunned if anyone was willing to pay money for a custom GUI written with Tkinter, I assume there's open source software that's way better then what I've done here.

    But still, it's what I'm best at so far, I have no idea what form of paid work is closest to this, making websites? Making android apps? No clue at all, so hoping someone can point me in the right direction.

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

    Trying to find a more efficient way to chaining if else statements

    Posted: 01 Feb 2020 06:10 PM PST

    (C++ question)

    I have a large array of number, the size of which is given by v_count, and the numbers range from 1-100.

    What I have to do is a sort of tally count for each group of number 1-10. 11 - 20 and so on, so I made a second array to hold the frequency for each range, incrementing when a number is in the range. What I did works, but it doesn't look "right", because if the numbers ranged from 1 - 1000 or something, this would be too tedious to do. What would be a neater way to do this?

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

    Is there any good site to learn "Design Pattern" like "Leetcode"?

    Posted: 01 Feb 2020 05:49 PM PST

    Recently I am learning algorithm via <leetcode> site.

    It is very useful for me. And I want to learn <Design Pattern>,

    but I cannot find the site for <Design Pattern> like <leetcode>.

    What I'm looking for there are some problem codes (needed to refactoring) given,

    people try to refactoring using design pattern skill,

    then people can discussing each solutions. (like leetcode)

    Is there any site like my request?

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

    What are some good tutorials on implementing ActivityPub?

    Posted: 01 Feb 2020 11:38 PM PST

    I want to help make a project called Lemmy federated using ActivityPub, but I have no experience with ActivityPub. Are there any good tutorials on the topic that you'd recommend? Particularly tutorials or documentation relevant to programming it in Rust, since it's what the Lemmy backend is written in.

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

    Is this the way things are really named, or are these tutorial people really lazy with naming?

    Posted: 01 Feb 2020 07:46 PM PST

    I've gone through several React tutorials now just to get a few projects, and in each case I have at some point or other just become completely lost within the naming structure. There are at least two places where there are two different files of the same name, but handling different things. I don't entirely understand enough of what is going on to come up with a better name. This also happens with props. something={something} gets passed down to something={something} and I hope you can see why I get lost. It's mostly a matter of figuring out, which something is causing the problem. Or which auth file has the bug. So that got me to thinking. Is this really how the naming is done? With props my idea would probably be to say alertSomething={alertSomethingProps} etc. Just so I know what is where, and to make spotting problems easier.

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

    Qt platform plugin "xcb" could not be loaded even though it was found when trying to run mu-editor.

    Posted: 01 Feb 2020 07:34 PM PST

    Hello, I'm very new to the Linux environment and I am looking to teach myself some Python by using the "Automate the Boring Stuff" guide, as well as getting more comfortable working with Linux. Well, I would like to start working but some annoying error stops me from doing that. I could probably use a different editor but I wanted to follow the guide. If nothing else works I will try a different editor.

    Here is the error message I get when I try to run mu-editor:

    Logging to /home/username/.cache/mu/log/mu.log

    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

    Aborted (core dumped)

    I've tried a few things so far but lots of the "solutions" that are found online are confusing me even harder. I appreciate all kind of help.

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

    a few questions

    Posted: 01 Feb 2020 11:16 PM PST

    so hey im 15 years old and just recently started codeing in python.i use pycharm and dont know a lot about programming so

    1.what language is for what?(i want to make a simple app that tells me good morning everyday i open my phone for the first time)

    2.can project i mentioned up be done with python if so how?

    3.any commands like print or anything that you would think would help me

    thanks in advance

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

    Problem with menu looping in my C++ text-based RPG game

    Posted: 01 Feb 2020 11:16 PM PST

    So when I select an option from my menu, for example, the Character Stats, I see them but the menu is supposed to show again after so I can select other options. Instead, the program just closes.

    Here is the code:

    Game.h

    public: Game(); virtual ~Game(); const int getChoice() const; void update(); void updateMenu(); void printMenu() const; protected: }; 

    Game.cpp

    void Game::printMenu() const { cout << "Welcome to the main menu!" << endl; cout << "Please choose an option!" << endl; cout << "\n" << "1) Travel" << endl; cout << "2) Quests" << endl; cout << "3) Shop" << endl; cout << "4) Inventory" << endl; cout << "5) Stats" << endl; cout << "6) About" << endl; } const int Game::getChoice() const { int choice; cout << "\n" << "Choice: "; cin >> choice; return choice; } void Game::updateMenu() { switch(this->getChoice()) { case 1: cout << "1" << endl; break; case 2: cout << "1" << endl; break; case 3: cout << "1" << endl; break; case 4: cout << "1" << endl; break; case 5: cout << "\n" "~ Stats ~" << endl; cout << this->character->toString() << "\n"; break; case 6: cout << "1" << endl; break; default: cout << "\n" << "ERROR! Faulty input!" << endl; break; } } void Game::update() { this->printMenu(); this->updateMenu(); } 

    I recently started using Reddit so don't complain about the formatting of the post. (if it's not good)

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

    What language should I use to make a Pokemon team database?

    Posted: 01 Feb 2020 11:14 PM PST

    So I am uber noob at programming. I know basics of Javascript, html and css. I'm thinking I may need to use SQL to make this project perhaps?

    Here is what I want to make:

    A simple program with an ugly(but preferably pretty) user interface that basically has the user input his/her opponents pokemon. It should(over several inputs) read how many entries have been made and should give a tally of how many individual types of pokemon the user has faced. I want to give basic stat's like winrate, order in which the pokemon are used and pokemon appearance frequency.

    Priorities: 1. User input and stat 2. Not the interface

    Ideally I'd like it to run off of his computer or online off a free server but I'm not sure how to do all that. Can someone please draw out a plan for me of what languages and libraries would be useful for this and how to use them and plug them in and stuff?

    I am using Visual studio Code atm.

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

    Git portfolio? Examples? How does one stand out as a new programmer looking for a entry level job?

    Posted: 01 Feb 2020 11:11 PM PST

    I asked a question about how did some people get jobs without bachelors (getting mine soon too) since none of my job applications resulted in anything. Most people recommended portfolio but I have no idea what a good one looks like. Does anyone have any examples, what should be in it?

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

    Excel: How to create a search box to find a Cell and change the color permanently?

    Posted: 01 Feb 2020 11:06 PM PST

    Not sure if this is even possible. I've got multiple pages on 1 spreadsheet with a list of numbers. I have access to a barcode scanner, and would like to be able to scan a barcode into a search box, then have it permanently highlight whatever is found, across multiple pages. I would like for it to stay highlighted, even after searching onto the next item. That way at the end of my scan, I can see which Cells I scanned.

    I have been able to create a search box, have it highlight whatever is found/scanned, but as soon as I scan something else, the highlight disappears.

    This is the formula I am using: =IF(ISBLANK(search_box),0,SEARCH(search_box, $A2 & $B2) )

    Hopefully that makes sense.

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

    php beginner basic functions

    Posted: 01 Feb 2020 11:02 PM PST

    Hey guys hope you're good.I'm a php beginner and i wanted to know what the curly braces in this function are for. The function works with or without them so why do i see some php code using these curly braces

    function sayHie($name){

    echo "Hie {$name}";

    }

    sayHie("john");

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

    LDR plushies

    Posted: 01 Feb 2020 10:50 PM PST

    I am currently in a long distance relationship and something we've been looking for is long distance plushies; as in, i will hug one and my partner will receive a vibration on her side, and vice versa. The sensor would probably be a pressure sensor inside the plush, so i could see the pressure increase upon being squished.

    There was only one example of this i found and it had been discontinued, so i looked to make my own. I'm fairly competent in programming and could quite easily code this project myself... However i have no clue on how to physically do this.

    I've looked at Arduinos and their sensors and modules and all, but i can't seem to find anything right for the situation, and then anything that has permanant storage (the plush would be on most of the time, the program would start automatically on boot).

    Is it worth looking at a couple of Raspberry Pis? Are there any alternatives?

    Many thanks! And i apologise if this is the wrong sub, i really had no clue who to ask.

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

    How To Control The Bandwidth Of Devices On Your Network

    Posted: 01 Feb 2020 10:41 PM PST

    How To Control The Bandwidth Of Devices On Your Network in this tutorial I explain how to use a very useful tool to limit and block the internet off unknown devices or someone who is taking up too much bandwidth this tool really comes in handy . if you like the tutorial or have some feedback to say about it leave a comment and I will reply

    https://youtu.be/ZubyAN4ygRo

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

    Any idea why it is giving me a invalid syntax to my directory when I run my code...?

    Posted: 01 Feb 2020 09:42 PM PST

     /usr/bin/python3 /Users/myusername/Desktop/objectoriented/project3.py ^ SyntaxError: invalid syntax 

    ?? Any idea why this is happening?

    If you need me to post the code let me know, but I honestly have no idea why it is throwing a invalid syntax that throws to my directory.. This is when ran on the terminal.

    Also, here's the thing. When I use my MacBook Pro touchbar, and press the go button on the right, it works. But on the left, it throws the syntax error.

    Here's a link to what I'm talking about : https://imgur.com/gallery/I3Faozr

    Ran on virtual studio

    Edit: here is my code

    #import csv #from operator import mul #from functools import reduce #from itertools import cycle #import itertools #from operator import mul from ast import literal_eval as createTuple ratings_file = open("ratings.txt","r") book_file = open("booklist.txt","r") ratinglist = open("ratings.txt").readlines() booklist = open("booklist.txt").readlines() print(booklist) myDict = {} def dict_keys(): with open("ratings.txt", "r") as rating: line = rating.readlines() line[0] = line[0].rstrip().lower() line[1] = (line[1].rstrip()).split(' ') myDict[line[0]] = line[1] line.remove(line[0]) line.remove(line[0]) if not line: rating.close dict_keys() print(myDict) def tuplelist(): tupleList = [] with open("booklist.txt","r") as infile: for line in infile: tupleList.append(tuple(line.rstrip().split(','))) tuplelist() print(tuplelist) list1 = ['0', '0', '0', '5', '0', '0', '0', '5', '0', '5', '5', '0', '0', '0', '0', '0', '5', '-3', '-3', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '5', '0', '0', '5', '0', '5', '5', '5', '5', '0', '0', '0', '0', '0', '3', '1', '0', '0', '0', '0'] list2 = ['5', '5', '0', '0', '0', '0', '0', '0', '0', '3', '0', '5', '0', '0', '1', '0', '5', '0', '1', '5', '0', '0', '0', '0', '0', '1', '0', '5', '0', '0', '3', '5', '5', '0', '0', '5', '0', '0', '3', '0', '0', '3', '5', '5', '0', '0', '0', '0', '0', '5', '5', '0', '5', '0', '0'] def dotprod(list1,list2): int_list_1 = map(int,list1) int_list_2 = map(int,list2) third = map(sum, zip(int_list_1, int_list_2)) product = [] for num1, num2 in zip(int_list_1,int_list_2): product.append(num1 * num2) productsum = sum(product) print(productsum) dotprod(list1,list2) #z = my_dict.values() #x = map(int,z) #third = map(sum, zip(x)) #result = sum([reduce(lambda x,y: x+y,map(int,elem)) for elem in zip(*my_dict.values())]) #result1 = sum([reduce(lambda x,y: x*y,map(int,elem)) for elem in zip(*my_dict.values())]) #affinityscore = result + result1 #print(result1) #print(ratinglist) #print(booklist) #with open('ratings.txt','r') as f: #for line in f: # a,b = line.split() #dictionary[a] = int(b) #print(dictionary) #Book Ratings #-5 Hated it! #-3 Didn't like it #0 Haven't read it #1 It's okay #3 Liked It #5 Really liked it! def dotprod(x,y): pass def recommend(): pass def friends(): pass #def main(): #prints reccomendations for all readers #with open('recommendations.txt', 'w') as rec_file: #print(report(), file=rec_file) #if __name__ == '__main__': #main() 
    submitted by /u/stupidcsstudent69
    [link] [comments]

    How do I learn without having small projects?

    Posted: 01 Feb 2020 05:54 PM PST

    I really want to learn python but I don't really have any small projects or ideas to learn from. How do I start learning?

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

    Simple Machine Learning projects in Biology?

    Posted: 01 Feb 2020 05:49 PM PST

    I have a course currently that requires us to implement or try to fix a biological/bioinformatics model using machine learning. Does anyone know of any simple Machine Learning projects that can be done in the biological sciences?

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

    Cannot import Class from Module

    Posted: 01 Feb 2020 05:26 PM PST

    So I am working in HeadFirst Python. I type from athlete import Athlete list. I am able to import the module "athlete" but not the Athletelist which is a class function.

    This is my error

    Traceback (most recent call last):

    File "C:\Users\Reggie\Desktop\The Matrix\HeadfirstPractixe\athletemode1.py", line 2, in <module>

    from athlete import Athletelist

    ImportError: cannot import name 'Athletelist' from 'athlete' (C:\Users\Reggie\Desktop\The Matrix\HeadfirstPractixe\athlete.py)

    import pickle

    from athlete import Athletelist

    def get_coach_data(filename):

    try:

    with open(filename) as f:

    data = f.readline()

    temp1 = data.strip().split(',')

    return(AthleteList(temp1.pop(0),temp1.pop(0), temp1))

    except IOError as ioerr:

    print('File error:' + str(ioerr))

    return(None)

    def put_to_store(files_list):

    all_athletes = {}

    for each_file in file_list:

    ath = get_coach_data(each_file)

    all_athletes[ath.name] = ath

    try:

    with open("athletes.pickle", "wb") as athf:

    pickle.dump(all_athletes, athf)

    except IOError as ioerr:

    print ("File error (Put_and_store):" + str(ioerr))

    return(all_athletes)

    def get_from_store():

    all_athletes = {}

    try:

    with open('athletes.pickle','rb')as athf:

    all_athletes = pickle.load(athf)

    except IOError as ioerr:

    print ("File error (get_from_store):" + str(ioerr))

    return(all_athletes)

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

    [JavaScript] I'm struggling to plot a graph using plotly. I believe it is because of my lack of knowledge of arrays/lists/variables. I'm referring to the variables/arrays Years and Levels. When I assign them like x: Years, there is an issue. Any help would be appreciated because I'm inexperienced!

    Posted: 01 Feb 2020 05:21 PM PST

    <!DOCTYPE html> <html> <head> <title>LCCS</title> <style> body { background-color: lightblue; font-family: arial; margin: 2em; } </style> </head> <body> <div id="plotlyGraph"></div> </body> </html> <script src="https://cdn.plot.ly/plotly-1.2.0.min.js"></script> <script src="https://www.gstatic.com/firebasejs/7.7.0/firebase.js"></script> <script> var firebaseConfig = { apiKey: "hidden", authDomain: "hidden", databaseURL: "hidden", projectId: "hidden", storageBucket: "hidden", messagingSenderId: "hidden", appId: "hidden" }; firebase.initializeApp(firebaseConfig); var Years=[]; var Levels=[]; var myDBConn = firebase.database().ref("mySeaLevelData"); myDBConn.on("child_added",function(data, prevChildkey){ var dataPoint = data.val(); Years.push(parseFloat(dataPoint.year)); Levels.push(parseFloat(dataPoint.level)); }); function plotGraph(){ var dataset = { x:Years, y:Levels, name: "Sea level", mode: 'scatter' }; var data = [dataset]; var layout = { title: 'Sea level', xaxis: { title: 'Year', range:[1992,2021]}, yaxis: { title: 'Level Change since 1993 (mm)', range:[0,100]} }; var config = {displayModeBar: false, displayautoScale2d: true} Plotly.newPlot('plotlyGraph', data, layout, config); } plotGraph(); </script> 

    The problem appears to be that x : Years, y : Levels is not working. Does anybody know what I am doing wrong. When I input for example [2010,2020] instead of Years the program works. I suspect I am doing something wrong during the creation of the array/var/list but I'm puzzled. I'm new to javascript so any guidance or support would be immensely appreciated. Thanks in advance.

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

    Prime Factorization runtime?

    Posted: 01 Feb 2020 04:59 PM PST

    Dumb cs student here Why is prime factorization non polynomial? Specifically the trial by division algorithm. Can someone explain the runtime being O(2n) given that division is O(1)

    And what is the run time if division was O(n)

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

    No comments:

    Post a Comment