`
Thomas会Coding
  • 浏览: 93080 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
最近写一个android小项目,需要用到上拉刷新的功能。在github上找了一个比较经典的。想作为library加入自己的项目中,折腾了半天,终于成功。纪录一下过程。 1:首先新建一个android项目。 2:将github上pullToRefresh的项目下载到本地。 3:点击android studio的 file->import module . 地址栏需要写到   点击完成后。左边如图所示 点击 library 右键 如下图 make module library          点击app 右键 打开 open module setting   ap ...
最近有个小项目需要进行一些定位的操作,找来找去,觉得百度做的还是比较好的。 就记录一点, MainActivity.java public class MainActivity extends Activity { public LocationClient mLocationClient = null; public LocationClientOption option; public BDLocationListener myListener = new BDLocationListener() { @Override public voi ...
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2->5->NULL. Note: Given m, n satisfy the following condition: 1 ≤ m ≤ n ≤ length of list.  这一题的主要就是链表的逆序,逆序比 ...
既然要安装maven,首先得下载吧。 mac上面安装软件的方式其实很简单 1:sudo brew install maven; 是不是很简单,一条语句搞定。 接下来就是让人头疼的问题了,当使用mvn -v 的时候出现了错误提示 Error: JAVA_HOME is not defined correctly. We cannot execute /usr/libexec/java_home/bin/java  好吧,这个错误的原因是我们的JAVA_HOME还没有设置。 有点晕哟。。。 因为当时安装jdk的时候使用的也是 brew install 命令。当时没记得配置过 ...
jdk为什么这样设计,只允许通过iterator进行remove操作?HashMap和keySet的remove方法都可以通过传递key参数删除任意的元素,而iterator只能删除当前元素(current),一旦删除的元素是iterator对象中next所正在引用的,如果没有通过modCount、 expectedModCount的比较实现快速失败抛出异常,下次循环该元素将成为current指向,此时iterator就遍历了一个已移除的过期数据。
for(int i=0;i<15;i++){ int id=getResources.getIdentifier("**"+i,"drawable",mContext.getPackageName()); }   使用循环获取一组资源的id的方法
Valid operators are +, -, *, /. Each operand may be an integer or another expression.
Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330. Note: The result may be very large, so you need to return a string instead of an integer. public class Solution { public S ...

Python下载echo歌曲

最近在echo上面听到一首歌,一个6岁小女孩唱的“ I will always love you ”,简直是天籁, http://echo.kibey.com/sound/198168。你们也可以试试,真的很好听 想下载的时候发现还要装什么客户端。不爽。。。 简单分析了一下,结果就发现轻轻松松就下载了。。。。 1:打开网页发现没有什么验证就可以直接听了,说明没什么验证,只要给定特定的url就直接定位到音乐资源了。关键找到正确的url。 2:打开chrome ,打开网页的时候监视网络连接。  根据Size 我们很容易就定位到请求歌曲的那条url了。  找到真正的请求资源http: ...
今天需要对一系列的图片进行重命名。想到Python的listdir 和rename命令。觉得分分钟搞定的事情 于是开始搞起 图片的命名规则是icon_weather_day_00.png.重命名为d00.png 第一版如下 import os; import sys path="weather" for name in os.listdir(path): newName='d'+name.split('_')[3] os.rename(name,newName)  结果就出现了 windowserror 【error 2 】的提示 ...
#-*- encoding=UTF-8 -*- from Tkinter import * from ttk import * import os def get_sub_path(path): if os.path.isdir(path): for sub_path in os.listdir(path): get_sub_path(path+'\\'+sub_path) else: if os.path.splitext(path)[1].find('java')>0: ...
Python 内置了sqlite的模块 import sqlite3 connection=sqlite3.connect('coachdata.sqlite') cursor=connection.cursor(); '''cursor.execute("""create table athletes(id integer primary key autoincrement unique not null, name text not null, dob date not null ...
windows上运行npm 报Error: ENOENT, stat 'C:\Users\PC111\AppData\Roaming\npm' 错误解决方法         在windows上装好了node.js 版本为:v0.10.30 。由于不是用的默认安装路径,需要在 报错的路径下 建个名为  npm的文件 ,不要带后缀名哦。报错路径为: C:\Users\“你用户名”\AppData\Roaming\   这个路径下建个npm文件即可正常使用npm 命令了!
#encoding='GB2312' import requests import os from HTMLParser import HTMLParser print '本脚本可以帮助您下载K歌之王中上传的歌曲'+'\n' bourl = "http://bbs.byr.cn/board/KaraOK" filepath= 'python/' headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Ac ...
在Django视图函数中经常出现类似于'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)的错误。           在解决错误之前,首先要了解unicode和utf-8的区别。        unicode指的是万国码,是一种“字码表”。而utf-8是这种字码表储存的编码方法。unicode不一定要由utf-8这种方式编成bytecode储存,也可以使用utf-16,utf-7等其他方式。目前大多都以utf-8的方式来变成bytecode。           其次,python中 ...
Global site tag (gtag.js) - Google Analytics