usecase區塊鏈
Ⅰ 我如何三種思維方式巧妙搞定雅思口語話題:科技和互聯
文章:我如何三種思維方式巧妙搞定雅思口語話題:科技和互聯網
據說都是智商和情商雙高哦
——對比——
Old and Young
Do old people in your country like to use apps?Are children allowed to use mobile phones in your country? How to teach older generation to use new technology?Do children like to play with toys or computer games nowadays?Is it necessary for teenagers to learn to use computers?
Paper and Electronic Versions
Do you usually write by hand or write using a computer (typewriter or word-processor)? Do you think computers might one day replace handwriting?
Gender and Place
Do you agree that men are more obsessed with new technology than women? Is there any difference between technology in cities and in small towns?
Examiner: So, any idea?
我大概會應聲倒地,直接被抬出考場
Fall to the ground and get a large bump on my forehead
Be carried/lifted out of the examination room
—不慌,鴿婆給你三道錦囊妙計—
a secret master plan, instructions for dealing with an emergency, wise counsel
NO.1 泔水湯
—坦白承認你的無知—
Admit: no hands-on experience with it
不知者無罪
Take a bit of time to gather your thoughts and make sure you don』t blurt out anything that gives away that you』re—well, completely stumped.
Think Aloud:fill up any empty airspace with words to avoid awkward silences
Great question. I』m just not familiar enough with XYZ to hazard a guess.
Hmm…that』s a great question. Let me think about that.
Your question raises a great point. That』s one of the several things I just don』t know about.
事出皆有因
Honestly, I know little about it. Here's why.
因為我雖然崇敬愛因斯坦、牛頓和愛迪生
Einstein, Newton, Edison
但是一點不懂高科技和互聯網
雖說手機不離手喜歡3D電影玩過虛擬現實
addictive, irresistible, get hooked; 3D movies; virtual reality
但不會打游戲沒見過時光機不會科技創新
談談小生活
Here』s what I can tell you
偶爾瀏覽果殼網、科學美國人、經濟學人:
Guokr, Scientific American, The Economist
蘋果小米華為OPPO三星魅族榮耀
Apple, Samsung, Nokia, Honor, BlackBerry, Lenovo
支付寶、淘寶、知乎、郵箱、微信
課堂講座電視上學過:
第一次工業革命,推進蒸汽時代
Instrial Revolution, inaugurated the Age ofSteam
第二次工業革命,步入電氣時代
the Age of Electricity
第三次科技革命,來到信息時代
Scientific Revolution, Information Age/era
編程、大數據、人工智慧、賽博經濟
programming, big data, artificial intelligence, cybereconomy
bitcoin, block chain, information encryption, quantum communication
新材料、煤炭清潔、空氣凈化
new materials, coal cleaning, air purification
幹細胞、代孕、轉基因、抗蟲棉、人造血液
stem cells, surrogate, transgenic, insect resistant cotton, artificial blood
核能汽車、核能手錶、彈道導彈
a nuclear car/watch, ballistic missile
創新鏈、產業鏈和資本鏈
Innovation/instrial/capital chain
深空深海深地網路空間安全和國防科技
Deep space/sea/land, cyberspace security, defense technology
邏輯推導:What, How, Why
NO.2 百味湯
—思辨性理論分析Critical Thinking—
A. 馬斯洛需求層次理論
Maslow's Hierarchy of Needs
從對食物的需求過渡到互聯網信息科技時代
對健康、安全、娛樂、愛和價值
對知識產權保護等更高級的需要
1.Biological and physiological needs- air, food, drink, shelter, warmth, sex, sleep.
2.Safety needs- protection from elements, security, order, law, stability, freedom from fear.
3.Love and belongingness needs- friendship, intimacy, trust, and acceptance, receiving and giving affection and love. Affiliating, being part of a group (family, friends, work).
4.Esteem needs- (i) esteem for oneself (dignity, achievement, mastery, independence) and (ii) the desire for reputation or respect from others (e.g., status, prestige). The need for respect or reputation is most important for children and adolescents and precedes real self-esteem or dignity.
5.Cognitive needs- knowledge and understanding, curiosity, exploration, need for meaning and predictability.
6.Aesthetic needs- appreciation and search for beauty, balance, form, etc.
7.Self-actualization needs- realizing personal potential, self-fulfillment, seeking personal growth and peak experiences. A desire 「to become everything one is capable of becoming」.
8.Transcendence needs- A person is motivated by values which transcend beyond the personal self (e.g., mystical experiences and certain experiences with nature, aesthetic experiences, sexual experiences, service to others, the pursuit of science, religious faith, etc.).
*simplypsychology.org/maslow
B. 全球化與殖民主義:主流文化入侵
Post-colonialism & Cultural Imperialism
Impact on Global Communication
從互聯網到全球聯系的增強
從科技和文化霸權看帝國殖民
從創新發展到本土文化的逐漸模糊與喪失
宗教、語言、民俗的趨同
Cultural Imperialism: the extension of influence or dominance of one nation』s culture over others, through the exportation of cultural commodities.
Global communication: the communication practice occurring across national borders, social, political, and cultural divides. The need for global communication has increased e to the expanse of globalisation.
The World Systems Theory: an inter-regional and transnational division of labour with core, periphery, and semi-periphery countries.
In its conquest of Italy, the Roman Empire imposed Latin on the people of Etruria, replacing the Etruscan language, which ultimately led tothe demise of the language and other aspects of the Etruscan culture. Then, Latin was the lingua franca and today English isthe lingua franca of global communication
The expansion of the British Empire ring the eighteenth and nineteenth centuries: cultural form of imperialism, throughreligious proselytising, i.e. the imposition of Christianity on cultures with other religions.The British Empire also exerted its cultural power throughimposing ecational material on the colonies, promoting the empire through books and syllabuses, serving the interest of colonialism.
The assimilation of media:literature, film, television, Internet, and music.
US media and entertainment instries, like Hollywood and Disney, are able topenetrate the global market and export US-American cultural procts and values.
*linkedin.com/pulse/critical-examination-cultural-imperialism-its-impact-global-drysén/
C. 資本主義、信息共享與互聯網
Capitalism and the Internet
資本主義剝削形式、人們工作方式的轉變
new way to exploit the working class
without having to work in factories
時長加長,無形的工作與生產
more time investment, longer exploitation
enhance possibilities to enjoy their work
give rise to a new proletarian identity
eventual confrontation with capital owner
Internet is just the development of past ways of entertainment, communication and knowledge (games, libraries, letters, books, etc.) which helped spread ecation and information throughout society andlower classes as they became more and more reachable and affordable, whilst also,especially in the case of entertainment, alienating people from their nature (workers- not in a bad connotation).
New technology hastranscended the standard capitalist business model.
Intangible, conceptual assets: a large part of corporate wealth, likeintellectual property, trademarks, patents and right. Microsoft is not valued principally in physical capital assets, as was the case with big corporations in the past. What Microsoft claims to own isideas, ideas that we all need to run factories and offices and to communicate with each other.
As Thomas Jefferson put it,passing light on to another candle does not diminish the light from your own. Jefferson thought this was a good enough reason whyideas should not be treated like coal, candles and other commodities, but should be allowed to circulate freely for the common good.
*marxist.com/capitalism-internet-patents130306
*quora.com/What-would-Karl-Marx-think-about-the-internet
D. 科技創新和女權主義
Technology and Gender Gap
技術教育不足,科技行業需要卻鮮有女性
男性主導、敵意的工作環境,高離職率低薪
Women have been left out of the mainstream of recorded technological development. Technology, increasingly so in instrialized societies, is male.
A feminist perspective can help us move from a hard technology society to a soft technology future in which values such asharmony with nature, subjectivity, co-operation, and non-exploitationbecome integral to technological development.
In the 1980s, women made up a little under40 percent of computer-science graates.Since then, the gender gap has grown: Currently, less than 20 percent of computer-science graates are women. In the earliest days of programming, ring World War II, building computers was deemed a macho thing, and programming was thought to be for typists. Later, when personal computers began to appear in homes and offices, they were promoted as apastime -- for boys.Contemporary bro culture has done nothing to attack this bias.
School should expand thefemale facultyand make thecurriculummore inviting to talented students withlimited exposure to computer science: assign classes according to students' past programming experience -- to prevent long-time enthusiasts fromintimidating novices.
bloomberg.com/view/articles/2017-09-06/how-to-close-the-gender-gap-in-tech
The tech instry's gender imbalance is no secret – only 17% of technology specific jobs are held by women.Projects to counter the problem, from conferences to mentorship programmes, are becoming widespread but are usually aimed at women already embarking on careers.
From toys to language, teaching girls basic skills and busting gender myths from an early age could encourage more women into tech careers.
theguardian.com/careers/2017/dec/01/closing-the-tech-gender-gap-starts-in-childhood
NO.3 人參湯
—熟悉互聯網雙刃劍的常見論點—
Ⅱ 軟體開發方法
1:瀑布方法
所有軟體方法的祖先是瀑布方法(waterfall methodology)。它之所以被稱為瀑布方法是因為開發模塊相互之間的依次流動,瀑布方法通過控制閥門的一系列活動組成。這些控制閥門決定一個給定的活動是否已經完成並且可以進入下一個活動。需求階段處理決定了所有的軟體需求。設計階段決定整個系統的設計。代碼在代碼階段編寫。代碼然後被測試。最後產品被發布。
對瀑布方法模型最基本的批評就是瀑布方法對於反饋事物發展狀況耗時太長。軟體的一些內容那個很容易被理解,而另一些內容則相反。因此,當用戶對於手邊出現的問題都沒有很好理解的時候,開發人員試圖先完成所有的需求(也就是說,將需求量化到實際的規格說明當中)是非常空難的。更進一步來說,如果在需求中出現一個錯誤,它將傳播到設計階段,傳播到代碼中等。同時一般不存在過程中返回的真正能力。因此,如果進入測試並且發現設計的一部分是無法工作的,那麼就會進行修改並修補問題而交差,但是這種方法將會失去設計活動的所有上下文環境——你只是有目的地對系統權宜行事!
認識到這個問題後瀑布方法已經被修改成幾種形式。例如螺旋式瀑布方法它繼承並使用了多個瀑布模型。這種方法縮短了生命周期向下的時間;也就是說,為解決為題提供了迭代方案。
最終,大家無法脫離瀑布方法是因為它確實是合乎常規的方法。首先,這種方法可以決定將要構建的內容。接著,決定將要如何構建這些,下一步,世界構建這些內容。可以確保自己確實構建自己所需的東西(並且可以成功運行)。
2:統一過程
統一過程應用了基於處理系統首先考慮的最重要方面而實施的短期迭代開發。
開發一個寡慾各種用列(use case)的調查文檔(也就是說,對用戶與系統交互的簡短描述),並且開始排除那些可能對整個系統成功造成風險的用列。只要適合,就可以在開發過程中添加或者刪除用列。
統一過程的4個階段定義如下:
初始(inception):系統仍然處於決定系統內容的階段——系統將要完成什麼以及系統的邊界是什麼。如果系統能夠很好的理解,那麼這個階段就非常短。
細化(Elaboration):正在將體系結構的風險移至系統。一種表述該階段的說法是,「你是否已經解決了所有難題?」或者「你知道如何完成你將要去完成的事情嗎?」
構造(Construction)正在完成所有相關的用列來使系統為移交做好准備,也就是說,進入Beta版本。
移交(Transition)使系統通過它的最後發布階段以及Beta版本。它可能包括軟體的操作及維護。
這是一個關注於維護要素的敏捷過程,但是仍然採用了大量用例開發,間模等方面的傳統實踐。
3:極限編程:
極限編程的開發過程就是以代碼為中心的方法。
讓用戶告知你一些有關系統是如何如用轉的故事描述,基於故事相互之間的重要性來定製這些系統這樣就可以為自己的團隊提供一個故事集合,可以在一個給定的迭代中完成他們,大約兩周時間——每周工作40個小時,你將團隊劃分,雙人應付沒一個故事,在代碼被編寫時提供確定數量的內建對等評審。你和你的同伴在編寫自己代碼的同時編寫單元測試。在完成自己負責的那段代碼後,將其拿到集成的機器上,放入代碼基線,運行從所有人的代碼中積累而成的單元測試。在完成iji負責的那段代碼後,將會提供一個運行系統使用戶可以評審來確保自己的工作滿足他們的需要。
注意極限編程並沒有將軟體的設計設置成一個高級階段。相反它認為那些最前端的設計對於整個系統開發不是很有幫助,並且隨著實際開發的進行它最終還是被修改。
極限編程對於需要持續提供運行系統的軟體卡發來說非常適用。當缺少用戶介入或者項目規模很大時極限編程方法將會不好用,因為這時協調和設計活動實際上變得更重要了。
極限編程合理地考慮開發團體的能力,這樣可以有效計劃。
Ⅲ 如何用JavaScript實現區塊鏈
<span style="font-family:Arial, Helvetica, sans-serif;">'use strict';</span>var CryptoJS = require("crypto-js");var express = require("express");var bodyParser = require('body-parser');var WebSocket = require("ws");var http_port = process.env.HTTP_PORT || 3001;var p2p_port = process.env.P2P_PORT || 6001;var initialPeers = process.env.PEERS ? process.env.PEERS.split(',') : [];class Block { constructor(index, previousHash, timestamp, data, hash) { this.index = index; this.previousHash = previousHash.toString(); this.timestamp = timestamp; this.data = data; this.hash = hash.toString(); }}var sockets = [];var MessageType = { QUERY_LATEST: 0, QUERY_ALL: 1, RESPONSE_BLOCKCHAIN: 2};var getGenesisBlock = () => { return new Block(0, "0", 1465154705, "my genesis block!!", "");};var blockchain = [getGenesisBlock()];var initHttpServer = () => { var app = express(); app.use(bodyParser.json()); app.get('/blocks', (req, res) => res.send(JSON.stringify(blockchain))); app.post('/mineBlock', (req, res) => { var newBlock = generateNextBlock(req.body.data); addBlock(newBlock); broadcast(responseLatestMsg()); console.log('block added: ' + JSON.stringify(newBlock)); res.send(); }); app.get('/peers', (req, res) => { res.send(sockets.map(s => s._socket.remoteAddress + ':' + s._socket.remotePort)); }); app.post('/addPeer', (req, res) => { connectToPeers([req.body.peer]); res.send(); }); app.listen(http_port, () => console.log('Listening http on port: ' + http_port));};var initP2PServer = () => { var server = new WebSocket.Server({port: p2p_port}); server.on('connection', ws => initConnection(ws)); console.log('listening websocket p2p port on: ' + p2p_port);};var initConnection = (ws) => { sockets.push(ws); initMessageHandler(ws); initErrorHandler(ws); write(ws, queryChainLengthMsg());};var initMessageHandler = (ws) => { ws.on('message', (data) => { var message = JSON.parse(data); console.log('Received message' + JSON.stringify(message)); switch (message.type) { case MessageType.QUERY_LATEST: write(ws, responseLatestMsg()); break; case MessageType.QUERY_ALL: write(ws, responseChainMsg()); break; case MessageType.RESPONSE_BLOCKCHAIN: handleBlockchainResponse(message); break; } });};var initErrorHandler = (ws) => { var closeConnection = (ws) => { console.log('connection failed to peer: ' + ws.url); sockets.splice(sockets.indexOf(ws), 1); }; ws.on('close', () => closeConnection(ws)); ws.on('error', () => closeConnection(ws));};var generateNextBlock = (blockData) => { var previousBlock = getLatestBlock(); var nextIndex = previousBlock.index + 1; var nextTimestamp = new Date().getTime() / 1000; var nextHash = calculateHash(nextIndex, previousBlock.hash, nextTimestamp, blockData); return new Block(nextIndex, previousBlock.hash, nextTimestamp, blockData, nextHash);};var calculateHashForBlock = (block) => { return calculateHash(block.index, block.previousHash, block.timestamp, block.data);};var calculateHash = (index, previousHash, timestamp, data) => { return CryptoJS.SHA256(index + previousHash + timestamp + data).toString();};var addBlock = (newBlock) => { if (isValidNewBlock(newBlock, getLatestBlock())) { blockchain.push(newBlock); }};var isValidNewBlock = (newBlock, previousBlock) => { if (previousBlock.index + 1 !== newBlock.index) { console.log('invalid index'); return false; } else if (previousBlock.hash !== newBlock.previousHash) { console.log('invalid previoushash'); return false; } else if (calculateHashForBlock(newBlock) !== newBlock.hash) { console.log(typeof (newBlock.hash) + ' ' + typeof calculateHashForBlock(newBlock)); console.log('invalid hash: ' + calculateHashForBlock(newBlock) + ' ' + newBlock.hash); return false; } return true;};var connectToPeers = (newPeers) => { newPeers.forEach((peer) => { var ws = new WebSocket(peer); ws.on('open', () => initConnection(ws)); ws.on('error', () => { console.log('connection failed') }); });};var handleBlockchainResponse = (message) => { var receivedBlocks = JSON.parse(message.data).sort((b1, b2) => (b1.index - b2.index)); var latestBlockReceived = receivedBlocks[receivedBlocks.length - 1]; var latestBlockHeld = getLatestBlock(); if (latestBlockReceived.index > latestBlockHeld.index) { console.log('blockchain possibly behind. We got: ' + latestBlockHeld.index + ' Peer got: ' + latestBlockReceived.index); if (latestBlockHeld.hash === latestBlockReceived.previousHash) { console.log("We can append the received block to our chain"); blockchain.push(latestBlockReceived); broadcast(responseLatestMsg()); } else if (receivedBlocks.length === 1) { console.log("We have to query the chain from our peer"); broadcast(queryAllMsg()); } else { console.log("Received blockchain is longer than current blockchain"); replaceChain(receivedBlocks); } } else { console.log('received blockchain is not longer than received blockchain. Do nothing'); }};var replaceChain = (newBlocks) => { if (isValidChain(newBlocks) && newBlocks.length > blockchain.length) { console.log('Received blockchain is valid. Replacing current blockchain with received blockchain'); blockchain = newBlocks; broadcast(responseLatestMsg()); } else { console.log('Received blockchain invalid'); }};var isValidChain = (blockchainToValidate) => { if (JSON.stringify(blockchainToValidate[0]) !== JSON.stringify(getGenesisBlock())) { return false; } var tempBlocks = [blockchainToValidate[0]]; for (var i = 1; i < blockchainToValidate.length; i++) { if (isValidNewBlock(blockchainToValidate[i], tempBlocks[i - 1])) { tempBlocks.push(blockchainToValidate[i]); } else { return false; } } return true;};var getLatestBlock = () => blockchain[blockchain.length - 1];var queryChainLengthMsg = () => ({'type': MessageType.QUERY_LATEST});var queryAllMsg = () => ({'type': MessageType.QUERY_ALL});var responseChainMsg = () =>({ 'type': MessageType.RESPONSE_BLOCKCHAIN, 'data': JSON.stringify(blockchain)});var responseLatestMsg = () => ({ 'type': MessageType.RESPONSE_BLOCKCHAIN, 'data': JSON.stringify([getLatestBlock()])});var write = (ws, message) => ws.send(JSON.stringify(message));var broadcast = (message) => sockets.forEach(socket => write(socket, message));connectToPeers(initialPeers);initHttpServer();initP2PServer();