我正在使用bootstrap 3.3.2并遇到了令人困惑的情况.想要的效果如下图所示
图片http://imageshack.com/a/img537/8048/MAcoOV.png
我目前的HTML看起来像这样
<div class='container'>
<div style='padding-bottom: 30px;' class='row'>
<div class='col-md-3 col-sm-3 col-xs-6'><img style='max-width: 100%;'src="http://placehold.it/400x400"></div>
<div class='col-md-3 col-sm-3 col-xs-6'><img style='max-width: 100%;'src="http://placehold.it/400x400"></div>
<div class='col-md-6 col-sm-6 col-xs-12'><img style='max-width: 100%;'src="http://placehold.it/840x400"></div>
</div>
<div style='padding-bottom: 30px;' class='row'>
<div class='col-md-3 col-sm-3 col-xs-6'><img style='max-width: 100%;'src="http://placehold.it/400x400"></div>
<div class='col-md-6 col-sm-6 col-xs-12'><img style='max-width: 100%;'src="http://placehold.it/840x400"></div>
<div class='col-md-3 col-sm-3 col-xs-6'><img style='max-width: 100%;'src="http://placehold.it/400x400"></div>
</div>
<div style='padding-bottom: 30px;' class='row'>
<div class='col-md-6 col-sm-6'><img style='max-width: 100%;'src="http://placehold.it/840x400"></div>
<div class='col-md-3 col-sm-3'><img style='max-width: 100%;'src="http://placehold.it/400x400"></div>
<div class='col-md-3 col-sm-3'><img style='max-width: 100%;'src="http://placehold.it/400x400"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我现在对桌面屏幕上的样子感到满意.但是,当屏幕尺寸小于770px或打破网col-xs-*格时,我还需要将其看作下图.
图片http://imageshack.com/a/img911/4395/WIt2nk.gif
然而,在小屏幕上,第一行根据需要分成两行:第一行两个方形图像; …
我的表有以下列
- >col1, col2, col3
我正在尝试使用这些列进行搜索.所以我从用户那里得到了3个输入.
简单的搜索规则:
1)如果col用户未输入任何一个,则应仅使用其他2列进行搜索.
select * from myTable where col1="abc" and col2="def"; // something like this. Any combination like col1-col2, col1-col3 or col2-col3
Run Code Online (Sandbox Code Playgroud)
2)如果col输入所有s,则:
select * from myTable where col1="abc" and col2="def" and col3="ghi"; // something like this
Run Code Online (Sandbox Code Playgroud)
3)如果col用户输入任何一个,则:
select * from myTable where col1="abc"; // something like this. It can be col1, col2 or col3.
Run Code Online (Sandbox Code Playgroud)
我知道这可以通过使用不同select的数据库语句和if-else在Java代码中使用来完成.
对于这种情况,我想要一个最优化的解决方案(很少的代码/解释).
编辑
注:所有3列是NULL -able!我使用的是 …
注意:Donot标记它重复,我知道它是重复的问题,但我没有得到它的帮助.
我想计算特定年份的一个月中的天数.我看了这个,但它不能正常工作.我试过跟随
public class NumOfDays {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter month: ");
int month = input.nextInt();
System.out.print("Enter year: ");
int year = input.nextInt();
Calendar mycal = new GregorianCalendar(year, month, 1);
System.out.println("Number of days are: " + mycal.getActualMaximum(Calendar.DAY_OF_MONTH));
}
}
Run Code Online (Sandbox Code Playgroud)
我的控制台是
Enter month: 2
Enter year: 2000
Number of days are: 31 /// Wrong
Run Code Online (Sandbox Code Playgroud)
和
Enter month: 10
Enter year: 1999
Number of days …Run Code Online (Sandbox Code Playgroud) 我正在使用 Spring JPA 将实体保存到数据库中。下面是代码结构
客户.java
@Entity
@Table(name="customer")
@Data
public class Customer {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
@OneToMany(mappedBy = "customer", cascade = CascadeType.ALL)
private Set<Order> orders = new HashSet<>();
public void add(Order order) {
if(order != null) {
if(orders == null) {
this.orders = new HashSet<>();
}
this.orders.add(order);
order.setCustomer(this);
}
}
}
Run Code Online (Sandbox Code Playgroud)
订单.java
@Entity
@Table(name="order")
@Data
public class Order {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String orderTrackingNumber;
private String status;
@ManyToOne
@JoinColumn(name …Run Code Online (Sandbox Code Playgroud) 有没有办法在另一个数组中找到一个数组
a=[1,2,3,4,5,6,7]
b=[2,3,4]
c=[2,4,5]
// b is child of a, but c is NOT child of a.
Run Code Online (Sandbox Code Playgroud)
我知道使用Brute-force方法我可以在另一个数组中找到该数组.但我想知道有没有可以帮助我的算法......或者(因为我正在使用JAVA)JAVA中是否有任何可以帮助我的内置功能?
实际问题: 如果它调用(1)那么我怎样才能调用它(2)?
我有以下方法签名
public void myMethod(String myStr, MyClass myClass) {...} // (1)
public void myMethod(Object... objects) {...} // (2)
Run Code Online (Sandbox Code Playgroud)
我在某个地方打电话
myMethod(new String("name"), new MyClass());
将调用哪个重载方法?如果它调用(1)那么我怎么能这样调用它(2)?