为什么Bootcamp只允许windows用一个盘

MAC笔记本中,用EFI替代了传统的BIOS,其引导方式也由MBR调整为GPT。

但实际上,为了兼容性要求,MAC下的分区有两个分区表,一个是GPT(GUID Partition Table),一个是hybrid MBR(Master Boot Record)。
而hybrid MBR其实是为了兼容只支持MBR的操作系统,在GPT中划分了一块作为MBR用。

MAC OS默认分区方式为GPT,主要也是在读GPT。
Windows只会读MBR。

1、为什么Bootcamp只允许windows用一个盘
MBR只允许四个主分区,而MAC占掉了三个:
1个引导分区
1个MAC分区
1个恢复分区
所以只留给了Windows一个主分区。

为什么MAC的硬盘分区要在MAC OS下进行呢?
MAC下分区的话,MAC OS会同时更新GPT与MBR,这样MAC与Windows读取的分区信息都是对的。
Windows下分区的话,Windows只会改写MBR,这样GPT与MBR的分区信息就不匹配了,MAC与Windows读取的信息就不一样了,是否相互覆盖全凭运气,你懂的。

AndroidStudio配置NDK环境

1、新建工程,在工程根目录找到local.properties文件

sdk.dir=C\:/Languages/Android/android-sdk-windows
ndk.dir=C\:/Languages/Android/android-ndk-r10

2、在app\build.gradle文件中的defaultConfig段内增加

       ndk {
            moduleName "yourModuleName"
       }

2、在工程的app\src\main目录下,新增jni文件夹,将你的ndk工程拷进去

3、在app\src\main\java目录下,将你的java文件拷贝进去

4、如果你的ndk工程用到了其他so文件,在app目录下,新建jniLibs文件夹,将so文件拷贝进去

jniLibs\armeabi\xxx.so
jniLibs\armeabi-v7a\xxx.so
....

5、自定义文件夹路径。编辑app\build.gradle文件下的android段

    //自定义引用库路径
    sourceSets.main {
        jniLibs.srcDir 'src/main/cpplibs'
    }

    //自定义源码路径
    sourceSets.main {
        jni.srcDirs 'src/main/cpp'
    }

6、现在就可以用啦

7、另一种方式就是,先把so文件用命令行生成好,然后,android项目中直接引用so文件就好了

PS:
如果你的ndk项目只有一个c文件,用早期的AndroidStudio编译会报错:

make.exe: *** No rule to make target
......

Execution failed for task ':XXXXXX:compileXXXXXXDebugNdk'.
.......

这样的话,在你的c文件目录下,随便建立一个空的c文件,重新编译就好了,好挫。

Android配置NDK环境

准备工作
1、下载NDK
2、直接运行,会解压到当前文件夹
3、剪切到你喜欢的文件夹

第一个项目
1、写一个调用JNI的Java类

package com.neohope.android.jni;

public class JniFunc {
    private native int  addNative(int a, int b);

    static {
        System.loadLibrary("jnifunc");
    }

    public int add(int a, int b)
    {
        return addNative(a,b);
    }
}

2、用你喜欢的方式,编译为class文件

3、用jdk的javah工具生成头文件

#在class文件的顶层路径,比如这个例子,就在com这个文件夹相同目录下
javah com.neohope.android.jni.JniFunc

会输出文件“com_neohope_android_jni_JniFunc.h”:

/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class com_neohope_android_jni_JniFunc */

#ifndef _Included_com_neohope_android_jni_JniFunc
#define _Included_com_neohope_android_jni_JniFunc
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     com_neohope_android_jni_JniFunc
 * Method:    addNative
 * Signature: (II)I
 */
JNIEXPORT jint JNICALL Java_com_neohope_android_jni_JniFunc_addNative
  (JNIEnv *, jobject, jint, jint);

#ifdef __cplusplus
}
#endif
#endif

4、编写“com_neohope_android_jni_JniFunc.c”

#include <jni.h>
#include "com_neohope_android_jni_JniFunc.h"

JNIEXPORT jint JNICALL Java_com_neohope_android_jni_JniFunc_addNative
  (JNIEnv *evn, jobject obj, jint a, jint b)
{
    return a+b;
}

