Menu
  • HOME
  • TAGS

Oracle BI Publisher, select different columns by parameter

oracle,parameters,publisher

if the user chooses 01, I should display ONLY 'january' with some data. If the user chooses 03, I should display 3 columns, 'january' 'february' 'march' with some data in each. You cannot have dynamic columns in pure SQL. You need to do it programmatically (ab)using EXECUTE IMMEDIATE. In...

NodeJS / ExpressJS check valid token parameter before routing

node.js,express,parameters

Use a middleware. app.use(function (req, res, next) { if (checkToken(req.query.token) { return next(); } res.status(403).end("invalid token"); }); app.use(require('./controllers')) ...

Python: importing a module with parameters?

python,logging,parameters,import,module

Personally, I'd stick with the code you have; less magic, more clarity. You can access the module name of the calling code by accessing the frame from the stack, using sys._getframe(): import sys def get(moduleName=None): if moduleName is None: caller = sys._getframe(1) moduleName = caller.f_globals['__name__'] return logging.getLogger("test." + moduleName) making...

Python subprocess return parameter

python,parameters,subprocess

You may receive a result and pass a parameter. Terminology is not correct :) Process returns a result of invocation. It would be 0 (success) or not zero (error condition). Subprocess.Popen() is for your needs. Pass input to STDIN and get output from STDOUT. Called process must drop their results...

Variadic Parameters v Array Parameter [closed]

ios,swift,parameters

I think there is no speed difference.Because,inside the function,you use Variadic Parameter just as Array. I think that if the parameters count is small,for example,less than 5,Variadic Parameter may be a better solution,because it is easy to read. If the count of parameters is large. Array is better solution. Also...

use htaccess to redirect a range of urls which have parameters

.htaccess,mod-rewrite,redirect,parameters,url-rewriting

Insert this rule just below RewriteEgine line in your WP .htaccess: RewriteCond %{QUERY_STRING} (^|&)wysija-page=1 [NC] RewriteRule ^ /subscriptions? [L,R=302] ...

how to replace ? with a if-else in java [closed]

java,parameters

if(isSummer) max = 100; else max = 90; And then you can paste your code. But if this is for assignment, you should practice the conversion of operators to if-else statements. Its better to clear the logic than asking for help here....

Multi select parameter default set by previous multi select parameter

reporting-services,parameters,multi-select

Create a DataSet to get "Default JobType" based on report type as per your requirement like as you said IF 3 IN (@ReportType) SELECT 0 as JobTypeId, 'N/A' as JobTypeDesc create a SP (stored procedure or query with parameter report type) as we normally do for Cascading Parameters ... once...

Intent and getSerializableExtra value return

android,android-intent,android-activity,parameters,parameter-passing

You should know how Intent.putExtra() and Intent.getSerializable() works. Intent use Bundle to save paremeters, and If it is not a inter-process intent the internal Bundle just save the original objects in a data map. , the objects will NOT be copyed(do the unparcel and parcel stuff) , so what you...

Check if the parameter of a shell command exists

shell,parameters

You can replace the command invocation with this: if ! $comm $par; then exit 1 fi to make it stop after an error. Also there is already a tool called watch but I think you already know this....

How can I POST JSON values without property expansion in soapUI?

json,post,properties,parameters,soapui

To prevent the property expansion from replacing ${MY_VALUE} you can add an extra $ like this: { "myNode":{ "myOtherNode":"$${MY_VALUE}" } } Doing that your original json will be sent like this: { "myNode":{ "myOtherNode":"${MY_VALUE}" } } ...

How to add parameters onto function in setAttribute() method in javascript

javascript,html,function,parameters,setattribute

add count in function as param, not as string. count = 0; //Will be the number that will go into parameter for function function start() { imageTag = document.createElement("IMG"); //Creates image tag imageTag.setAttribute("src", "popo.jpg"); //sets the image tags source count++; //as the start function keeps getting called, count will increase...

Remove unwanted paragraphs from string using php

php,parameters,line,paragraphs

In your regexp in the part <\br [^>]*> you escape the "b" with a backslash. By that you make it a backspace. I think you don't want that. Try to remove that backslash which then makes it: echo preg_replace("/<p[^>]*>[\s|&nbsp;|<br [^>]*>|<\/br>]*<\/p>/", '', $str); EDIT: (because of new information by the questioner)...

Adding to a parameter in a method call, outside of parameter parentheses?

ruby,methods,parameters

If Overflow.at(10) returns int you may treat stack = Overflow.at(10) + 3 as shorten version of: overflow = Overflow.at(10) stack = overflow + 3 It's more compact, but the result is the same....

pass variables to jade template

node.js,express,parameters,parameter-passing,jade

You might be rendering them as tags instead. View your source html post render. Try using !{param} instead of #{param}....

Rails (param is missing or the value is empty)

ruby-on-rails,ruby,ruby-on-rails-4,parameters

Typically the new action would be @user = User.new as there are no user_params getting posted back from the view.

How can I add another parameter to a drop down box?

c#,html,parameters

If this display name is something that would be used multiple times, I would suggest adding a property to your Supplier class. Something like DisplayName: public class Supplier { //... public string SupplierName { get; set; } public string AccountNumber { get; set; } //... public string DisplayName { get...

How to draw a rectangle using a char parameter in C++?

c++,parameters,char,drawing

Your draw is missing a variable. Change draw(char); to draw(char c); And both for loops need a maximum range, not the same value as the incrementing variable. height<=height; and width<=width; #include <iostream> using namespace std; void draw(char c ) { int rheight=10; int rwidth=20; for(int height=0;height<=rheight;height++) { for(int width=1;width<=rwidth;width++) {...

Issue with interface and parameter

java,parameters,interface

You can change public static Double getInfoSum(TreeMap<String, Iinterface> map){ ....some counting } to public static Double getInfoSum(TreeMap<String, ? extends Iinterface> map){ ....some counting } This will allow you to pass a TreeMap<String, ExampleClassItem> to this method....

PHP - url path as parameters

php,url,parameters

There is a full guide to mod_rewrite here that looks pretty good. You have to scroll down a bit to get to url as parameters. https://www.branded3.com/blog/htaccess-mod_rewrite-ultimate-guide/ If you don't want to mess too much with mod_rewrite and already have everything directed through a single public index.php (which is a good...

Data types not matching in function call

c++,parameters

In my opinion, using a template is the most elegant way for this: template<int size> void generate_all_paths(const char *maze[][size], int x, int y) { ... } int main() { const char *exmaze[][6] = { {"#","#","#","#","#","#"}, {"S","a","#","h","l","n"}, {"#","b","d","p","#","#"}, {"#","#","e","#","k","o"}, {"#","g","f","i","j","#"}, {"#","#","#","#","#","#"} }; generate_all_paths(exmaze, 1, 0); return 0; } Please also note...

Omitting function arguments in PHP

php,function,parameters

You could specify default values to the parameters: function create_log($action = '', $outcome = '', $message = '') This way, if you call create_log without one of the parameters, it will be assigned the value in the function's definition ('' for all the parameters in the above example)....

Why is my LINQ Expression with multiple parameters not compiling?

c#,linq,parameters,expression

When you add a fifth parameter, you're binding to a different Invoke that the one in LinqKit: public static TResult Invoke<T1, T2, T3, T4, TResult> ( this Expression<Func<T1, T2, T3, T4, TResult>> expr, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { return expr.Compile ().Invoke (arg1, arg2, arg3, arg4); }...

How to pass args when calling one method from another

java,android,methods,parameters

Both savePrivateKey and retrievePrivateKey accept a String[], although they do not use them. Just drop these redundant parameter specifications and you should be fine: public void savePrivateKey() throws FileNotFoundException { // code here... } public void retrievePrivateKey() throws FileNotFoundException { // code here... } ...

Class enumerator values cannot be passed as parameters to another class's function

c++,class,parameters,header,enumerator

You have a circular dependency problem. Your files can include each other all they want, but the #pragma once at the top means that only one sees the other one; not that each sees the other. There are several ways to go here. One way would be to remove the...

How to add a SwitchParameter to an attribute collection?

powershell,parameters

You does not have to use any additional attributes to make parameter to be switch parameter. You just declare it's type as System.Management.Automation.SwitchParameter or switch. function f{ [CmdletBinding()] param( [string[]]$Names ) dynamicparam{ $DynamicParams=New-Object System.Management.Automation.RuntimeDefinedParameterDictionary foreach($Name in $Names){ [email protected]( New-Object Parameter -Property @{ParameterSetName="Set_$Name"} ) $Param=New-Object System.Management.Automation.RuntimeDefinedParameter $Name,switch,$Attributes...

Spring security - passing parameters to login page

spring,login,parameters

You can use SavedRequest interface. Spring security use SavedRequest type to store the redirect url and parameters. Create a custom login controller to serve your login.jsp view. Get SavedRequest object from HttpSessionRequestCache Get the requested url and parameters savedRequest. Pass it to login.jsp page as model attribute. @Controller public class...

Having two param lists with same size

c#,parameters

How about just dropping the params keyword and taking arrays instead? That is, make the signature PrintTimes(string[], int[]). PrintTimes(new[]{"A","B","C","D"}, new[]{2,1,3,2}); isn't that much more to write.

Can I use meaningful parameter names rather than $1, $2 inside postgres function definition?

postgresql,function,parameters

Yes, apparently I can just use the parameter name directly without problem inside the function definition. For example CREATE OR REPLACE FUNCTION add_report_email( reportname text, personid integer ) RETURNS void AS $$ DECLARE reportid integer; BEGIN -- add the report name into reports table if it does not exist select...

second parameter interfering with generic handler

c#,asp.net,parameters,webforms,generic-handler

I created a test to simulate what you're trying to do and the error happened only once, than I couldn't reproduced it anymore. I realized that I wasn't always compiling the code. Then I started to always compile and the error no longer happened. You can check the code here....

jquery mobile pass parameter along with div id href

javascript,jquery,html,jquery-mobile,parameters

I asume you want to get data from DB using ajax and put content in desired div. Use this $('a').click(function(e){ e.preventDefault(); var target = $($(this).attr('href')); var url = your_url_here; $.ajax({ url: url, success: function(value){ target.html(value); } }) }) ...

Report Parameter validation in ssrs report

sql,sql-server,sql-server-2008,reporting-services,parameters

Click Report Menu then Report Properties. Go to Code Tab and add similar code as per your requirement: Function CheckDateParameters(StartDate as Date, EndDate as Date) as Integer Dim msg as String msg = "" If (StartDate > EndDate) Then msg="Start Date should not be later than End Date" End If...

Verilog - Compile time calculations

parameters,system-verilog,synthesis

The main problem is $floor is a function that returns value with a real type. Since you did not explicitly provide data types for your parameters, they are implicitly defined with the type of the default initialization or the type of any expression they ore overridden with. So when you...

Methods with parameters

java,variables,methods,parameters

by decalring variable as method parameter you can pass variables into method public void printIt(String text){ System.out.println(text); } but if you declare variable inside method like this: public void printIt(){ String name; //you can't pass } ...

How to use SQL parameters with IF conditions and what datatype is equal to the NVARCHAR. OLeDB, VB.NET

sql-server,vb.net,parameters,sql-injection

My answer to your first question that I think this is the list of equal data-types you want: SQL Server | OLEDB (ADO => ad+...) -----------+--------------- char | Char nchar | WChar varchar | VarChar nvarchar | VarWChar text | LongVarChar ntext | LongWVarChar ...

Pass parameter to a URL AsyncTask android

android,parameters,android-asynctask

Just add the following code before sending executing your httpClient: URL_STRING + = textInsideYourTextView; It should work, just avoid to manipulate your ui elements outside your UI thread....

Magento URL with get parameters redirects to login

php,magento,url,parameters

When creating a admin route theres actually two parts of the config.xml One is explicit declaration of a route (example): <admin> <routers> <adminhtml> <args> <modules> <training after="Mage_adminhtml">Training_Animal_Adminhtml</training> </modules> </args> </adminhtml> </routers> </admin> Take notice that you dont need to specify a <use>, this is because the adminhtml tag is declared...

Best way to document “splatted” parameter with YARD?

ruby,parameters,documentation,yard,splat

YARD's creator, lsegal, states that the appropriate thing to do is provide an @overload for expected invocations. However, this doesn't really provide much clarity in the case of an Array#push-like method. I suggest that you use the @param tag and use Array<Object> as the argument type or provide an @overload...

Passing in batch file with parameters as parameter in sftp command

batch-file,parameters,command,sftp

I assume the batch2.bat produces an sftp script (put, etc), right? So you want its output to be stored to a temp file (named pipe) and its name used as an argument to sftp -b. Your syntax would be wrong even on *nix. It should be: sftp -b <(batch2.bat %3...

Cognos session parameters usage

session,parameters,frameworks,ldap,cognos

You can use the same syntax you would use in FM. So, for example: #sq($account.personalInfo.givenName)# will return the first name, and so on. If you feel some burning need to for user-written SQL, instead of using FM, you can include the macro as a query item in your "outer" query...

Which is better programming practice - Unnecessary parameters or a static variable?

c#,parameters,constructor,static,xna

For performance it's better to have one static variable and share it between your classes. But usually the performance impact is close to none, unless it's critical code. (By critical code, I mean code that runs a lot of times in one second, e.g. the Update method, or code that...

how to initialize a parameter in javascript function when i define the function

javascript,parameters,initialization,arguments

whenever you do not initialize a value to a parameter javascript will consider it as undefined, so you can reap the benefit of this issue and do it like: function myFunction(param) { param = typeof param !== 'undefined' ? param : 0; } hope it would be useful....

Get Column title in View

asp.net-mvc,razor,parameters,title,actionlink

Why don't you use Resources for this: Add Resource LastNameTitle Your model will look like: public class Model { [Display(Name = "LastNameTitle ", ResourceType = typeof(Resources.Resources))] public string LastName{ get; set; } } Your View: <th> @Html.ActionLink(Resources.Resources.LastNameTitle , "Index", new { sortOrder = ViewBag.NameSortParm }) @Html.DisplayNameFor(model => model.LastName) </th> ...

How to pass params in url to another resource in rails?

ruby-on-rails,parameters

In your view change opening to opening_id : <%= link_to "Apply now", new_jobapplication_path(opening_id: @jobdetail.id) %> In you new action instantiate with the opening_id : def new @jobapplication = Jobapplication.new(opening_id: params[:opening_id]) end ...

Crystal Reports 2013 Referencing multi-value parameter in command

parameters,crystal-reports

if its a multiparameter then two conditions are not needed. try likw below and (i.PROC_CAT_ID in [{?Category}]) In the above case [{?Category}] should a , saperated value, if its not then convert into comma saperated value and use it...

What is the meaning of “static” in parameters array types in C?

arrays,function,parameters,static,c99

This C99 notation, void foo(double A[static 10]), means that the function can assume that A points to 10 valid arguments (from *A to A[9]). The notation makes programs more informative, helping compilers to both optimize the code generated for the function foo and to check that it is called correctly...

Thread start passed integer changes itself beyond what it should be [duplicate]

c#,multithreading,parameters,lambda,thread-safety

This is a simple closure issue, you should not be using the for loop counter as a threading parameter issue, issue happens out here, for loop and thread execution do not run at same speed, so value of i can change for multiple threads: for(int i = 0; i <...

Height parameter in Graphics2D.drawArc

java,swing,parameters,graphics2d

g2d.drawArc(0, 0, 100, 100, 45, 90, Arc2D.CHORD); I would have expected that the height would appear to be the same length as the width on the screen. It is because you only draw an arc of 90 degrees. Change the value to 180 and the width/height will be different. Even...

C++ classes: Is it possible to select a member's constructor in a constructor body? (Without doubly initializing the member)

c++,parameters,constructor,default-constructor,initialization-list

I think you are asking the wrong question, instead of trying to inhibit initialization, you should just do it, i.e. spell your ctor as: Foo(int a) : x((a==0) ? Bar(12,'a', 34) : Bar(13)) {} This will not cause any copies or moves (see here), and is as idiomatic as it...

What Is The Difference Between Passing Parameters By Output And By Reference In C#

c#,methods,parameters,parameter-passing,pass-by-reference

Reference and Output parameters are very similar. The only difference is that ref parameters must be initialized. int myInt = 1; SomeMethod(ref myInt); //will work SomeMethod(out myInt); //will work int myInt; SomeMethod(ref myInt); //won't work SomeMethod(out myInt); //will work The compiler will actually view the ref and out keywords the...

How to pass parameters in gulp dependencies

parameters,dependencies,task,gulp

For this, I'm use yargs module in gulpfile use: var mode = require("yargs").argv.mode; run task with: gulp compile -mode A In your [css/twig/etc] tasks use: gulp.task("css", function(){ var cssSRC = "./src/" + mode + "/*.css"; gulp.src(cssSRC) ... ... }) ...

Can't update SQL table [closed]

c#,sql-server,parameters,sql-update

You never executed the command. Before conn.Close(); put cmd.ExecuteNonQuery(); Also, a suggestion: don't just display ex.Message. Display ex.ToString() to display the full exception, including any Inner exceptions. That's especially important with SqlException as ther can be a lot of detail....

Pass variable as parameter to awk file in TCL

variables,awk,parameters,tcl

You pass variables like this: awk -f some/script.awk -v var="my value" Now you can access your variable var in awk and if you print it, you'll see it contains my value....

Java - Getting the URL's parameter

java,url,parameters,playframework-2.0

As you can see in Play's routing documentation you can use the colon syntax to define that some part of your route URL is a variable and pass that variable to the controller method, ie: POST /students/:studentNo controllers.Application.Post(studentNo: Long) ...

Iframe not passing url parameters

html,variables,url,iframe,parameters

It seems to be working for me: <iframe scrolling="no" src="http://www.angry-android.com/chartTest.html?start=2014-05-01&end=2014-06-01" frameBorder="0" width=315 height=200></iframe> ...

How to pass a pointer to a struct declared inside another struct as a function parameter?

c,function,pointers,struct,parameters

Just do: void myFunction(struct _small *poSmall) { poSmall->varB = 0; } The scope of struct _small is not limited to its outer structure....

Use a function with parameters inside a callback

javascript,parameters,callback

You can pass an anonymous function which can call the function with required parameters talk('John', hello, function(){ weather('sunny') }, goodbye); function talk(name) { console.log('My name is ' + name); var callbacks = [].slice.call(arguments, 1); callbacks.forEach(function(callback) { callback(); }); } function hello() { console.log('Hello guys'); } function weather(meteo) { console.log('The weather...

How to pass parameter ending with “!” to another bat file?

windows,batch-file,parameters,cmd,parameter-passing

In fact, the explanation mark is received by the destination batch file, but is discarded when the echo command is processed. You can see this if you have echoing turned on. (However, if you use the call command to run the batch file, the explanation mark is not passed to...

Data type mismatch when inserting record

sql,vb.net,ms-access,parameters,insert

Maybe the problem is linked to parameter placeholder. This MSDN doc states that OleDbCommand does not support named parameter (only positional) and the correct placeholder should be "?" and not "@p1". https://msdn.microsoft.com/en-us/library/yy6y35y8%28v=vs.110%29.aspx Edit It turned out in comments that the placeholder have not to be so strictly adherent to the...

SQL Server - Can I dynamically create multiple parameters from the results of a SELECT query on another table?

sql-server,variables,dynamic,parameters

Can you check this Declare @sql varchar(max) = '' set @sql = 'SELECT RotaDate, DateDay, SlotTypeID, SlotDescription AS Hours,' select @sql = @sql + ' ' + 'max(case when ChaplainName = '''+ChaplainName+''' then AvailabilityDescription end) '+LEFT(ChaplainName, CHARINDEX(' ', ChaplainName+ ' ') - 1)+' ,' FROM Chaplaincy_Chaplains SET @sql = LEFT(@sql,...

How to set javascript properties on a global listener, without duplicating code

javascript,parameters,call,bootstrap,typeahead

Use this var options = { autoSelect: true, // all typehead initilization have autoSelect updater: function (item) { // logic here } // ... more logic stripped here } $(".typehead_selector:not(#search)").typeahead(options); options.autoSelect = false; $("#seach").typeahead(options); ...

sending parameters to a function according to input

c,function,input,parameters

It sounds like you want to pass parameters by name. Assuming that's the case, two approaches come to mind. If your set names really are single-character names like A, D, R, etc., you could build an array of set pointers indexed by the character: set *sets[128]; // will result in...

Binding parameters in mysql

php,mysql,binding,parameters

To bind params in a prepared query in PDO, pass an array containing your params to the execute function : $result = $conn->prepare($sql); $result->execute(array($value1, $value2, $value3)); UPDATE For the mysqli version : connect(); $result = $conn->prepare($sql); $result->bind_param('sss', $value1, $value2, $value3); $result->execute(); See http://php.net/manual/en/mysqli-stmt.bind-param.php...

Django: Handling several page parameters

python,django,list,parameters,httprequest

Since, request.GET is a dictionary, you can access its values like this: for var in request.GET: value = request.GET[var] # do something with the value ... Or if you want to put the values in a list: val_list = [] for var in request.GET: var_list.append(request.GET[var]) ...

Symfony2 & PHPUnit - Access getContainer()

php,symfony2,login,parameters,phpunit

In the Symfony documentation How to Create a custom UserProvider, under 'Create a Service for the User Provider' it states: The real implementation of the user provider will probably have some dependencies or configuration options or other services. Add these as arguments in the service definition. So, rather than using...

Decremented value called in the recursion in Haskell

string,function,haskell,recursion,parameters

Yes, once you call again f with a new value of n, it has no way to reference the old value of n unless you pass it explicitly. One way to do it is to have an internal recursive function with its width parameter, as you have, but that can...

SSRS cascading parameters: child parameters' default 'All' value drops to blank after user changes parent parameter

reporting-services,parameters,mdx,rdl,cascading

I've found decision for my child parameter go-blank problem. In the Report Parameters dialog just print to the 'non-queried' field default value in quotes. For example, in case of olap data source: print ="[Calendar].[Quarter].&[All]" instead of: [Calendar].[Quarter].&[All] After this Quarter child cascading parameter will not lose it's default value 'All'...

Method or delegate parameters do not match delegate parameters

c#,parameters,action,func

I think you want to specify Func<T, IEnumerator> method instead of Func<IEnumerator, T> method in the parameter list of StartCoroutine<T>. It's Func<T, TResult>: the return type is the last type parameter - and your CacheSceneNames takes a parameter of Action (T) and returns IEnumerator....

Passing a predicate that was passed in as a parameter

c#,linq,parameters,predicate

Without a good, minimal, complete code example, it's impossible to know for sure what the best fix for your problem is, assuming one exists at all. That said, variance problems generally come in two flavors: 1) what you're doing is truly wrong and the compiler is saving you, and 2)...

Open website url links with parameter by using a batch file

url,batch-file,parameters

For /L %%i in (1000,1,5000) do ( start "images" "www.images.com/%%i/image.jpg" ) ...

Spring data JPA and parameters that can be null

java,parameters,null,spring-data-jpa

You are right. A request has been made to support better handling of null parameters. https://jira.spring.io/browse/DATAJPA-121 In your case, i would advise you to write your repository implementation and to use a custom CriteriaQuery to handle your case. Alternatively (not tested), you could use a @Query something like : (:parameter...

While calling a no parametered function wants a parameter swift

swift,parameters

You have defined assign() as an instance method of the ViewController() class, which means that it must be called on an instance of that class. If you try to initialize a property of that class with let dictArray = assign() then assign is taken as a "curried function" of the...

Java Paper Rock Scissors program

java,methods,parameters,arguments

Well, it seems like first you just need to move the call in to the loop: while(playCount < 3) { System.out.print("Please enter either (R)ock, (P)aper, or (S)iccors: "); player1 = scan.nextLine().toUpperCase().charAt(0); System.out.print("Please enter either (R)ock, (P)aper, or (S)iccors: "); player2 = scan.nextLine().toUpperCase().charAt(0); // recompute the winner each time int winner...

How to properly call handler method in C#?

c#,methods,parameters,handler

Thanks for the helpful comments. I found that I was going about this incorrectly, and should just instantiate a service, and can get transactions in this way. TransactionService.TransactionService _service = new TransactionService.TransactionService(); TransactionService.TransactionSearchParameters _params = new TransactionService.TransactionSearchParameters(); TransactionService.Transaction []list = _service.GetTransactions(_params); ...

Identify the arguments, parameters, local variables and global variables used in the following code?

javascript,parameters,arguments,global-variables,local-variables

Your answer looks correct. The book may just have been looking for the arguments, parameters, and variables from of the functions defined on the page. It seems you out-smarted them. You could perhaps submit it to them as a correction because your answer is technically correct.

parenthetical parameters in Ruby / Rails

ruby-on-rails,ruby,methods,syntax,parameters

Lack of parentheses in this example indicates the problem of parsing such an expression. Generally, in Ruby you can omit them when it is clear "how to pass arguments". Let's consider the following situation - I have add and multi methods defined: def add(*args) args.inject(:+) end def multi(*args) args.inject(:*) end...

Practical Reasons to use C# “named arguments”

c#,methods,parameters,arguments,optional-parameters

I find your first argument completely specious. Like it or not the names of parameters are part of each method's semantics, particularly for abstract classes and methods that will be overridden in subclasses. The names of the parameters are a key signalling to users of a method on the semantics...

Modulating Code for c++

c++,parameters,module

This example is bad: // Define global variable ... float X = 1000; // ... and expect A() to work with it ... A(); // ... because there is a hidden dependency. This example is good: // Define local variable ... float X = 1000; // ... and let A()...

What is the difference between * and & in function parameters?

c,pointers,parameters,reference,dereference

Your question is actually related to C++ void function(A_struct &var) is not valid for C because in C it is used to get an address of a variable. In C++ it is a type of variable which is known as reference. You can see an example of it in here...

what does DefaultEdge.class mean in jgrapht example

java,parameters,constructor,jgrapht

If the question only aims at the syntax, you might want to refer to the section The .class Syntax of the site about Retrieving Class Objects from the oracle documentation. In general DefaultEdge.class is an object that represents the class DefaultEdge. This is an object of the type java.lang.Class, and...

How extract parameters passed by delegate parameter

c#,parameters,delegates,helpers

In order to retrieve the body (since it would have been compiled and JIT'ed away into a much different state by the time you tried to retrieve it), you would need an Expression<Action<T>>. However, you cannot convert lambda statement bodies to expression trees. As a result, you may be better...

Simplify jQuery code by naming and recalling a repeated snippet

javascript,jquery,function,parameters

Sure - you just need a function. You were part of the way there, but you need to specify and use a parameter. Example: function iframe(target) { return $('#iframe').contents().find(target); } $(window).load(function(){ iframe('target1').doSomething1(); iframe('target2').doSomething2(); iframe('target3').doSomething3(); iframe('target4').doSomething4(); iframe('target5').doSomething5(); iframe('target6').doSomething6(); iframe('target7').doSomething7(); iframe('target8').doSomething8(); iframe('target9').doSomething9(); }); Note that the...

Verilog: generic parameters

parameters,verilog

A parameter needs to be a parameter type throughout the design. You cannot pass a variable as a parameter. You can use a generate block to control instantiation: module core_module#(parameter realtime P=1)(input in, output out); always @(in) out <= #(P) in; // p should be constant endmodule module some_module (input...

Paramaterized SQL Query C# [duplicate]

c#,sql-server,parameters

You can use the @ to define a parameter, like this: string selectQuery = "select [ID] from [myDB].[dbo].[myTable] where [myName] = @username;"; Then you can define the parameter by using the Command.Parameters Function, like this: cmd.Parameters.Add("@username", SqlDbType.VarChar); cmd.Parameters["@username"].Value = user.globalusername; or like this: cmd.Parameters.AddWithValue("@Username", user.globalusername); ...

How do pass parameter datasrc DataTables Jquery?

web-services,stored-procedures,parameters,jquery-datatables

Ok, it work follow "ajax": { "url": "../BUS/WebService.asmx/GET_PRODUCT", "dataType": "json", "contentType": "application/json; charset=utf-8", "type": "POST", data: function (data) { return "{'product_name':'Candy'}"; }, dataSrc: function (json) { return $.parseJSON(json.d); } }, ...

Is there a better way to check child params?

ruby-on-rails,ruby,parameters

You can create helper method for easier work with nested hashes. Create ruby_ext.rb file in your lib folder, and write this function: module RubyExt module SafeHashChain def safe(*args) if args.size == 0 then self # Called without args ... elsif args.size == 1 then self[args[0]] # Reached end elsif self[args[0]].is_a?(Hash)...

How to access Objective C unnamed parameters of some method?

objective-c,methods,syntax,parameters

The labels are the things before the type. You can omit them (except for the first one, because it is the name of the method). So you are allowed to declare this: - (float) divNum1: (int) a : (int) b; And define it like this: - (float) divNum1: (int) a...

URL paramter looking like directory

javascript,url,parameters

You can use javascript frameworks e.g. AngularJS or if you want only the routing you can use something like sammy.js or do it server-side

Using SQL Parameters in ASP CLASSIC, object improperly defined error

sql-server,parameters,asp-classic

Alright, after much discussion with Lankymart, which continued in the chat, I finally got it fixed. Because the error was not fixed with just one adjustment, ill post all the adjustments made. First of all I removed the first (unnecessary) parenthesis of spSQL.Parameters.Append(spSQL.CreateParameter("@Order", adInteger,,,1506)) Secondly, I replaced the @vars in...

Pass Java-method-call to Scala class/method [duplicate]

java,scala,methods,parameters

It does not compile since you're not passing the method to ScalaButton.create, you're passing the result of the method call, which is void. If you want to pass a function to Scala from Java, you need to construct an instance of - in this case - AbstractFunction0<BoxedUnit>, which corresponds to...

Optional output cursor as parameter

oracle,parameters,cursor,default-value,optional-parameters

What about method overloading? PROCEDURE Proc_GetQ (qList OUT SYS_REFCURSOR, qStack OUT SYS_REFCURSOR); PROCEDURE Proc_GetQ (qList OUT SYS_REFCURSOR); Create a procedure with the same name, similar logic (better call 2-parameter version inside and pass only one outside), but only one OUT parameter....

Multiple parameters of a function

function,haskell,parameters,arguments,fold

Is this what you are looking for? break (\x -> x == ' ' || x == '\t' || x == '\n') xss ...