`
ipython
  • 浏览: 289574 次
  • 性别: Icon_minigender_1
  • 来自: 佛山
社区版块
存档分类
最新评论
文章列表
React Native切换版本 1. 修改package.json文件,修改其中的 "react-native": "^0.18" 2. 将node_modules目录删除 3. 执行以下命令:   npm install   react-native upgrade

js函数参数长度

    博客分类:
  • web
js函数参数有多少个?   function f1(a,b,c) {   console.log (a,b,c);   console.log (arguments.length, arguments); }   console.log (f1.length);   //定义的参数有多少个, 3 console.log (f1());          //0 console.log (f1(1));       // 1 console.log (f1(1,2));    // 2 console.log (f1(1,2,3));  // 3 console.log ...
MySQL添加新数据场景:抓取某网站的数据后,将数据放入自己的数据库。问题:如何判断该数据已存在?假设字段名为(id , name,price,url, hashUrl), 设置hashUrl为Unique.解决方法:insert ignore into xx (name, price, url, hashUrl) values (%s, %s, %s, %s) ;由于hashUrl是唯一,加个ignore可以避免将重复的数据添加到数据。
Vagrant Note   1 vagrant 命令     vagrant init hashicorp/precise64    #需要先删除Vagrantfile文件     vagrant up                          #启动虚拟机,  根据Vagrantfile文件启动     vagrant destroy                     #清空修改的内容,还原box     vagrant ssh                         #连接到虚拟机     vagrant box remove             ...
React Native WebView使用本地HTML文件这里注意本地的文件路径为:http://localhost:8081/iosPages/b.html   HTML文件 /iosPages/b.html:  <h1>this is a html file</h1> <p>this is content hello </p>   JS文件: 'use strict'; var React = require('react-native'); var { StyleSheet, Text, View, ...
React Native 圆角模糊如果使用borderRadius时,发现有些边角会模糊残缺,可以用overflow:'hidden'
React Native ScrollView How to Jump to the Top ? 页面中有个ScrollView,点击某个Button,跳到ScrollView的顶部。可以参考以下例子: <ScrollView  ref={component => this._scrollView = component}  />  //this._scrollView.scrollTo(0, 0);  这个有动画效果    this._scrollView.scrollWithoutAnimationTo(0,0);    //这个没有动画效果----参考:htt ...
使用ScrollView时,自带了一个类似marginTop的效果,将其去掉 <ScrollView automaticallyAdjustContentInsets={false} >

php zero mq

    博客分类:
  • php
PHP Zero MQ   use ZMQ; use ZMQContext; use ZMQSocket; $addr = "tcp://127.0.0.1:5555"; $context = new ZMQContext(); $socket = new ZMQSocket($context, ZMQ::SOCKET_REQ); $socket->connect($addr); $socket->send("hello , this is a messgae"); $reply = $socket-& ...
/* 环境变量: JAVA_HOME  = D:\Program Files\Java\jdk1.7.0_25 CLASSPATH  = .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar Path  添加   ;%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin   javac HelloWorld.java       // 生成 HelloWorld.class文件 java HelloWorld   */   public class HelloWorld {  ...
Hello Tableview in Swift  xcode 6.01   1. create a single view application project2. [optional], uncheck the auto layout 3. drag a tableview into view controller , link it as datasource 4. add some code below to ViewController.swift // ------------     let tableData = ["Apple", " ...

jinja2 笔记

Jinja2 笔记   显示html的内容:  {{ content | escape }}   过滤html的标签 jinja2 filter html tag {{ content | striptags }}   取前x个字符 {{ content | truncate (20) }}
python 汉字按拼音排序,   原理很简单,就是根据汉字拼音字典,将汉字转为拼音,然后sort一下就好了,不过对于多音字倒是没有办法了。   #encoding:utf-8 import re def sort_pinyin (names): '''pinyin.txt: 吖 a1 阿 a1 啊 a1 锕 a1 錒 a1 嗄 a2 厑 aes ''' pinyin = file('pinyin.txt').read().decode('utf-8').split('\n') pinyin_dict = {} for line ...
正文提取:   平时打开一个网页,除了文章的正文内容,通常会有一大堆的导航,广告和其他方面的信息。本博客的目的,在于说明如何从一个网页中提取出文章的正文内容,而过渡掉其他无关的的信息。   这里先看看 demo : http://2.tingxinwen.duapp.com/extract_context   本方法是基于文本密度的方法,最初的想法来源于哈工大的《基于行块分布函数的通用网页正文抽取算法》,本文基于此进行一些小修改。   约定:        本文基于网页的不同行来进行统计,因此,假设网页内容是没有经过压缩的,就是网页有正常的换行的。

python 打印字典

python 打印字典   python 中,如果字典里面又有字典,则输出不好看。 方法一:使用内置的pprint方法二:自己写一个函数   method 1: >>> d = {1:{'who':{'name':'Michael','age':20,'job':{'P':'90-91','G':'91-93'}}},2:{'who':{'name':'Mary','age':18,'job':{'P':'90-93','G':'93-95'}}}} >>> d {1: {'who': {'job': {'P': '90-91', 'G': ...
Global site tag (gtag.js) - Google Analytics