Daily Archives

Articles indexed Sunday November 20 2011

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

  • Android - How do I load a contact Photo?

    - by PaulH
    I'm having trouble loading a photo for a contact in Android. I've googled for an answer, but so far have come up empty. Does anyone have an example of querying for a Contact, then loading the Photo? So, given a contactUri which comes from an Activity result called using startActivityForResult(new Intent(Intent.ACTION_PICK,ContactsContract.CommonDataKinds.Phone.CONTENT_URI),PICK_CONTACT_REQUEST) is: content://com.android.contacts/data/1557 The loadContact(..) works fine. However when I call the getPhoto(...) method, I get a null value for the photo InputStream. It is also confusing because the URI values are different. The contactPhotoUri evaluates to: content://com.android.contacts/contacts/1557 See the comments inline in the code below. class ContactAccessor { /** * Retrieves the contact information. */ public ContactInfo loadContact(ContentResolver contentResolver, Uri contactUri) { //contactUri --> content://com.android.contacts/data/1557 ContactInfo contactInfo = new ContactInfo(); // Load the display name for the specified person Cursor cursor = contentResolver.query(contactUri, new String[]{Contacts._ID, Contacts.DISPLAY_NAME, Phone.NUMBER, Contacts.PHOTO_ID}, null, null, null); try { if (cursor.moveToFirst()) { contactInfo.setId(cursor.getLong(0)); contactInfo.setDisplayName(cursor.getString(1)); contactInfo.setPhoneNumber(cursor.getString(2)); } } finally { cursor.close(); } return contactInfo; // <-- returns info for contact } public Bitmap getPhoto(ContentResolver contentResolver, Long contactId) { Uri contactPhotoUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, contactId); // contactPhotoUri --> content://com.android.contacts/contacts/1557 InputStream photoDataStream = Contacts.openContactPhotoInputStream(contentResolver,contactPhotoUri); // <-- always null Bitmap photo = BitmapFactory.decodeStream(photoDataStream); return photo; } public class ContactInfo { private long id; private String displayName; private String phoneNumber; private Uri photoUri; public void setDisplayName(String displayName) { this.displayName = displayName; } public String getDisplayName() { return displayName; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getPhoneNumber() { return phoneNumber; } public Uri getPhotoUri() { return this.photoUri; } public void setPhotoUri(Uri photoUri) { this.photoUri = photoUri; } public long getId() { return this.id; } public void setId(long id) { this.id = id; } } } Clearly, I'm doing something wrong here, but I can't seem to figure out what the problem is. Thanks.

    Read the article

  • Incrementing value by one over a lot of rows

    - by Andy Gee
    Edit: I think the answer to my question lies in the ability to set user defined variables in MySQL through PHP - the answer by Multifarious has pointed me in this direction Currently I have a script to cycle over 10M records, it's very slow and it goes like this: I first get a block of 1000 results in an array similar to this: $matches[] = array('quality_rank'=>46732, 'db_id'=>5532); $matches[] = array('quality_rank'=>12324, 'db_id'=>1234); $matches[] = array('quality_rank'=>45235, 'db_id'=>8345); $matches[] = array('quality_rank'=>75543, 'db_id'=>2562); I then cycle through them one by one and update the record $mult = count($matches)*2; foreach($matches as $m) { $rank++; $score = (($m[quality_rank] + $rank)/($mult))*100; $s = "UPDATE `packages_sorted` SET `price_rank` = '".$rank."', `deal_score` = '".$score."' WHERE `db_id` = '".$m[db_id]."' LIMIT 1"; } It seems like this is a very slow way of doing it but I can't find another way to increment the field price_rank by one each time. Can anyone suggest a better method. Note: Although I wouldn't usually store this kind of value in a database I really do need on this occasion for comparison search queries later on in the project. Any help would be kindly appreciated :)

    Read the article

  • xsl key - multiple levels for an element

    - by user1004770
    My previous post was not very meaningful. reposting here. What i am looking for is the QueueManager element, under SORRegion name="default"(which is the parent), within inan.xml. I have used xsl key. In my xsl the value 'default' is hardcoded. here is the xsl i used <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output omit-xml-declaration="yes" indent="yes" method="xml" /> <xsl:key name="CR-lookup" match="Service" use="concat(@ServiceName, '+', SOR/@SORname, '+', */CountryCode/@Ctrycd, '+', */*/SORRegion/@name, '+', */*/*/ConsumerName/@name)"/> <xsl:variable name="CRTable" select="document('inan.xml')"/> <xsl:template match="/"> <Contributor> <ContributorRole> <xsl:for-each select="$CRTable"> <!-- change context document --> <xsl:for-each select="key('CR-lookup', concat('StatementIndicatorsService', '+', 'Globestar', '+', '124', '+', 'default', '+', 'MYCA'))"> <a> <xsl:value-of select="*/*/*/*/QueueManager"/> </a> </xsl:for-each> </xsl:for-each> </ContributorRole> </Contributor> </xsl:template> </xsl:stylesheet> any input xml file is fine. here is my actual output <Contributor> <ContributorRole /> </Contributor> expected output <Contributor> <ContributorRole> <a>MAO1</a> </ContributorRole> </Contributor> inan.xml document <RoutingDetails> <Service ServiceName="StatementIndicatorsService"> <SOR SORname="Globestar"> <CountryCode Ctrycd="124"> <SORRegion name="Test"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146B</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146C</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.ICS.DP.DHIPO211.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="default"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.ICS.DP.DHIPO211.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="CICDKBX1"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.ICS.DP.DHIPO211.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="CICDKAX4"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.GDAS.DHIPO204.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="CICDKEX7"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.ICS.DP.DHIPO247.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> </CountryCode> <CountryCode Ctrycd="826"> <SORRegion name="Test"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.ICS.DP.DHIPO211.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="default"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.ICS.DP.DHIPO211.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="CICDKBX1"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.ICS.DP.DHIPO211.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="CICDKAX4"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.GDAS.DHIPO204.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="CICDKEX7"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA1146A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA1146A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.GDAS.DHIPO247.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> </CountryCode> <CountryCode Ctrycd="724"> <SORRegion name="Test"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA4248A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA4248A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.GDAS.DHIPO239.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="default"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA4248A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA4248A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.GDAS.DHIPO239.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="CICDKBX1"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA4248A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA4248A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.ICS.DP.DHIPO211.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="CICDKAX4"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA4248A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA4248A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.GDAS.DHIPO204.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> <SORRegion name="CICDKEX7"> <ConsumerName name="MYCA"> <AutomationIds> <PreAutoId> <AutomationId>XA4248A</AutomationId> <AutomationId>XA1146A</AutomationId> </PreAutoId> <DefaultAutoId> <AutomationId>XA4248A</AutomationId> </DefaultAutoId> </AutomationIds> </ConsumerName> <QueueDetails> <QueueManager>MAO1</QueueManager> <ReplyQueueManager>MAO1</ReplyQueueManager> <RequestQueue>GSTAR.GDAS.DHIPO247.REQUEST</RequestQueue> <ReplyQueue>ICS.DP.REPLY</ReplyQueue> </QueueDetails> </SORRegion> </CountryCode> </SOR> </Service> </RoutingDetails>

    Read the article

  • How can I join 3 tables with mysql & php?

    - by steven
    check out the page [url]http://www.mujak.com/test/test3.php[/url] It pulls the users Post,username,xbc/xlk tags etc which is perfect... BUT since I am pulling information from a MyBB bulletin board system, its quite different. When replying, people are are allowed to change the "Thread Subject" by simplying replying and changing it. I dont want it to SHOW the changed subject title, just the original title of all posts in that thread. By default it repies with "RE:thread title". They can easily edit this and it will show up in the "Subject" cell & people wont know which thread it was posted in because they changed their thread to when replying to the post. So I just want to keep the orginial thread title when they are replying. Make sense~?? Tables:mybb_users Fields:uid,username Tables:mybb_userfields Fields:ufid Tables:mybb_posts Fields:pid,tid,replyto,subject,ufid,username,uid,message Tables:mybb_threads Fields:tid,fid,subject,uid,username,lastpost,lastposter,lastposteruid I haev tried multiple queries with no success: $result = mysql_query(" SELECT * FROM mybb_users LEFT JOIN (mybb_posts, mybb_userfields, mybb_threads) ON ( mybb_userfields.ufid=mybb_posts.uid AND mybb_threads.tid=mybb_posts.tid AND mybb_users.uid=mybb_userfields.ufid ) WHERE mybb_posts.fid=42"); $result = mysql_query(" SELECT * FROM mybb_users LEFT JOIN (mybb_posts, mybb_userfields, mybb_threads) ON ( mybb_userfields.ufid=mybb_posts.uid AND mybb_threads.tid=mybb_posts.tid AND mybb_users.uid=mybb_posts.uid ) WHERE mybb_threads.fid=42"); $result = mysql_query(" SELECT * FROM mybb_posts LEFT JOIN (mybb_userfields, mybb_threads) ON ( mybb_userfields.ufid=mybb_posts.uid AND mybb_threads.tid=mybb_posts.tid ) WHERE mybb_posts.fid=42");

    Read the article

  • What is the best logging solution for a C# .NET 3.5 project?

    - by Odd
    My team is about to start a new enterprise wide ASP.NET development project, quite possibly the largest undertaken by my department so far and the largest project that I've ever worked on. I'm looking for a good logging solution for the system. Firstly, what logging tools are currently available and widely used? Secondly, for an ASP.NET (probably MVC) enterprise applicaiton, which tool is most appropriate based on your experience? So far I've used Log4net almost exclusively for all my previous projects. It's a fantastic tool, however I would like to see if there is anything I've not used out there before I start a project of this magnitude or if there is any reason I would not want to use Log4net for a project of this size.

    Read the article

  • How to display an icon on JOptionPane.showInputDialog() in Java?

    - by Lion
    The following segment of code shows JOptionPane.showInputDialog() method. It works fine but I need to display a custom icon on it. I currently left it null as shown below. String operatingSystem = System.getProperty("os.name"); Object o[] = {"Turn Off", "Restart", "Stand By", "Log Off"}; Frame frame = new Frame(operatingSystem); Object selectedValue = JOptionPane.showInputDialog(frame, "What would you like to do with the system?", "Select a task", JOptionPane.INFORMATION_MESSAGE, null, o, o[0]); //<---- Here it is. How can an icon be displayed on it replacing null?

    Read the article

  • Qt releasing memory occopied by unneeded images

    - by Gerhman
    I have a QML Flickable with 3 QML image elements that cycle through 8 image files. My problem is for each new image it loads into memory it does not release the the unused image. This is causing memory usage to become double what is necessary at times. I would like to know if there is some function I can use to force it to unload all the unused images? If it makes a difference, this is mainly for Symbian.

    Read the article

  • How to join 2 tables & display them correctly?

    - by steven
    http://img293.imageshack.us/img293/857/tablez.jpg Here is a picture of the 2 tables. The mybb_users table is the table that has the users that signed up for the forum. The mybb_userfields is the table that contain custom profile field data that they are able to customize & change in their profile. Now, all I want to do is display all users in rows with the custom profile field data that they provided in their profile(which is in the mybb_userfields table) How can I display these fields correctly together? For instance, p0gz is a male,lives in AZ,he owns a 360,does not know his bandwidth & Flip Side Phoenix is his team. How can it just be like "p0gz-male-az-360-dont know-flipside phoenix" in a row~???

    Read the article

  • fire click event for button

    - by Hadas
    I have column with buttons like this: var grid = new Ext.grid.GridPanel({ store: store, columns: [ { header: 'Issue',renderer: function(val){ return '<input type="button" class="btnissue" value="Issue" />'; }, dataIndex: 'btn', width: 49 } ], renderTo: Ext.get('Issuing') }); and I want to fire click event for this buttons. if I write : Ext.getCmp('btnissue').on('click',function(){ alert("message"); }); It say the button not exist. So how can I fire this event?

    Read the article

  • CQRS without using others patterns

    - by John Smith
    I would like to explain CQRS to my team of developers. I just can't figure out how to explain it in the simplest way so they can implement the pattern rapidly without any others frameworks. I've read a lot of resources including video and articles but I don't find how to implement CQRS without using others patterns like a service Bus, event sourcing pattern, domain driven design. I know the purpose of these pattern but for the first step, I don't want them to think CQRS and theses patterns must be tied together. My first idea is to say that CQRS is about separating the read part and the write part. The read part is composed only of the UI project, and DAL project. Then the write part is composed of a typical multilayer architecture: UI/BLL/DAL. Then, does CQRS say we must also have two datastore ? What about the notion of commands which reveal the user's intention, is it also something part of CQRS or DDD ? Basically, how to implement CQRS without using others patterns. I concede it's also not that clear in my mind because I've used to work with NCQRS/DDD/Event Sourcing/ServiceBus in my personal project. Thanks

    Read the article

  • LINQ XML query at c# wp7

    - by Karloss
    I am working at Windows Phone 7 C#, Xaml, XML and LINQ programming. I need to organize search by part of the name at following XML: <Row> <Myday>23</Myday> <Mymonth>12</Mymonth> <Mynames>Alex, Joanna, Jim</Mynames> </Row> <Row> <Myday>24</Myday> <Mymonth>12</Mymonth> <Mynames>John, David</Mynames> </Row> I have following query: var myData = from query in loadedData.Descendants("Row") where query.Element("Mynames").Value.Contains("Jo") select new Kalendars { Myday = (int)query.Element("Myday"), Mymonth = (int)query.Element("Mymonth"), Mynames = (string)query.Element("Mynames") }; listBoxSearch.ItemsSource = myData; Query problem is, that it will return full part of the names like "Alex, Joanna, Jim" and "John, David". How can i get only Joanna and John? Second question is how it is possible to do that user enters ...Value.Contains("jo") and query still returns Joanna and John? Possible solution (needs some corrections) public string Search_names { get { return search_names; } set { string line = this.Mynames; string[] names = line.Split(new[] { ", " }, StringSplitOptions.None); var jos = from name in names where name.Contains("is") select name; // ["Joanna"] // HOW TO BIND search_names? } }

    Read the article

  • How can I prompt for input using Selenium/Webdriver and use the result?

    - by Tempus
    I would like to allow for user input and make some decisions based on it. If I do this: driver.execute_script("prompt('Enter smth','smth')") I get a nice prompt, but I cannot use it's value. Is there any way of showing an input box to the user, and use the value typed there? EDIT: This is my script: from selenium.webdriver import Firefox if __name__ == "__main__": driver = Firefox() driver.execute_script("window.promptResponse=prompt('Enter smth','smth')") a = driver.execute_script("var win = this.browserbot.getUserWindow(); return win.promptResponse") print "got back %s" % a And this exits with the following exception: a = driver.execute_script("var win = this.browserbot.getUserWindow(); return win.promptResponse") File "c:\python26\lib\site-packages\selenium-2.12.1-py2.6.egg\selenium\webdriver\remote\webdriver.py", line 385, in ex ecute_script {'script': script, 'args':converted_args})['value'] File "c:\python26\lib\site-packages\selenium-2.12.1-py2.6.egg\selenium\webdriver\remote\webdriver.py", line 153, in ex ecute self.error_handler.check_response(response) File "c:\python26\lib\site-packages\selenium-2.12.1-py2.6.egg\selenium\webdriver\remote\errorhandler.py", line 110, in check_response if 'message' in value: TypeError: argument of type 'NoneType' is not iterable What am I not doing right?

    Read the article

  • WPF component for 2D tree diagram

    - by pdm2011
    I'm looking for a well-documented, supported WPF component that provides an API for visualisation of 2D tree diagrams. Ideally something easy to use, customisable (i.e. supports various flavours of nodes and splines) and preferably with automated layout control. Tools that look good so far are GoXam (http://www.nwoods.com/components/silverlight-wpf/goxam-overview.htm) and yFiles WPF (http://www.yworks.com/en/products_yfileswpf_about.html). Just wondering if anyone has experience with either of these, or can recommend an alternative? Thanks!

    Read the article

  • -(void)... does not work/appeal (iOS)

    - by user1012535
    Hi I've got a problem with my -(void) in my Xcode project for iOS. First of all here is the code ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController { IBOutlet UIWebView *webview; IBOutlet UIActivityIndicatorView *active; UIAlertView *alert_start; UIAlertView *alert_error; } -(IBAction)tele_button:(id)sender; -(IBAction)mail_button:(id)sender; -(IBAction)web_button:(id)sender; -(IBAction)news_button:(id)sender; @end ViewController.m #import "ViewController.h" @implementation ViewController - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; //Stop Bounce for WebView for (id subview in webview.subviews) if ([[subview class] isSubclassOfClass: [UIScrollView class]]) ((UIScrollView *)subview).bounces = NO; //First Start Alert [alert_start show]; NSLog(@"first alert"); NSString *start_alert = [[NSUserDefaults standardUserDefaults] objectForKey:@"alert_start"]; if(start_alert == nil) { [[NSUserDefaults standardUserDefaults] setValue:@"1" forKey:@"alert_start"]; [[NSUserDefaults standardUserDefaults] synchronize]; UIAlertView *alert_start = [[UIAlertView alloc] initWithTitle:@"iOptibelt" message:@"On some points this application need a internet connection." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert_start show]; [alert_start release]; } // Do any additional setup after loading the view, typically from a nib. [webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"home-de" ofType:@"html"]isDirectory:NO]]]; NSLog(@"webview fertig"); } -(void)webViewDidStartLoad:(UIWebView *) webview { [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [active startAnimating]; NSLog(@"lade"); } -(void)webViewDidFinishLoad:(UIWebView *) webview { [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; [active stopAnimating]; NSLog(@"fertig"); } -(void)webView: (UIWebView *) webview didFailLoadWithError:(NSError *)error{ NSLog(@"lade error"); UIAlertView *alert_error = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Can't connect. Please check your internet Connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert_error show]; [alert_error release]; }; - (IBAction)tele_button:(id)sender{ NSLog(@"it's connected!"); //Local HTML Call Button NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"phone" ofType:@"html"]isDirectory:NO]]; [webview loadRequest:theRequest]; } - (IBAction)mail_button:(id)sender{ NSLog(@"it's connected!"); //Mail App Mail Button [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://[email protected]"]]; } - (IBAction)web_button:(id)sender{ NSLog(@"it's connected!"); //Local HTML Button NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString: @"http://optibelt.com"]]; [webview loadRequest:theRequest]; } - (IBAction)news_button:(id)sender{ NSLog(@"it's connected!"); //local Home Button NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"home-de" ofType:@"html"]isDirectory:NO]]; [webview loadRequest:theRequest]; } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } @end At last my 3. -(void) does not work and i ve no more idea what could be the problem.... -(void)webViewDidStartLoad:(UIWebView *) webview { [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [active startAnimating]; NSLog(@"lade"); } -(void)webViewDidFinishLoad:(UIWebView *) webview { [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; [active stopAnimating]; NSLog(@"fertig"); } -(void)webView: (UIWebView *) webview didFailLoadWithError:(NSError *)error{ NSLog(@"lade error"); UIAlertView *alert_error = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Can't connect. Please check your internet Connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert_error show]; [alert_error release];

    Read the article

  • Getting OpenID to work on an existing MyBB Install

    - by Djdoubt03
    I am the administrator for a forum,The Vortex. It operates on the latest version of MyBB ver1.6.3. I would like to know how I can get OpenID to become the login for the forums, and also add the users to the MyBB Sql file and overwrite any users that are already registered. This must work on an existing install as I will not be dumping my SQL database to do a fresh install just to get OpenId to work. Any Thought?

    Read the article

  • PageableListView Not rendering my data as required

    - by Robin
    i am working on wicket, where i am supposed to show my data's under <tr> <td>Name</td> <td>Single Player Score</td> <td>Double Player Score</td> <td>Total Score</td> </tr> <tr wicket:id="data"> <td wicket:id="name"></td> <td wicket:id="singlePlayerScore"></td> <td wicket:id="doublePlayerScore"></td> <td wicket:id="totalScore"></td> </tr> My Player model class is as: Player class with attributes singlePlayerScore, doublePlayerScore(), name with getter and setter and also a list data obtained from database. Data from SQLQuery is as; name score gamemode A 200 singlePlayerMode A 100 doublePLayerMode B 400 singlePlayerMode B 300 doublePLayerMode dataList == player.getScoreList(); My PageableListView is as: final PageableListView listView = new PageableListView("data",dataList,10){ @Override protected void populateItem(Item item){ player = (Player)item.getModelObject(); item.add(Label("name",player.getName())); item.add(Label("singlePlayerScore",player.getName())); item.add(Label("doublePlayerScore",player.getName())); item.add(Label("totalScore",String.valueOf(player.getSinglePlayerScore()+player.getDoublePlayerScore()))); } } My Problem is as: What view i get is as: Name single Player Score Double Player Score Total Score A 0 100 100 A 200 0 200 B 0 300 300 B 400 0 400 How do i achieve below view on my webpage? Name single Player Score Double Player Score Total Score A 200 100 300 B 400 300 700 Please help me as to why is this happening? I guess my list has size four that's one reason why as to it is rendering the view? So what can i do to get as require rendering view?

    Read the article

  • {DCC Warning} W1036 Variable '$frame' might not have been initialized?

    - by Gad D Lord
    Any ideas why I get this warning in Delphi XE: [DCC Warning] Form1.pas(250): W1036 Variable '$frame' might not have been initialized procedure TForm1.Action1Execute(Sender: TObject); var Thread: TThread; begin ... Thread := TThread.CreateAnonymousThread( procedure{Anonymos}() procedure ShowLoading(const Show: Boolean); begin /// <------------- WARNING IS GIVEN FOR THIS LINE (line number 250) Thread.Synchronize(Thread, procedure{Anonymous}() begin ... Button1.Enabled := not Show; ... end ); end; var i: Integer; begin ShowLoading(true); try Thread.Synchronize(Thread, procedure{Anonymous}() begin ... // some UI updates end Thread.Synchronize(Thread, procedure{Anonymous}() begin ... // some UI updates end ); finally ShowLoading(false); end; end ).NameThread('Some Thread Name'); Thread.Start; end; I do not have anywhere in my code a variable names frame nor $frame. I am even not sure how $frame with $ sign can be a valid identifier. Smells like compiler magic to me. PS: Of course the real life xosw is having other than Form1, Button1, Action1 names.

    Read the article

  • In mysql I want to set lower_case_table_names=1 on existing databases to avoid cases-sensitivity issues accross multiple platforms

    - by sakhunzai
    In mysql I want to set lower_case_table_names=1 on existing databases to avoid cases-sensitivity issues accross multiple platforms. A) What are the risks ?( besides show table issue) B) After setting lower_case_table_names=1, will I be in position to query databases across multiple platforms consistantly ? select * from USERS == select * from users; C) How the triggers + stored procedure + functions + views + events will be affected in this regards. I know lower_case_table_names is only for "TABLE" names but how about triggers other database objects . Will they remain case-insensitive How about views ? D) Do I need to rename all tables before/after this configuration setting or this will do the miracle in one step (i.e lower_case_table_names=1 neutralize table names) ? E) What will be the exact steps WRT:mysqd / my.ini ?

    Read the article

  • Using SSH to find access to a problematic script in logs of multiple domains

    - by Hanan Cohen
    I run several (~20) sites on a Dreamhost VPS. Lately I max my memory allocation for the VPS and I want to find the problem. I would like to have an SSH script that will scan all the log files of all the domains and show me what object (image, php script etc) gets lots of calls. It will count the calls in each /logs/*/http/access.log, do an descending sort and show me the top 10 across domains. But I don't know how to do that. Can it be done? Can anyone suggest a script that will do that? Thanks. (Cross posted to Stack Overflow)

    Read the article

  • Applications not installing due to unmet dependencies

    - by Vineet Sharma
    I was running Apache on Linode. I recently shifted to Lighttpd and removed apache, now whenever I try to install any application I get the following error. ivineet:~# apt-get install subversion Reading package lists... Done Building dependency tree Reading state information... Done You might want to run `apt-get -f install' to correct these: The following packages have unmet dependencies: libapache2-mod-php5: Depends: apache2-mpm-prefork (> 2.0.52) but it is not going to be installed or apache2-mpm-itk but it is not going to be installed subversion: Depends: libsvn1 (= 1.6.12dfsg-6) but it is not going to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). ivineet:~#

    Read the article

  • Apache 2 with Weblogic Plug-in Redirection, original location still requested to backend

    - by Edo
    We're trying to setup an SSL server in front of a Weblogic server using Apache as the SSL provider. Here's what's inside of our httpd.conf: <Location /original> SetHandler weblogic-handler WebLogicHost 10.11.1.1 WebLogicPort 8700 PathTrim /original PathPrepend /destination ConnectTimeoutSecs 60 </Location> <Location /destination> SetHandler weblogic-handler WebLogicHost 10.11.1.1 WebLogicPort 8700 ConnectTimeoutSecs 60 </Location> This setup works mostly, but in the ssl_error_log file there're these entries: [Wed Aug 11 14:59:00 2010] [error] [client xxx.xxx.xxx.xxx] ap_proxy: trying GET /original at backend host '10.11.1.1/8700; got exception 'CONNECTION_REFUSED [os error=0, line 1739 of ../nsapi/URL.cpp]: Error connecting to host 10.11.1.1:8700' The weird thing is, the redirection still works, but these annoying entries still shows up. Anyone can point out where did we go wrong? Thanks.

    Read the article

  • Why is Perl Cgiwrap Sock refusing connection to nginx?

    - by Emmanuel
    Could anyone shed some light on the following line in my nginx error logs. I'm trying to get Perl and Nginx talking to each other, but so far no success. unix:/var/run/nginx/cgiwrap-dispatch.sock failed (111: Connection refused)2011/11/20 09:18:34 [error] 24054#0: *1186 connect() to unix:/var/run/nginx/cgiwrap-dispatch.sock failed (111: Connection refused) while connecting to upstream, client: 150.101.221.75, server: example.com, request: "GET /dspam.cgi HTTP/1.1", upstream: "fastcgi://unix:/var/run/nginx/cgiwrap-dispatch.sock:", host: "example.com" The relevant nginx configs. location ~ \.cgi$ { gzip off; include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_index index.pl; fastcgi_param SCRIPT_FILENAME /var/www/dspam$fastcgi_script_name; }

    Read the article

  • IP Phone over VPN - one way calls unless default route?

    - by dannymcc
    I have come across a strange problem with our VPN and BCM 50 (Nortel/Avaya) phone system. As you can tell by my other questions I have been doing some work on setting a VPN up from one location to another and it's all working well. With one exception. We have an IP phone that is connected at the remote location, straight to a router which has a VPN tunnel to our main practice. The phone works mostly, but every few calls it turns into a one way call. As in, the caller (from the remote phone) can't hear the receiver- but the receiver can hear the caller. This is fixed by setting the VPN tunnel to be the default route for all traffic. The problem with fixing it that way is that all traffic then goes through the tunnel which slows internet access etc. down considerably. The router is set to send the following over the VPN: 192.168.1.0/24 192.168.2.0/24 192.168.4.0/24 The IP of the remote location is: 192.168.3.0/24 The remote router (where the phone is) is a Draytek 2830n, and the local router (at the main practice) is a Draytek 2820. We are using an IPSec tunnel with AES encryption <- as a result of a previous answer pointing to the incompatibility in the hardware encryption. Any advice would be appreciated!

    Read the article

  • Setting up a server with only subdomains, any connection to top level goes to main server on another IP?

    - by Anagio
    I'm developing a web app where users will have their own sub-domain to login to and use the application. I'm running wordpress for the main website to manage the public / front end. Our application is developed in zend framework. The zf project is currently in a subfolder on the main server. I'd like to place the zend framework project onto another server (different IP) and keep it separate from the the wordpress front end www.domain.com site. The zf application server will run nginx. I'm not sure how to setup a server to run strictly sub domains. Setting up the virtual hosts in the configuration file is no problem. To give the users username.domain.com. But what about the main default configuration file? How would that be configured since the top level domain is technically another server (wordpress) on another IP?

    Read the article

  • Links break in IE9 when using Wordpress plugins in non Wordpress Page

    - by mouli
    I have a site that uses SEF URLs and htaccess RewriteRules to serve up the pages. This has worked fine for several years until the arrival of IE9. Now it appears that the links are not being rewritten and the site is dead in the water. I have tried different compatabilty modes, to no avail, and I've played with the Rewrite Rules over and over, tried different doctypes and a few other browser settings. I agree that it cannot in theory be a browser specific problem if the problem is with the htaccess file but this site works in IE8, firefox and chrome. I have run the rewriterule through a validator and it looks fine. Any ideas would be appreciated as I am running out of ideas. The site is www.marlboroughsounds.co.nz a sample link is http://www.marlboroughsounds.co.nz/walking/freedom-walk-queen-charlotte-track/4dfw and the rewrite rule thats not working looks like this: RewriteRule ^walking/.*/([a-z0-9_]*)/?$ /walking.php?act_code=$1 [L] The link fails and it serves up a browser 404 page, not even the custom 404 I have for the site. Any ideas would be much appreciated as I am stumped.

    Read the article

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