我想安装Tensorflow上Raspberry Pi.该操作系统是Ubuntu Mate,python2.7和PIP版本7.1.2
当我跑这个
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Run Code Online (Sandbox Code Playgroud)
它告诉我们
"tensorflow-0.5.0 ......在这个平台上不是支持的轮子."
是否有可能安装Tensorflow上Raspberry?有人知道我错过了什么?
我是第一次做Selenium测试.在主页上,我调用了一些AJAX,我希望Selenium等待元素加载完成.我不确定它是否有效,但我只是键入selenium并且waitForCondition能够选择.
我不管我选择它总是返回"假".我现在不在,如果waitForCondition甚至工作?
如何测试它是否有效?我在这段代码中做错了什么?
selenium.waitForCondition("//input[@name='Report'", "3000");
selenium.waitForCondition("//*[@id='MyTable']", "3000");
selenium.waitForCondition("css=.someClass2", "3000");
Run Code Online (Sandbox Code Playgroud)
如果我通过自己的类实现 - 它返回"true"
private boolean isElementPresent(By by) {
try {
driver.findElement(by);
return true;
} catch (NoSuchElementException e) {
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
isElementPresent(By.xpath("//*[@ id ='MyTable']")) - 返回"true"
我是一个非常新的Python
如果有重复的话,我想改变句子.
正确
现在我使用这个reg.但它完全改变了字母.防爆."我的朋友和我很高兴" - >"我的朋友,很高兴"(它删除了"我"和空格)错误
text = re.sub(r'(\w+)\1', r'\1', text) #remove duplicated words in row
Run Code Online (Sandbox Code Playgroud)
我怎样才能做同样的改变,而不是字母,它必须检查单词?
我是Python的新手,所以这似乎很容易.我试图删除所有#,数字,如果连续两次重复相同的字母,我需要将其更改为只有两个字母.这项工作完美但不是ØÆÅ.
有什么想法可以用ØÆÅ字母做到这一点?
#!/usr/bin/python
# -*- coding: utf-8 -*-
import math, re, sys, os, codecs
reload(sys)
sys.setdefaultencoding('utf-8')
text = "ån9d ånd ååååånd d9d flllllløde... :)asd "
# Remove anything other than digits
text = re.sub(r'#', "", text)
text = re.sub(r"\d", "", text)
text = re.sub(r'(\w)\1+', r'\1\1', text)
print "Phone Num : "+ text
Run Code Online (Sandbox Code Playgroud)
我现在得到的结果是:
Phone Num : ånd ånd ååååånd dd flløde... :)asd
Run Code Online (Sandbox Code Playgroud)
我想要的是:
Phone Num : ånd ånd åånd dd flløde... :)asd
Run Code Online (Sandbox Code Playgroud) 我正在开发我的第一个Android应用程序.我已经创建了一个Service类,其作用是检查外部网页上是否有任何新信息.HTTP请求和服务工作正常,但过了一段时间我得到了这些OutOfMemoryError.
有人能够看到服务收集所有内存的位置吗?
错误消息1.
java.lang.OutOfMemoryError: pthread_create (stack size 16384 bytes) failed: Try again
at java.lang.VMThread.create(Native Method)
at java.lang.Thread.start(Thread.java:1029)
at org.apache.http.impl.conn.tsccm.AbstractConnPool.enableConnectionGC(AbstractConnPool.java:140)
at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.createConnectionPool(ThreadSafeClientConnManager.java:120)
at org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.(ThreadSafeClientConnManager.java:98)
at com.loopj.android.http.AsyncHttpClient.(AsyncHttpClient.java:210)
at com.loopj.android.http.AsyncHttpClient.(AsyncHttpClient.java:149)
at com.loopj.android.http.AsyncHttpClient.(AsyncHttpClient.java:119)
at com.quickit.app.MyService.checkUpdates(MyService.java:89)
at com.quickit.app.MyService.access$1(MyService.java:75)
at com.quickit.app.MyService$TimeDisplayTimerTask$1.run(MyService.java:68)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5105)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
错误消息2.
java.lang.OutOfMemoryError: thread creation failed
at java.lang.VMThread.create(Native Method)
at java.lang.Thread.start(Thread.java:1050)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:913)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1295)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:81)
at com.loopj.android.http.AsyncHttpClient.sendRequest(AsyncHttpClient.java:893)
at com.loopj.android.http.AsyncHttpClient.post(AsyncHttpClient.java:688)
at com.loopj.android.http.AsyncHttpClient.post(AsyncHttpClient.java:671)
at …Run Code Online (Sandbox Code Playgroud) 我已经创建了一个webproject Web2Py,并希望用户在正常的http://instaed 上访问这些页面http://.
每次我输入http://domain.pythonanywhere.comet重定向我http://domain.pythonanywhere.com.
它的时间为0.5秒.进行SSL检查,我想避免这种情况.
这是默认值:
## if SSL/HTTPS is properly configured and you want all HTTP requests to
## be redirected to HTTPS, uncomment the line below:
# request.requires_https()
Run Code Online (Sandbox Code Playgroud) 我已经完成了这个功能,看起来工作得很好,但它返回了"#",因为它不适合AJAX.我试图删除返回调用,看看.
它需要等到AJAX完成后再返回.JSP工作正常.
怎么了?
jQuery.validator.addMethod("knidExist", function(value, element) {
var valid = "#";
$.ajax({
async: false,
type: "POST",
url: "USER.jsp",
data: "knid="+value,
dataType: "html",
success: function(msg) {
// if the user exists, it returns a string "true"
if($.trim(msg) != "true") {
//return false;
valid = false; // already exists
} else {
//return true;
valid = true; // username is free to use
}
}
});
return valid;
}, 'This USER does not exist');
Run Code Online (Sandbox Code Playgroud) python ×3
ajax ×2
regex ×2
android ×1
encoding ×1
java ×1
jquery ×1
python-2.7 ×1
python-2.x ×1
selenium ×1
tensorflow ×1
threadpool ×1
validation ×1
web2py ×1