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
function Animal(name) { | |
this.ssname = name; | |
console.log("Animal ctor", arguments); | |
} | |
Animal.prototype.walk = function() { | |
console.log("Animal walks", this.ssname); | |
} | |
Cat.prototype = new Animal(); |
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 <cstdlib> | |
#include <iostream> | |
using namespace std; | |
class Bar { | |
public: | |
Bar(std::string thoughts) : _thoughts(thoughts) { |
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 <cstdlib> | |
#include <iostream> | |
#include <functional> | |
using namespace std; | |
// http://en.cppreference.com/w/cpp/language/lambda | |
int main(int argc, char** argv) { | |
// Completely inline: |
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
/* | |
* Simple program to demonstrate a couple uses for pointers. This program was | |
* written so I could learn more about how to apply pointers and their syntax. | |
* As I'm a C novice, please don't just take this file for granted as it may | |
* contain errors and or bad practises. | |
* | |
* By Gerard (gerjo) Meier | |
*/ | |
#include <stdio.h> |
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
registerEvent(IDENT_IAM, [this] (Packet* packet) -> Packet* { | |
_state = IDENT_ACCEPTED; | |
return new Packet(PacketTypes::IDENT_ACCEPTED, "Welcome."); | |
}); | |
registerEvent(PING, [this] (Packet* packet) -> Packet* { | |
return new Packet(PacketTypes::PONG, "PONG"); | |
}); | |
registerEvent(REQUEST_LARGE_PACKET, [this] (Packet* packet) -> Packet* { |
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
#!/usr/bin/php | |
<?php | |
$path = trim(`pwd`); | |
$submodulePath = $path . DIRECTORY_SEPARATOR . ".gitmodules"; | |
$commands = array("cd {$path} && git pull"); | |
if(is_file($submodulePath)) { | |
$ini = parse_ini_file($submodulePath, true); |
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
==8793== Syscall param ioctl(generic) points to uninitialised byte(s) | |
==8793== at 0x37B7CEA2F7: ioctl (syscall-template.S:82) | |
==8793== by 0x37CF8035F7: drmIoctl (xf86drm.c:167) | |
==8793== by 0x5FA2BA7: drm_intel_gem_bo_free (intel_bufmgr_gem.c:930) | |
==8793== by 0x5FA2C9D: drm_intel_bufmgr_gem_destroy (intel_bufmgr_gem.c:1587) | |
==8793== by 0x5999BAD: intelDestroyScreen (intel_screen.c:382) | |
==8793== by 0x59DD35A: driDestroyScreen (dri_util.c:114) | |
==8793== by 0x37D36482B1: ??? (in /usr/lib64/libGL.so.1.2) | |
==8793== by 0x37D36204A5: ??? (in /usr/lib64/libGL.so.1.2) | |
==8793== by 0x37D3620522: ??? (in /usr/lib64/libGL.so.1.2) |
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
==10693== HEAP SUMMARY: | |
==10693== in use at exit: 217,921 bytes in 1,488 blocks | |
==10693== total heap usage: 274,279 allocs, 272,791 frees, 72,070,871 bytes allocated | |
==10693== | |
==10693== 39 bytes in 1 blocks are definitely lost in loss record 23 of 95 | |
==10693== at 0x4A08301: operator new(unsigned long) (vg_replace_malloc.c:298) | |
==10693== by 0x37C18BC2D8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (new_allocator.h:94) | |
==10693== by 0x37C18BDCC4: char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) (basic_string.tcc:140) | |
==10693== by 0x37C18BDDA2: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (basic_string.h:1722) | |
==10693== by 0x41C289: Network::init() (Network.cpp:157) |
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
==11337== HEAP SUMMARY: | |
==11337== in use at exit: 217,867 bytes in 1,487 blocks | |
==11337== total heap usage: 276,445 allocs, 274,958 frees, 74,240,734 bytes allocated | |
==11337== | |
==11337== 39 bytes in 1 blocks are definitely lost in loss record 23 of 94 | |
==11337== at 0x4A08301: operator new(unsigned long) (vg_replace_malloc.c:298) | |
==11337== by 0x37C18BC2D8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (new_allocator.h:94) | |
==11337== by 0x37C18BDCC4: char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) (basic_string.tcc:140) | |
==11337== by 0x37C18BDDA2: std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) (basic_string.h:1722) | |
==11337== by 0x41C2ED: Network::init() (Network.cpp:157) |
OlderNewer