Handling file uploads
Body handler is also used to handle multi-part file uploads.
If a body handler is on a matching route for the request, any file uploads will be automatically streamed to the uploads directory, which is file-uploads by default.
Each file will be given an automatically generated file name, and the file uploads will be available on the routing context with fileUploads.
Here’s an example:
router.route().handler(BodyHandler.create());
router.post("/some/path/uploads").handler(routingContext -> {
Set<FileUpload> uploads = routingContext.fileUploads();
// Do something with uploads....
});
Each file upload is described by a FileUpload instance, which allows various properties such as the name, file-name and size to be accessed.
請問一下你用的ZXing是哪個版本,具體是用了哪個幾個模塊???
電腦端瀏覽器可以拖動大小,手機(jī) pad上也有可能分屏,所以不能直接用屏幕大小
我們公司命名上都是加前綴或者后綴,action: ACT_getList,mutation: MUT_getList。
再詳細(xì)一點的,還需要加上對應(yīng)的分組名稱: action: ACT_MENU_getList,僅供參考吧。
這里有參考的鏈接https://stackoverflow.com/que...,但是不能解決問題
一般是iterm2+zsh 你應(yīng)該是沒有安裝字體 https://www.jianshu.com/p/7de...
修改下notebook的配置
from my jupyter_notebook_config.py file:
# c.NotebookApp.mathjax_url = ''
c.NotebookApp.enable_mathjax = Truedigraph startgame {
node [fontname="SimHei"]; // 設(shè)置節(jié)點屬性,這里設(shè)置字體為黑體
n1[label="TCP Socket" shape=box];
n2[label="Data" shape=diamond];
n3[label="h2\nParse Data" shape=ellipse];
n4[label="h2\nEvents" shape=diamond];
n5[label="gethy\nUpdate\nBuffers" shape=ellipse];
n6[label="gethy\nUParse\nBuffers" shape=ellipse];
n7[label="gethy\nEvents" shape=diamond];
n8[label="External\nHandlers" shape=box];
rankdir=TB;
{
rank=same;
n1 -> n2 [arrowhead="none"];
n2 -> n3;
n3 -> n4 [arrowhead="none"];
}
{
rank=same;
n8 -> n7[dir="back"];
n7 -> n6[arrowhead="none"];
n6 -> n5[dir="back"];
}
n4 -> n5;
}直接把.htaccess放到public不行嗎
你 post 的參數(shù)不是json格式啊,postman都給你提示錯誤了......
將后臺回調(diào)的時間轉(zhuǎn)換再渲染。this.form.record.endTime = new Date(endTime * 1000);//時間戳為10位需乘1000,時間戳為13位的話不需乘1000。
使用rxjava吧
線程操作比較方便
package com.github.rxjavatest
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import com.bumptech.glide.Glide
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.BiFunction
class MainActivity : AppCompatActivity() {
lateinit var recyclerView: RecyclerView
val list = arrayListOf<String>()
val adapter = ImageAdapter(list)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
recyclerView = findViewById(R.id.recyclerView)
recyclerView.layoutManager = GridLayoutManager(this, 3)
recyclerView.adapter = adapter
initImage()
}
private fun initImage() {
val imageGetter = ImageGetter("http://588ku.com/beijing/0-0-pxnum-4-8-0-0-0-1/")
val imgOb = imageGetter.getImageObserable()
val imageGetter2 = ImageGetter("http://588ku.com/beijing/0-0-pxnum-4-8-0-0-0-2/")
val imgOb2 = imageGetter2.getImageObserable()
Observable.zip(imgOb, imgOb2, BiFunction<List<String>, List<String>, List<String>> { t1, t2 ->
val list = arrayListOf<String>()
list.addAll(t1)
list.addAll(t2)
list
}).observeOn(AndroidSchedulers.mainThread())
.subscribe {
list.addAll(it)
adapter.notifyDataSetChanged()
}
}
}
class ImageAdapter(val list: List<String>) : RecyclerView.Adapter<VH>() {
override fun onBindViewHolder(holder: VH?, position: Int) {
holder?.apply {
val src = list[position]
Glide
.with(itemView)
.load(src)
.into(img)
}
}
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): VH {
val view = LayoutInflater.from(parent?.context)?.inflate(R.layout.item_img, parent, false)
return VH(view)
}
override fun getItemCount(): Int {
return list.size
}
}
class VH(itemView: View?) : RecyclerView.ViewHolder(itemView) {
val img: ImageView by lazy { itemView!!.findViewById<ImageView>(R.id.iv_image) }
}
package com.github.rxjavatest
import android.annotation.SuppressLint
import android.util.Log
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import org.jsoup.Jsoup
import org.jsoup.nodes.Document
import java.util.concurrent.Executors
/**
* Created by cai on 2018/2/12.
*/
class ImageGetter(var url: String) {
fun getImageObserable(): Observable<ArrayList<String>> {
return Observable
.create<Document> {
val doc = Jsoup.connect(url)
.get()
it.onNext(doc)
it.onComplete()
}
.subscribeOn(Schedulers.io())
.map {
it.select("div a img")
}
.map {
val list = arrayListOf<String>()
it.forEach {
val image = it.attr("data-original")
list.add(image)
}
list
}
.observeOn(AndroidSchedulers.mainThread())
}
@SuppressLint("SetJavaScriptEnabled")
companion object {
}
}
val Any.TAG
get() = this.javaClass.simpleName
fun Any.logger(msg: Any?) {
Log.i(TAG, msg.toString())
}
簡單寫了個demo
項目地址
這里用JSoup爬數(shù)據(jù)
然后Rxjava返回數(shù)據(jù)流處理結(jié)果的img src的集合的Observable
在實際Activity中同時獲得兩個Observable,使用zip操作符組合,然后在主線程中將圖片添加到list
刷新adapter
使用Glide加載圖片
不要修改你依賴庫的東西(node_modules 這里面的所有文件),這個路徑為了在項目中使用時正確的找到第三方模塊的位置,是 npm 工作時自動加上的,對你項目沒有任何影響。
...你這個代碼真是...差點繞進(jìn)去了
while (FilesList.SelectedItems.Count>0) //原因未知的死循環(huán)
{
FilesList.Items.Remove(FilesList.SelectedItem);
}
while (1>0){}本來就是死循環(huán)
this的綁定取決于調(diào)用的模式,JavaScript 中一共有4種調(diào)用模式:
function a(){
console.log(this)
};
a.prototype.testThis = function() {
console.log("a.prototype == this:"+(a.prototype == this)); // false
console.log("a == this:"+(a == this)); // false
console.log("b == this:"+(b == this)); // true
};
a() // 函數(shù)調(diào)用模式,this綁定到全局對象
var b = new a(); // 構(gòu)造器調(diào)用模式, 通過new 來調(diào)用, this 會被綁定到新對象上,即 b
b.testThis(); //所以 此時 this指向 b
a.prototype.testThis.call(a);// apply/call 調(diào)用模式, apply 方法接收的第一個參數(shù)就是要綁定給this的值。
a.prototype.testThis();// 方法調(diào)用模式,綁定發(fā)生在調(diào)用的時候,延遲綁定,此時 this指向a.prototype
上面都是從《JavaScript 語言精粹》里面函數(shù)一章可以找到
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
北大課工場是北京大學(xué)校辦產(chǎn)業(yè)為響應(yīng)國家深化產(chǎn)教融合/校企合作的政策,積極推進(jìn)“中國制造2025”,實現(xiàn)中華民族偉大復(fù)興的升級產(chǎn)業(yè)鏈。利用北京大學(xué)優(yōu)質(zhì)教育資源及背
博為峰,中國職業(yè)人才培訓(xùn)領(lǐng)域的先行者
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。