# PINCache
[![CocoaPods](https://img.shields.io/cocoapods/v/PINCache.svg)](http://cocoadocs.org/docsets/PINCache/)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Tavis CI build](https://img.shields.io/travis/pinterest/PINCache.svg?style=flat)](https://travis-ci.org/pinterest/PINCache)
## Fast, non-deadlocking parallel object cache for iOS and OS X.
[PINCache](PINCache/PINCache.h) is a fork of [TMCache](https://github.com/tumblr/TMCache) re-architected to fix issues with deadlocking caused by heavy use. It is a key/value store designed for persisting temporary objects that are expensive to reproduce, such as downloaded data or the results of slow processing. It is comprised of two self-similar stores, one in memory ([PINMemoryCache](PINCache/PINMemoryCache.h)) and one on disk ([PINDiskCache](PINCache/PINDiskCache.h)), all backed by GCD and safe to access from multiple threads simultaneously. On iOS, `PINMemoryCache` will clear itself when the app receives a memory warning or goes into the background. Objects stored in `PINDiskCache` remain until you trim the cache yourself, either manually or by setting a byte or age limit.
`PINCache` and `PINDiskCache` accept any object conforming to [NSCoding](https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Protocols/NSCoding_Protocol/Reference/Reference.html). Put things in like this:
```objective-c
UIImage *img = [[UIImage alloc] initWithData:data scale:[[UIScreen mainScreen] scale]];
[[PINCache sharedCache] setObject:img forKey:@"image" block:nil]; // returns immediately
```
Get them back out like this:
```objective-c
[[PINCache sharedCache] objectForKey:@"image"
block:^(PINCache *cache, NSString *key, id object) {
UIImage *image = (UIImage *)object;
NSLog(@"image scale: %f", image.scale);
}];
```
Both `PINMemoryCache` and PINDiskCache use locks to protect reads and writes. `PINCache` coordinates them so that objects added to memory are available immediately to other threads while being written to disk safely in the background. Both caches are public properties of `PINCache`, so it's easy to manipulate one or the other separately if necessary.
Collections work too. Thanks to the magic of `NSKeyedArchiver`, objects repeated in a collection only occupy the space of one on disk:
```objective-c
NSArray *images = @[ image, image, image ];
[[PINCache sharedCache] setObject:images forKey:@"images"];
NSLog(@"3 for the price of 1: %d", [[[PINCache sharedCache] diskCache] byteCount]);
```
## Installation
### Manually
[Download the latest tag](https://github.com/pinterest/PINCache/tags) and drag the `PINCache` folder into your Xcode project.
Install the docs by double clicking the `.docset` file under `docs/`, or view them online at [cocoadocs.org](http://cocoadocs.org/docsets/PINCache/)
### Git Submodule
git submodule add https://github.com/pinterest/PINCache.git
git submodule update --init
### CocoaPods
Add [PINCache](http://cocoapods.org/?q=name%3APINCache) to your `Podfile` and run `pod install`.
### Carthage
Add the following line to your `Cartfile` and run `carthage update --platform ios`. Then follow [this instruction of Carthage](https://github.com/carthage/carthage#adding-frameworks-to-unit-tests-or-a-framework) to embed the framework.
```github "pinterest/PINCache"```
## Requirements
__PINCache__ requires iOS 5.0 or OS X 10.7 and greater.
## Contact
[Garrett Moon](mailto:[email protected])
## License
Copyright 2013 Tumblr, Inc.
Copyright 2015 Pinterest, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. [See the License](LICENSE.txt) for the specific language governing permissions and limitations under the License.
没有合适的资源?快使用搜索试试~ 我知道了~
he4o是一个螺旋熵减机,是一种通用人工智能(AGI)系统
共502个文件
h:221个
m:191个
xib:23个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 27 浏览量
2023-08-03
16:46:41
上传
评论
收藏 8.45MB ZIP 举报
温馨提示
he4o是一个螺旋熵减机,是一种通用人工智能(AGI)系统;机器学习支持,知识表征宏微支持,神经网络支持,支持智能体自主终身动态学习。无论宏观框架还是微观细节设计,都依从相对与循环转化。思维控制支持,
资源推荐
资源详情
资源评论
收起资源包目录
he4o是一个螺旋熵减机,是一种通用人工智能(AGI)系统 (502个子文件)
7.1.0_842e0ab2ea_20200611125537 6B
Current 1B
.dat.nosync5ac2.F2h4SD 331KB
神经网络可视化v2.1演示.gif 808KB
.gitignore 537B
AIHeader.h 17KB
PINDiskCache.h 16KB
PINMemoryCache.h 15KB
SMGUtils.h 13KB
AINetUtils.h 12KB
MobClick.h 9KB
PINCache.h 8KB
TOUtils.h 8KB
MASConstraint.h 7KB
AIFoNodeBase.h 7KB
SMGEnum.h 6KB
MASUtilities.h 6KB
AINet.h 6KB
AIShortMatchModel.h 5KB
SMGConfig.h 5KB
AIMatchFoModel.h 5KB
MASConstraintMaker.h 5KB
TOAlgModel.h 5KB
AICansetModel.h 5KB
TOFoModel.h 4KB
View+MASAdditions.h 4KB
UMRemoteConfig.h 3KB
AIScore.h 3KB
AIThinkingControl.h 3KB
View+MASShorthandAdditions.h 3KB
UIView+Extension.h 3KB
SMGUtils+General.h 3KB
NVView.h 3KB
AIPort.h 3KB
TOModelBase.h 3KB
AITest.h 3KB
AINetIndex.h 3KB
RLTrainer.h 3KB
UIColor+expanded.h 2KB
AINetIndexUtils.h 2KB
XGDebug.h 2KB
ThinkingUtils.h 2KB
BirdView.h 2KB
NVModuleView.h 2KB
RuntimeInvoker.h 2KB
TVUtil.h 2KB
ReasonDemandModel.h 2KB
UMRemoteConfigEnum.h 2KB
AINodeBase.h 2KB
AIVisionAlgsModel.h 2KB
MASConstraint+Private.h 2KB
NSArray+MASAdditions.h 2KB
MathUtils.h 2KB
AINetDirectionReference.h 2KB
AIReactorControl.h 1KB
AIAbsCMVManager.h 1KB
NVModuleUtil.h 1KB
DemandManager.h 1KB
AIFilter.h 1KB
AISceneModel.h 1KB
AILine.h 1KB
DemandModel.h 1KB
AIAlgNodeBase.h 1KB
AIAnalyst.h 1KB
NVHeUtil.h 1KB
TIUtils.h 1KB
Output.h 1KB
AIKVPointer.h 1KB
AIAnalogy.h 1KB
NVNodeView.h 1KB
NVViewUtil.h 1KB
RTModel.h 1KB
TCDebug.h 1KB
MASViewConstraint.h 1KB
XGWedis.h 1KB
UMRemoteConfigSettings.h 1KB
TCSolutionUtil.h 1KB
AIMatchAlgModel.h 1KB
XGRedisDictionary.h 1KB
UMConfigure.h 1KB
XGRedis.h 1KB
ShortMatchManager.h 1KB
AIPointer.h 1KB
AIMvFoManager.h 1KB
AIInput.h 1019B
NSArray+MASShorthandAdditions.h 1016B
TVPanelView.h 1007B
AIStringAlgs.h 992B
AsyncMutableArray.h 980B
AIRank.h 978B
AINetAbsCMVUtil.h 946B
MASViewAttribute.h 942B
AITime.h 924B
XGDelegate.h 903B
ReadMe.h 881B
TCTransfer.h 879B
AIAbsFoManager.h 876B
XGRedisUtil.h 841B
TCResult.h 819B
TOMVisionNodeBase.h 816B
共 502 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6732
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功