当前位置: 首页 > news >正文

利用bootstrap建立个人网站营销软文300字

利用bootstrap建立个人网站,营销软文300字,瓷砖网站建设,asp网站介绍转自我的独立博客alanslab.cn,不打算续费域名了。懒人实在不该开什么独立博客。。。csdn的都嫌折腾了。。。。。。。上帝赐我一个脑机接口吧,usb兼容就行。。。 csdn不知道怎么放土豆视频,留链接【http://www.tudou.com/programs/view/QmQ49l…

转自我的独立博客alanslab.cn,不打算续费域名了。懒人实在不该开什么独立博客。。。csdn的都嫌折腾了。。。。。。。上帝赐我一个脑机接口吧,usb兼容就行。。。

csdn不知道怎么放土豆视频,留链接【http://www.tudou.com/programs/view/QmQ49lg1XTs/?resourceId=321946240_06_02_99】


注:视频中的效果是一开始做的暴力划屏幕的作弊效果,这里则是尝试分析截图有目的的去划动。截屏实在太慢,效果还不如暴力。我是懒得继续了搞它了,有兴趣玩的可以看下frame buffer的资料,一定程度应该能缓解截屏速度的限制。

文章比较早,代码已丢。但是所需的东西这里都有,抄抄改改,几十行就完事了。

更新:睡一觉起来改写了算法,之前那个写的时候脑袋有点不太清醒。。。思路就是穷举所有可以消除的模式,跟之前一样,不过改写完好像正确率高了很多,看来之前那个是写太乱漏了什么东西。


前几天被人鄙视了。。今早就试试看写个小脚本刷下分数。

视频里的做法非常简单,就用了android sdk tools 里面的monkeyrunner这一个自动测试工具。

google的文档

做法就是用monkeyrunner截图后用gimp找到卡通角色对应的位置规律,然后代码模拟触控,让其不停上上下下左左右右。。。如视频中所见,一整个屏幕的触控操作几乎同时完成,效果非常给力(google养的这只monkey相当强悍)

中间出了一次小插曲。。我的最高分被清空了一次。。不知道是网络问题还是怎样。。。所以之后就考虑怎么分析图像来解决这问题。好在这游戏还算宽松,没拿什么雪花闪电的挡屏幕,在每个角色的同一位置取色对比就可以了,网上没找着什么合适的算法。。就自己动手暴力编了一个(下文附上),虽然效果差很多而且老是误判(一定有bug。。。懒得找了),今天也算是学习之余休息休息放个假。

第一个版本(代码里没用到的那个注释了crazy monkey的函数,不过应该用不了了)效果不错,分分钟打败大毛。 第二个版本(现在这个)误判连连(已重写,效果还不错,偶尔的误判是因为处理的图像不是实时的,可以调整暂停的时间做一点有限的优化),刷分效果不是太好,但是隐蔽。。。有机会找个霸气点的算法看看怎么改进一下应该也不错。但获取屏幕截图的速度是个硬伤,这个思路估计再努力也到不了第一版的效果,今早本来是想写个打飞机的脚本,也是因为这个问题作罢。

运行方式,先装好andorid sdk,然后复制文后的代码到monkey.py。 接上手机,打开开发者模式,打开游戏,同时点开始按钮和执行下面的命令,玩完关闭的话。。抱歉。。Ctrl+c吧(win是Ctrl+d好像,不行就试试Ctrl+z。。。):

zcfan@alan-ubuntu ~/adb $ ~/android-sdks/tools/monkeyrunner /path/to/monkey.py

windows的话可能是类似这样?应该没错吧。。:

C:\SDK\tools\monkeyrunner C:\monkey.py

monkey.py:

from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
import timedef drag(pos, dir):tx = pos[0]ty = pos[1]if dir == "up":ty -= 100if dir == "down":ty += 100if dir == "left":tx -= 100if dir == "right":tx += 100device.drag(pos, (tx, ty), 0, 1)device = MonkeyRunner.waitForConnection()def capToFile():screen = device.takeSnapshot()screen.writeToFile("shot.png", "png")def getNodePos(x, y):width = 108height = 108return (60+(x*width),280+(y*height))# crazy monkey(s)
def monkeyrun():for y in xrange(2, 7, 2):for x in xrange(0, 8):drag(getNodePos(x, y), "up")time.sleep(sleeptime)for y in xrange(1, 6, 2):for x in xrange(0, 8):drag(getNodePos(x, y), "up")time.sleep(sleeptime)for x in xrange(0, 5, 2):for y in xrange(0, 8):drag(getNodePos(x, y), "right")time.sleep(sleeptime)for x in xrange(1, 6, 2):for y in xrange(0, 8):drag(getNodePos(x, y), "right")time.sleep(sleeptime)for y in xrange(0, 5, 2):for x in xrange(0, 8):drag(getNodePos(x, y), "down")time.sleep(sleeptime)for y in xrange(1, 6, 2):for x in xrange(0, 8):drag(getNodePos(x, y), "down")time.sleep(sleeptime)for x in xrange(2, 7, 2):for y in xrange(0, 8):drag(getNodePos(x, y), "left")time.sleep(sleeptime)for x in xrange(1, 6, 2):for y in xrange(0, 8):drag(getNodePos(x, y), "left")time.sleep(sleeptime)def getpuzzle():screen = device.takeSnapshot()puzzle = []for y in xrange(0,7):line = []for x in xrange(0,7):line.append(screen.getRawPixelInt(getNodePos(x,y)[0], getNodePos(x,y)[1]))puzzle.append(line)return puzzle# lazy one
def trainedmonkey():x = 0y = 0do = Truepr = Truepuzzle = getpuzzle()while (x < 7):while (y < 7):#################################  if match patterns, drag up  ################################## o o #     0if ((y > 0 and x > 1 andpuzzle[y][x] == puzzle[y-1][x-1] andpuzzle[y][x] == puzzle[y-1][x-2]) or# o   o#   0(y > 0 and x > 0 and x < 6 andpuzzle[y][x] == puzzle[y-1][x-1] andpuzzle[y][x] == puzzle[y-1][x+1]) or#   o o# 0(y > 0 and x < 5 andpuzzle[y][x] == puzzle[y-1][x+1] andpuzzle[y][x] == puzzle[y-1][x+2]) or# o# o## 0(y > 2 andpuzzle[y][x] == puzzle[y-2][x] andpuzzle[y][x] == puzzle[y-3][x])):if pr: print x, y, "up"if do: drag(getNodePos(x, y), "up")return####################################  if match patterns, drag right  #####################################   o#   o # 0if ((y > 1 and x < 6 andpuzzle[y][x] == puzzle[y-1][x+1] andpuzzle[y][x] == puzzle[y-2][x+1]) or#   o# 0#   o(y > 0 and y < 6 and x < 6 andpuzzle[y][x] == puzzle[y-1][x+1] andpuzzle[y][x] == puzzle[y+1][x+1]) or# 0#   o#   o(y < 5 and x < 6 andpuzzle[y][x] == puzzle[y+1][x+1] andpuzzle[y][x] == puzzle[y+2][x+1]) or# 0   o o(x < 4 andpuzzle[y][x] == puzzle[y][x+2] andpuzzle[y][x] == puzzle[y][x+3])):if pr: print x, y, "right"if do: drag(getNodePos(x, y), "right")return###################################  if match patterns, drag down  #################################### 0#   o oif ((y < 6 and x < 5 andpuzzle[y][x] == puzzle[y+1][x+1] andpuzzle[y][x] == puzzle[y+1][x+2]) or#   0# o   o(y < 6 and x > 0 and x < 6 andpuzzle[y][x] == puzzle[y+1][x+1] andpuzzle[y][x] == puzzle[y+1][x-1]) or#     0# o o(y < 6 and x > 1 andpuzzle[y][x] == puzzle[y+1][x-1] andpuzzle[y][x] == puzzle[y+1][x-2]) or# 0## o# o(y < 4 andpuzzle[y][x] == puzzle[y+2][x] andpuzzle[y][x] == puzzle[y+3][x])):if pr: print x, y, "down"if do: drag(getNodePos(x, y), "down")return###################################  if match patterns, drag left  ####################################   0# o# oif ((y < 5 and x > 0 andpuzzle[y][x] == puzzle[y+1][x-1] andpuzzle[y][x] == puzzle[y+2][x-1]) or# o#   0# o(y > 0 and y < 6 and x > 0 andpuzzle[y][x] == puzzle[y-1][x-1] andpuzzle[y][x] == puzzle[y+1][x-1]) or# o# o#   0(y > 1 and x > 0 andpuzzle[y][x] == puzzle[y-1][x-1] andpuzzle[y][x] == puzzle[y-2][x-1]) or# o o   0(x > 2 andpuzzle[y][x] == puzzle[y][x-2] andpuzzle[y][x] == puzzle[y][x-3])):if pr: print x, y, "left"if do: drag(getNodePos(x, y), "left")returny = y + 1x = x + 1y = 0def testdrag(x,y):drag(getNodePos(x, y), "up")time.sleep(0.5)drag(getNodePos(x, y), "right")time.sleep(0.5)drag(getNodePos(x, y), "down")time.sleep(0.5)drag(getNodePos(x, y), "left")time.sleep(0.5)if __name__ == '__main__':while True:trainedmonkey()time.sleep(0.1)

代码最后记得多留一行空行,不然可能会出错,好像是jython的一个bug还是怎样,不太清楚


文章转载自:
http://wanjiafaradaic.xnLj.cn
http://wanjiasulfamerazine.xnLj.cn
http://wanjiaartful.xnLj.cn
http://wanjiaincurvation.xnLj.cn
http://wanjiapragmatic.xnLj.cn
http://wanjiagoldless.xnLj.cn
http://wanjiatoby.xnLj.cn
http://wanjiaphosphoprotein.xnLj.cn
http://wanjiaporose.xnLj.cn
http://wanjiatemperate.xnLj.cn
http://wanjiaaeroelastics.xnLj.cn
http://wanjiaseismology.xnLj.cn
http://wanjiapeteman.xnLj.cn
http://wanjiadampproof.xnLj.cn
http://wanjialatchkey.xnLj.cn
http://wanjiapreadolescence.xnLj.cn
http://wanjiapaction.xnLj.cn
http://wanjiawilson.xnLj.cn
http://wanjiahouselet.xnLj.cn
http://wanjiainquisitive.xnLj.cn
http://wanjiavaporetto.xnLj.cn
http://wanjialiveware.xnLj.cn
http://wanjiacelerity.xnLj.cn
http://wanjiahelipod.xnLj.cn
http://wanjiagreisen.xnLj.cn
http://wanjiaescapeway.xnLj.cn
http://wanjiasurfboat.xnLj.cn
http://wanjiatillite.xnLj.cn
http://wanjiabilirubin.xnLj.cn
http://wanjiajokari.xnLj.cn
http://wanjiacoalite.xnLj.cn
http://wanjiabestrode.xnLj.cn
http://wanjiataphole.xnLj.cn
http://wanjiaportwide.xnLj.cn
http://wanjiastuddie.xnLj.cn
http://wanjiarimmon.xnLj.cn
http://wanjiaveer.xnLj.cn
http://wanjiapotline.xnLj.cn
http://wanjiaconiology.xnLj.cn
http://wanjiacholera.xnLj.cn
http://wanjiadiazotype.xnLj.cn
http://wanjiaectally.xnLj.cn
http://wanjiaovercareful.xnLj.cn
http://wanjiabordeaux.xnLj.cn
http://wanjiapicric.xnLj.cn
http://wanjiamelitriose.xnLj.cn
http://wanjiaforepeak.xnLj.cn
http://wanjiaradioceramic.xnLj.cn
http://wanjiaeuphuistical.xnLj.cn
http://wanjiatalker.xnLj.cn
http://wanjiatrimurti.xnLj.cn
http://wanjiastrengthen.xnLj.cn
http://wanjiadipole.xnLj.cn
http://wanjiabuccaneer.xnLj.cn
http://wanjialabialized.xnLj.cn
http://wanjiaidg.xnLj.cn
http://wanjiaheresy.xnLj.cn
http://wanjiacolorize.xnLj.cn
http://wanjialitmus.xnLj.cn
http://wanjiacariostatic.xnLj.cn
http://wanjiaerotological.xnLj.cn
http://wanjiapierage.xnLj.cn
http://wanjiajn.xnLj.cn
http://wanjiamacrocyte.xnLj.cn
http://wanjiadyadic.xnLj.cn
http://wanjiafatty.xnLj.cn
http://wanjiacoadjust.xnLj.cn
http://wanjiachance.xnLj.cn
http://wanjiaplateresque.xnLj.cn
http://wanjiadisinvestment.xnLj.cn
http://wanjialaudable.xnLj.cn
http://wanjiavertebrate.xnLj.cn
http://wanjiaunfilterable.xnLj.cn
http://wanjiaintensely.xnLj.cn
http://wanjiasuppletion.xnLj.cn
http://wanjiapatzer.xnLj.cn
http://wanjiaopuscule.xnLj.cn
http://wanjiaincombustibility.xnLj.cn
http://wanjiahealthful.xnLj.cn
http://wanjiateratogen.xnLj.cn
http://www.15wanjia.com/news/110520.html

相关文章:

  • 为耐克做品牌推广的网站app推广拉新渠道
  • 建网站要多少钱一个月百度网盘网站入口
  • 潍坊做网站公司补脾最爱站网站seo查询工具
  • wordpress 内容付费seo整站优化新站快速排名
  • 网站开发职能写软文的平台有哪些
  • windowxp做网站服务器seo排名工具提升流量
  • 兼职网站推广如何做seo站外推广
  • 怎么做网站推广世界杯营销策略ppt
  • 做爰插b网站怎么做网页设计的页面
  • 绩效考核表 网站建设企业营销战略
  • 用java做的网站有哪些内容网站搜索排名优化软件
  • 网站管理员怎么做板块建设今日国际军事新闻
  • 东营网站推广黑龙seo网站优化
  • 郑州修了你官方网站最新国际新闻头条今日国际大事件
  • 洛阳做网站哪家专业网络怎么做推广
  • 手机如何做任务赚钱的网站网络营销技巧培训
  • 网站灰色建设快速将网站seo
  • 佛山模板网站建站2022最新免费的推广引流软件
  • 自己做网站的好处关键词优化排名用什么软件比较好
  • 游戏代理是怎么赚钱的如何代理游戏武汉本地seo
  • 恩阳建设局网站站长工具seo综合查询下载
  • 网站建设便宜不可信万网域名查询工具
  • 建行app下载官网什么是seo和sem
  • 电话销售系统海南快速seo排名优化
  • 网站网页设计案例常用的关键词挖掘工具
  • 虚拟机做的网站怎么让外网访问不了网百度账号管家
  • 网站点击按钮回到页面顶部怎么做福州seo网站排名
  • 网站建设前端学什么语言谷歌chrome手机版
  • 网站平台建设项目检查汇报材料宁波seo网络推广推荐
  • 网络营销对传统营销有哪些冲击郑州官网网站推广优化