user-input

Ruby on Rails: file_field, how do I remove the upload button?

让人想犯罪 __ 提交于 2020-01-01 19:37:13
问题 Cause I have a custom styled / positioned button. Currently, our set up is: Special upload button (Fancy) Hide the file_field in a div, cause the button can't be moved to be separate from the text. But we still want the text saying what file you've selected 回答1: Use CSS opacity to make the file field invisible, but still clickable. Also make the file field absolute positioned, and use a z-index to display it above a target button for the user the click. You can reference the file name via

What are the difference in usage between Either and Except in Haskell?

▼魔方 西西 提交于 2020-01-01 11:58:08
问题 I have a class that can be created from several arguments in Haskell which requires some complex validation of those arguments. Currently I have something like makeAThingExcept :: String -> String -> ... String -> Except ThingError AThing makeAThingExcept s1 s2 ... = do unless (s1CheckPasses s1) (throwError (BadS1 s1)) ... data ThingError = BadS1 String ... instance Show ThingError where show (BadS1 s) = "Bad S1: " ++ s makeAThing :: String -> String -> ... String -> AThing makeAThing s1 s2 .

XSS Me Warnings - real XSS issues?

邮差的信 提交于 2020-01-01 07:14:38
问题 I've been using the free Firefox extension XSS Me from Security Compass to test for XSS problems. However, using what I understand to be safe filtering, XSS me still reports warnings. Are these accurate warnings or spurious? Using the code below as a testcase: <form method="post" action=""> <input type="text" name="param" value="<?php echo htmlentities($_POST['param'])?>"> <input type="submit"> </form> <?php echo htmlentities($_POST['param'])?> I run some nasties by hand but none of them are

Get user input from a textbox in a WPF application

微笑、不失礼 提交于 2020-01-01 02:33:52
问题 I am trying to get user input from the textbox in a WPF application I am building. The user will enter a numeric value and I would like to store it in a variable. I am just starting on C#. How can I do it? Currently I am opening the textbox and letting the user enter the value. After that the user has to press a button upon which the text from textbox is stored in a variable. private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { } private void Button_Click(object sender,

How to make a window with buttons in python

让人想犯罪 __ 提交于 2019-12-31 22:38:06
问题 How do I create a function that makes a window with two buttons, where each button has a specified string and, if clicked on, returns a specified variable? Similar to @ 3:05 in this video https://www.khanacademy.org/science/computer-science-subject/computer-science/v/writing-a-simple-factorial-program---python-2 (I know it's a tutorial for a very easy beginners program, but it's the only video I could find) but without the text box, and I have more controls over what the 'ok' and 'cancel'

Accept user input

故事扮演 提交于 2019-12-31 17:52:51
问题 I am currently writing a text-adventure type game in Malbolge. Can anyone tell me how to accept a user input in Malbolge? I am able to output text to the screen, however, I can't seem to figure out how to accept input. 回答1: GHJUYGHJKLKUJHM;&MJ:6AG9F5D8V)A8%]>75Q;6EE85U955%-245!/3DU,2TI) M2$=&141#0D% /SX]/#LZ.3@W-C4T,S(Q,"\N+2PK*BDH)R8E)",B(7Y]?'MZ M>7AW=G5T<W)Q<&]N;6QK:FEH9V9E9&-B86!?7EU<6UI96%=655134E%03TY- Untested, but should work. 来源: https://stackoverflow.com/questions/859314/accept-user

Accept user input

佐手、 提交于 2019-12-31 17:51:54
问题 I am currently writing a text-adventure type game in Malbolge. Can anyone tell me how to accept a user input in Malbolge? I am able to output text to the screen, however, I can't seem to figure out how to accept input. 回答1: GHJUYGHJKLKUJHM;&MJ:6AG9F5D8V)A8%]>75Q;6EE85U955%-245!/3DU,2TI) M2$=&141#0D% /SX]/#LZ.3@W-C4T,S(Q,"\N+2PK*BDH)R8E)",B(7Y]?'MZ M>7AW=G5T<W)Q<&]N;6QK:FEH9V9E9&-B86!?7EU<6UI96%=655134E%03TY- Untested, but should work. 来源: https://stackoverflow.com/questions/859314/accept-user

How to read a binary number as input?

旧城冷巷雨未停 提交于 2019-12-31 14:42:10
问题 Is there a way for the user to input a binary number in C or C++? If we write something like int a = 0b1010; std::cout << a << std::endl Then the output comes out to be 10 (when using the appropriate compiler extensions). but when we try to write int n; std::cin >> n; int t = 0bn; It gives us an error so can anyone suggest that how can we directly read binary number as input rather than using string to store input? 回答1: There is a bit of confusion here, let's disentangle it a bit. 0b1010 is

Python - User input for name of a variable to pass as an argument to a function

痞子三分冷 提交于 2019-12-30 11:02:32
问题 I have a question here which is based around user input to scripts and passing this user-input to functions. I have a script, within which I have defined a function. What I want the script to do is take user input to pass as arguments to the function. However, one of the things I want to pass to the function is the name of an argument rather than the argument itself. The user has the choice of using a variety of different lists to input to the function, and what I wanted was to get the user

How can I get user input without waiting for enter in Perl?

馋奶兔 提交于 2019-12-30 08:07:12
问题 I am trying to make an interactive shell script in Perl. The only user input I can find is the following: $name = <STDIN>; print STDOUT "Hello $name\n"; But in this the user must always press enter for the changes to take effect. How can I get the program to proceed immediately after a button has been pressed? 回答1: From perlfaq8's answer to How do I read just one key without waiting for a return key? : Controlling input buffering is a remarkably system-dependent matter. On many systems, you