假设这个标记:
<table class="table table-bordered" align="center">
Run Code Online (Sandbox Code Playgroud)
没有我有多少单元格,表格总是100%宽度.为什么?
我正在尝试执行此查询:
SELECT mac, creation_date
FROM logs
WHERE logs_type_id=11
AND mac NOT IN (select consols.mac from consols)
Run Code Online (Sandbox Code Playgroud)
但我没有结果.我测试了它,我知道语法有问题.在MySQL中,这样的查询非常有效.我添加了一行以确保表mac
中不存在一行consols
,但仍然没有给出任何结果.
是否有命令可以显示GIT中所有可用命令的列表?有git help
,但它显示:
usage: git [--version] [--exec-path[=<path>]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=<path>] [--work-tree=<path>]
[-c name=value] [--help]
<command> [<args>]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit …
Run Code Online (Sandbox Code Playgroud) 嗨我试图使内联形式混合水平我有http://jsfiddle.net/TNLnP/3/但我想得到类似的东西
<label><input>
<label><input><label><input><label><input>
Run Code Online (Sandbox Code Playgroud) 0并且有问题在哪里放置我试过的公共文件在spring-mvc应用程序中放置图像/ CSS的位置?这个解决方案,但它不适合我
我试图将我的公共文件夹放在WEB-INF
目录外的所有位置,但仍然没有
web.xml中
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<display-name>s-mvc</display-name>
<servlet>
<servlet-name>frontController</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>frontController</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<mvc:resources mapping="/css/**" location="/css/"/>
</web-app>
Run Code Online (Sandbox Code Playgroud)
frontcontroller-servlet.xml中
<mvc:annotation-driven/>
<context:component-scan base-package="pl.skowronline.controller" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
以及我如何调用css文件
<link type="text/css" href="/css/bootstrap.css" rel="stylesheet" />
我正在使用jOOQ来获取MySQL中的id smallint unsigned primary key auto_increment
public List<Integer> getID() {
Factory sql = new Factory(Database.getInstance().connect(), SQLDialect.MYSQL);
return (List<Integer>) sql.select().from("users").fetch().getValues("id_users");
}
Run Code Online (Sandbox Code Playgroud)
然后出错
org.jooq.tools.unsigned.UShort cannot be cast to java.lang.Integer
Run Code Online (Sandbox Code Playgroud)
在这里,他们写道,smallint unsigned应该转换为int.
编辑 方法应该是
public List<UShort> getID() {
Factory sql = new Factory(Database.getInstance().connect(), SQLDialect.MYSQL);
return (List<UShort>) sql.select().from("users").fetch().getValues("id_users");
}
Run Code Online (Sandbox Code Playgroud)
并且循环结果应该转换为int.
namespace griffin\UserBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="griffin\UserBundle\Entity\UserRepository")
* @ORM\Table(name="users")
*/
class User {
const STATUS_ACTIVE = 1;
const STATUS_INACTIVE = 0;
/**
* @ORM\Id
* @ORM\Column(name="id_users", type="smallint")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $idUsers;
Run Code Online (Sandbox Code Playgroud)
和Repository类一样
namespace griffin\UserBundle\Entity;
use Doctrine\ORM\EntityRepository;
class UserRepository extends EntityRepository {
public function getAdmin()
{
return $this->getEntityManager()
->createQuery('select * from users where users_groups_id = 1')
->getResults;
}
}
Run Code Online (Sandbox Code Playgroud)
当我在控制器中调用它时
$results = $this->getDoctrine()
->getRepository('griffin\UserBundle\Entity\UserRepository')
->getAdmin();
var_dump($results);
Run Code Online (Sandbox Code Playgroud)
我收到了错误
Class "griffin\UserBundle\Entity\UserRepository" sub class of "Doctrine\ORM\EntityRepository" is not a valid entity …
我有这样的听众
use Doctrine\Common\EventSubscriber;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
use Doctrine\Common\Persistence\Event\PreUpdateEventArgs;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\Events;
class MachineSubscriber implements EventSubscriber
Run Code Online (Sandbox Code Playgroud)
和方法
/**
* @param PreUpdateEventArgs $args
*/
public function preUpdate(PreUpdateEventArgs $args)
Run Code Online (Sandbox Code Playgroud)
和教义抛出异常
ContextErrorException:可捕获的致命错误:传递给 Certificate\MachineBundle\Event\MachineSubscriber::preUpdate() 的参数 1 必须是 Doctrine\Common\Persistence\Event\PreUpdateEventArgs 的实例,给定的 Doctrine\ORM\Event\PreUpdateEventArgs 实例,
这很奇怪,因为我使用了正确的课程。
嗨我试图从bash脚本执行php文件
#!/bin/sh
php ./func.php
Run Code Online (Sandbox Code Playgroud)
和func.php
文件看起来像
<?php
echo "php file";
Run Code Online (Sandbox Code Playgroud)
并作为输出
PHP Warning: Module 'apc' already loaded in Unknown on line 0
编辑:也许你也可以告诉我如何将参数传递给php文件?
在Kohana您可以测试这样的路线
$route = Route::get('admin');
echo Kohana_Debug::dump($route->matches('admin/user/edit/10'));
Run Code Online (Sandbox Code Playgroud)
以及如何在symfony2中测试路由.