This file contains 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
class StringLikePerlArray { | |
var text :String = "" | |
init(_ string :String = ""){ | |
text = string | |
} | |
func count()->Int { | |
var count :Int = 0 | |
for string in text { |
This file contains 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
class ArrayLikePerl { | |
var value: [Any] = [] | |
init(_ array :[Any] = []){ | |
value = array | |
} | |
func count()->Int { | |
return self.value.count | |
} |
This file contains 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
class ArrayLikePerl { | |
var value: [Any] = [] | |
init(_ array :[Any] = []){ | |
value = array | |
} | |
func count()->Int { | |
return self.value.count | |
} |
This file contains 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
extension Array { | |
typealias Element = T | |
mutating func scalar() -> Int { | |
return Int(self.count) | |
} | |
mutating func pop() -> T? { | |
if self.count == 0 { return nil } | |
let removed = self.removeAtIndex(self.endIndex.predecessor()) |
This file contains 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
extension Array { | |
typealias Element = T | |
mutating func scalar() -> Int { // use it if you like perl | |
return Int(self.count) | |
} | |
mutating func pop() -> T? { | |
return self.isEmpty ? nil : self.removeAtIndex(self.endIndex.predecessor()) | |
} |
This file contains 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
var arrayWithAnyType :[Any] = [/* You can insert here any initial values */] |
This file contains 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
extension Array { | |
typealias Element = T | |
mutating func splice(var _ atIndex :Int = 0, _ length :Int = 0, _ newElements: T...) -> Slice<T>? { | |
description | |
var theIndex = length + atIndex | |
var spliced :Slice<T> = [] | |
if length < 0 {fatalError("minus length was set")} | |
if atIndex >= 0 { | |
if theIndex > self.endIndex {fatalError("Bad Access")} |
This file contains 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
import UIKit | |
protocol CountNumDelegate: class { | |
func rapDelegate(lastRap: Int) -> ViewController | |
} | |
class TimerView :UILabel { | |
var timerOn = false | |
var nsTimer = NSTimer() | |
var countNum :Int |
This file contains 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
package Password; | |
use strict; | |
use warnings; | |
our $VERSION = '3.01'; | |
use Carp; | |
use Crypt::PasswdMD5; | |
my @charset = ('A'..'Z', 'a'..'z', '0'..'9', '#', ',', qw# ! ? = + - * / _ [ ] { } ( ) < > | ~ ^ ' " % & . ; : $ #); # 強調表示の訂正用→' |
This file contains 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/perl | |
use strict; | |
use warnings; | |
# 注)環境依存。この辺は適当に変えてください | |
use lib "$ENV{DOCUMENT_ROOT}/lib/perl5"; # CPANモジュールを読み込む | |
use lib "$ENV{DOCUMENT_ROOT}/lib"; # 上位のモジュールを読み込む | |
use lib "./lib"; # ローカルなモジュールを読み込む | |
# 環境依存終了 |
OlderNewer