思绪来得快 也去得快 偶尔在这里停留

Blog

首页博客
09
Jan
0

信佛 请不要再迷信

(09年QQ空间写的,觉得很重要就转到这里来了)

这段时间看了不少关于佛教的东西

  发现以前好多对于佛教的认识     被那些道听途说的东西

       扰乱和干扰是那么有冤枉

            下面就以我这段时间对佛教浅薄的认识来回答自己以前也很想知道的答案

                  希望对有缘看见这篇日志的朋友们一些感悟

    1.佛教是迷信吗?

         你可能见到很多人拿香拿烛拿烧猪去祈求佛祖保佑升官发财 我告诉你 那是迷信

         你也可能看见很多庙里的师傅让拿着签的信徒 去烧高香        我也告诉你 那也是迷信

         你或许还能看见有人花大钱买很多贡品还是什么的去庙里 求菩萨帮他化解犯下的罪业    那个叫迷信中的迷信

     2.佛那到底是什么呢?

         佛是你自己 纯洁的自己 去除贪嗔痴慢后的自己

     3.那释迦牟尼是什么?

         释迦牟尼是乔达摩.悉达多教育学生时的口号    意思是以仁爱之心教化众生

      4.成佛等于高高在上法力无边吗?

         佛说:佛即自性    意思是成佛只是恢复了你本来的性德而已 而不会得到什么

      5.怎么看待佛教文化和儒家.道家思想?

         不管是佛家的根本《十善业道经》儒家的根本《弟子归》还是道家的根《太上感应篇》

         它们都不是玄学文化 而最中心的思想是孝和悌两个字  意思是孝敬长辈 亲睦同辈

       6.佛教的佛祖和基督教的耶苏,儒家的孙孟还有其它很多教的真神是什么关系?

           佛说:应以什么身得道,就化成什么样的身

        7.真的有地狱或天堂吗?我怎么才看得到?

           能否看见天堂或地狱的关键是你是否有那样的资格

        8.那些高僧大德说不要迷信,但为什么他们还是会每天对佛像叩首呢,不是迷信吗?

           佛家.儒家和家里祭祀一样,尊师重道是放在首位的,那只是对老师的感恩
  目前就想到这些  已经花了我一个小时了  希望大家看后有所感悟 

   最后送四句话给有缘的人和自己  希望身体力行

   存好心      说好话

   行好事      做好人

   如果有人愿意和我讨论关于佛教和儒家文化的   欢迎留言

   小草目前所知甚少 不足之处欢迎提点  我愿意和大家分享我知道的  也愿意倾听你所知道的

   《论语》第一句 学而时习之 不亦悦乎  
06
Oct
0

RzBorder.pas 编译失败Number of elements (125) differs from declaration (224)

下面的变量覆盖一下, 就好了,

原因只是好多乱码地方的}的符号没有 加上就好了

可能编码问题造成的 要不然不会这么多个版本了 还是没有解决

const
DotMasks: TRzLEDCharacters = ( ( { } Col0: $00; Col1: $00; Col2: $00; Col3: $00; Col4: $00 ),

                             ( {!} Col0: $00; Col1: $00; Col2: $FA; Col3: $00; Col4: $00 ),
                             ( {"} Col0: $00; Col1: $C0; Col2: $00; Col3: $C0; Col4: $00 ),
                             ( {#} Col0: $28; Col1: $7C; Col2: $28; Col3: $7C; Col4: $28 ),
                             ( { } Col0: $24; Col1: $54; Col2: $FE; Col3: $54; Col4: $48 ),  // Dollar sign $
                             ( {%} Col0: $64; Col1: $68; Col2: $10; Col3: $2C; Col4: $4C ),
                             ( {&} Col0: $6C; Col1: $92; Col2: $AA; Col3: $44; Col4: $0A ),
                             ( {'} Col0: $00; Col1: $20; Col2: $C0; Col3: $00; Col4: $00 ),
                             ( {(} Col0: $00; Col1: $00; Col2: $7C; Col3: $82; Col4: $00 ),
                             ( {)} Col0: $00; Col1: $82; Col2: $7C; Col3: $00; Col4: $00 ),
                             ( {*} Col0: $54; Col1: $38; Col2: $FE; Col3: $38; Col4: $54 ),
                             ( {+} Col0: $10; Col1: $10; Col2: $7C; Col3: $10; Col4: $10 ),
                             ( {,} Col0: $00; Col1: $02; Col2: $04; Col3: $00; Col4: $00 ),
                             ( {-} Col0: $10; Col1: $10; Col2: $10; Col3: $10; Col4: $10 ),
                             ( {.} Col0: $00; Col1: $00; Col2: $02; Col3: $00; Col4: $00 ),
                             ( {/} Col0: $04; Col1: $08; Col2: $10; Col3: $20; Col4: $40 ),
                             ( {0} Col0: $7C; Col1: $8A; Col2: $92; Col3: $A2; Col4: $7C ),
                             ( {1} Col0: $00; Col1: $42; Col2: $FE; Col3: $02; Col4: $00 ),
                             ( {2} Col0: $46; Col1: $8A; Col2: $92; Col3: $92; Col4: $62 ),
                             ( {3} Col0: $44; Col1: $92; Col2: $92; Col3: $92; Col4: $6C ),
                             ( {4} Col0: $F0; Col1: $10; Col2: $10; Col3: $10; Col4: $FE ),
                             ( {5} Col0: $F4; Col1: $92; Col2: $92; Col3: $92; Col4: $8C ),
                             ( {6} Col0: $7C; Col1: $92; Col2: $92; Col3: $92; Col4: $4C ),
                             ( {7} Col0: $C0; Col1: $80; Col2: $8E; Col3: $90; Col4: $E0 ),
                             ( {8} Col0: $6C; Col1: $92; Col2: $92; Col3: $92; Col4: $6C ),
                             ( {9} Col0: $64; Col1: $92; Col2: $92; Col3: $92; Col4: $7C ),
                             ( {:} Col0: $00; Col1: $00; Col2: $24; Col3: $00; Col4: $00 ),
                             ( {;} Col0: $00; Col1: $02; Col2: $24; Col3: $00; Col4: $00 ),
                             ( {<} Col0: $10; Col1: $28; Col2: $44; Col3: $82; Col4: $00 ),
                             ( {=} Col0: $28; Col1: $28; Col2: $28; Col3: $28; Col4: $28 ),
                             ( {>} Col0: $00; Col1: $82; Col2: $44; Col3: $28; Col4: $10 ),
                             ( {?} Col0: $40; Col1: $80; Col2: $9A; Col3: $90; Col4: $60 ),
                             ( {@} Col0: $7C; Col1: $92; Col2: $AA; Col3: $BA; Col4: $70 ),
                             ( {A} Col0: $7E; Col1: $90; Col2: $90; Col3: $90; Col4: $7E ),
                             ( {B} Col0: $FE; Col1: $92; Col2: $92; Col3: $92; Col4: $6C ),
                             ( {C} Col0: $7C; Col1: $82; Col2: $82; Col3: $82; Col4: $44 ),
                             ( {D} Col0: $FE; Col1: $82; Col2: $82; Col3: $82; Col4: $7C ),
                             ( {E} Col0: $FE; Col1: $92; Col2: $92; Col3: $92; Col4: $82 ),
                             ( {F} Col0: $FE; Col1: $90; Col2: $90; Col3: $90; Col4: $80 ),
                             ( {G} Col0: $7C; Col1: $82; Col2: $92; Col3: $92; Col4: $5C ),
                             ( {H} Col0: $FE; Col1: $10; Col2: $10; Col3: $10; Col4: $FE ),
                             ( {I} Col0: $82; Col1: $82; Col2: $FE; Col3: $82; Col4: $82 ),
                             ( {J} Col0: $04; Col1: $02; Col2: $02; Col3: $02; Col4: $FC ),
                             ( {K} Col0: $FE; Col1: $10; Col2: $28; Col3: $44; Col4: $82 ),
                             ( {L} Col0: $FE; Col1: $02; Col2: $02; Col3: $02; Col4: $02 ),
                             ( {M} Col0: $FE; Col1: $40; Col2: $20; Col3: $40; Col4: $FE ),
                             ( {N} Col0: $FE; Col1: $20; Col2: $10; Col3: $08; Col4: $FE ),
                             ( {O} Col0: $7C; Col1: $82; Col2: $82; Col3: $82; Col4: $7C ),
                             ( {P} Col0: $FE; Col1: $90; Col2: $90; Col3: $90; Col4: $60 ),
                             ( {Q} Col0: $7C; Col1: $82; Col2: $82; Col3: $86; Col4: $7E ),
                             ( {R} Col0: $FE; Col1: $90; Col2: $90; Col3: $90; Col4: $6E ),
                             ( {S} Col0: $64; Col1: $92; Col2: $92; Col3: $92; Col4: $4C ),
                             ( {T} Col0: $80; Col1: $80; Col2: $FE; Col3: $80; Col4: $80 ),
                             ( {U} Col0: $FC; Col1: $02; Col2: $02; Col3: $02; Col4: $FC ),
                             ( {V} Col0: $E0; Col1: $18; Col2: $06; Col3: $18; Col4: $E0 ),
                             ( {W} Col0: $FC; Col1: $02; Col2: $0C; Col3: $02; Col4: $FC ),
                             ( {X} Col0: $C6; Col1: $28; Col2: $10; Col3: $28; Col4: $C6 ),
                             ( {Y} Col0: $C0; Col1: $20; Col2: $1E; Col3: $20; Col4: $C0 ),
                             ( {Z} Col0: $86; Col1: $8A; Col2: $92; Col3: $A2; Col4: $C2 ),
                             ( {[} Col0: $00; Col1: $FE; Col2: $82; Col3: $82; Col4: $00 ),
                             ( {\} Col0: $40; Col1: $20; Col2: $10; Col3: $08; Col4: $04 ),
                             ( {]} Col0: $00; Col1: $82; Col2: $82; Col3: $FE; Col4: $00 ),
                             ( {^} Col0: $20; Col1: $40; Col2: $80; Col3: $40; Col4: $20 ),
                             ( {_} Col0: $02; Col1: $02; Col2: $02; Col3: $02; Col4: $02 ),
                             ( {`} Col0: $00; Col1: $00; Col2: $C0; Col3: $20; Col4: $00 ),
                             ( {a} Col0: $04; Col1: $2A; Col2: $2A; Col3: $2A; Col4: $1E ),
                             ( {b} Col0: $FE; Col1: $22; Col2: $22; Col3: $22; Col4: $1C ),
                             ( {c} Col0: $1C; Col1: $22; Col2: $22; Col3: $22; Col4: $14 ),
                             ( {d} Col0: $1C; Col1: $22; Col2: $22; Col3: $22; Col4: $FE ),
                             ( {e} Col0: $1C; Col1: $2A; Col2: $2A; Col3: $2A; Col4: $18 ),
                             ( {f} Col0: $10; Col1: $7E; Col2: $90; Col3: $90; Col4: $40 ),
                             ( {g} Col0: $10; Col1: $2A; Col2: $2A; Col3: $2A; Col4: $1C ),
                             ( {h} Col0: $FE; Col1: $20; Col2: $20; Col3: $20; Col4: $1E ),
                             ( {i} Col0: $00; Col1: $22; Col2: $BE; Col3: $02; Col4: $00 ),
                             ( {j} Col0: $00; Col1: $02; Col2: $BC; Col3: $00; Col4: $00 ),
                             ( {k} Col0: $FE; Col1: $08; Col2: $08; Col3: $14; Col4: $22 ),
                             ( {l} Col0: $00; Col1: $82; Col2: $FE; Col3: $02; Col4: $00 ),
                             ( {m} Col0: $3E; Col1: $20; Col2: $3E; Col3: $20; Col4: $1E ),
                             ( {n} Col0: $3E; Col1: $20; Col2: $20; Col3: $20; Col4: $1E ),
                             ( {o} Col0: $1C; Col1: $22; Col2: $22; Col3: $22; Col4: $1C ),
                             ( {p} Col0: $3E; Col1: $28; Col2: $28; Col3: $28; Col4: $10 ),
                             ( {q} Col0: $10; Col1: $28; Col2: $28; Col3: $28; Col4: $3E ),
                             ( {r} Col0: $3E; Col1: $20; Col2: $20; Col3: $20; Col4: $10 ),
                             ( {s} Col0: $12; Col1: $2A; Col2: $2A; Col3: $2A; Col4: $24 ),
                             ( {t} Col0: $20; Col1: $FC; Col2: $22; Col3: $22; Col4: $00 ),
                             ( {u} Col0: $3C; Col1: $02; Col2: $02; Col3: $02; Col4: $3E ),
                             ( {v} Col0: $38; Col1: $04; Col2: $02; Col3: $04; Col4: $38 ),
                             ( {w} Col0: $3C; Col1: $02; Col2: $0C; Col3: $02; Col4: $3C ),
                             ( {x} Col0: $22; Col1: $14; Col2: $08; Col3: $14; Col4: $22 ),
                             ( {y} Col0: $22; Col1: $14; Col2: $08; Col3: $10; Col4: $20 ),
                             ( {z} Col0: $22; Col1: $26; Col2: $2A; Col3: $32; Col4: $22 ),
                             ( { } Col0: $00; Col1: $10; Col2: $6C; Col3: $82; Col4: $00 ),  // {
                             ( {|} Col0: $00; Col1: $00; Col2: $FE; Col3: $00; Col4: $00 ),
                             ( { } Col0: $00; Col1: $82; Col2: $6C; Col3: $10; Col4: $00 ),  // }
                             ( {~} Col0: $40; Col1: $80; Col2: $40; Col3: $20; Col4: $40 ),

                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( {€} Col0: $00; Col1: $00; Col2: $00; Col3: $00; Col4: $00 ),

                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character

                             ( {厎 }Col0: $00; Col1: $00; Col2: $00; Col3: $00; Col4: $00 ),
                             ( {唥 }Col0: $00; Col1: $00; Col2: $00; Col3: $00; Col4: $00 ),

                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character

                             ( {憓 }Col0: $00; Col1: $00; Col2: $00; Col3: $00; Col4: $00 ),
                             ( {憓 }Col0: $00; Col1: $00; Col2: $00; Col3: $00; Col4: $00 ),

                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character

                             ( {檥 }Col0: $00; Col1: $00; Col2: $00; Col3: $00; Col4: $00 ),

                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character
                             ( { } Col0: $00; Col1: $7C; Col2: $7C; Col3: $7C; Col4: $00 ), // Unsupported Character

                             ( {} Col0: $00; Col1: $00; Col2: $BE; Col3: $00; Col4: $00 ),
                             ( {}Col0: $38; Col1: $44; Col2: $FE; Col3: $44; Col4: $28 ),
                             ( {}Col0: $06; Col1: $7A; Col2: $92; Col3: $92; Col4: $42 ),
                             ( {}Col0: $44; Col1: $38; Col2: $28; Col3: $38; Col4: $44 ),
                             ( {}Col0: $D0; Col1: $30; Col2: $1E; Col3: $30; Col4: $D0 ),
                             ( {}Col0: $00; Col1: $00; Col2: $EE; Col3: $00; Col4: $00 ),
                             ( {}Col0: $52; Col1: $AA; Col2: $AA; Col3: $AA; Col4: $94 ),
                             ( {▆ }Col0: $00; Col1: $80; Col2: $00; Col3: $80; Col4: $00 ),
                             ( {﹠ }Col0: $7C; Col1: $92; Col2: $AA; Col3: $AA; Col4: $7C ),
                             ( {獇 }Col0: $00; Col1: $B4; Col2: $B4; Col3: $74; Col4: $00 ),
                             ( {珆 }Col0: $08; Col1: $14; Col2: $2A; Col3: $14; Col4: $22 ),
                             ( {瑌 }Col0: $10; Col1: $10; Col2: $10; Col3: $10; Col4: $18 ),
                             ( {瓆 }Col0: $00; Col1: $10; Col2: $10; Col3: $10; Col4: $00 ),
                             ( {畗 }Col0: $7C; Col1: $82; Col2: $BA; Col3: $A2; Col4: $7C ),
                             ( {瘆 }Col0: $80; Col1: $80; Col2: $80; Col3: $80; Col4: $80 ),
                             ( {皚 }Col0: $00; Col1: $40; Col2: $A0; Col3: $40; Col4: $00 ),
                             ( {眪 }Col0: $00; Col1: $24; Col2: $74; Col3: $24; Col4: $00 ),
                             ( {瞹 }Col0: $00; Col1: $90; Col2: $B0; Col3: $50; Col4: $00 ),
                             ( {硙 }Col0: $00; Col1: $88; Col2: $A8; Col3: $70; Col4: $00 ),
                             ( {磢 }Col0: $00; Col1: $00; Col2: $40; Col3: $80; Col4: $00 ),
                             ( {祡 }Col0: $3E; Col1: $04; Col2: $04; Col3: $38; Col4: $04 ),
                             ( {秨 }Col0: $60; Col1: $F0; Col2: $FE; Col3: $80; Col4: $FE ),
                             ( {穧 }Col0: $00; Col1: $00; Col2: $10; Col3: $00; Col4: $00 ),
                             ( {竲 }Col0: $00; Col1: $02; Col2: $0A; Col3: $04; Col4: $00 ),
                             ( {箎 }Col0: $00; Col1: $50; Col2: $F0; Col3: $10; Col4: $00 ),
                             ( {簘 }Col0: $00; Col1: $50; Col2: $B0; Col3: $50; Col4: $00 ),
                             ( {粆 }Col0: $22; Col1: $14; Col2: $2A; Col3: $14; Col4: $08 ),
                             ( {紏 }Col0: $E8; Col1: $10; Col2: $2C; Col3: $44; Col4: $9E ),
                             ( {絵 }Col0: $E8; Col1: $10; Col2: $20; Col3: $56; Col4: $8A ),
                             ( {緘 }Col0: $E8; Col1: $F0; Col2: $2C; Col3: $44; Col4: $9E ),
                             ( {縸 }Col0: $04; Col1: $02; Col2: $B2; Col3: $0A; Col4: $04 ),
                             ( {纝 }Col0: $1E; Col1: $A8; Col2: $68; Col3: $28; Col4: $1E ),
                             ( {羮 }Col0: $1E; Col1: $28; Col2: $68; Col3: $A8; Col4: $1E ),
                             ( {聖 }Col0: $1E; Col1: $68; Col2: $A8; Col3: $68; Col4: $1E ),
                             ( {脈 }Col0: $5E; Col1: $A8; Col2: $A8; Col3: $68; Col4: $9E ),
                             ( {膤 }Col0: $1E; Col1: $A8; Col2: $28; Col3: $A8; Col4: $1E ),
                             ( {舽 }Col0: $1E; Col1: $28; Col2: $A8; Col3: $28; Col4: $1E ),
                             ( {苶 }Col0: $7E; Col1: $90; Col2: $FE; Col3: $92; Col4: $92 ),
                             ( {莭 }Col0: $78; Col1: $84; Col2: $86; Col3: $84; Col4: $48 ),
                             ( {葈 }Col0: $78; Col1: $84; Col2: $86; Col3: $84; Col4: $48 ),
                             ( {蓕 }Col0: $3E; Col1: $2A; Col2: $6A; Col3: $AA; Col4: $22 ),
                             ( {蕔 }Col0: $3E; Col1: $6A; Col2: $AA; Col3: $6A; Col4: $22 ),
                             ( {藑 }Col0: $3E; Col1: $AA; Col2: $2A; Col3: $AA; Col4: $22 ),
                             ( {蘿 }Col0: $22; Col1: $A2; Col2: $7E; Col3: $22; Col4: $22 ),
                             ( {蛚 }Col0: $22; Col1: $22; Col2: $7E; Col3: $A2; Col4: $22 ),
                             ( {蝳 }Col0: $22; Col1: $62; Col2: $BE; Col3: $62; Col4: $22 ),
                             ( {蟷 }Col0: $22; Col1: $A2; Col2: $3E; Col3: $A2; Col4: $22 ),
                             ( {衹 }Col0: $10; Col1: $FE; Col2: $92; Col3: $44; Col4: $38 ),
                             ( {複 }Col0: $7E; Col1: $90; Col2: $88; Col3: $44; Col4: $BE ),
                             ( {襺 }Col0: $1C; Col1: $A2; Col2: $62; Col3: $22; Col4: $14 ),
                             ( {觹 }Col0: $1C; Col1: $22; Col2: $62; Col3: $A2; Col4: $14 ),
                             ( {詝 }Col0: $1C; Col1: $62; Col2: $A2; Col3: $62; Col4: $14 ),
                             ( {諁 }Col0: $5C; Col1: $A2; Col2: $A2; Col3: $62; Col4: $94 ),
                             ( {謢 }Col0: $1C; Col1: $A2; Col2: $22; Col3: $A2; Col4: $14 ),
                             ( {讅 }Col0: $00; Col1: $14; Col2: $08; Col3: $14; Col4: $00 ),
                             ( {貆 }Col0: $7C; Col1: $8A; Col2: $92; Col3: $A2; Col4: $7C ),
                             ( {賫 }Col0: $7C; Col1: $82; Col2: $42; Col3: $02; Col4: $7C ),
                             ( {趠 }Col0: $7C; Col1: $02; Col2: $42; Col3: $82; Col4: $7C ),
                             ( {踼 }Col0: $7C; Col1: $42; Col2: $82; Col3: $42; Col4: $7C ),
                             ( {軁 }Col0: $7C; Col1: $82; Col2: $02; Col3: $82; Col4: $7C ),
                             ( {輢 }Col0: $60; Col1: $10; Col2: $4E; Col3: $90; Col4: $60 ),
                             ( {迃 }Col0: $00; Col1: $FE; Col2: $28; Col3: $28; Col4: $10 ),
                             ( {遾 }Col0: $7E; Col1: $90; Col2: $92; Col3: $72; Col4: $0C ),
                             ( {鄛 }Col0: $04; Col1: $AA; Col2: $6A; Col3: $2A; Col4: $1E ),
                             ( {醹 }Col0: $04; Col1: $2A; Col2: $6A; Col3: $AA; Col4: $1E ),
                             ( {鈣 }Col0: $04; Col1: $6A; Col2: $AA; Col3: $6A; Col4: $1E ),
                             ( {銄 }Col0: $44; Col1: $AA; Col2: $AA; Col3: $6A; Col4: $9E ),
                             ( {鋧 }Col0: $04; Col1: $AA; Col2: $2A; Col3: $AA; Col4: $1E ),
                             ( {鍈 }Col0: $04; Col1: $2A; Col2: $AA; Col3: $2A; Col4: $1E ),
                             ( {鎪 }Col0: $04; Col1: $2A; Col2: $3E; Col3: $2A; Col4: $1A ),
                             ( {鐌 }Col0: $18; Col1: $24; Col2: $26; Col3: $24; Col4: $00 ),
                             ( {鑮 }Col0: $1C; Col1: $AA; Col2: $6A; Col3: $2A; Col4: $18 ),
                             ( {閩 }Col0: $1C; Col1: $2A; Col2: $6A; Col3: $AA; Col4: $18 ),
                             ( {陖 }Col0: $1C; Col1: $6A; Col2: $AA; Col3: $6A; Col4: $18 ),
                             ( {雧 }Col0: $1C; Col1: $AA; Col2: $2A; Col3: $AA; Col4: $18 ),
                             ( {靰 }Col0: $00; Col1: $A2; Col2: $7E; Col3: $02; Col4: $00 ),
                             ( {韢 }Col0: $00; Col1: $22; Col2: $7E; Col3: $82; Col4: $00 ),
                             ( {題 }Col0: $00; Col1: $62; Col2: $BE; Col3: $42; Col4: $00 ),
                             ( {飣 }Col0: $00; Col1: $A2; Col2: $3E; Col3: $82; Col4: $00 ),
                             ( {饈 }Col0: $0C; Col1: $B2; Col2: $52; Col3: $B2; Col4: $1C ),
                             ( {駗 }Col0: $7E; Col1: $A0; Col2: $A0; Col3: $60; Col4: $9E ),
                             ( {騷 }Col0: $1C; Col1: $A2; Col2: $62; Col3: $22; Col4: $1C ),
                             ( {髛 }Col0: $1C; Col1: $22; Col2: $62; Col3: $A2; Col4: $1C ),
                             ( {魙 }Col0: $1C; Col1: $62; Col2: $A2; Col3: $62; Col4: $1C ),
                             ( {鮹 }Col0: $5C; Col1: $A2; Col2: $A2; Col3: $62; Col4: $9C ),
                             ( {鰙 }Col0: $1C; Col1: $A2; Col2: $22; Col3: $A2; Col4: $1C ),
                             ( {鱹 }Col0: $10; Col1: $10; Col2: $54; Col3: $10; Col4: $10 ),
                             ( {鴠 }Col0: $3A; Col1: $4C; Col2: $54; Col3: $64; Col4: $B8 ),
                             ( {鶀 }Col0: $3C; Col1: $82; Col2: $42; Col3: $02; Col4: $3E ),
                             ( {鷠 }Col0: $3C; Col1: $02; Col2: $42; Col3: $82; Col4: $3E ),
                             ( {鹽 }Col0: $3C; Col1: $42; Col2: $82; Col3: $42; Col4: $3E ),
                             ( {鼄 }Col0: $3C; Col1: $82; Col2: $02; Col3: $82; Col4: $3E ),
                             ( {齷 }Col0: $22; Col1: $14; Col2: $48; Col3: $90; Col4: $20 ),
                             ( { }Col0: $00; Col1: $7E; Col2: $14; Col3: $08; Col4: $00 ),
                             ( {} Col0: $22; Col1: $94; Col2: $08; Col3: $90; Col4: $20 )
                            );

{===========================}
{== TRzLEDDisplay Methods ==}
{===========================}

26
Sep
0

判断当前网卡是物理网卡(有线网卡,无线网卡)还是虚拟网卡

MAC地址作为硬件唯一标识,在很多时候会被使用,如在软件授权方面,很多软件在产生机器码时会采用CPUID或MAC地址,或使用MAC地址来做一对一绑定。

相信很多人会碰到以下问题:

1)获取的是VMWare的网卡MAC地址

2)获取的是VPN的网卡MAC地址

VMWare或VPN软件的安装卸载都会导致获取的MAC地址变化,所以我们需要正确获取当前物理网卡的MAC地址。

下面是根据网卡实例ID判断是否为物理网卡的Delphi代码(RAD Studio 10.1版本的):

复制代码
const
NCF_VIRTUAL =$01; // 说明组件是个虚拟适配器
NCF_SOFTWARE_ENUMERATED = $02;// 说明组件是一个软件模拟的适配器
NCF_PHYSICAL = $04; // 说明组件是一个物理适配器
NCF_HIDDEN = $08; //说明组件不显示用户接口
NCF_NO_SERVICE = $10; // 说明组件没有相关的服务(设备驱动程序)
NCF_NOT_USER_REMOVABLE = $20; // 说明不能被用户删除(例如,通过控制面板或设备管理器)
NCF_MULTIPORT_INSTANCED_ADAPTER = $40; // 说明组件有多个端口,每个端 口作为单独的设备安装。

                                      //  每个 端口有自己的hw_id(组件ID) 并可被单独安装,
                                      //  这只适合于 EISA适配器

NCF_HAS_UI = $80; // 说明组件支持用户接口(例如,Advanced Page或Customer Properties Sheet)
NCF_FILTER = $400; // 说明组件是一个过滤器

function IsPhysicalAdapter(sAdapterGUID: string; bOnlyPCI: Boolean=False):Boolean;
const

NET_CARD_KEY_PATH =
'SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}';

var

Reg: TRegistry;
sList: TStrings;
vCharacteristics: DWORD;
I: Integer;

begin

Result := False;
sList:=TStringList.Create;
Reg:=TRegistry.Create;
try
  Reg.RootKey := HKEY_LOCAL_MACHINE;
  if not Reg.OpenKey(NET_CARD_KEY_PATH, False) then
    Exit;
  Reg.GetKeyNames(sList);
  Reg.CloseKey;
  if sList.Count>0 then
  for I := 0 to Pred(sList.Count) do
  if Reg.OpenKey(NET_CARD_KEY_PATH+'\'+sList.Strings[I], False) then
  begin
    try
      if sAdapterGUID.ToUpper.Trim.Equals(Reg.ReadString('NetCfgInstanceId').ToUpper.Trim) then
      begin
        vCharacteristics := DWORD(Reg.ReadInteger('Characteristics'));
        Result := (NCF_PHYSICAL and vCharacteristics) = NCF_PHYSICAL;
        Break;
      end;
    finally
      Reg.CloseKey;
    end;
  end;
finally
  Reg.Free;
  sList.Free;
end;

end;
复制代码

上面IsPhysicalAdapter的参数网卡实例ID通过GetAdaptersInfo即可得到,综合起来的具体代码如下:

注意:

调用 GetAdaptersInfo 可以直接引用下面2个单元

Winapi.IpTypes,
Winapi.IpHlpApi

复制代码
function GetMacAddress(): string;
var
dwRet: DWORD;
AI,Work : PIpAdapterInfo;
sGUID, sTmp, sLastMAC, sFirstMAC: string;
I: Integer;
uSize: ULONG;
begin
Result := '';
sLastMAC := '';
sFirstMAC := '';
uSize := SizeOf(TIpAdapterInfo);
GetMem(AI,uSize);
dwRet := GetAdaptersInfo(AI,uSize);
if (dwRet = ERROR_BUFFER_OVERFLOW)then
begin

FreeMem(AI);
GetMem(AI,uSize);
dwRet := GetAdaptersInfo(AI,uSize);

end;
try

if (dwRet <> ERROR_SUCCESS)then
  Exit;
Work := AI;
while Work<>nil do
begin
  try
    sGUID := string(AnsiString(Work.AdapterName));
    sTmp := string(AnsiString(Work.Description));
    // 名称描述出现VMWare,直接忽略
    if Pos('VMWare', sTmp)>0 then
      Continue;
    // 配置的ID地址不正常,忽略
    if Work.AddressLength=0 then
      Continue;

    // 将网卡MAC地址转成字符串
    sLastMAC := '';
    for I:=0 to Work.AddressLength-1 do
    begin
      sLastMAC := sLastMAC + Format('%.2x', [Work.Address[I]]);
    end;

    if sFirstMAC='' then
      sFirstMAC := sLastMAC;

    // 不是物理网卡,忽略
    if not IsPhysicalAdapter(sGUID) then
      Continue;

    Result := sLastMAC;

    //找到第一个物理网卡后退出
    Break;
  finally
    Work := Work.Next;
  end;
end;
// 找不到物理网卡MAC,返回第一个即可
if Result='' then
  Result := sFirstMAC;

finally

FreeMem(AI);

end;
end;
复制代码

理论上从软件层面是无法直接判断一个网络适配器硬件到底是有线还是无线的,因为不管是miniPCIE还是普通PCI接口的网卡,都可以是有线也可以是无线,

但是也有以下的方法判断:

1)网卡可以通过名称描述上判断:一般有线网卡名称上带PCI,无线带WLAN 或Wireless,此方法不依赖于网络是否连接,但对那些自定义驱动名称的高人当然无效

2)获取网络配置信息,也就是获取网络连接里的整个列表,包含物理网卡和宽带连接,VPN等各种连接设备信息,再查看连接类型,根据MSDN的说明,类型包含ETHERNET/PPP/IEEE80211等等,甚至包含移动手机卡的类型。
3)获取网络速率,和2)一样也是获取网络连接的配置信息,100/10Mbps一般是有线,54Mbps或其他一般为WLAN连接,虽说WLAN并不包含一个最高的速度标准,但是普通2.4G或5G的WIFI速度也快不到哪去。

注:

方法 2)和3)中的网络类型和网络速率均是通过 API GetIfEntry配合GetAdaptersInfo 获取(或直接通过 GetIfTable获取)网络配置信息得到的,代码MSDN也有

具体查看MSDN中对此函数返回的结构体MIB_IFROW字段dwType和dwSpeed的说明,除了类型速率,也包含其他非常多的信息。

26
Sep
0

Delphi常用类型及定义单元

Type Unit
Date SysUtils
DeleteFile SysUtils or Windows (different versions)
DispatchInvokeError ComObj
DWORD Windows
EDatabaseError DB
EncodeDateTime DateUtils
_Stream ADODB_TLB
akTop, akLeft, akRight, akBottom Controls
Application (the variable not a type) Forms
Beep SysUtils or Windows (different functions)
CGID_EXPLORER ShlObj
CN_BASE Controls
CoInitialize ActiveX
CopyFile Windows
CoUnInitialize ActiveX
CreateComObject ComObj
CreateOleObject ComObj
EnumWindows Windows
EOleError ComObj
EOleException ComObj
EOleSysError ComObj
Exception SysUtils
ExtractFileName SysUtils
FileExists SysUtils
FileOpen SysUtils
FILETIME Windows
FindFirst SysUtils
FindFirstFile Windows
FindWindow Windows
FlushFileBuffers Windows
fmOpenRead SysUtils
fmShareDenyWrite SysUtils
Format SysUtils
FormatDateTime SysUtils
FreeAndNil SysUtils
fsBold Graphics
ftWideString DB
ftString DB
GetCurrentProcessId Windows
GetEnvironmentVariable SysUtils or Windows (different versions)
GetFileAttributes Windows
GetFileVersionInfoSize Windows
GetWindowLong Windows
GetStdHandle Windows
HDC Windows
HFont Windows
HINTERNET WinInet
HKEY_CURRENT_USER Windows
IHTMLDocument2 MSHTML or MSHTML_TLB
IHTMLElement MSHTML or MSHTML_TLB
IHTMLEventObj MSHTML or MSHTML_TLB
IID_IWebBrowser2 SHDocVw or SHDocVw_TLB
IMessage CDO_TLB
InternetClosehandle WinInet
InternetOpenUrl WinInet
InternetReadFile WinInet
IntToHex SysUtils
IntToStr SysUtils
IOleCommandTarget ActiveX
IOleContainer ActiveX
IPersistStreamInit ActiveX
IsSameDay DateUtils
IStream ActiveX
IWebBrowser2 SHDocVw or SHDocVw_TLB
LockWindowUpdate Windows
Log10 Math
LowerCase SysUtils
LPSTR Windows
MAX_PATH Windows
MessageBox Windows
MessageDlg Dialogs
MB_YESNO, MB_OK etc Windows
MinutesBetween DateUtils
Now SysUtils
OleInitialize ActiveX
OleUninitialize ActiveX
PItemIDList ShlObj
POleCmd ActiveX
POleCmdText ActiveX
PostMessage Windows
PosX StrUtils
QueryHighPerformanceCounter Windows
QueryPerformanceCounter Windows
ReverseString StrUtils
RoundTo Math
SendMessage Windows
SetForegroundWindow Windows
ShellExecute ShellAPI
ShellExecuteEx ShellAPI
SHGetFileInfo ShellAPI
SHFILEINFO ShellAPI
ShowMessage Dialogs
Sleep SysUtils
StrAlloc SysUtils
StrPas SysUtils
StrToDate SysUtils
StrToInt SysUtils
StrToIntDef SysUtils
TAdoConnection ADODB
TAdoQuery ADODB
TAlign Controls
TAlignment Classes
TAnchors Controls
TBitmap Graphics
TBlobStream DBTables
TCanvas Graphics
TClientSocket ScktComp
TComboBox StdCtrls
TComponent Classes
TControl Controls or QControls
TCriticalSection SyncObjs
TField DB
TFieldType DB
TFileName SysUtils
TFileStream Classes
TForm Forms
TFrame Forms
TGroupBox StdCtrls
TIID ActiveX
TIniFile IniFiles
TJPEGImage Jpeg
TLabel StdCtrls
TList Classes
TMemo StdCtrls
TMemoryStream Classes
TMouseButton Controls
TNofityEvent Classes
TObjectList Contnrs
TOSVersionInfo Windows
TPanel ExtCtrls
TPoint Types
TProcessEntry32 TlHelp32
TProgressBar ComCtrls or QComCtrls
TRadioButton StdCtrls
TRadioGroup ExtCtrls
TRect Types
TRegistry Registry
Trim SysUtils
TRoundToRange Math
TSearchRec SysUtils
TSize Windows
TSocketAddrIn Winsock
TStaticText StdCtrls
TStream Classes
TStringList Classes
TStrings Classes
TStringStream Classes
TSystemTime Windows
TTable DBTables
TTabSheet ComCtrls
TThread Classes
TTreeNode ComCtrls
TWebBrowser SHDocVw or SHDocVw_TLB
TWinSocketStream ScktComp
TWMCommand Messages
Unassigned Variants
VarArrayCreate Variants
VarArrayOf Variants
VirtualProtect Windows
WM_USER Messages
YearOf DateUtils
DaysInAMonth DateUtils

29
Dec
0

impala安装使用

pip install six
pip install bit_array
pip install thriftpy
pip install sasl-0.2.1-cp36-cp36m-win32.whl
pip install thrift_sasl
pip install bitarray-0.8.3-cp36-cp36m-win32.whl
pip install impyla
pip install pandas

测试代码
from impala.dbapi import connect
from impala.util import as_pandas
conn = connect(host='10.86.45.40', port=21050)
cur = conn.cursor()

cur.execute('SHOW TABLES')

data = as_pandas(cur)

print(data)

cur.execute('SELECT * FROM geelylogdatawarehouse limit 10')

cur.execute('SELECT row_number() over (order by appid) as rnum, * FROM geelylogdatawarehouse where ymd = 20171230 order by appid limit 10 offset 1000000')

cur.execute('SELECT count(*) FROM geelylogdatawarehouse where ymd = 20171230')

data = cur.fetchall()`

print(data)

description = cur.description

print(description)

for row in cur:

print(row[4])

data = as_pandas(cur)
print(data)

报错:
thriftpy.parser.exc.ThriftParserError: ThriftPy does not support generating module with path in protocol 'c'
解决:
根据提示找到parser.py文件 488行 if url_scheme == '': 修改为 if len(url_scheme) <= 1:

    1. whl文件需要到https://www.lfd.uci.edu/~gohlke/pythonlibs/下载
      或者使用附件里的版本
    2. centos下:sudo yum install gcc-c++ python-devel.x86_64 cyrus-sasl-devel.x86_64 然后pip install sasl
    3. 如果直接安装impyla则会报Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
      C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

whl.rar

11
Dec
0

kafka测试单元

package TestKafka;

import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.TopicPartition;

import java.util.Arrays;
import java.util.List;
import java.util.Properties;

public class TestProducer {

public static void runProducer(int i) {
    Properties props = new Properties();
    props.put("bootstrap.servers", "10.190.35.131:9092");
    props.put("acks", "all");
    props.put("retries ", 1);
    props.put("buffer.memory", 33554432);
    props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
    props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");

    Producer<String, String> producer = new KafkaProducer<String, String>(props);
    producer.send(new ProducerRecord<String, String>("test", Integer.toString(i), Integer.toString(i) + "!!"));
    producer.close();
}

public static void runConsumer() {
    KafkaConsumer<String, String> consumer;

    Properties props = new Properties();
    props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "10.190.35.131:9092");  //10.190.35.131:9092   10.86.45.40:9092
    props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest"); //"earliest" else "latest"
    props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true");
    props.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, "1000");
    props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
    props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.StringDeserializer");
    props.put(ConsumerConfig.GROUP_ID_CONFIG, "consumer_group_test");

    consumer = new KafkaConsumer(props);

    consumer.subscribe(Arrays.asList("test"));  // log.sweet.request.trace.production
    try {
        while (true) {
            ConsumerRecords<String, String> records = consumer.poll(100); //Long.MAX_VALUE
            for (TopicPartition partition : records.partitions()) {
                List<ConsumerRecord<String, String>> partitionRecords = records.records(partition);
                for (ConsumerRecord<String, String> record : partitionRecords) {
                    System.out.printf("offset = %d, key = %s, value = %s", record.offset(), record.key(), record.value());
                    System.out.println("");
                }
            }
            consumer.commitSync();
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        consumer.close();
    }
}

public static void main(String[] args) throws Exception {
    Thread thread = new Thread() {
        public void run() {
            int i = 0;
            while (true) {
                i++;
                runProducer(i);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    };
    thread.start();

    runConsumer();

// String s = String.format("this is number : %10.2f", 50.1);
// System.out.println(s);

}

}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"

     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.geely.storm.test.producer</groupId>
<artifactId>TestProducer</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
    <kafka.client.version>0.10.0.0</kafka.client.version>
</properties>
<dependencies>
    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>${kafka.client.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-streams</artifactId>
        <version>${kafka.client.version}</version>
    </dependency>
</dependencies>

</project>