This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cast(cast(9223373.03685 as double precision) * cast(1.0000000000 as double precision) as numeric(18, 0)) as round_number |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
cls | |
echo All documents in print queue will be canceled! Please wait... | |
net stop spooler | |
echo . | |
echo Clearing the print queue... | |
del %windir%\system32\spool\printers\*.* /q /s | |
echo . | |
net start spooler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_index_recursive(vector, number, index = -1, prior_index = 0): | |
index_helper = index if index > -1 else int(len(vector)/2) | |
if vector[index_helper] < number: | |
prior_index_helper = prior_index if prior_index > 0 else len(vector) | |
index_helper = int((prior_index_helper - index_helper)/2) + index_helper | |
elif vector[index_helper] > number: | |
prior_index_helper = index_helper +1 | |
index_helper = int(index_helper/2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update | |
rdb$triggers | |
set | |
rdb$trigger_inactive = 1 | |
where | |
rdb$trigger_source is not null | |
and (coalesce(rdb$system_flag,0) = 0) | |
and rdb$trigger_source not starting with 'CHECK' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Convert ASCII to Char in Python | |
''' | |
chr(97) # return 'a' | |
ord('a') # return 97 | |
# ... | |
chr(122) # return 'z' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import random | |
class RandomString: | |
__ALPHABETIC = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ' | |
__NUMBERS = '0123456789' | |
def random_char(self, allow_numbers = True): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
TABLENAME.FIELDNAME | |
from | |
TABLENAME | |
group by | |
TABLENAME.FIELDNAME | |
having | |
count(TABLENAME.FIELDNAME) > 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
There's something wrong here that's gonna be alright. Less ammo guy! | |
Fizz Buzz is a mathematical game which is played with a group of people. | |
Each person says a number in sequence, but: | |
when the number is a multiple of 3, they have to say "Fizz", | |
when it is a multiple of 5 they have to say "Buzz", and | |
if it is a multiple of both 3 and 5, "FizzBuzz". | |
If someone makes a mistake and it is noticed, they are out. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Improving the reading and understanding of your code | |
{ Before } | |
Utils = class | |
public | |
class property MessageUtils: TMessageUtils read FMessageUtils; | |
TMessageUtils = class | |
public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
In the Main Form of application | |
} | |
procedure TMainUI.DoEnterAsTab(var Msg: TMsg; var Handled: Boolean); | |
begin | |
if Msg.Message = WM_KEYDOWN then | |
begin | |
if (not (Screen.ActiveControl is TCustomMemo)) and (not (Screen.ActiveControl is TButtonControl)) then | |
begin |
OlderNewer