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
- (instancetype)initWithPoints:(NSArray *)points { | |
NSParameterAssert(points); | |
NSParameterAssert([points objectAtIndex:0]); | |
NSParameterAssert([[points objectAtIndex:0] isKindOfClass:[NSValue class]]); | |
self = [super init]; | |
if (self) { | |
for (NSValue *value in points) { |
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
NSString *NSStringFromCATransform3D(CATransform3D t) { | |
return [NSString stringWithFormat:@"CATransform3D {\n%lf %lf %lf %lf\n%lf %lf %lf %lf\n%lf %lf %lf %lf\n%lf %lf %lf %lf\n}", t.m11, t.m12, t.m13, t.m14, t.m21, t.m22, t.m23, t.m24, t.m31, t.m32, t.m33, t.m34, t.m41, t.m42, t.m43, t.m44]; | |
} |
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
NSDictionary *dict = @{ | |
@"a":@"b", | |
}; | |
NSArray *arr = @[ | |
@"a", | |
@"b", | |
} |
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
// | |
// HomeViewController.m | |
// FreeCare | |
// | |
// Created by Shashi on 08/10/11. | |
// Copyright __MyCompanyName__ 2011. All rights reserved. | |
// | |
#import "HomeViewController.h" | |
#import "ClinicListViewController.h" |
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
import System.IO | |
digits n | n < 10 = [n] | |
| otherwise = let (d, m) = quotRem n 10 in (digits d) ++ [m] | |
r = sum . digits . fact | |
fact n | n < 2 = 1 | |
| otherwise = n * fact (n-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
-- | Merges the simple 'DSInfo's based on function calls from the functions | |
analyzeFunctions :: [DSFun t] -> [DSInfo] | |
analyzeFunctions dsfs = let startingDSF = lookupDSF dsfs startingFunction in | |
let functions = map getDSFFun dsfs in | |
let startingVars = map snd $ concatMap getDSINames $ getDSFDSI startingDSF in | |
let runMain = mapMaybe (\var -> analyzeFunction functions startingDSF var []) startingVars in --update the accumulator | |
concatMap (uncurry (:)) runMain where | |
analyzeFunction :: [FunctionDeclaration t] -> DSFun t1 -> VariableName -> [FunctionName] -> Maybe (DSInfo, [DSInfo]) | |
analyzeFunctiog functions dsf variable accumulator = let functionName = getFunName.getDSFFun $ dsf in | |
toMaybe (functionName `notElem` accumulator) (let functionCalls = getDSFCalls dsf in |
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
-- | Merges the simple 'DSInfo's based on function calls from the functions | |
analyzeFunctions :: [DSFun t] -> [DSInfo] | |
analyzeFunctions dsfs = let startingDSF = lookupDSF dsfs startingFunction in | |
let functions = map getDSFFun dsfs in | |
let startingVars = map snd $ concatMap getDSINames $ getDSFDSI startingDSF in | |
let runMain = mapMaybe (\var -> analyzeFunction functions startingDSF var []) startingVars in --update the accumulator | |
concatMap (uncurry (:)) runMain where | |
analyzeFunction :: [FunctionDeclaration t] -> DSFun t1 -> VariableName -> [FunctionName] -> Maybe (DSInfo, [DSInfo]) | |
analyzeFunction functions dsf variable accumulator = let functionName = getFunName.getDSFFun $ dsf in | |
toMaybe (functionName `notElem` accumulator) (let functionCalls = getDSFCalls dsf in |
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
import XMonad | |
import qualified XMonad.StackSet as W | |
import XMonad.Hooks.ManageHelpers | |
import XMonad.Hooks.DynamicLog hiding (xmobar) | |
import XMonad.Hooks.ManageDocks | |
import XMonad.Util.Run(spawnPipe) | |
import XMonad.Util.EZConfig(additionalKeys) | |
import XMonad.Actions.CycleWS | |
import XMonad.Layout.NoBorders | |
import XMonad.Actions.UpdateFocus |
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
withImgurDirectoryListing conf logger f = do | |
#ifdef PRODUCTION | |
s <- static Settings.staticDir | |
#else | |
s <- staticDevel Settings.staticDir | |
#endif | |
dbconf <- withYamlEnvironment "config/sqlite.yml" (appEnv conf) | |
$ either error return . Database.Persist.Base.loadConfig | |
Database.Persist.Base.withPool (dbconf :: Settings.PersistConfig) $ \p -> do | |
Database.Persist.Base.runPool dbconf (runMigration migrateAll) p |
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
pip python-dateutil | |
The directory '/Users/alistra/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. | |
The directory '/Users/alistra/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. | |
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. | |
InsecurePlatformWarning | |
Collecting python-dateutil | |
Downloading python_dateutil-2.4.2-py2.py3-none-any.whl (188kB |
NewerOlder