• Breaking News

    Friday, February 28, 2020

    How should I go about this system design question? Please help 🙏 Ask Programming

    How should I go about this system design question? Please help �� Ask Programming


    How should I go about this system design question? Please help ��

    Posted: 28 Feb 2020 10:01 AM PST

    I'm preparing for the system design portion of my upcoming onsite interview. I saw that this question was asked by the company a very long time ago so probably they won't be using this but I still want to prepare for this. This is the question: "Design the backend for a stock info widget that pulls data from a stock API and updates hourly. Avoid pulling it all the time if there are no changes. There should be no latency spike during the update."

    I'm very new to this so I appreciate some detailed explanations but a general guideline is also nice. Specially, Idk how to design the DB table and what to store since it seems like the data is pulled from the API, do we need to store this in our DB?

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

    Can someone help me figure out why my GAS script keeps returning the 'Unexpected token {' error for this IF / ELSE IF / ELSE statement?

    Posted: 28 Feb 2020 11:02 PM PST

    Here is the code, the IF and ELSE IF statements were fine, but then I added the third line and all hell broke loose:

    if (channel == "#chat"){var SLACK_WEBHOOK_URL= "https://hooks.slack.com/services/blahblahblah";} else if (channel == "#general"){var SLACK_WEBHOOK_URL= "https://hooks.slack.com/services/blohblohbloh";} else (channel == "#goals"){var SLACK_WEBHOOK_URL= "https://hooks.slack.com/services/blehblehbleh";} 
    submitted by /u/DuncnIdahosBandurria
    [link] [comments]

    Regarding bots that message my phone... why are they so terrible at spelling?

    Posted: 28 Feb 2020 07:54 PM PST

    "Hi its Mia, c0ntact1ng y0u regard!ng th!s post I saw"

    "l00se 3 2 pounds in 4 9 days, n0 work0ut need-ed"

    Is this intentional? Why would they expect anyone to click on messages like these?

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

    What’s the easiest app I can make on Android Studio to solve a daily problem?

    Posted: 28 Feb 2020 11:39 PM PST

    Best way to create PDF file from images and include clickable table of contents

    Posted: 28 Feb 2020 10:49 PM PST

    How would I create a pdf file from X number of images with a table of contents that is clickable?

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

    A question to a C# expert on TCP/UDP redirection

    Posted: 28 Feb 2020 12:18 PM PST

    Hello, I'm a old fart pushing 70 and have a 'intermediate' level of experience with C# over the last decade but my mind is slowly turning to jello thanks to dementia so bear with me.

    There is a piece of software I came across at church called 'Proxifier' which was used to make just the net traffic of firefox redirect through a socks4/5 proxy. This completely baffled me as I in all my C# journeys I've never knew there was a way of 'hijacking' the net traffic of a exe to your program for proxy purposes.

    This all being said I was just curious if anyone knew any guides, etc. or anything at all that would point a C# programmer in the right direction. Don't need to hold my hand, I'll figure it out past anything you give me.

    I posted this question here because I've learned over the years the smartest and most knowledgable amongst the computer world are the programmers and I apologize for the ramble.

    Edit: I rambled and should have said I was looking for any explanation how this works, how reliable it is if data always routes or sometimes, etc. or any code samples of doing such yourself.

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

    New to coding

    Posted: 28 Feb 2020 08:00 PM PST

    Hey yall! Recently I have a huge interested in computer programming. Been watching some Youtube video about coding and did some google. Still couldn't have a clue about this coding stuff. So here I am in Reddit hope you guys can give me some advice. Here are some of my question.

    Is coding hard?

    If I want to learn how cod by myself, where should I get to start as a novel student? What book should I read as a beginner?

    What language do you guys recommend? I heard python and Js are the most popular for now. But are they recommended for someone who new to coding?

    I found there are some coding boot camp out there somewhere in my area. Are they worth my time to join? Most of the youtube video I found is about to complain the boot camp is not good. But I want to know about you guys opinion.

    What can you do if you good at coding? Can you be a hacker? aka watchdog :) Can you make a videogame? Or forever alone?

    Thank you

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

    Why is there a lack of tooling that helps understand large codebases?

    Posted: 28 Feb 2020 01:32 AM PST

    How does the code base work?

    There is a lack of good in-depth tolling for understanding big codebases for architects/team leads/developers. On one side we have simple tools for test coverage and on the other side, complex and expensive products like code climate focused on velocity.

    But there is a problem left unsolved in the middle. As an engineer working in a bigger team, it's hard to get an answer about how does part of codebase work. Or why & how & in what places is this piece of the system used.

    Keep in mind that you can use static analysis and "find all" to find specific usage of a function but what I am interested in is connecting concepts/modules together and showing their relationships in easy to understand way.

    It's a new decade and I still don't have a way to have:

    • A clickable diagram explaining all subsystems of my app and their dependencies to one another
    • A simple way to see the high-level flow for a particular feature. User registration code diagram for an example
    • A simple way to see which parts of code are undertested / overtested. Code coverage is a bad metric in general. It does not tell you anything about the popularity/usage of tested code
    • A way to have a good understanding of what side effects will I have to think about before starting the work on a feature. To measure scope and time needed. (Oh shit user registrations need to be exported to intercom...)

    What general questions should you be able to answer easily?

    • I want to change the functionality of this feature for new requirements. How can I know all other subsystems interacting with the feature?
    • I want to quickly get a high-level overview of major subsystems. What are the dependencies, are there any hidden connections that people tend to forget? What should I watch out for?
    • How can I easily know where does the feature starts and ends? I want to know how the card payments work. Where to start?
    • How much effort will be needed to refactor this feature? Are there any connections/interloop that I should be careful about?

    Real-world example

    What parts of the codebase do Stripe payment gateway touch and how is it implemented at a high level? What do I need to watch out for when migrating to Braintree?

    Can it be better?

    It took me 4 months just to grasp the major subsystems and their interactions with each other in my company. There has to be a better way.

    I understand that deep and comprehensive docs could be an answer, but really how many companies will do documentation at all levels of the tech stack? Usually what I see is that you have a few people at the company who have an understanding of the architecture and you kind of have to piece it all together from them.

    Why can't we automate at least part of this process? Something simple to give to the developers, so they can get a quick understanding of the features and their relations in the whole codebase.

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

    Any good web design resources for someone already strong at building front ends?

    Posted: 28 Feb 2020 07:17 PM PST

    Hi, I'm a "full stack" dev, and I don't mean that to say "I can replace a frontend and a backend developer," but in that if you give me a design and an API, my strength lies in building out the frontend robustly and being able to potentially take on some backend tasks.

    I'm in the mood to get better with the aesthetics of web sites. Not looking to change career direction, only not be so clueless in making a web page look modern. I feel like a "backend frontend developer," and I'd like to just hone in on being able to make a site from scratch and have normal people think it looks cool (or useful/modern/clear/other adjectives). I'm in that zone where devs and particularly utilitarian people don't mind any design I come up with but others aren't very impressed, even if I wrote a heck of a React implementation.

    I'm just wondering if anyone has any recommendations for web design resources that don't focus too heavily on the beginner's HTML/CSS/JS aspects. There's always more to learn about anything, and I'm sure there are still things about HTML I don't know, but it would be nice to get some basic design theory/practice without spending too much time on these syntaxes and such, unless of course it's more advanced HTML/CSS techniques and practices. I'll do video courses if they're very good and to-the-point, but I actually enjoy physical books a lot as well.

    I'm aware some of the best practice comes from mimicking other websites, so I'm not ignoring the ways I can pursue this independently. I just know that with everything, there are always some experts who can boil down some great patterns that save you some trial and error.

    Main reason I'm asking is because so much web design learning resources focuses on beginner HTML/CSS or Wordpress, etc. I'd be happy with something that literally didn't even cover any code, and only visuals and interaction.

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

    Code Gurus, what do i search to view the program code a browser uses to decode and build/compile from html/css/js?

    Posted: 28 Feb 2020 06:53 PM PST

    Namely any internet browser is in question. I learned CS and data structures before i learned web development. I just started that web development journey and I can't help but keep wondering what the browser program code looks like under the hood.

    I just wanna see it's classes/functions. Browsers do a lot of work.

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

    CSS Media Query Screen Size

    Posted: 28 Feb 2020 04:18 PM PST

    Should I make a new css file for each max-width, or should i place the media queries underneath the same ids and classes that require responsive upgrades?

    For example, if I have #product { width: 800px; } in products.css, should i place directly under that \@media only screen and (max-width: 800px) { #product { width: 600px; } }? Or should i place the media query in a new css file called products_under_800px.css?

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

    Algorithm run-time/bigO analysis question.

    Posted: 28 Feb 2020 11:02 AM PST

    I'm working on a project that involves speeding up a bad algorithm, and I'm unsure about how to categorize the run-time.

    Here's some pseudo code to illustrate whats being done:

    bool array[X,Y] has Z members that are true. for x in range(X): for y in range(Y): if array[x,y]: DO WORK! 

    So if the WORK takes constant time (it doesn't but just for the sake of argument) Then is the algorithm O(X*Y) or O(Z)?

    Clearly its doing |X * Y| comparisons, but then its only continuing to do the actual work for a subset of that, |Z| times.

    I remember in my algorithm analysis class it was always assumed that the loops would run the maximum number of times, but in this case Z << (X * Y) is always true.

    Am i just looking at the difference between worst case and average case, and can i disregard worst case if it is unrealistic?

    Also the reason that the bools are stored in the 2d array in the first place is for quick lookup by coordinate, so I aware i could just maintain that array as well as a separate list of the Z true coordinates. But I want to know if that is necessary or if this shortcut doesn't affect the run-time too much.

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

    Need Help by delete an item from a room database via click on a recylerview item (Android - Kotlin)

    Posted: 28 Feb 2020 02:37 PM PST

    Hey guys, i did the room tutorial to understand the room environment and i now i want delete an item when i am click on a delete item. The Problem is in didn't implement an Recycleradapter until yet and now i don't know where i can place the onClickListener to delete the selected item. Thanks for helping

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

    What to think about when making a site like youtube?

    Posted: 28 Feb 2020 02:06 PM PST

    Hello. I would like to make a simple site like youtube and yes I'm a beginner. I know basic html, css and php and wonder what to think about when it comes to create such a site like this. I would like to add the function create account, upload video and maybe even a forum and comments to the videos.

    I would like to hear your advices about this.

    submitted by /u/moviescript-
    [link] [comments]

    Need a 3D Geometry Library or General Guidance- .NET

    Posted: 28 Feb 2020 07:48 AM PST

    I need to be able to figure out the surface area and volume for weird situations.

    If two cones exist, and I know they have some shared space, how can I figure out what the shared volume is.

    The only solution I can think of off the top of my head is checking a large rectangular prism at increasing resolution and seeing if the point exists in both cones.

    For a cone with the point at the center of a cube, there's a height at which the cone would break out the sides (not the plane normal to the height). If the cone were offset so it weren't in the center, it would conflict with a side before it would conflict with the opposing side of the cube. I would like to know the surface area which is created when the cone intersects with a side.

    For this problem, I imagine just checking every point on the surface of the cube and seeing which points exist inside the cone.

    Is there a package for these types of problems?

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

    Help With Getting Product Information from Amazon

    Posted: 28 Feb 2020 01:39 PM PST

    Hello. I have never used this sub before but I hope someone can help point me in the right direction at least.

    Basically, I am a comp sci student at a university and have a semester project to build an application (mostly proof of concept, not to actually be used on a large scale or anything) to basically allow students at my school to exchange textbooks. We are trying to use Java and Android Studio for this. My professor said it would be a good idea to use Amazon's product advertising API to get images of books and a description. However, when I tried to sign up for an Amazon Affiliate account I found that you need to have a website or something to get approved to use the API, which I don't have.

    I contacted Amazon basically telling them all of this but the response was extremely unhelpful, basically saying I need to wait for my application to be reviewed even though I did not even apply since I don't have a website.

    I saw some other mentions of this API for someone who asked a similar question on stack overflow. http://api-doc.axesso.de/

    I went and signed up for an account but I have never used an API before and I can't figure out what I am supposed to do to install and use it. Am I supposed to download the API SDK from github? The readme says I need something called Maven which I am not familiar with and overall I am just very confused at this point.

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

    Prevent Race condition in REST api

    Posted: 28 Feb 2020 01:33 PM PST

    I have an api that creates a signing session between two users. This api checks if there is an existing signing session or there was signing request in past. It uses that session instead of creating new.

    Problem here is that if both users start a new signing session at the same time. Duplicate signing session will be created.

    I am thinking of either adding message queue strategy or using socket instead http call.

    I am also worried that socket strategy will also introduce same race conditions that will lead to duplicate creation.

    Message Queue strategy sound nice but I am not using Message Queue strategy anywhere in project. I do not want to add new technologies into project unless existing can not server my need.

    Also if there is other strategy that is used.

    Please provide pros and cons of different strategies used commonly.

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

    What are some processes/tips/systems one can use to write front-end code faster?

    Posted: 28 Feb 2020 09:18 AM PST

    So, I am working on a lot of PSD to HTML kind of projects. I am more of a back-end developer who works a lot with laravel and PHP in general. I don't enjoy the process of developing front-end very much but it's becoming an important part of the work I do.

    What are some tips you can share which will help me to spend less time implementing the designs and more time doing what I love more?

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

    Simple Mathematica homework question, running into a wall

    Posted: 28 Feb 2020 09:13 AM PST

    https://preview.redd.it/87tvh8hvxhj41.png?width=1808&format=png&auto=webp&s=cde60eea2da1146a88fdd6f1886ffef9e0aae57a

    How would I write a function that returned what it is asking? Currently I have

    CheckMatrixEntries[a_, M_] := Module[{i, j, r, c},

    r = Dimensions[M][[1]];

    c = Dimensions[M][[2]];

    For[i = 1, i <= r, i++,

    For[j = 1, j <= c, j++,

    Print["Entry ", i, " is ", a]]]];

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

    Initializing inherited objects in C++

    Posted: 28 Feb 2020 11:54 AM PST

    #include <iostream>

    #include <cstdlib>

    using namespace std;

    class abstrClass

    {

    public:

    virtual void member() = 0;

    static abstrClass * init(int choose, int * val);

    };

    class class1 : public abstrClass

    {

    public:

    class1(int*val);

    virtual void member();

    int* z;

    };

    class class2 : public abstrClass

    {

    public:

    class2(int * choose, int*val);

    virtual void member();

    int* choose;

    int* z;

    };

    abstrClass * abstrClass::init(int choose, int* val)

    {

    abstrClass * res;

    if(choose==1)

    {

    auto tmp = class1(val);

    res = &tmp;

    }

    else

    {

    auto tmp = class2(&choose, val);

    res = &tmp;

    }

    return res;

    }

    class1::class1(int*val) : z(val) {}

    class2::class2(int*choose, int*val) : choose(choose), z(val) {}

    void class1::member() { cout << "Hi, I'm Class1. Choose was 1 and z was " << *z << endl; }

    void class2::member() { cout << "Class2 is my name. Choose was "<< *choose <<" and z was " << *z << endl; }

    int main(int argc,char **argv)

    {

    int z = 5;

    int i = atoi(argv[1]);

    cout << "(i, z) = (" << i << ", " << z << ")" << endl;

    auto c = abstrClass::init(i, &z);

    c->member();

    return 0;

    }

    /* OUTPUT

    bash> ./run 1 && ./run 2 && ./run 3

    (i, z) = (1, 5)

    Hi, I'm Class1. Choose was 1 and z was 1220708680

    (i, z) = (2, 5)

    Class2 is my name. Choose was 147096392 and z was 2

    (i, z) = (3, 5)

    Class2 is my name. Choose was 147096392 and z was 2

    */

    Appearantly C++ does not care that I still want to use i and z. How would I solve this problem?

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

    Anyone know how to add a Gumroad license key to a chrome extension?

    Posted: 28 Feb 2020 11:39 AM PST

    I'm looking to monetize a chrome extension through Gumroad. They have some basic docs on achieving this using CURL. Anyone have any experience doing this? Where do I I out the code exactly?

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

    Should I abandon my project?

    Posted: 28 Feb 2020 09:17 AM PST

    Back in December, I had a great idea for an app in NW.JS, and since then I have had 4 restarts from scratch, and two times where I "abandoned" it and "took the L" for one day. But it was supposed to be my first actual real desktop program, and a coming-of-age symbol for my programming journey after which I could have called myself a programmer.

    But I really seem to have a problem with going past a certain point. I always start happy, full of hope, write maybe 300-500 lines, and suddenly I'm making excuses and get annoyed with things like scrolling up/down, input fields, not having any inspiration for design, the code not seeming good-enough and thinking about a new restart even though it's good.

    Anyway, I have so much fun ignoring my project and making useless little examples on w3schools for you guys to ask you some vaguely important questions, that it seems to me that I just don't have it yet in me to do a big project.

    So, now I am here, two months passed, nothing to show for it, failed 4+ times. But on the other hand, I learned so much from you guys, on top of what I already know. I learned that objects arent' scary or special, that you can reference higher-level variables in local functions (derp), the magic of queryselector and nth-children, that classes can be used for fetching child elements and not only for css, and so much more.

    So yea, now I have a choice:

    1. Take the L and move on to learn Godot, like I intended after the glorious finish of my now failed project, right around March.

    2. Try a 5th time, but really modularly, with small chunks of working code, made in w3schools editor (because I somehow hate my Atom for some reason, or am afraid of it or something), to be sewn up together like a frankenstein at a later date.

    3. Take the L, and go make a smaller program in NW.JS, though I have no idea whatsoever what to make.

    4. Take the L, and go make my website for my epic future stuff that I will never make and only dream about

    So yea, I dunno. I only know that I love Javascript, but I am thinking about Python in a distant future. No idea how tkinter compares to my woes of making gui with web technologies

    What should I do?

    Tnx!

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

    Double f(double x) use in C

    Posted: 28 Feb 2020 08:24 AM PST

    Got a confusing assignment in uni.

    https://www.reddit.com/user/jotar0_/comments/fax01q/l/?utm_medium=android_app&utm_source=share

    I understood the summation portion but the section about doubles and comparing previous values of f(x) to ln(1+x) went right over my head. Am I not getting it right or is it just poor directions? Already emailed the professor but I posted this here just in case he doesn't reply.

    this is a freshman level assignment so I maybe just dumb and do not understand the question. I just want a clear explanation of what to do, not the complete solution. Anything helps thanks.

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

    Question about C (String pointers)

    Posted: 28 Feb 2020 06:40 AM PST

    #include<stdio.h>

    int main()

    {

    char c[]="JIIT Noida SDF-II Exam";

    char *p=c;

    int i;

    printf("%s:",p+p[11]-p[18]+4);

    printf("%s\n",p+p[11]-p[12]-4);

    for(i=9;i>=0;i--)

    {

    printf("%c",p[i]);

    }

    return 0;

    }

    Can someone explain me the output?

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

    No comments:

    Post a Comment