This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FooActivity extends AppCompatActivity | |
{ | |
private static final String TAG = FooActivity.class.getSimpleName(); | |
private static final int REQUEST_PERMISSION_SETTING = 109; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) | |
{ | |
// 省略... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The BlogId of a test blog. | |
String TEST_BLOG_ID = "8070105920543249955"; | |
// Configure the Java API Client for Installed Native App | |
HttpTransport HTTP_TRANSPORT = new NetHttpTransport(); | |
JsonFactory JSON_FACTORY = new JacksonFactory(); | |
// set up authorization code flow | |
AuthorizationCodeFlow flow = new AuthorizationCodeFlow.Builder( | |
BearerToken.authorizationHeaderAccessMethod(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
import commands | |
def getIpList(): | |
ipList = commands.getoutput("/sbin/ifconfig | grep -i \"inet\" | grep -iv \"inet6\" | " + | |
"awk {'print $2'} | sed -ne 's/addr\:/ /p'") | |
return ipList | |
import smtplib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
import time | |
import RPi.GPIO as GPIO | |
# http://coopermaa2nd.blogspot.tw/2010/12/arduino-lab6.html | |
B0 = 31 | |
C1 = 33 | |
CS1 = 35 | |
D1 = 37 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /path/to/your/jenkins_vm_project | |
cd /path/to/your/jeknins_vm_project | |
# 查看你抓下來的 box | |
vagrant box list | |
# centos64_x86_64 是我替 CentOS6.4 64 取的 box 名稱 | |
vagrant init centos64_x86_64 | |
# vagrant init 會自動產生 Vagranfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<job-scheduling-data | |
xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_2_0.xsd" | |
version="1.8"> | |
<schedule> | |
<job> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.quartz.threadPool.threadCount=2 # 用2個 Thread | |
org.quartz.plugin.jobInitializer.class=org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin # 用 XML(quartz_data.xml) 設定排程工作 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servlet> | |
<servlet-name>QuartzInitializer</servlet-name> | |
<servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class> | |
<init-param> | |
<param-name>shutdown-on-unload</param-name> | |
<param-value>true</param-value> | |
</init-param> | |
<init-param> | |
<param-name>wait-on-shutdown</param-name> | |
<param-value>true</param-value> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://www.packtpub.com/books/content/introduction-logging-tomcat-7 | |
#http://tomcat.apache.org/tomcat-7.0-doc/logging.html | |
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler # 有 File 和 Console 兩個 Handler | |
############################################################ | |
# Handler specific properties. | |
# Describes specific configuration info for Handlers. | |
############################################################ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one or more | |
contributor license agreements. See the NOTICE file distributed with | |
this work for additional information regarding copyright ownership. | |
The ASF licenses this file to You under the Apache License, Version 2.0 | |
(the "License"); you may not use this file except in compliance with | |
the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 |
NewerOlder