params

Samsung Galaxy S5 Camera Torch not working

孤街醉人 提交于 2019-12-19 11:08:46
问题 We have an app that works with all our supported Android phones "except Samsung Galaxy S5" . Our app uses the camera to take pictures at close range. We need torch mode ON the entire time we are focusing to take the picture. We check for supported parameters and set the values if supported. The params get set but the event either never gets fired or the camera is ignoring my settings. I tested using OpenCamera and their app is able to turn the torch on yet I cannot find the difference between

Ruby on Rails: params is nil. undefined method `[]' for nil:NilClass

被刻印的时光 ゝ 提交于 2019-12-19 04:23:50
问题 I am getting an error when trying to access a search page I have made. The problem seems to be that I am trying to remove blanks when there aren't any there. My search function works, but I am having trouble handling the case when technols is nil. Here is my error: NoMethodError in ProjectsController#search undefined method `[]' for nil:NilClass in my project controller, line 26: tech_ids = params["technols"]["id"].reject(&:blank?). Here is my search action: def search tech_ids = params[

Groovy: isn't there a stringToMap out of the box?

邮差的信 提交于 2019-12-18 12:49:07
问题 as a tcl developer starting with groovy, I am a little bit surprised about the list and map support in groovy. Maybe I am missing something here. I am used to convert between strings, lists and arrays/maps in tcl on the fly. In tcl, something like "['a':2,'b':4]".each {key, value -> println key + " " + value} would be possible, where as in groovy, the each command steps through each character of the string. This would be much of a problem is I could easily use something like the split or

ExtJs4 - Store baseParams config property?

允我心安 提交于 2019-12-18 11:47:49
问题 In extjs3.x I used the stores baseParams config property to specify parameters used to load the store. This property no longer exists in extjs 4. What should I do instead of this? Also in extjs3 I was able to specify wether the stores proxy was a GET or a POST method by using the proxy method config property. What should I do instead of this? My ExtJs 3 code -> var store = new Ext.data.JsonStore({ root: 'Data', baseParams: { StartDate: '', EndDate: ''' },//baseParams proxy: new Ext.data

Nested params with cURL?

怎甘沉沦 提交于 2019-12-18 11:47:18
问题 I've got an iPhone app requesting an API, and it uses a nested param structure to pass in a username and password to login. In my Rails controller, I'm successfully retrieving this information normally using: username = param[:session][:username] I'd like to test my API from shell, using cURL. But I can't figure out how to provide nested params? The code below does NOT work... And I've tried multiple variations. But just can't seem to figure it out? curl -d '{"session":{"username":"test",

Extract part of URL

陌路散爱 提交于 2019-12-17 20:42:41
问题 I have an URL and need to extract a part of it. The url is like this: http://website.com/get.php?url=http://www.website2.com/index.html?articleID=123456 And I need to extract this part: http://www.website2.com/index.html?articleID=123456 How would I do this in Objective-C? 回答1: First of all, create a NSURL. Then, use the query method to get the query string part: NSURL * url = [ NSURL URLWithString: @"... your url ..." ]; NSString * q = [ url query ]; Then you can use the NSString methods to

Android set height and width of Custom view programmatically

人盡茶涼 提交于 2019-12-17 08:13:01
问题 I have created a custom view named Graphview . Here is the structure for the GraphView class. public class GraphView extends View { public GraphView(Context context, float[] values, String title, String[] horlabels, String[] verlabels, boolean type) { super(context); ........ } .................. ................. } I have added the view in a tablerow using addview() . It is working fine. Now I want to set height and width for the GraphView . How to do that? 回答1: The easy way is to set the

Android set height and width of Custom view programmatically

ぃ、小莉子 提交于 2019-12-17 08:11:28
问题 I have created a custom view named Graphview . Here is the structure for the GraphView class. public class GraphView extends View { public GraphView(Context context, float[] values, String title, String[] horlabels, String[] verlabels, boolean type) { super(context); ........ } .................. ................. } I have added the view in a tablerow using addview() . It is working fine. Now I want to set height and width for the GraphView . How to do that? 回答1: The easy way is to set the

Using PDO for an insert and the_geom

前提是你 提交于 2019-12-13 20:51:56
问题 I'm switching my code to PDO for increased security. My insert works until I add a special column that create spatial data. See below for the standard insert that works, and 2nd below for what is not working. $sql = "INSERT INTO sites_tbl (sitename, the_geom) VALUES ('$_POST[sitename]', st_geomfromtext('POINT($geomstring)',27700))"; The geomstring = a number formatted 000000 000000 Using PDO the same insert looks something like (below) this works if I just want to insert the sitename, but not

XSLT param identity transform without input XML

时光毁灭记忆、已成空白 提交于 2019-12-13 12:37:55
问题 I'm trying this for days and no success. I have following XSLT which doesn't take any input XML, but has one param as XML: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" /> <xsl:param name="products"> <products author="Jesper"> <product id="p1"> <name>Delta</name> <price>800</price> <stock>4</stock> <country>Denmark</country> </product> <product id="p2"> <name>Golf</name> <price>1000</price> <stock>5</stock> <country