Daily Archives

Articles indexed Thursday April 8 2010

Page 21/125 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • iPhone SDK "White Flash" transition

    - by Extremely frustrated
    I want to make a button; when you press it the screen fades to a "flash of white" and back like in those powerpoint transitions. I'm thinking maybe dynamically changing the opacity of a white square or something? What do you think? Is there something like this that already exists like part of Catransitions or something? Thanks guys.

    Read the article

  • Common Wpf pitfalls

    - by Patrick Klug
    I want to gather a list of WPF pitfalls. Issues with WPF that are not that well known and either have some serious design consequences or some major inconveniences. One topic per answer. List: Mouse.GetPosition() does not always return a correct value. The Wpf layout recursion limit is hard coded to 255.

    Read the article

  • C: socket connection timeout

    - by The.Anti.9
    I have a simple program to check if a port is open, but I want to shorten the timeout length on the socket connection because the default is far too long. I'm not sure how to do this though. Here's the code: #include <sys/socket.h> #include <sys/time.h> #include <sys/types.h> #include <arpa/inet.h> #include <netinet/in.h> #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <netdb.h> #include <stdlib.h> #include <string.h> #include <unistd.h> int main(int argc, char **argv) { u_short port; /* user specified port number */ char addr[1023]; /* will be a copy of the address entered by u */ struct sockaddr_in address; /* the libc network address data structure */ short int sock = -1; /* file descriptor for the network socket */ if (argc != 3) { fprintf(stderr, "Usage %s <port_num> <address>", argv[0]); return EXIT_FAILURE; } address.sin_addr.s_addr = inet_addr(argv[2]); /* assign the address */ address.sin_port = htons(atoi(argv[2])); /* translate int2port num */ sock = socket(AF_INET, SOCK_STREAM, 0); if (connect(sock,(struct sockaddr *)&address,sizeof(address)) == 0) { printf("%i is open\n", port); } close(sock); return 0; }

    Read the article

  • Comma Seperated Values Insertion In SQL server 2005

    - by Asim Sajjad
    How can I insert Values from the comma separated input paramater to the Store prodcedure ? Example is exec StopreProcedure Name 17,'127,204,110,198',7,'162,170,163,170' you can see that I have two Comma Separated Values in the parameter list , both will have same number of values if first have 5 comma seperated value then second one also has 5 comma separated values you can says 127 and 162 are related 204 and 170 are related and same for other how can I insert these two values in ? One comma Sepated value is inserted but how to insert two ?

    Read the article

  • How to "uninstantiate" an object?

    - by Mark
    I wrote a function in Python: def instantiate(c): if inspect.isclass(c): return c() elif isinstance(c, object): return c else: raise Exception, '%s is not an object or class.' % c Now I want to do the opposite: get the class from an already instantiated object so that I can re-instantiate it with different parameters. How can I do that?

    Read the article

  • Setting minOccurs="0" (required) on web service parameters of type int

    - by Alex Angas
    I have an ASP.NET 2.0 web method with the following signature: [WebMethod] public QueryResult[] GetListData( string url, string list, string query, int noOfItems, string titleField) I'm running the disco.exe tool to generate .wsdl and .disco files from this web service for use in SharePoint. The following WSDL for the parameters is being generated: <s:element minOccurs="0" maxOccurs="1" name="url" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="list" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="query" type="s:string" /> <s:element minOccurs="1" maxOccurs="1" name="noOfItems" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="titleField" type="s:string" /> Why does the int parameter have minOccurs set to 1 instead of 0 and how do I change it? I've tried using [XmlElementAttribute(IsNullable=false)] in the parameter declaration without success.

    Read the article

  • jquery use return data from 2 functions in another function ---always get undefined. why ??

    - by user253530
    Function socialbookmarksTableData(data) is called by another function to generate the content of a table -- data is a JSON object. Inside the function i call 2 other functions that use getJSON and POST (with json as a return object) to get some data. The problem is: though the functions execute correctly i get undefined value for the 2 variables (bookmarkingSites, bookmarkCategories). Help with a solution please. function socialbookmarksGetBookmarkCategories(bookmarkID) { var toReturn = ''; $.post("php/socialbookmark-get-bookmark-categories.php",{ bookmarkID: bookmarkID },function(data){ $.each(data,function(i,categID){ toReturn += '<option value ="' + data[i].categID + '">' + data[i].categName + '</option>'; }) return toReturn; },"JSON"); } function socialbookmarksGetBookmarkSites() { var bookmarkingSites = ''; $.getJSON("php/socialbookmark-get-bookmarking-sites.php",function(bookmarks){ for(var i = 0; i < bookmarks.length; i++){ //alert( bookmarks[i].id); bookmarkingSites += '<option value = "' + bookmarks[i].id + '">' + bookmarks[i].title + '</option>'; } return bookmarkingSites; }); } function socialbookmarksTableData(data) { var toAppend = ''; var bookmarkingSites = socialbookmarksGetBookmarkSites(); $.each(data.results, function(i, id){ var bookmarkCategories = socialbookmarksGetBookmarkCategories(data.results[i].bookmarkID); //rest of the code is not important }); $("#searchTable tbody").append(toAppend); }

    Read the article

  • How can I tell if a closed path contains a given point?

    - by Tom Seago
    In Android, I have a Path object which I happen to know defines a closed path, and I need to figure out if a given point is contained within the path. What I was hoping for was something along the lines of path.contains(int x, int y) but that doesn't seem to exist. The specific reason I'm looking for this is because I have a collection of shapes on screen defined as paths, and I want to figure out which one the user clicked on. If there is a better way to be approaching this such as using different UI elements rather than doing it "the hard way" myself, I'm open to suggestions. I'm open to writing an algorithm myself if I have to, but that means different research I guess.

    Read the article

  • iPod Shuffle (3G) - USB adapter cables

    - by bencnscp
    The iPod shuffle (3G) seems to have a proprietary connector that is different than the previous one for iPod shuffle (2G). I have tried the cable that comes with the 2G, and even a 3rd party charger, and their connectors are physically keyed so you cannot plug them in. Is anyone using a 3rd-party cable (besides the one Apple provided)?

    Read the article

  • validate that URI is valid http URI

    - by Alfred
    Hi all, My problem: First of hopefully this is not a duplicate, but I could not find the right answer(right away). I would like to validate that an URI(http) is valid in Java. I came up with the following tests but I can't get them to pass. First I used getPort(), but then http://www.google.nl will return -1 on getPort(). This are the test I want to have passed Test: @Test public void testURI_Isvalid() throws Exception { assertFalse(HttpUtils.validateHTTP_URI("ttp://localhost:8080")); assertFalse(HttpUtils.validateHTTP_URI("ftp://localhost:8080")); assertFalse(HttpUtils.validateHTTP_URI("http://localhost:8a80")); assertTrue(HttpUtils.validateHTTP_URI("http://localhost:8080")); final String justWrong = "/schedule/get?uri=http://localhost:8080&time=1000000"; assertFalse(HttpUtils.validateHTTP_URI(justWrong)); assertTrue(HttpUtils.validateHTTP_URI("http://www.google.nl")); } This is what I came up with after I removed the getPort() part but this does not pass all my unit tests. Production code: public static boolean validateHTTP_URI(String uri) { final URI u; try { u = URI.create(uri); } catch (Exception e1) { return false; } return "http".equals(u.getScheme()); } This is the first test that is failing because I am no longer validating the getPort() part. Hopefully somebody can help me out. I think I am not using the right class to validate url's?? P.S: I don't want to connect to the server to validate the URI is correct. At least not yet in this step. I only want to validate scheme.

    Read the article

  • Why can i not rewrite parent class?

    - by latvian
    I want to rewrite core/adminthtml/block/widget/tabs.php class which is a super class for core/adminhtml/block/sales/order/view/tabs.php class. Here is config code for both scenarios: <blocks> <adminhtml> <rewrite> <sales_order_view_tabs>Jimmy_SalesAffil_Block_Widget_Tabs</sales_order_view_tabs> <widget_tabs>Jimmy_SalesAffil_Block_Widget_Tabs</widget_tabs> ..... </rewrite> </adminhtml> </blocks> While I am able to rewrite ...view/tabs.php, I am not able to rewrite the super class. Why? Is it possible? How?

    Read the article

  • Finding height in Binary Search Tree

    - by mike
    Hey I was wondering if anybody could help me rework this method to find the height of a binary search tree. So far my code looks like this however the answer im getting is larger than the actual height by 1, but when I remove the +1 from my return statements its less than the actual height by 1? I'm still trying to wrap my head around recursion with these BST any help would be much appreciated. public int findHeight(){ if(this.isEmpty()){ return 0; } else{ TreeNode<T> node = root; return findHeight(node); } } private int findHeight(TreeNode<T> aNode){ int heightLeft = 0; int heightRight = 0; if(aNode.left!=null) heightLeft = findHeight(aNode.left); if(aNode.right!=null) heightRight = findHeight(aNode.right); if(heightLeft > heightRight){ return heightLeft+1; } else{ return heightRight+1; } }

    Read the article

  • key value coding-compliant for NSObject class?

    - by 4thSpace
    I've created a singleton class that loads a plist. I keep getting this error when I try to set a value: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key test.' I have one key in the plist file. The key is named "test" and has no value associated with it. I set the value like this: [[PlistManager sharedManager].plist setValue:@"the title value" forKey:@"test"]; I look at the set plist dictionary and see this from within PlistManager: po self.plistDictionary { test = ""; } I get the error just as I'm leaving PlistManager in the debugger. PlistManager is of type NSObject. So no xibs. Any ideas on what I need to do?

    Read the article

  • How to add member variable to an interface in c#

    - by Nassign
    I know this may be basic but I cannot seem to add a member variable to an interface. I tried inheriting the interface to an abstract class and add member variable to the abstract class but it still does not work. Here is my code: public interface IBase { void AddData(); void DeleteData(); } public abstract class AbstractBase : IBase { string ErrorMessage; abstract AddData(); abstract DeleteData(); }

    Read the article

  • hide and show divs using javascript

    - by Sony
    Hello all, I have multiple links in a page. When I click a particular link I want a div which contains the details of that link and hide all other divs associated with other link in the same page Please find a solution may be using javascript.

    Read the article

  • ruby super keyword

    - by ash34
    Hi, From what I understand, 'super' keyword invokes a method with the same name as the current method in the superclass of the current class. Below in the autoload method, there is a call to 'super'. I would like to know in which superclass I would find a method with the same name or what does the call to 'super' do module ActiveSupport module Autoload ... def autoload(const_name, path = @@at_path) full = [self.name, @@under_path, const_name.to_s, path].compact.join("::") location = path || Inflector.underscore(full) if @@eager_autoload @@autoloads[const_name] = location end super const_name, location end .... end end module ActiveRecord extend ActiveSupport::Autoload ... autoload :TestCase autoload :TestFixtures, 'active_record/fixtures' end This code is from the rails master branch. Thanks much.

    Read the article

  • iPhone Development: CoreLocation and MapKit

    - by Mustafa
    How bad is it to use Location Manager to retrieve the location information when MapView.showUserLocation is also TRUE? I have a situation where i want to show the blue dot to indicate the user's current location, and i want to record the user's current location after some time interval. Having said that, there may be situations where the user's current location is now being shown, but i still want to get the user's current location. I think i'll have to use the Location Manager in my controller class, but setting showUserLocation = YES would mean that i'll be draining more battery since two Location Managers are working at the same time? Is this assumption correct?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >