Sunday, July 25, 2010

VB.net Coding Standards




In the development of good coding standard is very important. I have adopted the new VB.net coding standards is a significant improvement has been shown to code readability, and helps the code management, classification and coding specifications. Using this coding standard, to avoid such as Hungarian notation prefix length brought prosperity, easy to use memory variables. Here are this numbering.

First, type the name level units

1, class

Class statement to the class, must be a noun or noun phrase naming, reflecting the role of the class. Such as:

Class Indicator

When the class is a feature (Attribute), the order Attribute end, when the class is an exception (Exception) when to end Exception:

Class ColorSetException

Class CauseExceptionAttribute

When only one object class instance (the global object, such as Application, etc.), must be Class ends, such as

Class ScreenClass

Class SystemClass

When the class is only used as a base class for other classes, depending on the circumstances, to Base at the end:

MustInherit Class IndicatorBase

If the definition of the class is a form, then the name must be followed by additional suffix Form, if a Web form, you must add the suffix Page:

Class PrintForm: Inherits Form''* Windows Forms

Class StartPage: Inherits Page''* Web Forms

2, enumeration and structure

The same noun or noun phrase must be named. Best reflects the characteristics of enumeration or structure, such as:

Enum ColorButtons''in the plural ending, that this is an enumerated

Structure CustomerInfoRecord''to Record at the end, that this is a structure

3, designated type

Ordinary delegate type named after the term to describe the action to reflect the delegated functions of the type instance:

Delegate Sub DataSeeker (ByVal SeekString As String)

For event handling delegate type EventHandler must end, such as:

Delegate Sub DataChangedEventHandler (ByVal Sender As Object, ByVal e As DataChangedEventArgs)

4, the interface

With other types, interfaces must be prefixed by the I, and named with adjectives, the most prominent class implement the interface will have the capabilities to:

Interface ISortable

5, module

Module is not the type name in addition to his name must be the term, the must be the suffix Module:

Module SharedFunctionsModule

The common feature of all the rules, each component name must be capitalized at the beginning of words, prohibit entirely uppercase or lowercase name.

Second, the naming of methods and properties

1, methods

Whether the function or subroutine, method must be named by the verb or verb phrase. No need to distinguish between functions and subroutines, and need not specify the return type.

Sub Open (ByVal CommandString As String)

Function SetCopyNumber (ByVal CopyNumber As Integer)

Parameters necessary to specify ByVal or ByRef, procedures that make up the side of writing, but very necessary. If there are no special circumstances, use the ByVal. Parameter naming, refer to the back of "variable naming." Need to override the method, generally do not write Overloads, according to need to write overloaded methods.

2, attribute

In principle, the field (Field) is not open to the public to visit the field's value, general use properties. Attribute to simple clear terms naming:

Property Concentration As Single

Property Customer As CustomerTypes


3, event

Event is a special property, only in the event handling context. The general principle of naming is a verb or verb word, by the time state that the time the incident:

Event Click As ClickEventHandler

Event ColorChanged As ColorChangedEventHangler

Third, variables and constants

Constant to indicate that the constant sense of the term named, generally do not distinguish between the types of constants:

Const DefaultConcentration As Single = 0.01

In the strict requirements of the code, constants with c_ beginning, such as c_DefaultConcentration, but best not to use it, it will have input difficulties.

Common type of variable, with a meaningful name as long as you can not use short and meaningless name such as A, x1, etc., are given below a good example:

Dim Index As Integer

Dim NextMonthExpenditure As Decimal

Dim CustomerName As String

The name can not play too long and should be concise, as the following example:

Dim VariableUsedToStoreSystemInformation As String''* error, too complicated

Dim SystemInformation As String''* correct, clear and simple

Dim sysInfo As String''* error, too simple

Special circumstances can be considered a letter variables:

Dim g As Graphic

For the controls, should indicate the type of control, is directly behind them in the variable class name:

Friend WithEvents NextPageButton As Button''* button

Friend WithEvents ColorChoicerPanel As Panel''* panel

Friend WithEvents CardFileOpenDialog As FileOpenDialog''* file open dialog

So, no need to provide some type of a variable prefix, just the type of writing in the back on the line and try to contrast the following code:

btnCancel.Text = "& Cancel"

CancelButton.Text = "& Cancel"

Obviously the latter can make the reader understand the type of a variable is a button.

4, labeling

Tag is used to identify the code jump Goto, Goto is not recommended because, so the use of tabs are relatively harsh. Tags must be all caps, the middle of the space with an underscore _ to replace, and should be _ at the beginning, for example:

_A_LABEL_EXAMPLE:

Such a custom label and other code elements to the full difference.

5, name space

Typically, a project that one name space, usually do not use Namespace statement, Er Shi Zai project options of the "Root Namespace" Zhong Zhi Ding, using root name space can make Daimagengjia tidy, Rongyixiugai, that 1:00 is full of advantages of VB . Namespace syntax is:

Company name. Product Name [. Component name plural]

Such as:

Namespace Ninputer.VirtualScreen

Namespace Ninputer.CardEditor.CustomeControls

