在Eclipse中安装Android时遇到问题(Indigo和Helios,我尝试了很多不同的版本).当我使用地址http://dl-ssl.google.com/android/eclipse/或localy(包含存档)搜索插件时,它无效.
它找到了开发工具,但它阻止了"计算需求和依赖性".
有什么问题 ?
我的代码提取了JSONObject的结果,但有时,i值不会从1开始,我有一个错误:
org.json.JSONException: No value for 1
Run Code Online (Sandbox Code Playgroud)
我的代码:
JSONObject obj = new JSONObject(result);
for(int i=1;i<=14;i++) {
JSONArray arr = obj.getJSONArray(""+i);
extraction(arr, i);
}
Run Code Online (Sandbox Code Playgroud)
如果目标代码(i)存在与否,我想在提取之前进行测试.我怎么能这样做?
我无法使用表单访问我的servlet.我检查了arborescence,web.xml和表单,但我看不出任何问题.我使用Eclipse和"web动态项目".
有我的树枝:

我的web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Z-ProjetJ2EE</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<servlet>
<description></description>
<servlet-name>CommandeServlet</servlet-name>
<servlet-class>controleur.CommandeServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CommandeServlet</servlet-name>
<url-pattern>/urlCommandeServ</url-pattern>
</servlet-mapping>
</web-app>
Run Code Online (Sandbox Code Playgroud)
我的表单(我尝试了完整的网址,但它没有用):
<form action="/urlCommandeServ" method="post">
Run Code Online (Sandbox Code Playgroud)
而我的servlet:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String cat = request.getParameter("categorie");
Float prix = Float.parseFloat(request.getParameter("prix"));
response.sendRedirect("CreerCommande?cat=" + cat+"&prix="+prix);
Run Code Online (Sandbox Code Playgroud)
我在eclipse中没有任何错误,tomcat中的日志文件夹是空的.你可以帮帮我吗 ?
编辑:
有我的错误:

