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
// Asynchronous Client Socket Example | |
// http://msdn.microsoft.com/en-us/library/bew39x2a.aspx | |
using System; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Threading; | |
using System.Text; | |
// State object for receiving data from remote device. |
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
APP_NAME := my_awesome_app | |
all: compile | |
compile: clear | |
@cp src/$(APP_NAME).app ebin/ | |
@erlc -pa ebin/ -o ebin/ src/*.erl | |
compile_test: compile | |
@erlc -pa ebin/ -o ebin/ test/*.erl |
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
$ python xlog.py sample.log | |
{'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68898', 'priority': '132', 'message': 'bla bla bla warn'} | |
{'appname': 'test.app', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '68902', 'priority': '131', 'message': 'bla bla bla error'} | |
{'appname': 'Dock', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '154', 'priority': '11', 'message': 'CGSReleaseWindowList: called with 5 invalid window(s)'} | |
{'appname': 'WindowServer', 'timestamp': '2012-09-06 15:19:32', 'hostname': 'codezone.local', 'pid': '79', 'priority': '11', 'message': 'CGXSetWindowListAlpha: Invalid window 0'} | |
$ python xlog.py sample.log | grep test.app | |
{'priority': '132', 'timestamp': '2020-03-04 12:42:40', 'hostname': 'codezone.local', 'appname': 'test.app', 'pid': '68898', 'message': 'bla bla bla warn'} |
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 | |
pos, | |
sim, | |
p.* | |
FROM | |
produtos AS p, | |
NULLIF(POSITION('seme' IN LOWER(COALESCE(p.gtin, '') || ' ' || COALESCE(p.descricao, ''))), 0) AS pos, | |
NULLIF(SIMILARITY(LOWER(COALESCE(p.gtin, '') || ' ' || COALESCE(p.descricao, '')), 'seme'), 0) AS sim | |
WHERE | |
(LOWER(COALESCE(p.gtin, '') || ' ' || COALESCE(p.descricao, ''))) LIKE 'seme%' |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; |
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
private static void ParallelFor() | |
{ | |
var numberOfIterations = 1000; | |
var min = 0; | |
var max = 100_000_000; | |
var random = new Random(); | |
var breakIndex = random.Next(1, numberOfIterations); |
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
Sample code on how to parse command line options with Mono.Options. | |
Mono.Options can be downloaded and compiled from: | |
https://github.com/mono/mono/tree/master/mcs/class/Mono.Options/Mono.Options |
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
kill `ps aux | grep xsp4.exe | grep -v grep | awk '{print $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
#!/usr/bin/env ruby | |
# | |
# A little sugar to use Mono C# 4.0 compiler. | |
# | |
# Author: Leandro Silva | |
# . leandrodoze@gmail.com | |
# . http://leandrosilva.com.br | |
# . @codezone | |
# |
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
Code Effect | |
0 Turn off all attributes | |
1 Set bright mode | |
4 Set underline mode | |
5 Set blink mode | |
7 Exchange foreground and background colors | |
8 Hide text (foreground color would be the same as background) | |
30 Black text | |
31 Red text | |
32 Green text |
NewerOlder