0%

Of all that is written, I love only what a man has written with his blood. Write with blood, and you will find that blood is spirit.

阅读全文 »

YOU do not want to kill, you judges and executioners, until the animal has bowed its head? Behold, the pale criminal has bowed his head: out of his eye speaks the great contempt.

阅读全文 »

定义

SUBSTRING_INDEX - 按分隔符截取字符串

语法

1
SUBSTRING_INDEX(str, delimiter, count)

返回一个 str 的子字符串,在 delimiter 出现 count 次的位置截取。
如果 count > 0,从则左边数起,且返回位置前的子串;
如果 count < 0,从则右边数起,且返回位置后的子串。

delimiter 是大小写敏感,且是多字节安全的。

示例

1
2
3
4
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', 2);
-> 'www.mysql'
mysql> SELECT SUBSTRING_INDEX('www.mysql.com', '.', -2);
-> 'mysql.com'

总结

这个函数很实用,PHP中都没有类似的函数,
比如取一个以斜线分割的图片路径的名称,201807/20180731181759_5b603757ea5e4.jpg,这个函数可以一步到位,PHP中则需要explode成数组,然后取最后一个元素。

美中不足的是,我感觉可以再设置个可选参数,就是返回的时候是否保留分隔符,这个当然通过concat连接,但如果能直接返回就更好了。

To the despisers of the body I speak my word. I wish them neither to learn afresh, nor teach anew, but only to bid farewell to their own bodies,- and thus become silent.

“Body am I, and soul”- so says the child. And why should one not speak like children?

But the awakened one, the knowing one, says: “Body am I entirely, and nothing more; and soul is only the name of something in the body.”

The body is a great wisdom, a plurality with one sense, a war and a peace, a flock and a shepherd.

An instrument of your body is also your small wisdom, my brother, which you call “mind”- a little instrument and toy of your great wisdom.

“I,” you say, and are proud of that word. But the greater thing- in which you are unwilling to believe- is your body with its great wisdom; that does not say “I,” but does “I.”

What the sense feels, what the mind knows, never has its end in itself. But sense and mind would rather persuade you that they are the end of all things: so vain are they.

Instruments and toys are sense and mind: behind them there is still the Self. The Self seeks with the eyes of the senses, it listens also with the ears of the mind.

Always the Self listens and seeks; it compares, masters, conquers, and destroys. It rules, and is also the mind’s ruler.

Behind your thoughts and feelings, my brother, there is a mighty lord, an unknown sage- it is called Self; it dwells in your body, it is your body.

There is more wisdom in your body than in your best wisdom. And who then knows why your body needs precisely your best wisdom?

Your Self laughs at your mind, and its bold leaps. “What are these leaps and flights of thought to me?” it says to itself. “A detour to my end.

30 I hold the puppet-strings of the mind, and am the prompter of its notions.”

The Self says to the mind: “Feel pain!” Then the mind suffers, and thinks how it may put an end to its suffering- and that is why it is made to think.

The Self says to the mind: “Feel pleasure!” Then the mind is pleased, and thinks how it may be pleased again- and that is why it is made to think.

I want to speak to the despisers of the body. Their contempt is caused by their respect. What is it that created respect and contempt and worth and will?

The creating Self created for itself respect and contempt, it created for itself pleasure and pain. The creative body created the mind as a hand for its will.

Even in your folly and contempt you each serve your Self, you despisers of the body. I tell you, your very Self wants to die, and turns away from life.

No longer can your Self do that which it desires most:- create beyond itself. That is what it desires most; that is its fervent wish.

But it is now too late to do so:- so your Self wishes to perish, you despisers of the body.

To perish- so wishes your Self; and therefore you have become despisers of the body. For you can no longer create beyond yourselves.

And that is why you are angry with life and the earth. An unconscious envy is in the sidelong glance of your contempt.

I do not go your way, you despisers of the body! You are no bridges to the Superman!-

Thus spoke Zarathustra.


jQuery操作数组主要有两种方式:

普通数组

1
2
3
$.each(array,function(k,v){
//...
});
  • 关联数组,{“id”:10,”name”:”tom”}
  • 索引数组,[1,2,3,4,5,6,7,8,9]

k: 如果是关联是键名,如果是索引是下标(从0开始);
vo: 是元素值;


对象数组

1
2
3
$("p").each(function(k,v){
//...
})

i 是数组元素的下标数字,索引下标
v 是dom中的节点[子对象]

其中
v = this = '<p>...</p>' //字符串
$(v) = $(this) = init… //dom节点对象