• Breaking News

    Saturday, November 2, 2019

    How do you stay interested in projects that you work on? Ask Programming

    How do you stay interested in projects that you work on? Ask Programming


    How do you stay interested in projects that you work on?

    Posted: 02 Nov 2019 03:30 PM PDT

    I'm a student and aspiring software engineer, and I find trouble staying interested in little projects that I work on and am concerned about the future and what that could mean for a career in programming.

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

    Do my JRE and JDK versions need to be the same?

    Posted: 02 Nov 2019 03:36 PM PDT

    I am trying to run a simple Hello World program that was compiled using JDK 13 but my JRE is an older version (there is no JRE 13?)

    I have clipped the terminal window with the error as well as my current JDK/JRE versions. https://i.imgur.com/15rV1dp.png

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

    Dealing with burn out and inability to focus on my code? Haven’t programmed in a week

    Posted: 02 Nov 2019 06:28 PM PDT

    For the past week I've been avoiding programming altogether and I simply can't get my mind focusing on it.

    I tried to sit down and program a few times but after a few minutes my mind just shuts down from absolute boredom and the feeling of not wanting to do it.

    I've taken a 'break' by not doing much the past week but even then, I don't want to do it.

    Switching career is not a choice. I'm already on anti depression meds and all. And time is not on my side as I'm already late.

    I appreciate any suggestions to help me get out of this slump.

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

    “Actor model” in a game engine for ML

    Posted: 02 Nov 2019 09:15 PM PDT

    Looked around but couldn't find anything. Is there any precedent for using the actor model in game engines for supervised machine learning? I'd like to use unreal for visualization of these npcs and the nature of the problem leads me towards implementing the actor model.

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

    Duplicate Lines in a Text File (Help)

    Posted: 02 Nov 2019 09:34 AM PDT

    Hi all, I've been trying to program a code which will read records from a text file and subtract the last column of data by '1', and lastly update the text file. The code runs without any issue, however, I'm getting duplicate lines at the end of the text file. Will great appreciate if anyone can help amend my code!

    Program code:

    #include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; int main() { ifstream inFile; ofstream temp; string name, prio, plantrt, datein; int qty, daysdue, partnum, jobnum; inFile.open("database.txt"); temp.open("temp1.txt"); if (!inFile) cout << "Unable to open file" << endl; else { cout << left << fixed; while (!inFile.eof()) { inFile >> name >> partnum >> jobnum >> qty >> prio >> plantrt >> datein >> daysdue; daysdue--; temp << setw(20) << name << setw(20) << partnum << setw(20) << jobnum << setw(20) << qty << setw(20) << prio << setw(20) << plantrt << setw(20) << datein << setw(20) << daysdue << endl; } } inFile.close(); temp.close(); remove("database.txt"); rename("temp1.txt", "database.txt"); } 

    Original text file:

     MANIFOLD 879056 887156 5 LOW 19/11/19 10/11/19 9 MANIFOLD 170832 88145 4 HIGH 5/11/19 2/11/19 3 

    Text file after the code is ran:

     MANIFOLD 879056 887156 5 LOW 19/11/19 10/11/19 8 MANIFOLD 170832 88145 4 HIGH 5/11/19 2/11/19 2 MANIFOLD 170832 88145 4 HIGH 5/11/19 2/11/19 1 
    submitted by /u/Potatofist3r
    [link] [comments]

    Can Somebody Explain this Webhook vs Polling Scenario?

    Posted: 02 Nov 2019 07:25 PM PDT

    Hi Everyone

    I've been programmer for a while now, but most of my experience is with desktop dev. I'm trying to grasp the concept of webhooks and I'm kind of stuck.

    I already understand their purpose and how they work to an extent. They allow you to avoid constant polling of a server via an API, and instead notify you when something changes. That sounds great for server to server applications (like a github service that fires on pull requests), but here is where I get lost though.

    Let's say I'm developing a desktop or phone chat application that takes advantage of an existing messaging service like Twilio of MessageMedia. I have found that these services often recommend using webhooks over polling to check for received messages. How can a device receive a webhook though? It seems to me like you would have to set up your own server to receive the webhook, and then have your application poll your server still to check for the webhook saying "Hey, you have a new message"? How do you get around polling in this instance? Or do you still have to poll, but you're taking load off the services server?

    Any info on standard practices here is greatly appreciated!

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

    How should a digital humanist integrate XML texts with a database nowadays?

    Posted: 02 Nov 2019 06:47 PM PDT

    So, I'm a humanist, but I've used Linux as a daily drive since high school, know how to code, use plenty of TUI apps, etc -- I'm not clueless when it comes to tech. I have some ideas for digital humanities side projects I'd like to try, and I'd like to start by assembling my own collection of texts. But I'm already stumped trying to figure out where to put them. Most text is still available in some type of XML markup. This is understandable, because instead of using XML to serialize structured data, which was once a major use case of XML but is now better accommodated by JSON or TOML, digital humanities texts really need the markup nature of XML, where there can be metadata and references in tags and attributes, but more fundamentally there is one long, continuously running flow of text, which is not structured data. So XML isn't really going anywhere for this, but on the other hand, industry has largely left XML-based technologies behind. That leaves digital humanists off in their own bubble, largely working with tools that haven't gotten major updates since the mid 00's.

    I want to approach digital humanities with more awareness of what's going on in the rest of the software world. So I'm interested in hearing how others would approach trying to build a database of people, places, names, artifacts, etc. which could then be referenced in the markup to the text. Do I upload the text into the database? Do I leave the text in the filesystem and connect it via some type of reference? And what type of database do I use? Postgres has an XML datatype, is this the type of project where one wants to use solid, mature technologies? Or is this something that one of the new No/NewSQL databases is better suited for?

    I know there's no one answer here, but I'd really value others' suggestions on how to approach this.

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

    How to make file that runs Terminal script on TAILS?

    Posted: 02 Nov 2019 05:58 PM PDT

    How to add Adaptive Track Selection in Exoplayer?

    Posted: 02 Nov 2019 10:22 AM PDT

    Hey guys, I want to change my video quality of video in exo-player android, I am using kotlin to create the app,

    can anyone please guide me?

    Stackoverflow

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

    Giving Credit to a Tutorial

    Posted: 02 Nov 2019 01:45 PM PDT

    I am developing an Android app that is based off of a tutorial I found online. Any tips for giving proper credit to the author of the app I am basing mine off of? I have zero experience in app development besides this project and this guy really deserves credit for his code.

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

    Full Stack to start a career :React JS, Flutter , Laravel , Django , Hibernate , Angular Js or Pentest?

    Posted: 02 Nov 2019 10:48 AM PDT

    (Not as a Beginner)

    For a Dev to start a career , which one will has most scope and preferred by all.

    To choose a domain

    and also DevSecOps?

    any developers ,pentesters or anybody could suggestion the domain.

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

    how to add scrollIntoView to this?

    Posted: 02 Nov 2019 09:54 AM PDT

    Modifying a Column in a Text File

    Posted: 02 Nov 2019 06:53 AM PDT

    Hi all, I've been trying to program a code which will read records from a text file and subtract the last column of data by '1', and lastly update the text file. The code runs without any issue, however, I'm getting duplicate lines at the end of the text file. Will great appreciate if anyone can help amend my code!

    Program code:

    #include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; int main() { ifstream inFile; ofstream temp; string name, prio, plantrt, datein; int qty, daysdue, partnum, jobnum; inFile.open("database.txt"); temp.open("temp1.txt"); if (!inFile) cout << "Unable to open file" << endl; else { cout << left << fixed; while (!inFile.eof()) { inFile >> name >> partnum >> jobnum >> qty >> prio >> plantrt >> datein >> daysdue; daysdue--; temp << setw(20) << name << setw(20) << partnum << setw(20) << jobnum << setw(20) << qty << setw(20) << prio << setw(20) << plantrt << setw(20) << datein << setw(20) << daysdue << endl; } } inFile.close(); temp.close(); remove("database.txt"); rename("temp1.txt", "database.txt"); } 

    Original text file:

     MANIFOLD 879056 887156 5 LOW 19/11/19 10/11/19 9 MANIFOLD 170832 88145 4 HIGH 5/11/19 2/11/19 3 

    Text file after the code is ran:

     MANIFOLD 879056 887156 5 LOW 19/11/19 10/11/19 8 MANIFOLD 170832 88145 4 HIGH 5/11/19 2/11/19 2 MANIFOLD 170832 88145 4 HIGH 5/11/19 2/11/19 1 
    submitted by /u/Potatofist3r
    [link] [comments]

    Identity, Authorization & Authentication: Ory, Gluu, Vault?

    Posted: 02 Nov 2019 06:06 AM PDT

    Hello /r/AskProgramming!

    I'm researching about the three topics in the title in order to come up with a self-hosted solution for my situation. I'm creating a service that's going to be used by multiples users within a hiring party, and multiple services used by that same party.

    The main idea and necessity is to have a Single-Sign-On system. That itself isn't something concrete, because you can do it in different ways, so I'm still reading about everything that I can.

    I came across multiples options, but I'm considering Gluu, Ory & Keycloak.

    Ory doesn't come with an identity management server but it appears to function without it? What am I missing? What can I use it in the void?

    Gluu looks very complete but I don't see many people talking about it? What's the deal?

    Vault is something that looks very powerful, they appear to have identity but I don't think they do what I need from them?

    Keycloak looks hard to setup and customize, but might do the job?

    Have you ever gone through something similar? I appreciate any bit of knowledge that I can get!

    sorry if that's the wrong sub!

    edit: Just to make it clearer, I need to have a central identity server for all future services and I will need to have "scopes" inside those, that's the authorization part, right?

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

    Python - Changing an instance object's attributes without changing all class instances

    Posted: 01 Nov 2019 11:46 PM PDT

    How do I change an object's attribute values without changing the values for every instance of the class?

    If I adjust the second dog object's value, the function also affects the first dog even though the first dog is just a parameter.

    Is there a way to prevent that, without directly assigning the specific instance's value?

    Here is the code:

    class dog:
    weight = 10
    def makeHeavyClone(x):
    newDog = x
    newDog.weight = 50
    return newDog

    first_dog = dog()
    first_dog.weight = 15
    second_dog = makeHeavyClone(first_dog) #why is this line changing the attribute value of the first dog as well?
    # Is it possible to prevent this?
    print(first_dog.weight)

    #==================================================================================== output for first dog weight is 50

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

    When you're stuck on a bug in your logic, what's a good tactic to detect it and understand it efficiently?

    Posted: 01 Nov 2019 11:17 PM PDT

    No comments:

    Post a Comment