PIXNET Logo登入

Will的部落格

跳到主文

Will程式語言學習筆記

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 4月 29 週三 201521:21
  • 3. 英文成語 - be better off

be better off

原文解釋: used to give advice or an opnion, to be a better position/situation
中文解釋: 較佳狀況, (對於某事來說)是較為明智的
已下為兩個例句: 
A. Have you decide what to do after you graduate?
(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(4,842)

  • 個人分類:English idiom - 日常英文片語, 成語
▲top
  • 4月 28 週二 201521:42
  • 2. 英文成語 - drag on

drag on
原文解釋: if an event or situation drags on, it continues for too long
              and you dont know when is going to end
中文解釋: 拖延, 拖時間 
已下為兩個例句: 
A. How long has that MC been speaking?
(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(882)

  • 個人分類:English idiom - 日常英文片語, 成語
▲top
  • 4月 28 週二 201521:19
  • 1. 英文成語 - walk on egg shells

walk on egg shells 
原文解釋: to be very careful about how you behave with someone,
         
              because they are wasily upset or made angry.
中文解釋: 蛋殼相當脆弱, 若想走在蛋殼上頭必得警慎小心, 正處於一個微妙且危險的地位
已下為兩個例句: 
A. How is your daughter doing?
(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(2,164)

  • 個人分類:English idiom - 日常英文片語, 成語
▲top
  • 3月 25 週三 201521:32
  • BubbleSort泡沫排序

泡沫排序核心思維:每次比較兩個相鄰元素, 順序錯誤就交換
若有n個數字進行排序, 進行排序從第一個元素進行相鄰數字比較,
所以只需進行n - 1次操作即可完成,
程式碼如下:
#include <stdio.h>

int main(int argc, const char * argv[]) {

//n控制輸入元素之次數, tmp為暫存變數

int bubbleSortArray[100], n, tmp;
scanf("%d", &n);

for(int i = 0; i < n ; i++)
scanf("%d", &bubbleSortArray[i]);

for (int i = 0; i < n - 1; i++) //n個數排序, 只需n-1次
{
for (int j = 0; j <= n - 1; j++) //從陣列第一個元素比較到n-1個
{
if (bubbleSortArray[j] > bubbleSortArray[j + 1])
{
//大小互換
tmp = bubbleSortArray[j];
bubbleSortArray[j] = bubbleSortArray[j + 1];
bubbleSortArray[j + 1] = tmp;
}
}
}

//輸出結果
for(int i = 1; i < n ; i++)
printf("%d ", bubbleSortArray[i]);

return 0;

}

(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(663)

  • 個人分類:sort排序
▲top
  • 3月 24 週二 201516:02
  • android - 使用checkBox實現rememberMe功能

此範例為使用checkBox紀錄使用者登入之帳號密碼相關資訊,
google了許多範例都閹割了一些必要功能,
例如重新開啟app後rememberMe功能就失效之類等等,
重新reWork測試後為功能較完整的一份code如下所示
Xml布局檔
(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(179)

  • 個人分類:控制元件相關
▲top
  • 3月 21 週六 201512:42
  • iOS - UIImageView實現Animation

此範例先將動畫要用之圖片複製近xcode中,
接著使用一個array並存放圖片,
之後創建一個imageView物件顯示動畫窗格,
再透過[imageView startAnimating]此方法播放動畫, 程式碼如下
(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(1,119)

  • 個人分類:初階UI設計 - 顯示型元件
▲top
  • 3月 17 週二 201509:40
  • android 圖片翻轉產生out of memory

此範例作用為圖片翻轉會產生out of memory問題, 藉由inSampleSize去調整縮放比例則可以解決此問題
 
package com.example.photoRatation;

import android.R.string;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ContentResolver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;

public class MainActivity extends Activity {

/* this comment use for test */
public ImageView imageView1;
int deg = 0;
@SuppressLint("SdCardPath")
@Override
protected void onCreate(Bundle savedInstanceState) {
Runtime rt = Runtime.getRuntime();
long maxMemory = rt.maxMemory();
Log.d("00000000000", "maxMemory:" + Long.toString(maxMemory));
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
imageView1 = (ImageView) findViewById(R.id.imageView1);
String sourceFilePath = "file:///mnt/sdcard/DCIM/100MEDIA/IMAG0005.jpg";
String newFilePath = "file:///mnt/sdcard/DCIM/100MEDIA/";
photoRotation(sourceFilePath, newFilePath, deg);
}

public String photoRotation(String sourceFilePath, String newFilePath, int deg) {
try {
if (sourceFilePath == null) {
return null;
}
Uri uri = Uri.parse(sourceFilePath);
ContentResolver cr = this.getContentResolver();
deg = deg - 90;

final BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = android.graphics.Bitmap.Config.RGB_565;
options.outHeight = 1840;
options.outWidth = 3264;
options.inSampleSize = calculateInSampleSize(options, 32, 64);


Bitmap bitmap = BitmapFactory.decodeStream(cr.openInputStream(uri), null, options);
Matrix m = new Matrix();
int width = bitmap.getWidth();
int height = bitmap.getHeight();
m.setRotate(deg);
Bitmap bmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, m, false);
//imageView1.setImageBitmap(bmap);

newFilePath = bmap.toString();
//return newFilePath;

} catch (OutOfMemoryError ooe) {
ooe.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}
return newFilePath;
}

public static int calculateInSampleSize(BitmapFactory.Options options, int reqWidth, int reqHeight) {
// Raw height and width of image
final int height = options.outHeight;
final int width = options.outWidth;
int inSampleSize = 1;

if (height > reqHeight || width > reqWidth) {

final int halfHeight = height / 2;
final int halfWidth = width / 2;

// Calculate the largest inSampleSize value that is a power of 2 and
// keeps both
// height and width larger than the requested height and width.

while ((halfHeight / inSampleSize) > reqHeight
&& (halfWidth / inSampleSize) > reqWidth) {
inSampleSize *= 2;
}
}
return inSampleSize;
}
}

(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(301)

  • 個人分類:多媒體相關
▲top
  • 3月 16 週一 201514:47
  • android - 使用Intent啟動程式中的activity

android app是由activity組成, 每個activity代表一個畫面, 也是一個可執行的獨立單元
此範例為簡易的activity頁面切換
1. 首先新增一專案, 此範例命名為MainActivity, 創建完成後執行file/new/other/android activty
    新增activity, 命名為SecondActivity
(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(627)

  • 個人分類:用Intent啟動程式中其他activity
▲top
  • 3月 04 週三 201520:33
  • iOS UISlider - 滑動音量控制

UISlider - 滑動音量控制
此範例目的為滑動UISlider, 並顯示此音量控制元件的數值
1. stroryboard中加入slider, label
2. 加入程式關聯性
@property (weak, nonatomic) IBOutletUILabel *valueLabel;
property (weak, nonatomic) IBOutletUISlider *mySlider;
- (IBAction)sliderValueChange:(id)sender;
(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(444)

  • 個人分類:初階UI設計 - 操作型元件
▲top
  • 3月 03 週二 201523:29
  • iOS - 使用Long Press手勢

1. 開啟storyboard, 從元件褲拖曳一個Long Press Gesture Recognizer元件到view上,
並在viewcontroller.m檔中建立關聯性, 程式碼如下
@interfaceViewController ()

- (IBAction)handleLongPressGesture:(UILongPressGestureRecognizer *)sender;

@end

(繼續閱讀...)
文章標籤

Will 發表在 痞客邦 留言(0) 人氣(887)

  • 個人分類:初階手勢gesture運用
▲top
«1...232425»

個人資訊

Will
暱稱:
Will
分類:
數位生活
好友:
累積中
地區:

熱門文章

  • (27,188)Linux - cd指令(切換工作目錄)
  • (7,431)51. 英文片語 - better safe than sorry
  • (6,170)50. 英文片語 - be that as it may
  • (4,990)9. 英文片語 - lost one's train of thought
  • (4,597)38. 英文片語 - butt head with someone
  • (4,348)41. 英文片語 - have my heart set on (something)
  • (1,242)22. 英文片語 - get off one's back
  • (666)33. 英文片語 - be packed like sardines
  • (605)55. 英文片語 - stick to
  • (590)24. 英文片語 - out of one's element

文章分類

toggle SWIFT (2)
  • 網路服務與應用 (1)
  • 多媒體應用 (2)
toggle appleWatch學習筆記 (1)
  • watchConnectivity (1)
toggle 面試考題 (4)
  • 遞迴 (4)
  • C:選擇題 (2)
  • 常見面試考題 (8)
  • C:traceCode (2)
toggle appOnSale (1)
  • iOS (8)
toggle Java (1)
  • 檔案處理 (1)
toggle 英語學習 (2)
  • English idiom - 日常英文片語, 成語 (100)
  • English idiom - 日常英文片語, 成語 2 (16)
toggle Objective-C (2)
  • 類別, 物件與方法 (2)
  • 繼承 (2)
toggle 程式設計競賽題目 (3)
  • chapter1 (5)
  • chapter3 (1)
  • chapter2 (5)
toggle Linux (4)
  • Linux基本指令 (5)
  • Linux壓縮指令 (2)
  • Linux網路指令 (3)
  • Linux檔案與目錄管理 (1)
toggle 資料結構&演算法 (1)
  • sort排序 (2)
toggle android學習筆記 (7)
  • 其他 (1)
  • 網路服務相關 (1)
  • 用Intent啟動程式中其他activity (1)
  • SQLite資料庫 (2)
  • 事件處理 (5)
  • 多媒體相關 (1)
  • 控制元件相關 (11)
toggle iOS學習筆記 (7)
  • 其他 (14)
  • 初階UI設計 - 操作型元件 (13)
  • 初階UI設計 - 顯示型元件 (5)
  • 初階手勢gesture運用 (3)
  • 初階UI設計 - 指示型元件 (5)
  • 初階iOS內建裝置-多媒體功能 (7)
  • 初階iOS網路服務應用- 資料接收與傳送 (4)
  • 未分類文章 (1)

最新文章

  • iOS - NShopper (任天堂Switch商城特價遊戲查詢)
  • iOS - Bitcoin Miner (iOS比特幣挖礦程式)
  • iOS - Electronic Music Radio (免費電子音樂, 線上廣播)
  • iOS - Music Addict Radio (免費音樂, 完整曲風, 線上廣播)
  • iOS(Swift) - 播放影片
  • iOS(Swift) - 播放音樂
  • iOS(Swift) - 下載圖片並使用非同步傳輸
  • iOS - 2016/06/01之後app必須支援IPv6之問題
  • iOS - 後搖滾廣播電App(PostRock)
  • iOS - 調音器App(ThePitchPerfect)

最新留言

  • [24/08/23] 新飛Hsinfei 於文章「14. 英文片語 - had it co...」留言:
    實用日常英文合輯,5種生活英文對話情境,教你從常用英文開始學...
  • [23/01/06] 外約外送找小姐籟34386鐘點情人外約服務不只叫小姐素質好 臉蛋更優 想要找全套外約妹的朋友務必交給我 我將達成你最終性幻想對象Telegram:nini9595 於文章「iOS - Bitcoin Miner ...」留言:
    #奶糖外送茶 #外約 #舒壓 #喝茶籟34386和TG:ni...
  • [22/06/10] wecan如是外匯 於文章「3. 英文片語 - full plate...」留言:
    邀請你加入「外匯黃金虛擬貨幣技術信號Doo~Doo~」!請點...
  • [22/05/05] Unknown 於文章「65. 英文片語 - keep one'...」留言:
    Title: Keep one's word...
  • [22/04/24] 訪客 於文章「3-1. 陣列反轉輸出...」留言:
    原本在搜尋引擎找出一堆 Blog 文章,不知哪幾篇值得花時間...
  • [21/12/30] 康藥本鋪 kmed.tw 於文章「62. 英文片語 - on the sa...」留言:
    新聞BLOG https://kmed.tw/ind...
  • [21/03/28] 訪客 於文章「iOS - 控制camera閃光燈...」留言:
    「手機」,「虛擬網路」,[最高機密]。 --- ...
  • [21/03/28] 訪客 於文章「iOS - 控制camera閃光燈...」留言:
    一個錯誤的選擇 一個錯誤的環境 造就了 一連串 ...
  • [21/03/28] 訪客 於文章「iOS - 控制camera閃光燈...」留言:
    關閉系統基哨站。 這個世界,只不過是,謊言支撐起來,當...
  • [21/03/28] 訪客 於文章「iOS - 控制camera閃光燈...」留言:
    o•o 加油,別放棄,我們的星球,是變動的,生老病死,喜怒哀...

動態訂閱

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: