Show error in the case. C++

How can I show an error to the client of my code in the case? Here is the function which will be used by someone: double firstTaskSum(int n, double x) { if(n < 0) { cout << ("n is invalid! n : " + std::to_string(n) + ". And...
more »

2017-09-09 14:09 (2) Answers

Suppress Messages from zip in R

I want to suppress the messages as outputted by the zip command in r but I fail to find the right command to do so. Background, as I use the zip-function within a function, I don't want the user to see all information about all the files (roughly 5....
more »

2017-08-20 12:08 (1) Answers

Haskell Password Program

I am very new to Haskell and I am attempting to make a simple password program as my first program. I have ran into a problem and I am not very sure on how to fix it. I do not know how to make a second section for the passwords. main = do putStrL...
more »

2017-08-04 01:08 (1) Answers

Add Multiple URLs to this PowerShell Script?

I am using a script to call URLs, get the output, and save the output to a text file. It all works great. However, when I need to call multiple URLs in succession it causes CPU spikes because it is starting/stopping powershell.exe so many times. Is t...
more »

2017-07-05 12:07 (1) Answers

Variable as parameter for if()

I'm fairly new to coding and had a question regarding the output of a program I've recently encountered. Here's the code: #include <stdio.h> int main(void) { unsigned char x = 16; x = x * 16; if (x) { printf("True.\n"); ...
more »

2017-05-16 03:05 (2) Answers

Calculate interest without math library

I'm trying to calculate rent without math.h and pow, somehow i almost got it right, but it's not calculating the right amount and i am not sure where the issue could be, any advice on what i am missing? #include <stdio.h> double calcFutureVal...
more »

2017-04-26 18:04 (2) Answers

Bubble sort output is not sorted

My code works when put in the int main() function but when I implement it as another function (void bubbleSort) the output displays it as if there was no sorting done. void bubbleSort(int numeros[]) { int store = 0; int length = ARRAY_SIZE(numeros);...
more »

2017-04-22 05:04 (1) Answers

c++ read from a file and output sorted content

I am learning to code and found interesting task, but i do not know where to start in solving it. So i have a file with some titles and comments which need to be placed under the right title. So the first line of the input contains a number N which d...
more »

2017-04-18 16:04 (1) Answers

2d array output values incorrect

I have this code and have no idea why my output is incorrect. I'm used to C++ not C. Run using: ./sudoku.o < inputfile int row = 8; int col = 8; int puzzle[row][col]; for (int r = 0; r < row; r++){ for (int c = 0; c < col; c++){ ...
more »

2017-04-13 06:04 (1) Answers

Having trouble printing to same line

I'm trying to write a code where you enter an integer in the console, and then the integer you entered is shown bigger, made up of letters (like ascii art). So let's say the input is 112. Then the output will be # # ##### ## #...
more »

2017-04-12 11:04 (4) Answers

Invoke-RestMethod OutFile Empty When PassThru Used

Using PowerShell 4.0 and Invoke-RestMethod cmdlet. I'm having trouble with the -OutFile and -PassThru options. Whenever I add the -PassThru option, my -OutFile is created but the contents are Empty! According to the Invoke-RestMethod Documentation, ...
more »

2017-03-24 22:03 (0) Answers

Passing function to innerHTML method

Hi guys very new to JS and i've been working on this simple thing for too long trying to understand JS basics. Please help me out; I have an empty H1 element that I want to fill with content using JavaScript. I want the H1 header to contain a name ...
more »

2017-03-08 13:03 (5) Answers

AudioPluginSource testbench error: output size

I am new to the audio plugin toolbox and I try to learn how to use it. I would appreciate any help and hints I can get about my problem: I keep getting errors at the point of validation of the plugin. I set: out = plugin.matrix to get the matri...
more »

2017-02-27 18:02 (0) Answers

Laravel generate image and add content type header

Hi I'm using php's gd library to generate images. I've decided to integrate this into laravel, and I managed to make it work. My problem is that if laravel sometimes overwrites my content-type header. This is my controller: public function imga($a...
more »

2017-02-23 17:02 (2) Answers

Need help fixing my e^x approximation c program

I have written a c program that should compute and print the approximation of e^x for all values up to n. I am using this equation to implement my program. f(x, n) = e^x = the sum of i=0 up to n= x^i/x! = x^0/0! + x^1/1! + x^2/2! +....+ x^n/n! ...
more »

2017-02-20 17:02 (2) Answers