variables

Read line containing String (Bash)

被刻印的时光 ゝ 提交于 2020-02-01 04:55:32
问题 I have a file, and its something like this: Device: name1 random text Device: name2 random text Device: name3 random text I have a variable: MainComputer What I want to get (for each name, i have like 40 names): MainComputer -> name1 MainComputer -> name2 MainComputer -> name3 What I have: var="MainComputer" var1=$(awk '/Device/ {print $3}' file) echo "$var -> $var1" This only gives the arrow "->" and the link for the first variable, I want them for the other 40 variables... Thanks anyway!

Oracle PL/SQL: How to find unused variables in a long package?

回眸只為那壹抹淺笑 提交于 2020-01-31 18:28:05
问题 Please suppose you have an Oracle PL/SQL package of about 200,000 rows of code. Is there any fast way to detect variables declared, but not used in the package? Thank you in advance for your kind help. EDIT (April 7th, 2014): I am using Oracle 10G. EDIT: I am looking for a pure PL/SQL solution. 回答1: The following only applies to 11g R2. It looks like PL/Scope has become available in 11g R1. You won't get information about unused variables with PLSQL_WARNINGS='ENABLE:ALL' : SQL> !cat test.sql

Oracle PL/SQL: How to find unused variables in a long package?

▼魔方 西西 提交于 2020-01-31 18:28:05
问题 Please suppose you have an Oracle PL/SQL package of about 200,000 rows of code. Is there any fast way to detect variables declared, but not used in the package? Thank you in advance for your kind help. EDIT (April 7th, 2014): I am using Oracle 10G. EDIT: I am looking for a pure PL/SQL solution. 回答1: The following only applies to 11g R2. It looks like PL/Scope has become available in 11g R1. You won't get information about unused variables with PLSQL_WARNINGS='ENABLE:ALL' : SQL> !cat test.sql

how to define variable in jquery

爱⌒轻易说出口 提交于 2020-01-30 14:21:08
问题 I would like to know how to declare a variable in jQuery The code I am currently using is $.name = 'anirudha'; alert($.name); That code works fine, but if I write it as $.name = document.myForm.txtname.value; alert($.name); Then my code does not work. 回答1: jQuery is just a javascript library that makes some extra stuff available when writing javascript - so there is no reason to use jQuery for declaring variables. Use "regular" javascript: var name = document.myForm.txtname.value; alert(name)

Share a variable between two classes

半城伤御伤魂 提交于 2020-01-30 13:27:43
问题 I have two different .cs windows in just 1 project. Each one runs a different part of my program. But now I need to use a variable (i) of mainwindow.cs in Form.cs. This variable changes all the time. How can I do it? MAINWINDOW.CS namespace samples { using System.IO; ........ public partial class MainWindow : Window { float i; } } FORM1.CS namespace samples { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { ...

Bash - Initialize variable to output of command “permission denied”

会有一股神秘感。 提交于 2020-01-30 08:54:25
问题 I'm writing a small bash script to get the number out of each file name. For example the file name helloworld1.txt would produce 1 . When attempting to set the output to the variable i I get an error for each file. line 5: 985.txt: Permission denied If I just echo the command echo $f | tr -dc '[0-9]' rather than assign it to a variable, everything is good. #!/bin/bash for f in * do i=`$f | tr -dc '[0-9]'` // Permission denied. echo $i done 回答1: You have missed echo here. The line i=`$f | tr

I want to refer to a variable in another python script

痴心易碎 提交于 2020-01-30 08:34:05
问题 A variable AA is in aaa.py . I want to use this variable in my other python file bbb.py How do I access this variable? 回答1: You're looking for modules! In aaa.py : AA = 'Foo' In bbb.py : import aaa print aaa.AA # Or print(aaa.AA) for Python 3 # Prints Foo Or this works as well: from aaa import AA print AA # Prints Foo 回答2: You can import it; this will execute the whole script though. from aaa import AA 回答3: In your file bbb.py , add the following: import sys sys.path.append("/path/to/aaa.py

VBA — variable in .formula

你离开我真会死。 提交于 2020-01-30 08:27:27
问题 is there a more elegant (simpler) way to put a variable in .formula? I don't want to use .formulaR1C1 I have this code: Range("C8").Select Selection.End(xlDown).Select PosR = ActiveCell.Row KonR = PosR - 2 Range("N" & PosR).Select aAddress = Range("$N$9").Address & ":" & Range("$N$" & KonR).Address ActiveCell.Formula = "=SUM(" & aAddress & ")" Obviously I want to put =SUM($N$9:$N$101) (101 is the last cell minus 2) into that cell and this code does the job. But I just want to be sure that

Can C++ variables in cpp file defined as Special Symbols β

谁说我不能喝 提交于 2020-01-30 07:33:05
问题 Can we define the variable in c++/ c using special characters such as; double ε,µ,β,ϰ; If yes, how can this be achieved? 回答1: As per the working draft of CPP standard (N4713), 5.10 Identifiers [lex.name] ... An identifier is an arbitrarily long sequence of letters and digits. Each universal-character-name in an identifier shall designate a character whose encoding in ISO 10646 falls into one of the ranges specified in Table 2. The initial element shall not be a universal-character-name

What changed in xcode7 debugger that I can no longer view variables with “po” / Swift

假装没事ソ 提交于 2020-01-30 05:28:56
问题 ok what changed in xCode7 / Swift that I can no longer use "po frame" to view the contents of a CGRect anylonger? The print statment works just fine in the code. How come I can't view that in the debugger console like I used to? var frame = self.myLabel.frame frame.origin.x = self.startingFrame.origin.x + translation.x frame.origin.y = self.startingFrame.origin.y + translation.y print(frame) self.myLabel.frame = frame yet in the debugger if I break on the self.myLabel.frame = frame statement