Posts by Woody Costa • 192 points
10 posts
-
3
votes3
answers141
viewsA: Shouldn’t Python none be semantically equal to SQL Null?
Language defines like this, see: The None keyword is used to define a null variable or an object. In Python, the keyword None is an object and is a data type of the Nonetype class. We can assign…
-
1
votes1
answer54
viewsA: Doubt how to reverse values in a statistic list in C
In this case you don’t even need to check if the list is full, just invert the items according to the code below. int SList_reverse(SList* lista, int dado){ int i; int aux; for(i=0; i<…
-
0
votes1
answer45
viewsA: sequence of letters and points in c
The best way for you to implement this is: 1 - Get the string with the dots (your code is already wrong because it puts on a char where only one fits '.'); 2 - printf("Letter: %c",…
canswered Woody Costa 192 -
1
votes1
answer36
viewsA: displacement of all values of the elements to the next position, last value must be in the first position
What you want is to do a right shift on the vector. The code to do this is this, n being the number of elemtos of the vector: temp=a[n-1]; for(i=n-1;i>0;i--) { a[i]=a[i-1]; } a[0]=temp;…
canswered Woody Costa 192 -
4
votes3
answers174
viewsA: Python - Sine cycle in degrees
I’m not sure what you want with this code, since it doesn’t show the calculated value of the sine. Anyway, just change the print position so that the range of a is shown correctly: print('Ciclo seno…
-
-1
votes1
answer245
viewsA: Can anyone explain to me the working logic of this pattern
The question is in the expr Begin: Begin expr (... ...) The expressions in your example, in case the numbers (1, 2, 3 and 4) are evaluated sequentially from left to right, and in case the result is…
-
0
votes2
answers58
viewsA: Insert values into an array with dimensions defined from a loop
The problem is that you are recreating the array every iteration within the loop: X = np.zeros((2, 2)) That stretch needs to be before the while.
-
1
votes1
answer77
viewsA: BINGO game in C , Using matrix with 3 dimensions?
There is no other way but to dynamically allocate space to n cards you may have. As the number of players and the size of the card are variable, you will allocate this space using malloc and then…
-
0
votes3
answers75
viewsA: Shellscript does not run cd, calling sh via php
Try changing to: $return = shell_exec('. /usr/local/bin/api/test.sh'); This forces you to execute the command within your current process.
-
1
votes1
answer44
viewsA: How to detect "0X0D" car return in a TCP client program?
You can use the Split method to split the string with multiple lines and print one at a time. It would be something like: foreach (var line in e.UserState.ToString().Split('\n')) {…
c#answered Woody Costa 192