• Breaking News

    Wednesday, July 17, 2019

    Programming should be fun - ReactJS + Twitch API Dashboard Tutorial learn programming

    Programming should be fun - ReactJS + Twitch API Dashboard Tutorial learn programming


    Programming should be fun - ReactJS + Twitch API Dashboard Tutorial

    Posted: 17 Jul 2019 04:56 AM PDT

    One of the worst things about learning to code is how uninteresting most beginner programming tutorials are. How many todo apps or calculators does the world need? It's hard to stay motivated when making stuff like this

    IMO the best way to learn something new is to mix together things you enjoy so it stays fun and you don't give up on learning. In this case you can combine programming and gaming by using the Twitch API

    I made this tutorial with beginners trying to build a portfolio in mind. Once you're done with it you will have a nice base project to build off of so you have something unique for your portfolio instead of another cookie-cutter project.

    https://www.youtube.com/watch?v=VTY6ZzDTV3A

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

    I can see why people love MOOC's Java course so much.

    Posted: 17 Jul 2019 12:30 PM PDT

    I'm almost done with Week 6 & I feel like a wizard. I finished the sorting assignment a minute ago and I feel like a competent programmer for what is probably the first time. This is so great, really. I actually can't believe I've come this far in just six days.

    If you haven't tried it, get on it. I've been going through it for the past 6-7 days and my knowledge with Java and programming has skyrocketed. I can't believe I've learned this much. This course should be taught to literally everyone.

    https://moocfi.github.io/courses/2013/programming-part-1/

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

    Machine Learning and Artificial Intelligence Resources

    Posted: 17 Jul 2019 07:44 PM PDT

    What programming language to learn in 2019?

    Posted: 17 Jul 2019 08:03 AM PDT

    I have been working in IT sphere for quite a long time. People have been asking me the same questions over and over again: what programming language to learn, what language to start with to get the profession of a software developer, and how to figure it out.

    In the development sphere, there are both adherents of basic classical principles and beginners who want everything to be simple, fast and easy. For example, I often see how the guys prove to each other that it is better to code using JS than PHP or vice versa. Also, I often see how experienced developers say that it's nothing and you need to code using C++ in order to be a real developer.

    I put my thoughts into this article.

    Please share your thoughts, what programming language it is better to learn in 2019?

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

    Issue with Stripe and subscription changing from monthly to annual

    Posted: 17 Jul 2019 05:58 PM PDT

    I am working on an application and for the first time, I am trying to include an annual plan option as well. The issue I am having is that Stripe is complaining I can't change the interval yet their docs say you can. Here, with the wording of:

    If both plans have the same billing periods—combination of interval and interval_count, the subscription retains the same billing dates. If the plans have different billing periods, the new plan is billed at the new interval, starting on the day of the change. For example, switching a customer from one monthly plan to another does not change the billing dates.

    I have included my code that is relavent to this problem. It is done in Node.js behind an Express.js web server and the code is just inside a controller function with some other stuff too.

    Here is the error log message that I get when I try to update the subscription.

    {"message":"plan: Error message: Error: Currency and interval fields must match across all plans on this subscription. Found mismatch in interval field.","level":"error"} 

    On the Stripe side, it is a single product with two different pricing plans where the only differences are the monthly/yearly and then the price is different of course.

    Hope the Reddit formatting of the code is not too bad... I tried...

    stripe.subscriptions .update(subscriptionID, { billing_cycle_anchor: 'unchanged', items: [ { plan } ] }) .then((subscription) => { if(subscription.id != null) { logger.info(`Successfully updated subscription for ${req.body.user.email}`); options.json = req.body.user; options.json.plan = plan; options.json.subscriptionId = subscription.id request.post('/plan', options, (error, response, body) => { if (error) { logger.error(`Error saving plan due to: ${error}`) logger.debug(error); return res.status(500).json({success: false, message: 'Error saving plan. Please try again later.'}) } if(response.statusCode == 500) return res.status(500).json({success: false, message: 'Sorry we were unable to save your plan.'}); return res.json({success: true, message: 'Successfully updated your plan.'}) }); } else { return res.status(500).json({ success: false, message: 'Error saving your plan.' }); } }) .catch((err) => { if (err) { logger.error(`plan: Error message: ${err}`); return res.status(500).json({ success: false, message: 'Error saving your plan.' }); } }); 

    Really hope someone can help me with this I've spent way too much time on it and the docs and Stripe responses are conflicting.

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

    Can somebody help this noob(me) out?

    Posted: 17 Jul 2019 09:38 PM PDT

    So im trying to learn how to program seriously for the first time. I decided to start with Python and chose the book Python Crash Course as my first learning tool.

    I love the book and feel like I'm progessing at a somewhat descent pace. However, for the life of me I can't figure out why I can't see all of my processed code in the terminal. It shows 16 lines and then the rest just doesn't show up. I can scroll down but that just takes me into utter blackness.

    I'm using Geany as my text editor (as recommend ed by the book) and I am on windows 10. I tried messing with the terminal settings to no avail. My google-fu failed me as well.

    Please help me out fellas.

    submitted by /u/Big-Doge
    [link] [comments]

    [C++] Problem casting a void pointer from mmap() to a volatile uint64_t pointer

    Posted: 17 Jul 2019 09:22 PM PDT

    Hello, I'm new to C++ and I'm having an issue with casting from a void pointer to a 64 bit unsigned pointer. Whenever I assign the new uint64_t pointer to point to the virtual memory mapping of "sometext.txt" it defaults to "1" instead of the proper address.

    https://pastebin.com/4AVbNBAv

    I suspect it either has to do with my casting (I've tried doing it in C style and it still has the same issue though?) or the way C++ handles pointers? I'm having a helluva time trying to search this issue online.

    Thanks for any help! I appreciate you taking the time to look :)

    Sorry I'm posting to this to here and /r/cpp_questions. That sub doesn't seem as populated :) Thanks again.

    Also, I tried using (void *) malloc(8); instead of mmap() and i'm still having the same issue :(. It returns a valid address to a chunk of memory.

    Links to learn more are also appreciated.

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

    [C++] Pointer to a dynamic array? How does that work?

    Posted: 17 Jul 2019 08:14 PM PDT

    Suppose I have a class named "Tiger" that has a bunch of variables/functions related to what a tiger does.

    In my separate "Zoo" HEADER file, I have declared:

    Tiger** tiger; 

    In my "Zoo".cpp file, I have declared:

    tiger = new Tiger*[tigerArraySize] 

    Can anybody help me interpret what this notation means?

    My guess:

    "tiger" is a double pointer? To the class "Tiger". How does that work?

    And in the .cpp file, 'tiger' equals to a dynamic array, Tiger? And its as large as "tigerArraySize"? But what exactly are the contents of this array? Is it {pointer to a class Tiger 1, pointer to a class Tiger 2...}?

    I'm confused and am not sure how to interpret this.

    Note: This is part of a larger project where I have to construct a "zoo" that contains any amount of tigers, with certain conditions affecting them over time (sickness, buying new tigers, selling them, etc.)

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

    A CS student seeking some advice!

    Posted: 17 Jul 2019 11:47 PM PDT

    Hi there, I am a CS student in my 2nd year. I am very good in Java ( OOP + Data Structures).I have working knowledge of C and C++ .I have pretty good proficiency in HTML and CSS. I know Flask framework too . I feel like I am very good in back end development but not that good in front end development

    I am looking for internships. I am willing to be a Full Stack Developer or Software Developer as an intern.

    So any advice about frameworks,technologies and programming languages which are in demand? And relevant resources too !

    Thanks ! Any kind of help is appreciated!

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

    Any change in the my index.html is not reflected on webpage. Any help ?

    Posted: 17 Jul 2019 11:45 PM PDT

    I downloaded demo version of particles.js and am trying to modify it using basic HTML . But none of the changes are getting reflected on the webpage. Is there any obvious thing which I am missing ? TIA

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

    Reddit-like website

    Posted: 17 Jul 2019 11:41 PM PDT

    What are the resources needed and things to be learnt for creating a site custom-designed for college with niche subreddits and such?

    submitted by /u/12_1999
    [link] [comments]

    Is rule engine suitable for validating data against set of rules?

    Posted: 17 Jul 2019 11:35 PM PDT

    I am trying to design an enterprise application that allows users to create subscriptions based on different configurations - expressing their interest to receive alerts when those conditions are met.

    While evaluating the options for achieving the same, I was thinking about utilizing a generic rule engine such as Drools to achieve the same. Which seemed to be a natural fit to this problem looking at an high-level. But digging deeper and giving it a bit more thought, I am doubting if Business Rule Engine is the right thing to use.

    I see Rule engine as something that can select a Rule based on predefined condition and apply the Rule to that data to produce an outcome. Whereas, my requirement is to start with a data (the event that is generated) and identify based on Rules (subscriptions) configured by users to identify all the Rules (subscription) that would satisfy the event being handled. So that Alerts can be generated to all those Subscribers.

    To give an example, an hypothetical subscription from an user could be, to be alerted when a product in Amazon drops below $10 in the next 7 days. Another user would have created a subscription to be notified when a product in Amazon drops below $15 within the next 30 days and also offers free one-day shipping for Prime members.

    After a bit of thought, I have settled down to storing the Rules/Subscriptions in a relational DB and identifying which Subscriptions are to fire an Alert for an Event by querying against the DB.

    My main reason for choosing this approach is because of the volume, as the number of Rules/Subscriptions I being with will be about 1000 complex rules, and will grow exponentially as more users are added to the system. With the query approach I can trigger a single query that can validate all Rules in one go, vs. the Rule engine approach which would require me to do multiple validations based on the number of Rules configured.

    While, I know my DB approach would work (may not be efficient), I just wanted to understand if Rule Engine can be used for such purposes and be able to scale well as the number of rules increases. (Performance is of at most importance as the number of Events that are to be processed per minute will be about 1000+)

    If rule engine is not the right way to approach it, what other options are there for me to explore rather than writing my own implementation.

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

    [C++] Are there any differences between these two if-else statements?

    Posted: 17 Jul 2019 11:32 PM PDT

    Are these two if-else statements equivalent?

    //statement 1 if (something something) { return true; } return false //statement 2 if (something something){ return true; } else false 
    submitted by /u/lotyei
    [link] [comments]

    Where do I begin?

    Posted: 17 Jul 2019 11:27 PM PDT

    So back in 2016 I decided to take a fall course in computer programming, I got a D. I want to learn programming on my own now that I graduated, however I just loaded up my visual studio and it says my license expired. I thought I had a full license through the school that was mine - apparently not.

    I am still pretty poor so I was wondering if there were any free programs like visual studio?

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

    Question for coding languages I need

    Posted: 17 Jul 2019 11:12 PM PDT

    Hey all!

    I have a potential idea for an event registration website and mobile. My question is which languages do I need to use for that specific use?

    Thanks!

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

    AI resources to study along with elementsofai.com AI course

    Posted: 17 Jul 2019 11:02 PM PDT

    I started taking elementsofai.com course about Artificial Intelligence. Now I'm looking for resources especially books about Artificial Intelligence which are suitable for a beginner to study along with the online course. I would be happy if you could help.

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

    What to learn, what to focus on...

    Posted: 17 Jul 2019 10:51 PM PDT

    Recently finished up a bootcamp and feel as if I do have a good understanding of HTML, CSS and basic javascript (DOM manipulation, etc. ), but now that the bootcamp ended and I am not in a streamlined course anymore, I find myself jumping from language to language and not being to commit to one thing - pretty much right now I have 2 or 3 specific things I want to learn; React, PHP/MySQL and WordPress.

    I am really interesting in getting a developer position as soon as I can, and I keep thinking my best option would be to get a position doing wordpress (theme) development, but at the same time I want to learn react and really get into front end development - I know I can do both, but I am wondering if anyone has advice or as been in my situation before. Would picking up wordpress/php/mysql be a good route to go? In terms of being able to get experience the quickest way. Not that I would then have my career set in wordpress, but rather use it as a stepping stone. I am thinking that I can easily get a WP position once I learn the basic and theme development, because I could easily tie it in with my knowledge I already have, and then that will open many new opportunity.

    Advice for an aspiring junior developer trying to get any position they can?

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

    Should I build things even if I don't know enough about subjects involved in making it?

    Posted: 17 Jul 2019 10:30 PM PDT

    I want to be able to learn effectively while building projects with new aspects I did not have exposure to previously. For instance, I am interested in making a computer vision program that will check how long your eyes are closed. If I didn't care about learning the details of how such a program is built, I would just got to pyimagesearch.com, copy one of the sample code provided there, and tinker with it until I got my intended result.

    But, I want to be able to learn with each new project in a meaningful way. I am aware that computer vision is a growing field, and to be able to understand the algorithms used, I need to have a working knowledge of linear algebra. Though I know some things about linear algebra, let's say I didn't. Should I go through a linear algebra textbook and only after understanding the topic as a whole dive into any other prerequisite topics before diving into how computer vision works, or should I just try and build what I want blindly, doing what I can to just make it happen (i.e. using someone else's code as a sort of template on how it works, or maybe just asking someone on StackOverflow on how to do certain things I want in my program), and look up each unknown step in a textbook (or any other reliable resource), even if I may not be able to completely understand that particular sub-topic in the context of what the resource is teaching?

    In my opinion, I should try to go for the latter, and, to ensure that my mind doesn't get confused with all the random information I encounter with each new project I try building, I could make a sort of mental framework of what each textbook the topics are covered in talks about as a whole by skimming through the chapters and then fit the topic I am trying to learn within that framework, like a puzzle piece. So, even if I am diving right into the middle of a textbook I haven't even fully read from the pages before, I can at least somewhat know the context that that particular piece of knowledge is in. In that way, I think I could later recall it when I am learning more from that textbook again for a different project. And if there are sub-topics I need to know before getting into the topic at hand, I would learn each topic, then repeat in a recursive manner.

    What do you guys think? Should I approach learning in this manner, or should I just go about it the traditional/slow way, reading from a textbook or resource in order from left to right?

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

    How to create color collision in Javascript

    Posted: 17 Jul 2019 06:26 PM PDT

     var canvas = document.createElement('canvas'); canvas.width = 1600; canvas.height = 900; document.body.appendChild(canvas); var similarX = 0; var similarY = 0; document.addEventListener('mousemove',function(event){ similarX = event.clientX; similarY = event.clientY; document.getElementById('body').innerHTML = "x:" + similarX + ", y:" + similarY; }) var square = new Image(); square.src = 'supersquare.png'; window.addEventListener('load' , start); var c = canvas.getContext('2d'); var images = new Image(); images.src = 'course.png'; function start() { c.clearRect(0, 0, 1600, 900); c.fillStyle = 'green' ; c.fillRect(similarX - 12, similarY - 50, 20, 20); c.drawImage(images, 0, 100, 600, 200) window.requestAnimationFrame(start) } document.body.appendChild(canvas); 

    The text above is Javascript code in between script tags in an HTML document. Most of the code comes from this, but the body of the HTML document has the id "body" so that the x and y values of the mouse pointer appear onscreen. the image "course.png" consists of various black shapes. A green square follows your mouse, and I want it to have a collision with course.png's shapes by detecting if the color green is touching the color black. Is there any way to create a function to do this?

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

    When and how to use documentation vs example code/stackoverflow

    Posted: 17 Jul 2019 06:21 PM PDT

    I often find that a bit of example code is much more easy to get to my goals than drudging through documentation. What is the purpose of documentation? How and when should you be using it versus examples and SO? Do "real" developers mostly use examples/SO or is it all in the documentation?

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

    What can you do with code academy?

    Posted: 17 Jul 2019 10:04 PM PDT

    I just started learning through code academy recently and I've really gotten invested. Currently, I'm a journalism and mass comm student but I want to learn code on the side to possibly begin taking web development jobs on as a side hustle. Does code academy actually prepare you for stuff like that?

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

    Javidx9's Youtube channel is an excellent place for those looking to learn how to do some very practical projects!

    Posted: 17 Jul 2019 11:27 AM PDT

    He does most of his coding in C++ but he tries to make his projects as language agnostic as possible. I've been binging many of his videos and I've learnt quite a lot so far. I just finished a (very) simple maze game with the help of his "Code-It-Yourself First Person Shooter Tutorial". The way he describes his methodology and thinking patterns makes it very easy to follow along, so I'm just sharing this so more people can discover him :)

    Also, here's the Github for my maze game. Feel free to criticise it, I need it lol

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

    [C++] Getting incorrect output in a program that adds two numbers represented as arrays.

    Posted: 17 Jul 2019 09:45 PM PDT

    void sumOfTwoArrays(int input1[], int size1, int input2[], int size2, int output[]){ int i=size1-1,j=size2-1,carry=0; int k=std::max(size1,size2); //Size of output would be (max(size1,size2)+1) while(true){ if(i>-1 && j>-1){ //When both arrays have digits left output[k] = (input1[i]+input2[j]+carry)%10; carry = (input1[i]+input2[j]+carry)/10; } else if(i>-1 && j<0){ //When only input1 has digits left output[k] == (input1[i] + carry)%10; carry = (input1[i]+carry)/10; } else if(j>-1 && i<0){ //When only input2 has digits left output[k] == (input2[j] + carry)%10; carry = (input2[j]+carry)/10; } else{ //When none of the arrays have digits left output[k] = carry; break; } i--; j--; k--; } } 

    The function adds two large numbers that are represented as arrays. For example, if the two numbers are 456 and 99879, then the arrays would be {4,5,6} and {9,9,8,7,9}. The arguments of the function are the sizes of the arrays, the arrays themselves and an output array where we must add the digits of the addition result.

    The program runs fine if the length of both arrays is the same but gives incorrect results for arrays of unequal length.

    For sample input 1 (Arrays of equal size):

    3 1 5 4 3 9 8 7 

    The expected and the program's output is:

    1 1 4 1 

    But for sample input 2 (Arrays of unequal size):

    7 1 5 4 8 7 6 5 3 9 8 7 

    The expected output is:

     0 1 5 4 9 7 5 2 

    But the program's output is:

     0 0 0 0 0 7 5 2 

    I suspect the problem is that the while loop ends as soon as any of the two arrays has no digits left to add (hence all those zeros at the beginning). I want to end the while loop only when none of the arrays have any digits left.

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

    How do you determine when and where to abstract code into classes and methods?

    Posted: 17 Jul 2019 01:43 PM PDT

    I'm a computer science major and just recently started to code in a professional environment at an internship that I got accepted into. I understand the theory and the meaning of what classes and methods are meant to do, but I struggle on understanding when it is appropriate to take code and abstract it into a class, or take the code and put it in a method. I was wondering if there might be general rules as to when and where to use each to help me get a little better at cleaning up my code

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

    No comments:

    Post a Comment