Todos

loop over an array in javascript

forEach, each, map
https://stackoverflow.com/questions/33763768/loop-through-array-of-values-with-arrow-function, 
https://medium.com/how-to-react/different-ways-to-loop-through-arrays-and-objects-in-react-39bcd870ccf

see system specs on windows

wmic baseboard get product,Manufacturer,version,serialnumber
wmic cpu get caption,deviceid,name,numberofcores,maxclockspeed,status

demo async http client

Check the following links to understand more about using this library:
  1. HttpAsyncClient, https://hc.apache.org/httpcomponents-asyncclient-4.1.x/quickstart.html, accessed Oct 2023.
  2. async-http-client, https://github.com/AsyncHttpClient/async-http-client, accessed Oct 2023.
  3. Some threads on StackOverflow: https://stackoverflow.com/questions/16539245/java-equivalent-of-c-sharp-async-await, https://stackoverflow.com/questions/16349797/can-asynchttpclient-perform-non-blocking-async-http-calls?rq=3, https://stackoverflow.com/questions/3142915/how-do-you-create-an-asynchronous-http-request-in-java?rq=3
  4. Other references: https://onecompiler.com/cheatsheets/async-http-client, https://www.tornadoweb.org/en/stable/httpclient.html, http://www.java2s.com/example/java-api/org/apache/http/impl/nio/client/closeablehttpasyncclient/index.html

tailored

fashioned or fitted to resemble a tailor's work
custom-made
having the look of one fitted by a custom tailor

Dividing fractions

Tai sao chia 2 phan so bang cach nhan phan so nghich dao
1. https://www.khanacademy.org/math/cc-sixth-grade-math/cc-6th-arithmetic-operations/cc-6th-dividing-fractions/v/dividing-fractions-example
2. https://www.youtube.com/watch?v=ybwz9OGGzng
3. https://www.youtube.com/watch?v=3WqUjC16WQA

Tomcat and Apache HTTP Server

Read: https://www.theserverside.com/video/Tomcat-vs-Apache-HTTP-Server-Whats-the-difference

Dollar-Cost Average

DCA - Dollar-cost averaging - is an investment strategy in which an investor divides up the total amount to be invested across periodic purchases of a target asset in an effort to reduce the impact of volatility on the overall purchase.

A trailing slash at the end of URLs does matters

Should You Have a Trailing Slash at the End of URLs?
Should You Have a Trailing Slash at the End of URLs?
Trailing Slashes and SEO | Best Practice Guide for Trailing Slash SEO

Accessing the grailsApplication bean without using Holders

Accessing the GrailsApplication and ApplicationContext from domain classes without holders - No Fluff Just Stuff
dependency injection - Get a service bean from Grails Holders class - Stack Overflow

How to Synchronise HashMap in Java

How to Synchronize HashMap in Java - HowToDoInJava

Java ConcurrentHashMap Best Practices

Java ConcurrentHashMap Best Practices - HowToDoInJava

Run Groovy Scripts in Grails Context

Grails Goodness: Run Groovy Scripts in Grails Context - Messages from mrhaki
grailsw run-script --verbose scripts/HelloWorld.groovy

pseudocode

/ˈs(j)uːdəʊˌkəʊd/
a notation resembling a simplified programming language, used in program design.

drain doctor

Drain Doctor | The UK's Largest Drainage & Emergency Plumbing Company
Can call and order an appointment from here

how to install cairo module in MacOS

Link: http://macappstore.org/cairo/

timesheet 2019-09-10

* JBM-423:
- update the pull request #1 based on the reviewer's comments
- test and merge the pull request to omicsdi branch
- deploy AnnotationStore-0.3.4-SNAPSHOT to ebi maven snapshots
- copy the latest indexer and settings.json to /nfs/prod3/bm/work/bm/indexer
- lunch the indexer against biomodels-jump-dev database

motivation letter for phd application

See: Sample Motivation Letter For Your PhD Application | INOMICS
OR: Write A Killer Scholarship Motivation Letter (With Example)

Slj4j Format String Example

Slf4j Format String Example | Examples Java Code Geeks - 2018

Webpack - understanding how it works

Webpack Tutorial: Understanding How it Works – ag-Grid – Medium

why does git still ask prompt password

The link below explains what I am facing with
https://unix.stackexchange.com/questions/12195/how-to-avoid-being-asked-passphrase-each-time-i-push-to-bitbucket

Declaring repositories in Gradle

See the documentation published here: Declaring Repositories

Binary Log Options and Variables

Bug
Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
Resolved: MySQL Error: impossible to write to binary log - Database Administrators Stack Exchange

gradle vs. maven

I hesitate to choose which is better for go. Read this Gradle vs. Maven - DZone Java

Cannot set readonly property

The problem happened with FileSystemService when the property currentContainer as a String changed to an AtomicReference.
What is AtomicReference: AtomicReference (Java Platform SE 8 )
See: Cannot set readonly property: properties · Issue #10027 · grails/grails-core

figure race conditions out

Tim hieu ve race conditions: Race condition - Wikipedia

groovy testing

Testing guide
The Apache Groovy programming language - Testing guide

play with spock testing framework

http://spockframework.org/spock/docs/1.1/data_driven_testing.html
https://semaphoreci.com/community/tutorials/stubbing-and-mocking-in-java-with-the-spock-testing-framework
https://www.petrikainulainen.net/programming/testing/writing-unit-tests-with-spock-framework-creating-a-maven-project/
https://gist.github.com/robfletcher/1154459
https://www.pluralsight.com/guides/java-and-j2ee/introduction-to-testing-with-bdd-and-the-spock-framework
spockframework/spock-example: Spock example specifications along with ready-to-go Ant, Gradle, and Maven builds
pchudzik/blog-example-spock-groups: Samples for https://blog.pchudzik.com/201701/spock-groups/
Running Unit Tests With Maven – Spock Edition
Writing Unit Tests With Spock Framework: Creating a Maven Project
renatoathaydes/spock-reports: This project creates a global extension to Spock to create test reports.
alexruiz/fest-ui-testing: Common infrastructure for UI testing
pkainulainen/test-with-spring

Working with store procedures in MySQL

References:
  1. The official documentation can be found here MySQL :: MySQL 5.6 Reference Manual :: 13.1.15 CREATE PROCEDURE and CREATE FUNCTION Syntax
  2. The simple tutorials
    MySQL stored functions and procedures
    Getting Started with MySQL Stored Procedures
  3. Create a variable or populate data to a variable
    mysql - Set the variable result, from query - Stack Overflow
  4. How to use cursors in MySQL Stored Procedures: Cursors in MySQL Stored Procedures — SitePoint
  5. Define  a split function: MySQL string split function
  6. How to concatenate multiple rows into one field: sql - Can I concatenate multiple MySQL rows into one field? - Stack Overflow

Gradle

Online learning resources:
GradleGradle | DocumentationThe Gradle build system - TutorialGradle (Safari) - Google Docsgradlethe_basics_and_beyond.pptx

Using TreeSet and Comparable

Muốn duy trì một thứ tự sắp xếp nào đó, sử dụng kết hợp TreeSet và Comparable.
Hãy tạo một lớp cài đặt giao diện Comparable. Phương thức compareTo nên được cài đặt theo tiêu chuẩn của bạn.
Xem link tham khảo:

Maths for Tony

Mot so trang web danh de tai learning resources
Free Year 1 Maths Worksheets | Maths Blog
Year 1 - Free Printable Mental Maths Worksheets for Children aged 4-11
Free printable first grade math worksheets | K5 Learning

Conda

Một số nội dung
  1. Presentations & Blog Posts — Conda documentation
  2. Dashboard :: Anaconda Cloud

Installing LAMP On Linux Mint

Hướng dẫn các bước cài đặt LAMP trên Linux Mint 17
Installing LAMP (Linux, Apache, MySQL and PHP) On Linux Mint - Linux Mint Community

open bank account for darling

Mở tài khoản ngân hàng, có thể dùng Natwest again. 
Select Bank Account - Apply Online | NatWest

tags and categories autocompletion

Edit fiddle - JSFiddle, or Edit fiddle - JSFiddle
Auto complete text box with PHP, jQuery and MySql | TutsforWeb
JQuery autocomplete example with database accessing
Autocomplete search using PHP, MySQLi, Ajax and jQuery
Cascading List of Country, State, City using Ajax function in codeignitor
Edit fiddle - JSFiddle (jQuery Tag-it–autocomplete with grouping | chrisseroka)
Cascading Drop Down in Codeigniter Using AJAX
Simple ajax drop down filtering with CodeIgniter | Technodyne
TechnoPoetic » Multiple dropdowns with CodeIgniter and Javascript
TechnoPoetic » Populate DropDowns with jQuery and CodeIgniter
List of Autocomplete Plugins and Libraries | TechSlides

creating zoomable sunburst with updating data

Use this type of chart to populate search results on the right sidebar

Grails Best Practices

Nhieu bai viet hay trong linh vuc nay
Grails Best Practices - DZone JavaGrails Best Practices

differentiate user story, epic, issue, task in agile

Need to learn about these concepts
User Stories: An Agile IntroductionWrite a Great User Story | CA Agile Central Help

turn JummpIndexer to server

Mot so tai lieu tim hieu ve lap trinh mang voi Java
Tài liệu dưới dùng cải thiện: Socket programming for scalable systems | JavaWorld

finding for club management source codes

This is a bachelor level assignment: AUTOMATED FOOTBALL MANAGEMENT SYSTEM
This is a graduated project: salmon.pdf
This is an open source code written in C#: Câu lạc bộ thể hình - Fitness club - Home
This is an open source code written with APS.NET: SPORTS CLUB MANAGEMENT SYSTEM PROJECT IN ASP.NET WITH SOURCE CODE - ASP.NET FREE DOWNLOAD MANAGEMENT SYSTEM PROJECT IN ASP.NET WITH SOURCE CODE AND DOCUMENATATION

showing a basic dialog

Bạn muốn display một modal dialog khi click vào một cụm từ, liên kết trên trang web. Model dialog, mà theo kiến thức hạn hẹp của nhiều người, có thể hiểu là một pop-up window, thường mang nghĩa lạm dụng, xấu vì cho rằng chỉ dùng để hiển thị những quảng cáo. Tuy nhiên, modal dialog được sử dụng khá thường xuyên trên những trang web có những nội dung mà bạn chỉ cần hiển thị một hộp thoại để giải thích thêm nội dung đó, xem như một chú thích mở rộng.
Có nhiều cách để thực hiện mục đích này, theo kiến thức hiện có của tôi nghĩ. Những front-end developing framework like Bootstrap (Bootstrap JS Modal Reference, example, Edit fiddle - JSFiddle), Foundation (Reveal Modal | Foundation Docs) đều hỗ trợ cách tạo một pop-up windows theo cách riêng nhưng nền tảng kĩ thuật đều dựa theo jquery-ui.
Cách mà tôi đã sử dung là dùng jquery-ui. Đọc thêm về jquery-ui ở đây: Dialog | jQuery UI
Example: loading a page into a modal dialog

Various solutions of autocomplete

Dân làm web chắc đều biết tính năng autocomplete lợi hại như thế cho các ô nhập liệu hoặc ô tìm kiếm.
Trong bài post này, tôi xin giới thiệu các công cụ có thể giúp cho công việc này đỡ vất vả.
  • Dùng cách truyền thống
  • Dùng listjs
  • Dùng select2
  • Dùng backbone và underscore kết hợp
  • Dùng AngularJS
Và sau đây là những ví dụ minh họa cho mỗi cách đó.

Dùng cách truyền thống

Đây là một trong những tính năng autoComplete của jQuery jQuery autocomplete. Có thể sử dụng chức năng autocomplete của jQuery như ví dụ này utocomplete with PHP, MySQL and Jquery UI - David Carr | Web Developer, nhưng bạn cũng có thể dùng thư viện jQuery viết lại như cái link ban đầu. Thêm một vài ví dụ viết tương tự theo cách này sau đây:

