Kbase

Base de Conhecimento

Posts de Março, 2007

Menu do Excel desaparece

Publicado por agostinhojr em 26 Março, 2007

Ao abrir o meu excel tive um problema que foi o desaparecimento do menu do excel. Para resolver o problema tive que executar os seguintes paços:

  • Abrir o Excel.
  • Pressionar ALT + F11 para ativar o Editor do Visual Basic.
  • Abra uma janela dando um clique duplo no nome da planilha e execute o codigo abaixo.
  • Depois clique com o botão direito sobre a barra do menu e selecione personalizar.
  • Selecione a aba Barra de ferramentas e selecionar novamente todas as barras que sumiram.

Codigo para execução no VB

Sub ResetMenu()
Application.CommandBars(1).Enabled = True
End Sub

Enviado em office | 1 Comentário »

Como buscar uma string nos steps de jobs (MS SQL)

Publicado por agostinhojr em 23 Março, 2007

Utilize SQL abaixo para listar todos os jobs que possuem uma string, substituindo a palavra BUSCA pela string que deseja localizar.

SELECT j.name
FROM msdb.dbo.sysjobsteps js
inner join msdb.dbo.sysjobs j on j.job_id = js.job_id
WHERE (command LIKE ‘%BUSCA%’)

Enviado em MS SQL | Deixar um comentário »

Regular Expressions

Publicado por agostinhojr em 21 Março, 2007


NAME

perlre – Perl regular expressions

DESCRIPTION

This page describes the syntax of regular expressions in Perl. For a description of how to use regular expressions in matching operations, plus various examples of the same, see discussions of m//, s///, qr// and ?? in perlop/”Regexp Quote-Like Operators”. Matching operations can have various modifiers. Modifiers that relate to the interpretation of the regular expression inside are listed below. Modifiers that alter the way a regular expression is used by Perl are detailed in perlop/”Regexp Quote-Like Operators” and perlop/”Gory details of parsing quoted constructs”.

i
Do case-insensitive pattern matching. If use locale is in effect, the case map is taken from the current locale. See perllocale.
m
Treat string as multiple lines. That is, change “^” and “$” from matching the start or end of the string to matching the start or end of any line anywhere within the string.
s
Treat string as single line. That is, change “.” to match any character whatsoever, even a newline, which normally it would not match. The /s and /m modifiers both override the $* setting. That is, no matter what $* contains, /s without /m will force “^” to match only at the beginning of the string and “$” to match only at the end (or just before a newline at the end) of the string. Together, as /ms, they let the “.” match any character whatsoever, while yet allowing “^” and “$” to match, respectively, just after and just before newlines within the string.
x
Extend your pattern’s legibility by permitting whitespace and comments.

These are usually written as “the /x modifier”, even though the delimiter in question might not really be a slash. Any of these modifiers may also be embedded within the regular expression itself using the (?…) construct. See below. The /x modifier itself needs a little more explanation. It tells the regular expression parser to ignore whitespace that is neither backslashed nor within a character class. You can use this to break up your regular expression into (slightly) more readable parts. The # character is also treated as a metacharacter introducing a comment, just as in ordinary Perl code. This also means that if you want real whitespace or # characters in the pattern (outside a character class, where they are unaffected by /x), that you’ll either have to escape them or encode them using octal or hex escapes. Taken together, these features go a long way towards making Perl’s regular expressions more readable. Note that you have to be careful not to include the pattern delimiter in the comment–perl has no way of knowing you did not intend to close the pattern early. See the C-comment deletion code in perlop.

Regular Expressions

The patterns used in Perl pattern matching derive from supplied in the Version 8 regex routines. (The routines are derived (distantly) from Henry Spencer’s freely redistributable reimplementation of the V8 routines.) See Version 8 Regular Expressions for details. In particular the following metacharacters have their standard egrep-ish meanings:

    \ Quote the next metacharacter    ^ Match the beginning of the line    . Match any character (except newline)    $ Match the end of the line (or before newline at the end)     Alternation    () Grouping    [] Character class  

By default, the “^” character is guaranteed to match only the beginning of the string, the “$” character only the end (or before the newline at the end), and Perl does certain optimizations with the assumption that the string contains only one line. Embedded newlines will not be matched by “^” or “$”. You may, however, wish to treat a string as a multi-line buffer, such that the “^” will match after any newline within the string, and “$” will match before any newline. At the cost of a little more overhead, you can do this by using the /m modifier on the pattern match operator. (Older programs did this by setting $*, but this practice is now deprecated.) To simplify multi-line substitutions, the “.” character never matches a newline unless you use the /s modifier, which in effect tells Perl to pretend the string is a single line–even if it isn’t. The /s modifier also overrides the setting of $*, in case you have some (badly behaved) older code that sets it in another module. The following standard quantifiers are recognized:

    *    Match 0 or more times    +    Match 1 or more times    ?    Match 1 or 0 times    {n}    Match exactly n times    {n,}   Match at least n times    {n,m}  Match at least n but not more than m times  

(If a curly bracket occurs in any other context, it is treated as a regular character.) The “*” modifier is equivalent to {0,}, the “+” modifier to {1,}, and the “?” modifier to {0,1}. n and m are limited to integral ( answerid, faqid, answer, uid, status, datesub) values less than a preset limit defined when perl is built. This is usually 32766 on the most common platforms. The actual limit can be seen in the error message generated by code such as this:

    $_ **= $_ , / {$_} / for 2 .. 42;  

By default, a quantified subpattern is “greedy”, that is, it will match as many times as possible (given a particular starting location) while still allowing the rest of the pattern to match. If you want it to match the minimum number of times possible, follow the quantifier with a “?”. Note that the meanings don’t change, just the “greediness”:

    *?    Match 0 or more times    +?    Match 1 or more times    ??    Match 0 or 1 time    {n}?   Match exactly n times    {n,}?  Match at least n times    {n,m}? Match at least n but not more than m times  

