2013年12月6日 星期五

寫程式這件事在學校與在業界中有何差異?

What's difference between college-level and corporate programming?


從台大洪教授fb分享的連結看到這篇,我想把他翻成中文,希望自已進入職場前多了解一些,甚至在研究所就開始加入一些觀點,來快速適應職場環境。也希望中文版的內容可以幫助到更多人。


(待)




quote from:
http://arstechnica.com/information-technology/2013/12/whats-the-difference-between-college-level-and-corporate-programming/
by Stack Exchange

About the emguCV running in Windows Phone 8

在十月份的時候我在EmguCV的社群發了一封留言,請教EmguCV有沒有支援在WP8 APP。就在11/3我收到回覆,內容為:

Sorry, Windows Phone 8 is not supported. Windows 8 App store refers to the Windows 8 store running on x86, not Windows phone 8 store running arm. Microsoft is having too many different platforms at the moment:

1. Windows Desktop (regular windows executable)
2. Windows 8 App store App running on x86 (used to be called the metro interface)
3. Windows RT App store running on ARM (e.g. MS Surface, Surface 2) 
4. Windows Phone 8 App store running on ARM (e.g. Nokia phones)

As silly as it seems, app build for one platform cannot run on the others. None of platform 2, 3 and 4 seems to be a success at the moment and market share is small. Emgu CV currently support platform 1 & 2. It is possible to support platform 3 but we do not see enough demand for it. We don't have a road map for platform 4 yet because open cv do not support Windows Phone 8. 

Best regards,

Canming



整理:
    EmguCV目前支援在x86架構上,所以Windows Desktop跟Windows 8 App可以呼叫來用。但是WinRT跟WP8是ARM架構,所以不支援。
    在最後一段他寫了一些原因,也似乎婊了一下Microsoft。Win8 App、WinRT App跟WP8 App都是你家的東西,但build出來的App卻不能全部支援,有點愚蠢,而且這三個東西現在似乎還沒成功,市場也小。
    WinRT目前需求不大,不支援。OpenCV不支援WP8,所以EmguCV也無法支援。



2013年12月2日 星期一

How To Become A Hacker by Eric Steven Raymond

What Is a Hacker?
    The basic difference is this: hackers build things, crackers break them.


The Hacker Attitude
 
    To follow the path:
    look to the master,
    follow the master,
    walk with the master,
    see through the master,
    become the master.

  So, if you want to be a hacker, repeat the following things until you believe them:

    1. The world is full of fascinating problems waiting to be solved.

    2. No problem should ever have to be solved twice.
    3. Boredom and drudgery are evil.
    4. Freedom is good.
    5. Attitude is no substitute for competence.



Basic Hacking Skills

    1. Learn how to program.



2013年11月4日 星期一

Assignment1_A

Assignment1_A 不用寫到任何CODE,算是簡單的。


My First iOS app

終於開始自學iOS app撰寫了!

教材是Stanford University的iphone development 開放式課程CS193P

買了兩本工具書,精通OBJECTIVE-C程式設計以及探索IOS5程式開發實戰。

新的語言一定要Hello World! 一下。


//ViewController.h
@interface ViewController : UIViewController{
    IBOutlet UISlider *slider;
    IBOutlet UILabel *textValue;
    IBOutlet UILabel *hello;
}

@property (strong, nonatomic) IBOutlet UISlider *slider;
@property (strong, nonatomic) IBOutlet UILabel *textValue;
@property(strong,nonatomic) IBOutlet UILabel *hello;

- (IBAction)changTextValue:(UISlider *)sender;


//ViewController.m
@synthesize slider, textValue, hello;

- (IBAction)changTextValue:(UISlider *)sender {
    int SliderValue=slider.value;
    textValue.text=[NSString stringWithFormat:@"%d",SliderValue];
    hello.font=[UIFont systemFontOfSize:SliderValue];


2013年8月17日 星期六

Parallel.Foreach取得目前元素之索引位置

想法:在影像處理run pixel上用了Parallel Foreach跟For,比非Parallel的快非常多,但是卻少了Index。在做pixel操作的時候有時需要知道要寫回哪裡。
實作:
            byte[] byteArray = binary.Bytes; //size:307200
            var query = byteArray.Select((val, idx) => new { Index = idx, Value = val });
            int[] result = new int[byteArray.Length];

            //平行 擇一上註解
            Parallel.ForEach(query, b=>
            {  
                if (b.Value >= 255)
                {
                    result[b.Index] = -1;
                }

            } //close lambda expression
                 ); //close method invocation

            //非平行 擇一上註解
            foreach (var b in query)
            {
                if (b.Value >= 255) result[b.Index] = -1;

            }



結論:驚!! Parallel方法花了25ms。非Parallel花了17ms。Parallel for是否又比Parallel foreach?!
             等國科會結束我再來比較一下Parallel for!!!

2013年8月16日 星期五

在WPF將RGB轉HSV調亮度後轉回RGB再SHOW圖 using Emgu CV

想法:因為系統需要由使用者動態調整亮度。
實作:
Code:
        private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {  //sourceBgr&sourceHsv 事先建立
            Image<Rgb, byte> rgb = sourceBgr.Clone();
            Image<Hsv, byte> Hsv = sourceHsv.Clone();
            CvInvoke.cvCvtColor(rgb, Hsv, Emgu.CV.CvEnum.COLOR_CONVERSION.CV_RGB2HSV);     
            int  newValue=(int)e.NewValue; //取得slider事件發生後的值          
            string s = newValue.ToString();
            label1.Content = s;
            if (Hsv != null)
            {
                for (int j = 0; j < sourceHsv.Height; j++)
                {
                    for (int i = 0; i < sourceHsv.Width; i++)
                    {
                        byte value=0;
                        if (Hsv.Data[j, i, 2] + newValue > 255) value = 255;
                        else if (Hsv.Data[j, i, 2] + newValue < 0) value = 0;
                        else value = (byte)(Hsv.Data[j, i, 2] + newValue);

                        Hsv.Data[j, i, 2] = value;
                    }
                }
            }
            CvInvoke.cvCvtColor(Hsv, rgb, Emgu.CV.CvEnum.COLOR_CONVERSION.CV_HSV2RGB);

            image1.Source = rgb.ToBitmapSource();
        }

紀錄:Hsv的v(value)是亮度,只要調整它即可調整該PIXEL的亮度。