variables

Inputting a variable into a text file, using a batch file

♀尐吖头ヾ 提交于 2020-01-17 04:56:08
问题 So I'm trying to make it so that the user sets a password, and that password is loaded into a text file to be extracted for later use. The problem is, instead of typing the variable that the user inputs in the text file, it types 'ECHO is off' (or ECHO is on, if it's on). Here is what I have written. cls set/p pass = Please enter your password: > "p.txt" (@echo %pass%) echo Password created! Thanks in advance! EDIT: Thanks to MC ND, I have the solution! set /p "pass= Please enter your

How can i access a variable or change the state of an element(like tabNavigator) from one mxml to another mxml?

落花浮王杯 提交于 2020-01-17 04:33:06
问题 How can i access a variable or change the state of an element(like tabNavigator) from one mxml to another mxml in FLEX 4.6?? 回答1: Each separate MXML file should be viewed as a class, since that is what they are. In the theory of encapsulation; two classes should not directly access / change each others variables or state. They should use an API provided by the developer of the MXML Class. If MXML 1 is the parent of MXML 2; then MXML1 can pass data to MXML2 by setting public properties or

In bash, how do I execute the contents of a variable, VERBATIM, as though they were a command line?

耗尽温柔 提交于 2020-01-17 04:25:12
问题 I need to construct a complex command that includes quoted arguments. As it happens, they are arguments to grep, so I'll use that as my example and deeply simplify the command to just enough to demonstrate the error. Let's start with a working example: > COMMAND='/usr/bin/grep _' > echo $COMMAND /usr/bin/grep _ > $COMMAND foo <- I type this, and grep filters it out. foo_ <- I type this, and..... foo_ <- ... it matches, so grep emits it. "foo" is not echoed back because it lacks an underscore,

Storing image path in a variable

让人想犯罪 __ 提交于 2020-01-17 04:18:13
问题 I have a database that stores the path to the users image such as images/profile/950baasfaa88c.jpg. Now when i try to put this into a variable and surround it with image tags, only a blank image comes up not the image itself... $profile_picture = $row['profile_image']; <img src="'.$profile_picture.'" width=50 height=50 /> 回答1: you haven't echo PHP <img src="'.$profile_picture.'" width=50 height=50 /> should be <img src="<?= $profile_picture ?>" width=50 height=50 /> 回答2: you need to echo out

Pass checkbox value to Edit (using href)

≯℡__Kan透↙ 提交于 2020-01-17 04:11:09
问题 I'm trying to get the value of the selected checkbox to be transfered to the next page using href. I'm not in a position to use submit buttons.I want this to be done using JavaScript. My checkbox is populated with value from a table row-docid. Here is my code for Checkbox in view.php: ... mysql_connect("$host", "$dbuser", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $doctbl_name"; $result=mysql_query($sql); if(!$result ){ die

Javascript Dynamic Variable (Random number added)

試著忘記壹切 提交于 2020-01-17 02:56:05
问题 How do I create a dynamic variable in Javascript? For example, I have: var myAwesomeText = "Hello World!" But now I want the varible MyAesomeText to have a random number attached to it every time the page is refreshed. So it would instead look like something like this: var myAwesomeText12345 = "Hello World!" And most importantly, how do I call that that new random variable back once the random number has been assigned to it? (i.e: alert(???);) I've tried something like this, but I'm going

What is the order of local variables on the stack?

扶醉桌前 提交于 2020-01-17 02:22:07
问题 I'm currently trying to do some tests with the buffer overflow vulnerability. Here is the vulnerable code void win() { printf("code flow successfully changed\n"); } int main(int argc, char **argv) { volatile int (*fp)(); char buffer[64]; fp = 0; gets(buffer); if(fp) { printf("calling function pointer, jumping to 0x%08x\n", fp); fp(); } } The exploit is quite sample and very basic: all what I need here is to overflow the buffer and override the fp value to make it hold the address of win()

MySQL TRUNCATE or ROUND with variable decimal length

[亡魂溺海] 提交于 2020-01-17 01:30:28
问题 I am not able to TRUNCATE (or round) a decimal on variable decimal lengh . Here's my MySQL query: SELECT TRUNCATE( `amount` , `decimal_length` ) AS truncated_decimal, FROM table -- sample data amount decimal length 123.123 0 456.456 1 789.789 2 --expected outcome truncated_decimal 123 456.4 789.78 --current outcome (wrong) truncated_decimal 123.123 456.456 789.789 My truncated_decimal variable is returned WITHOUT truncation, i.e. default decimal length from table. Same behavior with ROUND

Making 1 of 6 Variables true randomly in jquery

↘锁芯ラ 提交于 2020-01-17 01:14:12
问题 I am trying to make a one of a series of divs appear randomly with jquery along with it's navigation link(i.e. If services gets pick, the services link will unfade). I have found this code various times in various forms on this forum, and was wondering if and how I could adapt it to what I would want. var services = $(random1, random2, random3).get() .sort(function(){return Math.round(Math.random());}).slice(0,1) $(services)/*Conditions here*/; var random1 = false; var random2 = false; var

Java initialization question

拟墨画扇 提交于 2020-01-17 00:34:33
问题 JPanel p2 = new JPanel(new GridLayout(6,1)); ButtonGroup tubtype = new ButtonGroup(); JRadioButton roundrButton = new JRadioButton("Round", true); tubtype.add(roundrButton); JRadioButton ovalrButton = new JRadioButton("Oval", false); tubtype.add(ovalrButton); calcButton = new JButton("Calculate Volume"); exitButton = new JButton("Exit"); hlength = new JTextField(5); hwidth = new JTextField(5); hdepth = new JTextField(5); hvolume = new JTextField(5); lengthLabel = new JLabel("Enter the tub's