یادداشتهای علی انصاری

1) sudo apt-get install nginx phpmyadmin

توجه داشته بشید هنگام نصب phpmyadmin هیچ webserverیی را انتخاب نکنید

2) برای اجرای اسریپتهای php5 توسط nginx باید php-fpm را نصب کرده باشید که جایگزینی برای PHP FastCGI است

sudo apt-get install php5-fpm 

3) حال باید تنظمیات nginx را انجام دهید . فایل پیکربندی Nginx در آدرس زیر قرار دارد:
/etc/nginx/nginx.conf
این فایل را باز کرده و در قسمت http کد زیر را بنویسید
server {
        listen          81;
        server_name     localhost;
        root        /usr/share/phpmyadmin;
        index       index.php index.html index.htm;
        if (!-e $request_filename) {
            rewrite ^/(.+)$ /index.php?url=$1 last;
            break;
        }
        location ~ .php$ {
            try_files $uri =404;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            fastcgi_index index.php;
            include /etc/nginx/fastcgi_params;
        }
    }
۰ نظر موافقین ۰ مخالفین ۰ ۲۸ بهمن ۹۳ ، ۱۳:۲۳
علی انصاری
function getScopeList(rs) {
    var scopeList = [];
    function traverseScope(s) {
        scopeList.push(s);
        if (s.$$nextSibling) {
            traverseScope(s.$$nextSibling);
        }
        if (s.$$childHead) {
            traverseScope(s.$$childHead);
        }
    }
    traverseScope(rs);
    return scopeList;
}

scopes = getScopeList(angular.element(document.querySelectorAll("[ng-app]")).scope());
total = _.uniq(_.flatten(scopes.map(function(s) { return s.$$watchers; }))).length;
لینک
۰ نظر موافقین ۰ مخالفین ۰ ۱۶ بهمن ۹۳ ، ۰۸:۴۶
علی انصاری

دست نوشته های بنده با موضوع علم داده را می توانید در datascience.blog.ir بخوانید

۰ نظر موافقین ۰ مخالفین ۰ ۱۱ دی ۹۳ ، ۱۲:۳۸
علی انصاری

link

The fact that regex doesn't support inverse matching is not entirely true. You can mimic this behavior by using negative look-arounds:

^((?!hede).)*$

The regex above will match any string, or line without a line break, not containing the (sub) string 'hede'. As mentioned, this is not something regex is "good" at (or should do), but still, it is possible.

And if you need to match line break chars as well, use the DOT-ALL modifier (the trailing s in the following pattern):

/^((?!hede).)*$/s

or use it inline:

/(?s)^((?!hede).)*$/

(where the /.../ are the regex delimiters, ie, not part of the pattern)

If the DOT-ALL modifier is not available, you can mimic the same behavior with the character class [\s\S]:

/^((?!hede)[\s\S])*$/

Explanation

A string is just a list of n characters. Before, and after each character, there's an empty string. So a list of n characters will have n+1 empty strings. Consider the string "ABhedeCD":

    +--+---+--+---+--+---+--+---+--+---+--+---+--+---+--+---+--+
S = |e1| A |e2| B |e3| h |e4| e |e5| d |e6| e |e7| C |e8| D |e9|
    +--+---+--+---+--+---+--+---+--+---+--+---+--+---+--+---+--+

index    0      1      2      3      4      5      6      7

where the e's are the empty strings. The regex (?!hede). looks ahead to see if there's no substring "hede" to be seen, and if that is the case (so something else is seen), then the . (dot) will match any character except a line break. Look-arounds are also called zero-width-assertions because they don'tconsume any characters. They only assert/validate something.

So, in my example, every empty string is first validated to see if there's no "hede" up ahead, before a character is consumed by the . (dot). The regex (?!hede). will do that only once, so it is wrapped in a group, and repeated zero or more times: ((?!hede).)*. Finally, the start- and end-of-input are anchored to make sure the entire input is consumed: ^((?!hede).)*$

As you can see, the input "ABhedeCD" will fail because on e3, the regex (?!hede) fails (there is "hede" up ahead!).

۰ نظر موافقین ۰ مخالفین ۰ ۰۷ مهر ۹۳ ، ۱۳:۵۱
علی انصاری

به نام خالق


این وبلاگ مکانی است برای نوشتن درباره هر آنچه دریافته ام  و می خواهم با دیگران به اشتراک بگذارم


۲۹ نظر موافقین ۱ مخالفین ۰ ۲۱ خرداد ۹۳ ، ۱۰:۴۷
علی انصاری