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

鍍金池/ 問答/ Java問答

read 方法的定義是讀取流中的字節(jié),如果流中有字節(jié),并且字節(jié)數(shù)組也是有空間的話,那么就將其讀取道整個(gè)字節(jié)數(shù)組中,出現(xiàn)這個(gè)情況的原因,我只能說是 stream 中的數(shù)據(jù)暫時(shí)就這么多. 就只有 27 個(gè)字節(jié),多的還在路上.

從這個(gè)方面去想的話,我覺得的網(wǎng)絡(luò)方面的原因,可能是這樣導(dǎo)致流尚未完全傳送完.

而后我換了一下幾個(gè)url進(jìn)行嘗試都是可以的正常讀取的.
http://114.67.130.61/
https://api.github.com/users/chenshun00

baidu
全部顯示是可以正常讀取的.

其次我打開你給的URL看了一下,發(fā)送了 65 個(gè)請(qǐng)求, 157 KB,耗時(shí)了 2.12 s.

以上屬于跟人猜測(cè).

心癌 回答

隨機(jī)端口的問題:設(shè)置下列啟動(dòng)參數(shù)為同一個(gè)端口即可。

com.sun.management.jmxremote.port
com.sun.management.jmxremote.rmi.port

對(duì) Java 7 update 25以后的版本有效。

安全及防火墻的問題:建議采用ssh隧道的方式進(jìn)行訪問,這是通用的安全遠(yuǎn)程訪問方式,對(duì)所有類型的訪問都有效。

參考
https://bugs.java.com/bugdata...

https://stackoverflow.com/que...

http://blog.csdn.net/u0137936...

心沉 回答

不知道有沒有用到SpringBoot
如果有的話直接MockBean做注入就行了

別瞎鬧 回答

(?P<charset>1+)這是我不懂之處,查閱博客之后才知道這個(gè)算是為分組命名,在.group('charset')這里將原先的分組的名字當(dāng)做字符串參數(shù)傳入,可以準(zhǔn)確獲取到正則表達(dá)式匹配到的值。


  1. ;s ?
乖乖噠 回答
  1. user.dir 指向的是你啟動(dòng) JVM 的地方,你可以看看這里

代碼一是你從工程路徑下啟動(dòng)的,但是代碼二你的 Servlet 是被容器 (Tomcat等等)加載進(jìn) JVM 的,而此時(shí) user.dir 指的是這些容器的路徑,這方面你需要了解一下容器是怎樣運(yùn)行的。

  1. 你要分清楚:開發(fā)環(huán)境、上線環(huán)境。

你在 E:\workspace\outer\javaConnectR 寫代碼,這是開發(fā)環(huán)境,但是當(dāng)你打包成 .war 時(shí),它會(huì)被容器解壓到一個(gè)目錄,比如你代碼二中輸出的 E:\workspace\...\wtpwebapps\javaConnectR\,此時(shí)它無論如何也不可能按你所想去讀到開發(fā)時(shí)的路徑,因?yàn)榇a二實(shí)際運(yùn)行的時(shí)候文件已經(jīng)不在你開發(fā)的路徑上了。

夕顏 回答
  • 如果可以用工具,可以看下dbeaver,這個(gè)工具通過jdbc可以直接做備份,生成sql
  • 如果需要自己寫,可以看看這個(gè)代碼 http://isocra.com/articles/db...,比較簡陋
  • 如果數(shù)據(jù)庫大到一定規(guī)模,還是mysqldump最靠譜。
遺莣 回答

修改路徑 /usr/app/nginx/html 為 /usr/share/nginx/html
詳情

default.conf 文件root默認(rèn)的路徑為: /usr/share/nginx/html

傻丟丟 回答

getOptimalPreviewSize 的第一個(gè)參數(shù)是硬件所支持的尺寸列表,后面長寬是你想要顯示的UI尺寸。
所以預(yù)覽的圖片顯示是經(jīng)過修正的,并不是攝像頭看到的實(shí)際尺寸。
個(gè)人想法
方案1.只是用完全匹配的尺寸,即UI尺寸和硬件尺寸相同比例的size (不太好,特別是低檔機(jī)的硬件支持?jǐn)?shù)少,會(huì)很模糊)
方案2.拿到拍攝后的圖后修圖。不直接用系統(tǒng)相機(jī)生成的圖,用工具類裁剪后保存。

