显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

NDEB Exam Busters

加拿大面对面及远程考牌辅导

 
 
 
 
 
 
 
 

海外 加拿大 狮子座

 发消息  写留言

 
NDEB, NBDE, Part1, Part2, 移民, 考试 资料库 真题 AFK, National Board Dental Exam, Foreign Trained, 下载, Download, 美国 加拿大 行医资格考试
 
近期心愿__... ...__ .__. ._ .__. ._
人生格言中国交通很行 中国农业很行 中国工商很行 中国建设很行 中国人民很行 中国很行
博客等级加载中...
今日访问加载中...
总访问量加载中...
最后登录加载中...
 
 
 
 
 
 
 

[置顶] 窝洞分类 - G.V.Black Cavity classification 分类

2010-3-13 18:15:18 阅读2693 评论0 132010/03 Mar13

G.V.Black分类

龋洞分类 - G.V.Black Cavity classification 分类 - godsonx - godsonx的博客

 

 

 考题:

哪些洞型可以出现在任何牙上?

 

答案:   Class I, Class V & Class VI   一类, 五类和六类洞

 

 

Cavity classification standardized methods of recording the need for restoration exist to facilitate communication among clinicians, researchers, and dental educators. The most commonly accepted means of classifying cavities is by the names of the surfaces involved. Cavity type is classified further based on the type of treatment and anatomical area involved. This classification, developed by Dr. G. V. Black in 1908, is designated by Roman numerals as Class I, Class II, Class III, Class IV, Class V, and Class VI (this is the only category that has been added to his original classification system). Note: It is important to remember that the classification relates to location and not size of the cavity.

#  Class I cavities -> involve the pits and fissures, while all other classifications involve smooth surfaces
of the teeth.
      #  Class II cavities -> involve the proximal surfaces and occlusal surfaces of premolars and molars.
      #  Class III cavities -> involve the proximal surfaces of incisors and canines that do not involve the
incisal angle.
      #  Class IV cavities -> are located on the proximal surface of incisors and canines and do involve
the incisal angle.
      #  Class V cavities -> are on the facial or lingual surface of ail teeth and do not involve a pit or fissure.
      #  Class VI cavities -> are on the incisal edges of anterior teeth or on the occlusal cusp heights of
posterior teeth.

** Remember: The best method for definitive detection of incipient carious lesions on the interproximal surfaces of posterior teeth (distal surface of canines through molars) is by bite-wing radiographs. 

 

 

 

I 类洞:为发生于所有牙齿的发育窝、沟内的龋损所制备的洞形。包括磨牙[牙合]面窝沟洞,磨牙颊(舌)面的颊(舌)沟洞,前磨牙的[牙合]面窝沟洞,上前牙的腭面窝洞。

II 类洞:为发生于后牙邻面的龋损所制备的洞形。包括前磨牙的邻面洞、邻[牙合]面洞和邻颊(舌)面洞,磨牙的邻[牙合]面洞和邻颊(舌)面洞及邻面洞。

III类洞:为发生于前牙邻面未损及切角的龋损所制备的洞形。包括切牙、尖牙的邻面洞、邻腭(舌)面洞、邻唇面洞。

IV类洞:为发生于前牙邻面并损及切角的龋损所制备的洞形。包括切牙、尖牙的邻唇腭(舌)面洞,目前含义延伸及牙外伤引起切角缺损的洞。

V类洞:为发生与所有牙齿的颊(唇)、舌(腭)面近龈1/3牙面的龋损所制备的洞形。包括前牙、前磨牙、磨牙在颊或舌面的近龈1/3洞。

 

窝洞定义、结构、各部名称、代表符号

(1)窝洞定义:牙齿龋洞去净龋坏组织,经手术制备的具有特定形状的洞。要求填入充填材料后,充填材料及牙齿均能承担正常咀嚼

压力,不折断、不脱落。

(2)窝洞结构:窝洞由洞壁、洞角及洞缘角构成。


    1)洞壁:组成窝洞的内面统称为壁。按其所在牙面部位命名如近中壁、远中壁、颊壁、舌壁、龈壁、髓壁、轴壁等。

    2)洞角:两个洞壁相交构成的角称为线角(Line angles),三个洞壁相交形成的角称为点角(Point angles)。线角及点角的命名

均以构成他们的各洞壁名称联合命名,如颊轴线角、轴髓线角、颊龈轴点角、舌龈轴点角等。

    3)洞缘角(Cavosurface Margin):洞侧壁与牙齿表面的相交线称为洞缘角,也称为洞面角。


(3)窝洞的名称及符号

    1)窝洞的名称:可根据窝洞所在的牙面命名,如牙合面洞、近中洞、近中牙合面洞等;也可以窝洞所包括牙面数命名,如单面

洞、复面洞等。

    2)窝洞的符号:以所在牙面英文名称的第一个字母或前两个字母作为符号,具体如下:

    切端为I(incisive S.)颊侧为B(buccal S.)

    舌侧为L(lingual S.)牙合面为O(occlusal S.)

    唇侧为La(labial S.)近中面为M(medial S.),远中面为D(distal S.)等。


=======================================================================================

Tooth Preparation Walls
---------------------------
Internal Wall. An internal wall is a prepared (cut) surface that does not extend to the external tooth
surface (Fig. 6-10).

Axial Wall. An axial wall is an internal wall parallel
with the long axis of the tooth (see Fig. 6-10).

Pulpal Wall. A pulpal wall is an internal wall that
is perpendicular to the long axis of the tooth and
occlusal of the pulp (see Figs. 6-10 and 6-13 [p]).

External Wall. An external wall is a prepared (cut)
surface that extends to the external tooth surface. Such
a wall takes the name of the tooth surface (or aspect)
that the wall is toward (see Fig. 6-10).

Floor (or Seat). A floor (or seat) is a prepared (cut) wall that is reasonably flat and perpendicular to the
occlusal forces that are directed occlusogingivally (generally parallel to the long axis of the tooth).
Examples are the pulpal and gingival walls (see Fig. 6-10).
Such floors may be purposefully prepared to provide
stabilizing seats for the restoration, distributing the
stresses in the tooth structure, rather than concentrating
them. This preparation increases the resistance form (see
later) of the restored tooth against postrestorative fracture.
More regarding this type of resistance form is
presented in a later section.

Enamel Wall. The enamel wall is that portion of
a prepared external wall consisting of enamel (see
Fig. 6-2D).

Dentinal Wall. The dentinal wall is that portion of
a prepared external wall consisting of dentin, in which
mechanical retention features may be located (see
Fig. 6-2D).


龋洞分类 - G.V.Black Cavity classification 分类 - godsonx - NDEB Board Busters
 
龋洞分类 - G.V.Black Cavity classification 分类 - godsonx - NDEB Board Busters
 
龋洞分类 - G.V.Black Cavity classification 分类 - godsonx - NDEB Board Busters



==================================================================================================



洞形设计
--------------

外形设计

窝洞外形的范围应包括所有病变组织和可疑的点隙裂沟,外形应作预防性扩展,邻面侧壁应扩展到接触点以外的自洁区,龈壁应置于平齐眼乳突边缘健康的牙休组织上。窝洞外形线应为圆缓曲线,以减少应力集中。



抗力形设计
-----------
抗力形是使充填体和余留牙能够承受咬合力而不会破裂的特定形状。Ⅰ、Ⅱ类洞对抗力形要求较高,V类洞要求可稍低。
1、洞形深度:窝洞底必须建立在牙本质上,后牙洞深应达釉牙本质界下0.2---0.5mm,前牙应达釉牙本质界的牙本质面。
2、盒状洞形:窝洞应制备成盒状,即除特殊情况外,要洞底平,侧壁平直与洞底相垂直,各侧壁之间相互平行。洞底各点线角应明确而圆钝,使应力不集中,要力均匀分布。
3、梯阶形成:复面洞的洞底应形成梯阶以均匀分担咬合力,其中龈壁与髓壁平行,轴壁与近、远中侧壁平行,各壁交接呈直角,点、线角圆钝。注意龈壁一定要与轴壁垂直,切勿形成向龈方的斜面。
4、无基釉、脆弱牙体处理:窝洞釉质壁应与釉柱排列方向平行,洞口不能留有无基釉;对脆弱的牙尖牙嵴,应适当降低高度,减轻要力负担。



固位形设计
-----------
固位形是使充填体能保留于洞内,承受更力后不移位、不脱落的特定形状。当充填材料与牙体组织无粘结力时,充填体的固位主要靠密合的摩擦力和一定的机械样合力。
1、侧壁固位:相互平行且具有一定深度的侧壁,可使充填体通过和洞壁的密合摩擦而达固位目的。
2、倒凹固位:单面洞可以在牙尖下制备倒凹增强固位,制备倒凹时要防止伤及髓角,因此洞底深度超过釉牙本质界0.5mm以上,应先垫底再制倒凹,较深的洞可以不制倒凹,使用粘结性强的修复材料时也可不制倒凹。
3、 鸠尾固位:鸠尾固位用于复面洞的固位,它借助鸠尾峡部的锁扣作用,防止充填体水平方向的脱出。鸠尾峡必须有一定的深度和宽度,宽度在后牙一般为颊舌牙尖间距的1/3。位置应在洞底轴髓线角的靠中线侧。鸠尾的宽度必须大于鸠尾峡。
4、 梯形固位:也是复面洞采用的固位形,邻雯面洞的邻面设计为龈方大于雯方的梯形,防止充填体呈垂直方向脱出。梯形的外形应作预防性扩展,梯形深度应达釉牙本质界下0.2一0.5mm。




便利形设计
-------------
在维护外形的基础上,在需要的地方略加修整,便于器械和充填物能够达到窝洞的任何部位。要达此目的,可选用适当器械,对洞形作适当延伸;当洞外形位于不健康牙龈处时,可用分离器或木楔分离牙龈,必要时切除部分牙龈。





-----------------------------------------------------

预备步骤

