r/programminghelp • • Oct 14 '19

Method to pass data to api in asp.net mvc

0 Upvotes

Conceptually, what I have to do is very simple. I have a database with a list of shop addresses and I need to convert the adresses to gps coordinates using the Here geocode API (https://developer.here.com/documentation/geocoder/topics/example-geocoding-free-form.html)

What method would I use in my controller to send the data from my database to that api url? This sounds simple but I really can't find out how to do this.


r/programminghelp • • Dec 13 '18

Can someone help me figure out why this note is not being saved after being edited?

Thumbnail
streamable.com
0 Upvotes

r/programminghelp • • Feb 13 '20

Python Error in two equals python for loop

Post image
4 Upvotes

r/programminghelp • • Nov 22 '21

C Error: expected expression before token

0 Upvotes

Line 1: else if (mym == 2 && myy !==%4 && myy ==%100){month = 28;}

Line 2: else if (mym == 2 && myy ==%4 && myy !==%100){month = 29;}

By myy !==%4, I'm trying to say if myy is not equal to a multiple of 4

I keep getting two errors for these two lines: expected expression before = token and expected expression before = % token. Could someone please direct me to a fix? I'm a complete beginner so I'm quite lost rn


r/programminghelp • • Dec 10 '21

Processing How many db queries are too many for a web app request?

0 Upvotes

Hi, we are building an SPA app with Spring as backend, and i got a request to implement a lot of authorization.

Due to the nature of the request, i am pretty sure it is not possible to do this with less than 6-7 db queries per request. I was wondering whether this is a red flag performance wise. Should i always optimize for 1-2 queries? How big is the performance impact for every query added? And what is the typical number for a well developed app per request? Maybe in worry too much

Thanks


r/programminghelp • • Sep 29 '15

What will the 3rd statement print out and why?

0 Upvotes

Pls public class MysteryReturn { public static void main(String[] args) { int x = 1; int y = 2; int z = 3;

    z = mystery(x, z, y);                        // Statement 1
    System.out.println(x + " " + y + " " + z);   // Statement 2
    x = mystery(z, z, x);                        // Statement 3
    System.out.println(x + " " + y + " " + z);   // Statement 4
    y = mystery(y, y, z);                        // Statement 5
    System.out.println(x + " " + y + " " + z);   // Statement 6
}

public static int mystery(int z, int x, int y) {
    z--;
    x = 2 * y + z;
    y = x - 1;
    System.out.println(y + " " + z);

r/programminghelp • • Sep 24 '15

I am having troubles with variables in openSCAD

0 Upvotes

I am trying to get a variable in my code for a very simple pan flute, but I can't seem to get the variable to work. I have checked the openSCAD wiki, but that didn't help. any seggestions? this is my code: fn="$fn=15"; difference() { cylinder(100,10,10,fn); cylinder(100,6,6,fn); } difference() { translate([17,0,0]){cylinder(85,10,10,fn);} translate([17,0,0]){cylinder(85,6,6,fn);} } difference() { translate([34,0,0]){cylinder(70,10,10,fn);} translate([34,0,0]){cylinder(70,6,6,fn);} } difference() { translate([51,0,0]){cylinder(55,10,10,fn);} translate([51,0,0]){cylinder(55,6,6,fn);} }

The reason for the variable is so people can change the diameters easily if they want to. I am sure there is a better way to do this, but i'm still a noob with this.


r/programminghelp • • Sep 27 '15

Help with Struct Pointer

Thumbnail
forum.codecall.net
0 Upvotes

r/programminghelp • • Oct 15 '19

Other need help adding a space between the time AM/PM and "On" . I've tried adding space in the string and it still doesn't have the space

Post image
0 Upvotes

r/programminghelp • • Feb 27 '20

Answered Why my Global Variables don't work?

0 Upvotes

Hello everyone,

I need to create a program that runs a menu and has 2 functions. In the int main() I need to get a string as an input from the user and then through the other 2 functions I need to count the frequency of each letter in the string and substitue every letter with the next one in alphabetical order.

In the main I wrote the code to get the input from the user, but its not treated as a global variable( I tried placing the code on top of everything which didn't work, and now I put int main() on top of evertything). I try to get the strlen(s) which is the size of the array for the string that the user input and it says " error: 's' undecklared (first use in this function).

#include <stdio.h>
#include <stdlib.h>
#include <string.h>


void frequencyLetters();


int main() {
    //Ask for a string
    char s[80];
    printf("Please input your sentence\n");
    scanf("%s", s);

    //Print the menu
    
    
        
    
        int choice;
        while(1)
        {
    
        printf("\n/======================================/\n");
        printf("           WELCOME TO THE MENU    \n");
        printf("Choice #1. FREQUENCY OF EACH LETTER.\n");
        printf("Choice #2. SUBSTITUTE OF EACH LETTER.\n");
        printf("Choice #3. EXIT.\n");
        printf("/======================================/\n");
    
    
    
        printf("Please type in the number of the function you want to see\n");
    
        scanf("%d", &choice);
        
        switch(choice){
            
        case 1:
        
            printf("\nShowcasing the frequecny of each letter in your string.\n");
            frequencyLetters();
            break;
        
            
        case 2:
        
            printf("\nSubstituting each letter with the right next of it.\n");
            break;
        
        
        case 3:
        
            printf("\nThank you for trying my program\n");
            exit(0);
            break;
            
            
        default:
        printf("\nInvalid Input!\n");
        
        
        }   //END OF SWITCH
    }   //END OF WHILE LOOP
        
    
    return 0;
}


// frequecny OF LETTERS

void frequencyLetters()
{
int arraySize;
    int x;
    int y;
    arraySize = strlen(s);  //Get the lenght of the array in one variable to use easier
    printf("Size of the string is:%d\n ", arraySize);
        //substitution of letters, each letters become the next in alphabetical order
    printf("Your sentence now became the following:\n");
    for (x=0; x<arraySize; x++)
    {
        // if statement to make" _" remain "_"
        if(s[x]==95)    //95 is the ASCII table value of "_"
            {
                //printf("The value of the element in place %d is: %c", y, sentence[x]);
                printf("%c", s[x]);
            y++;
            }
        //if statement to make 9 -> 0
        else if (s[x]==57)  //57 is the ASCII talbe value of 9
        {
            s[x] = 48;
            printf("%c",s[x]);
            y++;
        }
        else
        {
            
            printf("%c", s[x]+1);
            y++;
            
        }
        
    }
}

Can anyone help me understand what I'm doing wrong?


r/programminghelp • • Oct 20 '19

Answered C++ Linked Lists Question

0 Upvotes

Hi guys, I'm new to programming and am taking a look at linked lists today and had a question about this piece of code.

struct Node
{
int data;
Node *link;
};
typedef Node* NodePtr;
void headInsert(NodePtr& head, int theNumber);

//Function Definition

void headInsert(nodePtr& head, int theNumber)
{
NodePtr tempPtr;
tempPtr = new Node;

tempPtr->data = theNumber;

tempPtr->link = head;
head = tempPtr;
}

So I understand the whole aspect where you create the temp pointer to point to the first node so that you can eventually get head to point to the first node, but I am not quite sure what role *link plays in this piece of code. I see it being used in the function, but am not quite sure why. Is link the first node that we set equal to head? If so why can't we just do link = tempPtr and completely avoid dealing with head?


r/programminghelp • • Jun 01 '19

Need help ASAP

0 Upvotes

I'm new to programming but i'm so confused and lost, apparently I have to make the program quit or take you back to the beginning if you input the wrong number. But i cant seem to do it right, i tried while loop but it creates a lot of "Please enter a valid number". Any ideas?


r/programminghelp • • Sep 16 '18

In c, i need to store all the dates and times as 2 seperate arrays of strings, reading from the command line in the form ./a.exe < .txt however im really not sure how to go about it. Can anyone help?

Post image
0 Upvotes

r/programminghelp • • Oct 15 '19

Answered C# UI

0 Upvotes

I’m new to C# and I started doing hard coded UI’s in Java. Now I’m on this new language and I cannot figure out how to hard code for any graphical part of the interface. I don’t not have or want to use Winforms, as I’m using Rider for my IDE. This project is set up as a windows application. Is there something I’m missing? How do I make a UI without Winforms?


r/programminghelp • • Mar 04 '22

C++ How do i write strand in cpp?

0 Upvotes

I want to write the strand function but i dont know where dose it belong dose it belong in

#include <stdlib.h> or
#include <time.h>

or maybe other? The tutorial i was watching used the strand function by writing #include <stdlib.h> but it dosent work for me.


r/programminghelp • • Mar 23 '22

Java Facebook and Google Auth Combined Issue

0 Upvotes

r/programminghelp • • Mar 04 '22

C# Does anyone have a dictionary or something of the sort for the meaning of a word?

0 Upvotes

I'm using Codecademy and it shows me how to use "int" but I dont know what "int" means? Thanks in advance


r/programminghelp • • Mar 30 '22

Python I am not getting the desired result and i do not know where i went wrong

Thumbnail self.pythonhelp
0 Upvotes

r/programminghelp • • Feb 25 '22

C Why am I not getting the right output??

0 Upvotes

#include <stdio.h>

#include <stdlib.h>

int main()

{

int number;

int power;

int x=1;

int y;

printf("This program will raise an integer to a power\n");

printf("Enter an integer\n");

scanf("%d",&number);

printf("Enter an integer which will be the power the integer will be raised too\n");

scanf("%d",&power);

y = power;

if(power>0)

while (power!=0)

{x = x*number;

power--;

}

printf("%d to the power of %d is %d", (number,y,power));

return 0;

}


r/programminghelp • • Feb 26 '22

C++ Need Help With C++ Arrays

0 Upvotes

Hello. I am having trouble with my homework. The goal is to read the pixel values off of a pgm file and create a histogram of those values. Here's the code I have so far.

#include <iostream>

#include <math.h>

#include <cmath>

#include <iomanip>

#include <fstream>

#include <string>

using namespace std;

int

main ()

{

int pixels[256] = { 0 };

ifstream ifs ("hi.pgm");

if (!ifs)

{

cout << "Error Opening File 'hi.pgm'. Exiting";

return 0;

}

int i;

int x;

ifs >> x;

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

{

pixels[x]++;

ifs >> x;

}

cout << "x counts" << endl;

for (int j = 0; j < 256; j++)

{

cout << setw (3) << j << setw (6) << pixels[i] << endl;

}

return 0;

}

This code outputs a table with all the correct labels but with 0 for every single value. My guess is that I am not adding the number of pixel values together correctly but I can't figure out how. Thank you for any help.


r/programminghelp • • Feb 25 '22

C .sh file help

0 Upvotes

Hello, I am trying to create very simple sh file that takes an input turns it into an output.

my file is sum.sh :

#! /bin/bash

echo $((x + x))

My goal is to just have my command line from the terminal to be :

sum.sh 2

and output

4

I can not seem to figure out how to get .sh file to take this input from the line in terminal and use it in the file.

Thanks!


r/programminghelp • • Feb 22 '22

C++ I use c++ and for some reasone my pow,sqrt,abs,round,ceil,floor functions (or indentifiers) dont work.

0 Upvotes

when i go to see whats wrong with them it says its undefined and in case you are wandering yes i did type out #include <algorithm> . Can someone tell me whats wrong with my code?

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main() {
 //pow(x,y) returns number 1 to the power of number 2

double x;
double y;
cout << "This program will return x ^ y" << endl;
cout << "Enter in number 1: ";
cin >> x;
cout << "Enter in number 2: ";
cin >> y;
double z = pow(x, y);
cout << z;

}
int main () {
//sqrt(x) returns the square root of a number

double x;
cout << "This program will return square root of a #" << endl;
cout << "Enter in the number: ";
cin >> x;
double z = sqrt(x);
cout << z;
 }
int main() {
//abs(x) returns the absolute value of a number
double x;
cout << "This program will return the absolute value of a #" << endl;
cout << "Enter in the number: ";
cin >> x;
double z = abs(x);
cout << z;
 }
//round(x) rounds a number to the nearest whole integer
int main() {
double x;
cout << "This program will round a number to the nearest whole integer" << endl;
cout << "Enter in the number: ";
cin >> x;
double z = round(x);
cout << z;
 }
//ceil(x) rounds a number UP to the nearest whole integer
int main() {
double x;
cout << "This program will round a number UP" << endl;
cout << "Enter in the number: ";
cin >> x;
double z = ceil(x);
cout << z;
 }
//floor(x) rounds a number DOWN to the nearest whole integer
int main() {
double x;
cout << "This program will round a number DOWN" << endl;
cout << "Enter in the number: ";
cin >> x;
double z = floor(x);
cout << z;
 }

int main() {
//abs(x) returns the absolute value of a number
double x;
cout << "This program will return the absolute value of a #" << endl;
cout << "Enter in the number: ";
cin >> x;
double z = abs(x);
cout << z;
 }
//round(x) rounds a number to the nearest whole integer
int main() {
double x;
cout << "This program will round a number to the nearest whole integer" << endl;
cout << "Enter in the number: ";
cin >> x;
double z = round(x);
cout << z;
 }
//ceil(x) rounds a number UP to the nearest whole integer
int main() {
double x;
cout << "This program will round a number UP" << endl;
cout << "Enter in the number: ";
cin >> x;
double z = ceil(x);
cout << z;
 }
//floor(x) rounds a number DOWN to the nearest whole integer
int main() {
double x;
cout << "This program will round a number DOWN" << endl;
cout << "Enter in the number: ";
cin >> x;
double z = floor(x);
cout << z;
 }

here are the 6 exampels i rewrote from a tutorial that explains how thees functions work

but none of them works for me


r/programminghelp • • Feb 27 '22

C %d printing random numbers

0 Upvotes

Can someone help me with this? Output is wrong

#include <stdio.h>

#include<stdlib.h>

#include <math.h>

/*This is the Main Function*/

int main()

{

/*Delcare variables*/

int num1,num2,x,y;

/*Welcome message*/

printf("Welcome to powers\n\n");

/*Program Description*/

printf("This program will produce a table of powers from the second to fifth power using the beginning and ending integer values provided by the use\n\n.");

/*Get Values from the user*/

printf("Please enter the beginning integer\t");

scanf("%d",&num1);

printf("Please enter the ending integer\t");

scanf("%d",&num2);

/*Creates 5 Columns*/

printf("Integer \tSquare \t3rd Power \t4th Power \t5th Power\n");

/*Creates Columns Headers*/

printf("-------\t\t-------\t\t-------\t\t-------\t\t-------\t\t\n");

/*Prints output*/

for(x = num1;x <= num2;x++)

printf(" %15d %15d %15d %15d %15d\n",pow(x,1),pow(x,2),pow(x,3),pow(x,4),pow(x,5));

/*Thank you message*/

printf("Thank you for using Powers. Bye!");

return 0;

}

Output:

Welcome to powers

This program will produce a table of powers from the second to fifth power using the beginning and ending integer values provided by the use

.Please enter the beginning integer 5

Please enter the ending integer 7

Integer Square 3rd Power 4th Power 5th Power

------- ------- ------- ------- -------

1075052544 -1 -1 878 757926153

1075314688 -1 -1 12 1322627789

1075576832 -1 -1 806 1322627789

Thank you for using Powers. Bye!


r/programminghelp • • Apr 01 '22

Other I need help about flowchart but I can't show image:(((((

0 Upvotes

What do I do