• Breaking News

    Thursday, January 9, 2020

    I'm teaching C# to an absolute beginner and putting our lessons on YouTube/Live streaming on Twitch. Would you like to learn with us? learn programming

    I'm teaching C# to an absolute beginner and putting our lessons on YouTube/Live streaming on Twitch. Would you like to learn with us? learn programming


    I'm teaching C# to an absolute beginner and putting our lessons on YouTube/Live streaming on Twitch. Would you like to learn with us?

    Posted: 08 Jan 2020 07:35 AM PST

    TL DR: There is a live stream at 8:00PM CST on Twitch. Meet me there and we'll learn to code. There are additional resources on my YouTube channel.

    I have a friend that has been trying to learn to program for almost a year, but nothing has stuck. I know a lot of people on this sub have the same problem. My goal is to help my friend, and along with him you, to break the slump and finally learn how to code. I've done tutoring in the past and I have created a lesson plan that explains codding in small chunks that build upon one another.

    The plan is to make him a full stack web developer.

    The first step is learning C# and how to program.

    I'll then be moving on to SQL.

    And finally, JavaScript and React to make a webpage.

    My timing is a little unfortunate. I know there has been a lot of excitement for the Python tutorials. I have a very similar idea, but for C# and web development.

    The first live streamed lesson will be tonight around 8:00PM CST for anyone that would like to join.

    Twitch: https://www.twitch.tv/themattbauer

    I also have a YouTube channel where I post every Tuesday. I will be releasing edited versions of the live stream in shorter videos.

    Lesson 0: Installing Visual Studio

    Lesson 1: Variables

    I also have the lesson notes and tasks on my personal website http://finalparsec.com/Blog/ViewPost/c-sharp-lesson-1. They are on GitHub as well, but this course is for complete beginners. So I don't expect you to know how to use Git.

    EDIT: There is also a Discord server you can join where I'll be posting schedule info and where you can discuss the lessons:

    https://discord.gg/EffvErM

    EDIT2: I had a great time on the stream with you all. Can't wait for the next one. The schedule is posted on Twitch and in the Discord.

    Twitch VOD Here

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

    Any self taught front end people here who got jobs?

    Posted: 08 Jan 2020 07:27 PM PST

    I would love to ask some questions if you don't mind and have time.

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

    Finally published an android app with very limited coding experience. Thank you YouTube tutorials and stackoverflow.

    Posted: 08 Jan 2020 03:32 PM PST

    It's not an amazing app and probably buggy but I'm just happy that I published something.

    What was your first app?

    App link

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

    Some recommendations of how to improve at programming without actually programming?

    Posted: 09 Jan 2020 12:49 AM PST

    Hello,

    Im currently planning on learning programming (python, absolute beginner). I have a desk job, with loads of free time that I plan on using for learning, but my company wont allow me to install python on my computer.

    So I would like to ask if you can recommend some courses or literature that doesnt require me to have python installed and still will help me improve. It doesnt necessarily have to be Python related, it can just be literature that improves your logical thinking, math, anything really, I just want to spend time meaningfully while at work. Ive so far only completed https://www.mooc.fi/ elements of AI course.

    Thanks in advance :)

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

    Implementing MinSweeper in CPP

    Posted: 09 Jan 2020 12:04 AM PST

    I'm learning CPP now and I want to implement a clone of MinSweeper; This is the code I wrote for it:

    #include<iostream> #include<time.h> #include<stdlib.h> #include<stdio.h> #include<iomanip> #include <time.h> /*Rules: The player enters 'o' , then enters value of i and j to open cell[i][j]. Enter 'f' ,then enter value of i and j to place a flag on cell[i][j] */ using namespace std; void reveal(int, int); /// reveals a cell with given coordinates void create_mine_positions(); void cell_number(); //increases the number of a cell with 1 void create_table(); //creates the game table void open_cell(); // opens a cell void game(); void print_table(char); // prints the game table char table[30][30]; //the game table visible ot the player char table_mine_positions[30][30]; //table with the positions of the mines and the number of each cell char symbol; //the input symbol, it can be 'o' or f' int flag_counter = 0; int mines_flagged_counter = 0; bool end_game_lose = false; time_t time_since_epoch = time(0); time_t game_time; void cell_number(int i, int j) { if (i >= 0 && i < 30 && j >= 0 && j < 30 && table_mine_positions[i][j] != 'X') table_mine_positions[i][j]++; } void create_mine_positions() { int counter = 0; srand(time(NULL)); for (int i = 0; i < 30; i++) for (int j = 0; j < 30; j++) table_mine_positions[i][j] = '0'; int i = 0; int j = 0; while (counter < 20) { int i = rand() % 20; int j = rand() % 20; if (table_mine_positions[i][j] == '0') { table_mine_positions[i][j] = 'X'; cell_number(i - 1, j); cell_number(i + 1, j); cell_number(i, j - 1); cell_number(i, j + 1); cell_number(i - 1, j - 1); cell_number(i - 1, j + 1); cell_number(i + 1, j - 1); cell_number(i + 1, j + 1); counter++; } } } void create_table() { for (int i = 0; i < 30; i++) for (int j = 0; j < 30; j++) table[i][j] = '*'; } void print_table(char arr[30][30]) { cout << " "; for (int i = 0; i < 30; i++) cout << setw(3) << i; cout << endl << " "; for (int i = 0; i < 92; i++) cout << "_"; cout << endl; for (int i = 0; i < 30; i++) { cout << setw(3) << i << "|"; for (int j = 0; j < 30; j++) cout << setw(3) << arr[i][j]; cout << endl; } } void open_cell() { int i, j; do cin >> i >> j; while (i < 0 || i > 9 || j < 0 || j > 9); if (table_mine_positions[i][j] == 'X') { table[i][j] = 'X'; end_game_lose = true; for (int i = 0; i < 30; i++) for (int j = 0; j < 30; j++) if (table_mine_positions[i][j] == 'X') table[i][j] = 'X'; } else reveal(i, j); } void place_or_remove_flag() { int i, j; do cin >> i >> j; while (i < 0 || i > 9 || j < 0 || j > 9); if (table[i][j] == '*') { table[i][j] = 'F'; flag_counter++; if (table_mine_positions[i][j] == 'X') mines_flagged_counter++; } else if (table[i][j] == 'F') { table[i][j] = '*'; flag_counter--; if (table_mine_positions[i][j] == 'X') mines_flagged_counter--; } } void input_symbol() { cin >> symbol; switch (symbol) { case 'o': open_cell(); break; case 'f': place_or_remove_flag(); break; default: input_symbol(); } } void reveal(int i, int j) { if (table[i][j] == '*' && table_mine_positions[i][j] != 'X' && i >= 0 && i < 30 && j >= 0 && j < 30) { table[i][j] = table_mine_positions[i][j]; if (table_mine_positions[i][j] == '0') { reveal(i, j - 1); reveal(i, j + 1); reveal(i - 1, j - 1); reveal(i + 1, j - 1); reveal(i + 1, j + 1); reveal(i - 1, j + 1); reveal(i - 1, j); reveal(i + 1, j); } } } bool end_game_win_check() { if (flag_counter == 30 && mines_flagged_counter == 30) return 1; else return 0; } void game() { create_table(); create_mine_positions(); while (!end_game_lose && !end_game_win_check()) { game_time = time(0); print_table(table); cout << endl << "Flags:" << flag_counter << endl; cout << "Time:" << game_time - time_since_epoch << endl; input_symbol(); } if (end_game_lose) { print_table(table); cout << endl << "GAME OVER" << endl; } if (end_game_win_check()) cout << "Time to complete:" << game_time - time_since_epoch << endl; cout << endl << "YOU WIN!" << endl; cout << "Do you want to play again? (y/n)"; } int main() { cout << "Rules:" << endl << "Enter 'o' , then enter value of i and j to open cell[i][j]." << endl << "Enter 'f' ,then enter value of i and j to place " << "or remove flag on cell [i][j]." << endl << endl; game(); return 0; } 

    First of all do you have any suggestion to improve my code? and next is I want to make the game table 30 x 30 ; can someone help me to make the game 30 x 30 with 20 mines? now the mines are 30, I want to make them 20 mines at all but I can't, once I change the mines function, it shows this characters. Thanks a lot <3

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

    Question about project idea - new to programming

    Posted: 08 Jan 2020 10:55 PM PST

    Hey, I am pretty new to programming and I am not sure if I am asking this question in the right place.

    I want to develop a webpage/chrome extension/maybe an android app for myself that can show me lots of different personal and public information I have from different sources all in one, customizable screen. I know JavaScript is handy for simple web apps but I'm not sure if I'll need to use a deeper language for the large variety of features I would like to possibly implement.

    I want to be able see things ranging from simple weather forecasts, to-do lists or calendars, to abstract things displayed such a sketch pad or graphs of fitness data calculated in the app itself : displayed in a customisable format (like an android home screen where you can move widgets around and change their size). Would JavaScript be the language that would help me build this project, considering that data would come from different services (personal and public)?

    The key features I want are a reliable way to record all information day by day, customization themes/appearance, and interactivity between these 'widgets' and their data. It would also probably need to be able to take personal data from other apps such as my Google Calendar, Samsung Health etc.

    It would look somewhat similar to this: https://i.imgur.com/7B7y0qU.png (iChrome)

    If this is not the right place to ask this question, could you point me in the right direction?

    Cheers :)

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

    After downloading, cloning a repo on Github, which file do I open to use the software?

    Posted: 08 Jan 2020 10:32 PM PST

    Hi,

    When there a free open source software on GitHub how do I use it?

    After i clone, download the repot there a whole bunch of files.

    Which file is the one you open to launch the software?

    I couldn't find anything online for this.

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

    Self-studying Python, onto I/O exceptions & need basic help

    Posted: 09 Jan 2020 01:18 AM PST

    So I'm two chapters further than the last time I posted in Murach's Python Programming textbook. Many of the examples are done with an array of movies to (1) be able to list those movies upon request, (2&3) add and remove movies from the array, and (4) exit the program altogether.

    With this I/O exceptions section, the user-made functions now contain try/except statements. Looks a lot like this:

    def read_movies(): try: movies = [] with open("movies.csv",newline="") as file: reader=csv.reader(file) for row in reader: movies.append(row) return movies except FileNotFoundError: print("Could not find "+movies.csv+" file.") exit_program() except Exception as e: print(type(e), e) exit_program()

    Anyway, I hope the format didn't come out too funky (on mobile again). I like including these exceptions with my code and what they do, but I'm not sure how common it is to be doing. I saw some of my friend's code in Python, but he's not particularly advanced with programming in it either, so I wasn't too sure about how representative his programming was for the usage of exceptions (he had none). Are exceptions really only done when we import datasets to Python to work with? I'd imagine that'd be a no, but the book only seems to use them when data is being imported.

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

    Why do we need a reverse proxy when we have load balancer ?

    Posted: 08 Jan 2020 09:25 PM PST

    Hi I am learning about various application components as a part of preparation for my interview.

    I came across load balancer and then reverse proxy.

    Reverse Proxy seems to do everything a load balancer does and much more. So why do we need a load balancer.

    More Importantly my question is what are the best practices around using LB and RP?

    Do they complement each other in some way ?

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

    Why does an advanced knowledge of maths and physics is necessary for coding?

    Posted: 09 Jan 2020 12:57 AM PST

    Hi everyone,

    I have no idea how coding and/or software developing works but people tend to say coding is like learning a new language. If that's the case, why does one need to know maths and physics for software developing. Can't one become a good developer if he/she learns a coding language perfectly? Or in other words, is there any chance for someone who sucks at STEM can become a developer? Yet, I don't know where maths come into play.

    Thanks

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

    Linux using Virtual machine or option when booting?

    Posted: 09 Jan 2020 12:48 AM PST

    I am planning to start learning Linux and was wondering....what would be more efficient.. installing a virtual machine or format my computer to install it along with windows??

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

    Conceptual Question Regarding Microservices Authentication

    Posted: 09 Jan 2020 12:03 AM PST

    I am currently working on a person project where I am starting on creating a protected Microservice that would require the user to be signed in as this service will only retrieve results if they are owned by the user.

    My question is more with where the authentication service I created should be. Either the protected service I am to create sits directly behind the authentication and the frontend makes call to a protected route within the authentication service that then makes a call to the protected service or within the frontend code a call is made to the auth service and then only if the request is successful a call is then made to the protected service.

    Worth stating that the Frontend is written in NodeJS and follows a MVC architecture so the requests are made on the service and the only input the user submits so far is user password credentials to create a jwt token. Wrapping all protected services behind the auth service code would bloat the auth service so much and make it responsible for thing it shouldn't be.. but in terms of security it is probably the most secure option.

    I suppose implementing access keys for frontend to any micro-service would make it more secure.

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

    How can i create subfolders from bat files?

    Posted: 08 Jan 2020 11:43 PM PST

    Hello everyone and happy new year!

    i'm trying to learn a little bit programming for bat files to create new files / folders but i would like to do something fun and new for me, Let's say we have the following folders:

    - *\Main\Folder1\sub1\sub2\sub3\sub4

    - *\Main\Folder2\sub1\sub2

    - *\Main\Folder3\sub1

    - *\Main\Folder4\sub1\sub2\sub3

    - *\Main\Folder5\sub1\sub2\sub3\sub4\sub5

    and i'm on the Main folder, i would like to create subfolder called "January_2020", for example in sub4 on the first example i would like to create the subfolder and so on...

    Thank you for your time, appreciate that.

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

    I need a little guidance to build an idea

    Posted: 08 Jan 2020 11:21 PM PST

    At my college, a very common side business is to sell clothes found for very cheap at thrift stores, they do this by making an Instagram account and just adding the pictures of the clothing there. I thought of making a webpage that works as an aggregator for these posts, that kinda looks like an e-commerce site, so people can see all of them in a single place, which benefits both customers and sellers. Given that not all posts are items for sale (they often post a picture of a customer wearing an outfit bought from them, a post saying "I'm sick, won't attend school on Monday, deliveries moved to Tuesday", etcetera), there would have to be a hashtag or a tag that works as a checkmark for whether to show the post on the webpage or not. I plan to charge a small fee to be able to be shown, so only a list of whitelisted accounts are going to be checked for new posts. First hashtag is to indicate the type of item (e.g. #skirt, #sweater), second one for size (e.g. #WM for woman's M). Don't want to categorize any further than that. Size ignored if first hashtag is #shoes (long explanation). Description of the item on webpage would be the same as the one on the Instagram post, minus any hashtags. Price can be pulled from description and shown on website, simply any number after the $ symbol. Product removed if #sold is later added. Also, my college has several different campuses, so there would be an option to select the campus you're in so you only see posts from people selling in that same campus.

    The design aspect I can manage it. Guess I'll have to create a JSON file with the whitelisted accounts and the campus they sell at to input at an Instagram scraper that outputs a JSON file for each username with their posts' information, and then a script that pulls info from that JSON file to show in the website, right? Please correct me if I'm wrong.

    Sorry for the long post, and thanks in advance

    submitted by /u/fetus-wearing-a-suit
    [link] [comments]

    Could someone ELI5 these compile instructions for this app?

    Posted: 08 Jan 2020 10:25 PM PST

    So I downloaded the source code... and, well, now what? I can't make heads or tails of the compilation directions. Do I need a computer running on Fedora to do this? Is it possible to do this with Windows Linux Subsystem? Not that I know how to use that either.
    https://github.com/stransky/berusky2/blob/berusky2-0.10/README

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

    What does "." mean in Java?

    Posted: 08 Jan 2020 12:37 PM PST

    I was unable to find anything on Google about this. I have learning Android development and this has been tripping me up.

    For example: setContentView(R.layout.activity_main) 

    Could someone explain this to me?

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

    Real-time multi-player browser game

    Posted: 08 Jan 2020 04:06 PM PST

    Hello world !! (cheesy joke)

    Turns out I'm not as smart as I thought I was. I've done a little programming in the past (Java, VB, c, unix, swift, flash, etc.) and I thought I'd be able to google my way into creating a simple (very simple) real time app. But it turns out I need some serious help. I've put in many hours/days of research and following tutorials and I think I'm still as confused as day one.

    My goal is to create real time multiplayer apps that mimic simple games u might play with ur grandfather. think tic tac toe or checkers. I'd like to create games that allow up to 10 players at the same time. My target browser is iphone's safari, maybe a couple android phones too.

    But of course, I need to start with something achievable. Maybe my problem is that there are so many technologies out there that I don't know which to start learning with. I "think" I need to use nodejs with webrtc. But what about socket.io and websockets? My thoughts are that everything should conform to current/future web standards like html5. I tried using Heroku a little bit, but is that the right place for the long term? I'm not too worried about scaling to a user base or more than 100 devices, at this point seems very unlikely. What about pubnub? What about all these frameworks I'm encountering? Do I need to know/use react/vue/angular/express? Progressive apps? And are there any tools out there that can help me create a more attractive front end with javascript?

    So what I wanted to do at first is to create a simple app that will let multiple ppl connect to it and each person can click one of three buttons to change the color of a box (or the background) and have that choice sent to all connected devices. But I have been unable to modify any of the tutorials to accomplish this. I hesitate to even write this post because it is so vague and I imagine most ppl will be unwilling or even know how to help. Which makes sense, cuz I'm not even sure I know what all the buzzwords I've used thus far mean! So I ask you, what can I start with?

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

    Google OAuth 2.0 calling signup function multiple times

    Posted: 08 Jan 2020 09:51 PM PST

    today I was just trying to integrate google signin. and somehow it just worked well on my localhost and when I completed the project and uploaded that on web server. then I see that after entering password in the google login pop. it logs in and gives me message (as index.php?login=success) and then calls signup functions multiple times. (I redirected errorhandlers to my index.php as index.php?error=usrtaken) so, its just keep loading all the time. I tried logout but then I have to run the logout script from another window and then it stopped.

    Here is my necessary code.

    <html> <head> <meta name="google-signin-client_id" content="xxxxxxxx-xxxxxx.apps.googleusercontent.com"> <div class="g-signin2" data-onsuccess="onSignIn"></div> <div class="g-signin2" data-onsuccess="onSignUp"></div> </head> <?php echo 'footer.php'; ?> </html> 

    footer.php

    <script src="https://apis.google.com/js/platform.js" async defer></script> <script> function onSignIn(googleUser) { var id_token = googleUser.getAuthResponse().id_token; console.log("ID Token: " + id_token); let form = document.createElement('form'); form.action = 'includes/login.php'; form.method = 'POST'; form.innerHTML = '<input name="token" value="'+id_token+'"><input name="valid" value="tpZCI6ImNkMjM0OTg4ZT"><input name="send" value="id_tokn">'; document.body.append(form); form.submit(); } function onSignUp(googleUser) { var id_token = googleUser.getAuthResponse().id_token; console.log("ID Token: " + id_token); let form = document.createElement('form'); form.action = 'includes/signup.php'; form.method = 'POST'; form.innerHTML = '<input name="token" value="'+id_token+'"> <input name="valid" value="tpZCI6ImNkMjM0OTg4ZT"> <input name="send" value="id_tokn">'; document.body.append(form); form.submit(); } </script> 

    my signup.php

    <?php if(isset($_POST['send']) && $_POST['send'] == 'id_tokn') { if(isset($_POST['valid']) == 'tpZCI6ImNkMjM0OTg4ZT') { $id_token = $_POST['token']; $client_id = "xxxxx-xxxxx.apps.googleusercontent.com"; $url = "https://oauth2.googleapis.com/tokeninfo?id_token=$id_token"; $result = file_get_contents($url); $json_decode = json_decode($result, true); if($json_decode['iss'] = "accounts.google.com") { if($json_decode['exp'] > time()) { require 'config.php'; $sub = $json_decode['sub']; if($stmt = $conn->prepare('SELECT vendorauth FROM vendors WHERE vendorauth=?')) { $stmt->bind_param('s', $sub); $stmt->execute(); $stmt->store_result(); if($stmt->num_rows > 0) { header("Location: ../index.php?error=usrtaken"); exit(); } else { $str = str_shuffle("mijsyg"); $vendorid = date("S$str"); $vendorfname = $json_decode['given_name']; $vendorlname = $json_decode['family_name'] if($stmt = $conn->prepare('INSERT INTO vendors(`vendorid`, `vendorauth`, `vendor_first`, `vendor_last`) VALUES (?, ?, ?, ?)')) { $stmt->bind_param('ssss', $vendorid, $sub, $vendorfname, $vendorlname); $stmt->execute(); header("location: ../index.php?reg=sucess"); exit(); } }} } } } } 
    submitted by /u/arpitpatidar
    [link] [comments]

    Is there any way to access Netflix/Amazon/Hulu, etc. API's or check to see if they contain a certain movie or tv show?

    Posted: 08 Jan 2020 09:35 PM PST

    ^title

    Looking to see if I can "easily" access a streaming service to see if they contain a specific tv show or movie

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

    How can I improve my code ?

    Posted: 08 Jan 2020 05:10 PM PST

    Hi,

    I just made a little snippet and I wanted to know how I could improve it, in terms of optimisation, shortness etc.

    Could you give me your opinion, please ?

    https://codepen.io/gr-goire-fd/pen/bGNvNJL

    Thanks

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

    (Java) is interrupt() only for sleeping threads?

    Posted: 08 Jan 2020 08:48 PM PST

    I'm new to threads and anytime I see interrupt() it's always for threads with a sleep function. Can it work for threads without a sleep function? I tried writing one and it froze jframe.

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

    HELP TO FIX The terminal process command 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed to launch (exit code: {2})

    Posted: 08 Jan 2020 08:26 PM PST

    I cant start the python script that my friend gave it says The terminal process command 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' failed to launch (exit code: {2}) can somone help me please i dont know what`s the reason why im having this kind of issue

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

    How to prepare for competitive programming

    Posted: 08 Jan 2020 08:20 PM PST

    I know this question gets asked a lot, but what's the best way for an average level programmer to quickly improve his competitive programming skill? There are tons of sites like hackkerrank, codewars, and codeforces, but I'm not sure which site is the best and which questions I should be doing on those sites. Any pointers would be great.

    thanks

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

    How to map an array of decimal values to a color bar gradient?

    Posted: 08 Jan 2020 08:15 PM PST

    I have an array of 256 decimal values, ranging from -1 to 1. These 256 values are mapped to a scale of -3 to 3.

    Once they are mapped to the scale, they need to be mapped to a small rectangular color bar. The color schema for the color bar would blue and yellow, with the lowest (-3) being blue and highest 3 being yellow. How can I achieve this?

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

    No comments:

    Post a Comment