• Breaking News

    Sunday, November 21, 2021

    Help finding the correct algorithm Ask Programming

    Help finding the correct algorithm Ask Programming


    Help finding the correct algorithm

    Posted: 21 Nov 2021 01:04 PM PST

    Hello guys.

    I'm trying to solve a problem for college.

    We have a list of N flights following a 2D trajectory. We have to resolve separation conflicts between them (that is, when two or more of them get closer than a minimum safety distance). We can only modify the speed of each flight in order to resolve the collision.

    My question is, what would be the best approach to solve this problem, if there's the change to create conflicts dynamically when trying to resolve others?

    For example, let's say we have flights 0, 1, 2 and 3.

    If flight 2 gets too close to flight 3, the system should reduce the speed of one of them in order to avoid it. But, when doing so, we may create a conflict between 1 and 2. And, when trying to resolve this last conflict, we could create another one between 1 and 3.

    I hope I explained myself well... Thanks in advance, guys!

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

    Could this task be automated?

    Posted: 21 Nov 2021 04:33 PM PST

    Hi /r/AskProgramming !

    I apologize in advance if this is the wrong place to ask but I am wondering if this task can be achieved easily and, if so, what the best language might be to do it / hire someone to do it in.

    Background

    • A large number of radiology providers in my country have (thankfully) recently switched to an online, web-based retrieval system for medical imaging
    • They all use the same system 'inteleConnect EV'
    • A big part of my job is having to look through multiple of these systems for past imaging for patients
    • This involves having to open 5-6 different pages and perform 7 tasks

    Tasks

    Once logged in (simple username / password web form)

    1. Click this button
    2. Click this checkbox
    3. Input patient details
    4. Input DOB
    5. Click this button
    6. Click a further 'ok' button that will appear soon thereafter

    https://i.imgur.com/swK0xpm.png

    Would it be possible to do the following

    • Create a single form and input in the patient details
    • Have this inputted into each of the sites automatically in new tabs so I can search all sites for past imaging in one go rather than individually
    • How would I best go about this
    • Can this be done via web for portability?

    Thank you in advance for your help everyone, it's much appreciated.

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

    Programming advice (absolute notive w/ Mac)

    Posted: 21 Nov 2021 03:25 PM PST

    Hello,

    I've never done any computer programming other than stats on R. I was wondering how I might go about creating a basic program that can read a round astrology chart and essentially analyze, if X, then output Y, wiith Y being a specific text interpretation.

    Essentially, a rough and simple astrology program. I don't know if that would actually be easy to do. I'd need it to be able to know the glyphs, tkhen have it structured so if there's certain signs or planets certain places, it outputs as text a certain thing. Does that make sense? Happy to provide more info if needed.

    I have a Mac if thats relevant. I'm open to any coding language that is compatible with Mac and preferably free to use.

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

    Mac as a developer

    Posted: 21 Nov 2021 01:04 PM PST

    For those of you developing daily- are you happy with OSX? Or are you experiencing issues related to the Mac?

    I know normal dev tools like Eclipse, … are no problem, I want to know the deeper problems which aren't obvious.

    submitted by /u/error_404-974
    [link] [comments]

    How should I price my freelance work?

    Posted: 21 Nov 2021 06:41 PM PST

    I have gotten accepted for my first freelance job and I negotiate on the cost tomorrow but I'm not quite sure how much I should charge. The job is to create a program to schedule appointments at the most efficient time for customers and then to also use google maps API to find the fastest route. My proposal was $30 an hour but we came to the conclusion a one time fee would be better for the client so I'm thinking I would invoice the client $750 for the 25 hours I think it will take for me to get it all done over the span of 5 days. The number just seems very high in my head but that's what my hourly rate would be. Am I overcharging? Undercharging? I'm confident I can provide what the client wants I just haven't sold my services yet.

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

    If you had to learn python as a total beginner from all start, how would you proceed learning it?

    Posted: 21 Nov 2021 06:00 AM PST

    1) What courses (udemy,coursera, nptel, ones) would you use?

    2) Have basics of CS but assume I don't have much of that either but I am capable of learning them on the go as I have already studied all of them in college once.

    3) What 1 book would you recommend(Different people will have different recommendations).

    I don't want to start from project but from the basics of python as my basics of programming aren't clear. Please guide.

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

    2D array as argument in C++ vs C

    Posted: 21 Nov 2021 05:03 PM PST

    Hi,

    I'm wondering why doesn't this code work in C++

    #include <iostream> using namespace std; void printMatrix(int rows, int cols, double matrix[rows][cols]) { for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { cout << matrix[row][col] << "\t"; } cout << endl; } } int main() { const int DIM = 10; double matrix[DIM][DIM] = {{0}}; printMatrix(DIM, DIM, matrix); return 0; } 

    For me it fails to compile with message candidate function not viable: no known conversion from 'double [10][10]' to 'double (*)[cols]' for 3rd argument

    While the same code in C works perfectly fine

    #include "stdio.h" void printMatrix(int rows, int cols, double matrix[rows][cols]) { for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { printf("%f\t", matrix[row][col]); } printf("\n"); } } int main() { const int DIM = 5; double matrix[DIM][DIM] = {{0}}; printMatrix(DIM, DIM, matrix); return 0; } 

    what's the difference?

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

    A help with private app for a watch on Apple Watch and Android Wear OS

    Posted: 21 Nov 2021 06:28 AM PST

    I would like to know whether it is possbile to create a custom app in Swift for Apple Watch and Kotlin for Wear OS but not actually uploading it to the store of Apple and Google.

    Basically I want to create a custom app to control some hardware stuff I am building as a hobby project.

    I think you can run an apk on Anroid Wear OS and there is probably no issue, but I am not sure. But I am not sure about Apple Watch.

    I have never worked with any of them in the developer mode so that's why I am asking. My gut feeling is that Wear OS should be similar to Android OS on phone but maybe I am wrong. I have no idea about the Apple Watch though.

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

    Modelling a game score database?

    Posted: 21 Nov 2021 04:10 PM PST

    I'm making a game which has users, levels and scores and I'm struggling to find the best way to model this relationship.

    Essentially, every level has a list of scores associated with it, but users also have a list of scores for levels they've played.

    What would be the best way to model this relationship between this data? Users should be able to get a list of their scores for each level, and should also be able to see the list of scores for a level. How can I structure this?

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

    'extracting' last binary bit from an integer using bitwise and?

    Posted: 21 Nov 2021 05:07 AM PST

    Hello

    so i was going through solutions for a problem called "hamming distance" on leetcode, the problem requires finding the number of different binary bits between 2 integers.

    one of the interesting solutions i found was this:

    public int hammingDistance(int x, int y) { int res = 0; while(x != 0 || y != 0){ if(((x&1) ^ (y&1)) == 1) // extract the last bit of x and y and XOR them res++; // if it is equals to 1 then inc the res x = x>>1; y = y>>1; } return res; } 

    i can understand this solution except for one 'bit'..how do you exactly extract the last bit from an integer using the bitwise &? and is it the leftmost or the rightmost one?

    what i know is that the bitwise & compares the individual bits of the integer returning a new binary that resembles the logical outcome, like this for example:

    1&4 = 0001 & 0100 = 0000 = 0

    can someone please explain to me how does this work?

    submitted by /u/-KuroOkami-
    [link] [comments]

    I need a custom normal distribution algorithm.

    Posted: 21 Nov 2021 12:15 PM PST

    I have a population of NPCs in my game with six stats from 1 to 10 (strength, endurance, speed, etc). I want them all to be below-average clods mostly (from 3 to 4), but with an occasional rare super star with 9 or 10 in any given stat.

    int randomDistribution(int min, int max, int iterations) { int total = 0; for(int i = 0; i < iterations; i++) { total += random(min, max); } return total / iterations; } 

    This function gives me stats with the average dude having stats somewhere around 5, and they drop off in a normal distribution. The more iterations you loop through, the rounder the bell curve. Perfect.

    But what if I want the average guy to have stats somewhere around 3 or 4? I thought about simply subtracting 2 from the returned value, but that causes the population to never have the rare super stars with stats of 9 or 10.

    This should also be reversible, as the player will be a champion with average stats around 6 or 7, but with the occasional 1 or 2, just to keep it interesting.

    I need somebody smarter than me to help me out with this. Thanks in advance.

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

    Solution to stream around 500k records of an xlsx file using nodejs?

    Posted: 21 Nov 2021 12:03 PM PST

    I have already used xlsx library(taking too much ram) is thr any other work around for this. My vm/docker max mem limit is 1.6gigs. Can this be done?

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

    I want to build an API that listens to POST requests containing a picture and identifies facial expression/emotion, age and gender (etc) and saves the output and timestamp. What tools would I need?

    Posted: 21 Nov 2021 11:45 AM PST

    I have experience in web dev as well as some experience in Python development.

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

    Legality of using google messages in my software.

    Posted: 21 Nov 2021 08:51 AM PST

    I am making a software to sell and it is using google messages.So can I legally use google messages in my software or do I need to get/buy permission for using google messages.

    submitted by /u/Striking-Courage-182
    [link] [comments]

    Programming jobs?

    Posted: 21 Nov 2021 01:28 PM PST

    What is the best way to learn programming for a job in web design or any other computer science job?

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

    Need a bit of help for a choice

    Posted: 21 Nov 2021 06:46 AM PST

    I am a Java developer for a year now, and i have realized i really want to get into game dev.

    What would be a good game engine/language to go with? I made a few simple 2d games in java, but making my own small game engine is painful.

    I wanted to go for Godot, but that looks python-ish. Do i go with it or something else?

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

    What's your experience with MS Surface Pro?

    Posted: 21 Nov 2021 05:28 AM PST

    I've been using Dell laptop 15inch/ i5 Core/16GB/250GB SSD for development, doing Java mostly and running a VM. I'm considering Surface Pro to be quite tempting, but is it good for development work? Share your experience if you have one. Thanks in advance.

    submitted by /u/Chips-more
    [link] [comments]

    Need help initializing an array inside a class

    Posted: 21 Nov 2021 05:24 AM PST

    Header:

    #pragma once

    template <typename T>

    class Multime

    {

    private:

    `int nr;` `T elem[10];` 

    public:

    `Multime()` `{` `nr = 0;` `elem[0] = 0;` `}` `Multime(const int n, const T &v) :nr(n), elem(v)` `{` `}` `Multime(const Multime<T>& A)` `{` `nr =` [`A.nr`](https://A.nr)`;` `elem = A.elem;` `}` 

    };

    Main:

    #include<iostream>

    #include"Header.h"

    int main()

    {

    `Multime<int> A( 2, { 1,2 } );` 

    }

    I get these error in main:

    1. Error (active) E0289 no instance of constructor "Multime<T>::Multime [with T=int]" matches the argument list
    2. Error C2440 'initializing': cannot convert from 'initializer list' to 'Multime<int>'

    How can I resolve this?

    Edit: sorry if the formatting is not proper

    Edit 2: I'm using visual studio 2019 for c++

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

    How to really calculate signed int shifting operation?

    Posted: 21 Nov 2021 04:55 AM PST

    Could you help me to find my path?

    Posted: 21 Nov 2021 02:15 AM PST

    Hi everyone.

    I will give you some background quickly.

    I started medical school but I had a really rough time and I just drop it after some time. I jump to IT degree and learn basics and some Java (not much but I know what a loop is, the "if" "for" and such.

    OK so after sometime I get rid of my depression and came back to my truly passion, the medicine. I'm finishing it this year. I will be a doctor and I wont be anything else.

    BUT...I like so much the idea of making my own stuff and programming is so appealing to me. But I don't know what to focus on with the little time I have.

    My ideas are: - Python: Could be the programming language more useful for my daily basis. Even though I don't want to be a researcher it could help me on automatization. Like it. Algo Angela Yu course is awesome for what I heard.

    • JS, HTML, CSS: Don't know if I like this. Never tried. But I like the idea of building a beautiful website. Also I need to mention that all of the programming knowledge will be apply to my day to day. That means I would make a website where I find tools I can't find anywhere else. Ex: To-do list, pomodoros, calendar, notes, all in one website, without paying walls or ads or shit. I want it for my study and my productivity. Won't work as a programmer and won't sell or try to earn money with it. Also Angela Yu courses or THE ODIN PROJECT are really appealing to me.

    • Dart+Flutter: I recently discover this language. I just saw that you could build "easily" some apps, and also very beautiful. I don't know if webdev/app dev is better for my objetives but I like app dev more (however I love The Odin Project idea). Is there any good course here?

    Ok that is all. Could you point me in the right direction? I need to hear some opinions and thoughts please.

    Have a nice day.

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

    No comments:

    Post a Comment