• Breaking News

    Friday, February 14, 2020

    Thank you! I built my first game! learn programming

    Thank you! I built my first game! learn programming


    Thank you! I built my first game!

    Posted: 13 Feb 2020 07:19 AM PST

    Hello everyone. I have been a long time lurker (the person behind this account, the account itself is new) and wanted to say thank you to this community for all of the various links to resources you have provided. I have always had a interest in programming and being able to build something from scratch. My problem though was with all of the information out there I never really knew where to start. I still bounce around a lot, but thanks to this and a couple of other subs I was able to gather enough knowledge on some good starting points that I could start heading in the right direction. Because of you I was able to cross off a bucket list item and I built my first game! I know some people come back here with a similar message and show off the next Journey or Limbo that they built in a weekend. Mine is not that. I built a very simple game in Unity for Android (haven't figured out iOS yet) to try and get my feet wet with the entire process. But, it is still mine and I'm happy to have done it. I have a couple of updates I want to make to it, but I have a few new game ideas I am eager to start on. So thank you! I could not have done it with out all of you.

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

    Awesome tool that visualises Recursive Fibonacci

    Posted: 13 Feb 2020 09:24 PM PST

    https://www.cs.usfca.edu/~galles/visualization/DPFib.html

    At first I tried using pen and paper to visualise recursive Fibonacci's but God DAMN do they get complicated.

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

    How can I learn C++ from online sources?

    Posted: 13 Feb 2020 09:40 PM PST

    Hey all. I've been learning java around 15 hours/week for the past half year, sometimes I would've forgotten tho. Anyways, I've gotten to objects and got interested in learning both C++ and java. I've searched for an online course about C++ and found WEschools. I find that website helpful for the basics only but I know most of them from java, or small past experience with C++. If anyone has some online learning sources to learn C++ alone please share them here, couldn't find any in the FAQ. Thanks!

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

    MS Access and Excel exercises?

    Posted: 14 Feb 2020 12:07 AM PST

    Heya, Does someone know of good Access and Excel exercises (with answers?) I am writing an exam at the end of the school, but mine country official exercise "list" is... Well, full with errors, so I won't learn much. I know this might not be the place to ask, but I don't know any other place.

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

    How common is it to spend hours on code only to type out one line or find the error? How do you minimize this?

    Posted: 13 Feb 2020 11:04 PM PST

    I feel like I'm wasting quite a bit if time coding because... 1. Sometimes I can take as long as 4+ hours trying to do something and later realize one line of code does it... 2. Other times I don't know why something doesn't work and it takes hours to figure out some small thing like a misspelling.

    How common is this? How do you get through these faster? How do you minimize these situations?

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

    Which language (Python/Java/C++) do i choose to main?

    Posted: 13 Feb 2020 10:39 PM PST

    I want to work in Machine Learning and data analysis, so I have to start learning Python in-depth. I read Kaggle kernels (or notebooks by other users, whatever they're called) and have participated in 2 competitions.

    However, this semester at my university we have a compulsory Java course (which is very good, but hard) and all coding assignments in that course require a lot of work and are also compulsory. Furthermore, some homework are ICPC-style competitions and I usually use C++ as one of the faster languages to solve them.

    Which language do I main? Right now I'm thinking of doing a lot of Python and concentrating on it and doing all university stuff with Java (as ICPC is solvable with Java, too). Do you have any suggestions considering the future state of the job market or whatever? Maybe I should opt in for all-Java?

    submitted by /u/1ncend1ary
    [link] [comments]

    Python - How to not count spaces in a text file when counting characters?

    Posted: 13 Feb 2020 08:52 PM PST

    I am trying to make a program that will read a text file and determine the amount of sentences/lines, words, and characters but do not count spaces. I am having a hard time figuring out how to not count the spaces.

    Any help is appreciated!

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

    Shift schedule on a dynamic calendar

    Posted: 14 Feb 2020 12:27 AM PST

    Can anybody point me to the right direction on how should I approach this project?

    I've came up with pseudocode which I'll try to code using C but not entirely sure on how to output it into an excel or readable format for non programmers.

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

    Looking to develop programming courses: what are your biggest hurdles when learning to code?

    Posted: 13 Feb 2020 08:26 PM PST

    I'm a self taught programmer, and have been a professional developer for over 10 years now. I'd love to start developing some courses to give back, but I also see that there's tons of resources now (compared to when I was learning).

    What is your greatest struggles with learning to code? What is lacking in a lot of the materials out there right now?

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

    Is all content (like images and videos) from a website "downloadable"?

    Posted: 14 Feb 2020 12:04 AM PST

    Hello, hope this is the right place for this question, and that the question makes sense...

    Is all the content that a user can see/access on a website "downloadable"? An example being like Spotify: since Spotify streams all these songs to the user/listener, is it possible for the user to rip off the songs ala youtube to mp3 or something similar?

    The example in my case is the elective I am currently taking has these "embedded" lectures on the course page that we are required watch. I want to download the videos to watch at a faster speed because the speaker talks extremely slow, but I'm not sure how to. I open up the dev console to see if there are links I can click but nothing has worked so far...

    So like if the video itself is hosted on the school servers, then streamed to this course page, is there any way to "capture" that feed? I know for many wbesites, you can right click the images on like their sidebar and download it (save as), despite those pictures being hosted on the school servers.

    TLDR: are all the objects on a webpage "downloadable", as in can the user download everything they can see (videos, images, text) (Sorry if this is some fundamental misunderstanding on how websites work lol)

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

    What is the fastest loading text editor that still has decent features (windows 10)

    Posted: 13 Feb 2020 11:53 PM PST

    Basically I'm looking for something to replace notepad. Something simple and fast for when I want to make small edits to random files but not lacking so many features that it is a big set back (like gedit on linux)

    submitted by /u/Feminist-Gamer
    [link] [comments]

    Networking for the beginner.

    Posted: 13 Feb 2020 08:05 PM PST

    Hello r/learnprogramming! I'm pretty new here, but with the content I've been seeing, I'm not leaving any time soon. I too am trying to stick my foot into the door, going the self taught route, of programming, and I'm trying to learn the trade of social networking. Any tips would be highly appreciated.

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

    Linked List and multiple objects referencing to the list from CTCI

    Posted: 13 Feb 2020 11:50 PM PST

    on Chapter 2 of CTCI, there's an implemention of appendToTail() method and it says

    when you implement the linked list this way, you need to be a bit careful. What if multiple objects need a reference to the linked list, and then the head of the linked list changes? some objects might still be pointing to the old head

    my question is, how do you solve this problem? multi-thread?

    the code is

    class Node { Node next = null; int data; public Node(int d) { ...} void appendToTail(int d) { Node end = new Node(d); Node n = this; while(n.next != null) { n = n.next; } n.next = end; } 
    submitted by /u/JonasBrosSuck
    [link] [comments]

    Best approach for keeping a user logged in when using expiring JWT for endpoint auth

    Posted: 13 Feb 2020 11:45 PM PST

    I'm currently building a node backend using Koa/Postgre and finding my way around how to implement user auth. I'll describe what I've got so far (and any input on this is welcome, too)

    • Registration is via email & password. On account creation, a UUID secret (unique per user) is also saved against that account
    • Authenticated endpoints require a JWT, which contains the User Id (another UUID), and created and expiry times. The JWT is signed with the users secret.
    • JWTs are stored in their own table, recording the secret they were created with, the user's device ID, if they are valid and meta regarding why they were invalidated (user logged out, pw was reset etc) The idea being if you're logged in on 3 devices, you have 3 active tokens and can log out of one device and the other 2 are still ok
    • A password change (either just changing the password, or recovery without logging in) generates a new secret for that user and invalidates all existing tokens

    At the core of my thinking re designing this is under what circumstances is it vulnerable and barring credentials being stolen, it looks like the main threat is that if your JWT is stolen, who ever has it can make requests on your account (though the device ID would still need to match, I'm assuming this is trivial to overcome and isn't intended to be security through obscurity) So I want the JWTs to have a modest expiry time, maybe 15 minutes or so? So under this implementation, I'd need my front end to check the expiry of the JWT at the time of the request and if it has expired, hit the login endpoint again behind the scenes to get a new token. This approach however requires the users username and password to be stored at all times.

    I don't have any experience with user management on the front end (other than using pre-made firebase auth stuff on android) so I'm just wondering what the convention/best practice is for a setup like this? Any advice would be greatly appreciated.

    (For completeness sake, passwords are immediately salted and hashed serverside and saved against the user. Salts are regenerated on password resets)

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

    Ramer–Douglas–Peucker for sensor data

    Posted: 13 Feb 2020 11:30 PM PST

    I have a sensor which sends my the data to my pc. The sensor sends about 35 values per second. Later I want to store the data on a sd card. But I think the amount of data is too much. I found the Ramer–Douglas–Peucker algorithm. Can I use it to minimize this data in real time or is there another better method for this?

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

    [c] Intel Pin Tool when using uthash hash_find_str(), ADDRINT variable from Pin causes segment fault(core dump)?

    Posted: 13 Feb 2020 07:44 PM PST

    Hi, all

    try to access the InsertCall() ADDRINT variables, every time try to HASH_FIND_STR from the uthash.h to access these variables, it raises segment fault(core dump)?

    VOID funptr(ADDRINT INST,ADDRINT addr,ADDRINT target ){ HASH_FIND_STR( users,(char *)addr,s); } INS_InsertCall(ins,IPOINT_BEFORE,(AFUNPTR)funptr, IARG_INST_PTR, IARG_MEMORYREAD_EA, IARG_BRANCH_TARGET_ADDR, IARG_END); 

    another way accessing it also causes error:

    Addrint2VoidStar() function is from Pin API.

    char *l =Addrint2VoidStar(addr); printf("%p\n",l); 

    even casting it to char* will cause such error!

    seems any operation on ADDRINT variables will cause segment fault!

    any ways to get out of this? just want to use these ADDRINT variables.

    a little help would be highly appreciated!!

    thanks a ton!

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

    Trying to refactor some code, but can't decide which version to pick

    Posted: 13 Feb 2020 05:22 AM PST

    I'm trying to refactor a 200 line function in some code and I tried to refactor this (see image) from top (old) to bottom (new)

    https://imgur.com/wGolKtk

    What do you guys think?

    Old

    if (apiResponse.intents.length) { intent = apiResponse.intents[0].intent; probability = apiResponse.intents[0].confidence; } else { intent = 'error'; probability = 1.0; } 

    New

    [intent, probability] = getIntentFromAPI(apiResponse); function getIntentFromAPI (apiResponse) { const isValidIntent = apiResponse.intents.length; const intent = isValidIntent ? apiResponse.intents[0].intent : 'error'; const probability = isValidIntent ? apiResponse.intents[0].confidence: 1.0; return intent, probability } 
    submitted by /u/janmeppe
    [link] [comments]

    Help! Taking variable from inside a function to use in another function!

    Posted: 13 Feb 2020 11:24 PM PST

    *Javascript Problem*

    Hey guys - I'm creating the javascript for a rock-paper-scissors game. (Full link to the code below with comments to explain.)

    https://jsfiddle.net/rueeazy/8b5nw2ce/7/

    • side note, this is a project through TOP - haven't been taught looping yet although they said we could use it if were already familiar with it. I learned it but thought I would just call the function 5 times.

    I have a function playRound() that starts a round of rock paper scissors vs the computer. I am supposed to track the score via the [console.log] after each round and display the winner. And I loop this process in function game() 5 times and keep a tally of who won more rounds - and display the winner at the end.

    The part I'm having trouble with is getting pc/my score from the function playRound() to winner().

    I've tried making myScore and pcScore global variables that apply to every function in hopes that they would first be effected in playRound() and then from playRound() to winner() but that didn't seem to work. So I put myScore and pcScore inside the playRound() function - but don't know the correct way to define myScore and pcScore inside winner() and game().

    I hope this makes sense - and I appreciate any and all help! Thanks again.

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

    I need to develop a GUI.

    Posted: 13 Feb 2020 10:54 PM PST

    Hello,

    In my little programming experience, so far I tried to work on MATLAB, if it works I translated it to c++. Know I need to develop a bit complex GUI, I prefer a c based language. Where can I start? I didn't work with qt. Any help would be appreciated.

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

    Are there any websites that give programming problems?

    Posted: 13 Feb 2020 10:06 AM PST

    I'm in college and learning C++ and Python, I'd like to practice my skills while I learn these languages, I was wondering if there is a site that gives ideas for simple(ish) projects for coding?

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

    Learning Web Development

    Posted: 13 Feb 2020 09:54 PM PST

    Hi guys, I'm wanting to learn how to make my own weather website. I'm currently learning HTML and CSS and just want to know if I can build this using Python without having to learn JavaScript first.

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

    Book recommendations

    Posted: 13 Feb 2020 06:00 PM PST

    Anyone who has read cracking the coding interview , does the book contain code snippets/programs in java or in c/c++?

    Also people who've read both cracking the code interview and data structures and algorithms by Narasimha , which would you prefer to gain a better understanding of the concepts? Note: I'm prepping for my on campus placement interviews which is about two months away.

    submitted by /u/Grey-Winds
    [link] [comments]

    What does "define a method on an object mean?" [Javascript]

    Posted: 13 Feb 2020 09:42 PM PST

    I don't understand how to do this.

    Its supposed to be a function attached to an object I guess.

    I only know how to write functions by themselves, but I don't know how to attach them to an object.

    If the objects name was spaceShip. Its supposed to look like:

    spaceShip.nameOfTheFunction() 

    How do you apply a function specifically to an object like that?

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

    Is GroupID in Maven just a namespace for artifacts?

    Posted: 13 Feb 2020 05:05 PM PST

    I'm new to maven so I just want to make sure I understand some of the terminology

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

    No comments:

    Post a Comment