[ -d /usr/share/fonts/opentype ] || sudo mkdir /usr/share/fonts/opentype
sudo git clone --depth 1 --branch release https://github.com/adobe-fonts/source-code-pro.git /usr/share/fonts/opentype/scp
sudo fc-cache -f -v
;;;; SPEED UP EMACS ==================================== | |
;; Decrease the number of garbage collection invocations | |
(setq gc-cons-threshold 10000000) | |
(add-hook 'emacs-startup-hook 'my/set-gc-threshold) | |
(defun my/set-gc-threshold () | |
"Reset `gc-cons-threshold' to its default value." | |
(setq gc-cons-threshold 800000)) | |
;; Package configs | |
(require 'package) |
Ripgrep is a fast search tool like grep
. It's mostly a drop-in replacement for ag
, also know as the Silver Searcher.
helm-ag
is a fantastic package for Emacs that allows you to display search results in a buffer.
You can also jump to locations of matches. Despite the name, helm-ag
works with ripgrep (rg
) as well
as with ag
.
SPC s c remove highlight | |
**** Files manipulations key bindings | |
Files manipulation commands (start with ~f~): | |
| Key Binding | Description | | |
|-------------+----------------------------------------------------------------| | |
| ~SPC f c~ | copy current file to a different location | | |
| ~SPC f C d~ | convert file from unix to dos encoding | | |
| ~SPC f C u~ | convert file from dos to unix encoding | |
function convertArrayOfObjectsToCSV(args) { | |
var result, ctr, keys, columnDelimiter, lineDelimiter, data; | |
data = args.data || null; | |
if (data == null || !data.length) { | |
return null; | |
} | |
columnDelimiter = args.columnDelimiter || ','; | |
lineDelimiter = args.lineDelimiter || '\n'; |
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
- Ý tưởng của em là khởi tạo mảng mới chứa các điểm X. Sau đó duyệt qua từng hàng. | |
so sánh hoành độ của các điểm X của hàng đang duyệt với các điểm trong mảng các ao. | |
Nếu chênh nhau 1 thì nạp thêm điểm mới vào ao kia. | |
ví dụ như bài trên: | |
Ta có mảng arr_land chứa tất cả các ao | |
- Duyệt Row 1 : có Ao1 = {(0,0)}, Ao2 = {(0,9), (0,10)} --> add Ao1, Ao2 vào mảng arr_land | |
- Duyệt Row 2: có Ao3 = {(1,1),{1,2),(1,3)}, Ao4 = {(1,9),(1,10),(1,11)} | |
Xet Ao3 có phần tử (1,1) có chung đỉnh vs đỉnh (0,0) của Ao1 nên gộp 2 mảng Ao1 và Ao3 lại--> tượng tư vs Ao4 | |
vậy ta vẫn có magr arr_land chứa 2 ao Ao1 {(0,0),(1,1),{1,2),(1,3)} và Ao2 {(0,9), (0,10), (1,9),(1,10),(1,11) } |
Dùng "+" thì mỗi lần create một object mới chõ mỗi lần dùng, còn "concast" làm việc với chính nó nên việc sử dụng "+" | |
sẽ cho tóc độ xử lí chậm hơn. |
class CreatePeople < ActiveRecord::Migration | |
def change | |
create_table :people do |t| | |
t.string :name | |
t.references :parent, index: true | |
t.timestamps null: false | |
end | |
end | |
end |