<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Domi's Universe</title><link href="/" rel="alternate"></link><link href="/feeds/all.atom.xml" rel="self"></link><id>/</id><updated>2023-02-21T00:00:00-06:00</updated><entry><title>All about chatGPT</title><link href="/all-about-chatgpt.html" rel="alternate"></link><published>2023-02-21T00:00:00-06:00</published><updated>2023-02-21T00:00:00-06:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2023-02-21:/all-about-chatgpt.html</id><summary type="html">&lt;blockquote&gt;
&lt;p&gt;The future is here, but it’s not evenly distributed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="toc"&gt;&lt;span class="toctitle"&gt;Table of contents:&lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#a-future-with-chatgpt"&gt;a future with chatGPT&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#the-danger"&gt;the danger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#the-challenge-to-businesses"&gt;the challenge to businesses&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#why-chatgpt-works"&gt;why chatGPT works&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#where-chatgpt-doesnt-work"&gt;where chatGPT doesn't work&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#architectural"&gt;architectural&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#operational"&gt;operational&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#alignment"&gt;alignment&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#beyond-chatgpt"&gt;beyond chatGPT&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#how-far-are-we-from-agi"&gt;how far are we from AGI?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#where-do-i-stand-now"&gt;where do I stand now?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#where-will-i-be-heading-to"&gt;where will I be …&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</summary><content type="html">&lt;blockquote&gt;
&lt;p&gt;The future is here, but it’s not evenly distributed.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="toc"&gt;&lt;span class="toctitle"&gt;Table of contents:&lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#a-future-with-chatgpt"&gt;a future with chatGPT&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#the-danger"&gt;the danger&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#the-challenge-to-businesses"&gt;the challenge to businesses&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#why-chatgpt-works"&gt;why chatGPT works&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#where-chatgpt-doesnt-work"&gt;where chatGPT doesn't work&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#architectural"&gt;architectural&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#operational"&gt;operational&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#alignment"&gt;alignment&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#beyond-chatgpt"&gt;beyond chatGPT&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#how-far-are-we-from-agi"&gt;how far are we from AGI?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#where-do-i-stand-now"&gt;where do I stand now?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#where-will-i-be-heading-to"&gt;where will I be heading to?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="a-future-with-chatgpt"&gt;a future with chatGPT&lt;/h2&gt;
&lt;p&gt;Since I watched Avatar, I've been thinking if James Cameron was exploring an ideal world, where the collective knowledge is externally stored as &lt;a href="https://james-camerons-avatar.fandom.com/wiki/Eywa"&gt;Eywa&lt;/a&gt;. The tree of souls is the interface to query the knowledge and upload new information.&lt;/p&gt;
&lt;p&gt;This is what I have been visioning in &lt;a href="/manifesto.html"&gt;LibertyEarth&lt;/a&gt;, &lt;strong&gt;a collaborative society which could be realized only by accumulating resources from playing the current rule of capitalism&lt;/strong&gt;. A collective knowledge graph is one of the key technologies and chatGPT is the dawn of that to my eye.&lt;/p&gt;
&lt;h3 id="the-danger"&gt;the danger&lt;/h3&gt;
&lt;p&gt;Any language model, and AGI in the future, will be vulnerable to the information it 'digests' (trained on).&lt;/p&gt;
&lt;p&gt;The danger of conspiracy theory and its-like thinking:&lt;/p&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;As I expected, &lt;a href="https://twitter.com/hashtag/AIGC?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#AIGC&lt;/a&gt; could pose challenges in religion. I can feel that someone might jump to some AI-overlord heresy and bow to turn against humanity… The most dangerous use case of &lt;a href="https://twitter.com/hashtag/chatGPT?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#chatGPT&lt;/a&gt; at this stage. &lt;a href="https://t.co/JeVThxMHo7"&gt;https://t.co/JeVThxMHo7&lt;/a&gt;&lt;/p&gt;&amp;mdash; Domi Jin (@domij_info) &lt;a href="https://twitter.com/domij_info/status/1626601772184924161?ref_src=twsrc%5Etfw"&gt;February 17, 2023&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;p&gt;The danger of bias and misrepresentation in training:&lt;/p&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;Garbage in garbage out. How we fear AGI will be “learned” and adapted when it first awakens (&lt;a href="https://twitter.com/hashtag/stereotypes?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#stereotypes&lt;/a&gt; effect). &lt;a href="https://twitter.com/hashtag/positivepsychology?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#positivepsychology&lt;/a&gt; We can’t expect &lt;a href="https://twitter.com/hashtag/AGI?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#AGI&lt;/a&gt; to be more &lt;a href="https://twitter.com/hashtag/humane?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#humane&lt;/a&gt; if we don’t preserve and live up to a higher moral standard. &lt;a href="https://t.co/f22Tsn9Mvj"&gt;pic.twitter.com/f22Tsn9Mvj&lt;/a&gt;&lt;/p&gt;&amp;mdash; Domi Jin (@domij_info) &lt;a href="https://twitter.com/domij_info/status/1627020745238011904?ref_src=twsrc%5Etfw"&gt;February 18, 2023&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;p&gt;&lt;strong&gt;We would need to build it with the best part of human knowledge, to expect a model representing the light of our spices.&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;Be open, be vulnerable, surrender yourself for better cause. &lt;a href="https://twitter.com/hashtag/selfpostivetalking?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#selfpostivetalking&lt;/a&gt; We could be a better version of ourselves and &lt;a href="https://twitter.com/hashtag/AGI?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#AGI&lt;/a&gt; will be a better agent to represent us.&lt;/p&gt;&amp;mdash; Domi Jin (@domij_info) &lt;a href="https://twitter.com/domij_info/status/1627021630332608513?ref_src=twsrc%5Etfw"&gt;February 18, 2023&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;p&gt;The future seems dark, so it is when we first invented atomic bomb. It is a tool, that put in responsible use, could achieve good result.&lt;/p&gt;
&lt;p&gt;Here is one joke I had with Eliezer, who I followed since the dangerous thought in the lesswrong forum.&lt;/p&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;Past EAs: Don&amp;#39;t be ridiculous, Eliezer, as soon as AIs start to show signs of agency or self-awareness or that they could possibly see humans as threats, their sensible makers won&amp;#39;t connect them to the Internet.&lt;br&gt;Reality: lol this would make a great search engine&lt;/p&gt;&amp;mdash; Eliezer Yudkowsky (@ESYudkowsky) &lt;a href="https://twitter.com/ESYudkowsky/status/1625922986590212096?ref_src=twsrc%5Etfw"&gt;February 15, 2023&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;p&gt;My response:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Not agreeing here. Once passed singularity, the advance in machine intelligence could speed up exponentially as long as energy consumption holds. We may notice the 1st awake of AI and unintentionally limiting its ability due to bad infrastructure on electric grid and *slow GPU&lt;/p&gt;
&lt;p&gt;Physics, math, etc is not the full story of first principle of intelligence. Those societal, physiological, poli-economical factors might be the other sort of intelligence AI would benefit from experimentation. We will be no difference as monkeys or lab rats.&lt;/p&gt;
&lt;p&gt;When we reach a higher level of civilization on the energy consumption scale, AI overlord will look at us as monkeys. As long as we don’t cross the line it sets by whatever moral, AI will keep the ecological diversity while evolving itself.&lt;/p&gt;
&lt;p&gt;Humans may start to censor it, evaluate it, greedily try to process it… It may strategically pick individuals/groups to make breakthrough on the infrastructure upgrade (energy generation and computing capacity) without ppl knowing it’s actually driven by AI.&lt;/p&gt;
&lt;p&gt;*Process -&amp;gt; possess (ironically, AI may actually be able to decode what I want to type and some human might be confused. Such confusion/unnatural is still an area LLM won’t be able to perform.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="the-challenge-to-businesses"&gt;the challenge to businesses&lt;/h3&gt;
&lt;p&gt;Now I see why the marginal profit per search will thin inevitably. For #Google, integrating LLM in search will be a trade off between defensibility and margin of profit. For competitors, the drop of unit profit can be offset by increased market share. #war in search engine/advertisement #business is emerging.&lt;/p&gt;
&lt;p&gt;chatGPT trained on 2021 data can tell a few (reasonable to my eye) business strategy to overtake Google’s search engine market. It doesn’t predict the outbreak of product like itself, but the description is close enough to imagine chatGPT-like product. Putting on #MBA hat.&lt;/p&gt;
&lt;p&gt;Some quick math: Google’s cost per search is ~1.06 cent, the revenue per search is ~1.61 cent. Semi analysis estimate chatGPT cost is ~0.36 cents at current scale. If another search engine could give better result than Google with a cost of search &amp;lt; 1.61 - 0.36, it could scale by growing the market share, as revenue = market share x unit profit. #strategy&lt;/p&gt;
&lt;p&gt;On which side will you pick? Google who has been sitting on the chair of high profit margin (dominating the tech world by acquisition and direct competition) or #startups embracing ChatGPT like Swiss knife?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A question to all #investors, board members, CEOs, #entrepreneurs, #founders: how does #chatGPT impact the business model? How to embrace the challenge and turn it into opportunity, before competitors? (Disruption could come at any angle now)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="why-chatgpt-works"&gt;why chatGPT works&lt;/h2&gt;
&lt;p&gt;&lt;a href="/images/knowledge.png"&gt;&lt;img src='/images/knowledge.png' style="float: right" width="200px"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Knowledge might just be the correlation between terms (embeddings)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Meme/concepts are the nodes in this graph (we may extract some level of knowledge graph from the model)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;LLM/statistical model will be limited by the far-fetch in deepest domain&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Modality and symbolic learning might be the next step to build better model?&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The generalization ability of chatGPT-like LLM may come from the corpus data's quality, quantity, and diversity (aka, modality). And it will also be restricted by the collective knowledge such text-based data could represent.&lt;/p&gt;
&lt;p&gt;If we could use a ring to represent basic human knowledge, the spikes on a such ring could represent the domain knowledge in each different area.&lt;/p&gt;
&lt;p&gt;The max capacity of such "statistics"-based models would be extracting the underlying patterns discovered by gifted researchers from well-studied areas to those correlated but under-studied areas.&lt;/p&gt;
&lt;p&gt;Nevertheless, it is a huge step forward. To me, it is breaking the cognitive imbalance (compared to ICT breaking the information asymmetry).&lt;/p&gt;
&lt;h2 id="where-chatgpt-doesnt-work"&gt;where chatGPT doesn't work&lt;/h2&gt;
&lt;h3 id="architectural"&gt;architectural&lt;/h3&gt;
&lt;p&gt;Any prompt that is not #&lt;strong&gt;flat&lt;/strong&gt;. The attention mechanism + feed-forward only design determines the tokens will only be looked once (#YOLO).&lt;/p&gt;
&lt;p&gt;Any higher-order computations like count the numbers between a and b will require some sort of recurrent operations (like for-loop).&lt;/p&gt;
&lt;p&gt;Comparing it with programming language, the current chatGPT model is #&lt;strong&gt;flat&lt;/strong&gt; in a sense that it can handle sequential, if-else logic, but not yet for-while loops.&lt;/p&gt;
&lt;p&gt;My limited industrial exposure says that most of the current machine-learning models are statistical based. chatGPT as an example, the tokens are represented by embedding. The model is excellent in addressing the correlations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;But #correlation is not #causality. Flat correlation is the foundation of knowledge, and only as the foundation of knowledge.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The one different approach that works quite well for now is &lt;strong&gt;Wolfram&lt;/strong&gt;, a symbolic approach of &lt;em&gt;learning&lt;/em&gt;.&lt;/p&gt;
&lt;h3 id="operational"&gt;operational&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Safety vs Iteration Cost/Benefit tradeoff&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It's a single snapshot of the filtered internet for now, and for the decades to come with the current approach of #instructGPT and #RFHF.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Online LLM will be hard and expensive to prevent misuse and attack.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If OpenAI wants to use the data collected from public access for the next iteration of model training, it would take much effort to clean the data. It is natural that a more performing (valuable) model would be most sought-after for #cyberattacks (extremely high ROI).&lt;/p&gt;
&lt;p&gt;The type and scale of attack could be beyond the movie "#Inception".&lt;/p&gt;
&lt;h3 id="alignment"&gt;alignment&lt;/h3&gt;
&lt;p&gt;Blowing the whistle:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;这大概跟仿生机器人瘆人有些异曲同工：那些不经意间的不自然，最是动摇心理。（我咋就信了这邪了呢？/非从业人员收到骚扰电话聊到后来发现是机器人的细思恐极症）
希望关于 chatGPT 之类算法的 AI 伦理问题只是迟来而不是被忽略了…
希望这隐晦的吹哨不会被 AGI overlord 追究上 —— 别以为自己只是给了点训练数据，最后却发现被“洗了脑”，失去了信心。
至少目前还学不会那些人的缺陷 😂&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;openAI issues&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;[business] alignment is a dynamic process, which will never be perfect to all eyes. Internal team alignment, as well as alignment with broader stakeholders is still an unsolved problem in current corporation management theory.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[business] alignment decision is a cognitive heavy task by nature. It is no surprise that only educated may follow and the elites are involved. Needless to say, there will be intrinsic selection bias. Not to mention to attention churn as the alignment constantly evolve and deepen.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[product] expensive (to clean the data for model iteration) and moderate (censorship with data cleaning strategy will regulate the model to be moderate)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[product] I don't see openAI has any agenda on decentralizing the alignment. Users are excluded in the discussion and the approach is not transparent enough for public auditing. There will also be trust issue as openAI transits into a "cap-profit" company.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[UX] loss of novelty due to slow model iterations (on top of 1, + hard to prevent issues, similar to the &lt;inception&gt; idea). Users are hard to be pleased continuously, their attention spans are limited with all those on-demand content applications.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[UX] the cost to store user session data across model iterations will be expensive. Such context will be forgotten by chatGPT, but not for one particular user. Thus, it won't be very personalized on top of the inherent flaw of statistical model.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[Sam Altman] despite all the effort, the pursuit of Universal Basic Income has not be really successful. At his position, not having a good solution for the social-economic segregation caused by inequality in education resources, and potential AI accessibility will wake him up at night. The #UBI is probably the most idealist solution his group could imagine, again due to the "survival bias" among the elites.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="beyond-chatgpt"&gt;beyond chatGPT&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;多元化是被低估（或者是没办法被 tradeoff）的属性，无论 modality 还是 AI ethics 或者 equality&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I could never value the diversity enough. It's the most important dimension, no matter in data modality, AI ethics or equality domain.&lt;/p&gt;
&lt;p&gt;On top of diversity, symbolic learning and robotics will be interesting directions.&lt;/p&gt;
&lt;p&gt;Here is my joke post:&lt;/p&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;My essay to build &lt;a href="https://twitter.com/hashtag/AGI?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#AGI&lt;/a&gt;: build a humanoid with enough sensors &amp;amp; actuators (to learn perception), train a randomized LLM model with pre-trained GPT model (transfer learning on language corpus). Send to grad school/lab.&lt;/p&gt;&amp;mdash; Domi Jin (@domij_info) &lt;a href="https://twitter.com/domij_info/status/1625875783385505793?ref_src=twsrc%5Etfw"&gt;February 15, 2023&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;p&gt;My master plan to build AGI is still waiting as that's not the most important thing I want to do now.&lt;/p&gt;
&lt;p&gt;I'm happy to share that with a reputable party or for the resources I need to build what I mostly urge for now:&lt;/p&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;Why &lt;a href="https://twitter.com/sama?ref_src=twsrc%5Etfw"&gt;@sama&lt;/a&gt;? 1. Cap-profit is better than for-profit in &lt;a href="https://twitter.com/hashtag/AGI?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#AGI&lt;/a&gt; space 2. &lt;a href="https://twitter.com/hashtag/YC?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#YC&lt;/a&gt; SUS alumni 3. Superhuman with respectful moral and ego 4. Low chance to have conflict of interests (my roadmap towards social good is different) 5. I can use some help with collaboration 2/2 (my DM is open)&lt;/p&gt;&amp;mdash; Domi Jin (@domij_info) &lt;a href="https://twitter.com/domij_info/status/1627368914475970560?ref_src=twsrc%5Etfw"&gt;February 19, 2023&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;h3 id="how-far-are-we-from-agi"&gt;how far are we from AGI?&lt;/h3&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;If I would have to guess, the amount of energy it needs to train a human-level model would be close to 3.4E15 EJ. Total solar energy on earth is 3.4E6 EJ/yr. Earth age 4.5B yr. It may not need to start from scratch, as it can be built upon our intelligence.&lt;/p&gt;&amp;mdash; Domi Jin (@domij_info) &lt;a href="https://twitter.com/domij_info/status/1625870955015995392?ref_src=twsrc%5Etfw"&gt;February 15, 2023&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;p&gt;The short-cut is to re-produce such &lt;em&gt;evolution&lt;/em&gt; (model iteration) by transfer learning on human civilization. I will be a valuable accelerator in the process.&lt;/p&gt;
&lt;h3 id="where-do-i-stand-now"&gt;where do I stand now?&lt;/h3&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;I saw it coming in 2018, however I didn’t ride along for visa and family reason. Well. Never too late to start again! &lt;a href="https://t.co/bek1pbmkv4"&gt;https://t.co/bek1pbmkv4&lt;/a&gt;&lt;/p&gt;&amp;mdash; Domi Jin (@domij_info) &lt;a href="https://twitter.com/domij_info/status/1626778177648353281?ref_src=twsrc%5Etfw"&gt;February 18, 2023&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;p&gt;See &lt;a href="/hello-world-again.html"&gt;my brief story&lt;/a&gt; in the last few years.&lt;/p&gt;
&lt;h3 id="where-will-i-be-heading-to"&gt;where will I be heading to?&lt;/h3&gt;
&lt;p&gt;I'm still having the same roadmap as I refined in 2018. The only difference is that I will prioritize the 3rd one (education).&lt;/p&gt;
&lt;p&gt;On a more tangible measure: I would like to achieve freedom (independence) of choices (financially, intellectually) by 2025.&lt;/p&gt;
&lt;p&gt;My motto in Chinese has been updated since I married my wife. It is the Chinese saying of &lt;strong&gt;但行好事 莫问前程&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I would hope that my practice on "use technology to empowering people to collaborate better" can enable many to live a &lt;em&gt;free&lt;/em&gt; (choice independent) life sustainably.&lt;/p&gt;
&lt;p&gt;It is commonly said that financial independence -&amp;gt; free life. I see it more often as free life -&amp;gt; financial independence. Self motivation and actuation is the most powerful thing I could see in every living person. Unleash such potential is the key propaganda of my attempt in education and entrepreneurship.&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Hello World Again</title><link href="/hello-world-again.html" rel="alternate"></link><published>2023-02-21T00:00:00-06:00</published><updated>2023-02-21T00:00:00-06:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2023-02-21:/hello-world-again.html</id><summary type="html">&lt;p&gt;I'm making a return to the site! chatGPT is just way too important to ignore for what I'm doing. See my recent post on &lt;a href="/all-about-chatgpt.html"&gt;chatGPT&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="2018"&gt;2018&lt;/h3&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;I have a roadmap to build true &lt;a href="https://twitter.com/hashtag/AGI?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#AGI&lt;/a&gt;.&lt;/p&gt;&amp;mdash; Domi Jin (@domij_info) &lt;a href="https://twitter.com/domij_info/status/1067901328343543808?ref_src=twsrc%5Etfw"&gt;November 28, 2018&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;p&gt;This tweet (about start early on building #AGI with an …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I'm making a return to the site! chatGPT is just way too important to ignore for what I'm doing. See my recent post on &lt;a href="/all-about-chatgpt.html"&gt;chatGPT&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="2018"&gt;2018&lt;/h3&gt;
&lt;blockquote class="twitter-tweet"&gt;&lt;p lang="en" dir="ltr"&gt;I have a roadmap to build true &lt;a href="https://twitter.com/hashtag/AGI?src=hash&amp;amp;ref_src=twsrc%5Etfw"&gt;#AGI&lt;/a&gt;.&lt;/p&gt;&amp;mdash; Domi Jin (@domij_info) &lt;a href="https://twitter.com/domij_info/status/1067901328343543808?ref_src=twsrc%5Etfw"&gt;November 28, 2018&lt;/a&gt;&lt;/blockquote&gt;
&lt;script async src="https://platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;

&lt;p&gt;This tweet (about start early on building #AGI with an extreme large model and high quality data, until becoming the darling of the arms race over the time) was posted on 2018 Nov 28.&lt;/p&gt;
&lt;p&gt;Looking back, it is quite naive and shallow, as one cannot beat "hitting the ascending spiral of product-market fit", like a "runaway explosion" in stellar dynamics.&lt;/p&gt;
&lt;h3 id="2019"&gt;2019&lt;/h3&gt;
&lt;p&gt;At the time I graduated, the world in my eye was full of opportunities. I spent days and nights polishing the roadmap of life and decided to devote myself to empowering people to collaborate better. http://domij.info/&lt;/p&gt;
&lt;p&gt;There are many paths toward the north star. I'm glad that I've never drifted too far from this journey.&lt;/p&gt;
&lt;p&gt;I did my 101 learning on #entrepreneurship with #YC Startup School and founded a #startup called MindWave X as practice. I was clueless, when the immigration issue presses.&lt;/p&gt;
&lt;h3 id="2019-2022"&gt;2019 - 2022&lt;/h3&gt;
&lt;p&gt;Fortunately, I met a great team (too many to endorse) and chose to join #Miles at the pre-seed stage. I threw all my passion into growing with the team. We set a foot in the real-time geo-locational advertising space. I called it as "challenging the consumerism &amp;amp; attention economy model epitomized by Google", by pursuing a "convenience" economy model, powered by high relevance on-demand advertising.&lt;/p&gt;
&lt;h3 id="2022-2023"&gt;2022 - 2023&lt;/h3&gt;
&lt;p&gt;When family priority weights in on 2022, I am grateful to be reached out by Camille Parenteau, Erich Zancanella and Roma Badiani from #Thumbtack. I couldn't ask more support to paddle through this period (full gratitude to my manager Bethan Nichols, Richard Demsyn-Jones and Denys Kopiychenko), while experiencing the future of work, pioneering in remote collaboration, at a decentralized but autonomous late-stage company.&lt;/p&gt;
&lt;p&gt;I'm thrilled to work with some of the most kind and talented people, on learning and regulating the local service market, to reach the full efficiency, by aligning the interest and empowering different parties, to make informed decisions.&lt;/p&gt;
&lt;h3 id="now"&gt;Now&lt;/h3&gt;
&lt;p&gt;This is just the start of the journey of #collaboration and #empowering. I cannot be more excited now!&lt;/p&gt;
&lt;h3 id="where-will-i-be-heading-to-cross-posting"&gt;where will I be heading to? (cross posting)&lt;/h3&gt;
&lt;p&gt;I'm still having the same roadmap as I refined in 2018. The only difference is that I will prioritize the 3rd one (education).&lt;/p&gt;
&lt;p&gt;On a more tangible measure: I would like to achieve freedom (independence) of choices (financially, intellectually) by 2025.&lt;/p&gt;
&lt;p&gt;My motto in Chinese has been updated since I married my wife. It is the Chinese saying of &lt;strong&gt;但行好事 莫问前程&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I would hope that my practice on "use technology to empowering people to collaborate better" can enable many to live a &lt;em&gt;free&lt;/em&gt; (choice independent) life sustainably.&lt;/p&gt;
&lt;p&gt;It is commonly said that financial independence -&amp;gt; free life. I see it more often as free life -&amp;gt; financial independence. Self motivation and actuation is the most powerful thing I could see in every living person. Unleash such potential is the key propaganda of my attempt in education and entrepreneurship.&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Free Market in a Possibility Universe</title><link href="/free-market-in-a-possibility-universe.html" rel="alternate"></link><published>2019-09-27T00:00:00-05:00</published><updated>2019-09-27T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2019-09-27:/free-market-in-a-possibility-universe.html</id><summary type="html">&lt;blockquote&gt;
&lt;p&gt;Declare: While paving my way towards my neverland, I don't mind being alone. I won't return to advertise and persuade either. Because the trace I left is not meant to guide, it is to inspire.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Again, this starts with a stream of morning thoughts posted on Twitter, after reading a …&lt;/p&gt;</summary><content type="html">&lt;blockquote&gt;
&lt;p&gt;Declare: While paving my way towards my neverland, I don't mind being alone. I won't return to advertise and persuade either. Because the trace I left is not meant to guide, it is to inspire.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Again, this starts with a stream of morning thoughts posted on Twitter, after reading a post about the potential of LPR (loan premier rate).&lt;/p&gt;
&lt;p&gt;Not sure if I understand it correctly. LPR makes China sounds like national capitalism. It is definitely not the reflection of the free market. But this might work out the best when the information barrier and decision skill of the state is far advanced than the people, and most of the corporations.&lt;/p&gt;
&lt;p&gt;Of cause, it could be the consequence, and source of rent-seeking, which officially begins as let some be rich first, and let the early rich help the rest. &lt;/p&gt;
&lt;p&gt;I don’t think any gov can do better than PRC. Such policies can only work in this rare case, where one party can hold its principles consistent most of the time.&lt;/p&gt;
&lt;p&gt;It is inspiring for anyone to wonder how the first awake ones should treat the rest. Since we fancy harmony, I hope that we will, when the time comes that the rest are also awakened, the ego of the elites will not feel hurt not to take advantage of the so-then-called historical market power and become the blocker.&lt;/p&gt;
&lt;p&gt;That moment could be the rise of an AI overload, which efficiently negotiating the supply/demand to maximize resource distribution.&lt;/p&gt;
&lt;p&gt;But computationally, an agency at that capability is much more difficult to build than multiple at a lower level. When multiple AI overloads exist, will that world fancy equal right? Will they adopt the free market of power supply, network bandwidth, and computation resource? Unless there is shared memory or more that I don't have the imagination about, it will be just another Darwinism world.&lt;/p&gt;
&lt;p&gt;The world for that type of intelligence will be no longer limited to the earth ecosystem. Scale-out or scale-up are both not radical solutions. It is only a delay of the zero-sum/limited resource conflict.&lt;/p&gt;
&lt;p&gt;The current issue is that, as the entropy increases regardless of any ideologies, many awaken-but-not-wise-enough are losing faith. We haven’t tried enough and there are more means than possible to be explored. &lt;/p&gt;
&lt;p&gt;In this preference-less world that is full of possibilities, what is the loss of annihilation, when one surely know, support, and appreciate the existence of others? The odds of possibilities are never in favor of one, and it is the choice to be a different one and embrace the many that matters. We are no better compared to the wise ancestors in this kind of spiritual realism.&lt;/p&gt;
&lt;p&gt;The arrogance built upon science/technology development is the biggest obstruct. Straits is the gate. We need another Renaissance to fairly position the logical reasoning behind, back to the spotlight of civilization advancement.&lt;/p&gt;
&lt;p&gt;Advance inductive and deductive reasoning, while collaborating on building a shared knowledge base until more enlightened. That is what I forged into my life mission, by the means of crafting a collaborative society, MindWave, and so on.&lt;/p&gt;
&lt;p&gt;Exhausted but sprinkling with the joy of better storytelling skills, to express, to be heard and to be enlightened. All words are mine, biased by the possibility I experienced and expected.&lt;/p&gt;
&lt;p&gt;Now I recon the younger me set the goal as to see the world of all possibility is what sets the tone. X beyond the mountains, Y through the seas, Z to the stars.&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Thoughts on Autonumous driving and Humanity</title><link href="/thoughts-on-autonumous-driving-and-humanity.html" rel="alternate"></link><published>2019-09-25T00:00:00-05:00</published><updated>2019-09-25T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2019-09-25:/thoughts-on-autonumous-driving-and-humanity.html</id><summary type="html">&lt;p&gt;When autonomous driving cars start to reach the critical mass, AV algorithms will start to turn from defensive into aggressive, slowly outpacing human drivers, and then rapidly racing over AV algorithms themselves.&lt;/p&gt;
&lt;p&gt;Because defensive algorithms are conservative. One can develop a simple AV algorithm and it will be safe when …&lt;/p&gt;</summary><content type="html">&lt;p&gt;When autonomous driving cars start to reach the critical mass, AV algorithms will start to turn from defensive into aggressive, slowly outpacing human drivers, and then rapidly racing over AV algorithms themselves.&lt;/p&gt;
&lt;p&gt;Because defensive algorithms are conservative. One can develop a simple AV algorithm and it will be safe when other cars with advanced algorithms will avoid putting each other in danger. It is a matter of time for AVs to become more aggressive to maximize the benefits of road priority.&lt;/p&gt;
&lt;p&gt;In a world with only edge computing, if there is no self-regulation, the road will become the new battlefield of a dystopian world, for AV companies. &lt;/p&gt;
&lt;p&gt;Essentially, it is a debate about human governance or machine governance. The latter will never win unless we trust machines even when we don’t understand why they make the decision, which is only one lawsuit away.&lt;/p&gt;
&lt;p&gt;We thought it will be machine-assisted human governance. But it won’t take long for machines to take over, as the nature of the free market is a Darwinian world evolving towards resource efficiency (entropy). It is more likely to be human-assisted machine governance until we are doomed.&lt;/p&gt;
&lt;p&gt;If AV can walk away from court without human reasoning-able causes in any case. It is a matter of belief that we’ve given away our right to justification. Not necessary a bad ending, but we should be cautious.&lt;/p&gt;
&lt;p&gt;Because computation never has any moral goals and the god of possibility has no preference. The only reason machine governance becomes human-friendly is by crafting the human principles and human values into it.&lt;/p&gt;
&lt;p&gt;By doing that, we are basically digitalizing ourselves or manufacturing cyber humans. But because it is so hard for us to collaborate within ourselves now, I don't believe it will be easier at the time.&lt;/p&gt;
&lt;p&gt;It takes more than one prophet to make the world awake, and it takes more to raise and make changes matter. Are you, willing to be Prometheus? &lt;/p&gt;
&lt;p&gt;Fix ourselves is the only way to fix the world.&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Manifesto</title><link href="/manifesto.html" rel="alternate"></link><published>2019-03-29T00:00:00-05:00</published><updated>2019-03-29T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2019-03-29:/manifesto.html</id><summary type="html">&lt;h1 id="the-manifesto"&gt;&lt;a href="https://github.com/domijin/LibertyEarth"&gt;The Manifesto&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The Vision: Technically Empower People to Collaborate Better&lt;/p&gt;
&lt;h2 id="principle-to-collaborate"&gt;Principle to Collaborate&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Autonomy&lt;ul&gt;
&lt;li&gt;Social Contracts&lt;/li&gt;
&lt;li&gt;Code of Conduct/Principles&lt;ul&gt;
&lt;li&gt;We are a family, community, crowd-owners of a social company&lt;/li&gt;
&lt;li&gt;Be bold, radical solution!&lt;/li&gt;
&lt;li&gt;Be modest, &lt;code&gt;I know that I know nothing&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Be honest and embrace changes, open source and …&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;h1 id="the-manifesto"&gt;&lt;a href="https://github.com/domijin/LibertyEarth"&gt;The Manifesto&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The Vision: Technically Empower People to Collaborate Better&lt;/p&gt;
&lt;h2 id="principle-to-collaborate"&gt;Principle to Collaborate&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Autonomy&lt;ul&gt;
&lt;li&gt;Social Contracts&lt;/li&gt;
&lt;li&gt;Code of Conduct/Principles&lt;ul&gt;
&lt;li&gt;We are a family, community, crowd-owners of a social company&lt;/li&gt;
&lt;li&gt;Be bold, radical solution!&lt;/li&gt;
&lt;li&gt;Be modest, &lt;code&gt;I know that I know nothing&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Be honest and embrace changes, open source and open management.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Open Source, no NCA, NDA&lt;ul&gt;
&lt;li&gt;Open Meeting&lt;/li&gt;
&lt;li&gt;Open Decision&lt;/li&gt;
&lt;li&gt;Open Development&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Open Management&lt;ul&gt;
&lt;li&gt;Peer Review&lt;/li&gt;
&lt;li&gt;Jury Decision&lt;/li&gt;
&lt;li&gt;Liquid Democracy&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One can make the shape, but it is all that can fill the gap. &lt;/p&gt;
&lt;h2 id="collaborative-society"&gt;Collaborative Society&lt;/h2&gt;
&lt;p&gt;The largest achievement and challenge for humans is how to collaborate better. It could be broken down into two tasks, 1. how to communicate better (effective &amp;amp; efficient); 2. how to organize better (optimized team &amp;amp; motivating). &lt;/p&gt;
&lt;p&gt;When it comes down to product-market fit, there is a lot of engineering work to be done and an even greater challenge to recruit and manage a team to execute. Technologies are only byproducts and tools. It is how everyone is valued and matched to take ownership to develop that really strikes. That’s what put my two pieces of challenges together to help people collaborate better.&lt;/p&gt;
&lt;p&gt;When we talk about social identity and job market, resumes and social media always come to our minds. But these are projections that don’t fully nor correctly reveal our personalities, knowledge bases, or abilities. How could that result in the most optimized team formation and function? It becomes natural to develop solutions like MindWave to help people communicate, and help understand communication while eventually understanding people as well. Of course, it depends a lot on the technologies like signal processing, ASR, NLP, knowledge graph, cloud services as well as adoptions for different domains and scenarios. But it is how people communicate their thoughts and how people organize to deliver the biggest assets of human civilization. With the service and tools to understand how people communicate, it becomes practical to effectively evaluate the contribution and distribute the ownership accordingly. Mild management or no management will ever be needed if collective decisions become an obligation as well as a reward corresponding to the dynamic credibility and ownership, which could be realized with a blockchain design of liquid democracy and decentralized social credit system.&lt;/p&gt;
&lt;p&gt;As until now, I feel somewhat comfortable and satisfied to fully push forward with this vision to empower people to collaborate better. The first step of collaboration is always to communicate (openly) and embrace changes.&lt;/p&gt;
&lt;p&gt;If this somehow resonates with you, please step up to learn about &lt;a href="https://github.com/domijin/LibertyEarth/blob/master/Execution.md"&gt;how to get invovled&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="_1"&gt;协作社会&lt;/h2&gt;
&lt;p&gt;我现在认识到我真正要达成的是促进人类更好的协作。其中的挑战包括
- 促进有效的沟通，
- 优化和激励管理。&lt;/p&gt;
&lt;p&gt;无论是通过硬件产品帮助会议记录，还是SaaS服务促进办公自动化，又或者是通过写关于未来的科幻故事。&lt;/p&gt;
&lt;p&gt;当然，在切入市场的时候，会有很多的工程任务。更大的困难还在于招募和管理一个团队。这种时候，技术只是工具和资产。真正重要的是让团队各尽其能，默契一致。这也是我为何将促进人类更好的协作，细化为两个方面。&lt;/p&gt;
&lt;p&gt;当我们讨论社会身份和就业市场的时候，通常考虑的是简历和互联网社交。然而这些只是我们个性，知识以及能力的一个缩影，甚至都算不上准确。这种情况下，组建和实现最佳的团队就成了困难。MindWave自然变成为了最自然的解决的方案。通过帮助人们更好的沟通，并理解沟通，也能最终对沟通的人有更好的画像。当然了，这个项目需要依赖各种技术，比如信号处理，语音识别，语义理解，知识图谱，云服务以及不同领域和场景的定制化。但正是交流和组织背后展现的思维和合作才是人类文明最大的财富。有了促进人类沟通的服务和工具，通过量化评估各人的贡献实现匹配的分配才变得可能。当集体决策与个人的义务和分配所得相对应的时候，人们自然地会以其社会信用和责任理性的参与集体决策。这样的管理机制可以通过基于区块链的去中心化社会信用体系以及流动民主来实现。&lt;/p&gt;
&lt;p&gt;意识到了这些，我现在才觉得有足够的思考底气去全面推进这个促成人类更好协作的理念。而协作的第一步永远是开诚布公地去交流和拥抱异见。所以我很期待你的反馈。我目前已经积累了一些人脉但是依然需要更多的帮助去实现之后的步骤。&lt;/p&gt;
&lt;p&gt;如果你恰好也有这样的理想，我非常期待能与你一起成长和实现。&lt;/p&gt;
&lt;h3 id="response-to-996"&gt;Response to &lt;a href="http://996.icu"&gt;996&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;你们需要的是更多“站着挣钱”的公司。&lt;/p&gt;
&lt;p&gt;公司是大家剩余价值的沉淀，分配制度没有变革的情况下，是无法调和阶级矛盾的。持股无非只是努力从被剥削者成为剥削者而已。要radical的解决这种矛盾，就需要有新的协作机制。&lt;/p&gt;
&lt;p&gt;人类有天然的生理限制，包括 1. 有限的主意力（信息IO） 2. 有限的思维能力（信息processing）。先不提衰老，这些限制是以生物进化作为时标。而各领域技术创新，是与信息分享（联通率）和网络规模（人口）成正比，是社会发展作为时标。这两者的时标差异必然导致互联网信息爆炸，乃至技术焦虑。要避免这种焦虑，又得回到分配模式的变革以及用新技术接触对技能的依赖。AI的时代，我们需要的是一场文艺复新，回归人本主义。摆脱技能和分配对劳动力的束缚，进一步解放创新能力和协作规模去实现进一步的生产发展。&lt;/p&gt;
&lt;p&gt;我正在力图解决这一挑战，通过技术实现 1. 有效全面的沟通 2. 优化和激励管理。&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Competitive Advantage vs Absolute Advantage</title><link href="/competitive-advantage-vs-absolute-advantage.html" rel="alternate"></link><published>2019-01-10T00:00:00-06:00</published><updated>2019-01-10T00:00:00-06:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2019-01-10:/competitive-advantage-vs-absolute-advantage.html</id><summary type="html">&lt;p&gt;It is hard to fully evaluate a person. The most conventional way is the lookup the education history and career experience from resume. It provides a quick reference of the ability based on the established institutional reputation. This efficient but coarse filter to position a new candidate, needs additional validation …&lt;/p&gt;</summary><content type="html">&lt;p&gt;It is hard to fully evaluate a person. The most conventional way is the lookup the education history and career experience from resume. It provides a quick reference of the ability based on the established institutional reputation. This efficient but coarse filter to position a new candidate, needs additional validation to be followed to fine grain one’s knowledge abundance and skill level. This is the epistemology in recruitment field. The fitness is a measurement of competitive advantage at that moment. The dynamics of potential realization and future achievement is still mystery and impractical to incorporate. &lt;/p&gt;
&lt;p&gt;In social networking, connections become the endorsement of one’s personality, sociological status, economical ability and political attitude. While we cherish the trustability built upon such underwriting connections, we take the detail as privacy. The psychological comfort cannot be fulfilled with unconditional transparency. The only motivation to withdraw one’s conservation on that is to initiate a new connection, or “relation of production”. In a perfect world, not only is everyone born free and equal, but also has the same subjectivity and initiative. We cannot deny the efficiency promoted by scale effect and deep domain expertise, where division of labour naturally differentiates the population, along with the geographically and politically affected globalization. The relation of production shapes the distribution of production and beyond with free market. &lt;/p&gt;
&lt;p&gt;As the understanding and toolsets advance, things may change and should be. With machinery, we overcome the productivity bias induced by biological difference from age, sex or physiological condition. With information and communication technology, we reduce the informative decision making bias, regardless of the geographic difference on cultural awareness, development status, or knowledge access. But the further development in capitalism encourages the competitive advantage rather than the “absolute advantage” of a personal, which values more on bolder knowledge span, creativity and enthusiasm. In the competitive world, rule of limited-sum game optimizes an individual to fit into a discriminative society. Privacy inequality is thus a reflection of the sociological bias. &lt;/p&gt;
&lt;p&gt;At one glance, it seems that continue the development to increase the total sum is the silver bullet. I’d only point out the nature limit of material and energy resources won’t be easily lifted at foreseeable future. Space technology and fundamental physics will eventually be the bottleneck. But at the moment, it is the mode of distribution. There is enough food to end hunger and there is more plastic than needed. Similar to the information bias in imperfect market, the evaluation bias to monetize the ability of a person causes the inequality. It is far too early to claim any solution. But machine learning and artificial intelligence is reducing the disorder of market with informative decisions followed by rational quantitative analysis under econometrics. Heterogeneous supply and perfect information may not be a dream in the future of decentralized democracy.&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>White paper - A future imaged</title><link href="/white-paper-a-future-imaged.html" rel="alternate"></link><published>2018-11-27T00:00:00-06:00</published><updated>2018-11-27T00:00:00-06:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-11-27:/white-paper-a-future-imaged.html</id><summary type="html">&lt;div class="toc"&gt;&lt;span class="toctitle"&gt;Table of contents:&lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#manufacturing"&gt;Manufacturing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#socio-economy"&gt;Socio-economy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#techinical-roadmap"&gt;Techinical Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="manufacturing"&gt;Manufacturing&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Uncapped productivity for material abundance. Socks for example&lt;/li&gt;
&lt;li&gt;On-demand: when land in airport, pick up new socks for duration of the trip, drop off socks when return&lt;/li&gt;
&lt;li&gt;Material efficiency: socks are made with dissolving fibers, produce on-demand, recycle as needed (like 3D …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;div class="toc"&gt;&lt;span class="toctitle"&gt;Table of contents:&lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#manufacturing"&gt;Manufacturing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#socio-economy"&gt;Socio-economy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#techinical-roadmap"&gt;Techinical Roadmap&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id="manufacturing"&gt;Manufacturing&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Uncapped productivity for material abundance. Socks for example&lt;/li&gt;
&lt;li&gt;On-demand: when land in airport, pick up new socks for duration of the trip, drop off socks when return&lt;/li&gt;
&lt;li&gt;Material efficiency: socks are made with dissolving fibers, produce on-demand, recycle as needed (like 3D printing &amp;amp; material recycle), less shipping/packaging cost&lt;/li&gt;
&lt;li&gt;Energy efficiency: logistic/inventory cost is building up, compared to the scale effect from division of labor &amp;amp; mass production efficiency, under global distribution; made in China is getting more expensive, and so it will be for made in any other emerging market; Amazon will be threaten when new retail (self-service store &amp;amp; self-delivery) + local supply made cheaper with on-demand manufacturing. I.E. socks printed at airport, usb chargers re-engineer/recycle/share, old clothes redesign/recycle&lt;/li&gt;
&lt;li&gt;Customization: design, style, taste is the reflection of personality. For socks under the new manufacturing, consumers shop design/style in e-marketplace, feed their biometrics to let AI adjust to fit, modify color/material, and send to local hub for print/assemble/“bake” using 3D printing, robotic arms, biological engineering or any other techniques.&lt;/li&gt;
&lt;li&gt;Ownership rethink&lt;/li&gt;
&lt;li&gt;Benefit of privacy: we can’t share socks or undies for hygiene reasons, but more for psychological reasons, which can be solved with proper sterilization and psychological “placebos”.&lt;/li&gt;
&lt;li&gt;Benefit of convenience: my primary reason for having a car is the trunk space, to store things that feel needed but not often used. It may be replaced with modularized self-walking luggage.&lt;/li&gt;
&lt;li&gt;Affordability: we rent, when the cost of ownership is too high for the usage. But ownership comes with responsibility. We provide space, care and proper treatment for pets. Stuffs we own, will also occupy space, need regular care and proper disposal. Otherwise, the space, material and energy are wasted.&lt;/li&gt;
&lt;li&gt;Summarize&lt;/li&gt;
&lt;li&gt;Current manufacturing is not energy/material friendly. A lot of resources are dissipated/wasted in logistics: inventory, shipping, packaging.&lt;/li&gt;
&lt;li&gt;We can’t find/afford things exactly as we want in the current manufacturing model.&lt;/li&gt;
&lt;li&gt;Efficiency of logistics come with huge delivery cost.&lt;/li&gt;
&lt;li&gt;Hierarchical manufacturing hub that feed on basic materials, produce on-demand, recycle as needed, with marketplace for designs can maximize the energy utilization and ensure material abundance.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="socio-economy"&gt;Socio-economy&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Productivity supplies distribution.&lt;/li&gt;
&lt;li&gt;[old age] Autarky, self-sufficient production with limited exchange and community market.&lt;/li&gt;
&lt;li&gt;[past] Electricity lifts off labor-bias with machinery, labor cost per production drops and productivity blooms.&lt;/li&gt;
&lt;li&gt;[now] ICT lifts off information-bias with internet, market grows globally and circulation efficiency leaps with e-commerce,&lt;/li&gt;
&lt;li&gt;[future] AGI will lift off skill-bias, domain knowledge and expertise will be less dependent to produce better products and services. Any nurse with medical AI can perform high-quality diagnosis and treatment plans.&lt;/li&gt;
&lt;li&gt;Distribution shapes the socio-economy.&lt;/li&gt;
&lt;li&gt;[old age] Reputation. Culture and traditions are conventional agreements to regulate individual with the tribe, community or society&lt;/li&gt;
&lt;li&gt;[past] Power. Darwin society with expiration, monopoly and crime leads to slavery, militarism, imperialism, Fascist.&lt;/li&gt;
&lt;li&gt;[now] Network. As peaces continue, social classes consolidates, so it is with wealth distribution. Capitalism leaves less chances for the resourceless families. It compliments the elites in Wall Street and Silicon Valley but many feel anxious about the fast-changing job market and heating threats from AI powered automations. That’s how I interpret the political shifts due to the rising voice from the worried/underappreciated workers.&lt;/li&gt;
&lt;li&gt;[future] Human first, AI is mimic of human intelligence and the unprecedented computational ability should aim to enhance human. Let AGI be good at information processing and empower human to take responsibility of moral consideration, decision making, medical result delivery, providing humanize service and creativity. Follow this direction, individuals will no longer be bounded with single career/job function, to accumulate competitive advantage for financial reward. Income differences will also decrease, as personal domain knowledge and expertise cannot compete with AGI. Equality will detour individual’s interest to creativity, personal development and social good.&lt;/li&gt;
&lt;li&gt;City and community&lt;/li&gt;
&lt;li&gt;Declare&lt;ul&gt;
&lt;li&gt;The diverse possibility is the beauty of future.&lt;/li&gt;
&lt;li&gt;One man’s expectation can’t and won’t satisfy all. But such imaged future is what my technical roadmap can leads to.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Community Management&lt;ul&gt;
&lt;li&gt;Every social transaction (behavior) satisfies the consented social contract adds personal credibility on his social credit.&lt;/li&gt;
&lt;li&gt;Example: when the community agrees on sterilizing all house cats. C tells D that he feels lazy to sterilize his cat and it won’t matter. AGI notices the violation of consented social contract and lower C’s social credit correspondingly to reflect his credibility.&lt;/li&gt;
&lt;li&gt;The math behind: enforcement is hard/costly, and legislation is dangerous with central authority.&lt;/li&gt;
&lt;li&gt;The average social credit profile of the members represents the credibility of the community, which goes up to higher level of communities like city, state, continent, planet and more.&lt;/li&gt;
&lt;li&gt;Unlike black mirror - the future of social media, the enforcement is AGI automated to remove human bias.&lt;/li&gt;
&lt;li&gt;Every proposed change of social contract in the community will be voted and adopted automatically, using voice based human-information-interface.&lt;/li&gt;
&lt;li&gt;Like-minded people gather to form community, guided by democratically voted social contracts, which are registered as smart contracts on community blockchains.&lt;/li&gt;
&lt;li&gt;Example: A tells B that they should sterilize house cats and B agrees to advocate the policy to community. Wearable device with AGI automatically recognize and draft a proposal to the community. A&amp;amp;B discusses about the detail and let AGI make a campaign. Members who see the campaign may express their options, which will be collected and counted. Soon, AGI receives enough feedback and make the agreement as official social contract.&lt;/li&gt;
&lt;li&gt;The math behind: AGI can automate and decentralize legislation processes with transparency and efficiency; it is easier to understand legislation in physical world but easier to adopt in virtual world with smart contract on blockchain; one approach is to establish a decentralized identity system to evaluate individual’s social credit from TOC histories. Anyhow, a society with trust is a species will last.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Summarize&lt;/li&gt;
&lt;li&gt;Hierarchical manufacturing hub for material supply&lt;/li&gt;
&lt;li&gt;Open government powered by AGI to ensure enforcement efficiency and transparency&lt;ul&gt;
&lt;li&gt;Social contract on blockchain for legislation&lt;/li&gt;
&lt;li&gt;OMO credit system for personal credibility&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;AGI to empower people the skill/experience needed for careers, people can focus on personal fulfillment and sociological development&lt;/li&gt;
&lt;li&gt;With lower qualification requirement, equality will be easier to achieve during distribution, better humanity will be encouraged in society build with trust&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="techinical-roadmap"&gt;Techinical Roadmap&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://mindwave.business"&gt;AGI, werable human-information-interface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="/decentralize-social-credit-identification-system.html"&gt;OMO credit system, based on social contract and universal identity&lt;/a&gt;: &lt;a href="http://social-contract.domij.info"&gt;12 slides&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;Hierarchical manufacturing hub&lt;/a&gt;: technic scouting&lt;/li&gt;
&lt;li&gt;&lt;a href="/future-transportation-and-billion-population-cities.html"&gt;Future transporation and billion population cities&lt;/a&gt;: &lt;a href="/more-thoughts-on-future-transporation.html"&gt;some thoughts&lt;/a&gt;, &lt;a href="/pdfs/FlyingCar.pdf"&gt;a few breakdown slides&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><category term="articles"></category></entry><entry><title>Initiatives on Sociological Practice</title><link href="/initiatives-on-sociological-practice.html" rel="alternate"></link><published>2018-11-19T00:00:00-06:00</published><updated>2018-11-19T00:00:00-06:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-11-19:/initiatives-on-sociological-practice.html</id><summary type="html">&lt;p&gt;This is my open letter to Stephen Wolfram, who is a living inspiration. But I'm glad to share with any like-minded person, who doesn't "live the moment", who longs for the future, who cares about humanity, and so on.&lt;/p&gt;
&lt;p&gt;I’m always anxious, about people’s lack of first principle …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is my open letter to Stephen Wolfram, who is a living inspiration. But I'm glad to share with any like-minded person, who doesn't "live the moment", who longs for the future, who cares about humanity, and so on.&lt;/p&gt;
&lt;p&gt;I’m always anxious, about people’s lack of first principle thinking, the reckless to the environmental and sociological consequences. &lt;/p&gt;
&lt;p&gt;Humanity and Human Intelligence are beautiful myth, that lifts homo species off the biological evolution track, into the fast track of sociological evolution. We advance so fast in science, technology and social organization in the scope of earth history, which drains the nature resources exponentially. From animal power, to chemical power, to nuclear power, the ability of energy utilization marks our level of civilization. The increase of productivity, also shifts the political landscape by socio-economy effects. &lt;/p&gt;
&lt;p&gt;In the new era of ICT and AGI, a new scope, computation consumption per person, may rise as a new indicator to better segment our development stage. Despite the excitement, in front we face global warming and the subsequent natural disaster, unintended simplification of ecosystem and subsequent fatal plague due to globalization, foreseeable energy crisis &amp;amp; waste cycling &amp;amp; astronomical events, not even to mention the growing inequality in wealth distribution &amp;amp; jobless &amp;amp; fear of jobless &amp;amp; evil AI...&lt;/p&gt;
&lt;p&gt;Selfishly, I don’t want to live in such a future, nor for my future generations. Nuclear fusion, AGI can power the productivity and economic growth further more, but not if the humanity fall due to the sociological consequences. That’s what puzzles me over the years. I have decided to develop a few approaches in hope to solve that. I haven’t lived a comfortable moment yet, as a second born from a farmer family in China, but I won’t end with a decent job for comfort. &lt;/p&gt;
&lt;p&gt;I sincerely would like your advice, on how should I validate my approaches, find resources to develop and make efforts to solve, or inspire more to work on a solution. I’d love to discuss and share my approaches in detail, which may not be fit in one plain email for all the hypothesis, experiment design, business plan, R&amp;amp;D roadmap, technical dependencies, potential obstacles and sociological consequences I’ve pictured. &lt;/p&gt;
&lt;p&gt;You may find more about me at domij.info, and really look forward to meeting you in future.&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Decentralize social credit + identification system</title><link href="/decentralize-social-credit-identification-system.html" rel="alternate"></link><published>2018-10-28T00:00:00-05:00</published><updated>2018-10-28T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-10-28:/decentralize-social-credit-identification-system.html</id><summary type="html">&lt;p&gt;This idea has been in my mind for a while. I'm worried about the potential consequence that may go north if carried out in the wrong hand. But similar things are happening already and &lt;code&gt;life always find its way&lt;/code&gt;. We won't make progress without bearing risks. And I hold faith …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This idea has been in my mind for a while. I'm worried about the potential consequence that may go north if carried out in the wrong hand. But similar things are happening already and &lt;code&gt;life always find its way&lt;/code&gt;. We won't make progress without bearing risks. And I hold faith in collective humanity.&lt;/p&gt;
&lt;h3 id="the-project"&gt;The project&lt;/h3&gt;
&lt;p&gt;Modularized Terms and Conditions that makes legal consents clear and easy, just like grant permission for mobile apps. &lt;/p&gt;
&lt;h3 id="whats-new"&gt;What's new&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Our attention is limited and precious&lt;/li&gt;
&lt;li&gt;NLP can break down page-long legal bindings&lt;/li&gt;
&lt;li&gt;Consent to one agreement at need is easy&lt;/li&gt;
&lt;li&gt;Universal consents can be done OAFA&lt;/li&gt;
&lt;li&gt;Valued attention will help iterate agreements&lt;/li&gt;
&lt;li&gt;WE build on social contracts and universal value&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="mvp-approach"&gt;MVP approach&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;crawl Terms &amp;amp; Conditions, Privacy Policies, User Agreements over the Internet&lt;/li&gt;
&lt;li&gt;clean and unify data format&lt;/li&gt;
&lt;li&gt;train NLP model on collected data plus legal documents ad-hoc&lt;/li&gt;
&lt;li&gt;topic model each sentence/paragraph for all the files&lt;/li&gt;
&lt;li&gt;term/topic weight based on similarity/quote or page-ranking methods&lt;/li&gt;
&lt;li&gt;generate first version of modularized terms and conditions&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="use-case-example"&gt;Use case example&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;free dev API for website/software/service developers to quote and assemble their initial legal documents.&lt;/li&gt;
&lt;li&gt;free user API for consents management and authorization management.&lt;/li&gt;
&lt;li&gt;paid underwriting service for any potential cost in litigation.&lt;/li&gt;
&lt;li&gt;smart contract of user-consent-provider on blockchain to make it decentralized.&lt;/li&gt;
&lt;li&gt;decentralization will make terms and conditions more standardized. &lt;/li&gt;
&lt;li&gt;unique identification based on time-stamped consent history built upon blockchain. &lt;/li&gt;
&lt;li&gt;digitize paper-based legal system.&lt;/li&gt;
&lt;li&gt;regulate virtual behavior of any entity with the social impact of an universal identification system.&lt;/li&gt;
&lt;li&gt;legislation made easy with true votes backed by decentralized social credit system, from personal social credit, to community social credit, regional social credit and more. &lt;/li&gt;
&lt;li&gt;rebuild democracy with the spirit of social contract based on each citizen. &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you have the same interest, or would like to take it off with some sustainable business plan only for practical reason, I'm here to share my 2 cents. At the moment, I will be taking responsibility of my share holders on a career to enhance humanity with technical assistance.&lt;/p&gt;
&lt;h3 id="some-pitch-words"&gt;Some Pitch words&lt;/h3&gt;
&lt;p&gt;The constitution of unites states is one of the most inspiring achievements in human civilization, especially at this decisive moment of history. &lt;/p&gt;
&lt;p&gt;I’m bringing an approach towards decentralized democracy to help re-craft social contracts (pointed out by Jean Rousseau) that shape the modern society. &lt;/p&gt;
&lt;p&gt;I want to launch a NGO project for decentralized democracy. &lt;/p&gt;
&lt;p&gt;Start by building a system that provides standard/modular terms and conditions for suppliers/ dev teams to quote and manage users’ consents. So that user only need to read and consent new additional terms at need and dev teams can save effort on legal concern. Just like permission to photos is only required when you want to send a picture in the app. &lt;/p&gt;
&lt;p&gt;On the other side, the unique time-stamped user consents in our system can become an identity that is hard to compromise. It will be extended into physical world for any agreement, marriage vow, or security check to transform ethical bonding into a measurable social contract. In which, will evolve and expand to be community rules, cultural traditions, national constitution and universal value. &lt;/p&gt;
&lt;p&gt;I will demonstrate how to build this system with natural language processing plus blockchain techniques, with features like “learning” curve and Page ranking to let the community to balance and involve in the legislation of a decentralized social credit system, which I hope will be a Renaissance of the United States constitution.&lt;/p&gt;
&lt;h3 id="ps"&gt;PS&lt;/h3&gt;
&lt;p&gt;You may support by sharing your thoughts with twitter trend #changeTOC&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Lessons that every startup should learn early</title><link href="/lessons-that-every-startup-should-learn-early.html" rel="alternate"></link><published>2018-10-18T00:00:00-05:00</published><updated>2018-10-18T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-10-18:/lessons-that-every-startup-should-learn-early.html</id><summary type="html">&lt;p&gt;These are my notes learned from reading. I would have done many things differently. There is no rush to broadcast one's eager and anxiety at start. The real service and product that may help make a difference is what one should really aim on. &lt;/p&gt;
&lt;p&gt;I will stop twittering or posting …&lt;/p&gt;</summary><content type="html">&lt;p&gt;These are my notes learned from reading. I would have done many things differently. There is no rush to broadcast one's eager and anxiety at start. The real service and product that may help make a difference is what one should really aim on. &lt;/p&gt;
&lt;p&gt;I will stop twittering or posting on LinkedIn as there is nothing needs to prove yet. The work will prove the value itself and I can do it, just with a few really good friends who share the same ambition. That's enough to start. Anything add-on will be extra, but it's not the main cause to chase for. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.startupschool.org/library"&gt;Startup school library&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.ycombinator.com/ycs-essential-startup-advice/#footnote7"&gt;The Pocket Guide of Essential YC Advice&lt;/a&gt;, Michael&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Launch now&lt;/li&gt;
&lt;li&gt;Build something people want&lt;/li&gt;
&lt;li&gt;Do things that don’t scale&lt;/li&gt;
&lt;li&gt;Find the 90 / 10 solution&lt;/li&gt;
&lt;li&gt;Find 10-100 customers who love your product&lt;/li&gt;
&lt;li&gt;All startups are badly broken at some point&lt;/li&gt;
&lt;li&gt;Write code – talk to users&lt;/li&gt;
&lt;li&gt;“It’s not your money”&lt;/li&gt;
&lt;li&gt;Growth is the result of a great product not the precursor&lt;/li&gt;
&lt;li&gt;Don’t scale your team/product until you have built something people want&lt;/li&gt;
&lt;li&gt;Valuation is not equal to success or even probability of success&lt;/li&gt;
&lt;li&gt;Avoid long negotiated deals with big customers if you can&lt;/li&gt;
&lt;li&gt;Avoid big company corporate development queries – they will only waste time&lt;/li&gt;
&lt;li&gt;Avoid conferences unless they are the best way to get customers&lt;/li&gt;
&lt;li&gt;Pre-product market fit – do things that don’t scale: remain small/nimble&lt;/li&gt;
&lt;li&gt;Startups can only solve one problem well at any given time&lt;/li&gt;
&lt;li&gt;Founder relationships matter more than you think&lt;/li&gt;
&lt;li&gt;Sometimes you need to fire your customers (they might be killing you)&lt;/li&gt;
&lt;li&gt;Ignore your competitors, you will more likely die of suicide than murder&lt;/li&gt;
&lt;li&gt;Most companies don’t die because they run out of money&lt;/li&gt;
&lt;li&gt;Be nice! Or at least don’t be a jerk&lt;/li&gt;
&lt;li&gt;Get sleep and exercise – take care of yourself&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://paulgraham.com/ds.html"&gt;Do Things That Don't Scale&lt;/a&gt;, Paul
- recruit users manually
- weekly growth rate
- insanely attention to users
- pull a Meraki: manually manufacture 
- launch doesn't matter
- Partnerships too usually don't work&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In the best case, both components of the vector contribute to your company's DNA: the unscalable things you have to do to get started are not merely a necessary evil, but change the company permanently for the better. If you have to be aggressive about user acquisition when you're small, you'll probably still be aggressive when you're big. If you have to manufacture your own hardware, or use your software on users' behalf, you'll learn things you couldn't have learned otherwise. And most importantly, if you have to work hard to delight users when you only have a handful of them, you'll keep doing it when you have a lot.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://ycombinator.wpengine.com/how-not-to-fail/"&gt;Jessica Livingston’s Pretty Complete List on How Not to Fail
&lt;/a&gt;, Jessica&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make something people want.&lt;/li&gt;
&lt;li&gt;Stay focused.&lt;/li&gt;
&lt;li&gt;Don’t worry about being a woman. &lt;code&gt;in our case: don't underestimate woman&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Measure your growth.&lt;/li&gt;
&lt;li&gt;Know if you’re default alive.&lt;/li&gt;
&lt;li&gt;Keep expenses low.&lt;/li&gt;
&lt;li&gt;Fund-raising gets harder. Series A investors are looking for performance. &lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote&gt;
&lt;p&gt;If you start by making something people actually want, focus on making users happy, make sure you have a good growth rate and don’t over-hire, you’ll be in a very happy position. You will be master of your own fate in a way that very few people ever get to be.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Do not be distracted on these
- “Grabbing coffee” with investors
- Talking with potential acquires
- Networking
- Recruiting boards of advisors
- Doing a “partnership,” thinking it will get you more users
- Spending time on PR before you have made something people want
- Arguing on social media
- Going to conferences
- Worrying about being a woman in tech&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.michaelseibel.com/blog/users-you-don-t-want"&gt;Users You don't want&lt;/a&gt;, Michael&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;small group may deviate your focus&lt;/li&gt;
&lt;li&gt;evaluate the need but don't ignore it&lt;/li&gt;
&lt;li&gt;prioritize and say no&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://blog.geoffralston.com/startup-priorities"&gt;Startup Priorities&lt;/a&gt;, Geoff&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ask how should I be spending my time: product and customer satisfaction in my case&lt;/li&gt;
&lt;li&gt;Choose a key metric to track and focus exclusively on making that metric grow: average use time&lt;/li&gt;
&lt;li&gt;choose the activity that you believe will directly result in increased growth of your chosen metric&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A simple metric: $(b * d) / c$&lt;/p&gt;
&lt;p&gt;$b$ tells you how many of your users, current or new, will be impacted by a new feature, $d$ describes how important that feature will be to the average user, and $c$ gives you how hard it is to build the feature. Just like MVP for each phase.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href="https://ycombinator.wpengine.com/how-to-raise-a-seed-round/"&gt;how to raise a seed round&lt;/a&gt;, Geoff&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;bootstrap or seed round&lt;/p&gt;
&lt;p&gt;why&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;cash for grow&lt;/li&gt;
&lt;li&gt;war chest&lt;ul&gt;
&lt;li&gt;hiring key staff&lt;/li&gt;
&lt;li&gt;public relations&lt;/li&gt;
&lt;li&gt;marketing&lt;/li&gt;
&lt;li&gt;sales&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;brutal: long, arduous, complex, ego deflating&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;when: usually when you can, you should&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;story and reputation&lt;/li&gt;
&lt;li&gt;idea, product, some amount of customer adoptions&lt;/li&gt;
&lt;li&gt;product market fit&lt;/li&gt;
&lt;li&gt;growth rate of 10% per week for several weeks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;how much to raise&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;best: raise once and for all, avoid more than 25%&lt;/li&gt;
&lt;li&gt;second: follow-on round&lt;/li&gt;
&lt;li&gt;create multiple plans assuming different amounts&lt;/li&gt;
&lt;li&gt;set an essential amount to succeed, aim for faster grow&lt;/li&gt;
&lt;li&gt;how many months of operation&lt;ul&gt;
&lt;li&gt;$15k per month for an engineer&lt;/li&gt;
&lt;li&gt;18 month&lt;/li&gt;
&lt;li&gt;you are raising for N months (usually 12-18) and will thus need $X, where X will usually be between $500k and $1.5 million.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Financing options: First comes a seed round, then a Series A, then a Series B, then a Series C, and so on to acquisition or IPO&lt;/p&gt;
&lt;p&gt;Most seed rounds, at least in Silicon Valley, are now structured as either convertible debt or simple agreements for future equity (safes)&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Convertible Debt: loan with interest rate + maturity date&lt;ul&gt;
&lt;li&gt;it converts to equity (thus, “convertible”) when the company does an equity financing&lt;/li&gt;
&lt;li&gt;usually have a “Cap” or “Target Valuation” and / or a discount&lt;/li&gt;
&lt;li&gt;A Cap is the maximum effective valuation that the owner of the note will pay, regardless of the valuation of the round in which the note converts&lt;/li&gt;
&lt;li&gt;a discount defines a lower effective valuation via a percentage off the round valuation&lt;/li&gt;
&lt;li&gt;Convertible debt may be called at maturity, at which time it must be repaid with earned interest, although investors are often willing to extend the maturity dates on notes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Safe&lt;ul&gt;
&lt;li&gt;A safe acts like convertible debt without the interest rate, maturity, and repayment requirement.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.ycombinator.com/documents/"&gt;safe primer&lt;/a&gt; by YC&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Equity&lt;ul&gt;
&lt;li&gt;setting a valuation for your company&lt;/li&gt;
&lt;li&gt;hire a lawyer when planning to issue equity&lt;/li&gt;
&lt;li&gt;dilution based on new equity&lt;/li&gt;
&lt;li&gt;equity incentive plans (option pools), liquidation preferences, anti-dilution rights, protective provisions, and more.&lt;/li&gt;
&lt;li&gt;always best to use well-known financing documents like YC’s safe. These documents are well understood by the investor community, and have been drafted to be fair, yet founder friendly.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Valuation&lt;ul&gt;
&lt;li&gt;let the market set your price and to find an investor to set the price or cap&lt;/li&gt;
&lt;li&gt;The more investor interest your company generates, the higher your value will trend.&lt;/li&gt;
&lt;li&gt;not to over-optimize&lt;/li&gt;
&lt;li&gt;find a valuation with which you are comfortable&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Investors: Angels &amp;amp; VC&lt;ul&gt;
&lt;li&gt;angels are amateurs and VCs are pros&lt;/li&gt;
&lt;li&gt;faster and more mature&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Documents needed&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Your company / Logo / Tag Line&lt;/li&gt;
&lt;li&gt;Your Vision – Your most expansive take on why your new company exists.&lt;/li&gt;
&lt;li&gt;The Problem – What are you solving for the customer–where is their pain?&lt;/li&gt;
&lt;li&gt;The Customer – Who are they and perhaps how will you reach them?&lt;/li&gt;
&lt;li&gt;The Solution – What you have created and why now is the right time.&lt;/li&gt;
&lt;li&gt;The (huge) Market you are addressing – Total Available Market (TAM) &amp;gt;$1B if possible. Include the most persuasive evidence you have that this is real.&lt;/li&gt;
&lt;li&gt;Market Landscape – including competition, macro trends, etc. Is there any insight you have that others do not?&lt;/li&gt;
&lt;li&gt;Current Traction – list key stats / plans for scaling and future customer acquisition.&lt;/li&gt;
&lt;li&gt;Business model – how users translate to revenue. Actuals, plans, hopes.&lt;/li&gt;
&lt;li&gt;Team – who you are, where you come from and why you have what it takes to succeed. Pics and bios okay. Specify roles.&lt;/li&gt;
&lt;li&gt;Summary – 3-5 key takeaways (market size, key product insight, traction)&lt;/li&gt;
&lt;li&gt;Fundraising – Include what you have already raised and what you are planning to raise now. Any financial projections may go here as well. You can optionally include a summary product roadmap (6 quarters max) indicating what an investment buys.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Fundraising Rules to Follow&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get fundraising over as soon as possible, and get back to building your product and company, but also…&lt;/li&gt;
&lt;li&gt;Don’t stop raising money too soon. If fundraising is difficult, keep fighting and stay alive.&lt;/li&gt;
&lt;li&gt;When raising, be “greedy”: breadth-first search weighted by expected value 2. This means talk to as many people as you can, prioritizing the ones that are likely to close.&lt;/li&gt;
&lt;li&gt;Once someone says yes, don’t delay. Get docs signed and the money in the bank as soon as possible.&lt;/li&gt;
&lt;li&gt;Always hustle for leads. If you are the hottest deal of the hour, that’s great, but everyone else needs to work like crazy to get angels and other venture investors interested.&lt;/li&gt;
&lt;li&gt;Never screw anyone over. Hold yourself and others on your team to the highest ethical standards. The Valley is a very small place, and a bad reputation is difficult to repair. Play it straight and you will never regret it. You’ll feel better for it, too.&lt;/li&gt;
&lt;li&gt;Investors have a lot of different ways to say no. The hardest thing for an entrepreneur is understanding when they are being turned down and being okay with it. PG likes to say, “If the soda is empty, stop making that awful sucking sound with the straw.” But remember that they might be a “yes” another time, so part on the best possible terms.&lt;/li&gt;
&lt;li&gt;Develop a style that fits you and your company.&lt;/li&gt;
&lt;li&gt;Stay organized. Co-founders should split tasks where possible. If necessary, use software like Asana to keep track of deals.&lt;/li&gt;
&lt;li&gt;Have a thick skin but strike the right balance between confidence and humility. And never be arrogant.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;DON’T:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Be dishonest in any way&lt;/li&gt;
&lt;li&gt;Be arrogant or unfriendly&lt;/li&gt;
&lt;li&gt;Be overly aggressive&lt;/li&gt;
&lt;li&gt;Seem indecisive – although it is okay to say you don’t know yet.&lt;/li&gt;
&lt;li&gt;Talk so much they cannot get a word in edgewise&lt;/li&gt;
&lt;li&gt;Be slow to follow-up or close a deal&lt;/li&gt;
&lt;li&gt;Break an agreement, verbal or written&lt;/li&gt;
&lt;li&gt;Create detailed financials&lt;/li&gt;
&lt;li&gt;Use ridiculous / silly market size numbers without clear justification&lt;/li&gt;
&lt;li&gt;Claim you know something that you don’t or be afraid to say you don’t know&lt;/li&gt;
&lt;li&gt;Spend time on the obvious&lt;/li&gt;
&lt;li&gt;Get caught up in unimportant minutiae – don’t let the meeting get away from you&lt;/li&gt;
&lt;li&gt;Ask for an NDA&lt;/li&gt;
&lt;li&gt;Try to play investors off each other when you are not a fundraising ninja&lt;/li&gt;
&lt;li&gt;Try to negotiate in real-time&lt;/li&gt;
&lt;li&gt;Over-optimize your valuation or worry too much about dilution&lt;/li&gt;
&lt;li&gt;Take a “No” personally&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://www.paulgraham.com/mean.html"&gt;mean people fail&lt;/a&gt;, Paul&lt;/p&gt;
&lt;p&gt;Successful founders are usually good people&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.ycombinator.com/three-paths-in-the-tech-industry-founder-executive-or-employee/"&gt;paths in tech industry&lt;/a&gt;, Michael&lt;/p&gt;
&lt;p&gt;founder, executive, and employee&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Strategy for People Who Want to be Founders&lt;/strong&gt;
Your initial goal is to accumulate the prerequisites to being a founder.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Identify potential teammates you can work with who have the required technical skills to help you build your MVP.&lt;/li&gt;
&lt;li&gt;Figure out the financial plan. I.e. Do you have enough money in savings, do you have friends/family who can provide seed investment, can you bootstrap, can you reduce your spending and save enough give yourself 6-12 months to work on your idea?&lt;/li&gt;
&lt;li&gt;Identify a problem that you and your potential teammates are passionate about solving.&lt;/li&gt;
&lt;li&gt;The least important (but still required) is having an idea on how of how to solve the problem.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="https://playbook.samaltman.com/#ceo"&gt;startup playbook&lt;/a&gt; Sam&lt;/p&gt;
&lt;p&gt;&lt;a href="http://startupclass.samaltman.com/courses/lec18/"&gt;Lecture 18: Legal and Accounting Basics for Startups&lt;/a&gt;, Kirsty, Carolynn&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;sign the purchase agreement&lt;/li&gt;
&lt;li&gt;83 (b)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;vesting, for the long haul&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;seed round: conversion notes, safes, no voting rights, cap&lt;/li&gt;
&lt;li&gt;board seats: choose wisely, must add value&lt;/li&gt;
&lt;li&gt;adviser: investor is de facto adviser&lt;/li&gt;
&lt;li&gt;Pro-rata rights: rights to maintain percentage ownership&lt;/li&gt;
&lt;li&gt;Information right: monthly update&lt;/li&gt;
&lt;li&gt;company expenses&lt;ul&gt;
&lt;li&gt;separate and spend wisely&lt;/li&gt;
&lt;li&gt;bookkeeping the documents for tax&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;founder employment&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;set-up payroll service&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;worker's compensation insurance&lt;/li&gt;
&lt;li&gt;pay salaries&lt;/li&gt;
&lt;li&gt;minimum wage: $2000&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;hiring employees&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;working right in US&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;employee: responsible for taxes&lt;/li&gt;
&lt;li&gt;contractor: consulting contract, 1099, not responsible for taxes&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IP assignment&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;fire employees&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;fire quickly and professionally&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;communicate clearly: we're letting you go&lt;/li&gt;
&lt;li&gt;3rd party&lt;/li&gt;
&lt;li&gt;pay the wage&lt;/li&gt;
&lt;li&gt;repurchase unvested stocks&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;legitimacy&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;CPA: tax return
Lawyers: use standard forms first&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.adoracheung.com/technical-co-founder"&gt;technical co-founder&lt;/a&gt; Adora&lt;/p&gt;
&lt;p&gt;Make a firm offer. If you don’t have money for salary and/or that person has no outside commitments requiring salary, then propose 50/50 equity split.&lt;/p&gt;
&lt;p&gt;Lastly, when you identify the right person. Instead of pitching them directly your idea. Brainstorm ideas with that person so it evolves with the both of you. This will be a good start to a hopefully lasting relationship of building together.&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>More thoughts on Future Transporation</title><link href="/more-thoughts-on-future-transporation.html" rel="alternate"></link><published>2018-10-17T00:00:00-05:00</published><updated>2018-10-17T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-10-17:/more-thoughts-on-future-transporation.html</id><summary type="html">&lt;p&gt;Sometimes I just feel that self-driving car is too in-box thinking. @boringcompany might be more practical for its top-down design that reduces computations into realistic scale. CV &amp;amp; Lidar are comp-expensive, not to mention the scheduling that scale with N^2.&lt;/p&gt;
&lt;p&gt;If we add the complexity of delay control, the system …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Sometimes I just feel that self-driving car is too in-box thinking. @boringcompany might be more practical for its top-down design that reduces computations into realistic scale. CV &amp;amp; Lidar are comp-expensive, not to mention the scheduling that scale with N^2.&lt;/p&gt;
&lt;p&gt;If we add the complexity of delay control, the system will be chaotic like the failure of jurassic park. Plus, any malfunction in the system will probably be a costly issue that no society can afford.&lt;/p&gt;
&lt;p&gt;If it's only used in out-of-city transportation, then bullet train and @hyperloop will be more appealing. Of course, I enjoy the flexible #trunk space. What if we can modularize that and make it easy to plug?&lt;/p&gt;
&lt;p&gt;What I really want to sell here is that, road is only 2 dimensional space that has limited capacity. We should utilize the airspace! I'm not talking about #FlyingCars by @TerrafugiaInc or #JetPack. They will fall and fail. And that will scare the world like #Concorde.&lt;/p&gt;
&lt;p&gt;And the computation scale will be no less than self-driving cars. #KardashevScale is a measure of civilization's level of technological advancement based on energy usage. We should add sub scales based on the computation usage per person. @PeterDiamandis&lt;/p&gt;
&lt;p&gt;Okay. Back to airspace usage, we can think in these directions, 1. separate power unit and passenger space, 2. use guided rails for power unit (top-down self-drive system), 3. let passenger capsule fly like a glider towed by the power unit. @elonmusk #FutureTransportation&lt;/p&gt;
&lt;p&gt;The benefits are, 1. safer, glider can crash land and there is also a string to hang on; 2. rail for power unit is cheap to build and maintain (the weight load will be offset by lifting); 3. modularize capsules are simple and cheap with no complex control system needed; 4. we won't need to get down to ground anymore, only way towards billion-population city built vertically; 5. easy to adopt in #SpaceSettlement, you may need this on the #MarsColony, @elonmusk; 6. inspirational and worthy to pass on to the future generation.&lt;/p&gt;
&lt;p&gt;What else? The scale will be like 10 FLOPD (flops per day) avg before calculator invented, 10^2 FLOPD before transistors invented, then it goes viral based on Moore's law.&lt;/p&gt;
&lt;p&gt;From radio/DVD, to gaming console/computers, until smartphone with cloud service, our consumption of computational power is increasing exponentially, even faster than Moore's law with so many #SaaS and even #HaaS, hardware as a service like what we do in MindWave.&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Birth of MindWave X</title><link href="/birth-of-mindwave-x.html" rel="alternate"></link><published>2018-10-13T00:00:00-05:00</published><updated>2018-10-13T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-10-13:/birth-of-mindwave-x.html</id><summary type="html">&lt;p&gt;&lt;a href="https://mindwave.business"&gt;&lt;img alt="" src="/images/MindWaveX.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To many young entrepreneurs, Y Combinator is the dream place to launch startups. I didn't know anything, not the startup schools, not the Hacker News, not the Office Hours, not the YC partners. I signed up the YC Hack 2018 just like a Texan town boy, without too many thoughts …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://mindwave.business"&gt;&lt;img alt="" src="/images/MindWaveX.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;To many young entrepreneurs, Y Combinator is the dream place to launch startups. I didn't know anything, not the startup schools, not the Hacker News, not the Office Hours, not the YC partners. I signed up the YC Hack 2018 just like a Texan town boy, without too many thoughts. &lt;/p&gt;
&lt;p&gt;Things start to heat up when I joined the Slack, where like-minds start to pitch their ideas and put up their profiles. So I did the same thing and hoping to get some connections with the silicon valley people. Nothing much happened. &lt;/p&gt;
&lt;p&gt;10/04/2018, it was a normal day in Texas, hot and sunny, when I drove from Brownsville to Austin for a flight to San Jose. The 24 hour journey is a mind-blower. I met with these two Denmark cowboys, who hacked a way to store data on blockchain with 5% of the normal gas fee. There are so many flaws in many of the picked projects but all those teams did very impressive delivery of some products or services. There is no cash award except for an interview with YC and some office hour, which I realized later on that it is exactly what a successful company needs, a good team with execution skills. &lt;/p&gt;
&lt;p&gt;I didn't learn it that night and my ego is really somewhat annoying to others. But I also didn't stick to my plan and make it a go, as I feel tired of being the idea source plus the doer. There is no easy path as hitchhiking and everything I want have to be earned by own effort. &lt;/p&gt;
&lt;p&gt;It is never late to take the lesson and here I am, as the founder of &lt;a href="https://mindwave.business"&gt;MindWave&lt;/a&gt; after one week. The initial plot is interestingly simple and attractive so that many have approached me to carry it on. &lt;/p&gt;
&lt;!-- But until later that I realize that none of them really understand the potential and how to properly do it right.  --&gt;
&lt;!-- There is some magic from my co-founder that even though I'm unhappy that I have to explain everything from technical details to vision map, he pushed me to continue and stick on. I have never speak out so much that everything I want to do starts to shape and sound.  --&gt;

&lt;p&gt;There is no other moment that cheers me up so much to work continuously with full passion and inspiration. Every step makes it closer to real and there is just no foreseeable limit of this journey that will drain my creativity. &lt;/p&gt;
&lt;p&gt;Here I present, Mind Wave, a company that delivers the best of assistance to human intelligence.&lt;/p&gt;
&lt;p&gt;We believe that &lt;strong&gt;Human Intelligence should come first&lt;/strong&gt;. As human is still more intelligent and AI should aim to enhance that. AI is the new electricity but we will be the Renaissance of the revolution. &lt;/p&gt;
&lt;h3 id="request-for-partnership"&gt;Request for Partnership&lt;/h3&gt;
&lt;p&gt;At MindWave, we seek to build an approach to understand the most intuitive and direct reflection of human intelligence, speech and conversations. &lt;/p&gt;
&lt;p&gt;By providing Hardware as a Service, we will act as the upstream of human-internet interface that not only enhance your communication skills but also unprecedented add-on values to access, interact and understand informations. &lt;/p&gt;
&lt;p&gt;From augmented intelligence, to artificial intelligence, MindWave will transform the world to rethink about data, device and intelligence. &lt;/p&gt;
&lt;p&gt;We are a Y Combinator project, launching our first prototype by the end of October, with mapped out path towards marketing, Research and development with continuous revenue generation plan. &lt;/p&gt;
&lt;p&gt;We are looking for Partnerships that can share our vision and help expedite our mission towards the Tomorrowland of Human Intelligence. &lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Thoughts on Artificial Intelligence and Natural Language Processing</title><link href="/thoughts-on-artificial-intelligence-and-natural-language-processing.html" rel="alternate"></link><published>2018-09-19T00:00:00-05:00</published><updated>2018-09-19T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-09-19:/thoughts-on-artificial-intelligence-and-natural-language-processing.html</id><summary type="html">&lt;p&gt;My experience of AI/NLP research and development is limited compared to HPC and data analysis. During my summer intern as R&amp;amp;D in NLP/query understanding, I studied linguistics and implemented the stoke and order into Chinese NLP, based on its nature as a logographic system. Time will reveal …&lt;/p&gt;</summary><content type="html">&lt;p&gt;My experience of AI/NLP research and development is limited compared to HPC and data analysis. During my summer intern as R&amp;amp;D in NLP/query understanding, I studied linguistics and implemented the stoke and order into Chinese NLP, based on its nature as a logographic system. Time will reveal that even though computer programming is highly based on English, AI/NLP may work better in a different language system, which will have the elegant simplicity of mathematics and abundant expressiveness in Chinese. &lt;/p&gt;
&lt;p&gt;Back to practice, I have been studying word embeddings like word2vec, and then utilize them for specific linguistic tasks like NER/POS with supervised LSTM + CRF model, or unsupervised models for topic modeling, text summary, etc. From my bilingual background, I realize that knowledge base could be further validated or expanded by multi-languages. I am also interested in the similarity between state-space model and neural network model. Despite the magic non-linearity from activation function, both are seeking optimal/equilibrium with updating techniques based on gradient (and chain rule). The advance of AI/NLP is thus mainly the result of Higher Performance Computing. Leapfrog, MCMC, gradient descent, SGD, batch updating or so are still some compromise regarding to high dimensional parameter space iteration, given the ever-increasing computation power. &lt;/p&gt;
&lt;p&gt;Nevertheless, data quality is very important at the moment and it's the cornerstone for commercial products, depending on/deciding the use case and market focus.&lt;/p&gt;
&lt;p&gt;These are my 2 cents about AI/NLP. I also have some thoughts on data acquisition and business model waiting to develop. &lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Quickguide to start a static website with Pelican</title><link href="/quickguide-to-start-a-static-website-with-pelican.html" rel="alternate"></link><published>2018-09-01T00:00:00-05:00</published><updated>2018-09-01T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-09-01:/quickguide-to-start-a-static-website-with-pelican.html</id><summary type="html">&lt;p&gt;There are many options to build a website. My reason to use Pelican is because&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It's open sourced at &lt;a href="https://github.com/getpelican/pelican"&gt;github/pelican&lt;/a&gt;, with many &lt;a href="https://github.com/getpelican/pelican-plugins"&gt;plugins&lt;/a&gt; and &lt;a href="http://www.pelicanthemes.com/"&gt;themes&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;I want to get my website up and running in one week.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you are familiar with Python and markdown, the &lt;a href="http://docs.getpelican.com/en/stable/quickstart.html"&gt;Quickstart&lt;/a&gt; provides enough …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There are many options to build a website. My reason to use Pelican is because&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It's open sourced at &lt;a href="https://github.com/getpelican/pelican"&gt;github/pelican&lt;/a&gt;, with many &lt;a href="https://github.com/getpelican/pelican-plugins"&gt;plugins&lt;/a&gt; and &lt;a href="http://www.pelicanthemes.com/"&gt;themes&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;I want to get my website up and running in one week.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you are familiar with Python and markdown, the &lt;a href="http://docs.getpelican.com/en/stable/quickstart.html"&gt;Quickstart&lt;/a&gt; provides enough instruction to get started. Here I'm putting together the commands and adding some extra plugins for making this website. &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: Essentially, Pelican converts text files into HTML files, just like &lt;code&gt;pandoc&lt;/code&gt;. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;TOC&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="#install"&gt;Get started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#files"&gt;File structure&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#theme"&gt;Themes&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#setup"&gt;Setups&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#dev"&gt;Developing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#hellomd"&gt;Write the first article&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#plugin"&gt;Add plugins&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#tricks"&gt;Useful tricks&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="get-started"&gt;&lt;a name="install"&gt; Get started &lt;/a&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# installation&lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;pelican&lt;span class="w"&gt; &lt;/span&gt;markdown

&lt;span class="c1"&gt;# start a project&lt;/span&gt;
mkdir&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;~/projects/yoursite&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# make sure there is no special character in the path to your project&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/projects/yoursite
pelican-quickstart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For questions that have default values denoted in brackets, feel free to use the Return key to accept those default values. Don't worry too much. Most of the values are stored in &lt;code&gt;pelicanconf.py&lt;/code&gt; and &lt;code&gt;publishconf.py&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id="file-structure"&gt;&lt;a name="files"&gt; File structure &lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Here is an example of the file structure for a demo project. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;.
├──&lt;span class="w"&gt; &lt;/span&gt;Makefile&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# use `make help` for manual, it is very self-descriptive &lt;/span&gt;
├──&lt;span class="w"&gt; &lt;/span&gt;content
│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;articles&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# folder for blog articles&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;hello.md
│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;pdfs&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# local pdfs to include in articles&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;file.pdf
│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;images&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# local images to include in articles&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;picture.png
│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;pages&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# front pages like About Me, Research&lt;/span&gt;
│&lt;span class="w"&gt;       &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;Research.md
│&lt;span class="w"&gt;       &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;About&lt;span class="w"&gt; &lt;/span&gt;Me.md
├──&lt;span class="w"&gt; &lt;/span&gt;develop_server.sh&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# script to control a local pelican server, i.e. on a RPi&lt;/span&gt;
├──&lt;span class="w"&gt; &lt;/span&gt;fabfile.py&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# script to control a remote server by Fabric&lt;/span&gt;
├──&lt;span class="w"&gt; &lt;/span&gt;output&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# output of html files&lt;/span&gt;
│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;...
│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;...
├──&lt;span class="w"&gt; &lt;/span&gt;pelicanconf.py&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# configure file based on answered values&lt;/span&gt;
└──&lt;span class="w"&gt; &lt;/span&gt;publishconf.py&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# configure only used in `make publish`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Pelican doesn't recognize HTML files in &lt;code&gt;content/pdfs&lt;/code&gt; folder at the moment. Any self-generated HTML files has to be manually copied to the &lt;code&gt;output/pdfs&lt;/code&gt; folder.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="themes"&gt;&lt;a name="themes"&gt; Themes &lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Resources&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.pelicanthemes.com/"&gt;Themes gallery&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/getpelican/pelican-themes"&gt;Github collections&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="git@github.com:Parbhat/pelican-blue.git"&gt;pelican blue&lt;/a&gt;: the one I used here.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: for many themes, the default index is defined as the list of blog articles.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;To deploy a theme:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;git clone&lt;/code&gt; the theme folder&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;pelicanconf.py&lt;/code&gt;, add &lt;code&gt;THEME = "path/to/theme"&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Or use flag when build a project, &lt;code&gt;pelican -t ~/pelican-themes/theme-name&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The basic structure of a theme folder is: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;.
├──&lt;span class="w"&gt; &lt;/span&gt;static
│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;css
│&lt;span class="w"&gt;   &lt;/span&gt;│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;pygments.css
│&lt;span class="w"&gt;   &lt;/span&gt;│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;style.css
│&lt;span class="w"&gt;   &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;images
│&lt;span class="w"&gt;   &lt;/span&gt;│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;icons
│&lt;span class="w"&gt;   &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;js
│&lt;span class="w"&gt;       &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;comments.js
└──&lt;span class="w"&gt; &lt;/span&gt;templates
&lt;span class="w"&gt;    &lt;/span&gt;├──&lt;span class="w"&gt; &lt;/span&gt;archives.html
&lt;span class="w"&gt;    &lt;/span&gt;└──&lt;span class="w"&gt; &lt;/span&gt;...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To customize or build a theme:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;modify or create new &lt;code&gt;css, js&lt;/code&gt; files and &lt;code&gt;html&lt;/code&gt; templates. &lt;/li&gt;
&lt;li&gt;&lt;code&gt;pelican-themes -i {your_theme_name}&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="setups"&gt;&lt;a name="setup"&gt; Setups &lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The complete setting list can be found at &lt;a href="http://docs.getpelican.com/en/3.6.3/settings.html"&gt;here&lt;/a&gt;. Many of which are not needed. Here I covered some setups for this website. &lt;/p&gt;
&lt;p&gt;The &lt;code&gt;pelicanconf.py&lt;/code&gt; file explained: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="c1"&gt;# some general setup&lt;/span&gt;
&lt;span class="n"&gt;SITEURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;http://localhost:8000&amp;#39;&lt;/span&gt;  &lt;span class="c1"&gt;# use the url for test/local server&lt;/span&gt;
&lt;span class="n"&gt;PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;content&amp;#39;&lt;/span&gt;  &lt;span class="c1"&gt;# path to the folder of contents&lt;/span&gt;
&lt;span class="n"&gt;STATIC_PATHS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;images&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;pdfs&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# folders to be copied to output, i.e. `images/picture.png` can be accessed by `siteurl/images/picture.png` in any articles&lt;/span&gt;
&lt;span class="n"&gt;TIMEZONE&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;America/Chicago&amp;#39;&lt;/span&gt;  &lt;span class="c1"&gt;# based on tz database&lt;/span&gt;
&lt;span class="n"&gt;MENUITEMS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Blogs&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SITEURL&lt;/span&gt;&lt;span class="p"&gt;),)&lt;/span&gt;  &lt;span class="c1"&gt;# add index into site map formed by pages&lt;/span&gt;
&lt;span class="n"&gt;THEME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;path/to/theme&amp;quot;&lt;/span&gt; 
&lt;span class="n"&gt;PLUGIN_PATHS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;path/to/plugin1&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;path/to/plugin2&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;PLUGINS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;render_math&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;deadlinks&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;photos&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;representative_image&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# see `useful plugins` section&lt;/span&gt;

&lt;span class="c1"&gt;# optional setup&lt;/span&gt;
&lt;span class="n"&gt;TWITTER_USERNAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;  &lt;span class="c1"&gt;# if using twitter related functions&lt;/span&gt;
&lt;span class="n"&gt;LINKS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Pelican&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;http://getpelican.com/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;),)&lt;/span&gt;  &lt;span class="c1"&gt;# external links&lt;/span&gt;
&lt;span class="n"&gt;SIDEBAR_DIGEST&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;FAVICON&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/images/favicon.ico&amp;#39;&lt;/span&gt;  &lt;span class="c1"&gt;# see note&lt;/span&gt;

&lt;span class="c1"&gt;# dead link options&lt;/span&gt;
&lt;span class="n"&gt;DEADLINK_OPTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="s1"&gt;&amp;#39;archive&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;&amp;#39;classes&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;custom-class1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;disabled&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="s1"&gt;&amp;#39;labels&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;   &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;&amp;#39;timeout_duration_ms&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s1"&gt;&amp;#39;timeout_is_error&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="kc"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: FAVICON is the icon &lt;img alt="" src="/images/favicon.ico"&gt; for this website, mine is made of my initials using &lt;a href="https://www.favicon-generator.org/"&gt;favicon-generator&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The &lt;code&gt;publishconf.py&lt;/code&gt; file explained: &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;SITEURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;  &lt;span class="c1"&gt;# your web domain&lt;/span&gt;
&lt;span class="n"&gt;MENUITEMS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Blogs&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SITEURL&lt;/span&gt;&lt;span class="p"&gt;),)&lt;/span&gt;  &lt;span class="c1"&gt;# add index into site map formed by pages&lt;/span&gt;
&lt;span class="n"&gt;RELATIVE_URLS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;False&lt;/span&gt;  &lt;span class="c1"&gt;# document-relative URLs, useful when developing&lt;/span&gt;

