[
{ "keys": ["ctrl+shift+u"], "command": "sftp_upload_file" },
{ "keys": ["ctrl+shift+m"], "command": "sftp_browse" },
{ "keys": ["f4"], "command": "toggle_side_bar" },
]
Kiến thức là vô biên, vì vậy hãy chia sẻ nó. Trên đây là một số công cụ và source mình sưu tầm được. Mong là nó sẽ hữu ích đối với bạn !
Code Google
Thứ Năm, 23 tháng 1, 2014
Thứ Bảy, 18 tháng 1, 2014
something in sql
Boolean full-text searches have these characteristics:
- They do not use the 50% threshold.
- They do not automatically sort rows in order of decreasing relevance. You can see this from the preceding query result: The row with the highest relevance is the one that contains “MySQL” twice, but it is listed last, not first.
-
They can work even without a
FULLTEXT
index, although a search executed in this fashion would be quite slow. - The minimum and maximum word length full-text parameters apply.
- The stopword list applies.
-
+
A leading plus sign indicates that this word must be present in each row that is returned. -
-
A leading minus sign indicates that this word must not be present in any of the rows that are returned.
Note: The-
operator acts only to exclude rows that are otherwise matched by other search terms. Thus, a boolean-mode search that contains only terms preceded by-
returns an empty result. It does not return “all rows except those containing any of the excluded terms.” -
(no operator)
By default (when neither+
nor-
is specified) the word is optional, but the rows that contain it are rated higher. This mimics the behavior ofMATCH() ... AGAINST()
without theIN BOOLEAN MODE
modifier. -
> <
These two operators are used to change a word's contribution to the relevance value that is assigned to a row. The>
operator increases the contribution and the<
operator decreases it. See the example following this list. -
( )
Parentheses group words into subexpressions. Parenthesized groups can be nested. -
~
A leading tilde acts as a negation operator, causing the word's contribution to the row's relevance to be negative. This is useful for marking “noise” words. A row containing such a word is rated lower than others, but is not excluded altogether, as it would be with the-
operator. -
*
The asterisk serves as the truncation (or wildcard) operator. Unlike the other operators, it should be appended to the word to be affected. Words match if they begin with the word preceding the*
operator.
If a word is specified with the truncation operator, it is not stripped from a boolean query, even if it is too short (as determined from theft_min_word_len
setting) or a stopword. This occurs because the word is not seen as too short or a stopword, but as a prefix that must be present in the document in the form of a word that begins with the prefix. Suppose thatft_min_word_len=4
. Then a search for'+
will likely return fewer rows than a search forword
+the*''+
:word
+the'
-
The former query remains as is and requires both
word
andthe*
(a word starting withthe
) to be present in the document. -
The latter query is transformed to
+
(requiring onlyword
word
to be present).the
is both too short and a stopword, and either condition is enough to cause it to be ignored.
-
The former query remains as is and requires both
-
"
A phrase that is enclosed within double quote (“"
”) characters matches only rows that contain the phrase literally, as it was typed. The full-text engine splits the phrase into words and performs a search in theFULLTEXT
index for the words. Nonword characters need not be matched exactly: Phrase searching requires only that matches contain exactly the same words as the phrase and in the same order. For example,"test phrase"
matches"test, phrase"
.
If the phrase contains no words that are in the index, the result is empty. For example, if all words are either stopwords or shorter than the minimum length of indexed words, the result is empty.
-
'apple banana'
Find rows that contain at least one of the two words. -
'+apple +juice'
Find rows that contain both words. -
'+apple macintosh'
Find rows that contain the word “apple”, but rank rows higher if they also contain “macintosh”. -
'+apple -macintosh'
Find rows that contain the word “apple” but not “macintosh”. -
'+apple ~macintosh'
Find rows that contain the word “apple”, but if the row also contains the word “macintosh”, rate it lower than if row does not. This is “softer” than a search for'+apple -macintosh'
, for which the presence of “macintosh” causes the row not to be returned at all. -
'+apple +(>turnover <strudel)'
Find rows that contain the words “apple” and “turnover”, or “apple” and “strudel” (in any order), but rank “apple turnover” higher than “apple strudel”. -
'apple*'
Find rows that contain words such as “apple”, “apples”, “applesauce”, or “applet”. -
'"some words"'
Find rows that contain the exact phrase “some words” (for example, rows that contain “some words of wisdom” but not “some noise words”). Note that the “"
” characters that enclose the phrase are operator characters that delimit the phrase. They are not the quotation marks that enclose the search string itself.
SELECT name, description, ...
FROM ...
WHERE id IN([ids, any order])
ORDER BY FIELD(id, [ids in order])
FIELD() will return the index of the first parameter that is equal to
the first parameter (other than the first parameter itself).FIELD('a', 'a', 'b', 'c')
will return 1
FIELD('a', 'c', 'b', 'a')
Thứ Sáu, 17 tháng 1, 2014
class get pagerank
class PR {
public function get_google_pagerank($url) {
$query="http://toolbarqueries.google.com/tbr?client=navclient-auto&ch=".$this->CheckHash($this->HashURL($url)). "&features=Rank&q=info:".$url."&num=100&filter=0";
$data=file_get_contents($query);
$pos = strpos($data, "Rank_");
if($pos === false){} else{
$pagerank = substr($data, $pos + 9);
return $pagerank;
}
}
public function StrToNum($Str, $Check, $Magic)
{
$Int32Unit = 4294967296; // 2^32
$length = strlen($Str);
for ($i = 0; $i < $length; $i++) {
$Check *= $Magic;
if ($Check >= $Int32Unit) {
$Check = ($Check - $Int32Unit * (int) ($Check / $Int32Unit));
$Check = ($Check < -2147483648) ? ($Check + $Int32Unit) : $Check;
}
$Check += ord($Str{$i});
}
return $Check;
}
public function HashURL($String)
{
$Check1 = $this->StrToNum($String, 0x1505, 0x21);
$Check2 = $this->StrToNum($String, 0, 0x1003F);
$Check1 >>= 2;
$Check1 = (($Check1 >> 4) & 0x3FFFFC0 ) | ($Check1 & 0x3F);
$Check1 = (($Check1 >> 4) & 0x3FFC00 ) | ($Check1 & 0x3FF);
$Check1 = (($Check1 >> 4) & 0x3C000 ) | ($Check1 & 0x3FFF);
$T1 = (((($Check1 & 0x3C0) << 4) | ($Check1 & 0x3C)) <<2 ) | ($Check2 & 0xF0F );
$T2 = (((($Check1 & 0xFFFFC000) << 4) | ($Check1 & 0x3C00)) << 0xA) | ($Check2 & 0xF0F0000 );
return ($T1 | $T2);
}
public function CheckHash($Hashnum)
{
$CheckByte = 0;
$Flag = 0;
$HashStr = sprintf('%u', $Hashnum) ;
$length = strlen($HashStr);
for ($i = $length - 1; $i >= 0; $i --) {
$Re = $HashStr{$i};
if (1 === ($Flag % 2)) {
$Re += $Re;
$Re = (int)($Re / 10) + ($Re % 10);
}
$CheckByte += $Re;
$Flag ++;
}
$CheckByte %= 10;
if (0 !== $CheckByte) {
$CheckByte = 10 - $CheckByte;
if (1 === ($Flag % 2) ) {
if (1 === ($CheckByte % 2)) {
$CheckByte += 9;
}
$CheckByte >>= 1;
}
}
return '7'.$CheckByte.$HashStr;
}
}
Lay rank alexa
<?
$url
=
"toolspot.org"
;
$xml
= simplexml_load_file(
'http://data.alexa.com/data?cli=10&dat=snbamz&url='
.
$url
);
$rank
=isset(
$xml
->SD[1]->POPULARITY)?
$xml
->SD[1]->POPULARITY->attributes()->TEXT:0;
$web
=(string)
$xml
->SD[0]->attributes()->HOST;
echo
$web
.
" has Alexa Rank "
.
$rank
;
?>
Thứ Tư, 15 tháng 1, 2014
Thứ Ba, 7 tháng 1, 2014
Chủ Nhật, 5 tháng 1, 2014
tab basic using jquery
<!DOCTYPE html>
<html>
<body>
<style>
.title_tab li {
float: left;
list-style: none outside none;
}
.content_tab li {
display: none;
list-style: none outside none;
}
.title_tab ul {
height: 30px;
margin: 0;
padding: 0;
}
.title_tab li a {
background: none repeat scroll 0 0 #D7D7D7;
border-radius: 5px 5px 0 0;
border-top: 1px solid #CCCCCC;
color: #666161;
display: block;
font-family: arial;
margin-left: 10px;
padding: 5px 33px;
text-decoration: none;
}
.content_tab li {
}
.content_tab li.active {
display: block;
}
.content_tab > ul {
background: none repeat scroll 0 0 #EDEDED;
border-radius: 4px;
margin: 0;
padding: 10px;
}
.title_tab li.active a {
background: none repeat scroll 0 0 #EDEDED;
color: #060606;
font-weight: bold;
}
</style>
<div class="title_tab">
<ul class="">
<li data-class-child="1" class="active"> <a href="#">1</a></li>
<li data-class-child="2"> <a href="#">2</a></li>
<li data-class-child="3"> <a href="#">3</a></li>
</ul>
</div>
<div class="content_tab">
<ul class="">
<li class="active"> <a href="#">a</a></li>
<li> <a href="#">b</a></li>
<li> <a href="#">c</a></li>
</ul>
</div>
<!-- jQuery -->
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.title_tab li').click(function(event) {
var pos_li=$(this).attr('data-class-child');
$('.title_tab ul>li').removeClass('active');
$(this).addClass('active');
$('.content_tab ul>li').removeClass('active');
$('.content_tab ul>li:nth-child('+pos_li+')').addClass('active');
return false;
});;
});
</script>
</body>
</html>
<html>
<body>
<style>
.title_tab li {
float: left;
list-style: none outside none;
}
.content_tab li {
display: none;
list-style: none outside none;
}
.title_tab ul {
height: 30px;
margin: 0;
padding: 0;
}
.title_tab li a {
background: none repeat scroll 0 0 #D7D7D7;
border-radius: 5px 5px 0 0;
border-top: 1px solid #CCCCCC;
color: #666161;
display: block;
font-family: arial;
margin-left: 10px;
padding: 5px 33px;
text-decoration: none;
}
.content_tab li {
}
.content_tab li.active {
display: block;
}
.content_tab > ul {
background: none repeat scroll 0 0 #EDEDED;
border-radius: 4px;
margin: 0;
padding: 10px;
}
.title_tab li.active a {
background: none repeat scroll 0 0 #EDEDED;
color: #060606;
font-weight: bold;
}
</style>
<div class="title_tab">
<ul class="">
<li data-class-child="1" class="active"> <a href="#">1</a></li>
<li data-class-child="2"> <a href="#">2</a></li>
<li data-class-child="3"> <a href="#">3</a></li>
</ul>
</div>
<div class="content_tab">
<ul class="">
<li class="active"> <a href="#">a</a></li>
<li> <a href="#">b</a></li>
<li> <a href="#">c</a></li>
</ul>
</div>
<!-- jQuery -->
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.title_tab li').click(function(event) {
var pos_li=$(this).attr('data-class-child');
$('.title_tab ul>li').removeClass('active');
$(this).addClass('active');
$('.content_tab ul>li').removeClass('active');
$('.content_tab ul>li:nth-child('+pos_li+')').addClass('active');
return false;
});;
});
</script>
</body>
</html>
Đăng ký:
Bài đăng (Atom)