刚开始玩Google App Engine和Python(作为借口;)).如何正确提交这样的表格
<form action="https://www.moneybookers.com/app/payment.pl" method="post" target="_blank">
<input type="hidden" name="pay_to_email" value="ENTER_YOUR_USER_EMAIL@MERCHANT.COM">
<input type="hidden" name="status_url"
<!-- etc. -->
<input type="submit" value="Pay!">
</form>
Run Code Online (Sandbox Code Playgroud)
没有将数据暴露给用户?
在Swing应用程序中,只有在用户输入正确答案后,才能继续使用该方法.正确的答案存储在一个字符串中,用户答案由另一个字符串的监听器设置.所以,代码是
while (!correctAnswer.equals(currentAnswer)) {
// wait for user to click the button with the correct answer typed into the textfield
}
// and then continue
Run Code Online (Sandbox Code Playgroud)
这种方法一切都很好还是你会以某种方式重构它?它不会对CPU造成额外的惩罚吗?这是一个有点类似的问题.
任务是生成给定长度的给定数量的数字引脚.这是我提出的针对特殊情况的数字引脚的代码,它不以0开头:
def generate_pins(length, count):
return random.sample(range(int('1' + '0' * (length - 1)), int('9' * length)), count)
Run Code Online (Sandbox Code Playgroud)
你会如何实现它?
编辑:针不应重复.
EDIT2:可能让我们扩展这个例子,以便pin可以包含任何字母数字符号.
例如,我们来看看android.permission.GET_PACKAGE_SIZE.
在Android 1.6*.xml源文件中搜索此字符串仅指向使用它的单个应用程序frameworks\base\tests\AndroidTests.
所以下一步是搜索.java文件,希望我最终能找到可能看起来像查询包大小的代码.
这是发现许可使用的假设方式吗?
python ×3
android ×1
cpu-cycles ×1
forms ×1
java ×1
nonblocking ×1
post ×1
sockets ×1
while-loop ×1