Dùng listjs

Bạn có thể tham khảo ứng dụng mình đang viết ở đây: Model Search, chức năng autocomplete thể hiện trên các ô tìm kiếm của faceted search. Công nghệ bên dưới là jQuery, bản chất là search text/string và cách tìm kiếm dựa trên những selector được định nghĩa trước qua những css classes. Đi theo cách này có một số thư viện như:

Với Select2

Giới thiệu một chút về Select2: Select2 - The jQuery replacement for select boxes, có nhiều ví dụ cung cấp trên trang chủ, xem ở link này: Examples - Select2
  • Đầu là bạn cần phải khai báo thư viện Select2 để được tải về lúc nạp trang web của bạn.
  • Kế tiếp là bạn định nghĩa một ô nhập liệu (textbox/input) hoặc ô chọn (dropdown box)
Đặc biệt, nếu chúng ta muốn sử dụng Select2 với CodeIgniter, have a look at the tutorial Codeigniter 3 - select2 ajax autocomplete from database example with demo

Với sự kết hợp backbone và underscore

Cũng trong dự án mình đang làm, những tính năng như tìm kiếm người dùng để thêm vào một nhóm, tìm kiếm collaborator để chia sẻ model... đều đang được cài đặt dựa trên backbone và underscore.

Dùng AngularJS với tính năng filter

Nếu bạn đã từng sử dụng AngluarJS để phát triển web, filter cực kì hữu dụng để search thông tin.

Tham khảo:
http://jsfiddle.net/user/nvntung/fiddles/

Kiểm tra kết quả trả về có phải là một json không

Nếu muốn thử một url trả về kết quả json như thế nào, có thể chạy lệnh:
curl -X GET --header 'Accept: application/json' 'http://localhost:8090/it4bus-ci302/index.php/search?_type=query&term=mysql&q=mysql'
Nếu kết quả ok, bạn có thể sử dụng url vào trong lời gọi ajax với jquery.

travel on XML tree

Based on the following article, I can travel on NodeList of XML document to find the interest child.
Java Code Example groovy.util.NodeList

groovy java split string

//String str1 = "IPR031887 Serologically defined colon cancer antigen 8"
String str1 = "LTPOS"
String[] entry = str1.split(" ", 2)
if (entry.size() == 1) 
  println entry[0]
else {
println  entry[0]
println  entry[1]
}

String str = "name1, name2, name3, name4";
String[] parts = str.split(", ", 2);
String string1 = parts[0];
String string2 = parts[1];

System.out.println(string1);  // prints name1
System.out.println(string2);  // prints name2, name3, name4

import java.net.*
import java.io.*
URL oracle = new URL("ftp://ftp.ebi.ac.uk/pub/databases/interpro/entry.list")
BufferedReader br = new BufferedReader(new InputStreamReader(oracle.openStream()))
String inputLine

while ((inputLine = br.readLine()) != null)
inputLine
br.close()

split string into two parts based on a space

Xem link: Java Splitting a string into 2 strings based on a delimiter. - Stack Overflow

profile manager in Thunderbird

Viết một bài về cách tạo mới và khắc phục profile trong Thunderbird. Một số link tham khảo được:
Tại sao phải nghiên cứu cái này:
  • Khi thư mục Users/username có dấu hiệu đầy, bạn cần di chuyển chúng qua ổ đĩa khác.
  • Lỗi profile trong Thunderbird

implement acl in CI3

Using Ion Auth lightweight library. See the documentations
There is a thread of discussing which is the interested solutions to implement an ACL module in CodeIgniter at Stackoverflow.

VIM editor commands

The link shows many commands working in VIM editor. They are useful for you as beginner.

import sql-based data into mysql database

We provide here two ways to import those data into the existing database.


Method 1: Logged mysql shell client in

Running the following command:

mysql>use model_repository_database;

mysql>source path/to/jummp_dump.sql;


Method 2: Not yet logged mysql shell client in

Running the following command unless you are not sure model repository database credential.

mysql -u database_username -p database_name < path/to/jummp_dump.sql
Link: http://stackoverflow.com/questions/17666249/how-to-import-an-sql-file-using-the-command-line-in-mysql

working with enum in java groovy

Enum is used quite commonly in Java. See the examples:
  1. Enum Types (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
  2. Java Enum Tutorial: 10 Examples of Enum in Java
  3. How to use Groovy enum - Groovy - makble
  4. IT is a state of mind: Grails enum custom database value mapping

create online desktop

Dựa trên ý tưởng này, chúng ta có thể tạo ra những dialog box trôi nổi trên màn hình:
PNotify, thật là một gợi ý tuyệt vời.
Từ khóa để googling: create take note papers css jquery 
Một số liên kết hay tìm được:
  1. Create a Sticky Note Effect in 5 Easy Steps with CSS3 and HTML5 - Envato Tuts+ Code Tutorial (thực sự work theo ý mình)
  2. How To Create a Notebook Design with CSS | CSS-Tricks
  3. How to PageFlip? Creating Bookish Digital Effect - MonsterPost
  4. PFold: Paper-Like Unfolding Effect
  5. stickUp - a free jQuery Plugin

how to get the value selected from drop down box in grails

Wiki - AJAX-Driven SELECTs in GSP
Grails AJAX tutorial - remoteFunction tag - Java Developer Notes
Grails Dynamic Dropdown - DZone Java
The Grails Framework 2.4.4
Grails chained select - load data on one dropdown box depending on another - Grails Cookbook

một tài liệu hay về grails

Lang thang tìm được tài liệu này hay:
Grails Tutor (AJAX)
Có thể tìm hiểu thêm các nội dung khác ở trang này

mysql commands used commonly

CREATE USER 'dbadmin'@'localhost' IDENTIFIED BY 'admin';
UPDATE user SET real_name='Tung Nguyen' WHERE username='nvntung';

Track and untrack changes in a specific file in git

Chúng ta muốn track/untrack một hay nhiều file nào đó để cho git bỏ qua hoặc cập nhật trong index:
Untrack
git update-index --assume-unchanged path/to/file
Track:
git update-index --no-assume-unchanged path/to/file
Xem thêm ở đây: github - Untrack files from git - Stack Overflow

jquery ui

Icons | jQuery UI API Documentation
and
jQuery Mobile Icons

learning grails and groovy

Two projects: mainapp (3.1.0) and grailstutorial (2.4.4)
  1. Groovy Archives | Page 13 of 14 | Java Code Geeks - 2016
  2. 2 Getting Started 3.1.1 (appName)
  3. Grails Blog - Grails Framework:Tips and Tricks
  4. Grails tutorial for beginners | Examples Java Code Geeks - 2016
  5. Grails Tutorial: Grails Tutorial for Beginners
  6. Grails Tutorial for Beginners - Grails Service Layer - Grails Cookbook
  7. The Grails Framework 3.1.1
  8. 4 Configuration 3.1.1
  9. What's new in Grails 3
  10. How do you define the Grails 3 app name so that it's part of the url? - Google Groups
  11. Read Grails Goodness Notebook | Leanpub
  12. Messages from mrhaki

what is the difference of type submit vs button in html

I often wonder what is the difference between and and in HTML5.
Looking forward the documents in stackoverflow.

Get program execution time in the shell

Using to measure the running time of a program from Shell
linux - Get program execution time in the shell - Stack Overflow
batch file - How to measure execution time of command in windows command line? - Stack Overflow

What is console log in jQuery

We want to log information at Console in jQuery. How to do that?
javascript - What is console.log in jQuery? - Stack Overflow

jQuery AJAX POST Example

Một số ví dụ
  1. jQuery AJAX POST Example
  2. jQuery ajax() Method

Disabling and enabling buttons with jQuery

Demos:
  1. jQuery disable button: Disabling and enabling buttons with jQuery
  2. www.mkyong.com/wp-content/uploads/jQuery/jQuery-disabled-submit-button-after-clicked.html
  3. Enable/Disable Form Submit Button with jQuery

how to add removing format button to nicEdit

Xem các ví dụ minh họa demo trong file download. Rất hữu ích.
http://archive.billyflaherty.com/blog/2009/a-customized-web-based-wysiwyg-that-can-clean-a-paste-from-ms-word/

BD2K

Figure BD2K out here
BD2K Home Page | Data Science at NIH
Some ones working in here:
Wei Wang's Resume
UCLA Cardiac Proteomics and Signalling Laboratory
Heart BD2K @ UCLA

get and load in hibernate

http://stackoverflow.com/questions/5370482/whats-the-advantage-of-load-vs-get-in-hibernate

hibernate cache

http://vladmihalcea.com/2015/04/09/how-does-hibernate-store-second-level-cache-entries/
http://stackoverflow.com/questions/16929618/reloading-objects-from-database-not-cache-after-stored-procedure-updates-datab
http://shahzad-mughal.blogspot.co.uk/2012/04/spring-jpa-hibernate-support-for-custom.html
https://amitstechblog.wordpress.com/2011/05/31/supporting-custom-isolation-levels-with-jpa/
https://forum.hibernate.org/viewtopic.php?p=2387456

Explain the purpose of a WAR file and describe the contents of a WAR file

WAR's structure
http://java.boot.by/wcd-guide/ch02s04.html
http://docs.oracle.com/javaee/5/tutorial/doc/bnadx.html

How to deploy a Java web application on Tomcat

Official documentation
https://tomcat.apache.org/tomcat-7.0-doc/appdev/deployment.html
Others
http://www.codejava.net/servers/tomcat/how-to-deploy-a-java-web-application-on-tomcat
http://archive.oreilly.com/pub/a/java/archive/tomcat.html

config tomcat 7 on ubuntu 14.04

Link nay chay tot: https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-14-04
Otherwise, need to adjust JVM for Tomcat: http://wiki.razuna.com/display/ecp/Adjusting+Memory+Settings+for+Tomcat

a different object with the same identifier value was already associated with the session

Giải quyết vấn đề về Hibernate Exception:

Hibernate Error: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session

  1. The Simon Lawrence Application Development Blog: Hibernate Exception: "a different object with the same identifier value was already associated with the session"
  2. java - Hibernate Error: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session - Stack Overflow
  3. java - Hibernate Error: a different object with the same identifier value was already associated with the session - Stack Overflow
  4. Hibernate. Why a NonUniqueObjectException is thrown ? - GetJ2ee -Java development
  5. Technology: Hibernate Persistent Context and Session

partition software

Thay đổi kích thước phân vùng, dùng phần mềm ngay trên chính Windows như:
  1. Bootable Partition Manger | MiniTool Partition Wizard Bootable Edition
  2. How do I extend my primary partition in Windows 7? - Microsoft Community
  3. How To Shrink & Extend Volumes Or Partitions in Windows 7

Keyboard Shortcuts in Thunderbird

The list is useful for me
Thunderbird Help: Keyboard Shortcuts

Flask

Welcome | Flask (A Python Microframework)

Install MongoDB Community Edition on Red Hat Enterprise or CentOS Linux

Try to install MongoDB on Huu Vu's VPS
Install MongoDB Community Edition on Red Hat Enterprise or CentOS Linux — MongoDB Manual 3.2
How to Install MongoDB 3.2 on CentOS/RHEL & Fedora

How To Install nginx on CentOS 6 with yum

Nginx is emerging and interested in some ones.
How To Install nginx on CentOS 6 with yum | DigitalOcean

Differences between Java EE and Java SE

Differences between Java EE and Java SE - Your First Cup: An Introduction to the Java EE Platform

Sending an Email using the JavaMail API

Sending an Email using the JavaMail API
Example of sending email in Java - javatpoint
How to send email in java using gmail smtp server – HowToDoInJava

how to run a jar file

java - Can't execute jar- file: "no main manifest attribute" - Stack Overflow
java - Failing to run jar file form command line: “no main manifest attribute” - Stack Overflow
Setting an Application's Entry Point (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files)

POP server settings for Yahoo Mail

Helpcentral | SLN4724 - POP server settings for Yahoo Mail

jobs

  1. C3BI 2016 – Job Application | C3BI
  2. Big Data Careers - Join The Infochimps Team | Infochimps
  3. Jobs at EMBL-EBI < About us < EMBL-EBI
  4. Modelling cancer signalling networks | Société Française de BioInformatique

Java-based web frameworks

Ninja - full stack web framework for Java

Standards and Formats in Bioinformatics

BioPAX.org
pharmML
Main Page - SBML.caltech.edu

Sequence Data

Sequence data | Train online
Look this for interview
Videos: UniProt - YouTube

Bioinformatics Data Skills

Bioinformatics Data Skills - O'Reilly Media

Data Visualization in R

R-analyst Cheat sheet: Data Visualisation in R

Code coverage

Reading it
Code coverage - Wikipedia, the free encyclopedia

https://travis-ci.org/
https://coveralls.zendesk.com/hc/en-us

git diff against a stash

To see a stash:
git stash show -p stash@{3}
See more: Git diff against a stash - Stack Overflow

Repository access denied. access via a deployment key is read-only

This link help me a lot of time. It comes out from this link: http://stackoverflow.com/questions/16299407/push-to-bitbucket-from-sourcetree

git stashing

Stashing

Often, when you’ve been working on part of your project, things are in a messy state and you want to switch branches for a bit to work on something else. The problem is, you don’t want to do a commit of half-done work just so you can get back to this point later. The answer to this issue is the git stashcommand.

Stashing takes the dirty state of your working directory — that is, your modified tracked files and staged changes — and saves it on a stack of unfinished changes that you can reapply at any time.

Stashing Your Work

To demonstrate, you’ll go into your project and start working on a couple of files and possibly stage one of the changes. If you run git status, you can see your dirty state:

$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#      modified:   index.html
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#
#      modified:   lib/simplegit.rb
#

Now you want to switch branches, but you don’t want to commit what you’ve been working on yet; so you’ll stash the changes. To push a new stash onto your stack, run git stash:

$ git stash
Saved working directory and index state \
  "WIP on master: 049d078 added the index file"
HEAD is now at 049d078 added the index file
(To restore them type "git stash apply")

Your working directory is clean:

$ git status
# On branch master
nothing to commit, working directory clean

At this point, you can easily switch branches and do work elsewhere; your changes are stored on your stack. To see which stashes you’ve stored, you can use git stash list:

$ git stash list
stash@{0}: WIP on master: 049d078 added the index file
stash@{1}: WIP on master: c264051 Revert "added file_size"
stash@{2}: WIP on master: 21d80a5 added number to log

In this case, two stashes were done previously, so you have access to three different stashed works. You can reapply the one you just stashed by using the command shown in the help output of the original stash command: git stash apply. If you want to apply one of the older stashes, you can specify it by naming it, like this: git stash apply stash@{2}. If you don’t specify a stash, Git assumes the most recent stash and tries to apply it:

$ git stash apply
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#
#      modified:   index.html
#      modified:   lib/simplegit.rb
#

You can see that Git re-modifies the files you uncommitted when you saved the stash. In this case, you had a clean working directory when you tried to apply the stash, and you tried to apply it on the same branch you saved it from; but having a clean working directory and applying it on the same branch aren’t necessary to successfully apply a stash. You can save a stash on one branch, switch to another branch later, and try to reapply the changes. You can also have modified and uncommitted files in your working directory when you apply a stash — Git gives you merge conflicts if anything no longer applies cleanly.

The changes to your files were reapplied, but the file you staged before wasn’t restaged. To do that, you must run the git stash apply command with a --index option to tell the command to try to reapply the staged changes. If you had run that instead, you’d have gotten back to your original position:

$ git stash apply --index
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#      modified:   index.html
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#
#      modified:   lib/simplegit.rb
#

The apply option only tries to apply the stashed work — you continue to have it on your stack. To remove it, you can run git stash drop with the name of the stash to remove:

$ git stash list
stash@{0}: WIP on master: 049d078 added the index file
stash@{1}: WIP on master: c264051 Revert "added file_size"
stash@{2}: WIP on master: 21d80a5 added number to log
$ git stash drop stash@{0}
Dropped stash@{0} (364e91f3f268f0900bc3ee613f9f733e82aaed43)

You can also run git stash pop to apply the stash and then immediately drop it from your stack.

Un-applying a Stash

In some use case scenarios you might want to apply stashed changes, do some work, but then un-apply those changes that originally came from the stash. Git does not provide such a stash unapplycommand, but it is possible to achieve the effect by simply retrieving the patch associated with a stash and applying it in reverse:

$ git stash show -p stash@{0} | git apply -R

Again, if you don’t specify a stash, Git assumes the most recent stash:

$ git stash show -p | git apply -R

You may want to create an alias and effectively add a stash-unapply command to your Git. For example:

$ git config --global alias.stash-unapply '!git stash show -p | git apply -R'
$ git stash apply
$ #... work work work
$ git stash-unapply

Creating a Branch from a Stash

If you stash some work, leave it there for a while, and continue on the branch from which you stashed the work, you may have a problem reapplying the work. If the apply tries to modify a file that you’ve since modified, you’ll get a merge conflict and will have to try to resolve it. If you want an easier way to test the stashed changes again, you can run git stash branch, which creates a new branch for you, checks out the commit you were on when you stashed your work, reapplies your work there, and then drops the stash if it applies successfully:

$ git stash branch testchanges
Switched to a new branch "testchanges"
# On branch testchanges
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#      modified:   index.html
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#
#      modified:   lib/simplegit.rb
#
Dropped refs/stash@{0} (f0dfc4d5dc332d1cee34a634182e168c4efc3359)

This is a nice shortcut to recover stashed work easily and work on it in a new branch.

add idioms into database

http://english-the-easy-way.com/Idioms/Give_Me_Ride.html
This page has plenty of idioms that can be added into the database

cellml

https://www.cellml.org/

Sample Data for Data Science

  1. https://support.spatialkey.com/spatialkey-sample-csv-data/
  2. http://web.archive.org/web/20151106164622/http://www.datawrangling.org/some-datasets-available-on-the-web
  3. http://msftdbprodsamples.codeplex.com/releases/view/55330
  4. http://pgfoundry.org/projects/dbsamples/
  5. Where to Find Open Data on the Web - ReadWrite
  6. MySQL :: Other MySQL Documentation
  7. WHO | Download data as CSV files

Git Basics - Working with Remotes

https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes

solr vs. elasticsearch

http://www.solrtutorial.com/solr-vs-elasticsearch.html

federated search

Federated search is an information retrieval technology that allows the simultaneous search of multiple searchable resources. A user makes a single query request which is distributed to the search engines, databases or other query engines participating in the federation.
Source: https://en.wikipedia.org/wiki/Federated_search
More: http://www.baileysolutions.co.uk/uploads/Federated_searching.pdf

Xem: 
http://www.flax.co.uk/blog/2016/01/25/xjoin-solr-part-1-filtering-using-price-discount-data/
http://www.flax.co.uk/blog/2016/01/29/xjoin-solr-part-2-click-example/

Read a csv file into array in python

There are some ways to that.
Using csv module:
https://blog.udemy.com/python-examples/
https://blog.udemy.com/python-csv/

Using pandas library:
http://pandas.pydata.org/pandas-docs/stable/indexing.html

Using numpy library:
https://www.getdatajoy.com/examples/python-data-analysis/read---write-csv-file-with-numpy

soft reload SOLR server

Basically we run url: curl http://localhost:8983/solr/solrdemo/update?commit=true
In Solr 5, we need to indicate the collection name (core name).

Test: 
  1. Run: curl http://localhost:8983/solr/solrdemo/update -d '[{"id" : "book2", "title_t" : "Statistical Methods for Spatio-Temporal Systems", "autho r_s" : "Held Isham"}]'
  2. Look solr server and the number of docs
  3. Changes?
  4. Run: curl http://localhost:8983/solr/solrdemo/update?commit=true
  5. Look solr server and the number of docs
Another reference links:
http://stackoverflow.com/questions/7815628/most-simple-way-url-to-trigger-solr-commit-of-all-pending-docs
https://docs.datastax.com/en/datastax_enterprise/4.0/datastax_enterprise/srch/srchReldCore.html

rename database in mysql

We have some ways:
  1. Use phpmyadmin
  2. Command: http://stackoverflow.com/questions/67093/how-do-i-quickly-rename-a-mysql-database-change-schema-name

Lucence Solr tutorials

http://lifelongprogrammer.blogspot.co.uk/search/label/Lucene-Solr

associative array in PHP

Array
(
    [id] => 2
    [name] => Phrasal Verb
    [slug] => phrasal-verb
)

Apache Spark

Link: http://hortonworks.com/blog/introduction-to-data-science-with-apache-spark/

open environment variables tool in windows from console

Lệnh:
sysdm.cpl
Chính xác: %windir%\System32\rundll32.exe sysdm.cpl,EditEnvironmentVariables
Hướng dẫn đầy đủ và chi tiết ở đây:
http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them

Default environment variables under windows

Các biến môi trường ngầm định trong hệ điều hành Windows:
http://www.adp-gmbh.ch/win/misc/environment_variables.html

comment in batch file in windows operating system

Dung :: or REM
http://stackoverflow.com/questions/11269338/how-can-i-comment-out-a-section-or-add-comments-in-a-batch-file

good articles talking on GORM and Hibernate

http://www.infoq.com/presentations/GORM-Performance
https://mrpaulwoods.wordpress.com/2011/02/07/implementing-burt-beckwiths-gorm-performance-no-collections/
http://www.anyware.co.uk/2005/2012/11/12/the-false-optimism-of-gorm-and-hibernate/
http://sysgears.com/articles/association-types-in-gorm/

check transaction finish or not in grails gorm

Google voi cum tu nay
Bai bao hay:
http://stackoverflow.com/questions/10871705/grails-transaction-issues
http://desmontandojava.blogspot.co.uk/2013/08/grails-pitfalls-dont-do-flushtrue-when.html
http://www.anyware.co.uk/2005/2012/11/12/the-false-optimism-of-gorm-and-hibernate/
http://naleid.com/blog/2009/10/01/batch-import-performance-with-grails-and-mysql/
http://rpeszek.blogspot.co.uk/2014/08/i-dont-like-hibernategrails-part-5-auto.html
http://grails.asia/improving-performance-of-large-batch-insert
https://www.catalysts.cc/en/diskussion/grails-in-large-projects-part-2/

http://www.slideshare.net/burtbeckwith/grails-worst-practices?next_slideshow=1
http://www.slideshare.net/SpringCentral/transactions-30148247

http://www.tothenew.com/blog/grails-transactions-using-transactional-annotations-and-propagation-requires_new/

select last rows in mysql

Syntax:
SELECT id,comment,model_id,upload_date FROM revision WHERE model_id=5 ORDER BY id DESC LIMIT 5;

Network Attached Storage

If you've heard of Network Attached Storage - sometimes shortened to NAS - but aren't sure what it's all about, then read on for our quick guide to the basics...

What is Network Attached Storage (NAS)?

We all know we can connect a USB External Hard Drive to our computer and immediately create additional storage for data or backup, but when it comes to efficient data management, there is perhaps a better way… to use Network Attached Storage or NAS for short.

Why Choose Network Attached Storage (NAS)?

External Hard Drives are a great way to quickly and conveniently create additional storage via a simple USB connection to your computer. However such devices are often restricted to use at the specific computer to which they’re connected and by the specific person using that computer. All good and well, but what if you need to share the content and files?

The answer lies in Network Attached Storage. Instead of connecting directly to an individual desktop or laptop computer, a NAS server connects to your wireless router. This effectively allows multiple users from multiple computers to access and share the content and files stored on it. Just one copy of your files, in one accessible place!

NAS Diagram

http://www.dabs.com/learnmore/components-and-storage/network-attached-storage-(nas)-explained/

plex

Công nghệ dùng để lưu trữ file everywhere, like cloud media sharing
https://plex.tv/

power-line communication

Power-line communication (PLC) is a communication protocol that uses electrical wiring to simultaneously carry both data, and Alternating Current (AC) electric power transmission or electric power distribution. It is also known as power-line carrierpower-line digital subscriber line (PDSL), mains communicationpower-line telecommunications, or power-line networking (PLN).

A wide range of power-line communication technologies are needed for different applications, ranging from home automation to Internet access which is often called broadband over power lines (BPL). Most PLC technologies limit themselves to one type of wire (such as premises wiring within a single building), but some can cross between two levels (for example, both the distribution network and premises wiring). Typically transformers prevent propagating the signal, which requires multiple technologies to form very large networks. Various data rates and frequencies are used in different situations.

A number of difficult technical problems are common between wireless and power-line communication, notably those of spread spectrum radio signals operating in a crowded environment. Radio interference, for example, has long been a concern of amateur radio groups.[1]

Tiếng Pháp là:
La communication par courants porteurs en ligne (ou CPL) permet de construire un réseau informatique sur le réseau électrique d'une habitation ou d'un bureau, voire d'un quartier ou groupe de bureaux. Cette idée apparue dans les années 19301 a fait l'objet de nombreuses applications (pour la domotique et l'informatique notamment), et dont les développements récents pourraient être les prémices d'unréseau électrique intelligent annoncé par de nombreux prospectivistes, dont Jeremy Rifkin1 dans le cadre de son projet de troisième révolution industrielle. Des courants à basse et moyenne tension sont aujourd'hui couramment utilisés pour porter des informations.

set global session in mysql

From Mysql 5.5, set global can super account, set session can tai khoan binh thuong

logging all queries in mysql

using mysql 5.6
Look the discussion: http://stackoverflow.com/questions/6479107/how-to-enable-mysql-query-log
Solution in Mysql 5.6 in Windows 7
SET global general_log_file='c:/Temp/mysql.log'; SET global general_log = 'ON'/'OFF'; SET global log_output = 'file';

basic example with Log4j

http://www.javavillage.in/perf4j-basic-example-with-log4j.php

alter table

ALTER TABLE `user` CHANGE `date_created` `date_created` DATETIME NULL DEFAULT CURRENT_TIMESTAMP;
RENME TABLE abc TO xyz;
ALTER TABLE `model` CHANGE `deleted` `deleted` BIT(1) NOT NULL DEFAULT b'0';

Enterprise Integration Patterns

Books: Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions; Gregor Hohpe and Bobby Woolf, 2003
Sample chapters: https://manning-content.s3.amazonaws.com/download/f/737b721-0f60-4ba9-bb1f-7a27c4a4532b/chapter1sample.pdf
Links:
  1. http://www.javacodegeeks.com/2012/11/introduction-to-enterprise-integration-patterns.html
  2. http://www.slideshare.net/Claudia.Rosu/7-eaipatterns

pattern

A pattern is a standard solution to common and recurring design problems.

What exactly is Apache Camel?

Like to go heaven
http://stackoverflow.com/questions/8845186/what-exactly-is-apache-camel

I don't understand what exactly Camel does.

If you could give in 101 words an introduction to Camel:

  • What exactly is it?
  • How does it interact with an application written in Java?
  • Is it something that goes together with the server?
  • Is it an independent program?

Please explain what Camel is.


creating table of contents in google docs

Apply headings the texts want to be in TOC 
Link: http://googledrive.blogspot.co.uk/2010/06/tips-tricks-table-of-contents-in-google.html

working django ipython notebook

Start notebook from terminal:
>ipython notebook
Run Django:
>python manage.py runserver
Others
Run anamcs at localhost
http://127.0.0.1:8000/admin/polls/

nakkaya

a good website for reference: nakkaya.com

Where is waldo?

right, it games
Where's Wally? (known in the United States and Canada as Where's Waldo?) is a series of children's books created by the English illustrator Martin Handord. The books consist of a series of detailed double-page spread illustrations depicting dozens or more people doing a variety of amusing things at a given location. Readers are challenged to find a character named Wally hidden in the group. Wally's distinctive red-and-white-stripped shirt, bobble hat and glasses make him slightly easier to recognise, but many illustrations contain red herrings involving deceptive use of red-and-white stripped objects.

how to reload files opening in emacs

C-x C-v Enter
revert-buffer
Link: http://emacs.stackexchange.com/questions/169/how-do-i-reload-a-file-in-a-buffer

Don't repeat yourself

Don't Repeat Yourself (DRY) http://c2.com/cgi/wiki?DontRepeatYourself

password admin for django tutorial app

admin account: admin
password: admin123

user account in mysql exceed the max questions

Link here:
http://www.mkyong.com/mysql/how-to-modify-the-max_questions-resource-value-in-mysql/

install MingW 64

Install it and add its folder to PATH

install mysql-python quite confusing

Install mysql-python in Windows 7 under Python 3.5 is quite hard and most failed because the problem of comparability. 
This link helps me a lot
https://github.com/PyMySQL/mysqlclient-python/issues/54

run the tutorial django

Run the tutorial at 
  1. https://docs.djangoproject.com/en/1.9/intro/tutorial01/
  2. https://docs.djangoproject.com/en/1.9/intro/tutorial02/
Notes:
  • add 'polls' into settings.py

install django

Using Anaconda Prompt run the command:
pip install django
Test the installation successfully:

import django
print(django.get_version())
print(django.__path__)

Changes in Codeigniter 3 compared to CodeIgniter 2

Changes compared to CodeIgniter 2:

http://forum.codeigniter.com/thread-1657-post-7480.html#pid7480


config phpmyadmin

Link https://wiki.archlinux.org/index.php/PhpMyAdmin

create register login logout with codeigniter mysql and bootstrap

Link 1: Not work in my computer.
https://github.com/ntung/Codeigniter-login-logout-register
Link 2: Work well but need to change some things. Link: http://www.kodingmadesimple.com/2014/08/how-to-create-login-form-codeigniter-mysql-twitter-bootstrap.html
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL DEFAULT '',
  `email` varchar(255) NOT NULL DEFAULT '',
  `password` varchar(255) NOT NULL DEFAULT '',
  `avatar` varchar(255) DEFAULT 'default.jpg',
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  `is_admin` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_confirmed` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `is_deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `ci_sessions` (
        `id` varchar(40) NOT NULL,
        `ip_address` varchar(45) NOT NULL,
        `timestamp` int(10) unsigned DEFAULT 0 NOT NULL,
        `data` blob NOT NULL,
        PRIMARY KEY (id),
        KEY `ci_sessions_timestamp` (`timestamp`)
);
create table ci_session if we modify in config.php

Why? Please see here: http://forum.codeigniter.com/thread-50019-page-2.html

show the current mysql connection

How to know which database is connected/is in use.
>select User();
>select database();
>select status; not work in mysql, work with mysqladmin
http://stackoverflow.com/questions/3613704/mysql-show-current-connection-info

grind teeth and twitching while sleeping

http://www.dailymail.co.uk/health/article-2110674/How-stop-husband-wife-wrecking-nights-sleep-snoring.html

mysqladmin guide

http://dev.mysql.com/doc/refman/5.7/en/mysqladmin.html

frush privileges into mysql

Link here: https://mediatemple.net/community/products/dv/204404494/how-do-i-grant-privileges-in-mysql
Link tren mysql page: https://dev.mysql.com/doc/refman/5.5/en/grant.html

git labs

http://gitimmersion.com/lab_01.html

Git Aliases

Git Aliases

Before we finish this chapter on basic Git, there’s just one little tip that can make your Git experience simpler, easier, and more familiar: aliases. We won’t refer to them or assume you’ve used them later in the book, but you should probably know how to use them.

Git doesn’t automatically infer your command if you type it in partially. If you don’t want to type the entire text of each of the Git commands, you can easily set up an alias for each command using git config.Here are a couple of examples you may want to set up:

$ git config --global alias.co checkout
$ git config --global alias.br branch
$ git config --global alias.ci commit
$ git config --global alias.st status

This means that, for example, instead of typing git commit, you just need to type git ci. As you go on using Git, you’ll probably use other commands frequently as well; don’t hesitate to create new aliases.

This technique can also be very useful in creating commands that you think should exist. For example, to correct the usability problem you encountered with unstaging a file, you can add your own unstage alias to Git:

$ git config --global alias.unstage 'reset HEAD --'

This makes the following two commands equivalent:

$ git unstage fileA
$ git reset HEAD -- fileA

This seems a bit clearer. It’s also common to add a last command, like this:

$ git config --global alias.last 'log -1 HEAD'

This way, you can see the last commit easily:

$ git last
commit 66938dae3329c7aebe598c2246a8e6af90d04646
Author: Josh Goebel &lt;dreamer3@example.com&gt;
Date:   Tue Aug 26 19:48:51 2008 +0800

    test for current head

    Signed-off-by: Scott Chacon &lt;schacon@example.com&gt;

As you can tell, Git simply replaces the new command with whatever you alias it for. However, maybe you want to run an external command, rather than a Git subcommand. In that case, you start the command with a ! character. This is useful if you write your own tools that work with a Git repository. We can demonstrate by aliasing git visual to run gitk:

$ git config --global alias.visual '!gitk'
https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases

quote management

Làm một site về quản lí quote, cho phép

humorous stories

http://www.english-for-students.com/Humorous-Stories.html
Đây là ý tưởng mình muốn làm một site về chuyện cười

170 câu giao tiếp Anh căn bản

Link: http://bloghoctienganh.net/forum/threads/top-170-cau-tieng-anh-giao-tiep-thong-dung-nhat.4747/
Video:
<iframe width="560" height="315" src="https://www.youtube.com/embed/p_ht75PpKrA" frameborder="0" allowfullscreen></iframe>

CodeIgniter url_title decode not properly UTF8 Characters

Khi gõ tiêu đề tiếng Việt, url_title hàm này chuyển đổi không được mượt mà cho lắm. Thành ra, chúng ta sử dụng thêm hàm convert_accented_characters(). Hàm tiện dùng nằm trong thư viện text nên phải nạp nó trước khi dùng.
$this->load->helper('text');
Xem thêm giải thích ở: http://stackoverflow.com/questions/17073544/codeigniter-url-title-utf8-characters và hướng dẫn sử dụng helper này trên trang API documentation https://codeigniter.com/user_guide/helpers/text_helper.html

connect to remote mysql server with port and hostname

Cú pháp 
mysql -h 172.126.5.7 -P 4344 -u admin -p

Differences of varchar(255) vs tinytext vs blob etc

Tôi muốn thay đổi kiểu dữ liệu cho một cột trước đó khai báo là varchar(255). Để giải thích tại sao phải đổi thành text hay bất kì kiểu gì khác có kích thước lớn hơn, cần hiểu sự khác biệt của chúng.
I need to know what are the differences of the following data types in mysql:
  1. varchar(255) vs tinytext/tinybob
  2. varchar(255) vs blob/text
The link http://stackoverflow.com/questions/7755629/varchar255-vs-tinytext-tinyblob-and-varchar65535-vs-blob-text explains those

grails database migration

Today I start learning how to make a database migration in grails
Link https://grails-plugins.github.io/grails-database-migration/docs/manual/guide/introduction.html
Tai file pdf: http://grails-plugins.github.io/grails-database-migration/
Steps:
  1. Create a groovy file in migration folder of application
  2. Add rules and commands as well.
  3. Update dependencies
  4. Include it inside changelog.groovy
  5. From grails terminal, run dbm-update before running app

Basic CRUD with Codeigniter

This writing is quite simple to follow. http://www.amitavroy.com/justread/content/articles/part-4-basic-crud-codeigniter

© 2013 - 2026. Tung NGUYEN. Using CI version: 3.0.2 | Page rendered in 0.0069 seconds.