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
/* | |
cpu: Apple M1 | |
BenchmarkString1 | |
BenchmarkString1-8 3292 362786 ns/op | |
BenchmarkString2 | |
BenchmarkString2-8 27062 43746 ns/op | |
PASS | |
*/ | |
package foo |
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
class TestUnit { | |
// TODO | |
} |
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
// Why are you here? | |
const str = "###+0TPRBlbSZFV3dGVl#lmQY5UNOJDZDhmVXVjWWJ2a4dUZ5tmVk5kSUd1drRVZNpFVUlkTH1#0UoVV##W"; | |
const str2 = str.split('').reverse().join('').replace(/#/g, '').replace(/\+/g, '='); | |
console.log(str2); |
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
if ((((notification.orderID == orderID) | |
|| (notification.customerID == customerID) | |
|| (eventIDs.contains(notification.eventID)) && (notification.type.toAllStaff || notification.type.toAllOrders)) | |
|| (isAdmin && eventIDs.contains(notification.eventID)) | |
&& (userID != notification.senderID || notification.senderID == null))) { | |
send(notification); | |
} | |
// |
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
plusOne :: Maybe (Int -> Int) | |
plusOne = Just (+ 1) |
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
plusOne :: Int -> Maybe Int | |
plusOne x = Just (x + 1) |
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
plusOne :: Int -> Int | |
plusOne x = x + 1 |
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
withMonad :: Int -> String -> Maybe String | |
withMonad age name = do | |
validateAge age | |
s <- return (greet name) | |
return (greet s) -- Just "Hello Hello John" |
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
withMonad :: Int -> String -> Maybe String | |
withMonad age name = do | |
validateAge age | |
return (greet name) |
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
withMonad :: Int -> String -> Maybe String | |
withMonad age name = validateAge age >>= \_ -> return (greet name) |
NewerOlder