public boolean isOnline() {
    ConnectivityManager cm =
        (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo netInfo = cm.getActiveNetworkInfo();
    if (netInfo != null && netInfo.isConnectedOrConnecting()) {
        return true;
    }
    return false;
}


Posted by [czar]
,

칸투칸 k780 신발 끈 끊어짐.


Posted by [czar]
,

http://articles.slicehost.com/2009/2/2/centos-adding-an-nginx-init-script

CentOS - Adding an Nginx Init Script

If you decided to install Nginx via source (see the previous article) you would have the latest and greatest version.

However, one disadvantage of installing from source is that init scripts are not created. No problem, let's go ahead and create one for easy control of Nginx and to ensure it restarts on a reboot.


Assumption

I am assuming you have followed the previous article and installed Nginx from source.

If you have used other options or have placed the Nginx binary in a directory other than /usr/local/sbin/ then you will need to adjust the script shown below to match your installation.

Stop

If you have Nginx running then stop the process using:

sudo kill `cat /usr/local/nginx/logs/nginx.pid`

Init script

The script I use below is from a CentOS 'yum install' and has been adapted to take into account our custom install of Nginx.

Let's go ahead and create the script:

sudo nano /etc/init.d/nginx

Inside the blank file place the following:

#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig:   - 85 15 
# description:  Nginx is an HTTP(S) server, HTTP(S) reverse \
#               proxy and IMAP/POP3 proxy server
# processname: nginx
# config:      /usr/local/nginx/conf/nginx.conf
# pidfile:     /usr/local/nginx/logs/nginx.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

nginx="/usr/local/sbin/nginx"
prog=$(basename $nginx)

NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf"

lockfile=/var/lock/subsys/nginx

start() {
    [ -x $nginx ] || exit 5
    [ -f $NGINX_CONF_FILE ] || exit 6
    echo -n $"Starting $prog: "
    daemon $nginx -c $NGINX_CONF_FILE
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog -QUIT
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    configtest || return $?
    stop
    start
}

reload() {
    configtest || return $?
    echo -n $"Reloading $prog: "
    killproc $nginx -HUP
    RETVAL=$?
    echo
}

force_reload() {
    restart
}

configtest() {
  $nginx -t -c $NGINX_CONF_FILE
}

rh_status() {
    status $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}

case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart|configtest)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
            ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
        exit 2
esac

There's not really the space to go into the workings of the script but suffice to say, it defines where the main Nginx binary and pid files are located so Nginx can be started correctly.

Execute

As the init file is a shell script, it needs to have executable permissions.

We set them like so:

sudo chmod +x /etc/init.d/nginx

Chkconfig

Now we have the base script prepared, we need to add it to the default run levels:

sudo /sbin/chkconfig nginx on

Let's check our work to confirm:

sudo /sbin/chkconfig --list nginx
nginx           0:off   1:off   2:on    3:on    4:on    5:on    6:off

Done.

The script will now be called on a reboot so Nginx will automatically start.

Start, Stop and Restart

Now we can start, stop, restart, and reload Nginx using these commands:

sudo /etc/init.d/nginx start
...
sudo /etc/init.d/nginx stop
...
sudo /etc/init.d/nginx restart
...
sudo /etc/init.d/nginx reload

You can also check the current status as well as the configuration syntax:

sudo /etc/init.d/nginx status
...
sudo /etc/init.d/nginx configtest

Summary

Adding a process to the run levels like this saves a lot of frustration and effort, not only in manually starting and stopping the process, but it having it automatically start on a reboot.

Posted by [czar]
,

