Python objects aren't accepting arguments

I am trying to create a snake in python, I am doing this through an object that will be a snake. I am trying to call a createSnake function from inside my object but the arguments aren't being accepted. My IDE is returning: TypeError: createsnake()...
more »

2017-06-21 21:06 (2) Answers

How am getting this output ? Javascript ES6

Please find my snippet here, for (var i=0;i<11;i++) { setTimeout( () => console.log(i), 10); } How it print 11 for 11 times? since i was set < 11? if i console it without function it print 1-10 . for (var i=0;i<11;i++) {...
more »

2017-06-21 20:06 (2) Answers

Python: Unable to call function when in while loop

Just starting out here soz. I've been trying to make a menu with several options (def logged():) by entering a number and it would jump to that function with a purpose. However, I cannot seem to call the designated functions with the if statements pu...
more »

2017-06-21 14:06 (2) Answers

Python defining function outputs only first dir

when i def a function and try to use os.walk in it , the output is just the first file in the directory , i want to print out all there is in the C Drive. #os.chdir=("..") def dirslist(): for root, dirs, files in os.walk("c://", topdown=False): f...
more »

2017-06-20 21:06 (4) Answers

Proper way to evaluate code

So I'm building a small app where you can evaluate some pieces of JavaScript code, but I'm having a huge "moral" problem: Initially I wanted to use eval, but I found out about its dangers, so I quickly looked for an alternative. The closest thing I...
more »

2017-06-20 19:06 (1) Answers

Using dplyr group_by in a function

I am trying to use dplyr's group_by in a local function, example: testFunction <- function(df, x) { df %>% group_by(x) %>% summarize(mean.Petal.Width = mean(Petal.Width)) } testFunction(iris, Species) and I get an error "... unknown va...
more »

2017-06-20 19:06 (2) Answers

Azure function apps logs not showing

I'm relatively new to Azure and I just went through the tutorial on how to create a new Azure function, which is triggered when a new blob is created, and had this as the default code in it. public static void Run(Stream myBlob, string name, TraceWr...
more »

2017-06-20 17:06 (1) Answers

Risks of adding uint to enum in function call

I have a function that returns a float number: float function(enum value) I then have an enum typedef enum { a = 0, b, c } myenum; I want to do the following: function(a+1); And I wonder if there are any risks other than the risk...
more »

2017-06-20 15:06 (2) Answers

js function not returning onclick

I've created a function that I can't get to return with onclick. I'm sure it's something v simple i'm missing. HTML: <html> <head> <script type="text/javascript" src=""></script> <s...
more »

2017-06-19 23:06 (2) Answers

Why malloc can't work with strcpy?

char * removeChar(char * str, char c){ int len = strlen(str); int i = 0; int j = 0; char * copy = malloc(sizeof(char) * (len + 1)); while(i < len){ if(str[i] != c){ copy[j] = str[i]; j++; ...
more »

2017-06-19 17:06 (4) Answers

Calculation between two tables in SQL

I have two tables A and B: Table A Txn_amt2 rrn Pan Stan Msg_type 22000 7123344 556677 442233 0200 22000 7123344 556677 442233 0200 22000 7123344 556677 442233 0200 22000 7123344 556677 442233 0200 35200...
more »

2017-06-19 00:06 (1) Answers