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 sublime, sublime_plugin | |
class ConsoleLog(sublime_plugin.TextCommand): | |
def run(self, edit): | |
view = self.view | |
for sel in view.sel(): | |
selection = cursor = sel | |
line_region = view.line(cursor) | |
line_text = view.substr(line_region) | |
ident = line_text.replace(line_text.lstrip(), "") | |
if cursor.empty(): |
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
unsigned long int powsoftwo = 1; | |
do { | |
cout << " x=" << (int) log10(powsoftwo) << " y=" << powsoftwo << endl; | |
powsoftwo = powsoftwo << 1; | |
} while (powsoftwo != 0); |
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 <stdexcept> | |
/* | |
T must implement operator=, copy ctor | |
*/ | |
template<typename T> class CircBuf { | |
// don't use default ctor | |
CircBuf(); |
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.ArrayList; | |
public class Main { | |
static final int MAX = 100000; | |
static final int THREADS = Runtime.getRuntime().availableProcessors(); | |
static final int ARRINITSIZE = 100000; | |
static ArrayList<Integer> primes = new ArrayList<Integer>(ARRINITSIZE); | |
public static void main(String[] args) throws Exception { | |
Thread[] t = new Thread[THREADS]; | |
PrimeRun.m = new Monitor(); |