5、编写Android.mk及Application.mk

APP_ABI := all
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := jnifunc
LOCAL_SRC_FILES := com_neohope_android_jni_JniFunc.c \

LOCAL_C_INCLUDES += com_neohope_android_jni_JniFunc.h

include $(BUILD_SHARED_LIBRARY)

6、编译

SET NDK_HOME="C:\Languages\Android\android-ndk-r10d"

SET PATH=%NDK_HOME%;%PATH%

CMD

REM ndk-build

Andoid百度地图显示方向

    private BaiduMap mBaiduMap = null;
    private MapView mMapView = null;
    private LocationClient mLocClient = null;
    private MyLocationConfiguration.LocationMode mCurrentMode;
    private Boolean isFirstLoc = true;
    private BitmapDescriptor mCurrentMarker=null;

    private float[] accelerometerValues=new float[3];
    private float[] magneticFieldValues=new float[3];
    private float[] values=new float[3];
    private float[] rotate=new float[9];
    private float[] degree=new float[3];

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        SDKInitializer.initialize(getApplicationContext());
        setContentView(R.layout.activity_main);

        SensorManager sm = (SensorManager) getApplicationContext().getSystemService(Context.SENSOR_SERVICE);
        SensorEventListener sensorEventListener = new SensorEventListener() {
            @Override
            public void onSensorChanged(SensorEvent event) {
                if(event.sensor.getType()==Sensor.TYPE_ACCELEROMETER){
                    accelerometerValues=event.values;
                }
                if(event.sensor.getType()==Sensor.TYPE_MAGNETIC_FIELD){
                    magneticFieldValues=event.values;
                }
                else
                {
                    return;
                }

                SensorManager.getRotationMatrix(rotate, null, accelerometerValues, magneticFieldValues);
                SensorManager.getOrientation(rotate, values);

                //rotate
                degree[0] = values[0]/3.1415926f*180;
                //up down
                degree[1] = values[1]/3.1415926f*180;
                //left right
                degree[2] = values[2]/3.1415926f*180;
            }

            @Override
            public void onAccuracyChanged(Sensor sensor, int accuracy) {
            }
        };

        sm.registerListener(sensorEventListener,sm.getDefaultSensor(Sensor.TYPE_ACCELEROMETER),SensorManager.SENSOR_DELAY_NORMAL);
        sm.registerListener(sensorEventListener,sm.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD),SensorManager.SENSOR_DELAY_NORMAL);

        // init baiduMap
        mMapView = (MapView) findViewById(R.id.dbmapView);
        mBaiduMap = mMapView.getMap();

        // set parameters
        mCurrentMode = MyLocationConfiguration.LocationMode.FOLLOWING;
        mCurrentMarker=null;
        mBaiduMap.setMyLocationConfigeration(new MyLocationConfiguration(mCurrentMode, true, mCurrentMarker));

        // allow loaction
        mBaiduMap.setMyLocationEnabled(true);
        mLocClient = new LocationClient(this);
        mLocClient.registerLocationListener(new MyLocationListenner());
        LocationClientOption option = new LocationClientOption();
        option.setOpenGps(true);
        option.setCoorType("bd09ll");
        option.setScanSpan(1000);
        mLocClient.setLocOption(option);
        mLocClient.start();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mMapView.onDestroy();
    }

    public class MyLocationListenner implements BDLocationListener {
        @Override
        public void onReceiveLocation(BDLocation location) {
            if (location == null || mMapView == null)
                return;

            MyLocationData locData = new MyLocationData.Builder()
                    .accuracy(location.getRadius())
                    .direction(degree[0])
                    .latitude(location.getLatitude())
                    .longitude(location.getLongitude()).build();
            mBaiduMap.setMyLocationData(locData);

            if (isFirstLoc) {
                isFirstLoc = false;
                LatLng ll = new LatLng(location.getLatitude(),
                        location.getLongitude());
                MapStatusUpdate u = MapStatusUpdateFactory.newLatLng(ll);
                mBaiduMap.animateMapStatus(u);
            }
        }
    }

Apple In House 发布详解(七牛升级服务器搭建)

大家都懂的,很多云存储比如Dropbox国内根本访问不了,某度的规则又不适合做这个功能。