Because patterns are processed as double quoted strings, the following also work:

    \t  tab                   (HT, TAB)    \n  newline               (LF, NL)    \r  return                (CR)    \f  form feed             (FF)    \a  alarm (bell)          (BEL)    \e  escape (think troff)  (ESC)    33 octal char (think of a PDP-11)    \x1B hex char    \x{263a} wide hex char         (Unicode SMILEY)    \c[  control char    \N{name} named char    \l  lowercase next char (think vi)    \u  uppercase next char (think vi)    \L  lowercase till \E (think vi)    \U  uppercase till \E (think vi)    \E  end case modification (think vi)    \Q  quote (disable) pattern metacharacters till \E  

If use locale is in effect, the case map used by \l, \L, \u and \U is taken from the current locale. See perllocale. For documentation of \N{name}, see charnames. You cannot include a literal $ or @ within a \Q sequence. An unescaped $ or @ interpolates the corresponding variable, while escaping will cause the literal string \$ to be matched. You'll need to write something like m/\Quser\E\@\Qhost/. In addition, Perl defines the following:

    \w Match a "word" character (alphanumeric plus "_")    \W Match a non-word character    \s Match a whitespace character    \S Match a non-whitespace character    \d Match a digit character    \D Match a non-digit character    \pP Match P, named property.  Use \p{Prop} for longer names.    \PP Match non-P    \X Match eXtended Unicode "combining character sequence",        equivalent to Cmenorque(?:\PM\pM*)maiorque    \C Match a single C char (octet) even under utf8.  

A \w matches a single alphanumeric character, not a whole word. Use \w+ to match a string of Perl-identifier characters (which isn't the same as matching an English word). If use locale is in effect, the list of alphabetic characters generated by \w is taken from the current locale. See perllocale. You may use \w, \W, \s, \S, \d, and \D within character classes, but if you try to use them as endpoints of a range, that's not a range, the "-" is understood literally. See utf8 for details about \pP, \PP, and \X. The POSIX character class syntax

    [:class:]  

is also available. The available classes and their backslash equivalents (if available) are as follows:

    alpha    alnum    ascii    cntrl    digit       \d    graph    lower    print    punct    space       \s    upper    word        \w    xdigit  

For example use [:upper:] to match all the uppercase characters. Note that the [] are part of the [::] construct, not part of the whole character class. For example:

    [01[:alpha:]%]  

matches one, zero, any alphabetic character, and the percentage sign. If the utf8 pragma is used, the following equivalences to Unicode \p{} constructs hold:

    alpha       IsAlpha    alnum       IsAlnum    ascii       IsASCII    cntrl       IsCntrl    digit       IsDigit    graph       IsGraph    lower       IsLower    print       IsPrint    punct       IsPunct    space       IsSpace    upper       IsUpper    word        IsWord    xdigit      IsXDigit  

For example [:lower:] and \p{IsLower} are equivalent. If the utf8 pragma is not used but the locale pragma is, the classes correlate with the isalpha(3) interface (except for `word’, which is a Perl extension, mirroring \w). The assumedly non-obviously named classes are:

cntrl
Any control character. Usually characters that don’t produce output as such but instead control the terminal somehow: for example newline and backspace are control characters. All characters with ord() less than 32 are most often classified as control characters.
graph
Any alphanumeric or punctuation character.
print
Any alphanumeric or punctuation character or space.
punct
Any punctuation character.
xdigit
Any hexadecimal digit. Though this may feel silly (/0-9a-f/i would work just fine) it is included for completeness.

You can negate the [::] character classes by prefixing the class name with a ‘^’. This is a Perl extension. For example:

    POSIX trad. Perl  utf8 Perl

    [:^digit:]      \D      \P{IsDigit}    [:^space:]     \S     \P{IsSpace}    [:^word:]     \W     \P{IsWord}  

The POSIX character classes [.cc.] and [=cc=] are recognized but not supported and trying to use them will cause an error. Perl defines the following zero-width assertions:

    \b Match a word boundary    \B Match a non-(word boundary)    \A Match only at beginning of string    \Z Match only at end of string, or before newline at the end    \z Match only at end of string    \G Match only at pos() (e.g. at the end-of-match position        of prior m//g)  

A word boundary (\b) is a spot between two characters that has a \w on one side of it and a \W on the other side of it (in either order), counting the imaginary characters off the beginning and end of the string as matching a \W. (Within character classes \b represents backspace rather than a word boundary, just as it normally does in any double-quoted string.) The \A and \Z are just like “^” and “$”, except that they won’t match multiple times when the /m modifier is used, while “^” and “$” will match at every internal line boundary. To match the actual end of the string and not ignore an optional trailing newline, use \z. The \G assertion can be used to chain global matches (using m//g), as described in perlop/”Regexp Quote-Like Operators”. It is also useful when writing lex-like scanners, when you have several patterns that you want to match against consequent substrings of your string, see the previous reference. The actual location where \G will match can also be influenced by using pos() as an lvalue. See perlfunc/pos. The bracketing construct ( … ) creates capture buffers. To refer to the digit’th buffer use \menorquedigitmaiorque within the match. Outside the match use “$” instead of “\”. (The \menorquedigitmaiorque notation works in certain circumstances outside the match. See the warning below about \1 vs $1 for details.) Referring back to another part of the match is called a backreference. There is no limit to the number of captured substrings that you may use. However Perl also uses \10, \11, etc. as aliases for 10, 11, etc. (Recall that 0 means octal, so 11 is the 9′th ASCII character, a tab.) Perl resolves this ambiguity by interpreting \10 as a backreference only if at least 10 left parentheses have opened before it. Likewise \11 is a backreference only if at least 11 left parentheses have opened before it. And so on. \1 through \9 are always interpreted as backreferences.” Examples:

    s/^([^ ]*) *([^ ]*)/$2 $1/;     # swap first two words

     if (/(.)\1/) {                 # find first doubled char         print "'$1' is the first doubled character\n";     }

    if (/Time: (..):(..):(..)/) {   # parse out ( answerid, faqid, answer, uid, status, datesub) values $hours = $1; $minutes = $2; $seconds = $3;    }  

Several special variables also refer back to portions of the previous match. $+ returns whatever the last bracket match matched. $& returns the entire matched string. (At one point $0 did also, but now it returns the name of the program.) $` returns everything before the matched string. And $’ returns everything after the matched string. The numbered variables ($1, $2, $3, etc.) and the related punctuation set (menorque$+, $&, $`, and $’) are all dynamically scoped until the end of the enclosing block or until the next successful match, whichever comes first. (See perlsyn/”Compound Statements”.) WARNING: Once Perl sees that you need one of $&, $`, or $’ anywhere in the program, it has to provide them for every pattern match. This may substantially slow your program. Perl uses the same mechanism to produce $1, $2, etc, so you also pay a price for each pattern that contains capturing parentheses. (To avoid this cost while retaining the grouping behaviour, use the extended regular expression (?: … ) instead.) But if you never use $&, $` or $’, then patterns without capturing parentheses will not be penalized. So avoid $&, $’, and $` if you can, but if you can’t (and some algorithms really appreciate them), once you’ve used them once, use them at will, because you’ve already paid the price. As of 5.005, $& is not so costly as the other two. Backslashed metacharacters in Perl are alphanumeric, such as \b, \w, \n. Unlike some other regular expression languages, there are no backslashed symbols that aren’t alphanumeric. So anything that looks like \\, \(, \), \menorque, \maiorque, \{, or \} is always interpreted as a literal character, not a metacharacter. This was once used in a common idiom to disable or quote the special meanings of regular expression metacharacters in a string that you want to use for a pattern. Simply quote all non-alphanumeric characters:

    $pattern =~ s/(\W)/\\$1/g;  

Today it is more common to use the quotemeta() function or the \Q metaquoting escape sequence to disable all metacharacters’ special meanings like this:

    /$unquoted\Q$quoted\E$unquoted/  

Beware that if you put literal backslashes (those not inside interpolated variables) between \Q and \E, double-quotish backslash interpolation may lead to confusing results. If you need to use literal backslashes within \Q…\E, consult perlop/”Gory details of parsing quoted constructs”.

Extended Patterns

Perl also defines a consistent extension syntax for features not found in standard tools like awk and lex. The syntax is a pair of parentheses with a question mark as the first thing within the parentheses. The character after the question mark indicates the extension. The stability of these extensions varies widely. Some have been part of the core language for many years. Others are experimental and may change without warning or be completely removed. Check the documentation on an individual feature to verify its current status. A question mark was chosen for this and for the minimal-matching construct because 1) question marks are rare in older regular expressions, and 2) whenever you see one, you should stop and “question” exactly what is going on. That’s psychology…

(?#text)
A comment. The text is ignored. If the /x modifier enables whitespace formatting, a simple # will suffice. Note that Perl closes the comment as soon as it sees a ), so there is no way to put a literal ) in the comment.
(?imsx-imsx)
One or more embedded pattern-match modifiers. This is particularly useful for dynamic patterns, such as those read in from a configuration file, read in as an argument, are specified in a table somewhere, etc. Consider the case that some of which want to be case sensitive and some do not. The case insensitive ones need to include merely (?i) at the front of the pattern. For example:
    $pattern = "foobar";    if ( /$pattern/i ) { }

    # more flexible:

    $pattern = "(?i)foobar";    if ( /$pattern/ ) { }   

Letters after a - turn those modifiers off. These modifiers are localized inside an enclosing group (if any). For example,

    ( (?i) blah ) \s+ \1  

will match a repeated (including the case!) word blah in any case, assuming x modifier, and no i modifier outside this group.

(?:pattern)
(?imsx-imsx:pattern)
This is for clustering, not capturing; it groups subexpressions like “()”, but doesn’t make backreferences as “()” does. So
    @fields = split(/\b(?:abc)\b/)  

is like

    @fields = split(/\b(abc)\b/)  

but doesn’t spit out extra fields. It’s also cheaper not to capture characters if you don’t need to. Any letters between ? and : act as flags modifiers as with (?imsx-imsx). For example,

    /(?s-i:more.*than).*million/i  

is equivalent to the more verbose

    /(?:(?s-i)more.*than).*million/i  

(?=pattern)
A zero-width positive look-ahead assertion. For example, /\w+(?=\t)/ matches a word followed by a tab, without including the tab in $&.
(?!pattern)
A zero-width negative look-ahead assertion. For example /foo(?!bar)/ matches any occurrence of “foo” that isn’t followed by “bar”. Note however that look-ahead and look-behind are NOT the same thing. You cannot use this for look-behind. If you are looking for a “bar” that isn’t preceded by a “foo”, /(?!foo)bar/ will not do what you want. That’s because the (?!foo) is just saying that the next thing cannot be “foo”–and it’s not, it’s a “bar”, so “foobar” will match. You would have to do something like /(?!foo)…bar/ for that. We say “like” because there’s the case of your “bar” not having three characters before it. You could cover that this way: /(?:(?!foo)…^.{0,2})bar/. Sometimes it’s still easier just to say:
    if (/bar/ && $` !~ /foo$/)  

For look-behind see below.

(?menorque=pattern)
A zero-width positive look-behind assertion. For example, /(?menorque=\t)\w+/ matches a word that follows a tab, without including the tab in $&. Works only for fixed-width look-behind.
(?menorque!pattern)
A zero-width negative look-behind assertion. For example /(?menorque!bar)foo/ matches any occurrence of “foo” that does not follow “bar”. Works only for fixed-width look-behind.
(?{ code })
WARNING: This extended regular expression feature is considered highly experimental, and may be changed or deleted without notice. This zero-width assertion evaluate any embedded Perl code. It always succeeds, and its code is not interpolated. Currently, the rules to determine where the code ends are somewhat convoluted. The code is properly scoped in the following sense: If the assertion is backtracked (compare “Backtracking”), all changes introduced after localization are undone, so that
  $_ = 'a' x 8;  mmenorque     (?{ $cnt = 0 })   # Initialize $cnt.     (       a       (?{           local $cnt = $cnt + 1; # Update $cnt, backtracking-safe.       })     )*      aaaa     (?{ $res = $cnt })   # On success copy to non-localized     # location.   maiorquex;  

will set $res = 4. Note that after the match, $cnt returns to the globally introduced value, because the scopes that restrict local operators are unwound. This assertion may be used as a (?(condition)yes-patternno-pattern) switch. If not used in this way, the result of evaluation of code is put into the special variable $^R. This happens immediately, so $^R can be used from other (?{ code }) assertions inside the same regular expression. The assignment to $^R above is properly localized, so the old value of $^R is restored if the assertion is backtracked; compare “Backtracking”. For reasons of security, this construct is forbidden if the regular expression involves run-time interpolation of variables, unless the perilous use re ‘eval’ pragma has been used (see re), or the variables contain results of qr// operator (see perlop/”qr/STRING/imosx”). This restriction is because of the wide-spread and remarkably convenient custom of using run-time determined strings as patterns. For example:

    $re = menorquemaiorque;    chomp $re;    $string =~ /$re/;  

Before Perl knew how to execute interpolated code within a pattern, this operation was completely safe from a security point of view, although it could raise an exception from an illegal pattern. If you turn on the use re ‘eval’, though, it is no longer secure, so you should only do so if you are also using taint checking. Better yet, use the carefully constrained evaluation within a Safe module. See perlsec for details about both these mechanisms.

(??{ code })
WARNING: This extended regular expression feature is considered highly experimental, and may be changed or deleted without notice. A simplified version of the syntax may be introduced for commonly used idioms. This is a “postponed” regular subexpression. The code is evaluated at run time, at the moment this subexpression may match. The result of evaluation is considered as a regular expression and matched as if it were inserted instead of this construct. The code is not interpolated. As before, the rules to determine where the code ends are currently somewhat convoluted. The following pattern matches a parenthesized group:
  $re = qr{      \(      (?:  (?maiorque [^()]+ ) # Non-parens without backtracking

  (??{ $re }) # Group with matching parens      )*      \)   }x;  

(?maiorquepattern)
WARNING: This extended regular expression feature is considered highly experimental, and may be changed or deleted without notice. An “independent” subexpression, one which matches the substring that a standalonepattern would match if anchored at the given position, and it matches nothing other than this substring. This construct is useful for optimizations of what would otherwise be “eternal” matches, because it will not backtrack (see “Backtracking”). It may also be useful in places where the “grab all you can, and do not give anything back” semantic is desirable. For example: ^(?maiorquea*)ab will never match, since (?maiorquea*) (anchored at the beginning of string, as above) will match all characters a at the beginning of string, leaving no a for ab to match. In contrast, a*ab will match the same as a+b, since the match of the subgroup a* is influenced by the following group ab (see “Backtracking”). In particular, a* inside a*ab will match fewer characters than a standalone a*, since this makes the tail match. An effect similar to (?maiorquepattern) may be achieved by writing (?=(pattern))\1. This matches the same substring as a standalone a+, and the following \1 eats the matched string; it therefore makes a zero-length assertion into an analogue of (?maiorque…). (The difference between these two constructs is that the second one uses a capturing group, thus shifting ordinals of backreferences in the rest of a regular expression.) Consider this pattern:
    m{ \(   (     [^()]+  # x+

            \( [^()]* \)          )+       \)     }x  

That will efficiently match a nonempty group with matching parentheses two levels deep or less. However, if there is no such group, it will take virtually forever on a long string. That’s because there are so many different ways to split a long string into several substrings. This is what (.+)+ is doing, and (.+)+ is similar to a subpattern of the above pattern. Consider how the pattern above detects no-match on ((()aaaaaaaaaaaaaaaaaa in several seconds, but that each extra letter doubles this time. This exponential performance will make it appear that your program has hung. However, a tiny change to this pattern

    m{ \(   (     (?maiorque [^()]+ ) # change x+ above to (?maiorque x+ )

            \( [^()]* \)          )+       \)     }x  

which uses (?maiorque…) matches exactly when the one above does (verifying this yourself would be a productive exercise), but finishes in a fourth the time when used on a similar string with 1000000 as. Be aware, however, that this pattern currently triggers a warning message under the use warnings pragma or -w switch saying it “matches the null string many times”): On simple groups, such as the pattern (?maiorque [^()]+ ), a comparable effect may be achieved by negative look-ahead, as in [^()]+ (?! [^()] ). This was only 4 times slower on a string with 1000000 as. The “grab all you can, and do not give anything back” semantic is desirable in many situations where on the first sight a simple ()* looks like the correct solution. Suppose we parse text with comments being delimited by # followed by some optional (horizontal) whitespace. Contrary to its appearence, #[ \t]*is not the correct subexpression to match the comment delimiter, because it may “give up” some whitespace if the remainder of the pattern can be made to match that way. The correct answer is either one of these:

    (?maiorque#[ \t]*)    #[ \t]*(?![ \t])  

For example, to grab non-empty comments into $1, one should use either one of these:

    / (?maiorque \# [ \t]* ) (        .+ ) /x;    /     \# [ \t]*   ( [^ \t] .* ) /x;  

Which one you pick depends on which of these expressions better reflects the above specification of comments.

(?(condition)yes-patternno-pattern)
(?(condition)yes-pattern)
WARNING: This extended regular expression feature is considered highly experimental, and may be changed or deleted without notice. Conditional expression. (condition) should be either an integer in parentheses (which is valid if the corresponding pair of parentheses matched), or look-ahead/look-behind/evaluate zero-width assertion. For example:
    m{ ( \( )?       [^()]+       (?(1) \) )     }x  

matches a chunk of non-parentheses, possibly included in parentheses themselves.

Backtracking

NOTE: This section presents an abstract approximation of regular expression behavior. For a more rigorous (and complicated) view of the rules involved in selecting a match among possible alternatives, see Combining pieces together. A fundamental feature of regular expression matching involves the notion called backtracking, which is currently used (when needed) by all regular expression quantifiers, namely *, *?, +, +?, {n,m}, and {n,m}?. Backtracking is often optimized internally, but the general principle outlined here is valid. For a regular expression to match, the entire regular expression must match, not just part of it. So if the beginning of a pattern containing a quantifier succeeds in a way that causes later parts in the pattern to fail, the matching engine backs up and recalculates the beginning part–that’s why it’s called backtracking. Here is an example of backtracking: Let’s say you want to find the word following “foo” in the string “Food is on the foo table.”:

    $_ = "Food is on the foo table.";    if ( /\b(foo)\s+(\w+)/i ) { print "$2 follows $1.\n";    }  

When the match runs, the first part of the regular expression (\b(foo)) finds a possible match right at the beginning of the string, and loads up $1 with “Foo”. However, as soon as the matching engine sees that there’s no whitespace following the “Foo” that it had saved in $1, it realizes its mistake and starts over again one character after where it had the tentative match. This time it goes all the way until the next occurrence of “foo”. The complete regular expression matches this time, and you get the expected output of “table follows foo.” Sometimes minimal matching can help a lot. Imagine you’d like to match everything between “foo” and “bar”. Initially, you write something like this:

    $_ =  "The food is under the bar in the barn.";    if ( /foo(.*)bar/ ) { print "got menorque$1maiorque\n";    }  

Which perhaps unexpectedly yields:

  got menorqued is under the bar in the maiorque  

That’s because .* was greedy, so you get everything between the first “foo” and the last “bar”. Here it’s more effective to use minimal matching to make sure you get the text between a “foo” and the first “bar” thereafter.

    if ( /foo(.*?)bar/ ) { print "got menorque$1maiorque\n" }  got menorqued is under the maiorque  

Here’s another example: let’s say you’d like to match a number at the end of a string, and you also want to keep the preceding part the match. So you write this:

    $_ = "I have 2 numbers: 53147";    if ( /(.*)(\d*)/ ) {    # Wrong! print "Beginning is menorque$1maiorque, number is menorque$2maiorque.\n";    }  

That won’t work at all, because .* was greedy and gobbled up the whole string. As \d* can match on an empty string the complete regular expression matched successfully.

    Beginning is menorqueI have 2 numbers: 53147maiorque, number is menorquemaiorque.  

Here are some variants, most of which don’t work:

    $_ = "I have 2 numbers: 53147";    @pats = qw{ (.*)(\d*) (.*)(\d+) (.*?)(\d*) (.*?)(\d+) (.*)(\d+)$ (.*?)(\d+)$ (.*)\b(\d+)$ (.*\D)(\d+)$    };

    for $pat (@pats) { printf "%-12s ", $pat; if ( /$pat/ ) {     print "menorque$1maiorque menorque$2maiorque\n"; } else {     print "FAIL\n"; }    }  

That will print out:

    (.*)(\d*)    menorqueI have 2 numbers: 53147maiorque menorquemaiorque    (.*)(\d+)    menorqueI have 2 numbers: 5314maiorque menorque7maiorque    (.*?)(\d*)   menorquemaiorque menorquemaiorque    (.*?)(\d+)   menorqueI have maiorque menorque2maiorque    (.*)(\d+)$   menorqueI have 2 numbers: 5314maiorque menorque7maiorque    (.*?)(\d+)$  menorqueI have 2 numbers: maiorque menorque53147maiorque    (.*)\b(\d+)$ menorqueI have 2 numbers: maiorque menorque53147maiorque    (.*\D)(\d+)$ menorqueI have 2 numbers: maiorque menorque53147maiorque  

As you see, this can be a bit tricky. It’s important to realize that a regular expression is merely a set of assertions that gives a definition of success. There may be 0, 1, or several different ways that the definition might succeed against a particular string. And if there are multiple ways it might succeed, you need to understand backtracking to know which variety of success you will achieve. When using look-ahead assertions and negations, this can all get even tricker. Imagine you’d like to find a sequence of non-digits not followed by “123″. You might try to write that as

    $_ = "ABC123";    if ( /^\D*(?!123)/ ) {  # Wrong! print "Yup, no 123 in $_\n";    }  

But that isn’t going to match; at least, not the way you’re hoping. It claims that there is no 123 in the string. Here’s a clearer picture of why it that pattern matches, contrary to popular expectations:

    $x = 'ABC123' ;    $y = 'ABC445' ;

    print "1: got $1\n" if $x =~ /^(ABC)(?!123)/ ;    print "2: got $1\n" if $y =~ /^(ABC)(?!123)/ ;

    print "3: got $1\n" if $x =~ /^(\D*)(?!123)/ ;    print "4: got $1\n" if $y =~ /^(\D*)(?!123)/ ;  

This prints

    2: got ABC    3: got AB    4: got ABC  

You might have expected test 3 to fail because it seems to a more general purpose version of test 1. The important difference between them is that test 3 contains a quantifier (\D*) and so can use backtracking, whereas test 1 will not. What’s happening is that you’ve asked “Is it true that at the start of $x, following 0 or more non-digits, you have something that’s not 123?” If the pattern matcher had let \D* expand to “ABC”, this would have caused the whole pattern to fail. The search engine will initially match \D* with “ABC”. Then it will try to match (?!123 with “123″, which fails. But because a quantifier (\D*) has been used in the regular expression, the search engine can backtrack and retry the match differently in the hope of matching the complete regular expression. The pattern really, really wants to succeed, so it uses the standard pattern back-off-and-retry and lets \D* expand to just “AB” this time. Now there’s indeed something following “AB” that is not “123″. It’s “C123″, which suffices. We can deal with this by using both an assertion and a negation. We’ll say that the first part in $1 must be followed both by a digit and by something that’s not “123″. Remember that the look-aheads are zero-width expressions–they only look, but don’t consume any of the string in their match. So rewriting this way produces what you’d expect; that is, case 5 will fail, but case 6 succeeds:

    print "5: got $1\n" if $x =~ /^(\D*)(?=\d)(?!123)/ ;    print "6: got $1\n" if $y =~ /^(\D*)(?=\d)(?!123)/ ;

    6: got ABC  

In other words, the two zero-width assertions next to each other work as though they’re ANDed together, just as you’d use any built-in assertions: /^$/ matches only if you’re at the beginning of the line AND the end of the line simultaneously. The deeper underlying truth is that juxtaposition in regular expressions always means AND, except when you write an explicit OR using the vertical bar. /ab/ means match “a” AND (then) match “b”, although the attempted matches are made at different positions because “a” is not a zero-width assertion, but a one-width assertion. WARNING: particularly complicated regular expressions can take exponential time to solve because of the immense number of possible ways they can use backtracking to try match. For example, without internal optimizations done by the regular expression engine, this will take a painfully long time to run:

    'aaaaaaaaaaaa' =~ /((a{0,5}){0,5}){0,5}[c]/  

And if you used *’s instead of limiting it to 0 through 5 matches, then it would take forever–or until you ran out of stack space. A powerful tool for optimizing such beasts is what is known as an “independent group”, which does not backtrack (see (?maiorquepattern)). Note also that zero-length look-ahead/look-behind assertions will not backtrack to make the tail match, since they are in “logical” context: only whether they match is considered relevant. For an example where side-effects of look-ahead might have influenced the following match, see (?maiorquepattern).

Version 8 Regular Expressions

In case you’re not familiar with the “regular” Version 8 regex routines, here are the pattern-matching rules not described above. Any single character matches itself, unless it is a metacharacter with a special meaning described here or above. You can cause characters that normally function as metacharacters to be interpreted literally by prefixing them with a “\” (e.g., “\.” matches a “.”, not any character; “\\” matches a “\”). A series of characters matches that series of characters in the target string, so the pattern blurfl would match “blurfl” in the target string. You can specify a character class, by enclosing a list of characters in [], which will match any one character from the list. If the first character after the “[" is "^", the class matches any character not in the list. Within a list, the "-" character specifies a range, so that a-z represents all characters between "a" and "z", inclusive. If you want either "-" or "]” itself to be a member of a class, put it at the start of the list (possibly after a “^”), or escape it with a backslash. “-” is also taken literally when it is at the end of the list, just before the closing “]”. (The following all specify the same class of three characters: [-az], [az-], and [a\-z]. All are different from [a-z], which specifies a class containing twenty-six characters.) Also, if you try to use the character classes \w, \W, \s, \S, \d, or \D as endpoints of a range, that’s not a range, the “-” is understood literally. Note also that the whole range idea is rather unportable between character sets–and even within character sets they may cause results you probably didn’t expect. A sound principle is to use only ranges that begin from and end at either alphabets of equal case ([a-e], [A-E]), or digits ([0-9]). Anything else is unsafe. If in doubt, spell out the character sets in full. Characters may be specified using a metacharacter syntax much like that used in C: “\n” matches a newline, “\t” a tab, “\r” a carriage return, “\f” a form feed, etc. More generally, \nnn, where nnn is a string of octal digits, matches the character whose ASCII value is nnn. Similarly, \xnn, where nn are hexadecimal digits, matches the character whose ASCII value is nn. The expression \cx matches the ASCII character control-x. Finally, the “.” metacharacter matches any character except “\n” (unless you use /s). You can specify a series of alternatives for a pattern using “” to separate them, so that feefiefoe will match any of “fee”, “fie”, or “foe” in the target string (as would f(eio)e). The first alternative includes everything from the last pattern delimiter (“(“, “[", or the beginning of the pattern) up to the first "", and the last alternative contains everything from the last "" to the next pattern delimiter. That's why it's common practice to include alternatives in parentheses: to minimize confusion about where they start and end. Alternatives are tried from left to right, so the first alternative found for which the entire expression matches, is the one that is chosen. This means that alternatives are not necessarily greedy. For example: when matching foofoot against "barefoot", only the "foo" part will match, as that is the first alternative tried, and it successfully matches the target string. (This might not seem important, but it is important when you are capturing matched text using parentheses.) Also remember that "" is interpreted as a literal within square brackets, so if you write [feefiefoe] you’re really only matching [feio]. Within a pattern, you may designate subpatterns for later reference by enclosing them in parentheses, and you may refer back to the nth subpattern later in the pattern using the metacharacter \n. Subpatterns are numbered based on the left to right order of their opening parenthesis. A backreference matches whatever actually matched the subpattern in the string being examined, not the rules for that subpattern. Therefore, (00x)\d*\s\1\d* will match “0×1234 0×4321″, but not “0×1234 01234″, because subpattern 1 matched “0x”, even though the rule 00x could potentially match the leading 0 in the second number.

Warning on \1 vs $1

Some people get too used to writing things like:

    $pattern =~ s/(\W)/\\\1/g;  

This is grandfathered for the RHS of a substitute to avoid shocking the sed addicts, but it’s a dirty habit to get into. That’s because in PerlThink, the righthand side of a s/// is a double-quoted string. \1 in the usual double-quoted string means a control-A. The customary Unix meaning of \1 is kludged in for s///. However, if you get into the habit of doing that, you get yourself into trouble if you then add an /e modifier.

    s/(\d+)/ \1 + 1 /eg;     # causes warning under -w  

Or if you try to do

    s/(\d+)/\1000/;  

You can’t disambiguate that by saying \{1}000, whereas you can fix it with ${1}000. The operation of interpolation should not be confused with the operation of matching a backreference. Certainly they mean two different things on the left side of the s///.

Repeated patterns matching zero-length substring

WARNING: Difficult material (and prose) ahead. This section needs a rewrite. Regular expressions provide a terse and powerful programming language. As with most other power tools, power comes together with the ability to wreak havoc. A common abuse of this power stems from the ability to make infinite loops using regular expressions, with something as innocuous as:

    'foo' =~ m{ ( o? )* }x;  

The o? can match at the beginning of ‘foo’, and since the position in the string is not moved by the match, o? would match again and again because of the * modifier. Another common way to create a similar cycle is with the looping modifier //g:

    @matches = ( 'foo' =~ m{ o? }xg ,1,5,UNIX_TIMESTAMP());  

or

    print "match: menorque$&maiorque\n" while 'foo' =~ m{ o? }xg;  

or the loop implied by split(). However, long experience has shown that many programming tasks may be significantly simplified by using repeated subexpressions that may match zero-length substrings. Here’s a simple example being:

    @chars = split //, $string;    # // is not magic in split    ($whitewashed = $string) =~ s/()/ /g; # parens avoid magic s// /  

Thus Perl allows such constructs, by forcefully breaking the infinite loop. The rules for this are different for lower-level loops given by the greedy modifiers *+{}, and for higher-level ones like the /g modifier or split() operator. The lower-level loops are interrupted (that is, the loop is broken) when Perl detects that a repeated expression matched a zero-length substring. Thus

   m{ (?: NON_ZERO_LENGTH  ZERO_LENGTH )* }x;  

is made equivalent to

   m{   (?: NON_ZERO_LENGTH )*

        (?: ZERO_LENGTH )?    }x;  

The higher level-loops preserve an additional state between iterations: whether the last match was zero-length. To break the loop, the following match after a zero-length match is prohibited to have a length of zero. This prohibition interacts with backtracking (see “Backtracking”), and so the second best match is chosen if the best match is of zero length.

For example:

    $_ = 'bar';    s/\w??/menorque$&maiorque/g;  

results in "menorquemenorquebmaiorquemenorquemaiorquemenorqueamaiorquemenorquemaiorquemenorquermaiorquemenorquemaiorque”maiorque. At each position of the string the best match given by non-greedy ?? is the zero-length match, and the second best match is what is matched by \w. Thus zero-length matches alternate with one-character-long matches.

Similarly, for repeated m/()/g the second-best match is the match at the position one notch further in the string.

The additional state of being matched with zero-length is associated with the matched string, and is reset by each assignment to pos(). Zero-length matches at the end of the previous match are ignored during split.

Combining pieces together

Each of the elementary pieces of regular expressions which were described before (such as ab or \Z) could match at most one substring at the given position of the input string. However, in a typical regular expression these elementary pieces are combined into more complicated patterns using combining operators ST, ST, S* etc (in these examples S and T are regular subexpressions).

Such combinations can include alternatives, leading to a problem of choice: if we match a regular expression aab against "abc", will it match substring "a" or "ab"? One way to describe which substring is actually matched is the concept of backtracking (see “Backtracking”). However, this description is too low-level and makes you think in terms of a particular implementation.

Another description starts with notions of “better”/”worse”. All the substrings which may be matched by the given regular expression can be sorted from the “best” match to the “worst” match, and it is the “best” match which is chosen. This substitutes the question of “what is chosen?” by the question of “which matches are better, and which are worse?”.

Again, for elementary pieces there is no such question, since at most one match at a given position is possible. This section describes the notion of better/worse for combining operators. In the description below S and T are regular subexpressions.

ST

Consider two possible matches, AB and A'B', A and A' are substrings which can be matched by S, B and B' are substrings which can be matched by T.

If A is better match for S than A', AB is a better match than A'B'.

If A and A' coincide: AB is a better match than AB' if B is better match for T than B'.

ST

When S can match, it is a better match than when only T can match.

Ordering of two matches for S is the same as for S. Similar for two matches for T.

S{REPEAT_COUNT}
Matches as SSS...S (repeated as many times as necessary).
S{min,max}
Matches as S{max}S{max-1}...S{min+1}S{min}.
S{min,max}?
Matches as S{min}S{min+1}...S{max-1}S{max}.
S?, S*, S+
Same as S{0,1}, S{0,BIG_NUMBER}, S{1,BIG_NUMBER} respectively.
S??, S*?, S+?
Same as S{0,1}?, S{0,BIG_NUMBER}?, S{1,BIG_NUMBER}? respectively.
(?maiorqueS)
Matches the best match for S and only that.
(?=S), (?menorque=S)
Only the best match for S is considered. (This is important only if S has capturing parentheses, and backreferences are used somewhere else in the whole regular expression.)
(?!S), (?menorque!S)
For this grouping operator there is no need to describe the ordering, since only whether or not S can match is important.
(??{ EXPR })
The ordering is the same as for the regular expression which is the result of EXPR.
(?(condition)yes-patternno-pattern)
Recall that which of yes-pattern or no-pattern actually matches is already determined. The ordering of the matches is the same as for the chosen subexpression.

The above recipes describe the ordering of matches at a given position. One more rule is needed to understand how a match is determined for the whole regular expression: a match at an earlier position is always better than a match at a later position.

Creating custom RE engines

Overloaded constants (see overload) provide a simple way to extend the functionality of the RE engine.

Suppose that we want to enable a new RE escape-sequence \Y which matches at boundary between white-space characters and non-whitespace characters. Note that (?=\S)(?menorque!\S)(?!\S)(?menorque=\S) matches exactly at these positions, so we want to have each \Y in the place of the more complicated version. We can create a module customre to do this:

    package customre;    use overload;

    sub import {      shift;      die "No argument to customre::import allowed" if @_;      overload::constant 'qr' =maiorque \&convert;    }

    sub invalid { die "/$_[0]/: invalid escape '\\$_[1]'"}

    my %rules = ( '\\' =maiorque '\\',    'Y' =maiorque qr/(?=\S)(?menorque!\S)(?!\S)(?menorque=\S)/ );    sub convert {      my $re = shift;      $re =~ s{                \\ ( \\  Y . )              }              { $rules{$1} or invalid($re,$1) }sgex;      return $re;    }  

Now use customre enables the new escape in constant regular expressions, i.e., those without any runtime variable interpolations. As documented in overload, this conversion will work only over literal parts of regular expressions. For \Y$re\Y the variable part of this regular expression needs to be converted explicitly (but only if the special meaning of \Y should be enabled inside $re):

    use customre;    $re = menorquemaiorque;    chomp $re;    $re = customre::convert $re;    /\Y$re\Y/;  

BUGS

This document varies from difficult to understand to completely and utterly opaque. The wandering prose riddled with jargon is hard to fathom in several places.

This document needs a rewrite that separates the tutorial content from the reference content.

SEE ALSO

perlop/”Regexp Quote-Like Operators”.

perlop/”Gory details of parsing quoted constructs”.

perlfaq6.

perlfunc/pos.

perllocale.

Mastering Regular Expressions by Jeffrey Friedl, published by O’Reilly and Associates.

Enviado em Referencia | Deixar um comentário »

Creating a Windows Service through Visual Studio.NET

Publicado por agostinhojr em 21 Março, 2007

 

Creating a Windows Service through Visual Studio.NET

Synopsis:

Services run in the Windows operating system as a part of the operating system. These components activate when the operating system boots and keep functioning until the operating system is shut down. This article is a walk through that guides you how to create your own Windows services through Visual Studio.NET.

Note: These concepts do not apply to Windows 9x and Windows Me operating systems.

Defining the Problem:

There are often times when you would have felt the need to create some module or part of your application that would boot up with the operating system and stays functioning until the operating system is not shut down or some type of process that would repeat itself after a specific period of time and etc.

Defining the Solution:

Cases that have been mentioned above require to create serviced components. A serviced component runs as a service in the Windows operating system. If you have worked on Windows NT or Windows 2000 platforms, you would know about many Windows services like Print Spooler Service, Fax Service, Event Log and etc. All these services activate with the operating system and perform different operations related to operating system or the software application along with which they get installed. Although services can automatically start themselves, but you can also change their status by altering their Startup Type property to Manual or Disabled through the Service Control Manager (SCM).

Getting Started

Lets now start with the process of creating a Windows service of our own. In this article I will be creating a Windows service that deletes records from a table after an interval of two minutes. The service will also write entries in a log file of its own.

Open up Visual Studio and select File-New-Project. From the project type window that appears select the Windows Service template. Name the project and select the location where you want this project to be created. In the case of this example, I have named my project as AspaService.

(Figure shows Window Service template selected for creating the new project)

Click the OK button. Visual Studio.NET creates a default template and displays the design view of a page named as Service1.vb, as also shown in the figure below.

(Figure shows default template for the Window Service project created by VS.NET)

In the Properties pane, change the File Name property of the file to DeleteRecords.vb. Changing the file name also changes the name of the file on the designer tab.

Now place a Timer control and an EventLog control from the Toolbox-Components menu on the designer. See the following figure.

(Figure shows the Timer and EventLog components placed on the designer)

After placing the components, double click on the designer window to open up its source file. In the source file expand the Component Designer Generated Code section. Under the Sub New sub procedure write down the following lines of code after the InitializeComponent() method.

If Not EventLog.SourceExists(“MySource”) Then
EventLog.CreateEventSource(“MySource”, “MyNewLog”)
End If

EventLog1.Source = “MySource”
EventLog1.Log = “MyNewLog”

See the following figure for a more clear view.

(Figure shows the code written for creating an event log source)

The code here checks to see if an eventlog source file by name of MySource exists. If it does that file would be assigned to our EventLog object as the source file, otherwise the file would first be created and then be used.

Close the Component Designer Generated Code region by clicking on the (-) sign next to it. This would close the node and the code in it. Notice that there are two sub procedures that are also existing in the source file. These have been shown below in the figure.

(Figure shows the events of the Windows service generated in the default template by VS.NET)

The OnStart() and OnStop() are among two of the events of a Windows service. There are others also like OnContinue and OnPause() etc, but these are the two that are created for us in the default template. The OnStart() event occurs when the service starts and the OnStop() event occurs when the serviced component is stopped. Before writing code into these events first of all include the following namespace at the top of your source file.

                     

Imports System.Data.SqlClient

 
       

Since the service would be used to delete records from a table after a specific period of time therefore this namespace is required to declare the objects that would be used for connecting and executing the SQL statements on the database server.

After this declare a variable of date data type in the class and initialize it with the current date and time. See the following figure.

(Figure shows the declaring and the initializing of a Date data type variable)

As shown in the figure a variable named _PreviousTime of data type Date is declared and is initialized with the current date and time of the system, which is assigned to it through the Now() function.

Now from the designer view, double click on the timer control and write the code within its Elapsed event as shown in the figure below.

(Figure shows the code for the Elapsed event of the Timer Control)

This event is fired by the timer after every millisecond (the default behavior which can be changed). On being fired, it compares the current minute of the system time by subtracting two from it with the minute of the time stored in the _PreviousTime variable. On having a match it would call the custom defined procedure DeleteRecords(), that would actually delete the records from the table in the database server. The code for DeleteRecords() is as shown below in the figure.

(Figure shows code for the custom sub procedure DeleteRecords( ))

The code in the procedure is simple. It creates a connection object that is being used to connect to the Pubs database on the local system server. A command object is also created that is provided the connection object and the query parameters in the constructor. The temp is a table that you will have to create yourself as it is not provided in the Pubs database by default.

Within the Try block the command object is executed and incase of a successful execution the entry is listed into the log file that was created earlier in this project. The Try and Catch section is to handle any types of errors that may arise and incase if an error is encountered it would be written into the same eventlog file that was created earlier.

Having done this, add some lines of code to the OnStart() and OnStop() events of the service also. See the following figure.

(Figure Shows the code to be written in the OnStart and OnStop events)

When the service starts it will make an entry into the log file stating “In OnStart” and after that it would start the timer. Similarly, when the service is stopped, an entry is made in the log file and the timer is stopped.

This completes the coding required to create the service. But the service cannot be just tested by clicking F5. For testing a service it is required to be installed first.

Creating an Installer for the service

Return to the designer view and click on the background of the designer to select it.

Once selected change the Name and ServiceName properties to AspaService.

Right click on the designer and select the Add Installer option. Visual Studio will create a new component class named as ProjectInstaller. The design view of the class will show two installers on the designer. The ServiceInstaller1 is to install your service and the other ServiceProcessInstaller1 is to install the process associated with the service. See the following figure.

(Figure shows the design view for the Project Installer having two installer placed by default)

Click on ServiceInstaller1, set the Name property to AspaService and StartType property to Automatic.

Now click on ServiceProcessInstaller1 to select it. Set the Account property to LocalSystem. Incase if you leave it as User, you would be required to provide a username and a password during installation. The other two options for the property i.e. LocalService and NetworkService are only applicable on WindowsXP.

Creating a Setup Project

For creating a setup project, select File-New-Project.

From the New Project window, select Setup and Deployment Projects from Project Types and select Setup Project from the Templates pane.

Name the project as Aspa Service Setup and select the Add to Solution radio button option. See the figure below for a demonstration.

(Figure shows settings for the new Setup Project)

Click OK. Visual studio will create a default template for you.

In the solution explorer right click on the Aspa Service Setup, point to Add, then choose Project Output. The Add Project Output Group dialog appears.

Make sure that AspaService is selected in the Project box. From the list box below the Project box, select Primary Output. This has been displayed in the figure below.

(Figure shows settings for Add Project Output Group)

Click OK. A project item for the primary output of AspaService is added to the setup project. Now add a custom action to install the AspaService.exe file.

Adding a Custom Action to the Setup Project

In Solution Explorer, right-click the setup project, point to View, then choose Custom Actions. The Custom Actions editor appears.

In the Custom Actions editor, right-click the Custom Actions node and choose Add Custom Action. The Select Item in Project dialog box appears.

Double-click the Application Folder in the list box to open it, select Primary Output from AspaService(Active), and click OK. The primary output is added to all four nodes of the custom actions — Install, Commit, Rollback, and Uninstall.

Now Build the Setup Project.

Installing the Service

Browse to where the setup project has been saved and double click the .msi file. Install the service and then view it through the SCM. The SCM can be opened from Start-Programs-Administrative Tools-Services menu. In the SCM the service will appear by the name of AspaService or any other name that you have given to the service.

The Service in action

Click on the service to select it. Then right click and select the Start option. This would start your service and it would also write down an entry into the log file. To view the log file open the Event Viewer from the Administrative Tools menu. Within the Event Viewer click on MyNewLog in the left pane and then from the right pane double click on the first event entry. See the description section and it will show In OnStart, which is what you specified in the OnStart event of your service.

Create a table in the pubs database by name of temp and fill it with some records. After an interval of two minutes review the table and you would see that all of the records from the table have been deleted. Another entry for the successful deletion of the records will also be listed in the log and you can view that from the Event Viewer as well.

Uninstalling the Service

To uninstall the service simply rerun the .msi file. Select the Remove option from the wizard window and the service will be uninstalled automatically.

Categories:

Enviado em .NET, windows | Deixar um comentário »

Tipos de dados do banco MS Access

Publicado por agostinhojr em 21 Março, 2007

Propriedade Type

Define ou retorna um valor que indica o tipo operacional ou o tipo de dados de um objeto. Configurações e valores de retorno A configuração ou valor de retorno é uma constante que indica um tipo operacional ou de dados. Para um objeto Field, Parameter ou Property, as possíveis configurações e valores de retorno são os seguintes:

Constante Descrição Observação
dbBigInt Inteiro grande tipo de dados Big Integer – Um tipo de dados que armazena um valor numérico exato e com sinal, com precisão 19 (com sinal) ou 20 (sem sinal), escala 0 (com sinal: -263 ≤ n ≤ 263-1; sem sinal: 0 ≤ n ≤ 264-1).
dbBigInt Inteiro grande tipo de dados Big Integer – Um tipo de dados que armazena um valor numérico exato e com sinal, com precisão 19 (com sinal) ou 20 (sem sinal), escala 0 (com sinal: -263 ≤ n ≤ 263-1; sem sinal: 0 ≤ n ≤ 264-1).
dbBinary Binário tipo de dados Binary – Um tipo de dados que armazena dados binários de comprimento fixo. O comprimento máximo é de 255 bytes
dbBoolean Booleano tipo de dados Boolean – Um valor True/False ou sim/não. Os valores Boolean normalmente são armazenados em campos de bits em um banco de dados Microsoft Jet; entretanto, alguns bancos de dados não dão suporte direto a este tipo de dados.”
dbByte Byte Tipo de dados Byte – Um tipo de dados fundamental usado para manter os números inteiros positivos menores em um intervalo de 0 a 255.
dbChar Caracter tipo de dados Char – Um tipo de dados que armazena uma seqüência de caracteres de comprimento fixo. O comprimento é definido pela propriedade Size.
dbCurrency Unidade monetária Tipo de dados Currency Um tipo de dados útil para cálculos envolvendo dinheiro ou para cálculos de ponto fixo em que a precisão é extremamente importante. Este tipo de dados é usado para armazenar números com até 15 dígitos à esquerda do ponto decimal e 4 dígitos à direita. Como o tipo de dados Currency usa valores distintos em todas as quantidades, o arredondamento binário não é um fator no cálculo de totais.
dbDate Data/hora datas e horas As datas e horas são armazenadas internamente como partes diferentes de um número real. O valor à esquerda do decimal representa uma data entre 30 de dezembro de 1899 e 30 de dezembro de 9999, inclusive. Os valores negativos representam as datas anteriores a 30 de dezembro de 1899. O valor à direita do decimal representa uma hora entre 0:00:00 e 23:59:59, inclusive. O meio-dia é representado por 5.
dbDecimal Decimal tipo de dados Decimal Um tipo de dados que armazena um valor numérico exato e com sinal, com precisão p e escala s (1 ≤ p ≤15; 0 ≤ s ≤ p).
dbDouble Duplo tipo de dados Double Um tipo de dados fundamental que dá suporte aos números de ponto flutuante de dupla precisão no formato IEEE. Uma variável Double é armazenada como um número de 64 bits (8 bytes) no intervalo de -1,79769313486231E308 a -4,94065645841247E-324 para valores negativos, de 4,94065645841247E-324 a 1,79769313486231E308 para valores positivos e 0.
dbFloat Flutuante tipo de dados Float Um tipo de dados que armazena um valor numérico aproximado e com sinal, com precisão da mantissa de 15 (zero ou valor absoluto de 10-308 a 10.308).
dbGUID GUID tipo de dados GUID Globally Unique Identifier/Universally Unique Identifier (GUID, identificador exclusivo global/identificador exclusivo universal). Uma seqüência de caracteres de identificação exclusiva usada com chamadas remotas de procedimento. Todas as interfaces e classes de objetos usam um GUID para identificação. Os GUIDs no cliente e no servidor devem coincidir para que o cliente e o servidor se vinculem. Os fabricantes de objetos podem solicitar que a Microsoft aloque um ou mais conjuntos de 256 GUIDs para seu uso exclusivo. Por outro lado, se você tiver uma placa de rede, poderá executar uma ferramenta chamada Uuidgen.exe, que fornece um conjunto de 256 GUIDs baseado na hora do dia, data e um número exclusivo contido na sua placa de rede.
dbInteger Inteiro tipo de dados Integer Um tipo de dados fundamental que contém números inteiros. Uma variável Integer é armazenada como um número de 16 bits (2 bytes) no intervalo de -32.768 a 32.767.
dbLong Longo tipo de dados Long Um tipo de dados fundamental que mantém números inteiros extensos. A variável Long é armazenada como um número de 32 bits (4 bytes) com valor no intervalo de -2.147.483.648 a 2.147.483.647.
dbLongBinary Binário longo (objeto OLE) tipo de dados OLE Object Um tipo de dados de campos que você usa em objetos criados em outros aplicativos que podem ser vinculados ou incorporados em um banco de dados Microsoft Jet. Por exemplo, você poderia usar um campo Objeto OLE para armazenar uma coleção de figuras.
dbMemo Memorando tipo de dados Memo Um tipo de dados de campo, como por exemplo, os campos que podem conter até 1,2 GB de dados de texto.
dbNumeric Numérico tipo de dados Numeric Um tipo de dados que armazena um valor numérico exato e com sinal, com precisão p e escala s (1 ≤ p ≤15; 0 ≤ s ≤ p).
dbSingle Único tipo de dados Single Um tipo de dados fundamental que mantém números de ponto flutuante de precisão simples no formato IEEE. Uma variável Single é armazenada como um número de 32 bits (4 bytes) com um valor no intervalo de -3,402823E38 a -1,401298E-45 para valores negativos, de 1,401298E-45 a 3,402823E38 para valores positivos e 0.
dbText Texto Tipo de dados Text Um tipo de dados de campo. Os campos de texto podem conter até 255 caracteres ou o número de caracteres especificado pela propriedade Size do objeto Field, aquele que for menor. Se a propriedade Size do campo de texto for definida como 0, o campo de texto poderá conter até 255 caracteres de dados.
dbTime Hora tipo de dados Time Um tipo de dados que armazena um valor de tempo. O valor depende da configuração do relógio da fonte de dados.
dbTimeStamp Carimbo de hora tipo de dados TimeStamp Um tipo de dados que armazena um TimeStamp. O valor depende da configuração do relógio da fonte de dados.

Propriedade Tipo (MDB)

No Microsoft Access, você pode definir o tipo de dados de um campo no modo estrutura da tabela, além de poder definir o tipo de dados de um parâmetro na caixa de diálogo Parâmetros da consulta. Essas ações equivalem a definir a propriedade Tipo DAO para um objeto Field ou um objeto Parameter utilizando o Visual Basic. A tabela a seguir lista as constantes da propriedade Tipo DAO e as configurações correspondentes do Microsoft Access para os tipos de dados de parâmetro e de campo se você os estiver definindo a partir de tabela modo estrutura ou da caixa de diálogo Parâmetros da consulta. Ao criar um campo de tabela com o tipo de dados Número, defina a propriedade FieldSize para especificar qual dos seis tipos de dados numéricos será o campo. Por padrão, essa propriedade é definida como Inteiro longo. As outras configurações são Byte, Inteiro, Simples, Duplo e CódigoDeReplicação.

Constante Configuração do campo de tabela Configuração do parâmetro de consulta
dbBoolean Sim/Não Sim/Não
dbByte Número(FieldSize = Byte) Byte
dbCurrency Moeda Moeda
dbDate Data/Hora Data/Hora
dbDouble Número(FieldSize = Duplo) Duplo
dbGUID Número ou AutoNumeração(FieldSize = CódigoDeReplicação) Sem suporte
dbInteger Número(FieldSize = Inteiro) Inteiro
dbLong Número(FieldSize = Inteiro Longo) Inteiro longo
AutoNumeração(FieldSize = Inteiro longo) Sem suporte
dbLongBinary Objeto OLE Objeto OLE
Sem suporte Binário
dbMemo Memorando Memorando
dbSingle Número(FieldSize = Simples) Simples
dbText Texto Texto
Sem suporte Sem suporte Valor

Observação: O tipo de dados de parâmetro Valor não corresponde a um tipo de dados definido pelo mecanismo de banco de dados Microsoft Jet. Ele corresponde à palavra reservada SQL VALUE, que pode ser utilizada para criar uma consulta parâmetro. Em consultas SQL ou do Microsoft Access, VALUE pode ser considerado um sinônimo válido para o tipo de dados Variante do Visual Basic.

Enviado em Referencia | Deixar um comentário »

Verificar todas as variaveis do servidor

Publicado por agostinhojr em 21 Março, 2007

<%
for each i in request.servervariables
response.write i&” —-> “&request.servervariables(i)&”<br><br>”
next
%>;

Enviado em .NET, IIS | Deixar um comentário »

Padrões de nomenclaturas – Guia de consulta rápida

Publicado por agostinhojr em 21 Março, 2007



Padrões de nomenclaturas – Guia de consulta rápida


Para garantir a qualidade de qualquer sistema temos um ponto muito importante a definir em nosso projeto, independente de ser um projeto desenvolvido por uma ou mais pessoas, este ponto é a padronização. A forma mais fácil de nosso código estar bem escrito, de forma fácil de entender onde todos da equipe possam saber tudo que acontece no sistema é padronizando o máximo possível do trabalho realizado. O padrão é algo que deve ser definido pela equipe de desenvolvimento antes do início do projeto. Após o padrão definido e o projeto ser iniciado, ele jamais pode ser alterado ou discutido, todos devem seguir o padrão. Estarei mostrando uma padronização que defini. Não sei se é a melhor ou a pior, só sei que se for bem seguida, qualquer projeto fica fácil de ser entendido. Retirei um pouco de sites, um pouco de livros e montei este padrão. Cada equipe de projeto deve se reunir antes do início do projeto e montar o seu padrão onde todos devem opinar e votar nos pontos mais críticos.

Padrão de nomenclatura arquivos















Tipo Nomenclatura Exemplo
Formulário frm frmMenu
Formulário (Janela Pop up) frmPop frmPopJanela
Classe cls clsFuncionario
Módulo mdl mdlModulo
User Control wuc wucControle
Folha de Estilo css cssFormulario
Java Script jsc jscFuncao
Relatório rel relRelatorio
DataSet dst dstFatura
XML xml xmlArquivo
Custom Control cco ccoControle
Página html htm htmPagina

Padrão de Sub´s e funções

Subs






Funções






Variáveis



















Objetos
Banco de Dados









Controles


















































Procedures, Views e Functions

Nomenclatura (ex. Mailing)





Nomenclatura (ex. Banco de Dados Geral)





Parâmetros de Procedures

Idêntico ao campo da tabela inclusive o tipo e o tamanho
Ex. Campo – cliCodigo char (10)
Declare @cliCodigo as char(10)

Caso não seja campo de tabela deve-se seguir o padrão de variáveis.

Tabela

ex. Cadastro de Clientes
tblCliente
Obs. Deve-se evitar comer palavas. Exemplo tblCliInternacional

Campo

ex. Razão Social no Cadastro de Clientes





Tabelas com nomes compostos
Ex. Endereço na tabela tblClienteEndereco





Obs. Campos Padrões

Data: Dt
Quantidade: Qtd

Data (ex. data de cadastro)





Código (ex. Código do cliente)





COMENTÁRIOS

Banco de dados

/*

* -----------------------------------------------------------------------------
* EMPRESA : XYZ INFORMÁTICA
* SISTEMA : FATURAMENTO
* OBJETIVO : ALTARAÇÃO DE AVISOS
* AUTOR : JOÃO NINGUÉM
* CRIAÇÃO : 15/06/2005
* MANUTENÇÃO:
* OBSERVAÇÃO:
* -----------------------------------------------------------------------------
*/



Programas

/*
* -----------------------------------------------------------------------------
* EMPRESA : XYZ INFORMÁTICA
* OBJETIVO :
* -----------------------------------------------------------------------------
* AUTOR : JOÃO NINGUÉM
* DATA CRIAÇÃO : 15/06/2005
* MANUTENÇÃO:
* OBSERVAÇÃO :
* -----------------------------------------------------------------------------
*/

Categories:

Enviado em .NET | Deixar um comentário »

Acrônimos

Publicado por agostinhojr em 21 Março, 2007

Internet abbreviations

A| B| C| D|E| F| G| H| I | J| K| L|M| N| O|P| Q| R| S| T| U| V| W| X| Y| Z


A

10Q         - Thank You1FTR        - One For The Road24/7        - 24 hours a day, 7 days a weekAAMOF       - As A Matter Of FactACK         - AcknowledgementACRONYM     - Abbreviated Coded Rendition Of Name Yielding MeaningADN         - Any Day NowAFAIAC      - As Far As I Am ConcernedAFAICT      - As Far As I Can TellAFAIK       - As Far As I KnowAFAIUI      - As Far As I Understand ItAFK         - Away From The KeyboardAISB        - As I Said BeforeAISE        - As I Said EarlierAISI        - As I See ItAIW         - As It Were/WasAKA         - Also Known AsAMAP        - As Much/Many As PossibleAMF         - Adios My Friend; Adios Mother F*ckerANFAWFOS    - And Now For A Word From Our SponsorANSI        - American National Standards InstituteAOB         - Any Other BusinessAPAC        - All Praise And CreditAPI         - Application Program InterfaceARPA        - Advanced Research Projects AgencyASAFP       - As Soon As F*cking PossibleASAP        - As Soon As PossibleASCII       - American Standard Code for Information InterchangeATB         - All The BestATK         - At The KeyboardATLA        - Another Three Letter AcronymATTN        - AttentionATTYOB      - Anything That Turns You On BabyAWCIGO      - And Where Can I Get OneAWGTHTGTATA - Are We Going To Have To Go Through All This/That AgainAWGTHTGTTA  - Are We Going To Have To Go Through This/That AgainAWHFY       - Are We Having Fun YetAYT         - Are You There


B

B/C         - BecauseB4          - BeforeB4N         - Bye For NowBAC         - By Any ChanceBAD         - Broken As DesignedBAK         - Back At KeyboardBAMF        - Bad Assed Mother F*ckerBBB         - Busy Beyond BeliefBBFN        - Bye Bye For NowBBIAB       - Be Back In A BitBBIAS       - Be Back In A SecBBL         - Be Back LaterBBR         - Burnt Beyond RepairBBS         - Bulletin Board SystemBC          - Basket CaseBCC         - Blind Carbon CopyBCNU        - Be Seein' You<BEG>       - Big Evil GrinBF          - Boy FriendBFD         - Big F*cking DealBFG         - Big Friendly Giant; Big F*cking GunBFH         - Bastard From HellBFI         - Brute Force and Ignorance; Bunch of F*cking IdiotsBFMI        - Brute Force and Massive IgnoranceBFN         - Bye For Now<BG>        - Big GrinBIL         - Brother In LawBION        - Believe It Or NotBIOYA       - Blow It Out Your A*seBITD        - Beaten It To DeathBK          - BecauseBMF         - Bad Mother F*ckerBMHATK      - Banging My Head Against The KeyboardBMHATW      - Banging My Head Against The WallBMOC        - Big Man On CampusBMTA        - Brilliant Minds Think AlikeBMTIPG      - Brilliant Minds Think In Parallel GuttersBNF         - Big Name FanBOC         - But Of CourseBOF         - Birds Of a FeatherBOFH        - Bastard Operator From HellBOHOF       - Back Of Hand On ForeheadBOHICA      - Bend Over Here It Comes AgainBOS         - Big Orange SwitchBOT         - Back On TopicBOTEC       - Back Of The Envelope CalculationBRB         - Be Right BackBRS         - Big Red SwitchBRT         - Be Right ThereBS          - Bullsh*tBSEG        - Big Sh*t Eating GrinBSG         - Big Smiling Grin; Broad Sweeping GeneralisationBTA         - But Then AgainBTAICBW     - But Then Again I Could Be WrongBTAIM       - Be That As It MayBTDT        - Been There Done ThatBTDTGTTS    - Been There Done That Got The T-ShirtBTOBD       - Be There Or Be DeadBTOBS       - Be There Or Be SquareBTSOOM      - Beats The Sh*t Out Of MeBTTP        - Back To The PointBTW         - By The WayBWQ         - Buzz Word QuotientBY          - BusYBYKT        - But You Know/Knew ThatBYKTA       - But You Know/Knew That AlreadyBYOB        - Bring Your Own Bottle/Booze


C

C/O         - Care OfC&P         - Copy & PasteCADET       - Can't Add Doesn't Even TryCB          - Call BackCC          - Carbon CopyCCWC        - Can't Cook Won't CookCE          - Creative EditingCERT        - Computer Emergency Response TeamCFD         - Call For DiscussionCFV         - Call For Votes<CG>        - Cute GrinCGI         - Common Gateway InterfaceCHOWUR      - See HOW yoU aReCHUR        - See How yoU aReCIAC        - Computer Incident Advisory CapabilityCIAO        - goodbye [pronounced Chow]CIC         - Christ I'm ConfusedCIO         - Cut It OutCLAB        - Crying Like A BabyCLM         - Career Limiting MoveCMIIW       - Correct Me If I'm WrongCO          - COnferenceCOD         - Cash On DeliveryCPF         - Can Pigs FlyCRAFT       - Can't Remember A F*cking ThingCRC         - Cyclic Redundancy CheckCRS         - Can't Remember Sh*tCS          - Cop ShopCTTD        - Cute Things They DoCTTS        - Cute Things They SayCU          - See yoUCUL         - See yoU LaterCUL8R       - See yoU LateRCWYL        - Chat With You LaterCYA         - See Ya; Cover Your A*seCYL         - See You Later


D

D/L         - DownloadD&W         - Ducking And WeavingDAP         - Parents Against Dyslexia [chuckle]DARFC       - Ducking And Running For CoverDBA         - Doing Business AsDBN         - Doing Business - NotDFM         - Don't Flame MeDFU         - Don't Forget UnitsDIIK        - Damned If I KnowDIIN        - Damned If I kNowDILLIGAF    - Does It Look Like I Give A F*ckDILLIGAFF   - Does It Look Like I Give A Flying F*ckDIM         - Do It MyselfDIY         - Do It YourselfDK          - Don't KnowDL          - DownLoadDLG         - Devilish Little GrinDNA         - Did Not AnswerDNPM        - Darn Near P*ssed MyselfDNS         - Domain Name SystemDOA         - Dead On ArrivalDOB         - Date Of BirthDOLT        - Division of Overseas Lemming Technicians             (only seen in private newsgroups - aol.newsgroups.*)DOM         - Dirty Old ManDOS         - Disk Operating System [the original computer operating              system developed by Microsoft, and how they made their             name <g>]DTP         - DeskTop PublishingDTRT        - Do The Right ThingDTTAH       - Don't Try This At HomeDUCWIC      - Do YoU See What I SeeDUK         - Dead Upon KeyboardDWIM        - Do What I MeanDWIMC       - Do What I Mean CorrectlyDWIMNWIS    - Do What I Mean Not What I SayDWISNWID    - Do What I Say Not What I DoDYE         - Damn Your EyesDYHWIH      - Do You Hear What I HearDYSWIS      - Do You See What I See


E

E2EG       - Ear to Ear GrinE&OE       - Errors And Omissions ExceptedED         - Emotionally DisturbedEDP        - Emotionally Disturbed Person<EG>       - Evil GrinEIF        - Exercise In FutilityEOB        - End Of BusinessEOD        - End Of DiscussionEOF        - End Of FileEOL        - End Of Lectureeom        - End Of Message (nearly always seen in lower case)EOT        - End Of ThreadES&D       - Eat Sh*t And DieESAD       - Eat Sh*t And DieESAL       - Eat Sh*t And LiveESP        - ESPeciallyESOSL      - Endless Snorts Of Stupid LaughterETA        - Estimated Time Of ArrivalETLA       - Extended Three Letter Acronym


F

F2F        - Face To FaceFAQ        - Frequently Asked Question(s)FCFS       - First Come First ServedFCOL       - For Crying Out LoudFDROTFL    - Falling Down Rolling On The Floor LaughingFFRD       - Flying F*ck in a Rolling DoughnutFFS        - For F*ck's SakeFIGJAM     - F*ck I'm Good Just Ask MeFIGMO      - F*ck It Got My OrdersFIIK       - F*cked If I KnowFIIN       - F*cked If I kNowFIL        - Father In LawFIRST      - Forum of Incident Response and Security TeamsFISH       - First In Still HereFITB       - Fill In The BlankFLEA       - Four Letter Extended AcronymFMH        - F*ck Me HarderFOAD       - F*ck Off And DieFOAF       - Friend Of A FriendFOAFOAG    - Father Of A Friend Of A GirlfriendFOAG       - Father Of A GirlfriendFOD        - Finger Of DeathFOS        - Freedom Of Speech; Full Of Sh*tFOT        - Full Of TripeFOTCL      - Falling Off The Chair LaughingFRED       - F*cking Ridiculous Electronic DeviceFRO        - F*ck Right OffFROB       - F*ck Right Off BabyFSD        - Fools Seldom DifferFTASB      - Faster Than A Speeding BulletFTF        - Face To FaceFTL        - Faster Than LightFTP        - File Transfer ProtocolFTS        - Fixin' To StartFUBAB      - F*cked Up Beyond All BelieveFUBAR      - F*cked Up Beyond All Repair/RecognitionFUD        - Fear Uncertainty And DoubtFUMTU      - F*cked Up More Than UsualFURTB      - Full Up Ready To BurstFWIW       - For What It's WorthFYA        - For Your AmusementFYI        - For Your Information


G

G          - Grin <g>GA         - Go AheadGAC        - Get A ClueGAFIA      - Get Away From It AllGAL        - Get A LifeGD&R       - Grinning Ducking And RunningGD&RF      - Grinning Ducking And Running FastGD&RVVF    - Grinning Ducking And Running Very Very FastGD&W       - Grinning Ducking And WeavingGF         - GirlFriendGFU        - General F*ck UpGFY        - Go F*ck YourselfGFYS       - Go F*ck Your SelfGGN        - Gotta Go NowGGP        - Gotta Go PeeGIF        - Graphical Interchange FormatGIGO       - Garbage In Garbage Out; Garbage In Gospel OutGIWIST     - Gee I Wish I'd Said ThatGLG        - Goofy Little GrinGLGH       - Good Luck and Good HuntingGMTA       - Great Minds Think AlikeGOK        - God Only KnowsGOOML      - Get Out Of My LifeGOTFIA     - Groaning On The Floor In AgonyGOWI       - Get On With ItGPF        - General Protection Fault; Go Puke FastGRQ        - Get Rich Quick - a type of spam (MMF)GRUIT      - Get Real yoU Impudent ThingGTBOS      - Glad To Be Of ServiceGTFOOMF    - Get The F*ck Out Of My FaceGTFOH      - Get The F*ck Outta HereGTG        - Got To GoGTGN       - Got To Go NowGTP        - Got To PeeGYFFR      - Get Your F*cking Facts Right


H

H2         - How ToHAND       - Have A Nice DayHCB        - Holy Cow BatmanHHGTTG     - Hitch Hiker's Guide To The GalaxyHHO½K      - Ha Ha Only Half KiddingHHOJ       - Ha Ha Only JokingHHOK       - Ha Ha Only KiddingHHOS       - Ha Ha Only SeriousHIB__      - Have I Been ___________HICA       - Here It Comes AgainHNG        - Horny Net GeekHOMPR      - Hang On Mobile Phone's RingingHOPR       - Hang On Phone's RingingHOS        - Husband Over ShoulderHOUER      - Hanging On yoUr Every WordHOYER      - Hanging On Your Every WordHSIK       - How Should I KnowHSP        - Highly Sensitive PersonHTFSIK     - How The F*ck Should I KnowHTH        - Hope This HelpsHTML       - HyperText Markup LanguageHTTP       - HyperText Transfer ProtocolHUA        - Head Up A*seHW         - HardWareHWUA       - Head Way Up A*se


I

IAAA       - I Am An AccountantIAAD       - I Am A DoctorIAAL       - I Am A LawyerIAC        - In Any CaseIAE        - In Any EventIAGFII     - It's All Good Fun Isn't ItIANA       - Internet Assigned Numbers AuthorityIANAA      - I Am Not An AccountantIANAC      - I Am Not A CrookIANAD      - I Am Not A DoctorIANAL      - I Am Not A LawyerIAP        - Internet Access ProviderIARTPFWTSIOWIM          - I Am Repeating This Parrot Fashion Without The Slightest            Idea Of What It MeansIAWC       - In A While Crocodile [usually used to reply to SYLA(cf)]IBC        - Inadequate But CuteIBM        - Inadequate But MarketableIBTD       - I Beg To DifferIC         - I SeeICB        - I Care BecauseICBW       - I Could Be WrongICCL       - I Couldn't Care LessICGAFF     - I Couldn't Give A Flying F*ckICP        - Internet Content ProviderICTYBTIHTKY- I Could Tell You But Then I'd Have To Kill YouICUR       - I See yoU aReIDGAD      - I Don't Give A DamnIDGAF      - I Don't Give A F*ck (also seen as I Do Give A F*ck)IDGAFF     - I Don't Give A Flying F*ckIDGAS      - I Don't Give A Sh*tIDGI       - I Don't Get ItIDK        - I Don't KnowiDOT       - Internet Development Outreach and TechnologyIDTS       - I Don't Think SoIDTT       - I'll Drink To ThatIETF       - Internet Engineering Task ForceIHABICNRWTSF - I Hate Abbreviations Because I Can Never Remember What              They Stand For [pronounced Eye habbik nerwit siff<g>]IHTFP      - I Hate This F*cking Place; I Have Truly Found ParadiseIIABDFI    - If It Ain't Broke Don't Fix ItIIRC       - If I Recall/Remember CorrectlyIITYWITIWHTKY - If I Tell You What It Means I Will Have To Kill YouIITYWIMWYBMAD - If I Tell You What It Means Will You Buy Me A DrinkIITYWIMWYKM   - If I Tell You What It Means Will You Kiss MeIJLS       - I Just Like SayingIK         - I KnowIKWUM      - I Know What yoU MeanIKWYM      - I Know What You MeanILI        - I Like IkeILIWAPCT   - I Love It When A Plan Comes TogetherILU        - I Love yoUILY        - I Love YouIMAO       - In My Arrogant OpinionIMBO       - In My Biased OpinionIMCDO      - In My Conceited Dogmatic OpinionIMCO       - In My Considered OpinionIME        - In My ExperienceIMHO       - In My Humble OpinionIMMOR      - I Make My Own RulesIMNSHO     - In My Not So Humble OpinionIMO        - In My OpinionIMOBO      - In My Own Biased OpinionIMPE       - In My Personal/Previous ExperienceIMPOV      - In My Point Of ViewIMVHO      - In My Very Humble OpinionINGSI      - I'm Not Going To Say ItINPO       - In No Particular OrderINT        - I'll Never TellIOU        - I Owe YouIOW        - In Other WordsIP         - Internet ProtocolIR         - Inter RacialIRC        - Internet Relay ChatIRL        - In Real LifeIROOC      - I've Run Out Of CigarettesISC        - I Stand CorrectedISDN       - Integrated Services Digital NetworkISP        - Internet Service ProviderISTM       - It Seems To MeISTR       - I Seem To RememberITFA       - In The Final AnalysisITMA       - Its That Man AgainIUTHALORFH - I Used To Have A Lot Of Respect For Him/HerIT         - Information Technology [a global term for all things now to                                     do with computers]ITYM       - I Think You MeanIUTKATS    - I Used To Know All That StuffIWBNI      - It Would Be Nice IfIWIK       - I Wish I KnewIYF        - In Your FaceIYF __     - Insert Your Favourite ________IYFEG      - Insert Your Favourite Ethnic GroupIYSWIM     - If You See What I Mean


J

J/K        - Just KiddingJAFO       - Just Another F*cking ObserverJAFU       - Just Another F*ck UpJAM        - Just A Moment/MinuteJAO        - Just Another ObserverJAS        - Just A SecondJFF        - Just For FunJIC        - Just In CaseJPEG       - Joint Photographic Experts GroupJFTR       - Just For The RecordJTYWTK     - Just Thought You Wanted To Know


K

K          - oKayKIA        - Know It AllKIBO       - Knowledge In Bullsh*t OutKISS       - Keep It Simple StupidKITA       - Kick In The A*seKMA        - Kiss My A*seKMWIH      - Kick Me Where It HurtsKMYF       - Kiss Me You FoolKOS        - Kids Over ShoulderKOTC       - Kiss On The CheekKOTL       - Kiss On The LipsKOTM       - Kook Of The MonthKTCOOTN    - Keep This Crap Out Of This NewsgroupKWIM       - Know What I MeanKYHU       - Keep Your Head UpKYHOOTW    - Keep Your Head Out Of The Water


L

L8R        - LaterLAB&TYD    - Life's A Bitch And Then You DieLAB&TYMO   - Life's A Bitch And Then You Marry OneLAGNAF     - Let's All Get Naked And F*ckLALL       - Live And Let LiveLAN        - Local Area NetworkLART       - Luser Attitude Re-adjustment ToolLJBF       - Let's Just Be FriendsLLTA       - Lots and Lots of Thunderous ApplauseLMA        - Leave Me AloneLMAO       - Laughing My A*se OffLMAOROTF   - Laughing My A*se Off Rolling On The FloorLMC        - Lost My ConnectionLMCOA      - Lost My Connection Once AgainLMFAO      - Laughing My F*cking A*se OffLMK        - Let Me KnowLMTFA      - Leave Me The F*ck AloneLoTR       - Lord of The RingsLOL        - Laughing Out Loud; Little Old Lady;            Lots of Love [minority usage]LSFIAB     - Like Shooting Fish In A BarrelLSHIPMP    - Laughing So Hard I Peed My PantsLSMIF      - Laughing So Much I FartedLSMISMT    - Laughing So Much I Shot My TampaxLSP        - Less Sensitive PersonLTBF       - Learn To Be FunnyLTIP       - Laughing 'Til I PukeLTMSH      - Laughing 'Til My Sides HurtLTNS       - Long Time No SeeLUSER      - Loser USER


M

MAY        - Mad About YouMAYB       - Mad About You BabyMB         - Message BoardMBR        - Master Boot RecordMCIBTY     - My Computer Is Better Than YoursMFG        - More Friendly GarbageMFIC       - Mother F*cker In ChargeMFWIC      - Mother F*cker What's In ChargeMHBFY      - My Heart Bleeds For YouMHDC       - My Hard Drive CrashedMHM        - Members Helping MembersMHOTY      - My Hat's Off To YouMIL        - Mother In LawMIME       - Multi-purpose Internet Mail ExtensionsMIPS       - Meaningless Information Per SecondML         - More LaterMLA        - Multiple Letter AcronymMMF        - Make Money Fast - a type of spam, illegal in most countriesMMIF       - My Mouth Is FullMMX        - Multi-Media eXtensionsMOF        - Matter Of FactMOMN       - Milk Out My NoseMORF       - Male OR FemaleMOS        - Member of the Opposite SexMOTAS      - Member Of The Appropriate SexMOTD       - Message Of The DayMOTOS      - Member Of The Opposite SexMOTSS      - Member Of The Same SexMS         - More Sh*t; More of the SameMSCEA      - My Southern Comfort's Empty AgainMSS        - Member of the Same SexMTFBWY     - May The Force Be With YouMUD        - Multi-User Dungeon/DomainMUNG       - Mash/Mung Until No GoodMYOB       - Mind Your Own Business


N

N/M        - Never MindNAGI       - Not A Good IdeaNANAE      - news.admin.net-abuse.email [Usenet newsgroup]NANAU      - news.admin.net-abuse.usenet [Usenet newsgroup]NAVY       - Never Again Volunteer YourselfNAYY       - Not Affiliated. Yada-Yada. [origin unknown]NB         - Nota Bene [Latin for Note Well, i.e. what follows is             important]NBD        - No Big DealNBL        - Not Bloody LikelyNBTD       - Nothing Better To DoNDM        - No Disrespect MeantNERD       - National Establishment for Real DorksNFG        - No F*cking GoodNFI        - No F*cking IdeaNFW        - No F*cking WayNFY        - No - F*ck YouNHOH       - Never Heard Of Her/HimNICBDAT    - Nothing Is Certain But Death And TaxesNIDWTC     - No I Don't Want To ChatNIH        - Not Invented HereNIMBY      - Not In My Back YardNINO       - Nothing In Nothing OutNIMTO      - Not In My Term Of OfficeNIT        - Not In TherapyNLI        - Not Logged InNM         - No Message [used in the subject title of an email which                         includes only an attachment]NMI        - No Middle InitialNMP        - Not My ProblemNN         - Night NightNNTP       - Network News Transfer ProtocolNoCeM      - No See 'eMNOOTO      - Nothing Out Of The OrdinaryNOYB       - None Of Your BusinessNP         - No ProblemNP         - No Picture [used in the subject title of an email]NPF        - No Problem FoundNPLU       - Not People Like UsNQA        - No Questions AskedNQOS       - Not Quite Our SortNRN        - No Reply NecessaryNSS        - No Sh*t SherlockNTG        - Not Too GoodNTH        - No Therapy HelpfulNTIBOA     - Not That I'm Bitter Or AnythingNTIM       - Not That It MattersNTIMM      - Not That It Matters MuchNTL        - None The Less/Never The LessNUI        - Network User IdentificationNYCTMI     - Now You Come To Mention ItNYP        - Not Your Problem


O

O          - Over [to you]OATUS      - On A Totally Unrelated SubjectOAUS       - On An Unrelated SubjectOB         - OBligatoryOBTW       - Oh By The WayOD         - OverDose; Oh DearOIC        - Oh I SeeOMFG       - Oh My F*cking GodOMG        - Oh My GodONNA       - Oh No Not AgainONNTA      - Oh No Not That/This AgainOO         - Over and OutOOI        - Out Of InterestOOSOOM     - Out Of Sight Out Of MindOOTC       - Obligatory On Topic Comment [indicates that part of a message             that pertains in some way to the Usenet newsgroup that the             message appears in]OSIM       - Oh Sh*t It's MondayOT         - Off TopicOTC        - Over The CounterOTD        - Out The DoorOTF        - On The FloorOTGH       - On The Gripping HandOTL        - Out To LunchOTOH       - On The Other HandOTOOH      - On The Other Other HandOTT        - Over The TopOTTH       - On The Third HandOTTOMH     - Off The Top Of My HeadOTW        - On The WholeOW         - Oh WellOWTTE      - Or Words To That Effect


P

PABG       - Pack A Big GunPBM        - Play By Mail (games)PBNFL      - Possible, But Not F*cking LikelyPCB        - Please Call BackPCMCIA     - People Can't Master Computer Industry AcronymsPD         - Public DomainPDA        - Public Display of AffectionPDN        - Public Data NetworkPDQ        - Pretty Damn QuickPEM        - Privacy Enhanced MailPEST       - Please Excuse Slow TypingPGP        - Pretty Good PrivacyPhD        - Piled Higher and DeeperPIMP       - Pee In My PantsPITA       - Pain In The A*sePKB        - Pot Kettle BlackPLMK       - Please Let Me KnowPLMKO      - Please Let Me Know OkPLOKTA     - Press Lots Of Keys To AbortPMBI       - Pardon My Butting InPMETC      - Pardon Me ETCPMFBI      - Pardon Me For Butting InPMFJI      - Pardon Me For Jumping InPMFJIH     - Pardon Me For Jumping In HerePMJI       - Pardon My Jumping InPO         - Piss OffPOETS (day)- Piss Off Early Tomorrow's SaturdayPOM        - Phase Of the MoonPOP        - Point Of Presence; Post Office ProtocolPOQ        - Piss Off QuicklyPOQADCB    - Piss Off Quickly And Don't Come BackPOS        - Parents Over ShoulderPOTS       - Plain Old Telephone Service/SystemPOV        - Point Of ViewPPL        - PeoPLePPP        - Point-to-Point Protocol; Petty Pet PeevePPPP       - Previous Paragraph was Polemical PositionPTB        - Powers That BePTMM       - Please Tell Me MorePTMY       - Pleased To Meet YouPTMYA      - Pleased To Make Your AcquaintancePTO        - Please Turn OverPW         - Pathetic Wanker; PowWow


Q

QED        - Quod Erat Demonstrandum; Quite Easily DoneQPQ        - Quid Pro Quo


R

RE         - REgardingRFC        - Request For CommentsRFD        - Request For DiscussionRFM        - Reply To Flagged MessageRFN        - Right F*cking NowRFT        - Request For ThinkingRHIP       - Rank Hath Its PrivilegesRL         - Real LifeRLCO       - Real Life COnferenceRNA        - Ring No AnswerROFFNAR    - Rolling On the Floor For No Apparent ReasonROFL       - Rolling On Floor LaughingROFLMAO    - Rolling On Floor Laughing My A*se OffROFLWPIMP  - Rolling On Floor Laughing Whilst Peeing In My PantsROTBA      - Reality On The Blink AgainROTF       - Rolling On The FloorROTFL      - Rolling On The Floor LaughingROTFLAS    - Rolling On The Floor Laughing And SnortingROTFLSHISMC- Rolling On The Floor Laughing So Hard I Spilt My CoffeeROTM       - Right On The MoneyRPG        - Role Playing GameRSN        - Real Soon NowRT         - Real TimeRTFF       - Read The F*cking FAQ(s)RTFI       - Read The F*cking InstructionsRTFM       - Read The F*cking ManualRTFN       - Right The F*ck NowRTFQ       - Read The F*cking QuestionRTFS       - Read The F*cking SourceRUMF       - aRe yoU Male or FemaleRUMORF     - aRe yoU Male Or Female


S

*S*        - *Smile*SAMFUTU    - Situation Abnormal More F*cked Up Than UsualSAPFU      - Surpassing All Previous F*ck UpsSAR        - Smart A*se RemarkSASS       - Short Attention Span Society/SyndromeSBID       - Sh*tty But It'll DoSEG        - Sh*t Eating GrinSEP        - Somebody Else's ProblemSFAIAA     - So Far As I Am AwareSFLA       - Stupid Four Letter AcronymSGML       - Standardised Generalised Markup LanguageSH         - Sh*t HappensSHAM       - Stay At Home MomSHTSI      - Somebody Had To Say ItSIG        - Special Interest GroupSIIK       - Stuffed If I KnowSIL        - Sister In LawSITD       - Still In The DarkSLIP       - Serial Line Interface ProtocolSMAR       - Suck My A*se RawSMO        - Serious Mode OnSMOP       - Small Matter Of ProgrammingSMOFF      - Serious Mode OFFSMTP       - Simple Mail Transfer ProtocolSNAFU      - Situation Normal All F*cked UpSNERT      - Snot-Nosed Egotistical Rude TeenagerSNR        - Signal To Noise RatioSO         - Significant OtherSOHB       - Sense Of Humour BypassSOI        - Stink On IceSOL        - Sh*t Out of LuckSOP        - Standard Operating ProcedureSOS        - Same Old Sh*t; Stuck On StupidSOVS       - SomeOne Very SpecialSPAM       - SPiced hAMSSDD       - Same Sh*t Different DayST         - Such That; Star TrekST-DS9     - Star Trek Deep Space 9ST-TNG     - Star Trek The Next GenerationST-TOS     - Star Trek The Original SeriesST-VOY     - Star Trek VoyagerSTFU       - Shut The F*ck UpSTS        - So To SpeakSUAD       - Shut/Suck Up And DealSUB        - Sign Up BoardSUCDIC     - Situation Under Control Dickheads In ChargeSUFID      - Screwing Up Face In DisgustSUNOILTY   - Shut Up No One Is Listening To YouSUYP       - Shut Up You PervertSW         - SoftWare; So What; Says WhomSWAG       - Simple Wide Ass Guess; Scientific Wide Ass GuessSWAK       - Sealed With A KissSWALK      - Sealed With A Loving KissSWDYRTW    - Since When Do You Rule The WebSWMBO      - She Who Must Be ObeyedSWYP       - So What's Your ProblemSYLA       - See You Later AlligatorSYOTB      - See You On The BoardSYSOP      - System Operator [normally of Bulletin Boards, or networks]SYT        - Sweet Young Thing


T

T&E        - Trial And ErrorTA         - Thanks A lotTAF        - That's All FolksTAFN       - That's All For NowTANJ       - There Ain't No JusticeTANSTAAFL  - There Ain't No Such Thing As A Free LunchTARFU      - Things Are Really F*cked UpTAWIS      - That Ain't What I saidTBC        - To Be ContinuedTBE        - To Be ExpectedTBYB       - Try Before You BuyTC         - Telephone Call; Take CareTCB        - Taking Care Of BusinessTCD        - The Cat's DeadTDD        - The Dog's DeadTDM        - Too Damn ManyTEHO       - To Each His OwnTFB        - Too F*cking BadTFE        - Too F*cking EasyTFS        - Three Fingered Salute [Ctrl-Alt-Del]TFTT       - Thanks For The ThoughtTGAL       - Think Globally Act LocallyTGIF       - Thank God It's FridayTGTF       - Thank God Tomorrow's FridayTHX        - ThanksTIA        - Thanks In AdvanceTIATLG     - Truly I Am The Living GodTIC        - Tongue In CheekTIME       - Tears In My EyesTIMTOWTDI  - There Is More Than One Way To Do ItTINALO     - This Is Not A Legal OpinionTINAR      - This Is Not A RecommendationTINWIS     - That Is Not What I SaidTIP        - To Insure PromptnessTJATAW     - Truth Justice And The American WayTLA        - Three Letter AcronymTLC        - Tender Loving CareTLG        - The Living GodTM         - Thread ManglerTMI        - Too Much InformationTN         - TelNetTNOTVS     - There's Nothing On Television SoTNTL       - Trying Not To LaughTNX        - ThanksTPAE       - The Possibilities Are EndlessTPS(S)     - This Program Sucks (Severely)TPTB       - The Powers That BeTRDMC      - Tears Running Down My CheeksTS         - Tough Sh*tTSOHF      - Total Sense Of Humour FailureTSR        - Terminate And Stay Resident (program,1,5,UNIX_TIMESTAMP()); Totally Stupid RulesTTBE       - That's To Be ExpectedTTBOMK     - To The Best Of My KnowledgeTTFN       - Ta Ta For NowTTKSF      - Trying To Keep Straight FaceTTL4N      - That's The Lot For NowTTM        - To The ModeratorTTSP       - This Too Shall PassTTUL       - Talk/Type To You LaterTTYL       - Talk To You LaterTTYRS      - Talk To You Real SoonTWAIN      - Technology Without An Important NameTWIAVBP    - The World Is A Very Big PlaceTWIMC      - To Whom It May ConcernTWIS       - That's What I SaidTWYAS      - That's What You All SayTWYT       - That's What You ThinkTYVM       - Thank You Very Much


U

U/L        - UpLoadUAE        - Unrecoverable Application ErrorUDP        - Usenet Death PenaltyUL         - UpLoadUOK        - yoU OK?URL        - Uniform Resource LocatorURLCM      - yoU aRe weLCoMeUSU        - UsuallyUTC        - Under The CounterUTT        - Under The TableUUCP       - Unix-to-Unix CoPyUYKD       - Unless You Know Different(ly)


V

<VBG>      - Very Big GrinVH         - Virtual HugVR         - Virtual RealityVRML       - Virtual Reality Modelling LanguageVT         - Virtual Time


W

W/         - WithW/O        - With OutW8         - WaitW8ING      - WaitingWAB        - What Another BillWAEF       - When All Else FailsWALOC      - What A Load Of CrapWAN        - Wide Area NetworkWB         - Welcome BackWCAGA      - What Comes Around Goes AroundWDYMBT     - What Do You Mean By ThatWEFT       - Wrong Every F*cking TimeWFM        - Works For Me<WG>       - Wicked GrinWGAS       - Who Gives A Sh*tWIBNIF     - Wouldn't It Be Nice IfWMMOWS     - Wash My Mouth Out With SoapWOA        - Work Of ArtWOFTAM     - Waste Of F*cking Time And MoneyWOM        - Word Of MouthWOS        - Wife Over ShoulderWR         - With RespectWRT        - With Respect ToWTAA       - What's This All AboutWTF        - What The F*ckWTFDIC     - What The F*ck Do I CareWTFDIK     - What The F*ck Do I KnowWTFDYTYA   - Who The F*ck Do You Think You AreWTFWT      - What The F*ck Was ThatWTG        - Way To Go!WTGP       - Want To Go PrivateWTH        - What The HellWTTRW      - Welcome To The Real WorldWUTNB      - Wait Until The Next BookWWW        - World Wide Web; World Wide WaitWYGIWYG    - What You Got Is What You GetWYGIWYPF   - What You Get Is What You Pay ForWYMM       - Will You Marry MeWYP        - What's Your PointWYSIAYG    - What You See Is All You GetWYSIWYG    - What You See Is What You Get


X

XYZ        - eXamine Your Zipper


Y

YABA       - Yet Another Bloody AcronymYAOTM      - Yet Another Off-Topic MessageYGGM       - Your Guess is as Good as MineYGTBK      - You've Got To Be KiddingYHB_____   - You Have Been ________YHBW       - You Have Been WarnedYHL        - You Have LostYHTBT      - You Had To Be ThereYIU        - Yes I UnderstandYIWGP      - Yes I Will Go PrivateYKYATP     - You Know You're A Tired Parent [relates to something really             silly, but if you are honest with yourself, you've done             equally silly things]YM         - You MeanYMMV       - Your Mileage May Vary [results may differ according to setup,             power, size etc]YOYO       - You're On Your OwnYOYOW      - You Own Your Own WordsYR         - Yeah RightYSS        - You Suck SeverelyYTMOB      - You Turn Me On BabyYWHOL      - Yelling Woo Hoo Out Loud [a variation on LOL(cf)]YWSYLS     - You Win Some You Lose Some


Z

ZAM        - Z's Are MeZAC        - Z's Are Calling (time for bed)ZNT        - ZiffNeTZSTFB      - Zebedee Says Time For Bed

Enviado em Referencia | Deixar um comentário »

HP Deskjet PCL Printer Commands

Publicado por agostinhojr em 21 Março, 2007

ASCII
Use the following table to translate ASCII values into decimal or hexadecimal values:

ASCII Value9 Dec Hex Description
0 48 30 Zero
1 49 31 One
2 50 32 Two
3 51 33 Three
4 52 34 Four
5 53 35 Five
6 54 36 Six
7 55 37 Seven
8 56 38 Eight
9 57 39 Nine
. 46 2E Period (point)

PCL commands

         

PCL command

Printer control
Printer command Decimal value Hex. value
Printer feature Reset EcE 027 069 1B 45
Self-Test Ecz 027 122 1B 7A
Paper input control (media source) Z-fold media (banners)
HP Deskjet 680, 690 printers only
Ec&l-1H (h) 027 038 108 046 072 (104) 1B 26 6C 2E 48 (68)
Eject page Ec&l0H (h) 027 038 108 048 072 (104) 1B 26 6C 30 48 (68)
Feed from tray (cut sheet) Ec&l1H (h) 027 038 108 049 072 (104) 1B 26 6C 31 48 (68)
Manual feed Ec&l2H (h) 027 038 108 050 072 (104) 1B 26 6C 32 48 (68)
Envelope feed Ec&l3H (h) 027 038 108 051 072 (104) 1B 26 6C 33 48 (68)
Media type Plain paper Ec&l0M (m) 027 038 108 048 077 (109) 1B 26 6C 30 4D (6D)
Bond paper Ec&l1M (m) 027 038 108 049 077 (109) 1B 26 6C 31 4D (6D)
Special paper Ec&l2M (m) 027 038 108 050 077 (109) 1B 26 6C 32 4D (6D)
Transparency Ec&l3M (m) 027 038 108 051 077 (109) 1B 26 6C 33 4D (6D)
Glossy paper Ec&l4M (m) 027 038 108 052 077 (109) 1B 26 6C 34 4D (6D)
Underline Single fixed Ec&d1D (d) 027 038 100 049 068 (100) 1B 26 64 31 44 (64)
Double fixed HP Deskjet 600, 660 printer Ec&d2D (d) 027 038 100 050 068 (100) 1B 26 64 32 44 (64)
Single floating Ec&d3D(d) 027 038 100 051 068 (100) 1B 26 64 33 44 (64)
Double floating DJ 600, 660 Ec&d4D (d) 027 038 100 052 068 (100) 1B 26 64 34 44 (64)
Turn off Ec&d@ 027 038 100 064 1B 26 64 40
Line termination CR = CR;
LF = LF;
FF = FF
Ec&k0G (g) 027 038 107 048 071 (103) 1B 26 6B 30 47 (67)
CR = CR + LF;
LF = LF;
FF = FF
Ec&k1G (g) 027 038 107 049 071 (103) 1B 26 6B 31 47 (67)
CR = CR;
LF = CR + LF;
FF = CR + FF
Ec&k2G (g) 027 038 107 050 071 (103) 1B 26 6B 32 47 (67)
CR = CR + LF;
LF = CR + LF;
FF = CR + FF
Ec&k3G (g) 027 038 107 051 071 (103) 1B 26 6B 33 47 (67)
End-of-line wrap Turn on Ec&s0C (c) 027 038 115 048 067 (99) 1B 26 73 30 43 (63)
Turn off Ec&s1C (c) 027 038 115 049 067 (99) 1B 26 73 31 43 (63)
Transparent Print mode Number of bytes Ec&p#X [data] (x) 027 038 112 # 088 [data] (120) 1B 26 70 # 58 [data] (78)
Display Functions mode Turn on EcY 027 089 1B 59
Turn off EcZ 027 090 1B 5A
Page control and page orientation Portrait Ec&l0O (o) 027 038 108 048 079 (111) 1B 26 6C 30 4F (6F)
Landscape Ec&l1O (o) 027 038 108 049 079 (111) 1B 26 6C 31 4F (6F)
Page size Executive Ec&l1A (a) 027 038 108 049 065 (097) 1B 26 6C 31 41 (61)
U.S. letter Ec&l2A (a) 027 038 108 050 065 (097) 1B 26 6C 32 41 (61)
U.S. legal Ec&l3A (a) 027 038 108 051 065 (097) 1B 26 6C 33 41 (61)
A5 ISO/JIS Ec&l25A (a) 027 038 108 050 055 065 (097) 1B 26 6C 32 37 41 (61)
A4 ISO/JIS Ec&l26A (a) 027 038 108 050 054 065 (097) 1B 26 6C 32 36 41 (61)
B5 JIS Ec&l45A (a) 027 038 108 052 053 065 (097) 1B 26 6C 34 35 41 (61)
Card – 4 x 6 Ec&l74A (a) 027 038 108 055 052 065 (097) 1B 26 6C 37 34 41 (61)
Card – 5 x 8 Ec&l75A (a) 027 038 108 055 053 065 (097) 1B 26 6C 37 35 41 (61)
Card – A6 ISO/JIS Ec&l24A (a) 027 038 108 050 052 065 (097) 1B 26 6C 32 34 41 (61)
Card -Hagaki Ec&l71A (a) 027 038 108 055 049 065 (097) 1B 26 6C 37 31 41 (61)
Number 10 envelope Ec&l81A (a) 027 038 108 056 049 065 (097) 1B 26 6C 38 31 41 (61)
Int’l DL envelope Ec&l90A (a) 027 038 108 057 048 065 (097) 1B 26 6C 39 30 41 (61)
Int’l C6 envelope Ec&l92A (a) 027 038 108 057 050 065 (097) 1B 26 6C 39 32 41 (61)
U.S. A2 Envelope Ec&l109A (a) 027 038 108 049 048 057 065 (097) 1B 26 6C 31 30 39 41 (61)
Line spacing Lines per inch – number of lines Ec&l#D (d) 027 038 108 # 068 (100) 1B 26 6C # 44 (64)
Page length Number of lines
(5-128)
Ec&l#P (p) 027 038 108 #…# 080 (112) 1B 26 6C #…# 50 (70)
Perforation skip On Ec&l1L (l) 027 038 108 049 076 (108) 1B 26 6C 31 4C (6C)
Off Ec&l0L (l) 027 038 108 048 076 (108) 1B 26 6C 30 4C (6C)
Top margin Number of Lines Ec&l#E (e) 027 038 108 #…# 069 (101) 1B 26 6C #…# 45 (65)
Text length Number of Lines Ec&l#F (f) 027 038 108 #…# 070 (102) 1B 26 6C #…# 46 (66)
Side margins Clear Ec9 027 057 1B 39
Left (column number) Ec&a#L (l) 027 038 097 #…# 076 (108) 1B 26 61 #…# 4C (6C)
Right (column number) Ec&a#M (m) 027 038 097 #…# 077 (109) 1B 26 61 #…# 4D (6D)
Text scale Off Ec&k5W (w) 027 038 107 053 087 (119) 1B 26 6B 35 57 (77)
On Ec&k6W (w) 027 038 107 054 087 (119) 1B 26 6B 36 57 (77)
Horizontal Motion Index (HMI) Number of .008 inch Increments Ec&k#H (h) 027 038 107 #…# 072 (104) 1B 26 6B #…# 48 (68)
The Horizontal Motion Index (HMI) command designates the distance between columns in .008 inch increments. When fixed pitch fonts are selected, all printable characters, including the space and backspace characters, are affected by HMI. When proportional fonts are selected, the HMI affects only
the control code space character. The default HMI is equal to the pitch value in the font header. The printer escape sequence that you send is as follows:
Ec&k#H # is equal to a variable that is derived from the following formula:

Horizontal Printable Area
_____________________ X 120 = #
Desired Characters Per Line

Horizontal position Number of columns Ec&a#C (c) 027 038 097 #…# 067 (99) 1B 26 61 #…# 43 (63)
Number of dots Ec*p#X (x) 027 042 112 #…# 088 (120) 1B 2A 70 #…# 58 (78)
Number of decipoints Ec&a#H (h) 027 038 097 #…# 072 (104) 1B 26 61 #…# 48 (68)
Vertical Motion Index (VMI) Number of .021 inch Increments Ec&l#C (c) 027 038 108 #…# 067 (99) 1B 26 6C #…# 43 (63)
The Vertical Motion Index (VMI) command designates the distance
between rows in .021 inch increments (the vertical distance the cursor will
move for a line feed operation). This command affects the line feed
and half line feed spacing. The factory default VMI is 8, which corresponds to 6 lines per inch. VMI can be selected from the printer control panel or by sending a printer escape sequence: Ec&l#C . # is equal to a variable that is derived from the following formula:
Vertical Printable Area
_________________ X 48 = #
Desired Lines Per Page
Vertical position Number of rows Ec&a#R (r) 027 038 097 #…# 082 (114) 1B 26 61 #…# 52 (72)
Number of dots Ec*p#Y (y) 027 042 112 #…# 089 (121) 1B 2A 70 #…# 59 (79)
Number of decipoints Ec&a#V (v) 027 038 097 #…# 086 (118) 1B 26 61 #…# 56 (76)
Font selection and symbol set PC-8 Ec(10U 027 040 049 048 085 1B 28 31 30 55
HP Roman8 Ec(8U 027 040 056 085 1B 28 38 55
PC-8 Danish/
Norwegian
Ec(11U 027 040 049 049 085 1B 28 31 31 55
PC 850 Ec(12U 027 040 049 050 085 1B 28 31 32 55
ECMA-94 Latin 1 Ec(0N 027 040 048 078 1B 28 30 4E
German (ISO 21) Ec(1G 027 040 049 071 1B 28 31 47
French (ISO 69) Ec(1F 027 040 049 070 1B 28 31 46
Italian (ISO 15) Ec(0I 027 040 048 073 1B 28 30 49
Spanish (ISO 17) Ec(2S 027 040 050 083 1B 28 32 53
Swedish (ISO 11) Ec(0S 027 040 048 083 1B 28 30 53
Norwegian1 (ISO 60) Ec(0D 027 040 048 068 1B 28 30 44
ISO 4: United Kingdom Ec(1E 027 040 049 069 1B 28 31 45
ANSI ASCII (ISO 6) Ec(0U 027 040 048 085 1B 28 30 55
HP Legal Ec(1U 027 040 049 085 1B 28 31 55
PC-8 Turkish Ec(9T 027 040 057 084 1B 28 39 54
PC-852 Ec(17U 027 040 049 055 085 1B 28 31 37 55
ISO 8859/2 Latin 2 Ec(2N 027 040 050 078 1B 28 32 4E
ISO 8859/5 Latin 5 Ec(5N 027 040 053 078 1B 28 35 4E
Microsoft (R) Windows 3.1 Latin 1 Ec(19U 027 040 049 057 085 1B 28 31 39 55
Microsoft Windows 3.1 Latin 2 Ec(9E 027 040 057 069 1B 28 39 45
Microsoft Windows 3.1 Latin 5 Ec(5T 027 040 053 084 1B 28 35 54
Refer to the PCL-5 Comparison Guide for additional supported symbol sets.

PCL command

Printer control
Printer command Decimal value Hex. value
Spacing Proportional Ec(s1P (p) 027 040 115 049 080 (112) 1B 28 73 31 50 (70)
Fixed Ec(s0P (p) 027 040 115 048 080 (112) 1B 28 73 30 50 (70)
Print pitch Number Characters per inch Ec(s#H (h) 027 040 115 #…# 072 (104) 1B 28 73 #…# 48 (68)
Point size (character height) Number of .014 inch Ec(s#V (v) 027 040 115 #…# 086 (118) 1B 28 73 #…# 56 (76)
Style Upright Ec(s0S (s) 027 040 115 048 083 (115) 1B 28 73 30 53 (73)
Italic Ec(s1S (s) 027 040 115 049 083 (115) 1B 28 73 31 53 (73)
Stroke weight Normal Ec(s0B (b) 027 040 115 048 066 (98) 1B 28 73 30 42 (62)
Bold Ec(s3B (b) 027 040 115 051 066 (98) 1B 28 73 33 42 (62)
Extra Bold Ec(s7B (b) 027 040 115 055 066 (98) 1B 28 73 37 42 (62)
Typeface Courier Ec(s3T (t) 027 040 115 051 084 (116) 1B 28 73 33 54 (74)
CG Times Ec(s4101T (t) 027 040 115 052 049 048 049 084 (116) 1B 28 73 34 31 30 31 54 (74)
Letter Gothic Ec(s6T (t) 027 040 115 054 084 (116) 1B 28 73 36 54 (74)
Univers Ec(s52T (t) 027 040 115 053 050 084 (116) 1B 28 73 35 32 54 (74)
Print quality EconoFast
300 x 300 dpi
Ec*o-1M (m) 027 042 111 045 049 077 (109) 1B 2A 6F 2D 31 4D (6D)
Normal
600 x 300 dpi
Ec*o0M (m) 027 042 111 048 077 (109) 1B 2A 6F 30 4D (6D)
Presentation
600 x 600 dpi
Ec*o1M (m) 027 042 111 049 077 (109) 1B 2A 6F 31 4D (6D)
Download font management Font ID number Ec*c#D (d) 027 042 099 # 068 (100) 1B 2A 63 # 44 (64)
ASCII code number Ec*c#E (e) 027 042 099 # 069 (101) 1B 2A 63 # 45 (65)
Delete All Ec*c0F (f) 027 042 099 048 070 (102) 1B 2A 63 30 46 (66)
Delete Temporary Ec*c1F (f) 027 042 099 049 070 (102) 1B 2A 63 31 46 (66)
Delete last Ec*c2F (f) 027 042 099 050 070 (102) 1B 2A 63 32 46 (66)
Make Temporary Ec*c4F (f) 027 042 099 052 070 (102) 1B 2A 63 34 46 (66)
Make Permanent Ec*c5F (f) 027 042 099 053 070 (102) 1B 2A 63 35 46 (66)
Create font number of bytes Ec)s#W[data] 027 041 115 # 087 [data] 1B 29 73 # 57[data]
Download chr. Number of bytes Ec(s#W[data] 027 040 115 # 087 [data] 1B 28 73 # 57 [data]

PCL command

Printer control
Printer command Decimal value Hex. value
Start Raster Graphics At left most position Ec*r0A 027 042 114 048 065 1B 2A 72 30 41
Current Cursor Position Ec*r1A 027 042 114 049 065 1B 2A 72 31 41
End Raster Graphics End Graphics Ec*rC 027 042 114 067 1B 2A 72 43
Resolution 75 dots per inch Ec*t75R 027 042 116 055 053 082 1B 2A 74 37 35 52
150 dots per inch Ec*t150R 027 042 116 049 053 048 082 1B 2A 74 31 35 30 52
300 dots per inch Ec*t300R 027 042 116 051 048 048 082 1B 2A 74 33 30 30 52
600 dots per inch Ec*t600R 027 042 116 054 048 048 082 1B 2A 74 36 30 30 52
Configure Raster Data Ec*g#W 027 042 103 # 087 1B 2A 67 # 57
Set Raster Graphics Width Number of pixels Ec*r#S 027 042 114 # 083 1B 2A 72 # 53
Add Raster Graphics Compression Method 0 Ec*b0M 027 042 098 048 077 1B 2A 62 30 4D
Method 1 Ec*b1M 027 042 098 049 077 1B 2A 62 31 4D
Method 2 Ec*b2M 027 042 098 050 077 1B 2A 62 32 4D
Method 3 Ec*b3M 027 042 098 051 077 1B 2A 62 33 4D
Method 9 Ec*b9M 027 042 098 057 077 1B 2A 62 39 4D
Seed Row Source Ec*b#S 027 042 098 # 083 1B 2A 62 # 53
Transfer Raster Graphics Transfer data by row (Number of bytes) Ec*b#W[data] 027 042 098 # 087 [data] 1B 2A 62 # 57 [data]
Transfer data by plane (Number of bytes) Ec*b#V[data] 027 042 098 # 086 [data] 1B 2A 62 # 56 [data]
Relative Vertical Pixel Movement (formerly known as Y offset) Number of dots Ec*b#Y 027 042 098 # 089 1B 2A 62 # 59

PCL command

Printer control
Printer command Decimal value Hex. value
Set Number of Raster planes per row Single plane palette Ec*r1U 027 042 114 049 085 1B 2A 72 31 55
3 planes, CMY palette Ec*r-3U 027 042 114 045 051 085 1B 2A 72 2D 33 55
3 planes, RGB palette Ec*r3U 027 042 114 051 085 1B 2A 72 33 55
4 planes, KCMY palette Ec*r-4U 027 042 114 045 052 085 1B 2A 72 2D 34 55
Configure Raster Data (CRD) Planar Direct Ec*g2W 027 042 103 050 087 1B 2A 67 32 57
Color Text (Graphics) White (no ink) Ec*v0S 027 042 118 048 083 1B 2A 76 30 53
True Black Ec*v1S 027 042 118 049 083 1B 2A 76 31 53
Cyan Ec*v2S 027 042 118 050 083 1B 2A 76 32 53
Magenta Ec*v4S 027 042 118 052 083 1B 2A 76 34 53
Blue Ec*v6S 027 042 118 054 083 1B 2A 76 36 53
Yellow Ec*v8S 027 042 118 056 083 1B 2A 76 38 53
Green Ec*v10S 027 042 118 049 048 083 1B 2A 76 31 30 53
Red Ec*v12S 027 042 118 049 050 083 1B 2A 76 31 32 53
Composite Black Ec*v14S 027 042 118 049 052 083 1B 2A 76 31 34 53
Graphics image improvement Raster graphics depletion (1-5) Ec*o#D 027 042 111 # 068 1B 2A 6F # 44

Enviado em Deskjet | Deixar um comentário »

Buscar por uma string no conteúdo de uma store procedure

Publicado por agostinhojr em 21 Março, 2007

Quando houver necessidade de buscar determinada comando ou string em um conteudo de uma store procedure pode-se executar o comando abaixo:

select * from information_schema.routines route where route.routine_definition like ‘%count%’

Enviado em MS SQL | Deixar um comentário »