• Breaking News

    Sunday, February 2, 2020

    Is there a proper term for an application that mocks another application's API, and for the relationship between them? Ask Programming

    Is there a proper term for an application that mocks another application's API, and for the relationship between them? Ask Programming


    Is there a proper term for an application that mocks another application's API, and for the relationship between them?

    Posted: 02 Feb 2020 08:31 PM PST

    Say, for example, I have application A, and it's programmed to talk to application B via an API. Then, I decide to create my own application C that will mock B's API. Application A will not see any difference, but I as an end user will because actual implementations in C are different.

    Are there proper terms for the process that C does, and for applications A, B, and C in this context?

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

    If lines of code can't be accessed by the program, will the compiler just ignore it?

    Posted: 02 Feb 2020 04:55 AM PST

    Like let's say you define a method, but never use it, will the compiler just ignore it? If that's the case, how does it know if it can't be accessed or not? If I do something like "if x == 12, then run method", will the compiler bruteforce the entire code to see if x can be 12?

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

    Am I doing too much?

    Posted: 02 Feb 2020 09:36 PM PST

    Monday to Thursday I study C# for 2 hours each day and then learn to build games with Unity game engine for another 2 hours

    Friday and Saturday I spend doing Harvard's CS50

    Im still a beginner right now, I only just learned about Polymorphism. Is it a bad idea for me to be learning these different things at once? Should I just stick to C# for now?

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

    need an experienced coders help on an assignment!

    Posted: 02 Feb 2020 08:39 PM PST

    I have a simple program that I can pay $$$ for completion and here it is:

    this is for an introductory class on Java, I would just need some help. Would take a master maybe 10 minutes to do!

    1. Write a program that analyzes an object falling speed for 10 seconds. It should contain main and two additional methods. One of the additional methods should return the distance an object falls in meters when passed the current second as an argument. See the formula needed below. The third method should convert meters to feet. You can look up the conversion factor needed online. The main method should use one loop to call the other methods and generate a table as shown below. The table should be displayed in formatted columns with decimals as shown. formula table 2. Write a program that simulates tossing a coin. Prompt the user for how many times to toss the coin. Code a method with no parameters that randomly returns either the String "heads"or the string "tails". Call this method in main as many times as requested and report the results. See Example outputs below. Example Outputs How many times should I toss the coin? 1000 Results of 1000 tosses. Heads: 483, tails: 517 How many times should I toss the coin? 1000000 Results of 1000000 tosses. Heads: 500074, tails: 499926 Recheck the requirements before you submit 

     DM me if you're interested! 
    submitted by /u/cogama
    [link] [comments]

    Why is ASCII é 130 when áíóú are next to eachother?

    Posted: 02 Feb 2020 04:45 PM PST

    Programming project C++

    Posted: 02 Feb 2020 06:02 PM PST

    URGENT!!!! Im writing a code in C++ but i dont quite know how to do this type, im supposed to make a fundraiser, this is what im supposed to do.

    "Write a program that asks for the type and number of candy bars purchased then computes the total cost of the purchase. Your program should consist of input validation for the number of candy bars (must be greater than zero) and type (only 2 types allowed---plain milk chocolate and milk chocolate with almonds)."

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

    Not Case-Sensitive language

    Posted: 02 Feb 2020 01:10 AM PST

    So python is case-sensitive, ruby is case-sensitive and so are many of them. Which one is not?

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

    Assembler: What is fast and universal method to "loop" until a condition is met?

    Posted: 02 Feb 2020 09:54 AM PST

    Hi so lets say i had an universal assembler language (not that i have it, but lets assume it). What method would be the fastest to reproduce something like this C code:

    for ( int i = 0; i < 5; i++ ){ do(); } 

    METHOD 1:

    MOV R0 5 for: CMP R0 0 JZ end DEC R0 JMP do do: ; some code JMP for end: ; end of loop 

    METHOD 2:

    for: ; do() ; do() ; do() ; do() ; do() 

    Is there a better method? because method 1 s easier but slower, methode 2 is cumbersome when you have allot of code in the for loop or when the iteration is big, but faster.

    submitted by /u/k3rn4l-p4n1c
    [link] [comments]

    What is needed to make a better version of TeamViewer that simply connects to remote PC without all the other bells and whistles...

    Posted: 02 Feb 2020 01:18 PM PST

    Could someone please elaborate more on this. I'm curious to see what it will take to make a better application?

    I read TeamViewer uses their own server to connect to end user. I'd like to understand this further...

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

    Where to find more abstract/esoteric/insightful content around programming and building software?

    Posted: 02 Feb 2020 07:00 AM PST

    Getting bored with "hot take about this piece of tech" or "tutorials on how to build a thing with x, y, z" or "deep dive into niche feature of thing" etc.

    Looking for things that really make me think about the "bigger picture" of building software.

    Any recommendations of platforms/authors/speakers/etc?

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

    Help with designing architecture for real user data segmentation

    Posted: 02 Feb 2020 08:09 AM PST

    Hello, I could use some insight into the possibilities for designing an architecture for a marketing campaign system (similar to Campaign Monitor or MailChimp), with the following requirements:

    • Bulk importing of potentially a few million (let's say maximum 10M per import) records of user data for marketing purposes. Each import can have completely arbitrary user data, although each field should have a data type determined during import. Some fields can also be semantically recognized by our platform, but some could be entirely custom;
    • After importing, the client can create segments (sequence of rules) for querying the imported arbitrary data (e.g. people born after 1975, people who are female, etc). The response time for calculating the total count of the matching records should be no more than a few seconds;

    I've done some experiments using Neo4J, modelling the possible segments as relationships between user nodes. This approach wasn't so successful, since the import and the segmentation processes grew quite cumbersome for only a few hundred thousand records (taking up to 10minutes for 100k). The relationship model also didn't seem adequate for numerical comparison or date range queries.

    Another possible approach could be using elastic search for segmentation querying, however since the user data schema is different between clients, and could change in a given import, I dont see how I could define appropriate mappings for document indexing. Having an index per client could prove cumbersome as well.

    I'd like to gather some opinions as to how one could model these requisites or ideally know how an existing system working at scale with similar requirements has been implemented.

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

    NEED ASSIGNMENT DONE PLS HALP

    Posted: 02 Feb 2020 07:17 PM PST

    I've already started a reddit asking for help but im getting utterly confused with this, im doing A C++ project and honestly don't know what im doing. So if someone could please make this program id appreciate it a lot (with explainations b/c i wanna understand)

    Write a program that asks for the type and number of candy bars purchased then computes the total cost of the purchase. Your program should consist of input validation for the number of candy bars (must be greater than zero) and type (only 2 types allowed---plain milk chocolate and milk chocolate with almonds).

    HERE IS THE START UP IVE GOT THUS FAR 1. Input the type of the candy bar to order. 2. Input the number of candy bars to order. 3. Determine the discount based on the number of candy bars ordered. if qty is less than 6 discRate is 0 else if qty is between 6 and 10 discRate is .15 else if qty is between 11 and 15 discRate = .25 else if qty is between 16 and 20 discRate is .35 otherwise discRate is .50 4. If the type is plain milk chocolate, the price is 1.99. If the type is milk chocolate with almonds, the price is 2.50. 5. Calculate the subtotal by multiplying the price by the number ordered. 6. Calculate the discount by multiplying the discRate by the subtotal. 7. Calculate the totalCost by subtracting the discount from the subtotal. 8. Display the number and type of candy bar ordered along with the discount and total cost. */

    include <iostream>

    include <string>

    include <iomanip>

    using namespace std;

    int main() { // Variables int qty = 0; double price = 0, subtotal = 0, discount = 0, totalCost = 0, discRate = 0; string type = "";

    // Get Input cout << "Enter the type of candy bar purchased: "; getline(cin, type); // getline must be used because candy bar names have spaces in them cout << " Plain Milk Chocolate "; // Fill in missing code if/else statement to determine candy bar prices based on type. else { cout << "An invalid type was entered!" << endl; system("pause"); exit(0); // Causes program to end. } // Request and input the number of candy bars if (qty < 1) { cout << "An invalid qty was entered!" << endl; system("pause"); exit(0); // Causes program to end. } // Determine Discount Rate and Price (Based on Type) string discRate; // Insert the if else if statement to determine discount rate 

    // Perform Calculations

     // Display Output cout << setprecision(2) << showpoint << fixed; system("pause"); return 0; 

    } /* Program Output

    */

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

    [C] Quicksort is generating 0's and overwriting numbers in array's

    Posted: 02 Feb 2020 10:24 AM PST

    I want to make it as easy as possible for my dad to select a ROM for an NES/SNES Emulator. Need to create a GUI for choosing ROMs with game-pad support. Which Language is easiest for that? --Linux compatible-- (noob)

    Posted: 02 Feb 2020 09:30 AM PST

    Hi.

    I recently got the idea to use an old laptop I've got lying around as a gaming platform for my Dad. He used to enjoy the games on the NES. I already got the emulator working and all, but I fear - since he never used a computer before - that it would be too complex or unappealing for him to go through a file-manager, that doesn't show pictures. He never used a mouse before and all that ... so the easiest thing I can imagine is him using the game-pad to point and select on Icons of the old games (Which I totally all own, don't worry), which then load in the respective emulator that I configured so that he only needs to use the controller and everything works. (I can imagine setting up a sort-of key-combination - on the game-pad - in order to close the emulator and going back to the GUI)

    Basically, imagine something like on the PS4. But less complex.

    Currently the Laptop runs Lubuntu. ZSNES and FCE Ultra are running on it perfectly fine. (60 fps and more) It is a very old Laptop with a Sempron 3500+ and ATI xpress mobility x200. So, Windows would just slow things down.

    This doesn't work through the file-manager of Lubuntu (I think) and I would need to add icons myself since the ROMs don't include one. (Which is also not possible in the file-manager)

    I'm certain, since there are probably a hundred languages, that there must be one that is made for things like that. Something almost like HTML, but deeper and better at it.

    I don't have much experience programming in any language, but I tend to learn that quickly. Since this is a very easy job, I don't think I will have much issues creating something like that.

    TL:DR: I would need a language that would make it easy to program a (maybe fullscreen) GUI with game-pad support in Lubuntu.

    Thank you! :)

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

    The best way to transform a string into excel table?

    Posted: 02 Feb 2020 05:41 AM PST

    Hey.

    After doing some http request my program ends up with a json-like string that is something like this: {"situation":"active","id":"3","pront":"3","name":"John"}, "doctor":[{"id":"14","idpac":"3","idmed":"79","name":"Rachel"}]},...

    I want to transform all into an excel file, preferably with two tables, like this:

    Patient table situation id pront name active 3 3 john Doctor table id idpac idmed name 14 3 79 Rachel 

    Another catch is that as the program runs it will get more strings with different patients and doctors, but always with same fields (id, name, etc). So in the first loop the excel should be something like above, but after some interactions the result needs to be something like:

    Patient table situation id pront name active 3 3 John active 4 5 Mike inactive 5 4 Sarah Doctor table id idpac idmed name 14 3 79 Rachel 15 1 60 Joseph 

    Later on I plan to transform this excel into a real database. I don't know which one yet, that's why I want to convert into an excel, so it would be easier to transform in any kind of database later on (mysql, oracle, etc).

    Thanks in advance.

    Edit: Forgot to say I'm doing this in C#!

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

    Are there any apps that allow you to program games on the iOS?

    Posted: 02 Feb 2020 08:22 AM PST

    I'm an amateur programmer, but I like to make short minimalist proof of concept games from time to time. But often, the times where I find myself wishing to punch out some code, I'm far away from my mac.

    Would be nice if there was a way to program and run primitive games on my iPhone. Does such a thing exist?

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

    What is the correct term for a class from which no objects inherit?

    Posted: 02 Feb 2020 08:07 AM PST

    Let's say I have 3 objects - objects a, b and c. Object c inherits from object b and object b inherits from object a. What is the correct term for the class object c derives from(the object from which no other objects inherit)? Or is there no term to describe this?

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

    IntelliJ IDEA VM options

    Posted: 02 Feb 2020 07:37 AM PST

    I started creating a custom plugin for the IDEA. As soon as I extend an action from AnAction, override abstract methods and hit run plugin, I get Unable to start DebugAttachDetector, please add `--add-exports java.base/jdk.internal.vm=ALL-UNNAMED` to VM options

    What is this. I tried adding this in settings/build, exec../compiler/java compiler under Override compiler parameters but still does not work. What am I to do :(

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

    [JS HTML] Can I use an "element object" (the thing returned by getElementById) as a parameter in a function?

    Posted: 02 Feb 2020 06:52 AM PST

    Hello!

    I have an "element object" (I have no idea what it holds and how it works, but I would be a lot more at peace it if was called "element pointer", meaning that it just hs the internal id of the element and points to it in memory, whereas "object" implies whole hierarchies of sub-variables of sub-variables 100 levels deep and megabytes large.

    var element_object = document.getElementById("id_of_element"); 

    I don't have this exactly, but my function returns the element object that it carries over from the getElementById function, so I Just wrote it here. Now, we can do some javascript and anything we want.

    BUT, since literally every element that I will make uses the same exact css attributes, I thought, I'd just make another function. This is a caricature, don't yell at me about how stupid this is.

    What I did:

    function applyStyles (id, color, textcolor, flexorder) { var ele_obj = document.getElementById(id); ele_obj.backgroundColor = color; ele_obj.color = textcolor; ele_obj.order = flexorder; } var element_object = document.getElementById("id_of_element"); applyStyles("id_of_element", "green", "red", 5); 

    What I want to do:

    function applyStyles (ele_obj, color, textcolor, flexorder) { ele_obj.backgroundColor = color; ele_obj.color = textcolor; ele_obj.order = flexorder; } var element_object = document.getElementById("id_of_element"); applyStyles(element_object, "green", "red", 5); 

    So, which one is better and more "legit", and which one should be avoided? Are "element objects" something special and spooky, or can you use them as a normal variable that just points to somewhere? Like, in the sense that I am not multiplying big objects and making copies of them because they are a function parameter and doing extra work for the processor.

    Tnx!

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

    [HELP] Can someone explain how this Brainfuck RNG works?

    Posted: 02 Feb 2020 06:35 AM PST

    Hi, throughout my BF journey, I stumbeled over this RNG code:

    >>>++[ <++++++++[ <[<++>-]>>[>>]+>>+[ -[->>+<<<[<[<<]<+>]>[>[>>]]] <[>>[-]]>[>[-<<]>[<+<]]+<< ]<[>+<-]>>- ]<.[-]>> ] 

    Can someone explain to me how and why it works? The only 'thing' I understand, is that the dot outputs the random number which is then converted to a char (BF-101 ;D ). But I have no clue how these loops generate the random numbers. And are they 'good' pseudo randoms or is there a pattern which is easily recognizable?

    submitted by /u/3Domse3
    [link] [comments]

    Tkinter Background image covers widgets and doesn't appear

    Posted: 02 Feb 2020 05:31 AM PST

    I'm having a problem with my GUI that I made with tkinter and the problem is that I can't set the background to and image.

    I've tried this code

    import sys import sqlite3 import os import pandas as pd from pandas import DataFrame from tkinter import * from tkinter import ttk from PIL import ImageTk,Image from PyQt5.QtWidgets import QApplication, QTableView from PyQt5.QtCore import QAbstractTableModel, Qt r = Tk() # Opens new window r.title('Multimedica Store Control Program') bg_img = ImageTk.PhotoImage(Image.open('D:/Codecademy/storebackground.png')) bg_label = Label(image=bg_img) img_label.place(x=0, y=0, relwidth=1, relheight=1) r.mainloop() 

    but it shows a white screen and all my other widgets aren't shown on the screen. The window is simply a white screen so neither the widgets nor the photo appear. I've tried transforming the image into GIF and it still didn't work. The Image is 1280*720 and I'm working on a 1280*720 screen and the window is set to being always full screen so there shouldn't be a problem with size. Thanks

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

    JS Syntax help

    Posted: 02 Feb 2020 05:09 AM PST

    EXTERNAL: {
    $: {
    name: library.external.name
    }

    deployment.EXTERNAL['SYMBOL'] = library.external.symbols;

    Property 'SYMBOL' does not exist on type '{ $: { name: ExternalLibraryNames; }; }'.ts(7053)

    I am currently working on a open source project and have been trying to figure out what $ means in this case as I thought it is a substitute for any attribute name depending on the input but I keep getting the symbol error, could someone give me some terms to google or let me know what is going on.

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

    Can someone tell me what is Fintech or Finance tech and what programming languages should one learn for this?

    Posted: 02 Feb 2020 04:16 AM PST

    So I have heard that there are a lot of Jobs in UK related to financial tech. I assume its related to data science ? But I am not exactly sure because where I live most jobs are embedded C++.

    I would like to move there and I think my best chance is trying to get a job in Fintech. Can someone explain to me please?

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

    If you use scripting language to modify boss/item behavior in a c++ game, how much will it impact the performance?

    Posted: 02 Feb 2020 04:12 AM PST

    I'm trying to make a game in c++ and I wanted to make it easier for me, in the long run, to allow modding later down the line. I'm thinking of only using the scripts once while loading assets, or items so that the performance of the game isn't impacted that much, especially on old Pentiums and Celerons. Is it possible to use it to handle boss mechanics, how items work and such?

    For example, let's imagine I have a boss that has its values in a c++ class and one of the methods which are called in the main loop is its "AI", which executes a function from script with conditional logic, then returns back to the c++ code and continues executing the precompiled stuff. The function that the script is executing in the AI method will only modify values of the class like for example, make it move a certain way or check the player's hp and set the boss's status as enraged.

    Of course, I will create a program to help with the creation of mods by having a default template and for example, if the developer wanted to create a new item, he would click on create a new item and the program will generate a script file with the function name ready to be modified plus added the name and path to the item's textures in an AssetList file, so the next time the game loads it will load the new item into memory in the specified state (main menu, options menu, world creator, the world).

    Is that a good way to allow for modding, is it possible, is it going to really affect the performance by a substantial amount or not? If it will impact it which of the scripting languages would be more performant than the rest (Python, JavaScript, Lua, etc.)? Is it possible to pass an object from the c++ code to the script file and modify it in there or not? Is there another way to allow mod developers to create mods for a c++ game?

    I'm trying to find a way to add mod support early on, so I can just tune it after a stable release and add it in a later stable version as a content update.

    P.S.

    I've read about LuaPlus, but I can't seem to understand the way to add it. The creator says on it's Github page to download 2 executables, one of which is no longer downloadable (unzip.exe) or at least I'm not smart enough to figure out how to download it, in order to build the library. I'd be very grateful if you could help me set it up on vs2019 community.

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

    No comments:

    Post a Comment