窝洞预备的基本步骤
1、开扩洞口或寻人口:病变部位较隐蔽的龋洞,应首先开扩洞口或寻人口,使龋洞充分暴露或为手术操作形成通路,便于观察和进行操作。可用裂钻或球钻去除洞缘的无基釉质,依病变范围开扩,或用裂钻从龋洞一侧作沟,以形成手术通路。
2、去除腐质:病变范围较大时,应先去除腐质。可先用挖匙除去洞内食物残渣和大部分腐质,然后用球钻将洞缘周围腐质除尽,最后除尽洞底腐质。洞底近髓腔处的少量软化牙本质的去留,应视实际情况而定。
3、设计并制备洞形:窝洞的洞缘线构成窝洞外形。虽然各类窝洞都有基本的外形要求,但洞形的制备还应兼顾病变破坏的范围。腐质除尽后,应依病变范围设计窝洞外形。窝洞应包括所有的病变部位,其颊(唇)、舌壁应达自洁区。窝洞的形态应符合固位形和抗力形的基本原则。制备过程中不可过多磨除健康的牙体组织。
4、修整洞形、清洗窝洞:完成洞形制备后,应去除洞内牙本质碎屑,仔细检查窝洞各部是否腐质已除尽,抗力形、固位形是否符合要求。不符合要求时应进一步去除腐质、修改洞形至达到要求。最后修整洞缘釉质,使与釉柱排列方向一致,并彻底清洗窝洞,除去所有碎屑。
5、窝洞消毒:窝洞预备后洞内牙本质小管中不可避免地会有少量细菌残留,理想的消毒药物,既可杀灭小管中的细菌,又不致损伤牙髓,对窝洞的消毒无疑有益。但目前所用的消毒药物尚不能达到上述要求。因此,除尽腐质远比消毒窝洞重要。除尽腐质即可除去绝大部分细菌,即使有少量细菌残留,由于充填修复后的环境不利细菌生长,经一定时间后也会逐渐丧失活动能力或死亡。
I类洞的制备
I类洞多为单面洞,但当龋损波及颊、舌侧面时,应制成复面洞。单面洞应底平、壁直,窝洞深度达釉牙本质界处。较深的龋损不必要求窝洞底平整,在去尽腐质后可借助垫底形成平底。复面洞时,颊面或舌面窝洞的龈壁应与牙长轴垂直,其近远中和颊舌宽度均不小于1.5mm。近、远中壁相互平行并垂直于龈壁,轴壁与龈壁垂直。要面鸠尾固位形的洞形要求同单面洞。鸠尾峡的宽度不小于1.5mm,用高速气涡轮牙钻(裂钻)沿颊沟或舌沟向更面中央窝沟或远中窝沟扩展形成鸠尾形。洞底髓壁与轴壁垂直,形成梯阶。
Ⅱ类洞的制备
Ⅱ类洞依病变破坏范围可制备单面洞或复面洞。当病变已累及接触区时,应制备复面洞;若病变未累及接触区,为避免过多磨除健康的牙齿组织,可从邻面制备单面洞;如果从邻面操作极为困难,也可制成复面洞,从更面进行操作。Ⅱ类洞多数情况下需制备成复面洞。
邻面部分制备:用裂钻从舌面边缘蜻处开扩洞口,钻轴与更面垂直,洞口的大小与邻面破坏范围一致。将邻面洞制备成盒状洞形,龈壁与轴壁垂直,宽度不超过2mm。颊舌壁位于自洁区并在要方略靠拢,使龈方颊舌壁间距略大于雯方。
Ⅲ类洞的制备
视病变范围的大小和邻面的存在与否可备成单面洞或复面洞。
1、单面洞的制备:病变范围较小,龋洞的颊、舌壁有一定厚度且同时伴有龋损侧邻牙缺失,可制备单面洞。
1.1 用倒锥钻从邻面去除龋损腐质。
1.2 按单面洞制备方法将窝洞制备成与患牙邻面外形相一致的三角形,洞底与牙面形态一致呈凸形,深度达釉牙本质界即可。
1.3 可在唇轴舌点角处制作倒凹,倒凹位于釉牙本质界下约0.5毫米处的牙本质中。
2、复面洞的制备:若前牙邻面龋损破坏范围大,或龋损侧邻牙存在,无备洞操作空间,须制备复面洞。
2.1 视龋损破坏范围及方向确定从舌侧或唇侧扩大洞口,如唇侧未遭破坏则尽量从舌侧人口。
2.2 用裂钻从舌面边缘峰处开扩洞口,洞口的切龈向宽度应与邻面破坏范围一致。邻面洞形与单面洞相同。
2.3 用裂钻从邻面约lmm深处向舌侧窝扩展形成鸠尾形,裂钻的长轴应与舌面垂直。舌面窝洞的洞形与I类洞相同。鸠尾一般不过中线,其切龈宽度约为2.5mm。切牙的鸠尾应不损伤切嵴、对侧的边缘嵴和舌隆突;由于切牙的唇舌径较小,制作鸠尾固位形时,不可加深窝洞,以免降低牙齿的抗力和意外穿髓。舌面洞底(髓壁)与邻面洞底(轴壁)互相垂直并形成梯阶。
IV类洞的制备
因受银汞合金充填材料性能所限,目前一般不用银汞合金修复IV类洞而改用复合树脂类修复材料。
V类洞的制备
1、用小号倒锥钻从唇、颊侧备洞,钻针应垂直于牙面,深度约达釉牙本质界处的牙本质中。
2、洞外形呈肾形,洞底呈凸面,与牙面平行。
3、龈壁与洞底垂直,可在轴龈线角或轴妥线角处作倒凹以增进固位。

作者  | 2010-3-13 18:15:18 | 阅读(2693) |评论(0) | 阅读全文>>

http://www.edaboard.com/thread273835.html


A solution: PL2303 Error Code 10 and how to solve it on Win7 64-bit

I thought it worth pasting here, since possibly many people use USB-Serial converters. I have several different types, and the PL2303 ones don't work on Win7 64-bit. Maybe they are not "genuine" PL2303 chips inside. Mine were purchased from Maplin UK.

Anyway, the root of the problem is that the most recent drivers are incompatible with some of the PL2303 USB Serial converters, and the older (working) driver cannot be found on official sites (maybe to encourage people to purchase new USB to Serial interfaces).

First step is to uninstall from Device Manager if you have already plugged in the device. The drivers that you need can be found via google; search for a file called
PL2303_Prolific_GPS_AllInOne_1013.exe (file size was 3,052,939 bytes).
Once found, double-click to install. After installing, the PL2303 USB Serial converter _may_ work on Windows 7.

If you still get an error marker against the device in Device Manager (and possibly an Error code 10 if you look at the properties of the device) then the problem is, that Windows is still loading the incorrect driver.

The trick to getting it to operate is a little convoluted but it works:
Firstly, confirm the symptom by looking at the Driver settings in the Device Manager. If the Driver Version is higher than 3.3.2.105, then Windows is picking up a more recent driver.
To solve this, you need the help of a text editor that can "Find in Files". An example is UltraEdit. Use the editor (or an alternate method) to search for all *.inf files in C:\Windows\inf that have the following text inside them "Prolific USB-to-Serial". My search found two files; one was called oem42.inf and the other was called oem43.inf. The numbers will vary.
Inspect the files in a text editor. In my case, the oem42.inf file was the culprit; it contained this text on around line 12: DriverVer=11/12/2012,3.4.42.258The oem43.inf was the result of installing the 
PL2303_Prolific_GPS_AllInOne_1013.exe software, and it had this correct text:
DriverVer=10/27/2008,3.3.2.105
So, I needed to disable the oem42.inf file because it refers to the more recent driver that doesn't work. The easiest way to disable it is to change the filename from oem42.inf to oem42_inf_backup (without the .inf suffix).
After that, plug in the USB Serial converter, and the correct .inf file will be used to install the driver. Success.


http://www.edaboard.com/thread273835.html

作者  | 2015-3-31 1:31:53 | 阅读(6) |评论(0) | 阅读全文>>

运算符 : 移位运算符 << , >>

2015-3-24 5:41:55 阅读19 评论0 242015/03 Mar24

 <<
左移运算符 (<<) 将第一个操作数向左移动第二个操作数指定的位数。第二个操作数的类型必须是 int
备注:
如果第一个操作数是 int  uint32 位数),则移位数由第二个操作数的低 5 位给出。
如果第一个操作数是 long  u ong64 位数),则移位数由第二个操作数的低 6 位给出。
第一个操作数的高序位被放弃,低序空位用 0 填充。移位操作从不导致溢出。
用户定义的类型可重载 << 运算符(请参见 operator);第一个操作数的类型必须为用户定义的类型,第二个操作数的类型必须为 int。重载二元运算符时,也会隐式重载相应的赋值运算符(如果有)。

位左移运算将整个数按位左移若干位,左移后空出的部分0。比如:8位的byte型变量 
byte a=0x65(即二进制的01100101),将其左移3位:a<<3的结果是0x27(即二进制的00101000)。 


 >>
右移运算符 (>>) 将第一个操作数向右移动第二个操作数所指定的位数。
备注:
如果第一个操作数为 int  uint32 位数),则移位数由第二个操作数的低五位给出(第二个操作数 & 0x1f)。
如果第一个操作数为 long  ulong64 位数),则移位数由第二个操作数的低六位给出(第二个操作数 & 0x3f)。
如果第一个操作数为 int  long,则右移位是算术移位(高序空位设置为符号位)。如果第一个操作数为 uint  ulong 类型,则右移位是逻辑移位(高位填充 0)。
用户定义的类型可重载 >> 运算符;第一个操作数的类型必须为用户定义的类型,第二个操作数的类型必须为 int。有关更多信息,请参见 operator。重载二元运算符时,也会隐式重载相应的赋值运算符(如果有)。



位右移运算将整个数按位右移若干位,右移后空出的部分填0。比如:8位的byte型变量 
Byte a=0x65(既(二进制的01100101))将其右移3位:a>>3的结果是0x0c(二进制00001100)。 
在进行位与、或、异或运算时,如果两个运算对象的类型一致,则运算结果的类型就是运算对象的类型。比如对两个int变量a和b做与运算,运算结果的类型还是int型。如果两个运算 
对象的类型不一致,则C#要对不一致的类型进行类型转换,变成一致的类型,然后进行运算。
类型转换的规则同算术运算中整型量的转换则一致。 
位运算符连接整型量而成的表达式就是位运算表达式。

https://msdn.microsoft.com/zh-cn/library/aa691377(v=vs.71).aspx

<< 和 >> 运算符用于执行移位运算。

shift-expression:(移位表达式:)
additive-expression(加法表达式)
shift-expression   <<   additive-expression(移位表达式   <<   加法表达式)
shift-expression   >>   additive-expression(移位表达式   >>   加法表达式)

对于 x << count 或 >> count 形式的运算,应用二元运算符重载决策(第 7.2.4 节)以选择特定的运算符实现。操作数转换为所选运算符的参数类型,结果的类型是该运算符的返回类型。

当声明重载移位运算符时,第一个操作数的类型必须总是包含运算符声明的类或结构,并且第二个操作数的类型必须总是 int

下面列出了预定义的移位运算符。

  • 左移位:
    int operator <<(int x, int count); uint operator <<(uint x, int count); long operator <<(long x, int count); ulong operator <<(ulong x, int count); 

<< 运算符将 x 向左位移若干个位,具体计算方法如下所述。

放弃 x 中经移位后会超出结果类型范围的那些高序位,将其余的位向左位移,将空出来的低序位均设置为零。

  • 右移位:
    int operator >>(int x, int count); uint operator >>(uint x, int count); long operator >>(long x, int count); ulong operator >>(ulong x, int count); 

>> 运算符将 x 向右位移若干个位,具体计算方法如下所述。

当 x 为 int 或 long 类型时,放弃 x 的低序位,将剩余的位向右位移,如果 x 非负,则将高序空位位置设置为零,如果 x 为负,则将其设置为 1。

当 x 为 uint 或 ulong 类型时,放弃 x 的低序位,将剩余的位向右位移,并将高序空位位置设置为零。

对于预定义运算符,位移的位数按下面这样计算:

  • 当 x 的类型为 int 或 uint 时,位移计数由 count 的低序的 5 位给出。换言之,位移计数由 count & 0x1F 计算出。
  • 当 x 的类型为 long 或 ulong 时,位移计数由 count 的低序的 6 位给出。换言之,位移计数由 count & 0x3F 计算出。

如果计算位移计数的结果为零,则移位运算符只返回 x 的值。

移位运算从不会导致溢出,并且在 checked 和 unchecked 上下文中产生的结果相同。

当 >> 运算符的左操作数为有符号的整型时,该运算符执行算术右移位,在此过程中,操作数的最有效位(符号位)的值扩展到高序空位位置。当>> 运算符的左操作数为无符号的整型时,该运算符执行逻辑右移位,在此过程中,高序空位位置总是设置为零。若要执行与由操作数类型确定的不同的移位运算,可以使用显式强制转换。例如,如果 x 是 int 类型的变量,则 unchecked((int)((uint)x >> y)) 运算执行 x 的逻辑右移位。

https://msdn.microsoft.com/zh-cn/library/aa691377(v=vs.71).aspx




http://blog.csdn.net/huwei2003/article/details/9114541

C#移位运算(左移和右移) 
 


  C#是用<<(左移) 和 >>(右移) 运算符是用来执行移位运算。

  左移 (<<)

  将第一个操作数向左移动第二个操作数指定的位数,空出的位置补0。
  左移相当于乘. 左移一位相当于乘2;左移两位相当于乘4;左移三位相当于乘8。

  x<<1= x*2 
  x<<2= x*4 
  x<<3= x*8 
  x<<4= x*16

  同理, 右移即相反:

  右移 (>>) 
  将第一个操作数向右移动第二个操作数所指定的位数,空出的位置补0。

  右移相当于整除. 右移一位相当于除以2;右移两位相当于除以4;右移三位相当于除以8。

  x>>1= x/2 
  x>>2= x/4 
  x>>3= x/8 
  x>>4=x/16


 int i = 7;
 int j = 2;
 Console.WriteLine(i >> j);   //输出结果为1


  当声明重载C#移位运算符时,第一个操作数的类型必须总是包含运算符声明的类或结构,并且第二个操作数的类型必须总是 int,如:

