Search Results

Search found 450 results on 18 pages for 'vincent chan'.

Page 11/18 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Ruby/Rails display general screen when modifications being performed on server

    - by john chan
    I have a ruby on rails app running a server and sometimes it needs to be taken down for updates/etc. As of now, one way I see to have a general display screen during update periods (when the app is down) is to substitute the files within /srv/www/ directory to just have it display a general screen everywhere that the user could possibly navigate to. I also thought of having a central controller file that connects all others (essentially a main) but this seems counter intuitive for rails. There are many external links to these different components of the site that the user could navigate to from outside and I need to make sure that they always receive this general update screen when the app is taken down for a little. I was wondering if anyone had any other ideas.... maybe a library or something like that, I can't seem to find anything online. any suggestions would be appreciated. Thanks

    Read the article

  • powershell / runspace in a thread

    - by Vincent
    Hello ! I'm running the following code : RunspaceConfiguration config = RunspaceConfiguration.Create(); PSSnapInException warning; config.AddPSSnapIn("Microsoft.Exchange.Management.PowerShell.Admin", out warning); if (warning != null) throw warning; Runspace thisRunspace = RunspaceFactory.CreateRunspace(config); thisRunspace.Open(); string alias = usr.AD.CN.Replace(' ', '.'); string letter = usr.AD.CN.Substring(0, 1); string email = alias + "@" + (!usr.Mdph ? Constantes.AD_DOMAIN : Constantes.MDPH_DOMAIN) + "." + Constantes.AD_LANG; string db = "CN=IS-" + letter + ",CN=SG-" + letter + ",CN=InformationStore,CN=" + ((char)letter.ToCharArray()[0] < 'K' ? Constantes.EXC_SRVC : Constantes.EXC_SRVD) + Constantes.EXC_DBMEL; string cmd = "Enable-Mailbox -Identity \"" + usr.AD.CN + "\" -Alias " + alias + " -PrimarySmtpAddress " + email + " -DisplayName \"" + usr.AD.CN + "\" -Database \"" + db + "\""; Pipeline thisPipeline = thisRunspace.CreatePipeline(cmd); thisPipeline.Invoke(); The code is running in a thread created that way : t.WorkThread = new Thread(cu.CreerUser); t.WorkThread.Start(); If I run the code directly (not through a thread), it's working. When in a thread it throws the following exception : ObjectDisposedException "The safe handle has been closed." (Translated from french) I then replaced "Open" wirh "OpenAsync" which helped not getting the previous exception. But when on Invoke I get the following exception : InvalidRunspaceStateException "Unable to call the pipeline because its state of execution is not Opened. Its current state is Opening." (Also translated from french) I'm clueless... Any help welcome !!! Thanks !!!

    Read the article

  • Get ListView Visible items

    - by Vincent Piel
    I have a ListView which might contains a lot of items, so it is virtualized and recycling items. It does not use sort. I need to refresh some value display, but when there are too many items, it is too slow to update everything, so I would like to refresh only the visible items. How could I get a list of all currently displayed items ? I tried to look into the ListView or in the ScrollViewer, but I still have no idea how to achieve this. The solution must NOT go through all items to test if they can be seen, because this would be too slow. I'm not sure code or xaml would be usefull, it is just a Virtualized/Recycling ListView with its ItemSource bound to an Array. Edit Answer : thanks to akjoshi, i found the way : get the ScrollViewer of the ListView (with a FindDescendant method, that you can do yourself with the VisualTreeHelper ). Then use its ScrollViewer.VerticalOffset : it is the number of the first item shown and ScrollViewer.ViewportHeight : it is the count of items shown. Rq : CanContentScroll must be true.

    Read the article

  • Browser Detection and Zend MVC

    - by Vincent
    I have a PHP application using Zend MVC framework. The entry point for every request to the application is in /public/index.php. I have a Browser class that has functions to check if the user's browser is compatible with application or not. My dilemma is, index.php is executed for every controller call. So there are chances that this file gets executed multiple times within the same page and hence redirection becomes an issue. What's the best way to solve the looping issue? Thanks

    Read the article

  • Calculating pi using infinite series in C#

    - by Jonathan Chan
    Hi! I tried to write the following program in C# to calculate pi using infinite recursion, but I keep getting confused about integer/double/decimal division. I really have no clue why this isn't working, so pardon me for my lack of understanding of strongly typed stuff, as I'm still learning C#. Thanks in advance! using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { public static int Main(string[] args) { int numeratornext = 2; int denominatornext = 5; decimal findto = 100.0M; decimal pi = 0.0M; decimal halfpi = 1.0M; int seriesnum = 1; int seriesden = 3; for (int i = 0; i < findto; i++) { halfpi += Decimal.Divide((decimal)seriesnum, (decimal)seriesden); //System.Console.WriteLine(Decimal.Divide((decimal)seriesnum, (decimal)seriesden).ToString()); seriesnum *= numeratornext; seriesden *= denominatornext; numeratornext++; denominatornext += 2; } pi = halfpi * 2; System.Console.WriteLine(pi.ToString()); System.Console.ReadLine(); return 0; } } }

    Read the article

  • Update JQuery Progressbar with JSON Response in an ajax Request

    - by Vincent
    All, I have an AJAX request, which makes a JSON request to a server, to get the sync status. The JSON Request and responses are as under: I want to display a JQuery UI progressbar and update the progressbar status, as per the percentage returned in the getStatus JSON response. If the status is "insync", then the progressbar should not appear and a message should be displayed instead. Ex: "Server is in Sync". How can I do this? //JSON Request to getStatus { "header": { "type": "request" }, "payload": [ { "data": null, "header": { "action": "load", } } ] } //JSON Response of getStatus (When status not 100%) { "header": { "type": "response", "result": 400 }, "payload": [ { "header": { "result": 400 }, "data": { "status": "pending", "percent": 20 } } ] } //JSON Response of getStatus (When percent is 100%) { "header": { "type": "response", "result": 400 }, "payload": [ { "header": { "result": 400 }, "data": { "status": "insync" } } ] }

    Read the article

  • PHP 5.3 SOAP deprecated errors

    - by Vincent
    All, I am using PHP 5.3.1 under Ubuntu and using the SOAP package. I am getting the following errors when I include SOAP/Client.php. Any one knows how to get this working? Thanks Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/SOAP/WSDL.php on line 214 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/SOAP/WSDL.php on line 791 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/SOAP/WSDL.php on line 1159 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/SOAP/WSDL.php on line 1685 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/HTTP/Request.php on line 228 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/HTTP/Request.php on line 324 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/HTTP/Request.php on line 602 Deprecated: Assigning the return value of new by reference is deprecated in /opt/lampp/lib/php/HTTP/Request.php on line 621 Strict Standards: Redefining already defined constructor for class Net_URL in /opt/lampp/lib/php/Net/URL.php on line 122

    Read the article

  • Using Zend_HTTP_Client instead of CURL

    - by Vincent
    All, I want to use Zend_HTTP_CLient instead of CURL as there are issues with using curl on Solaris. I have the following curl code.. How will this code be written if I want to use Zend_HTTP_Client? $ch = curl_init(); $devnull = fopen('/tmp/cookie.txt', 'w'); curl_setopt($ch, CURLOPT_STDERR, $devnull); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL, $desturl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,800); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); $retVal = curl_exec($ch); print_r(curl_error($ch)); curl_close($ch); if ($devnull) { fclose($devnull); } Thanks

    Read the article

  • PHP Browser Detection and Redirection

    - by Vincent
    All, My application supports IE7+, MOZILLA and other modern browsers. Anybody know of a very good browser detection and redirection PHP class? I came across this, but I am not sure if anybody used this: http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php/#typicalusage Thanks

    Read the article

  • Android: Dialog themed activity not visible

    - by Vincent
    I have an activity which, when started, needs to check if the user is authenticated. If not, I need to display an interface to authenticate. I do this with another activity, which has a dialog theme, and I start it in onResume() with flags NO_HISTORY and EXCLUDE_FROM_RECENTS. Everything works fine when starting the application for the first time. But I have a feature that resets login after some time, if the user is not in an activity. When I test this, I start the applicatio, enter the password, then move back to home. Then when I enter the application again, the background darkens as if the dialog would show, but it doesn't. At this point, if I press the back button, the darkening from the background activity disappears for a second, then the dialog finally appears. I used logcat to investigate the case, and the activity lifecycle functions get called properly: //For the first start: onCreate background activity onStart background activity onResume background activity onPause background activity onCreate dialog onStart dialog onResume dialog //Enter password onPause dialog onResume background activity onStop dialog onDestroy dialog //navigating to homescreen onPause background activity onStop background activity //starting again onRestart background activity onStart background activity onResume background activity onPause background activity onCreate dialog onStart dialog onResume dialog //no dialog shown, only darkened background activity recieving no input //pressing back button onPause dialog onResume background activity onPause background activity onCreate NEW dialog onStart NEW dialog onResume NEW dialog onStop OLD dialog onDestroy OLD dialog //now the dialog is properly shown //entering password onPause NEW dialog onResume background activity onStop NEW dialog onDestroy NEW dialog Using the SINGLE_TOP flag makes no change. However, if I remove the dialog theme from the dialog activity, it IS shown after the restart. So far I didn't want to use a Dialog instead of an Activity, because I consider them problematic sometimes and less encapsulated and this part has to be quite secure. You may be able to convince me though.. Thank you in advance!

    Read the article

  • UVA #10410 Tree Reconstruction

    - by Vincent
    I have worked on UVA 10410 Tree Reconstruction several days. But I can't get the correct answer unitl now. I have used an algorithm similar to the one which we always use to recovery a binary tree through the preorder traversal and the inorder traversal. But it can't work. Can anyone help me? Thanks in advance.

    Read the article

  • Zend Server with xampp MySQL

    - by Vincent
    I am running Zend Server,Zend Studio (Trial versions) on Ubuntu 9.10. I am also using xampp to do most of my development. I plan to use Zend Server only to do URL profiling to know function level performance of my code. Is it possible to configure Zend Server to use XAMPP's MySQL database instead of installing a new mysql instance for Zend Server? Thanks

    Read the article

  • CURL - HTTPS Wierd error

    - by Vincent
    All, I am having trouble requesting info from HTTPS site using CURL and PHP. I am using Solaris 10. It so happens that sometimes it works and sometimes it doesn't. I am not sure what is the cause. If it doesn't work, this is the entry recorded in the verbose log: * About to connect() to 10.10.101.12 port 443 (#0) * Trying 10.10.101.12... * connected * Connected to 10.10.101.12 (10.10.101.12) port 443 (#0) * error setting certificate verify locations, continuing anyway: * CAfile: /etc/opt/webstack/curl/curlCA CApath: none * error:80089077:lib(128):func(137):reason(119) * Closing connection #0 If it works, this is the entry recorded in the verbose log: * About to connect() to 10.10.101.12 port 443 (#0) * Trying 10.10.101.12... * connected * Connected to 10.10.101.12 (10.10.101.12) port 443 (#0) * error setting certificate verify locations, continuing anyway: * CAfile: /etc/opt/webstack/curl/curlCA CApath: none * SSL connection using DHE-RSA-AES256-SHA * Server certificate: * subject: C=CA, ST=British Columnbia, L=Vancouver, O=google, OU=FDN, CN=g.googlenet.com, [email protected] * start date: 2007-07-24 23:06:32 GMT * expire date: 2027-09-07 23:06:32 GMT * issuer: C=US, ST=California, L=Sunnyvale, O=Google, OU=Certificate Authority, CN=support, [email protected] * SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway. > POST /gportal/gpmgr HTTP/1.1^M Host: 10.10.101.12^M Accept: */*^M Accept-Encoding: gzip,deflate^M Content-Length: 1623^M Content-Type: application/x-www-form-urlencoded^M Expect: 100-continue^M ^M < HTTP/1.1 100 Continue^M < HTTP/1.1 200 OK^M < Date: Wed, 28 Apr 2010 21:56:15 GMT^M < Server: Apache^M < Cache-Control: no-cache^M < Pragma: no-cache^M < Vary: Accept-Encoding^M < Content-Encoding: gzip^M < Content-Length: 1453^M < Content-Type: application/json^M < ^M * Connection #0 to host 10.10.101.12 left intact * Closing connection #0 My CURL options are as under: $ch = curl_init(); $devnull = fopen('/tmp/curlcookie.txt', 'w'); $fp_err = fopen('/tmp/verbose_file.txt', 'ab+'); fwrite($fp_err, date('Y-m-d H:i:s')."\n\n"); curl_setopt($ch, CURLOPT_STDERR, $devnull); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL, $desturl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,120); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt($ch, CURLOPT_VERBOSE,1); curl_setopt($ch, CURLOPT_FAILONERROR, true); curl_setopt($ch, CURLOPT_STDERR, $fp_err); $ret = curl_exec($ch); Anybody has any idea, why it works sometimes but fails mostly? Thanks

    Read the article

  • Zend DB MYSQL Wrapper

    - by Vincent
    All, I have a PHP application written in Zend Framework with MVC style. I plan to use Zend_DB to connect to the MySQL database and process queries. I am looking for a wrapper class which makes it easy to use Zend_DB class. This wrapper class will have a constructor that connects to the Mysql db using Zend_DB. It will also have a method to return a singleton instance for each and every db connection made. Something like: $pptDB = PPTDB::getInstance(); $pptDB->setFetchMode(PPTDB::FETCH_OBJ); $result = $pptDB->fetchRow('SELECT * FROM bugs WHERE bug_id = 2'); echo $result->bug_description; Where class PPTDB extends Zend_DB Is this something feasible to have? If not, how ls would you use Zend_DB in a major application? Thanks,

    Read the article

  • CURL - https - solaris

    - by Vincent
    All, I am receiving the following error when I use PHP to curl to a https site. Both PHP and the https site are hosted on Solaris. This error seems to occur occassionally but frequently. error:80089077:lib(128):func(137):reason(119) This is the curl code I am using: $ch = curl_init(); $devnull = fopen('/tmp/cookie.txt', 'w'); curl_setopt($ch, CURLOPT_STDERR, $devnull); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_URL, $desturl); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,800); curl_setopt($ch, CURLOPT_AUTOREFERER, true); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); $retVal = curl_exec($ch); print_r(curl_error($ch)); curl_close($ch); if ($devnull) { fclose($devnull); } How can I fix this error? If not, is there an alternative to curl?

    Read the article

  • Solve the IE select overlap bug

    - by Vincent Robert
    When using IE, you cannot put an absolutely positioned div over a select input element. That's because the select element is considered an ActiveX object and is on top of every HTML element in the page. I already saw people hiding selects when opening a popup div, that leads to pretty bad user experience having controls disappearing. FogBugz actually had a pretty smart solution (before v6) of turning every select into text boxes when a popup was displayed. This solved the bug and tricked the user eye but the behavior was not perfect. Another solution is in FogBugz 6 where they no more use the select element and recoded it everywhere. Last solution I currently use is messing up the IE rendering engine and force it to render the absolutely positioned div as an ActiveX element too, ensuring it can live over a select element. This is achieved by placing an invisible iframe inside the div and styling it with: #MyDiv iframe { position: absolute; z-index: -1; filter: mask(); border: 0; margin: 0; padding: 0; top: 0; left: 0; width: 9999px; height: 9999px; overflow: hidden; } Anyone has a even better solution than this one ? EDIT: The purpose of this question is as much informative as it is a real question. I find the iframe trick to be a good solution but I am still looking for improvement like removing this ugly useless iframe tag that degrade accessibility.

    Read the article

  • Jquery - Loop through Checkboxes and Multiple elements

    - by Vincent
    All, I have a set of elements like this in a form: <input type="checkbox" name="chk[140]"> <input type="hidden" value="3" name="ctcount[140]"> <input type="hidden" value="Apples" name="catname[140]"> <input type="checkbox" name="chk[142]"> <input type="hidden" value="20" name="ctcount[142]"> <input type="hidden" value="Bananas" name="catname[142]"> <input type="checkbox" name="chk[144]"> <input type="hidden" value="200" name="ctcount[144]"> <input type="hidden" value="Strawberries" name="catname[144]"> <input type="checkbox" name="chk[145]"> <input type="hidden" value="0" name="ctcount[145]"> <input type="hidden" value="Carrots" name="catname[145]"> When a user clicks a button, I want the Javascript to: 1. Loop through all the checkboxes 2. For all the checked checkboxes, 2a. Get ctcount value 2b. Get catname value 2c. If ctcount value > 50, alert a message saying "Unable to add item as max limit for 'catname' has reached. 2d. Break the loop after it encountered first ctcount value that is greater than 50. I am new to JQuery..have the following code so far: var checklimit = 50; $('#frmTest input:checkbox:checked').each(function(i) { alert(this.value); }); How do I do this using JQuery? Thanks

    Read the article

  • How to debug packet loss ?

    - by Gene Vincent
    I wrote a C++ application (running on Linux) that serves an RTP stream of about 400 kbps. To most destinations this works fine, but some destinations expericence packet loss. The problematic destinations seem to have a slower connection in common, but it should be plenty fast enough for the stream I'm sending. Since these destinations are able to receive similar RTP streams for other applications without packet loss, my application might be at fault. I already verified a few things: - in a tcpdump, I see all RTP packets going out on the sending machine - there is a UDP send buffer in place (I tried sizes between 64KB and 300KB) - the RTP packets mostly stay below 1400 bytes to avoid fragmentation What can a sending application do to minimize the possibility of packet loss and what would be the best way to debug such a situation ?

    Read the article

  • Create a screen like the iPhone home screen with Scrollview and Buttons

    - by Anthony Chan
    Hi, I'm working on a project and need to create a screen similar to the iPhone home screen: A scrollview with multiple pages A bunch of icons When not in edit mode, swipe through different pages (even I started the touch on an icon) When not in edit mode, tap an icon to do something When in edit mode, drag the icon to swap places, and even swap to different pages When in edit mode, tap an icon to remove it Previously I read from several forums that I have to subclass UIScrollview in order to have touch input for the UIViews on top of it. So I subclassed it overriding the methods to handle touches: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //If not dragging, send event to next responder if (!self.dragging) [self.nextResponder touchesBegan:touches withEvent:event]; else [super touchesBegan:touches withEvent:event]; } In general I've override the touchesBegan:, touchesMoved: and touchesEnded: methods similarly. Then in the view controller, I added to following code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; UIView *hitView = (UIView *)touch.view; if ([hitView isKindOfClass:[UIView class]]) { [hitView doSomething]; NSLog(@"touchesBegan"); } } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // Some codes to move the icons NSLog(@"touchesMoved"); } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesEnded"); } When I run the app, I have the touchesBegan method detected correctly. However, when I tried to drag the icon, the icon just moved a tiny bit and then the page started to scroll. In console, it logged with 2 or 3 "touchesMoved" message only. However, I learned from another project that it should logged tonnes of "touchesMoved" message as long as I'm still dragging on the screen. (I'm suspecting I have the delaysContentTouches set to YES, so it delays a little bit when I tried to drag the icons. After that minor delay, it sends to signal back to the scrollview to scroll through the page. Please correct me if I'm wrong.) So if any help on the code to perform the above tasks would be greatly appreciated. I've stuck in this place for nearly a week with no hope. Thanks a lot.

    Read the article

  • Zend_Soap_Client - Ignore HTTPS verification

    - by Vincent
    All, I want to use Zend_Soap_Client class to load WSDL from an HTTPS url. Currently, if I call like this, it gives me an error even if the WSDL is perfectly valid: $wsdlUrl = "https://abc.xyz.com/webservices/WeatherService.php?wsdl"; $soapClient = new Zend_Soap_Client($wsdlUrl); The error I receive is: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://abc.xyz.com/webservices /WeatherService.php?wsdl' : Start tag expected, '<' not found If I browse to the WSDL url in the browser, it loads up the WSDL just fine. I think Zend_Soap_Client is trying to validate the certificate and failing. Is there a way to set the SOAP option to ignore the HTTPS verification and just load the WSDL? Thanks

    Read the article

  • CSS for https urls

    - by Vincent
    Hello, looking for some help with images referenced within the stylesheet. I have no problems with these from non secure locations within the site but only from https. The stylesheet loads fine and displays everything correctly except for the images. example: body { margin: 0; padding: 0; background: url(/img/background_tile.gif) top left repeat-x; text-align: center; background-color: #fff; } All my css files and other image paths inside the code use relative urls to images. How can I make sure they all work fine without hard coding my image paths with https or http? I want the code to work fine with http and https. Thanks

    Read the article

  • Why I cannot get correct class of a custom class through isKindOfClass?

    - by Anthony Chan
    Hi, I've created a custom class AnimalView which is a subclass of UIView containing a UILabel and a UIImageView. @interface AnimalView : UIView { UILabel *nameLabel; UIImageView *picture; } Then I added in several AnimalView onto the ViewController.view. In the touchesBegan:withEvent: method, I wanted to detect if the touched object is an AnimalView or not. Here is the code for the viewController: @implementation AppViewController - (void)viewDidLoad { UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:... [self.view addSubview scrollview]; for (int i = 0; i<10; i++) { AnimalView *newAnimal = [[AnimalView alloc] init]; // customization of newAnimal [scrollview addSubview:newAnimal; } } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; UIView *hitView = touch.view; if ([hitView isKindOfClass:[AnimalView class]]) { AnimalView *animal = (AnimalView *)hitView; [animal doSomething]; } } However, nothing happened when I clicked on the animal. When I checked the class of hitView by NSLog(@"%@", [hitView class]), it always shows UIView instead of AnimalView. Is it true that the AnimalView changed to a UIView when it is added onto the ViewController? Is there any way I can get back the original class of a custom class?

    Read the article

  • merge() multiple data frames (do.call ?)

    - by Vincent
    Hi everyone, here's my very simple question: merge() only takes two data frames as input. I need to merge a series of data frames from a list, using the same keys for every merge operation. Given a list named "test", I want to do something like: do.call("merge", test). I could write some kind of loop, but I'm wondering if there's a standard or built-in way to do this more efficiently. Any advice is appreciated. Thanks! Here's a subset of the dataset in dput format (note that merging on country is trivial in this case, but that there are more countries in the original data): test <- list(structure(list(country = c("United States", "United States", "United States", "United States", "United States"), NY.GNS.ICTR.GN.ZS = c(13.5054687, 14.7608697, 14.1115876, 13.3389063, 12.9048351), year = c(2007, 2006, 2005, 2004, 2003)), .Names = c("country", "NY.GNS.ICTR.GN.ZS", "year"), row.names = c(NA, 5L), class = "data.frame"), structure(list( country = c("United States", "United States", "United States", "United States", "United States"), NE.TRD.GNFS.ZS = c(29.3459277, 28.352838, 26.9861939, 25.6231246, 23.6615328), year = c(2007, 2006, 2005, 2004, 2003)), .Names = c("country", "NE.TRD.GNFS.ZS", "year"), row.names = c(NA, 5L), class = "data.frame"), structure(list( country = c("United States", "United States", "United States", "United States", "United States"), NY.GDP.MKTP.CD = c(1.37416e+13, 1.31165e+13, 1.23641e+13, 1.16309e+13, 1.0908e+13), year = c(2007, 2006, 2005, 2004, 2003)), .Names = c("country", "NY.GDP.MKTP.CD", "year"), row.names = c(NA, 5L), class = "data.frame"))

    Read the article

  • Pear SOAP and XAMPP on Ubuntu

    - by Vincent
    All, I have installed xampp for linux on ubuntu 9.10. The installation directory is /opt/lampp. The xampp website says PEAR comes with the installation.. I am relatively new to PEAR and want to know the answers for following: Is PEAR installed with xampp or need to be installed separately using synaptic package manager? I browse to /opt/lampp/bin directory and see "pear" there, but when i type it in the command line, it says "The program 'pear' is currently not installed. You can install it by typing: sudo apt-get install php-pear pear: command not found " I want to use PEAR:SOAP package in my PHP code. How to use that? Do I need to set any paths to the pear in my php.ini? Thanks

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >