• Breaking News

    Friday, August 28, 2020

    How difficult would this project be? Ask Programming

    How difficult would this project be? Ask Programming


    How difficult would this project be?

    Posted: 28 Aug 2020 04:28 PM PDT

    Hello, I am new to programming, currently a freshman in a C++ course. I am not sure if this is the right sub to post this is in, so please let me know if it is not. One of the projects I have always wanted to do was write a program that will automatically perform a water change on my aquariums. Essentially I want to be able to click a button or say a command for example " Hey Google, water change my aquarium". I want the program to turn on a drain pump then turn it off after a specified amount of time, then after it turns off the drain pump, turn on a refill pump and then turn it off after a specified amount of time.

    Here is a crappy visual:

    https://imgur.com/a/6tqRCeq

    I am very new to programming ( only been doing it for a week) so I am not sure where I would even start with this or if it is something I should even be attempting right now. Any advice is appreciated, thank you.

    submitted by /u/Ok-Amoeba5080
    [link] [comments]

    MathF missing from System Namespace. using visual studio comm 2017

    Posted: 28 Aug 2020 09:14 PM PDT

    I am writing a C# program in VS community 2017 and I seem to be missing some helper classes. I am specifically trying to use MathF described here: https://docs.microsoft.com/en-us/dotnet/api/system.mathf?view=netcore-3.1

    i have tried installing .net 5.0 sdk.. tried installing 4.8 dev tools etc... i just dont know how to get this thing to show up. anyone have any ideas on what I need to do. Google has been letting me down and most references to MathF seem to point to people using UNITY wihch isn't helpful.

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

    How do we even verify today's leetcode daily question?

    Posted: 28 Aug 2020 03:41 PM PDT

    So the question is:

    Given a function rand7which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer in the range 1 to 10.

    Do NOT use system's Math.random()

    but how exactly do we even verify this with the 'expected answer', since the numbers are randomly generated

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

    How do I find modern takes/improvements/versions of algorithms?

    Posted: 28 Aug 2020 05:41 AM PDT

    So for all of our college projects, we're required, for some bizarre reason, to use only algorithms, or derivative versions of algorithms published no more than 5 years ago, the lower that number the higher you're graded.

    Now, my question is how do I find these similar algorithms without combing every citation and wiki available?!

    Take the shortest path problem, you can easily find related algorithms due to its popularity, but more obscure ones, it's hard to find their improvements.

    Any advice?

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

    Is a CS degree really worth it??

    Posted: 28 Aug 2020 07:08 PM PDT

    (18M), started learning basics of programming around January and February. Started learning JavaScript and React Native during the summer and developed a couple of websites and apps (2) along the way. Started learning game development C++ in Unreal Engine and I love it! I can tell this is definitely what I want to do for the rest of my life.

    My father owns a buisness and he hires programmers. He says that in order for me to be more competitive and make more money, I need to finish college and get a CS degree. I started my classes a couple weeks ago and I absolutely hate it with a passion. I see it as nothing but a complete waste of my time and energy. I don't see that being miserable stressing over school for 4 years as worth it.

    So the question is..is it worth it? I'm ok with not being super competitive and not making more money. I'm not super materialistic so it doesn't bother me. As long as I get to do what I love, I'm fine. So ig the question is, how important is a CS degree in the game development industry?

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

    Why do people develop freeware and not share the source code?

    Posted: 28 Aug 2020 10:18 PM PDT

    I've been fighting with a program called which is insanely, uniquely useful for what it does... and simultaneously kind of shit. Whether it works or not is pretty hit or miss, and when it does work it has some big flaws which would be infuriatingly simple to fix if I only had the option. As far as I can tell it's no longer maintained, and the creator has explicitly declined to share the source. The project is so daunting it appears no one wants to start over. I certainly don't.

    I don't understand. Why create a tool for the public benefit, and then cripple it by declaring "I'm the only one who may work on this"?

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

    What is the time complexity of this code that generates permutations of a set?

    Posted: 28 Aug 2020 12:56 PM PDT

    I've read the following code in the Competitive Programmer's Handbook (by Antti Laaksonen) where search processes all of the permutations of a set that contains the elements {0,1,..., n-1}:

    void search() { if (permutation.size() == n) { // process permutation } else { for (int i = 0; i < n; i++) { if (chosen[i]) continue; chosen[i] = true; permutation.push_back(i); search(); chosen[i] = false; permutation.pop_back(); } } } 

    There is a vector called permutation that contains the current elements in the permutation and an array called chosen that keeps track of which elements have already been chosen.

    I understand the how the code runs, but I am struggling to understand its time complexity. I know there are n! final permutations, but it appears as though the for loop (an O(n) operation) is executed more often than this. What is the time complexity of this function if //process permutation is O(1) or if it is O(n)?

    submitted by /u/1UglyGod
    [link] [comments]

    Did anyone have any "go on, try me" moments with your manager?

    Posted: 28 Aug 2020 01:08 PM PDT

    Swift: Will I need Firebase?

    Posted: 28 Aug 2020 02:57 PM PDT

    I am currently in the middle of developing a simple application that will retrieve information from certain websites and then display that information onto the UI.

    I am confused as to when the information would be gathered from the different websites, parsed, & then displayed.

    Would I used Firebase to gather, parse, and then send this information to my application/users? Or will my app have to do this every time a user opens the app & then web scraper is activated?

    I'm sure this is a very noob question but I can't wrap my head around where my data will be store and how many times I have to retrieve it. I am afraid of having to retrieve it every-time a user opens the app because my app would be making an unnecessary amount of requests to the website or slow down the app. Thank you.

    submitted by /u/Concept-Youtube
    [link] [comments]

    Streams/Videos Similar to Andrew Kelley, Andreas Kling, Per Vognsen, Casey Muratori, Jonathan Blow

    Posted: 28 Aug 2020 04:21 AM PDT

    I am curating a list of streamers/youtubers that aren't making "tutorial" or "entertainment" videos but just developing stuff and documenting their progress along the way. They speak during videos, occasionally explain stuff, but not in the vein of a tutorial

    My all time favorites so far

    Are there any more hidden gems out there i don't know of?


    Also as you might have noticed most of them deal with compilers and programming language design, so it'd be a bonus if there's more of that.

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

    looking for help

    Posted: 28 Aug 2020 01:36 PM PDT

    First of all, if this post is inappropriate or belongs in another sub, I will of course delete it

    Hello everybody A friend and I have a problem we regularly upload to a streaming platform (I am not allowed to name the name otherwise it would be advertising right?) now we have the problem with a song that we wanted to re-upload that it is no longer on the hard drive. Is it possible to create an MP3 in some way from an existing URL even though it leads to 404? Thank you for your answers

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

    Is it safe to run code written by a stranger on the internet?

    Posted: 28 Aug 2020 01:20 AM PDT

    I hired someone on Fiverr to write a program to scrape information from an online directory. He is telling me he will show me how to use the program. He sent me the file and is telling me to download chromedriver, anydesk, and python. Now I am worried that he could somehow put a virus on my computer or hack me by running the program. I feel like I got ahead of myself and as you can tell I do not know much about programs or coding.

    How much risk do I face running the program he wrote?

    Are there steps I can take to protect myself and safely attempt to use the program he made?

    Thanks!

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

    Windows Command Line, Don't start new instance of executable if already open?

    Posted: 28 Aug 2020 01:09 PM PDT

    Say I simply enter the command "path\to\executable.exe" "file"

    Windows opens the file with the executable

    Then, if I enter the command "path\to\executable.exe" "file2"

    Windows opens another instance of the executable with the second file. Is there any way to open file2 with the original instance of the executable already open, in terms of Windows? Or is that just the unfortunate nature of that specific executable?

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

    I create html/javascript in Python. What do you use to edit? I've been copypasting into vscode.

    Posted: 28 Aug 2020 11:19 AM PDT

    I use python ''' ''' strings to generate the full html page, with occasional calls to APIs and other data.

    How would you be working on this?

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

    Could use some advice about giving a programming tutorial

    Posted: 28 Aug 2020 04:50 AM PDT

    We have several Project Managers that hand out work to our backend team (PHP, mostly with Laravel), but who themselves have no or a limited technical background when it comes to programming.

    I'm gonna give small workshop/tutorial about programming (in PHP), to give them a better insight into our jobs.

    It's the first time I'll be giving a workshop of this kind and I won't have the time to go into detail, so it will have to be quite high level.

    Subjects I'd like to discuss:

    • Basics of programming (logic)
    • PHP
    • Laravel
    • An overview of other aspects of the backend job (external and local hosting, mailing, ftp, git, the programs we use)
    • Common pitfalls/errors, testing, debugging
    • The importance of a good briefing and info from the customer

    If I'm given just an hour, that would mean 10 minutes per subject, so I'll have to prioritise, consider what to include, which things deserve a more detailed look, and which don't.

    I would love some suggestions on how to organise this workshop, are there things I'm missing from my list that the PMs should know, any guides I can follow or other suggestions?

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

    Learning programming. Why doesn't this work?

    Posted: 28 Aug 2020 08:45 AM PDT

    HI! I trying to write some dumb stuff just to get some practise. I wrote this in the app solo learn. It's supposed to ask one question and provide a response based on that question. Can't get it to work. Could someone figure out why?

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;

    namespace SoloLearn { class Program { static void Main(string[] args) { const string intro=("CAKE"); const string val1=("1. Leave the cake"); const string val2=("2. Eat the cake"); int svar=0;

     Console.WriteLine(intro); Console.WriteLine(val1); Console.WriteLine(val2); Console.WriteLine(svar) Convert.ToInt16(Console.ReadLine(svar)); if(svar==1) { Console.WriteLine("The fruits of your labour remains uplucked."); } if(svar==2) { Console.WriteLine("The cake is a lie."); } } } 

    }

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

    Hey guys I'm(21m) mediocre to programming and would like to understand scripting

    Posted: 28 Aug 2020 05:30 AM PDT

    So I (20m) am into programming and I have been into web development and app development and trying different data structures and algorithms. I recently wanted to understand the idea of scripting and if i could find out where I should start scripting as well as what knowledge I need for it

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

    How do i ReadMemory as a string?

    Posted: 28 Aug 2020 05:06 AM PDT

    This is what im doing to read memory in byte:

    int whiskas; ReadProcessMemory(handle, (BYTE*)(clientbase + 0x4), &whiskas, sizeof(whiskas), 0); if (whiskas == "0x42") cout << "Hot whiskas for breakfast for everyone"; 

    But what if i need to read it as a string?

    std::string whiskas; ReadProcessMemory(handle, (STRING*)(clientbase + 0x4), &whiskas, sizeof(whiskas), 0); //STRING* doesnt work if (whiskas == "Awesome") cout << "Hot whiskas for breakfast for everyone"; 

    How do i make this work? Pls help

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

    How do I get around HttpOnly cookies and having different localhosts between my front end and back end for accessing my JWT access token?

    Posted: 28 Aug 2020 03:58 AM PDT

    I'm so lost. I've been stuck on this issue for about a week now with barely any progress. I've had to resort to using a hacky solution, but I really don't want to. I want to do this properly.

    So, I'm working on a project right now using React on the front end and Django REST Framework on the back end. For the most part, I have two scenarios that I'm having issues with:

    1. My back end stores a CSRF token inside an HttpOnly cookie
    2. Using the dj-rest-auth package, I'm able to implement JWT authentication. My back end uses that package's custom configs to:
      1. Return the user's information & the access/refresh tokens on successful login
      2. Automatically store the access token inside an HttpOnly cookie upon successful login

    Here are my problems:

    1. I can't really get access to the CSRF token in my front end forms because it's inaccessible via JavaScript (due to it being HttpOnly). I've tried to get around this using Axios (axios.defaults.xsrfCookieName = "Co6kpjZ4jUn61vnF15QRXu"), but I feel like that's a hacky method, at best. Does what I'm doing with Axios actually work? If not, is storing the CSRF token in a non-HttpOnly cookie the only solution I have left?
    2. Because my front end lives in localhost:8000 and my back end lives in localhost:7000, I'm having issues with my access token being stored inside a cookie. For one, it's inside an HttpOnly cookie. But, here's the bigger issue: the dj-rest-auth package stores the JWT access token inside a SameSite = "strict" cookie. So, whenever I do a test login from localhost:7000, it successfully stores the access token inside the HttpOnly cookie, but when I do a login from the front end on localhost:8000 (axios.post(/auth/login/)), it doesn't store the access token inside a cookie at all; it only returns the user information and access/refresh tokens (i.e. the response). My assumption is because of the SameSite = "strict". Is there a way around this, or do I have to make it so that the cookie, where the access token is stored within not a SameSite = "strict"?

    In general, here are my questions:

    1. How do I handle HttpOnly cookies with React?
    2. How do I handle SameSite = "strict" when my front end and back end live on different ports?
    submitted by /u/roynotto
    [link] [comments]

    How would a real time trends system be built

    Posted: 28 Aug 2020 12:55 AM PDT

    If you were to create a social network and wanted to have a trends table feature, how would you go about building it ?

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

    Trinity cannot locate Salmon

    Posted: 28 Aug 2020 12:34 AM PDT

    My Salmon is in bin file but the trinity cannot locate it. Why?

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

    HELO FOR PROGRAMMING PROJECT

    Posted: 28 Aug 2020 05:41 AM PDT

    Hi! This is Bhakti! I'm a 17 year old in high school. So I want to design a virtual library for my school that'll help students in distant countries to access the books online for studying purposes. However, I'm have a basic foundation in python and nothing more. This program will be added to the school website and can be accessed by everyone. I need some tips or HELP with the coding aspect of the project. Any advise?

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

    Want to share Grokking the System Design Interview, Grokking OOD, AlgoExpert, SystemsExpert, AlgoPro

    Posted: 28 Aug 2020 04:56 AM PDT

    I recently bought the subscriptions of Grokking the System Design Interview, Grokking the Object Oriented Design Interview, AlgoExpert, SystemsExpert, AlgoPro for my interview preparation. I want to share each of these courses for 10$. I have some courses also. DM me if you are interested.

    #Interview

    #GrokkingTheSystemDesignInterview

    #GrokkingTheObjectOrientedDesignInterview

    #AlgoExpert

    #SystemsExpert

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

    No comments:

    Post a Comment