• Breaking News

    Thursday, March 28, 2019

    As someone who learned the basics of programming from Scratch, I thought it would be cool to make a game where you use a custom Scratch-like interface to build spells and defeate baddies! learn programming

    As someone who learned the basics of programming from Scratch, I thought it would be cool to make a game where you use a custom Scratch-like interface to build spells and defeate baddies! learn programming


    As someone who learned the basics of programming from Scratch, I thought it would be cool to make a game where you use a custom Scratch-like interface to build spells and defeate baddies!

    Posted: 28 Mar 2019 09:57 AM PDT

    As the title states, I learned programming in college and the first course I took used scratch to introduce basic logic and functions. Fast forward 9 years... I've been developing as a profession, and a hobby, and one of those hobbies includes game development. I always wanted to incorporate teaching programming in a game, and it just happened to fit perfectly in this case! Here's a quick sample from Spoxel:

    https://i.imgur.com/ZKfuxe9.mp4

    Basically, you have a start block, logic, conditionals, loops, and triggers, and you can make spells that can either obliterate enemies, automate tedious tasks, or more! My hope is that people can see that programming can be both fun and entertaining (especially when you get to watch things go boom!), and be less reluctant to try it out.

    I also incorporated a basic model editor for a similar reason, so that people can toy with editing 3D models into whatever shapes they like :)

    https://i.imgur.com/mRbKaUb.mp4

    Anyways, thanks for reading and if you have any questions about Spoxel let me know!

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

    Programming Resources

    Posted: 28 Mar 2019 10:28 PM PDT

    Who here is learning programming (or already knows know to program) just for fun as a hobby vs attempting to turn this into a career?

    Posted: 28 Mar 2019 03:09 PM PDT

    So I've been dabbling in programming but only as a hobby. I have a pretty successful career in a non tech field and am not really open right now to starting over in my late 30s in a completely new field. With that said, I do find programming fun and have enjoyed the time I've spent on it outside of work.

    Given that most people here are likely looking for careers in programming/software engineering, I'm curious who else is here solely for pursing a hobby? What got you into programming, what things are you doing with these skills and what keeps you motivated?

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

    First time ever coding and my Hello, World is already wrong, can someone please help??

    Posted: 28 Mar 2019 04:32 PM PDT

    Hey all,

    Decided I want to learn C++ and just started today. Was doing the famous "Hello, World" and kept getting this once I run without debugging? Can anyone tell me what this is, why it's there, and how to make it stop? Below is my code and here's what it says when I run it.

    "Hello, World!

    c:\users\admin-101\source\repos\HelloWorld\Debug\HelloWorld.exe (process 7140) e

    xited with code 0.

    Press any key to close this window . . ."

    #include <iostream> int main() { std::cout << "Hello, world!"; return 0; } 

    Bonus Question:

    For a beginner, do you recommend learning JavaScript or C++ first?

    Edit: I don't want that middle 2 lines to come up once I start it. I should have included that because I don't think that is correct. Please let me know what I am doing wrong.

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

    High Quality Assorted Computer Science Tutorials [self promotion]

    Posted: 28 Mar 2019 11:42 PM PDT

    Hi,

    I've noticed a common pattern amongst us. We collects loads of resources and bookmarks but don't actually take the efforts to go through any of them.

    An effective way to get past this is to focus on one tutorial and take it to completion.

    So I'll be sharing one resource / link every 4 or 5 days. Sometimes I might fall behind the schedule but certainly won't exceed the stated frequency.

    So in short.

    • One post every 4 or 5 days.
    • Different domains and different languages.
    • Sometimes it'll be a drill down article on stuff we use but haven't explored.
    • At times touch upon new concepts in an intuitive way.
    • I'll only share articles that I can vouch for.

    If it's something that might interest you, here's how you can follow along.

    Thanks for your time :)

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

    [Android] How to create an overlay activity on top of everything

    Posted: 28 Mar 2019 11:10 PM PDT

    First of all I am sorry if the title sounded a little vague, What I want to do is create an activity which will be shown on top of whatever user is currently doing without opening my app.

    The parts I've figured out,

    • I'll have to use a service since I don't want my app to open

    • The service will use a SensorEventListener to listen for a shake, If a shake is found the service will then trigger an overlay Activity

    • Since newer APIs put strong restrictions on background services I decided I'll just make a foreground service

    The parts I can't figure out,

    • How do I draw an overlay activity that shows up on whatever user is currently doing?

    for reference I want to do something exactly like this (overlay highlighted in yellow boxes)

    https://i.imgur.com/eI4bot9.png

    https://i.imgur.com/sz0iggL.jpg

    Hopefully someone in here can show me a guide, tutorial, code or whatever that solves my problem, Thank you!

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

    Stuck Unit Testing FOUR Lines of Code!

    Posted: 28 Mar 2019 06:41 PM PDT

    Good evening!

    I've been trying to post this but not super familiar with how posting on Reddit works. I know how to read it though!

    So, take #3.

    I'm in a very fortunate position where I co-op during my last two semesters. I learned though I don't know squat about programming! There's a lot of great senior developers helping me. They throw around terms like Domain Driven Design, Anemic and Rich models, SOLID principles, and more! I learned fast I don't know as much as I thought I did.

    I decided to try to implement some of the terms I recently learned. I tried building a Health Check site. I doubt the company I am working for needs it, but I thought it may help and I could try using some of my new knowledge.

    With that said I am stuck on FOUR simple lines of code!

    I tried to implement a rich domain model below , at least I think it's a rich domain model.

    public class Endpoint { private String siteName; private String siteURL; private String status; private Date lastChecked; public Endpoint(String siteName, String siteURL) { this.siteName = siteName; this.siteURL = siteURL; } // getters and setters // How to test this method? public Boolean isSiteUp() throws IOException { URL url = new URL(this.siteURL); HttpURLConnection connection = (HttpsURLConnection) url.openConnection(); connection.setRequestMethod("GET"); return connection.getResponseCode() == 200; } 

    I pass in a site name and a site url. I use that url to create a URL object. The code works but I do not know how in the world to test it!

    I'm familiar with test driven development JUnit, Mockito, Hamcrest, etc. I can't seem to figure out how to test these four simple lines. To be honest, I am a little embarrassed to ask.

    I thought I could bring up a server which would turn this test into an integration test. I don't know if that's what I want to do.

    I then tried to extract the URL and HttpURLConnection objects out of the method. That way I could pass them in via setter injection. Then I could mock them using Mockito.

    I learned that I cannot mock the URL object because it is a final class. This lead me to looking into PowerMock. I didn't have much success with that either.

    What I am trying to do is given I create an endpoint object, when I call isSiteUp, then it should return whether the site is available.

    Any help would be very much appreciated.

    Thanks!

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

    Top tools for junior frontend developer

    Posted: 28 Mar 2019 07:02 AM PDT

    Introduction

    I've created a list of top tools for junior frontend developer and explained why you should use them. It's hard to choose what to learn when you're starting your journey as a frontend developer. There're plenty of sources, courses, tutorials or frameworks to choose from. You might get confused starting researching all above. One practical approach is a craftsman road where you learn the process by tools.

    GitHub

    GitHub is a web-based hosting service for version control using Git. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its other features. It provides access control and several collaboration features such as bug tracking, feature requests, task management, and wikis for every project. Github is also a great community where you find and collaborate a lot of open source projects.

    Chrome Dev Tools

    It's a set of developer tools built into the Chrome browser. With DevTools you can access the internals of any web application, see how it performs on different screen sizes and change any page. You can edit pages real-time and diagnose problems quickly. It ultimately helps you build better websites and faster. Additional network tools can help you optimise your loading flows while a timeline gives you a knowledge of what the browser is doing at the moment.

    React Developer Tools

    React is a popular javascript framework among web development last years. However, Google Chrome Developer tools cannot examine the Dom as React Components. Don't be confused; there is a Chrome Extension called React Developer Tools that allows you to get into the nitty-gritty of how data is passed through components.

    Pixel Perfect

    This chrome extension helps develop your websites with per-pixel sharpness! It's for web developers and markup designers. PerfectPixel allows developers to put a half-transparent image overlay over the top of the developed HTML and perform pixel perfect comparison among them.

    Visual Code Editor

    Visual Studio Code is the number one code editor for building and debugging modern web and cloud applications. It's very customizable, has built-in git, massive list of integrations, powerful autocomplete and debugging features. It's a powerful multilanguage IDE, super fast and simple. Also, free an open source.

    Codepen

    Codepen it's amazing web-based and community-driven code editor. You can see right away results of code. It's a magic place for designers and front end developers where people are sharing and commenting on their front end skills. It's a great source of inspiration for new ideas and ways to code. The editor is used for: prototyping new ideas, instant bug testing, sending clients things to look at, evaluating potential hires and finding inspiration.📷

    GraphQL and GraphQL Editor

    GraphQL is a query language for APIs. It's very trendy nowadays and recognised by leading tech organisations. GraphQL Editor makes understanding GraphQL schema a lot easier. Plan it out by linking visual blocks and our editor will transform them into a code! Create fake backend out of GraphQL, and you could power up your application.

    Npm

    It's a package manager for JS. It helps to find packages of reusable code and compile them in new ways. It has over 470,000 free code packages in the database to be used by you. This web dev tool is a command-line utility for interacting with a repository that aids in the package. It also has team features with your private namespace.

    Webpack

    It's a bundler for javascript and friends which packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, CoffeeScript, LESS, ... and your custom stuff.

    Figma

    Figma is a design app but very trendy and good to collaborate with designers. Every Figma file has Code Mode where a developer can inspect design files. When designer share view-only files with the developer, he will have access to Code Mode where they can examine, comment, and export without having full edit access to the files.

    https://web.dev/

    Every web project needs proper feedback and testing. With this tool, you can check how your website performs according to modern standards. You can measure things: performance, PWA status, accessibility or SEO. Also, you can practice skills: like load speed, network resilience or data security. Check how your website performs over time, and keep track as you learn on your schedule.

    Terminal

    A terminal is a text-based interface you can type your commands in. A shell takes these commands and tells the operating system to execute them. Getting familiar with tools like Git from the terminal gives you more power and flexibility over GUI. In the end, a GUI is a graphical shell in front of a command-line tool. Being "closer to the metal", it can also help you to get out of trouble in case a GUI is stuck or messed up. It's an essential productivity tool in a developer's arsenal.

    Others

    • Caniuse.com - are you worried about browser compatibility for some cutting edge ideas? Try this site and see if you can use it.
    • StackOverflow - that site doesn't need explanation ;)
    • TinyPNG- Advanced lossy compression for PNG images
    • Compressor.io - another image compression tool
    • Notion.so - recording notes, specs, product owner feedback and planning.
    • Postman - when working with REST APIs.

    What tool impressed you most at early stage or your career?

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

    Linking OpenCV static libs help?

    Posted: 28 Mar 2019 10:05 PM PDT

    Hello, I know this might be a violation of the rules but I am really desperate. I have asked this question on stackoverflow with no success. Has anyone here successfully compiled OpenCV in static mode? I really need to deploy my program as easily as possible for my teammates to test without installing or compiling opencv from source. All answers point to the 'correct order' when compiling and I understand that. But I am lost on where to find the proper order for the dependencies and what dependencies to include. I would appreciate if anyone here has been successful in doing this. I am currently using opencv4.

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

    I needed help for a compiler I am designing using Flex and Bison.

    Posted: 28 Mar 2019 10:05 PM PDT

    expr ::= let ID : TYPE [ <- expr ] [[, ID : TYPE [ <- expr ]]]∗ in expr

    I was trying to implement this rule in Bison.

    So expr is the non terminal while [[, ID : TYPE [ <- expr ]]]∗ describes a regex and I thought that the only way to describe has using a combination of a few rules

    express: COMMA ID COL TYPE OSB ASSIGN expr CSB express ; expr : LET ID COL TYPE OSB ASSIGN expr CSB IN expr 

    where COL represents a colon (:), OSB and CSB are [ and ] respectively, ASSIGN is <-, TYPE is int/char.

    I felt that adding a production made sense intuitively as it allowed me to have zero or more occurences of the expression

    [, ID : TYPE [ <- expr ]]. I applied this logic to other rules as well. However I got a bunch of shift reduce conflicts now and I am fairly sure that this is to blame. But I am not sure how to fix this.

    Here's the code using Bison and Flex. The grammar is on page 16 of 30.

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

    Question about open-source software

    Posted: 28 Mar 2019 09:54 PM PDT

    So from what I understand the main difference between open-source software and closed-source, is that open-source the customers must have access to the source code and be allowed to make modifications. If I create an open-sourced applications, does this mean they can change everyone's application? Or just modify the one that they download? I'm new to programming and I've just started picking up C++. Thanks.

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

    What makes programming languages different?

    Posted: 28 Mar 2019 12:59 PM PDT

    I've only gone trough the basics loops,variables,..

    Why is javascript used for building websites and C# isn't? I mean is it speed, file size

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

    Implementing Graphs in Python

    Posted: 28 Mar 2019 03:34 PM PDT

    I understand graphs when I do it on paper. My next step is to start coding them.

    Ideally, I would like to use a Class instead of using a dictionary (https://www.python.org/doc/essays/graphs/)

    I am getting confused on implementation. Should I create 2 classes: Graph and Node? Or have everything in one class? I can't seem to find a good example to study.

    My intention is to learn DFS,BFS,and shortest path with graphs. Then I can say, I KNOW graphs!

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

    Is front-end still worth learning in 2019 or is it all being outsourced?

    Posted: 28 Mar 2019 09:29 PM PDT

    A friend of mine said that front-end jobs are all being outsourced to India and that it is a saturated market.

    I have an engineering background (hardly any coding experience) and want to make a career switch into software - I was considering front-end but that made me a little worried I wouldn't be able to find a good job. Any advice? What is the best path to take for employability?

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

    Iframe Id and name changes each time but only in one spot

    Posted: 28 Mar 2019 09:01 PM PDT

    idk if its at random or somehow im causing it but the name/id is basically

    IFrame0ID

    but sometime it comes up as

    IFrame1ID

    IFrame4ID

    or IFrame3ID

    no idea what im supposed to do because without finding this id i cant switch to iframe on the page

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

    Developing Speech Recognition

    Posted: 28 Mar 2019 08:56 PM PDT

    Hey guys, for my final year project, I am proposing to develop a speech recognition algorithm/software to convert malaysian-slang speech to normal English text.

    The problem is, I don't know where to start, is 14 weeks enough time? What's the difficulty, prerequisites, tools, etc.

    I am hoping to find some developers here who have knowledge and experience in speech recognition to guide me please. It's a malaysian-slang speech converter to plain English text with no application. I want to develop this so it can be used in softwares/applications such as Siri or Cortana, or any other softwares.

    Thank you

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

    [Javascript] I want to write javascript plugins for Webstorm. Where do I start?

    Posted: 28 Mar 2019 08:45 PM PDT

    I couldn't find any resources that I could understand. What would be a good primer to get started on writing the most basic Webstorm plugin (e.g plugin where cmd+c+l writes console.log() in the file)?

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

    How best to search GitHub and other repos?

    Posted: 28 Mar 2019 04:59 PM PDT

    In the past when I've looked at GitHub, I've tried to search, but only gotten "Angular libraries" or ".NET Core" examples. Or insert language x thing here. Rather than examples of real world code which is what I want. I want to see how people use certain things in production(I don't want to see private repos, only those that areout in the public).

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

    New series on git

    Posted: 28 Mar 2019 08:25 PM PDT

    Hey everyone, I've really been excited about helping people learn to program for a while now and I've started making videos that teach it. I'm starting my first series on learning to use git, as well as interfacing with a few common vendors related to git like Github and Heroku. Here's the first video, apologies for only have the first in the series available, but I promise to get some more stuff up soon.

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

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

    I created a Trello Clone with React + Redux - I learned so much in the process.

    Posted: 28 Mar 2019 09:47 AM PDT

    Hi guys,

    I created a Trello clone in the last month.

    You can find the repo here: https://github.com/SelfDevTV/trello-clone

    A live example is here: https://selfdevtv.github.io/trello-clone/

    The youtube series: https://www.youtube.com/watch?v=RDQGPs7StNA&list=PLkIwB9zsYA2is0Hb-uRoDhPoSG82Hap1h

    I also created a youtube series where I create this. It's not finished yet (creating, lists + cards and also DND is completed).

    It's not a tutorial per se but rather a walkthrough, where I try to explain some thoughts and some of the things I do and why I did it.

    What do you guys think? What could I have done better?

    Features

    • You can drag and drop lists + cards and also edit / create / delete (CRUD).
    • Also the ability to create several boards is there.
    • State gets persisted in Cache (after refreshing the page, everything is still there)

    Next I will create the backend for it (for now the state gets persisted in the browser cache, using localStorage).

    Check it out and let me know what you think :)

    Geralt

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

    Having a hard time with try-catch statements.

    Posted: 28 Mar 2019 08:21 PM PDT

     System.out.println("Please enter your annual salary: "); while(true) { String input = userIn.next(); try{ baseSalary = Double.parseDouble(input); break; } catch(Exception e) { System.out.println("Invalid Entry. Please enter your annual salary in numerical form: "); } } 

    So I'm working on a calculator that calculates ones salary based on current salary input, raise percentage input, and gives you the raise amount and new salary. I'm supposed to use try catch statements in order to prevent user from entering non numerical values (which I was able to do in the code above) but also need to prevent the user from entering negative numbers. If a negative number is entered it needs to have a separate message like "No negative numbers" or something instead of the output for non numerical numbers I have above. I would really love some help.

    **EDIT: This is not the code to my full program, this is just the portion of the program I am having trouble with.**

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

    Create a directory in a generic location users can write too C#.

    Posted: 28 Mar 2019 08:20 PM PDT

    Hello everyone, I'm currently making a DnD program for a friend. One of the features is that the DM can keep up with notes in the program. The program will create a directory to save the files too, and then pull the files later for editing and reading. However, I'm not sure how to create a directory in a generic location that the user can use. Obviously if it we're for myself, I could create it in my documents or something, however, my user may not have the same path for their documents as I do. (Mine save to my personal OneDrive.) How do I create a directory and write files to a location that would work for every user? (I thought about C drive, but a lot of PC's don't have permission to write there, nor do I know how to enable permission to write there for me or my user.)

    Thanks!

    P.S. I'm still new at C# and also wasn't sure how to do this in Java either.

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

    Need some help with homework (c++)

    Posted: 28 Mar 2019 08:03 PM PDT

    My homework question is to write a program to solve 5 linear equations using while loops.

    This is my code so far, not sure how to get it to solve 5 linear equations.

    #include <iostream>

    using namespace std;

    int main() {

    float a, b, x; cout << "Enter 2 coefficients\\n"; cin >> a >> b; cout << a << b; while (a == 0) while (b == 0) cout << "all solutions\n"; while (b > 0 && b < 0 && a>0 && a < 0) cout << "no solutions\n"; x = -b / a; cout << " x= " << x << endl; system("pause"); return 0; } 
    submitted by /u/Deezie123
    [link] [comments]

    No comments:

    Post a Comment