CoreLocationを使ってGPSやらなにやらで現在位置を特定する。
まずプロジェクトにCoreLocation.frameworkを追加する。
ここではサンプルとしてDemoViewControllerというものがあるとして、そこで位置取得を行う。
| // | |
| // SIFlatButton.swift | |
| // TwitterClone | |
| // | |
| // Created by Shoya Ishimaru on 2015/05/08. | |
| // Copyright (c) 2015年 shoya140. All rights reserved. | |
| // | |
| import UIKit |
| # Basic Keygen | |
| # Briefly used at my startup | |
| # Note: be mindful of any console logging or stdout logging when running this. | |
| # | |
| # By Jason Giedymin | |
| # jasong _-@-_ apache -dot- org | |
| # | |
| crypto = require "crypto" | |
| rbytes = require "rbytes" |
| thumbnail: http://pds.exblog.jp/pds/1/201101/16/02/d0055302_13383029.jpg | |
| video: http://www.youtube.com/watch?v=UE27t_LJpx0 |
| module Sinatra | |
| module Flash | |
| module Style | |
| def styled_flash(key=:flash) | |
| return "" if flash(key).empty? | |
| id = (key == :flash ? "flash" : "flash_#{key}") | |
| close = '<a class="close" data-dismiss="alert" href="#">×</a>' | |
| messages = flash(key).collect {|message| " <div class='alert alert-#{message[0]}'>#{close}\n #{message[1]}</div>\n"} | |
| "<div id='#{id}'>\n" + messages.join + "</div>" | |
| end |
| <script> | |
| function gc() { for (let i = 0; i < 0x10; i++) { new ArrayBuffer(0x1000000); } } | |
| var sc = []; | |
| for (var i=0; i<0x480; i++) { | |
| sc.push(0x90); | |
| } | |
| //sc.push(0xcc); | |
| //sc.push(0xeb); | |
| //sc.push(0xfe); |
| # coding: utf-8 | |
| require 'sinatra' | |
| set server: 'thin', connections: [] | |
| get '/' do | |
| halt erb(:login) unless params[:user] | |
| erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
| end | |
| get '/stream', provides: 'text/event-stream' do |
| import 'dart:async'; | |
| import 'package:flutter/material.dart'; | |
| class InfiniteScroll extends StatefulWidget { | |
| @override | |
| _InfiniteScrollState createState() => new _InfiniteScrollState(); | |
| } | |
| class _InfiniteScrollState extends State<InfiniteScroll> { |