FAQ Database Discussion Community


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

java,scala,methods,parameters
This question already has an answer here: Using Scala from Java: passing functions as parameters 4 answers I have to work with this huge monolithic code that was written in Java and has hundreds of code-repetitions like: createButtonOne() { ... public boolean pressed() { doSomething(); return true; } }...

Java Paper Rock Scissors program

java,methods,parameters,arguments
Paper rock scissors java program. Ok so the only problem I'm having now is the player's score doesn't update until the second loop around. Any suggestions? Thanks again Radiodef for your help!! Updated code below....... import java.util.Scanner; public class RPS_Game { public static void main(String[] args) { char r =...

what does DefaultEdge.class mean in jgrapht example

java,parameters,constructor,jgrapht
What does dot class mean in the parameter passed to Constructor I am using jgrapht for the first time . I have this question What are we passing to the constructor of the DefaultDirectedGraph class? I mean what does DefaultEdge.class means ? There is no static field with that name...

Multiple parameters of a function

function,haskell,parameters,arguments,fold
How to give break (== ' ') xxs multiple boolean parameters without changing the definition? Or that is inevitable. For instance break (== (' ' || '\t' || '\n')) xss foldl and foldr are one way, but here they are not applicable, or at least I haven't been able to...

Get Column title in View

asp.net-mvc,razor,parameters,title,actionlink
MVC5 did a great job on automatically creating the View page (Razor). It currently displays my list of Students for example with table heading like this: <th> @[email protected]("", "Index", new { sortOrder = ViewBag.NameSortParm })*@ @Html.DisplayNameFor(model => model.LastName) </th> Now. DisplayNameFor take a Lambda Expression as its parameter. However, I...

Practical Reasons to use C# “named arguments”

c#,methods,parameters,arguments,optional-parameters
I find this feature "named arguments" from C# to be really weird because I see two flaws from it. The book says "named arguments give you the "ability to pass arguments in any order". Two flaws I think is a problem for this C# feature: It violates "information hiding" in...

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

ruby-on-rails,parameters
I am developing a kind of job board, where I have a "page" called 'jobdetails' with job details ('jobdetails' displays openings resources) job with apply button that should redirect to 'jobapplications' "page" where the jobseeker can upload his cv (not yet implemented) and save opening_id. I tried many ways but...

Passing a predicate that was passed in as a parameter

c#,linq,parameters,predicate
I'm having trouble with passing in a predicate to another function. This predicate would have been passed in as a parameter that is trying to call the second function. Below is a code snippet. public IEnumerable<ViewModel> BuildModel<TPart, TRecord>(Expression<Func<TRecord, bool>> predicate) where TPart : ContentPart<TRecord> where TRecord : ContentPartRecord { IEnumerable<ReportPart>...

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

reporting-services,parameters,mdx,rdl,cascading
I have a big bunch of cascading parameters in my rdl report with default value 'All' everywhere. But all children go blank after user changes some parent parameter, and then he has to choose 'All' value from drop-down list for each of child parameters manually. This is pretty annoying staff....

Modulating Code for c++

