layer

layer.zPosition does not work with non-sibling UIViews

我与影子孤独终老i 提交于 2019-11-29 17:38:28
I have a reasonably complex hierarchy of UIImageView s. Originally, I was carefully swapping the sibling order when one UIImageView moved in front of another. Then I found out about myUIImageView.layer.zPosition and switched to using this instead. Worked out much simpler. It even works almost all the time. I found out from this SO question that zPosition only works amongst sibling layers. Great! So I have two questions really: Is there any actual documentation about this? and, is there some kind of fudge I can use to get this to work? (like adding all my UIImageViews to a UIView that is never

Stack divs with different heights

老子叫甜甜 提交于 2019-11-29 13:24:54
I want to stack divs with different heights but same width within a div container.. from top to bottom going right. Problem now is with divs that are short.. gives a ugly gap to the div above. I've added a small sketch with what i want to do.. Thanks from norway! I suppose that you are using jQuery on your site. From the sketch I suggest to take a look at jQuery plugin called Masonry . CSS: .column { width:20em; float:left } .column div { background:red; margin:1em } HTML: <div class="column"> <div></div> <div></div> <div></div> </div> <div class="column"> <div></div> <div></div> <div></div> <

What should I keep in mind in order to refactor huge code base?

蓝咒 提交于 2019-11-29 12:25:59
问题 I'm going to refactor certain parts in a huge code base (18000+ Java classes). Goal is to be able to extract lower layers as independent libraries to be reused in other projects that currently use duplicate of this code base. Especially one part is of interest to be refactored into a framework independent of business logic. Ultimately I would like the code to have a clean architectural layering. I've looked at the code with a tool called Structure 101 for java and found lots (!) of

How to load Open layers 3 geojson vector layer with bbox?

南笙酒味 提交于 2019-11-29 12:12:27
I am struggling with building OL3 Vector layer BBOX strategy loading. So far I can easily load Geojson file with valid json syntax, however this is one time strategy. My another approach was to use ol.ServerVector which to my understading returns Javascript with callback, but I can't make it work. Working simple Geojson layer: var vectorSource = new ol.source.GeoJSON( ({ projection: 'EPSG:3857', preFeatureInsert: function(feature) { feature.geometry.transform('EPSG:4326', 'EPSG:3857'); }, url: 'geojson2.json' })); var vectorLayer = new ol.layer.Vector({ source: vectorSource, style:

linux内核之块设备驱动图解

守給你的承諾、 提交于 2019-11-29 09:50:00
块设备驱动程序的分层结构 块设备驱动: 在Linux中,驱动对块设备的输入或输出(I/O)操作,都会向块设备发出一个请求,在驱动中用 request结构体 描述。但对于一些磁盘设备而言请求的速度很慢,这时候内核就提供一种队列的机制把这些 I/O请求 添加到队列中(即:请求队列),在驱动中用 request_queue结构体 描述。在向块设备提交这些请求前内核会先执行请求的合并和排序预操作,以提高访问的效率,然后再由内核中的 I/O调度程序子系统 来负责提交 I/O 请求,调度程序将磁盘资源分配给系统中所有挂起的块 I/O 请求,其工作是管理块设备的请求队列, 决定队列中的请求的排列顺序以及什么时候派发请求到设备 。 通用块层(Generic Block Layer): 负责维持一个I/O请求在上层文件系统与底层物理磁盘之间的关系。在通用块层中, 通常用一个bio结构体来对应一个I/O请求 。 Linux提供了一个 gendisk数据结构体 ,用来表示一个独立的磁盘设备或分区,用于对底层物理磁盘进行访问。在gendisk中有一个类似字符设备中file_operations的硬件操作结构指针,是 block_device_operations结构体 。 IO调度层: 当多个请求提交给块设备时,执行效率依赖于请求的顺序。如果所有的请求是同一个方向(如:写数据),执行效率是最大的

cocos2d subclassing sprite to handle touch?

元气小坏坏 提交于 2019-11-29 08:45:27
I'm new to the cocos2d(-x) world. I'd like to detect a touch to a sprite, and tutorials/examples seem to suggest using layer to detect touch and find the approapriate sprite with bounding box. Is subclassing sprite to allow touch detection generally a bad idea? it is better and much more clear to handle touches in one place. but i think, no one can bar you to do this Note: This answer might be outdated. I answered this at 2012. It is not a bad idea. Here is how I do it: header file: #include "cocos2d.h" using namespace cocos2d; class TouchableSprite : public cocos2d::CCSprite, public

阿里云数据库再获学术顶会认可,一文全览VLDB最新亮点

家住魔仙堡 提交于 2019-11-29 08:12:20
一年一度的数据库领域顶级会议 VLDB 2019 于当地时间8月26日-8月30日在洛杉矶圆满落幕。在本届大会上,阿里云数据库产品团队浓墨登场,不仅有 多篇论文入选Research Track和Industrial Track ,为了进一步加深产学研学术交流,阿里云还在大会期间举办了“阿里之夜”交流晚宴。 8月29日晚,超200名论文作者、行业专家、来自MIT、CMU等高校的学术界资深教授、学者和产业界人士共赴 “阿里之夜——Alibaba Night Networking Event“ ,活动空前爆满。在轻松氛围中,参会者共同探讨全球数据库生态,并就阿里云目前在数据库和大数据方面的最新技术进展进行交流与研讨,开启了一场智慧碰撞的盛宴。 在VLDB大会上, 阿里巴巴集团副总裁、阿里云数据库事业部总裁、达摩院数据库首席科学家李飞飞 进行题为《Cloud Native Database System at Alibaba: Opportunities and Challenges》的主题演讲。李飞飞分享了云原生数据库在阿里发展的心路历程,并表示:“云原生数据库天然拥有云计算的弹性能力,不仅具备开源数据库的易用、开放特点,而且拥有传统数据库的管理和处理性能等优势“。 他还详细介绍了阿里云自研数据库的两款明星产品: OLTP数据库——POLARDB 基于共享存储的Scale-up

How to scale the size of line and point separately in ggplot2

故事扮演 提交于 2019-11-29 05:38:21
The code is as follows: set.seed(123) d1=data.frame(x=runif(10),y=runif(10),z=runif(10,1,10)) d2=data.frame(x=runif(10),y=runif(10),z=runif(10,100,1000)) ggplot()+geom_point(aes(x,y,size=z),data=d1)+ geom_line(aes(x,y,size=z),data=d2) And the result is like this: The size of points are too small so I want to change its size by scale_size . However, it seems both lines and points are influenced. So I wonder if there is a way to scale lines and points separately with a separate legend? oshun The two ways I can think of are 1) combining two legend grobs or 2) hacking another legend aesthetic.

