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
section .text | |
global _start ;must be declared for linker (ld) | |
_start: ;tell linker entry point | |
mov edx,len ;message length | |
mov ecx,msg ;message to write | |
mov ebx,1 ;file descriptor (stdout) | |
mov eax,4 ;system call number (sys_write) | |
int 0x80 ;call kernel |
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
#![feature(struct_variant)] | |
extern crate debug; | |
enum Direction { | |
Up, Down, Left, Right | |
} | |
/* | |
use std::fmt; |
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
#include <iostream> | |
struct bar { | |
int i; | |
}; | |
struct foo { | |
int bar::* 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
#!/bin/bash | |
LOG="mail.log" | |
while read -r -a array; do | |
echo ${array[*]} >> ${LOG} | |
done |
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
#include <iostream> | |
#include <memory> | |
#include <string> | |
class Greeter { | |
public: | |
template <class T> | |
Greeter(T data) : self_(std::make_shared<Model<T>>(data)) {} | |
void greet(const std::string &name) const { |
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
#ifndef __APPLE__ | |
#include <algorithm> | |
#endif | |
#include <iostream> | |
#include <fstream> | |
using namespace std; | |
int main(int argc, char *argv[]) |
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
#include <iostream> | |
using namespace std; | |
class A { | |
public: | |
A() { | |
cout << "default constructor" << endl; | |
} | |
A(const A& x) { |
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
#include <stack> | |
class MinStack { | |
public: | |
void push(int x) { | |
s.push(x); | |
if (m.empty() == true || m.top() >= x) { | |
m.push(x); | |
} |
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
import ctypes | |
class IntStruct(ctypes.Structure): | |
_fields_ = [("ob_refcnt", ctypes.c_long), | |
("ob_type", ctypes.c_void_p), | |
("ob_size", ctypes.c_ulong), | |
("ob_digit", ctypes.c_long)] | |
def __repr__(self): | |
return ("IntStruct(ob_digit={self.ob_digit}, " | |
"refcount={self.ob_refcnt})").format(self=self) |
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
int main() { | |
int *x[10]; | |
int (*y)[10]; | |
int val = 666; | |
for (int a = 0; a < 10; a++) { | |
x[a] = &val; | |
(*y)[a] = val; | |
} |
OlderNewer