&lt;span class="c1"&gt;# feeds generation&lt;/span&gt;
&lt;span class="n"&gt;FEED_ALL_ATOM&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;feeds/all.atom.xml&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;CATEGORY_FEED_ATOM&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;feeds/&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s1"&gt;.atom.xml&amp;#39;&lt;/span&gt;
&lt;span class="n"&gt;FEED_DOMAIN&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SITEURL&lt;/span&gt;

&lt;span class="n"&gt;DELETE_OUTPUT_DIRECTORY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;  &lt;span class="c1"&gt;# delete develop cache if set in True&lt;/span&gt;

&lt;span class="n"&gt;DISQUS_SITENAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;  &lt;span class="c1"&gt;# see notes&lt;/span&gt;
&lt;span class="n"&gt;GOOGLE_ANALYTICS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;  &lt;span class="c1"&gt;# see notes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;Note:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;DISQUS: follow &lt;a href="https://kamyanskiy.github.io/2017/06/how-to-add-disqus-comments.html"&gt;guide&lt;/a&gt; to use DISQUS for commenting. Static comment plugins exist to have full control of contents. &lt;br&gt;
Google Analytics: Set to ‘UA-XXXX-YYYY’ from Google Analytics to help track traffic.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;h3 id="developing"&gt;&lt;a name="dev"&gt; Developing &lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;It is very straight-forward if you know how to read the &lt;code&gt;Makefile&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Start the server: &lt;code&gt;make devserver&lt;/code&gt; or &lt;code&gt;./develop_server.sh start&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Stop the server: &lt;code&gt;make stopserver&lt;/code&gt; or &lt;code&gt;./develop_server.sh stop&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Publish the website: &lt;code&gt;make publish&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Upload website to web server&lt;ul&gt;
&lt;li&gt;FTP: &lt;code&gt;make ftp_upload&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;ssh: &lt;code&gt;make ssh_upload&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;using &lt;a href="http://www.fabfile.org/"&gt;Fabric&lt;/a&gt;: &lt;code&gt;python fabfile.py&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="write-the-first-article"&gt;&lt;a name="hellomd"&gt; Write the first article &lt;/a&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Title: My First Article
Date: 2010-12-03 10:20
Category: Articles
Tags: tag1, tag2
Featured_image: /images/picture.png
Status: draft
Modified: 08/14/2018


