Skip to content

Instantly share code, notes, and snippets.

View toddlipcon's full-sized avatar

Todd Lipcon toddlipcon

View GitHub Profile
(defun open-or-switch-to (file)
(let ((existing-buffer (find-buffer-visiting file)))
(cond (existing-buffer (pop-to-buffer existing-buffer))
(t (find-file-existing file)))))
(defun switch-to-header-or-impl ()
(interactive)
(let ((other-file
private void addFlag() {
int ch = peek();
for (;;) {
switch (ch) {
case 'i':
flags |= CASE_INSENSITIVE;
break;
case 'm':
flags |= MULTILINE;
break;
[todd@p0116 tmp]$ cat test.cc
#include <boost/thread.hpp>
int main() { return 0; }
[todd@p0116 tmp]$ g++ -o test test.cc
[todd@p0116 tmp]$ /opt/toolchain/llvm-3.2/bin/clang++ -o test test.cc
In file included from test.cc:1:
In file included from /usr/include/boost/thread.hpp:24:
In file included from /usr/include/boost/thread/future.hpp:12:
/usr/include/boost/exception_ptr.hpp:41:5: error: exception specification of overriding function is more lax than
#include <string>
class Base {
public:
virtual ~Base() throw() {}
};
class Derived : public Base {
private:
std::string x;
"RequestHandlerThread[#186]" daemon prio=10 tid=0x00007f77d4023000 nid=0x556a runnable [0x00007f7612ceb000]
java.lang.Thread.State: RUNNABLE
at java.util.zip.Deflater.deflateBytes(Native Method)
at java.util.zip.Deflater.deflate(Deflater.java:322)
- locked <0x00000006ac87b508> (a java.util.zip.ZStreamRef)
at java.util.zip.DeflaterOutputStream.deflate(DeflaterOutputStream.java:176)
at java.util.zip.DeflaterOutputStream.write(DeflaterOutputStream.java:135)
at java.util.zip.GZIPOutputStream.write(GZIPOutputStream.java:89)
- locked <0x00000006ac87b298> (a java.util.zip.GZIPOutputStream)
at org.kohsuke.stapler.compression.FilterServletOutputStream.write(FilterServletOutputStream.java:31)
class Foo {
public:
static Foo* CreateFoo() {
return new Foo();
}
private:
Foo() {}
};
119 static boolean getAllSubDirs(Path path, Job job, Set<Path> paths) throws IOException {
120 FileSystem fs = FileSystem.get(path.toUri(), job.getConfiguration());
121 FileStatus[] matchedFiles = fs.globStatus(path, PATH_FILTER);
122 if (matchedFiles == null || matchedFiles.length == 0) {
123 return false;
124 }
125 for (FileStatus file : matchedFiles) {
126 if (file.isDir()) {
127 for (FileStatus sub : fs.listStatus(file.getPath())) {
128 getAllSubDirs(sub.getPath(), job, paths);
#!/bin/bash
REMOTE=${GERRIT:-gerrit}
GERRIT_NUMBER=$1
REV_A=$2
REV_B=$3
if ! [[ "$GERRIT_NUMBER" =~ "[0-9]+" ]] || \
! [[ "$REV_A" =~ "[0-9]+" ]] || \
! [[ "$REV_B" =~ "[0-9]+" ]] ; then
#include <boost/thread/thread.hpp>
#define CHECK(x) if (!x) { abort(); }
struct State {
State()
: x(0) {
}
boost::mutex m;
#!/bin/bash
echo Waiting for NTP sync status
start_time=$(cut -f1 -d. /proc/uptime)
delta=0
while ntptime | grep UNSYNC ; do
now=$(cut -f1 -d. /proc/uptime)
delta=$[$now - $start_time]
if [ $delta -gt 600 ]; then
echo NTP time sync never achieved. Failing build.