小编rzy*_*mek的帖子

63
推荐指数
4
解决办法
3万
查看次数

css两个背景图像

一种新的css,但我想要一个我想要的图像在左上角,然后另一个图像,我想在那之后重复.目前我累了:

CSS

#topsection{
    background: url('../images/bannerBGs.jpg');
    background-repeat:no-repeat;
    background: url('../images/bannerBGl.jpg');
    background-repeat:repeat-x;
    height: 200px; /*Height of top section*/
    color: White;
    text-align:center
}

#topsection a{
    color: #FFFF80;
}

#topsection h1{
    margin: 0;
    padding-top: 25px;
    text-align:Left
}

#topsection h2{
    margin: 0;
    padding-top: 0px;
    text-align:Center
}
Run Code Online (Sandbox Code Playgroud)

HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IG Indy Gamers</title>
<link rel="stylesheet" type="text/css" href="CSS/mycss.css" media="screen" />    
</head>
<body>
<div id="maincontainer">

<div id="topsection" > <div class="innertube">
    <h1>IG -Indy Gamers …
Run Code Online (Sandbox Code Playgroud)

css

21
推荐指数
1
解决办法
5万
查看次数

HQL中的内部联接查询

我无法为内部联接执行HQL,查询在sql执行正确但在HQL中执行不正确.我不知道我在哪儿.你的帮助很明显.

 ***Error***: org.hibernate.hql.ast.QuerySyntaxError: unexpected token: ON near line 1, column 148 [SELECT op.username, op.email, orders.p_id, orders.o_id, product.listed_price FROM com.model.Orders  orders INNER JOIN orders.OrderProcessing as op ON op.u_id = orders.u_id INNER JOIN orders.Product as product ON product.p_id = orders.p_id WHERE product.p_id = '208' ORDER BY op.username]

productList = (List<Orders>) session.createQuery(
 "SELECT op.username, op.email, orders.p_id, orders.o_id, product.listed_price " +                                                                               
 "FROM Orders orders " +                                                                   
 "INNER JOIN orders.OrderProcessing as op " +                                                                                       
 "ON op.u_id = orders.u_id " +                                                         
 "INNER JOIN orders.Product as product …
Run Code Online (Sandbox Code Playgroud)

java sql hibernate hql

15
推荐指数
2
解决办法
7万
查看次数

AWK过滤CSV文件

我想过滤掉第3列中"同义"的行.命令如下

awk '$3 !~ /^synonymous/' fileCSV.csv > fileCSV2.csv
Run Code Online (Sandbox Code Playgroud)

但是fileCSV2.csv在第3列中仍然包含单词"synonymous".我想知道可能出错了什么?

fileCSV.csv中的两行:

"exonic","LINC00115","synonymous SNV","uc010nxx.2:c.C299T:p.P100L",,"0.99",,0.56,rs3115849,,,,,,,,,,,,,chr1,762273,762273,G,A,"chr1","762273",".","G","A","30483.62","PASS","AC=24;AF=1.00;AN=24;DP=2972;FS=0.000;MLEAC=8;MLEAF=1.00;MQ0=0;VQSLOD=19.50;culprit=FS;set=Intersection","GT:AD:DP:GQ:PL","1/1:0,2:2:6:66,6,0","1/1:0,297:297:99:10476,951,0","1/1:0,304:304:99:10098,950,0","1/1:0,295:295:99:9869,929,0","1/1:0,292:292:99:8655,895,0","1/1:0,304:304:99:10006,965,0","1/1:0,179:179:99:5862,568,0","1/1:0,273:273:99:9328,851,0","1/1:0,279:279:99:7946,850,0","1/1:0,283:283:99:9214,866,0","1/1:0,8:8:21:229,21,0","1/1:0,456:456:99:16385,1285,0"    
"exonic","SAMD11","synonymous SNV","uc001abw.1:c.T1027C:p.W343R","559;Name=lod=249",,,1.00,rs6672356,1,0.916445,N,0.0,T,0.0,B,0.998605,N,4.19E-4,N,3.17,chr1,877831,877831,T,C,"chr1","877831",".","T","C","3594.56","PASS","AC=24;AF=1.00;AN=24;DP=387;FS=0.000;MLEAC=8;MLEAF=1.00;MQ=60.00;MQ0=0;VQSLOD=15.00;culprit=DP;set=Intersection","GT:AD:DP:GQ:PL","1/1:0,3:3:9:97,9,0","1/1:0,3:3:12:113,12,0","1/1:0,64:64:99:1805,189,0","1/1:0,57:57:99:1605,168,0","1/1:0,30:30:90:768,90,0","1/1:0,69:69:99:2026,216,0","1/1:0,15:15:45:428,45,0","1/1:0,23:23:81:809,81,0","1/1:0,22:22:69:562,69,0","1/1:0,40:40:99:1142,117,0","1/1:0,3:3:9:94,9,0","1/1:0,58:58:99:14,7,0"
Run Code Online (Sandbox Code Playgroud)

csv awk

9
推荐指数
1
解决办法
1万
查看次数

java垃圾收集在对话框中

*当我尝试在JFrame中创建一个按钮时,我现在遇到一个非常奇怪的java GC问题,当我单击该按钮时,它会显示一个需要处理并显示一些图像并需要近200M内存的JDialog.但问题是当我关闭对话框并重新打开它时,有时它会导致java.lang.OutOfMemoryError.(不是每次都)

试图解决这个问题,我简化了这个问题并做了一些实验,这让我更加困惑.

我在"实验"中使用的代码如下所示.当我单击框架中的按钮时,我为整数数组分配160M内存,并显示一个对话框但是如果我关闭对话框并重新打开它,则会出现OutOfMemoryError.我调整代码,结果是:

  1. 如果我不创建对话框并显示它,没有内存问题.
  2. 如果我添加一个调用System.gc()的windowsCloseListener到对话框,没有内存问题.
  3. 如果我在run()方法中调用System.gc(),则显示内存问题.

    public class TestController {
      int[] tmp;
    
      class TDialog extends JDialog {
        public TDialog() {
          super();
          this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
          // If I uncommment this code, OutOfMemoryError seems to dispear in this situation
          // But I'm sure it not a acceptable solution
          /*
          this.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
              System.out.println("windowsclose");
              TDialog.this.dispose();
              System.gc();
            }
          });
          */
        }
      }
    
      TDialog dia;
    
      public void run() {
        // If I do System.gc() here, OutOfMemoryError still exist …
    Run Code Online (Sandbox Code Playgroud)

java swing garbage-collection memory-leaks

7
推荐指数
1
解决办法
633
查看次数

使用 gradle 依赖 Java 9 模块系统库中的遗留 jar

问题

如何创建一个 java 库 jar 来:

  • 是java模块(有module-info
  • 有一个依赖的遗留(非模块)jar。(喜欢commons-exec)?

依赖项是一个实现细节 - 不应导出。

来源

具有以下条件build.gradle(使用gradle-6.8):

plugins {
    id 'java-library'
}

group = 'test'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '15'

repositories {
    mavenCentral()
}
java {
    modularity.inferModulePath = true
}

dependencies {
    implementation 'org.apache.commons:commons-exec:1.3'
}
Run Code Online (Sandbox Code Playgroud)

以及以下内容module-info.java

module test.module {
    requires commons.exec;
}
Run Code Online (Sandbox Code Playgroud)

错误

我收到以下编译错误:

module-info.java:2: error: module not found: commons.exec
    requires commons.exec;
                    ^
Run Code Online (Sandbox Code Playgroud)

如果我不包含,requires commons.exec则错误将变为:

error: package org.apache.commons.exec is not visible …
Run Code Online (Sandbox Code Playgroud)

java gradle java-platform-module-system java-9 unnamed-module

6
推荐指数
1
解决办法
2658
查看次数

Android:允许 TableLayout 中的边距/填充以在小部件之间提供一定的分隔

我在 TableLayout 中定义了六个按钮:-

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
android:shrinkColumns="*"
android:stretchColumns="*" >

<TableRow
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"
    android:gravity="center" >

    <Button
        style="@style/CustomStyleButton2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_span="1"
        android:text="Btn1" />

    <Button
        style="@style/CustomStyleButton2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_span="1"
        android:text="Btn1" />
</TableRow>

<TableRow
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1" >

    <Button
        style="@style/CustomStyleButton2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_span="1"
        android:text="Btn1" />

    <Button
        style="@style/CustomStyleButton2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_span="1"
        android:padding="5dp"
        android:text="Btn1" />
</TableRow>

<TableRow
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1" >

    <Button
        style="@style/CustomStyleButton2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_span="1"
        android:text="Btn1" />

    <Button
        style="@style/CustomStyleButton2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_span="1"
        android:text="Btn1" />
</TableRow>

</TableLayout>
Run Code Online (Sandbox Code Playgroud)

其显示是这样的:

在此输入图像描述

在这里我想将所有这些按钮分开。当我应用填充或边距时,右侧的按钮不适合屏幕,并且某些部分被剪切。

这里我给第一行设置了 …

android android-layout android-tablelayout

5
推荐指数
1
解决办法
2万
查看次数

如何在本地打开 Mongo Atlas 备份快照?

我在 Mongo Atlas 上启用了自动备份。现在我需要查看和查询特定的快照来检查一些文档吗?我怎样才能快速安全地做到这一点?

mongodb mongodb-atlas mongodb-compass

5
推荐指数
2
解决办法
1504
查看次数

你能用方法==另一种方法吗?

我评论了代码不起作用的地方.为什么不呢?我要确保calculate()==computerInput()的,但它打印出"这行不通"!这是为什么?

import java.util.Scanner;

class Drank {

    private static String[] userOption = new String[] { "Rock", "Paper", "Scissors" };
    private static String[] computerOption = new String[] { "Rock", "Paper", "Scissors" };

    public static void main(String[] args) {
        System.out.println("Enter: Rock, Paper Or Scissors");
        System.out.println(calculate());
        System.out.println(computerInput());
        result();
    }

    public static int calculate() {
        Scanner input = new Scanner(System.in);
        String userInput = input.nextLine();

        int calculate = 0;
        if (userInput.equals(userOption[0])) {
            calculate = 0;
        } else if (userInput.equals(userOption[1])) { …
Run Code Online (Sandbox Code Playgroud)

java methods if-statement equals

0
推荐指数
1
解决办法
111
查看次数