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
use rlua::{Context, Error, FromLua, Lua, Value}; | |
fn eval2<'lua, T>(lua_text: &str) -> rlua::Result<T> // line 190 | |
where T: FromLua<'lua> | |
{ | |
let lua = Lua::new(); | |
let result = lua.context(|lua_ctx: Context<'lua>| { | |
let result = lua_ctx |
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
function package_deps() { | |
BINARY=$1 | |
DEPS=$(otool -L $BINARY \ | |
| grep "/opt/local/lib" \ | |
| tr -s ' ' \ | |
| cut -d ' ' -f 1) | |
for DEP in $DEPS; do | |
cp $DEP Far2l.app/Contents/MacOS/ |
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
preprocessor_data::preprocessor_data(preprocessor_streambuf& t, | |
filesystem::scoped_istream i, | |
const std::string& history, | |
const std::string& name, | |
int linenum, | |
const std::string& directory, | |
const std::string& domain, | |
std::unique_ptr<std::map<std::string, std::string>> defines, | |
bool is_define) | |
: preprocessor(t) |
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
(lldb) process interrupt | |
Process 21193 stopped | |
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP | |
frame #0: 0x00007fff5bacc20a libsystem_kernel.dylib`mach_msg_trap + 10 | |
libsystem_kernel.dylib`mach_msg_trap: | |
-> 0x7fff5bacc20a <+10>: retq | |
0x7fff5bacc20b <+11>: nop | |
libsystem_kernel.dylib`mach_msg_overwrite_trap: | |
0x7fff5bacc20c <+0>: movq %rcx, %r10 |
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
void write_key_val_visitor::operator()(t_string const &value) const | |
{ | |
bool first = true; | |
// Crashes: | |
for (t_string::walker w(value); !w.eos(); w.next()) | |
// Doesn't crash: | |
for (t_string::walker w(value.get()); !w.eos(); w.next()) | |
// ... | |
} |
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
1. Windows: https://stackoverflow.com/questions/29438430/how-to-get-dpi-scale-for-all-screens | |
2. OS X: https://stackoverflow.com/questions/12589198/how-to-read-the-physical-screen-size-of-osx | |
3. GTK: https://stackoverflow.com/questions/25048987/in-gtk-linux-whats-the-correct-way-to-get-the-dpi-scale-factor | |
4. Qt: https://stackoverflow.com/questions/20603931/how-to-get-the-dpi-of-the-display-screen-in-qt |
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
static ProfileCounter counter_one("profiled_function"); | |
void profiled_function() | |
{ | |
... | |
{ | |
ProfileGuard g(&counter_one); | |
do_some_timed_activity(); | |
} | |
... |
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
int f() { | |
FILE *fp = NULL; | |
Forest* forest = NULL; | |
Tree *tree = NULL; | |
Element *element = NULL; | |
int status = 0; | |
fp = fopen("data.txt", "rb"); | |
forest = generate_forest(fp, ...); | |
if (!forest) { |
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
BSS 90:94:e4:ef:51:34 (on wlan0) -- associated | |
TSF: 235968921975 usec (2d, 17:32:48) | |
freq: 2412 | |
beacon interval: 100 | |
capability: ESS Privacy ShortSlotTime APSD (0x0c11) | |
signal: -65.00 dBm | |
last seen: 116 ms ago | |
Information elements from Probe Response frame: | |
SSID: Torba Lab | |
Supported rates: 1.0* 2.0* 5.5* 11.0* 9.0 18.0 36.0 54.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
package com.foobar.chaos; | |
import javax.naming.InitialContext; | |
import javax.naming.Reference; | |
import org.eclipse.jetty.plus.jndi.Resource; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.webapp.WebAppContext; | |
public class JettyLauncher { |