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
| del %USERPROFILE%\AppData\Local\Temp\sqlite*.dll | |
| del %USERPROFILE%\AppData\Local\Temp\jffi*.tmp | |
| for /f %%a IN ('dir /b %USERPROFILE%\AppData\Local\Temp\jruby*extract') do call superdeltree.bat %USERPROFILE%\AppData\Local\Temp\%%a |
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
| @echo off | |
| echo "Removing: %*" | |
| move %* C:\TEMP\%~nx1 | |
| md C:\TEMP\new-%~nx1 | |
| robocopy "C:\TEMP\new-%~nx1" C:\TEMP\%~nx1 /MIR | |
| echo "C:\TEMP\%~nx1" | |
| rd /q C:\TEMP\%~nx1 | |
| echo "C:\TEMP\new-%~nx1" | |
| rd /q C:\TEMP\new-%~nx1 |
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
| # benchmark code @ https://raw.github.com/jruby/jruby/master/bench/bench_red_black.rb | |
| #ruby 1.9.3p125 (2012-02-16) [i386-mingw32] | |
| ============================================================================================================================================= | |
| C:\Users\Hedley Robertson\Projects\NetsuiteQueue>J:\Ruby193\bin\ruby.exe "C:\Users\Hedley Robertson\Desktop\bench_red_black.rb" | |
| 4.978284 | |
| GC.count = 7 | |
| 4.814275 | |
| GC.count = 9 | |
| 5.117292 | |
| GC.count = 11 |
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
| // This example shows a ReaderWriterLock protecting a shared | |
| // resource that is read concurrently and written exclusively | |
| // by multiple threads. | |
| // The complete code is located in the ReaderWriterLock | |
| // class topic. | |
| using System; | |
| using System.Threading; | |
| public class Test |
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
| let mapSchedule f sch = | |
| match sch with | |
| | Never -> Never // Unscheduled events remain unscheduled | |
| | Once(dt) -> Once(f(dt)) // Reschedule event occurring once | |
| | Repeatedly(dt, ts) -> Repeatedly(f(dt), ts) // Reschedule repeated event | |
| ;; | |
| val mapSchedule : (DateTime -> DateTime) -> Schedule -> Schedule | |
| (* | |
| If you look at the type, you can see that the first parameter is a function |
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
| // Higher order functions for working with tuples | |
| let mapFirst f (a, b) = (f(a), b) | |
| (* | |
| val mapFirst : ('a -> 'b) -> 'a * 'c -> 'b * 'c | |
| - a generic function and it has three type parameters: | |
| - It takes a function as the first parameter: | |
| ('a -> 'b) |
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
| (* | |
| The pipelining operator (|>) | |
| allows you to write the first argument for a function on the left | |
| side; that is, before the function name itself. | |
| *) | |
| List.hd(List.rev [1 .. 5]) |
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
| /* Working with strings using extension methods (C#) | |
| - 'this' keyword precedes the first parameter | |
| - Using standard static method calls | |
| */ | |
| public static string AddLine(this string str, string next) { | |
| return str + "\n>>" + next; | |
| } | |
| // Concatenate strings using extension method |
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
| // Define Operator "+>" for concatenating strings in a special way | |
| let (+>) a b = a + "\n>>" + b;; | |
| // val ( +> ) : string -> string -> string | |
| (* Test the function: | |
| > printfn "%s" ("Hello world!" +> | |
| "How are you today?" +> | |
| "I'm fine!");; |
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
| // val condPrint : 'a -> ('a -> bool) -> ('a -> string) -> unit | |
| // function that takes three params and returns nothing. | |
| // param1: 'a => a generic generalized (untyped) value | |
| // param2: ('a -> bool) => a function taking 1 param as a generic generalized (untyped) value abd returning a bool | |
| // param3: ('a -> string) => a function taking 1 param as a generic generalized (untyped) value and returning a string | |
| let condPrint value test format = | |
| if (test(value)) then printfn "%s" (format(value)) | |
| // Test the function: |
NewerOlder