parameters

CSS Class name parameters?

Is there a more efficient way of declaring and using these (very similar/repetitive) CSS classes: div.rounded20 { -webkit-border-radius:20px; -moz-border-radius:20px; } div.rounded15 { -webkit-border-radius:15px; -moz-border-radius:15px; } Say maybe with something along the lines of: div.rounded(@Y) { -webkit-border-radius...

Why not infer template parameter from constructor?

Hi all, my question today is pretty simple: why can't the compiler infer template parameters from class constructors, much as it can do from function parameters? For example, why couldn't the following code be valid: template<typename obj> class Variable { obj data; public: Variable(obj d) { ...

How do I retain parameters after a form validation fails in CakePHP?

I am creating an application which tracks signatures form various organizations. I have a simple form which I can pass an ID to, so it will automatically select the right organization. The URL for add looks like this: /signatures/add/3 The form works well. By passing 3, or any other ID, it automatically selects the right field, be...

Can I pass parameters to a client-side HTML page?

I'm not sure if I have the jargon for asking this question not being a web developer but please bear with me. I want to send parameters to a client side HTML page (just a file on a disk no web server involved). My initial attempt was to use a query string and then parse it from window.location.href but instead of the query string being ...

Does Java support default parameter values?

I came across some Java code that had the following structure: public MyParameterizedFunction(String param1, int param2) { this(param1, param2, false); } public MyParameterizedFunction(String param1, int param2, boolean param3) { //use all three parameters here } I know that in C++ I can assign a parameter a default value. F...

why iterator methods can't take either 'ref' or 'out' parameters?

I tried this earlier today: public interface IFoo { IEnumerable<int> GetItems_A( ref int somethingElse ); IEnumerable<int> GetItems_B( ref int somethingElse ); } public class Bar : IFoo { public IEnumerable<int> GetItems_A( ref int somethingElse ) { // Ok... } public IEnumerable<int> GetItems_B( ref in...

SQL Server 2005 Xml Parameter Causing Timeout?

I'm trying to send a XML of aproximately 1MB as XML parameter in a Stored Procedure, but always the connection returns timeout. Anyone knows what's the size limit for the XML type? Environment: Microsoft SQL Server 2005 Express .NET Framework 2.0 C# C# Code: using (SqlCommand commandSave = new SqlCommand("SaveScanning", this.D...

Changing a constructor param type breaks class in another jar

I have the following class in a common jar: public class Common { public Common(List list) { ... } } I then change the constructor parameter from a List to a Collection as follows: public class Common { public Common(Collection collection) { ... } } Rebuilding the common jar and running the system causes a...

Is it better to pass an *interface* or an *object* as a parameter to a function?

I'm trying to convince a colleague that a function should take an interface as a parameter, and not the object itself. I think small objects can be fine to pass across, but for large ones I would give them an interface and just pass the i/f over, not the whole thing. Note that there will only ever be one of these large classes - the i/f...

Context parameters in VSTS Web Tests

Hi, Can anyone help me with the following question? How can a context parameter be used in a parameterized request? I have created an extraction rule that populates a context parameter (say Param1). I also have parameterized a subsequesnt request and want to use this context parameter in that request. Eg. "{DetailArray:strUserID:xyz,int...

Parameter Checks vs Function Call Overhead

Hello, I have a public function that needs to check the validity of a few parameters, but this function is also used internally in a few others places in which I know that the given parameters will be valid. Thus, I'm wondering, which is more costly: 1) Leave the validity checks in every public function, or 2) Do the validity checks in...

blog post content via url parameters (meta) in wordpress

i am trying to create an url which will set the blog post like ./wp-admin/post-new.php?post_title=title i know that post_title, content and excerpt will work for this, but i dont know how to set meta tags. i need this to create a new posting when clicking on a map (openlayers) and automaticaly set longitude and latitude in meta tags. ...

What happens when an inline function is passed as a parameter in C?

Today I was writing some C code to sort an array of structs using quicksort with a custom comparator function to determine their ordering. At first I wrote it with the call to the comparator function hard-coded into the quicksort function. Then I thought perhaps it would be nicer to pass that function as an argument to a generic quickso...

How can C# nullable value typed values be set on NHibernate named IQuery parameters?

I am using NHibernate and calling a stored procedure via a named query: <sql-query name="SearchStuff" read-only="true" cacheable="true"> <return class="ResultEntity" /> EXEC [SearchStuff] ?, ?, ? </sql-query> Many of the stored procedure parameters are deliberately nullable - this cannot be changed. The C#: IQuery listQuery =...

How can I pass variable parameters into a Javascript Function using Excel VBA

Hi, I'm not sure if I have the correct terms above, but what I'm trying to do is call a Javascript function passing parameters into it from an Excel File, so the function will run and list the items in the next textbox, allowing me to choose the correct entry in that textbox, which then chooses the final box. Here is the code that I hav...

how to set default method argument values?

Hi, Is it possible to set the default method parameter values in Java? Example: If there is a method public int doSomething(int arg1, int arg2) { //some logic here return 0; } is it possible to modify the given method in order to be able to call it with and without parameters? example: doSomething(param1, param2); doSomething(); ...

I am stuck with php array()?

Does anybody have an idea why following array() is passing into function. I am not able to understand the array() function. I know, if $_POST dont have any value, it will pass array(). but what are the value in array()? SomeFunction($_POST ? $_POST : array()); ...

Stored Procedure that handles 1 or 2 or 3 value ...

i am using a stored procedure to run some queries in my database. The value is taken from a query string then passed to the stored procedure. the thing is, the user may select more than 1 option that generates 3 or more query string. e.g. http://localhost.com/test.aspx?param=76&amp;param2=79 i know how to take the values from the query...

Convert param into python ?

Hello everyone, I am trying to learn web programming in python. I am converting my old php-flash project into python. Now, I am confused about how to set param value and create object using python. FYI I used a single php file, index.php to communicate with flash.swf. So, my other php files like login.php, logout.php, mail.php, xml.php ...

Clojure Parameters with Optional Flags

What's the best way to implement keywords as optional flags to a function? I want to make function calls such as: (myfunction 5) (myfunction 6 :do-this) (myfunction 3 :go-here) (myfunction 2 :do-this :do-that) Using defn, I can define a function such as: (defn myfunction [value & flags] ... ) But the flags becomes a list. I can wri...