Recognizing gesture does not work on the subview

At first,I attach UISwipeGestureRecognizer to a image view,the action method can't be triggered.Then I attach UISwipeGestureRecognizer to view controller's view,it works well.I don't know why. here is the code that doesn't work - (void)viewDidLoad {

List comprehension with multiple missions

I presently have this code for factoring large numbers: def f1(n): return [[i, n//i] for i in range(1 , int(n**0.5) + 1) if n % i == 0] It's the fastest version I've seen so far (If there's a faster way I'd love to know about that as well), but I'd l

Text Center in a horizontal navigation bar

I want my text in the middle of the navigation bar. I tried vertical-align:center or middle but that didn't work. Here is what I have: ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; }

Connecting to Android socket to update graphics

I am sending an analog signal to an android app via Ethernet. The goal is to control the alpha channel of some shapes being drawn. The code applies specifically to a rectangle. I've gotten both tutorials to work separately. The communications one rec

Tomcat up to 100 simultaneous requests

I have deployed a big size war (600 mb) on the tomcat server. Its a great project and hence the number of users. But if counting it should not be more than 100 at a time. But my tomcat goes hang out even in this small number. The problem is server ma

How to debug an ssl connection?

I have a client application that connects to a web service over https. I need to "sniff" all the network traffic between web service and my client to check if everything is okay, i.e, i have to debug the connection. I have tried Wireshark but si

Unable to locate Java at home

I'm writing an application that leverages jsvc to start up a Java service as a daemon. I need to use something like jsvc because my application utilizes ports under 1024 and yet I'd really like to not run it as root so that created files are owned by

The variable does not change outside the function

JSFiddle : If I call the variable value from inside my function, it works. However, it doesn't if I call it outside of the function. I feel like it has something to do with change, as it is first assigned ok, but w

NSOutlineView develops / collapses code animation

i'm wondering how does one animate the expansion/collapse of an NSOutlineView's tree node from code ? // this works ok but doesn't animate NSTreeNode *node = [self.outlineView itemAtRow:self.outlineView.clickedRow]; if([self.outlineView isItemExpande

Strange Results Print Pointer as C Float

I know this is wrong and gcc will give you a warning about it, but why does it work (i.e. the numbers are printed correctly, with some rounding difference)? int main() { float *f = (float*) malloc(sizeof(float)); *f = 123.456; printf("%f\n", *f)

How to draw diagrams using c #?

I have to draw a bar chart using c#. First I have tried using using System.Windows.Forms.DataVisualization.Charting namespace.code here below Dim strConn As string MyConString = "SERVER=localhost;" + "DATABASE=demo;" + "UID

Xpath XML Nokogiri - LIKE expression

I'm using Nokogiri, Ruby and Xpath to parse a large XML document of computer games. To put what im trying to do in context... I have a large database of computer games, I want to lookup those computer games in an XML document. The issue I have is tha

PHP memcache :: addServer, weight

My question is related to the "weight" parameter in the addServer function of the PHP Memcache extension. For last couple of months, I have been using "weight = 1" for all servers. I am now trying to apply the configurations below to e

SQL, Find all entries that do not exist in another table

So I've got two tables, A and B, I'm trying to find the values that exist in a column in table A that do not exist in a matching column in table B my current code is: SELECT A.x FROM A WHERE A.x NOT IN (SELECT B.x FROM B); I have also tried: SELECT A

Remote Control Client for Android

The RemoteControlClient was introduced in ICS. That's the way the lock screen seems to be integrating with various music players. See the screenshot below for an example of Spotify on the lock screen. Could one from another app than the lock screen i

WPF / C # drag and drop from ListView on canvas

I have a ListView with a custom view for displaying items as icons. I also have a regular ol' canvas. I want to be able to drag an item from the ListView and drop it into the canvas. Now I've looked all over the place for various tutorials on how to

Type the event on the text field in Sencha Touch

I can add tap event to textfield like this: { xtype : 'textfield', name : 'GIVEN_NAME', label : 'Given Name', disabled: false, listeners : { element : 'element', tap : function() { console.log('tap'); } } } and it works. But this one, when used in co

Extract a URL in Python from XML

I read this thread about extracting url's from a string. Really nice, i got all url's from a XML document containing with >>> s = '<link href=""

sympy installed, otherwise sympy.mpmath not found

I want to use the jacobDN function in sympy, so I download it and python install it, successfully. When I want to use it as in the documentation does: >>> from sympy.mpmath import * Traceback (most recent call last): File "<stdin

Reading from the command line in java

I am trying to read in values from the command line into variables, using the code below. public static void main (String [] args) throws Exception { // Read in all of the passed arguments String address = args[0]; int port = Integer.parseInt(args[1]

Include path ignored

I'm not understanding what's going on here. I have the following: set_include_path( get_include_path() .PATH_SEPARATOR.'/home/mike/www/Zend/library/' ); Which appears to set the value correctly: var_dump(get_include_path()); // string(61) ".:/usr/sha

rvm determines and installs the latest version of ruby

So far I only know how to do commands like rvm 2.0.0 Fortunately Google tells me The current stable version is 2.0.0-p247. But shouldn't I be able to use rvm to do that step for me? I can't figure out how to just tell rvm to install the latest versio