Random name from a name space is not a good idea, we must comply with the requirements.

6, Notes

Note numerous rules, only mentioned one thing here: the normal''* Note to the beginning of a separate''only without the code being used to annotate

''* This is a general comment

''* This code is correct in adding debugging

''If UseHighSpeed (g) = True Then ....

This can be easily controlled with code annotation tool for the use of the code.

Has introduced more than a simple I am using VB.net code specification, the code specification also applies to C #. Only for your reference.







Recommended links:



More than to see PR value of the exchange of links Matters need attention



Avi to mkv



My MSN is NOT the same as your



dvd Ripper



Terminal And TELNET Clients introduction



how To convert .mp4 to .avi



Waste cartridge up to 5 times the false profit Canon ink cartridge recycling difficult



Icons Directory



Teaching And Training Tools Catalogs



New Timers And Time Synch



CSS examples: horizontal style input boxes



Charles Zhang: Sohu Is Looking For The Next Opponent



Free download mp4 to 3gp



Win XP to crash when you become extremely smart!



China Machinery Industry Federation leading research Beijing Petroleum Machinery Factory



Michael Dell Back The First Three Fire Burning



Antitrust who first stumbled HOM



Thursday, July 15, 2010

Photoshop effect of manufacturing flames soar



There are many textbooks which now have have some examples of combustion, which put it is probably the most "burning words." The process was very simple, very rough. If you are new to Photoshop, you may be surprised, can be a long day, you will find that this effect does not stand scrutiny! You do not like to persuade their people that this reluctance to float the plants looked like things like fire! It may look more like a melting molten steel. If the flame really as this is the case, I am afraid that people will be careful to use a lot more! In addition to matting, the Do not approach it? See the following chart, you will not think about it, maybe. (Figure Fire)



Highlights: stamp visible layer, style of filter, Gaussian blur, liquefied command, Hue / Saturation command, the application of mixed-mode layer.

1. Create a new 560x400 pixel document, with black as background color. Select the font tool, the color is white, in the Font list, select Times New Roman, set the font for the Rugular, size of 150Pt, the way anti-aliasing for the "strong"; if the ratio is not very satisfied with the font size, font spacing can be adjusted and freedom to adjust the zoom tool. You can also use a different font type, as long as the size of almost on the line. Canvas with the Move tool to move to the bottom. (Figure 01)



2. Note that we followed the method used, you may never know there is the use of Photoshop, although rare, it is indeed a very useful skill! In the text layer, new layer one, hold down the Alt key, click the layer with the mouse command, the drop-down menu to find "split visible layers", pay attention to Alt key and mouse are not loose, you will see that the new layers includes the following two-tier content, such as snapshots of history as a record of all visible layers of image content, merge them into a layer, the convenience of editing, while retaining the original layer is not destroyed. When you need to edit but do not want to merge multi-layer, this was a good way. I do not have the command menu in Photoshop to find the command, but in the history panel, you will see the name of the command is called "stamp visible layer", the shortcut key is Shift + Alt + Ctrl + E, in this case in this technique to be used many times. (Figure 02)



3. In the Edit> Transform, the layer 1 rotated 90 degrees, the implementation style of> the wind, by default, three consecutive. (Figure 03)



4. The Layer 1 90 degrees clockwise, back to the original position, with a soft Gaussian blur radius set to 4 pixels. (Figure 04)



5. Here we start a flame coloring. Using hue / saturation color command to layer 1, this layer we are in a bright orange, click on the "color", set hue to 40, Saturation 100. (Figure 05)



6. The Layer 1 copy, continue to use the Hue / Saturation command, the hue to -40, the other the same, you can see, this layer is now into the red. (Figure 06)






[Next]



7. The Layer 1 copy of the mixed layer to "Color Dodge", so that red and orange to get a good mix, the color of flame came out. (Figure 07)



8. To Layer 1 and Layer 1 copy of the merger to form the new layer 1, we have to describe the appearance of the flame. In Photoshop6.0 version above, there is a new feature, it is liquefied. With it, you do not using any filter can be easily deformed fluid effect. Command in the image, select "liquefaction" will pen the size of transferred 50, the pressure set at 40, the image depicted in the main flame, and then transfer a small brush and pressure, to draw other small flame. You can squeeze with the expansion and reduction tool, draw a realistic flame appearance. If not, hold down Alt, "Cancel" button will become a "reset", remember: you open the liquefaction command dialog box again, the last setting will be saved, you could just plays on the basis of continue. (Figure 08)



9. Well, then we should continue to be modified on the flame, so that its full integration within and outside the flame, the color uniformity of the transition. Select painting tools, with a medium to soft brush, the pressure set to 65%, lightly coated in flames, written to the changing size and pressure, to meet different needs. The appearance of the flame at the bottom of the font to be consistent and not change too much, otherwise it can not be a good combination and fonts. Also note the color of flame, from the outer to the center followed by red - yellow - white. This step is no difficulty, the key is patience and meticulous, from the previous step to this step, we need hand-painted, this is the painting where the most exhausting, and no lazy could steal it, you work it! (Figure 09)