那就用七牛吧。

1、到七牛注册账号
http://www.qiniu.com/

2、上传身份证,进行认证
谁让你想省钱呢

3、认证通过后,新建一个空间,设置开通HTTPS,设置自己的域名
假设你的访问地址为https://dn-xxxxxx.qbox.me/

4、将html文件及plist中文件的绝对路径全部修改为https://dn-xxxxxx.qbox.me/xxxxxx

5、上传文件,将plist的mime type修改为text/xml

6、搞定

还是花钱买的证书好用啊。

Apple In House 发布详解(HTTPS证书生成)

1、如果是在Windows下面,用openssl就可以搞定了
1.1首先生成pem格式的CA证书,并导出为crt格式

set OPENSSL_CONF=%OPENSSL_HOME%\bin\openssl.cfg
openssl genrsa 1024 > NMyCA1024.key
openssl req -new -x509 -nodes -key NMyCA1024.key -days 1095 -subj "/C=CN/ST=ShangHai/L=ShangHai/O=NEOHOPE/OU=Development/CN=NMyCA1024" > NMyCA1024.pem

1.2将CA证书导出为der格式

openssl x509 -outform der -in NMyCA1024.pem -out NMyCA1024.der

1.3生成网站私钥及证书签名请求

set OPENSSL_CONF=%OPENSSL_HOME%\bin\openssl.cfg
openssl genrsa 1024 > server.key
openssl req -new -key server.key -subj "/C=CN/ST=ShangHai/L=ShangHai/O=NEOHOPE/OU=Development/CN=192.168.130.50" > server.csr

1.4用CA证书处理证书签名请求,生成CA授权的证书

openssl x509 -req -in server.csr -CA NMyCA1024.pem -CAkey NMyCA1024.key -CAcreateserial -days 365 > serversigned.crt

1.5将NMyCA1024.der、server.key、serversigned.crt拷给证书使用者

1.6一定要保管好NMyCA1024.key及NMyCA1024.pem,不要弄丢,更不要拷给别人

2、如果是在MAC下面,有一个工具就能搞定EasyCert

./EasyCert -cn NMyCA -h 192.168.130.50

但同样的,要保护好CA的私钥。

Apple In House 发布详解(内网升级服务器搭建)

要内网升级的话,需要搭建内网升级HTTPS服务器。

以APACHE为例:

1、下载支持SSL的APACHE服务程序,如果你已经有APACHE服务,可以查找mod_ssl.so,如果没有请重新下载

2、打开HTTPS支持,httpd.conf文件中,去掉下面两行的注释

LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf

修改httpd-ssl.conf中证书信息

SSLCertificateFile "C:/ProgramerTools/WebServer/Apache2.2/conf/server.crt"
SSLCertificateKeyFile "C:/ProgramerTools/WebServer/Apache2.2/conf/server.key"

3、将httpd.conf及httpd-ssl.conf路径信息调整为正确路径

4、此时HTTP与HTTPS都可以访问APACHE服务了

5、构建升级网站

5.1、准备资源文件
57×57图标,512×512图标,in house发布签名的ipa文件,CA根证书

5.2、准备plist文件

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <!-- array of downloads. -->
   <key>items</key>
   <array>
       <dict>
           <!-- an array of assets to download -->
           <key>assets</key>
           <array>
               <!-- software-package: the ipa to install. -->
               <dict>
                   <!-- required.  the asset kind. -->
                   <key>kind</key>
                   <string>software-package</string>
                   <!-- required.  the URL of the file to download. -->
                   <key>url</key>
                   <string>https://192.168.130.50/XXXXX.ipa</string>
               </dict>
               <!-- display-image: the 57*57 icon to display during download. -->
               <dict>
                   <key>kind</key>
                   <string>display-image</string>
                   <key>url</key>
                   <string>https://192.168.130.50/XXXXX_57.png</string>
               </dict>
               <!-- full-size-image: the large 512x512 icon used by iTunes. -->
               <dict>
                   <key>kind</key>
                   <string>full-size-image</string>
                   <key>url</key>
                   <string>https://192.168.130.50/XXXXX_512.png</string>
               </dict>
           </array>
           <key>metadata</key>
           <dict>
               <!-- required -->
               <key>bundle-identifier</key>
               <string>程序的app id</string>
               <!-- optional (software only) -->
               <key>bundle-version</key>
               <string>程序的版本</string>
               <!-- required.  the download kind. -->
               <key>kind</key>
               <string>software</string>
               <!-- optional. displayed during download; -->
               <!-- typically company name -->
               <key>subtitle</key>
               <string>厂商名称</string>
               <!-- required.  the title to display during the download. -->
               <key>title</key>
               <string>软件名称</string>
           </dict>
       </dict>
   </array>
