Mobile terminal icon drag and get the coordinates after moving.

These two days in the demand for contract stamps, require that the moving end can drag the stamp, and get the coordinates of the stamp. On the Internet also read some related code, and finally sort out a demo. The code is still in bug, when the first move finger is lifted.Once again click the chapter, the coordinates will change, this point needs to be improved later.$(function(){ var cirX=0;//Center X abscissaVar cirY=0; / / center Y ordinateVar moveX=0; / / moving contact X abscissaVAR moveY=0; / / moving contact Y ordinateVar boxW=$(".Box").Width (); / / Zhang KuanVar boxH...

The CSS of the front end

1. What is CSS?   CSS( Cascading Style Sheet )Cascading style sheets define how HTML tags are displayed.   CSSStyle consists of two components: selector and declaration. The declaration also includes the corresponding values of attributes and attributes, and each declaration ends with a semicolon.   CSSNotes: / * notes * / Two. Introduction mode of CSS.   1. In-line styles: lt; P style = “color: red” & gt; Hello word & lt; / P & gt; where style attributes are tags for setting CSS styles   2. Internal Embedded: Simplified CSS Style Several Writte...

SSH & Git

SSHBasic Usage work with git branch some tips for git setup and git config git and github ssh service    GitChinese handbook GitUsername and mailbox with Github Q:Why does push still need to enter a username password or pre-configure SSH key after configuring git’s username mailbox? A:The configured git username and mailbox are different users when distinguishing commit; the input username password or SSH key is to distinguish whether there is push privilege or not. (Sharing a computer by multiple people differentiates the commit of different users, or multiple commit to the compa...

Python coding problem

CampThere was a lot of python2 coding. Understanding the encoding of pyhon2 python2There are only two kinds of string types:Type STR: B'xxx'That is, the str type is the encoded type, and Len () is calculated bybyte.Unicode type: len (), calculated by Unicode character. python2Open file read string is STR type, without encoding parameter.Recommended reading and writing files under python2codecs packageCodecs.open, codecs.write can specify encoding.   python3Coding python3There are two kinds of string types:Type STR: u'xxx'The str type is the uncoded Unicode. Pay attention to the distinctio...

Interval tree interval update lazy

  1. hdu1698 http://acm.hdu.edu.cn/showproblem.php?pid=1698 1 /* 2 x y k 3 x~yThe value changed to K 4 */ 5 #include <cstdio> 6 #include <cstdlib> 7 #include <cmath> 8 #include <cstring> 9 #include <time.h> 10 #include <string> 11 #include <set> 12 #include <map> 13 #include <list> 14 #include <stack> 15 #include <queue> 16 #include <vector> 17 #include <bitset> 18 #include <ext/rope> 19 #include <algorithm> 20 #include <iostream> 21 using namespace std; 22 #define l...

Yii2 file upload

//Model<?php namespace backend\models; use Yii; use yii\web\UploadedFile; class UploalModel extends \yii\db\ActiveRecord { /** * @var UploadedFile|Null file attribute */ public $file; /** * @return array the validation rules. */ public function rules() { return [ [["file"], "file",], ]; } /**Public Upload Information (Array) File Name Size Suffix Name Limits Update to Remove Existing Pictures for Update Pictures*/ public function upload($img,$name = '/vessel',$siez = '',$arr_type = '',$text_name = '',$act='upd...