hyphen

iOS automatically add hyphen in text field

感情迁移 提交于 2019-11-26 09:52:41
问题 I\'m learning iOS development and am having a hard time figuring out the various events for the controls. For a test I have a UITextField where the user is meant to input a string in the format: XXXX-XXXX-XXXX-XXXX I want to be able to check how long the text in the field is after each entry and see if it needs to have a hyphen appended to it. I\'ve set up my IBAction function for this but when I assign it to the \"Value Changed\" event it does nothing, it works fine when I set it on the \

How to import module when module name has a '-' dash or hyphen in it?

时光毁灭记忆、已成空白 提交于 2019-11-26 09:07:57
问题 I want to import foo-bar.py. This works: foobar = __import__(\"foo-bar\") This does not: from \"foo-bar\" import * My question: Is there any way that I can use the above format i.e., from \"foo-bar\" import * to import a module that has a - in it? 回答1: you can't. foo-bar is not an identifier. rename the file to foo_bar.py Edit: If import is not your goal (as in: you don't care what happens with sys.modules , you don't need it to import itself), just getting all of the file's globals into your

Hyphens in column names in MySQL DB

早过忘川 提交于 2019-11-26 06:47:41
问题 May be this question has been answered before but I couldn\'t find it. I am using a 2/3 yr old MySQL database which has hyphens in its column names. When I try to use these names from my Java code, the names are broken at the hyphen (e.g. air_port becomes air) and thus are not found. I tried replacing hyphens to underscores in my code hoping that the DB might treat them equally but that doesn\'t work. How can I escape the hyphen or how can I access these columns ? Could this be an issue of