《小印记》iOS源码分享--自定义弹框篇

不想你离开。 提交于 2019-11-29 05:25:39
笔者前不久终于发布了自己的APP《小印记》,在此分享一些iOS源码,如果读者学到了有用的东西,希望能前往App Store下载《小印记》支持一下笔者,谢谢! 《小印记》iOS源码分享--极光推送实践篇 《小印记》iOS源码分享--HTTPS配置篇 《小印记》源码分享--极光推送服务器篇 《小印记》iOS源码分享--网络层封装篇 首先看一下效果: 附上源码:(布局使用的是Masonry框架) JKBaseAlertView.h #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, AlertViewMode) { OkCancelMode = 0, // 带确定和取消按钮 OnlyOkMode // 仅带确定按钮 }; typedef void(^ClickBlock)(NSMutableDictionary * dic); @interface JKBaseAlertView : UIView @property (nonatomic, strong) UIView * alertBgView; // 背景视图 @property (nonatomic, strong) UIView * operateView; // 操作视图 @property (nonatomic, strong) UILabel * titleLabel; /

Cocos2d adding a background image to a layer?

眉间皱痕 提交于 2019-11-29 05:17:22
问题 I just finished reading some of the cocos2d documentation, and as far as I understand to add a background image to a layer you have to do something like: Sprite * bg = [Sprite spriteWithFile:@"Background.png"]; [layer addChild:bg z:0]; Allthough as far as my testing goes you can just directly add the sprite to the scene like this: @implementation IntroScene - (id) init { self = [super init]; if (self != nil) { Sprite * bg = [Sprite spriteWithFile:@"Background.png"]; [bg setPosition:ccp(240,