class Program    
{        
 static void Main(string[] args)        
 {            
  ShiftClass shift1 = new ShiftClass(5, 10);            
  ShiftClass shift2 = shift1 << 2;            
  ShiftClass shift3 = shift1 >> 2;            
  Console.WriteLine("{0} << 2 结果是:{1}", shift1.valA,  shift2.valA);            
  Console.WriteLine("{0} << 2 结果是:{1}", shift1.valB,shift2.valB);            
  Console.WriteLine("{0} >> 2 结果是:{1}", shift1.valA,  shift3.valA);            
  Console.WriteLine("{0} >> 2 结果是:{1}", shift1.valB, shift3.valB);            
  Console.ReadLine();        
 }        
 public class ShiftClass        
 {           
  public int valA;           
  public int valB;            
  public ShiftClass(int valA, int valB)            
  {                
   this.valA = valA;                
   this.valB = valB;            
  }            
  public static ShiftClass operator <<(ShiftClass shift, int count)            
  {                
   int a = shift.valA << count;                
   int b = shift.valB << count;                
   return new ShiftClass(a, b);            
  }            
  public static ShiftClass operator >>(ShiftClass shift, int count)            
  {                
   int a = shift.valA >> count;                
   int b = shift.valB >> count;                
   return new ShiftClass(a, b);            
  }        
 }    
}

因为位移比乘除速度快.对效率要求高,而且满足2的幂次方的乘除运方,可以采用位移的方式进行。

http://blog.csdn.net/huwei2003/article/details/9114541

作者  | 2015-3-24 5:41:55 | 阅读(19) |评论(0) | 阅读全文>>

Endianness 端序,尾序

2015-3-19 9:26:22 阅读17 评论0 192015/03 Mar19

字节顺序,又称端序尾序英语Endianness)。在计算机科学领域中,是跨越多字节的程序对象的存储规则。


在几乎所有的机器上,多字节对象都被存储为连续的字节序列。例如在C语言中,一个类型为int的变量x地址为0x100,那么其对应地址表达式&x的值为0x100。且x的四个字节将被存储在存储器0x100, 0x101, 0x102, 0x103位置。[1]

而存储地址内的排列则有两个通用规则。一个多位的整数将按照其存储地址的最低或最高字节排列。如果最低有效字节最高有效字节的前面,则称小端序;反之则称大端序。在网络应用中,字节序是一个必须被考虑的因素,因为不同机器类型可能采用不同标准的字节序,所以均按照网络标准转化。

例如假设上述变量x类型为int,位于地址0x100处,它的十六进制为0x01234567,地址范围为0x100~0x103字节,其内部排列顺序依赖于机器的类型。大端法从首位开始将是:0x100: 01, 0x101: 23,..。而小端法将是:0x100: 67, 0x101: 45,..



endian”一词来源于乔纳森·斯威夫特的小说格列佛游记。小说中,小人国为水煮蛋该从大的一端(Big-End)剥开还是小的一端(Little-End)剥开而争论,争论的双方分别被称为“大端派”和“小端派”。以下是1726年关于大小端之争历史的描述:

“我下面要告诉你的是,Lilliput和Blefuscu这两大强国在过去36个月里一直在苦战。战争开始是由于以下的原因:我们大家都认为,吃鸡蛋前,原始的方法是打破鸡蛋较大的一端,可是当今皇帝的祖父小时候吃鸡蛋,一次按古法打鸡蛋时碰巧将一个手指弄破了。因此他的父亲,当时的皇帝,就下了一道敕令,命令全体臣民吃鸡蛋时打破鸡蛋较小的一端,违令者重罚。老百姓们对这项命令极其反感。历史告诉我们,由此曾经发生过6次叛乱,其中一个皇帝送了命,另一个丢了王位。这些叛乱大多都是由Blefuscu的国王大臣们煽动起来的。叛乱平息后,流亡的人总是逃到那个帝国去寻求避难。据估计,先后几次有11000人情愿受死也不肯去打破鸡蛋较小的一端。关于这一争端,曾出版过几百本大部著作,不过大端派的书一直是受禁的,法律也规定该派任何人不得做官。”[2]

1980年,Danny Cohen,一位网络协议的早期开发者,在其著名的论文"On Holy Wars and a Plea for Peace"中,为平息一场关于字节该以什么样的顺序传送的争论,而第一次引用了该词。[3]



字节顺序[编辑]

在哪种字节顺序更合适的问题上,人们表现得非常情绪化,实际上,就像鸡蛋的问题一样,没有技术上的原因来选择字节顺序规则,因此,争论沦为关于社会政治问题的争论,只要选择了一种规则并且始终如一地坚持,其实对于哪种字节排序的选择是任意的。

对于单一的字节(a byte),大部分处理器以相同的顺序处理位元(bit),因此单字节的存放方法和传输方式一般相同。

对于多字节数据,如整数(32位机中一般占4字节),在不同的处理器的存放方式主要有两种,以内存中0x0A0B0C0D的存放方式为例,分别有以下几种方式:

注: 0x前缀代表十六进制。

大端序[编辑]

大端序(英:big-endian)或称大尾序

Big-Endian.svg
  • 数据以8bit为单位:
地址增长方向  →
...0x0A0x0B0x0C0x0D...

示例中,最高位字节是0x0A 存储在最低的内存地址处。下一个字节0x0B存在后面的地址处。正类似于十六进制字节从左到右的阅读顺序。

  • 数据以16bit为单位:
地址增长方向  →
...0x0A0B0x0C0D...

最高的16bit单元0x0A0B存储在低位。

小端序[编辑]

小端序(英:little-endian)或称小尾序

Little-Endian.svg
  • 数据以8bit为单位:
地址增长方向  →
...0x0D0x0C0x0B0x0A...

最低位字节是0x0D 存储在最低的内存地址处。后面字节依次存在后面的地址处。

  • 数据以16bit为单位:
地址增长方向  →
...0x0C0D0x0A0B...

最低的16bit单元0x0D0C存储在低位。

  • 更改地址的增长方向:

当更改地址的增长方向,使之由右至左时,表格更具有可阅读性。

←  地址增长方向
...0x0A0x0B0x0C0x0D...

最低有效位(LSB)是0x0D 存储在最低的内存地址处。后面字节依次存在后面的地址处。

←  地址增长方向
...0x0A0B0x0C0D...

最低的16bit单元0x0C0D存储在低位。

混合序[编辑]

混合序(英:middle-endian)具有更复杂的顺序。以PDP-11为例,0x0A0B0C0D被存储为:

  • 32bit在PDP-11的存储方式
地址增长方向  →
...0x0B0x0A0x0D0x0C...

可以看作最高的16bit位和低位以大端序存储,但16bit内部以小端存储。

处理器体系[编辑]

网络序[编辑]

网络传输一般采用大端序,也被称之为网络字节序,或网络序IP协议中定义大端序为网络字节序。

伯克利socket API定义了一组转换函数,用于16和32bit整数在网络序和本机字节序之间的转换。htonl,htons用于本机序转换到网络序;ntohl,ntohs用于网络序转换到本机序。

位序[编辑]

一般用于描述串行设备的传输顺序。网络协议中只有数据链路层的底端会涉及到。

小端序(先传低位)的串行协议[编辑]

大端序(先传高位)的串行协议[编辑]


作者  | 2015-3-19 9:26:22 | 阅读(17) |评论(0) | 阅读全文>>


11down voteaccepted

Visual Studio 2010:

right click on project

Menu select "Add reference..."

select tab "Browse"

select directory "C:\windows\assembly\ GAC\Microsoft.DirectX.AudioVideoPlayback

The DLL to reference is in that folder.

answered Oct 25 '10 at 13:57
Robert Harvey?
112k23181299

作者  | 2015-3-15 20:22:09 | 阅读(19) |评论(0) | 阅读全文>>

波形头损坏: 没有做这个 Stream.Position = 0;

2015-3-15 20:00:16 阅读17 评论0 152015/03 Mar15



波形头损坏:  没有做这个 Stream.Position = 0; 

作者  | 2015-3-15 20:00:16 | 阅读(17) |评论(0) | 阅读全文>>

octave for Windows8 windows 8.1

2015-3-15 4:05:36 阅读19 评论0 152015/03 Mar15

If you got any problems while running Windows 8 or libstdc++-6.dll errors, try this octave-gui.bat file and place it into your octave-3.8.0 folder (e.g. `C:/octave-3.8.0/`).

 @echo off set PATH=%CD%\bin\ start octave --force-gui -i --line-editing exit


最简单就是一行:

C:\Octave-3.6.4\bin\octave  -i --line-editing

问题解决。


记得 pwd  = present working directory.

作者  | 2015-3-15 4:05:36 | 阅读(19) |评论(0) | 阅读全文>>

No overload for method "xxxxx" takes 0 arguments 为什么

2015-3-14 19:35:47 阅读20 评论0 142015/03 Mar14



No overload for method  "xxxxx"  takes 0 arguments 为什么

就是没有给它参数呗, 忘记给它参数了.



            try
            {
                string ls_disp;
                uint lud_vol = 0;
                ls_disp = waveOutGetVolume(IntPtr.Zero, out lud_vol).ToString();
                MessageBox.Show(ls_disp, " Result: ");

            }
            catch (Exception)
            {
            }

作者  | 2015-3-14 19:35:47 | 阅读(20) |评论(0) | 阅读全文>>

ZLIB, zlib where to download a reliable version?

2015-3-12 8:17:21 阅读20 评论0 122015/03 Mar12


ZLIB, zlib    where to download a reliable version?

here:
http://www.zlib.net/
http://www.zlib.net/
http://www.zlib.net/
http://www.zlib.net/
http://www.zlib.net/
http://www.zlib.net/
http://www.zlib.net/



zlib

A Massively Spiffy Yet Delicately Unobtrusive Compression Library
(Also Free, Not to Mention Unencumbered by Patents)

(Not Related to the Linux zlibc Compressing File-I/O Library)


Welcome to the zlib home page, web pages originally created by Greg Roelofs and maintained by Mark Adler. If this page seems suspiciously similar to the PNG Home Page, rest assured that the similarity is completely coincidental. No, really.

zlib was written by Jean-loup Gailly (compression) and Mark Adler (decompression).

Current release:

zlib 1.2.8

April 28, 2013

Version 1.2.8 fixes a very rare bug in decompression. All users are encouraged to upgrade immediately. Version 1.2.8 also has these improvements:

  • Add new inflateGetDictionary() function
  • Fix bug where gzopen() immediately followed by gzclose() would write an empty file instead of an empty gzip stream.
  • Fix bug in gzclose() when gzwrite() runs out of memory
You can also look at the complete Change Log.

Version 1.2.7 has many portability improvements over 1.2.6, and has these enhancements:

  • Fix bug in gzclose_w() when gzwrite() fails to allocate memory
  • Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen()
  • Add gzopen_w() in Windows for wide character path names
  • Fix type mismatch between get_crc_table() and crc_table

Version 1.2.6 has many changes over 1.2.5, including these improvements:

  • gzread() can now read a file that is being written concurrently
  • gzgetc() is now a macro for increased speed
  • Added a 'T' option to gzopen() for transparent writing (no compression)
  • Added deflatePending() to return the amount of pending output
  • Allow deflateSetDictionary() and inflateSetDictionary() at any time in raw mode
  • deflatePrime() can now insert bits in the middle of the stream
  • ./configure now creates a configure.log file with all of the results
  • Added a ./configure --solo option to compile zlib with no dependency on any libraries
  • Fixed a problem with large file support macros
  • Fixed a bug in contrib/puff
  • Many portability improvements

