在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/ Java問答
六扇門 回答

有遇到在 execute shell script on remote host using ssh 執(zhí)行 node 報找不到命令,但是在其linux上執(zhí)行node是可以執(zhí)行的,知道怎么解決嗎?

魚梓 回答

應(yīng)用啟動就實例化,具體可以看DefaultListableBeanFactory 和AbstractAutowireCapableBeanFactory的源碼,@autowired是Bean的裝配,具體可以看AutowiredAnnotationBeanPostProcessor的源碼。

安若晴 回答
public static void doSome(String className, String methodName, Object[] methodArgs) throws Exception {
    Class c = Class.forName(className);
    Object target = c.newInstance();
    if (methodArgs == null) {
        methodArgs = new Object[0];
    }
    Class[] classes = new Class[methodArgs.length];
    for (int i = 0; i < methodArgs.length; i++) {
        classes[i] = methodArgs[i].getClass();
    }
    Method method = c.getMethod(methodName, classes);
    method.invoke(target, methodArgs);
}
別瞎鬧 回答

試一下SQLAlchemy的event吧(http://docs.sqlalchemy.org/en...
一個簡單的使用例子

import sqlalchemy
from sqlalchemy import event
from models import Wallet

class User(db.Model):
  name = sqlalchemy.column(s.String)

  @staticmethod
  def after_create(mapper, connection, target):
    wallet = Wallet()
    db.session.add(wallet)
    db.session.commit()
    
event.listen(User, 'after_insert', User.after_create)
久不遇 回答

Cannot cast org.apache.cxf.transport.http_jetty.continuations.JettyContinuationProviderFactory to org.apache.cxf.transport.http.ContinuationProviderFactory
這行代碼是類轉(zhuǎn)換異常,你使用了jetty的jar在服務(wù)中,tomcat中使用jetty的jar包,會有jar沖突

HttpURLConnection 有個 setReadTimeout 的方法可以實現(xiàn)你的需求。

public static String doGet(String HTTP_URL, Object object) {
        BufferedReader reader = null;
        String result = null;
        StringBuffer httpUrl = new StringBuffer(HTTP_URL);
        StringBuffer sbf = new StringBuffer();
        HttpURLConnection connection = null;
        try {
            System.out.println(httpUrl.toString());
            URL url = new URL(httpUrl.toString());
            connection = (HttpURLConnection) url.openConnection();
            connection.setDoOutput(true);
            connection.setDoInput(true);
            // 請求方式設(shè)置 POST
            connection.setRequestMethod("GET");
            // 設(shè)置維持長連接
            connection.setRequestProperty("Connection", "Keep-Alive");
            // 設(shè)置文件字符集:
            connection.setRequestProperty("Charset", "UTF-8");

            //根據(jù)需求設(shè)置讀超時的時間
            connection.setReadTimeout(50);
            // 開始連接請求
            connection.connect();
            OutputStream out = connection.getOutputStream();
            out.write((object.toString()).getBytes());
            out.flush();
            out.close();
            if (connection.getResponseCode() == 200) {
                System.out.println("連接成功,傳送數(shù)據(jù)...");
                InputStream is = connection.getInputStream();
                reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
                String strRead = null;
                while ((strRead = reader.readLine()) != null) {
                    sbf.append(strRead);
                    sbf.append("\r\n");
                }
                reader.close();
                result = sbf.toString();
                if (result.equals("1")) {
                    return "1";
                } else if(result.equals("0")) {
                    return "0";
                } else {
                    return result;
                }
            } else {
                System.out.println("連接失敗,錯誤代碼:" + connection.getResponseCode());
            }
        } catch (Exception e) {
            if(e instanceof SocketTimeoutException) {
                if("Read timed out".equals(e.getMessage()) && connection != null && connection.getDoOutput()) {
                    //TODO 只請求不需要響應(yīng)
                    return null;
                }
            }
            e.printStackTrace();
        }
        return null;
    }
氕氘氚 回答

可以的。
在路由層那里resolve處理

眼雜 回答

POST請求,最好使用RequestBody + bean(json)的形式

吢涼 回答

我覺得與樓主提供的的連接相比,不如分成面向?qū)ο?/code>、面向過程,以及函數(shù)式編程。這里顯然是面向?qū)ο蟮摹?/p>

