10 2017 档案

摘要:Install: Basic example: Advanced example: Component: 阅读全文
posted @ 2017-10-31 19:31 Zhentiw 阅读(459) 评论(0) 推荐(0) 编辑
摘要:Always treat Router as the source of truth When we use Ngrx, we can see that we will use a "StoreRouterConnectingModule" from the example app. What it 阅读全文
posted @ 2017-10-30 21:43 Zhentiw 阅读(593) 评论(0) 推荐(0) 编辑
摘要:Most of time, we get used to use class name as a selector in the test. But one problem for this is classname is used for styling, when we also use it 阅读全文
posted @ 2017-10-30 18:19 Zhentiw 阅读(247) 评论(0) 推荐(0) 编辑
摘要:/* list of strings */ let _ = ["example-1", "example-2", "example-3"]; /* Array of strings */ let _ = [|"example-1", "example-2", "example-3"|]; /* Stating the type of a Reason record */ type event... 阅读全文
posted @ 2017-10-28 01:57 Zhentiw 阅读(345) 评论(0) 推荐(0) 编辑
摘要:// ::country is named param // ::country=?: which make it optional // because we make ::country=? optional named param, we may pass in or may not pass in // we need use '()' --> (): string => , which... 阅读全文
posted @ 2017-10-28 01:55 Zhentiw 阅读(212) 评论(0) 推荐(0) 编辑
摘要:For example, we want to use moment.js inside our ReasonML code. What we can do is create a module file: Using it inside component: 阅读全文
posted @ 2017-10-28 01:52 Zhentiw 阅读(304) 评论(0) 推荐(0) 编辑
摘要:Register a account on https://console.dialogflow.com/api-client/ "Creat a intent" -- you can custom your message here. "Small Talks" -- the default me 阅读全文
posted @ 2017-10-24 03:38 Zhentiw 阅读(867) 评论(1) 推荐(0) 编辑
摘要:The upload class will be used in the service layer. Notice it has a constructor for file attribute, which has a type of File. This will allows us to i 阅读全文
posted @ 2017-10-22 01:57 Zhentiw 阅读(783) 评论(0) 推荐(0) 编辑
摘要:User input validation is a core part of creating proper HTML forms. Form validators not only help you to get better quality data but they also guide t 阅读全文
posted @ 2017-10-22 00:12 Zhentiw 阅读(221) 评论(0) 推荐(0) 编辑
摘要:Updated to AngularFire2 v5.0. One important change is that you need to call .snapshotChanges() or .valueChanges() to get data as Observable back. The 阅读全文
posted @ 2017-10-18 22:53 Zhentiw 阅读(371) 评论(0) 推荐(0) 编辑
摘要:In certain situations, you care more about the final state of the redux store than you do about the particular stream of events coming out of an epic. 阅读全文
posted @ 2017-10-17 19:34 Zhentiw 阅读(616) 评论(0) 推荐(0) 编辑
摘要:Often in unit tests we are focussing on the logic involved in crafting a network request, & how we respond to the result. The external service is unli 阅读全文
posted @ 2017-10-17 18:57 Zhentiw 阅读(1180) 评论(0) 推荐(0) 编辑
摘要:Epics can be unit-tested just like any other function in your application - they have a very specific set of inputs (the action$ stream) and the outpu 阅读全文
posted @ 2017-10-17 18:20 Zhentiw 阅读(208) 评论(0) 推荐(0) 编辑
摘要:With redux-observable, we have the power of RxJS at our disposal - this means tasks that would otherwise be complicated and imperative, become simple 阅读全文
posted @ 2017-10-16 00:30 Zhentiw 阅读(792) 评论(0) 推荐(0) 编辑
摘要:Imaging you are building a Tabs component. If looks like: You want to know which tab is clicked (actived). But you don't want this actived tab state b 阅读全文
posted @ 2017-10-13 19:06 Zhentiw 阅读(553) 评论(0) 推荐(0) 编辑
摘要:In this lesson we create a new Express web server app for handling file uploads and persisting them to the filesystem. We will walk through using the 阅读全文
posted @ 2017-10-12 23:52 Zhentiw 阅读(339) 评论(0) 推荐(0) 编辑
摘要:def myfunc(x, y, z): print(x, y, z) tuple_vec = (1, 0, 1) dict_vec = {'x': 1, 'y': 0, 'z': 1} >>> myfunc(*tuple_vec) 1, 0, 1 >>> myfunc(**dict_vec) 1, 0, 1 阅读全文
posted @ 2017-10-12 18:20 Zhentiw 阅读(249) 评论(0) 推荐(0) 编辑
摘要:The way to test router componet needs a little bit setup, first we need to create a "router-stubs.ts". This file is a helper file. The component we wa 阅读全文
posted @ 2017-10-12 15:48 Zhentiw 阅读(931) 评论(0) 推荐(0) 编辑
摘要:Both what "TestBed.get" & "injector" trying to do is get service for the test component. But there is some diffenece which determined when use which. 阅读全文
posted @ 2017-10-10 19:21 Zhentiw 阅读(1649) 评论(0) 推荐(0) 编辑
摘要:When you testing Component rendering, you often needs to call: For example: You can also set auto change detection: Add to providers: Tests wit auto c 阅读全文
posted @ 2017-10-10 16:51 Zhentiw 阅读(262) 评论(0) 推荐(0) 编辑
摘要:When using Ngrx, we need to know how to test the component which has Router injected. Component: One thing we can test just for component wihtout temp 阅读全文
posted @ 2017-10-10 15:54 Zhentiw 阅读(565) 评论(0) 推荐(0) 编辑
摘要:More detail check LInk. Render Prop vs HOC: HOC version for withMouse: Problems: Indirection. We still have the same problem with indirection that we 阅读全文
posted @ 2017-10-10 00:27 Zhentiw 阅读(290) 评论(0) 推荐(0) 编辑
摘要:class Toggle extends Component { static propTypes = { defaultOn: PropTypes.bool, on: PropTypes.bool, onToggle: PropTypes.func, children: PropTypes.oneOfType([ PropTypes.func, ... 阅读全文
posted @ 2017-10-05 19:46 Zhentiw 阅读(294) 评论(0) 推荐(0) 编辑
摘要:# Why Python is Great: Namedtuples # Using namedtuple is way shorter than # defining a class manually: >>> from collections import namedtuple >>> Car = namedtup1e('Car', 'color mileage') # Our new "... 阅读全文
posted @ 2017-10-03 20:59 Zhentiw 阅读(234) 评论(0) 推荐(0) 编辑
摘要:Tf-idf, or term frequency-inverse document frequency, is a statistic that indicates how important a word is to the entire document. This lesson will e 阅读全文
posted @ 2017-10-03 20:38 Zhentiw 阅读(398) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we will learn how to train a Naive Bayes classifier and a Logistic Regression classifier - basic machine learning algorithms - on JSON 阅读全文
posted @ 2017-10-03 20:23 Zhentiw 阅读(608) 评论(0) 推荐(0) 编辑
摘要:In this lesson, we will learn how to train a Naive Bayes classifier or a Logistic Regression classifier - basic machine learning algorithms - in order 阅读全文
posted @ 2017-10-03 19:20 Zhentiw 阅读(218) 评论(0) 推荐(0) 编辑
摘要:Shuffling is a common process used with randomizing the order for a deck of cards. The key property for a perfect shuffle is that each item should hav 阅读全文
posted @ 2017-10-03 18:39 Zhentiw 阅读(512) 评论(0) 推荐(0) 编辑
摘要:A common interview question is to write a
function
that
converts a string
into
an
integer e.g. "123" => 123. This function is commonly called atoi bec 阅读全文
posted @ 2017-10-03 16:17 Zhentiw 阅读(290) 评论(0) 推荐(0) 编辑
摘要:In a doubly linked list each node in the list stores the contents of the node and a pointer or reference to the next and the previous nodes in the lis 阅读全文
posted @ 2017-10-03 01:56 Zhentiw 阅读(928) 评论(0) 推荐(0) 编辑
摘要:In a singly linked list each node in the list stores the contents of the node and a reference (or pointer in some languages) to the next node in the l 阅读全文
posted @ 2017-10-02 19:01 Zhentiw 阅读(425) 评论(0) 推荐(0) 编辑
摘要:# The get() method on dicts # and its "default" argument name_for_userid = { 382: "Alice", 590: "Bob", 951: "Dilbert", } def greeting(userid): return "Hi %s!" % name_for_userid.get(... 阅读全文
posted @ 2017-10-01 18:30 Zhentiw 阅读(177) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示