macでsvnを利用する

Windowsなら TortoiseSVN ですが、macなら、ということで、
ターミナルで以下のコマンドを入力してください。
$ svn –version
svn, version 1.7.19
compiled Jun 17 2015, 13:48:11

Copyright (C) 2014 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see http://subversion.apache.org/

svnadmin も確認
$ svnadmin –version
svnadmin, version 1.7.19 (r1643991)
compiled Jun 17 2015, 13:48:11

Copyright (C) 2014 The Apache Software Foundation.
This software consists of contributions made by many people; see the NOTICE
file for more information.
Subversion is open source software, see http://subversion.apache.org/

The following repository back-end (FS) modules are available:

* fs_fs : Module for working with a plain file (FSFS) repository.

アプリケーション起動時にイベント送信

func application(application: UIApplication,
                 didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // ...
    let mobileAnalytics =
    AWSMobileAnalytics(forAppId: "ApplicationID")
    let eventClient = mobileAnalytics.eventClient
    let event = eventClient.createEventWithEventType("ApplicationStart")
    eventClient.recordEvent(event)
    eventClient.submitEvent()
    return true
}

プッシュ通知

func push(){
    let publishInput = AWSSNSPublishInput()
    publishInput.targetArn = "arn:aws:sns:us-east-1:xxxxxxxxxx:share-users"
    publishInput.message = "new picture is posted"
    AWSSNS.defaultSNS().publish(publishInput)
}

AWSプッシュ通知

エンドポイントANRを取得します。

import AWSSNS

// ...

func application(application: UIApplication,
                 didFinishLauchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // ...
    let settings =
    UIUserNotificationSettings(forTypes: [.Badge, .Sound, .Alert],
                               categories: nil)
    application.registerUserNotificationSetting(settings)
    application.registerForRemoteNotifications()
    return true
}

    func application(application: UIApplication,
                     didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData){
        let deviceTokenString = "¥(deviceToken)"
        .stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString:"<>"))
        .stringByReplacingOccurrencesOfString(" ", withString: "")
        
        let credentialsProvider =
        AWSCognitoCredentialsProvider(regionType: .USEast1,
                                      identityPoolId: "us-east-1:")
        
        let serviceConfiguration =
        AWSServiceConfiguration(region: .USEast1,
                                credentialsProvider: credentialProvider)
        AWSServiceManager.defaultServiceManager().defaultServiceConfiguration =
        serviceConfiguration
        
        let createPlatformEndpointInput = AWSSNSCreatePlatformEndpointInput()
        createPlatformEndpointInput.platformApplicationArn =
        "arn:aws:sns:us-east-1::app/APNS_SANDBOX/Share"
        createPlatformEndpointInput.token = deviceTokenString
        AWSSNS.defaultSNS().createPlatformEndpoint(createPlatformEndpointInput)
        .continueWithSuccessBlock({(task) -> AnyObject! in
            guard let createEndpointResponse =
            task.result as? AWSSNSCreateEndpointResponse else{
                return task
            }
            let subscribeInput = AWSSNSSubscribeInput()
            subscribeInput.protocols = "application"
            subscriptInput.topicArn =
            "arn:aws:sns:us-east-1::share-users"
            subscribeInput.endpoint = createEndpointResponse.endpointArn
            return AWSSNS.defaultSNS.subscribe(subscribeInput)
        })
    }

端末の発着信履歴を表示

public class CallLogActivity implements SensorEventListener {
	SensorManager sensorManager;
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		
		sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
		
		Cursor c = getContentResolver().query(
				android.provider.CallLog.Calls.CONTENT_URI, null, null, null,
				android.provider.CallLog.Calls.DATE+ " DESC");
		startManagingCursor(c);
		ListAdapter adapter = new SimpleCursorAdapter(this,
				R.layout.calllog_row, c, new String[] {
				android.provider.CallLog.Calls.TYPE,
				android.provider.CallLog.Calls.NUMBER,
				android.provider.CallLog.Calls.CACHED_NAME },
				new int[] { R.id.type, R.id.number, R.id.name }) {
			@Override
			public void setViewImage(ImageView v, String value){
				switch (Integer.parseInt(value)){
				case android.provider.CallLog.Calls.INCOMING_TYPE:
					v.setImageDrawable(getResources().getDrawable(android.R.drawable.sym_call_incoming));
					break;
				case android.provider.CallLog.Calls.MISSED_TYPE:
					v.setImageDrawable(getResources().getDrawable(android.R.drawable.sym_call_missed));
					break;
				case android.provider.CallLog.Calls.OUTGOING_TYPE:
					v.setImageDrawable(getResources().getDrawable(android.R.drawable.sym_call_outgoing));
					break;
					default:
						break;
				}
			}
		};
		setListAdapter(adapter);
	}
	
	// activity
	@Override
	protected void onResume(){
		super.onResume();
		sensorManager.registerListener(this,
				sensorManager.getDefaultSensor(Sensor.TYPE_ACCELERAOMETER),
				SensorManager.SENSOR_DELAY_UI);
	}
	@Override
	protected void onStop(){
		sensorManager.unregisterListener(this);
		super.onStop();
	}
	
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id){
		telTo(((TextView) v.findViewById(R.id.number)).getText());
	}
	
	public void onSensorChanged(SensorEvent event){
		switch(event.sensor.getType()){
		case Sencor.TYPE_ACCELEROMETER:
			if (getSelectedItemPosition() > -1){
				if (Math.abs(event.values[0]) > SensorManager.GRAVITY_EARTH
				|| Math.abs(event.values[1]) > SensorManager.GRAVITY_EARTH
				|| Math.abs(event.values[2]) > SensorManager.GRAVITY_EARTH) {
					telTo(((TextView) getListView().getChildAt(
							getSelectedItemPosition()).findViewById(R.id.number)).getText());
				}
			}
			default:
		}
}

ARMプロセッサ

チップの設計には、基盤の部品を減らす、消費電力を抑えるなどの理由から、演算機能、グラフィックス機能、I/Oコントローラなどが1チップ化したSoCがよく採用されます。そして、ARMアーキテクチャは、そのSoCの一部として利用されています。

ARMアーキテクチャを設計しているARM社はファブレスメーカーです。

簡易sleepコマンド

#include < time.h >
#include < stdio.h >
#include < stdlib.h >

int main(int argc, char **argv)
{
    struct timespec req;
    char *end;
    
    if(
        argc != 2 ||
       argv[1][0] == '\0' ||
       (req.tv_sec = strtol(argv[1], &end, 10), *end != '\0')
       ) {
        fprintf(stderr, "Usage: %s seconds \n", argv[0]);
        return 1;
    }
    
    req.tv_nsec = 0;
    
    if (nanosleep(&req, NULL) < 0){
        perror("naosleep");
        return 1;
    }
    return 0;
}

whoamiコマンド

getpwuid()を使います。

#include < unistd.h >
#include < sys/types.h >
#include < pwd.h >
#include < stdio.h >

int main(){
    pid_t euid;
    struct passwd *pw;

    euid = geteuid();

    if((pw = getpwuid(euid))== NULL){
        printf("%d\n", (int)euid);
    } else {
        printf("%s\n", pw->pw_name);
    }
    return 0;
}

簡易touchコマンド

#include < sys/types.h >
#include < sys/stat.h >
#include < fcntl.h >
#include < utime.h >
#include < stdio.h >

int main(int argc, char **argv)
{
    int i;
    int err = 0;
    
    if (argc <= 1){
        fprintf(stderr, "Usage: %s file...\n", argv[0]);
        return 1;
    }
    
    for (i = 1; i < argc; i++){
        open (argv[i], O_WRONLY|O_CREAT, 0666);
        
        if (utime(argv[i], NULL)){
            perror(argv[i]);
            err = 1;
        }
    }
    return err;
}