我的眼好疼

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/iteye_14880/article/details/81695917

最近发生了一些事情,好在自己假装很从容。

 

一些论断:

1、如果没有垄断的技术,就没有什么价值;譬如开源,只是一种商业上的成功。

2、要想进入社会,就一定要有一个文凭

3、人不是追求名就是追求利,你是哪一个?

4、你需要拿东西来证明

5、你需要第三方权威证明

……

 

我觉得这样很累,大家都在纸上谈信任,其实我们还是互相恐惧、互相嫉妒。

 

很累,我觉得会有这样一种绝对客观的工具或者模式吗,让彼此可以信任,很难。

 

除了自己的心,其它的我都不懂,有时候自己的也未必懂。

 

 

展开阅读全文

今天我蛋疼了

01-08

表示今天无聊到蛋疼,决定不用查表法来将10进制转换为16进制(PS:因为大家设置缓存一般都对齐4字节的,所以这个也是只处理对齐部分的)rn不知道还有没改进余地呢rn[code=c]rnIFNDEF _GLOBE_INC_rn INCLUDE Globe.incrnENDIF;// !_GLOBE_INC_rnrnCOMMENT */////////////////////////////////////////////////////////////////////////////////////////////rn//======================================================================================================rn// [value]::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::rn// 0 1 2 3 4 5 6 7 8 9rn// 0000|0000 0000|0001 0000|0010 0000|0011 0000|0100 0000|0101 0000|0110 0000|0111 0000|1000 0000|1001rn// A B C D E Frn// 0000|1010 0000|1011 0000|1100 0000|1101 0000|1110 0000|1111rn// [string]:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::rn// 0 1 2 3 4 5 6 7 8 9rn// 0011|0000 0011|0001 0011|0010 0011|0011 0011|0100 0011|0101 0011|0110 0011|0111 0011|1000 0011|1001rn// A B C D E Frn// 0100|0001 0100|0010 0100|0011 0100|0100 0100|0101 0100|0110rn//======================================================================================================*rn.CODErnHexBufferA PROC STDCALL \rn USES esi edi edx ebxrnrn pbSource EQU rn pbDest EQU rn dwLength EQU rn temp EQU rnrnALIGN AlignSizernrn shr dwLength,2rnrnHexBuffer_LOOP_DWORD:rn mov eax,DWORD PTR[pbSource]rn mov edx,eaxrnrn and eax,00F0F0F0Fhrn and edx,0F0F0F0F0hrn shr edx,4rn rn ;// 各字节加30hrn or eax,030303030hrn or edx,030303030hrn rn ;// 矫正eax各字节的数值rn mov temp,eaxrn sub temp,00A0A0A0Ahrn and temp,010101010hrn add eax,temprn shr temp,4rn sub eax,temprn shl temp,3rn xor eax,temprnrn ;// 矫正edx各字节的数值rn mov temp,edxrn sub temp,00A0A0A0Ahrn and temp,010101010hrn add edx,temprn shr temp,4rn sub edx,temprn shl temp,3rn xor edx,temprnrn ;// 矫正各字节的位置rn ;// eax:7531rn ;// ebx:6420rn ror eax,10hrn ;// eax:3175rn xchg ax,dxrn ;// eax:3120rn ;// ebx:6475rn ror eax,8rn rol edx,8rn ;// eax:0312rn ;// ebx:4756rn xchg ah,alrn xchg dh,dlrn ;// eax:0321rn ;// ebx:4765rn rol eax,8rn rol edx,8rn ;// eax:3210rn ;// ebx:7654rn mov [pbDest],eaxrn mov [pbDest+4],edxrnrn add pbSource,TYPE DWORDrn add pbDest,(TYPE DWORD*2)rnrn loop HexBuffer_LOOP_DWORDrnrn RETrnHexBufferA ENDPrnrnENDrn[/code] 论坛

一个让我很蛋疼的问题

03-11

先贴代码rn[code=Java]public class NormalCardsView extends SurfaceView implements View.OnTouchListener,SurfaceHolder.Callbackrn rn private Card[] cards;//纸牌rn rn private SurfaceHolder holder;rn rn private float space;//纸牌之间的间距rn /**rn * @param contextrn * @param targetrn * @param spacern */rn public NormalCardsView(Context context,Card[] target,float space) rn super(context);rn cards = target;rn this.space = space;rn holder = this.getHolder();rn holder.addCallback(this);rn setOnTouchListener(this);rn rn /* (non-Javadoc)rn * @see android.view.View.OnTouchListener#onTouch(android.view.View, android.view.MotionEvent)rn */rn @Overridern public boolean onTouch(View v, MotionEvent event) rn System.err.println(event.getX()+"------"+event.getY());rn int index = getClickedCardIndex(event.getX(),event.getY());rn if(index != -1)rn Toast.makeText(getContext(), "选中了第"+(index+1)+"张牌", Toast.LENGTH_SHORT).show();rn chooseCard(index);rn elsern Toast.makeText(getContext(), "没有选中牌", Toast.LENGTH_SHORT).show();rn rn return false;rn rn /**rn * 通过获取点击的坐标判断点击的是哪一张牌rn */rn public int getClickedCardIndex(float x,float y)rn int index = -1;rn for(int i=0;i= cards[i].getMinPoint().x && x <= cards[i].getMaxPoint().x && rn y >= cards[i].getMinPoint().y && y <= cards[i].getMaxPoint().y)rn index = i;rn rn rn return index;rn rn /**rn * 把点击的那张牌用一个同等的透明矩形重绘rn */rn public void chooseCard(int cardIndex)rn Card card = cards[cardIndex];rn int left = card.getMinPoint().x;rn int top = card.getMinPoint().y;rn int right = card.getMaxPoint().x;rn int bottom = card.getMaxPoint().y;rn Canvas mCanvas = holder.lockCanvas();rn Paint mPaint = new Paint();rn mPaint.setAlpha(0);rn mPaint.setColor(Color.TRANSPARENT);rn mCanvas.drawRect(new Rect(left, top, right, bottom), mPaint);rn holder.unlockCanvasAndPost(mCanvas);rn rn rn /* (non-Javadoc)rn * @see android.view.SurfaceHolder.Callback#surfaceChanged(android.view.SurfaceHolder, int, int, int)rn */rn @Overridern public void surfaceChanged(SurfaceHolder holder, int format, int width,rn int height) rn rn rnrn /* (non-Javadoc)rn * @see android.view.SurfaceHolder.Callback#surfaceCreated(android.view.SurfaceHolder)rn */rn @Overridern public void surfaceCreated(SurfaceHolder holder) rn new Thread(new CardsLoader()).start();rn rnrn /* (non-Javadoc)rn * @see android.view.SurfaceHolder.Callback#surfaceDestroyed(android.view.SurfaceHolder)rn */rn @Overridern public void surfaceDestroyed(SurfaceHolder holder) rn rn rn class CardsLoader implements Runnablernrn @Overridern public void run() rn for(int i=0;i 论坛

没有更多推荐了,返回首页