.
'생활의 발견 > 아침편지' 카테고리의 다른 글
나의 부족함을 끌어안을 때 (0) | 2013.08.10 |
---|---|
세상을 바꾸는 시간, 15분: 세바시 207회 지금 당신에게 힐링이... @고도원 (재)아침편지문화재단 이사장 (0) | 2013.08.09 |
'나는 괜찮은 사람' (0) | 2013.08.09 |
비가 내리지 않는 하늘은 없다 (0) | 2013.08.08 |
자연을 통해... (0) | 2013.08.07 |
.
나의 부족함을 끌어안을 때 (0) | 2013.08.10 |
---|---|
세상을 바꾸는 시간, 15분: 세바시 207회 지금 당신에게 힐링이... @고도원 (재)아침편지문화재단 이사장 (0) | 2013.08.09 |
'나는 괜찮은 사람' (0) | 2013.08.09 |
비가 내리지 않는 하늘은 없다 (0) | 2013.08.08 |
자연을 통해... (0) | 2013.08.07 |
세상을 바꾸는 시간, 15분: 세바시 207회 지금 당신에게 힐링이... @고도원 (재)아침편지문화재단 이사장 (0) | 2013.08.09 |
---|---|
[링컨학교 영어캠프 2기] 특강-왜링컨학교영어캠프인가 (고도원) (0) | 2013.08.09 |
비가 내리지 않는 하늘은 없다 (0) | 2013.08.08 |
자연을 통해... (0) | 2013.08.07 |
마음의 채널 (0) | 2013.08.06 |
외로운 신하와 서자로 태어난 사람은
그들의 마음가짐이 절실할 수밖에 없고,
그 어려움을 극복하는 생각이 깊을 수밖에 없다.
그러므로 그런 사람들은 남보다 뛰어난 사람이 되는 것이다.
- 맹자
남보다 부족하고 어려운 상황에 처하게 되면
마음가짐이 남과 다를 수밖에 없습니다.
남보다 몇 배 더 고민하고 몇 배 더 노력하게 됩니다.
가장 큰 어려움을 겪고 난 후 사람들은 가장 크게 성장합니다.
칭찬거리를 찾는 것을 하루 일과로 삼아라. (0) | 2013.08.13 |
---|---|
연습이 천재를 만든다. (0) | 2013.08.12 |
인생에서 가장 큰 위험은? (0) | 2013.08.08 |
배움에 고파하라. 성장하지 않으면 곧 퇴보한다. (0) | 2013.08.07 |
큰 실패를 했다면, 자서전 집필중이라 생각하라. (0) | 2013.08.05 |
.
[ClubMix] 여러가지. (0) | 2013.08.09 |
---|---|
Daft Punk - Get Lucky (Full Video) (0) | 2013.08.09 |
폭풍을 쫓는 이의 사진 (0) | 2013.08.08 |
[Crayon Pop] 크레용팝 빠빠빠(Bar Bar Bar) 뮤직비디오 - Story Ver. MV (0) | 2013.08.02 |
Official Call of Duty: Black Ops 2 Vengeance Replacers Gameplay Video [PS3] (0) | 2013.08.02 |
서버구입 없이 RoR, Nodejs, Django, Go 개발 및 Publishing 을 경험해 볼 수 있는 웹기반 '무료' 서버입니다.
Nitrous.IO - Develop in the Cloud
혼자서 프로젝트 수행하기 (0) | 2013.09.09 |
---|---|
Call of Duty®: Strike Team (0) | 2013.09.09 |
Skeuocard: An innovative way to enter credit card details (0) | 2013.08.08 |
YouCompleteMe — Fuzzy-search code completion in Vim (0) | 2013.08.06 |
Furatto — A flat front-end framework (0) | 2013.08.02 |
> /(a+)b\1/.test("aaba") true > /^(a+)b\1/.test("aaba") false > var tagName = /<([^>]+)>[^<]*<\/\1>/; > tagName.exec("<b>bold</b>")[1] 'b' > tagName.exec("<strong>text</strong>")[1] 'strong' > tagName.exec("<strong>text</stron>") null
Flags modify matching behavior.
Regular expression literal: var regex = /xyz/; (compiled at load time) Regular expression object: var regex = new RegExp("xzy"); (compiled at runtime)
Examples:
g global The given regular expression is matched multiple times. i ignoreCase Case is ignored when trying to match the given regular expression. m multiline In multiline mode, the begin and end operators ^ and $ work for each line, instead of for the complete input string.
> /abc/.test("ABC") false > /abc/i.test("ABC") trueRegular expressions have the following properties.
regex.test(str)Examples:
> var regex = /^(a+)b\1$/; > regex.test("aabaa") true > regex.test("aaba") falseIf the flag g is set then test() returns true as often as there are matches in the string.
> var regex = /b/g; > var str = 'abba'; > regex.test(str) true > regex.test(str) true > regex.test(str) false
str.search(regex)search() completely ignores the flag g. Examples:
> 'abba'.search(/b/) 1 > 'abba'.search(/x/) -1
var matchData = regex.exec(str);matchData is null if there wasn’t a match. Otherwise, it is an array with two additional properties.
> var regex = /a(b+)a/; > regex.exec("_abbba_aba_") [ 'abbba' , 'bbb' , index: 1 , input: '_abbba_aba_' ] > regex.lastIndex 0Invoke repeatedly: Flag global is set.
> var regex = /a(b+)a/g; > regex.exec("_abbba_aba_") [ 'abbba' , 'bbb' , index: 1 , input: '_abbba_aba_' ] > regex.lastIndex 6 > regex.exec() [ 'aba' , 'b' , index: 7 , input: '_abbba_aba_' ] > regex.exec() nullLoop over matches.
var regex = /a(b+)a/g; var str = "_abbba_aba_"; while(true) { var match = regex.exec(str); if (!match) break; console.log(match[1]); }Output:
bbb b
var matchData = str.match(regex);If the flag g of regex is not set, this method works like RegExp.prototype.exec(). If the flag is set then it returns an array with all matching substrings in str (i.e., group 0 of every match) or null if there is no match.
> 'abba'.match(/a/) [ 'a', index: 0, input: 'abba' ] > 'abba'.match(/a/g) [ 'a', 'a' ] > 'abba'.match(/x/g) null
str.replace(search, replacement)Parameters:
> "a1b_c1d".replace("1", "[$`-$&-$']") 'a[a-1-b_c1d]b_c1d' > "a1b_c1d".replace(/1/, "[$`-$&-$']") 'a[a-1-b_c1d]b_c1d' > "a1b_c1d".replace(/1/g, "[$`-$&-$']") 'a[a-1-b_c1d]b_c[a1b_c-1-d]d'Replacement is a function. The replacement function has the following signature.
function(completeMatch, group_1, ..., group_n, offset, inputStr) { ... }completeMatch is the same as $& above, offset indicates where the match was found, and inputStr is what is being matched against. Thus, the special variable arguments inside the function starts with the same data as the result of the exec() method.
Example:
> "I bought 3 apples and 5 oranges".replace( /[0-9]+/g, function(match) { return 2 * match; }) 'I bought 6 apples and 10 oranges'
str.split(separator, limit?)Parameters:
> "aaa*a*".split("a*") [ 'aa', '', '' ] > "aaa*a*".split(/a*/) [ '', '*', '*' ] > "aaa*a*".split(/(a*)/) [ '', 'aaa', '*', 'a', '*' ]
11 Javascript ToolKit For Creating Charts and Graphs (0) | 2013.08.13 |
---|---|
[jQuery] 16 Free jQuery Data And Time Plugins (0) | 2013.08.12 |
[jQuery] Caching jQuery selections in an object (0) | 2013.08.08 |
[javascript] Pickadate.js — Responsive date & time picker (0) | 2013.08.07 |
[jQuery] Sticky-kit: A sticky element jQuery plugin (0) | 2013.08.07 |
Call of Duty®: Strike Team (0) | 2013.09.09 |
---|---|
Nitrous.IO - Nodejs, Django, Go (0) | 2013.08.08 |
YouCompleteMe — Fuzzy-search code completion in Vim (0) | 2013.08.06 |
Furatto — A flat front-end framework (0) | 2013.08.02 |
Monsta FTP — FTP cloudware (0) | 2013.07.31 |
Caching jQuery selections in an object
Before
jQuery(document).ready(function() {
After
var someNamespace_Dom = {
someSelector : 'jQuery("#some-selector")',
anotherElement: 'jQuery("#another-element")',
};
jQuery(document).ready(function() {
someNamespace_Dom.someSelector.on('hover', function() {
jQuery(this).fadeOut('slow').delay(400).fadeIn();
console.log(jQuery(this).text());
});
someNamespace_Dom.anotherElement.on('hover', function() {
jQuery(this).slideUp();
});
someNamespace_Dom.someSelector.on('click', function() {
alert('You have clicked a featured element');
});
someNamespace_Dom.anotherElement.on('mouseout', function() {
jQuery(this).slideUp();
});
});
[jQuery] 16 Free jQuery Data And Time Plugins (0) | 2013.08.12 |
---|---|
JavaScript: an overview of the regular expression API (0) | 2013.08.08 |
[javascript] Pickadate.js — Responsive date & time picker (0) | 2013.08.07 |
[jQuery] Sticky-kit: A sticky element jQuery plugin (0) | 2013.08.07 |
[WEB] HTML5, CSS, javascript 게임 (0) | 2013.08.06 |