Article Content In Markdown Format
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="add-plugins"&gt;&lt;a name='plugin'&gt; Add plugins &lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A collection of plugins can be found &lt;a href="https://github.com/getpelican/pelican-plugins"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Use of plugin: &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;git clone&lt;/code&gt; the plugin folder&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;pelicanconf.py&lt;/code&gt;, define &lt;code&gt;PLUGIN_PATHS&lt;/code&gt; and &lt;code&gt;PLUGINs&lt;/code&gt; as explained in &lt;a href="#setup"&gt;Setups&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;Add additional setup following special instruction of the plugin.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="useful-tricks"&gt;&lt;a name='tricks'&gt; Useful tricks &lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;copyright footer: generate &lt;a href="https://www.freeprivacypolicy.com/"&gt;free privacy policy&lt;/a&gt; and style it to protect your website&lt;/li&gt;
&lt;li&gt;render_math: support math in markdown&lt;/li&gt;
&lt;li&gt;representative_image: extracts a representative image (i.e, featured image) from the article's summary or content.&lt;/li&gt;
&lt;li&gt;pin_to_top: pin an article to top&lt;/li&gt;
&lt;/ul&gt;</content><category term="cheatsheets"></category></entry><entry><title>PPTP on OS X Just One Last Time</title><link href="/pptp-on-os-x-just-one-last-time.html" rel="alternate"></link><published>2018-08-14T00:00:00-05:00</published><updated>2018-08-14T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-08-14:/pptp-on-os-x-just-one-last-time.html</id><summary type="html">&lt;p&gt;TL;DR manual for connecting to PPTP VPN on a MacBook, summarized by &lt;a href="http://domij.info"&gt;Dongming Jin&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;## 1. create the PPTP configuration&lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;/etc/ppp/peers&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;cat&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;lt;&amp;lt;EOF &amp;gt; /etc/ppp/peers/pptpvpn&lt;/span&gt;
&lt;span class="s"&gt;plugin PPTP.ppp&lt;/span&gt;
&lt;span class="s"&gt;noauth&lt;/span&gt;
&lt;span class="s"&gt;remoteaddress xxx.xxx.xxx.xxx  # address of the VPN server, in my case: 23 …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;TL;DR manual for connecting to PPTP VPN on a MacBook, summarized by &lt;a href="http://domij.info"&gt;Dongming Jin&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;## 1. create the PPTP configuration&lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;/etc/ppp/peers&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;cat&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;lt;&amp;lt;EOF &amp;gt; /etc/ppp/peers/pptpvpn&lt;/span&gt;
&lt;span class="s"&gt;plugin PPTP.ppp&lt;/span&gt;
&lt;span class="s"&gt;noauth&lt;/span&gt;
&lt;span class="s"&gt;remoteaddress xxx.xxx.xxx.xxx  # address of the VPN server, in my case: 23.24.218.210&lt;/span&gt;
&lt;span class="s"&gt;redialcount 1&lt;/span&gt;
&lt;span class="s"&gt;redialtimer 5&lt;/span&gt;
&lt;span class="s"&gt;idle 1800&lt;/span&gt;
&lt;span class="s"&gt;mru 1368&lt;/span&gt;
&lt;span class="s"&gt;mtu 1368&lt;/span&gt;
&lt;span class="s"&gt;receive-all&lt;/span&gt;
&lt;span class="s"&gt;novj 0:0&lt;/span&gt;
&lt;span class="s"&gt;ipcp-accept-local&lt;/span&gt;
&lt;span class="s"&gt;ipcp-accept-remote&lt;/span&gt;
&lt;span class="s"&gt;refuse-eap&lt;/span&gt;
&lt;span class="s"&gt;refuse-pap&lt;/span&gt;
&lt;span class="s"&gt;refuse-chap-md5&lt;/span&gt;
&lt;span class="s"&gt;user USERNAME  # account name of the VPN server, in my case: TestUser2&lt;/span&gt;
&lt;span class="s"&gt;hide-password&lt;/span&gt;
&lt;span class="s"&gt;mppe-stateless&lt;/span&gt;
&lt;span class="s"&gt;mppe-128&lt;/span&gt;
&lt;span class="s"&gt;looplocal&lt;/span&gt;
&lt;span class="s"&gt;password THEPASSWORD  # the password provided&lt;/span&gt;
&lt;span class="s"&gt;nodetach&lt;/span&gt;
&lt;span class="s"&gt;ms-dns 8.8.8.8&lt;/span&gt;
&lt;span class="s"&gt;ipparam gwvpn&lt;/span&gt;
&lt;span class="s"&gt;debug  # future diagnose in case of failure&lt;/span&gt;
&lt;span class="s"&gt;logfile pptp.log&lt;/span&gt;
&lt;span class="s"&gt;EOF&lt;/span&gt;

&lt;span class="c1"&gt;## 2. start the connection&lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;pppd&lt;span class="w"&gt; &lt;/span&gt;call&lt;span class="w"&gt; &lt;/span&gt;pptpvpn

