Detail Focused

Wednesday, November 8, 2017

Heap (data structure)

›
A heap is a specialized tree -based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) ...

find median from unsorted array of intergers

›
For example [3,4,5,2,1], median is 3. [3,4,5,2,1,6] median is (3+4)/2=3.5 The easiest way is to sort them and then calculate the median. ...
Monday, November 6, 2017

HATEOAS

›
HATEOAS basically means when you trigger a request, the restful service not only returns the data but also the further actions (URLs) you ca...
Saturday, November 4, 2017

RxJs do operator on Observable

›
https://angularfirebase.com/lessons/methods-for-debugging-an-angular-application/ https://www.youtube.com/watch?time_continue=9&v=gxix...

Spring boot supports Cross domain request (CORS)

›
https://spring.io/guides/gs/rest-service-cors/ @CrossOrigin(origins = "http://localhost:9000") This @CrossOrigin annotation e...
Friday, October 27, 2017

markdown cheat sheet

›
newline break two space at the end of line, it is two "Enter", it is
Wednesday, October 18, 2017

JPA bidirection mapping JSON infinite loop issue

›
Employee and EmployeeTitle are parent and child class. I made an extreme example here. Both fetch is eager. Actually JPA can deal it, whi...
Friday, September 15, 2017

Proxy Api Calls in Vue2

›
The big advantage is we don't have to worry about CORS https://github.com/prograhammer/vue-example-project#proxy-api-calls-in-webpack-d...

webpack and Jquery-ui

›
Here is the way to integrate jquery-ui in webpack project npm install jquery - ui - dist -- save webpack.config.js resolve : { ali...
Thursday, September 7, 2017

vue basic

›
The data are only reactive if they existed when the instance was created. That means if you add a new property, like: vm.b = 'hi' Th...
Friday, August 25, 2017

python generator and yield

›
Generators are best for calculating large sets of results (particularly calculations involving loops themselves) where you don’t want to all...
Thursday, August 24, 2017

python list comprehensions - Single Line For Loops

›
List comprehensions provide a concise way to create lists. [thing for thing in list_of_things] [thing for thing in list_of_things if thin...
Wednesday, August 23, 2017

python unit test

›
I am using pytest https://docs.pytest.org/en/latest/ python -m pytest py.test -v py.test -s # which allows print Be careful of the...
Wednesday, August 16, 2017

Common Fork Join Pool and Streams

›
https://dzone.com/articles/common-fork-join-pool-and-streams how do you make the parallel streams use their own Fork Join Pools instead of...
Monday, July 31, 2017

python numpy

›
reshape change the dimension of the array rangeArray = np.arange(6,12) # [6,7,8,9,10,11] rangeArray = rangeArray.reshape((2,3)) # [[6,7,...
Monday, July 10, 2017

python function arguments

›
Python function parameters is like this *non-keywords is a tuple ** keywords is a dict You can call the method like newfoo(2, 4, *(6, 8...
Friday, July 7, 2017

spring MVC upload and download file example

›
http://www.journaldev.com/2573/spring-mvc-file-upload-example-single-multiple-files http://memorynotfound.com/spring-mvc-download-file-exa...
Tuesday, June 20, 2017

eclipse break when exception

›
https://stackoverflow.com/questions/3066199/break-when-exception-is-thrown
Thursday, June 15, 2017

python pandas practice

›
iternate dataframe for index, row in prediction_df.iterrows():         print(row['columnName']) rename dataframe column nam...
Friday, June 9, 2017

python practice

›
check if dict has key if key in dict python 3.6 install package after 3.4, pip is not standalone, to install a package, run python -m ...
Wednesday, June 7, 2017

ember.js practice

›
-install ember-cli npm install -g ember-cli - create project ember new hello-world --start server ember server - create controller ...
Monday, June 5, 2017

spring injects into static class

›
Usually, a static class shall not depend on some specific object. But in some cases, we want to inject some env specific instance into the s...
Friday, May 26, 2017

elasticsearch distinct value and search

›
In elasticsearch, to get the distinct value of one field, it is using term aggregation. For example, here are the documents  {     ...
Wednesday, May 24, 2017

elasticsearch query

›
Full-text search queries The most important queries in this category are the following: - match_all - match - match_phrase - multi_mat...
Thursday, May 18, 2017

elasticsearch update_by_query

›
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html#picking-up-a-new-property This is helpful when y...
Tuesday, May 16, 2017

JVM verbose log

›
For example, if you want to see the verbose jvm log for SSL handshake, add JVM parameters -Djavax.net.debug=all -Djavax.net.debug=ssl:hand...
Friday, May 12, 2017

express: request entity too large

›
When post with large text, you may get the error "request entity too large", here is the code to fix that.
Thursday, May 4, 2017

java rest sslContext

›
http://massapi.com/method/javax/ws/rs/client/ClientBuilder.sslContext.html http://stackoverflow.com/questions/30121510/java-httpsurlconnec...
Monday, May 1, 2017

webpack practice

›
webpack enable sourcemaps -- to be continued --
Friday, April 28, 2017

elasticsearch join query

›
Elasticsearch can have nested query or parent-child join query. https://www.elastic.co/guide/en/elasticsearch/guide/current/nested-objects...
Thursday, April 6, 2017

expressjs post, request entity too large

›
To avoid this error http://stackoverflow.com/questions/19917401/error-request-entity-too-large
Thursday, March 30, 2017

passportjs, nodejs auth

›
The document of passportjs is not good. I followed the document and it did not make my code work. After reading a couple of tutorial online...
Tuesday, March 28, 2017

Run NodeJS as a Service on Ubuntu

›
https://gist.github.com/jobsamuel/6d6095d52228461f3c53
Monday, March 27, 2017

Javascript asynchronous and promise

›
The javascript is now using lots of asynchronous call.  In some scenarios, you need an asynchronous call chain, one after another. Promise c...
›
Home
View web version
  • Harvey Shen
  • Yao, Dong
Powered by Blogger.