parameters

Relative and absolute tolerance definitions in Matlab solver

主宰稳场 提交于 2019-12-18 21:16:51
问题 I am trying to understand the following Matlab definitions for RelTol and AbsTol parameters: RelTol — This tolerance is a measure of the error relative to the size of each solution component. Roughly, it controls the number of correct digits in all solution components, except those smaller than thresholds AbsTol(i).The default, 1e-3, corresponds to 0.1% accuracy. AbsTol — AbsTol(i) is a threshold below which the value of the ith solution component is unimportant. The absolute error tolerances

How to use a parameter in a xslt as a XPath?

旧时模样 提交于 2019-12-18 19:07:32
问题 I'd like to add an element to a xml document and I'd like to pass as a parameter the path to the element. sample.xml file: <?xml version="1.0"?> <stuff> <element1> <foo>2</foo> <bar/> </element1> <element2> <subelement/> <bar/> </element2> <element1> <foo/> <bar/> </element1> </stuff> Using: xalan.exe -p myparam "element1" sample.xml addelement.xslt I'd like the following result: <?xml version="1.0"?> <stuff> <element1> <foo>2</foo> <bar/> <addedElement/> </element1> <element2> <subelement/>

How to get parameters from PreparedStatement?

耗尽温柔 提交于 2019-12-18 18:47:50
问题 I'm writing generic logger for SQLException and I'd like to get parameters that were passed into PreparedStatement, how to do it ? I was able to get the count of them. ParameterMetaData metaData = query.getParameterMetaData(); parameterCount = metaData.getParameterCount(); 回答1: Short answer: You can't. Long answer: All JDBC drivers will keep the parameter values somewhere but there is no standard way to get them. If you want to print them for debugging or similar purposes, you have several

Angular 2 custom validator with parameters

 ̄綄美尐妖づ 提交于 2019-12-18 18:38:35
问题 How do I create let's say my own maxLength validator in Angular 2? All examples I could find use validators similar to 'required' one meaning that they already know the rules. They only accept one param - the control itself. How do I pass more parameters? Here's the sample validator I have. How do I modify it to pass number 5 as a parameter? export class MyValidators { static minValue(control:Control): {[s: string]: boolean} { var num = +control.value; if (isNaN(num) || num < 5 ) { return {

Start A Process With Parameters

五迷三道 提交于 2019-12-18 16:52:39
问题 I'm Using Process.Start from my website to open a windows form application I made in c#. I want send to the application my username. So how can I do that? 回答1: You can use this: string username = "MyUsername"; Process.Start(Path.Combine("MyExe.exe" + " \"" + username + "\""); 回答2: You can do this by assigning arguments in start info, e.g.: var process = new Process { StartInfo = { FileName = processName, Arguments = "-username=Alice" } }; process.Start(); If your process fails to start you

Calling functions with parameters using a dictionary in Python

给你一囗甜甜゛ 提交于 2019-12-18 16:48:42
问题 I'm making a program which has a main menu that asks the user to input an option and store it in integer option1 , which is looked up in dictionary options . The corresponding function is then run. The following code works if the functions have no parameters: options = {0 : FunctionZero, # Assign functions to the dictionary 1 : FunctionOne, 2 : FunctionTwo, 3 : FunctionThree} options[option1]() # Call the function If the functions have parameters the above code doesn't work as the () part

Pass a NULL in a parameter to a DateTime field in a stored procedure

旧城冷巷雨未停 提交于 2019-12-18 15:30:55
问题 I have a stored procedure which updates a database using the parameters I supply but I'm having trouble passing a NULL to the stored procedure The field I need to make NULL is a DateTime field DB.Parameters.AddWithValue("@date", NULL) This gives me the error 'NULL' is not declared. 'Null' constant is no longer supported; use 'System.DBNull' instead So I tried DB.Parameters.AddWithValue("@date", DBNull.Value.ToString()) But this produces the value 1900-01-01 00:00:00.000 in the column as it's

rerenderEvents / refetchEvents problem

落花浮王杯 提交于 2019-12-18 13:20:05
问题 I am not sure if I am using this correctly so my problem may be my mis-understanding rather than a bug or larger problem. I have a fullcalendar that gets initiated from doc ready like this (some code left out for brevity). function renderEvents() { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); var technicians = $("div[ID*='ucTechnicians'] :hidden").val(); var calendar = $('#calendar').fullCalendar({ ... events: "JsonResponse.ashx

How to access nested params

烂漫一生 提交于 2019-12-18 13:04:15
问题 I would like to get some nested params. I have an Order that has many Items and these Items each have a Type. i would like to get the type_id parameter from the controllers create method. @order = Order.new(params[:order]) @order.items.each do |f| f.item_type_id = Item_type.find_by_name(f.item_type_id).id end The reason is that i want the user to be able to create new item_types in the view. When they do that i use an AJAX call add them to the db. When they post the form i get names of the

Best way to safely read query string parameters?

青春壹個敷衍的年華 提交于 2019-12-18 12:39:37
问题 We have a project that generates a code snippet that can be used on various other projects. The purpose of the code is to read two parameters from the query string and assign them to the "src" attribute of an iframe. For example, the page at the URL http://oursite/Page.aspx?a=1&b=2 would have JavaScript in it to read the "a" and "b" parameters. The JavaScript would then set the "src" attribute of an iframe based on those parameters. For example, "<iframe src="http://someothersite/Page.aspx?a