• Breaking News

    Thursday, November 26, 2020

    Is it possible to get a remote programmer job from another country? Ask Programming

    Is it possible to get a remote programmer job from another country? Ask Programming


    Is it possible to get a remote programmer job from another country?

    Posted: 26 Nov 2020 10:57 AM PST

    I'm from Hungary but I would like to get a remote job from another country if it's possible. Is this a thing or we are still not there yet? Do you have any experience with it? How would the taxation process look like.

    Thank you all in advance.

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

    Why does my integral_1 function print the wrong values?

    Posted: 26 Nov 2020 09:45 PM PST

    #include<stdio.h> #include<math.h> /* input: 10 -5 2 8 1 4 1 20 5 */ int a, b, c, d, e, f; float equ(float x){//the equation return a * pow(x, 5) + b * pow(x, 4) + c * pow(x, 3) + d * pow(x, 2) + e * x + f; } void diff_1(float x){ float i; for(i=0.1;i>=0.01;i=i-0.01){ printf("%f %f\n",i,(equ(x+i)-equ(x))/i); } } void diff_2(float x){ printf("%f\n",5*a * pow(x, 4) + 4*b * pow(x, 3) + 3*c * pow(x, 2) + 2*d * x + e); } void integral_1(float x1,float x2){ float i,j,sum; for(i=0.1;i>=0.01;i=i-0.01){ sum=0; for(j=x1;j<x2;j=j+(x2-x1)/i){ sum+=i*equ(j); } printf("%f %f\n",i,sum); } } float integral(float x){ return (1/6*a * pow(x, 6) + 1/5*b * pow(x, 5) + 1/4*c * pow(x, 4) + 1/3*d * pow(x, 3) + 1/2*e * x*x + f*x); } void integral_2(float x1,float x2){ printf("%f",integral(x2)-integral(x1)); } int main() { int x = 0; int y; printf("please input six coefficients\n"); scanf_s("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f); int x1, x2; printf("please input range of x1-x2\n"); scanf_s("%d%d", &x1, &x2); int p; printf("please input tangent point\n"); scanf("%d",&p); diff_1(p); diff_2(p); integral_1(x1,x2); integral_2(x1,x2); return 0; } 
    submitted by /u/JacksonSteel
    [link] [comments]

    Creating all possible k combinations of n items in C++. Could somebody explain step-by-step how this code works?

    Posted: 26 Nov 2020 03:17 PM PST

    Link to the code

    #include <algorithm> #include <iostream> #include <string> void comb(int N, int K) { std::string bitmask(K, 1); // K leading 1's bitmask.resize(N, 0); // N-K trailing 0's // print integers and permute bitmask do { for (int i = 0; i < N; ++i) // [0..N-1] integers { if (bitmask[i]) std::cout << " " << i; } std::cout << std::endl; } while (std::prev_permutation(bitmask.begin(), bitmask.end())); } int main() { comb(5, 3); } 
    submitted by /u/haroldas194
    [link] [comments]

    First time building an enterprise application for a client, need help with choosing the database!

    Posted: 26 Nov 2020 01:05 PM PST

    Hey guys, thank you for taking yoour time to help me.

    First of all, some backstory, I am a 2 year old experienced python desktop application developer, started with tkinter, made money on the side freelancing. A few weeks ago I switched to PySide2 and it is better over miles, I love it!

    Now the client wants to access data that is generated by the application on any computer.
    My guess would be I need a server host + a database running on that server host? I was thinking of MySQL, is that the right path?

    Do you guys know a good and secure server hoster or a better SQL language?

    Thank you for your help.

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

    Guys, please help. Iam sort of new to c, and have not been able to set the debugger in vscode for the life of me.

    Posted: 26 Nov 2020 06:04 AM PST

    Iam using cygwin. I can debug in the console, but for some reason debugging through vs code does nothing. I would upload pictures, but that is not allowed here. I have the c plugin installed of course. I also tried following like 3 or 4 different tutorials, but to no avail.

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

    Bass Transducer/Music-Response Haptic App?

    Posted: 26 Nov 2020 09:54 PM PST

    Hi. The basslet seems dead and some wearables seem too expensive to just 'try out'. I'm wondering why there are no music-responsive haptic/tactile transduction apps for mobile - particularly watchOS. I ignorantly assume this is a market void. Maybe it's not possible? There can't be zero demand.

    Please forgive if wrong sub.

    Thanks.

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

    Approaches to representing an chopping up array of arrays or matrices?

    Posted: 26 Nov 2020 05:44 PM PST

    Visual

    Say you have a 5 x 5 array. Represented as:

    [a,1,0,0,0]

    [b,2,0,0,0]

    [c,3,0,0,0]

    [d,4,0,0,0]

    [e,5,0,0,0]

    Note the contents are random, just wanted a way to distinguish.

    Say that I want to chop it up sequentially left to right, top to bottom in 4s.

    So then you'd have groups like:

    [a, 1]

    [b, 2]

    and

    [1, 0]

    [2, 0]

    My solution for this would be to have two loops and go with offsets. But wondering is there another way that makes more sense? The languages I would perform this in would be JavaScript and Python.

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

    HTML - How to force a %age width DIV not to shrink down smaller than its contents?

    Posted: 26 Nov 2020 12:40 PM PST

    https://jsfiddle.net/jmu0b9f7/1/

    If you shrink the window, you'll see that eventually the box of the div will shrink below the width of the text, and the text will overflow the edge of the div.

    Is there a way, just with CSS, to force the DIV to stop shrinking (but otherwise still be 50% of the page width) once it reaches the width of the content?

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

    Need help add comments with //

    Posted: 26 Nov 2020 07:43 PM PST

    //FUNDAMENTALS V1

    #include "fundamentals.h"

    void fundamentals() { //Data type that has no value and is used to represent nothing

     printf("\*\*\*Start of Indexing Strings Demo \*\*\*\\n"); //will display the string of text that within () char buffer1\[80\]; char num\_input\[10\]; size\_t position; //will be used for array indexing and counting while (TRUE) { printf("Type a string (q - to quit):\\n"); // will output this string of text gets(buffer1); if (strcmp(buffer1, "q") == 0) break; while (TRUE) { printf("Type the character position within the string:\\n"); //will output this string of text gets(num\_input); position = atoi (num\_input); if (position >= strlen(buffer1)) { 

    printf("Wrong position... type again, please\n"); //will output this string of text

    continue;

     } printf("The Character found at %u position is \\'%c\\'\\n", position,buffer1\[position\]); //will output this string of text break; } } printf("\*\*\*End of Indexing Strings Demo \*\*\*\\n\\n"); // wil output this string of text 

    }

    Hey im trying to add comments to this program but i don't understand it could anyone help me out

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

    How is the interface for non-web, non-mobile software developed?

    Posted: 26 Nov 2020 11:53 AM PST

    Software like iMovie, Blender, and Adobe products. Do they use raw OpenGL? Or are there frameworks that abstract a lot of the tedium like there are for mobile and web?

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

    RE: can someone help debug this super simple java code for bubble sorting

    Posted: 26 Nov 2020 06:10 AM PST

    here:

    import java.util.*;

    public class bubble

    {

    public static void main(String []args)

    {

    Scanner in=new Scanner(System.in);

    int i,j,t;

    int m[]=new int[10];

    for(i=0;i<10;i++)

    {

    System.out.print("enter numbers");

    m[i]=in.nextInt();

    }

    for(i=0;i<9;i++)

    {

    for(j=0;j<(9-1);j++)

    {

    if(m[j]>m[j+1])

    {

    t=m[j];

    m[j]=m[j+1];

    m[j+1]=t;

    }}}

    System.out.println("the no in ascending oder");

    for(i=0;i<10;i++)

    System.out.println(m[i]);

    }}

    Example input:
    4

    2

    3

    89

    8

    6

    5

    4

    4

    5

    output:
    2

    3

    4

    4

    4

    5

    6

    8

    89

    5

    expected output is all of them sorted in ascending order

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

    Email: Does this message mean I was marked as spam?

    Posted: 26 Nov 2020 03:42 AM PST

    I send emails via Mailgun API and got this back:

    Your message to [name@email.com](mailto:name@email.com) has been blocked. See technical details below for more information.
    The response from the remote server was:
    550 5.4.1 Recipient address rejected: Access denied. AS(201806281) [BN8NAM11FT013.eop-nam11.prod.protection.outlook.com]

    And there was a red traffic light below this. What does this indicate exactly?

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

    3D Connect-4 AI Project: Need help handling explosive search tree!

    Posted: 26 Nov 2020 05:39 PM PST

    Hello!

    I'm currently working on a project for school. I wanted to make my project game related, so I decided to create an AI that is an expert at connect-4. My professor suggested expanding the project to be a 3D version of it, and I'm currently trying to figure out how to make this efficient enough to work.

    My plan was to create a 3D (4x4x4) array to represent the game state, where the player and AI can place any piece (X/O) on any tile they want. They have to connect-4 pieces in any way possible, which could be through multiple layers since it is now 3D. In order to plan the AI's moves, I want to use the minimax algorithm, with Alpha/Beta pruning to help cut down the tree size.

    My huge concern is the fact that we now have up to 64 potential moves instead of just 7 moves in the original 2D version... When using a minimax algorithm, combined with the now 3D array, this can be very problematic as the tree will grow at an explosive rate, creating 64 child nodes for every node evaluated (at the beginning of the game).

    What can I do besides minimax + alpha/beta pruning to help solve this problem? I'm worried that it will only be feasible for the AI to look ahead a few turns due to the complexity of having a branching factor up to 64, while also using a 3D array (which adds to the space being used). In this case, the AI would be pretty much useless until the end of the game when the amount of available moves is reduced drastically.

    Any help would be appreciated! Thank you!

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

    Help needed on a Login and Register system (C++)

    Posted: 26 Nov 2020 04:43 PM PST

    Currently, in university, I have been assigned a project on making a login and register program, however, I have encountered a problem where the second set and onwards of username and password is not recognised by the program. From another post, I learnt that a while loop is required, and the code should look like this while(!read.eof()) and inside this loop I will check the username and password. But I am not really familiar with using fstream commands. Any help is appreciated. Here is the code, https://github.com/Byome303/Login-system-C-/blob/main/Source.cpp

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

    Does anyone know if there is an emoji string library for c++?

    Posted: 26 Nov 2020 03:33 AM PST

    I have been trying to find a way to compare to emojis

    eg 🙈== 🙈

    The current string standard library allows the comparisons of strings but out of the few compilers I have tried, most of them run into an error when trying to compare or it does something unexpected.

    ð\u009f\u0099\u0088

    this one emoji is technically 4 characters, I have no idea how that works, something to do with Unicode that I don't understand yet.

    Does anyone know if there is a library that I can run a function

    string a = "🙈🙈"

    eg is_emoji(a[0])

    and get back a Boolean? Or at least some sort of string library that allows emoji comparison?

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

    Got a little confused on a simple exercise at c#

    Posted: 26 Nov 2020 11:15 AM PST

    Hello everyone, I've got this exercise :

    Write a program that asks the user to enter integer numbers until either 10 numbers have been entered OR a non-integer value (which could be non-numeric) is entered. Then the numbers entered should be displayed in reverse order.

    The thing that confuses me is when I enter a non-integer value into my integers array, it crashes. What should I do to avoid that and just end the loop when a non-integer value is entered?

    code

    int[] x = new int[10];

    int i = 0;

    while (i < 10)

    {

    Console.WriteLine("Please enter the next number: ");

    x[i] = int.Parse(Console.ReadLine());

    i++;

    }

    int y = i-1;

    for (i=y; i >= 0; i--)

    {

    Console.Write (" "+x[i]);

    }

    Console.ReadKey();

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

    Linear Programming (Excel Solver) Problem..

    Posted: 26 Nov 2020 02:47 PM PST

    First of all, apologies if this is not the right place to ask for help with this.

    I have to use Excel solver for this problem, and while I think I understand what I am trying to work out, I'm just not sure how to do it. Here is the question, and the Excel file:

    DataCaseStudy2020 (1).xlsx

    There are currently 4 recycling facilities (A, B, C and D) that are operating in a city. In addition, the city council is considering 2 potential locations E and F to locate their recycling facilities. Facilities at these locations can be opened and operated at a cost of £80,000 per facility. This expansion is to support their burgeoning metropolitan city. They have divided the city into 12 zones. Each zone has a collection point where they collect recyclable waste from the residents of that zone. The expected amount of waste material collected in these 12 zones is given in the data file. The estimated recycling cost at a facility for the materials collected from a specific zone (per kg) is also provided in the file. This variation occurs because the recycling cost incorporates various components such as transportation cost, wages, grades of the recycling materials collected, etc. In addition, there is a restriction on how many kilograms of waste material that can be processed by a particular facility.

    The waste material that cannot be recycled has to be disposed at a cost of £17.75/kg. They are currently considering the following two options: a. Do not open any new facilities and use only current facilities. b. Open facilities in E and F in addition to current facilities.

    You need to prepare an Excel file with two sheets for two models. In addition to the Excel file, you need to send them a 1-page summary letter, where you explain them briefly your approach and recommendation.

    So this is my understanding, but I could be way off. I am to minimise cost for each model, one with the new Facilities and one without. My decision variables are how much waste from each Zone is going to each Facility. The restraints are the capacities of each Facility.

    I have no idea how to solve this in Excel Solver... Could anyone help with this? Or is there other examples I can look at that would give me a good idea? I just don't know what commands to use to find the optimal solution. I've never done a question like this before. I'd really appreciate any help with this.

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

    c++ vector/array compile problem

    Posted: 26 Nov 2020 01:36 PM PST

    Question: https://i.imgur.com/mFNzGwz.png

    My code:

    #include <iostream>
    #include <vector>
    using namespace std;
    int main(){
    string word;
    const int num = 5;

    vector <string> wordsList;
    vector <int> freqList {1,2,1,2,1};
    for (int i=0; i<num; i++){ cin >> word;
    wordsList.push_back(word);
    }
    cout << endl;
    for (int i=0; i<num; i++){ //cin >> word;
    // wordsList.push_back(word);
    cout << wordsList[i] << " - " << freqList[i];
    }
    return 0;
    }

    Error: https://i.imgur.com/voK3MxH.png

    on Repl.it it comes out: https://i.imgur.com/OybnLPa.png Not sure why it's not coming out on code lab?

    I'm not sure what I'm doing wrong here, I think I'm on the right path, but I'm stuck.

    Any help appreciated. :)

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

    From UML to C++

    Posted: 26 Nov 2020 01:36 PM PST

    Hi guys,

    so I am facing a problem at a task from a C++ Book I am using to learn C++.

    Can anybody help me here out, and tell me how I can integrate these marked points in Code, since I cant fina a correct solution to this, and I cant find either any direct reference to it.

    Thank you for helping a Beginner out!!!

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

    How can i make an old abandonedware game support dx11 shaders?

    Posted: 26 Nov 2020 09:42 AM PST

    As a personal experiment i want to switch an old game NASCAR racing 2003 by papryus to have dx 11 support such a thing even possible? if so how?

    Basically how can i get the game to read the d3d11.dll shader library instead of the dx 8 one the game comes with?

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

    To people who tried joining hackathons, do you guys limit what you want your proposed app can do based on what your skills can handle or have you tried risking things by trying to implement something that you haven't tried before?

    Posted: 26 Nov 2020 02:31 AM PST

    need help for FactorialCalculator

    Posted: 26 Nov 2020 10:25 AM PST

    import java.util.*;

    public class FactorialCalculator {

    public static void main(String args[]) {

    Scanner input = new Scanner(System.in);

    int factorial = 1;

    int count,number,i;

    for (i=1; i <=5; i++ ){

    System.out.print("Enter a Positive Integer: "+"\n");

    number = input.nextInt();

    System.out.print(number + "! = ");

    for (count=1; count<=number; count++){

    factorial = factorial*count;

    System.out.print(count);

    if(count < number){

    System.out.print(" * ");

    }

    }

    System.out.println("\nThe Factorial of "+number+" is "+factorial);

    }

    }

    }

    This is the output:

    Enter a Positive Integer:

    5

    5! = 1 * 2 * 3 * 4 * 5

    The Factorial of 5 is 120

    Enter a Positive Integer:

    4

    4! = 1 * 2 * 3 * 4

    The Factorial of 4 is 2880

    Enter a Positive Integer:

    3

    3! = 1 * 2 * 3

    The Factorial of 3 is 17280

    Enter a Positive Integer:

    2

    2! = 1 * 2

    The Factorial of 2 is 34560

    Enter a Positive Integer:

    1

    1! = 1

    The Factorial of 1 is 34560

    the out put i need is like this:

    Enter a Positive Integer: 5

    5! = 1 * 2 * 3 * 4 * 5

    The Factorial of 5 is 120

    Enter a Positive Integer: 4

    4! = 1 * 2 * 3 * 4

    The Factorial of 4 is 24

    and so on

    please help me i'm stuck :((

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

    Deploy Java app on AWS

    Posted: 26 Nov 2020 09:51 AM PST

    Accidently deleted previous post while browsing on mobile app...

    I have a Java app that does webscraping and saves images locally every 12 hours. These images are then processed and deleted. I would like to deploy this to AWS and have it running 24/7. What is the best way to do this? Thanks

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

    How to ship even faster with test automation

    Posted: 26 Nov 2020 05:59 AM PST

    How To Run Multiple Python Files asynchronously from a script deployed on the server

    Posted: 26 Nov 2020 05:39 AM PST

    I am generating certain python files from a python program and these are codes which run asynchronously. Since this application will be used by lot of users, I would not want to create separate projects for them in services like heroku etc. How should i run the generated file on-demand on the server.

    This Is Where The File Is Created

    ``` if flask.request.method == 'POST':
    token = flask.request.form['token'] TOKEN = "TOKEN = \""+token+"\"" file = open("Program.py", "w") code = imports + "\n" + TOKEN + "\n" + main_body + "\n"

    if flask.request.form.get('Function 1'):
    code = code + function1

    if flask.request.form.get('Function 2'): code = code + function2

    if flask.request.form.get('Function 3'): code = code + function3
    code = code + end
    file.write(code)

    print(code)

    ```

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

    No comments:

    Post a Comment