• Breaking News

    Tuesday, April 9, 2019

    Stumped on something? Take a walk. learn programming

    Stumped on something? Take a walk. learn programming


    Stumped on something? Take a walk.

    Posted: 08 Apr 2019 09:11 AM PDT

    So I was working on my programming homework yesterday for class and for some reason, I could not figure it out.

    I then decided to go out for a walk, and low and behold, I figured out a way to solve it!

    My mind for some reason was thinking much more "freely," and my thoughts were much clearer.

    It helped me a lot today as well, I have a presentation, basically a speech in a week, and I decided to think about it during a walk,

    and as if it were magic, I think I came up with the entire speech.

    My mind was much more creative and I was able to "freestyle" my entire speech, I ran home to write it all out before I forgot it all :)

    Hopefully, this helps.

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

    I made a website where every day I add a beginner-friendly explanation of one of the top posts on /r/programmerhumor.

    Posted: 08 Apr 2019 12:11 PM PDT

    I always encourage my programming students to look at a/r/programmerhumor because (a) it's funny, (b) you see that programmers everywhere share the same strugglers/impostor syndrome, and (c) you learn a surprising amount, even as a senior developer. It's one of the subs I look at the most.

    There have been a couple posts on /r/all joking about not understanding /r/programmerhumor. This prompted me to start Explain Programmer Humor. I'm challenging myself to write a new explanation every day that any non-programmer could understand and (hopefully) enjoy reading. It's a good learning experience for me too!

    I'm also posting my explanations and comments in /r/programmerhumor. Today's is about Impostor Syndrome.

    I feel really passionately about tech education, and hope this is useful. If there are any posts you don't understand, or if you have feedback, I'd love to hear it!

    https://explainprogrammerhumor.com

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

    Started a C# YouTube tutorial series for people who've never programmed before

    Posted: 08 Apr 2019 06:37 AM PDT

    Been thinking about this for a while so I finally started a C# tutorial series. Aimed at those who've never programmed a day in their life. If you're interested in C# check it out. Will be going through the fundamentals and later on be taking requests on specific things people want to learn (.NET Software Engineer).

    Check it out, share some feedback if you have a moment

    https://www.youtube.com/playlist?list=PLkToKRR6x_lBlVMN-EiB_qaKYOQ4j_iZX

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

    Beginner programs for C++

    Posted: 09 Apr 2019 12:24 AM PDT

    Everyone, can you suggest good beginner programs for C++.

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

    How to fix OneSignal push notification returning “All included players are not subscribed”?

    Posted: 08 Apr 2019 09:38 PM PDT

    I'm trying send notifications into a device in which my app is installed using php, pushing notifications to all users was successful when using 'included_segments' => array('All') , but when i try to use filters i get All included players are not subscribed response error, this is the push notification script i'm using:

    push.php

    <?PHP function sendMessage(){ $content = array( "en" => 'Testing Message' ); $fields = array( 'app_id' => <omitted>, 'filters' => array(array("field" => "tag", "key" => "etab", "relation" => "=", "value" => "1")), 'data' => array("foo" => "bar"), 'large_icon' =>"ic_launcher_round.png", 'contents' => $content ); $fields = json_encode($fields); print("\nJSON sent:\n"); print($fields); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://onesignal.com/api/v1/notifications"); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json; charset=utf-8', 'Authorization: Basic <omitted>')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_HEADER, FALSE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $response = curl_exec($ch); curl_close($ch); return $response; } $response = sendMessage(); $return["allresponses"] = $response; $return = json_encode( $return); print("\n\nJSON received:\n"); print($return); print("\n"); ?> 

    Output

    JSON sent: {"app_id":<omitted>,"filters":[{"field":"tag","key":"etab","relation":"=","value":"1"}],"data": {"foo":"bar"},"large_icon":"ic_launcher_round.png","contents":{"en":"Testing Message"}} JSON received: {"allresponses":"{\"id\":\"\",\"recipients\":0,\"errors\":[\"All included players are not subscribed\"]}"} 
    submitted by /u/sandnog
    [link] [comments]

    Trying to learn how to code

    Posted: 08 Apr 2019 05:50 PM PDT

    I've decided to try to learn how to learn C#, though my highschool schedule isn't flexible enough for me to fit in a class. My father's job solely revolves around programming and is a complete computer geek (which I think is awesome), and I'm trying to take up his trade. He's pointed me to some websites to help me get started. I guess I'm wondering if anyone out there has learned to program without actually taking class, and how was your experience with it?

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

    I'm 26 and very interested in programming, but also very intimidated.

    Posted: 08 Apr 2019 05:54 PM PDT

    As the title says, I'm 26 and programming has always been something that interests me, but I was so intimidated and unsure, I never took the plunge into college after high school. I'm currently working a dead end job that pays well enough but I'm completely unfulfilled. I've finally reached a point where I'm ready to commit on an attempt at least, but I've got some questions I was hoping someone who's been through it can answer.

    1. Can I realistically learn and land a job without going to college? Money and time aren't abundant right now, and learning at my own pace from home would be much easier to work in. I've seen alot of ways to learn online, but I worry that most jobs in the field would require a degree.
    2. If I can realistically learn from home online, what tools or resources would be recommended for my situation?
    3. Should I start with a programming language focus? I know that there are many languages in programming, game development would be the dream, but I think I'd be happy developing web pages or applications.
    4. What are some entry level jobs should I be looking at in the field? Something to get my foot in the door would be ok, even if its not programming directly.

    I really appreciate anyone who's taken the time to read and answer all this. I'm very excited about making this change in my life.

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

    Can someone help me with my basic JavaScript image Changer Code?

    Posted: 08 Apr 2019 10:44 PM PDT

    I'm a beginner learning coding through MDN (as well as Free Code Camp).

    In MDN, I've reached the part of the JavaScript basics where they show you how to add JavaScript to your test website that will change the image to another image when you click on it. Here's the code:

    var myImage = document.querySelector('img') myImage.onclick = function() { var mySrc = myImage.getAttribute('src'); if(mySrc === images/mosquito-bitch.jpg) { myImage.setAttribute ('src','images/mosquito-bitch2.jpg'); } else { myImage.setAttribute ('src','images/mosquito-bitch.jpg'); } } 

    All this code is in a .js file in a scripts folder within the same folder where my website's .html file is.

    I made sure the images are in the images folder and that I named them correctly. I tripled checked I didn't make a typo (I'm gonna look stupid if there is a silly typo).

    I remembered that I changed the mosquito-bitch.jpg's size with a style class in my styles file and removed that to see if it would do anything but nada. All the other JS code has worked so for so I'm stumped as to why this isn't working. I'm a complete beginner so I'd appreciate any help.

    My test website is about how much I hate mosquitos, if anyone was wondering.

    EDIT: Problem solved. I'm an idiot.

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

    The Largest & Smallest of the File

    Posted: 08 Apr 2019 10:39 PM PDT

    I need help with the following problem. I have some code done which is store below.

    Write a program that generates a list of random numbers of type int and output to a file named randoms.txt. Then opens the file random.txt, takes its input from the file of numbers of type int and outputs the largest and the smallest number found in the file to the screen.

    The program reads all the numbers from the file, and calculates the following:

    A) The number of integers in the file

    B) The sum of all the numbers in the file (a running total)

    C) The average of all the numbers in the file

    The file contains nothing but numbers of integers by blanks and/or line breaks. You will need to create one or more test files in order to test your program

    The program should display the largest and smallest numbers, # of numbers found in the file, the sum of the numbers, and the average of the numbers.

    Average: Set up the output formatting to two digits after the decimal point.

    #include <iostream>; #include <fstream>; #include <cstdlib>; using namespace std; int main() { ofstream write; write.open("output.txt"); if (write.fail()) { cout << "Error opening file" << endl; exit(1); } int high, low, sum, count; double number, average; high = 0; low = 0; count = 0; sum = 0; ifstream read; read.open("random.txt"); if (read.fail()) { cout << "Output file opening failed" << endl; exit(1); } while (!read.eof()) { if (number > high) high = number; if (number < low) low = number; sum = sum + number; count++; } average = (double)sum / count; write << "There are " << count << " numbers in the file." << endl; write.setf(ios::fixed); write.setf(ios::showpoint); write.precision(2); write << "The sum of all numbers is " << sum << endl; write << "The average of all numbers is" << average << endl; write.close(); read.close(); } 
    submitted by /u/Dilnob2K
    [link] [comments]

    How do I start a career in web development?

    Posted: 08 Apr 2019 06:44 PM PDT

    I'm just turning 16, and I was first introduced to programming at khan academy with JavaScript. Then I learned how to create a basic website with html, how to make it interactive with java script, and how to style it with css.I also toyed with an arkbotics sparki(python). Then I could code outside of Khan with sublime text, and then I learned how to do it with notepad.

    So out of all those languages, I was most comfortable with javascript. I never created anything fancy mostly because I didn't know how to. The web is a great place to learn, but can I get a job self-educated? I heard freelancers make quite a bit less than those hired with bachelor degrees, and even less so than those with masters. So looking at the wages, I saw python paid the most. Is there anyway I can build my knowledge at an early age, maybe even making money for an education? What does a developer actually do? That sounds like a broad question, so I want to be more specific: What does a python developer do? Is there any point in messing with node.js and github, socket.io , express jquery etc if I don't go and get an expensive college education for my career? What would you recommend for someone who has basic knowledge and wants to grow but just doesn't know where to even begin? It seems there is just too much to learn. I thought maybe the best way would be projects(eg. creating a functional online game with websockets) but then I run into a stumbling block and it takes me a long time to debug and figure out just what was wrong. I'm done dabbling, can anybody here help me get serious about it and lead me in the right direction?

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

    Updated my personal project, Thanks for your suggestions. I highly recommend everyone learning programming find a project they are passionate it about, it is 1000x better than learning from tutorials!

    Posted: 08 Apr 2019 03:45 PM PDT

    Hello everyone! I posted here recently asking for suggestions on my personal project and I just wanted to reach out and show that I implemented some of them. I also bought a domain: jamminmovies.com . Thank you so much for your suggestions, having so much fun continuously improving upon this website that I am making. It is such a great feeling making something that is actually useful as well and layered. Feel free to use the website if you wish, it supports individual accounts now! I plan on continously improving upon this project until it is of a more production grade quality so stay tuned if interested. Thanks again!

    edit: Also if any suggestions/ bugs(Im sure theres a million to be honest) I would highly appreciate if you would let me know! Thanks!

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

    Creating a game.

    Posted: 08 Apr 2019 09:13 PM PDT

    I am about to begin a long journey of creating an educational game, however I am not sure if I should create it for mobile, browser. Would you recommend doing one over the other, or doing both?

    Also, would I be able to use javascript for the mobile version too? (Not just the browser version)

    If you need me to specify anything, don't hesitate to ask. :)

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

    Begin Programming (with JavaScript) for Complete Beginners

    Posted: 08 Apr 2019 03:41 AM PDT

    Hi, I created a programming guide for complete beginners.

    Other than rules and syntax, it also gets into the problem solving aspect of programming. All concepts are explained and visually illustrated in a way that anyone can understand. (Please let me know if something isn't clear to you.)

    Also there's exercise at the end of each chapter.

    http://beginjs.com

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

    [javascript] Why my object output written only [Object] ?

    Posted: 09 Apr 2019 12:36 AM PDT

    screenshot

    This is using code runner in vscode, same when i tried using repl.

    This is an output from a function that take an object of list of person, i manually pushing them to the specific gender.

    Here's the code, it suppose to be a full list like this.

     result[persons[i].gender].persons.push({ "id": persons[i]["id"], "first name": persons[i]["first name"], last_name : persons[i]["last_name"], email: persons[i].email, age: persons[i].age, "score": persons[i]["score"] }) 
    submitted by /u/Nero420
    [link] [comments]

    [C#] Can't output to console with GUI

    Posted: 09 Apr 2019 12:09 AM PDT

    Off the spur of the moment I decided to crack open on old C# GUI program I had invented a few years ago and try to change things around. It's basically a password bank I use to try and store all my passwords. It works relatively well but I wanted to try to add the ability to output to the console as well. I tried with just one part of the program but it didn't work as I thought it would.

    When the program runs, the text in the TextBox component is initially censored out as it's seen as a Password as you can see in the code. When I click the button, the text becomes un-censored. But I also want it to print to the console.

    https://ideone.com/BwgiPO

    I got the idea from another C# GUI program I created a few years back that was able to output to the console just fine but when I tried to copy the same technique it didn't work and I can't figure out why.

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

    Adding frameworks or other code to the project.

    Posted: 08 Apr 2019 11:49 PM PDT

    Hello all,

    So I'm just wondering if this is possible. Say I have a site with HTML, CSS, and JavaScript, but I'd like to add a framework like nodejs or something like mongodb.. is this possible to do? Or should I just do HTML, CSS, js, and add php for the whole stack?

    I'm trying to figure out how to make everything connect. I thought about mern. Thought about some other stacks, but someone told me to go back to basics and learn this way. Can I easily implement a database for user logins, a login system, and stuff like this with just php or do I need a framework?

    I'm so confused. I want to make this easier on myself AND understand it and how to make my site fullstack fully, rather than dig myself into a deep hole with hard to learn languages or frameworks that don't make much sense and take a while to learn.

    I started this coding journey almost 3 months ago and I've learned so much so quickly, but I always get conflicting answers about what to do , and so I don't know if I should use vanilla code to do things or frameworks.

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

    Learning Assembly Language - Need Advice

    Posted: 08 Apr 2019 11:42 PM PDT

    Where and how is the best way to learn Assembly Language? Any tips would be greatly appreciated. Much respect!

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

    From Java to C# (version 2019)

    Posted: 08 Apr 2019 11:30 PM PDT

    I'm a beginner Java programmer (I've completed Helsinki uni Mooc and studied some Spring) and I'm looking for good C# tutorials / other resources.

    I already know about Pluralsight (C# path), C# Yellow Book and Microsoft Visual Academy (https://mva.microsoft.com/en-US/training-courses/c-fundamentals-for-absolute-beginners-16169 and https://mva.microsoft.com/en-US/training-courses/programming-in-c-jump-start-14254?l=j0iuozSfB_6900115888) but are there any good up-to-date resources for someone like me who already knows the basics of programming and don't need to be explained what a method / variable etc are?

    I want to get into C# because I'm interested in desktop application development and also because most of the Java jobs seem to be for senior programmers (while most of the entry level jobs are C#, go figure?).

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

    "Try not to repeat the same mistake over and over" - How can one learn to avoid doing this?

    Posted: 08 Apr 2019 07:31 PM PDT

    [This is directed more towards people learning or starting their career in tech]

    That's some advice a more experienced friend told me, specially when starting out. It's normal to make mistakes, but in order to improve and progress, you should learn to implement the lessons learned and avoid repeating the same mistake.

    Does anyone have some practical advice for this? Do you keep notes of mistakes to keep an eye for? Do you log them?

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

    Big O - is there a strategy for knowing which function is faster than another?

    Posted: 08 Apr 2019 10:55 PM PDT

    I have the following list of functions and I need to sort them by their big-Oh notation. A lot of them are non standard... is there a strategy for comparing two functions to determine which is faster?

    https://imgur.com/a/5drjF3A

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

    (C Programming: Strings)

    Posted: 08 Apr 2019 10:52 PM PDT

    https://imgur.com/a/DOf8QjV

    #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX_STR 100 #define MSG_NOT_EMPTY "The string is NOT empty." #define MSG_EMPTY "The string is empty." int main(void){ char str[MAX_STR]; char str2[MAX_STR]; int i; int len_str; fgets(str, MAX_STR, stdin); len_str = strlen(str); for(i = 1; i < len_str; i++){ strcat(str2, " "); } /*strcat(str2, "\0");*/ puts(str2); if(strcmp(str, str2) == 0){ printf("%s\n", MSG_EMPTY); }else{ printf("%s\n", MSG_NOT_EMPTY); } return EXIT_SUCCESS; } 

    Hello, I'm trying to solve a simple exercise of strings: I'm supposed to get a string through stdin and then check if it's empty or not. To make it simple I considered it empty if it's composed exclusively of spacebar characters. To do that, I check the length of what I read through the stdin. Then create a second string composed of only spacebar characters (this second string with the same length as the first one). Finally, I compare if both strings are equal. I can clearly see that the second string is being created correctly, so the problem is either in reading the first string or when comparing with strcmp() (I think this is the problem, I can never make strcmp work the way I want it to). Do you have any clue of what could be happening?

    Thanks in advance!

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

    Need help coding

    Posted: 08 Apr 2019 10:20 PM PDT

    Is there anyone who can help me live or even through emails on coding. I need help with some of the coding for my homework.

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

    [Question] Okta authentication & linking to a MySQL Database

    Posted: 08 Apr 2019 10:20 PM PDT

    I'm working on a project & was curious if I am able to link an okta user to a MySQL dB. The users MySQL database would contain their email, name, address, products ect.

    Okta seems like it's pretty easy to setup. Is it possible to use their token to sync to the database?

    Thanks!

    submitted by /u/86thecake
    [link] [comments]

    Auto Typer Via List

    Posted: 08 Apr 2019 10:14 PM PDT

    I am completely new to coding, but recently something came up and I was interested in learning how to code my own program that would take a .txt file and type it into a little box that I select (I wanted to learn how to set a box up using a tool similar to screen shotting tools.

    Basically I have absolutely no coding experience, so what would the recommended code type be for this type of project and where should I go to learn about something like this?

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

    No comments:

    Post a Comment