Version 1.2.5 fixes bugs in gzseek() and gzeof() that were present in version 1.2.4 (March 2010). All users are encouraged to upgrade immediately.

Version 1.2.4 has many changes over 1.2.3, including these improvements:

  • Fixed bugs in adler32_combine()compressBound(), and deflateBound()
  • Wholesale replacement of gz* functions with faster versions
  • As part of that, added gzbuffer()gzoffset()gzclose_r(), and gzclose_w() functions
  • Faster Z_HUFFMAN_ONLY and Z_RLE compression for images and other specialized compression
  • Added flush options Z_BLOCK to deflate() and Z_TREES to inflate() for finer control
  • Added inflateReset2() and inflateMark() functions, the latter to aid in random access applications
  • Added LFS (Large File Summit) support for 64-bit file offsets and many other portability improvements
  • Updated examples in examples/ and updated third-party contributions in contrib/

If you are using libxml version 2.7.6 or earlier, you will need to update libxml to version 2.7.7 or later before installing zlib version 1.2.4 or later. libxml 2.7.6 and earlier made unnecessary assumptions about the undocumented internal structure of zlib that were changed in zlib 1.2.4 and result in libxml crashing. This was fixed in libxml 2.7.7.

Version 1.2.3 (July 2005) eliminates potential security vulnerabilities in zlib 1.2.1 and 1.2.2, so all users of those versions should upgrade immediately. The following important fixes are provided in zlib 1.2.3 over 1.2.1 and 1.2.2:

  • Eliminate a potential security vulnerability when decoding invalid compressed data
  • Eliminate a potential security vulnerability when decoding specially crafted compressed data
  • Fix a bug when decompressing dynamic blocks with no distance codes
  • Fix crc check bug in gzread() after gzungetc()
  • Do not return an error when using gzread() on an empty file

Versions 1.1.4 (March 2002) and later eliminate an earlier potential security vulnerability, see details here. Any software that is linked against or derived from an earlier version of zlib should be upgraded immediately.

A partial list of over 500 applications using zlib is given here.


Canonical URL: http://zlib.net/ (US)


[DDJ's zlib image]zlib is designed to be a free, general-purpose, legally unencumbered -- that is, not covered by any patents -- lossless data-compression library for use on virtually any computer hardware and operating system. The zlib data format is itself portable across platforms. Unlike the LZW compression method used in Unix compress(1) and in the GIF image format, the compression method currently used in zlib essentially never expands the data. (LZW can double or triple the file size in extreme cases.) zlib's memory footprint is also independent of the input data and can be reduced, if necessary, at some cost in compression. A more precise, technical discussion of both points is available on another page.

zlib was written by Jean-loup Gailly (compression) and Mark Adler (decompression). Jean-loup is also the primary author/maintainer ofgzip(1), the author of the comp.compression FAQ list and the former maintainer of Info-ZIP's Zip; Mark is also the author of gzip's andUnZip's main decompression routines and was the original author of Zip. Not surprisingly, the compression algorithm used in zlib is essentially the same as that in gzip and Zip, namely, the `deflate' method that originated in PKWARE's PKZIP 2.x.

Mark and Jean-loup can be reached by e-mail at zlib email address. Please read the FAQ and the manual before asking us for help. We are getting too many questions which already have an answer in the zlib documentation.

Greg, Mark and/or Jean-loup will add some more stuff here when they think of something to add. For now this page is mainly a pointer to zlib itself and to related links. Note that the deflate and zlib specifications both achieved official Internet RFC status in May 1996, and zlib itself was adopted in version 1.1 of the Java Development Kit (JDK), both as a raw class and as a component of the JAR archive format.

The lovely zlib-vise image above was provided courtesy of Bruce Gardner, art director of Dr. Dobb's Journal. It appears in Mark Nelson's article in the January 1997 issue (see below).


The current release is publicly available here:

 *  zlib source code, version 1.2.8, tar.gz format (558K, MD5 checksum 44d667c142d7cda120332623eab69f40):

 *  US (zlib.net)
 *  Pick a mirror (prdownloads.sourceforge.net)
 *  zlib source code, version 1.2.8, tar.xz format (440K, MD5 checksum 28f1205d8dd2001f26fec1e8c2cebe37):

 *  US (zlib.net)
 *  Pick a mirror (prdownloads.sourceforge.net)
 *  zlib source code, version 1.2.8, zipfile format (678K, MD5 checksum 126f8676442ffbd97884eb4d6f32afb4):

 *  US (zlib.net)
 *  Pick a mirror (prdownloads.sourceforge.net)
 *  zlib compiled DLL, version 1.2.8, zipfile format (139K, MD5 checksum 42eccc2af5bac6b7a1188d7817d03549):

 *  US (zlib.net)
 *  Pick a mirror (prdownloads.sourceforge.net)

Note that zlib is an integral part of libpng and has been tested extensively as part of many PNG-supporting applications.


zlib Information

 *  zlib Frequently Asked Questions
 *  Zlib-announce mailing list
New versions of zlib are announced on this list.
 *  Zlib-devel mailing list
Please do not send questions or comments about zlib to this mailing list. Send those directly to the authors at zlib email address after checking theFAQ and the manual, of course. The zlib-devel list is for the development of zlib—members are contributors to and testers of new versions of zlib.
 *  zlib Manual
 *  zlib Usage Example
 *  zlib Technical Details
 *  zlib-related specifications:
 *  Deflate stream disassembler. infgen.c produces a readable description of a gzip, zlib, or raw deflate stream.
 *  zlib's Deflate Algorithm
 *  zlib's deflate flush modes
 *  zlib License
 *  zlib on github

CRC (Cyclic Redundancy Check) Bonus Information

 *  Ross Williams' classic "A Painless Guide to CRC Error Detection Algorithms"
 *  Code to generate any CRC, with a list of CRC descriptions. crcany.c can take a description of a CRC and compute that CRC efficiently. It includes bit-wise, table-driven byte-wise, and table-driven word-wise CRC algorithms.
 *  Code to modify a message so that it generates the desired CRC. spoof.c takes an abbreviated description of the CRC, the exclusive-or of the current CRC of the message and the desired CRC, the length of the message, and a list of bit locations in a message, and tells you which of those bits should be inverted in the message to get the desired CRC. Note that it does not need the message itself, due to the linearity property of CRCs.

ZIP File Processing Bonus Software

 *  Code to read a zip file as a stream and extract its contents. sunzip.c will read a zip file from stdin and extract the files therein that use compression methods 0, 8, 9, or 12 (stored, deflate, deflate64, or bzip2). It accepts Zip64 input.
 *  Code to merge multiple zip files into a single zip file. zipknit.c accepts Zip64 input files, and will create Zip64 output if the combined size of the merged zip file warrants it. All compression formats are permitted, since no decompression or recompression is performed. Encrypted entries are permitted, and pass through unscathed.


Related External Links

 *  zlib for Linux, both shared and static plus headers (RPM format, many architectures)
 *  zlib for Solaris
 *  zlib for Solaris (alternate)
 *  zlib for SCO Open Server 5.0
 *  zlib for BeOS R5
 *  zlib for Mac OS X: zlib is already included as part of Mac OS X
 *  zlib for Mac OS
 *  zlib for OS/2 (DLL and static version for emx 0.9c, 46k)
(click here if link breaks)
 *  zlib for Palm Pilot
 *  zlib for Newton OS
 *  zlib for Windows CE
 *  zlib for RIM BlackBerry
 *  zlib for Windows 9x/NT/2000/XP/2003 (DLL version, plus related utilities)
 *  zlib for Windows 9x/NT (DLL and static version)
 *  DotNetZip zip file manipulation for .NET, and more (including replacements for the buggy Microsoft GZipStream and DeflateStream classes)
 *  zlib for .NET in C#
 *  zlib DLL wrapper for .NET in C#
 *  zlib DLL wrapper for .NET in VB
 *  Zip for .NET
 *  Mark Nelson's ZlibTool article and Win32 source code for Dr. Dobb's Journal (January 1997)
 *  zlib C++ wrapper for the de>gz*de> functions.
 *  C++ zlib and gzip filters in an iostream framework.
 *  zlib 32-bit OCX (C++ source and binaries for use with Visual Basic 4.x or Delphi 2.0)
(unsupported VB5 binary also available)
 *  zlib Pascal port (Pascal source, tested with Turbo Pascal 7.0 and Delphi 3.02)
(not tested by us, but looks complete and well-maintained)
 *  zlib Delphi 5 interface
(includes compiled object files and corresponding C++ Builder 5 project files)
 *  zlib Perl interface (source code; look for Compress-Zlib*.tar.gz)
 *  zlib Python interface (online manual; part of the standard library as of Python 1.5)
 *  zlib Tcl interface mkZiplib
 *  zlib Haskell interface
 *  zlib Java interface (see also JAR format)
 *  zlib reimplementation in pure Java
(not tested by us, but looks like a good alternative to java.util.zip)
 *  Mark Nelson's JavaZip article (with source code) for Dr. Dobb's Journal (December 1997)
 *  Random access for gzip archives, for Java
 *  Gilles Vollant's zlib-based mini-zip and mini-unzip
(see also Info-ZIP's UnZip, which optionally can be compiled with zlib)
 *  Scott Ludwig's zlib-based CExe executable compressor for Win32
 *  zlib technical issues, including spec errors
 *  zlib information in Japanese
 *  zlib information in Russian
 *  Real World Scanning and Halftones (second edition includes a section on zlib)
 *  Markus Oberhumer's LZO `real-time' data compression library
(not tested by us, but looks like a good alternative if you need more speed and less compression)
 *  lz4, a very fast compression algorithm
(not tested by us, but looks like an even better alternative if you need more speed and less compression)
 *  libbzip2
(not tested by us, but looks like a good alternative if you need more compression and less speed)
 *  PPP Deflate Protocol (RFC 1979)
 *  Info-ZIP Home Page
 *  Portable Network Graphics (PNG) Home Page
 *  gzip Home Page
 *  pigz (parallel gzip) Home Page
 *  DataCompression.info
 *  comp.compression Frequently Asked Questions list


Send comments or questions about zlib to the authors at zlib email address  after checking FAQ and manual
Please report broken links to Mark's email address (PGP key). Last updated December 24th, 2014.



ZLIB is a compression library compatible with the gzip format. It has been written by Jean-Loup Gailly and Mark Adler. It is free software.
The official page is there, but if you are interested only in Windows 95/98/NT/2000/XP/2003 support, you have found the right place.
There is also a page with a discussion list, Zlib-devel -- zlib compression library development discussions.

This page contains stuff built around zLib by Gilles Vollant, maker of WinImage and Smartversion.
It provides a DLL version of the library and pointers to other projects like MiniZip. It also intends to offer support for the DLL version and for assembly code optimisation.

NEW: the source distribution of the zlib DLL is now merged with the standard zlib.

--


Current version (1.2.5):

zlib125.zip - zlib-1.2.5.tar.gz - sources of zlib

zlib125dll.zip - pre-built zlib DLL, compiled with the Microsoft Visual studio 2010 compiler (the compiler is available as free download)

  • This DLL is for Win32-x86. Make sure to define ZLIB_WINAPI before including zlib.h. Read contrib\vstudio\readme.txt file whithin zlib123.zip for more information.

zlib125_masm_obj.zip - Latest assembly code object for zLib 1.25, both 32 bits (x86) and 64 bits (x86-64 for AMD64/Intel EM64T).


Previous version (1.1.4):

zlib114.zip [146K] (or through FTP) - sources of zlib

  • You need that if you want to use zlib in your programs. Officially, zlib does not have a "programmers manual", but a quick read to zlib.h will make your ideas clearer.
    NOTE: this archive is now THE SAME of the standard distribution.

    Take a look at the Users Corner.
    If you are going to rebuild the library by yourself, read the build instructions.
    If you need a Visual Basic interface to zlib, see cmp-z-it.zip or http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm and contrib/visual-basic.txt

zlib114dll.zip [94K] - pre-built zlib DLL

If you want the complete version history for zLib (from 0.95 to 1.1.4), get the multiversion archive zlib.svf, or, from 0.95 to 1.23, zlibnew.svf, and open it withSmartVersion.


Other projects:

Minizip package - Source code that enables to unzip files from a .ZIP file.

  • Formerly named "Unzip package", this package is based on Zlib.
    You will also find an excellent sample that adds a "Send as ZIP-File" command to the MFC Scribble sample. I have included the corresponding Visual C++ 6.0 project.

sfondo.zip [34K] - full source & exe of an MFC app that uses ZLIB.DLL

  • This is a quick & dirty utility that allows you to compress BMP images with gzip to obtain better compression than GIF images, and still use them as background for your desktop.
    To use this program, you need ZLIB.DLL and the MFC30.DLL that comes with 95.

gzip124xN.zip [32K] - NT version 1.24 of GNU gzip

  • It works also under Windows 95.

作者  | 2015-3-12 8:17:21 | 阅读(20) |评论(0) | 阅读全文>>

十进制浮点数怎么显示为比特流

2015-3-8 4:57:57 阅读25 评论0 82015/03 Mar8

http://www.exploringbinary.com/converting-floating-point-numbers-to-binary-strings-in-c/

http://stackoverflow.com/questions/397692/how-do-i-display-the-binary-representation-of-a-float-or-double

http://stackoverflow.com/questions/21244252/convert-float-to-its-binary-representation-using-memorystream





using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace d2b01
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Text = null;
            //richTextBox1.Text = null;
            string ls_decinput;
            double ld_temp;
            ls_decinput = textBox2.Text.Trim();
            ld_temp = double.Parse(ls_decinput);

            //// ref to https://msdn.microsoft.com/en-us/library/a5be4sc9(v=vs.110).aspx
            ////

            byte[] lba_array = BitConverter.GetBytes(ld_temp);

            ////StringBuilder sb0 = new StringBuilder(lba_array.Length * 2);
            ////foreach (byte lb_bit in lba_array)
            ////{
            ////    sb0.Append(lb_bit.ToString("x2"));
            ////}

            textBox1.Text = BitConverter.ToString(lba_array).Replace("-","");
            richTextBox1.Text += BitConverter.ToString(lba_array) + "\r\n";

        }
    }
}

作者  | 2015-3-8 4:57:57 | 阅读(25) |评论(0) | 阅读全文>>

C# 连接MySQL数据库并进行相关操作 by DSQiu

2015-3-3 15:59:45 阅读34 评论0 32015/03 Mar3

  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Text;  
  5. using System.Windows.Forms;  
  6. using System.Diagnostics;  
  7. using System.IO;  
  8. //Add MySql Library  
  9. using MySql.Data.MySqlClient;  
  10. using System.Data;  
  11.   
  12. namespace ReadXlsxData  
  13. {  
  14.     class DBConnect  
  15.     {  
  16.         private MySqlConnection connection;  
  17.         private string server;  
  18.         private string database;  
  19.         private string uid;  
  20.         private string password;  
  21.         private string port;  
  22.         //private string database;  
  23.   
  24.   
  25.   
  26.         //Initialize values  
  27.         public void Initialize(string server, string database,string uid, string password, string port)  
  28.         {  
  29.             //server = "localhost";  
  30.             //database = "connectcsharptomysql";  
  31.             //uid = "username";  
  32.             //password = "password";  
  33.             this.server = server;  
  34.             this.uid = uid;  
  35.             this.password = password;  
  36.             this.port = port;  
  37.             this.database = database;  
  38.             string connectionString = "Data Source=" + server + ";" + "port=" + port + ";" + "Database=" + database + ";" + "User Id=" + uid + ";" + "Password=" + password + ";" + "CharSet = utf8"; ;  
  39.             connection = new MySqlConnection(connectionString);  
  40.         }  
  41.   
  42.   
  43.         //open connection to database  
  44.         public bool OpenConnection()  
  45.         {  
  46.             try  
  47.             {  
  48.                 connection.Open();  
  49.                 return true;  
  50.             }  
  51.             catch (MySqlException ex)  
  52.             {  
  53.                 //When handling errors, you can your application's response based on the error number.  
  54.                 //The two most common error numbers when connecting are as follows:  
  55.                 //0: Cannot connect to server.  
  56.                 //1045: Invalid user name and/or password.  
  57.                 switch (ex.Number)  
  58.                 {  
  59.                     case 0:  
  60.                         MessageBox.Show("Cannot connect to server.  Contact administrator");  
  61.                         break;  
  62.   
  63.                     case 1045:  
  64.                         MessageBox.Show("Invalid username/password, please try again");  
  65.                         break;  
  66.                 }  
  67.                 return false;  
  68.             }  
  69.         }  
  70.   
  71.         //Close connection  
  72.         public bool CloseConnection()  
  73.         {  
  74.             try  
  75.             {  
  76.                 connection.Close();  
  77.                 return true;  
  78.             }  
  79.             catch (MySqlException ex)  
  80.             {  
  81.                 MessageBox.Show(ex.Message);  
  82.                 return false;  
  83.             }  
  84.         }  
  85.   
  86.         public DataTable GetSchema(string str, string[] restri)  
  87.         {  
  88.             return connection.GetSchema(str, restri);  
  89.         }  
  90.         public DataTable GetSchema(string str)  
  91.         {  
  92.             return connection.GetSchema(str);  
  93.         }  
  94.         // Get Database List  
  95.   
  96.         //Insert statement  
  97.         public void Insert()  
  98.         {  
  99.             string query = "INSERT INTO tableinfo (name, age) VALUES('John Smith', '33')";  
  100.   
  101.             //open connection  
  102.             if (this.OpenConnection() == true)  
  103.             {  
  104.                 //create command and assign the query and connection from the constructor  
  105.                 MySqlCommand cmd = new MySqlCommand(query, connection);  
  106.                 //Execute command  
  107.                 cmd.ExecuteNonQuery();  
  108.                 //close connection  
  109.                 this.CloseConnection();  
  110.             }  
  111.         }  
  112.   
  113.         //Update statement  
  114.         public void Update()  
  115.         {  
  116.             string query = "UPDATE tableinfo SET name='Joe', age='22' WHERE name='John Smith'";  
  117.   
  118.             //Open connection  
  119.             if (this.OpenConnection() == true)  
  120.             {  
  121.                 //create mysql command  
  122.                 MySqlCommand cmd = new MySqlCommand();  
  123.                 //Assign the query using CommandText  
  124.                 cmd.CommandText = query;  
  125.                 //Assign the connection using Connection  
  126.                 cmd.Connection = connection;  
  127.   
  128.                 //Execute query  
  129.                 cmd.ExecuteNonQuery();  
  130.   
  131.                 //close connection  
  132.                 this.CloseConnection();  
  133.             }  
  134.         }  
  135.   
  136.         //Delete statement  
  137.         public void Delete()  
  138.         {  
  139.             string query = "DELETE FROM tableinfo WHERE name='John Smith'";  
  140.   
  141.             if (this.OpenConnection() == true)  
  142.             {  
  143.                 MySqlCommand cmd = new MySqlCommand(query, connection);  
  144.                 cmd.ExecuteNonQuery();  
  145.                 this.CloseConnection();  
  146.             }  
  147.         }  
  148.   
  149.         //Select statement  
  150.         public List<string>[] Select()  
  151.         {  
  152.             string query = "SELECT * FROM tableinfo";  
  153.   
  154.             //Create a list to store the result  
  155.             List<string>[] list = new List<string>[3];  
  156.             list[0] = new List<string>();  
  157.             list[1] = new List<string>();  
  158.             list[2] = new List<string>();  
  159.   
  160.             //Open connection  
  161.             if (this.OpenConnection() == true)  
  162.             {  
  163.                 //Create Command  
  164.                 MySqlCommand cmd = new MySqlCommand(query, connection);  
  165.                 //Create a data reader and Execute the command  
  166.                 MySqlDataReader dataReader = cmd.ExecuteReader();  
  167.   
  168.                 //Read the data and store them in the list  
  169.                 while (dataReader.Read())  
  170.                 {  
  171.                     list[0].Add(dataReader["id"] + "");  
  172.                     list[1].Add(dataReader["name"] + "");  
  173.                     list[2].Add(dataReader["age"] + "");  
  174.                 }  
  175.                 //close Data Reader  
  176.                 dataReader.Close();  
  177.                 //close Connection  
  178.                 this.CloseConnection();  
  179.                 //return list to be displayed  
  180.                 return list;  
  181.             }  
  182.             else  
  183.             {  
  184.                 return list;  
  185.             }  
  186.         }  
  187.   
  188.         //Count statement  
  189.         public int Count()  
  190.         {  
  191.             string query = "SELECT Count(*) FROM tableinfo";  
  192.             int Count = -1;  
  193.             //Open Connection  
  194.             if (this.OpenConnection() == true)  
  195.             {  
  196.                 //Create Mysql Command  
  197.                 MySqlCommand cmd = new MySqlCommand(query, connection);  
  198.   
  199.                 //ExecuteScalar will return one value  
  200.                 Count = int.Parse(cmd.ExecuteScalar() + "");  
  201.                 //close Connection  
  202.                 this.CloseConnection();  
  203.                 return Count;  
  204.             }  
  205.             else  
  206.             {  
  207.                 return Count;  
  208.             }  
  209.         }  
  210.   
  211.         //Backup  
  212.         public void Backup()  
  213.         {  
  214.             try  
  215.             {  
  216.                 DateTime Time = DateTime.Now;  
  217.                 int year = Time.Year;  
  218.                 int month = Time.Month;  
  219.                 int day = Time.Day;  
  220.                 int hour = Time.Hour;  
  221.                 int minute = Time.Minute;  
  222.                 int second = Time.Second;  
  223.                 int millisecond = Time.Millisecond;  
  224.   
  225.                 //Save file to C:\ with the current date as a filename  
  226.                 string path;  
  227.                 path = "C:\\" + year + "-" + month + "-" + day + "-" + hour + "-" + minute + "-" + second + "-" + millisecond + ".sql";  
  228.                 StreamWriter file = new StreamWriter(path);  
  229.   
  230.   
  231.                 ProcessStartInfo psi = new ProcessStartInfo();  
  232.                 psi.FileName = "mysqldump";  
  233.                 psi.RedirectStandardInput = false;  
  234.                 psi.RedirectStandardOutput = true;  
  235.                 psi.Arguments = string.Format(@"-u{0} -p{1} -h{2} {3}", uid, password, server, database);  
  236.                 psi.UseShellExecute = false;  
  237.   
  238.                 Process process = Process.Start(psi);  
  239.   
  240.                 string output;  
  241.                 output = process.StandardOutput.ReadToEnd();  
  242.                 file.WriteLine(output);  
  243.                 process.WaitForExit();  
  244.                 file.Close();  
  245.                 process.Close();  
  246.             }  
  247.             catch (IOException ex)  
  248.             {  
  249.                 MessageBox.Show("Error , unable to backup!");  
  250.             }  
  251.         }  
  252.   
  253.         //Restore  
  254.         public void Restore()  
  255.         {  
  256.             try  
  257.             {  
  258.                 //Read file from C:\  
  259.                 string path;  
  260.                 path = "C:\\MySqlBackup.sql";  
  261.                 StreamReader file = new StreamReader(path);  
  262.                 string input = file.ReadToEnd();  
  263.                 file.Close();  
  264.   
  265.   
  266.                 ProcessStartInfo psi = new ProcessStartInfo();  
  267.                 psi.FileName = "mysql";  
  268.                 psi.RedirectStandardInput = true;  
  269.                 psi.RedirectStandardOutput = false;  
  270.                 psi.Arguments = string.Format(@"-u{0} -p{1} -h{2} {3}", uid, password, server, database);  
  271.                 psi.UseShellExecute = false;  
  272.   
  273.                 Process process = Process.Start(psi);  
  274.                 process.StandardInput.WriteLine(input);  
  275.                 process.StandardInput.Close();  
  276.                 process.WaitForExit();  
  277.                 process.Close();  
  278.             }  
  279.             catch (IOException ex)  
  280.             {  
  281.                 MessageBox.Show("Error , unable to Restore!");  
  282.             }  
  283.         }  
  284.         //Execute Sql File  
  285.         public void ExecuteSQLFile(string fileName)  
  286.         {  
  287.             string sql = File.ReadAllText(fileName, Encoding.UTF8);  
  288.             MySqlCommand myCommand = new MySqlCommand(sql);  
  289.             myCommand.Connection = connection;  
  290.             if (this.OpenConnection() == true)  
  291.             {  
  292.                 myCommand.ExecuteNonQuery();  
  293.                 //MessageBox.Show("..........");  
  294.                 this.CloseConnection();  
  295.             }  
  296.               
  297.   
  298.         }  
  299.   
  300.     }  
  301. }  

http://dsqiu.iteye.com/blog/1964567



  1. / ODBC -- MySQL ODBC 3.51 Driver    
  2.  
  3. using System.Data.Odbc;  
  4.  
  5. OdbcConnection conn = new OdbcConnection();  
  6. conn.ConnectionString =   
  7.      "Driver={MySql ODBC 3.51 Driver};" +   
  8.      "Server=ServerName;" +   
  9.      "Option=16834;" +   
  10.      "Port=3306;" +   
  11.      "Stmt=;" +   
  12.      "DataBase=DataBaseName;" +   
  13.      "Uid=UserName;" +   
  14.      "Pwd=Secret;"   
  15. conn.Open();  
  16.  
  17. // or   
  18.  
  19. using System.Data.Odbc;  
  20.  
  21. OdbcConnection conn = new OdbcConnection();  
  22. conn.ConnectionString =   
  23.      "DRIVER={MySql ODBC 3.51 Driver};" +   
  24.      "SERVER=ServerName;" +   
  25.      "DATABASE=DataBaseName;" +   
  26.      "USER=UrerName;" +   
  27.      "PASSWORD=Secret;"   
  28. conn.Open();  

 

  1. // OleDb    
  2.  
  3. using System.Data.OleDb;  
  4.  
  5. OleDbConnection conn = new OleDbConnection();  
  6. conn.ConnectionString =   
  7.             "Provider=MySqlProv;" +   
  8.             "Data Source=ServerName;" +   
  9.             "User id=UserName;" +   
  10.             "Password=Secret;"   
  11. conn.Open();  

  

  1. // .NET DataProvider from CoreLab   
  2.    
  3.  
  4. using CoreLab.MySql;  
  5.  
  6. MySqlConnection conn = new MySqlConnection();  
  7. conn.ConnectionString =   
  8.               "Host=ServerName;" +   
  9.               "DataBase=DataBaseName;" +   
  10.               "Protocol=TCP;" +   
  11.               "Port=3306;" +   
  12.               "Direct=true;" +   
  13.               "Compress=false;" +   
  14.               "Pooling=true;" +   
  15.               "Min Pool Size=0;" +   
  16.               "Max Pool Size=100;" +   
  17.               "Connection Lifetime=0;" +   
  18.               "User id=UserName;" +   
  19.               "Password=Secret;" +   
  20. conn.Open();

 



连接Oracle

一下C#连接Oracle代码,仅供参考

using System.Data.OracleClient; using System.Data; ... string connString="Data Source=bubufxServer;user=system;password=bubufx123;";//写连接串 OracleConnection conn=new OracleConnection(connString);//创建一个新连接 try { conn.Open(); OracleCommand comd=conn.CreateCommand(); comd.CommandText="select * from bubufxTable"; OracleDataReader odr=comd.ExecuteReader(); while(odr.Read()) { Response.Write(odr.GetOracleString(1).ToString()); } odr.Close(); } catch(Exception bubufxEX) { Response.Write(bubufxEX.Message); } finally { conn.Close(); } 

4、连接MySQL 


using MySQLDriverCS; MySQLConnection DBConn; DBConn = new MySQLConnection(new MySQLConnectionString("localhost","mysql","root","",3306).AsString); DBConn.Open(); MySQLCommand DBComm; DBComm = new MySQLCommand("select a,b from bubufxTable",DBConn); MySQLDataReader DBReader = DBComm.ExecuteReaderEx(); try { while (DBReader.Read()) { Console.WriteLine("Host = {0} and User = {1}", DBReader.GetString(0),DBReader.GetString(1)); } } finally { DBReader.Close(); DBConn.Close(); } DBConn.Close(); 




作者  | 2015-3-3 15:59:45 | 阅读(34) |评论(0) | 阅读全文>>

事儿逼

2015-2-17 11:39:34 阅读38 评论0 172015/02 Feb17

OFFICIOUS    事儿逼   : Meddlesome   事儿逼  

作者  | 2015-2-17 11:39:34 | 阅读(38) |评论(0) | 阅读全文>>

.NET -- Compute Network Parameters in a .AC Analysis

 

This statement is used with a small signal(.AC) analysis to compute the input and output admittance, impedance, Y-parameters, Z-parameters, H-parameters, and S-parameters of a 2-port network. It can also be used to compute the input admittance and impedance of a 1-port network. This must be used with a .AC statement, which determines the frequency sweep of the network analysis.

 

Syntax: .net [V(out[,ref])|I(Rout)] <Vin|Iin>

+ [Rin=<val>] [Rout=<val>]

 

The network input is specified by either an independent voltage source, <Vin>, or an independent current source, <Iin>. The optional output port is specified either with a node, V(out), or a resistor, I(Rout). The ports will be terminated with resistances Rin and Rout. If unspecified, the termination impedances default to 1 Ohm except in the case of the Voltage source with an Rser specified or an output port specified with a resistor. In those two cases the termination resistances defaults to the device impedance. Termination values specified on the .NET statement will override device impedances for the .NET calculation, but not for the normal .AC node voltages and currents. That is, the .NET statement will not impose terminating impedances on the network for the normal voltages and currents computed as part of the .AC analysis.

 

See the example file typically installed as C:\Program Files\LTC\LTspiceIV\examples\Educational\S-param. It recommends using a voltage source, V4, with Rser set the desired source impedance and a resistor, Rout, to set the output termination with a .NET statement reading simply ".net I(Rout) V4." No Rin or Rout values specified on the .net statement and the input/output devices supply default termination values. This arrangement makes the node voltages and currents of the .AC analysis correspond to the network being terminated in the same manner as in the .NET statement.



http://web.engr.oregonstate.edu/~moon/ece323/hspice98/files/chapter_9.pdf

http://csserver.evansville.edu/~richardson/courses/Tutorials/LTspiceIV/07_FrequencyResponse/07_FrequencyResponse.pdf



http://ltwiki.org/index.php?title=NET_Compute_Network_Parameters_in_a_AC_Analysis


Use LTSpice.
Using the .net command. Works for AC.
Right click on plot window , select trace. Take your pic. Zin , Zout , S11 etc



作者  | 2015-2-2 13:02:15 | 阅读(43) |评论(0) | 阅读全文>>

Common FlexNet error codes:

2015-1-3 13:24:29 阅读81 评论0 32015/01 Jan3

Common FlexNet error codes

Oct 31, 2014

Issue:

You want information about common FlexNet? error codes and their meaning.

Solution:

