• Breaking News

    Tuesday, July 16, 2019

    What was that article where the author complains that his machine overheats and takes tens of milliseconds just to render one keystroke in the browser? Ask Programming

    What was that article where the author complains that his machine overheats and takes tens of milliseconds just to render one keystroke in the browser? Ask Programming


    What was that article where the author complains that his machine overheats and takes tens of milliseconds just to render one keystroke in the browser?

    Posted: 16 Jul 2019 01:31 PM PDT

    I think he was complaining about a Chromium app, but the more general point was that software nowadays is way too wasteful.

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

    Assistance with some code debugging

    Posted: 16 Jul 2019 05:50 PM PDT

    CODE 1

    package assignments;

    import modifiable.PlainOldJavaObject;

    public class Assignment1 {

    public static void main(String\[\] args) { // All of the lines of code below \*should\* work. However, there are several // issues with the PlainOldJavaObject class, which are preventing them from // working properly. Make any required changes to the PlainOldJavaObject class // required to run the below code successfully without changing it. // Hint: Remember what a getter and setter are supposed to do. // Hint 2: Remember what the parameter list of a method actually does... PlainOldJavaObject pojo = new PlainOldJavaObject(); System.out.println("Setting var1..."); pojo.setVar1(10); System.out.println("Value of var1 is: " + pojo.getVar1()); System.out.println("Setting var2..."); pojo.setVar2(5); System.out.println("Value of var1 is: " + pojo.getVar2()); } 

    }

    CODE 2

    package assignments;

    public class Assignment2 {

    private int numInstances = 0; private Assignment2() { numInstances++; } public static void main(String\[\] args) { // This assignment is making use of methods and variables that should be // global, or belong to the class rather than an instance. doSomething(); Assignment2 obj1 = new Assignment2(); Assignment2 obj2 = new Assignment2(); System.out.println(Assignment2.numInstances); } public void doSomething() { System.out.println("doSomething() invoked!"); } 

    }

    CODE 3

    package assignments;

    public class Assignment3 {

    public static void main(String\[\] args) { // This class is attempting to use the properties of Strings in various // capacities. Make the required corrections so they work. String str1 = "Hello"; String str2 = new String("Hello"); String str3 = "World"; String str4 = new String("world"); System.out.println("The 4th letter of \\"" + str1 + "\\" is: " + str1.letterAt(4)); System.out.println("Do \\"" + str1 + "\\" and \\"" + str2 + "\\" have the same sequence of characters? " + (str1 = str2)); System.out.println(str4 + " is " + str4.length + " characters long"); } 

    }

    I know these are super simple but I have a lot of trouble figuring out where to even start... some guidance would be greatly appreciated instead of just a straight up answer. I feel like I understand the concepts so well when they are being taught but then I have to debug and its difficult to apply them.

    Appreciate any assistance provided in advance.

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

    Getting Started in Game Dev

    Posted: 16 Jul 2019 01:31 PM PDT

    I want to gain some knowledge on game development and design. Where can I begin? I'm extremely proficient in C, C++, C#, JavaScript, HTML, and CSS development and intermediate in Python, so if any frameworks exist for game development centered around these tools, that would be preferred!

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

    HackerRank won't recognize my solution for hourglass array

    Posted: 16 Jul 2019 11:13 PM PDT

    The challenge is to find a subsection of an array with the highest sum. When I try to return the highestSum (which works in my IDE and terminal just fine...) on hackerRank, it returns 0 and says I failed all the test cases, as if it isn't even reading or recognizing my return statement. This is weird because when I simply return the input array, it prints to their output and is recognized no problem.

    Any ideas?

    Thanks!

    My solution is

     function hourglassSum(arr) { // input example: // arr = [1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,0,2,4,4,0,0,0,0,2,0,0,0,0,1,2,4,0] // arranged by rows // array values index // 1,1,1,0,0,0, 0-5 // 0,1,0,0,0,0, 6-11 // 1,1,1,0,0,0, 12-17 // 0,0,2,4,4,0, 18-23 // 0,0,0,2,0,0, 24-29 // 0,0,1,2,4,0 30-35 let currentSum , highestSum , arrayToBeReduced , hourglassMatchSequence , startingIndex ; // while n <= 21 the last possible hourglass in a 6x6 array // pattern = n, n +1, n+2, // n +7 // n+12,n+13,n+14 hourglassMatchSequence = [0, 1, 2, 7, 12, 13, 14] startingIndex = 0 currentSum = 0 highestSum = 0 arrayToBeReduced = [] while (startingIndex < 22) { arrayToBeReduced.push(arr[startingIndex], arr[startingIndex + 1], arr[startingIndex + 2], arr[startingIndex + 7], arr[startingIndex + 12], arr[startingIndex + 13], arr[startingIndex+14]) // use match sequence here for breveity? // console.log('arrayToBeReduced:', arrayToBeReduced) currentSum = arrayToBeReduced.reduce((a, b) => a + b) console.log('currentSum,', currentSum) if (currentSum > highestSum) { highestSum = currentSum currentSum = 0 console.log('highestSum:', highestSum) } startingIndex++ arrayToBeReduced = [] console.log(startingIndex) } console.log( 'highestSum:', highestSum ) return highestSum // return arr // this is just to prove that returning anything from this function prints to stdout // the above line simply returns the input array, and this is given as the stdout on hackerrank, so I thought that // returning 'highestSum' above would print to their output in the same way } hourglassSum([1,1,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,0,2,4,4,0,0,0,0,2,0,0,0,0,1,2,4,0]) 

    The code on hackerRank's site for this challenge is as follows:

     'use strict'; const fs = require('fs'); process.stdin.resume(); process.stdin.setEncoding('utf-8'); let inputString = ''; let currentLine = 0; process.stdin.on('data', inputStdin => { inputString += inputStdin; }); process.stdin.on('end', _ => { inputString = inputString.replace(/\s*$/, '') .split('\n') .map(str => str.replace(/\s*$/, '')); main(); }); function readLine() { return inputString[currentLine++]; } // Complete the hourglassSum function below function hourglassSum(arr) { let currentSum , highestSum , arrayToBeReduced , hourglassMatchSequence , startingIndex ; // while n <= 21 the last possible hourglass in a 6x6 array // pattern = n, n +1, n+2, // n +7 // n+12,n+13,n+14 hourglassMatchSequence = [0, 1, 2, 7, 12, 13, 14] startingIndex = 0 currentSum = 0 highestSum = 0 arrayToBeReduced = [] while (startingIndex < 22) { arrayToBeReduced.push(arr[startingIndex], arr[startingIndex + 1], arr[startingIndex + 2], arr[startingIndex + 7], arr[startingIndex + 12], arr[startingIndex + 13], arr[startingIndex + 14]) // use match sequence here for breveity? // console.log('arrayToBeReduced:', arrayToBeReduced) currentSum = arrayToBeReduced.reduce((a, b) => a + b) console.log('currentSum,', currentSum) if (currentSum > highestSum) { highestSum = currentSum currentSum = 0 console.log('highestSum:', highestSum) } startingIndex++ arrayToBeReduced = [] console.log(startingIndex) } console.log(highestSum) return highestSum } function main() { const ws = fs.createWriteStream(process.env.OUTPUT_PATH); let arr = Array(6); for (let i = 0; i < 6; i++) { arr[i] = readLine().split(' ').map(arrTemp => parseInt(arrTemp, 10)); } let result = hourglassSum(arr); ws.write(result + "\n"); ws.end(); } 

    should I be doing something like

    process.stdout.write(myAnswerHere) 
    submitted by /u/paramourn
    [link] [comments]

    Building own website as a beginner without own server

    Posted: 16 Jul 2019 11:12 PM PDT

    Hi. I want to start a small web application for a small business. I have a little bit of experience with golang. What's my pathway to build a serverless Web application with go and necessary frontend framework?

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

    Why do large C++ projects seem to be comprised of only header files?

    Posted: 16 Jul 2019 06:28 AM PDT

    I'm mainly talking about open source projects such as Proton. Coming from a web dev background I'm used to Ruby code being in Ruby files and C# code being in .cs files. Why does it seem like larger C++ projects don't keep their C++ code in .cpp or .cc files?

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

    What's the best developer documentation site you know?

    Posted: 16 Jul 2019 06:39 AM PDT

    Hi there, I'm Stephanie, working as a UX'er on a project where I'm creating a developer documentation website for an online product. Since I'm creating it for developers, I would love to hear your experiences with good (and bad) developer websites so that I can make it as useful as I can for you developers ;) It will be a website where developers can find information on what the provided API does and how to use/implement it.

    So,what's the best developer documentation site you know?

    What is so good/bad about it? What is important for you as a developer?

    To clarify, here an example of the developer website from sketch

    Thanks :D

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

    How impressive is moderator status on Stack Overflow?

    Posted: 16 Jul 2019 05:31 PM PDT

    I'm sure it's impressive, I'm just not sure how impressed I should be.

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

    Best entry-level Data Science textbooks.

    Posted: 16 Jul 2019 04:27 PM PDT

    Hey AskProgramming,

    I'm a software engineer who recently graduated with a bachelor's in computer science, software engineering concentration. I've started my first job in the field and can't stop thinking about going back to school.

    I keep having the idea of getting a master's in Data Science, but I'm not super familiar with the field. Before I apply to programs I'd like to read a textbook or two on the subject and see if it's something I'd enjoy.

    What are the best primers for someone who is technical but who hasn't studied machine learning or data warehousing/mining etc?

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

    ELI5: How does one decompile .LUAC files?

    Posted: 16 Jul 2019 06:44 PM PDT

    I'm trying to decompile .LUAC files for a Empire: Total War mod, these .LUACs bare most of the scripts and triggers of in-game events. There isn't a single comprehensive tutorial in the forums, could anyone explain like I'm five?

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

    Project and SDLC Management Tools

    Posted: 16 Jul 2019 06:23 PM PDT

    I need advice and would like people's experience on a tool or set of tools for the following:

    • Project management for larger projects or new when developing new software that spans months or years with multiple developers and stake holders. Would have ideally have time entry for items in a project.

    • Bug reporting and feature requests. Ideally allowing users to submit and search existing themselves.

    • Change management to schedule planed changes and review changes that happened. An approval system would be optional. Allowing templates or form entries for common changes would be nice to have.

    We are looking to move to Git/GitLab in the near future so if there are any integrations into a tool(s) that would be nice to know about.

    Some context:

    Joined a team about 6 months ago. Our team handles the company's custom ERP solution and any integrations of 3rd party applications. We often are fixing, expanding or creating software solutions for internal users.

    From my perspective our team doesn't have a good tool for managing our on going development. We have a home grown tool that is good for project management but that is about it. You can assign people to be a lead or be point on a task under a project. You record your time spent on a task or a set of default day-to-day tasks that isn't project work. Small feature requests do come through here.

    We have a kind of change management but it is just a scrolling wall of text where you can post what you changed. You can't schedule a date and there is no calendar to see what has changed when or to quickly see if there was an issue on a day that may have been the cause of something.

    Finally we don't have any tool to manage or catalog bugs. And I don't think our project management tool is great for feature requests either. Bug management I think is probably the worst due to how they are handled. Either a bug is critical enough that it becomes too priority right then and there for a developer to work on and it gets fixed before anything else. Or ... It isn't critical enough and gets put on the "Todo" list of a developer's memory, probably forgotten. I think it is a bit telling that I hear things like 'this has been broken for a while', and 'oh while you are doing that this isn't working can it get fixed'. I think this is probably a blind spot for our team/company not knowing the full extent of broken things for our applications.

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

    Does Google's Cloud Firestore Make Sense Or Am I Looking At It Wrong?

    Posted: 16 Jul 2019 03:30 AM PDT

    Am a first time user of Cloud Firestore, so please let me know if anything I say sounds ridiculous and/or not true.

    For a project I have, I picked Flutter as the dev environment for mobile and after watching a couple of YouTube videos on how to use Flutter with Cloud Firestore, and determining there was a dotnet core SDK for Cloud Firestore (will be important later), I decided to jump in. And I have to say that I was super impressed at first, how easy it was to push/pull data. And I built out a fairly large amount of functionality in what I can only call record time.

    The project also has a web app (ReactJS) not being a huge fan of JS, most of the business logic is to be handled on the back-end by a dotnet core REST API.

    I should have probably seen it coming, but having multiple apps use the same Firestore DB, but written in different languages, means that the developer has to implement CRUD multiple times; once for each language.

    Anyhow, in my case, I've decided to move all the DB access code to the dotnet core back-end and have both the mobile and web app talk to the REST service.

    But if I'll be switching all DB access to the back-end service, why give up all the advantages or an RDBMS without gaining any of Firestore's advertised advantages?

    Wouldn't I be better off firing up a MariaDB server and use that in this scenario?

    Edit: Also for the life of me, I couldn't figure out if there are tools out there to play around with the data or the console was it.

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

    Questions about mind map software’s, develop my own software.

    Posted: 16 Jul 2019 09:25 AM PDT

    I cannot find answers anywhere, so here I am and hopefully this is the right place. I think mind maps are programming that is why I am putting this question here.

    I know what a mind map is and I have used them in the past however I am looking for a unique kind of mind map I cannot find. So most of the sites I go to charge a monthly price per user and I am trying to find out if my idea is even feasible being able to hire someone to create my own.

    My thinking is hiring someone that can create a mind map or the software for me that I can use and be able to customize it the way I want and to be able use it internally in my small company. As well add it to my website is that possible? So it would be an interactive mind map.

    I don't know what something like this would cost so that is why I am here. Is this idea I have feasible to create at low cost or no? I am thinking like 1,500 to 2,000.00 usd. If I cannot get it made for this price what variable/ ballpark price 2 to 4k? I don't know.

    I have tried doing some research and it seems unless I am wrong mind maps can be created in java and c plus so that is similar to creating a website, I think if I am wrong sorry however that is why I am here.

    Last question if this is feasible who do I look for a programmer only or do I need more a software engineer? I don't want to contact the wrong people. Thanks in advance if you can help.

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

    To which objects are time-related repeating events, for example saving automaticaly, attached in game developement (unity)?

    Posted: 16 Jul 2019 09:02 AM PDT

    I thought about the camera itself, but Im not sure.

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

    Jumblr client for Java

    Posted: 16 Jul 2019 11:39 AM PDT

    I have to do some work on jumblr (tumblr api) and I am struggling with some work, so if anyone over here has some experience working with jumblr do reply or message me.

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

    Is there something wrong with bluetooth that motivates wireless keyboard mouse and game controllers to come with a usb dongle instead?

    Posted: 16 Jul 2019 11:14 AM PDT

    Tutorial needed

    Posted: 16 Jul 2019 07:05 AM PDT

    Can anyone link me a tutorial for making a login and registration page on NetBeans with SQlite3? I'm not sure which one to use, this is for a school assignment. Any help will be great.

    Cheers,

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

    How to reenable wifi via bluetooth on GoPro 7

    Posted: 16 Jul 2019 05:51 AM PDT

    Hi everyone!

    I've already asked about the topic here https://www.reddit.com/r/gopro/comments/cdw8kw/reenable_wifi_via_bluetooth_python/

    So the question remains the same, if you have anything releated to connecting and controlling GoPro with bluetooth, please share it

    Thank you

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

    C# update async till key pressed

    Posted: 16 Jul 2019 04:52 AM PDT

    //Pseudocode While loop{

    UpdateData() ; PrintData() ;

    Wait(update Interval) ;

    }

    I need the loop and the Wait() to break/return when a button is pressed. But the wait can't block listening for keypress.

    I assume async await could solve this but maybe its better with Timer class?

    I'm looking for a current best practice for handling this situation.

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

    Those who work in software development careers, what are the ups and downs of being a software developer?

    Posted: 16 Jul 2019 12:56 AM PDT

    Also, what should I expect when entering the field. I'm going to school for computer science. If it sucks, please explain why.

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

    [Python 3] Filtering text after webscraping

    Posted: 16 Jul 2019 02:46 AM PDT

    So I'm trying to webscrape this website that provides novels for free, for example this page: https://www.wuxiaworld.com/novel/martial-world/mw-chapter-1

    I'm trying to only extract the title and the body of the chapter. Finding the title is easy enough since its in h4, however the body of the chapter is not separated by any specific div tags so I cannot just isolate it. I was wondering how I'd do this. The closest Ive gotten to just having the text is this.

    I tried to identify if the body of text was under any exclusive div tag but it wasn't, so i tried to call it under whatever the closest div tag was, this still returned a lot of useless and unwanted text.

    The closest I got to isolating the text I wanted was searching using the "fr-view" class, however there was more than one instance of this class being used, giving me a lot of unwanted text.

    Ps. Im new to webscraping, sorry if my question is unclear or stupid.

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

    No comments:

    Post a Comment