|
Hi,
I am a beginner to create Facebook application. Will appreciate if someone can explain how to get and use offline access session key?
regards,
rnv
|
|
|
|
|
Have you checked out the Facebook developers community[^]?
"If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair
|
|
|
|
|
Hi. I've recently had to do this as well. I used the following:
browserFacebook.Navigate(@"http://www.facebook.com/login.php?api_key=" + FacebookAPIKey + @"&connect_display=popup&v=1.0&
next=http://www.facebook.com/connect/login_success.html&cancel_url=http://www.facebook.com/connect/login_failure.html&
fbconnect=true&return_session=true&session_key_only=true&req_perms=read_stream,publish_stream,offline_access");
You can intercept this URL once its done loading (string s = browserFacebook.Url.ToString() ) which will show you the session key thats been returned
|
|
|
|
|
hi guys ,
i have an image that after deskewing it , a black slopped line appear at the end of the image , it is always black in color .
i need to remove that line from the image how can i do that i searched the internet and i found an image processing library called aforge , but i actually don't know how to use i to detect that line and then remove it successfully.
Any help will be greatly appreciated....
Thanks in advance..Human knowledge belongs to the world.
|
|
|
|
|
Instead of trying to remove the line, I'd try to find out why it's there to begin with. There might be an issue with your code..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
a
modified 23-Nov-14 6:36am.
|
|
|
|
|
GhostDoc? Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:36am.
|
|
|
|
|
stancrm wrote: Sancastle is only for 2.0.
No it's not. There's a common misconception that .NET 3.5 won't be able to run .NET 2 things and that's just plain wrong. .NET 3.5 is built as a set of extensions to .NET 2, so things that run on .NET 2 will run on .NET 3.5. Trust me, I document my projects with Sandcastle.
stancrm wrote: GhostDoc is payware.
Did you even bother reading the announcement on the page I linked you to? Here's the free download[^]."WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Good call: I use both and they work fine and are free.Tychotics
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
I recently started using Doxygen (http://www.stack.nl/~dimitri/doxygen/index.html[^]) and have been very impressed with its capabilities. Once you set up a configuration file, you can easily (and quickly) generate documentation with the click of a button. And you can't beat the price. -NP
Never underestimate the creativity of the end-user.
|
|
|
|
|
i am currently working with ptz cameras. i want to send the ptz commands thorugh http. can anybody help me?
or some good reference which could help me ?
|
|
|
|
|
I suppose you want to send http requests to those cams and receive whatever response the cams send back. In this case you might take a look at the System.Net.WebClient class in the MSDN. With this class you can send HttpRequests and receive the responses. Good Luck. A while ago he asked me what he should have printed on my business cards. I said 'Wizard'.
I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.
|
|
|
|
|
Hi everyone.
This is a trivial question, but I can't find the answer anywhere (even though it's been asked before in these forums, but it wasn't solved in a way that satisfies me): is it possible to catch several hierarchically unrelated exceptions in the same catch block? By hierarchically unrelated I mean one isn't a subclass of the other, etc.
Basically, I'd like to do this:
try {
} catch (ExceptionType1, ExceptionType2) {
}
Is it possible, or do I need to do it as follows?
try {
} catch (ExceptionType1) {
handleMyException();
} catch (ExceptionType2) {
handleMyException();
}
public void handleMyException() {
}
I know Java allows the first format (ExceptionType1, ExceptionType2 ), but C# doesn't seem to like it. However, having to create a method each time this happens doesn't seem to promote code-cleanliness.
So... is it possible to do it as in Java?
Thanks!modified on Wednesday, March 10, 2010 6:10 AM
|
|
|
|
|
You have to use the 2nd method you posted..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
|
You need to do the second. I'm actually surprised Java has the first syntax, though it does make sense if you don't access the Exception object, so I suspect the Java syntax is really [good] syntactic sugar. If you do need to access the Exception object (as in my snippet) and the first syntax is used the compiler would have hellish time as it wouldn't be able to work out the Exception object type etc...
try
{
}
catch (NullReferenceException ex)
{
Console.WriteLine(ex.Source);
}
catch (ArgumentException ex)
{
Console.WriteLine(ex.ParamName);
}
is OK, but
try
{
}
catch (NullReferenceException ex, ArgumentException ex)
{
Console.WriteLine(ex.ParamName);
}
Hope this helps!Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
|
You could do this:
private static void Main(string[] args)
{
Exception ex = null;
try
{
throw new InvalidOperationException("oops");
}
catch (InvalidOperationException myEx)
{
ex = myEx;
goto Something;
}
catch (InvalidTimeZoneException myEx)
{
ex = myEx;
goto Something;
}
catch (Exception myEx)
{
Console.WriteLine("Exception: " + myEx.ToString());
}
return;
Something:
Console.WriteLine(ex.ToString());
return;
}
That would allow your catch-all code to have access to local variables and would give it the ability to return (perhaps conditionally), which a method you call cannot do. And, yes, you can have labels in C#. Or, you could do this:
private static void Main(string[] args)
{
try
{
throw new InvalidOperationException("oops");
}
catch (Exception ex)
{
switch (ex.GetType().ToString())
{
case "System.InvalidOperationException":
goto case "System.InvalidTimeZoneException";
case "System.InvalidTimeZoneException":
Console.WriteLine(ex.ToString());
return;
case "System.Exception":
Console.WriteLine("Exception: " + ex.ToString());
break;
default:
Console.WriteLine("Hmmm.");
break;
}
}
}
I don't think either are pretty and I don't recommend either. I'd say just call a common method.
|
|
|
|
|
Thanks for your answers.
As you say, they're not pretty (but I appreciate them! ), so I'll stick with the method.
In particular:
1) Like many other people, I don't really like using labels and gotos in a high-level language.
2) GetType() is computationally expensive (not extremely so, but you know, reflection). Plus, I don't think you need a goto in this case. Couldn't you just do this?
private static void Main(string[] args)
{
try
{
throw new InvalidOperationException("oops");
}
catch (Exception ex)
{
switch (ex.GetType().ToString())
{
case "System.InvalidOperationException":
case "System.InvalidTimeZoneException":
Console.WriteLine(ex.ToString());
return;
case "System.Exception":
Console.WriteLine("Exception: " + ex.ToString());
break;
default:
Console.WriteLine("Hmmm.");
break;
}
}
}
Anyway, as suggested, I'll just use a method.
Thanks!
|
|
|
|
|
blackblizzard wrote: Couldn't you just do this?
Hmm, I thought C# complained when you let it fall through like that, but it seems the compiler only complains when you have something under the first case above and no "break". That is, it expects that all the logic be placed on the bottom-most of the cases you fall through. Good to know... thanks!
blackblizzard wrote: GetType() is computationally expensive
Not sure if that's true. I know Reflection.Emit and dynamically building types and things of that sort are expensive, but I'm not sure GetType is all that expensive, as it is pretty much known at compile time. As far as derived classes, that shouldn't be any more expensive than other inherited method call. Depends on how .NET implements GetType under the hood, but I tend to think it would use the faster technique. The string comparison done during the switch statement could slow things down marginally, but when you are dealing with exception cases, you typically don't need to worry about speed (assuming you are not using exceptions to control the typical flow of your program).
blackblizzard wrote: I'll just use a method.
Good choice.
|
|
|
|
|
aspdotnetdev wrote: Hmm, I thought C# complained when you let it fall through like that, but it seems the compiler only complains when you have something under the first case above and no "break". That is, it expects that all the logic be placed on the bottom-most of the cases you fall through. Good to know... thanks!
Sure!
aspdotnetdev wrote: Not sure if that's true. I know Reflection.Emit and dynamically building types and things of that sort are expensive, but I'm not sure GetType is all that expensive, as it is pretty much known at compile time. As far as derived classes, that shouldn't be any more expensive than other inherited method call. Depends on how .NET implements GetType under the hood, but I tend to think it would use the faster technique. The string comparison done during the switch statement could slow things down marginally, but when you are dealing with exception cases, you typically don't need to worry about speed (assuming you are not using exceptions to control the typical flow of your program).
I read somewhere in the msdn site that although GetType and typeof are considerably less expensive than all other reflection methods they don't come particularly cheap (I'd post a link, but I haven't been able to find my reference). Although you're right that this is a case where an exception has been thrown, so we're not really concerned about performance.
|
|
|
|
|
Check out this page. It seems you can do on the order of 10 to 100 million GetType()'s a second. I suppose whether or not that is "cheap" is subjective.
|
|
|
|
|
Great to know, thanks
|
|
|
|