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 BubbleSort(var Vetor: Array of Integer); | |
var | |
i, temp: Integer; | |
changed: Boolean; | |
begin | |
changed := True; | |
while changed do | |
begin | |
changed := False; |
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
{$IFDEF VER80} ShowMessage('Delphi 1');{$ENDIF} | |
{$IFDEF VER90} ShowMessage('Delphi 2');{$ENDIF} | |
{$IFDEF VER100} ShowMessage('Delphi 3');{$ENDIF} | |
{$IFDEF VER120} ShowMessage('Delphi 4');{$ENDIF} | |
{$IFDEF VER130} ShowMessage('Delphi 5');{$ENDIF} | |
{$IFDEF VER140} ShowMessage('Delphi 6');{$ENDIF} | |
{$IFDEF VER150} ShowMessage('Delphi 7');{$ENDIF} | |
{$IFDEF VER160} ShowMessage('Delphi 8');{$ENDIF} | |
{$IFDEF VER170} ShowMessage('Delphi 2005');{$ENDIF} | |
{$IFDEF VER180} ShowMessage('Delphi 2006');{$ENDIF} |
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
GRANT CONNECT ON DATABASE $dbName TO $user; | |
GRANT USAGE ON SCHEMA $schema TO $user; | |
GRANT SELECT ON ALL TABLES IN SCHEMA $schema TO $user; | |
Default privileges | |
ALTER DEFAULT PRIVILEGES IN SCHEMA $schema | |
GRANT SELECT ON TABLES TO $user; | |
see more at http://www.postgresql.org/docs/9.0/static/sql-alterdefaultprivileges.html |
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
Contributing | |
1. Fork it | |
2. Create your feature branch (git checkout -b my-new-feature) | |
3. Commit your changes (git commit -am 'Added some feature') | |
4. Push to the branch (git push origin my-new-feature) | |
5. Create new Pull Request |
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
public void redirect(String path) throws Exception { | |
FacesContext ctx = FacesContext.getCurrentInstance(); | |
ExternalContext extContext = ctx.getExternalContext(); | |
String url = extContext.encodeActionURL(ctx.getApplication().getViewHandler().getActionURL(ctx, path)); | |
extContext.redirect(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
/* List active sessions */ | |
select datname, | |
procpid, | |
usename, | |
application_name, | |
client_addr, | |
client_hostname, | |
backend_start | |
from pg_stat_activity; |
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
/* List all session, except background processes*/ | |
SELECT s.username, | |
s.osuser, | |
s.sid, | |
s.serial#, | |
p.spid, | |
s.status, | |
s.machine, | |
s.program, | |
TO_CHAR(s.logon_Time,'DD-MON-YYYY HH24:MI:SS') AS logon_time |
NewerOlder