</dict>
</plist>

5.3、准备.htaccess文件,与plist文件放在一起

AddType text/xml .plist
AddType application/octet-stream .ipa

修改httpd.conf文件,让.htaccess文件生效

#升级文件所在的目录
AllowOverride FileInfo

5.4、准备网页

<html>
	<body>
		<a href="https://192.168.130.46/myCA.cer">Install CA Cert</a>
		</br>
                 <a href="itms-services://?action=download-manifest&amp;url=https://192.168.130.50/XXXXX.plist">Install My App over the air </a>
	</body>
</html>

6、使用
6.1、HTTPS访问网页,下载CA证书,并添加到IOS的信任列表
6.2、点击安装App,然后就开始自动安装啦

7、自动升级
请Google或github一下iVersion

Apple In House 发布详解(准备工作)

1、你需要知道自己为什么需要Apple In House发布应用,好处及限制分别是什么,不清楚请Google。

2、如果是公司申请,需要有D.U.N.S.编码(邓氏编码)
如果不嫌麻烦,可以国外申请
http://www.dunsregistered.com/
如果不差钱,请国内申请
http://dnbregistered.com.cn/
这个编码在做国际贸易的时候也很有用的

3、注册Apple Id,并购买iOS Development Enterprise Program,一定要搞清楚,不要买成iOS Development Program

4、使用发布版的Certificates和正确的App ID得到In House版本的Provisioning Profiles,其流程与普通发布证书一样,不清楚请Google

5、XCode使用正确的签名,编译并打包为ipa文件

6、将ipa拖到iTunes中,尝试用iTunes安装到你的IOS设备,如果安装不成功,请检查签名是否正确

Quartz入门03

接下来,我们用Cron表达式加配置文件的方式,写一个简单的例子

1、首先是任务类
1.1、Job001

package com.neohope.quartz.test;

import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

/**
 * Created by Hansen
 */
public class Job001 implements Job {
    private static Logger logger = LoggerFactory.getLogger(Job001.class);

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("Job001 Executing : " + new Date());

        //获取Job的参数
        JobDetail jobDetail = jobExecutionContext.getJobDetail();
        //String jobDesc = jobDetail.getDescription();

        JobDataMap dataMap = jobDetail.getJobDataMap();
        String message = dataMap.getString("JOB_MSG");
        logger.info("Job001 Message is : " + message);

    }
}

1.2、Job002

package com.neohope.quartz.test;

import org.quartz.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

/**
 * Created by Hansen
 */
public class Job002 implements Job {
    private static Logger logger = LoggerFactory.getLogger(Job002.class);

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("Job002 Executing : " + new Date());

        //获取Job的参数
        JobDetail jobDetail = jobExecutionContext.getJobDetail();
        //String jobDesc = jobDetail.getDescription();

        JobDataMap dataMap = jobDetail.getJobDataMap();
        String message = dataMap.getString("JOB_MSG");
        logger.info("Job002 Message is : " + message);
    }
}

2、然后是测试类

package com.neohope.quartz.test;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;


/**
 * Created by Hansen
 */
public class Test002 {

    public void run() throws Exception {
        Logger logger = LoggerFactory.getLogger(Test002.class);

        SchedulerFactory sf = new StdSchedulerFactory();
        Scheduler scheduler = sf.getScheduler();

        scheduler.start();
        logger.info("scheduler started");

        try {
            System.in.read();
        } catch (Exception e) {
        }

        scheduler.shutdown(true);
        logger.info("scheduler ended");
    }

    public static void main(String[] args) throws Exception {
        System.setProperty("org.quartz.properties","quartzN.properties");

        Test002 test = new Test002();
        test.run();
    }
}

