parameter-passing

command line arguments fed from an array

醉酒当歌 提交于 2019-12-11 11:45:55
问题 I'd like to perform a complicated bash command, using data fed from a long array as arguments. I guess it has to use a subshell in some way. For example, instead of the workable convert -size 100x100 xc:black -fill white -draw "point 1,1" -draw "point 4,8" -draw "point 87,34" etc etc etc image.png I want to employ a different logic where the arguments are given in the same command, more like convert -size 100x100 xc:black -fill white $(for i in 1,1 4,8 87,34 etc etc; -draw "point $i"; done)

Error in Python Script regarding str(sys.argv[1])

…衆ロ難τιáo~ 提交于 2019-12-11 11:41:42
问题 import MySQLdb as mdb import math import sys from decimal import Decimal conn=mdb.connect('localhost','root','','testdb') c=conn.cursor() user_id=str(sys.argv[1]) lati=str(sys.argv[2]) longi=str(sys.argv[3]) radius=int(str(sys.argv[4])) #user_id=1 #lati='28.635308' #longi='77.224960' #radius=1.5 The error is : Traceback (most recent call last): File "C:\Python27\recommend.py", line 9, in <module> user_id=str(sys.argv[1]) IndexError: list index out of range However the dummy values which is

Why does java use both pass-by-value and pass-by-reference? [duplicate]

纵饮孤独 提交于 2019-12-11 11:35:43
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: Is Java “pass-by-reference”? Maybe I'm missing something...but I can't really understand why Java uses both the pass-by-value and pass-by-reference. Why not using only one paradigm? 回答1: It doesn't. Java is purely pass-by-value. The value passed when you're dealing with an object is an object reference, but that has nothing to do with "pass by reference." Pass-by-reference means that a function can be passed a

Getting an error Xlib: extension “RANDR” missing on display “:24.0”. gtk

自古美人都是妖i 提交于 2019-12-11 11:10:09
问题 I am receiving this error and not sure why...Please take a look at my buttons array, maybe I messed smth there, I am not sure... The error i get is: Xlib: extension "RANDR" missing on display ":24.0". and nothing happens after that, meaning my program doesnt run at all.... #include <gtk/gtk.h> /* Our new improved callback. The data passed to this function * is printed to stdout. */ static void callback (GtkWidget *widget, gpointer data) { system ((gchar *) data); } /* another callback */

argparse - how pass to a method with kwargs or argv

本秂侑毒 提交于 2019-12-11 10:52:08
问题 I've been looking for a way to use **kwargs or *argv with argparse . I will from hard code to a dynamic way. Here is my hard code and a example how I will use it. def get_parser(): parser = argparse.ArgumentParser() parser.add_argument("-r", "--range", dest="r", nargs=8, help="AddRange Parameters") parser.add_argument("-p", "--parameters", dest="p", nargs=8, help="SetDefaults as Parameters") parser.add_argument("-r", "--range", dest="r", nargs=8, help="AddRange Parameters") return parser ""

how to post parameter like {“register_id”:“3”} in AFNetworking

北城以北 提交于 2019-12-11 10:34:36
问题 i tried it but didn't work in AFNetworking only showing parameters error but i used postman to check and when i send data via key and value it showing error but from raw data i send {"register_id":"3"} then it will show me data so how to post parameter like this in AFNetworking. using This Link http://www.icubemedia.net/visitorbook/display_all.php is any one can help me for that how to post that data log error is: 2015-06-19 14:05:08.078 DemoAFNetworking[72771:1160924] {"msg":"parameter

How to pass GridView IDs and other controls into jQuery functions?

余生颓废 提交于 2019-12-11 10:32:46
问题 I am learning a lot more about jQuery and Javascript, and I am loving it! The power you have over a webform, control, etc with this language beats client-server methodologies hands down! One of the most common things people do with scripting languages is control Gridview rows and columns. In my case I am trying to control a Gridview within a cell of another gridview. What I want to do is to checkbox all my checkboxes inside the sub GridView control. Here is my ASP.net code of the main

Struts 2 - Can I access properties of another action which is not on the ValueStack?

房东的猫 提交于 2019-12-11 10:29:38
问题 I have two JSP pages displaying two lists from two different actions: page A displays employee list, page B displays department list. Both pages have a common text field (included from a third JSP page) on the top to search employees by name: <s:form action="searchEmployeesByName"> <s:textfield name="employeeName" /> <s:submit> </s:form> The search action is a part of class EmployeeAction and I can load page A and perform searching without problems. However, when loading page B , I

Update action seems to be doing nothing

天大地大妈咪最大 提交于 2019-12-11 09:54:45
问题 Currently,I have a overtime_definition_controller with methods like this class Edms::OvertimeDefinitionsController < ApplicationController require 'will_paginate/array' layout :compute_layout def new @flag = params[:flag] @employee = Employee.find(params[:id]) @overtime = OvertimeDefinition.new end def create @employee = Employee.find(params[:overtime_definition][:employee_id]) @overtime = OvertimeDefinition.new(params[:overtime_definition]) if (params[:half_day_extra_duty_hours][:hour].to_s

Google Apps Menu - Function with parameter

折月煮酒 提交于 2019-12-11 08:26:02
问题 Let's say I have this function: function alertar(userEmail) { var doc = DocumentApp.getActiveDocument(); // Get the URL of the document. var url = doc.getUrl(); // Send yourself an email with a link to the document. var u = Session.getActiveUser(); ui.alert('it worked'); GmailApp.sendEmail(userEmail, "assunto", "hey, click here" + url); } And then I created menus as follows: var editors = DocumentApp.getActiveDocument().getEditors(); var m = ui.createMenu('uPaPoPe Actions'); var subMenu = ui