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
| # screen-like prefix | |
| unbind C-b | |
| set -g prefix C-a | |
| # Indexing from 1 instead of 0 | |
| set -g base-index 1 | |
| set -g pane-base-index 1 | |
| # Reload config | |
| bind r source-file ~/.tmux.conf \; display "Reloaded tmux config file." |
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
| """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " => General | |
| """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
| " Sets how many lines of history VIM has to remember | |
| set history=700 | |
| " modeline magic! | |
| set modeline | |
| " required! |
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
| var udp = require('dgram'); | |
| var server = udp.createSocket('udp4'); | |
| var client = null; | |
| server.on('message', function(msg, rinfo) { | |
| if(rinfo.address = '127.0.0.1') { | |
| client = rinfo; | |
| } else { | |
| server.send(msg, 0, msg.length, client.port, client.address); | |
| } | |
| var offset = 12, |
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
| public class App { | |
| public interface A { | |
| B foo(); | |
| } | |
| public static class B { | |
| B foo() { return null; } | |
| } | |
| public static class C implements A { | |
| private int x; | |
| public void baz(B b) {} |
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> | |
| using namespace std; | |
| template<class T> | |
| struct Bind { | |
| T first; | |
| T (*fun)(const T&, const T&); | |
| Bind(T (*fun)(const T&, const T&), T f):first(f), fun(fun){} | |
| T operator()(const T& o) { return fun(first, o); } |
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> | |
| using namespace std; | |
| int main() | |
| { | |
| int arr[4][4]; | |
| for(int i=0;i<4;i++) for(int j=0;j<4;j++) arr[i][j]=i*4+j; | |
| for(int i=0;i<16;i++) { | |
| cout<<((int*)arr)[i]<<", "; |
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> | |
| template <class T> | |
| class Vektor | |
| { | |
| protected: | |
| T x; | |
| T y; | |
| public: | |
| Vektor(const T& x = T(), const T& y = T()) : x(x), y(y) { } //Default konstruktor |
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
| // ha T nem primitív típus | |
| template<class T> | |
| bool isPrimitiveType() { return false; } | |
| // kivéve, ha pl int. | |
| // a teljes megoldáshoz double, stb-re is meg kéne írni, ezért fapados kicsit :-) | |
| template<> | |
| bool isPrimitiveType<int>() { return true; } | |
| // A módosított Array konstruktor |
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
| Array<int, 20> t(1); | |
| t.at(8) = 12; | |
| for (size_t i = 0; i < 8; i++) | |
| cout << t.at(i) << endl; | |
| //konstruktor: | |
| explicit Array(size_t n = maxsiz, const T& value = T()) : siz(0) { | |
| // default értékkel feltölti a tömb méretéig, utána tényleg memóriaszemét lesz! | |
| // Ha kitöröljük, tényleg nem 0-kat kapunk... | |
| while (siz < n && siz < maxsiz) |
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
| template <class T> | |
| class OstreamFunctor { | |
| ostream& os; | |
| const char* delim; | |
| public: | |
| ostreamFunctor(ostream& os, const char* delim = ""):os(os),delim(delim){} | |
| /** | |
| * A const módosító kényelmi okokból van csak ott, | |
| * ha akarnánk, lehagyhatnánk. | |
| * Viszont akkor konstans objektumon nem működne, mi pedig szeretnénk azt is. |