3、Quartz配置文件

#============================================================================
# Configure Main Scheduler Properties  
#============================================================================
org.quartz.scheduler.instanceName: NeoScheduler
org.quartz.scheduler.instanceId: AUTO
org.quartz.scheduler.skipUpdateCheck: true

#============================================================================
# Configure ThreadPool  
#============================================================================
org.quartz.threadPool.class: org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount: 1
org.quartz.threadPool.threadPriority: 5

#============================================================================
# Configure JobStore  
#============================================================================
org.quartz.jobStore.misfireThreshold: 60000
org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore

#org.quartz.jobStore.class: org.quartz.impl.jdbcjobstore.JobStoreTX
#org.quartz.jobStore.driverDelegateClass: org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
#org.quartz.jobStore.useProperties: false
#org.quartz.jobStore.dataSource: myDS
#org.quartz.jobStore.tablePrefix: QRTZ_
#org.quartz.jobStore.isClustered: false

#============================================================================
# Configure Datasources  
#============================================================================
#org.quartz.dataSource.myDS.driver: org.postgresql.Driver
#org.quartz.dataSource.myDS.URL: jdbc:postgresql://localhost/dev
#org.quartz.dataSource.myDS.user: jhouse
#org.quartz.dataSource.myDS.password: 
#org.quartz.dataSource.myDS.maxConnections: 5

#============================================================================
# Configure Plugins
#============================================================================
org.quartz.plugin.triggHistory.class: org.quartz.plugins.history.LoggingJobHistoryPlugin
org.quartz.plugin.jobInitializer.class: org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
org.quartz.plugin.jobInitializer.fileNames: quartzNScheduler.xml
org.quartz.plugin.jobInitializer.failOnFileNotFound: true
org.quartz.plugin.jobInitializer.scanInterval: 120
org.quartz.plugin.jobInitializer.wrapInUserTransaction: false

4、任务配置文件

<?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_1_8.xsd"
    version="1.8">
    
    <pre-processing-commands>
        <!-- clear all jobs in scheduler -->
        <delete-jobs-in-group>*</delete-jobs-in-group>
        <!-- clear all triggers in scheduler -->
        <delete-triggers-in-group>*</delete-triggers-in-group>
    </pre-processing-commands>
    
    <processing-directives>
        <!-- if there are any jobs/trigger in scheduler of same name (as in this file), overwrite them -->
        <overwrite-existing-data>true</overwrite-existing-data>
        <!-- if there are any jobs/trigger in scheduler of same name (as in this file),
        and over-write is false, ignore them rather then generating an error -->
        <ignore-duplicates>false</ignore-duplicates> 
    </processing-directives>
    
    <schedule>
        <job>
            <name>Job001</name>
            <group>JGroup001</group>
            <job-class>com.neohope.quartz.test.Job001</job-class>
            <job-data-map>
                <entry>
                    <key>JOB_MSG</key>
                    <value>Hi Job001</value>
                </entry>
            </job-data-map>
        </job>

        <trigger>
            <simple>
                <name>Trigger001</name>
                <group>TGroup001</group>
                <job-name>Job001</job-name>
                <job-group>JGroup001</job-group>
                <!--start-time>2010-02-09T10:15:00</start-time-->
                <!--end-time>2012-02-09T12:26:00.0</end-time-->
                <misfire-instruction>MISFIRE_INSTRUCTION_SMART_POLICY</misfire-instruction>
                <repeat-count>3</repeat-count>
                <repeat-interval>1000</repeat-interval>
            </simple>
        </trigger>

	    <job>
	        <name>Job002</name>
            <group>JGroup002</group>
            <description>Job002</description>
            <job-class>com.neohope.quartz.test.Job002</job-class>
            <job-data-map>
                <entry>
                    <key>JOB_MSG</key>
                    <value>Hi Job002</value>
                </entry>
            </job-data-map>
	    </job>

	    <trigger>
	        <cron>
	            <name>Trigger002</name>
	            <group>TGroup002</group>
	            <job-name>Job002</job-name>
	            <job-group>JGroup002</job-group>
                <!--start-time>2010-02-09T12:26:00.0</start-time-->
                <!--end-time>2012-02-09T12:26:00.0</end-time-->
                <misfire-instruction>MISFIRE_INSTRUCTION_SMART_POLICY</misfire-instruction>
                <cron-expression>0/10 * * * * ? *</cron-expression>
	        </cron>
	    </trigger>
    </schedule>    