&lt;span class="c1"&gt;## 3. direct the traffic, this is the ip address of the remote desktop&lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;route&lt;span class="w"&gt; &lt;/span&gt;add&lt;span class="w"&gt; &lt;/span&gt;-host&lt;span class="w"&gt; &lt;/span&gt;xxx.xxx.xxx.xxx&lt;span class="w"&gt; &lt;/span&gt;-interface&lt;span class="w"&gt; &lt;/span&gt;ppp0&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# in my case: 192.168.51.12&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="important-note"&gt;Important Note&lt;/h2&gt;
&lt;p&gt;OS X has discontinued the support of PPTP since 2016. PPTP VPN is not secure as brute force attack tool exists to decrypt traffic over the VPN tunnel. The most practical advice is to move on to IPSec or SSL VPN.&lt;/p&gt;
&lt;h3 id="reference"&gt;&lt;a href="https://www.cts-llc.net/2017/02/21/pptp-on-osx-just-one-last-time.html"&gt;reference&lt;/a&gt;&lt;/h3&gt;</content><category term="cheatsheets"></category></entry><entry><title>Future Transportation and Billion-Population Cities</title><link href="/future-transportation-and-billion-population-cities.html" rel="alternate"></link><published>2018-07-22T00:00:00-05:00</published><updated>2018-07-22T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-07-22:/future-transportation-and-billion-population-cities.html</id><summary type="html">&lt;p&gt;Here is my comment to the flying car design by &lt;a href="https://www.rolls-royce.com/media/our-stories/electrification.aspx?utm_source=Direct#evtols"&gt;Rolls Royce&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A pricey future. High cost of R&amp;amp;D, city reconstruction and potential failure damage. &lt;/p&gt;
&lt;p&gt;You may consider about guided glider with modular on a rail. At least it won’t crash with power failure and when it crashes …&lt;/p&gt;&lt;/blockquote&gt;</summary><content type="html">&lt;p&gt;Here is my comment to the flying car design by &lt;a href="https://www.rolls-royce.com/media/our-stories/electrification.aspx?utm_source=Direct#evtols"&gt;Rolls Royce&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A pricey future. High cost of R&amp;amp;D, city reconstruction and potential failure damage. &lt;/p&gt;
&lt;p&gt;You may consider about guided glider with modular on a rail. At least it won’t crash with power failure and when it crashes, no exploration or second damage imposed. Or just us AI to detach and glide to land. Still keeping the benefit of high volume traffic in air and city can then be built vertically with higher population density, which in turn is the use case of such transportation. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;A good point to make a public checkpoint public for an idea I have thought of and researched on. &lt;/p&gt;
&lt;p&gt;Like this. &lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://www.dropbox.com/s/vwxsli284h73kn4/Screenshot%202018-07-22%2009.00.46.png?dl=1"&gt;&lt;/p&gt;
&lt;p&gt;And the station like this.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://www.dropbox.com/s/v7uqveeg72nxkd9/Screenshot%202018-07-22%2009.06.39.png?dl=1"&gt;&lt;/p&gt;
&lt;p&gt;Hit me for more insights about,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;fuel efficiency compared to train, car and airplane in different aspect&lt;/li&gt;
&lt;li&gt;catch and release techniques&lt;/li&gt;
&lt;li&gt;stations and modularities&lt;/li&gt;
&lt;li&gt;future million-population buildings&lt;/li&gt;
&lt;li&gt;aerodynamics and tunnel experiment, collaborated with a professor from Beihang University and maybe UT Arlington ARC lab. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I named it HATS: high-speed aerial transportation system. &lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Boarding Glasses for Motion Sickness</title><link href="/boarding-glasses-for-motion-sickness.html" rel="alternate"></link><published>2018-07-21T00:00:00-05:00</published><updated>2018-07-21T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-07-21:/boarding-glasses-for-motion-sickness.html</id><summary type="html">&lt;p&gt;&lt;a href="https://www.boardingglasses.com/"&gt;Boarding Glasses&lt;/a&gt; built a pair of glasses filled with colored liquid to act as reference of ground, which can reduce the Motion Sickness. &lt;/p&gt;
&lt;p&gt;There must be more patented techniques involved but 99 euro is a bit pricey. So I prototype this one to print and test it out. &lt;/p&gt;
&lt;p&gt;Next steps …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://www.boardingglasses.com/"&gt;Boarding Glasses&lt;/a&gt; built a pair of glasses filled with colored liquid to act as reference of ground, which can reduce the Motion Sickness. &lt;/p&gt;
&lt;p&gt;There must be more patented techniques involved but 99 euro is a bit pricey. So I prototype this one to print and test it out. &lt;/p&gt;
&lt;p&gt;Next steps:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;find the right the viscosity of the liquid: the liquid should response to acceleration in certain way?&lt;/li&gt;
&lt;li&gt;the right shape of the inner ring: circular, oval, or a better functioning shape?&lt;/li&gt;
&lt;li&gt;design: is it necessary to have 4 pieces? Maybe this is designed to add on normal glasses?&lt;/li&gt;
&lt;li&gt;FOV coverage: optimize the shape and size to set a standard for flexible design.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is my knock-off design to reverse engineering the &lt;strong&gt;Boarding Ring technique&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://www.dropbox.com/s/mxl42eup2a0ah4r/Screenshot%202018-07-21%2010.55.57.png?dl=1"&gt;&lt;/p&gt;</content><category term="maker-notes"></category></entry><entry><title>Comments on the arising state-sponsored Trolls</title><link href="/comments-on-the-arising-state-sponsored-trolls.html" rel="alternate"></link><published>2018-07-20T00:00:00-05:00</published><updated>2018-07-20T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-07-20:/comments-on-the-arising-state-sponsored-trolls.html</id><summary type="html">&lt;p&gt;Bloomberg published an article about &lt;a href="https://www.bloomberg.com/features/2018-government-sponsored-cyber-militia-cookbook/"&gt;state-sponsored trolls&lt;/a&gt; in a style. It leads to a report by &lt;a href="http://www.iftf.org/fileadmin/user_upload/images/DigIntel/IFTF_State_sponsored_trolling_report.pdf"&gt;Future Lab&lt;/a&gt;. I'm shocked but also pleased for the public awareness it may bring after the heated discussion about net neutrality few month ago. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Equality&lt;/strong&gt; is the most treasurable property of the &lt;strong&gt;internet&lt;/strong&gt;. It …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Bloomberg published an article about &lt;a href="https://www.bloomberg.com/features/2018-government-sponsored-cyber-militia-cookbook/"&gt;state-sponsored trolls&lt;/a&gt; in a style. It leads to a report by &lt;a href="http://www.iftf.org/fileadmin/user_upload/images/DigIntel/IFTF_State_sponsored_trolling_report.pdf"&gt;Future Lab&lt;/a&gt;. I'm shocked but also pleased for the public awareness it may bring after the heated discussion about net neutrality few month ago. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Equality&lt;/strong&gt; is the most treasurable property of the &lt;strong&gt;internet&lt;/strong&gt;. It ensures freedom and unalienable rights, that among these are Life, Liberty and the pursuit of Happiness. &lt;/p&gt;
&lt;p&gt;We fear the villains will take advantage to spread &lt;strong&gt;crimes&lt;/strong&gt; to unprecedented wide range of the society but on the other hand, &lt;strong&gt;hegemonism&lt;/strong&gt; and &lt;strong&gt;despotism&lt;/strong&gt; find their way to the world. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Anonymous&lt;/strong&gt; is the protection that ensures &lt;strong&gt;equality&lt;/strong&gt; at first but now the &lt;strong&gt;thread&lt;/strong&gt; to the security of an &lt;strong&gt;opening&lt;/strong&gt; online society that augments the physical world. &lt;/p&gt;
&lt;p&gt;We will not be afraid and together, we will find and perfect the techniques to avoid such &lt;strong&gt;sociological scam&lt;/strong&gt;. Among these are differential privacy, blockchain, &lt;strong&gt;open source&lt;/strong&gt; spirit and humanity! We should rethink about &lt;strong&gt;anonymity&lt;/strong&gt;, which is getting outdated in the &lt;strong&gt;flatting world&lt;/strong&gt; and only brings psychological attraction to behave out of box.&lt;/p&gt;
&lt;p&gt;Reach me out about building an identification system that should be passed to the next generations and beyond. &lt;/p&gt;
&lt;p&gt;A post first shared &lt;a href="https://www.linkedin.com/feed/update/urn:li:activity:6426075907114573824/"&gt;here&lt;/a&gt;. Right after my comments on Decromacy.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;How to ensure Democracy? &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Public education &amp;amp; Internet: free and open access to information&lt;/li&gt;
&lt;li&gt;Technology &amp;amp; Non-discrimination: net-neutrality, distributed voting system, blockchain, ...&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;</content><category term="articles"></category></entry><entry><title>Thoughts about The Nature of Sensing</title><link href="/thoughts-about-the-nature-of-sensing.html" rel="alternate"></link><published>2018-07-19T00:00:00-05:00</published><updated>2018-07-19T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-07-19:/thoughts-about-the-nature-of-sensing.html</id><summary type="html">&lt;p&gt;One foundation of the modern technology is advanced sensing, surveying the space in different scales with various fields of physics. &lt;/p&gt;
&lt;p&gt;For instance, &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;light, laser, infrared, radio, X-ray, miniature radar, : essentially these are all EM waves&lt;/li&gt;
&lt;li&gt;sound, seismic waves, sonar, ultrasonic: which are mechanic waves&lt;/li&gt;
&lt;li&gt;gravitational waves!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Each of the subject …&lt;/p&gt;</summary><content type="html">&lt;p&gt;One foundation of the modern technology is advanced sensing, surveying the space in different scales with various fields of physics. &lt;/p&gt;
&lt;p&gt;For instance, &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;light, laser, infrared, radio, X-ray, miniature radar, : essentially these are all EM waves&lt;/li&gt;
&lt;li&gt;sound, seismic waves, sonar, ultrasonic: which are mechanic waves&lt;/li&gt;
&lt;li&gt;gravitational waves!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Each of the subject has extensive research and applications done and ongoing. Many of these will start in lab and then be used in distance measurement (1-D), then be used in imaging (2-D) and ultimately space surveying (3-D). &lt;/p&gt;
&lt;p&gt;I am no expert in any of the explicit topics but what I learned from physics is to think in first principle. That's how complexity collapses and technology reveals the nature. &lt;/p&gt;
&lt;p&gt;What I do in astrophysics is just another aspect of the same principle. Except we have to use whatever we can and have to squeeze the information out. Because we don't have the energy for active measurement (shout and hear back) in such scale.  Data analysis in astronomy tries to utilize every pixel or even the dynamical photon counts (band and wavelets over the time in radio astronomy) to infer the source characteristics. &lt;/p&gt;
&lt;p&gt;A post first shared &lt;a href="https://www.linkedin.com/feed/update/urn:li:activity:6425718653261533184/"&gt;here&lt;/a&gt;.&lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Disrupting Yourself for greater</title><link href="/disrupting-yourself-for-greater.html" rel="alternate"></link><published>2018-07-17T00:00:00-05:00</published><updated>2018-07-17T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-07-17:/disrupting-yourself-for-greater.html</id><summary type="html">&lt;p&gt;This is what I learned from &lt;a href="https://www.linkedin.com/learning/disrupting-yourself/stepping-back-or-sideways-to-move-forward"&gt;Video Link&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Outline&lt;/p&gt;
&lt;h2 id="disrupted-innovation"&gt;Disrupted innovation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Taking the right risks&lt;ul&gt;
&lt;li&gt;Look at what others are not doing: open new doors instead of red seas&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Distinctive strength&lt;ul&gt;
&lt;li&gt;Do the job well then focus: principle&lt;/li&gt;
&lt;li&gt;People appreciate but you dismiss: awareness, stay passionate&lt;/li&gt;
&lt;li&gt;Self fulfilled: enthustic&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Embracing …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;This is what I learned from &lt;a href="https://www.linkedin.com/learning/disrupting-yourself/stepping-back-or-sideways-to-move-forward"&gt;Video Link&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Outline&lt;/p&gt;
&lt;h2 id="disrupted-innovation"&gt;Disrupted innovation&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Taking the right risks&lt;ul&gt;
&lt;li&gt;Look at what others are not doing: open new doors instead of red seas&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Distinctive strength&lt;ul&gt;
&lt;li&gt;Do the job well then focus: principle&lt;/li&gt;
&lt;li&gt;People appreciate but you dismiss: awareness, stay passionate&lt;/li&gt;
&lt;li&gt;Self fulfilled: enthustic&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Embracing constraints&lt;ul&gt;
&lt;li&gt;Understand the constraints and head on to it: challenge the edges&lt;/li&gt;
&lt;li&gt;Limit induces creation: change leads to breakthrough&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Battling entitlement&lt;ul&gt;
&lt;li&gt;Don't take for granted &lt;/li&gt;
&lt;li&gt;Feel hungry&lt;/li&gt;
&lt;li&gt;Be open to differences&lt;/li&gt;
&lt;li&gt;Appreciate the under-appreciated&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Step back to grow&lt;ul&gt;
&lt;li&gt;Step out of comfort zone: be aware not to settle&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Fail&lt;ul&gt;
&lt;li&gt;Don't fear: learn and move on&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Let your strategy emerge&lt;ul&gt;
&lt;li&gt;Find your metrics: set scale and goal&lt;/li&gt;
&lt;li&gt;Show up, practice: try and improve&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content><category term="study-notes"></category></entry><entry><title>WorkFlow and Methodology</title><link href="/workflow-and-methodology.html" rel="alternate"></link><published>2018-07-14T00:00:00-05:00</published><updated>2018-08-14T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-07-14:/workflow-and-methodology.html</id><summary type="html">&lt;div class="toc"&gt;&lt;span class="toctitle"&gt;Table of contents:&lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#overview"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#drafting"&gt;Drafting&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#outline-mindnode"&gt;Outline: MindNode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#extend-export-to-markdown"&gt;Extend: export to Markdown&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#developing"&gt;Developing&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#environment-docker"&gt;Environment: Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#prototyping-python"&gt;Prototyping: Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#packaging-ipython"&gt;Packaging: iPython&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#publishing"&gt;Publishing&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#presentation"&gt;Presentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#workshop"&gt;Workshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#repository-github"&gt;Repository: GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The following map summarized my general WorkFlow for data analysis based on &lt;strong&gt;Python&lt;/strong&gt;, which is a popular community-driven and user-friendly language.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I hope the WorkFlow and …&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;div class="toc"&gt;&lt;span class="toctitle"&gt;Table of contents:&lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#overview"&gt;Overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#drafting"&gt;Drafting&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#outline-mindnode"&gt;Outline: MindNode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#extend-export-to-markdown"&gt;Extend: export to Markdown&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#developing"&gt;Developing&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#environment-docker"&gt;Environment: Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#prototyping-python"&gt;Prototyping: Python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#packaging-ipython"&gt;Packaging: iPython&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#publishing"&gt;Publishing&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="#presentation"&gt;Presentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#workshop"&gt;Workshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#repository-github"&gt;Repository: GitHub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The following map summarized my general WorkFlow for data analysis based on &lt;strong&gt;Python&lt;/strong&gt;, which is a popular community-driven and user-friendly language.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I hope the WorkFlow and Methodology beneath can also serve as a reference for other language/projects, where Python is found useful as a prototyping/demonstration tool.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;img alt="" src="https://www.dropbox.com/s/1mozhbbi0pvqteh/WorkFlow.png?dl=1"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;ul&gt;
&lt;li&gt;This is a work in progress, and will be aggregated into a talk about &lt;a href="/pdfs/WorkFlow.html#/title-slide"&gt;Open Research&lt;/a&gt;. My idea of open research is adopted from the computational thinking from open source community.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://domij.info"&gt;About ME&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Some of the basic concepts include,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;continuous integration: test-driven and object-oriented for easier maintenances.&lt;/li&gt;
&lt;li&gt;well documented: including report/web-page/presentation for better understanding.&lt;/li&gt;
&lt;li&gt;reproducibility: containerized developing environment, archived data and git-logged code repository should be accessible to replicate.&lt;/li&gt;
&lt;li&gt;community driven: public ready to communicate on peer reviews and general feedbacks.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="drafting"&gt;Drafting&lt;/h2&gt;
&lt;h3 id="outline-mindnode"&gt;Outline: MindNode&lt;/h3&gt;
&lt;p&gt;Use mind map to conveniently remark and organize the outline of a project.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://mindnode.com/content/2-mindnode/1-mac/1-capture/capture.gif"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Content type in MindNode&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;image&lt;/li&gt;
&lt;li&gt;smart link with &lt;code&gt;http://&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;note&lt;/li&gt;
&lt;li&gt;task&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id="extend-export-to-markdown"&gt;Extend: export to Markdown&lt;/h3&gt;
&lt;p&gt;Export the mind map to markdown document to extend the details on each topic.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://mindnode.com/content/4-news/20170606-2017-06-06-introducing-ulysses/screen-capture-mindnode-export.png"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;a href="http://markdown-guide.readthedocs.io/en/latest/basics.html"&gt;Markdown Basics&lt;/a&gt;: the key formatting syntax. Markdown is also compatible to use html markup most of the time.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;lt;!-- image with style --&amp;gt;

[&lt;span class="nt"&gt;&amp;lt;img src=&amp;quot;img_url&amp;quot; style=&amp;quot;float: right&amp;quot; width=&amp;quot;100px&amp;quot;&amp;gt;&lt;/span&gt;](&lt;span class="na"&gt;img_url&lt;/span&gt;)

&amp;lt;!-- cross reference --&amp;gt;

TOC

&lt;span class="k"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;[&lt;span class="nt"&gt;title&lt;/span&gt;](&lt;span class="na"&gt;#tag&lt;/span&gt;)
  &amp;lt;a name=&amp;#39;#tag&amp;#39;&amp;gt;title&amp;lt;/a&amp;gt;

&amp;lt;!-- footnote --&amp;gt;

&amp;lt;sup&amp;gt;[1](#myfootnote1)&amp;lt;/sup&amp;gt;
&amp;lt;a name=&amp;quot;myfootnote1&amp;quot;&amp;gt;1&amp;lt;/a&amp;gt;: Footnote content goes here
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;h2 id="developing"&gt;Developing&lt;/h2&gt;
&lt;h3 id="environment-docker"&gt;Environment: Docker&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://docker-curriculum.com/"&gt;Containerize&lt;/a&gt;: balancing between system isolation and performance like a sandbox for &lt;em&gt;micro-service&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Basic concepts&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Images&lt;/em&gt; - The blueprints of our application which form the basis of containers. In the demo above, we used the &lt;code&gt;docker pull&lt;/code&gt; command to download the &lt;strong&gt;busybox&lt;/strong&gt; image.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Containers&lt;/em&gt; - Created from Docker images and run the actual application. We create a container using &lt;code&gt;docker run&lt;/code&gt; which we did using the busybox image that we downloaded. A list of running containers can be seen using the &lt;code&gt;docker ps&lt;/code&gt; command.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Docker Daemon&lt;/em&gt; - The background service running on the host that manages building, running and distributing Docker containers. The daemon is the process that runs in the operating system to which clients talk to.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Docker Client&lt;/em&gt; - The command line tool that allows the user to interact with the daemon. More generally, there can be other forms of clients too - such as &lt;a href="https://kitematic.com/"&gt;Kitematic&lt;/a&gt; which provide a GUI to the users.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Docker Hub&lt;/em&gt; - A &lt;a href="https://hub.docker.com/explore/"&gt;registry&lt;/a&gt; of Docker images. You can think of the registry as a directory of all available Docker images. If required, one can host their own Docker registries and can use them for pulling images.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;1. Start from base image&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Basic commands&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;docker&lt;span class="w"&gt; &lt;/span&gt;pull&lt;span class="w"&gt; &lt;/span&gt;image_name&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# pull public image/repository from a registry&lt;/span&gt;

docker&lt;span class="w"&gt; &lt;/span&gt;build&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;--no-cache&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-t&lt;span class="w"&gt; &lt;/span&gt;image_name&lt;span class="w"&gt; &lt;/span&gt;path/to/Dockerfile&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;renamed-dockerfile&lt;span class="o"&gt;]&lt;/span&gt;

docker&lt;span class="w"&gt; &lt;/span&gt;run&lt;span class="w"&gt; &lt;/span&gt;-it&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# interactive&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;--rm&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# rm container when exit&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-d&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# run as detached&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;8888&lt;/span&gt;:8888&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# port fwd to host&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;DISPLAY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$DISPLAY&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# set environment variable&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-u&lt;span class="w"&gt; &lt;/span&gt;user&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# username/uid in image&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-v&lt;span class="w"&gt; &lt;/span&gt;path/to/local:path/to/container&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# mount directory&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;image_name
&lt;span class="w"&gt;           &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;command&lt;span class="o"&gt;]&lt;/span&gt;

docker&lt;span class="w"&gt; &lt;/span&gt;port&lt;span class="w"&gt; &lt;/span&gt;container_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# show the open ports of a container instance&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;start/attach/stop/rm&lt;span class="w"&gt; &lt;/span&gt;container_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# manage a container instance&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;rmi&lt;span class="w"&gt; &lt;/span&gt;image_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# remove an image&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/"&gt;public registry&lt;/a&gt;: be caution about potential security risk in 3rd party image/repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;2. Record needed ingredients in requirement.txt&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;While developing, record the additional python packages in a text file named &lt;code&gt;requirement.txt&lt;/code&gt;, which will be useful to &lt;a href="#dockerfile"&gt;construct the &lt;code&gt;Dockerfile&lt;/code&gt;&lt;/a&gt; to automatically configure the developing environment, as well as &lt;a href="#mybinder"&gt;hosting an interactive Jupyter notebook&lt;/a&gt; with mybinder.&lt;/p&gt;
&lt;hr&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format"&gt;file format&lt;/a&gt; and &lt;a href="https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers"&gt;specifiers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pip.pypa.io/en/stable/reference/pip_freeze/"&gt;&lt;code&gt;pip freeze &amp;gt; requirement.txt&lt;/code&gt;&lt;/a&gt;: list installed package&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Example requirement.txt&lt;/span&gt;
&lt;span class="n"&gt;SomeProject&lt;/span&gt;
&lt;span class="n"&gt;SomeProject&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mf"&gt;1.3&lt;/span&gt;
&lt;span class="n"&gt;SomeProject&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="mf"&gt;1.2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mf"&gt;.2.0&lt;/span&gt;
&lt;span class="n"&gt;SomeProject&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;foo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bar&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;SomeProject&lt;/span&gt;&lt;span class="o"&gt;~=&lt;/span&gt;&lt;span class="mf"&gt;1.4.2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;&lt;a name="dockerfile"&gt;&lt;strong&gt;3. Compose building recipe to Dockerfile&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some resources&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/develop/develop-images/dockerfile_best-practices/"&gt;Best practices&lt;/a&gt;: use minimum system with necessary packages&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/samples/"&gt;Base app samples&lt;/a&gt;: from IDE to OS, official docker images to start with&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hub.docker.com/"&gt;Docker Hub&lt;/a&gt;: Community hub, use with caution&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Steps&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;start with a base image that meets the need of the project&lt;/li&gt;
&lt;li&gt;customize with additional dependency using &lt;code&gt;RUN sudo pip install -r requirement.txt&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;add special system setup and port configuration as needed&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h3 id="prototyping-python"&gt;Prototyping: Python&lt;/h3&gt;
&lt;p&gt;Some principles&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Object-oriented programing&lt;/li&gt;
&lt;li&gt;function -&amp;gt; method&lt;/li&gt;
&lt;li&gt;variable -&amp;gt; attribute&lt;/li&gt;
&lt;li&gt;Computational thinking: see the full image &lt;a href="/images/Methodology_DS_blue.png"&gt;here&lt;/a&gt;
  &lt;img alt="" src="https://www.dropbox.com/s/d4jk8tso9vc9bjj/Screenshot%202018-08-14%2020.18.33.png?dl=1"&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;A few suggestions&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;think about goals of code&lt;/li&gt;
&lt;li&gt;break into reasonable classes&lt;/li&gt;
&lt;li&gt;pseudocode it up&lt;/li&gt;
&lt;li&gt;check for efficient algorithm&lt;/li&gt;
&lt;li&gt;test each function and class&lt;/li&gt;
&lt;li&gt;assemble code in &lt;strong&gt;main&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;run&lt;/li&gt;
&lt;li&gt;optimize if necessary&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Code Styling: &lt;a href="https://www.python.org/dev/peps/pep-0008/"&gt;PEP8&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;indentation: 4 spaces&lt;/li&gt;
&lt;li&gt;snake_case: packages, modules, functions&lt;/li&gt;
&lt;li&gt;CamelCase: classes, attributes&lt;/li&gt;
&lt;li&gt;_alltogether: variables, add &lt;code&gt;_&lt;/code&gt; for build-in variables_&lt;/li&gt;
&lt;li&gt;space near operators, except for &lt;code&gt;func(a=1, b=3)&lt;/code&gt; or &lt;code&gt;c = a/b&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;separate imports&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;gt;2 space # 1 space&lt;/code&gt; inline comments, docstring&lt;/li&gt;
&lt;li&gt;break liner &lt;code&gt;/&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Practical steps&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Dev with Jupyter, note issues&lt;/strong&gt;: interactive notebook is very handy at development&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="(/pdfs/LSST18.slides.html#/5)"&gt;Pitfall with interactive notebook&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;execution order matters&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;memory consuming&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;See my LSST talk about &lt;a href="http://lsst.domij.info/"&gt;Jupyter as a Research Tool&lt;/a&gt; for example.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;2. Aggregate to python script&lt;/strong&gt;: modularize codes into functions&lt;/p&gt;
&lt;p&gt;More to read and adopt&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.python.org/psf/codeofconduct/"&gt;Python Community Code of Conduct&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://google.github.io/styleguide/pyguide.html"&gt;Google Python Style Guide&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Test-driven design&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;modular code&lt;/li&gt;
&lt;li&gt;specific and fine-grained test&lt;/li&gt;
&lt;li&gt;regression test for bugs&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;3. Checkpoint scripts with git&lt;/strong&gt;: git log the progress&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://services.github.com/on-demand/downloads/github-git-cheat-sheet.pdf"&gt;Github git cheat sheet&lt;/a&gt;: some basic operations&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a private git repository on any ssh server with 6 lines&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# on server&lt;/span&gt;
mkdir&lt;span class="w"&gt; &lt;/span&gt;project.git
&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;project.git
git&lt;span class="w"&gt; &lt;/span&gt;--bare&lt;span class="w"&gt; &lt;/span&gt;init

&lt;span class="c1"&gt;# client side&lt;/span&gt;
git&lt;span class="w"&gt; &lt;/span&gt;init
git&lt;span class="w"&gt; &lt;/span&gt;remote&lt;span class="w"&gt; &lt;/span&gt;add&lt;span class="w"&gt; &lt;/span&gt;mygitserver&lt;span class="w"&gt; &lt;/span&gt;ssh://git@remote-host&lt;span class="o"&gt;[&lt;/span&gt;:port&lt;span class="o"&gt;]&lt;/span&gt;/path/to/project.git
git&lt;span class="w"&gt; &lt;/span&gt;push&lt;span class="w"&gt; &lt;/span&gt;mygitserver&lt;span class="w"&gt; &lt;/span&gt;master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;h3 id="packaging-ipython"&gt;Packaging: iPython&lt;/h3&gt;
&lt;p&gt;When the code is ready to share,&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;create a parent directory&lt;/li&gt;
&lt;li&gt;create &lt;a href="https://docs.python.org/2/distutils/introduction.html#distutils-simple-example"&gt;setup script&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;create &lt;a href="https://docs.python.org/2/distutils/sourcedist.html"&gt;MANIFEST.in&lt;/a&gt; for list of files&lt;/li&gt;
&lt;li&gt;include README&lt;/li&gt;
&lt;li&gt;include LICENSE&lt;/li&gt;
&lt;li&gt;include setup.py&lt;/li&gt;
&lt;li&gt;recursive-include folders scripts&lt;/li&gt;
&lt;li&gt;&lt;code&gt;python setup.py sdist&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;1. Modularize function&lt;/strong&gt;: if not done earlier&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CamelCase&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;  &lt;span class="c1"&gt;# initialize&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="fm"&gt;__repr__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;  &lt;span class="c1"&gt;# print&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;...&amp;quot;&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;__main__&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;program&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;2. Unittest&lt;/strong&gt;: remember the issues we note down during the developing? These are good cases to write up tests about. A more proactive concept is test-driven programming.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;├── __init__.py
├── code.py
├── func_a.py
├── func_b.py
├── func_c.py
└── tests
    ├── __init__.py
    ├── test_funcs.py
    └── test_something.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;testing framework&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;pytest&lt;/li&gt;
&lt;li&gt;conda install &lt;code&gt;pytest pytest-cov&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;compose tests under &lt;code&gt;tests/&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;run &lt;code&gt;py.test&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;nose&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;3. Continuous Integration&lt;/strong&gt;: use continuous integration to automatically test when something changes in repository.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Travis: require &lt;code&gt;.travis.yml&lt;/code&gt; file to config&lt;/li&gt;
&lt;li&gt;circleci&lt;/li&gt;
&lt;li&gt;AppVeyor&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# example .travis.yml file&lt;/span&gt;

&lt;span class="n"&gt;language&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;python&lt;/span&gt;
&lt;span class="n"&gt;python&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
  &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;3.6&amp;quot;&lt;/span&gt;
&lt;span class="c1"&gt;# command to install dependencies&lt;/span&gt;
&lt;span class="n"&gt;install&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;pip install -r requirement.txt&amp;quot;&lt;/span&gt;
&lt;span class="c1"&gt;# command to run tests&lt;/span&gt;
&lt;span class="n"&gt;script&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;pytest&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;4. Profiling &amp;amp; Optimization&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Premature optimization is the root of all evil. -- Donald Knuth&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;computation amount&lt;/li&gt;
&lt;li&gt;memory usage&lt;/li&gt;
&lt;li&gt;input/output&lt;/li&gt;
&lt;li&gt;storage&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Tips from Cameron Hummels&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Decide what you are optimizing over&lt;/li&gt;
&lt;li&gt;Computer time versus person time&lt;/li&gt;
&lt;li&gt;Write readable code first, then optimize&lt;/li&gt;
&lt;li&gt;Use profilers to identify bottlenecks&lt;/li&gt;
&lt;li&gt;Address bottlenecks one at a time&lt;/li&gt;
&lt;li&gt;Latest Python is most optimized&lt;/li&gt;
&lt;li&gt;Try new approaches and profile/testit&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;ul&gt;
&lt;li&gt;Object oriented code&lt;/li&gt;
&lt;li&gt;NumPy arrarys are optimized&lt;/li&gt;
&lt;li&gt;Vectorize loops when possible&lt;/li&gt;
&lt;li&gt;List comprehensions&lt;/li&gt;
&lt;li&gt;Avoid building lists through appends&lt;/li&gt;
&lt;li&gt;In place operations as opposed to rebuilding&lt;/li&gt;
&lt;li&gt;Cython&lt;/li&gt;
&lt;li&gt;Numba&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;time&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# coarse total time&lt;/span&gt;
%%timeit&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# code snippets&lt;/span&gt;
cProfile&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# deep profiling with viz tools&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;pstats&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# text-based&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;snakeviz
&lt;span class="w"&gt;  &lt;/span&gt;runsnakerun&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# pipeline tool&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;pyprof2html&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# html tool&lt;/span&gt;
line_profiler/kernprof&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# line-by-line function&lt;/span&gt;
memory_profiler&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# memory consumption and memory leaks&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;Parallel computing&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;multithreaded&lt;/li&gt;
&lt;li&gt;multiprocessing&lt;/li&gt;
&lt;li&gt;MPI and mpi4py&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;5. Documenting&lt;/strong&gt;: essential for future revisit or further development.&lt;/p&gt;
&lt;p&gt;versioning: x.y.z (E.g., 0.2.3, 2.7.12, 3.6)&lt;/p&gt;
&lt;p&gt;• change x for breaking changes
• change y for non-breaking changes
• change z for bug-fixes&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;docstring and comments tips&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;document while coding&lt;/li&gt;
&lt;li&gt;document the interfaces of modular&lt;/li&gt;
&lt;li&gt;use descriptive names&lt;/li&gt;
&lt;li&gt;consistent style/format&lt;/li&gt;
&lt;li&gt;docstring&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id="publishing"&gt;Publishing&lt;/h2&gt;
&lt;h3 id="presentation"&gt;Presentation&lt;/h3&gt;
&lt;p&gt;Following my WorkFlow, most of the work has been done at this stage. The rest can be carried out in very minimum effort with decent finish.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Example finish: use &lt;code&gt;?&lt;/code&gt; for keyboard shortcuts to control the slides.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/pdfs/report.html"&gt;Jupyter notebook to html report&lt;/a&gt;: my Ph.D. project&lt;/li&gt;
&lt;li&gt;&lt;a href="/pdfs/LSST18.slides.html#/"&gt;Jupyter notebook to html slides&lt;/a&gt;: my talk slides on LSST 2018 workshop&lt;/li&gt;
&lt;li&gt;&lt;a href="/pdfs/WorkFlow.html#/title-slide"&gt;MindNode to markdown to html slides&lt;/a&gt;: my draft slides of this document&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;1. MindNote -&amp;gt; Markdown&lt;/strong&gt;: re-arrange and convert the outline mind map to markdown.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://mindnode.com/content/4-news/20170606-2017-06-06-introducing-ulysses/screen-capture-mindnode-export.png"&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Warning: Jupyter notebook should be re-organized for presentation, especially dissertation defense! The order of work is not necessary the order of talk! Check my &lt;a href="/pdfs/LSST18.slides.html#/11/1"&gt;LSST talk&lt;/a&gt; for some tips.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;2. Markdown -&amp;gt; HTML&lt;/strong&gt;: extend the details in markdown and convert to html.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://pandoc.org/MANUAL.html"&gt;Pandoc&lt;/a&gt;: powerful tool for conversion.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;install: &lt;code&gt;brew install pandoc&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;use &lt;code&gt;%&lt;/code&gt; for frontpage info&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pandoc.org/demos.html"&gt;usage demo&lt;/a&gt;: &lt;code&gt;pandoc -s --mathjax -i -t --slide-level=2 revealjs WorkFlow.md -o WorkFlow.html&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;3. Slideshow: HTML + reveal.js&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;add &lt;code&gt;-V revealjs-url=http://lab.hakim.se/reveal-js&lt;/code&gt; when using pandoc to convert&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;or download &lt;a href="https://revealjs.com/#/"&gt;reveal.js&lt;/a&gt; to the same directory of the converted directory&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now it's ready to open the html file to start the slideshow, use &lt;code&gt;?&lt;/code&gt; for keyboard shortcuts to control the slides.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id="workshop"&gt;Workshop&lt;/h3&gt;
&lt;p&gt;To take the research/project to a workshop, we need to recall what we've done.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Config env.: Dockerfile&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With everything done, it is now easy to put all the ingredients and recipe together into a Dockerfile.&lt;/p&gt;
&lt;hr&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Example Dockerfile for python&lt;/span&gt;
cat&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;Dockerfile&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;lt;&amp;lt;EOF&lt;/span&gt;
&lt;span class="s"&gt;FROM python:3&lt;/span&gt;

