• Breaking News

    Monday, May 27, 2019

    Need some help with this, Can't figure out a way to accomplish this Ask Programming

    Need some help with this, Can't figure out a way to accomplish this Ask Programming


    Need some help with this, Can't figure out a way to accomplish this

    Posted: 27 May 2019 07:11 PM PDT

    I'm working on a programming assignment, and I have to move numbers entered into an array to a second array, but in ascending order, but I'm not allowed to sort either array. I've been racking my brain probably 3 hours trying to figure out this one bit, and I can't for the life of me think of anything. Any guidance would be appreciated.

    Assignment is in C++.

    My professor says this counts as sorting the array, which is not allowed in the homework guidelines.

    Pointer notation is mixed in because I remembered while writing it that this function has to use pointer notation for the arrays.

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

    Tear My Algorithm Apart - Sorted Birthdays Within the Next 30 Days

    Posted: 27 May 2019 10:34 AM PDT

    C# vs Java, what do i chose as a primary language for programming interviews?

    Posted: 27 May 2019 09:04 PM PDT

    It's been a while since I have coded in Java. Many of my programmer friends asked me to use Java and show Java portfolio since the chances of getting a recruiter call are more for Java. Need suggestions.

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

    Neural Network Seption

    Posted: 27 May 2019 02:16 PM PDT

    Could you make a neural network where every node is it's own neural network? Could this be used to formulate more complex neural networks? An example of this is where every node gets a input from every node above it and then comes up with its own output to the entire process but compares it with other nodes in the same layer to decide which is the correct output. This process would continue until it gets through all of the node layers and finally releases with a matrix of outputs from the final node/neural network.

    Edit (Pasted comment): Yes, but I'm thinking of it more on in how are brains work. Where neurons can process information individually and then communicate with other neurons to come up with a solution. And then us as individuals bounce ideas off each other to solve issues. See the human race learns collectively on different layers of abstraction. Are neurons process information and then communicate which what's make us, and then each of us communicate to progress the human race forward. So my question is if we could simulate these layer of abstractions to where eventually the neural net could teach its self by comparing ideas with other neural nets working on the same problem from a different angle? Kinda mimicking how we solve problems as a human race.

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

    SDL2 framework controller event polling for multiple controllers.

    Posted: 27 May 2019 06:30 PM PDT

    Im having a weird issue where my first controller registers events properly and I only see 1 button down and 1 button up event, but the exact same code that produces this result also causes my 2nd controller to register 2 down buttons and 2 up buttons when I trigger it with a single button down and up. This function is being ran in a thread and is infinitely looping. Im trying to have a thread handle my events as they come in. Im also having a hard time finding any good information online on how to implement multiple controllers.

    int EventHandler(void* data)

    {

    SDL_Event event;

    bool quit = false;

    //TODO: Start here and make new class for background textures and level textures(possible use for inheritance).

    SDL_Event prev_poll;

    while (!quit)

    {

    while( SDL_PollEvent(&event) != 0)

    {

    if( event.type == SDL_QUIT )

    {

    return 0;

    }

    else if(event.type == SDL_CONTROLLERBUTTONDOWN)

    {

    for(int i=0; i<SDL_NumJoysticks(); i++)

    {

    if(SDL_GameControllerGetButton(gameControllers[i],SDL_CONTROLLER_BUTTON_DPAD_DOWN) ==1 )

    {

    std::cout << "DEBUG#1"<<std::endl;

    break;

    }

    if(SDL_GameControllerGetButton(gameControllers[i],SDL_CONTROLLER_BUTTON_DPAD_UP) ==1)

    {

    std::cout << "DEBUG#2"<<std::endl;

    break;

    }

    if(SDL_GameControllerGetButton(gameControllers[i],SDL_CONTROLLER_BUTTON_DPAD_LEFT) ==1)

    {

    std::cout << "DEBUG#3"<<std::endl;

    break;

    }

    if(SDL_GameControllerGetButton(gameControllers[i],SDL_CONTROLLER_BUTTON_DPAD_RIGHT) ==1)

    {

    std::cout << "DEBUG#4"<<std::endl;

    break;

    }

    }

    }// BUTTONDOWN

    else if(event.type == SDL_CONTROLLERBUTTONUP)

    {

    for(int i=0; i<SDL_NumJoysticks(); i++)

    {

    if(SDL_GameControllerGetButton(gameControllers[i],SDL_CONTROLLER_BUTTON_DPAD_DOWN) ==0 )

    {

    std::cout << "DEBUG#5"<<std::endl;

    break;

    }

    if(SDL_GameControllerGetButton(gameControllers[i],SDL_CONTROLLER_BUTTON_DPAD_UP) ==0)

    {

    std::cout << "DEBUG#6"<<std::endl;

    break;

    }

    if(SDL_GameControllerGetButton(gameControllers[i],SDL_CONTROLLER_BUTTON_DPAD_LEFT) ==0)

    {

    std::cout << "DEBUG#7"<<std::endl;

    break;

    }

    if(SDL_GameControllerGetButton(gameControllers[i],SDL_CONTROLLER_BUTTON_DPAD_RIGHT) ==0)

    {

    std::cout << "DEBUG#8"<<std::endl;

    break;

    }

    }

    }

    else

    {

    break;

    }

    }

    }

    }

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

    Making a GitHub repository for a ReactJS app?

    Posted: 27 May 2019 05:55 PM PDT

    Hey everyone. This might be a really stupid question, but I'm trying to learn React and this was the only place I could think of to ask this question. When I make a React app, it makes a lot of folders and files in the node_modules folder that I assume are required for it to run properly. It makes a lot of little files, and it takes a long time to add and push every single one of these to a GitHub repo. The only part that I need is the stuff in the src folder. Is there a way to make it so that the repo only tracks changes made in the src folder, and only commits and pushes that?

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

    C# resources

    Posted: 27 May 2019 07:33 AM PDT

    I have been tasked to get a cognex sensor working within C# and acquire 3D scans, specifically a 3D displacment sensor if anyone was curious. This is fairly easy to do within VisionPro and Cognex does provide alot of information and video tutorials on how to do this all in vb but not much within C#.

    Now here's my issue; my knowledge within C# is pretty abysmal, it so far consists of a few youtube videos therfore I am looking for good resources or even online courses (willing to pay up to £30), does anybody have some good recommendations?

    Thanks

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

    I need some help with Jupyter notebook

    Posted: 27 May 2019 10:20 AM PDT

    Hi, well i'm a student and my university send me to do service, i'm doing it at one investigation center, the problem here is that i don't know hot to program in python, they ask me to learn it, but i think i'm not doing well, i have a lot of questions and no one is here to teach me.the program is about a kind of gauss meter the problem with it is that it shows some errors maybe it isn't exclusive of the jupyter language but i don't have any idea of what does means.

    program**# import serial

    import time

    def serial_connection(b):

    global text_conn1, text_conn2, check_conn, ser, serG

    serPort = text_conn1.value

    baudRate = 9600

    ser = None

    serPortG = text_conn2.value

    baudRateG = 2400

    serG = None

    if check_conn.value:

    ser.close()

    serG.close()

    print("Desconectado!")

    check_conn.value=False

    b.description="Conectar"

    b.button_style="warning"

    else:

    ser = serial.Serial(serPort, baudRate)

    serG = serial.Serial(serPortG, baudRateG)

    print("Conectado!")

    check_conn.value=True

    b.description="Desconectar"

    b.button_style="success"

    error ---------------------------------------------------------------------------

    NameError Traceback (most recent call last) <ipython-input-3-3bf45b1fdfed> in serial_connection**(b)** 21 b**.button_style="warning"**

    22 else:

    ---> 23 ser = serial**.Serial(serPort,** baudRate**)**

    24 serG = serial**.Serial(serPortG,** baudRateG**)**

    25 print**("Conectado!")**

    NameError: name 'serial' is not defined

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

    From the Hiring Side: Interview Questions for Position that Involves *some* Programming

    Posted: 27 May 2019 12:00 PM PDT

    There's a lot of talk about bad interview questions so I wanted to approach the community to see what a good practice would be. I've been tasked with coming up with 2 take home questions.

    My approach is this, 1 question geared towards general knowledge. Writing pseudocode prove you know functions, data structures, loops, if statements, etc. And then 2. A more complicated question that shows that they can search for an answer and think about problems.

    Any suggestions?

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

    Which language would you choose for secure and fast e-government systems?

    Posted: 27 May 2019 12:48 PM PDT

    Some requirements:

    • easy to read and understand (for transparency and maintainability)

    • fast (for computing rules and for natural language processing)

    • safe (type safety, best practices enforcing, tamper proofing, etc)

    If you could chose a maximum of two languages, but ideally one, what would be your choice(s)?

    Ada, Spark, D, Rust, ...?

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

    When populating a message bus, what is best practice for naming queues?

    Posted: 27 May 2019 11:05 AM PDT

    What is a good place to ask about open source libraries?

    Posted: 27 May 2019 10:45 AM PDT

    I tried stackoverflow but learned the hard way that such questions aren't allowed (it seemed to be in part because people would get in pissing contests over those questions)

    Closest one it the stack suite of sites that fit was software Recs, which allows library questions but it seems not the direct goal, and so the question is kind of dead.

    Is there an active place like stackoverflow for this?

    My specific question is: https://softwarerecs.stackexchange.com/questions/61634/looking-for-a-good-open-source-library-for-cpp-sockets-usage-including-sending

    But I doubt this will be the first time I have similar questions.

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

    Is password bruteforcing NP Complete?

    Posted: 27 May 2019 03:46 AM PDT

    Because it can be rephrased as "which inputs satisfy this black box function?", making it a version of SAT, right?

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

    What was your worst/unfixable version control fuck up?

    Posted: 27 May 2019 05:53 AM PDT

    When I do LoadLibrary on a DLL, I get identifier is undefined.

    Posted: 27 May 2019 12:49 AM PDT

    I'm still learning about DLLs, and from what I've read, the proper way to do it is with a .def file. But I don't have one, because the DLL in question isn't made by me.

    My goal is to make a DLL injector, which I've completed, but, inside of my injected DLL, I want to LoadLibrary one of the DLLs that the target process is using, so my injected DLL can use it as well.

    I just want to make sure I'm doing this right, and most of all, to understand what I'm doing.

    If I LoadLibrary the target process DLL, and then do GetProcAddress to get the functions I need from it, Visual Studio just gives me "identifier is undefined" everywhere I try to use them.

    I wanted to add the target process DLL to my project's references but the references window didn't have any option for me to add anything from outside the solution.

    But if I go into project properties -> Linker -> Input, there's a additional dependencies, maybe I'm supposed to add the DLL to that? If I do that, then all the "identifier is undefined" goes away at least.

    I don't know if this accomplishes what I want though, maybe it just solves one problem and creates another that I don't know of yet?

    And if that is the correct way to do it, I wonder two things:

    1. I thought Visual Studio wanted to deprecate external dependencies, and that we should start using references instead?
    2. What exactly does it do when I add it to additional dependencies? Why isn't it enough with LoadLibrary and GetProcAddress?
    submitted by /u/Menzoberranyr
    [link] [comments]

    [Swift] - How does one make a Firebase Database Child be a user Default and then in a different swift file check if that Child/Default exists for this user?

    Posted: 27 May 2019 08:10 AM PDT

    have so far:

    Part 1 (Child Database (this works) and making that a user default (I'm not sure how to check it that worked)

    @IBAction func SubmitPressed(_ sender: Any) { let databaseRef = Database.database().reference() let uid = Auth.auth().currentUser!.uid databaseRef.child("Education").child(uid).setValue(self.Education.text!) UserDefaults.standard.set("Education", forKey: "Education") 

    Part 2 in different .Swift file (Check if the User Default (aka Education Child) exists

    func viewDidAppear(_ animated: String) { ?????? } 
    submitted by /u/StreetParsley
    [link] [comments]

    No comments:

    Post a Comment