我同意关于我在response.sendRedirect上的错误的回复,但这不是我的错误的真正主题:)即使我删除了doPost上的所有代码,我有这个错误,而不是白页.
我想测试两个变量是否存在,在我使用"read"创建它之后.如果用户只输入我想要的两个变量之一,则会显示错误.
有我的代码:
while true;
do
echo "Saisissez deux variables x et y sous la forme [x y]"
read x y
if [ !-e $x ] || [ !-e $y ] <<<<<< problem ligne
then
echo "Vous devez renseigner deux nombres x et y"
elif [ $x = "." ]
then
exit 0
else
calcul $x $y
fi
done
Run Code Online (Sandbox Code Playgroud)
当我输入一个参数时出现错误:
[: !-e: unary operator expected
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助 :)
我对SQL请求有一个奇怪的结果,我在子请求中为"alerts"表提供了一个未知字段"alert_event_load_time",但是存在于"alert_events"表中,但是我得到的结果是:
"select count(*) FROM rc.alert_events WHERE
alert_id in
(select alert_id from rc.alerts where alert_event_load_time like '2015-08-04%');"
+----------+
| count(*) |
+----------+
| 237634 |
+----------+
Run Code Online (Sandbox Code Playgroud)
它返回与请求相同的结果:
select count(*) FROM rc.alert_events WHERE alert_event_load_time like '2015-08-04%' ;"
+----------+
| count(*) |
+----------+
| 237634 |
+----------+
Run Code Online (Sandbox Code Playgroud)
它可能是一个错误吗?
嗨,大家好 !
我正在尝试使用动态 ID 查找元素,但是!无论我做什么,都会系统地引发除了 NoSuchElementException 之外的...
有我的代码:
try:
driver.get('http://www.website.com/')
usr = driver.find_element_by_css_selector("a[id*='txtEmail']")
pwd = driver.find_element_by_css_selector("a[id*='txtPassword']")
usr.send_keys(username)
pwd.send_keys(password)
driver.find_element_by_css_Selector("a[id*='btnLogin']").click()
if (driver.find_element_by_css_Selector("a[id$=lnkLogOut]")):
log.info("Successfully connected")
else:
log.error("Login failed - Cannot login to the website - Wrong username/password ?")
except NoSuchElementException:
log.error("Cannot find element needed on the login page")
except TimeoutException:
log.error("Cannot reach the website in time")
except:
log.error("Error occurred during the login attempt: {}".format(sys.exc_info()))
Run Code Online (Sandbox Code Playgroud)
有 html 形式:
<td>Email/Username:</td>
<td><input name="ctl00$cph1$Login1$txtEmail" id="ctl00_cph1_Login1_txtEmail" style="width:160px;" type="text"></td>
<td>Password:</td>
<td><input name="ctl00$cph1$Login1$txtPassword" id="ctl00_cph1_Login1_txtPassword" style="width:160px;" type="password"></td>
<td><input name="ctl00$cph1$Login1$btnLogin" value="Login" …Run Code Online (Sandbox Code Playgroud) 你好!
我有点卡在 docker-compose 中,因为我需要将我的私有 SSH 密钥传递给我Dockerfile在我的声明中声明的docker-compose.yml,如下所示:
docker-compose.yml
version: '3.7'
services:
worker:
build: .
args:
- SSH_PRIVATE_KEY
Run Code Online (Sandbox Code Playgroud)
文件
ARG SSH_PRIVATE_KEY
RUN mkdir /root/.ssh/ && \
echo "${SSH_PRIVATE_KEY}" > /root/.ssh/id_rsa && \
chmod 600 /root/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
使用 docker 本身,这很容易,因为我只需要运行以下命令:
docker build . --build-arg SSH_PRIVATE_KEY="$(cat ~/.ssh/id_rsa)"
Run Code Online (Sandbox Code Playgroud)
但是在docker-compose中... docker-compose中的ARGS配置问题在另一个问题中描述的就是不能让私钥在docker-compose.yml文件里面。
我需要让 docker-compose 访问里面的密钥~/.ssh/id_rsa:有关如何执行该操作的任何线索?
谢谢!
我的PHP脚本的JSON结果有问题.我无法在JAVA中提取此结果.以下是错误:
Error converting result org.json.JSONException: Value
{"3":[{"date":"25\/07\/2011","descr":"Une colloque bla bla","numColloque":"1","titre":"Une colloque"}],
"2":[{"mail":"jm@dvaid.fr","descr":"truc truc","nom":"Une personne","tel":"0600000000","numPersonne":"1"}],
"1":[{"lien":"http:\/\/www.irdes.fr","numTypeActu":"1","date":"25\/07\/2011","titre":"Une actualité récente","numActu":"1"}],
"7":[{"numEtablissement":"1","specialite":"STG","mention":"une mention","modalite":"BTS","titre":"Un titre de formation","numFormationCours":"1"}],
"6":[{"numEtablissement":"1","numEnseignement":"1","titre":"Cours de bla bla","numEnseignant":"1"}],
"5":[{"date":"31\/07\/2011","descr":"Université paris descartes dans le 1-ème arrondissement de Paris","numEtablissement":"1","libelle":"IUT Paris DESCARTES"}],
"4":[{"numDocument":"1","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypeDocument":"1","descrRapide":"un glossaire qui regroupe du bla bla","nom":"un document de glossaire"},
{"numDocument":"2","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypeDocument":"2","descrRapide":"Une synthèse parlant d'un truc","nom":"Une synthèse"}],
"9":[{"lien":"http:\/\/www.irdes.fr","descr":"un séminaire sur le blabla","date":"25\/07\/2011","heure":"14h30","nom":"Un séminaire","numSeminaire":"1"}],
"8":[{"numPublication":"1","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypePublication":"1","titre":"Une publication"},
{"numPublication":"2","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypePublication":"2","titre":"un titre de publication"},
{"numPublication":"3","lienPDF":"http:\/\/www.irdes.com","date":"25\/07\/2011","numTypePublication":"3","titre":"un titre"}]}
of type org.json.JSONObject cannot be converted to JSONArray
Run Code Online (Sandbox Code Playgroud)
我的结果的语法很简单:
{"Object1":[{"id":"value"},{"id":"value"}],
"Object2":[{"id":"value"},{"id":"value"}],
...
} …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用JDBC驱动程序将我的Android应用程序连接到服务器(PostgreSQL),但是我有这个错误:
java.lang.ClassNotFoundException: org.postgresql.Driver
...
Caused by: java.lang.NoClassDefFoundError: org/postgresql/Driver
... 12 more
Caused by: java.lang.ClassNotFoundException: org.postgresql.Driver
...
java.sql.SQLException: No suitable driver
Run Code Online (Sandbox Code Playgroud)
我尝试了很多东西,比如在路径中添加驱动程序的地址,但没有任何效果.我按照本教程:http: //appliedcoffeetechnology.tumblr.com/post/10657124340并在Build Path中添加了驱动程序JDBC4(我也尝试过JDBC3).
每个人都可以帮助我吗?
我想知道如何删除电子邮件中上一条消息的任何标题。有一个消息示例:
Something above
-----Message d'origine-----
De : Myself <myself@himself.com>
Envoyé : vendredi 8 mars 2019 14:30
À : Someone <someone@himself.com>
Cc : AnotherGuy <another@himself.com>
Objet : My bad I forgot how to do it
Hi,
blabla
Run Code Online (Sandbox Code Playgroud)
而且我需要删除-----Message d'origine-----和之间以及之前carriage return和empty new line之前的所有内容"Hi,"。
我已经尝试过以下正则表达式:
-----Message d'origine-----[\s\S]*?[\r\n]
Run Code Online (Sandbox Code Playgroud)
但仅-----Message d'origine-----匹配而没有下面的其他行。但是,如果我改用"Hi,",它将匹配所有行:
-----Message d'origine-----[\s\S]*?Hi
Run Code Online (Sandbox Code Playgroud)
有谁可以帮助我解决问题所在,以及如何使用carriage return和empty new line?
谢谢 :)