Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I would like to know how to make for loops in Nim.
This is my code by far
int i = 1
# for loop expected here
Please help.
You can find this and other versions of for loops in the For statement section of the official Nim Tutorial:
echo "Counting to ten: "
for i in countup(1, 10):
echo i
# --> Outputs 1 2 3 4 5 6 7 8 9 10 on different lines
To find the tutorial, go to main site at https://nim-lang.org/, click on the learn tab, and finally on the Tutorial, part 1 link.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 days ago.
Improve this question
a = 5
b = 3
How to substitution without creating a new variable in python and JS Or other programming language.
The value of (a) should be replaced by (b), and the value of (b) by (a).
Tried but couldn't without creating a new variable.
you can use :
a , b = b , a
hope it was usefull theres other methos but this is the easiest
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
How do i generate a list of integers from 1 to 200 where it only prints the first 20 odd/even numbers?
Try This Code :
odd=[i for i in range(1,201,2)]
even=[i for i in range(2,201,2)]
print("Odd : ",odd[0:20]) # First 20 Odd numbers between 1 to 200
print("Even : ",even[0:20]) # First 20 Even numbers between 1 to 200
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I am trying to assign a particular process to a particular CPU core.
e.g $taskset -p 0x11 4106
I know from the example it is setting core 0 and 4 to "ON" and assigning it to PID 4106. Can someone help me understand the conversion from 0 and 4 to "0x11"
The formula is to raise 2 to the power of the number of each processor, then add them all up.
For 0 and 4 we compute 20 and 24, giving 1 and 16, respectively.
Their sum is 17, which in hexadecimal format is 0x11.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I'm a novice in linux and I'm doing a project on scheduling. I installed the LinSched
on my PC to see the behavior of "LinSched" and how it works? I followed the steps given in the link
Scheduler simulator linsched
but I could not make it work. Am I supposed to copy "Listing 4" from http://www.ibm.com/developerworks/library/l-linux-scheduler-simulator/
and write it in basic_test.c? Also I found difficulties in step 5 and step 6.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I'm probably doing this wrong.. it returns a #Value error...
=IF(AND(B2=0,W2<>0),1,0),IF(AND(B2>0,W2=0),1,0)
IF only allows 3 arguments and you can't just join them outside each other with a ,.
=IF(OR(AND(B2=0,W2<>0),AND(B2>0,W2=0)),1,0)
Or if you only want 1 or 0 as the outputs then:
=--OR(AND(B2=0,W2<>0),AND(B2>0,W2=0))
The -- will turn TRUE/FALSE to 1/0 respectively.
As per #Jeeped's comment.