• Breaking News

    Sunday, August 11, 2019

    What programming knowledge do I need to build a Gmail add-on? Ask Programming

    What programming knowledge do I need to build a Gmail add-on? Ask Programming


    What programming knowledge do I need to build a Gmail add-on?

    Posted: 11 Aug 2019 04:22 PM PDT

    I want to make a Gmail add-on.

    As a beginner, would this be too advanced a project for me, or something I could feasibly tackle?

    I know HTML, CSS, and some JavaScript.

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

    Managing large amounts of files in WPF C# (Making Music Player for Self)

    Posted: 11 Aug 2019 04:24 PM PDT

    When I set the directory to a place with about a 100 or so files it takes a bit, but it adds the songs to the program in which I can play them like normal. It's when I'm doing large folders (especially my entire library) the program stops and freezes. If I can get thousands of files to eventually work, I'm going to probably learn how to cache it somehow so I don't have to scan my music library every time I want to play music, but that's a story for a different time.

    public static List<ATL.Track> ScanLibrary(string path, bool searchInSubDir) { string[] fileEntries = {}; List<ATL.Track> temp = null; //Search for files in sub-directories if chosen to if(searchInSubDir) { fileEntries = Directory.GetFiles(path, "*.*", SearchOption.AllDirectories); } else { fileEntries = Directory.GetFiles(path, "*.*", SearchOption.TopDirectoryOnly); } //Check for each file in "fileEntries" to see if there are files with the supported media types for(int i=0; i<fileEntries.Length; i++) { for(int j=0; j <supportedFileTypes.Length; j++) { //If the file is supported add it to the "trackList" temp.Add(new ATL.Track(fileEntries[i])); } } return temp; } 

    supportedFileTypes is a seperate static string array that contains all of the file types ATL supports (unrelated to function as a whole)

    This function works perfectly fine to give me a list of ATL.Tracks (C# Audio Tool Library), to get all sorts of song data. However I can't find away to use this function of scanning and adding to a progress bar, to visually signify that the program is doing something, rather than it freezing for a minute until it's done scanning, and then resuming like normal.

    My issues that I can't seem to do are:

    1.) Make a progress bar showing the process of scanning for files.

    2.) Having Visual Studio throw an error when I set the directory path to be my entire music library which has around 6,000 songs when it sits for a couple minutes.

    When I set the directory to a place with about a 100 or so files it takes a bit, but it adds the songs to the program in which I can play them like normal. It's when I'm doing large folders (expecially my entire library) the program stops and freezes. One major thing I've noticed however is that the Directory.GetFiles() bits are the ones freezing the program temporarily not the other half of the function.

    Side note: I've seen Directory.EnumerateFiles but unsure how it works. I kept seeing responses from a user called csharptest.net on other people's posts showing how to iterate through large amounts of files but it seems like it's his own namespace and project files. Which I'm not opposed to, just a bit unsure of if its necessary to download all that extra files & stuff to do one thing.

    TL;DR: I'm trying to get thousands of files using Directory.GetFiles() without temporarily freezing program and have it show a progress bar.

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

    How to play separate audio and video streams on the web?

    Posted: 11 Aug 2019 08:43 AM PDT

    So I would like to try playing a separate audio and video stream, extracted from invidio.us together. Is there any way to play them together with the URLs? The default <video> element only allows one source at a time and I couldn't understand how to use Media Source Extensions. Thank you in advance!

    submitted by /u/Bobby-Botato
    [link] [comments]

    What to study to get into competitive programming?

    Posted: 11 Aug 2019 09:59 PM PDT

    I was into competitive mathematics and only recently got into programming. Naturally, competitive programming like ICPC or Google Code Jam intrigue me as sort of a long term goalpost to study for.

    Currently, I finished an introductory CS textbook with a focus on Java and I'm working through an algorithms & data structure book.

    On the side, I'm solving Project Euclid problems as much as I can.

    I am curious as to the steps to take to get into competitive programming. I am guessing that I should, at the minimum, learn:

    1. The rest of algorithms & data structure
    2. Discrete math (no prior experience other than prepping for HS level mathematics contests) (Idk if lin alg which is apparently important for machine learning is needed for this, but I know some lin alg anyway.)
    3. C eventually, since ICPC seems to prefer C for its efficiency over Java
    4. Competitive programming - which seems to be advanced algorithms & data structured
    5. Find and join existing programming group in my university

    Obviously, with very little programming experience I'm guessing a lot. Guidance would be helpful.

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

    What do ML Engineers actually do?

    Posted: 11 Aug 2019 09:31 PM PDT

    Do they create new models and algorithms for each problem or do they simply tweak and apply existing models to the problem they are solving?

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

    Looking for ideas on integrating a Push To Talk feature in a C# mobile app.

    Posted: 11 Aug 2019 09:24 PM PDT

    Hey all. So I'm developing a mobile app in C# for both iOS and Android that will be used by small security companies. As a feature of the app, I would like to allow users to have a PTT button that would allow them to talk to other security officers on their site. I have been having a hard time finding ideas on how to make this happen. I have been thinking about using a SIP server hosted in Azure to handle the communications but I was wondering if anyone would have any better ideas on how to go about this. Anyone have any ideas?

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

    Way to create apple calendar events through an API?

    Posted: 11 Aug 2019 09:22 PM PDT

    I am trying to to integrate a js fullcalendar on my website with my current apple icloud calendar. I know google calendar has an events API but I have always used apple calendar so I would prefer to integrate that. I tried using apple-calendar-integration python package but there is little to no documentation (doc page is 404). Can the iCalendar python package be used for this? Is this even possible without using apples own EventKit? I am lost here, any help appreciated.

    More research yielded this documentation from apple: working with events, however I am having trouble understanding where this script would even be running?

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

    How to solve "Doesn't match the certificate for the app" on Google Play?

    Posted: 11 Aug 2019 09:03 PM PDT

    My boss and I are trying to solve this problem.

    Context: Once a upon a time, there was an app that was created under our company by a previous team, but the app is now antiquated and my boss told me to unpublish it from Google Play and just add this new one. So, I create new android app bundle and sign it myself on my computer. But, whenever I give my boss the "private_key.pepk" file it says it does not match the certificate.

    I've been browsing stack overflow and I cannot for the life of me find a solution, we've been struggling with this for about a week now. I gave him the .jks and the .keystore files. None of them work.

    What do I have to do to match the certificate of the app? Can I just delete it? This is so fucking stupid.

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

    More C++ confusion

    Posted: 11 Aug 2019 04:37 PM PDT

    Hello there. Making a game of tic tac toe with a 2d character array, and I am having some trouble. Not really sure what the problem is, but I bet it comes down to me having some large misunderstanding with how passing arrays and void functions work. If you've got time and can think of any solutions, let me know:

    #include <iostream>

    using namespace std;

    int main()

    {

    char board[3][3] = { {0, 1, 2}, {3, 4, 5}, {6, 7, 8} }; 

    void runGame(board); //incomplete data type is not allowed 

    return 0; 

    }

    void playGame(char (&array)[3][3], char player, char spot)

    {

    if (player = 'X') { switch (spot) { case '0': array[0][0] = 'X'; break; case '1': array\[0]\[1\] = 'X'; break; case '2': array\[0\]\[2\] = 'X'; break; case '3': array\[1\]\[0\] = 'X'; break; case '4': array\[1\]\[1\] = 'X'; break; case '5': array\[1\]\[2\] = 'X'; break; case '6': array\[2\]\[0\] = 'X'; break; case '7': array\[2\]\[1\] = 'X'; break; case '8': array\[2\]\[2\] = 'X'; break; } } 

    if (player = 'O') { switch (spot) { case '0': array\[0\]\[0\] = 'O'; break; case '1': array\[0\]\[1\] = 'O'; break; case '2': array\[0\]\[2\] = 'O'; break; case '3': array\[1\]\[0\] = 'O'; break; case '4': array\[1\]\[1\] = 'O'; break; case '5': array\[1\]\[2\] = 'O'; break; case '6': array\[2\]\[0\] = 'O'; break; case '7': array\[2\]\[1\] = 'O'; break; case '8': array\[2\]\[2\] = 'O'; break; } } 

    }

    void runGame(char (&array)[3][3])

    { //expected a ;

    cout << array; int turn = 1; bool fQuit = false; char spot; while (1) { if (turn % 2 != 0) { cout << "go ahead X, pick a spot (0-8)\\n"; cin >> spot; playGame(array, 'X', spot); turn++; } else if (turn % 2 == 0) { cout << "go ahead O, pick a spot (0-8)\\n"; cin >> spot; playGame(array, 'O', spot); turn++; } else if (turn < 10) { fQuit = true; break; } } 

    }

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

    Start with web development or app development?

    Posted: 11 Aug 2019 08:15 PM PDT

    Hi! A few days ago I started learning the web development basics with MDN (html, css, javascript). I'd like to know if I should keep going on with this or switch to another thing, I like this and I would like to go serious with this, and make it my job while studying other thing. Im from Argentina, sorry for my english :P

    Thanks for any answer and advices. :)

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

    How would you style this? I used float but it doesn't look good and can't quite figure out how to do it using Grid or Flex

    Posted: 11 Aug 2019 07:45 PM PDT

    Here's a picture: https://imgur.com/a/lPpkv0K

    I'm trying to get the last line of text to start at the same edge as the text above it. I'll add margin and padding later but for now I'm trying to figure out the layout

    I tried using Grid but explaining that would be a whole other post.

    The code I have now is just the image floated to the left and the container has a set width

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

    What is the dumbest sentence, statement or otherwise you have heard from a non-programmer about programming?

    Posted: 11 Aug 2019 05:57 AM PDT

    retrieve() - returns a single Account with the specified accountID from the accounts Map. If none is found, return null.

    Posted: 11 Aug 2019 05:58 PM PDT

    what would be the best way to create a method to do this?

    I was thinking boolean but wasnt sure?

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

    Google smart home device

    Posted: 11 Aug 2019 05:43 PM PDT

    Hello I was seeing a video about Google smart home device, the device where you talk and it executes your ''orders''.... I was asking myself some things, can you help me?

    1) which programming language is it used for the software

    2) Ho can the device (the code) know what to do if it is a new house? How does it the device

    connected to the rolling shutter or television? Through what? How does it interface with these interfaces that it has never seen before and to give it orders?

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

    Where Do You See the Future of Data Going As Far As Databases: Relational vs Non-Relational Databases

    Posted: 11 Aug 2019 08:56 AM PDT

    I know the difference between SQL and No-SQL, as I've used both on pet projects of mine (I'm still in school so have not seen them in the real world, although SQL is extremely popular on job search sites). I'm just interested in starting a discussion between the two. Do you think that No-SQL will become more popular and that SQL will become more of a legacy language do to the flexibility of non-relational databases, or do you think that SQL and relational databases will reign supreme for the foreseeable future due to how ingrained in data it already is?

    submitted by /u/Majin-Buuddha
    [link] [comments]

    How should I structure a simple 2048-style game at the highest level?

    Posted: 11 Aug 2019 12:43 PM PDT

    I'm at the hardest part (for me, as a novice) of game prototyping: a blank unity project.

    Basically I'm trying to decide how to create the grid space and the tiles that slide across it. I've reviewed a couple free unity asset store projects of this game type but I'm not sure about the quality of the code.

    Here's a gameplay vid if you aren't familiar with it: https://www.youtube.com/watch?v=ayqhX9UA6FY

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

    Can you tell me how you would write a unit test for this function?

    Posted: 11 Aug 2019 11:57 AM PDT

    I've been writing unit tests for all the functions of my classes, but I'm concerned that my tests are way too implementation-specific, such as asserting that a function calls other functions a certain number of times and with certain arguments.

    The example below is a function from a JavaScript Class that has its dependencies injected in via Dependency Injection. Following best practices for Unit Testing, can you show me how you might write a unit test for this function:

    ``` async signUpNewUser(userData = {}) { try { // Only checking password here because the Model will validate other properties. if (!userData || !userData.password) throw new ValidationError();

     // Hash the user's password. const hashedPassword = await this.passwordService.hash(userData.password); // Create a safe user object to store with no sensitive data in plain-text. const cleanUser = { ...userData, avatarPaths: this.appConfig.cloudStorage.avatars.getDefaultAvatarPaths(), password: hashedPassword }; // Save the user to the database. const userPreToken = await this.userRepository.create(cleanUser); // TODO: Emit events for analytics, cron-jobs, email on-boarding, etc. // TODO: this.eventEmitter.emit('signed_up_user', { email, name }); // Attain an authentication token for the user. const token = this.authenticationService.generateAuthToken(userPreToken._id); // Update the user in the database to save his/her token. const userWithToken = await this.userRepository.updateTokensById(userPreToken._id, token); return { user: this._transformUser(userWithToken), token }; } catch (err) { if (err.code === 11000) throw new ValidationError(null, 'The provided email address is already in use.'); if (!err.name) throw err; throw err.name === 'ValidationError' ? new ValidationError(err) : err; } } 

    } ``` I'd prefer a Jest example, if at all possible, but any other testing framework would work fine.

    Thank you.

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

    I'm trying to find the website where programming advice is packaged as Taoist Parables

    Posted: 11 Aug 2019 02:15 PM PDT

    Hey, I'm not sure this is the best place to ask this, but I could not think of any better.

    A few years ago, I was quite frequently reading this website where programming advice was presented in the form of Taoist philosophy/parables. A coding shop was called a monastery, the junior programmers were novices and the seniors were masters.

    It included such things as

    • Explaining the virtue of clean system design by comparing it to a beautiful winding path nobody used, opting instead for a direct line trough the garden, leaving a straight line of trampled flowers
    • Technical debt as rain that took days to trickle trough the branches of dense trees
    • Frequently featuring the phrase "At this, he was enlightened"

    I recalled it being called "The Zen of Code", but it clearly isn't - google doesn't give anything useful for this.

    I've searched for this for a few days now and I'm going crazy.

    Thanks.

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

    Help With Recursive Function to Delete a Property From a Tree Object

    Posted: 11 Aug 2019 12:32 PM PDT

    Are there any true multi-platform GUI libraries nowadays?

    Posted: 11 Aug 2019 12:31 PM PDT

    Does there exist any UI library that allows to write software capable of running natively on all modern platforms? I.e.:

    • web (HTML5)
    • desktop (Windows, Mac, GTK/Linux, Qt/Linux)
    • mobile (Android, iOS)

    (I'm not asking about running a web app and pretending it's a "desktop app" just because it runs in its own Window)

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

    LNK1168 error

    Posted: 11 Aug 2019 11:38 AM PDT

    hi guys i'm new to programming .I'm practicing c++ on visual studio 2019 but when i try to run it with windows local debugger it gives and error LNK1168 saying it cannot open exe file for writing.please any suggestions on how to fix this problem?

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

    Does JS's dynamic prototype chain (as opposed to "classical" class inheritance) offers any actual benefits?

    Posted: 11 Aug 2019 05:31 AM PDT

    Program that can visually filter out data

    Posted: 11 Aug 2019 11:26 AM PDT

    Looking for a program where I can put in 7 images , each of which contains 12 smaller images (in a grid).

    I want the software the determine which image appears most often to least often. What is out there that can do this? If not then how would I program it? Thanks!!!

    Context: im a visual artist and am looking through my Instagram data to determine which posts get most (likes, shares, engagement, reach, etc.) each of those metrics is presented as a gallery. So I just want the program to find the common images so I know which of my content is best optimized for Instagram

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

    Framework choice for creating an LCD panel displaying drinks menu

    Posted: 11 Aug 2019 11:24 AM PDT

    I want to create a real time interactive display for my college's student bar so that we can easily add new items on the menu.

    There is already an existing website through which all transactions are done, and I would like to display some animations when people buy a drink. These animations would be fairly simple, for example the drink serves would blink and change color. But if possible I would also like to add more complex animations such as some sparks or flames appearing.

    I don't know a lot in front end, so I have not a precise idea of the project's complexity.

    I'm thinking of using a raspberry pi outputting an HDMI stream, but I don't know what programming language of framework to choose.

    I know that it should be feasible using Processing, but there might be other easier and cleaner options.

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

    No comments:

    Post a Comment