Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
my code
I'm trying to make a program to generate amicable numbers under 10000, but after i pressed ctrl+f9, it exited with exit code 201. How do i fix that?
Probably in the expression a[a[i]], a[i] contains an invalid index, which leads to the range check error as Ken said.
For starters, you initialize cells with 0, but you don't initialize a[0]
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I have looked through stackoverflow trying to figure this out, since I see alot of questions titled the same as mine. But I get this parse error in a Haskell file which worked perfectly the last time I opened it. I get this error-message
One defines a signature for a function by writing the name of the function, then two consecutive colons (::), and then the signature. You forgot the double colon, you thus write the signature of your concat function with:
-- ↓↓ double colon
concat :: [[a]] -> [a]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 5 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Improve this question
My code is apparently not working, can you help? Its for school project.
x=msgbox("Hello. Make sure you dispose of this computer properly. You can donate to a local school, retirement home, charitable organization, or a community center. You can recycle it or resell it. Let's protect our enviornment one piece of tech at a time. Our tech. Our future. Our job.",1,"Proper Care")
If vbCancel then
CreateObject("WScript.Shell").Run("http://bestanimations.com/Military/Explosions/earth-explosion-animated-gif-2.gif")
If vbOK then
CreateObject("WScript.Shell").Run("https://www.cta.tech/Consumer-Resources/Greener-Gadgets/Recycle-Electronics.aspx")
x=msgbox("If you don't, we might have a horrible future.",16,"Help the environment")
End If
If x=vbCancel then CreateObject("WScript.Shell").Run("http://bestanimations.com/Military/Explosions/earth-explosion-animated-gif-2.gif")
If x=vbOK then
CreateObject("WScript.Shell").Run("https://www.cta.tech/Consumer-Resources/Greener-Gadgets/Recycle-Electronics.aspx")
x=msgbox("If you don't, we might have a horrible future.",16,"Help the environment")
End If
You have two If statements, but only one End If statement. I'm guessing you may want your second If to actually be an ElseIf.
Also, saying If vbCancel doesn't do what you think it does. If you're trying to test the value of x, then you need to be testing the value of x.
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 7 years ago.
Improve this question
Im pretty new to Android but I have worked with Java before.
I dont understand why my algorithm doesn't work. The result I get is 0.0%.
txtInfo.setText(Double.toString((RadioProgress/255)*100)+"%");
txtInfo is a TextView.
I can see in my graphic that my RadioProgress gets the right value. But still I get 0.0% all the time.
Please help me understand :)
Thanks in advance!
If RadioProgress is of integer type and less than 255 then division will always return 0. Cast it to double and you will see values.
Another way would be to divide by 255.0 to enforce conversion
txtInfo.setText(Double.toString((RadioProgress/255.0)*100)+"%");
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have a number that comes from an external API but it has two extra zeros at the end. What would be a solution to remove the two zeros. I have tried the chomp method and that doesn't work. The number I receive from the API is a Bignum. I am using Ruby 2.
This is a sample input from the API is 1374577200000
This is a sample output I want is 13745772000
If the number is an integer, you can use integer division:
> 123456 / 100
=> 1234
You can't chomp a Fixnum or Bignum, so you'd have to convert it back and forth:
number = 123400
number.to_s[0..-3].to_i
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have a piece of code that says:
for i = 4,16, . . . , n
I am trying to find an upper bound in terms of big oh notation for the number of times the statement gets executed. I believe here it goes like 4,42,43 ... and so on. Since it grows exponentially, it looks like to me that that code is executed about O(logn) times. Am i right? Thanks in advance.
You can confirm your result by thinking in terms of a loop whose index variable is used as the exponent, taking the values 1, 2, 3, ... , floor(log_4(n))