• Breaking News

    Sunday, October 11, 2020

    Why don't complex api's write setup guides like outside tutorials? Ask Programming

    Why don't complex api's write setup guides like outside tutorials? Ask Programming


    Why don't complex api's write setup guides like outside tutorials?

    Posted: 11 Oct 2020 09:43 AM PDT

    I was not having a fun time with the Gmail API's getting started guide until I found a tutorial on Medium. Then it was straightforward.

    I noticed a few things

    1. The tutorial is opinionated and linear
    2. The information given is selective and minimal for the task at hand

    I sort of get it. The official docs want to be comprehensive and explanatory. My question is, why is this true even in a getting started guide? Seems that would be the place to do what these outside tutorials do.

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

    What language should i learn if i am interested in AI and Big Data?

    Posted: 11 Oct 2020 07:30 PM PDT

    What is the language that would allow me go far into AI and Big data?

    Is it Python?

    submitted by /u/Comprehensive-Ad8099
    [link] [comments]

    Firebase API and looping

    Posted: 11 Oct 2020 09:31 PM PDT

    I'm working on a project that uses Google Firebase Storage. Our application gathers a ListResult of all documents in any given Storage 'folder.' Since it's Firebase, and their API revolves around asynchrony, I have an onCompleteListener that handles the results.

    The problem is that I need to gather metadata from each result, which is ALSO asynchronous. So for every element in the ListResult that I get, I need to also run another asynchronous method to get the metadata. I then use a combination of the document info and metadata to instantiate a custom class and place that into a list for a RecyclerView.

    As of now, I have a for loop that iterates through the list, then calls .getMetadata() (asynchronous). I add a new custom class instance inline to the list, then link the list to the recyclerview for every iteration of the loop (a hack, really).

    Is having a bunch of asynchronous calls like that inside of an advanced for loop good practice? I've looked at documentation for CyclicalBarrier and CountDownLatch, but I already have the asynchrony, so using those would start a thread that then also starts another thread. I may be a student, but I can tell that that screams poor performance.

    Also, what would be the best way to handle the data I receive at the end of the iterations and asynchronous methods? I considered a Listener that sets a variable(s) to true and, when all data is collected (all variables are true), it then handles the linkage of the list to the RecyclerView. However, I find it difficult to properly set that up, and I keep getting stuck.

    Thanks in advance for all help and advice.

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

    What language should I learn?

    Posted: 11 Oct 2020 08:50 PM PDT

    A long time ago I learned HTML, now I just finished learning C++. I would like making a big tech company, like a page or an app, and I also like game development, but I don't really know what codes should I learn for this kind of stuff, so what languages would you suggest me learning?

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

    How do you go about making a Spotify app like this?

    Posted: 11 Oct 2020 07:51 PM PDT

    How would you go about making an app that curates a playlist based on certain keywords?

    https://duolovesongs.byspotify.com/

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

    Can someone walk me through the steps of how to solve this question?

    Posted: 11 Oct 2020 07:17 PM PDT

    Consider the following string of ASCII characters that were captured by Wireshark when the browser sent an HTTP GET message (i.e., this is the actual content of an HTTP GET message). The characters <cr><lf> are carriage return and line-feed characters (that is, the italized character string <cr> in the text below represents the single carriage-return character that was contained at that point in the HTTP header). Answer the following questions, indicating where in the HTTP GET message below you find the answer.

    GET /cs453/index.html HTTP/1.1<cr><lf>Host: gai a.cs.umass.edu<cr><lf>User-Agent: Mozilla/5.0 ( Windows;U; Windows NT 5.1; en-US; rv:1.7.2) Gec ko/20040804 Netscape/7.2 (ax) <cr><lf>Accept:ex t/xml, application/xml, application/xhtml+xml, text /html;q=0.9, text/plain;q=0.8, image/png,/;q=0.5 <cr><lf>Accept-Language: en-us, en;q=0.5<cr><lf>Accept- Encoding: zip, deflate<cr><lf>Accept-Charset: ISO -8859-1, utf-8;q=0.7,*;q=0.7<cr><lf>Keep-Alive: 300<cr> <lf>Connection:keep-alive<cr><lf><cr><lf>

    a. What is the URL of the document requested by the browser?

    b. What version of HTTP is the browser running?

    c. Does the browser request a non-persistent or a persistent connection?

    d. What type of browser initiates this message? Why is the browser type needed in an HTTP request message?

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

    Need help understanding this Function in Python.

    Posted: 11 Oct 2020 07:14 PM PDT

    Its part of a simple Tic Tac Toe program I had to make with a lab partner.

    here is the portion I have a question about.

    def makeAMove(game_board, game_player):

    playrRow = int(input('Enter a row for player {}: '.format(game_player)))

    playrCol = int(input('Enter a column for player {}: '.format(game_player)))

    if game_board[playrRow - 1][playrCol - 1] == ' ':

    if game_player == 'X':

    game_board[playrRow - 1][playrCol - 1] = 'X'

    elif game_player == 'O':

    game_board[playrRow - 1][playrCol - 1] = 'O'

    elif game_board[playrRow - 1][playrCol - 1] != ' ':

    print('This cell is already occupied. Try a different cell')

    playrRow = int(input('Enter a row for player {}: '.format(game_player)))

    playrCol = int(input('Enter a column for player {}: '.format(game_player)))

    return game_board

    What I don't get it the last elif statement after the print it goes right into playrRow and allows the player to re enter where they want to place their Tic Tac Toe move. How does those two lines make this loop back into the function. I made it like this. In this version of this function I have the makeAMove call to have it run through the function again if they select an area that has already been selected. Basically my question is in the program above how does the end of function allow it self to loop over again by just the " playrRow = int(input('Enter a row for player {}: '.format(game_player)))

    playrCol = int(input('Enter a column for player {}: '.format(game_player)))" portion at the end of the elif statement.

    def makeAMove(game_board, game_player):

    playrRow = int(input('Enter a row for player {}: '.format(game_player)))

    playrCol = int(input('Enter a column for player {}: '.format(game_player)))

    if game_board[playrRow - 1][playrCol - 1] == ' ':

    if game_player == 'X':

    game_board[playrRow - 1][playrCol - 1] = 'X'

    elif game_player == 'O':

    game_board[playrRow - 1][playrCol - 1] = 'O'

    elif game_board[playrRow - 1][playrCol - 1] != ' ':

    print('This cell is already occupied. Try a different cell')

    makeAMove(game_board, player)

    return game_board

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

    Output help with similar words

    Posted: 11 Oct 2020 06:46 PM PDT

    Hello, I'm relatively new to programming in C++. I'm working on a text-based game and I'm having a problem when the user inputs the same word, it would output lines that I'm not trying to make the program output. The "verb" and noun" are already declared in previous lines. Here is a part of the code:

    if(verb == "LOOK"){
    cout << "The room is dark but you see a small object in front of you." << endl;
    else if(verb == "LOOK" and noun == "OBJECT"){
    cout << "It looks to be a small key" << endl;
    }

    The problem is, when the user types "LOOK", it would output both if and else-if statements so it would say "The room..." and "It looks to be...".

    How do I separate these so if the user only types LOOK it would output the first cout and if the user only types LOOK OBJECT, it would cout the second?

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

    I used a standard algorithm for a Hackerrank coding interview

    Posted: 11 Oct 2020 02:22 PM PDT

    For the coding question on my Hackerrank coding interview, I recognized it as a standard Knapsack problem. Of course, there were some modifications I had to make to the inputs. But once I modified the inputs, the problem could be solved using the standard DP Knapsack algorithm. My question is, will this be flagged as cheating? I really only know the Knapsack algorithm implementation from GeeksForGeeks, so my code (aside from the input modifications) looks really similar to the GeeksForGeeks implementation.

    submitted by /u/Creative-Lawfulness9
    [link] [comments]

    What does "bool run" and "char ch" do in c++?

    Posted: 11 Oct 2020 06:08 PM PDT

    Code in C++ won’t update in terminal

    Posted: 11 Oct 2020 06:03 PM PDT

    (I am using visual code studio)

    Trying to test some simple text code in the terminal in visual studio code, but it won't update when I change anything in the code

    I am very new to coding, just simply writing a piece of code that says

    "You have (int. value) pieces of pie"

    I downloaded a compiler, named "code runner" and I pressed ctrl+alt+n to start the compiling, it says its running and then done with the text "exited with code=0" and when I try to test the code again, nothing updates

    Anyone know if I'm doing anything wrong? Thanks!

    submitted by /u/I-already-redd-it-
    [link] [comments]

    Best way to learn ZeroMQ?

    Posted: 11 Oct 2020 05:35 PM PDT

    I'm trying to use cppzmq library to build a 0MQ application; however, I can't find any resource to learn ZeroMQ.

    I've read https://zguide.zeromq.org/ but again it doesn't explain internals rather basics.

    Their API documentation does contain brief descriptions about internals but again it's not straightforward.

    On the Internet, There are lot of examples but most of them are either C or Python. I can't find anything on Modern C++ except just 1-2 examples which doesn't suits my use-case.

    I've tried to put together something in my code but it's so much brute forcing and guessing.

    My brain hurts!!!

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

    Is Cloud Storage just this?

    Posted: 11 Oct 2020 04:18 PM PDT

    I wanted to code my own GUI platform for a personal cloud storage, that will give some use to my raspberry pi.

    Instead of using an already available software I wanted to make my own. Since I want to improve on/learn c++, that's the language I chosen to use.

    Before I start coding it, I'm planning everything, that means that I need to take in consideration what I need to do and what services I'll be needing (e.g.: sftp, ssh, etc..). When I think about the services the one thing that stands out is ssh, since this will be a private platform for me to use and it will be connected by ethernet and wont touch any connections outside my router.

    So basically my cloud storage will only be a machine with an ssh server and all I need is to code my GUI platform, is this mindset right? Am I missing something? Because this makes me sad, because my initial idea was to actually "code my cloud" even if that's something that not even I have figured on how I'd do it.

    Can you guys point me in the right direction? Or even just a better direction? Thank you.

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

    Mouse-Tracking Project

    Posted: 11 Oct 2020 02:25 PM PDT

    Hi to you all!

    I am working on a new project with my classmate from university. The theme is "tracking" and we decided to make a WPF program where the movement of a mouse is tracket troughout the day/week and after recording the mouse movement in the background. Once the recording of mouse movement is done, you could see the diagram of where the mouse is most active, where the most clicks are made on the screen etc. Any ideas where I could read the documentation, Github projects I could use or any other tutorials except Microsoft Documentation?

    Thank you!

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

    How to figure out best possible salary

    Posted: 11 Oct 2020 02:16 PM PDT

    Through one of my connections I was essentially offered a job as a full stack developer.

    I have a total of close to 2 years experience as a Java Developer but if I were to proceed with this opportunity it would have me switching between a Java stack to a Dot Net stack which I am completely fine and comfortable with due to all of my personal projects being created using Dot Net.

    I would be going from a company size of 100 to over 1000+.

    The cons truly only are having to eventually move 2 hours away into a city Called Milwaukee in the state of Wisconsin. I currently stay in Illinois.

    I have no idea what a full stack developer makes in Milwaukee with two years of experience. When I do a quick Google search I receive lots of possible answers and I'm a bit confused to say the least.

    Any help would highly be appreciated.

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

    API not setting collection?

    Posted: 11 Oct 2020 12:37 PM PDT

    Error: 'Object reference not set to an instance of an object.'.

    I am trying to use NewtonSoft to deserialize some json from the RestCountries API but getting this error yet I am clearly setting the cc object. The error is called when returning cc.Countries.Count.

    My method:

    public int GetCountriesList()

    {

    using(var webClient = new WebClient())

    {

    String rawJson = webClient.DownloadString("https://restcountries.eu/rest/v2/currency/cop");

    String parsed = rawJson.Substring(1, rawJson.Length - 2);

    CountriesCollection cc = new CountriesCollection();

    cc = JsonConvert.DeserializeObject<CountriesCollection>(parsed);

    return cc.Countries.Count;

    }

    }

    My Collection Class:

    public class CountriesCollection

    {

    public List<CountryModel> countries;

    public List<CountryModel> Countries { get => countries; set => countries = value; }

    }

    My Model:

    public class CountryModel

    {

    public string Name { get; set; }

    public List<string> TopLevelDomain { get; set; }

    public string Alpha2Code { get; set; }

    public string Alpha3Code { get; set; }

    public List<string> CallingCodes { get; set; }

    public string Capital { get; set; }

    public List<string> AltSpellings { get; set; }

    public string Region { get; set; }

    public string Subregion { get; set; }

    public int Population { get; set; }

    public List<double> Latlng { get; set; }

    public string Demonym { get; set; }

    public double? Area { get; set; }

    public double? Gini { get; set; }

    public List<string> Timezones { get; set; }

    public List<string> Borders { get; set; }

    public string NativeName { get; set; }

    public string NumericCode { get; set; }

    public List<Currency> Currencies { get; set; }

    public List<Language> Languages { get; set; }

    public Translations Translations { get; set; }

    public string Flag { get; set; }

    public List<RegionalBloc> RegionalBlocs { get; set; }

    }

    I don't know where the problem lies, I'm pretty sure everything is set up correctly and I followed the newtonsoft guide online here.

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

    formatted outputs on python

    Posted: 11 Oct 2020 10:58 AM PDT

    Set seed:

    42

    How many doors?

    10

    _ _ _ _ _ _ _ _ _ _

    | | | | | | | | | | | | | | | | | | | |

    |_| |_| |_| |_| |_| |_| |_| |_| |_| |_|

    1 2 3 4 5 6 7 8 9 10

    Choose a door 1-10.

    4

    You chose the door number 4.

    ...

    _ _ _ _ _ _ _ _ _ _

    |G| | | |G| | | |G| |G| |G| |G| |G| |G|

    |_| |_| |_| |_| |_| |_| |_| |_| |_| |_|

    1 2 3 4 5 6 7 8 9 10

    8 certainly wrong doors were opened. The door number 2 was left.

    Choose 4 if you want to keep the door you first chose and choose 2 if you want to change the door.

    2

    _ _ _ _ _ _ _ _ _ _

    |G| |C| |G| |G| |G| |G| |G| |G| |G| |G|

    |_| |_| |_| |_| |_| |_| |_| |_| |_| |_|

    1 2 3 4 5 6 7 8 9 10

    Congratulations! The car was behind the door you chose!

    ---------------------------

    How do I get formatted outputs like this? I'm not even sure where to start with all these characters and symbols :/ (im completely new to programming)

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

    How useful would it be to take courses on agile etc. practices? Is there evidence to e.g. suggest that they're useful?

    Posted: 11 Oct 2020 02:33 AM PDT

    How useful would it be to take courses on agile etc. practices? Is there evidence to e.g. suggest that they're useful?

    I've been puzzled by the "non-linearities" of software development lately where it's possible to spend plenty of time on projects by chasing all sorts of features. And then I've been interested, whether it's possible to perhaps downsize this by understanding some psychological things.

    But I am not sure about the effectiveness of motives of agile etc. Since "managerial types" can be found to be prone to drawing all sorts of other "theories" in order to justify practices that may work for other purposes than stated ones.

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

    Architecture/framework question

    Posted: 11 Oct 2020 12:49 AM PDT

    I'm a pretty advanced programmer in my day-to-day job, but it's always been in complete different fields from what I want to do now.

    I want to setup a backend service running on my NAS, that constantly calls various API's (every few seconds) to track changes happening. When some change happens, I want the change/data written to a database that's also running on my NAS. Furthermore I want to provide API end-points so I can build a frontend on top of the data later on, and I want to have the possibility to send alerts to my phone from the backend.

    All above I can code pretty easily (various API calls, creating restful services etc.), but I have a hard time figuring out what frameworks to use for this. What would you use that will constantly keep calling services, as well as providing different services by yourself? What DB would you use? (MariaDB? Since that's pretty natively installed on my NAS?) What framework of getting alerts on your phone would you use? (Could be as easy as sending a telegram message in a group that I'm a member of and have alerts on for)

    Some information about me and the hardware I use: mainly worked with java, c#, html and css. Got a Synology DS918+ NAS, use an Iphone XS Max.

    Thats for any assistance in advance!

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

    Basic HTML/CSS question

    Posted: 11 Oct 2020 12:21 AM PDT

    I am taking a beginner web design class. I'm trying to put an image for the header of a page inside of a div. For some reason my div extends several pixels below the image. What could be my issue? I didn't have this problem at first so I don't know what I changed.

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

    Need advice

    Posted: 11 Oct 2020 01:25 AM PDT

    No comments:

    Post a Comment