|
This is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself.
Let me just explain what the error means: You have tried to use a variable, property, or a method return value but it contains null - which means that there is no instance of a class in the variable.
It's a bit like a pocket: you have a pocket in your shirt, which you use to hold a pen. If you reach into the pocket and find there isn't a pen there, you can't sign your name on a piece of paper - and you will get very funny looks if you try! The empty pocket is giving you a null value (no pen here!) so you can't do anything that you would normally do once you retrieved your pen. Why is it empty? That's the question - it may be that you forgot to pick up your pen when you left the house this morning, or possibly you left the pen in the pocket of yesterdays shirt when you took it off last night.
We can't tell, because we weren't there, and even more importantly, we can't even see your shirt, much less what is in the pocket!
Back to computers, and you have done the same thing, somehow - and we can't see your code, much less run it and find out what contains null when it shouldn't.
But you can - and Visual Studio will help you here. Run your program in the debugger and when it fails, VS will show you the line it found the problem on. You can then start looking at the various parts of it to see what value is null and start looking back through your code to find out why. So put a breakpoint at the beginning of the method containing the error line, and run your program from the start again. This time, VS will stop before the error, and let you examine what is going on by stepping through the code looking at your values.
But we can't do that - we don't have your code, we don't know how to use it if we did have it, we don't have your data. So try it - and see how much information you can find out!
At a guess, your authentication is failing - but we can't test that!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Make sure you're using the latest version of the Tweetinvi library - currently 4.0.3.
If you still get the exception, report it to the developers:
Issues · linvi/tweetinvi · GitHub[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yes, it worked I installed the latest version, and its working. Thank you so much for your help.
|
|
|
|
|
I want to write a program in C # that I can connect to Instagram and extract my follower and following information from it.
Can you help?
|
|
|
|
|
And?
What have you tried?
Where are you stuck?
What help do you need?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
i dont have any idea for this, how can i do this , i wanna do it with C# ,is there any libraries???
or any kind of example code??
|
|
|
|
|
As Richard suggested, you should probably start here: Instagram Developer Documentation[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
But that means actually doing some work. 
|
|
|
|
|
Sad, but true ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Another extension bites the dust ...
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
|
wtf is hapening ?
for(float i=-5.0f ; i<5.0f ; i+=0.1f)
Console.WriteLine(i+"\n");
// with while
float r=-5.0f;
while (r < 5.0f)
{
Console.WriteLine(r+"\n");;
r += 0.1f;
}
//output at -4.5
//-4,9
//-4,8
//-4,7
//-4,6
//-4,5
//-4,400001 <--- this is bullshit makes me angry 
|
|
|
|
|
|
It's floating point data: it's stored in binary, not decimal, and 0.1 decimal is not a "precise" value in floating point format: 15. Floating Point Arithmetic: Issues and Limitations[^]
If you format your output to two decimal places, it'll always look the same:
for (float i = -5.0f; i < 5.0f; i += 0.1f)
{
Console.WriteLine($"{i:0.00}");
}
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
modified 13-Sep-20 10:19am.
|
|
|
|
|
Isawyouoo wrote: 0.1f The bullshit is right here. There is no float with the exact value of 0.1, so the nice-looking results are at best misleading.
|
|
|
|
|
so what is the best way to make the loop generate those numbers correctly? just by i.ToString("0.00")
|
|
|
|
|
That doesn't affect the actual number, just the string representation of it.
Read the links Richard and I gave you.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Depends on what you want with them. If just printing them with fewer decimals is good enough, great. Or maybe it's an occasional for decimal floating point (in C# with the handy decimal type, though a bit slow), or decimal fixed point (store eg -49 instead of -4.9, and handle the details of the arithmetic manually).
|
|
|
|
|
Did you even stop to think about the problem before you lost your mind?
How many floating point numbers are there in any range of values? Infinite.
How do you represent an infinite number of values in a finite number of bits? You don't, but to get the largest usable range possible, you have to make sacrifices and put up with limits on precision.
...and you just ran into one of those limits.
Seriously, read those links and your expand your understanding instead of getting pissed over something you don't understand.
|
|
|
|
|
thank god you people, I've lost my mind one moment, I was gonna throw my laptop from the window 
|
|
|
|
|
I need to determine whether each character in the first string can be uniquely replaced by a character in the second string so that the two strings are equal.
Like this:
for "eef" and "ddg"
Result :
True e => d
f =>g
If I have: "efe" and "ddg" the result is "False" because "e" it has "d" and "g". (strings are equal in length)
I need help with the starting point, I made an array to store the characters from input strings and I was thinking to use IndexOf method after that, to return the indexof each character and compare it with the second string. I'm not sure how to implement this.
modified 13-Sep-20 10:21am.
|
|
|
|
|
And?
What does it do that you didn't expect, or not do that you did?
What have you tried to do to find out why?
Are there any error messages, and if so, where and when? What did you do to make them happen?
What help do you need?
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I need help with the starting point, I made an array to store the characters from input strings and I was thinking to use IndexOf method after that, to return the indexof each character and compare it with the second string. I'm not sure how to implement this.
|
|
|
|
|
Think about how you would do it manually, with a pencil and paper.
When you have that down pat, the code should be pretty easy.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Make an array with a position for each character code, each element a character and a bool, initialized to nul and true. Scan the two input strings S1 and S2 in parallel. Use the S1 char as index in your new array. If its char is still nul, change it to the S2 char. If it is something else, but different from the S2 char, set the bool to false. After reaching the end of S1/S2, if there are any entry in you new array with the bool set to false, the result is false.
I am sure that your professor will accept this solution method for your homework.
|
|
|
|