[Solved] My program crashes and I don’t know why

I assume (It would be better if you post the crash log along with your question, so that we can help you better and stop assuming) you are getting a null pointer exception on the following code: i.putExtra(“temper”, temp.getText().toString()); In your code you declared temp, but it is never initialised. You need to initialise temp … Read more

[Solved] My Program is not printing what I want it to print

To match the symptoms reported I believe that your code is actually: import random name=input(“Welcome to this Arithmetic quiz,please enter your name:”) score = 0 for i in range(10): number1=random.randint(20,50) number2=random.randint(1,20) oper=random.choice(‘+-*’) correct_answer = eval(str(number1)+oper+str(number2)) answer = (int(input(‘What is:’+str(number1)+oper+str(number2)+’=’)) == correct_answer) if answer == correct_answer: print(‘Correct!’) score +=1 else: print(‘Incorrect!’) print(“You got”,score,”out of 10″) Note … Read more

[Solved] Get latest file directory wise in java

Find below a small snippet which does what you want to achieve. For demonstration purpose it also generates some example directories and files. import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Date; import java.util.Optional; import static java.util.concurrent.TimeUnit.MINUTES; public class FindRecentFileRecursively { public static void main(String[] args) throws IOException { // create some … Read more

[Solved] Why there are “null” in c#? [closed]

The problem why you sometimes get null is the concurrent access to your list with the operations Add and ElementAt. Since in your case ElementAt won’t have to enumerate the list it will just check internally if the list is null and in the case it isn’t it will return the element at the specified … Read more

[Solved] how to remove excess data in javascript array [closed]

Your selector is considering all the checkboxes on the page which are checked so the extra values are of some other checkboxes, instead use .map on input:checkbox:checked[name=”lecture”] $(‘#separate_course_list’).on(“change”, “:checkbox”, function () { var values = $(‘input:checkbox:checked[name=”lecture”]’).map(function () { return this.value; }).get(); // [“1”, “2”, “4”] $(“input[name=”comment”]”).val(values); //this input saves array }); 4 solved how to … Read more

[Solved] Please explain the output of this program based on pointers and strings?

Explanation line by line: Striker=Track; Sets Striker to point to the memory of Track, so Striker[0] would be equals to Track[0]. Track[1]+=30; Increases the value of the second index of Track by 30 (Track[1] = 50). cout<<“Striker >”<<*Striker<<endl; *Striker is the same as Striker[0], *Stirker+1 is the same as Striker[1] and so on. The output … Read more

[Solved] find numbers at string line c++

As mentioned in @Jhonny Mopp’s comment the primary problem is, that you don’t read a whole line here: cin>>line; it just reads up to the next whitespace delimiter. What you actually want is: getline(cin, line); This would read in the whole input until you hit Enter. Regarding the rest of processing refer to that Q&A … Read more

[Solved] Need help to add a link to this javascript [closed]

Your question is completely unclear but assuming your situation, you might be wanting something similar to this. You said they are already showing up in your page and you want them to appear as links var users = [ ‘<a href=”#2016″>2016</a>’, ‘<a href=”#2015″>2015</a>’, ‘<a href=”#2014″>2014</a>’, ‘<a href=”#”>#</a>’, ‘#’, ‘#’, ‘#’, ‘#’ ]; 1 solved Need … Read more