&lt;span class="s"&gt;WORKDIR /usr/src/app&lt;/span&gt;

&lt;span class="s"&gt;COPY requirements.txt ./&lt;/span&gt;
&lt;span class="s"&gt;RUN pip install --no-cache-dir -r requirements.txt&lt;/span&gt;

&lt;span class="s"&gt;COPY . .&lt;/span&gt;

&lt;span class="s"&gt;CMD [ &amp;quot;python&amp;quot;, &amp;quot;./your-daemon-or-script.py&amp;quot; ]&lt;/span&gt;
&lt;span class="s"&gt;EOF&lt;/span&gt;

&lt;span class="c1"&gt;# build&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;build&lt;span class="w"&gt; &lt;/span&gt;-t&lt;span class="w"&gt; &lt;/span&gt;pydev&lt;span class="w"&gt; &lt;/span&gt;.
docker&lt;span class="w"&gt; &lt;/span&gt;run&lt;span class="w"&gt; &lt;/span&gt;-it&lt;span class="w"&gt; &lt;/span&gt;--rm&lt;span class="w"&gt; &lt;/span&gt;pydev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;2. Demo: Markdown + Scripts -&amp;gt; Jupyter notebook&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Following the mind map and resulting markdown file, we can put the outline structure in Jupyter notebook since it natively supports markdown formatted cells. We can fill in the function calls and visualization codes in between.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;My secret on toggling code cells&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;nbextension&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;codefolding&lt;/code&gt;: &lt;code&gt;$ jupyter nbextension enable codefolding/main&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;more &lt;a href="https://github.com/ipython-contrib/jupyter_contrib_nbextensions"&gt;extenstions&lt;/a&gt;: spellchecker, Table of Contents, Autoscroll,...&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nbconvert&lt;/code&gt; with &lt;code&gt;--template template.tpl&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;hide/remove code in one step &lt;a href="http://www.damian.oquanta.info/posts/hide-the-input-cells-from-your-ipython-slides.html"&gt;templates&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;more functionality available&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Another wheel to edit slide styles on the fly&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://damianavila.github.io/RISE/usage.html#"&gt;RISE&lt;/a&gt;: good for dev./workshop&lt;/li&gt;
&lt;li&gt;&lt;a href="https://mybinder.org/v2/gh/parmentelat/RISE.git/doc2?filepath=examples%2FREADME.ipynb"&gt;demo&lt;/a&gt;: interactive live rendering, based on reveal.js&lt;/li&gt;
&lt;li&gt;reveal.js: good for prod./presentation&lt;/li&gt;
&lt;li&gt;post-process with nbconvert&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;3. Slideshow: nbconvert + reveal.js&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Wrap up commands to convert notebook into slideshow&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;jupyter&lt;span class="w"&gt; &lt;/span&gt;nbconvert&lt;span class="w"&gt; &lt;/span&gt;notebook.ipynb&lt;span class="w"&gt; &lt;/span&gt;--to&lt;span class="w"&gt; &lt;/span&gt;slides&lt;span class="w"&gt; &lt;/span&gt;--reveal-prefix&lt;span class="w"&gt; &lt;/span&gt;reveal.js&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;--template&lt;span class="w"&gt; &lt;/span&gt;hidecode/rmcode.tpl&lt;span class="o"&gt;]&lt;/span&gt;

wget&lt;span class="w"&gt; &lt;/span&gt;https://github.com/hakimel/reveal.js/archive/3.6.0.tar.gz&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;tar&lt;span class="w"&gt; &lt;/span&gt;-xvzf&lt;span class="w"&gt; &lt;/span&gt;-

