hey
i have iphone application that using facebook connect.
users login to the iphone application using facebook connect.
and then i receive their sessionKey back to my server, and i am using the sesssionkey to post actions to users wall.
the iphone application keeps the user logged in allways.
which means that every times the user will open the application, he will not need to make login again.
the problem is that, when the user change his facebook password
the user sessionKey also changes.
and when the user enter to my iphone applicaiton,
the user is shown as loggedin, and then i recieve to my server
the user old sessionkey, and when i try to post to the user wall
facebook tells me that the session is inavlid.
it is ok because the user change his password and the session changes too.
my question is
how can i check in the iphone if the session key has changed ?
and if it changes to promote the user to make login again.
Via SWFobject and AJAX I put in a video to a certain .
Using jquery I tried this:
$('#youtubepreview').html('');
HOwever that didn't remove it at all - the video still stayed right there.
Any ideas?
I am using Facebook Python's SDK along with Google App Engine, and making a call to do a checkin:
graph.put_object("me", "checkins", message="Hello, world", place="165039136840558", coordinates='{"latitude":"38.2454064", "longitude":"-122.0434404"}')
However, this throws an error 400 Bad Request and I don't seem to be able to try catch it so I can have the important information.
On a bad request, Facebook should return, an object like below which can help troubleshoot and address the issue, but I am not sure how I can retrieve this object:
{
"error": {
"type" : "OAuthException",
"message" : "An active access token must be used to query information about the current user."
}
}
i am very new to Google maps i want calculate the distance between two places in android .for that i get the two places lat and lag positions for that i write the following code:
private double getDistance(double lat1, double lat2, double lon1, double lon2) {
double dLat = Math.toRadians(lat2 - lat1);
double dLon = Math.toRadians(lon2 - lon1);
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2)
+ Math.cos(Math.toRadians(lat1))
* Math.cos(Math.toRadians(lat2)) * Math.sin(dLon / 2)
* Math.sin(dLon / 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
double temp = 6371 * c;
temp=temp*0.621;
return temp;
}
the above code cant give the accurate distance between two places .what is the another way to find distance please give me any suggestions thanks in advance....
I am new to jQuery. I've done some simple things with it but what I am attempting now is a over my head and I need some help. I am building a locator for all the firearms dealers in the US for a client. I am working within Drupal. I have a proximity search by zip code that works great. If you search by zip a list of paginated results shows up in an html table that can by paged through via ajax. I would like a map to be above this list with markers corresponding to the names and addresses being listed. I already have all the lat and long values in the table results. I want the script to update the markers and automatically zoom to fit the markers in the view when a user changes the sort order of the table or pages through the results. Also, I'd like to have a hover highlight effect over the rows of the table that simultaneously highlight the corresponding marker, and have a click on the table row equal a click on a marker that pops up a marker info window to be populated using jQuery to read the name and address fields of the table. Hope this all makes sense. I know I'm putting a lot out there, I'm not asking for someone to write the whole script, just wanted to give as many details as possible. Thanks for any help. I'm just lost when it comes to looping and moving data around. If you want to check out what I have so far on the project please visit: www.axtsweapons.com and login with the username: "test" and the password: "1234" and then visit this direct link: www.axtsweapons.com/ffllocator. For just a simple page that would be easy to manipulate and play with goto: http://www.axtsweapons.com/maptest.html Thanks!
There are a number of free finance tracking sites out there like mint.com, wesabe.com etc.. .
I've tried all of them and all seem to miss the mark in one way or another. I'm interested in creating my own website, or possibly just a stand alone windows program for tracking my finances in ASP.NET or C#.NET.
I'm assuming the answer is no, but is there any way that a personal developer can download transactions from financial websites like these? I know once you login to most financial sites you can download a CSV or Quicken file. Yet I really like how I can log-in to my Mint.com account and update all my accounts with one click.
So, issue is with the thing Delphi progies scare to death - Rich Edit in Windows ( XP and pre-XP versions ).
Situation:
I have added EM_AUTOURLDETECTION in OnCreate of form. Target - RichEdit1. Then, I have form, that is "collapsed" after showing form. RichEdit Control is sattic, visible and enabled, but it is "hidden" because form window is collapsed.
I can expand and collapse form, using Button1 and changing forms Constraints and Size properties.
After first time I expand form, the URL inside RichEdit1 control is highlighted.
BUT -
After second, third, fourth, etc... time I Collapse and Expand form, the RichEdit1 Control does not highlight URL anymore.
I have tried EM_SETTEXTMODE messages, also WM_UPDATEUISTATE, also basic WM_TEXT message - no luck. It sems like this merssage really works ( enables detection ) while sending keyboard strokes ( virtual keycodes ), but not when text has been modified.
Also - I am thinking to rewrite code to make RichEdit Control dynamic. Would this fix the problem?
Maybe solution is to override OnPaint / OnDraw method to avoid highlight ( formatting ) losing when collapsing or expanding form?
Weird is that my Embarcadero Documentation says this function must work in any moment text has been modified. Why it does not work?
Any help appreciated. I am making this Community Wiki because this is common problem and togewther we cam find solution, right? :)
Also - follow-ups and related Question:
http://stackoverflow.com/questions/738694/override-onpaint
http://stackoverflow.com/questions/478071/how-to-autodetect-urls-in-richedit-2-0
http://www.vbforums.com/archive/index.php/t-59959.html
I am working on a custom module with multi-page form on drupal 6.
I found that #default_value is not working when my '#type' = 'textfield'.
However, when '#type'='textarea', it displays correctly with the '#default_value' specified.
Basically, I wrote a FormFactory to return different form definition ($form) based on the post parameter received. Initially, it returns the display of directories list, user then selects from radio buttos until a specific directory contains a xml file, it will become edit form. The edit form will have text fields display the data (#default_value) inside the xml file, however the type 'textarea' works here rather than 'textfield'.
How can I make my '#default_value' work in this case?
Below is the non-working field definition:
$form['pageset']['newsTitle'] = array(
'#type' => 'textfield',
'#title' => 'News Title',
'#default_value' => "{$element->newsTitle}",
'#rows' => 1,
'#required' => TRUE,
);
Then I changed it to textarea as shown below to make it work:
$form['pageset']['newsTitle'] = array(
'#type' => 'textarea',
'#title' => 'News Title',
'#default_value' => "{$element->newsTitle}",
'#rows' => 1,
'#required' => TRUE,
);
I am making my first Facebook App and nothing is working as stated in the documentation. As an example, I have facebook.php on my server and am calling this line:
$friends = $facebook->api_client->friends_get();
but I get a "call to undefined function friends_get()"
I see that there is no "friends_get()" function in the facebook.php. I do see there is a friends.get in that long array... but I'm not sure how to access it?
This is a repeated question and I have followed both the suggestions provided in these StackOverflow links:
How to log-out users using FaceBook connect in php and zend
Trouble logging out of a FaceBook connect site and destroying sessions
The issue is - the code works 90% of the time. Thats the weird part. Out of the 100 times I've logged in and out - I've experienced this problem 5-6 times and 2 of my beta test users have reported the same issue.
So when it works- if u click the logout link - u get the facebook popup saying - you being logged out - when it does'nt work - absolutely nothing happens - the page does not refresh - it just sits on that page doing nothing.
This is the javascript code that gets called on clicking logout
function logout()
{
FB.Connect.get_status().waitUntilReady(function(status) {
switch(status) {
case FB.ConnectState.connected:
FB.Connect.logoutAndRedirect("http://www.example.com/login/logout");
break;
case FB.ConnectState.userNotLoggedIn:
window.location = "http://www.example.com/login/logout";
break;
}
});
return false;
}
This is the php code:
$this-_auth-clearIdentity();
$face = Zend_Registry::get('facebook');
$fb = new Facebook($face['appapikey'], $face['appsecret']);
//$fb-clear_cookie_state();
$fb-expire_session();
Anyone experienced such sporadic issues.
Thanks
I'm trying to use GData to retrieve the email address, real name, and profile URL of the user that just authorized my site using Google OAuth.
We know how to request it using Google's OpenID flow, but the OpenID flow has the severe limitation that we have to ask for a Google Apps user's domain before we know where to send them to log in. At least using OAuth (or even AuthSub), the user gets prompted for which of their Google accounts to log in.
I created an application to receive a broadcasted windows message which works fine. When I turn it into a service, install it, and start the service, the service doesn't receive the message.
I'm almost sure this question has been asked before, but for the love of me I just can't find the answer anywhere. Basically what I want to do is create multiple markers on a custom Google Map I'm building. I already have an XML file with the coordinates (lat/lng) and title of each item. I'd like to take the data from the XML file and use it to create markers on the map. I've found how to do this using KML files and MySQL/PHP, but I need to know how to do it in Javascript.
One more thing: I have a .xml file of my own, so it won't be like I'll be getting the data from a webpage because I believe (from research I've done today) that the code for that may be different.
If anyone knows if this has been posted somewhere else before, could you please direct me there? I've literally been searching all day, this is my last resort. Thanks a ton!!!
this is a part of my geocoding code. I want it to show only country of the selected place, but it shows all address components, My problem is I cant specify the address components object. There is a way of doing it that is written on documentation but I didnt understand, can you do it for me.
if (geocoder) {
geocoder.geocode({'latLng': latlng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var str = "";
$.each(results, function(){
str += "address components: <ul>"
$.each(this.address_components, function(){
str +="<li>"+this.types.join(", ")+": "+this.long_name+"</li>";
});
str +="</ul>";
});
$("#geocode_info").html(str);
I'm about to integrate automated payments into a site.
To date, I've successfully used paypal for a number of projects, but these have always been sites which sell physical goods, meaning I can upload the cart contents, user pays, person physically ships goods.
This site is a one off payment to enable extra features on a web app. My current thinking is to go down the paypal IPN route to get a notification back and update the users account based on the successful payment.
Question is in two parts:
1 - is there a better / simpler way? (any payment processor considered)
2 - does anyone know of a code library or plug in for php which will speed up my integration?
Thanks for your help.
Rob
Is it a good or bad idea to make setters in java return "this"?
public Employee setName(String name){
this.name = name;
return this;
}
This pattern can be useful because then you can chain setters like this:
list.add(new Employee().setName("Jack Sparrow").setId(1).setFoo("bacon!"));
instead of this:
Employee e = new Employee();
e.setName("Jack Sparrow");
...and so on...
list.add(e);
...but it sort of goes against standard convention. I suppose it might be worthwhile just because it can make that setter do something else useful. I've seen this pattern used some places (e.g. JMock, JPA), but it seems uncommon, and only generally used for very well defined APIs where this pattern is used everywhere.
Update:
What I've described is obviously valid, but what I am really looking for is some thoughts on whether this is generally acceptable, and if there are any pitfalls or related best practices. I know about the Builder pattern but it is a little more involved then what I am describing - as Josh Bloch describes it there is an associated static Builder class for object creation.
can anyone detail the particulars that are required to send data collected from a asp.net web page using vb.net that has a bunch of text boxes for first name, last name, address... item price, quantity, total price... to paypal for processing and settlement?
i have never worked with paypal so i am assuming paypal will get this info and generate a bill to send the user.
thanks in advance
I'm trying to authenticate users via Facebook Connect using a custom Javascript button:
<form>
<input type="button" value="Connect with Facebook" onclick="window.open('http://www.facebook.com/login.php?api_key=XXXXX&extern=1&fbconnect=1&req_perms=publish_stream,email&return_session=0&v=1.0&next=http%3A%2F%2Fwww.example.com%2Fxd_receiver.htm&fb_connect=1&cancel_url=http%3A%2F%2Fwww.example.com%2Fregister%2Fcancel', '_blank', 'top=442,width=480,height=460,resizable=yes', true)" onlogin='window.location="/register/step2"' />
</form>
I am able to authenticate users. However after authentication, the popup window just stays open and the main window is not directed anywhere. In fact, it is the popup window that goes to "/register/step2"
How can I get the login window to close as expected, and to pass the facebook session id to /register/step2?
Thanks!
I am capturing output of windows program using following function:
public static Bitmap Get(IntPtr hWnd, int X1, int Y1, int width, int height)
{
WINDOWINFO winInfo = new WINDOWINFO();
bool ret = GetWindowInfo(hWnd, ref winInfo);
if (!ret)
{
return null;
}
int curheight = height;
if (curheight <= 0 || curheight > winInfo.rcWindow.Height)
curheight = winInfo.rcWindow.Height;
int curwidth = width;
if (curwidth <= 0 || curwidth > winInfo.rcWindow.Width)
curwidth = winInfo.rcWindow.Width;
if (curheight == 0 || curwidth == 0) return null;
Graphics frmGraphics = Graphics.FromHwnd(hWnd);
IntPtr hDC = GetWindowDC(hWnd); //gets the entire window
//IntPtr hDC = frmGraphics.GetHdc(); -- gets the client area, no menu bars, etc..
System.Drawing.Bitmap tmpBitmap = new System.Drawing.Bitmap(curwidth, curheight, frmGraphics);
Graphics bmGraphics = Graphics.FromImage(tmpBitmap);
IntPtr bmHdc = bmGraphics.GetHdc();
BitBlt(bmHdc, 0, 0, curwidth, curheight, hDC, X1, Y1, TernaryRasterOperations.SRCCOPY);
bmGraphics.ReleaseHdc(bmHdc);
ReleaseDC(hWnd, hDC);
return tmpBitmap;
}
On Development environment everything is excellent, but on windows server 2008 I have following issues:
1) When there is other window in front my - it is getting captured as well
2) When there is no user connected to RDC - image is black
On other hand, I am able to render webpage images using IE. How I can change behaviour of windows rendering process to get proper results?
Is there a way to retrieve a list of the contents of a public Dropbox folder (preferably in PHP)? This is what a URL to a public file in Dropbox looks like:
http://dl.dropbox.com/u/1234567/publikPholder/textytext.txt
One would think that jumping up one level to the directory in the URL...
http://dl.dropbox.com/u/1234567/publikPholder/
...would show all the public files. Nope. Nothing but a 404.
Hi all,
I was testing Zend Gdata 1.10.1 in my localhost.
I downloaded Zend Gdate from this link:
http://framework.zend.com/download/webservices
Inside the Zend Gdata zip file, there was a folder called demos.
I extracted it and used the YouTudeVideoApp to upload a sample video to Youtube.
But every time after I logged into Youtube, before it redirected me to my localhost,
I received a warning message like this warning message:
localhost: This website is registered
with Google to make authorization
requests, but has not been configured
to send requests securely. We
recommend that you continue the
process only if you trust the
following destination:
localhost:8080/youtube/operations.php
So I googled on how to resolve the problem of getting this warning message when
I saw some people suggesed changing the value of $secure to True in operation.php.
Here is the script mentioned:
function generateAuthSubRequestLink($nextUrl = null)
{
$scope = 'http://gdata.youtube.com';
$secure = true;
$session = true;
if (!$nextUrl) {
generateUrlInformation();
$nextUrl = $_SESSION['operationsUrl'];
}
$url = Zend_Gdata_AuthSub::getAuthSubTokenUri($nextUrl, $scope, $secure, $session);
echo '<a href="' . $url
. '"><strong>Click here to authenticate with YouTube</strong></a>';
}
After I altered the value of $secure to True,
I found that the warning message changed to this:
localhost: Registered, secure. This
website is registered with Google to
make authorization requests
The new warning message is somehow shorter and looks better than the previous warning message.
But once I pressed the Allow Access button, it turned out to be this:
ERROR - Token upgrade for
CI3M6_Q3EOGkxoL-___wEYjffToQQ failed
: Token upgrade failed. Reason:
Invalid AuthSub header. Error 401
ERROR - Unknown search type - ''
I don't know why this happened.
Could you help me solve the problem please?
If anyone can help me with the Video wall posts on my site www.fameboxx.com, then i would really be greatful.
Since youtube changed its design i could not post Videos using the URL from youtube. What am i suppose to do in this case.
You can check the site www.fameboxx.com
Please help.
Hi,
We are trying it with facebook social plugin. The HTML code for it as follow:
<iframe border='0' src='http://www.facebook.com/plugins/likebox.php?id=1185611481&width=243&height=400&connections=15&stream=false&header=false' scrolling='yes' frameborder='0' allowTransparency='false' style='border:0px; overflow:hidden; width:243px; height:300px; background-color: #03869E; color: white;'> <iframe>
As it replace inner HTML of frame on load. We want our own CSS to apply to this HTML. But as it replace whole HTML and it have its own CSS we are unable to set our CSS.
We are doing this in GWT. Is there any way we can get the list of fans so we can display it as we want and can apply css? Or check given user is fan of page?