Search Results

Search found 3440 results on 138 pages for 'returning'.

Page 54/138 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • Forward horizontal swipe events on UITableView to parent view

    - by D-Nice
    I have a UITableView that I want to have respond to taps and vertical swipes, but still have something like userInteractionEnabled = NO for horizontal swipes. By that I mean, it would not handle touches and pass the touch event back to its superview. Things I've tried that didn't work: returning NO in - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath Overriding touchesBegan/touchesMoved/touchesEnded and passing the event to the next responder Adding gesture recognizers for horizontal swipes and setting cancelsTouchesInView to YES I've been trying to fix this on and off for several weeks, so any help is greatly appreciated!

    Read the article

  • How to convert a PGresult to custom data type with libpq (PostgreSQL)

    - by mocopera
    Hi everyone! I'm using the libpq library in C to accessing my PostgreSQL database. So, when I do res = PQexec(conn, "SELECT point FROM test_point3d"); I don't know how to convert the PGresult I got to my custom data type. I know I can use the PQgetValue function, but again I don't know how to convert the returning string to my custom data type. Any suggestion? Thanks in advice.

    Read the article

  • How to get attributes from an element in XML

    - by iSight
    I have constructed an XML tree structure of an XML file. I am able to trace the entire tree. When i want to retrieve the attributes of an element, it is returning as NSXMlNode of kind NSXMLAttributeKind. How can i extract the key value pairs in the attribute node.

    Read the article

  • How to count how many items for distinct items in mysql?

    - by Vincent Duprez
    Imagine a have a table with a column named status: status ------ A A A B C C D D D How can I count how many rows have A, how many rows have B etc? this kind of output: A |B |C |D |E ------------------ 3 |1 |2 |3 |0 As for E = O , this will always be A,B,C,D and E Output should be one row (thus 1 query). When doing a distinct count (most returning answer on my searches, it does return how many different elements there are, 4 in this case...)

    Read the article

  • output parameter into label

    - by MyHeadHurts
    instead of returning my output paremeter value in my stored procedure to my label it returns the default value i set my output parameter to. why cant i put my output parameter into my text label Dim reader As SqlDataReader cmd.Parameters.AddWithValue("@tour", "2365") cmd.Parameters.Add("@tourname", SqlDbType.VarChar) cmd.Parameters("@tourname").Direction = ParameterDirection.Output cmd.CommandText = "test" cmd.CommandType = CommandType.StoredProcedure cmd.Connection = conn conn.Open() reader = cmd.ExecuteReader() Dim myTable As DataTable = New DataTable() myTable.Load(reader) DropDownList1.DataSource = myTable DropDownList1.DataTextField = "ddate7" DropDownList1.DataBind() Label1.Text = cmd.Parameters("@tourname").ToString conn.Close()

    Read the article

  • How would I rspec/test an updated_at field without using sleep() in ruby?

    - by Kamilski81
    How do i write my spec without using the sleep(1.second) method? When I remove the sleep then my tests break because they are returning the same time stamp? I have the following class method: def skip qs = find_or_create_by(user_id: user_id) qs.set_updated_at qs.n_skip += 1 qs.save! end and following spec: qs = skip(user.id) sleep(1.second) qs2 = skip(user.id) qs.should_not be_nil qs2.should_not be_nil (qs.updated_at < qs2.updated_at).should be_true

    Read the article

  • AES and CBC in PHP

    - by Kane
    I am trying to encrypt a string in php using AES-128 and CBC, but when I call mcrypt_generic_init() it returns false. $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '',MCRYPT_MODE_CBC, ''); $iv_size = mcrypt_enc_get_iv_size($cipher); $iv = mcrypt_create_iv($iv_size, MCRYPT_RAND); $res = mcrypt_generic_init($cipher, 'aaaa', $iv); //'aaaa' is a test key Can someone tell me why is returning 0/false? I read the php documentation and seems correct (http://us.php.net/manual/en/mcrypt.examples.php)

    Read the article

  • Class definition thinks setting a variable is a Unit?

    - by DeLongey
    Writing out a Scala class and problem here is that the compiler thinks that the code is a unit not returning the proper value. It's a method used to set a property in the class: def setObject(`object`:StripeObject):StripeObject = { this.`object` = `object` } The error is: type mismatch; found : Unit required: com.stripe.StripeObject The full class is: case class EventData(var previousAttributes: HashMap[String,Object], var `object`:StripeObject) extends StripeObject { def getPreviousAttributes = { previousAttributes } def setPreviousAttributes(previousAttributes: HashMap[String, Object]) = { this.previousAttributes = previousAttributes } def getObject = { `object` } def setObject(`object`:StripeObject):StripeObject = { this.`object` = `object` } } How do I make sure it doesn't return a Unit?

    Read the article

  • Decayed multidimensional array return from function

    - by paul simmons
    related to http://stackoverflow.com/questions/2520535/gcc-multi-dim-array-or-double-pointer-for-warning-free-compile , is there a way to return so-called "decayed array pointer" from a function? in summary (suppose 2 dim array) returning int (*a)[5] format rather than int** format? as far as I see, when returned int** pointer is sent to another function waiting (int*)[] parameter, it is not working correctly.

    Read the article

  • Is or Are to prefix boolean values

    - by Brian T
    When naming a boolean, or a function returning a boolean it's usual to prefix with 'is' e.g. isPointerNull isShapeSquare What about when refering to multiple items, should it be: arePointersNull or isPointersNull areShapesNull or isShapesNull I can see arguments for both; is offers consistency and perhaps slightly better readability, are makes the code read in a more natural way. Any opinions?

    Read the article

  • Letter Count on a string

    - by user74283
    Python newb here. I m trying to count the number of letter "a"s in a given string. Code is below. It keeps returning 1 instead 3 in string "banana". Any input appreciated. def count_letters(word, char): count = 0 while count <= len(word): for char in word: if char == word[count]: count += 1 return count print count_letters('banana','a')

    Read the article

  • Why doesn't HashTable.Contains() just simply return false if it is passed a null?

    - by Nate Pinchot
    I understand why passing a null to HashTable.Contains() doesn't work, but I don't understand what the point of it throwing an ArgumentNullException is - instead of just simply returning false? What is the benefit of throwing the exception (other than to make me do null checks before calling .Contains())? Caused By [System.ArgumentNullException] Key cannot be null. Parameter name: key at System.Collections.Hashtable.ContainsKey(Object key) at System.Collections.Hashtable.Contains(Object key)

    Read the article

  • how to get powershell to look for files in other folders when moving items?

    - by steeluser
    I have written this script to move files to the destination folder. Looks like I am missing something here because when I run the script, it is only looking for .zqx files in current directory and not all the drives. Please note that the ( dir $paths..) part is returning the list of .zqx files promptly. Paths.txt has drive letters like this C:\ D:\ E:\ $paths = get-content paths.txt mv (dir $paths -r -fi *.zqx | ?{$_.lastwritetime -lt ($sevendaysold)}) -dest e:\xqz Thanks Steeluser

    Read the article

  • Knowing the type of the stored proc when invoking from C#

    - by dotnetdev
    I am making a windows service to be able to run operations on a sql server database (insert, edit, etc) and invoke Stored Procs. However, is there a way for me to know the type of the SP? When invoking from C#, I need to knof if it is returning 1 value, or more, or none (so I can use executereader, scalar, etc)? Thanks

    Read the article

  • OpenID authentication error

    - by Raindog
    When I try to login to this site using my yahoo openid, it takes me to the yahoo site, I click "continue" meaning that i want to send my authentication details to stackoverflow.com and stackoverflow.com gives me the following error underneath the login text field: Unable to log in with your OpenID provider: failed to authenticate, returning Failed. Please ensure your identifier is correct and try again.

    Read the article

  • How do you preserve the viewstate while using strongly typed views in asp MVC 2?

    - by Mark Kadlec
    I have an ActionResult returning from a strongly typed view where I manually validate some conditions, pass in an error message, but would like to preserve the users responses. Since my View is strongly typed, I am calling it like this: return View("PrincipalInvestigatorForm", new SmartFormViewModel(sections, questions)); My problem though, is that the error message is displayed but all the users data is wiped. How do I preserve the "ViewState" in MVC? Is there an easy way?

    Read the article

  • MySQL select one field from table WHERE condition is in multiple rows

    - by Alex
    Tried to find the answer, but still couldn't.. The table is as follows: id, keyword, value 1 display 15.6 1 harddrive 320 1 ram 3 So what i need is something like this.. Select an id from this table where (keyword="display" and value="15.6") AND (keyword="harddrive" and value="320") There's also a possibility that there will be 3 or 4 such keyword conditions which should result into returning one id (one row) It seems there's something to deal with UNION but i didn't use it before so i can't figure it out Thanks in advance

    Read the article

  • Method-Object pairs in Java

    - by John Manak
    I'd like to create a list of method-object pairs. Each method is a function returning a boolean. Then: foreach(pair) { if method evaluates to true { do something with the object } } One way of modelling this that I can think of is to have a class Constraint with a method isValid() and for each constraint produce an anonymous class (overriding the isValid() method). I feel like there could be a nicer way. Can you think of any?

    Read the article

  • Getting a date value in a postgres table column and check if it's bigger than todays date

    - by Roland
    I have a Postgres table called clients. The name column contains certain values eg. test23233 [987665432,2014-02-18] At the end of the value is a date, I need to compare this date, and return all records where this specific date is younger than today I tried select id,name FROM clients where name ~ '(\d{4}\-\d{1,2}\-\d{1,2})'; but this isn't returning any values. How would I go about to achieve the results I want?

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >