Pen

程序猿七夕-心心相印

巧了我就是萌 提交于 2020-02-25 23:32:14
python带你过七夕,让程序猿的七夕不再无趣^_^。 一提到程序猿,大家的映象是 这样 这样 或者这样 其实,标配是这样 哈哈,很搞笑是不,我们是程序猿,时代电子技术的领导者,怎么可能那么low呢。言归正传,程序猿也是懂浪漫的,马上七夕了,用一副漫画 心心相印 程序猿专有方式来陪你们过七夕,拿走不谢。 代码如下: # -*- coding: utf-8 -*- """ ------------------------------------------------ describe: usage: base_info: __version__ = "v.10" __author__ = "mingliang.gao" __time__ = "2018/8/13" __mail__ = "mingliang.gao@qunar.com" ------------------------------------------------ """ import time import turtle from turtle import * def write_zi(x, y, content, font_type='Comic Sans MS', font_size=30, font_normal='normal'): penup() goto(x, y) pendown() write

Why does use of pens with dash patterns cause huge (!) performance degredation in WPF custom 2D drawing?

喜你入骨 提交于 2020-01-10 19:55:30
问题 Hope anyone can shed light on this so I can use pens with dash patterns? I am writing a scrollable chart (a Panel inside ScrollViewer that implements IScrollInfo ) in WPF using DrawingVisual 's DataContext.Draw X . I have several thousand DrawingVisual s that get scrolled by using TranslateTransform on the Panel that hosts them. I implemented a grid by placing a Panel on top of it and drawing simple horizontal lines from one edge to the other using DataContext.DrawLine(pen, new Point(0, y),

如何创建带有可点击标签的复选框?

陌路散爱 提交于 2020-01-08 10:34:17
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 如何创建带有可单击标签的HTML复选框(这意味着单击标签可以打开/关闭该复选框)? #1楼 它也可以工作: <form> <label for="male"><input type="checkbox" name="male" id="male" />Male</label><br /> <label for="female"><input type="checkbox" name="female" id="female" />Female</label> </form> #2楼 您还可以使用CSS伪元素分别从复选框的所有value属性中选择并显示标签。 编辑: 这仅适用于基于Webkit和基于眨眼的浏览器(Chrome(ium),Safari,Opera ....)以及大多数移动浏览器。 这里没有 Firefox 或IE支持。 仅在将webkit / blink嵌入到您的应用程序中时,这才有用。 <input type="checkbox" value="My checkbox label value" /> <style> [type=checkbox]:after { content: attr(value); margin: -3px 15px; vertical-align: top; white

Can a Pen or Brush paint a Point?

安稳与你 提交于 2019-12-12 04:09:51
问题 I know that I can draw a filled circle and I can draw many simple and complicated things with a Graphics. But I couldn't get it to draw a single point (not a single pixel). I'm playing with a Paint program and the user can draw fine but not plot a dot. I can add a dummy point really close or can draw a filled cirlce but sometimes I miss the obvious. So is there a way to draw a single point with a given Brush or Pen ? And no, of course I don't mean to draw a single Pixel. I want to use the

Check if USB device is idling, LINUX

别说谁变了你拦得住时间么 提交于 2019-12-11 13:23:44
问题 I've got a quick question, but I can't find an answer. Is it possible in linux (or in python) to see if an external usb pen drive is idling? I need to know this for a python script I'm writing. I need to rename a folder on an external usb pen drive as soon as nothing is writing to it. edit: I know there is lsof command to list open files. 'lsof /theDir' only works half. It works OK when the process copying to the USB is still running. But when the process stops, lsof shows nothing. But the OS

GDI+ DashStyle throws OutOfMemoryException in .NET

心已入冬 提交于 2019-12-11 10:41:51
问题 I'm using DashStyle.Dash while rendering my hierarchy of objects. My application uses Graphics.Transform extensively and I find that at some scale values (including a scale of 100%) and some angles of rotation, Graphics.DrawLine throws OutOfMemoryException when using a pen with DashStyle.Dash . Using Google I found that this is a well-known problem. Microsoft tells us that this is not a blocking issue. So far, I have not found a workaround for this problem. What are my options? 回答1: I just

How to draw a line in VB.NET

余生颓废 提交于 2019-12-10 16:49:33
问题 I am trying to draw a simple line with VB.NET. My code is as below, however when I run the code, only the form is shown up! There is no line. What did I do wrong here? Public Class Form1 Dim pen As System.Drawing.Graphics Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load pen = Me.CreateGraphics() pen.DrawLine(Pens.Azure, 10, 10, 20, 20) End Sub End Class 回答1: Basically, what you did wrong was to use the CreateGraphics method. This is

CSS实现footer“吸底”效果

谁说我不能喝 提交于 2019-12-06 02:37:09
我们经常会遇到这样的问题:如何用css来实现底部元素可“粘住底部”的效果,对于“粘住底部”,本文有两种理解: 一是无论内容的多少,我们都希望使按钮,固定于可视窗口的底部,且内容区是可滚动的。 二是当内容区的内容较少时,页脚区不是随着内容区排布,而是始终显示在屏幕的最下方;当内容区的内容较多时,页脚能随着内容区的增高而撑开,始终显示在页面的最底部。 谈到“吸底”效果的实现,大家可能较多了解到的是sticky-footer布局,但这个方式大多是用来解决第二种情况的实现。本文将采用以下的三种方案来分别来实现以上这两种效果,并简单实现的原理以及其的适用情况。 容器(wrapper)包含两部分,分别是内容(content)和底部需固定的区域(footer)。 html设置 <!-- wrapper是包裹content和footer的父容器 --></div> <div class= "wrapper" > <div class= "content" > <ul> <!-- 页面主体内容区域 --></div> <li>1.这是内容,这是内容……</li> <li>2.这是内容,这是内容……</li> <li>3.这是内容,这是内容……</li> <li>4.这是内容,这是内容……</li> <li>5.这是内容,这是内容……</li> <li>6.这是内容,这是内容……</li> <li>7

clearfix为什么用display:table,而不用display:block

China☆狼群 提交于 2019-12-06 00:17:26
本文转载于: 猿2048 网站➮ clearfix为什么用display:table,而不用display:block 我们都知道clearfix一般这么写: .clearfix:before,.clearfix:after{ content:""; display:table; } .clearfix:after{clear:both;} 但是为嘛用 display:table哪? 我用display:block好像也是显示很正常,也能清除浮动。 曾经也搜索过这个问题,感觉都讲得糊里糊涂的还是我水平太低了,反正我是看不懂他们想要表达啥意思,也不给例子,好了,废话不多说, 看结果吧: See the Pen Clearfix by wenjie ( @wenjie ) on CodePen . 网上讲得一堆什么使父容器形成BFC,什么防止margin塌陷。但是不给例子,我怎么搞都不会塌陷。 我本来是蓝色那一块那样测试的,看到没,我用:block,margin很正常, 并没有塌陷啊? 后来才发现,其实margin要在一个 没有浮动的标签上,才会发生塌陷。所以 display:table就是为了解决这个 问题的。 两个都浮动的时候,并不会发生塌陷,不管你怎么测都测不出来 用block代替table有何问题。 还有为什么 要写:before呢?我去掉也是正常清除浮动啊, 一样的

开始使用HTML5和CSS3验证表单

烈酒焚心 提交于 2019-12-05 14:01:35
本文转载于: 猿2048 网站➯ 开始使用HTML5和CSS3验证表单 使用HTML5和CSS3验证表单 客户端验证是网页客户端程序最常用的功能之一,我们之前使用了各种各样的js库来进行表单的验证。HTML5其实早已为我们提供了 表单验证 的功能。至于为啥没有流行起来估计是兼容性的问题还有就是样式太丑陋了吧。 下面我们将来一步一步创造一个HTML5和CSS3的表单验证,只使用HTML和CSS。 完成后的如下: 第一步:整理验证字段和类型 首先我们需要如下几个字段: 姓名(full name) 电话号码(phone number) 邮箱地址(email address) 网址(website) 在用户输入一些信息后,我们需要校验用户的信息是否正确,避免错误数据和欺骗性的数据传递到服务器。 在HTML5的新规范中,input输入框提供了多种输入类型比如:tel、email、number、range、color等,这些类型在桌面客户端中一般体现不是很明显,如果在移动端键盘上面体现的会更明显。比如number在移动端键盘会自动切换为纯数字,email键盘会自动切换带有@的键盘。 第二步:确定表单样式 我们还需要确定表单最终的样式风格,一般这个工作来至于设计师。这里我在 dribbble 上面找了一个表单的样式作为这次的demo风格。 第三步:模板代码 使用标准的HTML5申明代码 <