Search Results

Search found 310 results on 13 pages for 'userinfo'.

Page 1/13 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to receive userinfo with google adwords api libraries

    - by PatrickvKleef
    I'm using the Google Adwords API libraries and I would like to receive the userinfo of the logged in user. I added the userinfo scope as followed: googleAdwordsUser = new AdWordsUser(); string oauth_callback_url = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Path); googleAdwordsUser.OAuthProvider = new AdsOAuthNetProvider("https://adwords-sandbox.google.com/api/adwords/ https://www.googleapis.com/auth/userinfo.email", oauth_callback_url, Session.SessionID); When the callback url is called, I'm trying to get the users emailaddress, but it isn't working, the error 'The remote server returned an error: (401) Unauthorized.' is thrown. string url = @"https://www.googleapis.com/oauth2/v2/userinfo?access_token=" + token; HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Method = "GET"; HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse(); string result = string.Empty; using (StreamReader sr = new StreamReader(objResponse.GetResponseStream())) { result = sr.ReadToEnd(); } Does somebody knows how to fix this? Thanks.

    Read the article

  • Passing Data thru NSTimer UserInfo

    - by zorro2b
    I a trying to pass data thru userInfo for an NSTimer call. What is the best way to do this? I am trying to use an NSDictionary, this is simple enough when I have objective c objects, but what about other data? I want to do something like this, which doesn't work as is: - (void) play:(SystemSoundID)sound target:(id)target callbackSelector:(SEL)selector { NSLog(@"pause ipod"); [iPodController pause]; theSound = sound; NSMutableDictionary *cb = [[NSMutableDictionary alloc] init]; [cb setObject:(id)&sound forKey:@"sound"]; [cb setObject:target forKey:@"target"]; [cb setObject:(id)&selector forKey:@"selector"]; [NSTimer scheduledTimerWithTimeInterval:0 target:self selector: @selector(notifyPause1:) userInfo:(id)cb repeats:NO]; }

    Read the article

  • Error Domain=SKErrorDomain Code=3 UserInfo=0x2a5a00 "Cannot connect to iTunes Store"

    - by SKk
    I am trying to implement InApp purchase in my application. I have implemented it as per Apple's programming guide and it(code) was working fine until I created new application, appid, provisioning profile and in-app products @ another developer account. Now, it gives me following error. Error Domain=SKErrorDomain Code=3 UserInfo=0x2a5a00 "Cannot connect to iTunes Store" Same code works fine if I use previous developer account's appid, pro-certificate and product ids. This is very strange issue, I double checked product id names and other things still facing same error. Any clue..?

    Read the article

  • Reference Value Parameter VS Return value which one is good?

    - by CodeYun
    When we want to modify some value in one object we may use two different methods, just want to know which one is better or there is no big different between them. void SomeMethod() { UserInfo newUser = New UserInfo(); ModifyUserInfo(newUser); //Modify UserInfo after calling void method GetUserInfo } void ModifyUserInfo(UseerInfo userInfo) { userInfo.UserName = "User Name"; ..... } void SomeMethod() { UserInfo newUser = New UserInfo(); //Assign new userinfo explicitly newUser = GetUserInfo(newUser); } UserInfo ModifyUserInfo(UseerInfo userInfo) { userInfo.UserName = "User Name"; ..... return userInfo; }

    Read the article

  • Optimize existing code and need to list alphabetically.

    - by Brad
    I need help optimizing the code to run faster, unless it is optimized the best. I also want to alphabetize the list and I am unsure how to do that. It should be alphabetized by $userinfo[0]["sn"][0] I am using the adLDAP class: http://adldap.sourceforge.net/ <?php require_once('adLDAP.php'); //header('Content-type: text/json'); $adldap = new adLDAP(); $groupMembers = $adldap->group_members('STAFF'); //print_r($groupMembers); $userinfo = $adldap->user_info($username, array("givenname","sn","telephonenumber")); $displayname = $userinfo[0]["givenname"][0]." ".$userinfo[0]["sn"][0]; print "<ul>"; foreach ($groupMembers as $i => $username) { $userinfo = $adldap->user_info($username, array("*")); $displayname = "<strong>".$userinfo[0]["givenname"][0]." ".$userinfo[0]["sn"][0]."</strong> - ".$userinfo[0]["telephonenumber"][0]; if($userinfo[0]["sn"][0] != "" && $userinfo[0]["givenname"][0] != "" && $userinfo[0]["telephonenumber"][0] != "") { print "<li>".$displayname."</li>"; } } print "</ul>"; ?>

    Read the article

  • Maintaining a secure database of user logins and info?

    - by Rafe Kettler
    I want to have a login form on a charity website I am building (it's for a friend, and I'm learning on the go), and I want to know what languages/software should I learn to build databases for user logins and info? Note: it HAS to be secure and relatively simple to learn for someone with moderate programming experience. Update: I understand that CMSs offer good tools for logins etc. but I want to do this all by myself.

    Read the article

  • Placing advice on any parameter of a given type in AspectJ

    - by user12558
    Hi, Im doing a POC using Aspectj. class BaseInfo{..} class UserInfo extends BaseInfo{..} class UserService { public void getUser(UserInfo userInfo){..} public void deleteUser(String userId){..} } I've defined an advice, that gets invoked when I pass an UserInfo instance.But when i try to pass the BaseInfo, the advice is not getting invoked. Below block executes the afterMethod as expected for getUser. &ltaop:pointcut id="aopafterMethod" expression="execution(* UserService.*(..,UserInfo,..))" / &gtaop:after pointcut-ref="aopafterMethod" method="afterMethod" / But when i try to give BaseInfo instead of UserInfo, the aspect is not getting triggered. Am i missing something? Kindly help me on this issue.

    Read the article

  • aspect parameter validation [closed]

    - by user12558
    Hi, Im doing a POC using Aspectj. class BaseInfo{..} class UserInfo extends BaseInfo{..} class UserService { public void getUser(UserInfo userInfo){..} public void deleteUser(String userId){..} } I've defined an advice, that gets invoked when I pass an UserInfo instance.But when i try to pass the BaseInfo, the advice is not getting invoked. Below block executes the afterMethod as expected for getUser. &ltaop:pointcut id="aopafterMethod" expression="execution(* UserService.*(..,UserInfo,..))" / &gtaop:after pointcut-ref="aopafterMethod" method="afterMethod" / But when i try to give BaseInfo instead of UserInfo, the aspect is not getting triggered. Am i missing something? Kindly help me on this issue.

    Read the article

  • Custom Keyboard (iPhone), UIKeyboardDidShowNotification and UITableViewController

    - by Pascal
    On an iPhone App, I've got a custom keyboard which works like the standard keyboard; it appears if a custom textfield becomes first responder and hides if the field resigns first responder. I'm also posting the Generic UIKeyboardWillShowNotification, UIKeyboardDidShowNotification and their hiding counterparts, like follows: NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithCapacity:5]; [userInfo setObject:[NSValue valueWithCGPoint:self.center] forKey:UIKeyboardCenterBeginUserInfoKey]; [userInfo setObject:[NSValue valueWithCGPoint:shownCenter] forKey:UIKeyboardCenterEndUserInfoKey]; [userInfo setObject:[NSValue valueWithCGRect:self.bounds] forKey:UIKeyboardBoundsUserInfoKey]; [userInfo setObject:[NSNumber numberWithInt:UIViewAnimationCurveEaseOut] forKey:UIKeyboardAnimationCurveUserInfoKey]; [userInfo setObject:[NSNumber numberWithDouble:thisAnimDuration] forKey:UIKeyboardAnimationDurationUserInfoKey]; [[NSNotificationCenter defaultCenter] postNotificationName:UIKeyboardWillShowNotification object:nil userInfo:userInfo]; This code is working and I use it in UIViewController subclasses. Now since iPhone OS 3.0, UITableViewController automatically resizes its tableView when the system keyboards show and hide. I'm only now compiling against 3.0 and I thought that the controller should also resize the table if my custom keyboard appears, since I'm posting the same notification. However it doesn't. The table view controller is set as the delegate of the input fields. Does anyone have an idea why this might be the case? Has anyone implemented something similar successfully? I have standard input fields along the custom ones, so if the user changes the fields the standard keyboard hides and the custom one shows. It would be beneficial if the tableView didn't resize to full height and I didn't have to resize it back with a custom method.

    Read the article

  • Converting a generic list into JSON string and then handling it in java script

    - by Jalpesh P. Vadgama
    We all know that JSON (JavaScript Object Notification) is very useful in case of manipulating string on client side with java script and its performance is very good over browsers so let’s create a simple example where convert a Generic List then we will convert this list into JSON string and then we will call this web service from java script and will handle in java script. To do this we need a info class(Type) and for that class we are going to create generic list. Here is code for that I have created simple class with two properties UserId and UserName public class UserInfo { public int UserId { get; set; } public string UserName { get; set; } } Now Let’s create a web service and web method will create a class and then we will convert this with in JSON string with JavaScriptSerializer class. Here is web service class. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; namespace Experiment.WebService { /// <summary> /// Summary description for WsApplicationUser /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class WsApplicationUser : System.Web.Services.WebService { [WebMethod] public string GetUserList() { List<UserInfo> userList = new List<UserInfo>(); for (int i = 1; i <= 5; i++) { UserInfo userInfo = new UserInfo(); userInfo.UserId = i; userInfo.UserName = string.Format("{0}{1}", "J", i.ToString()); userList.Add(userInfo); } System.Web.Script.Serialization.JavaScriptSerializer jSearializer = new System.Web.Script.Serialization.JavaScriptSerializer(); return jSearializer.Serialize(userList); } } } Note: Here you must have this attribute here in web service class ‘[System.Web.Script.Services.ScriptService]’ as this attribute will enable web service to call from client side. Now we have created a web service class let’s create a java script function ‘GetUserList’ which will call web service from JavaScript like following function GetUserList() { Experiment.WebService.WsApplicationUser.GetUserList(ReuqestCompleteCallback, RequestFailedCallback); } After as you can see we have inserted two call back function ReuqestCompleteCallback and RequestFailedCallback which handle errors and result from web service. ReuqestCompleteCallback will handle result of web service and if and error comes then RequestFailedCallback will print the error. Following is code for both function. function ReuqestCompleteCallback(result) { result = eval(result); var divResult = document.getElementById("divUserList"); CreateUserListTable(result); } function RequestFailedCallback(error) { var stackTrace = error.get_stackTrace(); var message = error.get_message(); var statusCode = error.get_statusCode(); var exceptionType = error.get_exceptionType(); var timedout = error.get_timedOut(); // Display the error. var divResult = document.getElementById("divUserList"); divResult.innerHTML = "Stack Trace: " + stackTrace + "<br/>" + "Service Error: " + message + "<br/>" + "Status Code: " + statusCode + "<br/>" + "Exception Type: " + exceptionType + "<br/>" + "Timedout: " + timedout; } Here in above there is a function called you can see that we have use ‘eval’ function which parse string in enumerable form. Then we are calling a function call ‘CreateUserListTable’ which will create a table string and paste string in the a div. Here is code for that function. function CreateUserListTable(userList) { var tablestring = '<table ><tr><td>UsreID</td><td>UserName</td></tr>'; for (var i = 0, len = userList.length; i < len; ++i) { tablestring=tablestring + "<tr>"; tablestring=tablestring + "<td>" + userList[i].UserId + "</td>"; tablestring=tablestring + "<td>" + userList[i].UserName + "</td>"; tablestring=tablestring + "</tr>"; } tablestring = tablestring + "</table>"; var divResult = document.getElementById("divUserList"); divResult.innerHTML = tablestring; } Now let’s create div which will have all html that is generated from this function. Here is code of my web page. We also need to add a script reference to enable web service from client side. Here is all HTML code we have. <form id="form1" runat="server"> <asp:ScriptManager ID="myScirptManger" runat="Server"> <Services> <asp:ServiceReference Path="~/WebService/WsApplicationUser.asmx" /> </Services> </asp:ScriptManager> <div id="divUserList"> </div> </form> Now as we have not defined where we are going to call ‘GetUserList’ function so let’s call this function on windows onload event of javascript like following. window.onload=GetUserList(); That’s it. Now let’s run it on browser to see whether it’s work or not and here is the output in browser as expected. That’s it. This was very basic example but you can crate your own JavaScript enabled grid from this and you can see possibilities are unlimited here. Stay tuned for more.. Happy programming.. Technorati Tags: JSON,Javascript,ASP.NET,WebService

    Read the article

  • Tomboy error while tring to sync with Ubuntu one; Can anyone help?

    - by Michael Chapman
    So I'm sure you've heard the song before, but after trying to sync my notes with Ubuntu One(on 10.10 AMD64) I get "Could not synchronize notes. Check the details below and try again." Of course the problem is that there are no details and trying again doesn't help. So I ran tomboy -debug and compared my error to any thing I could find about similar problems (such as the post here) but found nothing useful. Any way here's my first error, I got this using preferencessynchronizationUbuntu_one [ERROR 21:08:42.271] Synchronization failed with the following exception: String was not recognized as a valid DateTime. at System.DateTime.Parse (System.String s, IFormatProvider provider, DateTimeStyles styles) [0x00000] in <filename unknown>:0 at System.DateTime.Parse (System.String s, IFormatProvider provider) [0x00000] in <filename unknown>:0 at System.DateTime.Parse (System.String s) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.Api.NoteInfo.ParseJson (Hyena.Json.JsonObject jsonObj) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.Api.UserInfo.ParseJsonNoteArray (Hyena.Json.JsonArray jsonArray) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.Api.UserInfo.ParseJsonNotes (System.String jsonString, System.Nullable`1& latestSyncRevision) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.Api.UserInfo.GetNotes (Boolean includeContent, Int32 sinceRevision, System.Nullable`1& latestSyncRevision) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.WebSyncServer.GetNoteUpdatesSince (Int32 revision) [0x00000] in <filename unknown>:0 at Tomboy.Sync.SyncManager.SynchronizationThread () [0x00000] in <filename unknown>:0 The next thing I tried was using preferencessynchronizationtomboy_web with the default 'http://one.ubuntu.com/notes/' and got the same error plus one more. [ERROR 21:12:31.949] System.ObjectDisposedException: The object was used after being disposed. at System.Net.HttpListener.CheckDisposed () [0x00000] in <filename unknown>:0 at System.Net.HttpListener.EndGetContext (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.WebSyncPreferencesWidget.<OnAuthButtonClicked>m__1 (IAsyncResult localResult) [0x00000] in <filename unknown>:0 [ERROR 21:13:19.245] Synchronization failed with the following exception: String was not recognized as a valid DateTime. at System.DateTime.Parse (System.String s, IFormatProvider provider, DateTimeStyles styles) [0x00000] in <filename unknown>:0 at System.DateTime.Parse (System.String s, IFormatProvider provider) [0x00000] in <filename unknown>:0 at System.DateTime.Parse (System.String s) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.Api.NoteInfo.ParseJson (Hyena.Json.JsonObject jsonObj) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.Api.UserInfo.ParseJsonNoteArray (Hyena.Json.JsonArray jsonArray) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.Api.UserInfo.ParseJsonNotes (System.String jsonString, System.Nullable`1& latestSyncRevision) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.Api.UserInfo.GetNotes (Boolean includeContent, Int32 sinceRevision, System.Nullable`1& latestSyncRevision) [0x00000] in <filename unknown>:0 at Tomboy.WebSync.WebSyncServer.GetNoteUpdatesSince (Int32 revision) [0x00000] in <filename unknown>:0 at Tomboy.Sync.SyncManager.SynchronizationThread () [0x00000] in <filename unknown>:0 I Have also tried removing then re-adding My computer from my Ubuntu One account, but that did not help either. The only other Thing I have noticed is that under systempreferencesubuntu one services, "Notes" is not listed as a service. I don't know if this is normal or not. Thanks for any help and please let me know if anything is confusing.

    Read the article

  • What should I do when the managed object context fails to save?

    - by dontWatchMyProfile
    Example: I have an Cat entity with an catAge attribute. In the data modeler, I configured catAge as int with a max of 100. Then I do this: [newManagedObject setValue:[NSNumber numberWithInt:125] forKey:@"catAge"]; // Save the context. NSError *error = nil; if (![context save:&error]) { NSLog(@"Unresolved error %@, %@", error, [error userInfo]); } I'm getting an error in the console, like this: 2010-06-12 11:40:41.947 CatTest[2250:207] Unresolved error Error Domain=NSCocoaErrorDomain Code=1610 UserInfo=0x10164d0 "Operation could not be completed. (Cocoa error 1610.)", { NSLocalizedDescription = "Operation could not be completed. (Cocoa error 1610.)"; NSValidationErrorKey = catAge; NSValidationErrorObject = <NSManagedObject: 0x10099f0> (entity: Cat; id: 0x1006a90 <x-coredata:///Cat/t3BCBC34B-8405-4F16-B591-BE804B6811562> ; data: { catAge = 125; catName = "No Name"; }); NSValidationErrorPredicate = SELF <= 100; NSValidationErrorValue = 125; } Well, so I have an validation error. But the odd thing is, that it seems the MOC is broken after this. If I just tap "add" to add another invalid Cat object and save that, I'm getting this: 2010-06-12 11:45:13.857 CatTest[2250:207] Unresolved error Error Domain=NSCocoaErrorDomain Code=1560 UserInfo=0x1232170 "Operation could not be completed. (Cocoa error 1560.)", { NSDetailedErrors = ( Error Domain=NSCocoaErrorDomain Code=1610 UserInfo=0x1215f00 "Operation could not be completed. (Cocoa error 1610.)", Error Domain=NSCocoaErrorDomain Code=1610 UserInfo=0x1209fc0 "Operation could not be completed. (Cocoa error 1610.)" ); } That seems to report two errors now. BUT: When I try to delete now an valid, existing object from the table view (using the default core data template in a navigation-based app), then the app crashes! All I get in the console is: 2010-06-12 11:47:18.931 CatTest[2250:207] Unresolved error Error Domain=NSCocoaErrorDomain Code=1560 UserInfo=0x123eb30 "Operation could not be completed. (Cocoa error 1560.)", { NSDetailedErrors = ( Error Domain=NSCocoaErrorDomain Code=1610 UserInfo=0x1217010 "Operation could not be completed. (Cocoa error 1610.)", Error Domain=NSCocoaErrorDomain Code=1610 UserInfo=0x123ea80 "Operation could not be completed. (Cocoa error 1610.)" ); } ...so no idea where or why it crashes, but it does. So the question is, what are the neccessary steps to take when there's an validation error?

    Read the article

  • UITextView doesn't not resize when keyboard appear if loaded from a tab bar cotroller

    - by elio.d
    I have a simple view controller (SecondViewController) used to manage a UITextview (I'm building a simple editor) this is the code of the SecondViewController.h @interface SecondViewController : UIViewController { IBOutlet UITextView *textView; } @property (nonatomic,retain) IBOutlet UITextView *textView; @end and this is the SecondViewController.m // // EditorViewController.m // Editor // // Created by elio d'antoni on 13/01/11. // Copyright 2011 none. All rights reserved. // @implementation SecondViewController @synthesize textView; /* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"uiViewBg.png"]]; textView.layer.borderWidth=1; textView.layer.cornerRadius=5; textView.layer.borderColor=[[UIColor darkGrayColor] CGColor]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillAppear:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillDisappear:) name:UIKeyboardWillHideNotification object:nil]; } -(void) matchAnimationTo:(NSDictionary *) userInfo { NSLog(@"match animation method"); [UIView setAnimationDuration:[[userInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]]; [UIView setAnimationCurve:[[userInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]]; } -(CGFloat) keyboardEndingFrameHeight:(NSDictionary *) userInfo { NSLog(@"keyboardEndingFrameHeight method"); CGRect keyboardEndingUncorrectedFrame = [[ userInfo objectForKey:UIKeyboardFrameEndUserInfoKey ] CGRectValue]; CGRect keyboardEndingFrame = [self.view convertRect:keyboardEndingUncorrectedFrame fromView:nil]; return keyboardEndingFrame.size.height; } -(CGRect) adjustFrameHeightBy:(CGFloat) change multipliedBy:(NSInteger) direction { NSLog(@"adjust method"); return CGRectMake(20, 57, self.textView.frame.size.width, self.textView.frame.size.height + change * direction); } -(void)keyboardWillAppear:(NSNotification *)notification { NSLog(@"keyboard appear"); [UIView beginAnimations:nil context:NULL]; [self matchAnimationTo:[notification userInfo]]; self.textView.frame = [self adjustFrameHeightBy:[self keyboardEndingFrameHeight: [notification userInfo]] multipliedBy:-1]; [UIView commitAnimations]; } -(void)keyboardWillDisappear:(NSNotification *) notification { NSLog(@"keyboard disappear"); [UIView beginAnimations:nil context:NULL]; [self matchAnimationTo:[notification userInfo]]; self.textView.frame = [self adjustFrameHeightBy:[self keyboardEndingFrameHeight: [notification userInfo]] multipliedBy:1]; [UIView commitAnimations]; } // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } (void)dealloc { [super dealloc]; } @end the problem is that if load the view controller from a tab bar controller the textView doesn't resize when the keyboard appear, but the SAME code works if loaded as a single view based app. I hope I was clear enough. I used the tabBar template provided by xcode no modifications.

    Read the article

  • SQL Query syntax, I want to use INNER JOIN

    - by amol kadam
    Hi . I'm working on a windows application project using front end "vb.net" & back end "Ms Access" I have problem in wrinting sql query Actually there are 5 tables Transaction,items,itemtitle,itemtype & userinfo. check the following query & with this referance if u get idea then plz change in correct query Thanking You SELECT TRANSACTIONS.ACCESSIONNO AS ACCESSIONNO,TRANSACTIONS.TYPEID, TRANSACTIONS.CHECKOUTDATE AS CHECKOUTDATE,ITEMTITLE.ITEMTITLE, TRANSACTIONS.CHECKEDOUTBY, USERINFO.FULLNAME_ENG, USERINFO.FULLNAME_MAR, TRANSACTIONS.ACCOUNTNO, ITEMTYPE.TYPES_MAR, ITEMTYPE.TYPES_ENG FROM TRANSACTIONS,ITEMTYPE, ITEMTITLE, USERINFO WHERE TRANSACTIONS.ACCOUNTNO=USERINFO.ACCOUNTNO AND TRANSACTIONS.ACCESSIONNO=ITEMS.ACCESSIONNO AND ITEMS.ITEMTITLEID=ITEMTITLE.ITEMTITLEID AND TRANSACTIONS.TYPEID=ITEMTYPE.TYPEID AND TRANSACTIONS.STATUS='Enabled'

    Read the article

  • iPhone: how to keep integer value on UILabel

    - by Nandakishore
    i am working on Twitter on iPhone now i have to keep the count of Friend, Tweets, Followers etc on UILabel how to work with this (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier { NSLog(@"User Info Received: %@", userInfo); // userInfo contains all user details like userName, screenName, count of Friends, Followers, Following, Status Count etc NSLog(@"User Info Received: %d", [userInfo count]); NSMutableDictionary *profileData = [userInfo objectAtIndex:0]; //converting userInfo array into profileData dictionary lblUserName.text = [profileData objectForKey:@"name"]; // lblUserName is UILabel, userName keeping on Label lblLocation.text = [profileData objectForKey:@"location"]; // lblLocation is UILabel, Location keeping on Label lblDescription.text = [profileData objectForKey:@"description"]; // lblDescription is UILabel, Location keeping on Label /////* Up to here all working but how to Keep integer value on UILabel *///// lblFolCount = (NSNumber *)[profileData objectForKey:@"followers_count"]; //how to keep user Followers Count on UILable lblFavCount = (NSNumber *)[profileData objectForKey:@"favourites_count"]; //how to keep user Followers Count on UILable lblStatusCount = (NSNumber *) [profileData objectForKey:@"statuses_count"]; //how to keep user statuses count on UILable lblFriends = (NSNumber *) [profileData objectForKey:@"friends_count"]; //how to keep user friends count on UILable } ////**This info Display on debugger console*/////// ////NSLog(@"User Info Received: %@", userInfo); // by this we get info on debugger console User Info Received: ( { "created_at" = "Tue Nov 02 14:42:42 +0000 2010"; description = "being honest"; favorited = false; "favourites_count" = 0; "followers_count" = 5; "friends_count" = 21; "listed_count" = 0; location = Chennai; name = "nanda kishore reddyv"; "profile_background_color" = EDECE9; "profile_background_image_url" = "http://a2.twimg.com/a/1292975674/images/themes/theme3/bg.gif"; "profile_background_tile" = false; "profile_image_url" = "http://a2.twimg.com/a/1292975674/images/default_profile_6_normal.png"; "retweet_count" = 0; "screen_name" = velugotinanda; source = "<a href=\"http://www.icodeblog.com\" rel=\"nofollow\">iCodeBlog Oauth Demo</a>"; status = "Mon Dec 27 09:22:44 +0000 2010"; "statuses_count" = 15; "time_zone" = "Indiana (East)"; verified = false; } ) 2011-01-01 10:38:29.460 IdeaTweet[471:207] User Info Received: 1 Thanks YOU can you tell me how to Keep integer Value on UILabel

    Read the article

  • iPhone SDK: TextView, Keyboard in Landscape mode

    - by Arnold
    Hello. How do I make sure that the textview is shown and the keyboard is not obscuring the textview, while in landscape. Using UICatalog I created a TextViewController which works. In it there are two methods for calling the keyboard and making sure that textView is positioned above the keyboard. his just works great in Portrait mode. I got the Landscape mode working, but on the textView is still being put to the top of the iPhone to compensate for the keyboard in portrait mode. I changed the methods for showing the keyboards. Below is the code for this methods: (I will just let see the code for show, since the hide code will be the reverse.. - (void)keyboardWillShow:(NSNotification *)aNotification { UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation]; if (orientation == UIInterfaceOrientationPortrait) { // the keyboard is showing so resize the table's height CGRect keyboardRect = [[[aNotification userInfo] objectForKey:UIKeyboardBoundsUserInfoKey] CGRectValue]; NSTimeInterval animationDuration = [[[aNotification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; CGRect frame = self.view.frame; frame.size.height -= keyboardRect.size.height; [UIView beginAnimations:@"ResizeForKeyboard" context:nil]; [UIView setAnimationDuration:animationDuration]; self.view.frame = frame; [UIView commitAnimations]; } else if (orientation == UIInterfaceOrientationLandscapeLeft) { NSLog(@"Left"); // Verijderen later CGRect keyboardRect = [[[aNotification userInfo] objectForKey:UIKeyboardBoundsUserInfoKey] CGRectValue]; NSTimeInterval animationDuration = [[[aNotification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; CGRect frame = self.view.frame; frame.size.width -= keyboardRect.size.height; [UIView beginAnimations:@"ResizeForKeyboard" context:nil]; [UIView setAnimationDuration:animationDuration]; self.view.frame = frame; [UIView commitAnimations]; } else if (orientation == UIInterfaceOrientationLandscapeRight){ NSLog(@"Right"); // verwijderen later. CGRect keyboardRect = [[[aNotification userInfo] objectForKey:UIKeyboardBoundsUserInfoKey] CGRectValue]; NSTimeInterval animationDuration = [[[aNotification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; CGRect frame = self.view.frame; frame.size.width -= keyboardRect.size.width; [UIView beginAnimations:@"ResizeForKeyboard" context:nil]; [UIView setAnimationDuration:animationDuration]; self.view.frame = frame; [UIView commitAnimations]; } } I know that I have to change the line frame.size.height -= keyboardRect.size.height but I do not seem to get it working. I tried frame.size.width -= keyboardRect.size.height that did not work. Losing the keyboardRect and frame all together work, however off course the keyboard obscures the textview........

    Read the article

  • python urllib post question

    - by paul
    hello ALL im making some simple python post script but it not working well. there is 2 part to have to login. first login is using 'http://mybuddy.buddybuddy.co.kr/userinfo/UserInfo.asp' this one. and second login is using 'http://user.buddybuddy.co.kr/usercheck/UserCheckPWExec.asp' i can login first login page, but i couldn't login second page website. and return some error 'illegal access' such like . i heard this is related with some cooke but i don't know how to implement to resolve this problem. if anyone can help me much appreciated!! Thanks! import re,sys,os,mechanize,urllib,time import datetime,socket params = urllib.urlencode({'ID':'ph896011', 'PWD':'pk1089' }) rq = mechanize.Request("http://mybuddy.buddybuddy.co.kr/userinfo/UserInfo.asp", params) rs = mechanize.urlopen(rq) data = rs.read() logged_fail = r';history.back();</script>' in data if not logged_fail: print 'login success' try: params = urllib.urlencode({'PASSWORD':'pk1089'}) rq = mechanize.Request("http://user.buddybuddy.co.kr/usercheck/UserCheckPWExec.asp", params ) rs = mechanize.urlopen(rq) data = rs.read() print data except: print 'error'

    Read the article

  • SelectedItem of listbox - BindableCollection is binded on listbox

    - by user572844
    Hi, I bind BindableCollection from caliburn micro on listbox. Also I bind selected listbox item on property in view model. After I select some item on listbox, property SelectedFriedn which is bind on SelectedItem of listbox is still null. Code from view model: private BindableCollection<UserInfo> _friends; //bind on listbox public BindableCollection<UserInfo> Friends { get { return _friends; } set { _friends = value; NotifyOfPropertyChange(() => Friends); } } private UserInfo _selectedFriend = new UserInfo(); //bind on SelectedItem property of listbox public UserInfo SelectedFriend { get { return _selectedFriend; } set { _selectedFriend = value; NotifyOfPropertyChange(() => SelectedFriend); } } In view I have this: <ListBox Name="Friends" SelectedIndex="{Binding Path=SelectedFriendsIndex,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedItem="{Binding Path=SelectedFriend, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Style="{DynamicResource friendsListStyle}" IsTextSearchEnabled="True" TextSearch.TextPath="Nick" Grid.Row="2" Margin="4,4,4,4" PreviewMouseRightButtonUp="ListBox_PreviewMouseRightButtonUp" PreviewMouseRightButtonDown="ListBox_PreviewMouseRightButtonDown" MouseRightButtonDown="ListBox_MouseRightButtonDown" Micro:Message.Attach="[MouseDoubleClick]=[Action OpenChatScreen()]" > Where can be problem?

    Read the article

  • EXC_BAD_ACCESS on [error localizedDescription];

    - by david
    This Code trows an EXC_BAD_ACCESS: NSError* error; if(![appdelegate.managedObjectContext countForFetchRequest:request error:&error]) { DLog(@"Failed to save to data store: %@", [error localizedDescription]); NSArray* detailedErrors = [[error userInfo] objectForKey:NSDetailedErrorsKey]; if(detailedErrors != nil && [detailedErrors count] > 0) { for(NSError* detailedError in detailedErrors) { DLog(@" DetailedError: %@", [detailedError userInfo]); } } else { DLog(@" %@", [error userInfo]); } }

    Read the article

  • iphone Core Data Unresolved error while saving

    - by Ahmed Kotb
    I am getting a strange error message from the core data when trying to save but the problem that the error is not reproducible ( it appears at different times when doing different tasks) the error message: Unresolved error Domain=NSCocoaErrorDomain Code=1560 UserInfo=0x14f5480 "Operation could not be completed. (Cocoa error 1560.)", { NSDetailedErrors = ( Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x5406d70 "Operation could not be completed. (Cocoa error 1570.)", Error Domain=NSCocoaErrorDomain Code=1570 UserInfo=0x14f9be0 "Operation could not be completed. (Cocoa error 1570.)" ); } and the method that generates the error is: - (IBAction)saveAction:(id)sender { NSError *error; if (![[self managedObjectContext] save:&error]) { // Handle error NSLog(@"Unresolved error %@, %@, %@", error, [error userInfo],[error localizedDescription]); exit(-1); // Fail } } any idea for the reason of this message ? giving that it appears at random times

    Read the article

  • iPhone: Using dispatch_after to mimick NSTimer

    - by Joseph Tura
    Don't know a whole lot about blocks. How would you go about mimicking a repeating NSTimer with dispatch_after? My problem is that I want to "pause" a timer when the app moves to the background, but subclassing NSTimer does not seem to work. I tried something which seems to work. I cannot judge its performance implications or whether it could be greatly optimized. Any input is welcome. #import "TimerWithPause.h" @implementation TimerWithPause @synthesize timeInterval; @synthesize userInfo; @synthesize invalid; @synthesize invocation; + (TimerWithPause *)scheduledTimerWithTimeInterval:(NSTimeInterval)aTimeInterval target:(id)aTarget selector:(SEL)aSelector userInfo:(id)aUserInfo repeats:(BOOL)aTimerRepeats { TimerWithPause *timer = [[[TimerWithPause alloc] init] autorelease]; timer.timeInterval = aTimeInterval; NSMethodSignature *signature = [[aTarget class] instanceMethodSignatureForSelector:aSelector]; NSInvocation *aInvocation = [NSInvocation invocationWithMethodSignature:signature]; [aInvocation setSelector:aSelector]; [aInvocation setTarget:aTarget]; [aInvocation setArgument:&timer atIndex:2]; timer.invocation = aInvocation; timer.userInfo = aUserInfo; if (!aTimerRepeats) { timer.invalid = YES; } [timer fireAfterDelay]; return timer; } - (void)fireAfterDelay { dispatch_time_t delay = dispatch_time(DISPATCH_TIME_NOW, self.timeInterval * NSEC_PER_SEC); dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_after(delay, queue, ^{ [invocation performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:NO]; if (!invalid) { [self fireAfterDelay]; } }); } - (void)invalidate { invalid = YES; [invocation release]; invocation = nil; [userInfo release]; userInfo = nil; } - (void)dealloc { [self invalidate]; [super dealloc]; } @end

    Read the article

  • How to optimize this Linq query

    - by Luke101
    I am trying to optimize this query. It is not slow for now but I am expecting a spike to hit this query in the near future. Is there anything else i can do to make this query faster? var posts = from p in context.post where p.post_isdeleted == false && p.post_parentid == null select new { p.post_date, p.post_id, p.post_titleslug, p.post_title, p.post_descriptionrender, p.userinfo.user_username, p.userinfo.user_userid, p.userinfo.user_GravatarHash, p.userinfo.user_points, p.category.catid, p.category.name, p.post_answercount, p.post_hasbestanswer, p.post_hits, p.post_isanonymous, p.post_votecount, FavoriteCount = context.favorites.Where(x => x.post.post_id == p.post_id).Count(), tags = from tg in context.posttag where tg.posttag_postid == p.post_id select new { tg.tag.tag_id, tg.tag.tag_title } };

    Read the article

  • Updating UISearchDisplayController with Core Data results using GCD

    - by Brian Halpin
    I'm having trouble displaying the results from Core Data in my UISearchDisplayController when I implement GCD. Without it, it works, but obviously blocks the UI. In my SearchTableViewController I have the following two methods: - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { // Tell the table data source to reload when text changes [self filterContentForSearchText:searchString]; // Return YES to cause the search result table view to be reloaded. return YES; } // Update the filtered array based on the search text -(void)filterContentForSearchText:(NSString*)searchText { // Remove all objects from the filtered search array [self.filteredLocationsArray removeAllObjects]; NSPredicate *predicate = [CoreDataMaster predicateForLocationUsingSearchText:@"Limerick"]; CoreDataMaster *coreDataMaster = [[CoreDataMaster alloc] init]; // Filter the array using NSPredicate self.filteredLocationsArray = [NSMutableArray arrayWithArray: [coreDataMaster fetchResultsFromCoreDataEntity:@"City" UsingPredicate:predicate]]; } You can probably guess that my problem is with returning the array from [coreDataMaster fetchResultsFromCoreDataEntity]. Below is the method: - (NSArray *)fetchResultsFromCoreDataEntity:(NSString *)entity UsingPredicate:(NSPredicate *)predicate { NSMutableArray *fetchedResults = [[NSMutableArray alloc] init]; dispatch_queue_t coreDataQueue = dispatch_queue_create("com.coredata.queue", DISPATCH_QUEUE_SERIAL); dispatch_async(coreDataQueue, ^{ NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entityDescription = [NSEntityDescription entityForName:entity inManagedObjectContext:self.managedObjectContext]; NSSortDescriptor *nameSort = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; NSArray *sortDescriptors = [NSArray arrayWithObjects:nameSort, nil]; [fetchRequest setEntity:entityDescription]; [fetchRequest setSortDescriptors:sortDescriptors]; // Check if predicate is set if (predicate) { [fetchRequest setPredicate:predicate]; } NSError *error = nil; NSArray *fetchedManagedObjects = [self.managedObjectContext executeFetchRequest:fetchRequest error:&error]; for (City *city in fetchedManagedObjects) { [fetchedResults addObject:city]; } NSDictionary *userInfo = [NSDictionary dictionaryWithObject:[NSArray arrayWithArray:fetchedResults] forKey:@"results"]; [[NSNotificationCenter defaultCenter] postNotificationName:@"fetchResultsComplete" object:nil userInfo:userInfo]; }); return [NSArray arrayWithArray:fetchedResults]; } So the thread hasn't finished executing by the time it returns the results to self.filteredLocationsArray. I've tried added a NSNotification which passes the NSDictionary to this method: - (void)updateSearchResults:(NSNotification *)notification { NSDictionary *userInfo = notification.userInfo; NSArray *array = [userInfo objectForKey:@"results"]; self.filteredLocationsArray = [NSMutableArray arrayWithArray:array]; [self.tableView reloadData]; } I've also tried refreshing the searchViewController like [self.searchDisplayController.searchResultsTableView reloadData]; but to no avail. I'd really appreciate it if someone could point me in the right direction and show me where I might be going wrong. Thanks

    Read the article

  • Timer (NSTimer) won't work...why?

    - by eco_bach
    Hi I have the following, can anyone familiar with NSTimer tell me why it isn't working?? I've tried various values for an interval but no luck. self.timer = [NSTimer scheduledTimerWithTimeInterval:.5 target:self selector:@selector(update:) userInfo:nil repeats:YES]; And then my selector method - (void)update:(NSTimer*)timer { //DOESN"T TRACE OUT! NSLog(@" update:theTimer and userInfo = %@",timer.userInfo); }

    Read the article

  • need to print 5 column list in alpha order, vertically

    - by Brad
    Have a webpage that will be viewed by mainly IE users, so CSS3 is out of the question. I want it to list like: A D G B E H C F I Here is the function that currently lists like: A B C D E F G H I function listPhoneExtensions($group,$group_title) { $adldap = new adLDAP(); $group_membership = $adldap->group_members(strtoupper($group),FALSE); sort($group_membership); print " <a name=\"".strtolower($group_title)."\"></a> <h2>".$group_title."</h2> <ul class=\"phone-extensions\">"; foreach ($group_membership as $i => $username) { $userinfo = $adldap->user_info($username, array("givenname","sn","telephonenumber")); $displayname = "<span class=\"name\">".substr($userinfo[0]["sn"][0],0,9).", ".substr($userinfo[0]["givenname"][0],0,9)."</span><span class=\"ext\">".$userinfo[0]["telephonenumber"][0]."</span>"; if($userinfo[0]["sn"][0] != "" && $userinfo[0]["givenname"][0] != "" && $userinfo[0]["telephonenumber"][0] != "") { print "<li>".$displayname."</li>"; } } print "</ul><p class=\"clear-both\"><a href=\"#top\" class=\"link-to-top\">&uarr; top</a></p>"; } Example rendered html: <ul class="phone-extensions"> <li><span class="name">Barry Bonds</span><span class="ext">8281</span></li> <li><span class="name">Gerald Clark</span><span class="ext">8211</span></li> <li><span class="name">Juan Dixon</span><span class="ext">8282</span></li> <li><span class="name">Omar Ebbs</span><span class="ext">8252</span></li> <li><span class="name">Freddie Flank</span><span class="ext">2281</span></li> <li><span class="name">Jerry Gilmore</span><span class="ext">4231</span></li> <li><span class="name">Kim Moore</span><span class="ext">5767</span></li> <li><span class="name">Barry Bonds</span><span class="ext">8281</span></li> <li><span class="name">Gerald Clark</span><span class="ext">8211</span></li> <li><span class="name">Juan Dixon</span><span class="ext">8282</span></li> <li><span class="name">Omar Ebbs</span><span class="ext">8252</span></li> <li><span class="name">Freddie Flank</span><span class="ext">2281</span></li> <li><span class="name">Jerry Gilmore</span><span class="ext">4231</span></li> <li><span class="name">Kim Moore</span><span class="ext">5767</span></li> <li><span class="name">Barry Bonds</span><span class="ext">8281</span></li> <li><span class="name">Gerald Clark</span><span class="ext">8211</span></li> <li><span class="name">Juan Dixon</span><span class="ext">8282</span></li> <li><span class="name">Omar Ebbs</span><span class="ext">8252</span></li> <li><span class="name">Freddie Flank</span><span class="ext">2281</span></li> <li><span class="name">Jerry Gilmore</span><span class="ext">4231</span></li> <li><span class="name">Kim Moore</span><span class="ext">5767</span></li> </ul> Any help is appreciated to getting it to list alpha vertically.

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >