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
| process.on('uncaughtException', function (err) { | |
| console.log('exception: ' + err); | |
| console.log('stack: ' + err.stack); | |
| }); | |
| require('Task/Joose/NodeJS'); | |
| use(['KiokuJS.Backend.CouchDB', 'KiokuJS.Linker'], function () { | |
| var handle = new KiokuJS.Backend.CouchDB({ | |
| dbURL : 'http://localhost:5984/test' | |
| }); | |
| var scope = handle.newScope(); |
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 Options = Cactus.Util.Options; | |
| var jade = require("jade"); | |
| var C = Cactus.Data.Collection; | |
| Class("CpsJade", { | |
| has : { | |
| layoutFile : { required : true } | |
| }, | |
| trait : JooseX.CPS, | |
| methods : { | |
| _parseArgs : function (args) { |
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 editUser = new FormHelper({ | |
| action : "/edit", | |
| fields : { | |
| name : { | |
| in : { type : "string" }, | |
| out : { | |
| // Will always be string or ["string"] for form submissions. | |
| type : "string", | |
| validators : [{ | |
| required : true, |
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
| TRY(function () { | |
| try { | |
| this.CONT.CONTINUE(); | |
| } catch (e) { | |
| console.log("catch 1"); | |
| } | |
| }).THEN(function () { | |
| throw 1; | |
| }).NOW(); |
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
| prepareDto : function (vals, helpers) { | |
| var dto = this.newDto(); | |
| dto.reversePopulate(vals, helpers).then(function () { | |
| try { | |
| var fields = dto.get(helpers); | |
| } catch (e) { | |
| setTimeout(this.getTHROW().curry(e), 0); | |
| return; | |
| } | |
| setTimeout(this.getCONTINUE().curry(fields), 0); |
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
| cpanm (App::cpanminus) 1.4008 on perl 5.010001 built for x86_64-linux-gnu-thread-multi | |
| Work directory is /home/adam/.cpanm/work/1314969734.22227 | |
| You have make /usr/bin/make | |
| You have LWP 5.836 | |
| You have /bin/tar: tar (GNU tar) 1.23 | |
| Copyright (C) 2010 Free Software Foundation, Inc. | |
| License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. | |
| This is free software: you are free to change and redistribute it. | |
| There is NO WARRANTY, to the extent permitted by law. |
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
| #!/usr/bin/env ruby | |
| pairs = [] | |
| while !(print '> ') && (s = gets.strip) != '' | |
| word,num = /^(\S+)\s*(\d+)?$/.match(s)[1..2] | |
| if num | |
| pairs << [word,num.to_i] | |
| else | |
| print(pairs.map { |p_word,p_num| | |
| p_num == word.chars.zip(p_word.chars).inject(0) { |s,(a,b)| s + (a == b ? 1 : 0) } | |
| }.all? ? "match\n" : "no match\n") |
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
| Prelude Text.Regex.Posix> "bar" =~ "(foo|bar)" :: Bool | |
| <interactive>:1:7: | |
| No instances for (RegexMaker Regex CompOption ExecOption [Char], | |
| RegexContext Regex [Char] Bool) | |
| arising from a use of `=~' | |
| Possible fix: | |
| add instance declarations for | |
| (RegexMaker Regex CompOption ExecOption [Char], | |
| RegexContext Regex [Char] Bool) |
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
| Haskell: | |
| data Select = FirstAlternative String String | |
| | SecondAlternative Select Select | |
| | ThirdAlternative Select | |
| printSelect :: Select -> IO () | |
| printSelect (FirstAlternative str1 str2) = | |
| putStr("FirstAlternative(" ++ str1 ++ ", " ++ str2 ++ ")") | |
| printSelect (SecondAlternative sel1 sel2) = do |