Unexpected return value from string

I am trying to get just the phone number out of the string passed into getPhoneNumber(char[] str), but for some reason, i get some random character appended to it each time i run the code, please i need help. source code #include <stdio.h> #i...
more »

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

Function doesn't return right values

I am stuck on this problem for hours now. I have written a Python code to read and convert data from a text file and everything is running fine. simulink_robot_motor1=[] with open('C:\\Users\...\sensor_data.txt',"r") as data_file: rows=0 fo...
more »

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

Aggregate character/string variables

I've got a data frame which has a list of Person Reference and then a Trade, each person reference can have multiple trades. I want to aggregate so that it shows the data as below: Record Person Ref Trade Code 1 512 elec, plumbing...
more »

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

Using an array for functions in javascript

I'm trying to create a program that uses an array of functions to cycle through the order of execution. I've included the program below, can somebody please suggest what i have done wrong.I have created a set of traffic lights on HTML and im trying t...
more »

2017-04-18 15:04 (4) Answers

not able to add a break in the alert box

I have created this form sort of thing without using "form" tag i need to add a break in my alert box between Hello ____ Your email address is: .Is it possible to do that? I have tried br tag and \n but nothing seems to work <head> &l...
more »

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

Accessing a R user defined function in Python

So I need to do Principle Component Regression with cross validation and I could not find a package in Python that would do so. I wrote my own PCR class but when tested against R's pls package it performs significantly worse and is much slower on hig...
more »

2017-04-17 17:04 (1) Answers

Simple function giving unexpected result

So I'm making a simple program to find the largest common divider (lcd) between two numbers, using the Euclidean Algorithm (http://www.math.jacobs-university.de/timorin/PM/continued_fractions.pdf, on the second page) it's very simple. So here's the f...
more »

2017-04-17 17:04 (1) Answers

Function pointing to a struct in c

I'm analyzing a bit of code and can't quite seem to grasp some of the workings behind it. struct dplist { dplist_node_t * head; }; struct dplist_node { dplist_node_t * prev, * next; element_t element; }; dplist_t * dpl_create () { dplist_t...
more »

2017-04-17 16:04 (2) Answers

Recursive function keeps turning infinitely python

I am trying to write some code to solve this math problem: there is 8 teams and all of them will play football game each other (so total of 7+6+...+1 = 28 matches) and they have just two chance of result: win or lose. There are how many combunation o...
more »

2017-04-17 15:04 (1) Answers

sub functions vs event, what is the difference?

I went through events in Vb.net and i found they are really an amazing feature..but still confused about how to use them effectively. The real doubt is that the functions and sub could be effective alternative for events. Whatever i do with events i...
more »

2017-04-17 15:04 (2) Answers

What's wrong w/ MySql Statement (Function)

I'm using MySql57 What's wrong with this script?(I'm Mysql newbie) Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= 'A0001'; ELSE BEGI...
more »

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

validate input from the function in c

i want the input and validation features for “top_speed” and “horsepower” in this fuction: double get_positive_value() , but i am not getting it resolved.Additionally, the top speed or horsepower of the car must not be less than or equal to ...
more »

2017-04-17 06:04 (0) Answers

variable within functions-Linux Shell Script

i am facing an issue with this simple code , where i call a function , but the variable $X of that function doesnt seem to pass outside, since the printout message is always "Your interface is ." ... Am i missing something? #! /bin/bash function ch...
more »

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