我想在表单输入提交按钮上使用twitter bootstrap图标.
http://twitter.github.com/bootstrap/base-css.html#icons上的示例主要显示样式化的超链接.
我最接近的是获得按钮旁边的图标,但不是内部.
<div class="input-prepend">
   <span class="add-on"><i class="icon-user icon-white"></i></span>
   <input type="submit" class="btn-primary" value="Login" >
</div>
intval和(int)之间有什么特别的区别吗?
例:
$product_id = intval($_GET['pid']);
$product_id = (int) $_GET['pid'];
上面两行代码之间有什么特别的区别吗?
我正在编写一个脚本来自动为我自己的web服务器创建Apache和PHP的配置文件.我不想使用像CPanel或ISPConfig这样的任何GUI.
我有一些Apache和PHP配置文件的模板.Bash脚本需要读取模板,进行变量替换并将解析后的模板输出到某个文件夹中.最好的方法是什么?我可以想到几种方法.哪一个是最好的还是有更好的方法可以做到这一点?我想在纯Bash中做到这一点(例如在PHP中很容易)
template.txt:
the number is ${i}
the word is ${word}
script.sh:
#!/bin/sh
#set variables
i=1
word="dog"
#read in template one line at the time, and replace variables
#(more natural (and efficient) way, thanks to Jonathan Leffler)
while read line
do
    eval echo "$line"
done < "./template.txt"
顺便说一句,如何在此处将输出重定向到外部文件?如果变量包含引号,我是否需要逃避某些事情?
2)使用cat&sed替换每个变量的值:
给出template.txt:
The number is ${i}
The word is ${word}
命令:
cat template.txt | sed -e "s/\${i}/1/" | sed -e "s/\${word}/dog/"
对我来说似乎不好,因为需要逃避许多不同的符号,并且对于许多变量,这条线太长了.
你能想到其他一些优雅而安全的解决方案吗?
任何人都知道像Squiggle这样的一些优秀的SQL构建器库(似乎不再维护).优选地,正在积极开发的项目.
最好使用类似Zend_Db_Select的语法,这样可以进行类似的查询
String query = db.select().from('products').order('product_id');
我在网上看到过几个关于如何使用XML架构或DTD for logback.xml文件至少在IDEA或Eclipse等IDE中进行非常基本的验证和自动完成的讨论,但我从未见过任何解决方案
你是否?
当为PHPStorm使用Symfony2插件时,我有时会看到弱路由警告:

这是什么意思?
我应该将哪个JDBC连接池库用于新的应用程序项目(而不是Web应用程序)?
我应该选择BoneCP吗?我没有任何巨大的要求.我只需要一个好的,易于使用的数据库连接池,即正在开发中.图书馆,作者可以回复错误报告,回答一些具体问题等.
顺便说一下,实际上,我只使用MySQL.我发现,MySQL驱动程序支持DriverManager接口,但我不确定它是否实际上是连接池.
任何人都可以总结一下,具体功能是什么让你在Mockito上添加PowerMock?
到目前为止,我发现了这些:
它是否添加了其他内容?你能用几行总结一下吗?
使用PowerMock时是否需要牺牲一些东西?
我正在查看chrisbanes/cheesesquare,我正在尝试将TabLayout与Toolbar放在CollapsingToolbarLayout中,这是我的代码
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">
    <android.support.v4.view.ViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/detail_backdrop_height"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        android:fitsSystemWindows="true">
        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/primary_dark"
            android:minHeight="150dip"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:expandedTitleMarginStart="48dp"
            app:expandedTitleMarginBottom="60dp"
            app:expandedTitleMarginEnd="64dp">
            <ImageView
                android:id="@+id/backdrop"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="centerCrop"
                android:fitsSystemWindows="true"
                app:layout_collapseMode="parallax" />
            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="110dip"
                android:layout_gravity="top"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
                app:layout_collapseMode="pin" />
            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"/>
        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
当打开CollapsingToolbar时,这会出现类似这样的内容,这正是我正在寻找的内容:

但当我崩溃时(通过拉动图像)我得到这样的东西

这是因为我将工具栏的高度设置为110dip,如果我保留标签和工具栏标题重叠的默认设置.所以我正在寻找正确的方法,以便工具栏的标题在appbar上正确的位置,tablayout在它下面.有没有办法实现这一目标?
android material-design android-toolbar android-design-library
你能解释一下Netty如何使用线程池工作吗?我是否理解正确,有两种线程池:老板和工人.老板用来做I/O而工人用来调用用户回调(messageReceived)来处理数据?