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 FooClass = function() | |
{ | |
x = function() { /* Class constructor */ }; | |
x.prototype.foo = "bar"; | |
x.prototype.__init__ = function() | |
{ | |
this.something = "other"; | |
}; | |
x.prototype.__call__ = function() { | |
return 42; |
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
load("py-builtins.js"); | |
load("datadumper.js"); | |
d = function(x, y) { | |
if (defined(y)) { | |
print(x, Dumper(y)); | |
} else { | |
print("Dump", Dumper(x)); | |
} | |
}; |
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
rpc.event_click = lambda: jQuery.jsonRPC.request(js('test.sum'), js({ | |
params: [1, 2, 3, 4], | |
success: lambda result: alert(sprintf(js("Result from server: %s"), result.result)), | |
error: lambda result: alert("fail") | |
})) |
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
Compiling test v0.1.0 (file:///home/chrivers/git/rust/test) | |
<std macros>:5:8: 6:42 error: mismatched types: | |
expected `()`, | |
found `core::result::Result<_, _>` | |
(expected (), | |
found enum `core::result::Result`) [E0308] | |
<std macros>:5 return $ crate:: result:: Result:: Err ( | |
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } ) | |
src/main.rs:7:13: 7:42 note: in this expansion of try! (defined in <std macros>) | |
<std macros>:5:8: 6:42 help: run `rustc --explain E0308` to see a detailed explanation |
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
Compiling rustray v0.1.0 (file:///home/chrivers/git/rustray) | |
src/sphere.rs:21:21: 21:25 error: mismatched types: | |
expected `vector::Vector<F>`, | |
found `&_` | |
(expected struct `vector::Vector`, | |
found &-ptr) [E0308] | |
src/sphere.rs:21 fn trace(&self, &hit: Vector<F>, &light: Light<F>) -> Color<F> | |
^~~~ | |
src/sphere.rs:21:21: 21:25 help: run `rustc --explain E0308` to see a detailed explanation | |
src/sphere.rs:21:38: 21:44 error: mismatched types: |
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
use num::ToPrimitive; | |
macro_rules! enum_to_primitive { | |
($name:ident) => { | |
impl ToPrimitive for $name { | |
fn to_i64(&self) -> Option<i64> { | |
return Some(*self as i64); | |
} | |
fn to_u64(&self) -> Option<u64> { |
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
enum_from_primitive! { | |
#[derive(Debug,Clone,Copy)] | |
pub enum AlertStatus | |
{ | |
Normal = 0x00, | |
RedAlert = 0x01, | |
} | |
} | |
enum_to_primitive!(AlertStatus); |
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
// all cases are unit enums | |
pub enum ServerPacket | |
{ | |
AllShipSettings(AllShipSettingsPacket), | |
BeamFired(BeamFiredPacket), | |
CommsIncoming(CommsIncomingPacket), | |
ConsoleStatus(ConsoleStatusPacket), | |
DestroyObject(DestroyObjectPacket), | |
Difficulty(DifficultyPacket), | |
DmxMessage(DmxMessagePacket), |
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
macro_rules! enum_to_primitive { | |
($name:ident) => { | |
impl ToPrimitive for $name { | |
fn to_i64(&self) -> Option<i64> { | |
return Some(*self as i64); | |
} | |
fn to_u64(&self) -> Option<u64> { | |
return Some(*self as u64); | |
} |
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
diff --git data/parser.stf data/parser.stf | |
index 29aa2f7..3f6f0fd 100644 | |
--- data/parser.stf | |
+++ data/parser.stf | |
@@ -66,7 +66,7 @@ parser SimpleEvent(u32) | |
0x10: struct<ServerPacket::DmxMessage> | |
0x11: struct<ServerPacket::KeyCaptureToggle> | |
0x12: struct<ServerPacket::Perspective> | |
-## 0x13: ... | |
+ 0x13: struct<ServerPacket::__unknown_3> |
OlderNewer