10. Well, the appearance of the flame after the completion of the next work is easier. Copy the "Fire" layer, layer 1 will be moved to the top of a copy, the font color to black. And better integration for the flame, we can move some of the flame level down slightly, so that their basic alignment of the lower edge. (Figure 10)



11. Copy flame layer, (ie layer 1), move it to the font copy of the layer, the layer mixed-mode to "screen", so that the brightness of the flame increased. Click the Layers panel below the "Add Mask" button, as it adds a layer mask. After setting the color to black before the white, select the gradient tool, set the gradient type to "From the foreground to the background color" to create a gradient in the mask, gradient ranging from the Department of text at the top in the end, so that black characters are gradually revealed. (Figure 11)



Copy brighter layer, the mixed-mode to "screen", which is a common effect of nothing, the establishment of light. It is natural, soft effect, much better than using layer styles.

12. Flame around the smoke, and some transparent gas, which makes the flames look not so clear, we increase the number of fuzzy to simulate this effect. New Layer 2, in accordance with the method just stamp visible layer, Gaussian blur, radius of 50 pixels; the layer opacity set to 50%, mixed-mode "screen." (Figure 12)



13. Now the main part of the image has been completed, let us add some effects to it, make it look more realistic. New layer 3, another stamp visible layer, mixed-mode is set to "screen", opacity 60%, which we regard as a reflection. Select the magnifying tool, hold down the Alt key, and zoom function to reduce, in the map, click, until there is enough space around the image, as shown in Figure 13, reverse reflection layer, making it the top and the rest of the basic phase flame Then, a little gap but leaving a reasonable amount, so the effect will appear mysterious.



You are free to use this method on any object, as long as the triggering of an object with the shape of the path will be as a constituency, the other way and above the same. Now you also feel burning effects are so difficult to do it?







Recommand Link:



Youtube to M4V Pack



Recommend Newsgroup Clients



Bluesea VCD SVCD Ripper PLATINUM



How to check the regional oligarchy Dealers



Infomation Games BOARD



Mpg To Wmv Converter



MXF converter



mkv video format



Guide Registry Tools



Convert avi to ipod



MP3 Converter - rm,asf,mpg,wmv,mp3,ogg



AlltoDVD DVD to MPG



PowerFish iPod Backup



QuickTime Converter



Tuesday, July 6, 2010

Youtube to PS2 Software

Hot popluar youtube video Converter + download + player tool. With YouTube tool you can also convert downloaded YouTube videos to a format compatible with your favorite portable device; including - iPod Video, iPod Touch, iPod Nano, iPhone, Zune, PSP, as well as video capable MP3 players, video capable mobile phones, and Pocket PC, And finally... YouTube tool's embedded player will allow you to watch all your favorite YouTube videos off-line. So now you can enjoy any .flv and .swf videos anytime!
Supports YouTube video or any .flv and .swf file as input file. Supports not only YouTube video, but also various video formats as input file, including avi, DivX, XviD, rm, rmvb, MOV, MPEG, WMV. Supports a wide variety of output file format., including avi, DivX, XviD, rm, rmvb, MOV, MPEG, WMV. Provides various profiles, these profiles can meet the needs of most people. - is the most powerful YouTube assistant on the planet.



Recommand Link:



Ever M4P MP3 to MPC Backup



Pavtube DVD Copy



mp4 to wmv CONVERTER free



SIMPLE Telephony



Articles about Help Tools



Converter avi to 3gp



Youtube Movie To DAT Software



Recommend E-Commerce



Youtube to TV Mixer



Explosion DVD Manager



Mpg to dat



Merry MP3 CDA Audio To VQF Creator



Explosion XviD Converter



flv to mpeg Converter free



Thursday, July 1, 2010

Youtube Video to WMV Pack

It's most popular and very easy to use YouTube tools. helps you Fast download, convert, play, manage your favorite YouTube videos. If you're a YouTube fan, you'll love YouTube tool! is the most powerful YouTube assistant on the planet. YouTube tool easily: 1. Fast downloads YouTube videos, 2. Supports unlimited simultaneous downloads (a real time saver!), 3. Automatically names the downloaded video the same as the YouTube title, 4. Converts YouTube videos to various video formats, including Video, DVD, VCD, AVI, MPG, MPEG, Divx, Xvid, WMV, RM, RMVB, MOV, MP4, 3GP, SWF, DAT, H264, VOB, Flash, PDA, M4V, 3G2, AMV, CDA, DV,QuickTime, ASX, TV, VHS, FLV, H264, BDMV, MAC, Apple TV, Zune, iPod, PDA, PSP, PS2, PS3, Xbox, Xbox 360, Mobile Phone, Cell Phone, Blackberry, Wii, Laptops, Printers, Palm OS, Pocket PC, PPC, Treo, Psion, EPOC, iphone.
Easily Convert all popular video formats. Provides the highest speed to download YouTube video. Support unlimited simultaneous downloading tasks. Supports auto-name your downloaded video title as the YoutTube page shows. Offers you the most convenient task management and the easiest control capability. About Conversion Features. - is the most powerful YouTube assistant on the planet.