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
/* | |
* Measures the current (and peak) resident and virtual memories | |
* usage of your linux C process, in kB | |
*/ | |
void getMemory( int* currRealMem, | |
int* peakRealMem, | |
int* currVirtMem, | |
int* peakVirtMem ) | |
{ |
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 | |
from ctypes import wintypes | |
import time | |
import msvcrt | |
user32 = ctypes.WinDLL('user32', use_last_error=True) | |
INPUT_MOUSE = 0 | |
INPUT_KEYBOARD = 1 |
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
package jstest.views; | |
import javax.tools.*; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.lang.reflect.InvocationTargetException; | |
import java.net.URI; | |
import java.security.SecureClassLoader; | |
import java.util.ArrayList; |
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 java.util.List; | |
import javax.script.ScriptEngine; | |
import javax.script.ScriptEngineFactory; | |
import javax.script.ScriptEngineManager; | |
import javax.script.ScriptException; | |
public class ScriptTest { | |
public final String hello = "Hello"; | |
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 <boost/property_tree/ptree.hpp> | |
#include <boost/any.hpp> | |
#include <boost/property_tree/info_parser.hpp> | |
#include <boost/foreach.hpp> | |
#include <list> | |
#include <string> | |
#include <iostream> | |
using namespace boost::property_tree; |
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
To add you Xtext Dsl Editor to Multi-Page Editor | |
Getting the instance of XText editor | |
MyDslActivator activator = MyDslActivator.getInstance(); | |
final Injector injector = activator.getInjector("org.shashwat.xtext.mydsl.MyDsl"); | |
XtextEditor xtextEditor = injector.getInstance(XtextEditor.class); | |
Remember to have editor input instance of IFileEditorInput. XtextEditor uses XtextDocumentProvider which extends FileDocumentProvider |
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
// public domain | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <memory> | |
#include <windows.h> |
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
// public domain | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cstring> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <memory> | |
#include <windows.h> |
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
git filter-branch -f --commit-filter 'GIT_COMMITTER_NAME="Serge Lamikhov-Center"; GIT_AUTHOR_NAME="Serge Lamikhov-Center"; GIT_COMMITTER_EMAIL="[email protected]"; GIT_AUTHOR_EMAIL="[email protected]"; git commit-tree "$@";' HEAD |
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 <windows.h> | |
class HPTimer | |
{ | |
public: | |
HPTimer( std::string name ) : total(0.0), name_(name) | |
{ | |
} | |
void reset() |
NewerOlder