那些年我們賺過的外快


可能童鞋們都看到園子里有很多大神,賺錢快又輕松。這里我們討論下苦逼程序員如何增加自己的收入。像xiaotie啊、吉日啊這些個前輩是怎么做到的呢?你們想過沒有!當然我也是苦逼大眾之一,還沒到達那境界,我作個簡單分析。然后分享一下最近5、1期間一次技術救急的經歷,分享一下自己做私活的心得。

成功沒有捷徑,因為專業,所以出色!

1、做軟件多年明白一個道理:需求很值錢,業務很值錢。

比如我以前是做酒店管理系統、餐飲管理系統、桑拿收銀系統等等,這些國內信息化比較早的傳統管理軟件。這些軟件能夠成就北京中軟、泰能、杭州西湖軟件等上市公司,還有無數的中小軟件作坊。所以專業的管理軟件必須體現那個行業的先進的管理理念、實現先進的管理方法,能夠提高客戶的收益,提升客戶的管理水平。所以說需求很值錢,業務很值錢。悲劇的是,我沒進到做這些系統的大公司,我入行時那公司只是作坊的規模。所以就悲催了。但是因為在這個行業做了幾年,積累了些人脈,后面換工作因為熟悉這個行業的一些需求、業務,找到了項目經理、產品經理的職位。所以大家不必死死盯着最新的技術,術業有專攻。當你在某一領域做到最專業最有名就成功了。xiaotie是圖像界泰斗,吉日是權限方面的專家,還有像老魏啊醫療HIS方面的、企業級快速開發平台等領域...

一個有趣的現象,同樣是程序員:

一些人累得半死,一個月賺不了多少。有些人很輕松依靠自己的獨門絕技,悶聲發財,關鍵還有時間找妹紙。

對於這現象我也是只有驚嘆,人和人怎么就那么大區別啊!不科學啊!%……&%¥###

2、機遇很重要,人脈很重要。苦逼碼農你要寫博客,多看牛人的博客。

訂閱園子優秀博客的rss以來這幾年逛園子的習慣讓我增長了知識,拓寬了眼界,還有幸結識了一些大牛。苦逼碼農要想發展好,必須注重建立自己的圈子。對,圈子!君不見牛人換工作都是獵頭自己找上門來,成功的碼農跳槽都是朋友推薦,同樣做外快也大都是自己圈子里朋友介紹,或者是人家看了你博客找到你。精明的商家已經學會了微博營銷,碼農你要寫博客,你也可以實現博客營銷。吉日大哥一句話驚醒夢中人:這幾年一寫博客,每年就增加10萬收入!當然我不是在這里找抽,拜金。一個碼農不能養家糊口,算什么英雄。在天朝你沒買房買車,你得不到尊重!

3、個人一次技術援助的分享。

五一前,有位帥哥:山東日照做計生軟件的李哥。通過看我的博客,認為我能解決他遇到的條形碼打印的問題,通過QQ要求我加他。他說可以付費請我幫忙。先是加了他,然后遠程協助了一下,寫了一段代碼那條形碼打印機有反應了,但是打出來東西是空白。無奈那東西需要大量調試,那廠家提供的SDK也只有VB和Delphi、VFP等的。沒有C#的。我使用的是GDI+進行測試,跳開了使用廠家SDK的辦法。但是證明不行,那么只有把Delphi的DEMO轉成C#的一條路了。我說必須多次調試,沒有打印機。李哥二話不說,網上訂了打印機,第二天就到了。李哥老問多少錢,我出於有研究的興趣一直沒答復他,我說簡單的話就免費了。剛好放假有時間花了一天時間搞定了。在通知李哥前,他QQ上留言給我寄了點心意,我擦,山東李哥真豪爽!李哥的答謝禮是一台台電4核的平板電腦!價值1300多!估計李哥是看我說說你們照片發現最近在學安卓開發吧。無圖無真相,上圖得瑟下!

送上一段代碼,CODE39條形碼圖像生成。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Code39GenApp
{
    /// <summary>
    /// Code39表形碼圖形生成器
    /// </summary>
    public class Code39BarCode
    {
        /// <summary>
        /// 條碼文本,最后一次調用時的BarCode
        /// </summary>
        public static string BarCodeText = string.Empty;
        /// <summary>
        /// 生成條碼Bitmap 默認大小
        /// </summary>
        /// <param name="sourceCode"></param>
        /// <returns></returns>
        public static Bitmap GetCode39(string sourceCode)
        {
            int leftMargin = 5;
            int topMargin = 0;
            int thickLength = 2;
            int narrowLength = 1;
            int barCodeHeight = 35;
            int intSourceLength = sourceCode.Length;
            string strEncode = "010010100"; //添加起始碼“*”.
            var font = new System.Drawing.Font("Segoe UI", 5);

            string AlphaBet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*";

            string[] Code39 = 
             {
                 /* 0 */ "000110100",  
                 /* 1 */ "100100001",  
                 /* 2 */ "001100001",  
                 /* 3 */ "101100000",
                 /* 4 */ "000110001",  
                 /* 5 */ "100110000",  
                 /* 6 */ "001110000",  
                 /* 7 */ "000100101",
                 /* 8 */ "100100100",  
                 /* 9 */ "001100100",  
                 /* A */ "100001001",  
                 /* B */ "001001001",
                 /* C */ "101001000",  
                 /* D */ "000011001",  
                 /* E */ "100011000",  
                 /* F */ "001011000",
                 /* G */ "000001101",  
                 /* H */ "100001100",  
                 /* I */ "001001100",  
                 /* J */ "000011100",
                 /* K */ "100000011",  
                 /* L */ "001000011",  
                 /* M */ "101000010",  
                 /* N */ "000010011",
                 /* O */ "100010010",  
                 /* P */ "001010010",  
                 /* Q */ "000000111",  
                 /* R */ "100000110",
                 /* S */ "001000110",  
                 /* T */ "000010110",  
                 /* U */ "110000001",  
                 /* V */ "011000001",
                 /* W */ "111000000",  
                 /* X */ "010010001",  
                 /* Y */ "110010000",  
                 /* Z */ "011010000",
                 /* - */ "010000101",  
                 /* . */ "110000100",  
                 /*' '*/ "011000100",
                 /* $ */ "010101000",
                 /* / */ "010100010",  
                 /* + */ "010001010",  
                 /* % */ "000101010",  
                 /* * */ "010010100"  
             };
            sourceCode = sourceCode.ToUpper();

            Bitmap objBitmap = new Bitmap(
              ((thickLength * 3 + narrowLength * 7) * (intSourceLength + 2)) + (leftMargin * 2),
              barCodeHeight + (topMargin * 2));
            Graphics objGraphics = Graphics.FromImage(objBitmap);

            objGraphics.FillRectangle(Brushes.White, 0, 0, objBitmap.Width, objBitmap.Height);

            for (int i = 0; i < intSourceLength; i++)
            {
                //非法字符校驗
                if (AlphaBet.IndexOf(sourceCode[i]) == -1 || sourceCode[i] == '*')
                {
                    objGraphics.DrawString("Invalid Bar Code",
                      SystemFonts.DefaultFont, Brushes.Red, leftMargin, topMargin);
                    return objBitmap;
                }
                //編碼
                strEncode = string.Format("{0}0{1}", strEncode,
                 Code39[AlphaBet.IndexOf(sourceCode[i])]);
            }

            strEncode = string.Format("{0}0010010100", strEncode); //添加結束碼“*”

            int intEncodeLength = strEncode.Length;
            int intBarWidth;

            for (int i = 0; i < intEncodeLength; i++) //繪制 Code39 barcode
            {
                intBarWidth = strEncode[i] == '1' ? thickLength : narrowLength;
                objGraphics.FillRectangle(i % 2 == 0 ? Brushes.Black : Brushes.White,
                 leftMargin, topMargin, intBarWidth, barCodeHeight);
                leftMargin += intBarWidth;
            }

            //繪制 明碼
            SizeF sizeF = objGraphics.MeasureString(sourceCode, font);
            float x = (objBitmap.Width - sizeF.Width) / 2;
            float y = objBitmap.Height - sizeF.Height;
            objGraphics.FillRectangle(Brushes.White, x, y, sizeF.Width, sizeF.Height);
            objGraphics.DrawString(sourceCode, font, Brushes.Black, x, y);

            return objBitmap;
        }
       
        /// <summary>
        /// 生成條碼Bitmap,自定義條碼高度
        /// </summary>
        /// <param name="sourceCode"></param>
        /// <returns></returns>
        public static Bitmap GetCode39(string sourceCode, int barCodeHeight)
        {
            BarCodeText = sourceCode.ToUpper();
            int leftMargin = 5;
            int topMargin = 0;
            int thickLength = 2;
            int narrowLength = 1;           
            int intSourceLength = sourceCode.Length;
            string strEncode = "010010100"; //添加起始碼“*”.
            var font = new System.Drawing.Font("Segoe UI", 5);
            string AlphaBet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*";
            string[] Code39 = 
             {
                 /* 0 */ "000110100",  
                 /* 1 */ "100100001",  
                 /* 2 */ "001100001",  
                 /* 3 */ "101100000",
                 /* 4 */ "000110001",  
                 /* 5 */ "100110000",  
                 /* 6 */ "001110000",  
                 /* 7 */ "000100101",
                 /* 8 */ "100100100",  
                 /* 9 */ "001100100",  
                 /* A */ "100001001",  
                 /* B */ "001001001",
                 /* C */ "101001000",  
                 /* D */ "000011001",  
                 /* E */ "100011000",  
                 /* F */ "001011000",
                 /* G */ "000001101",  
                 /* H */ "100001100",  
                 /* I */ "001001100",  
                 /* J */ "000011100",
                 /* K */ "100000011",  
                 /* L */ "001000011",  
                 /* M */ "101000010",  
                 /* N */ "000010011",
                 /* O */ "100010010",  
                 /* P */ "001010010",  
                 /* Q */ "000000111",  
                 /* R */ "100000110",
                 /* S */ "001000110",  
                 /* T */ "000010110",  
                 /* U */ "110000001",  
                 /* V */ "011000001",
                 /* W */ "111000000",  
                 /* X */ "010010001",  
                 /* Y */ "110010000",  
                 /* Z */ "011010000",
                 /* - */ "010000101",  
                 /* . */ "110000100",  
                 /*' '*/ "011000100",
                 /* $ */ "010101000",
                 /* / */ "010100010",  
                 /* + */ "010001010",  
                 /* % */ "000101010",  
                 /* * */ "010010100"  
             };
            sourceCode = sourceCode.ToUpper();
            Bitmap objBitmap = new Bitmap(((thickLength * 3 + narrowLength * 7) * (intSourceLength + 2)) + 
                                           (leftMargin * 2),barCodeHeight + (topMargin * 2));
            Graphics objGraphics = Graphics.FromImage(objBitmap);
            objGraphics.FillRectangle(Brushes.White, 0, 0, objBitmap.Width, objBitmap.Height);
            for (int i = 0; i < intSourceLength; i++)
            {
                //非法字符校驗
                if (AlphaBet.IndexOf(sourceCode[i]) == -1 || sourceCode[i] == '*')
                {
                    objGraphics.DrawString("Invalid Bar Code",SystemFonts.DefaultFont, Brushes.Red, leftMargin, topMargin);
                    return objBitmap;
                }
                //編碼
                strEncode = string.Format("{0}0{1}", strEncode,
                Code39[AlphaBet.IndexOf(sourceCode[i])]);
            }
            strEncode = string.Format("{0}0010010100", strEncode); //添加結束碼“*”
            int intEncodeLength = strEncode.Length;
            int intBarWidth;
            for (int i = 0; i < intEncodeLength; i++) //繪制 Code39 barcode
            {
                intBarWidth = strEncode[i] == '1' ? thickLength : narrowLength;
                objGraphics.FillRectangle(i % 2 == 0 ? Brushes.Black : Brushes.White,leftMargin, topMargin, intBarWidth, barCodeHeight);
                leftMargin += intBarWidth;
            }
            //繪制明碼          
            Font barCodeTextFont = new Font("黑體", 10F);
            RectangleF rect = new RectangleF(2, barCodeHeight - 20, objBitmap.Width - 4, 20);          
            objGraphics.FillRectangle(Brushes.White,rect);
            //文本對齊
            StringFormat barCodeTextFormat = new StringFormat();
            barCodeTextFormat.Alignment = StringAlignment.Center;
            barCodeTextFormat.LineAlignment = StringAlignment.Center;
            objGraphics.DrawString(BarCodeText, barCodeTextFont, Brushes.Black, rect, barCodeTextFormat);
            return objBitmap;
        }

        /// <summary>
        /// 生成條碼Bitmap,自定義條碼高度,自定義文字對齊樣式
        /// </summary>
        /// <param name="sourceCode"></param>
        /// <param name="barCodeHeight"></param>
        /// <param name="sf"></param>
        /// <returns></returns>
        public static Bitmap GetCode39(string sourceCode, int barCodeHeight,StringFormat sf)
        {
            BarCodeText = sourceCode.ToUpper();
            int leftMargin = 5;
            int topMargin = 0;
            int thickLength = 2;
            int narrowLength = 1;
            int intSourceLength = sourceCode.Length;
            string strEncode = "010010100"; //添加起始碼“*”.
            var font = new System.Drawing.Font("Segoe UI", 5);
            string AlphaBet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*";
            string[] Code39 = 
             {
                 /* 0 */ "000110100",  
                 /* 1 */ "100100001",  
                 /* 2 */ "001100001",  
                 /* 3 */ "101100000",
                 /* 4 */ "000110001",  
                 /* 5 */ "100110000",  
                 /* 6 */ "001110000",  
                 /* 7 */ "000100101",
                 /* 8 */ "100100100",  
                 /* 9 */ "001100100",  
                 /* A */ "100001001",  
                 /* B */ "001001001",
                 /* C */ "101001000",  
                 /* D */ "000011001",  
                 /* E */ "100011000",  
                 /* F */ "001011000",
                 /* G */ "000001101",  
                 /* H */ "100001100",  
                 /* I */ "001001100",  
                 /* J */ "000011100",
                 /* K */ "100000011",  
                 /* L */ "001000011",  
                 /* M */ "101000010",  
                 /* N */ "000010011",
                 /* O */ "100010010",  
                 /* P */ "001010010",  
                 /* Q */ "000000111",  
                 /* R */ "100000110",
                 /* S */ "001000110",  
                 /* T */ "000010110",  
                 /* U */ "110000001",  
                 /* V */ "011000001",
                 /* W */ "111000000",  
                 /* X */ "010010001",  
                 /* Y */ "110010000",  
                 /* Z */ "011010000",
                 /* - */ "010000101",  
                 /* . */ "110000100",  
                 /*' '*/ "011000100",
                 /* $ */ "010101000",
                 /* / */ "010100010",  
                 /* + */ "010001010",  
                 /* % */ "000101010",  
                 /* * */ "010010100"  
             };
            sourceCode = sourceCode.ToUpper();
            Bitmap objBitmap = new Bitmap(((thickLength * 3 + narrowLength * 7) * (intSourceLength + 2)) +
                                           (leftMargin * 2), barCodeHeight + (topMargin * 2));
            Graphics objGraphics = Graphics.FromImage(objBitmap);
            objGraphics.FillRectangle(Brushes.White, 0, 0, objBitmap.Width, objBitmap.Height);
            for (int i = 0; i < intSourceLength; i++)
            {
                //非法字符校驗
                if (AlphaBet.IndexOf(sourceCode[i]) == -1 || sourceCode[i] == '*')
                {
                    objGraphics.DrawString("Invalid Bar Code", SystemFonts.DefaultFont, Brushes.Red, leftMargin, topMargin);
                    return objBitmap;
                }
                //編碼
                strEncode = string.Format("{0}0{1}", strEncode,
                Code39[AlphaBet.IndexOf(sourceCode[i])]);
            }
            strEncode = string.Format("{0}0010010100", strEncode); //添加結束碼“*”
            int intEncodeLength = strEncode.Length;
            int intBarWidth;
            for (int i = 0; i < intEncodeLength; i++) //繪制 Code39 barcode
            {
                intBarWidth = strEncode[i] == '1' ? thickLength : narrowLength;
                objGraphics.FillRectangle(i % 2 == 0 ? Brushes.Black : Brushes.White, leftMargin, topMargin, intBarWidth, barCodeHeight);
                leftMargin += intBarWidth;
            }
            //繪制明碼          
            Font barCodeTextFont = new Font("黑體", 10F);
            RectangleF rect = new RectangleF(2, barCodeHeight - 20, objBitmap.Width - 4, 20);
            objGraphics.FillRectangle(Brushes.White, rect);
            //文本對齊
            objGraphics.DrawString(BarCodeText, barCodeTextFont, Brushes.Black, rect, sf);
            return objBitmap;
        }
    }
}

 

后續希望可以成為條形碼、RFID等物聯網技術領域的專家。所以我開心的笑了,等我哪天成功了,我來園子炫下富,刺激一下你們眼球...

~_~ 拋了磚,接你們的玉!謝謝CCTV、謝謝博客園...


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM