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
authenticate(Opcode, Data, State) -> | |
case logon_patterns:auth_request(Data) of | |
{ok, Build, Account} -> | |
case account_helper:find_by_name(Account) of | |
[AccountRecord] -> | |
H = srp6:challenge(AccountRecord), | |
NewState = State#logon_state{authenticated=no, account=AccountRecord, hash=H}, | |
{send, logon_patterns:auth_reply(H), NewState}; | |
_ -> | |
{send, logon_patterns:error(Opcode, account_missing), State} |
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
%begin | |
{R, cmsg_player_login, D} -> | |
{ok, CharId} = realm_patterns:cmsg_player_login(D), | |
Char = char_helper:find(CharId), | |
ok = set_dungeon_difficulty(S, -1), | |
MapPid = verify_world(S, Char), | |
ok = send_account_data(S), | |
ok = set_rest_start(S), | |
ok = set_tutorial_flags(S), | |
ok = send_spells_and_cooldowns(S), |
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
observe_search_query({search_query, {product, PropsSorted}, OffsetLimit}, Context) -> | |
%% io:format("~p~n", [PropsSorted]), | |
#search_sql{select="*", from="product", tables=[{product, "product"}]}; | |
observe_search_query({search_query, Req, OffsetLimit}, Context) -> | |
z_notifier:first({search_query, Req, OffsetLimit}, Context). |
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
module Game.Player { | |
class Player { | |
public skills: Skill[]; | |
} | |
export class Skill { | |
} | |
} |
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
pub fn insert(&mut self, k: K, v: V) { | |
if k < self.key { | |
match self.left { | |
Some(ref mut l) => l.insert(k, v), | |
None => self.left = Some(self.make_child(k, v)) | |
} | |
} | |
else if k > self.key { | |
match self.right { | |
Some(ref mut r) => r.insert(k, v), |
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(window) { | |
function Some(v) { | |
this.value = v; | |
} | |
Some.prototype = { | |
map: function(f) { | |
return some(f(this.value)); | |
}, | |
isNone: false, |
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
{-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-} | |
module Proto.King.Hello (Hello(..)) where | |
import Prelude ((+), (/)) | |
import qualified Prelude as Prelude' | |
import qualified Data.Typeable as Prelude' | |
import qualified Data.Data as Prelude' | |
import qualified Text.ProtocolBuffers.Header as P' | |
import qualified Proto.King.NodeDescription as King (NodeDescription) | |
data Hello = Hello{hNodeDesc :: !King.NodeDescription} |
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
instance GenServerState Command Int CounterState where | |
handle_call Get = gets counter | |
handle_cast Inc = | |
modify $ \st -> st { counter = counter st + 1 } | |
-- another instance for CounterState | |
instance GenServerState Command Float CounterState where | |
handle_call Get = gets (fromIntegral . counter) | |
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
(** **** Exercise: 2 stars (andb_eq_orb) *) | |
(** Prove the following theorem. (You may want to first prove a | |
subsidiary lemma or two.) *) | |
Lemma orb_always_true : | |
forall b, | |
orb true b = true. | |
Proof. reflexivity. Qed. | |
Lemma andb_always_false : |
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
<!DOCTYPE html> | |
<html> | |
<head><title>Example</title></head> | |
<body> | |
<script type="text/javascript" src="http://localhost:8090/webpack-dev-server.js"></script> | |
<script type="text/javascript" src="http://localhost:8090/assets/bundle.js"></script> | |
</body> | |
</html> |
OlderNewer