盡量使用npm安裝
修改你賬號下的.bashrc文件,將
#If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
修改為:
#If not running interactively, don't do anything
# case $- in
# i) ;;
# *) return;;
#esac
或者將你的nvm環(huán)境變量改寫在.bashrc文件的頭部
私有包多半是不能同步的,私有把是你自己的別人看不見,怎么同步
windows的文件名是gbk的
使用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())
}
簡單寫了個(gè)demo
項(xiàng)目地址
這里用JSoup爬數(shù)據(jù)
然后Rxjava返回?cái)?shù)據(jù)流處理結(jié)果的img src的集合的Observable
在實(shí)際Activity中同時(shí)獲得兩個(gè)Observable,使用zip操作符組合,然后在主線程中將圖片添加到list
刷新adapter
使用Glide加載圖片
OrgChart只支持一個(gè)root節(jié)點(diǎn)。
可以通過css方式視覺上實(shí)現(xiàn)。
你好,我也遇到這個(gè)問題,請問您解決了嗎
daocloud
阿里云
nginx訪問靜態(tài)文件和uwsgi是沒啥關(guān)系的,都是一樣的配制方法.無論用gunicorn還是uwsgi都是這么配置.
這是我隨手截圖的寫法,用的是root,
按照alias寫法,就要在下邊的路徑加上/static/
你看看加上尾部的/行不行.
還有就是nginx是否有權(quán)限訪問你的文件目錄的問題.看一下nginx運(yùn)行的用戶是誰
git,在服務(wù)器建個(gè)庫,把代碼拉到本地,修改提交就能更新服務(wù)器代碼
使用 echo 也可以
你也可以寫到文件里面,然后重定向標(biāo)準(zhǔn)輸入
docker logs scheduler 看日志
https://segmentfault.com/q/10...
——————————————————————————————
第一次回復(fù)時(shí)沒看你的內(nèi)容,只回應(yīng)了標(biāo)題所以貼了個(gè)網(wǎng)址
下面正式回復(fù)
你的問題不是cookies的問題,我根據(jù)那篇文章改了下運(yùn)行成功了,你自己對照下
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
"net/url"
"regexp"
"strings"
)
var cookies_lagou []*http.Cookie
const (
login_url_lagou string = "https://passport.lagou.com/login/login.html"
post_login_info_url_lagou string = "https://passport.lagou.com/login/login.json"
username_lagou string = "13330295142"
password_lagou string = "4525674692ac06e619cdb3f1b4b65b08"
)
func getToken(contents io.Reader) (string, string) {
data, _ := ioutil.ReadAll(contents)
regCode := regexp.MustCompile(`X_Anti_Forge_Code = '(.*?)';`)
if regCode == nil {
log.Fatal("解析Code出錯(cuò)...")
}
//提取關(guān)鍵信息
code := regCode.FindAllStringSubmatch(string(data), -1)[0][1]
regToken := regexp.MustCompile(`X_Anti_Forge_Token = '(.*?)';`)
if regToken == nil {
fmt.Println("MustCompile err")
}
//提取關(guān)鍵信息
token := regToken.FindAllStringSubmatch(string(data), -1)[0][1]
return token, code
}
func login_lagou() {
//獲取登陸界面的cookie
jar, _ := cookiejar.New(nil)
client := &http.Client{
Jar: jar,
}
req, _ := http.NewRequest("GET", login_url_lagou, nil)
res, _ := client.Do(req)
// for k, v := range res.Cookies() {
// fmt.Printf("%v=%v\n", k, v)
// }
token, code := getToken(res.Body)
fmt.Println(token, code)
//post數(shù)據(jù)
postValues := url.Values{}
postValues.Add("isValidate", "true")
postValues.Add("username", username_lagou)
postValues.Add("password", password_lagou)
postValues.Add("request_form_verifyCode", "")
postValues.Add("submit", "")
// body := ioutil.NopCloser(strings.NewReader(postValues.Encode())) //把form數(shù)據(jù)編下碼
// requ, _ := http.NewRequest("POST", post_login_info_url_lagou, nil)
requ, _ := http.NewRequest("POST", post_login_info_url_lagou, strings.NewReader(postValues.Encode()))
requ.Header.Set("Referer", "https://passport.lagou.com/login/login.html")
requ.Header.Set("X-Requested-With", "XMLHttpRequest")
requ.Header.Set("X-Anit-Forge-Token", token)
requ.Header.Set("X-Anit-Forge-Code", code)
requ.Header.Set("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:51.0) Gecko/20100101 Firefox/51.0")
requ.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
//for _, v := range res.Cookies() {
// requ.AddCookie(v)
//}
res, _ = client.Do(requ)
//cookies_lagou = res.Cookies()
data, _ := ioutil.ReadAll(res.Body)
res.Body.Close()
fmt.Println(string(data))
}
func main() {
login_lagou()
}
運(yùn)行結(jié)果
15f131a3-74b0-4914-bd6e-2672f36675e1 28747049
{"content":{"rows":[]},"message":"該帳號不存在或密碼(驗(yàn)證碼)誤,請重新輸入","state":400,"submitCode":23207051,"submitToken":"666f51d4-ccef-462a-bb56-55cb97c5231a"}
Process finished with exit code 0
可以把字符串變成數(shù)字類型
應(yīng)該沒差別吧。你這個(gè)錯(cuò)誤第二次就沒有了吧。第一次是創(chuàng)建個(gè)文件吧
lua-nginx-module
和OpenSSL 1.1.0
不兼容
你換成OpenSSL 1.0.2
就好了
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。