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
__author__ = 'diego.garcia' | |
import urllib.request as req | |
import re | |
class Cotacao: | |
def __get_cotacao(self, url, regex='^.*nacional" value="([0-9,]+)"'): | |
pagina = req.urlopen(url) |
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
__author__ = 'diego.garcia' | |
import socket | |
class UDPClient: | |
__IP = '255.255.255.255' | |
__PORT = 49152 | |
__udp_cli = '' |
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
unit Singleton.Example; | |
interface | |
type | |
TMyClass = class | |
strict private | |
class var FInstance : TMyClass; | |
private | |
class procedure ReleaseInstance(); |
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
// ************************************************************************ // | |
// The types declared in this file were generated from data read from the | |
// WSDL File described below: | |
// WSDL : http://www.webservicex.net/CurrencyConvertor.asmx?WSDL | |
// >Import : http://www.webservicex.net/CurrencyConvertor.asmx?WSDL>0 | |
// Encoding : utf-8 | |
// Version : 1.0 | |
// (27/06/2013 19:13:01 - - $Rev: 45757 $) | |
// ************************************************************************ // |
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")) |
OlderNewer