The following table lists the most common FlexNet error codes that may be displayed by the Autodesk Network License Manager. Error codes typically display as Error[1.5. ###] where ### corresponds to the error codes listed in the table. 
 
Error CodeDescription
21lc_flexinit failed because there were insufficient rights to start the FlexNet Publisher Service. Resolve this by setting the service to start automatically.
20FlexNet Publisher Service is not installed.
13Computed path to required file is too long for Mac OS X operating system.
12Invalid bundle ID on Mac OS X operating system.
11Framework specified by bundle ID was not loaded.
10Error creating path from URL.
9Error creating URL.
8Path string not specified in UTF-8 format.
7A call to lc_flexinit is not allowed after a call to lc_flexinit_cleanup.
6Activation application has not been processed using the preptool
5Unable to allocate resources.
4Initialization failed.
3Unsupported version of the operating system.
2Unable to load activation library.
1Unable to find activation library.
-1Cannot find license file.
-2Invalid license file syntax.
-3No license server system for this feature.
-4Licensed number of users already reached.
-5No such feature exists.
-6No TCP/IP port number in license file and FLEXnet Licensing Service does not exist. (pre-v6 only)
-7No socket connection to license server manager service.
-8Invalid (inconsistent) license key or signature. The license key/signature and data for the feature do not match. This usually happens when a license file has been altered.
-9Invalid host. The hostid of this system does not match the hostid specified in the license file.
-10Feature has expired.
-11Invalid date format in license file.
-12Invalid returned data from license server system.
-13No SERVER lines in license file.
-14Cannot find SERVER host name in network database. The lookup for the host name on the SERVER line in the license file failed. This often happens when NIS or DNS or the hosts file is incorrect. Work around: Use IP address (for example, 123.456.789.123) instead of host name.
-15Cannot connect to license server system. The server (lmadmin or lmgrd) has not been started yet, or the wrong port@host or license file is being used, or the TCP/IP port or host name in the license file has been changed. Windows XP SP2 platforms have a limit on the number of TCP/IP connection attempts per second that can be made, which your application may have exceeded. Refer to the manufacturer's documentation on how to change this limit.
-16Cannot read data from license server system.
-17Cannot write data to license server system.
-18License server system does not support this feature.
-19Error in select system call.
-20License server system busy (no majority).
-21License file does not support this version.
-22Feature checkin failure detected at license server system.
-23License server system temporarily busy (new server connecting).
-24Users are queued for this feature.
-25License server system does not support this version of this feature.
-26Request for more licenses than this feature supports.
-29Cannot find ethernet device.
-30Cannot read license file.
-31Feature start date is in the future.
-32No such attribute.
-33Bad encryption handshake with vendor daemon.
-34Clock difference too large between client and license server system.
-35In the queue for this feature.
-36Feature database corrupted in vendor daemon.
-37Duplicate selection mismatch for this feature. Obsolete with version 8.0 or later vendor daemon.
-38User/host on EXCLUDE list for feature.
-39User/host not on INCLUDE list for feature.
-40Cannot allocate dynamic memory.
-41Feature was never checked out.
-42Invalid parameter.
-47Clock setting check not available in vendor daemon.
-52Vendor daemon did not respond within timeout interval.
-53Checkout request rejected by vendor-defined checkout filter.
-54No FEATURESET line in license file.
-55Incorrect FEATURESET line in license file.
-56Cannot compute FEATURESET data from license file.
-57socket call failed.
-59Message checksum failure.
-60License server system message checksum failure.
-61Cannot read license file data from license server system.
-62Network software (TCP/IP) not available.
-63You are not a license administrator.
-64lmremove request before the minimum lmremove interval.
-67No licenses available to borrow.
-68License BORROW support not enabled.
-69FLOAT_OK can’t run standalone on license server system.
-71Invalid TZ environment variable.
-73Local checkout filter rejected request.
-74Attempt to read beyond end of license file path.
-75SYS$SETIMR call failed (VMS). Indicates and error due to an operating system failure.
-76Internal FLEXnet Licensing error. Please report error to Flexera Software.
-77Bad version number must be floating-point number with no letters.
-82Invalid PACKAGE line in license file.
-83FLEXnet Licensing version of client newer than server.
-84USER_BASED license has no specified users; see license server system log.
-85License server system doesn’t support this request.
-87Checkout exceeds MAX specified in options file.
-88System clock has been set back.
-89This platform not authorized by license.
-90Future license file format or misspelling in license file. The file was issued for a later version of FLEXnet Licensing than this program understands.
-91Encryption seeds are non-unique.
-92Feature removed during lmreread, or wrong SERVER line hostid.
-93This feature is available in a different license pool. This is a warning condition. The server has pooled one or more INCREMENT lines into a single pool, and the request was made on an INCREMENT line that has been pooled.
-94Attempt to generate license with incompatible attributes.
-95Network connect to THIS_HOST failed. Change this_host on the SERVER line in the license file to the actual host name.
-96License server machine is down or not responding. See the system administrator about starting the server, or make sure that you're referring to the right host.
-97The desired vendor daemon is down. 1) Check the lmadmin or lmgrd log file or 2) Try lmreread.
-98This FEATURE line can’t be converted to decimal format.
-99The decimal format license is typed incorrectly.
-100Cannot remove a linger license.
-101All licenses are reserved for others. The system administrator has reserved all the licenses for others. Reservations are made in the options file. The server must be restarted for options file changes to take effect.
-102A FLEXid borrow error occurred.
-103Terminal Server remote client not allowed.
-104Cannot borrow that long.
-105Feature already returned to license server.
-106License server system out of network connections. The vendor daemon can't handle any more users. See the debug log for further information.
-110Cannot read dongle: check dongle or driver. Either the dongle is unattached, or the necessary software driver for this dongle type is not installed.
-112Missing dongle driver. In order to read the FLEXid hostid, the correct driver must be installed. These drivers are available from your software publisher.
-114SIGN= keyword required, but missing from license certificate. You need to obtain a SIGN= version of this license from your vendor.
-115Error in Public Key package.
-116TRL not supported for this platform.
-117BORROW failed.
-118BORROW period expired.
-119lmdown and lmreread must be run on license server.
-120Cannot lmdown the server when licenses are borrowed.
-121FLOAT_OK requires exactly one FLEXid hostid.
-122Unable to delete local borrow info.
-123Returning a borrowed license early is not supported. Contact the publisher for further details.
-124Error returning borrowed license.
-125A PACKAGE component must be specified.
-126Composite hostid not initialized.
-127A item needed for the composite hostid is missing or invalid.
-128Error, borrowed license doesn't match any known server license.
-135Error enabling the event log.
-136Event logging is disabled.
-137Error writing to the event log.
-139Communications timeout.
-140Bad message command.
-141Error writing to socket. Peer has closed socket.
-142Error, cannot generate version specific license tied to a single hostid, which is composite.,
-143Version-specific signatures are not supported for uncounted licenses.
-144License template contains redundant signature specifiers.
-145Bad V71_LK signature.
-146Bad V71_SIGN signature.
-147Bad V80_LK signature.
-148Bad V80_SIGN signature.
-149Bad V81_LK signature.
-150Bad V81_SIGN signature.
-151Bad V81_SIGN2 signature.
-152Bad V84_LK signature.
-153Bad V84_SIGN signature.
-154Bad V84_SIGN2 signature.
-155License key required but missing from the license certificate. The application requires a license key in the license certificate. You need to obtain a license key version of this certificate from your publisher.
-156Invalid signature specified with the AUTH= keyword.
-157Trusted storage has been compromised; repair needed. Contact your publisher for repair instructions.
-158Trusted storage open failure. Contact your publisher for further information.
-159Invalid fulfillment record. Contact your publisher for further information.
-160Invalid activation request received. Contact your publisher for further information.
-161No fulfillment exists in trusted storage which matches the request. Contact your publisher for further information.
-162Invalid activation response received. Contact your publisher for further information.
-163Cannot return the specified activation. Contact your publisher for further information.
-164Return count(s) would exceed the maximum for the fulfillment. Contact your publisher for further information.
-165No repair count left. Contact your publisher for further repair authorization.
-166Specified operation not allowed. Contact your publisher for further information.
-167The requested activation has been denied because the user or host is excluded from activating this entitlement by a specification in the options file.
-168The options file contains include specifications for the entitlement, and this user or host is not included in these specifications.
-169Activation error. Contact your publisher for further information.
-170Invalid date format in trusted storage. Can be caused by setting your system clock to an earlier date. Check that your system clock is set to the current date and time.
-171Message encryption failed. Internal error. Please report to Flexera Software Inc.
-172Message decryption failed. Internal error. Please report to Flexera Software Inc.
-173Bad filter context. Internal error. Please report to Flexera Software Inc.
-174SUPERSEDE feature conflict. Contact your publisher for further information.
-175Invalid SUPERSEDE_SIGN syntax. Contact your publisher for further information.
-176SUPERSEDE_SIGN does not contain a feature name and license signature. Contact your publisher for further information.
-177ONE_TS_OK is not supported in this Windows Platform.
-178Internal error. Please report to Flexera Software Inc.
-179Only one terminal server remote client checkout is allowed for this feature.
-180Internal error. Please report to Flexera Software Inc.
-181Internal error. Please report to Flexera Software Inc.
-182Internal error. Please report to Flexera Software Inc.
-183More than one ethernet hostid not supported in composite hostid definition. Contact your publisher for further information.
-184

The number of characters in the license file paths exceeds the permissible limit. There is a limit on the number of license files that can be used by a license server manager. This limit is on the number of characters in the combined license file paths to the license files:

Unix — 40,960 characters
Windows—20,400 characters

Reduce the number of license files, or relocate them so that the paths are shorter.

-187The time zone information could not be obtained. A license that is time zone limited could not be checked out because time zone information could not be obtained for the machine on which the license is required. Contact your publisher for further information.
-188License client time zone not authorized for license rights. A license that is time zone limited could not be checked out because the time zone of the machine on which the license is required does not match the time zone specified in the license.
-190Feature can be checked out from Physical machine only. The license specifies that it cannot be used on a virtual machine: The FlexEnabled application is installed on a virtual machine so checkout has been denied. Install the FlexEnabled application on a physical machine.
-191FEATURE can be checked out from Virtual machine only. The license specifies that it cannot be used on a physical machine. The FlexEnabled application is installed on a physical machine so checkout has been denied. Install the FlexEnabled application on a virtual machine.
-192VM platform not authorized by license.
-193FNP vendor keys do not support Virtualization feature.
-194Checkout request denied as it exceeds the MAX limit specified in the options file., host, or display.
-195Binding agent API - Internal error.
-196Binding agent communication error
-197Invalid Binding agent version.
-201Invalid IP address used while overriding.

The IP address specified for the LM_A_INTERNET_OVERRIDE attribute, used to override the existing IP address, is invalid.

 

This information and more is also available in the License Administration Guide (LicenseAdministration.pdf) that gets installed with the Autodesk Network License Manager.

作者  | 2015-1-3 13:24:29 | 阅读(81) |评论(0) | 阅读全文>>

Configuring FLEXnet Licensing

2015-1-3 12:19:14 阅读69 评论0 32015/01 Jan3

Configuring FLEXnet Licensing

These are basic instructions for configuring FLEXnet licensing.

They are only applicable if your site has purchased Open Inventor run-time floating licenses for use with FLEXnet. The standard Open Inventor licensing does not use FLEXnet, so if you are using standard licensing, these instructions do not apply to you.

Overview

The FLEXnet software supports a wide array of licensing options. Currently, VSG provides the FLEXnet licensing option to support floating licenses. In this scenario, a site purchases a specific number, N, of Open Inventor licenses. The FLEXnet license server tracks the licenses being used and allows simultaneous use of up to N instances of the Open Inventor software. The advantage of this approach is that, unlike standard Open Inventor licensing, Open Inventor is not locked to a specific computer, but can be run on any computer that can communicate with the license server.

images/FloatingLicenses.png

A small set of FLEXnet-related files are provided for managing the FLEXnet licensing. These files must be copied onto the system to where the license server will be run. The license server can be run on the same system where Open Inventor is installed, but it doesn't have to be.

One of the supplied files, lmgrd ("license manager daemon"), is a FLEXnet executable that is responsible for starting the vendor daemon, which does the actual checking in and out of licenses specific to that vendor. The supplied vendor daemon, mcslmd ("Visualization Sciences Group license manager daemon"), handles the requests for licenses from the Open Inventor application programs.

There is a FLEXnet license file that is read by the server. This license file contains information indicating which products are licensed and how many licenses are allowed for each.

In addition, each Open Inventor installation has a separate license file which indicates the name of the FLEXnet license server.

The sections below will provide the basic technical details of installing and managing a FLEXnet license server.

For complete technical details regarding FLEXnet itself, see the Web site of Flexera Software, supplier of the FLEXnet licensing software (www.flexerasoftware.com):

Getting Started

The first thing to do is decide on which computer you wish to run the FLEXnet license server. This system should be "visible" from any system that might want to request a license. It should also be highly reliable.

The server can be installed on a computer on which Open Inventor is installed, but it does not have to be.

It is possible to do FLEXnet licensing in a heterogeneous environment. That is, the server and Open Inventor can be running on different operating systems. For instance, the FLEXnet server could be on a Linux box, with the Open Inventor users running Open Inventor on a Windows platform.

If your site already has a FLEXnet license server running that is used for licensing other vendors' products, this may affect where and how you decide to configure the Open Inventor license server. The FLEXnet documentation from Acresso can help you with this decision. See, for example, the chapter "Managing Licenses from Multiple Vendors" in the FLEXnet Licensing End User Guide.

For the rest of this discussion, we will assume that you will be setting up a license server used only for licensing Open Inventor.

Once you have selected the server machine, if you are not going to run the server from the Open Inventor installation directory (i.e., from <oiv_install_dir>/<architecture>/license/flexnet), you will need to copy the FLEXnet-related files provided by VSG to that system into an empty directory.

Suggested server directory name:

 oiv_flexnet

The FLEXnet files are provided in:

 <oiv_install_dir>/<architecture>/license/flexnet

If you need FLEXnet files for a platform other than the one on which you will be running Open Inventor, please contact technical support.

Instructions for installing and configuring the server are provided in below.

Providing License Server Identification Information to VSG

In order for VSG to generate a FLEXnet license, we will need the following information about the system on which the license server is running/will run:

  1. its host name (or IP address), and
  2. its host ID.

Instructions for capturing this info are given below (UNIXWindows).

You will send this info to the License Administrator, who will generate the license and send it to you via email.

From North, South, and Central America

Email: license@vsg3d.com
Phone: +1 978 967 3206
Fax: +1 978 967 3303

From Europe, Middle East, Africa, Asia, and Australasia

Email: license_eu@vsg3d.com
Phone: +33 556 13 37 71
Fax: +33 556 13 02 10

Please include also:

  • The name and version number of each product for which you are requesting a password.
  • Your name and company name.
  • Your VSG Customer ID # (if you know it). If you don't know it, please provide as much identifying info as you can.
  • Your phone number, FAX number, and email address.

UNIX

  1. On the system where the server is running/will run, in a command shell, go to the directory where the server will be installed:
     cd <server_install_dir>
  2. To get the host ID, execute the lmutil program as follows:
     lmutil lmhostid

    The output will look like:

     lmutil - Copyright (c) 1989-2005 Macrovision Europe Ltd. and/or Macrovision 
    Corporation. All Rights Reserved.
    The FLEXlm host ID of this machine is "001422505387"
  3. To get the hostname, you can use any of the following commands:
     uname -a
    hostname
    lmutil lmhostid -hostname
  4. To get the IP address (optional):
     lmutil lmhostid -internet
  5. Copy/paste the lmhostid output and the hostname (or IP address) into a mail message and send it to the VSG License Administrator as described above.

Windows

  1. On the system where the server is running/will run, run LMTOOLS. It should be located in:
     <server_install_dir>\lmtools.exe
  2. Click on the Systems Settings tab. 

    images/SystemSettings.png 

    • The Computer/Hostname field contains the required host name.
    • The Ethernet Address field contains the required host id.
    • The IP Address field contains the optional IP address.

  3. Copy/paste those values into a mail message and send them to the VSG License Administrator as described above.

Installing the FLEXnet Server (UNIX)