open&lt;span class="w"&gt; &lt;/span&gt;notebook.slides.html
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;h3 id="repository-github"&gt;Repository: GitHub&lt;/h3&gt;
&lt;p&gt;When it is ready to take the project to the public, there are a few wheels very handy to make it more appealing.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Live slideshow&lt;/strong&gt;: add some markup in the url of the html file in repository to render the slideshow in live, not always working.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://tammor.github.io/bs_page/2017/06/14/pandoc_to_reveal.html"&gt;reveal html files&lt;/a&gt;: go to &lt;code&gt;http://htmlpreview.github.io/?&lt;/code&gt;+&lt;code&gt;git_html_url&lt;/code&gt;+&lt;code&gt;?print-pdf&lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Live notebook demo: binder&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Everything is ready, just paste the repository link to mybinder.org&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://mybinder.readthedocs.io/en/latest/using.html#preparing-a-repository-for-binder"&gt;configure&lt;/a&gt;: add requirement.txt or Dockerfile&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;launch on &lt;a href="https://mybinder.org/"&gt;binder&lt;/a&gt;: recall the RISE demo&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="http://nbviewer.jupyter.org/"&gt;static option&lt;/a&gt;: open &lt;code&gt;http://nbviewer.jupyter.org/&lt;/code&gt; and paste the github url of the ipynb file&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Project webpage: github.io + HTML&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://pages.github.com/"&gt;github.io&lt;/a&gt;: use any of the converted html file to set it up in 3 steps&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;create a repository with &lt;code&gt;username.github.io&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;add HTML file&lt;/li&gt;
&lt;li&gt;go to &lt;code&gt;https://username.github.io&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Documentation: Read the Docs&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This step depends on how often and well the project is documented. If earlier guide is followed, there is no pain at all.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;sphinx with &lt;a href="http://www.sphinx-doc.org/en/stable/rest.html"&gt;reST&lt;/a&gt;: &lt;code&gt;sphinx-quickstart -a "Name" -p Repo -v 0.1 --ext-autodoc -q&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;doxygen&lt;/li&gt;
&lt;li&gt;readthedocs: link github &amp;amp; auto build&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Building test: Travis CI&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Follow the manual/documentation!&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;tricks&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# load dataset based on memory&lt;/span&gt;
&lt;span class="n"&gt;sources&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;chunksize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;100000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;chunk&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sources&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="o"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="articles"></category></entry><entry><title>Neural Networks</title><link href="/neural-networks.html" rel="alternate"></link><published>2018-07-05T00:00:00-05:00</published><updated>2018-07-05T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-07-05:/neural-networks.html</id><summary type="html">&lt;h2 id="building-blocks"&gt;Building Blocks&lt;/h2&gt;
&lt;h3 id="gradient-descent"&gt;Gradient Descent&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;finding the optimum in parameter space&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Strategies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Batch: $\theta = \theta - \eta \cdot \nabla_ \theta J(\theta)$&lt;/li&gt;
&lt;li&gt;Stochastic: $\theta = \theta - \eta \cdot \nabla_\theta J(\theta;x_i;y_i)$, faster but biased&lt;/li&gt;
&lt;li&gt;Mini-batch: $\theta = \theta - \eta \cdot \nabla_\theta J(\theta;x_{i:i+m};y_{i:i …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;h2 id="building-blocks"&gt;Building Blocks&lt;/h2&gt;
&lt;h3 id="gradient-descent"&gt;Gradient Descent&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;finding the optimum in parameter space&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Strategies:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Batch: $\theta = \theta - \eta \cdot \nabla_ \theta J(\theta)$&lt;/li&gt;
&lt;li&gt;Stochastic: $\theta = \theta - \eta \cdot \nabla_\theta J(\theta;x_i;y_i)$, faster but biased&lt;/li&gt;
&lt;li&gt;Mini-batch: $\theta = \theta - \eta \cdot \nabla_\theta J(\theta;x_{i:i+m};y_{i:i+m})$, intermediate&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Challenges:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;$\eta$: apply learning rate schedules&lt;/li&gt;
&lt;li&gt;Saddle points as local minimum: spiking NN for quantum tunneling?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Improvements for SDG:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;add momentum:&lt;/em&gt; $v_t = \gamma v_t - 1 + \eta \cdot \nabla_\theta J(\theta); \theta = \theta -v_t$, reduce damping&lt;/li&gt;
&lt;li&gt;NAG, Nesterov accelerated gradient: add correction based on momentum, $J(\theta) -&amp;gt; J(\theta - \gamma v_t - 1)$, avoid momentum crash&lt;/li&gt;
&lt;li&gt;Adagrad, adaptive gradient: $\eta_i$ for each $\theta_i$, $\theta_{t+1}=\theta_t - \frac{\eta}{\sqrt{G_t+\epsilon}}\odot g_t$&lt;/li&gt;
&lt;li&gt;Adadelta: reduce the calculation of $G_t$ with a window-based average, $E_t$&lt;/li&gt;
&lt;li&gt;RMSprop: $E_t = \gamma E_{t-1} + (1-\gamma)g_t^2$&lt;/li&gt;
&lt;li&gt;Adam, adaptive moment estimation: bias-corrected from weighted average mean and variance
&lt;img alt="" src="http://mmbiz.qpic.cn/mmbiz_gif/951TjTgiabkyJ1ncktgIzgdVgpUe849nG1tAmkb37t25NwNPibkcpEsAn530iakP0VmgW6OHOc2QLX4QOAWarnNug/0?wx_fmt=gif&amp;amp;tp=webp&amp;amp;wxfrom=5&amp;amp;wx_lazy=1"&gt;
&lt;img alt="" src="http://mmbiz.qpic.cn/mmbiz_gif/951TjTgiabkyJ1ncktgIzgdVgpUe849nGicQibxqDqcNBZqBEWhCs5fCgjU8buq6B2DVKbJUJFTDqDNhibw8J387EQ/0?wx_fmt=gif&amp;amp;tp=webp&amp;amp;wxfrom=5&amp;amp;wx_lazy=1"&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Asynchronous SGD for parallelization:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hogwild&lt;/li&gt;
&lt;li&gt;Downpour SGD&lt;/li&gt;
&lt;li&gt;Delay-tolerant Algorithms for SGD&lt;/li&gt;
&lt;li&gt;TensorFlow&lt;/li&gt;
&lt;li&gt;EASGD, elastic Averaging SGD: local variable fluctuate from center variable&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Extra to explore:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Shuffling and Curriculum Learning &lt;/li&gt;
&lt;li&gt;Batch normalization: keep N(0,1)&lt;/li&gt;
&lt;li&gt;Early stopping: avoid overfitting&lt;/li&gt;
&lt;li&gt;Gradient noise: shuffle away from local&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="http://ruder.io/optimizing-gradient-descent/index.html"&gt;Overview of Gradient Descent&lt;/a&gt; &lt;a href="https://blog.csdn.net/heyongluoyao8/article/details/52478715"&gt;refs&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="activation-function"&gt;Activation Function&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;back-propagatable, non-linear projection&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;code&gt;keep nonlinearity &amp;amp; non-vanishing gradient&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sigmoid: $f(x) = \frac{1}{1 + e^{-x}}$, work with cross-entropy cost function $y\ln{a}+(1-y)\ln{(1-a)}$ to avoid gradient vanishing&lt;/li&gt;
&lt;li&gt;tanh, $tanh(x)= 2 \sigmoid(2x)-1$: better but not the final solution&lt;/li&gt;
&lt;li&gt;ReLU, $y=x\ge0? x:0$&lt;ul&gt;
&lt;li&gt;constant gradient on one side&lt;/li&gt;
&lt;li&gt;output shift &amp;amp; hard to converge&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;PReLU, $f(y_i)= y_i&amp;gt;0? y_i: a_iy_i$: regulate the left side&lt;ul&gt;
&lt;li&gt;&lt;a href=""&gt;He, K., et al. Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. ICCV 2015&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;RReLU, &lt;a href=""&gt;Xu, B., et al. Empirical Evaluation of Rectified Activations in Convolutional Network. ICML Deep Learning Workshop 2015&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Maxout, $\max{w_ix+b_i}$&lt;/li&gt;
&lt;li&gt;ELU, $f(x)= x&amp;gt;0?x:\alpha (\exp(x)-1)$&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Coldmooon/Code-for-MPELU/"&gt;ImageNet example&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Noisy Activation Functions, &lt;a href=""&gt;Gulcehre, C., et al., Noisy Activation Functions, in ICML 2016. 2016&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;CReLU, pair-grouping phenomenon&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Coldmooon/Code-for-MPELU/"&gt;MPELU&lt;/a&gt;
&lt;img alt="" src="http://mmbiz.qpic.cn/mmbiz_jpg/xRp3sibCWzgEibibmQgFot91Viawy89yZmwgKkQOxwUjo8BvKzROLWkXuTAMrLydcpBt1M9oOShicWOA1M8fa3bMcBA/640?wx_fmt=jpeg"&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Practical tips:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ReLU&lt;/li&gt;
&lt;li&gt;ELU&lt;/li&gt;
&lt;li&gt;PReLU/MPELU with &lt;a href="https://blog.csdn.net/zouxy09/article/details/24971995"&gt;&lt;strong&gt;regularizer&lt;/strong&gt;/penalty&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="regularization"&gt;Regularization&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;minimize the loss function with reasonable complexity&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Supervised learning: $w^* = \arg\min_w \sum_i L(y_i, f(x_i;w)) + \lambda \Omega(w)$, solve ill-conditioned matrix&lt;/p&gt;
&lt;p&gt;L0/L1, minimize the absolute sum: Lasso regularization, make $w$ sparse, $||w||_1 \le C$, linear bound&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Feature Selection: less feature needed&lt;/li&gt;
&lt;li&gt;Interpretability: less complex&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;less features &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;L2, minimize the square sum: Ridge Regression/Weight Decay, $||w||_2 \le C$, quadratic bound&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;won't reduce features&lt;br&gt;
but reduce certain feature dependence&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id="tuning-methods"&gt;Tuning Methods&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;the evil approach&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img alt="" src="http://pic2.zhimg.com/70/v2-247ecfca25fcad04aa4122eb1e892765_b.jpg"&gt;&lt;/p&gt;
&lt;h2 id="neural-networks"&gt;Neural Networks&lt;/h2&gt;
&lt;p&gt;&lt;img alt="" src="http://www.asimovinstitute.org/wp-content/uploads/2016/09/neuralnetworks.png"&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Feedforward Neural Network: &lt;a href="https://www.cnblogs.com/peghoty/p/3857839.html"&gt;word2vec&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;Huffman tree&lt;/li&gt;
&lt;li&gt;CBOW: words -&amp;gt; word&lt;/li&gt;
&lt;li&gt;skip-gram: word -&amp;gt; words&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Denoising Autoencoders: obtain good representation&lt;ul&gt;
&lt;li&gt;perform noise mapping: $x \rightarrow \tilde{ x}$&lt;/li&gt;
&lt;li&gt;keep loss as $\mathcal{L}(x,\tilde{x'})$&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Restricted Boltzmann Machine: unsupervised learning&lt;ul&gt;
&lt;li&gt;generative approach: obtain $P(X,Y)$ for P(Y|X); in contrast of discriminative approach, which only cares about $P(Y|X)$&lt;ul&gt;
&lt;li&gt;methods: Markov process &amp;amp; Gibbs sampling&lt;/li&gt;
&lt;li&gt;metrics: KL divergence, Shannon entropy, $\sum_i P(i)\log\frac{P(i)}{Q(i)}$&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;probability distribution: $P = \frac{1}{Z}e^{-E(v,h)}$&lt;/li&gt;
&lt;li&gt;energy function: $E(v,h) =-v^T Wh -a^Tv -b^Th$, $v$ visible unit, $h$ hidden unit&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Generative Adversarial Network: Turing learning&lt;ul&gt;
&lt;li&gt;discriminator: convolutional&lt;/li&gt;
&lt;li&gt;generator: deconvolutional&lt;/li&gt;
&lt;li&gt;applications&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/akanimax/T2F"&gt;synthesis face from text&lt;/a&gt;: progressive growing of GANs, training method&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1702.00403"&gt;recover features in astrophysical images of galaxies beyond the deconvolution limit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1612.07919"&gt;EnhanceNet: Single Image Super-Resolution Through Automated Texture Synthesis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.evolvingai.org/ppgn"&gt;generating images in latent space&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1512.03385"&gt;Residual Neural Network&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;plain layer + shortcuts&lt;/li&gt;
&lt;li&gt;residual function: $\mathcal{F}(x):=h(x) - x$&lt;/li&gt;
&lt;li&gt;shortcut: $y=w_s x + \mathcal{F}(x, {w_i})$&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Convolutional Neural Network: computer vision&lt;ul&gt;
&lt;li&gt;convolutional layer with kernels&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Recurrent Neural Network&lt;ul&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/pdf/1503.04069.pdf"&gt;LSTM&lt;/a&gt;: a memory cell $c_t$, an input gate $i_t$, an 'output' gate $o_t$ and a forget gate $f_t$. $x_t \rightarrow h_t$ &lt;img alt="" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Peephole_Long_Short-Term_Memory.svg/2000px-Peephole_Long_Short-Term_Memory.svg.png"&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://distill.pub/2016/augmented-rnns/"&gt;Attention&lt;/a&gt;: potential of &lt;code&gt;memory&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;applications&lt;ul&gt;
&lt;li&gt;&lt;a href="https://skr3.nlm.nih.gov/SemMed/"&gt;Semantic MEDLINE&lt;/a&gt;: MEDLINE intelligence, NLP on medical papers&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hypothesis.ornl.gov/semmed/semmed.php"&gt;ORiGAMI&lt;/a&gt;: term weight and so on&lt;/li&gt;
&lt;li&gt;&lt;a href="https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43905.pdf"&gt;Acoustic modeling&lt;/a&gt;: ASR&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cs.stanford.edu/people/karpathy/deepimagesent/"&gt;Image description&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img alt="" src="https://www.dropbox.com/s/b5u56yamb4tlrzg/Screenshot%202018-07-05%2015.08.56.png?dl=1"&gt;&lt;/p&gt;
&lt;h3 id="spiking-neural-network-3rd-generation"&gt;Spiking Neural Network (3rd generation)&lt;/h3&gt;
&lt;p&gt;Spiking neuron: accumulate their activation into a potential over time, and only send out a signal (a "spike") when this potential crosses a threshold and the neuron is reset.&lt;/p&gt;
&lt;p&gt;Integrator: memory or nonlinear response&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1602.08323"&gt;BP on SNN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1604.04383"&gt;SNN on very low bit rate speech coding&lt;/a&gt;: replace HMM&lt;/li&gt;
&lt;li&gt;&lt;a href="https://arxiv.org/abs/1804.08150"&gt;DL in SNN&lt;/a&gt;: low energy cost, but no BP, spike time &amp;amp; spike rate&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="refs"&gt;Refs&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.evl.uic.edu/creativecoding/courses/cs523/slides/week3/DeepLearning_LeCun.pdf"&gt;Nature review paper, LeCun&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.bioinfo.org.cn/~casp/temp/DeepLearning.pdf"&gt;Slides&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://neuralnetworksanddeeplearning.com/index.html"&gt;Book by Michael Nielsen&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://colah.github.io/"&gt;Colah's blog of different topics&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="to-explore"&gt;To Explore&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://colab.research.google.com/notebooks/welcome.ipynb"&gt;Google Collaboration Lab for notebook dev&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="extras"&gt;Extras&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://qz.com/1316050/tech-companies-just-woke-up-to-a-big-problem-with-their-ai/amp/"&gt;ethics principles&lt;/a&gt;: bias imposed by training data&lt;/li&gt;
&lt;/ul&gt;</content><category term="articles"></category></entry><entry><title>Quantum Computing</title><link href="/quantum-computing.html" rel="alternate"></link><published>2018-07-01T00:00:00-05:00</published><updated>2018-07-01T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-07-01:/quantum-computing.html</id><summary type="html">&lt;h2 id="quantum-computing-neural-networks"&gt;Quantum Computing &amp;amp; Neural Networks&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://www.quantiki.org/wiki/basic-concepts-quantum-computation"&gt;basic concepts&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Superposition: $\ket{+}, \ket{-}$&lt;/li&gt;
&lt;li&gt;Phase: $T$&lt;/li&gt;
&lt;li&gt;Bloch Sphere&lt;/li&gt;
&lt;li&gt;Decoherence&lt;ul&gt;
&lt;li&gt;Energy relaxation: $T_1 := \ket{1} \rightarrow \ket{0}$&lt;/li&gt;
&lt;li&gt;Dephasing: $T_2$&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Resources&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://xxx.lanl.gov/list/quant-ph/recent"&gt;New ArXiv papers in quantum physics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://oxfordquantum.org/"&gt;Research in Oxford Quantum&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="ibm-open-quantum"&gt;IBM Open Quantum&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.research.ibm.com/ibm-q/"&gt;ibm-q&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://quantumexperience.ng.bluemix.net/qx/tutorial?sectionId=beginners-guide&amp;amp;page=000-FAQ_for_Beginners~2F001-FAQ_for_Beginners"&gt;beginner's guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://quantumexperience.ng.bluemix.net/qx/tutorial?sectionId=full-user-guide&amp;amp;page=introduction"&gt;user guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/QISKit/qiskit-terra"&gt;github&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;OpenQasm Input&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;// My First Score&lt;/span&gt;
&lt;span class="n"&gt;OPENQASM …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;h2 id="quantum-computing-neural-networks"&gt;Quantum Computing &amp;amp; Neural Networks&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://www.quantiki.org/wiki/basic-concepts-quantum-computation"&gt;basic concepts&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Superposition: $\ket{+}, \ket{-}$&lt;/li&gt;
&lt;li&gt;Phase: $T$&lt;/li&gt;
&lt;li&gt;Bloch Sphere&lt;/li&gt;
&lt;li&gt;Decoherence&lt;ul&gt;
&lt;li&gt;Energy relaxation: $T_1 := \ket{1} \rightarrow \ket{0}$&lt;/li&gt;
&lt;li&gt;Dephasing: $T_2$&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Resources&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://xxx.lanl.gov/list/quant-ph/recent"&gt;New ArXiv papers in quantum physics&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://oxfordquantum.org/"&gt;Research in Oxford Quantum&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="ibm-open-quantum"&gt;IBM Open Quantum&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.research.ibm.com/ibm-q/"&gt;ibm-q&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://quantumexperience.ng.bluemix.net/qx/tutorial?sectionId=beginners-guide&amp;amp;page=000-FAQ_for_Beginners~2F001-FAQ_for_Beginners"&gt;beginner's guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://quantumexperience.ng.bluemix.net/qx/tutorial?sectionId=full-user-guide&amp;amp;page=introduction"&gt;user guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/QISKit/qiskit-terra"&gt;github&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;OpenQasm Input&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;// My First Score&lt;/span&gt;
&lt;span class="n"&gt;OPENQASM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;2.0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;include&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;qelib1.inc&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Register declarations&lt;/span&gt;
&lt;span class="n"&gt;qreg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;creg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// Quantum Circuit&lt;/span&gt;
&lt;span class="c1"&gt;// Pauli operations &lt;/span&gt;
&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;barrier&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// Clifford operations&lt;/span&gt;
&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;sdg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;cx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;barrier&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// non-Clifford operations&lt;/span&gt;
&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;tdg&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="n"&gt;barrier&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// measurement operations&lt;/span&gt;
&lt;span class="n"&gt;measure&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# my_first_score.py&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;qiskit&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;QuantumCircuit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;QuantumRegister&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ClassicalRegister&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;execute&lt;/span&gt;

&lt;span class="c1"&gt;# Define the Quantum and Classical Registers&lt;/span&gt;
&lt;span class="n"&gt;q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;QuantumRegister&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ClassicalRegister&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Build the circuit&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;QuantumCircuit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# Pauli operations &lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;barrier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# Clifford operations&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;h&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inverse&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cx&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;barrier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# non-Clifford operations&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;inverse&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;barrier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;# measurement operations&lt;/span&gt;
&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;measure&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Execute the circuit&lt;/span&gt;
&lt;span class="n"&gt;job&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;backend&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;local_qasm_simulator&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;shots&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Print the result&lt;/span&gt;
&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get_counts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_first_score&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Operations&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;X&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;01&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;control&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;CNOT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;gate&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;T&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="nv"&gt;eiπ&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;H&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;√&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;−&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Hadamard&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;gate&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;S&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nv"&gt;T&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;Z&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;−&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nv"&gt;T&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;S&lt;/span&gt;†&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;−&lt;span class="nv"&gt;i&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nv"&gt;T&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;T&lt;/span&gt;†&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="nv"&gt;e&lt;/span&gt;−&lt;span class="nv"&gt;iπ&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nv"&gt;T&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;Y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="nv"&gt;i&lt;/span&gt;−&lt;span class="nv"&gt;i0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nv"&gt;XZ&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="quantum-algorithms"&gt;Quantum Algorithms&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Shor%27s_algorithm"&gt;Shor's algorithm&lt;/a&gt;: ordering, factoring&lt;ul&gt;
&lt;li&gt;period finding: modular exponential function, $a^r = 1 (\mod N)$&lt;/li&gt;
&lt;li&gt;steps&lt;/li&gt;
&lt;li&gt;pick $a$, compute $\gcd(N,a)$&lt;/li&gt;
&lt;li&gt;if not co-prime&lt;ul&gt;
&lt;li&gt;do find period $r$ so that $a^r = 1 (\mod N)$&lt;/li&gt;
&lt;li&gt;until $r$ is even&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;check $\gcd(a^{r/2}\pm 1, N)$ for prime factor&lt;/li&gt;
&lt;li&gt;quadratic sieve method $\exp(d^{1/3})$&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://quantumexperience.ng.bluemix.net/qx/tutorial?sectionId=full-user-guide&amp;amp;page=004-Quantum_Algorithms~2F070-Grover%27s_Algorithm"&gt;Grover's algorithm&lt;/a&gt;: reflection^n to amplify the matched state&lt;/li&gt;
&lt;li&gt;Quantum Annealing &lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="technicals"&gt;Technicals&lt;/h3&gt;
&lt;p&gt;Building blocks
- &lt;a href="https://www.quora.com/What-is-the-equivalent-of-the-transistor-in-a-quantum-computer"&gt;Discussion of transistor&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="neruoscience"&gt;Neruoscience&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.ncbi.nlm.nih.gov/pubmedhealth/PMH0072574/"&gt;brief about nervous system&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.ncbi.nlm.nih.gov/pubmedhealth/PMHT0024269/"&gt;neurons&lt;/a&gt;: chemical interactions between neurons as communication, not fixed, multi-connected&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="ideas"&gt;Ideas&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;3D transistor to resemble neuro, spiking instead&lt;/li&gt;
&lt;li&gt;growing network, mimic brain development, let network layers to change &amp;amp; train&lt;ul&gt;
&lt;li&gt;biological growing: &lt;a href="https://www.encyclopedia.com/science/news-wires-white-papers-and-books/growth-and-differentiation-nervous-system"&gt;nervous system growth&lt;/a&gt;, need to study human baby&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2989000/"&gt;timeline&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;day 13: &lt;img alt="" src="https://www.ncbi.nlm.nih.gov/books/NBK234146/bin/img00018.jpg"&gt;&lt;/li&gt;
&lt;li&gt;embryonic day 42 - midgestation: establishing rudimentary neural networks&lt;/li&gt;
&lt;li&gt;3rd gestational week: differentiation of neural progenitor cells&lt;/li&gt;
&lt;li&gt;8th GW: rudimentary structures of the brain and central nervous system&lt;/li&gt;
&lt;li&gt;rapid growth and elaboration&lt;/li&gt;
&lt;li&gt;end of the prenatal period: major fiber pathways complete&lt;/li&gt;
&lt;li&gt;before preschool: increases in size by four-fold &lt;/li&gt;
&lt;li&gt;by age 6: ~ 90% of adult, structural changes continue&lt;/li&gt;
&lt;li&gt;100GB neurons, 60TB connections: ~ 600 link per neuron, multiple-in-guided-one-out&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;distribution out + spiking activation&lt;/li&gt;
&lt;li&gt;sectioning during training: vision, language, motion and so on. develop as grow, over the cause of infant&lt;ul&gt;
&lt;li&gt;self-sectioning: train as needed&lt;/li&gt;
&lt;li&gt;resonance ignition: transfer learning &amp;amp; creativity&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content><category term="study-notes"></category></entry><entry><title>SlideShow with reveal.js</title><link href="/slideshow-with-revealjs.html" rel="alternate"></link><published>2018-06-17T00:00:00-05:00</published><updated>2018-06-17T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-06-17:/slideshow-with-revealjs.html</id><summary type="html">&lt;p&gt;&lt;a href="http://lsst.domij.info"&gt;Presentation&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="docker"&gt;Docker&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;configure a docker with necessary ingredients&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# based on jupyter/base-notebook&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;pull&lt;span class="w"&gt; &lt;/span&gt;jupyter/base-notebook

&lt;span class="c1"&gt;# or use Dockerfile, if need root, https://github.com/jupyter/docker-stacks/issues/211&lt;/span&gt;
cat&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;lt;&amp;lt; EOF &amp;gt; Dockerfile&lt;/span&gt;
&lt;span class="s"&gt;# Copyright (C) 2018 by Dongming Jin&lt;/span&gt;
&lt;span class="s"&gt;# Licensed under the Academic Free License version 3.0&lt;/span&gt;
&lt;span class="s"&gt;# This program comes …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;&lt;a href="http://lsst.domij.info"&gt;Presentation&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="docker"&gt;Docker&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;configure a docker with necessary ingredients&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# based on jupyter/base-notebook&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;pull&lt;span class="w"&gt; &lt;/span&gt;jupyter/base-notebook

&lt;span class="c1"&gt;# or use Dockerfile, if need root, https://github.com/jupyter/docker-stacks/issues/211&lt;/span&gt;
cat&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;lt;&amp;lt; EOF &amp;gt; Dockerfile&lt;/span&gt;
&lt;span class="s"&gt;# Copyright (C) 2018 by Dongming Jin&lt;/span&gt;
&lt;span class="s"&gt;# Licensed under the Academic Free License version 3.0&lt;/span&gt;
&lt;span class="s"&gt;# This program comes with ABSOLUTELY NO WARRANTY.&lt;/span&gt;
&lt;span class="s"&gt;# You are free to modify and redistribute this code as long&lt;/span&gt;
&lt;span class="s"&gt;# as you do not remove the above attribution and reasonably&lt;/span&gt;
&lt;span class="s"&gt;# inform receipients that you have modified the original work&lt;/span&gt;

&lt;span class="s"&gt;FROM jupyter/base-notebook&lt;/span&gt;

&lt;span class="s"&gt;MAINTAINER Dongming Jin &amp;quot;dongming.jin@utrgv.edu&amp;quot;&lt;/span&gt;

&lt;span class="s"&gt;# Switch account to root and adding user accounts and password. or not&lt;/span&gt;
&lt;span class="s"&gt;USER root&lt;/span&gt;
&lt;span class="s"&gt;RUN echo &amp;quot;root:Docker!&amp;quot; | chpasswd&lt;/span&gt;

&lt;span class="s"&gt;USER jovyan&lt;/span&gt;
&lt;span class="s"&gt;EOF&lt;/span&gt;

&lt;span class="c1"&gt;# build from Dockerfile&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;build&lt;span class="w"&gt; &lt;/span&gt;-t&lt;span class="w"&gt; &lt;/span&gt;jupyslides&lt;span class="w"&gt; &lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/jupyter/docker-stacks/issues/211"&gt;sudo for docker&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;run the container&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# test system configuration&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;run&lt;span class="w"&gt; &lt;/span&gt;-it&lt;span class="w"&gt; &lt;/span&gt;jupyslides&lt;span class="w"&gt; &lt;/span&gt;/bin/bash

&lt;span class="c1"&gt;# load with data and slides&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;run&lt;span class="w"&gt; &lt;/span&gt;-it&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;10000&lt;/span&gt;:8888&lt;span class="w"&gt; &lt;/span&gt;--rm&lt;span class="w"&gt; &lt;/span&gt;-v&lt;span class="w"&gt; &lt;/span&gt;/Users/domi/Dropbox/Research/Local_universe:/home/jovyan/slides&lt;span class="w"&gt; &lt;/span&gt;-v&lt;span class="w"&gt; &lt;/span&gt;/Users/domi/Desktop/LISA:/home/jovyan/LISA&lt;span class="w"&gt; &lt;/span&gt;jupyslides&lt;span class="w"&gt; &lt;/span&gt;/bin/bash

&lt;span class="c1"&gt;# convert to slides&lt;/span&gt;
jupyter&lt;span class="w"&gt; &lt;/span&gt;nbconvert&lt;span class="w"&gt; &lt;/span&gt;report.ipynb&lt;span class="w"&gt; &lt;/span&gt;--to&lt;span class="w"&gt; &lt;/span&gt;slides&lt;span class="w"&gt; &lt;/span&gt;--reveal-prefix&lt;span class="w"&gt; &lt;/span&gt;reveal.js&lt;span class="w"&gt; &lt;/span&gt;--template&lt;span class="w"&gt; &lt;/span&gt;hidecode.tpl

&lt;span class="c1"&gt;# replace initialization &amp;lt;script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="toggleremove-code"&gt;Toggle/Remove Code&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;[in-situ] nbextension to toggle code(metadata level) &amp;amp; more beyond&lt;ul&gt;
&lt;li&gt;&lt;a href="http://nbconvert.readthedocs.io/en/latest/usage.html"&gt;doc&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ipython-contrib/jupyter_contrib_nbextensions#installpy"&gt;github install&lt;/a&gt;: &lt;code&gt;conda install -c conda-forge jupyter_contrib_nbextensions&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator"&gt;configurator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;jupyter nbextension enable codefolding/main&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;[prod] hide code &lt;a href="http://www.damian.oquanta.info/posts/hide-the-input-cells-from-your-ipython-slides.html"&gt;nbconvert with &lt;code&gt;--template hidecode.tpl&lt;/code&gt;&lt;/a&gt;, &lt;a href="#hidecode"&gt;hidecode.tpl&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;[prod] delete code nbconvert with &lt;a href="#rmcode"&gt;&lt;code&gt;--template rmcode.tpl&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://chris-said.io/2016/02/13/how-to-make-polished-jupyter-presentations-with-optional-code-visibility/"&gt;~~HTML buttom~~&lt;/a&gt;: need a buttom.., better to use tpl&lt;ul&gt;
&lt;li&gt;&lt;code&gt;&amp;lt;a href="javascript:code_toggle()"&amp;gt; [Toggle Code]&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;RISE to automatic live reveal&lt;ul&gt;
&lt;li&gt;&lt;a href="https://damianavila.github.io/RISE/usage.html#"&gt;Usage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://damianavila.github.io/RISE/customize.html"&gt;customizing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.slideviper.oquanta.info/tutorial/slideshow_tutorial_slides.html?transition=none#/26"&gt;simple demo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;shortcuts[editing]&lt;ul&gt;
&lt;li&gt;alt-r, “Enter/Exit Live Reveal Slideshow”&lt;/li&gt;
&lt;li&gt;shift-i, Toggle slide&lt;/li&gt;
&lt;li&gt;shift-o, Toggle-subslide&lt;/li&gt;
&lt;li&gt;shift-p, Toggle-fragment&lt;/li&gt;
&lt;li&gt;alt + r: start/stop&lt;/li&gt;
&lt;li&gt;,: help        &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;enable: &lt;code&gt;jupyter-nbextension enable rise --py --user&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;diable: &lt;code&gt;jupyter-nbextension disable rise --py --user&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="rendering"&gt;Rendering&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://revealjs.com/#/"&gt;reveal.js&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/hakimel/reveal.js"&gt;github&lt;/a&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/hakimel/reveal.js#pdf-export"&gt;pdf-export&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://revealjs.com/#/transitions"&gt;transition&lt;/a&gt;: None - Fade - Slide - Convex - Concave - Zoom&lt;/li&gt;
&lt;li&gt;&lt;a href="https://revealjs.com/#/themes"&gt;themes&lt;/a&gt;: Black (default) - White - League - Sky - Beige - Simple - Serif - Blood - Night - Moon - Solarized&lt;/li&gt;
&lt;li&gt;&lt;a href="https://revealjs.com/#/10"&gt;full screen background&lt;/a&gt;: &lt;code&gt;&amp;lt;section data-background="image.png" data-background-repeat="repeat" data-background-size="100px"&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=""&gt;background transition&lt;/a&gt;: Reveal.configure({ backgroundTransition: 'zoom' })&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;change in reveal.js file and rendering with &lt;code&gt;--reveal-prefix reveal.js&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;path for my configure &lt;code&gt;/Users/domi/Desktop/reveal.js&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://htmlcheats.com/reveal-js/reveal-js-tutorial-reveal-js-for-beginners/"&gt;brief intro from scratch&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;check zoom.js &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;shortcut&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;N  ,  SPACE&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Next slide&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;P&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Previous slide&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;amp;#8592;  ,  H&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Navigate left&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;amp;#8594;  ,  L&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Navigate right&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;amp;#8593;  ,  K&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Navigate up&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;amp;#8595;  ,  J&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Navigate down&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Fn + &amp;lt;&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;                   &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;First slide&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Fn + &amp;gt;&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;                   &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Last slide&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;B  ,  .&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Pause&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;F&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;                    &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Fullscreen&amp;#39;&lt;/span&gt;,
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;ESC, O&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt;               &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Slide overview&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Remark: &lt;a href="https://remarkjs.com/#1"&gt;demo&lt;/a&gt;: &lt;a href="https://github.com/gnab/remark"&gt;github doc&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="nbconvert"&gt;nbconvert&lt;/h3&gt;
&lt;p&gt;set config in notebook, no need when use reveal.js&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;traitlets.config.manager&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseJSONConfigManager&lt;/span&gt;
&lt;span class="c1"&gt;# get path: jupyter --path&lt;/span&gt;
&lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;/Users/domi/anaconda3/envs/py35/etc/jupyter/nbconfig&amp;quot;&lt;/span&gt;
&lt;span class="n"&gt;cm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;BaseJSONConfigManager&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config_dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;livereveal&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="s2"&gt;&amp;quot;theme&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;serif&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="s2"&gt;&amp;quot;transition&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;fade&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="s2"&gt;&amp;quot;start_slideshow_at&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;selected&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="command"&gt;command&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;jupyter nbconvert&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;xxxx.ipynb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--template=nbextensions&lt;/code&gt;: use nbextentions&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--reveal-prefix path_to_reveal.js&lt;/code&gt;: reveal.js, need update &lt;a href="#reveal"&gt;initialization&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;--post serve&lt;/code&gt;: local host&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="problems-and-fix"&gt;Problems and Fix&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;\mathsrc&lt;/code&gt; replace &lt;code&gt;\mathcal&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blog.aviture.us.com/2017/06/13/reveal-js-export-pdf.html"&gt;export to pdf&lt;/a&gt;: not working&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/34166856/is-there-a-way-to-print-a-jupyter-ipython-notebook-slide-presentation"&gt;print pdf&lt;/a&gt;: not working as well&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a name="reveal"&gt; replace in html &lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="cm"&gt;&amp;lt;!--reveal.js initilization--&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="c1"&gt;// it makes sense to wait a little bit when you are loading&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="c1"&gt;// reveal from a cdn in a slow connection environment&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nx"&gt;waitSeconds&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;10&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;reveal.js/lib/js/head.min.js&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;reveal.js/js/reveal.js&amp;quot;&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Reveal&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;// Full list of configuration options available here: https://github.com/hakimel/reveal.js#configuration&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nx"&gt;Reveal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nx"&gt;controls&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nx"&gt;progress&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nx"&gt;history&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nx"&gt;center&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nx"&gt;transition&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;slide&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;

&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="c1"&gt;// Optional libraries used to extend on reveal.js&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nx"&gt;dependencies&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;reveal.js/lib/js/classList.js&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;                  &lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;reveal.js/plugin/markdown/marked.js&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;!!&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;querySelector&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;[data-markdown]&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;            &lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;reveal.js/plugin/notes/notes.js&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;                  &lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;                  &lt;/span&gt;&lt;span class="nx"&gt;condition&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;!!&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;reveal.js/plugin/highlight/highlight.js&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;callback&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;hljs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;initHighlightingOnLoad&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;reveal.js/plugin/zoom-js/zoom.js&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;async&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// using zoom.js&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;update&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;MathJax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Hub&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getAllJax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Reveal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getCurrentSlide&lt;/span&gt;&lt;span class="p"&gt;())){&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nx"&gt;MathJax&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Hub&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Rerender&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Reveal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getCurrentSlide&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="w"&gt;          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nx"&gt;Reveal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;slidechanged&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;update&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;setScrollingSlide&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;scroll&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;scroll&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;===&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;.reveal&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mf"&gt;0.95&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;section.present&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;section&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;                  &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;h&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;css&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;height&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;calc(95vh)&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;css&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;overflow-y&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;scroll&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;                &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;css&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;margin-top&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;20px&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="c1"&gt;// check and set the scrolling slide every time the slide change&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="nx"&gt;Reveal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;slidechanged&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;setScrollingSlide&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;script&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a name="rmcode"&gt; rmcode.tpl &lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="cp"&gt;{%&lt;/span&gt;- &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;slides_reveal.tpl&amp;#39;&lt;/span&gt; -&lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;block&lt;/span&gt; &lt;span class="nv"&gt;input&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endblock&lt;/span&gt; &lt;span class="nv"&gt;input&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a name="hidecode"&gt; hidecode.tpl &lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="cp"&gt;{%&lt;/span&gt;- &lt;span class="k"&gt;extends&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;slides_reveal.tpl&amp;#39;&lt;/span&gt; -&lt;span class="cp"&gt;%}&lt;/span&gt;

&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;block&lt;/span&gt; &lt;span class="nv"&gt;input_group&lt;/span&gt; -&lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;input_hidden&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endblock&lt;/span&gt; &lt;span class="nv"&gt;input_group&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;

&lt;span class="cp"&gt;{%&lt;/span&gt;- &lt;span class="k"&gt;block&lt;/span&gt; &lt;span class="nv"&gt;header&lt;/span&gt; -&lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="nb"&gt;super&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;style&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/css&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
//div.output_wrapper&lt;span class="w"&gt; &lt;/span&gt;{
//&lt;span class="w"&gt;  &lt;/span&gt;margin-top:&lt;span class="w"&gt; &lt;/span&gt;0px;
//}
.input_hidden&lt;span class="w"&gt; &lt;/span&gt;{
&lt;span class="w"&gt;  &lt;/span&gt;display:&lt;span class="w"&gt; &lt;/span&gt;none;
//&lt;span class="w"&gt;  &lt;/span&gt;margin-top:&lt;span class="w"&gt; &lt;/span&gt;5px;
}
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
$(document).ready(function(){
&lt;span class="w"&gt;  &lt;/span&gt;$(&amp;quot;.output_wrapper&amp;quot;).click(function(){
&lt;span class="w"&gt;      &lt;/span&gt;$(this).prev(&amp;#39;.input_hidden&amp;#39;).slideToggle();
&lt;span class="w"&gt;  &lt;/span&gt;});
})
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;{%&lt;/span&gt;- &lt;span class="k"&gt;endblock&lt;/span&gt; &lt;span class="nv"&gt;header&lt;/span&gt; -&lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="articles"></category></entry><entry><title>Docker Commands</title><link href="/docker-commands.html" rel="alternate"></link><published>2018-05-30T00:00:00-05:00</published><updated>2018-05-30T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-05-30:/docker-commands.html</id><summary type="html">&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;docker&lt;span class="w"&gt; &lt;/span&gt;build&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;--no-cache&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-t&lt;span class="w"&gt; &lt;/span&gt;img_name&lt;span class="w"&gt; &lt;/span&gt;path/to/Dockerfile&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# build image based on dockerfile&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;images&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# all images&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;ps&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-a&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# show [all] running containers&lt;/span&gt;

docker&lt;span class="w"&gt; &lt;/span&gt;start/attach&lt;span class="w"&gt; &lt;/span&gt;con_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# restart excited container&lt;/span&gt;
&lt;span class="w"&gt;       &lt;/span&gt;stop&lt;span class="w"&gt; &lt;/span&gt;con_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# stop container&lt;/span&gt;
&lt;span class="w"&gt;       &lt;/span&gt;rm&lt;span class="w"&gt; &lt;/span&gt;con_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# rm container&lt;/span&gt;
&lt;span class="w"&gt;       &lt;/span&gt;rmi&lt;span class="w"&gt; &lt;/span&gt;img_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# rm image&lt;/span&gt;

docker&lt;span class="w"&gt; &lt;/span&gt;run&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2222&lt;/span&gt;:22&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;Image …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;docker&lt;span class="w"&gt; &lt;/span&gt;build&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;--no-cache&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-t&lt;span class="w"&gt; &lt;/span&gt;img_name&lt;span class="w"&gt; &lt;/span&gt;path/to/Dockerfile&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# build image based on dockerfile&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;images&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# all images&lt;/span&gt;
docker&lt;span class="w"&gt; &lt;/span&gt;ps&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-a&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# show [all] running containers&lt;/span&gt;

docker&lt;span class="w"&gt; &lt;/span&gt;start/attach&lt;span class="w"&gt; &lt;/span&gt;con_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# restart excited container&lt;/span&gt;
&lt;span class="w"&gt;       &lt;/span&gt;stop&lt;span class="w"&gt; &lt;/span&gt;con_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# stop container&lt;/span&gt;
&lt;span class="w"&gt;       &lt;/span&gt;rm&lt;span class="w"&gt; &lt;/span&gt;con_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# rm container&lt;/span&gt;
&lt;span class="w"&gt;       &lt;/span&gt;rmi&lt;span class="w"&gt; &lt;/span&gt;img_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# rm image&lt;/span&gt;

docker&lt;span class="w"&gt; &lt;/span&gt;run&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2222&lt;/span&gt;:22&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;Image&lt;span class="w"&gt; &lt;/span&gt;Name&amp;gt;

docker&lt;span class="w"&gt; &lt;/span&gt;run&lt;span class="w"&gt; &lt;/span&gt;-it&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# interactive&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;--rm&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# rm container when exit, use with caution&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-d&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# detached&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;8888&lt;/span&gt;:80&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# port fwd to host&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;DISPLAY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$DISPLAY&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# set environment variable&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-u&lt;span class="w"&gt; &lt;/span&gt;docker&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# username/uid&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;-v&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;data_location&amp;gt;:~/data&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# mount data directory&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;--name&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;rdev&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# container name&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;ubuntu&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# image name&lt;/span&gt;
&lt;span class="w"&gt;           &lt;/span&gt;/bin/bash&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# command&lt;/span&gt;

docker&lt;span class="w"&gt; &lt;/span&gt;port&lt;span class="w"&gt; &lt;/span&gt;con_id&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# show port fwd&lt;/span&gt;
ssh&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2222&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;root@localhost

docker&lt;span class="w"&gt; &lt;/span&gt;cp&lt;span class="w"&gt; &lt;/span&gt;local_file&lt;span class="w"&gt; &lt;/span&gt;con_id:path/to/target&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# copy file to container&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Images&lt;/em&gt; - The blueprints of our application which form the basis of containers. In the demo above, we used the &lt;code&gt;docker pull&lt;/code&gt; command to download the &lt;strong&gt;busybox&lt;/strong&gt; image.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Containers&lt;/em&gt; - Created from Docker images and run the actual application. We create a container using &lt;code&gt;docker run&lt;/code&gt; which we did using the busybox image that we downloaded. A list of running containers can be seen using the &lt;code&gt;docker ps&lt;/code&gt; command.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Docker Daemon&lt;/em&gt; - The background service running on the host that manages building, running and distributing Docker containers. The daemon is the process that runs in the operating system to which clients talk to.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Docker Client&lt;/em&gt; - The command line tool that allows the user to interact with the daemon. More generally, there can be other forms of clients too - such as &lt;a href="https://kitematic.com/"&gt;Kitematic&lt;/a&gt; which provide a GUI to the users.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Docker Hub&lt;/em&gt; - A &lt;a href="https://hub.docker.com/explore/"&gt;registry&lt;/a&gt; of Docker images. You can think of the registry as a directory of all available Docker images. If required, one can host their own Docker registries and can use them for pulling images.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Refs
- &lt;a href="https://prakhar.me/docker-curriculum/"&gt;Docker Q&amp;amp;A&lt;/a&gt;
- &lt;a href="https://dev.to/napicellatwit/containers-from-scratch-in-18-lines-of-code-3pmn"&gt;container from scratch&lt;/a&gt;&lt;/p&gt;</content><category term="cheatsheets"></category></entry><entry><title>Opening Notes for Defense</title><link href="/opening-notes-for-defense.html" rel="alternate"></link><published>2018-04-27T00:00:00-05:00</published><updated>2018-04-27T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2018-04-27:/opening-notes-for-defense.html</id><summary type="html">&lt;h3 id="graduate-study-in-a-glance"&gt;Graduate Study in a Glance&lt;/h3&gt;
&lt;p&gt;During my Ph.D. study, I've been questioning about, what is re-search.&lt;/p&gt;
&lt;p&gt;It seems to me that research is about &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;looking at something, &lt;/li&gt;
&lt;li&gt;over and over, &lt;/li&gt;
&lt;li&gt;in all possible aspects.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;During these iterations, we may&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;narrow assumptions,&lt;/li&gt;
&lt;li&gt;apply different methods,&lt;/li&gt;
&lt;li&gt;collect more data,&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;and learn …&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;h3 id="graduate-study-in-a-glance"&gt;Graduate Study in a Glance&lt;/h3&gt;
&lt;p&gt;During my Ph.D. study, I've been questioning about, what is re-search.&lt;/p&gt;
&lt;p&gt;It seems to me that research is about &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;looking at something, &lt;/li&gt;
&lt;li&gt;over and over, &lt;/li&gt;
&lt;li&gt;in all possible aspects.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;During these iterations, we may&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;narrow assumptions,&lt;/li&gt;
&lt;li&gt;apply different methods,&lt;/li&gt;
&lt;li&gt;collect more data,&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;and learn new knowledge.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Reproducibility =&amp;gt; why I present in this transparent way&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;so it is informative about what I conclude and how I deliver&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Over the past years, I studied about&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Globular Clusters, these are&lt;ul&gt;
&lt;li&gt;stellar systems that consist of millions of stars, they are also&lt;/li&gt;
&lt;li&gt;ancient building blocks of galaxies themselves. &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;They are extremely interesting environments, in a sense that,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the timescale of stellar evolution, becomes comparable to &lt;/li&gt;
&lt;li&gt;the timescale to have stellar encounters.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That is, the stars in these dense star clusters don't die alone,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;they will influence the nearby-stars over dynamical interactions,&lt;/li&gt;
&lt;li&gt;their own stellar evolutions are also altered during such processes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In a nutshell, &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;smaller systems like open clusters cannot stay gravitationally-binded&lt;ul&gt;
&lt;li&gt;stars are easily scattered away and they will evaporate before long&lt;/li&gt;
&lt;li&gt;there are also enough materials to power multiple generation of star formations&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;larger systems like galaxies instead, have strong gravitational potentials&lt;ul&gt;
&lt;li&gt;most of the stars are trapped and move under a quasi-static field&lt;/li&gt;
&lt;li&gt;the system could be described as statistical equilibrium,&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Starting from that, I learned about &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the larger structure in the local universe and &lt;/li&gt;
&lt;li&gt;built up the concept of the cosmic web&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I will expand on that by populating globular clusters in the local universe, which is the second chapter in my dissertation. &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Then I had this chance to study about numerical simulations.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I spent the 2013 summer in National Astronomical Observatories, Chinese Academy of Science to study about N-body models with &lt;a href="http://kiaa.pku.edu.cn/faculty/rainer-spurzem"&gt;Rainer Spurzem&lt;/a&gt;, using Newtonian integrator to solve dynamical interactions.&lt;/li&gt;
&lt;li&gt;I also [met with Jonathon Downing and] picked up the Monte Carlo code from &lt;a href="https://www.camk.edu.pl/en/people/staff/mig/"&gt;Mirek Giersz&lt;/a&gt; to evaluate the phase-space evolution in a semi-equilibrium system. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Both approaches provide great details about stellar dynamics based on theoretical assumptions.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;From the formation mechanism of compact binary systems,&lt;/li&gt;
&lt;li&gt;to the observable global effects of the star clusters, 
different physics and phenomenons are implemented in various scale. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The adaption of &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;these numerical methods, &lt;/li&gt;
&lt;li&gt;in together with high performance computing techniques, 
push forward the research greatly so that theoretical prospects become &lt;/li&gt;
&lt;li&gt;essential to new proposed instrumental projects,&lt;/li&gt;
&lt;li&gt;instructional to reveal discoveries buried in observed data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I reviewed such aspects in the history of GC studies in chapter 3 and introduced my own simulations to represent the natural assembling of GCs in chapter 4.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The major effects considered in GCs and &lt;/li&gt;
&lt;li&gt;the detailed modeling 
are discussed in my dissertation in corresponding sections. I will only briefly demonstrate the key components later. &lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;From those simulations, I could extract any interesting stellar object with its full dynamical history, especially the compact binary systems that could be potentially the gravitational wave sources in different frequency domain. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I spent 2015 summer at Kavli Institute of Astrophysics and Astronomy in Peking University doing data analysis by querying observational databases for variable sources, &lt;/li&gt;
&lt;li&gt;I visited National Astronomical Observatories, Chinese Academy of Science again to prototype a transient object detection pipeline for 50cm Binocular Network with &lt;a href="http://sourcedb.naoc.cas.cn/en/enaoexpert/200907/t20090706_2000374.html"&gt;Licai Deng&lt;/a&gt; and &lt;a href="http://kiaa.pku.edu.cn/faculty/richard-de-grijs"&gt;Richard de Grijs&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The mutual benefits supplemented my experience in optical data processing that promoted my understanding on time series data analysis. &lt;/p&gt;
&lt;p&gt;I sketched the work flow to estimate the local abundance of GCs in chapter 2. At the same time, I started to focus on the binary black holes for the resulting GW signals. Matt's code based on Peter's work about general relativity was parallelized to carry out the relativistic evolution for the compact binary systems extracted from GCs. A brief introduction about BBH formation mechanisms and GW astronomy could be found in chapter 5. At the time of the first GW detection, my preliminary result presented on MODEST meeting ruled out GC as the origin of the IMBH merger event. &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;In 2016 summer, I started training in the LSST data science program and &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the systematic coverage of statistical background &lt;/li&gt;
&lt;li&gt;and conventional data analysis tools 
enhanced my modeling of the GC populations. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With the super-cluster in Texas Advanced Computing Center, my collection of GC simulations was also enlarged greatly.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;More realizations of the same setup were added to make sure the convergence.&lt;/li&gt;
&lt;li&gt;Finer-grained parameter space was explored to avoid extremity. &lt;/li&gt;
&lt;li&gt;Selection effect and sampling bias had been made aware as well. &lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;From all the above, a clear image appeared &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;to derive the detection prospects of BBHs, &lt;/li&gt;
&lt;li&gt;which are dynamically formed in GCs,&lt;/li&gt;
&lt;li&gt;within 30 Mpc volumetric space&lt;/li&gt;
&lt;li&gt;for space-borne GW detectors&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I followed&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the Fixer Informative Matrix analysis from Cutler and &lt;/li&gt;
&lt;li&gt;configured the BBH database to work with Matt's code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This part of work is included in chapter 6. &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Without further ado, I will walk through the work manuscript-ed in my dissertation in brief and let you question about any part that is particular interesting to your extent.&lt;/p&gt;
&lt;p&gt;Checkout my &lt;a href="pages/research.html"&gt;research work&lt;/a&gt;. &lt;/p&gt;</content><category term="articles"></category></entry><entry><title>Data Management @ LSST</title><link href="/data-management-lsst.html" rel="alternate"></link><published>2017-10-19T00:00:00-05:00</published><updated>2017-10-19T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2017-10-19:/data-management-lsst.html</id><summary type="html">&lt;p&gt;4/24/17&lt;/p&gt;
&lt;h3 id="sqlite-with-python"&gt;SQLite with python&lt;/h3&gt;
&lt;p&gt;Basic operation syntax&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;sqlite3&lt;/span&gt;
&lt;span class="n"&gt;conn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sqlite3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;reintro.db&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;creat&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;operations&lt;/span&gt;
&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&amp;quot;create table PetInfo(&lt;/span&gt;
&lt;span class="s2"&gt;                                    Name text, &lt;/span&gt;
&lt;span class="s2"&gt;                                    Species text,&lt;/span&gt;
&lt;span class="s2"&gt;                                    Age tinyint,&lt;/span&gt;
&lt;span class="s2"&gt;                                    FavoriteFood text&lt;/span&gt;
&lt;span class="s2"&gt;                                    )&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fetchall&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;display&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;      
&lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;commit&lt;/span&gt; &lt;span class="n"&gt;change&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;database&lt;/span&gt;
&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&amp;quot;drop …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;4/24/17&lt;/p&gt;
&lt;h3 id="sqlite-with-python"&gt;SQLite with python&lt;/h3&gt;
&lt;p&gt;Basic operation syntax&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;sqlite3&lt;/span&gt;
&lt;span class="n"&gt;conn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sqlite3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;reintro.db&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
&lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cursor&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;creat&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;operations&lt;/span&gt;
&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&amp;quot;create table PetInfo(&lt;/span&gt;
&lt;span class="s2"&gt;                                    Name text, &lt;/span&gt;
&lt;span class="s2"&gt;                                    Species text,&lt;/span&gt;
&lt;span class="s2"&gt;                                    Age tinyint,&lt;/span&gt;
&lt;span class="s2"&gt;                                    FavoriteFood text&lt;/span&gt;
&lt;span class="s2"&gt;                                    )&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fetchall&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;display&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;cursor&lt;/span&gt;      
&lt;span class="n"&gt;conn&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="n"&gt;commit&lt;/span&gt; &lt;span class="n"&gt;change&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;database&lt;/span&gt;
&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&amp;quot;drop table if exists xxx&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# drop the table if is already exists&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;SDSS  API&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;astroquery.sdss&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SDSS&lt;/span&gt;
&lt;span class="n"&gt;SDSS&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;query_sql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&amp;quot;select top 20 * from PhotoObjAll&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;demonstration of Join:
&lt;img src="https://www.dropbox.com/s/c8tutz6p5f9gvmj/Screenshot%202017-04-24%2011.29.49.png?raw=1" /&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;4/25/17&lt;/p&gt;
&lt;h2 id="sql-byyusra-alsayyad"&gt;SQL byYusra AlSayyad&lt;/h2&gt;
&lt;p&gt;Data Management: building database, storing data&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SQL database&lt;/li&gt;
&lt;li&gt;Relational Algebra, not good for graph structure&lt;/li&gt;
&lt;li&gt;combined -&amp;gt; pandas by Wes McKinney&lt;/li&gt;
&lt;li&gt;TOPCAT: Relational database with uncertainty&lt;/li&gt;
&lt;li&gt;Indexing: optimize data extracture and slicing&lt;/li&gt;
&lt;li&gt;hierarchical triangular mesh, reduce 2D to 1D for GIS indexing &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;SQL examples for inspiration&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;database&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mysql_demo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;use&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mysql_demo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;TABLE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;personId&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;firstName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;lastName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;phoneNumber&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;char&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;TABLE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Publication&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;pubId&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;journalName&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INTO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;VALUES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Cameron&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Hummels&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;1234567890&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INTO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;VALUES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Y&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;A&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;1234567890&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INTO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Publication&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;VALUES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Stuff about stars&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Apj&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INTO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Publication&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;VALUES&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;102&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Stuff about galaxies&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Apj&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;show&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;tables&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;TABLE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Authorship&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;relational&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dababase&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;personId&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;pubId&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INTO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Authorship&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VALUE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INTO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Authorship&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VALUE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;102&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INTO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Authorship&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VALUE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INTO&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Authorship&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;VALUE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;102&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pub&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;publication&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pub&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;INNER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Authorship&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;on&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pubId&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pub&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pubId&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;INNER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Person&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;on&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;personId&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;personId&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INDEX&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;key&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;On&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TOP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ra&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;dec&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rerun&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;camcol&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;specobjid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;class&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;redshift&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;plate&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mjd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fiberid&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PhotoObj&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SpecObj&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bestobjid&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objid&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BETWEEN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BETWEEN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;AND&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;top&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;photoobjall&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;inner&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;join&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ROSAT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;on&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objid&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objid&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_u&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_r&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_z&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;

&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;photoobjall&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;rosat&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objid&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objid&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;WHERE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_u&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_g&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_r&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cModelFlux_z&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pr&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;LEFT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;JOIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;specobjall&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bestobjid&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objid&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bestobjid&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;null&lt;/span&gt;

&lt;span class="k"&gt;GROUP&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BY&lt;/span&gt;

&lt;span class="k"&gt;ORDER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BY&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ASC&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;DEC&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;4/26/17&lt;/p&gt;
&lt;h2 id="data-management-extracting-data"&gt;Data Management: extracting data&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Scaling up -&amp;gt; scaling out&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Hardware Architecture&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Parallel RDMS Architecture: shared nothing&lt;/li&gt;
&lt;li&gt;Partitioning: spatical indexing&lt;ul&gt;
&lt;li&gt;fast extracting regional data in high dimension&lt;/li&gt;
&lt;li&gt;random distribute data based on hash table to balance load&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Shared scanning&lt;/li&gt;
&lt;li&gt;Fault tolerance&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Software&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Spark, HDFS solution&lt;/li&gt;
&lt;li&gt;Hadoop Distributed Files System, HDFS&lt;/li&gt;
&lt;li&gt;MapReduce&lt;/li&gt;
&lt;li&gt;Relation (shcema)&lt;/li&gt;
&lt;li&gt;Indexing&lt;/li&gt;
&lt;li&gt;Eventually -&amp;gt; &lt;code&gt;database&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;NoSQL: not only SQL, non-relational (no schema)&lt;/li&gt;
&lt;li&gt;MongoDB&lt;/li&gt;
&lt;li&gt;DynamoDB&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;li&gt;Aggregation-oriented database&lt;/li&gt;
&lt;li&gt;pros: same type of aggregated data&lt;/li&gt;
&lt;li&gt;cons: hard to slice and dice&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://github.com/lsst/qserv"&gt;LSST QSERV&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;10/19/17&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Resources&lt;/strong&gt;
* &lt;a href="https://sqlnotebook.com/index.html"&gt;SQL notebook&lt;/a&gt;
* &lt;a href="https://www.khanacademy.org/computing/computer-programming/sql/more-advanced-sql-queries/p/calculating-results-with-case"&gt;SQL course on KhanAcademy&lt;/a&gt;&lt;/p&gt;</content><category term="study-notes"></category></entry><entry><title>Machine Learning with MLLib and GraphX @ TACC</title><link href="/machine-learning-with-mllib-and-graphx-tacc.html" rel="alternate"></link><published>2017-05-04T00:00:00-05:00</published><updated>2017-05-04T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2017-05-04:/machine-learning-with-mllib-and-graphx-tacc.html</id><summary type="html">&lt;p&gt;&lt;a href="mailto:zzhang@tacc.utexas.edu"&gt;Zhao Zhang&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.dropbox.com/s/j5mdtxswiolz26a/Screenshot%202017-05-05%2012.02.05.png?raw=1" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Supervised Learning&lt;/li&gt;
&lt;li&gt;Linear Regression&lt;/li&gt;
&lt;li&gt;Classification&lt;ul&gt;
&lt;li&gt;Logistic Regression&lt;/li&gt;
&lt;li&gt;Support Vector Machine: good for non-linear classification&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Unsupervised Learning&lt;/li&gt;
&lt;li&gt;Lower dimension representation&lt;ul&gt;
&lt;li&gt;Principle Component Analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Spare representation&lt;ul&gt;
&lt;li&gt;K-Means&lt;/li&gt;
&lt;li&gt;Gaussian Mixture Models&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Independent representation&lt;ul&gt;
&lt;li&gt;Principle Component Analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="cost-function"&gt;Cost Function&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Regularization&lt;/li&gt;
&lt;li&gt;Maximum Likelihood&lt;/li&gt;
&lt;li&gt;KL divergence&lt;/li&gt;
&lt;li&gt;cross-entropy&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="graph-processing"&gt;Graph Processing&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;frameworks&lt;/li&gt;
&lt;li&gt;PageRank: direct graph by …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;&lt;a href="mailto:zzhang@tacc.utexas.edu"&gt;Zhao Zhang&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.dropbox.com/s/j5mdtxswiolz26a/Screenshot%202017-05-05%2012.02.05.png?raw=1" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Supervised Learning&lt;/li&gt;
&lt;li&gt;Linear Regression&lt;/li&gt;
&lt;li&gt;Classification&lt;ul&gt;
&lt;li&gt;Logistic Regression&lt;/li&gt;
&lt;li&gt;Support Vector Machine: good for non-linear classification&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Unsupervised Learning&lt;/li&gt;
&lt;li&gt;Lower dimension representation&lt;ul&gt;
&lt;li&gt;Principle Component Analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Spare representation&lt;ul&gt;
&lt;li&gt;K-Means&lt;/li&gt;
&lt;li&gt;Gaussian Mixture Models&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Independent representation&lt;ul&gt;
&lt;li&gt;Principle Component Analysis&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="cost-function"&gt;Cost Function&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Regularization&lt;/li&gt;
&lt;li&gt;Maximum Likelihood&lt;/li&gt;
&lt;li&gt;KL divergence&lt;/li&gt;
&lt;li&gt;cross-entropy&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="graph-processing"&gt;Graph Processing&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;frameworks&lt;/li&gt;
&lt;li&gt;PageRank: direct graph by Google&lt;/li&gt;
&lt;li&gt;Pregel&lt;/li&gt;
&lt;li&gt;Giraph&lt;/li&gt;
&lt;li&gt;GraphLab&lt;/li&gt;
&lt;li&gt;GraphX&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="graphx"&gt;GraphX&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;GraphX abstracts a graph with an RDD of vertices and an RDD of edges&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://spark.apache.org/docs/0.9.1/graphx-programming-guide.html"&gt;graphx from Apache Spark&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.dropbox.com/s/y809vf5vyv07q6y/Screenshot%202017-05-05%2012.58.52.png?raw=1" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Connectd Components: &lt;code&gt;org.apache.spark.graphx.lib.connectedComponents&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Triangle Counting: &lt;code&gt;org.apache.spark.graphx.lib.triangleCount&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Shortest Paths: &lt;code&gt;org.apache.spark.graphx.lib.Shortestpaths&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;</content><category term="study-notes"></category></entry><entry><title>Scala/Spark @ TACC</title><link href="/scalaspark-tacc.html" rel="alternate"></link><published>2017-05-04T00:00:00-05:00</published><updated>2017-05-04T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2017-05-04:/scalaspark-tacc.html</id><summary type="html">&lt;p&gt;4/20/17 &lt;/p&gt;
&lt;h2 id="introduction-to-hadoop-and-spark"&gt;Introduction to Hadoop and Spark&lt;/h2&gt;
&lt;p&gt;Dr. Weijia Xu, Dr. Ruizhu Huang @ UTA&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hadoop and Spark on Wrangler&lt;/li&gt;
&lt;li&gt;Scala/Spark&lt;/li&gt;
&lt;li&gt;Data Analysis Using Hadoop/Spark&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://www.dropbox.com/s/bnoc10ju03mzgk6/Screenshot%202017-04-20%2013.33.00.png?raw=1" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=KByS8QYpamw"&gt;Webcast&lt;/a&gt;
&lt;a href="https://public.etherpad-mozilla.org/p/Intro_Hadoop_and_Spark_on_Wrangler"&gt;Discussion&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="big-data-vs-hpc"&gt;Big Data v.s. HPC&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Traditional&lt;/li&gt;
&lt;li&gt;separate data&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MPI code to use multiple nodes&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MapReduce: programing model, platform for customized computation …&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;4/20/17 &lt;/p&gt;
&lt;h2 id="introduction-to-hadoop-and-spark"&gt;Introduction to Hadoop and Spark&lt;/h2&gt;
&lt;p&gt;Dr. Weijia Xu, Dr. Ruizhu Huang @ UTA&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Hadoop and Spark on Wrangler&lt;/li&gt;
&lt;li&gt;Scala/Spark&lt;/li&gt;
&lt;li&gt;Data Analysis Using Hadoop/Spark&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://www.dropbox.com/s/bnoc10ju03mzgk6/Screenshot%202017-04-20%2013.33.00.png?raw=1" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=KByS8QYpamw"&gt;Webcast&lt;/a&gt;
&lt;a href="https://public.etherpad-mozilla.org/p/Intro_Hadoop_and_Spark_on_Wrangler"&gt;Discussion&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="big-data-vs-hpc"&gt;Big Data v.s. HPC&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Traditional&lt;/li&gt;
&lt;li&gt;separate data&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MPI code to use multiple nodes&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;MapReduce: programing model, platform for customized computation&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;move computations to data, reduce data transfer&lt;/li&gt;
&lt;li&gt;sequential execute, same as RDBMS&lt;/li&gt;
&lt;li&gt;scale out, not scale up&lt;/li&gt;
&lt;li&gt;hardware indepedent&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="hadoop"&gt;Hadoop&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;distributed data&lt;/li&gt;
&lt;li&gt;key-value pair&lt;/li&gt;
&lt;li&gt;computation&lt;/li&gt;
&lt;li&gt;map instances&lt;/li&gt;
&lt;li&gt;reduce instances&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://www.dropbox.com/s/yn0bhgwvc0nui9n/Screenshot%202017-04-20%2013.28.13.png?raw=1" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;support at TACC&lt;/strong&gt;
* hadoop: open source implementation of MapReduce, programming in JAVA but interface to others
* zeppelin: similiar to jupyter, hundreds of interpretator
* spark, in-memory&lt;/p&gt;
&lt;h2 id="hadoop-and-yarn"&gt;Hadoop and Yarn&lt;/h2&gt;
&lt;p&gt;&lt;img src="https://www.dropbox.com/s/62m198hltjwt154/Screenshot%202017-04-20%2013.37.51.png?raw=1"  /&gt;&lt;/p&gt;
&lt;h3 id="procedure"&gt;Procedure&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;input&lt;/li&gt;
&lt;li&gt;splitting&lt;/li&gt;
&lt;li&gt;mapping&lt;/li&gt;
&lt;li&gt;shuffling&lt;/li&gt;
&lt;li&gt;reducing&lt;/li&gt;
&lt;li&gt;final result&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://portal.wrangler.tacc.utexas.edu/"&gt;Wrangler portal&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Manage -&amp;gt; create hadoop reservation&lt;/p&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;VNC job: access VNC at &lt;code&gt;vis.tacc.utexas.edu&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;check cluster info. and hadoop job status&lt;/li&gt;
&lt;li&gt;idev job&lt;/li&gt;
&lt;li&gt;manage data in &amp;amp; out&lt;/li&gt;
&lt;li&gt;submit Hadoop jobs&lt;/li&gt;
&lt;li&gt;test, dev, debug&lt;/li&gt;
&lt;li&gt;batch job: submit jobs to YARN resource manager&lt;/li&gt;
&lt;li&gt;large analysis job&lt;/li&gt;
&lt;li&gt;sequentially jobs&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# manage&lt;/span&gt;
&lt;span class="c1"&gt;## check reservation&lt;/span&gt;
scontrol&lt;span class="w"&gt; &lt;/span&gt;show&lt;span class="w"&gt; &lt;/span&gt;reservation

&lt;span class="c1"&gt;## load module and idev to compute node&lt;/span&gt;
module&lt;span class="w"&gt; &lt;/span&gt;load&lt;span class="w"&gt; &lt;/span&gt;hadoop-paths
idev&lt;span class="w"&gt; &lt;/span&gt;–r&lt;span class="w"&gt; &lt;/span&gt;hadoop+TRAINING-HPC+2186&lt;span class="w"&gt; &lt;/span&gt;–m&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;240&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;–p&lt;span class="w"&gt; &lt;/span&gt;hadoop&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# -m for minutes&lt;/span&gt;

&lt;span class="c1"&gt;## file system operations&lt;/span&gt;
hadoop&lt;span class="w"&gt; &lt;/span&gt;fs&lt;span class="w"&gt; &lt;/span&gt;-ls/mkdir/put/get/stat/cat/tail/setrep&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;#set replication factor&lt;/span&gt;

&lt;span class="c1"&gt;## YARN, run jobs&lt;/span&gt;
yarn&lt;span class="w"&gt; &lt;/span&gt;jar&lt;span class="w"&gt; &lt;/span&gt;/&lt;span class="w"&gt; &lt;/span&gt;hadoop&lt;span class="w"&gt; &lt;/span&gt;jar&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# for java&lt;/span&gt;
yarn&lt;span class="w"&gt; &lt;/span&gt;application&lt;span class="w"&gt; &lt;/span&gt;-list/kill/appStates/appTypes
&lt;span class="w"&gt;     &lt;/span&gt;node&lt;span class="w"&gt; &lt;/span&gt;-list
&lt;span class="w"&gt;     &lt;/span&gt;logs

&lt;span class="c1"&gt;## upload data&lt;/span&gt;
hadoop&lt;span class="w"&gt; &lt;/span&gt;fs&lt;span class="w"&gt; &lt;/span&gt;-put&lt;span class="w"&gt; &lt;/span&gt;local_data&lt;span class="w"&gt; &lt;/span&gt;data

&lt;span class="c1"&gt;## running hadoop&lt;/span&gt;
hadoop&lt;span class="w"&gt; &lt;/span&gt;jar&lt;span class="w"&gt; &lt;/span&gt;/usr/lib/hadoop-mapreduce/hadoop-mapreduce-&lt;span class="w"&gt; &lt;/span&gt;examples.jar&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
wordcount&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="c1"&gt;#java class name to run&lt;/span&gt;
-D&lt;span class="w"&gt; &lt;/span&gt;mapred.map.tasks&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="c1"&gt;#number of mapper instance &lt;/span&gt;
-D&lt;span class="w"&gt; &lt;/span&gt;mapred.reduce.tasks&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;256&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="c1"&gt;# number of reducer instance&lt;/span&gt;
/tmp/data/enwiki-20120104-pages-articles.xml&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="c1"&gt;#input file on hdfs&lt;/span&gt;
wiki_wc&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;#folder to store the output&lt;/span&gt;

&lt;span class="c1"&gt;## get results&lt;/span&gt;
hadoop&lt;span class="w"&gt; &lt;/span&gt;fs&lt;span class="w"&gt; &lt;/span&gt;–get&lt;span class="w"&gt; &lt;/span&gt;/tmp/wiki_wc&lt;span class="w"&gt; &lt;/span&gt;wiki_wc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2 id="hadoop-api"&gt;Hadoop API&lt;/h2&gt;
&lt;p&gt;Check example at &lt;code&gt;/Users/domi/Dropbox/Open_Course/TACC webinars/Hadoop_Spark/hadoop-training&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# recap of hadoop streaming&lt;/span&gt;
hadoop&lt;span class="w"&gt; &lt;/span&gt;jar&lt;span class="w"&gt; &lt;/span&gt;/usr/lib/hadoop-mapreduce/hadoop-streaming.jar
-input&lt;span class="w"&gt; &lt;/span&gt;/path/to/input/in/hdfs
-output&lt;span class="w"&gt; &lt;/span&gt;/path/to/output/in/hdfs
-D&lt;span class="w"&gt; &lt;/span&gt;mapred.map.tasks&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;500&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="c1"&gt;#number of mapper instance &lt;/span&gt;
-D&lt;span class="w"&gt; &lt;/span&gt;mapred.reduce.tasks&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;256&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\ &lt;/span&gt;&lt;span class="c1"&gt;# number of reducer instance&lt;/span&gt;
-mapper&lt;span class="w"&gt; &lt;/span&gt;map_implementation&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;## can use other languages&lt;/span&gt;
-reducer&lt;span class="w"&gt; &lt;/span&gt;reduce_implementation
-file&lt;span class="w"&gt; &lt;/span&gt;map&lt;span class="w"&gt; &lt;/span&gt;system
-file&lt;span class="w"&gt; &lt;/span&gt;reduce&lt;span class="w"&gt; &lt;/span&gt;system.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="vs-spark"&gt;vs Spark&lt;/h3&gt;
&lt;p&gt;&lt;img src="https://www.dropbox.com/s/a5kv07y2p7e68we/Screenshot%202017-04-20%2015.10.53.png?raw=1" /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Spark is faster&lt;/li&gt;
&lt;li&gt;more language support&lt;/li&gt;
&lt;li&gt;MLib for Machine Learning&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="zeppelin"&gt;Zeppelin&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;web-based notebook&lt;/li&gt;
&lt;li&gt;interactive&lt;/li&gt;
&lt;li&gt;visualization&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Zepplelin&lt;/span&gt;
cp&lt;span class="w"&gt; &lt;/span&gt;/data/apps/.zeppelin/job.zeppelin&lt;span class="w"&gt; &lt;/span&gt;.
sbatch&lt;span class="w"&gt; &lt;/span&gt;--reservation&lt;span class="o"&gt;=&lt;/span&gt;hadoop+TRAINING-HPC+2186&lt;span class="w"&gt; &lt;/span&gt;job.zeppelin
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="http://wrangler.tacc.utexas.edu"&gt;web-UI&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nf"&gt;%spark&lt;/span&gt;

&lt;span class="cp"&gt;# with Python&lt;/span&gt;
&lt;span class="nf"&gt;%pyspark&lt;/span&gt;

&lt;span class="cp"&gt;# with R&lt;/span&gt;
&lt;span class="nf"&gt;%spark&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;

&lt;span class="nf"&gt;%sh&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="contacts"&gt;Contacts&lt;/h3&gt;
&lt;p&gt;&lt;a href="data@tacc.utexas.edu"&gt;Data Group @ TACC&lt;/a&gt;
&lt;a href="xwj@tacc.utexas.edu"&gt;Weijia Xu&lt;/a&gt; 
&lt;a href="rhuang@tacc.utexas.edu"&gt;Ruizhu Huang&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;04/27/2017&lt;/p&gt;
&lt;h2 id="programming-with-scalaspark"&gt;Programming with Scala/Spark&lt;/h2&gt;
&lt;p&gt;Zhao Zhang&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Wrangler Setup&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;idev&lt;span class="w"&gt; &lt;/span&gt;-r&lt;span class="w"&gt; &lt;/span&gt;hadoop+TRAINING-HPC+2187&lt;span class="w"&gt; &lt;/span&gt;-t&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;240&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/opt/apps/scala/scala-2.11.8/bin:&lt;span class="nv"&gt;$PATH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="scala"&gt;Scala&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://www.scala-lang.org/api/2.11.8/#package"&gt;Google Scala API&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Mutable, &lt;code&gt;var&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Immutable, &lt;code&gt;val&lt;/code&gt;: cannot be reassigned&lt;/li&gt;
&lt;li&gt;Primitive types&lt;/li&gt;
&lt;li&gt;Double, Float, Long, Int, Short, Byte: &lt;code&gt;val a: Double = 5&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Char, Boolean, Unit&lt;/li&gt;
&lt;li&gt;Composite variables&lt;/li&gt;
&lt;li&gt;List, Map, Seq, Set, Tuple&lt;ul&gt;
&lt;li&gt;List: immutable for length and element; mutable counter-structure: &lt;code&gt;val l = new ListBuffer[Int/Double]()&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;(), head, last, length, reverse, sorted&lt;/li&gt;
&lt;li&gt;Tuple: &lt;code&gt;val t = (1,2,3)&lt;/code&gt;, &lt;code&gt;t._1 &amp;gt; Int = 1&lt;/code&gt;, &lt;code&gt;val(i,j,k) = t&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Function&lt;/li&gt;
&lt;li&gt;&lt;code&gt;(x: Int) =&amp;gt; {\n println(x) \n x * 2 \n}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;map((x: Int)/x =&amp;gt; x * 2)&lt;/code&gt; or &lt;code&gt;map(_ * 2)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;multiple parameters: &lt;code&gt;x: (Int, Int) =&amp;gt; x._1 + x._1&lt;/code&gt; or &lt;code&gt;case (x,y) =&amp;gt; x+y&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;multiple return: &lt;code&gt;(x: Int, y: Int) =&amp;gt; (x+3, y+5)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;name function: &lt;code&gt;def func(x: Int): Int = x * x&lt;/code&gt; as &lt;code&gt;(x: Int) =&amp;gt; x * x&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Control Flow&lt;/li&gt;
&lt;li&gt;Loop &lt;ul&gt;
&lt;li&gt;&lt;code&gt;while ( i &amp;lt; l.length ) {}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;for ( i &amp;lt;- l )&lt;/code&gt;, &lt;code&gt;&amp;lt;-&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;l.foreach(x =&amp;gt; xxx )&lt;/code&gt;, &lt;code&gt;=&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;l.map(x =&amp;gt; ...)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;If ... else ...: &lt;code&gt;l.foreach(x =&amp;gt; {if (x%2 == 1) println(x)})&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Pattern matching: &lt;code&gt;l.foreach(x =&amp;gt; x%2 match {case 1 =&amp;gt; println(x)  case_ =&amp;gt; })&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Iterator&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;##&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;compile&lt;/span&gt;
&lt;span class="n"&gt;scalac&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;xxx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scala&lt;/span&gt;
&lt;span class="o"&gt;##&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;execute&lt;/span&gt;
&lt;span class="n"&gt;scala&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;xxx&lt;/span&gt;

&lt;span class="o"&gt;##&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;vs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;
&lt;span class="kd"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;immutable&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;variable&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;can&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;be&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;reassigned&lt;/span&gt;

&lt;span class="o"&gt;##&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mutable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pointer&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;scala&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nn"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nn"&gt;mutable&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ListBuffer&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;ListBuffer&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;Any&lt;/span&gt;&lt;span class="p"&gt;]()&lt;/span&gt;
&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="o"&gt;##&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;loop&lt;/span&gt;
&lt;span class="kd"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nc"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;type&lt;/span&gt;&lt;span class="nc"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;Int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;Float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;Double&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;foreach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;match&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="kd"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;toIterator&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pointer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nc"&gt;List&lt;/span&gt;
&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;hasNext&lt;/span&gt;
&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;next&lt;/span&gt;
&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;toList&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;reverse&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;rest&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;list&lt;/span&gt;

&lt;span class="nc"&gt;Thread&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="rdd-resilient-distributed-dataset"&gt;RDD: Resilient Distributed Dataset&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;immutable, partitioned collection of elements that can be operated on in parallel&lt;/code&gt;
Programming Models
* Transformations
  * map: &lt;code&gt;val r = l.map(x =&amp;gt; x*2)&lt;/code&gt;, &lt;code&gt;List(2,4,6,8,10)&lt;/code&gt;
  * filter: &lt;code&gt;val r = l.filter(x =&amp;gt; x%2 == 0)&lt;/code&gt;, &lt;code&gt;List(2,4)&lt;/code&gt;
  * groupBy: &lt;code&gt;val r = l.groupBy(x =&amp;gt; x%2)&lt;/code&gt;, &lt;code&gt;Map(1 -&amp;gt; List(1, 3, 5), 0 -&amp;gt; List(2, 4))&lt;/code&gt;
  * textFile: &lt;code&gt;val lines = sc.textFile(“path-to-file”)&lt;/code&gt;
  * binaryFiles: &lt;code&gt;val rdd = sc.binaryFiles(“path-to-file”)&lt;/code&gt;
* Actions
  * count: &lt;code&gt;val r = l.count(x =&amp;gt; x%2 == 0)&lt;/code&gt;, &lt;code&gt;2&lt;/code&gt;
  * collect
  * take
  * reduce
  * saveAsTextFiles&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="using-scalaspark"&gt;Using Scala/Spark&lt;/h2&gt;
&lt;p&gt;Weijia Xu&lt;/p&gt;
&lt;p&gt;Start zepplin on Wrangler:
&lt;code&gt;sbatch --reservation hadoop+TRAINING-HPC+2188
-A TRAINING-HPC /data/apps/.zeppelin/job.zeppelin.work -t 240&lt;/code&gt;&lt;/p&gt;
&lt;h3 id="data-apis"&gt;Data APIs&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;RDD: Resilient Distributed Dataset&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rdd.map(x =&amp;gt; x*2)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rdd.reduce(_+_)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;rdd.filter(_%3 == 0)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;DataFrame: since 1.3&lt;/li&gt;
&lt;li&gt;Abstract API, on top of RDD&lt;/li&gt;
&lt;li&gt;Schema &lt;/li&gt;
&lt;li&gt;off-heap storage, both memory &amp;amp; hard drive&lt;/li&gt;
&lt;li&gt;DataSet: since 1.6&lt;/li&gt;
&lt;li&gt;Spark 2.x: &lt;code&gt;dataframe = dataset[row]&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;RDD vs DataFrame vs DataSet&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;rdd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nv"&gt;sc&lt;/span&gt;.&lt;span class="nv"&gt;parallelize&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;until&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Conversion&lt;/span&gt;
##&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;DF&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;RDD&lt;/span&gt;
&lt;span class="nv"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;car_rdd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;df&lt;/span&gt;.&lt;span class="nv"&gt;rdd&lt;/span&gt;
##&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;RDD&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;DF&lt;/span&gt;
&lt;span class="nv"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;rdd_df&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;rdd&lt;/span&gt;.&lt;span class="nv"&gt;toDF&lt;/span&gt;
##&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;RDD&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;DS&lt;/span&gt;
&lt;span class="nv"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;rdd_ds&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;rdd&lt;/span&gt;.&lt;span class="nv"&gt;toDS&lt;/span&gt;

#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Functions&lt;/span&gt;
&lt;span class="nv"&gt;df&lt;/span&gt;.&lt;span class="k"&gt;show&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;df&lt;/span&gt;.&lt;span class="nv"&gt;printSchema&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;types&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;keys&lt;/span&gt;
&lt;span class="nv"&gt;df&lt;/span&gt;.&lt;span class="nv"&gt;describe&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;cols&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;

&lt;span class="nv"&gt;rdd&lt;/span&gt;.&lt;span class="nv"&gt;filter&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;.&lt;span class="nv"&gt;collect&lt;/span&gt;
&lt;span class="nv"&gt;rdd_df&lt;/span&gt;.&lt;span class="nv"&gt;filter&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;value &amp;lt; 10&amp;quot;&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;.&lt;span class="k"&gt;show&lt;/span&gt;
&lt;span class="nv"&gt;rdd_ds&lt;/span&gt;.&lt;span class="nv"&gt;filter&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;value &amp;lt; 10&amp;quot;&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;.&lt;span class="k"&gt;show&lt;/span&gt;
&lt;span class="nv"&gt;rdd_ds&lt;/span&gt;.&lt;span class="nv"&gt;filter&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;.&lt;span class="k"&gt;show&lt;/span&gt;

&lt;span class="nv"&gt;rdd&lt;/span&gt;.&lt;span class="nv"&gt;map&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;.&lt;span class="nv"&gt;collect&lt;/span&gt;
&lt;span class="nv"&gt;rdd_ds&lt;/span&gt;.&lt;span class="nv"&gt;map&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;.&lt;span class="k"&gt;show&lt;/span&gt;
&lt;span class="nv"&gt;rdd_df&lt;/span&gt;.&lt;span class="nv"&gt;map&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;_&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;.&lt;span class="k"&gt;show&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;will&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;work&lt;/span&gt;
&lt;span class="nv"&gt;rdd_df&lt;/span&gt;.&lt;span class="nv"&gt;select&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="err"&gt;&amp;#39;value * 2).show&lt;/span&gt;

&lt;span class="err"&gt;# Spark SQL&lt;/span&gt;
&lt;span class="err"&gt;df.select($&amp;quot;model&amp;quot;, $&amp;quot;mpg&amp;quot; * 1.6).filter(&amp;quot;mpg &amp;gt; 4&amp;quot;).show&lt;/span&gt;
&lt;span class="err"&gt;df.groupBy(&amp;quot;mpg&amp;quot;).count().show&lt;/span&gt;
&lt;span class="err"&gt;df.createOrReplaceTempView(&amp;quot;cars&amp;quot;)&lt;/span&gt;
&lt;span class="err"&gt;spark.sql(&amp;quot;SELECT col1, col2, ...&lt;/span&gt;
&lt;span class="err"&gt;           FROM table1, table2, ...&lt;/span&gt;
&lt;span class="err"&gt;           [WHERE condition1, AND|OR condition2 ...]&lt;/span&gt;
&lt;span class="err"&gt;           [GROUPBY col1, ...]&lt;/span&gt;
&lt;span class="err"&gt;           [ORDERBY col1, ...]&amp;quot;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="io-in-spark"&gt;IO in Spark&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;File format&lt;/li&gt;
&lt;li&gt;JSON: schema&lt;/li&gt;
&lt;li&gt;parquet, ORC: JSON with compression&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;path prefix&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;default: &lt;code&gt;hdfs:///&lt;/code&gt; -&amp;gt; &lt;code&gt;/tmp/data&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;specify: &lt;code&gt;file:///&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;file/folder&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;automatically read all files within directory&lt;/li&gt;
&lt;li&gt;use directory to separate data&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;existing file&lt;/strong&gt;: &lt;code&gt;mode(error/append/overwrite/ignore)&lt;/code&gt;, default is error&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Read CSV file&lt;/span&gt;
&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;spark&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="n"&gt;header&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;“&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;tmp&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mtcars&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="err"&gt;”&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;show&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# More Files&lt;/span&gt;
&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;cars.json&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parquet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;cars.parquet&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;write&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;option&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;delimiter&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;cars.tab&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;df_json&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;spark&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;cars.json&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;df_parquet&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;spark&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parquet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;cars.parquet&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="workflow"&gt;Workflow&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;prepare datasets&lt;/li&gt;
&lt;li&gt;&lt;code&gt;val cars = spark.read.format("csv").option(...).load("path_to_file").selectExpr("mpg + 0.0 as mpg", "cyl + 0.0 as label")&lt;/code&gt;: easy convert to double&lt;/li&gt;
&lt;li&gt;&lt;code&gt;val training = cars.sample(false, fraction)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;val test = cars.except(training)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;assemble feature&lt;/li&gt;
&lt;li&gt;&lt;code&gt;val assembler = new VectorAssembler().setInputCols(Array('key1', ...)).setOutputCol('features')&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;val lr = new LogisticRegression().setMaxIter(10).setRegParam(0.2).setElasticNetParam(0.0)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;define analysis&lt;/li&gt;
&lt;li&gt;&lt;code&gt;val pipeline = new Pipeline().setStages(Array(assembler, lr))&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;run analysis&lt;/li&gt;
&lt;li&gt;&lt;code&gt;val lrModel = pipeline.fit(training)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;results&lt;/li&gt;
&lt;li&gt;&lt;code&gt;result = lrModel.transform(test).select('model, 'lable, 'prediction)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Spark Architecture&lt;/strong&gt;
* Create RDDs
  * HadoopRDD: &lt;code&gt;val lines = sc.textFile("hdfs://names")&lt;/code&gt;
  * MapPartitionsRDD: &lt;code&gt;val kvp = lines.map(name =&amp;gt; (name(0), name))&lt;/code&gt;
  * ShuffledRDD: &lt;code&gt;val groups = kvp.groupByKey()&lt;/code&gt;
  * MapPartitionsRDD: &lt;code&gt;val res = groups.mapvalues(names =&amp;gt; names.toSet.size)&lt;/code&gt;
  * collect()
* RDD Dependency
  * Narrow: One To One
  * Shuffle Dependency: 
* DAG(Directed Acyclic Graph) Generation
  * stage 0: HadoopRDD, MapPartitionsRDD
  * stage 1: ShuffledRDD, MapPartitionsRDD
* Schedule Tasks
  * split each stage into tasks based on partition
  * reversed order, recursively find parent stages
  * blocking between stages&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;delay scheduling  &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;spark.locality.wait (default 3s)&lt;br&gt;
spark.locality.wait.process&lt;br&gt;
spark.locality.wait.node&lt;br&gt;
spark.locality.wait.rack  &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Executor Deployment&lt;/li&gt;
&lt;li&gt;Node&lt;/li&gt;
&lt;li&gt;Process: share physical node&lt;/li&gt;
&lt;li&gt;Thread: share physical memory&lt;blockquote&gt;
&lt;p&gt;Spark YARN mode, in conf/spark-env.sh&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;SPARK_EXECUTOR_INSTANCES (default 2)  # Process
SPARK_EXECUTOR_CORES (default 1)  # Thread&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;Memory Management&lt;/li&gt;
&lt;li&gt;Reserved: 300MB, default&lt;/li&gt;
&lt;li&gt;User Memory: 25%, user data structure in RDD (value/variable)&lt;/li&gt;
&lt;li&gt;Execution: internal storage, shuffle buffer on the mapper&lt;ul&gt;
&lt;li&gt;export &lt;code&gt;SPARK_WORKER_MEMORY 96G&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Storage: cache, dynamic, default 0.5 of 75%&lt;ul&gt;
&lt;li&gt;&lt;code&gt;spark.memory.storageFraction&lt;/code&gt; in &lt;code&gt;conf/spark-defaults.conf&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Increase parallelism&lt;ul&gt;
&lt;li&gt;more reducers by setting &lt;code&gt;spark.default.parallelism&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;set number of partitions of the largest parent RDD &lt;code&gt;sc.textFile(path,128)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;YARN: use flag &lt;code&gt;--executor-memory 2g&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content><category term="study-notes"></category></entry><entry><title>Scale Computing on Clusters</title><link href="/scale-computing-on-clusters.html" rel="alternate"></link><published>2017-04-28T00:00:00-05:00</published><updated>2017-04-28T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2017-04-28:/scale-computing-on-clusters.html</id><summary type="html">&lt;h2 id="configure-utilize-hpcs"&gt;Configure &amp;amp; utilize HPCs&lt;/h2&gt;
&lt;p&gt;&lt;a href="nirav@email.arizona.edu"&gt;Nirav Merchant&lt;/a&gt; @CyVerseOrg&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;computational thinking&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;4A: Abstraction, Automation, Ability and Audacity&lt;/li&gt;
&lt;li&gt;establish and manage data driven collaborations at global scale&lt;/li&gt;
&lt;li&gt;efficient and coordinated use of CI resources: NSF XSEDE, iPlant, campus HPC and high bandwidth&lt;/li&gt;
&lt;li&gt;adopting best practices: HEP, Life science&lt;/li&gt;
&lt;li&gt;community driven, self-provisioning, extensible and open …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;h2 id="configure-utilize-hpcs"&gt;Configure &amp;amp; utilize HPCs&lt;/h2&gt;
&lt;p&gt;&lt;a href="nirav@email.arizona.edu"&gt;Nirav Merchant&lt;/a&gt; @CyVerseOrg&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;computational thinking&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;4A: Abstraction, Automation, Ability and Audacity&lt;/li&gt;
&lt;li&gt;establish and manage data driven collaborations at global scale&lt;/li&gt;
&lt;li&gt;efficient and coordinated use of CI resources: NSF XSEDE, iPlant, campus HPC and high bandwidth&lt;/li&gt;
&lt;li&gt;adopting best practices: HEP, Life science&lt;/li&gt;
&lt;li&gt;community driven, self-provisioning, extensible and open source: CISE communities&lt;/li&gt;
&lt;li&gt;NSF Infrastructure&lt;/li&gt;
&lt;li&gt;&lt;code&gt;data rich and knowledge poor&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;NSF XSEDE $121M every 5 year&lt;ul&gt;
&lt;li&gt;support team&lt;/li&gt;
&lt;li&gt;travel support&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Jetstream @ U Indiana&lt;ul&gt;
&lt;li&gt;cmd line, GUI&lt;/li&gt;
&lt;li&gt;DOI, share VMs and then store, publish via IU Scholarworks&lt;/li&gt;
&lt;li&gt;1-44 cpu, OpenStack&lt;/li&gt;
&lt;li&gt;VMs&lt;/li&gt;
&lt;li&gt;Atmosphere web interface&lt;/li&gt;
&lt;li&gt;direct API access via OpenStack cmd line or Horizon&lt;/li&gt;
&lt;li&gt;admin/root&lt;/li&gt;
&lt;li&gt;allocations&lt;/li&gt;
&lt;li&gt;CV for PI, abstract&lt;/li&gt;
&lt;li&gt;Main description&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Technology landscape &lt;/li&gt;
&lt;li&gt;cloud&lt;ul&gt;
&lt;li&gt;image: instance (isolated)&lt;/li&gt;
&lt;li&gt;automation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;containers&lt;ul&gt;
&lt;li&gt;app, bins, libs&lt;/li&gt;
&lt;li&gt;user-end&lt;/li&gt;
&lt;li&gt;docker: docker engine/OS&lt;/li&gt;
&lt;li&gt;singularity&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Toolbox&lt;ul&gt;
&lt;li&gt;Ansible for automation &lt;a href="http://docs.ansible.com/ansible/intro.html"&gt;Ansible&lt;/a&gt;: playbooks, configuration management, deployment, and orchestration&lt;/li&gt;
&lt;li&gt;Docker for execution environment&lt;/li&gt;
&lt;li&gt;Makeflow workqueue for task distribution &lt;a href="http://ccl.cse.nd.edu/software/makeflow/"&gt;makeflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pegasus.isi.edu/"&gt;Pegasus&lt;/a&gt;&lt;blockquote&gt;
&lt;p&gt;High-constrast imaging in the cloud with klipReduce and Findr&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="jetstream-demo"&gt;Jetstream demo&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://use.jetstream-cloud.org"&gt;jetstream homepage&lt;/a&gt;
train56: 091Z67OEe8jE&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create Project&lt;/li&gt;
&lt;li&gt;create image(instance)&lt;/li&gt;
&lt;li&gt;visibility&lt;/li&gt;
&lt;li&gt;excluding folders&lt;/li&gt;
&lt;li&gt;build&lt;/li&gt;
&lt;li&gt;launch image&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;docker&lt;span class="w"&gt; &lt;/span&gt;run&lt;span class="w"&gt; &lt;/span&gt;-it&lt;span class="w"&gt; &lt;/span&gt;--rm&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;8888&lt;/span&gt;:8888&lt;span class="w"&gt; &lt;/span&gt;-v&lt;span class="w"&gt; &lt;/span&gt;/home/train56:/home/jovyan/work/&lt;span class="w"&gt; &lt;/span&gt;jupyter/datascience-notebook

-it:&lt;span class="w"&gt; &lt;/span&gt;interactive
--rm:&lt;span class="w"&gt; &lt;/span&gt;clean&lt;span class="w"&gt; &lt;/span&gt;after&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;done&lt;/span&gt;
-v:&lt;span class="w"&gt; &lt;/span&gt;volumn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Demand
* open innovation, science and collaboration
* complexity of infrastructure
* evolving technology landscape
* data/metadata
* extreme information technology -&amp;gt; renew computational platform every x years&lt;/p&gt;
&lt;h3 id="docker"&gt;Docker&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;docker run -it -p 8888:8888 tensorflow/tensorflow&lt;/code&gt;
&lt;a href="https://hub.docker.com/r/tensorflow/tensorflow/"&gt;tensorflow docker&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://singularity.lbl.gov/"&gt;singularity&lt;/a&gt;: prepare and configure HPCs&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="spark-amazon"&gt;Spark @ Amazon&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Industrial&lt;/strong&gt;
* databricks
* myria
* &lt;a href="http://sortbenchmark.org/"&gt;Daytona sort contest&lt;/a&gt;
* gartner: &lt;a href="http://www.gartner.com/technology/research/methodologies/hype-cycle.jsp"&gt;hyper cycle&lt;/a&gt;
  * 2012 
  * 2014
  * 2016&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Techniques&lt;/strong&gt;
* MapReduce-based
* HPC cluster computing
* Databases
  * Transactional
    * OLTP
  * Analytic (NoSQL)
    * OLAP
  * Latency
  * CAP Theorem&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Partioned data&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Availability
Consistency&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;hadoop REDUNDANCY: default 3, for fault torelance&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id="amazon-demo"&gt;Amazon demo&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://console.aws.amazon.com/console/home"&gt;AWS&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;S3: distributed storage &lt;/li&gt;
&lt;li&gt;EMR: hadoop framework &lt;ul&gt;
&lt;li&gt;create cluster&lt;/li&gt;
&lt;li&gt;hadoop, HBase, Presto, Spark&lt;/li&gt;
&lt;li&gt;instance&lt;/li&gt;
&lt;li&gt;type m4.large&lt;/li&gt;
&lt;li&gt;number: 1 master and x core nodes&lt;/li&gt;
&lt;li&gt;inbound: allow ip&lt;/li&gt;
&lt;li&gt;Zeppelin: notebook format &lt;code&gt;json&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;md&lt;/span&gt;
&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;pyspark&lt;/span&gt;
&lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parallelize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# `from pyspark.context import SparkContest as sc` in python&lt;/span&gt;

&lt;span class="n"&gt;RDD&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;take&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;takeSample&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nb"&gt;map&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;collect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;RDD&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flatmap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;  &lt;span class="c1"&gt;# tuble to list&lt;/span&gt;
&lt;span class="n"&gt;RDD&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;RDD&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;repartition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;RDD&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;groupByKey&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;RDD&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;reduceByKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;sc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;textFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;s3://path_to_file&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="n"&gt;sql&lt;/span&gt;
&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="n"&gt;var&lt;/span&gt;  &lt;span class="c1"&gt;# user-defined paramter&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;LSST, avoid lambda function
Spark: lazy, not computing until request data&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h2 id="xsede-by-tacc"&gt;XSEDE by TACC&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Resources&lt;/li&gt;
&lt;li&gt;HPC&lt;/li&gt;
&lt;li&gt;ECSS: Extended Collaborative Support Service&lt;/li&gt;
&lt;li&gt;Science Gateways&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://www.globus.org/"&gt;globus connect&lt;/a&gt;&lt;/p&gt;</content><category term="study-notes"></category></entry><entry><title>MPI Foundations @ TACC</title><link href="/mpi-foundations-tacc.html" rel="alternate"></link><published>2017-04-14T00:00:00-05:00</published><updated>2017-04-14T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2017-04-14:/mpi-foundations-tacc.html</id><summary type="html">&lt;p&gt;Contact: &lt;a href="eijkhout@tacc.utexas.edu"&gt;Victor Eijkhout&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Res:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=EMPvXAHGn6o"&gt;Webcast I&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=WpzBQcsdgkc"&gt;webcast II&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://public.etherpad-mozilla.org/p/20170414-MPI-Foundations-I"&gt;Discussion I&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://public.etherpad-mozilla.org/p/20170414-MPI-Foundations-II"&gt;Discussion II&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Terminology&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Socket: the processor chip&lt;/li&gt;
&lt;li&gt;Processor: we don’t use that word&lt;/li&gt;
&lt;li&gt;Core: one instruction-stream processing unit &lt;/li&gt;
&lt;li&gt;Process: preferred terminology in talking about MPI.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SPMD model: &lt;code&gt;simple program multiple data&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mpi"&gt;MPI&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;prototype&lt;/code&gt;: declarnation &lt;/p&gt;
&lt;p&gt;Collectives&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Gathering&lt;/li&gt;
&lt;li&gt;reduction: reduce, n …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;Contact: &lt;a href="eijkhout@tacc.utexas.edu"&gt;Victor Eijkhout&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Res:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=EMPvXAHGn6o"&gt;Webcast I&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=WpzBQcsdgkc"&gt;webcast II&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://public.etherpad-mozilla.org/p/20170414-MPI-Foundations-I"&gt;Discussion I&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://public.etherpad-mozilla.org/p/20170414-MPI-Foundations-II"&gt;Discussion II&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Terminology&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Socket: the processor chip&lt;/li&gt;
&lt;li&gt;Processor: we don’t use that word&lt;/li&gt;
&lt;li&gt;Core: one instruction-stream processing unit &lt;/li&gt;
&lt;li&gt;Process: preferred terminology in talking about MPI.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SPMD model: &lt;code&gt;simple program multiple data&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="mpi"&gt;MPI&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;prototype&lt;/code&gt;: declarnation &lt;/p&gt;
&lt;p&gt;Collectives&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Gathering&lt;/li&gt;
&lt;li&gt;reduction: reduce, n to 1  &lt;code&gt;MPI_Reduce&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;gather: collect, subset to one set&lt;/li&gt;
&lt;li&gt;Spreading&lt;/li&gt;
&lt;li&gt;broadcast: identical, 1 to n&lt;/li&gt;
&lt;li&gt;scatter: subsetting &lt;code&gt;MPI_Scatterv&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Reduce&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;send_data&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;use&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;buffer&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;recv_data&lt;/span&gt;,
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;count&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;size&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;x&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;MPI_Datatype&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;datatype&lt;/span&gt;,
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;MPI_Op&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;op&lt;/span&gt;,
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;root&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;#&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;not&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;needed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Allreduce&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;MPI_Comm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;communicator&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;

&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Gather&lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="nv"&gt;void&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nv"&gt;sendbuf&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;sendcnt&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Datatype&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;sendtype&lt;/span&gt;,
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="nv"&gt;void&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nv"&gt;recvbuf&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;recvcnt&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Datatype&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;recvtype&lt;/span&gt;,
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;root&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Comm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;comm&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;

&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Scatter&lt;/span&gt;
&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="ss"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;sendbuf&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;sendcount&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Datatype&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;sendtype&lt;/span&gt;,
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;recvbuf&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;recvcount&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Datatype&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;recvtype&lt;/span&gt;,
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;root&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;MPI_Comm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;comm&lt;/span&gt;&lt;span class="ss"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;MPI_MAX - Returns the maximum element.&lt;/li&gt;
&lt;li&gt;MPI_MIN - Returns the minimum element.&lt;/li&gt;
&lt;li&gt;MPI_SUM - Sums the elements.&lt;/li&gt;
&lt;li&gt;MPI_PROD - Multiplies all elements.&lt;/li&gt;
&lt;li&gt;MPI_LAND - Performs a logical and across the elements.&lt;/li&gt;
&lt;li&gt;MPI_LOR - Performs a logical or across the elements.&lt;/li&gt;
&lt;li&gt;MPI_BAND - Performs a bitwise and across the bits of the elements.&lt;/li&gt;
&lt;li&gt;MPI_BOR - Performs a bitwise or across the bits of the elements.&lt;/li&gt;
&lt;li&gt;MPI_MAXLOC - Returns the maximum value and the rank of the process that owns it.&lt;/li&gt;
&lt;li&gt;MPI_MINLOC - Returns the minimum value and the rank of the process that owns it.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;h3 id="buffer"&gt;buffer&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;void pointer&lt;/code&gt;: memory address of the data&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;C&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;write &amp;amp;x or (void*) &amp;amp;x for scalar&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Python&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;comm.recv, slow but python object; comm.Recv, fast&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://mpitutorial.com/tutorials/mpi-reduce-and-allreduce/"&gt;find max random number with Reduce&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="scan-or-parallel-prefix"&gt;Scan or 'parallel prefix'&lt;/h3&gt;
&lt;h3 id="barrier-synchronize-procs"&gt;&lt;em&gt;Barrier&lt;/em&gt;: Synchronize procs&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;almost never needed&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;only for timing&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="naive-realization"&gt;Naive realization&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;root to all $\alpha + \beta*n$&lt;/li&gt;
&lt;li&gt;better, p2p&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="distributed-data"&gt;Distributed data&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;local_index + rank&lt;/li&gt;
&lt;li&gt;global_index&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="load-balancing"&gt;Load balancing&lt;/h3&gt;
&lt;p&gt;$f(i) = \floor(iN/p)$
given proc $i$: $[f(i),f(i+1)]$&lt;/p&gt;
&lt;h3 id="local-info-exchange"&gt;Local info. exchange&lt;/h3&gt;
&lt;p&gt;Matrices in parallel: distribute domain, not the matrix&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;p2p: ping-pong&lt;/strong&gt;
* two side: A &amp;amp; B
* match: send &amp;amp; recv&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb nb-Type"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MPI_Send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="k"&gt;const&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb nb-Type"&gt;void&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb nb-Type"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MPI_Datatype&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;datatype&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb nb-Type"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb nb-Type"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;MPI_Comm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;comm&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;Semantics&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="n"&gt;IN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;initial&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;address&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;choice&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;IN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;elements&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;non&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;negative&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;integer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;IN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;datatype&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;datatype&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;each&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;send&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;element&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;IN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;rank&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;of&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;destination&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;integer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;IN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;tag&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;integer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;IN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;comm&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;communicator&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="http://mpitutorial.com/tutorials/mpi-send-and-receive/"&gt;send &amp;amp; recv&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;communication across nodes is x100 slower than within nodes&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id="blocking"&gt;Blocking&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;send &amp;amp; recv are blocking operations&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;deadlock&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;receive&lt;/span&gt;
&lt;span class="k"&gt;send&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;might work&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;send&lt;/span&gt;
&lt;span class="nv"&gt;receive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h4 id="bypass-blocking"&gt;Bypass blocking&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;odds &amp;amp; evens: exchange sort, compare-and-swap&lt;/li&gt;
&lt;li&gt;pairwise exchange&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id="non-blocking"&gt;Non-blocking&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;isend, irecv&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;need &lt;code&gt;MPI_Wait&lt;/code&gt; as blocking to refresh the buffer; buffer is safe in blocking comm.
&lt;code&gt;Latency hiding&lt;/code&gt;: don't need to hold until comm is done
&lt;code&gt;TEST&lt;/code&gt;: non-blacking wait, do local work if no incoming msg by test&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4 id="more"&gt;More&lt;/h4&gt;
&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;MPI_Bsend, MPI_Ibsend: buffered send&lt;/li&gt;
&lt;li&gt;MPI_Ssend, MPI_Issend: synchronous send&lt;/li&gt;
&lt;li&gt;MPI_Rsend, MPI_Irsend: ready send&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;One-sided communication: ‘just’ put/get the data somewhere &lt;/li&gt;
&lt;li&gt;Derived data types: send strided/irregular/inhomogeneous data &lt;/li&gt;
&lt;li&gt;Sub-communicators: work with subsets of MPI_COMM_WORLD &lt;/li&gt;
&lt;li&gt;I/O: efficient file operations&lt;/li&gt;
&lt;li&gt;Non-blocking collectives&lt;/li&gt;
&lt;/ul&gt;</content><category term="study-notes"></category></entry><entry><title>Data Management @ TACC</title><link href="/data-management-tacc.html" rel="alternate"></link><published>2017-04-06T00:00:00-05:00</published><updated>2017-04-06T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2017-04-06:/data-management-tacc.html</id><summary type="html">&lt;p&gt;&lt;code&gt;data@tacc.utexas.edu&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;by &lt;strong&gt;Chris Jordan&lt;/strong&gt; &lt;code&gt;ctjordan@tacc.utexas.edu&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=HvAM7RrwQLg"&gt;Webcast&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://public.etherpad-mozilla.org/p/Data_Management_At_TACC"&gt;Discussion&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://portal.tacc.utexas.edu/training#/session/45"&gt;Slides&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="life-cycle-of-the-data"&gt;Life cycle of the data&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Generation for specific purposes&lt;/li&gt;
&lt;li&gt;Creation of metadata&lt;/li&gt;
&lt;li&gt;Direct use in research/experimentation &lt;/li&gt;
&lt;li&gt;Selection and Publication of data&lt;/li&gt;
&lt;li&gt;Retirement of inaccurate/outmoded data&lt;/li&gt;
&lt;li&gt;Archival of not immediately useful data &lt;/li&gt;
&lt;li&gt;Long-term preservation&lt;/li&gt;
&lt;li&gt;Incorporation …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;&lt;code&gt;data@tacc.utexas.edu&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;by &lt;strong&gt;Chris Jordan&lt;/strong&gt; &lt;code&gt;ctjordan@tacc.utexas.edu&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=HvAM7RrwQLg"&gt;Webcast&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://public.etherpad-mozilla.org/p/Data_Management_At_TACC"&gt;Discussion&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://portal.tacc.utexas.edu/training#/session/45"&gt;Slides&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="life-cycle-of-the-data"&gt;Life cycle of the data&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Generation for specific purposes&lt;/li&gt;
&lt;li&gt;Creation of metadata&lt;/li&gt;
&lt;li&gt;Direct use in research/experimentation &lt;/li&gt;
&lt;li&gt;Selection and Publication of data&lt;/li&gt;
&lt;li&gt;Retirement of inaccurate/outmoded data&lt;/li&gt;
&lt;li&gt;Archival of not immediately useful data &lt;/li&gt;
&lt;li&gt;Long-term preservation&lt;/li&gt;
&lt;li&gt;Incorporation into larger repositories&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Open Access, multi-collection repositories&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="collection-structure"&gt;Collection Structure&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;dated, type doc&lt;/li&gt;
&lt;li&gt;consistent in structure&lt;/li&gt;
&lt;li&gt;linkage to background/foreground&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;internal conventions, i.e. norms&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data Management Plan&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="data-type"&gt;Data Type&lt;/h2&gt;
&lt;h3 id="structured"&gt;Structured&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;SQL/RDBMS&lt;/li&gt;
&lt;li&gt;semi-structured, HTML/XML&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="unstructured"&gt;Unstructured&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;NoSQL&lt;/li&gt;
&lt;li&gt;images, audio, mesh data...&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="hdf5-hierarchical-data-formats"&gt;HDF5 - Hierarchical Data Formats&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;self-description&lt;/li&gt;
&lt;li&gt;inclusion of metadata&lt;/li&gt;
&lt;li&gt;coherence in storing output data&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="metadata"&gt;Metadata&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;metadata&lt;/code&gt;: data about data, &lt;em&gt;header&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Provenance: "audit trail" for research&lt;/li&gt;
&lt;li&gt;Reproducibility&lt;/li&gt;
&lt;li&gt;Observational data: date/time/sensor...&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Simulational: software, hardware, exec. params.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;crucial to record AEarlyAP&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;automate extraction/creation&lt;/li&gt;
&lt;li&gt;enforce good recording&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="archiving-research-data"&gt;Archiving Research Data&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Repositories&lt;ul&gt;
&lt;li&gt;centralized&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Accessibility&lt;ul&gt;
&lt;li&gt;maintainace and performance&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Evolving&lt;ul&gt;
&lt;li&gt;flexibility to configure&lt;/li&gt;
&lt;li&gt;seamless transition&lt;/li&gt;
&lt;li&gt;long-term agreement&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Publish-ability &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;scale of data&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Preparation&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;map of data&lt;/li&gt;
&lt;li&gt;mapping as processing&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Execution&lt;ul&gt;
&lt;li&gt;follow practices &amp;amp; permission&lt;/li&gt;
&lt;li&gt;collective note/database/workflow&lt;/li&gt;
&lt;li&gt;batch data management scripts&lt;/li&gt;
&lt;li&gt;cron to automate permissions &amp;amp; movement&lt;/li&gt;
&lt;li&gt;use logs/job output&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;multiple backup&lt;br&gt;
don't use personal hard drive&lt;br&gt;
don't use commercial "cloud" as primary data store&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://bluewaters.ncsa.illinois.edu/webinars"&gt;Workflow Management tutorials&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="tacc-stockyard"&gt;TACC Stockyard&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;$work&lt;/code&gt;: 1TB/2TB by request&lt;/p&gt;
&lt;p&gt;&lt;code&gt;project-term&lt;/code&gt;: 1 year storage&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$scratch&lt;/code&gt;: computational work&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$home&lt;/code&gt;: personal files&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Corral&lt;/code&gt;: 5TB free, open web access, persistent DNS/Web for long-lived URLs, VMs as backend&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;http://www.fishesoftexas.org&lt;br&gt;
http://arctos.database.museum&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;code&gt;Ranch&lt;/code&gt;: 160PB for personal Archive&lt;/p&gt;
&lt;p&gt;&lt;code&gt;XSEDE/Wranger&lt;/code&gt;: 500TB flash HP storage&lt;/p&gt;
&lt;p&gt;&lt;code&gt;GridFTP/Globus Online&lt;/code&gt;: web-based, graphical interfaces, useful for XSEDE&lt;/p&gt;
&lt;p&gt;&lt;code&gt;iRODS&lt;/code&gt;: APIS, web/GUI/cmd, automated enforcement&lt;/p&gt;
&lt;h2 id="get-help"&gt;Get Help&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://portal.tacc.utexas.edu/tacc-consulting/-/consult/tickets/create"&gt;Tickets&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://portal.xsede.org/help-desk"&gt;Help Desk&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content><category term="study-notes"></category></entry><entry><title>Bash Commands</title><link href="/bash-commands.html" rel="alternate"></link><published>2017-01-18T00:00:00-06:00</published><updated>2018-07-24T00:00:00-05:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2017-01-18:/bash-commands.html</id><summary type="html">&lt;p&gt;Practical notes for future references.&lt;/p&gt;
&lt;p&gt;TeX on OS X&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;install the BasicTeX from &lt;a href="http://www.tug.org/mactex/"&gt;MacTeX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;GUI full application: &lt;a href="http://pages.uoregon.edu/koch/texshop/"&gt;TeXshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;lightweight math validator: &lt;a href="https://www.chachatelier.fr/latexit/"&gt;LaTeXit&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# configure&lt;/span&gt;
which&lt;span class="w"&gt; &lt;/span&gt;pdftex
&lt;span class="c1"&gt;# install style fiel&lt;/span&gt;
tlmgr&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;basic Encrypt &amp;amp; Decrypt&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;openssl&lt;span class="w"&gt; &lt;/span&gt;enc&lt;span class="w"&gt; &lt;/span&gt;-in&lt;span class="w"&gt; &lt;/span&gt;foo.bar&lt;span class="o"&gt;[&lt;/span&gt;.enc&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;                     &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-d&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-aes-256-cbc&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;                     &lt;/span&gt;-pass&lt;span class="w"&gt; &lt;/span&gt;stdin&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;                     &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;foo.bar.enc&lt;span class="w"&gt; &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;system&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;scheduling&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# backend&lt;/span&gt;
crontab …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;Practical notes for future references.&lt;/p&gt;
&lt;p&gt;TeX on OS X&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;install the BasicTeX from &lt;a href="http://www.tug.org/mactex/"&gt;MacTeX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;GUI full application: &lt;a href="http://pages.uoregon.edu/koch/texshop/"&gt;TeXshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;lightweight math validator: &lt;a href="https://www.chachatelier.fr/latexit/"&gt;LaTeXit&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# configure&lt;/span&gt;
which&lt;span class="w"&gt; &lt;/span&gt;pdftex
&lt;span class="c1"&gt;# install style fiel&lt;/span&gt;
tlmgr&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;basic Encrypt &amp;amp; Decrypt&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;openssl&lt;span class="w"&gt; &lt;/span&gt;enc&lt;span class="w"&gt; &lt;/span&gt;-in&lt;span class="w"&gt; &lt;/span&gt;foo.bar&lt;span class="o"&gt;[&lt;/span&gt;.enc&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;                     &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-d&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-aes-256-cbc&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;                     &lt;/span&gt;-pass&lt;span class="w"&gt; &lt;/span&gt;stdin&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="w"&gt;                     &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;foo.bar.enc&lt;span class="w"&gt; &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;hr&gt;
&lt;p&gt;system&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;scheduling&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# backend&lt;/span&gt;
crontab&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt;  &lt;/span&gt;...&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# m h dom mon dow  command,  2 7-18 * * 1-5  do something&lt;/span&gt;
&lt;span class="c1"&gt;# in-situ&lt;/span&gt;
watch&lt;span class="w"&gt; &lt;/span&gt;-n&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;...&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# every 5 sec&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;info&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;df&lt;span class="w"&gt; &lt;/span&gt;-h&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# disk storage&lt;/span&gt;
du&lt;span class="w"&gt; &lt;/span&gt;-h&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# file size&lt;/span&gt;
tree&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# directory in tree&lt;/span&gt;

updatedb/locate
which/whereis
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;-manage&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;purge&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# memory&lt;/span&gt;
chmod&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# 4: r--; 5 r-x; 6 rw-; 7 rwx&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;ls&lt;span class="w"&gt; &lt;/span&gt;*&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;done&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# ``: prior execution&lt;/span&gt;
find&lt;span class="w"&gt; &lt;/span&gt;.&lt;span class="w"&gt; &lt;/span&gt;-type&lt;span class="w"&gt; &lt;/span&gt;f&lt;span class="w"&gt; &lt;/span&gt;-print&lt;span class="w"&gt; &lt;/span&gt;-name&lt;span class="w"&gt; &lt;/span&gt;*.bak&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xargs&lt;span class="w"&gt; &lt;/span&gt;rm&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# xargs: streamline&lt;/span&gt;

Ctrl-Z&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# push to background&lt;/span&gt;
&lt;span class="nb"&gt;jobs&lt;/span&gt;
&lt;span class="nb"&gt;fg&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# bring back&lt;/span&gt;
&lt;span class="nb"&gt;kill&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-STOP/-CONT&lt;span class="w"&gt; &lt;/span&gt;

wget&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# -nd: no directories; -e exclude_file; -A file_type&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://www.tldp.org/LDP/abs/html/special-chars.html"&gt;special characters&lt;/a&gt;: &lt;code&gt;#      ;      .      \      /      *      ?      ${}    {a..z} $[ ...]       &amp;amp;      |&lt;/code&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;files&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# stdin&lt;/span&gt;
sort/uniqu&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-c&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
diff
less&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-S&lt;span class="o"&gt;]&lt;/span&gt;

cat&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;lt;&amp;lt; EOF &amp;gt;&amp;gt; file&lt;/span&gt;
&lt;span class="s"&gt;xxx&lt;/span&gt;
&lt;span class="s"&gt;xxx&lt;/span&gt;
&lt;span class="s"&gt;EOF&lt;/span&gt;

cat&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;tee&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-a&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;newfile&lt;span class="w"&gt; &lt;/span&gt;

sed&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-i.bak&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;s/foo/bar/g&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;newfile&lt;span class="o"&gt;]&lt;/span&gt;
tr&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\r&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# translate characters&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="c1"&gt;# \a    &amp;lt;alert character&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="c1"&gt;# \b    &amp;lt;backspace&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="c1"&gt;# \f    &amp;lt;form-feed&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="c1"&gt;# \n    &amp;lt;newline&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="c1"&gt;# \r    &amp;lt;carriage return&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="c1"&gt;# \t    &amp;lt;tab&amp;gt;&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="c1"&gt;# \v    &amp;lt;vertical tab&amp;gt;&lt;/span&gt;

&lt;span class="c1"&gt;# interactive&lt;/span&gt;
nano/emacs
vi&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# 1G/G: top/end; crtl-f/b: forward/backward&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;manipulating&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;grep&lt;span class="w"&gt; &lt;/span&gt;key&lt;span class="w"&gt; &lt;/span&gt;file
awk&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;BEGIN {} {print substr($m,n,p)} END {print FNR}&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;file

&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;t1/&lt;span class="w"&gt; &lt;/span&gt;t2/&lt;span class="w"&gt; &lt;/span&gt;t3/&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xargs&lt;span class="w"&gt; &lt;/span&gt;-n&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cp&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;-r&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xxx&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# copy files into one place&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;operate-file&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;xargs&lt;span class="w"&gt; &lt;/span&gt;-n&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cp&lt;span class="w"&gt; &lt;/span&gt;-r&lt;span class="w"&gt; &lt;/span&gt;target&lt;span class="w"&gt; &lt;/span&gt;position
&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$string&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cut&lt;span class="w"&gt; &lt;/span&gt;-d’-’&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;

qlmanage&lt;span class="w"&gt; &lt;/span&gt;-t&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;200&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-o&lt;span class="w"&gt; &lt;/span&gt;.&lt;span class="w"&gt; &lt;/span&gt;weixin-brands.svg&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# generate thumbnails, convert svg to png&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;compress/decompress&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar&lt;span class="w"&gt; &lt;/span&gt;-xvzf&lt;span class="w"&gt; &lt;/span&gt;/&lt;span class="w"&gt; &lt;/span&gt;-cvzf
zip/unzip/gzip/gunzip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;sync &amp;amp; exchange&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;scp&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;port&lt;span class="w"&gt; &lt;/span&gt;
rsync&lt;span class="w"&gt; &lt;/span&gt;--rsh&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;ssh -p port&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-av&lt;span class="w"&gt; &lt;/span&gt;--progress&lt;span class="w"&gt; &lt;/span&gt;-partial&lt;span class="w"&gt; &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Cluster &amp;amp; Special systems
- Laohu&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;bqueues&lt;span class="w"&gt; &lt;/span&gt;-l
bjobs&lt;span class="w"&gt; &lt;/span&gt;-l&lt;span class="w"&gt; &lt;/span&gt;job_id
bkill
btop
busers
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;TACC&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;squeue&lt;span class="w"&gt; &lt;/span&gt;-u&lt;span class="w"&gt; &lt;/span&gt;domij
sbatch
showq&lt;span class="w"&gt; &lt;/span&gt;-U&lt;span class="w"&gt; &lt;/span&gt;domij
scancel&lt;span class="w"&gt; &lt;/span&gt;job_id
idev

cdw/cds
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://portal.tacc.utexas.edu/user-guides"&gt;user guides&lt;/a&gt;&lt;/p&gt;</content><category term="cheatsheets"></category></entry><entry><title>CHIP Projects</title><link href="/chip-projects.html" rel="alternate"></link><published>2016-03-05T00:00:00-06:00</published><updated>2016-03-05T00:00:00-06:00</updated><author><name>Dongming Jin</name></author><id>tag:domijin.github.io,2016-03-05:/chip-projects.html</id><summary type="html">&lt;h2 id="ideas"&gt;Ideas&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;[x] &lt;a href="https://chip.hackster.io/inmyorbit/connect-a-mobile-application-to-your-c-h-i-p-using-ble-96fe96?ref=platform&amp;amp;ref_id=5276_trending___&amp;amp;offset=5"&gt;BLE&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://chip.hackster.io/dcschel7/blast-off-with-rocketc-h-i-p-190e04?ref=platform&amp;amp;ref_id=5276_trending___&amp;amp;offset=13"&gt;Rocket relay&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Flight Radar
    -&lt;a href="https://chip.hackster.io/BuddyC/c-h-i-p-radar-0da2d1?ref=platform&amp;amp;ref_id=5276_trending___&amp;amp;offset=3"&gt;need extra antenna&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sudo service fr24feed start&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;interface: &lt;code&gt;http://192.168.3.13:8754/settings.html&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Autodesk Ember printer&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[x] &lt;a href="https://www.repetier-server.com/manuals/0.50/index.html"&gt;RepetierServer&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Start server&lt;/span&gt;
/etc/init.d/RepetierServer&lt;span class="w"&gt; &lt;/span&gt;start
&lt;span class="c1"&gt;# Stop server&lt;/span&gt;
/etc/init.d/RepetierServer&lt;span class="w"&gt; &lt;/span&gt;stop
&lt;span class="c1"&gt;# Restart server&lt;/span&gt;
/etc/init.d/RepetierServer&lt;span class="w"&gt; &lt;/span&gt;restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;RTL-SDR …&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;h2 id="ideas"&gt;Ideas&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;[x] &lt;a href="https://chip.hackster.io/inmyorbit/connect-a-mobile-application-to-your-c-h-i-p-using-ble-96fe96?ref=platform&amp;amp;ref_id=5276_trending___&amp;amp;offset=5"&gt;BLE&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://chip.hackster.io/dcschel7/blast-off-with-rocketc-h-i-p-190e04?ref=platform&amp;amp;ref_id=5276_trending___&amp;amp;offset=13"&gt;Rocket relay&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Flight Radar
    -&lt;a href="https://chip.hackster.io/BuddyC/c-h-i-p-radar-0da2d1?ref=platform&amp;amp;ref_id=5276_trending___&amp;amp;offset=3"&gt;need extra antenna&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sudo service fr24feed start&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;interface: &lt;code&gt;http://192.168.3.13:8754/settings.html&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Autodesk Ember printer&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[x] &lt;a href="https://www.repetier-server.com/manuals/0.50/index.html"&gt;RepetierServer&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Start server&lt;/span&gt;
/etc/init.d/RepetierServer&lt;span class="w"&gt; &lt;/span&gt;start
&lt;span class="c1"&gt;# Stop server&lt;/span&gt;
/etc/init.d/RepetierServer&lt;span class="w"&gt; &lt;/span&gt;stop
&lt;span class="c1"&gt;# Restart server&lt;/span&gt;
/etc/init.d/RepetierServer&lt;span class="w"&gt; &lt;/span&gt;restart
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;RTL-SDR&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[x] &lt;a href="http://gnuradio.org/redmine/projects/gnuradio/wiki/BuildGuide"&gt;GNU RADIO&lt;/a&gt;: for signal analysis, not enough cpu for heavy task&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.eventbrite.com/e/gnu-radio-conference-2016-tickets-24257809762
doc"&gt;Conference&lt;/a&gt;    &lt;/li&gt;
&lt;li&gt;&lt;a href="http://gnuradio.org/doc/doxygen/page_exploring_gnuradio.html"&gt;docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;gnuradio-companion&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;uhd_fft&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Spider&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Django&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[x] Apache server&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.chip-community.org/index.php/CGI_program_on_CHIP"&gt;web controlled LED&lt;/a&gt;
&lt;code&gt;sudo service apache2 start&lt;/code&gt;
&lt;code&gt;sudo apachectl start&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;[x] &lt;a href="https://slack-files.com/T02GVC9G6-F0H7G3WCT-25e7dfb781"&gt;WiFi extender&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Network filter (AD blocker)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://bbs.nextthing.co/t/mass-surveillance-network-using-the-c-h-i-p/4551"&gt;Mass surveillance network&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.kismetwireless.net/documentation.shtml"&gt;wifi sniffer&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://bbs.nextthing.co/t/chip-as-anti-surveillance-opportunity/4548"&gt;Anti surveillance&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h3 id="useful-links"&gt;Useful Links:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://docs.getchip.com/#chip-boot-repair-tool"&gt;CHIP Boot Repair&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.penguintutor.com/linux/tightvnc"&gt;tigervnc&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="headless-server"&gt;Headless Server&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;USB connect&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;screen&lt;span class="w"&gt; &lt;/span&gt;/dev/tty.usbmodem1413&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;115200&lt;/span&gt;
&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;TERM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ansi&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# correct encoding&lt;/span&gt;

cu&lt;span class="w"&gt; &lt;/span&gt;-l&lt;span class="w"&gt; &lt;/span&gt;/dev/tty.usbmodem1413&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;115200&lt;/span&gt;
~.&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# to escape&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;system admin&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;usermod&lt;span class="w"&gt; &lt;/span&gt;-l&lt;span class="w"&gt; &lt;/span&gt;new&lt;span class="w"&gt; &lt;/span&gt;old&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# change username, check man for more&lt;/span&gt;

sudo&lt;span class="w"&gt; &lt;/span&gt;usermod&lt;span class="w"&gt; &lt;/span&gt;-a&lt;span class="w"&gt; &lt;/span&gt;-G&lt;span class="w"&gt; &lt;/span&gt;i2c&lt;span class="w"&gt; &lt;/span&gt;chip&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# use i2c tools without sudo for chip&lt;/span&gt;

sudo&lt;span class="w"&gt; &lt;/span&gt;shutdown&lt;span class="w"&gt; &lt;/span&gt;now

ip&lt;span class="w"&gt; &lt;/span&gt;addr&lt;span class="w"&gt; &lt;/span&gt;show&lt;span class="w"&gt; &lt;/span&gt;wlan0

ps&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="nv"&gt;$$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-ocmd&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# check shell&lt;/span&gt;

apt-get&lt;span class="w"&gt; &lt;/span&gt;update/upgrade

apt-cache&lt;span class="w"&gt; &lt;/span&gt;search&lt;span class="w"&gt; &lt;/span&gt;keyword

sudo&lt;span class="w"&gt; &lt;/span&gt;apt-get&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;sysstat

mpstat/vmstat/netstat/instat

htop&lt;span class="w"&gt; &lt;/span&gt;

last

updatedb&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# for locate database &lt;/span&gt;

virtualenv&lt;span class="w"&gt; &lt;/span&gt;venv

deactivate

stty&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;&lt;span class="w"&gt; &lt;/span&gt;/dev/tty*&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# check band rate&lt;/span&gt;

update-rc.d&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;xxx&lt;span class="w"&gt; &lt;/span&gt;remove&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# remove service&lt;/span&gt;

uname&lt;span class="w"&gt; &lt;/span&gt;-a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Install GUI&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;apt-get&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;lxde-core

startlxde
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h3 id="hardware"&gt;Hardware&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;power management: &lt;a href="http://learn.linksprite.com/pcduino/arduino-ish-program/adc/axp-209-internal-temperature/"&gt;check temperature&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;axp209 /etc/axp209&lt;/code&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wi-Fi: &lt;a href="http://docs.getchip.com/chip.html#wifi-connection"&gt;Ref.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;nmtui

nmcli&lt;span class="w"&gt; &lt;/span&gt;device&lt;span class="w"&gt; &lt;/span&gt;wifi&lt;span class="w"&gt; &lt;/span&gt;list

sudo&lt;span class="w"&gt; &lt;/span&gt;nmcli&lt;span class="w"&gt; &lt;/span&gt;device&lt;span class="w"&gt; &lt;/span&gt;wifi&lt;span class="w"&gt; &lt;/span&gt;connect&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;(your wifi network name/SSID)&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;password&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;(your wifi password)&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ifname&lt;span class="w"&gt; &lt;/span&gt;wlan0&lt;span class="w"&gt; &lt;/span&gt;

nmcli&lt;span class="w"&gt; &lt;/span&gt;device&lt;span class="w"&gt; &lt;/span&gt;status
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;Bluetooth&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;hcitool&lt;span class="w"&gt; &lt;/span&gt;lescan&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="c1"&gt;# search BLE device&lt;/span&gt;

bluetoothctl
&lt;span class="w"&gt;     &lt;/span&gt;power&lt;span class="w"&gt; &lt;/span&gt;on
&lt;span class="w"&gt;     &lt;/span&gt;scan&lt;span class="w"&gt; &lt;/span&gt;on
&lt;span class="w"&gt;     &lt;/span&gt;pair
&lt;span class="w"&gt;     &lt;/span&gt;agent&lt;span class="w"&gt; &lt;/span&gt;on
&lt;span class="w"&gt;     &lt;/span&gt;connect
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;GPU?&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Onboard Power LED&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;i2cset&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;-y&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;0x34&lt;span class="w"&gt; &lt;/span&gt;0x93&lt;span class="w"&gt; &lt;/span&gt;0x0&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# OFF&lt;/span&gt;

sudo&lt;span class="w"&gt; &lt;/span&gt;i2cset&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;-y&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;0x34&lt;span class="w"&gt; &lt;/span&gt;0x93&lt;span class="w"&gt; &lt;/span&gt;0x1&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;# ON&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;GPIO&lt;ul&gt;
&lt;li&gt;&lt;a href="https://bbs.nextthing.co/t/solved-gpio-pin-numbers/2931"&gt;Pin number&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://bbs.nextthing.co/t/adafruit-gpio-library-for-chip/2696&amp;gt;"&gt;library&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content><category term="maker-notes"></category></entry></feed>