history

React Router 使用教程

若如初见. 提交于 2020-01-04 01:09:36
React Router 一个针对React而设计的路由解决方案、可以友好的帮你解决React components 到URl之间的同步映射关系。 本文转载自 阮一峰的日志 基本用法 React Router 安装命令 1 $ npm install -save-dev react-router 路由器Router就是React的一个组件。 12 import { Router } from 'react-router';render(<Router/>, document.getElementById('app')); Router组件本身只是一个容器,真正的路由要通过Route组件定义。 1234567 import { Router, Route, hashHistory } from 'react-router';render(( <Router history={hashHistory}> <Route path="/" component={App}/> </Router>), document.getElementById('app')); 上面代码中,用户访问根路由/(比如 http://www.example.com /),组件APP就会加载到document.getElementById(‘app’)。 你可能还注意到,Router组件有一个参数history

react 打包出现空白页面报错

故事扮演 提交于 2020-01-02 11:35:32
import { HashRouter as Router, Route } from 'react-router-dom' import createHistory from 'history/createHashHistory' const history = createHistory() <Router history={history}> <Route render={({ location }) => { return( <div> <Route location={location} exact path="/" component={Home} /> <Route location={location} path="/detail/:id" component={Detail} /> <Route location={location} path="/comment/:id" component={Comment} /> </div> )}}/> </Router> 来源: CSDN 作者: 前端小李 链接: https://blog.csdn.net/qq_43287934/article/details/103800016

Simpletron machine and indirect addressing

99封情书 提交于 2020-01-02 09:28:12
问题 I recently made the Simpletron assignment from the Deitel and Deitel textbook. The Simpletron machine language has only one addressing mode which is direct addressing. (That is, you have to specify the address you want to access in the operand part of the instruction.) So I think there is no way of computing an address at run time and access it. So doing something like this: [pseudo-c] int a[10]; ... int i = 0; while(a[i] > 100) { i++; } .. would require some self modifying code or expanding

TensorFlow2.0 实战1分类问题

妖精的绣舞 提交于 2020-01-01 15:18:00
1.导入需要用到的包: import tensorflow as tf import matplotlib as mpl import matplotlib . pyplot as plt import numpy as np import sklearn import pandas as pd import os import sys import time from tensorflow import keras 2.导入数据集 从库中导入全部数据集和测试集,并将全部数据集分成验证集和训练集,其中训练集有5000个,测试集10000个,训练集55000个 fashion_mnist = keras . datasets . fashion_mnist ( x_train_all , y_train_all ) , ( x_test , y_test ) = fashion_mnist . load_data ( ) x_valid , x_train = x_train_all [ : 5000 ] , x_train_all [ 5000 : ] #验证集5000个 y_valid , y_train = y_train_all [ : 5000 ] , y_train_all [ 5000 : ] #打印训练集,测试集,验证集维度 #print(x_train.shape

Coursera: Internet History, Technology, and Security

北城余情 提交于 2020-01-01 14:31:51
课程网址:https://www.coursera.org/learn/internet-history 学习笔记: Week 1: History - Dawn of Early Computing (1940 - 1960) War Time Computing and Conmmunication — High Stakes Research in Computing, and Communication 二战刺激了政府对各种科技的研究投入,由此促进了计算机技术的发展,其中就包括电子计算机的诞生。 为了解密德国的无线电情报,英国布莱切利园( Bletchley Park )内以艾伦·图灵( Alan Turing )为代表的跨学科( cross-disciplinary )团队为电子通信和计算( electronic communication and computation )技术打下了基础。 — Alan Turing and Bletchley Park 在二战期间,布莱切利园是英国政府进行密码解读的主要场所,各行各业的上万名人员在此处工作,轴心国的密码与密码文件,都会送到那里进行解码。布莱切利园是最早的跨学科合作部门。 Bombe 是一台英国机械计算机,致敬波兰密码破译机 Bomba ,对破译德国 Enigma 密码机起到了重要作用,一个 Bombe 可以模拟36个

Internet History,Technology and Security

徘徊边缘 提交于 2020-01-01 14:31:30
Internet History,Technology and Security(简单记录) First Week High Stakes Research in Computing,and Communication 二战期间,需要有效快速的方式联系盟国,进而意味着通信方式需要便捷以及快速。 但是无线通信难以物理隐藏,需要利用code(应该是密码)来加密解密,也就产生了相应的计算需求,数学则是其中重要的工具。 为了破解这类code,选择借助于计算机,从最早的机械计算机(mechanical computer)利用暴力枚举的方式破解。在面对复杂度较高的密码时,破解时间过长导致的延误,使得当时迫切的需要新的电子计算机(electronic computer)。 the moment where a mechanical computer,no matter how hard you tried,wouldn't work fast enough Computer in Phone line 战后,对于计算机更倾向于将其通用化,利用其高效的计算能力去满足多方面的需求。 当时,各个计算机利用调制解调器(modem)来相互连接通信,但是它低效,慢速而且昂贵。 Q:为什么战时选择实现无线通信,而战后时间内还是一直采用利用有线来构建通信方式? 不过那个电传打字机还是蛮有趣的。 Second

Internet History, Technology, and Security(week2)——History: The First Internet - NSFNet

荒凉一梦 提交于 2020-01-01 14:31:18
前言: 上周学习了《电子计算机的曙光》,对战时及战后的计算机的历史发展有了更丰富的了解,今天继续coursera的课程,感觉已经有点适应了课程的节奏(除了经常有些奇奇怪怪的词汇看都看不懂@#¥%),嗯。 Supercomputers Justify a National Network : History Through Supercomputing 70年代开始的时候,只有少数幸运的人才能用上电传打字机,就像视频中使用的一样。那时候的数据传输还依靠 leased line(租用线路) 来实现,和拨号上网其实有些类似,但是存在一个比较大的问题:当时的租用线路还不是光纤,受限于当时的技术而使用的是铜线,这导致了不便于长距离传输数据且价格昂贵。除此之外,租用线路在总数量一定的情况下,每被租用一根,就导致其他人能共用的数量少了一根,线路本身就是一个宝贵的资源。 为了节省费用,最终学术界研究出了所谓的 Store and forward networks(存储和转发网络)—— BITNET ,目的是将我们为电话线支付的成本降到最低。但是你必须在电脑附近,或者在电脑附近有一个办公室,使用本地电话网络拨入,然后将有一个连接从该计算机的背面连接到另一台有用户的计算机,一直循环互联下去。 但是 BITNET 存在着缺点,例如图中的绿点、黄点、紫点代表着从小到大的三个数量的数据

Internet History, Technology and Security (Week2)

旧城冷巷雨未停 提交于 2020-01-01 14:31:01
Week2. History: The First Internet - NSFNet coursera address Supercomputers Justify a National Network Keywords : leased line, Supercomputer center, Store and forward networks, ARPANET, BITNET, packet switching, router, NSF, Larry Smarr History Through Supercomputing 进入电子计算机时代后,人们在计算机网络、与计算机通信的道路不断地探寻着。下面介绍几历史上的网络模式。 Leased Line leased line :专线网络,是使用电缆等使得两地直接建立起联系关系,例如过去使用铜线、现在使用光纤等,来提供信息互换、网络服务等。不像拨号上网那样每次上网都需要连接,专线是一直可用的。然而也有缺点,一就是线路总量是有限的,你占了一条别人就少一条;二是专线费用极高,人们也会因此去寻找别的方法 Bitnet BITNET (Store and forward networks) :避免使用专线的高花费而使用的方法。有一个比较明显的缺点就是此网络系统使用类似于 线性队列 模拟的任务处理方式

python 的tab.py的代码

谁说胖子不能爱 提交于 2020-01-01 13:21:39
day1 可以在输入命令是可以按删除键 ,上下左右键 代码: # python startup file import sys import readline import rlcompleter import atexit import os # tab completion readline.parse_and_bind('tab: complete') # history file histfile = os.path.join(os.environ['HOME'], '.pythonhistory') try: readline.read_history_file(histfile) except IOError: pass atexit.register(readline.write_history_file, histfile) ~ ~ ~ 来源: https://www.cnblogs.com/Xkay/p/6421096.html

ejabberd: retrieve chat history from mysql db

非 Y 不嫁゛ 提交于 2019-12-31 22:59:16
问题 I'm building a chat system based on ejabberd using an iOS client (and XMPPFramework). My current chat system supports only one-on-one conversations between users saving a chat history on a MySQL database. In order to recreate the same chat system, i'd need ejabberd to retrieve chat history from my database so the users don't lose previous conversations when switching to the new chat system. I'd like not to save the conversation client-side since the iOS app can be deleted and reinstalled (or