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
| HAI | |
| BTW this kinda follows the lolcode 1.2 spec http://lolcode.org/1.2_spec.html | |
| I HAZ A ANSWER | |
| I HAZ A INDEX | |
| BTW defining a function | |
| HOW IZ ASK YR QUESTION | |
| VISIBLE QUESTION | |
| GIMME RESPONZ |
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 unsafe(PVS) of | |
| Res -> Res | |
| catch | |
| A:B -> lager:error("Problem:~p stacktrace:~p",[[A,B], erlang:get_stacktrace()]), | |
| case {A,B} of | |
| {exit,_} -> exit(B); | |
| {error,_} -> error(B); | |
| {exception,_} -> throw(B) | |
| end | |
| end. |
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
| trapping_views = {VIEW_BREAKPOINT: dbg.callbacks.on_breakpoints_dblclick,VIEW_STACK: dbg.callbacks.on_stack_dblclick} | |
| class UnityTrapDoubleclickCommand(TextCommand): | |
| def run_(self, args): | |
| print 'on dbl click' | |
| special_handler = trapping_views.get(self.view.name(),None) | |
| print args | |
| if not special_handler is None: | |
| line = self.view.line(self.view.sel()[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
| Catastrophic failure: System.InvalidOperationException: Hashtable.Enumerator: snapshot out of sync. | |
| at System.Collections.Hashtable+Enumerator.FailFast () [0x00000] in <filename unknown>:0 | |
| at System.Collections.Hashtable+Enumerator.MoveNext () [0x00000] in <filename unknown>:0 | |
| at System.Net.EndPointListener.Close () [0x00000] in <filename unknown>:0 | |
| at System.Net.EndPointManager.RemoveEndPoint (System.Net.EndPointListener epl, System.Net.IPEndPoint ep) [0x00000] in <filename unknown>:0 | |
| at System.Net.EndPointListener.CheckIfRemove () [0x00000] in <filename unknown>:0 | |
| at System.Net.EndPointListener.RemovePrefix (System.Net.ListenerPrefix prefix, System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 | |
| at System.Net.EndPointManager.RemovePrefixInternal (System.String prefix, System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 | |
| at System.Net.EndPointManager.RemoveListener (System.Net.HttpListener listener) [0x00000] in <filename unknown>:0 | |
| at System.Net.HttpListener.Clo |
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
| //Works | |
| public async void Write(byte[] buffer) | |
| { | |
| var len = buffer.Length; | |
| Size += len; | |
| await _stream.WriteAsync(buffer, 0, len); | |
| } | |
| var bytes = Encoding.UTF8.GetBytes(item); | |
| blob.Write(bytes); |
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
| fname = '/Users/yann/temp/products.txt' | |
| #vec = CountVectorizer(input='content',analyzer=str.split,tokenizer=None) | |
| features = [] | |
| y = [] | |
| for line in open(fname,'r'): | |
| c,f = line.split(',',1) | |
| features.append(f) | |
| y.append(c) | |
| print datetime.now(),"splitting data sets" |
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
| pmap(Mapper,XS,_) when length(XS) =< 2-> %async not really useful here | |
| [Mapper(X) || X <-XS]; | |
| pmap(Mapper,XS,Timeout)-> | |
| Myself = self(), | |
| [spawn(fun()-> Myself ! Mapper(X) end) || X <- XS], | |
| map_receive(length(XS),[],Timeout). | |
| map_receive(0,Acc,_) -> Acc; | |
| map_receive(N,Acc,Timeout)-> | |
| receive |
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
| 4> A = integer_to_list(42). | |
| "42" | |
| 5> [C+1 || C <- A]. | |
| "53" | |
| 6> [C+1000 || C <- A]. | |
| [1052,1050] | |
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
| void Main() | |
| { | |
| var chrono = new Stopwatch(); | |
| chrono.Start(); | |
| Syntouze res = null; | |
| for (var i=0; i < 1000; i++) | |
| res = (from taz in new[]{0,1,2} | |
| from pieds in Enumerable.Range(1,10 - taz) | |
| from gifles in Enumerable.Range(1,10 - pieds - taz) | |
| let touze = new Syntouze{Taz=taz,Pieds=pieds,Gifles=gifles} |
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
| void Main() | |
| { | |
| var res = (from taz in new[]{0,1,2} | |
| from pieds in Enumerable.Range(1,10 - taz) | |
| from gifles in Enumerable.Range(1,10 - pieds - taz) | |
| let productivite = gifles * 50 + pieds * 100 + taz * 200 | |
| let bugs = gifles * 2 + pieds * 5 + taz * 11 | |
| where bugs <= 50 | |
| select new []{taz,pieds,gifles,bugs,productivite}) | |
| .MaxOf(o => o[4]); |
NewerOlder