• Breaking News

    Wednesday, May 20, 2020

    ELI5 what is dynamic programming? Ask Programming

    ELI5 what is dynamic programming? Ask Programming


    ELI5 what is dynamic programming?

    Posted: 20 May 2020 12:05 PM PDT

    I've been encountering problems lately where the solution requires a dynamic programming solution, but I can't wrap my head around how that works. Can some ELI5 it?

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

    Why Batch Processing? It sucks.

    Posted: 20 May 2020 10:56 PM PDT

    I work in a bank with history. Batch processing is common. Transactions have various states and one of such batch operations is calculating balances. Of course in this age we want to move to event driven architecture to provide real time values. Was discussing with my friend and he seemed not to get what I was pointing at. If we create a bank from scratch, this calculation can be done on the fly and will be written in the same way comments are implemented on FB. In batch processing every record is read chronologically anyway and state changes are in order. I was asking how is money fundamentally different from comments that one needs batch solution while the other doesn't? There are use cases for batch I get that especially in analysis. But business logic? When the real time state which is needed can be inferred but is not materialised and only calculated later on.

    I am partly discussing this because I realise this is not a place I want to be at dealing with batch processing. I was hired as a full stack developer, those are my strengths. My Guess is this is just legacy stuff. Somehow it was easier back then and they made the choice that hey lets not calculate these in real time but do it when people are asleep. But it just makes no design sense and adds unnecessary complication to the problem

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

    I can make sense of this statement.

    Posted: 20 May 2020 10:43 PM PDT

    I was viewing a meme on Facebook about javascript.

    > 2 + 2

    > 4

    > "2" + "2"
    > "22"

    > 2 + 2 - 2
    > 2

    > "2" + "2" - "2"
    > 20

    For the above statement, it makes sense

    First, it subtracted then concatenated.

    I tried a few things in the browser console.
    I could not make sense of

    > "2" + "2" - "3"

    > 19

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

    What did the programmers unlearn in the last 30 years?

    Posted: 20 May 2020 05:22 AM PDT

    Basically the title, I mean things besides writing more small programs (not 40GB Dependencies), and so on.

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

    Facebook/Instagram Graph API

    Posted: 20 May 2020 11:21 PM PDT

    Hello, I'm trying to utilize graph api to pull information about any given Instagram post (from any account). Correct me if I'm wrong, but would Basic Display API be enough for this? I would need photo url, author and likes.

    Also is it necessary for FB app to go live in order to start working? I need it only on my website.

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

    I want to run a socket server on a server raspberry pi and connect via ethernet to another client raspberry pi. The ethernet port on the server pi is already used for incoming messages to it. What do I do?

    Posted: 20 May 2020 10:31 PM PDT

    As the title says, I have a server pi that I want to connect to another client pi via ethernet cable except the ethernet port is already being used on the server pi. The server/clients are written in python. I do not have an option to use wireless socket and the current ethernet plugged into the server pi must remain connected. Is there a way to have 2 ethernet cables connected to 1 raspberry pi? If so, will i be able to use sockets between a server/client the same way or will this confuse things?

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

    Paid courses suggestions

    Posted: 20 May 2020 09:46 PM PDT

    Remote Router Configuration Changer Curiosity

    Posted: 20 May 2020 05:27 PM PDT

    Had an idea pop into my head from a suggested idea of a friend.

    He said, "I wish I could make <son's name>'s internet speed drop 1-3mbps every time he swears."

    I know you can remote into a router with telnet usually, and ssh if you have something like dd-wrt installed on it.

    But I have been poking around the telnet on my own router to see if I can find out where the configuration files are, or how it is saved etc., in any other location other than the web interface.

    It is an Asus RT-N12D1 router, and I am curious if anyone has ever poked around as well to do something like change configuration options remotely.

    The end goal would be to use python potentially with an rPi/Arduino and perform the changes that way.

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

    suggestions for programming language to learn?

    Posted: 20 May 2020 09:07 PM PDT

    I currently know basic python and want to learn another language since i have alot of free time on my hands rn. Please give suggestions and also resources on where i could learn them from! :)

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

    Need to scrape "stock sector" for Sheets

    Posted: 20 May 2020 07:46 PM PDT

    I am trying to link to the stock ticker sector in google sheets, scraped from Finviz. I have a picture, but I'm unable to post it on here for some reason or other. The sector link is below the company name, for example Procter & Gamble is "Consumer Defensive".

    Can anyone help me out by pointing me in the direction of how the link should look in google sheets to have the cell reference the unique ticker symbol? I'm building a portfolio tracker and this is m last step... thanks! or email me at [Chicago_27@hotmail.com](mailto:Chicago_27@hotmail.com) and I can send you a screenshot of what i'm looking at.

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

    need help with click to play audio sequence, or random audio (any)

    Posted: 20 May 2020 03:55 PM PDT

    i started learning to program a website 2days ago and i made a button that plays a sound following a tutorial, like this:

    <script> var bleep = new Audio (); bleep.src = "/audio/audio.mp3" ; </script>

    <button> <a href="#" onmousedown="\[bleep.play\]([https://bleep.play)()" >Order now ](https://bleep.play%29%28%29%22%20%3Eorder%20now%20/)</a></button>

    how do i make so i the second time i click i play audio 2 and the third i play audio 3? i'm testing some random stuff but nothing yet

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

    What is a typical career path for a Unity Developer?

    Posted: 20 May 2020 12:55 PM PDT

    I am a Unity Developer currently working with developing VR/AR apps. I am sort of lost on how to develop organically in this career path without trying to switch to a more traditional SDE role. Looking forward to some guidance from my fellow Unity devs !

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

    What’s the oldest program to teach coding?

    Posted: 20 May 2020 06:36 PM PDT

    Ok to put it simply I just want to know some of the oldest programs that teach programming languages. This is not for learning just out of curiosity. This is being used as a joke between friends

    submitted by /u/the-truth2
    [link] [comments]

    So SQL can have queries that remain the same but have changing response times. What are some other systems that are similar? I'm mostly interested in read path but all examples are welcome.

    Posted: 20 May 2020 04:58 PM PDT

    I'm thinking about something for benchmarking heterogenous and changing data access systems like SQL so I'm looking for great examples.

    submitted by /u/Terrible-Assumption
    [link] [comments]

    Question on where to get started

    Posted: 20 May 2020 12:53 PM PDT

    Hi everyone,

    First of all, I'm not sure if this is the right forum to ask for help, so feel free to direct me elsewhere if I'm in the wrong place.

    I'm a special education teacher that works with kids who have low cognition / significant language needs.

    With schools quarantining and the very likely possibility that we may have to periodically quarantine if there are outbreaks in individual communities, many students with special needs have been struggling to access meaningful learning.

    I was hoping to find either some youtube channels or online courses that could teach me the skillset I would need in order to make either a website or app with interactive books I could make for my students.

    My end goal would be to create high interest, low reading level books where I let the reader choose to have it read aloud, highlight words, or read on their own, could animate pictures on the page, let the students click on words to sound out, work on receptive language by giving questions to find thing in the text or pictures, embed some some comprehension questions in it, etc.

    I know just enough about designing this to know that I have no clue where I should start! Is this a programming thing? Are there preexisting programs I can use to create the content? If anyone has suggestions for where I could start, I would greatly appreciate it. Thanks!

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

    Lets' share some underrated Youtube channels about programming.

    Posted: 20 May 2020 05:48 AM PDT

    Recently while searching for specific questions in youtube I've stumbled upon some really nice but underrated youtube channels. I would like to share them here and feel free to comment your picks for this list too.

    Please feel free to reccomend your favourite youtube channels, while I've only listed more low level and unity focused channels, i'm sure there are some great channels on other areas too

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

    I have 3 years of high school left, what language should I spend all my time towards?

    Posted: 20 May 2020 02:01 PM PDT

    I realize I have quite a bit of time that I may never get again. 3 school years (including the summers). And I've heard it's better to be a master of one rather than decent at many things so considering all this time, what language should I put all my focus towards? My main interests are a little hazy but I think they are indie games, desktop software, and maybe mobile apps (not huge on this since mobile apps are so saturated).

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

    Video from blob only plays sometimes

    Posted: 20 May 2020 02:00 PM PDT

    I'm trying to play a video that is stored in a blob, but it only works sometimes, about 1 / 5 times. The other times it either tells me "no video with supported format and MIME type found" or gives me a blank screen. Any idea why could that happen ?

    Here's my code : https://pastebin.com/HWMKxRu0

    EDIT : because the outcome is not consistent, I suppose it's something to do with timing.

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

    Should I use C++ or C# for making iOS, Windows, and Android apps?

    Posted: 20 May 2020 01:41 PM PDT

    So I could either use Visual Studio (C++) or Xamarin (.NET and C#) to make Android and iOS apps. Which one should I use? I am a beginner and willing to learn one or the other or both.

    submitted by /u/8blackears
    [link] [comments]

    Where to place git while using docker to containerize a (laravel) project?

    Posted: 20 May 2020 01:00 PM PDT

    This question may seem pretty dumb but I'm very new to docker so excuse me.
    Just went through some boilerplates for laravel/docker setup and I'm curious about where the .git will go? Like if the laravel app is placed inside /src directory (inside the main dir) then will the git initialization take place in /src or in the main docker directory?

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

    Is anybody familiar with Jason programming?

    Posted: 20 May 2020 12:22 PM PDT

    Not JSON but Jason. I have a project and I don't really understand the concept of the language. Any help is welcomed. I read the book but still don't really know where and how to start.
    My project is a Smart Store. If you have anything please feel free to share

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

    Interval for geolocation

    Posted: 20 May 2020 12:01 PM PDT

    I have an angular ionic 5 app running on a cordova android emulator. What I need to do is use the ionic Geolocation plugin to find the speed of the user. I need to record the user's speed every second, and make sure it falls in the range of 0.7 < x < 2.5 m/s. If it does not, continue recording every second until it does. I need to record 10 valid speed measurements using this method. Then determine the average speed from that set of data. Here is a link to my Stackoverflow post, and here is my typescript file:

    import { Component } from '@angular/core';

    import { Geolocation } from '@ionic-native/geolocation/ngx';

    u/Component({

    selector: 'app-home',

    templateUrl: 'home.page.html',

    styleUrls: ['home.page.scss'],

    })

    export class HomePage {

    framework = 'At exact boarding time';

    constructor(private geolocation: Geolocation) {}

    latitude: any = 0; //latitude

    longitude: any = 0; //longitude

    speed: any = 1; //speed

    choices = {

    timeout: 10000,

    enableHighAccuracy: true,

    maximumAge: 3600

    };

    average_walking_speed(){

    this.geolocation.getCurrentPosition(this.choices).then((resp) => {

    this.speed = resp.coords.speed;

    console.log(this.speed);

    }).catch((error) => {

    console.log('Error getting speed', error);

    });

    }

    // use geolocation to get user's device coordinates

    getCurrentCoordinates() {

    this.geolocation.getCurrentPosition().then((resp) => {

    this.latitude = resp.coords.latitude;

    this.longitude = resp.coords.longitude;

    this.speed = resp.coords.speed;

    }).catch((error) => {

    console.log('Error getting location', error);

    });

    document.getElementById("updater").innerHTML = ' ' + this.speed +" m/s"

    }

    }

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

    Really stupid question about Generics in C# .NET Core Web API

    Posted: 20 May 2020 11:50 AM PDT

    Suppose in a service class I had a Dictionary:

    Dictionary<string, T> Mappings {get;set;} 

    Where I would put random model classes for T.

    Now I need to declare T in my service. No Problem..

    public class MyService<T> 

    But my service is injected via DI so I have to add T to ConfigureServices method for my web api

    public class Startup<T> 

    Now I have to declare T in my startup file. My whole app knows about T more than I know about anything in my life.

    Anyway how I can I stop T from being needed to propogate so high up? Can I tell C# to use generic parameter T only in my service?

    I don't want to resort to using dynamic in place of T for my dictionary as I want to be able to use reflection.

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

    .StaleElementReferenceException even if try catch is added

    Posted: 20 May 2020 11:29 AM PDT

    So in my method first if check if rowList == 0, if not I check if my predicates is on the list, if not click on tab and refresh table (thre's no other way to do this, I have to click on that element).

    I have added exeption in my else if but every time I get error

    org.openqa.selenium.StaleElementReferenceException: stale element reference: element is not attached to the page document (Session info: chrome=81.0.4044.138) For documentation on this error, please visit: https://www.seleniumhq.org/exceptions/stale_element_reference.html Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'

    How to fix it?

     private SelectionResult Test(Map<String, String> predicates, By selector) throws InterruptedException { if (rowList.size() == 0) { for (int i = 0; i < 10; i++) { try { getDriver().findElement(selector).click(); } catch (StaleElementReferenceException e) { // HERE I DON'T HAVE ERROR } Thread.sleep(10000); if (rowList.size() != 0) { break; } System.out.println(i); } throw new RuntimeException("There's no case in this table!"); } else { SelectionResult selectionResult = new SelectionResult(); Actions action = new Actions(getDriver()); for (int i = 0; i < rowList.size(); i++) { if (verifyRow(predicates, i)) { List<WebElement> row = rowList.get(i); WebElement cell = row.get(1); action.doubleClick(cell).perform(); selectionResult.addMatchedRow(i); break; }else if (!verifyRow(predicates, i)){ for (int j = 0; j < 10; j++) { try { getDriver().findElement(selector).click(); } catch (StaleElementReferenceException e) { // HERE I HAVE ERROR } Thread.sleep(10000); if (verifyRow(predicates, i)){ break; } System.out.println(j); } } } return selectionResult; } } 
    submitted by /u/baetky
    [link] [comments]

    Sending Signature/Bullet points with SmtpClient in VS C#/.net

    Posted: 20 May 2020 09:57 AM PDT

    I'm using SmtpClient.Send() to send automated emails from my app to my personal email. Everything is working as it should, but I want to add a "response format" at the end of every email for us to easily copy/paste directly to our reply (unfortunately we still have to do some stuff by hand, so we cant yet automate the response).

    There 2 questions I have:

    1) Is there a way to add my gmail account's signature in the message being sent through the app?

    2) What is the 'bullet point' character for gmail formatted mail? Unfortunately people are picky about this and I can't just use a tab/hyphen. And I've had trouble actually figuring out how to add whatever character(s) gmail uses for bullet points. If I could figure out the bullet point character, I could just hard-code the signature in the app's code.

    An answer to either of the 2 questions should solve my issue.

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

    No comments:

    Post a Comment