尐懶貓 回答

你給的信息不足以判斷原因。
自己到SSL Labs測試下吧 https://www.ssllabs.com/ssltest/

另外截圖實在是太模糊了……都是文本為啥不直接貼上來……

喵小咪 回答

我和樓主一樣的問題,換成jdk8就可以了?

愛礙唉 回答

idea64.exe.vmoptions文件中最后一行加上 "-Dfile.encoding=UTF-8"

遲月 回答

正則不擅長做這個,也不是不能做

根據(jù)生成正則表達(dá)式來匹配任意數(shù)值范圍, 并在 Regex_For_Range 中為您的示例生成這樣的 regex 后:

\b0*(1[1-9][0-9]|[2-9][0-9]{2}|1[0-9]{3}|2[01][0-9]{2}|22[0-2][0-9]|223[0-4])\b


能實現(xiàn)你的需求:

過程如下 (仍然按那 Regex 生成器步驟操作):

首先, 分成相等的長度范圍:

110-999
1000-2234

第二, 分?jǐn)喈a(chǎn)生簡單 regexes 的范圍:

110-199
200-999
1000-1999
2000-2199
2200-2229
2230-2234

將每個范圍變?yōu)?regex:

1 [1-9] [0-9]
[2-9][0-9]{2}
1 [0-9] {3}
2 [01] [0-9] {2}
22 [0-2] [0-9]
223 [0-4]

折疊相鄰的 10進(jìn)制數(shù)位: 1[1-9][0-9] [2-9][0-9]{2} 1[0-9]{3} 2[01][0-9]{2} 22[0-2][0-9] 223[0-4]

結(jié)合以上 regex:

0*(1[1-9][0-9]|[2-9][0-9]{2}|1[0-9]{3}|2[01][0-9]{2}|22[0-2][0-9]|223[0-4])

接下來, 我們將嘗試使用樹來分解常用前綴:
基于 regex 前綴分析成樹:

.1 [1-9] [0-9]
+ [0-9] {3}
+ [2-9] [0-9] {2}
+ 2 [01] [0-9] {2}
+ 2 [0-2] [0-9]
+ 3 [0-4]

將分析樹轉(zhuǎn)變?yōu)檎齽t:

0*(1([1-9][0-9]|[0-9]{3})|[2-9][0-9]{2}|2([01][0-9]{2}|2([0-2][0-9]|3[0-4])))

我們選擇較短的一個作為我們的結(jié)果。

\b0*(1[1-9][0-9]|[2-9][0-9]{2}|1[0-9]{3}|2[01][0-9]{2}|22[0-2][0-9]|223[0-4])\b



參見:

How to match numbers between X and Y with regexp?

短嘆 回答

1.

在早期的HTML中,標(biāo)簽是被嚴(yán)格限制,在HTML5中完全放開了限制,即 可以不用引號包裹,因為瀏覽器會去自動處理,如果里面有空格的話 還是要加上的。包括 非閉合標(biāo)簽也不用主動閉合比如

<input />

現(xiàn)在則就沒那么多限制了

<input>

2.

并不影響,瀏覽器并不會限制from的action。

3.

然而打印出來也就只是 phpinfo(); 并不會解析。

短嘆 回答

如果使用php的話

<?php
$query1 = ' title      =  "test1" AND  name    = "test2"  and age="30" ';
$query2 = ' title = "test1"';
$query3 = ' title = "test1" OR  name = "test2"';
$query4 = ' title = "test1" AND  name = "test2" OR name = "test3   "';
preg_match_all("/(\w+)\s*=\s*\"(\s*\w+\s*)\"/u", $query4,$match);
print_r($match);
//output  $match[1]是所有字段的數(shù)組,$match[2]是所有字段對應(yīng)值的數(shù)組,1和2一一對應(yīng),$match[1][0]=$match[2][0] 即title="test1"
//    Array
// (
//     [0] => Array
//         (
//             [0] => title = "test1"
//             [1] => name = "test2"
//             [2] => name = "test3"
//         )

//     [1] => Array
//         (
//             [0] => title
//             [1] => name
//             [2] => name
//         )

//     [2] => Array
//         (
//             [0] => test1
//             [1] => test2
//             [2] => test3
//         )
// )




孤客 回答

用ApplicationContext獲取Repository