At this point, we assume that the FLEXnet files are in their desired location:

  • either in the default location, <oiv_install_dir>/<architecture>/license/flexnet
  • or have been copied to <some_path>/oiv_flexnet directory on the system where the server will run.

The vendor daemon mcslmd must be in the same directory as lmgrd.

The command to start the server looks like:

 lmgrd -c <server_license_file> -l [+]<debug_log_path>
where:
  • <server_license_file> is the full path to the server license file, and
  • <debug_log_path> is the path to the debug log file.

Prepending the + character the the log file name causes log entries to be appended.

The following is the suggested command to use:

 lmgrd -c passwordServer.dat -l +flexnet.log

TIP: It can be convenient to set up the server so that it is started automatically upon system reboot. This would involve editing the system boot script. See the FLEXnet Licensing End User Guide, chapter "The License Server Manager" for details.

Installing the FLEXnet Server (Windows)

At this point, we assume that the FLEXnet files are in their desired location:
  • either in the default location, <oiv_install_dir>\<architecture>\license\flexnet
  • or have been copied to <some_path>\oiv_flexnet directory on the system where the server will run.

FLEXnet uses a program called lmgrd to manage licenses. On Windows, FLEXnet provides a GUI called LMTOOLS that allows one to configure lmgrd to run as a service. This is the preferred method of configuring FLEXnet and is outlined below.

NOTE: To configure a license server as a service, you must have Administrator privileges.

The vendor daemon mcslmd.exe must be in the same directory as lmgrd.exe.


  1. Run LMTOOLS

  2. Click the Configuration using Services radio button to select it. 

  3. Click the Config Services tab. 

  4. In the Service Name field, type the name of the service that you want to define.

    It is recommended that you use the name OIV License Manager.

Configuring FLEXnet Licensing - godsonx - NDEB Exam BustersScreenshot of steps 2 and 3
  1. In the Path to the lmgrd.exe file field, enter or browse to lmgrd.exe for this license server.

    In many cases the path will be:

     <oiv_install_dir>\<architecture>\license\flexnet\lmgrd.exe.
  2. In the Path to the license file field, enter or browse to the license file for this license server.

    It is recommended that you copy the server license file to:

     <oiv_install_dir>\<architecture>\license\flexnet\passwordServer.dat
  3. In the Path to the debug log file, enter or browse to the debug log file that this license server writes. For example, FLEXnet.log.

    (Prepending the debug log file name with the + character appends logging entries. The default location for the debug log file is the C:\WINDOWS\System32 folder. To specify a different location, make sure you specify a fully qualified path.)

    For most users, the following should be appropriate:

     +<oiv_install_dir>\<architecture>\license\flexnet\flexnet.log
  4. (Optional) Click on the View Log button to display the log file. Check that no logging errors occur (i.e., log file is openable and it contains readable text). Click on the Close Log button to close the log file. 

  5. To ensure that the license service is always running and automatically started upon system reboot, it is necessary to set the two checkboxes, Use Services and Start Server at Power Up, at the bottom of the dialog. 

  6. To save the new OIV License Manager service, click the Save Service button.
Configuring FLEXnet Licensing - godsonx - NDEB Exam BustersScreenshot of steps 4, 5, 6, 7, 8, 9, and 10

Starting the Server (Windows)

Once the license manager service is configured, lmgrd is started by starting the service from the LMTOOLS interface:
  1. Run LMTOOLS if it is not already running. LMTOOLS appears with the Service/License File tab open. 

  2. Click the Configuration using Services radio button. 

  3. Select the service name from the list presented in the selection box.

    If you followed the recommendations above, the service name should be OIV License Manager

  4. Click the Start/Stop/Reread tab.
Configuring FLEXnet Licensing - godsonx - NDEB Exam BustersScreenshot of steps 2, 3, and 4
  1. Start OIV License Manager by clicking the Start Server button.

The OIV License Manager license server should now be started and writing its debug log output to <oiv_install_dir>\<architecture>\license\flexnet\flexnet.log.

NOTE: Any time you make a change to the server configuration, you should stop the server then restart it in order for the changes to take effect.

NOTE: Any time you make a change to the server password file, you should use the Start/Stop/Reread tab, and press the ReReadLicenseFilebutton. If the first time you press it, the operation fails, wait briefly (a minute or less), and try pressing it again.

Configuring FLEXnet Licensing - godsonx - NDEB Exam BustersScreenshot of step 5

Installing the Server License File

After you send your license server info to the VSG License Administrator, you will receive an email containing FLEXnet license strings.

Here's an example server license file:

 
SERVER XP-PANGOLIN2 001234567890 VENDOR mcslmd
FEATURE OpenInventor mcslmd 6.0 permanent 2 SIGN=9F667CAD92
FEATURE OpenInventorSDK mcslmd 6.0 permanent 2 SIGN=1E9D961EEA
FEATURE VolumeVizLDM mcslmd 6.0 permanent 2 SIGN=C1AF9459F8
FEATURE VolumeViz mcslmd 6.0 permanent 2 SIGN=873B4AC82
FEATURE FXViz mcslmd 6.0 permanent 2 SIGN=AEA7626B66
FEATURE MeshViz mcslmd 6.0 permanent 2 SIGN=27291E2020
FEATURE HardCopy mcslmd 6.0 permanent 2 SIGN=22131C30D0
FEATURE ScaleViz mcslmd 6.0 permanent 2 SIGN=A2E3800ECA
FEATURE SolidViz mcslmd 6.0 permanent 2 SIGN=A7E5516ED732

UNIX

On UNIX, the server license file is specified when the server is started.

  1. Decide where you want to place the server license info supplied by the License Administrator.

    Recommended location:

     <server_install_dir>/passwordServer.dat
  2. Using a text editor, copy the server license strings into that file. 

  3. Start the server:
     lmgrd -c passwordServer.dat -l +flexnet.log
    (See the section above for more information about starting the server.)

Windows

  1. Decide where you want to place the server license info supplied by the License Administrator.

    Recommended location:

     <server_install_dir>\passwordServer.dat
  2. Using a text editor, copy the server license strings into that file. 

  3. Run LMTOOLS, click on the Config Services tab, then specify the "path to the license file". 

  4. For this change to take effect, stop and restart the server using the Start/Stop/Reread tab.

Installing the Client License Files (All Platforms)

Each system that might request an Open Inventor license from the FLEXnet license server must have an Open Inventor license file.

Here's an example client license file:

 SERVER XP-PANGOLIN2 ANY
USE_SERVER

On each client system, copy the client license info to the Open Inventor license file.

The default (and recommmended) location is:

 <oiv_install_dir>/<architecture>/license/password.dat

This can be changed by setting the VSG_LICENSE_FILE environment variable to a new path, including the file name. Once this variable is set, Open Inventor automatically looks for the license file in the specified location. If Open Inventor cannot find the license file, the user is presented with a dialog that asks for the license information. 

Configuring FLEXnet Licensing - godsonx - NDEB Exam Busters

Nomad Licensing / Borrowing

To use a FLEXnet floating license on a system that is not always connected to the license server, you will need to "borrow" a license while you are connected to the server, then disconnect from the server. This kind of licensing is what we call "nomad" licensing. Below are the detailed instructions. We will assume that standard FLEXnet licensing, i.e., not borrowing, is already working correctly.

UNIX

  1. On the client machine, in a command shell, go to the directory where the FLEXnet utilities are installed. By default, these utilities are found on the client machine in: <oiv_install_dir>/<architecture>/license/FLEXnet.

    cd <oiv_install_dir>/<architecture>/license/FLEXnet

  2. To initiate borrowing, execute the lmutil program on the client as follows:

    lmutil lmborrow mcslmd <enddate> <time>

    where:

    <enddate> <time> Enddate is the date the license is to be returned in dd-mmm-yyyy format. Time is optional and is specified in 24-hour format (hh:mm) in the FLEXenabled application local time. If time is unspecified, the checkout lasts until the end of the given end date.

    For example:

    lmutil lmborrow mcslmd 16-jan-2007 13:00

To print information about borrowed features, issue the following command on the machine from which they are borrowed:

lmutil lmborrow -status

Windows

  1. Run LMTOOLS on the client machine. By default, LMTOOLS is found on the client machine in: <oiv_install_dir>/<architecture>/License/FLEXnet.

  2. Click on the Borrowing tab.

  3. Specify a return date.

  4. Optional, specify the vendor name (mcslmd).

  5. Press the Set Borrow Expiration button.

  6. Configuring FLEXnet Licensing - godsonx - NDEB Exam Busters
  7. Start your Open Inventor Application, then use all of the extensions that you want to borrow. 

  8. Disconnect from the network. 

  9. Exit your Open Inventor Application and confirm that you can restart it and use all of the borrowed modules. 

You can check how many licenses are checked-in or out by pressing the List Currently Borrowed Features button of the Borrowing tab of the LMTOOLS application.

Additional controls can be set directly into the license string. The most important are:

  • Limit the number of token that can be borrowed: 
    Examples: The customer want to keep 60 tokens over his 100 tokens, so only 40 tokens can be borrowed. 
    Add a BORROW_LOWWATER line:
    BORROW_LOWWATERProduct60
  • Limit the number of days a token can be borrowed:
    Examples: One week (7days x 24hours = 168hours). Add a MAX_BORROW_HOURS line:
    MAX_BORROW_HOURS Product 168 
    Notes: If not specified, default value is one year. 

  • Specify who is allowed to borrow:
    • a user
      INCLUDE_BORROW Product USER Jim
    • a group of users
      INCLUDE_BORROW Product GROUP project_dev
    • a computer
      INCLUDE_BORROW Product HOST  hots_name
    • a group of computers
      INCLUDE_BORROW Product HOST_GROUP computer_group

  • Specify who is not allowed to borrow:
    • a user
      EXCLUDE_BORROW Product USER Jim
    • a group of users
      EXCLUDE_BORROW Product GROUP project_dev
    • a computer
      EXCLUDE_BORROW Product HOST  hots_name
    • a group of computers
      EXCLUDE_BORROW Product HOST_GROUP computer_group

Defining groups

  • Group of users: 
    GROUP project_dev Jim Mike Bob
  • Group of computers:  
    HOST_GROUP  computer_group  host1 host2 host3

Reserving tokens

Tokens can be reserved for specific users groups or  computers. 

  • Reserve 10 tokens for an user:
    RESERVE 10 Product USER Jim
  • Reserve 10 tokens for a group of users:
    RESERVE 10 Product GROUP project_dev
  • Reserve 10 tokens for a computer:
    RESERVE 10 Product HOST host1
  • Reserve 10 tokens for a group of computers:
    RESERVE 10 Product HOST_GROUP computer_group

Setting Access Permissions

You can control who is allowed to use a product using the INCLUDE EXCLUDE commands. 

  • Who is allowed to use a product :
    INCLUDE Product USER Jim
    Can be used for GROUP, HOST and HOST_GROUP as described above.
  • Who is not allowed to use a product :
    EXCLUDE Product USER Mike

Troubleshooting

Refer to the FLEXnet documentation. The FLEXnet Licensing End User Guide contains a troubleshooting appendix. If you need assistance getting your FLEXnet licenses installed and operational, please contact technical support.

Technical Support

From North, South, and Central America

Email: hotline@vsg3d.com
Phone: 800 428 7588 (US only)
Phone: +1 760 494 9690
Fax: +1 760 494 9640

From Europe, Middle East, Africa, Asia, and Australasia

Email: hotline_eu@vsg3d.com
Phone: +33 556 13 37 71
Fax: +33 556 13 02 10

作者  | 2015-1-3 12:19:14 | 阅读(69) |评论(0) | 阅读全文>>

查看所有日志>>

 
 
 
 
 

有道博客魔方

 
 
模块内容加载中...
 
 
 
 
 

有道博客搜索

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2015

下载LOFTER客户端

汇聚1000万达人的兴趣社区
下载即送20张免费照片冲印

创建博客 登录  
 加关注