This file contains hidden or 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 nsToStr(nanoseconds): | |
h=3.6e+12 | |
m=h/60 | |
s=m/60 | |
return str(int(d/h)) +':'+str(int((d%h)/m))+':'+ str(int((d%h)%m/s)) + '.' + str(int((d%h)%m%s)) |
This file contains hidden or 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
import socket | |
UDP_IP = "127.0.0.1" | |
UDP_PORT = 1234 | |
MESSAGE = "Hello, World!" | |
print ("UDP target IP:", UDP_IP) | |
print ("UDP target port:", UDP_PORT) | |
print ("message:", MESSAGE) |
This file contains hidden or 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
import logging | |
import socket | |
log = logging.getLogger('udp_server') | |
def udp_server(host='127.0.0.1', port=1234): | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
This file contains hidden or 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
#include <iostream> | |
#define STR(p) #p | |
enum { | |
Tool, | |
Main | |
}; | |
int main() |
This file contains hidden or 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
#include <iostream> | |
#include <unordered_set> | |
class TestEvent { | |
private: | |
static std::unordered_set<TestEvent*> objects; | |
std::string m_title; | |
public: | |
TestEvent(const std::string& title):m_title (title) |
This file contains hidden or 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
#include <iostream> | |
#include <map> | |
template<typename TValue> | |
int locateFirstAvailableSlot(std::map<int, TValue> my_map) | |
{ | |
typename std::map<int, TValue>::iterator it; | |
int expected_value=1; |
This file contains hidden or 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
export HISTIGNORE=$'[ \t]*:&:[fb]g:exit' # Don't put duplicate lines in the history. | |
alias grep='grep --color=always' # show differences in colour | |
alias ls='ls -h --color=tty' # Dispaly size unit, classify files in colour | |
alias ll='ls -l' # long list | |
alias la='ls -A' # all but . and .. | |
alias l='ls -CF' # | |
alias cd.='cd ..' | |
alias cd..='cd ../..' | |
alias cd...='cd ../../..' | |
alias cd....='cd ../../../..' |
This file contains hidden or 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
CMD:listbugs(playerid, params[]) | |
{ | |
if(GetFactionType(playerid) != FACTION_FEDERAL) | |
{ | |
SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a federal agent."); | |
return 1; | |
} | |
SendClientMessage(playerid, COLOR_GREEN, "Online Bugged players:"); |
This file contains hidden or 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
ls -d */ | awk '{print "cd "$0" && git config core.filemode false && cd .."}' > script.sh | |
chmod +x script.sh | |
./script.sh |
This file contains hidden or 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
{ | |
... | |
"problemMatcher": { | |
"base": "$gcc", | |
"fileLocation": ["relative", "${workspaceRoot}/builddir"] | |
} | |
} |
OlderNewer