陌顏 回答
.roll-inner2 {
  animation: roll 8s infinite linear;
  animation-delay: 4s;
}

animation-delay這個(gè)改下

維他命 回答

像1樓一樣,前后端傳值一般是定義一個(gè)Dto對(duì)象。使用hibernate-validation對(duì)Dto參數(shù)進(jìn)行校驗(yàn),BeanUtils.copyProperties()方法進(jìn)行屬性值替換。

懷中人 回答

你數(shù)據(jù)庫和程序是部署在一起的嗎?如果是,其實(shí)直接都是localhost都是可以,都是指向的是自己本機(jī)。但是用127.0.0.1更好

http://blog.csdn.net/qq_17864...
異常原因:是因?yàn)閙yeclipse10不支持jdk1.8導(dǎo)致,換成最新的myeclipse或者eclipse,然后配置jdk1.8,問題得到解決。

殘淚 回答

BeanFactory是Spring中IOC容器最核心的接口,遵循了IOC容器中所需的基本接口。例如我們很常見的:ApplicationContext,XmlBeanFactory 等等都使用了BeanFactory這個(gè)接口。

FactoryBean是工廠類接口,當(dāng)你只是想簡單的去構(gòu)造Bean,不希望實(shí)現(xiàn)原有大量的方法。它是一個(gè)Bean,不過這個(gè)Bean能夠做為工廠去創(chuàng)建Bean,同時(shí)還能修飾對(duì)象的生成。

總結(jié):FactoryBean比BeanFactory在生產(chǎn)Bean的時(shí)候靈活,還能修飾對(duì)象,帶有工廠模式和裝飾模式的設(shè)計(jì)思想在里面,不過它的存在還是以Bean的形式存在。

直接看MyBatis的SqlSessionFactoryBean就明白了

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="typeAliasesPackage" value="com.george"/>
    <property name="typeAliasesSuperType" value="com.george.common.persistence.BaseEntity"/>
    <property name="mapperLocations" value="classpath:/mappings/**/**/*.xml"/>
    <property name="configLocation" value="classpath:/mybatis-config.xml"></property>
</bean>

Spring會(huì)調(diào)用SqlSessionFactoryBean這個(gè)實(shí)現(xiàn)了FactoryBean的工廠Bean 同時(shí)加載dataSource,Mapper文件的路徑,對(duì)sqlSessionFactory進(jìn)行初始化(這里就不貼源碼了 源碼看一下)

BeanFactory因?yàn)槭呛诵慕涌?,編寫?fù)雜邏輯很容易接觸到其他不必要的接口,不好實(shí)現(xiàn)。
如果是FactoryBean就簡單很多,SqlSessionFactoryBean這個(gè)工廠Bean生產(chǎn)不同數(shù)據(jù)源的sqlSessionFactory,同時(shí)加載相應(yīng)的配置信息。

維她命 回答

你把 res 變量打印出來, 我猜值是: "json : 瀏覽器不支持..."

你看提示, 和fastjson并沒有什么關(guān)系. 是你自己的邏輯錯(cuò)誤.

真難過 回答

注意:python3以后才支持yield from語法

import collections


def flatten(d, prefix="", sep="_"):
    def _take_prefix(k, v, p):
        if p:
            yield from flatten(v, "{}{}{}".format(p, sep, k))
        else:
            yield from flatten(v, str(k))

    if isinstance(d, dict):
        for k, v in d.items():
            if isinstance(v, str) or not isinstance(v, collections.Iterable):
                if prefix:
                    yield "{}{}{}".format(prefix, sep, k), v
                else:
                    yield k, v
            elif isinstance(v, dict):
                yield from _take_prefix(k, v, prefix)
            elif isinstance(v, list):
                for i in v:
                    yield from _take_prefix(k, i, prefix)
            else:
                pass
    else:
        pass

dic = {your dataset}
for key, value in flatten(dic):
    print("{}: {}".format(key, value))

結(jié)果如下,應(yīng)該能拍平了

status: changed
dataset_id: 5a4b463c855d783af4f5f695
dataset_name: AE_E
dataset_label: 1- ADVERSE EVENTS - Not Analyzed
details_variables_variable_id: 5a4b4647855d783b494f9d3f
details_variables_variable_name: CPEVENT
details_variables_variable_label: CPEVENT
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: factor
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9d25
details_variables_variable_name: CPEVENT2
details_variables_variable_label: CPEVENT2
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: binary
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9d26
details_variables_variable_name: CP_UNSCHEDULED
details_variables_variable_label: CP_UNSCHEDULED
details_variables_status: changed
details_variables_details_r_type_new_value: undefined
details_variables_details_r_type_old_value: unary
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9d02
details_variables_variable_name: VISIT_NUMBER
details_variables_variable_label: VISIT_NUMBER
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: integer
details_variables_message: Variable with different R Type
details_variables_variable_id: 5a4b4647855d783b494f9ccf
details_variables_variable_name: VISIT_NUMBER2
details_variables_variable_label: VISIT_NUMBER2
details_variables_status: changed
details_variables_details_r_type_new_value: unary
details_variables_details_r_type_old_value: binary
details_variables_message: Variable with different R Type
details_many_visits: None

針對(duì)你修改后的問題, 再加個(gè)函數(shù)就搞定:

# 這個(gè)fuck_all函數(shù)比較特例, 完全是針對(duì)你要區(qū)分的dataset下面的N個(gè)變量信息這種需求
def fuck_all(dic, prefix="details_variables"):
    lst = list(flatten(dic))  # flatten函數(shù)則比較通用,任何嵌套數(shù)據(jù)集都可以用它拍平
    lines = []
    top = {k: v for k, v in lst if not k.startswith(prefix)}
    index = 0
    for key, value in lst:
        if not key.startswith(prefix):
            continue
        else:
            if not lines:
                lines.append(top.copy())
        if key in lines[index].keys():
            index += 1
            lines.append(top.copy())
        lines[index][key] = value
    return lines

d = {your dataset}
for i in fuck_all(d):
    print(i)    

結(jié)果長這樣,應(yīng)該是能滿足你需求了

{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d3f', 'details_variables_variable_name': 'CPEVENT', 'details_variables_variable_label': 'CPEVENT', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'factor', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d25', 'details_variables_variable_name': 'CPEVENT2', 'details_variables_variable_label': 'CPEVENT2', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'binary', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d26', 'details_variables_variable_name': 'CP_UNSCHEDULED', 'details_variables_variable_label': 'CP_UNSCHEDULED', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'undefined', 'details_variables_details_r_type_old_value': 'unary', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9d02', 'details_variables_variable_name': 'VISIT_NUMBER', 'details_variables_variable_label': 'VISIT_NUMBER', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'integer', 'details_variables_message': 'Variable with different R Type'}
{'status': 'changed', 'dataset_id': '5a4b463c855d783af4f5f695', 'dataset_name': 'AE_E', 'dataset_label': '1- ADVERSE EVENTS - Not Analyzed', 'details_many_visits': None, 'details_variables_variable_id': '5a4b4647855d783b494f9ccf', 'details_variables_variable_name': 'VISIT_NUMBER2', 'details_variables_variable_label': 'VISIT_NUMBER2', 'details_variables_status': 'changed', 'details_variables_details_r_type_new_value': 'unary', 'details_variables_details_r_type_old_value': 'binary', 'details_variables_message': 'Variable with different R Type'}

送佛送到西好了

from functools import reduce
import json

import pandas as pd


with open("your dataset file", "r") as fh:
    dic = json.load(fh)

df = pd.DataFrame(reduce(lambda x, y: x + y, (fuck_all(i) for i in dic)))
df.to_csv("out.csv", index=False)

成品

clipboard.png

毀憶 回答

模擬登陸一般有兩種,一種是直接構(gòu)建數(shù)據(jù)包,一種是模擬人操作
你可以直接用個(gè)模擬器,像webdriver,phantomjs等,直接找到對(duì)應(yīng)的文本框,輸入賬號(hào)密碼,把驗(yàn)證碼截出來,自動(dòng)識(shí)別或者人工輸入,當(dāng)然如果是暴力的話,不知道網(wǎng)站是不是存在驗(yàn)證碼失效的問題,最后模擬點(diǎn)擊登錄就好了

鐧簞噯 回答

對(duì), 如果需要加上事務(wù)的話, 可以試下通過 AopContext.currentProxy() 獲取到代理對(duì)象, 然后再調(diào)用do2.

硬扛 回答

幾乎可以肯定是nginx配置,試試配置proxy_http_version 1.1;