</job-scheduling-data>

5、大家运行一下看看吧

Quartz入门02

在正式部署时,任务执行的规则不会很简单,Quartz通过Cron表达式来解决这个问题。

Cron表达式的格式为:
[秒] [分] [时] [日] [月] [星期] [年]

各字段填写规则为:

字段 是否必填 允许值 允许通配符
YES 0-59 , – * /
YES 0-59 , – * /
YES 0-23 , – * /
YES 1-31 , – * ? / L W
YES 1-12 or JAN-DEC , – * /
星期 YES 1-7 or SUN-SAT , – * ? / L #
NO empty, 1970-2099 , – * /

通配符含义为:

* 表示所有值 在分的字段上设置 “*”,表示每一分钟都会触发。
? 表示不指定值,不需要关心当前设置这个字段的值 要在每月的10号触发一个操作,但不关心是周几,所以需要周位置的那个字段设置为”?” 具体设置为 0 0 0 10 * ?
表示区间 在小时上设置 “10-12”,表示 10,11,12点都会触发。
, 表示指定多个值 在周字段上设置 “MON,WED,FRI” 表示周一,周三和周五触发
/ 用于递增触发 在秒上面设置”5/15″,表示从5秒开始,每增15秒触发(5,20,35,50)。在月字段上设置’1/3’所示每月1号开始,每隔三天触发一次。
L 表示最后的意思。 在日字段设置上,表示当月的最后一天, 在日期字段上表示星期六,相当于”7″或”SAT”。如果在”L”前加上数字,则表示该数据的最后一个。在周字段上设置”6L”这样的格式,则表示“本月最后一个星期五”
W 表示离指定日期的最近那个工作日(周一至周五) 例如在日字段上设置”15W”,表示离每月15号最近的那个工作日触发。如果15号正好是周六,则找最近的周五(14号)触发, 如果15号是周未,则找最近的下周一(16号)触发。如果15号正好在工作日(周一至周五),则就在该天触发。如果指定格式为 “1W”,它则表示每月1号往后最近的工作日触发。如果1号正是周六,则将在3号下周一触发。(注,”W”前只能设置具体的数字,不允许区间”-“)。’L’和’W’可以一组合使用。如果在日字段上设置”LW”,则表示在本月的最后一个工作日触发
# 序号(表示每月的第几个周几) 例如在周字段上设置”6#3″表示在每月的第三个周六。注意果指定”6#5″,正好第五周没有周六,则不会触发该配置

官网上的示例:

表达式 含义
0 0 12 * * ? Fire at 12pm (noon) every day
0 15 10 ? * * Fire at 10:15am every day
0 15 10 * * ? Fire at 10:15am every day
0 15 10 * * ? * Fire at 10:15am every day
0 15 10 * * ? 2005 Fire at 10:15am every day during the year 2005
0 * 14 * * ? Fire every minute starting at 2pm and ending at 2:59pm, every day
0 0/5 14 * * ? Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day
0 0/5 14,18 * * ? Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day
0 0-5 14 * * ? Fire every minute starting at 2pm and ending at 2:05pm, every day
0 10,44 14 ? 3 WED Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.
0 15 10 ? * MON-FRI Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday
0 15 10 15 * ? Fire at 10:15am on the 15th day of every month
0 15 10 L * ? Fire at 10:15am on the last day of every month
0 15 10 L-2 * ? Fire at 10:15am on the 2nd-to-last last day of every month
0 15 10 ? * 6L Fire at 10:15am on the last Friday of every month
0 15 10 ? * 6L Fire at 10:15am on the last Friday of every month
0 15 10 ? * 6L 2002-2005 Fire at 10:15am on every last friday of every month during the years 2002, 2003, 2004 and 2005
0 15 10 ? * 6#3 Fire at 10:15am on the third Friday of every month
0 0 12 1/5 * ? Fire at 12pm (noon) every 5 days every month, starting on the first day of the month.
0 11 11 11 11 ? Fire every November 11th at 11:11am.