Don't know which map/collection to use ? 
Here is a nice cheat sheet ;)
(Ref : http://www.sergiy.ca/guide-to-selecting-appropriate-map-collection-in-java/)






키/값 쌍으로 된 것인가? 아니면 값만 있는 것인가?

쌍 -> 순서가 중요한가? 

                 no -> HashMap

                 yes -> 삽입순서 or 키별로 정렬??

                                    ordered 순서별로 -> LinkedHashMap

                                    Sorted 키별로 정렬 -> TreeMap

값 -> 중복을 포함하는것인가?

                  no -> 기본         기본작업이 요소 검색이다?? 

                                     no -> ArrayList

Yes -> 아래 순서가 중요한가?

                  yes -> ArrayList



 순서가 중요한가? 

        no -> HashSet

         yes -> 삽입순서 or 키별로 정렬??

                               sorted -> TreeSet

                                 Ordered -> LinkedHashSet



Posted by [czar]
,
행아웃 실행 시
Google에 연결할 수 없기 때문에 로그인 할 수 없습니다. 다시 시도하세요.

해결 방법


 
  1. Use some app to take backup of Google Play Services (ES File Explorer can do it for you) and save the apk locally. This is recommended because after the next step you may not be able to connect and re-download the update over Mobile Data. It would work on WiFi however.
  2. Go to Manage Apps > Google Play Services
  3. Do "Uninstall" / "Uninstall Updates" for Google Play Services
  4. Google Hangout will automatically ask you to Install or Update Google Play Services.
  5. If you "Uninstalled Updates", then the app would update over Mobile Data when you click on update in Google Play. After this go to Step #8
  6. If you "Uninstalled" the app completely, you wouldn't find it in Google Play. So install it from the backup created in Step #1.
  7. Now go to Google Play and install any updates for Google Play Services.
  8. Now open Google Hangout. It may still show you a connection issue for a couple for times.
  9. Don't lose your heart. It should work after you try for a maximum of 1-2 times.
  10. Thank me and go ahead to chat with your girlfriend 






1. 설정> 앱 > google play service 업데이트 제거
2. hangout 업데이트 제거
3. google play 실행 하여 hangout 업데이트
4. hangout 실행하면 google play service 업데이트 하라고 나오는데 이때 업데이트
5. hangout 정상 실행......  




Posted by [czar]
,
Posted by [czar]
,

$('#<%= lbUSD.ClientID %>')

<asp:Label ID="lbUSD" runat="server" />

Posted by [czar]
,

가.미용실 : http://pinterest.com/parkchoonok/ 

나.농특산물 쇼핑몰 : http://pinterest.com/arirangmall/

다.언론기관:포천신문 : http://pinterest.com/ipcs21/

라.개인홈쇼핑몰 : http://pinterest.com/ysoonhi

마.화장품:http://pinterest.com/search/boards/?q=cosmetic+company

바.디자인:http://pinterest.com/search/boards/?q=design+company

사.교회:http://pinterest.com/search/boards/?q=chapel

아.스파:http://pinterest.com/search/boards/?q=spar

자.피트니스:http://pinterest.com/search/boards/?q=fitness+center

차.대학:http://pinterest.com/search/boards/?q=university

카.호텔:http://pinterest.com/search/boards/?q=hotel

파.방송국:http://pinterest.com/search/boards/?q=broadcasting+station

하.기타

(1)병원:http://pinterest.com/search/boards/?q=hospital

(2)백화점:http://pinterest.com/search/boards/?q=departmentstore

(3)통신사:http://pinterest.com/ollehkt/

(4)신문사:http://pinterest.com/search/boards/?q=newspaper

(5)레스토랑:http://pinterest.com/search/boards/?q=restaurant

(6)식당:http://pinterest.com/search/boards/?q=cafeteria

(7)대형매장:http://pinterest.com/search/boards/?q=mart

(8)현지 직거래:http://pinterest.com/search/boards/?q=direct+selling

(9)전자상거래:http://pinterest.com/search/boards/?q=e-commerce

(10)보석점:http://pinterest.com/search/pins/?q=jewely+store

(11)네트웤 사업:http://pinterest.com/search/boards/?q=acn

(12)보험:http://pinterest.com/search/boards/?q=insurance

(13)은행:http://pinterest.com/search/boards/?q=ibk

(14)주식:http://pinterest.com/search/boards/?q=hold+company

(15)소상공인:http://pinterest.com/search/boards/?q=retailer 

Posted by [czar]
,

function showConfirm(message, callback, buttonLabels, title){


    //Set default values if not specified by the user.

    buttonLabels = buttonLabels || 'OK,Cancel';


    title = title || "default title";


    //Use Cordova version of the confirm box if possible.

    if(navigator.notification && navigator.notification.confirm){


            var _callback = function(index){

                if(callback){

                    callback(index == 1);

                }

            };


            navigator.notification.confirm(

                message,      // message

                _callback,    // callback

                title,        // title

                buttonLabels  // buttonName

            );


    //Default to the usual JS confirm method.

    }else{

        invoke(callback, confirm(message));

    }

}


And here is how you would use it:


var message = "Would you like to proceed?";

var title = "Important Question";


//The first element of this list is the label for positive 

//confirmation i.e. Yes, OK, Proceed.

var buttonLabels = "Yes,No";


var callback = function(yes){

    if(yes){

        alert('Proceed');

    }else{

        alert('Do Not Proceed'); 

    }

};


showConfirm(message, callback, buttonLabels, title);

Posted by [czar]
,

package coupon;


import java.util.Random;


public class Coupon {


public static void main(String[] args) {


int couponSize = 1000;

final char[] possibleCharacters =

{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'A', 'B', 'C', 'D', 'E', 'F',

'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',

'V', 'W', 'X', 'Y', 'Z'};

final int possibleCharacterCount = possibleCharacters.length;


String[] arr = new String[couponSize];


Random rnd = new Random();

int currentIndex = 0;

int i = 0;

while (currentIndex < couponSize) {

StringBuffer buf = new StringBuffer(16);

for (i= 16; i > 0; i--) {

buf.append(possibleCharacters[rnd.nextInt(possibleCharacterCount)]);

}


String password = buf.toString();

System.out.println("password==>"+password);


arr[currentIndex] = password;

currentIndex++;

}

}


}


Posted by [czar]
,