iosで2つのファイルは同じかどうか判断方法
サンプルコード
if () {
NSLog(@”2つのファイルの差分がございません。”);
}
ios開発にキーボードを好きな色に変更するサンプルコード
サンプルコード:
– (void)textFieldDidBeginEditing:(UITextField *)textField{
NSArray *ws = windows];
for(UI ...
ios開発にプッシュ通知を実装する方法
1.Push通知
UILocalNotification *notification = init] autorelease];
NSDate *pushDate = ; if (notification != ni ...
「ios開発」ファイルを削除するサンプルコード
サンプルコード
NSFileManager *defaultManager;
defaultManager = ;
「ios開発」plistファイルの読み込む方法
サンプルコード:
NSString *path = pathForResource:@”filename_startnews24″ ofType:@”plist”];
nginxで帯域制限をする方法メモ
方法1
http{
limit_zone one $binary_remote_addr 10m;
limit_conn one 5;
# limit_req_zone $binary_remote_a ...
Linuxでmod_cband0.9.7.5をインストールしてBand Widthを 制御する
1.インストール
# wget
# tar zxvf mod-cband-0.9.7.5.tgz
# cd mod-cband-0.9.7.5
# ./configure –with-apx ...
PHPでのSQLインジェクションを防止するコード
PHPコード下記:
if (@get_magic_quotes_gpc ()) {
$_GET = sec ( $_GET );
$_POST = sec ( $_POST );
$_COOKIE = ...
phpでの16進数をRGB数値に変換するソースコード
PHPコード:
function hex2rgb($hexColor){
$color=str_replace(‘#’,”,$hexColor);
if (strlen($c ...
PHPでクライアントIPアドレスを取得するサンプルコード
方法1
function get_real_ipstartnews24(){
$ip=false;
if(!empty($_SERVER)){
$ip=$_SERVER;
}
if(!e ...
PHPでのutf-8文字列の長さを取得するコード
サンプルコード:
function utf8_strlen($string){
$string=trim($string);
if(empty($string)) return 0;
preg_matc ...
PHPでファイルをダウンロードするサンプルコード
サンプルコード:
function download_func($file_url,$new_name=”){
if(!isset($file_url)||trim($file_url)==”) ...
JavaScriptにオブジェクトを文字列に変換するコード
サンプルコード:
function obj2string(o){
var r=)/g,”\\$1″).replace(/(\n)/g,”\\n”).replace(/(\ ...
PHPで配列の先頭または末尾の要素を削除メモ
1.array_shift
PHPコード:
$user=array(‘品川区’,’港区’,’渋谷区’);
$result=array_sh ...
phpで文字列から数字を取得する方法まとめ
1.in_array関数
function searchNumber_Startnews24($str=”){
$str=trim($str);
if(empty($str)){return ...
「PHP初心者」ファイル拡張子を取得する方法まとめ
方法1
function get_file_type_startnews24($filename)
{
$type =explode(“.” , $filename);
$cou ...
Ubuntu 14.04にMySQL 5.5.37をインストールする方法
1.MySQLのインストール
sudo apt-get install mysql-server
sudo apt-get install mysql-client
2.MySQLのアクセス権限を設定
Pythonで昨日の日付の計算を実現するコード
コード下記
#-*-coding:utf-8-*-
import datetime
def getYesterday(): #
today=datetime.date.today()
oneda ...