• Breaking News

    Friday, August 24, 2018

    How do image processing suites like Photoshop or GIMP keep a history of an image? Ask Programming

    How do image processing suites like Photoshop or GIMP keep a history of an image? Ask Programming


    How do image processing suites like Photoshop or GIMP keep a history of an image?

    Posted: 24 Aug 2018 03:06 PM PDT

    The dumb way would be to literally store every version of the image in a linked list style structure and append on to it with each change but this seems massively wasteful. A smarter way might be to store the history on a per pixel basis as not all pixels change with each operation but this still seems like it would have a large memory overhead. Does anyone know how it's done in professional grade software like Photoshop or GIMP?

    I feel like the most efficient way would be to make an "inverse" function for every tool so that you could just save the arguments to a function and run the inverse function whenever you undo something but I feel like there are plenty of tools, like the paint bucket, where the "inverse" function isn't really well defined (at least to me).

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

    Can I have my users run a websocket server?

    Posted: 24 Aug 2018 05:48 PM PDT

    Hello, I am doing some research for my project and cannot get a clear awnser.

    I am thinking about creating a fun party game.I was planning to use Websockets for universal communication since I can use it in Browser, Apps and more :).

    But, I want my users to host the websocket server themselves. I was thinking about first just packaging a node js server but thats supposedly impossible. Then I wanted to try and just create a app to deploy and inside the app a user can choose to host or join and the app will host a websocket server. Now I can't get a clear awnser, but, would this be possible? Could I write a app in Android studio, Swift or Xamarin wich would include the ability to host a websocket server my users can connect to.

    Still noting it is all LAN and wont need crazy port forwarding. Or would all this just be possible by hosting a websocket server in browser?

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

    [Embedded] What does it mean to work with a processor architecture on microcontrollers?

    Posted: 24 Aug 2018 09:28 PM PDT

    With a background in cpu architecture, and OS from college courses, I'm trying to get into embedded systems. So far, I've written small C programs to make my CC3200 MCU send files to a TCP server over wifi. But then I keep hearing people talk about working "with" an ARM Cortex processor or some other architecture, and they never say what that exactly means. I write and flash my C program, debug, repeat. I'd probably be doing the exact same thing if I was using some other MCU/processor. There's no meddling with the processor anywhere. So what do they actually mean by that?

    And am I following the right path if I want to make myself marketable for Embedded Systems jobs? (I'm a new grad by the way)

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

    C# loaded a WPF before doing any work

    Posted: 24 Aug 2018 12:35 PM PDT

    I have a wpf that I would like to load and display before doing any work, but I can't figure out how to do it.

     public MainWindow() { InitializeComponent(); // Check to see if there is a new pre launcher CheckPreLauncher(); // Check to see if the newest crystal is installed CheckCrystal(); 

    I want to load the entire form, and then go into the functions like CheckPreLauncher(); and tie that to a progress bar later on.
    Any help is greatly appreciated, I feel like I have to be missing something extremely basic.

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

    How different are the skillsets for artificial intelligence, machine learning and deep learning?

    Posted: 24 Aug 2018 07:02 AM PDT

    I'm aware that those three things are subtly different, but in terms of the actual skills you need to learn, how different are they? For example, if I decided to specialize in machine learning, and I got a degree in it, would I still be eligible for jobs in artificial intelligence/deep learning? Or are there too many differences? If it's the latter, then please list down the differences (if the differences are too numerous, then feel free to only list the major differences).

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

    Starting out with Cross Platform Development

    Posted: 24 Aug 2018 03:50 PM PDT

    Hey all. Wanted to ask some advice on cross platform development. I'm fairly new to Software Development, but am proficient in C# and Java. Can anyone recommend what languages/ frameworks would be best for creating an application that can be run on desktop (Windows) and then easily be ported to mobile operating systems like Android/ iOS?

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

    sublime-text-eslint not working

    Posted: 24 Aug 2018 03:31 PM PDT

    I was using SublimeLinter-jshint before but i disabled it because it doesn't support async functions. So now i installed SublimeLinter-eslint (also installed eslint globally via npm first), then i reopened sublime . Its not linting, i tryed to do some errors but does nothing. Also tried to lint the .js file manually but nothing...

    With jshint and other linters it works automatically after installation

    submitted by /u/Don-g9
    [link] [comments]

    Is Empty String i.e “” is a valid node if tree nodes are only String type?

    Posted: 24 Aug 2018 06:37 PM PDT

    Also, can same tree have NULL node or node with no value at all? Will that still be valid?

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

    Learning Resources for Audio Software Programming that interacts with electronics (console programming)?

    Posted: 24 Aug 2018 06:11 PM PDT

    My question is, where is a good place to learn how to . . . . . .

    1. Program software in terms of displaying audio information on a screen (Levels, Sends, EQ, etc....)
    2. Learn how electronics and computer software interact with one another.
    3. Online classes, certifications or DIY projects that are specifically related to audio and software programming that will give me a better grasp on how the hardware of a audio console interacts with the software.

    I've been trying to google literature based on electronics and software programming in the audio world, but i'm not seeing anything super related to the topic.

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

    Calculator help

    Posted: 24 Aug 2018 06:10 PM PDT

    how could i program a calculator to do algebra?

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

    Hello \rAskProgramming I have a hopefully quick question regarding the cNOT Gate for entangled states

    Posted: 24 Aug 2018 09:19 AM PDT

    I hope this is the right place...
    Currently I am trying to program a simulation of quantum teleportation for 2-qubits.
    Meaning I have a four qubit quantum channel. In entanglement with the 2-qubits I have 6qubit entangled states.
    The cNOT gate normally acts on 2 qubits.
    eg: |10> -> |11> where the first bit is the controling one and the second one is the target

    I also now how I would apply the cNot gate on any consecutive qubits for larger states.
    The answer is a simple tensor product between cNOT and the Identity
    eg: |000> I now how to implement (cNOTxI)|000>= |0c0t0> and (IxcNOT)|000>|00c0t>
    but not how to implement|0c00t>
    (c, and t marking control and target qubit)
    How do I do that? Is there a general cNOT_ik formulation?

    In my program I would need |0c00t000> and |00c00t00>

    Any Help is appreciated!

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

    [C++11] What is the best way to get type safety and overloading for scalar variables with physical units?

    Posted: 24 Aug 2018 11:04 AM PDT

    As a physics student, a lot of my function parameters were unitful scalars. Passing these into functions had none of the type safety of named objects since every function parameter was a floating point value or an integer. Sometimes I had projects with both micrometres and parsecs, both length units that could be passed as long doubles into functions and so I couldn't get the compiler to help much. I guess I could have made a handful of structs, each with only one parameter but there has to be a better way.

    C++11 has custom literals so I can use operator "" _Pa(long double); to generate a floating point number that represents a pressure in pascals. However this isn't going to stop me from passing a mass into a function that takes a pressure as a long double. Using using I seem to be able to specify that a function takes a pressure not a raw long double, but I can't overload this function to take a density literal instead. Creating lots of single variable structs, seems a bit verbose but does the job.

    What is the best way to get type safety or overloading for a function that takes a primitive variable that can mean different things or be in different units?

    I fear my question has crossed the line between general and vague, but does anyone have any suggestions?

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

    How do you all diagram your business logic?

    Posted: 24 Aug 2018 02:09 PM PDT

    I'm trying to make a diagram that essentially outlines business logic and the flow of a user on my website while clicking different buttons and such.

    The diagram is actually pretty bad because I suck at making diagrams. I think my biggest issue is the fact that I don't have a good way of representing state. For example, the user lands on the landing page with only one button available. Clicking that button makes a dialog show up with a few fields, then after saving, They have a note on the screen. But now the note has a 2 options on it. There can be multiple notes on the screen after this. Etc.

    Here is my attempt at explaining my custom note taking web app. Ive simplified it. but you can see its getting out of hand quickly.

    https://imgur.com/a/Y34EYOC

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

    Looping requests in NodeJS

    Posted: 24 Aug 2018 01:08 PM PDT

    I'm having a tough time making my code work correctly when looping through. I'm building a small web scraping script that works when you do one run through but gives unexpected results when you loop. See below for the code. The issue is clearly the control flow, but I'm not sure how to remedy it. Additionally, I need to make sure that it goes in a series rather than parallel, as there will be a lot of urls in the loop.

    const Xray = require('x-ray');

    const x = Xray();

    const urls = ['url1.com', 'url2.com']

    x(urls[0], '.title').then(function(scrape) {

    console.log(scrape);

    });

    // This works.

    for(i = 0; i < urls.length; i++) { x(urls[i], '.title').then(function(scrape) { console.log(scrape); });

    // That doesn't work

    }

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

    What's an alternative to commenting out code for a future feature.

    Posted: 24 Aug 2018 12:05 PM PDT

    In several code reviews, I've pushed back on commented out lines.

    Often this is code or configuration that is causing an unresolved issue or was prematurely implemented. We want to remove the functionality, but keep the source for future reference.

    I believe it best practice to always remove unused code or configuration. The push-back I get is that it is difficult to find and/or remember what was removed, and that it will be re-implemented soon enough.

    My own practice is to:

    • Comment the lines out
    • git commit
    • Remove the lines
    • git commit again. Record the commit id, perhaps in the work ticket.
    • When time to re-implement, run git revert with the commit id to restore it

    But, not everybody likes my method.

    Should I allow commented out code? Should I push my method? What do you do?

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

    Go Decoding

    Posted: 24 Aug 2018 11:44 AM PDT

    I want to decode the serialized string received on using the GET command on a bitmap or a hyperloglog. For example if a bitmap returns x80\x04 on using GET how do I change it to a representation of the offset-bit pairs in Go.

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

    How to deal with critique as a relatively inexperienced developer

    Posted: 24 Aug 2018 12:16 AM PDT

    Hi everyone, I've been working as a software developer for a company for around three years now. I got the job right after graduating and I really like the work I do. My skills as a developer have increased massively during this time and I am pretty confident in my skills nowadays.

    The thing is, that when I started my work at the company I was given a relatively small customer project to do on my own. Now in hindsight that seemed to be a bad decision because I had no prior real world experience in working for a customer and my skills in designing software, managing a project and my coding skills were not that great back then. Looking back I made some horrible design choices and the code is not easy to manage.

    Now three years later, I have a senior co-worker who is continuing to develop that customer project with new features and he has given me a lot of flack for the bad choices I made. He continuously talks about how horrible the code is to manage and many times has asked me "what was I thinking". And it's not that I don't appreciate his feedback and I would do a lot of things differently now but how am I supposed to handle his constant critique? I now the code is shit, but I can't really do anything about it now. I've already said that I was very inexperienced when I programmed the project but what else does he expect me to do about it? In general, how do you handle critique that is due to your own inexperience?

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

    Using ancient C library with gcc cross-compiler?

    Posted: 24 Aug 2018 08:28 AM PDT

    Having seen a bug report for the PDP-11 page size and verifying that the bug report is correct, I need to test the output with a cross compiler. Building one is not a problem, if built with nostdlib. However, I can't get a runnable binary that way. I have been unsuccessful in building one which can use the 2.11BSD libc. Any ideas how to do so or, failing that, where best to ask?

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

    [Javascript|React] Guides for creating a proper NPM package that satisfies VSCode's intellisence?

    Posted: 24 Aug 2018 08:23 AM PDT

    Hey there!

    tl;dr: I need a guide on how to set up a proper npm module for a UI library I've built, that was originally nested inside our main application which vscode provided me with autocomplete for everything. I moved it out to a node module due to needing the library in a separate application. I lost all intellisence and the ability to know what the package is exporting (auto module discovery).

    Anybody have experience or know what the proper google query is to find what I'm looking for?

    Thanks :) -Andrew

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

    jquery.min.js:2 Uncaught TypeError: (h.dataType || "*").toLowerCase is not a function

    Posted: 24 Aug 2018 07:06 AM PDT

    Why i am getting this error?

    Here is my code:

     getData( { name: "John" }, function ( err, data ) { if ( err ) { console.log( "Error! " + err.toString( ) ); } else { console.log( data ); } } ); function getData( options, callback ) { $.get( "example.php", options, function ( response ) { callback( null, JSON.parse( response ) ); }, function ( ) { callback( new Error( "AJAX request failed!" ) ); } ); } 

    submitted by /u/Don-g9
    [link] [comments]

    Hey all at r/AskProgramming, i have a quick question.

    Posted: 24 Aug 2018 03:47 AM PDT

    https://gyazo.com/a9c223207573e148fbc3d49d50488e60
    Attached above is the screenshot i get whenever i try to launch a game of mine and it is only that game. I have tried so many things to fix the issue. Nothing has worked. Do you guys have any fixs or is it just completely on the companies side to fix and optimize.

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

    New to C#: if I want to check continuously changes in clipboard data how would I go about this?

    Posted: 24 Aug 2018 03:37 AM PDT

    I'm making a program that runs in the background and whenever I copy something on the clipboard, I want certain words to be taken from the data (assuming the data is a string of text). I'm thinking having a continuous loop as it is will cause problems. Is threading the way go or is there another way?

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

    Google Docs + Calendar API questions

    Posted: 24 Aug 2018 02:51 AM PDT

    I'm trying to build a reminder bot/script for my office;

    - Load a list of emails from Google Sheet or anything (CSV, JSON, etc.)

    - Randomize it

    - Send a mail (we use the G suite) about the said reminder. e.g; "Your deadline is in 2 weeks!"

    - Automatically add the schedule/date into their calendars

    Am planning to use a simple cronjob, python, and Google API, not sure if that's the best approach though or where to start or maybe just using MailChimp would be better/easier?

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

    What are the most expensive cloud computations?

    Posted: 23 Aug 2018 10:08 PM PDT

    Hey guys I'm building an app using GCP and MongoDB Atlas. I'm curious, what do you think are the most expensive fees associated with cloud computing? Is it content storage (i.e. video, images, etc)? Database queries? Server requests/responses? Serving content? Streaming data?

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

    assembly in cmd

    Posted: 24 Aug 2018 01:14 AM PDT

    How can I write and run assembly code directly in the command line? I do not want to download any additional assemblers or environments. Thanks!

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

    No comments:

    Post a Comment