草泥馬
  
 
 
 

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

2014-10-30_113355
常覺得行銷人大部分的工作時間都是在蹲馬步的動作,很多時候我們都在默默地做基本功,
整理報表、分析數據、收集網路資料….等,這些與「創意」八竿子打不上邊的就是我們平時最主要的工作內容。

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

Bruce
原以為遠離了學生生涯,畢業這個詞就會離我們很遠。沒想到出了社會後,還是脫離不了經歷各種的畢業離別」。

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

10月-Yuro
恭喜以下同仁榮獲卓越表彰表揚及獎金500元獎勵!!
10月份卓越同仁:
1.恭喜David大大(102年常勝軍之一)
 

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

2013-12-09 16.40.18.jpg
又到一年度的尾聲~
安德最重要的大型活動"年度會議"上場了!!!
 
選擇在桃園風景優美的綠風草原~

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

9月得主-david
102.9月~
 
恭喜David , Jenny 優秀安德人 !!
ODOTers~都要與你們看齊!

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

6月份-恭喜H大大!
102.6月~
 
恭喜H大大!!
ODOTers~都要與您看齊!

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

IMG_7401
2013.6.3 安德listening day~
 
*大地遊戲為 今天拉開序幕~
   請你跟我這樣做!!

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

Processing一直都是設計師用來制作互動作品的平台之一,過往都是搭配Arduino來與實體感測器結合,設計的初衷就是小而簡單,並且搭配了穩定的2D/3D功能,讓設計師也可以製作出絢麗的動畫效果,現在Processing的功能可以搬移到網頁上了,搭配Processing.js,就可以使用Processing提供的API來製作出以往Processing平台上可以達成的效果,不過是HTML5限定喔。
以下是示範程式碼:
<!DOCTYPE html>
<html>
<head>
<title>Processing.js Test</title>
<script src="processing.min.js"></script>

</head>
<body>
<h1>Processing.js</h1>
<canvas id="HelloProcess"></canvas>

<script type="text/javascript">
function sketchProc(processing) {
processing.println('Hello World');
// Override draw function, by default it will be called 60 times per second
processing.draw = function() {
// determine center and max clock arm length
var centerX = processing.width / 2, centerY = processing.height / 2;
var maxArmLength = Math.min(centerX, centerY);

function drawArm(position, lengthScale, weight) {
processing.strokeWeight(weight);
processing.line(centerX, centerY,
centerX + Math.sin(position * 2 * Math.PI) * lengthScale * maxArmLength,
centerY - Math.cos(position * 2 * Math.PI) * lengthScale * maxArmLength);
}

// erase background
processing.background(224);

var now = new Date();

// Moving hours arm by small increments
var hoursPosition = (now.getHours() % 12 + now.getMinutes() / 60) / 12;
drawArm(hoursPosition, 0.5, 5);

// Moving minutes arm by small increments
var minutesPosition = (now.getMinutes() + now.getSeconds() / 60) / 60;
drawArm(minutesPosition, 0.80, 3);

// Moving hour arm by second increments
var secondsPosition = now.getSeconds() / 60;
drawArm(secondsPosition, 0.90, 1);
};
}
var canvas = document.getElementById('HelloProcess');
var prsObj = new Processing(canvas, sketchProc);

</script>
</body>
</html>
canvas必須作為Processing的畫板使用,之後要建立一個Processing的物件,而Processing會透過draw函式以60 fps的速度描繪圖形,所有的動畫就是寫在這裡,要呼叫Processing的API時就只要使用processing即可。

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

寫程式的時候常常會需要用到GUID,JavaScript有一種很簡易的產生方式:
Math.guid = function(){
return 'xxxxxxxx-xxxx-0xxx-yxyx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c){
var string = Math.random()*16|0, v = c === 'x' ? string : (string &0x3|0x8);
return string.toString(16);
}).toUpperCase();
}
console.info(Math.guid());

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

今天改寫了之前寫得縮圖程式,之前寫的縮圖程式會將小於特定寬度的圖片重新取樣成特定尺寸,這樣的做法會導致小圖片的失真,所以我改寫了這個過程,將小於特定尺寸的圖片透過補色,變成一張符合特定尺寸的圖:
public function resizeImg($img, $width = 300, $height = 300, $newFilename = '', $maxImgWidth = 800, $maxImgHeight=800, $bgColor=null) {

$bgColor = $bgColor === null || !is_array($bgColor) ? array('r'=>255, 'g'=>255, 'b'=>255) : $bgColor;

switch (strtolower($img['type'])) {
case 'image/jpg':
case 'image/jpeg':
case 'image/pjpeg':
$image = imagecreatefromjpeg($img['tmp_name']);
break;
case 'image/png':
$image = imagecreatefrompng($img['tmp_name']);
break;
case 'image/gif':
$image = imagecreatefromgif($img['tmp_name']);
break;
default:
throw new Exception('Unsupported type: ' . $img['type']);
}

// Target dimensions
$max_width = $width;
$max_height = $height;

// Get current dimensions
$old_width = imagesx($image);
$old_height = imagesy($image);

// Calculate the scaling we need to do to fit the image inside our frame
$scale = min($max_width / $old_width, $max_height / $old_height);

$new_width = ceil($scale * $old_width);
$new_height = ceil($scale * $old_height);

// Create new empty image
$new = imagecreatetruecolor($new_width, $new_height);

// Get the new dimensions
if($old_width >= $maxImgWidth){
imagecopyresampled($new, $image, 0, 0, 0, 0, $new_width, $new_height, $old_width, $old_height);
}else{
$new_width = $maxImgWidth;
$new_height = ($maxImgHeight >= $old_height ? $maxImgHeight : $old_height);
$new = imagecreatetruecolor($new_width, $new_height);
$backgroundColor = imagecolorallocate($new, $bgColor['r'], $bgColor['g'], $bgColor['b']);
imagefill($new, 0, 0, $backgroundColor);
$centerX = (($new_width - $old_width) / 2);
$centerY = (($new_height - $old_height) / 2);
$centerY = $centerY + $old_height >= $new_height ? 0 : $centerY;
imagecopy($new, $image, $centerX, $centerY, 0, 0, $old_width, $old_height);
}


switch (strtolower($img['type'])) {
case 'image/jpg':
case 'image/jpeg':
case 'image/pjpeg':
$optImg = imagejpeg($new, $newFilename, 100);
break;
case 'image/png':
$optImg = imagepng($new, $newFilename, 0, PNG_ALL_FILTERS);
break;
case 'image/gif':
$optImg = imagegif($new, $newFilename);
break;
}

imagedestroy($image);
imagedestroy($new);
}

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

JavaScript needs a standard way to include other modules and for those modules to live in discreet namespaces. There are easy ways to do namespaces, but there’s no standard programmatic way to load a module (once!). This is really important, because server side apps can include a lot of code and will likely mix and match parts that meet those standard interfaces.
Kevin Dangoor, What Server Side JavaScript needs

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

1 2 3
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。