parameters

XSL named parameter 'with-param' using 'apply-templates'

和自甴很熟 提交于 2019-12-18 12:23:13
问题 My questions are at the bottom of this post, if you wish to read them before the full explanation. I'm converting an XML document to a pretty web page using XSL, and am having trouble with correctly passing a variable. I have many xsl:template s defined, and need to pass a specific parameter to just one of them. I was hoping that I would be able to pass a named parameter that would presumably be sent to all of the xsl:template s, but only be used by a single one and ignored by the others.

What exactly does “pass by reference” mean?

瘦欲@ 提交于 2019-12-18 12:17:43
问题 And who has the authority to decide? Edit: Apparently I haven't succeeded in formulating my question well. I am not asking how Java's argument passing works. I know that what looks like a variable holding an object is actually a variable holding a reference to the object, and that reference is passed by value. There are lots of fine explanations of that mechanism here (in the linked threads and others) and elsewhere. The question is about the technical meaning of the term pass-by-reference.

RAILS3: Pass arbitrary parameters via button_to?

假如想象 提交于 2019-12-18 12:15:51
问题 I'm trying to do something very simple in my first Rails app (Rails 3) and I'm not sure what I'm doing wrong, or if there's a better approach. Can't find anything on the web or here that has solved it for me despite much searching. In the app I have WorkRequests and Articles. When viewing an Article, I want a button to create a WorkRequest and, when the new WorkRequest form appears, have the article filled in. Essentially, I'm trying to pass the Article.id to the new WorkRequest. Works in

Can you safely synchronize on a Java method parameter?

亡梦爱人 提交于 2019-12-18 12:15:03
问题 Take this code: public class MyClass { private final Object _lock = new Object(); private final MyMutableClass _mutableObject = new MyMutableClass() public void myMethod() { synchronized(_lock) { // we are synchronizing on instance variable _lock // do something with mutableVar //(i.e. call a "set" method on _mutableObject) } } } now, imagine delegating the code inside myMethod() to some helper class where you pass the lock public class HelperClass { public helperMethod(Object lockVar,

Python Sqlite3: INSERT INTO table VALUE(dictionary goes here)

随声附和 提交于 2019-12-18 11:47:35
问题 I would like to use a dictionary to insert values into a table, how would I do this? import sqlite3 db = sqlite3.connect('local.db') cur = db.cursor() cur.execute('DROP TABLE IF EXISTS Media') cur.execute('''CREATE TABLE IF NOT EXISTS Media( id INTEGER PRIMARY KEY, title TEXT, type TEXT, genre TEXT, onchapter INTEGER, chapters INTEGER, status TEXT )''') values = {'title':'jack', 'type':None, 'genre':'Action', 'onchapter':None,'chapters':6,'status':'Ongoing'} #What would I Replace x with to

How to pass a parameter to a windows service once and for all at install instead of each start

家住魔仙堡 提交于 2019-12-18 11:26:41
问题 We have a Windows Service application that can accept command line parameters like: MyService -option So far, when we want to start the service with a parameter, we either do it manually from the Service Properties dialog (in the Start parameters box) or with the command sc start MyService -option What we would like is a way to install the service "permanently" with this parameter , so that the users would just have to start/stop it without having to set the parameter each time . BTW, adding

C++ Design Pattern for Passing a Large Number of Parameters

不想你离开。 提交于 2019-12-18 11:07:22
问题 I have a reasonably-sized class that implements several logically-related algorithms (from graph theory). About 10-15 parameters are required as input to the algorithm. These are not modified by the algorithm, but are used to guide the operation of it. First, I explain two options for implementing this. My question is what is a common way to do so (whether it is or isn't one of the two options). I personally don't like to pass these values as parameters to the function when N is large,

How do I pass a string parameter to a t4 template

倖福魔咒の 提交于 2019-12-18 10:44:31
问题 Hi I am trying to find a way to pass a normal string as a parameter to a text template. This is my Template code, if someone could tell me what I would need to write in c# to pass my parameters and create the class file. That would be very helpful, Thanks. <#@ template debug="false" hostspecific="true" language="C#" #> <#@ output extension=".cs" #> <#@ assembly name="System.Xml" #> <#@ assembly name="EnvDTE" #> <#@ import namespace="System.Xml" #> <#@ import namespace="System.Collections

How to determine method names and parameters in wsdl web service

坚强是说给别人听的谎言 提交于 2019-12-18 10:37:12
问题 I have few problems with Web Services and KSoap library. I searched this topic before asking but couldn't find anything. Here is the question : I have an url like http://www.anyting.com/bulkService.wsdl but i haven't got any documentation about it. Can I determine METHOD NAME and NAMESPACE parameters just examining wsdl file. Example : http://www.webservicex.net/isbn.asmx?WSDL If it is possible, where can i found method parameters for sending request. I'm working on Android Project so I'm

Method not applicable for arguments

亡梦爱人 提交于 2019-12-18 09:46:45
问题 I'm trying to create a tester class, but in doing so I have gotten an error which states: 1 error found: Error: The method printData(double, double) in the type PayCalculator is not applicable for the arguments () How do I fix it? This my tester code PayCalculator p1 = new PayCalculator(); p1.setHourlyRate(8.25); p1.setHoursWorked(45.0); p1.printData(); my main code { private double hourlyRate; private double hoursWorked; public PayCalculator() { hourlyRate = 0.0; hoursWorked = 0.0; } /** *