layer

Convert this from Google Maps API v2 to v3

十年热恋 提交于 2019-12-10 17:11:19
问题 This works on Google Maps API v2, now how do I convert this to API v3? Thanks // - Radar 1 Overlay Tiles var radar_layer= new GTileLayer(new GCopyrightCollection(""),1,17); radar_layer.getTileUrl=function(tile,zoom) { var llp = new GPoint(tile.x*256,(tile.y+1)*256); var urp = new GPoint((tile.x+1)*256,tile.y*256); var ll = G_NORMAL_MAP.getProjection().fromPixelToLatLng(llp,zoom); var ur = G_NORMAL_MAP.getProjection().fromPixelToLatLng(urp,zoom); var dt = new Date(); var nowtime = dt.getTime()

Multi-tier vs Distibuted?

强颜欢笑 提交于 2019-12-10 11:02:29
问题 Multi-tier and/or ditstributed apps, do they have the same meaning ? When we talk about layers in these apps, is it physical layers (database, browser, web server,...) or logical layers (data access layer, business layer,...) ? 回答1: Maybe these two sentences do convey intuitively the distinction between distributed and multi-tier : Distributed : You replicate the processing amongst nodes Multi-tier : You split the processing amongst tiers In one case, the same processing is replicated over

Keras: Using weights for NCE loss

懵懂的女人 提交于 2019-12-10 10:11:06
问题 So here is the model with the standard loss function. target = Input(shape=(1, ), dtype='int32') w_inputs = Input(shape=(1, ), dtype='int32') w_emb = Embedding(V, dim, embeddings_initializer='glorot_uniform',name='word_emb')(w_inputs) w_flat= Flatten()(w_emb) # context w1= Dense(input_dim=dim, units=V, activation='softmax') # because I want to use predicition on valid set) w= w1(w_flat) model = Model(inputs=[w_inputs], outputs=[w]) model.compile(loss='sparse_categorical_crossentropy',

How to exchange an image in a layer-list by a bitmap?

五迷三道 提交于 2019-12-09 13:51:37
问题 Here is my Bitmap Bitmap bitmap = BitmapFactory.decodeStream((InputStream) new URL(url).getContent()); //Need some code to access "dynamicItem" and exchange it with my Bitmap And here is my layer list (nothing spectacular). I want to exchange the dynamicItem with my Bitmap. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/dynamicItem" android:drawable="@drawable/defaultItem" /> <item> <bitmap android:src="

Litho在动态化方案MTFlexbox中的实践

蹲街弑〆低调 提交于 2019-12-09 11:50:21
1. MTFlexbox MTFlexbox是美团内部应用的非常成熟的一种跨平台动态化解决方案,它遵循了CSS3中提出的 Flexbox规范 来抹平多平台的差异。MTFlexbox适用于重展示、轻交互的业务场景,与现有HTML、React Native、Weex等跨平台方案相比,MTFlexbox具备着性能高、渲染速度快、兼容性高、原生功能支持度高等优势。但其缺点在于不支持复杂的交互逻辑,不适合复杂交互的业务场景。目前,MTFlexbox已经广泛应用在美团首页、搜索、外卖等重要业务场景。本文主要介绍在MTFlexbox中使用Litho优化性能的实践经验。 1.1 MTFlexbox的原理 MTFlexbox首先定义一份跨平台统一的DSL布局描述文件,前端通过“所见即所得”的编辑器编辑产生布局,客户端下载布局文件后,根据布局中的描述绑定JSON数据,并最终完成视图的渲染。MTFlexbox框架图如下图所示: 图中分为五层,分别是: 业务应用层:业务使用MTFlexbox的编辑器定义符合Flexbox规范的DSL文件(XML模版)。 模版下载:负责XML模版下载相关的工作,包括模版缓存、预加载和异常监控等。 模版解析:负责模版解析相关的工作,包括标签节点的预处理、数据绑定、标签节点的缓存复用和数据异常监控等。 视图渲染:负责视图渲染相关的工作

TCP/IP 应用程序的通信连接模式

老子叫甜甜 提交于 2019-12-09 11:24:10
TCP/IP 应用层与应用程序 TCP/IP 起源于二十世纪 60 年代末美国政府资助的一个分组交换网络研究项目,它是一个真正的开放协议,很多不同厂家生产各种型号的计算机,它们运行完全不同的操作系统,但 TCP/IP 协议组件允许它们互相进行通信。现在 TCP/IP 已经从一个只供一些科学家使用的小实验网成长为一个由成千上万的计算机和用户构成的全球化网络,TCP/IP 也已成为全球因特网(Internet)的基础,越来越多的 TCP/IP 互联网应用和企业商业应用正在改变着世界。 TCP/IP 通讯协议采用了四层的层级模型结构(注:这与 OSI 七层模型不相同),每一层都调用它的下一层所提供的网络任务来完成自己的需求。TCP/IP 的每一层都是由一系列协议来定义的。这 4 层分别为: 应用层 (Application):应用层是个很广泛的概念,有一些基本相同的系统级 TCP/IP 应用以及应用协议,也有许多的企业商业应用和互联网应用。 传输层 (Transport):传输层包括 UDP 和 TCP,UDP 几乎不对报文进行检查,而 TCP 提供传输保证。 网络层 (Network):网络层协议由一系列协议组成,包括 ICMP、IGMP、RIP、OSPF、IP(v4,v6) 等。 链路层 (Link):又称为物理数据网络接口层,负责报文传输。 图1显示了 TCP/IP 层级模型结构

How to recognize tap gesture while a view is animating

会有一股神秘感。 提交于 2019-12-09 09:32:22
问题 Just wondering is there way to have a view recognize tap gestures while it is being animated? I am working on a view that has a cashapelayer line tethered to it. When the user pans the view (pan gesture) the line follows accordingly until the user stops panning. At this point an animation is executed that brings the view back to its original position and the tether layer back as well. Now my only real problem is that while the view and the tether are animating the view doesnt respond to tap

Photoshop scripting: changing text of a text layer

一个人想着一个人 提交于 2019-12-09 06:01:41
问题 Because I don't have enough time to learn all about PS-Scripting, I was wondering, if you may help me. It's very simple. I want to have a JS-Script, which changes the Text of the Top Layer . For example: The Text is "#005", the script should add 1, so it says "#006". After that, it should export (Save for Web & Devices w. transparency @ 1280x720) the file with the current number (006). Here's a screen of the layers ( omg its in german!!11 ): imageshack.us/photo/my-images/706/helpal.png 回答1:

how to obtain the runtime batch size of a Keras model

≡放荡痞女 提交于 2019-12-09 03:23:22
问题 Based on this post. I need some basic implementation help. Below you see my model using a Dropout layer. When using the noise_shape parameter, it happens that the last batch does not fit into the batch size creating an error (see other post). Original model: def LSTM_model(X_train,Y_train,dropout,hidden_units,MaskWert,batchsize): model = Sequential() model.add(Masking(mask_value=MaskWert, input_shape=(X_train.shape[1],X_train.shape[2]) )) model.add(Dropout(dropout, noise_shape=(batchsize, 1,

UIView Layer Mask Animate

寵の児 提交于 2019-12-08 23:58:46
问题 I am trying to animate the mask layer on a UIView. Basically this code displays the image below: let bounds: CGRect = self.manualWBMaskView!.bounds let maskLayer: CAShapeLayer = CAShapeLayer() maskLayer.frame = bounds maskLayer.fillColor = UIColor.blackColor().CGColor let screenWith : CGFloat = UIScreen.mainScreen().bounds.width let roundedRectFrame : CGRect = CGRectMake(self.manualWBMaskView!.bounds.midX - (screenWith/4), self.manualWBMaskView!.bounds.midY - (screenWith/4), screenWith/2,