• Breaking News

    Monday, August 3, 2020

    Can you help. Ask Programming

    Can you help. Ask Programming


    Can you help.

    Posted: 03 Aug 2020 09:30 PM PDT

    I'm learning to program. I know the functions etc. but don't know how to actually program something with actual purpose.

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

    Using smart contracts to award a prize to first person to solve a problem

    Posted: 03 Aug 2020 07:13 PM PDT

    I want to offer an award a prize to the first person to come with a solution for a geometric problem. They need to send some points and if the points are correct then they get the award.

    Is this a problem that can be solved using smart contracts?

    If yes, what concepts do I need to learn in order to implement this?

    I don't really know much about blockchains but a friend told me that ethereum could help me. Skimming in Wikipedia I almost got convinced but I don't really know how to award only the first person with security.

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

    Beginner here working on my First non tutorial project and I'm looking for opinions.

    Posted: 03 Aug 2020 01:26 PM PDT

    Been studying java and decided my first non tutorial project was going to be a text adventure game that I eventually would like to make a gui with and maybe add some music. Right now I'm currently working through planning on how to tackle things and dividing what I want into their own individual compartments. Where I want the opinions though is the combat system to implement and why one would be better than another.

    I'm not entirely sure as to whether the game will be sci-fi or fantasy based but I'm looking to mimic either the D&D way of combat or the Warhammer way. The player, enemies and NPC's all will be their own classes and have their own stats. What do you guys think would make the most sense for a beginner to work with in terms of combat?

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

    How to connect front-end and back-end from in two different domains?

    Posted: 03 Aug 2020 03:58 AM PDT

    [SOLVED] Thanks everyone! mystery solved!

    HiI am creating a react app that should connect to a django server to collect and send dataI am thinking about lunching django server on heroku and react app on github pagesbut I guess browsers don' t allow you to communicate with different domains

    And I have no idea how to lunch it once and as a single project in heroku.

    What do i do?your help will do me a great favor

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

    Is programming as a career consistently and generally stressful?

    Posted: 03 Aug 2020 09:42 AM PDT

    I have been learning programming on and off for the last 10 years. I started with c++ then jumped on the mern bandwagon a couple years ago.

    Unfortunately I've not been able to finish a project because i have just been constantly discouraged by hearing stories about tight deadlines, snooty and evil co-workers, 60+ hours per week.

    Even though i do enjoy computer science very much and most times do enjoy actually programming, there is something in me that just rejects this lifestyle. I burn out very easily with projects. It also doesnt help that i have bad anxiety disorder.

    If it is such a toxic environment, is it even possible for someone like me to thrive in an industry like this? Or will i just be bottom of the barrel just struggling to survive? Does anyone have a similar story?

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

    Redesigning Bluetooth transmitter ?

    Posted: 03 Aug 2020 06:46 PM PDT

    Hey my Bluetooth transmitter has 4 color options. It starts out default on red and I want it to start out default on blue.. what do I need to do this ?

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

    Need help with creating new software.

    Posted: 03 Aug 2020 09:28 PM PDT

    Hey there!
    So, I am about to start making a new software that can help user schedule tasks online. Like, posting something at a scheduled time. Some examples can be, automatically starting or ending an online meeting. Basically, a bot that can handle some tasks for the user.

    I need suggestions regarding what technology I'll be using for this. It can be a naive computer software but building a web application would be better. A few tips regarding web bots and scrapers would be appreciated.

    Thanks in advance.

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

    What exactly is wrong with my code on line 25.

    Posted: 03 Aug 2020 07:11 PM PDT

    /*

    1. Store correct answers

      - When quiz begins, no answers are correct

      */

    let correct;

    // 2. Store the rank of a player

    let rank;

    // 3. Select the <main> HTML element

    const main = document.querySelector("main")

    /*

    1. Ask at least 5 questions

      - Store each answer in a variable

      - Keep track of the number of correct answers

    */

    const correct1 = prompt ("write the word plug")

    if (correct1.toUpperCase() === "PLUG") { correct += 1 }

    const correct2 = prompt ("name something better than an apple") if (correct2.toUpperCase() === "BANANA") {correct += 1}

    const correct3 = prompt("name something funnier than a bottle") if (correct3.toUpperCase() === "PLASTIC"){correct += 1}

    const correct4 = prompt("name something i do") if (correct4.toUpperCase()==="CODE"){correct += 1}

    const correct5 = prompt("name your favorite song") if (correct5==="LOOK ALIVE") {correct += 1}

    /*

    1. Rank player based on number of correct answers

      - 5 correct = Gold

      - 3-4 correct = Silver

      - 1-2 correct = Bronze

      - 0 correct = No crown

    */

    if (correct === 5) {rank = gold}

    else if (correct >= 3) {rank = silver}

    else if (correct >= 1) {rank = bronze}

    else (correct = 0) {rank = trash}

    // 6. Output results to the <main> element

    main.innerHTML =

    <h2>

    <h2> `you got ${correct}!! ` </h2>

    <h2> ` your rank for today is <strong> ${rank} </strong> ` </h2>

    </h2>

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

    Is it true that putting a dot after a .com will allow you to bypass a paywall? I’ve seen this suggested a few times and wanted to understand if and why this works.

    Posted: 03 Aug 2020 01:09 PM PDT

    I've seen this said a few times in the last week or so and it always goes like this

    "This article is behind a paywall OP"

    "Add a . after the .com in the URL"

    "Wait, that works? Why?"

    Then it's either

    "No idea" or a very simplistic explanation

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

    Tips on dealing with a toxic habit

    Posted: 03 Aug 2020 02:24 PM PDT

    Heyy! Not here to waste your precious time so =>
    TLDR, I'm a second year software engineering student in a mid-to-low quality university in my country - wasn't confident enough that I would get accepted or could afford the "best" one. If it's not MIT or something else, you could study it online - still thinking like that to this day! I have been taking online courses for almost a year now which include C#, data structures, OOP, EF Core and ASP.NET Core.

    It's important to point out that this had nothing to do with uni since I didn't see the importance of self-studying until the second semester when things took off like crazy. We were learning OOP and ASP.Net Core MVC architecture at the same time! I also had to cram a 2-3 months Database course into 2 weeks just to be able to take my exam. Thankfully I learned the fundamentals but I had no clue how ignorant some proffesors might be.. That's when it clicked, the moment I realised I needed to take things in my hands and neglect irrelevant information and lectures from uni that I could learn myself!

    COVID-19 hit, 2nd semester had to be finished from home - fine. The struggle was that I couldn't find my pace... I kept going back and fourth from concepts and exercises because I thought I was not good enough. I solved everything, and come back after 2-4 months or so because of that insecurity in me that I might forget the concepts. Plus the pressure from uni to take 2 HEAVY disciplines at the same time without having never explained what ORMs are and learn ANY EF Core might have affected my thinking proccess.

    Right now, I am yet again going over the stuff I learned from the past year. Tried to apply for an intership twice, got rejected but learned a lot from the experiences. I enjoy learning new stuff but there is also high peep pressure. I keep trying to read new books that have nothing to do with coding like - Rich Dad, Poor Dar, investment books, some AI related books, etc. I have this another weird habbit of getting too interested in something and then abandoning it when I am bored.

    I would really apprectiate your thoughts on work-life balance because I never really had one in highschool and now I see how hard it is to balance things out.. Also, how do you deal with burnout? Do 1 day breaks work for you? Do you think the COVID situation might have some partial influence? Do you get interested in completely different things and how do you get back on track?

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

    Managing source-code enums with database content

    Posted: 03 Aug 2020 10:31 AM PDT

    So, I have an application which has the concept of "rights", with each right consisting of an id, name and description. Users are associated with right id's.

    Right now these rights are stringly typed in the code (e.g. user.has_right_with_name("admin")), which I would like to change (to avoid spelling errors): instead of using strings, I want to be using an enum (so it's user.has_right_with_name(Right::Admin)).

    But the problem is that this enum is set in the source code: if I remove an enum field from the source code it could still be saved in the database, even though the application code cannot handle it. And if I add an enum field to the code it wouldn't exist in the db, so I can't search by it.

    What's the best way of keeping them synced?

    I'm used to writing Django, where the application checks on startup that all the fields required exists in the DB. Perhaps that's a good solution? E.g. upon startup the application will create all rights that doesn't exist, then retrieve all rights from the db and crash if any of the rights are not part of the enum. This would force the programmer to migrate the database before running new code (to avoid a runtime error or bug).

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

    Help with pre-order traversal

    Posted: 03 Aug 2020 12:27 PM PDT

    Hey guys I have recently started doing data structures again and I am a bit confused on how I should go about performing a pre-order traversal via implementing a Stack.I was able to achieve an In-order traversal by doing

    class InOrderTraverser extends NodeTraverser { private Stack<Node> stack; public InOrderTraverser(Node n) { super(n); stack = new Stack<Node>(); stackInOrder(n); } private void stackInOrder(Node n) { if (n.right != null) stackInOrder(n.right); stack.push(n); if (n.left != null) stackInOrder(n.left); } public Node next() { if (stack.empty()) return null; return stack.pop(); } } 

    Here is what i attempted to do

    class PreOrderTraverser extends NodeTraverser { private Stack<Node> stack; public PreOrderTraverser(Node n) { super(n); stack = new Stack<Node>(); stackPreOrder(n); } private void stackPreOrder(Node n) { if (n.left != null) stackPreOrder(n.left); stack.push(n); if (n.right != null) stackPreOrder(n.right); } public Node next() { if (stack.empty()) return null; return stack.pop(); } } 

    I know I did it wrong as I am comparring my output to the correct output and it is wrong, any help would be greatly appreciated

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

    How do I make a full CRUD web application?

    Posted: 03 Aug 2020 09:41 AM PDT

    Ive decided to make a crud web application(front mend and backend) so I can learn and have some experience/ a good project. However I have no clue how to do this what steps can I take?

    I currently have a Java program which interacts with Spotify's API, I want to incorporate that as well. Any ideas how I can go about doing this?

    I'm currently just trying to learn HTML/css/js to make a web page(front end) for this project.

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

    Can someone ELI5 the difference between c#.NET and ASP.NET?

    Posted: 03 Aug 2020 02:32 PM PDT

    From my understanding .NET is the framework that works with languages like c# and f# in a windows environment while ASP.NET is for web development? A lot of the job posts in my area are asking for .NET developers. I'm trying to narrow down what this exactly is. I don't have a ton of experience with .NET or ASP but I know a bit of c#. So these terms are slightly confusing to me. Can someone help clear this up for me?

    Thanks!

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

    Splitting an Ultrawide Monitor

    Posted: 03 Aug 2020 10:38 AM PDT

    Hey people,

    so I got this awesome 49" 32:9 monitor. I love this screen, but there is one thing...

    I mean, we live in 2020, right?I am looking for a tool, so i can split my monitor in separat areas, especially Full-Screen stuff.

    For example, i want to watch a Youtube Video in FullScreen, but just over half the monitor, so i can open a browser window, like i would do with two 16:9 monitors.

    Can somebody help me out? I can not find anything. Just window managment tools, but no supoorting fullscreen mode. :(

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

    Command Prompt Closes After I Press Enter

    Posted: 03 Aug 2020 01:57 PM PDT

    Hello guys, I am new at C++. I made this easy program but when I run the .exe file in Command Prompt it asks my question, but after I press enter it closes. How do I fix this? Thanks!

    #include <iostream>
    using namespace std;
    int main()
    {
    double grade;
    cout << "Enter your grade: ";
    cin >> grade;
    if (grade >= 90)
    {
    cout << "your grade is A:";
    }
    else if ( (grade >= 80) && (grade < 90) )
    {
    cout << "your grade is B+";
    }
    else if ( (grade >= 70) && (grade < 80) )
    {
    cout << "your grade is C+";
    }
    else if ( (grade >= 60) && (grade < 70) )
    {
    cout << "your grade is D+";
    }
    else
    {
    cout<<"You failed";
    }

    return 0;
    }

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

    Flexbox Responsive Design

    Posted: 03 Aug 2020 01:55 PM PDT

    I know there's many results on the web but all seems so confusing. If I want to create a site that works on all devices (smartphone, tablet and desktop/laptop), what do I need?

    Like what are my breakpoints/media queries?

    What attributes must I use E.g. Flex-Grow: 1;

    Can someone either create or point me to a ready template? I feel like this will benefit everyone in the long run.

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

    Auto correct so bad right now

    Posted: 03 Aug 2020 01:19 PM PDT

    I very often find myself trying words/phrases into google and get the correct spelling 9/10 so why is autocorrect on phones/word/email just general typing so bad, the google search word correction is easily the best autocorrect out rn, why not just port it over?

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

    Don't know what to learn!

    Posted: 03 Aug 2020 08:32 AM PDT

    Hi, I'm a beginner in programming. I worked on a front-end web project recently and didn't find it interesting. I like to play with logic, so I'm confused about what to learn next. I made a list which includes flutter development, artificial intelligence and ethical hacking. I know these are all the common subjects but i don't know where to start. I learnt python programming built some small projects and found it interesting. Can anyone suggest me what to learn next? Anything out of the list is also welcomed. Thank You.

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

    Issue with Environment Variables Between AWS S3 to CloudFront

    Posted: 03 Aug 2020 11:52 AM PDT

    Hello all, I've been writing a simple React application that allows users to be authenticated through a specific Google Domain.

    The Problem: Production build of my application is spitting out the following error.

    "gapi.auth2.ExternallyVisibleError: Missing required parameter 'client_id' at new ew (https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.WuHGBC70tdw.O/m=auth2/rt=j/sv=1/d=1/ed=1/am=wQc/rs=AGLTcCNpHoaMoiiRyTFOuGnNuTT-eiD9VA/cb=gapi.loaded_0:333:25) at Qw (https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.WuHGBC70tdw.O/m=auth2/rt=j/sv=1/d=1/ed=1/am=wQc/rs=AGLTcCNpHoaMoiiRyTFOuGnNuTT-eiD9VA/cb=gapi.loaded_0:352:131) at Object._.mx [as init] (https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.WuHGBC70tdw.O/m=auth2/rt=j/sv=1/d=1/ed=1/am=wQc/rs=AGLTcCNpHoaMoiiRyTFOuGnNuTT-eiD9VA/cb=gapi.loaded_0:370:269) at https://portal.gracecovenant.net/static/js/2.c71ad1ed.chunk.js:2:306847 at https://apis.google.com/js/api.js:15:290 at ea (https://apis.google.com/js/api.js:8:677) at A (https://apis.google.com/js/api.js:15:273) at Array.Aa.r.<computed> (https://apis.google.com/js/api.js:15:369) at Object.Aa.D.<computed> [as loaded_0] (https://apis.google.com/js/api.js:15:431) at https://apis.google.com/_/scs/apps-static/_/js/k=oz.gapi.en_US.WuHGBC70tdw.O/m=auth2/rt=j/sv=1/d=1/ed=1/am=wQc/rs=AGLTcCNpHoaMoiiRyTFOuGnNuTT-eiD9VA/cb=gapi.loaded_0:1:15" 

    Debugging Process: I hear loud and clear, client_id is missing. I take a look at what the server is shooting me and find that the client_id is clearly missing.

    main.ad65f6b6.chunk.js

    ... }) : r.a.createElement(N.GoogleLogin, { clientId: Object({ NODE_ENV: "production", PUBLIC_URL: "", WDS_SOCKET_HOST: void 0, WDS_SOCKET_PATH: void 0, WDS_SOCKET_PORT: void 0, REACT_APP_AUTH_URL: "OMITTED", REACT_APP_TITLE: "OMITTED" }).REACT_APP_GOOGLE_CLIENT_ID, ... 

    No worries, let's check S3 and see if the file itself is bundling correctly.

    static/js/main.ad65f6b6.chunk.js

    ... }) : r.a.createElement(B.GoogleLogin, { clientId: "1a2a3a4aREDACTED1a2a3a4aqadp.apps.googleusercontent.com", onSuccess: e.success, onFailure: e.failure, ... 

    Clearly it's bundling appropriately. Could someone help me out and debug this issue?

    Any help would be greatly appreciated!

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

    Did I ruin my chances for getting a call with Google's Foobar challenge?

    Posted: 03 Aug 2020 11:37 AM PDT

    A few weeks ago I was working on the problem with absorbing Markov chains. I was struggling with solving this problem, I had an algorithm that only worked 80% of the time, for some reason I just couldn't get two of the ten test cases working. As I was doing research, I found people who were asking about this problem without labeling it as a Foobar problem and as I was just ignoring those posts because I wasn't gonna just rip off someones solution. Well while I was researching, I stumbled upon another post that happened to list the hidden test cases. I thought I would use this to see where my calculations were going wrong. I narrowed it down to a floating point to integer conversion error that was causing the calculations to be off. My issue now is that I couldn't fix it in time as I was seriously running out of time, so in my solution file I added a condition to check for these two inputs and return the expected outputs. I added a note that Im not happy with this solution and what I figured the problem was and submitted the solution. I feel like this is seen as cheating, which im ashamed to do, I just wanted to continue the challenge. This is the only problem I did this in. I submitted my info to a recruiter two weeks ago and im on stage five now but I still haven't heard anything from a recruiter. Are my chances shot?

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

    I'm programming illiterate. I've tried finding ways to detect malicious Javascript macro's in PDF files, but so far I've reached a dead end. Is there any way to detect (malicious) macro's?

    Posted: 03 Aug 2020 03:49 AM PDT

    Hi, thanks for reading this!

    I'm trying to find malicious macros in pdfs. I already use Pdfviewer in Google Chrome to protect myself, but I'm curious about certain files that may contain them. And I'd like to protect myself by knowing how to find them. Are there any tools available to someone who isn't that literate in programming?

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

    C++ or Java

    Posted: 03 Aug 2020 11:14 AM PDT

    Hello friends,

    I am like a bit new to programming. I started basic JAVA in 8th standard (just wrote a println statement) in 8th standard, last to last year, basic C++ in my 9th standard (program for converting temperatures in units, input/output mainly) last year, I am in 10th right now. I didn't move very much ahead with it. It was primarily because I think I didn't like that DOS GUI and probably, my interest just dropped out. This year I started a Web Development Course and I really like the Web Development part. I have completed the HTML, CSS, JQuery, JavaScript basics. And then in back-end, Node and Express yet. I am taking this course.

    Now, I came across the International Informatics Olympiad. I want to participate and win a medal. It only allows C++ or Java. So, this is the basic conflict I am facing. I basically have 2 years for participation only. And then I have to apply for colleges, so the Olympiad will be pretty good in my opinion for college application.

    Please help me what language should I go ahead with. I am thinking about my future as well. I would appreciate every opinion.

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

    Convert SVG to PNG/JPEG/PDF

    Posted: 03 Aug 2020 11:12 AM PDT

    Hello, all!

    I want to convert an SVG into either a PNG, JPEG or PDF, through JavaScript.

    The SVG graph components are built with d3.js, then I have an html.jade file which creates the layout for changing data in my SVG graph, and I have css which styles the SVG.

    I basically want to be able to copy this SVG graph and paste it into a word document (or something similar). So in order to do that I would need to convert it to PNG, PDF, etc.

    Has anyone successfully done this and can point me in the right direction?

    Thank you so much in advance!

    submitted by /u/potato-who-programs
    [link] [comments]

    How to scrape data from websites using Javascript

    Posted: 03 Aug 2020 11:01 AM PDT

    Hello, I want to become more proficient in Javascript (I'm fairly new to it) so I'm trying to make projects that are a little out of my comfort zone so I can learn different methodologies involved with JS. With that said, I am attempting to create a project that would scrape different websites (think google search / yelp / trip advisor) and get information about local businesses using the users location, I will then use that data to finish the rest of my project, but that part I don't really need help on. My questions are; How would I go about collecting the data from these websites using Javascript? Are there any legal ramifications involved with webscraping that I should be aware of?

    Thanks in advance!

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

    No comments:

    Post a Comment