我有一个带有一些GET参数的URL,如下所示:
www.test.com/t.html?a=1&b=3&c=m2-m3-m4-m5
Run Code Online (Sandbox Code Playgroud)
我需要获得全部价值c.我试图读取URL,但我只是m2.我如何使用JavaScript执行此操作?
我想INNER JOIN在SQL Server 2008中删除使用.
但我得到这个错误:
消息156,级别15,状态1,行15
关键字"INNER"附近的语法不正确.
我的代码:
DELETE FROM WorkRecord2
INNER JOIN Employee ON EmployeeRun=EmployeeNo
WHERE Company = '1' AND Date = '2013-05-06'
Run Code Online (Sandbox Code Playgroud) 如果我订
<property name="show_sql">true</property>
Run Code Online (Sandbox Code Playgroud)
在我的控制台的hibernate.cfg.xml配置文件中,我可以看到SQL.
但它不是真正的 SQL ......我能看到将直接传递给数据库的SQL代码吗?
例:
我知道了
select this_.code from true.employee this_ where this_.code=?
Run Code Online (Sandbox Code Playgroud)
我可以看吗
select employee.code from employee where employee.code=12
Run Code Online (Sandbox Code Playgroud)
在真正的 SQL?
我正在尝试备份/恢复PostgreSQL数据库,如Docker网站上所述,但数据未恢复.
数据库映像使用的卷是:
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]
Run Code Online (Sandbox Code Playgroud)
而且CMD是:
CMD ["/usr/lib/postgresql/9.3/bin/postgres", "-D", "/var/lib/postgresql/9.3/main", "-c", "config_file=/etc/postgresql/9.3/main/postgresql.conf"]
Run Code Online (Sandbox Code Playgroud)
我用这个命令创建数据库容器:
docker run -it --name "$DB_CONTAINER_NAME" -d "$DB_IMAGE_NAME"
Run Code Online (Sandbox Code Playgroud)
然后我连接另一个容器来手动插入一些数据:
docker run -it --rm --link "$DB_CONTAINER_NAME":db "$DB_IMAGE_NAME" sh -c 'exec bash'
psql -d test -h $DB_PORT_5432_TCP_ADDR
# insert some data in the db
<CTRL-D>
<CTRL-D>
Run Code Online (Sandbox Code Playgroud)
然后创建tar存档:
$ sudo docker run --volumes-from "$DB_CONTAINER_NAME" --rm -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /etc/postgresql /var/log/postgresql /var/lib/postgresql
Run Code Online (Sandbox Code Playgroud)
现在我删除用于db的容器并创建另一个具有相同名称的容器,并尝试恢复之前插入的数据:
$ sudo docker run --volumes-from "$DB_CONTAINER_NAME" --rm -v $(pwd):/backup ubuntu tar xvf /backup/backup.tar
Run Code Online (Sandbox Code Playgroud)
但表是空的,为什么数据没有正确恢复?
我试图排除Sonar分析目录.我在我的sonar-project.properties文件中定义了以下属性:
sonar.sources=src/java
sonar.exclusions=src/java/test/****/*.java
Run Code Online (Sandbox Code Playgroud)
我的目录结构是:
src/java/dig
src/java/test/dig
Run Code Online (Sandbox Code Playgroud)
当我运行声纳 - 跑步者时,我得到以下信息:
INFO - Excluded sources:
INFO - src/java/test/**/*.java
INFO - Excluded tests:
INFO - **/package-info.java
Run Code Online (Sandbox Code Playgroud)
但是当我检查分析结果时,测试目录中的所有包仍然存在.
我只需要告诉Sonar不要分析测试目录及其中的任何包.
我使用Nginx作为反向代理,接受请求,然后执行proxy_pass从端口8001上运行的上游服务器获取实际的Web应用程序.
如果我去mywebsite.com或做一个wget,我会在60秒后获得504网关超时...但是,如果我加载mywebsite.com:8001,应用程序会按预期加载!
因此有些事情阻止了Nginx与上游服务器的通信.
所有这一切都是在我的托管公司重置机器运行之后开始的,之前没有任何问题.
这是我的vhosts服务器块:
server {
listen 80;
server_name mywebsite.com;
root /home/user/public_html/mywebsite.com/public;
access_log /home/user/public_html/mywebsite.com/log/access.log upstreamlog;
error_log /home/user/public_html/mywebsite.com/log/error.log;
location / {
proxy_pass http://xxx.xxx.xxx.xxx:8001;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Run Code Online (Sandbox Code Playgroud)
我的Nginx错误日志输出:
2014/06/27 13:10:58 [error] 31406#0: *1 upstream timed out (110: Connection timed out) while connecting to upstream, client: xxx.xx.xxx.xxx, server: mywebsite.com, request: "GET / HTTP/1.1", upstream: "http://xxx.xxx.xxx.xxx:8001/", host: "mywebsite.com"
Run Code Online (Sandbox Code Playgroud) 我知道virtualenv和pip.但这些与bundler/carton有点不同.
例如:
exec子命令(bundle exec bar)每个Python开发人员都使用virtualenv/pip吗?是否有其他Python包管理工具?
在Microsoft SQL Server中,可以指定"重音不敏感"排序规则(对于数据库,表或列),这意味着可以进行类似的查询
SELECT * FROM users WHERE name LIKE 'João'
Run Code Online (Sandbox Code Playgroud)
找到一个带有Joao名字的行.
我知道可以使用unaccent_string contrib函数从PostgreSQL中删除字符串中的重音符号,但我想知道PostgreSQL是否支持这些"重音不敏感"排序规则,以便SELECT上述方法可行.
我用hibernate成功编写了我的第一个master child示例.几天后我再次拿起它并升级了一些图书馆.不知道我做了什么,但我再也不能让它再次运行.有人会帮助我弄清楚在返回错误消息后返回的代码中出现了什么问题:
org.hibernate.PersistentObjectException: detached entity passed to persist: example.forms.InvoiceItem
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:127)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:799)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:791)
.... (truncated)
Run Code Online (Sandbox Code Playgroud)
hibernate映射:
<hibernate-mapping package="example.forms">
<class name="Invoice" table="Invoices">
<id name="id" type="long">
<generator class="native" />
</id>
<property name="invDate" type="timestamp" />
<property name="customerId" type="int" />
<set cascade="all" inverse="true" lazy="true" name="items" order-by="id">
<key column="invoiceId" />
<one-to-many class="InvoiceItem" />
</set>
</class>
<class name="InvoiceItem" table="InvoiceItems">
<id column="id" name="itemId" type="long">
<generator class="native" />
</id>
<property name="productId" type="long" />
<property name="packname" type="string" />
<property name="quantity" type="int" />
<property name="price" type="double" />
<many-to-one …Run Code Online (Sandbox Code Playgroud) 更具体地说,我使用自制软件来安装MySQL,我收到了这个错误:
Error: SHA1 mismatch
Expected: f218ed64ce6e7a5d3670acdd6a18e5ed95421d1f
Got: 3a57f6f44186e0dba34ef8b8fb4a9047e9e5d8a3
Archive: /Users/rdp/Library/Caches/Homebrew/cmake-2.8.7.bottle.tar.gz
(To retry an incomplete download, remove the file above.)
Run Code Online (Sandbox Code Playgroud) sql ×3
hibernate ×2
postgresql ×2
backup ×1
database ×1
docker ×1
homebrew ×1
indexing ×1
inner-join ×1
java ×1
javascript ×1
localization ×1
nginx ×1
orm ×1
perl ×1
pip ×1
proxypass ×1
python ×1
ruby ×1
sonar-runner ×1
sonarqube ×1
sql-delete ×1
sql-server ×1
url ×1
virtualenv ×1