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
program TesteCotacao; | |
{$APPTYPE CONSOLE} | |
{$R *.res} | |
uses | |
System.SysUtils, | |
Utils.Cotacao in 'Utils.Cotacao.pas'; |
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
procedure TForm1.BitBtn1Click(Sender: TObject); | |
begin | |
TUDPServer.GetInstance().SetReponseToMessage( | |
function(const AMsg : string):String | |
begin | |
Memo1.Lines.Insert(0,AMsg); | |
if AMsg = 'UDP-MSG' then | |
Result := 'DONE' | |
else | |
Result := ReverseString(AMsg); |
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
procedure TForm1.Button1Click(Sender: TObject); | |
var | |
wPort: Word; | |
sIp: string; | |
sMsg: string; | |
begin | |
TUDPClient.GetInstance().EndOfProtocol := '.'; | |
sMsg := TUDPClient.GetInstance().SendBroadcast('UDP-MSG',sIp,wPort); | |
Memo1.Lines.Add(Format('[%s] [%d] : %s',[sIp,wPort,sMsg])); |
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
unit Rastreio.Correios; | |
interface | |
uses | |
IdHTTP, | |
System.Generics.Collections; | |
type | |
TStatus = record |
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
class MyClass: | |
__instance = None | |
@staticmethod | |
def instance(): | |
if not MyClass.__instance: | |
MyClass.__instance = MyClass() | |
return MyClass.__instance |
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
__author__ = 'diego.garcia' | |
import datetime | |
dt = datetime.datetime.strptime('February 28, 2014, 7:05 AM', '%B %d, %Y, %I:%M %p') | |
print(dt.strftime("%d/%m/%Y %I:%M %p")) |
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
__author__ = 'Diego Garcia' | |
from pymongo import MongoClient | |
import ptracking | |
def make_tracking(cod, user, package): | |
t = ptracking.PyTracking(ptracking.BRAZIL) | |
p = t.tracking(cod) | |
p['package'] = package |
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
unit Strategy.Concrete.Lower; | |
interface | |
uses | |
Strategy.Interfaces; | |
type | |
TFormatterLower = class(TInterfacedObject, IFormatter) | |
public | |
function GetFormattedText(AText: IText): string; |
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
#based on: https://github.com/sixohsix/twitter | |
__author__ = 'Diego Garcia' | |
from twitter import * | |
from my_twitter_tokens import * # TOKENS CONSTS | |
t = Twitter( | |
auth=OAuth(ACCESS_TOKEN, | |
ACCESS_TOKEN_SECRET, | |
API_KEY, |
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
net use \\%Machine% [PasswordOfRemoteMachine] /USER:[UserOfRemoteMachine] | |
sc \\%Machine% %Action% %Service% |
OlderNewer