c++,parameters,module
I have heard that it is best practice to 'modulate' your code, to minimize the amount your code relies on other sections of your code. If I have a float: float X = 1000; And a function that uses X: void A() { //use X } Is it better practice...

Variadic Parameters v Array Parameter [closed]

ios,swift,parameters
I am struggling to see if there is an obvious advantage over which method to use when passing values into a function. My code below may not be the best example to explain the decision I'm trying to make, but it is my opinion the easiest to understand. Variadic Parameter...

jquery mobile pass parameter along with div id href

javascript,jquery,html,jquery-mobile,parameters
I have a jquery mobile app that uses 2 data-role=page divs. <div data-role="page" id="main"></div> <div data-role="page" id="det"></div> On the link to switch from main to truckdet I use <a href="#det">LINK</a> Is there a way to pass a parameter in the href so I can dynamically extract data from a database...

Height parameter in Graphics2D.drawArc

java,swing,parameters,graphics2d
I'm trying to create an arc, but when I use the same width and height parameters, the arc is almost flat, shouldn't it be higher? I would have expected that the height would appear to be the same length as the width on the screen. public void paintComponent(Graphics g) {...

How to pass parameters in gulp dependencies

parameters,dependencies,task,gulp
I'd like to prepare a different versions of a software by passing a special parameters in gulp task. I've created tasks for css, js, etc. and made one to run then all: gulp.task('compile', ['css', 'twig', 'js', ....]); How to pass a parameter which will be passed also to the subtasks?...

Pass variable as parameter to awk file in TCL

variables,awk,parameters,tcl
I want to pass variable to awk file in TCL which is somewhat similar to below code. Is there any way? // out.tr is input file and variable to be passed is to_node my_code.tcl: set to_node 13 exec awk -f check_ack.awk out.tr $to_node check_ack.awk: BEGIN {} { # variable passed...

Remove unwanted paragraphs from string using php

php,parameters,line,paragraphs
How to remove unwanted tags using pregmatch in below cases. i wrote pregmatch but its not working for some cases. here is my string <?php $str='<div class="borderdummydiv" style="padding: 10px;"> <div class="showcolsec" style="line-height: normal;"> <p style="font-size: 14px;" data-mce-style="font-size: 14px;"><strong>Email Template for Testing - 01:</strong></p><p style="font-size: 14px;" data-mce-style="font-size: 14px;"><br data-mce-bogus="1"></p><p style="font-size: 14px;"...

Kendo UI Grid Read Action Parameters not Work

javascript,parameters,kendo-ui,grid
Work .Read(read => read.Action("Evento_Read", "Eventos", new { dataInicial = new DateTime(2014, 10, 13), dataFinal = new DateTime(2015, 10, 13) }) Not Work .Read(read => read.Action("Evento_Read", "Eventos").Data("additionalParam") <script type="text/javascript"> function additionalParam() { return { dataInicial: new Date(2014,10,13), dataFinal: new Date(2015, 10, 13) } } Grid Code @(Html.Kendo().Grid<Evento>() .Name("eventoGrid") .Columns(columns => {...

sending parameters to a function according to input

c,function,input,parameters
I have a simple typedef (typedef int set [4]) and creations of it. I have a function that gets 3 of this typedef as parameters. Now, I want the function to be called with parameters according to the input. For example, if the input is A,D,R (assume those are allready...

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
So my question actually has more than 2 parts but all linked with protecting my application against SQL injection. Lately I am rebuilding my application to make it SQL injection proof. My application is written in VB.NET and I am using Parameters.Add to protect the queries. UPDATE first question: Found...

Symfony2 & PHPUnit - Access getContainer()

php,symfony2,login,parameters,phpunit
I have a problem with my PHPUnit test on symfony2. To connect to my application, I use a web service, so I created a UserProvider. In my function loadUserByUsername I use symfony2 parameters saved in app/config/parameters.yml. As I'm not in a controller I need to use the global variable $kernel...

Report Parameter validation in ssrs report

sql,sql-server,sql-server-2008,reporting-services,parameters
I have created one SSRS report having begin date and end date. If I provide end date< start date it will execute the report as shown in the image But that condition I need to show a pop up "Please Check the start date and end date provided". How to...

Can't update SQL table [closed]

c#,sql-server,parameters,sql-update
I need to change values in table Iepirkumi to values that are in textboxes. Debbugger shows no problems, but the code doesn't work. string connectionString = (@"Data Source=(LocalDB)\v11.0;AttachDbFilename=""C:\Users\Davis\Documents\Visual Studio 2013\Projects\WindowsFormsApplication1\WindowsFormsApplication1\dati.mdf"";Integrated Security=True"); using (SqlConnection conn = new SqlConnection(connectionString)) { conn.Open(); using (SqlCommand cmd = new SqlCommand("UPDATE Iepirkumi SET"+ " [Pieg_Nos][email protected]_Nos',"+ "...

Pass dynamically generated parameters to command inside script

bash,parameters,parameter-passing
I have a script which calls the rsync command with some dynamically generated parameters but I'm having trouble passing them correctly. Here's some excerpt: logfile="$logDir/$(timestamp) $name.log" echo "something" >> "$logfile" params="-aAXz --stats -h --delete --exclude-from $exclude --log-file=$logfile $src $dest" if [ "$silent" = "" ]; then params="-v $params --info=progress2" fi...

How to properly call handler method in C#?

c#,methods,parameters,handler
I am having issues with the following method below -GetTransactionsCompletedEventHandler. I am attempting to pass the necessary arguments to it, but it is also asking for more parameters in a format I am unfamiliar with. It is asking for GetTransactionsCompletedEventHandler(object[] results(object, GetTransactionsCompletedEventArgs)target) Can anyone point me in the right direction...

Data types not matching in function call

c++,parameters
I am having trouble matching up data types for a function I have written, The function is: void generate_all_paths(int size, char *maze[][size], int x, int y) { ... } This parameters size, x, and y are all super simple. I believe it is the maze that is throwing me off....

Method or delegate parameters do not match delegate parameters

c#,parameters,action,func
I'm doing some asynchronous caching and I'm using a simple Action callback to let the rest of the system know when the caching is complete. The entry point (the line causing the error): this.StartCoroutine<Action>(SceneUtils.CacheSceneNames, PopulateButtons); Coroutine method: public static IEnumerator CacheSceneNames(Action completedCallback) {} Callback method: private void PopulateButtons() {} And...

Passing in batch file with parameters as parameter in sftp command

batch-file,parameters,command,sftp
I am attempting to automate a upload/download from a sftp depot. The password is piped into the sftp command. I want the batch to execute as follows: batch1.bat: @ECHO OFF SET usernameHost=%1 SET password=%2 SET inputLoc=%3 SET outputLoc=%4 (echo %2) | sftp -b (batch2.bat %3 %4) %1 A batch2.bat will...

Oracle BI Publisher, select different columns by parameter

oracle,parameters,publisher
I'm just starting with Oracle BI Publisher and I really don't know how to get along with my task. My project is to ask the user for a parameter (that's ok), and if the user chooses 01, I should display ONLY 'january' with some data. If the user chooses 03,...

Issue with interface and parameter

java,parameters,interface
I have problem with interface and parameters: public class Functions { public static Double getInfoSum(TreeMap<String, Iinterface> map){ ....some counting } } public class ExampleClass { private TreeMap<String, ExampleClassItem > xxxx; public static void SomeFunction(){ Functions.getInfoSum(xxxx); //HERE IS ERROR } } public class ExampleClassItem implements Iinterface { ..... } Is there...

Python: importing a module with parameters?

python,logging,parameters,import,module
I have a small logging wrapper module, test.logging: import logging debuglog = "debug.log" f = open(debuglog, 'w') # truncate the file f.close() logger = logging.getLogger('test') logger.setLevel(logging.INFO) formatter = logging.Formatter( '%(asctime)s %(name)s %(levelname)s: %(filename)s:%(lineno)d: %(message)s') fh = logging.FileHandler(debuglog) fh.setLevel(logging.DEBUG) fh.setFormatter(formatter) logger.addHandler(fh) def get(moduleName): return logging.getLogger("test." + moduleName) and some modules...

SSRS Parameters - Toggle a parameter's NULL checkbox depending on value other parameter(s) NULL checkboxes

reporting-services,parameters,toggle,optional-parameters
In MS SQL Server Report Builder 3.0, I have an SSRS report with 3 parameters: start date (date) end date (date) last number of days (integer) My Stored Procedure needs either a Date Range OR the last number of days, not all 3 (they are set to NULL by default)....

Java For Loop Termination Parameter

java,for-loop,parameters
So i know you can have multiple statements within each parameter of a for loop such as: for(int i=0, int j=0; i<10 , j<14; i++, j=j+2){} but is the second parameter treated as an "and" statement or an "or" statement? Will it stop when "j" becomes greater than 14 or...

use htaccess to redirect a range of urls which have parameters

.htaccess,mod-rewrite,redirect,parameters,url-rewriting
I had an email subscription for updates on my site, which I've temporarily disabled. I'm seeing hits to the site related to the subscription. The urls are very long but the first several characters are always the same. I've been trying to redirect these (at least for the time being)...

Is there a better way to check child params?

ruby-on-rails,ruby,parameters
Is there a better way to check for items_attributes than the following code? I have to check params[:order] first since sometimes that may not exist, but I hate the look of the long conditional. if params[:order] and params[:order][:items_attributes] ...

Omitting function arguments in PHP

php,function,parameters
I have a function that saves every user log that looks like this <?php function create_log($action=null, $outcome, $message) { require 'dbc.php'; include 'get_ip.php'; $ip = get_ip_address(); $dateTime = date('m-d-Y h:i:s A', time()); $query = "INSERT INTO tbllogs (logOrigin, logAction, logUser, logDate, logOutcome, logMessage) VALUES (:origin, :action, :user, :dt, :outcome, :message)";...

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
Consider this: class Foo { private: Bar x; public: Foo(int a) { // no initialization here since constructor is dependent on a following if-block if (a==0) x=Bar(12,'a', 34); // some (int, char, int) constructor of Bar else x=Bar(13); // (int) constructor of Bar } } What this is supposed to...

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

arrays,function,parameters,static,c99
I saw following little complicated function definition. void foo(double A[static 10]) { double B[10]; } Is it valid C & C++ code? Is it new syntax introduced by C99 or C++ standard? What is the purpose of it? When should I use it? What is the need for this?...

How to declare array size with a parameter in c

c,arrays,function,parameters
Im writing a function in c and here is my code: char* makeMoves(char oldBoard[], int moveType, int empties, char player){ int oldBoardLength; oldBoardLength = sizeof(oldBoard) / sizeof(oldBoard[0]); char result[oldBoardLength]; copyBoard(oldBoard, result); } I think that this line has a problem: char result[oldBoardLength]; how can i create this array with length=oldBoardLength?...

Paramaterized SQL Query C# [duplicate]

c#,sql-server,parameters
This question already has an answer here: How do I create a parameterized SQL query? Why Should I? 5 answers This is a simple query I have written. What would be the best way to paramaterize this to prevent SQL injection? string selectQuery = "select [ID] from [myDB].[dbo].[myTable] where...

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

javascript,parameters,arguments,global-variables,local-variables
The code is: var x = 32; var y = 44; var radius = 5; var centerX = 0; var centerY = 0; var width = 600; var height = 400; function setup(width, height) { centerX = width/2; centerY = height/2; } function computeDistance(x1, y1, x2, y2) { var dx...

What does “local variables at the outermost scope of the function may not use the same name as any parameter” mean?

c++,parameters,scope,local-variables
I have been reading the C++ primer 5th edition. In the third paragraph of Function Parameter List of Chapter 6.1 . It writes "Moreover, local variables at the outermost scope of the function may not use the same name as any parameter". What does it mean? I am not native...

Multi select parameter default set by previous multi select parameter

reporting-services,parameters,multi-select
I have a report with several parameters, all in varying degrees depending on the value of its predecessors. I’m trying to convert from single selects to multi-selects. I’ve set the multiselect values for Report Type – see image – and would like to set the default value for the multiselect...

Intent and getSerializableExtra value return

android,android-intent,android-activity,parameters,parameter-passing
In onCreate I get an extra serializable from intent into itemsList of my activity itemsList = (ArrayList<HashMap<String, String>>) intent .getSerializableExtra("sliding_menu_content"); then in the activity I add some other map elements to the itemsList array. My surprise is that, changing the orientation of the device, getSerializableExtra returns the updated state of...

Check if the parameter of a shell command exists

shell,parameters
In my program, I have to check whether a command given as a input by a user exists or not and if it exists, program needs to check if the parameters of that command are correct. For example: ls ( is correct) -al (is correct) do the watch and if...

How to access Objective C unnamed parameters of some method?

objective-c,methods,syntax,parameters
All I've found on the web about parameters of methods in Objective C is that they are optional, but if I don't label each input parameter of some method, how do I access them? Here's an example of what I'm trying to do: - (float) divNum1: (int) AndNum2: (int); then...

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

c#,multithreading,parameters,lambda,thread-safety
This question already has an answer here: Thread alters passed Int, if start() is called separately 1 answer I have no idea what is going on in this. I'm trying to test thread safety of a class by spawning 100 threads to access it constantly, but it seems my...

How to pass args when calling one method from another

java,android,methods,parameters
I have written the following code to create a key pair, store the private key locally, and then read the private key from that file. When I try to call the methods savePrivateKey(); and retrievePrivateKey(); from testData(View view) I get an error that says (String[]) cannot be applied to ()....

Why is my LINQ Expression with multiple parameters not compiling?

c#,linq,parameters,expression
I want to extend the LINQ expression (DoSomething) using LinqKit; // for System.Linq.Expressions.Expression<>.Invoke() public class Expressions { public static System.Linq.Expressions.Expression< System.Func<int, int, int, int, bool>> DoSomething = (a, b, c, d) => false; } public class ExpressionTester { public ExpressionTester() { Expressions.DoSomething.Invoke(1, 2, 3, 4); } } with an additional...

Iframe not passing url parameters

html,variables,url,iframe,parameters
I am loading a web page inside an iframe. If I load the page without the iframe I using the same url it works as expected. However if the iframe loads the url it doesn't work. I have tried googling it and all I can seem to find is how...

Best way to document “splatted” parameter with YARD?

ruby,parameters,documentation,yard,splat
I have a method that should take 1+ parameters of any class, similar to Array#push: def my_push(*objects) raise ArgumentError, 'Needs 1+ arguments' if objects.empty? objects.each do |obj| puts "An object was pushed: #{obj.inspect}" @my_array.push obj end end What is the best way to document the method parameters using YARD syntax?...

Having two param lists with same size

c#,parameters
The method PrintTimes(string a, int b) prints the string a, b times (i.e. PrintTimes("test",3) will print testtesttest). I want to create a method, which will get a params array of strings and a params array of integers. So the call function will ook like this PrintTimes("A","B","C","D",2,1,3,2); Or PrintTimes("A",2,"B",1,"C",3,"D",2) Both of...

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

c#,methods,parameters,parameter-passing,pass-by-reference
I have been making an effort on C# methods. There are three ways that parameters can be passed to a C# methods. Value parameters : This method copies the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside...

How do pass parameter datasrc DataTables Jquery?

web-services,stored-procedures,parameters,jquery-datatables
I have a small question as follow: I have a function that it takes on values input and returns JSON string. In my function GET_PRODUCT input a parameter as string @product_name . The result as JSON , I do not know how to pass parameters in here . I must...

Java - Getting the URL's parameter

java,url,parameters,playframework-2.0
I have a URL something like this I'm using play framework HTTP Routes: GET /students controllers.Application.Get() POST /students controllers.Application.Post() PUT /students/{studentNo} controllers.Application.Put() How will I get the {studentNo} value? For example I'm using a postman(rest client) and I typed something in the url http://localhost:9000/students/2012111222 , how will I get the...

pass variables to jade template

node.js,express,parameters,parameter-passing,jade
I am trying to pass variables from page.js to page.jade but for some reason this is not working. here's my code: page.js res.render('page', {param1: 'xxx', param2: 'yyy'} ); page.jade #{param1} br #{param2} br ...

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

c,function,pointers,struct,parameters
In one of my applications written in C I have a struct declared as a member of another struct: struct _test { int varA; //... struct _small { int varB; //... } small; } test; Now I want to create a function that access varB above, but I don't want...

NodeJS / ExpressJS check valid token parameter before routing

node.js,express,parameters
I have the following app code: (app.js) var express = require('express') , app = express() , port = process.env.PORT || 8082 app.use(require('./controllers')) app.use(function(req, res, next) { res.send('Test') next() }) app.listen(port, function() { console.log('Listening on port ' + port) }) and two controllers: (index.js) var express = require('express') , router =...

Binding parameters in mysql

php,mysql,binding,parameters
I'm trying to learn about binding parameters in MySQL. I tried this test but I'm getting the error "Call to a member function bind_param() on a non-object". Am I doing something wrong? Here is the updated code: $sql = "INSERT INTO users (field1, field2, field3) VALUES (?, ?, ?)"; connect();...

How to add a SwitchParameter to an attribute collection?

powershell,parameters
I have an attribute collection defined like so: $AttributeCollection = New-Object System.Collections.ObjectModel.Collection[System.Attribute] While I am able to add attributes and validateset options I am however unable to add a SwitchParameter to the collection. $SwitchParameter = New-Object System.Management.Automation.SwitchParameter $AttributeCollection.Add($SwitchParameter) When I run the above I get the following error: Cannot find...

Optional output cursor as parameter

oracle,parameters,cursor,default-value,optional-parameters
I'm trying to cater for two applications. One calls a procedure with 2 cursors, the other with 1. Both are OUT SYS_REFCURSOR. Because of the difference in definition of the procedure, the change to one application will break the other. I am wondering if its possible to have the same...

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

c++,parameters,char,drawing
I want to draw and fill a rectangle using C++. The function parameter passed in must be a char, not an int. In my header file the drawing function is this: void draw(char); My rectangle.cpp file is this: void rectangle::draw(char ) { for(height=0;height<=height;height++) { for(width=1;width<=width;width++) { cout<<'*'; } } }...

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

c#,parameters,constructor,static,xna
I am making a game in C# and XNA 4.0 and one of my classes requires its own texture. The class is currently being used like this: Class constructor: class Item : ItemBase //It uses a base class { public Item(Texture2D myTexture) : base(myTexure) { } } New instance: Texture2D...

Verilog: generic parameters

parameters,verilog
I have several verilog (not system-verilog) blocks where I want to generate them depending on other parameters. As an example: module some_module (in, out) realtime p = 3.5; // the parameter which I want to change initial begin if ('global_parameter == 1) p = 5.8; if ('global_parameter == 2) p...

Django: Handling several page parameters

python,django,list,parameters,httprequest
I have several possible parameter to process in a page. Assume x0, x1, x2,..., x1000. It seems awkward to get and process them one by one by request.GET.get('x0'), request.GET.get('x1'), ... Any idea to put them in a list, so that they can be processed in a loop....

Methods with parameters

java,variables,methods,parameters
Is there a difference between declaring a variable in method parameters and declaring a variable inside a method? Both print out the same variable but i suppose there is a difference.

second parameter interfering with generic handler

c#,asp.net,parameters,webforms,generic-handler
My problem is this. When I just have a single parameter to search by, my image control works, when I try and pass a second parameter through, the image control does not work. I am using a generic handler as the image.URL, as I want to be able to either...

Cognos session parameters usage

session,parameters,frameworks,ldap,cognos
I have setup LDAP authentication and set up "custom properties" in cognos configuration to get a attribute i have defined in the LDAP entry. For example this custom property is called ORG_NAME, how do i use this ORG_NAME in report studio as a parameter to filter on? I have seen...

How extract parameters passed by delegate parameter

c#,parameters,delegates,helpers
I try to build a helper in MVC. I try passed parameters like this: @Html.InputHandler(settings => { settings.Name = "Julio"; settings.Mask = "000-000-000"; settings.visible = false; settings.Label = true; settings.htmlAttributes = new { @class="form-control" } }) I have the following code for definition of parameters public delegate void Action<in T>(T...

parenthetical parameters in Ruby / Rails

ruby-on-rails,ruby,methods,syntax,parameters
Learning Ruby / Rails, and encountered this with ERB templating: Works: <%= link_to image_tag(link.screenshot.url(:thumb)), link.screenshot.url(:original) %> Doesn't work: <%= link_to image_tag link.screenshot.url(:thumb), link.screenshot.url(:original) %> In the first one, the parameters for image_tag are in parentheses. For the other, they are not. I've come to understand in Ruby that methods don't...

While calling a no parametered function wants a parameter swift

swift,parameters
I wrote that function using Duncan C's post. I entered not parameter but while calling function Xcode wants a ViewController parameter. How can I solve that issue? Edit: I added rest of the code. What's destroying the assign() function? calling: import UIKit class ViewController: UIViewController, UITextFieldDelegate { @IBOutlet weak var...

Rails (param is missing or the value is empty)

ruby-on-rails,ruby,ruby-on-rails-4,parameters
I am using rails 4 and I've read that attr_accessible is beter not to use in this version. I have created that code: class UsersController < ApplicationController def new @user = User.new(user_params) end private ## Strong Parameters def user_params params.require(:user).permit(:name, :email, :password, :password_confirmation) end end But it gives me out...

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

json,post,properties,parameters,soapui
In soapUI, I am trying to perform an HTTP POST with the following JSON: { "myNode":{ "myOtherNode":"${MY_VALUE}" } } The POST operation is successful, but in the response the value for myOtherNode is blank. I'm guessing this is because soapUI is treating it as parameter and trying to replace it....

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

c#,html,parameters
At the moment I have a drop down box which only displays a Suppliers Name with the value of the ID hidden behind it. I would also like to display the Suppliers account number next to the Supplier Name. HTML: @Html.DropDownListFor( m => m.SupplierID, new SelectList(Model.Suppliers, "SupplierID", "SupplierName"), new {...

What are some use cases of “$*” in bash?

bash,parameters,arguments,command-line-arguments
From the bash man page: "$*" is equivalent to "$1c$2c...", where c is the first character of the value of the IFS variable. "$@" is equivalent to "$1" "$2" ... Any example where "$@" cannot work in place of "$*"?...

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

java,parameters
The squirrels in Palo Alto spend most of the day playing. In particular, they play if the temperature is between 60 and 90 (inclusive). Unless it is summer, then the upper limit is 100 instead of 90. Given an int temperature and a boolean isSummer, return true if the...

Magento URL with get parameters redirects to login

php,magento,url,parameters
I have a problem in my currently working Magento with the url on a custom extension I am building. In the config.xml I have added a <routers> entry wher the <use> is using admin and in the <args> are the tags <module> and <frontName>, the url acts well using the...

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

c,pointers,parameters,reference,dereference
I have seen something in this form: void function( A_struct &var ) { var.field0 = 0; // ... } Since there is & before var, I thought that var is a pointer. But in the body, instead of writing var->field0, var.field0 is written. So, my questions are: Isn't var a...

PHP - url path as parameters

php,url,parameters
My question might be silly, but I have no idea how to do it. I'm using PHP for creating websites. To change content of the page there is script which includes different file based on url parameter, eg. http://example.com/index.php?page=news This loads some news page. When I want to load some...

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

ruby,methods,parameters
I saw this line of code in a test I'm trying to get to pass. stack = Overflow.at(10) + 3 I've never seen a method called like this. Every book/blog I've seen only shows what's happening inside the parentheses (like the splat operator, multiple params, etc). I've never seen something...

Spring security - passing parameters to login page

spring,login,parameters
I am working on a Java/J2EE & Spring based web application. We are using spring security configurations for login. I have a requirement and not getting how to implement it. Requirement: Whenever anonymous users clicks on 'View Address Book' link on home page they should be redirect to login/signup page....

Decremented value called in the recursion in Haskell

string,function,haskell,recursion,parameters
So, I have this function that aligns the text to the left for a given column width. I have already fixed some of its problems, but I am unable to make it not use the decremented parameter once it is called, but to return to the starting value of n....

Spring data JPA and parameters that can be null

java,parameters,null,spring-data-jpa
My understanding is, that with Spring data JPA I cannot have a query method to fetch all rows where a column equals a given non-null method parameter and use the same method to fetch all rows where this column is NULL when the method parameter is null. Is that correct?...

Pass parameter to a URL AsyncTask android

android,parameters,android-asynctask
I'm developing an app and now I have to pass a parameter to a RESTful Service's URL. I'm using AsyncTask, and I need to pass a text from a list view as a parameter to the URL, for example: the URL is http://ip:7001/product?product_name=PARAM I need to get the text from...

Use a function with parameters inside a callback

javascript,parameters,callback
I've written a function which may take an unknown number of functions as parameters, but can't figure how I can make this work when one or more of the functions take parameters too. Here is a quick example of what I would like to achieve: function talk(name) { console.log('My name...

Open website url links with parameter by using a batch file

url,batch-file,parameters
I am trying to open some website url links with a parameter in my browser. I made a batch file using this code : @echo off start "images" "www.images.com/1000/image.jpg" start "images" "www.images.com/1001/image.jpg" start "images" "www.images.com/1002/image.jpg" ... ... start "images" "www.images.com/5000/image.jpg" All I want is to create a For loop that...

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

c++,class,parameters,header,enumerator
In a program I'm making, I'm trying to get a certain class to pass data to another class's function as a parameter. This data happens to be a variable from the first class's member enumerator. But I'm getting a lot of errors. The code below is an example of what...

Data type mismatch when inserting record

sql,vb.net,ms-access,parameters,insert
I've this piece of code for inserting records into an Access table. LastUpdated field is defined as Date/Time at database level. It fails when inserting giving the error Data type mismatch in criteria expression I'm using parameterized query which avoid problems with formatting values and it's very weird because I've...

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

windows,batch-file,parameters,cmd,parameter-passing
I have two bat files and i need to pass three parameter from one bat file to the other. However if the parameter ends in an "!" the parameter is not receieved caller.bat impl.bat param1 param2! param3 impl.bat echo %1 echo %2 echo %3 Expected Result after running caller.bat: param1...

Crystal Reports 2013 Referencing multi-value parameter in command

parameters,crystal-reports
I have a multi-value parameter called Category, listing out all the different procedure categories that can be queried. How does one reference this parameter in the command. The following code does not appear to work 1. and (i.PROC_CAT_ID in ({?Category})) 2. and (i.PROC_CAT_ID = ({?Category})) Any suggestions for making this...

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

sql-server,variables,dynamic,parameters
So I have my 'Chaplains' table: CREATE TABLE Chaplaincy_Chaplains ( ChaplainID INTEGER IDENTITY PRIMARY KEY, ChaplainName VARCHAR(50), FaithID INTEGER, Telephone VARCHAR(50), Email VARCHAR(255), Notes VARCHAR(255), FOREIGN KEY (FaithID) REFERENCES Chaplaincy_Faiths(FaithID) ); Into which I have inserted four records: INSERT INTO Chaplaincy_Chaplains VALUES ('Robin Richardson',1,'555-123456',[email protected]',NULL) INSERT INTO Chaplaincy_Chaplains VALUES ('Peter Jackson',8,'555-123-456',[email protected]',NULL)...

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

javascript,parameters,call,bootstrap,typeahead
If I have multiple '.typeahead' input field on my page, and I want each of them to initialize typehead(), how can I make an exception for one specfic input element without duplicating my code? E.g.: My fields: <input type="text" class="typehead_selector" id="coworkers"> <input type="text" class="typehead_selector" id="jobs"> <input type="text" class="typehead_selector" id="search" data-action="search">...

URL paramter looking like directory

javascript,url,parameters
I have seen websites with site IDs in the URL looking like a folder. For example: www.example.com/detail.html/42. The page is always the same and gets its content-ID from the URL without the typical GET parameters (.../detail.html?id=42). How can i manage this with Javascript?...

Simplify jQuery code by naming and recalling a repeated snippet

javascript,jquery,function,parameters
Sorry this question is so "newbie." I'm not entirely sure if what I'm attempting to do is possible, but I thought I would check. I have a script that finds and operates on many different elements inside of an iframe, like so: $(window).load(function(){ $('#iframe').contents().find('target1').doSomething1(); $('#iframe').contents().find('target2').doSomething2(); $('#iframe').contents().find('target3').doSomething3(); $('#iframe').contents().find('target4').doSomething4(); $('#iframe').contents().find('target5').doSomething5();...

parameters in event handlers - Javascript

javascript,events,parameters,event-handling
I have an event listener which includes an event handler with parameters ... and it works ... and, from what I have read, it is not supposed to. When I include the event handler in an anonymous function, like (I think that) I'm supposed to, it stops working. I have...

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

javascript,html,function,parameters,setattribute
In javascript, I was creating new image tags and I was adding attributes to them with the setAttribute() method but I found that if I add an onclick event and add a function, I can't set in a parameter for it as seen below count = 0; //Will be the...

Using SQL Parameters in ASP CLASSIC, object improperly defined error

sql-server,parameters,asp-classic
I am trying to protect my INSERT statement from SQL injection using Parameters, but for some reason I am getting the error: Parameter object is improperly defined. Inconsistent or incomplete information was provided... Though, I have no clue what is causing it. My SQL statement is as follows: Set spSQL...

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

postgresql,function,parameters
Can I use the meaningful name that I put on the parameter list, rather than the $1, $2 inside the function definition? CREATE OR REPLACE FUNCTION add_report_email( reportname1 text, personid2 integer ) RETURNS integer AS $$ DECLARE reportid integer; BEGIN select report_id into reportid from reports where report_name = $1;...

Verilog - Compile time calculations

parameters,system-verilog,synthesis
I need to do some calculations in compile time for a video driver. When the module is instantiated, WIDTH and HEIGHT parameters are defined. Then I compute some values from these. parameter X_BLOCK = $floor(640 / WIDTH); parameter Y_BLOCK = $floor(480 / HEIGHT); parameter BLOCK = X_BLOCK < Y_BLOCK ?...

Python subprocess return parameter

python,parameters,subprocess
What command must I use in Phyton to invoke a program and receive a parameter in return. Not a return "OK" or "not OK", but a returning identifier from the program that was invoked. I am using subprocess.call, but I know that not works. I am using Python 2.4.4....

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

javascript,parameters,initialization,arguments
i have a defined a function with a parameter in javascript, and i don't know how to initialize it's parameter, any one help me. the code is bellow <br/>Enter a number: <input type="text" id="txt1" name="text1"> <p>Click the button to see the result</p> <button onclick="myFunction(5)">show result</button> <br/> <p id="demo"></p> <script> function...