phaser 按键表 keyboard keycode

https://photonstorm.github.io/phaser-ce/Phaser.KeyCode.html 帮助文档里都有,但就是没人说

SuCicada

PhaserCE 使用 create.texture 出错 Phaser.Cache.addImage: Image "xx" is not complete 并且图形没有显示

首先参看官网文档的写法 https://photonstorm.github.io/phaser-ce/Phaser.Create.html#texture var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'game', { preload: preload, create: create, }); function preload(){ var data = [ ' 333 ', ' 777 ', 'E333E', ' 333 ', ' 3 3 ']; game.create.texture('bob', data); } function create() { game.add.sprite(0, 0, 'bob'); } 控制台警告 Phaser.Cache.addImage: Image "xx" is not complete 改为 ...... game.create.texture('bob', data,100,10,0,true,function(f){}); ...... 警告 Phaser.Cache.getImage: Key "xx" not found in Cache. 查找资料无果,实验之后发现 使用 game.load.imageFromTexture('bob',data,100,1); 替换...

SuCicada

pyhton 下 使用getch(), 输入字符无需回车

#原代码来自 https://code.activestate.com/recipes/134892-getch-like-unbuffered-character-reading-from-stdin/ 同时支持windows和unix平台 class _Getch: """Gets a single character from standard input. Does not echo to the screen.""" def __init__(self): try: self.impl = _GetchWindows() except ImportError: self.impl = _GetchUnix() def __call__(self): return self.impl() class _GetchUnix: def __init__(self): import tty, sys def __call__(self): import sys, tty, termios fd = sys.stdin.fileno() old_settings = termios.tcgetattr(fd) try: tty.setraw(sys.stdin.fileno()) ch = sys.stdin.read(1) finally: termios.tcsetattr(fd, termios.TCSADRAIN, old_settings) return ch class _GetchWindows: def __init__(self): import msvcrt def __call__(self): import msvcrt return msvcrt....

SuCicada

python matplotlibmat 包mplot3d工具 三维视图透视取消

https://stackoverflow.com/questions/23840756/how-to-disable-perspective-in-mplot3d 简单的解决方法是 ax = fig.add_subplot(111, projection='3d', proj_type='ortho') 注意111 和 proj_type=‘ortho’ 辛亏在打算转用Mayavi 前找到了解决方法

SuCicada

python pip安装不成功 在windows下

我用的是windows。你可以试试以管理员模式运行终端。 我在用python安装第三方库时,使用如下方式 pip install xxxx.whl 但是无论如何都只显示到 Installing collected packages: xxxx 然后就没了,和网上说的出来什么success提示完全不,然后我通过import来验证,也是没有安装上的。 一定要出现 Successful installed xxxx 才算成功。 如果你的问题不是这样的,请查查看别的家的博客。 花了一个晚上都没有安上pygame。 于是第二天在整整一个下午琢磨了两个小时为什么。重启电脑,将python卸载再安装,卸载再安装,卸载再安装。删除easy_install 重装ez。删除pip,重装pip。重装wheel,但是如上面那样也失败了。然后我终于发现问题所在了。 我把powershell当成了是默认的管理员模式,于是我就一直处于安装不成功的地步。 所以说,如果你也安装不上,试试管理员模式运行终端。 真的是气,那些三步安装库的人根本不说。

SuCicada

python Tkinter 的 Text 保持焦点在行尾

https://bbs.csdn.net/topics/390712532 text.see(END)

SuCicada

Python3 urllib 爬取 花瓣网图片

点我去我的github上看源码 **花瓣网是动态的,所以要抓包分析,,但我真的累的不行,不想写教程了,我源码里有注释

SuCicada

python3 urllib爬取wallhalla网站图片

点我去我的github上看源码 简单使用静态方法爬取https://wallhalla.com/网站的图片 参考: https://blog.csdn.net/cquptcmj/article/details/53526137 https://www.cnblogs.com/zhouxuchen/p/4341034.html

SuCicada

python3.5 安装twisted

https://blog.csdn.net/caimouse/article/details/77647952 下载地址:http://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载到文件:Twisted-18.7.0-cp35-cp35m-win_amd64.whl 然后安装:pip install Twisted-18.7.0-cp35-cp35m-win_amd64.whl 如果不行 下载win32版本试试 如果不行 提示Python.h: No such file or directory compilation terminated. 那么就 sudo apt-get install python-dev 然后试试 上面步骤 如果还不行 sudo pip3 install twisted

SuCicada

sublime 自定义主题(linux版)

先ctrl+`安装packa: import urllib.request,os; pf = ‘Package Control.sublime-package’; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), ‘wb’).write(urllib.request.urlopen( ‘http://sublime.wbond.net/' + pf.replace(’ ‘,’%20’)).read()) 使用快捷键ctrl+shift+p,输入packet control install package 这个网站上可以自制主题 http://tmtheme-editor.herokuapp.com/#!/editor/local/undefined 之后将文件放到home/peng/.config/sublime-text-3/Packages 从preferences里的theme选项可以换了

SuCicada

ubuntu 18.04 使用 Docker 安装 kiwenlau版Hadoop

1. docker 安装 参考 sudo apt-get update sudo dpkg --configure -a sudo apt-get install apt-transport-https ca-certificates curl software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" sudo apt-get update sudo apt-get install docker-ce 1.5 docker换源(可选) 参考 2. docker验证 docker --version sudo docker run hello-world 3. docker非root使用 参考 sudo usermod -aG docker $USER sudo service docker restart newgrp docker 4. hadoop的docker image 参考:基于Docker搭建Hadoop集群之升级版...

SuCicada

virtualbox 发送 ctrl alt fn组合键的方法:使用热键(默认右ctrl)+fn即可

一般是用来在虚拟机中切换文字模式和图像化窗口模式的。 如果直接使用ctrl+alt+fn可能会触发主机的组合键。 所以使用热键+fn

SuCicada

Visual Stdio Code 运行生成任务 输出不了

刚刚解决了pip安装的问题,现在打开vscode又出现了问题。 我像平常一样按下ctrl+shift+B 运行我的python文件 但是结果就像我用vc写C语言一样,闪过一个黑窗口的终端界面,然后就没了。没有输出,控制台界面也没有停下来让我好好看看。 我查了查,没有结果。 然后灵机一动,我知道怎么回事了。都怪我手贱,将python.exe这个文件设置成了默认管理员模式运行。 我不知道为什么,反正我取消了管理员模式运行就好了。

SuCicada

windows 一键切换ip dns脚本

下载bat脚本 https://github.com/SuCicada/ipswitch 然后运行,按照提示输入即可 @echo off&color 1E&title IP地址快速切换器 echo ┌────────────────────────────┐ echo | | echo | 切换网络环境,请输入当前所在位置 │ echo | | echo └────────────────────────────┘ >nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" :choice set choice= set /p choice=【外网】请选择1,【内网】请选择2 :[1,2]? if %choice%==2 goto school_lan if %choice%==1 (goto lab_lan) else (echo 输入错误,请重新输入&goto choice) :lab_lan set eth="本地连接" set ip=10.0.0. set netmask=255.255.255.0 set gw=10.0.0.1 set dns1=8.8.8.8 set dns2= echo. echo 切换到外网有线环境 echo. goto switch :school_lan set eth="本地连接" set ip=10.90.6. set netmask=255.255.255.0 set gw=10....

SuCicada

WSL2 -- Windows10 环境中运行 Linux (无缝衔接,开发利器)

WSL2 是什么 全称为 Windows Subsystem for Linux2。是一个能在Windows上运行Linux运行环境的工具。是WSL的第二代。 简单来说就是Windows下的Linux虚拟机。 比虚拟机好在哪里 启动速度超快。文件访问跨系统访问无限制(因为两个系统之间的目录是通过网络映射挂载的) Windows、Linux 命令混合使用。无论在哪个系统的终端,都可以使用另一个系统的命令。(比如在Linux中使用explorer.exe . 看看会发生什么) 比WSL1好在哪 最主要体现在网络隔离、以及进程管理(比如ps)。 WSL2使用类似NAT的虚拟机网络模式。这样的好处就是Linux和Windows的网段是隔离的。 而WSL1更像是运行在Windows上的一个程序,所以网络IP、端口、进程状态等都是用的Windows宿主机。 所以这么来看WSL2更像是纯粹的一个虚拟机了。 安装&配置 在 Windows 中运行 Linux:WSL 2 使用入门 適用於Linux的Windows子系統(Windows Subsystem for Linux;WSL) 进阶提升效率 Windows Terminal 比PowerShell 更好用、更美观的Windows终端。支持窗口多开,WSL直开。 玩转WSL(2)之安装并配置Windows Terminal Ctrl+Alt+T 开启终端。 下载WinHotKey,设置Windows Terminal默认窗口为WSL。 体验原生Linux终端的快感。 肯定有用的脚本 todo 衍生资源 WSL 和 WSL2 简单对比

SuCicada

三柱体hanoi问题(C_C++语言版)

控制台运行输入数据格式 : xxx(程序名) 3(汉诺塔层数) 会显示出每一步的移动步骤,以及每一柱上留有的盘数 #include<iostream> #include<sstream> using namespace std; int a=0,b=0,c=0; void hno(int n,char from,char mid,char to) { if(n>1) { hno(n-1,from,to,mid); hno(1,from,mid,to); hno(n-1,mid,from,to); } else { switch(from) { case 'A':a--;break; case 'B':b--;break; case 'C':c--;break; } switch(to) { case 'A':a++;break; case 'B':b++;break; case 'C':c++;break; } cout<<from<<"-->"<<to<<" A:"<<a<<" B:"<<b<<" C:"<<c<<endl; } } int main(int argc,char *argv[]) { // cout<<argc<<endl; // cout<<"_"<<argv[1]<<"_"<<endl; // return 0; stringstream s; int n;//=*argv[1]; s<<argv[1]; s>>n; //cin>>n; a=n; //hno(n,) hno(n,'A','B','C'); return 0; }

SuCicada

三柱汉诺塔问题(Python版)

思路一样 def move(n, a, b, c): if(n>1): move(n-1,a,c,b) move(1,a,b,c) move(n-1,b,a,c) else: print a,'-->',c n = input('input a number') #int(raw_input()) move(n, 'A', 'B', 'C')

SuCicada

修改 linux、ubuntu 默认终端,外加terminator颜色方案

需求:使用 cinnamon 桌面,想要修改右键打开的终端为terminator 先安装 dconf-tools sudo apt-get install dconf-tools 依次进入 org -> cinnamon -> desktop -> default-applications -> terminal 然后将键值改成你想要的 比如terminator为 key value exec: x-terminal-emulator exec-arg: -e 最后来一个一键脚本 gsettings set org.gnome.desktop.default-applications.terminal exec /usr/bin/x-terminal-emulator gsettings set org.gnome.desktop.default-applications.terminal exec-arg "-e" terminator颜色方案 配置文件 ~/.config/terminator/config [global_config] always_split_with_profile = True enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler focus = system geometry_hinting = False handle_size = 2 inactive_color_offset = 1.0 title_font = mry_KacstQurn Bold 11 title_hide_sizetext = True title_receive_bg_color = "#729fcf" [keybindings] paste = <Primary>v [layouts] [[default]] [[[child1]]] parent = window0 profile = default type = Terminal [[[window0]]] parent = "" type = Window [plugins] [profiles] [[default]] background_color = "#3e3535" background_darkness = 0....

SuCicada

关于 1.0_0.0 以及 0.0_0.0 的值

#include<cstdio> #include<iostream> using namespace std; int main() { printf("%d\n",1.0/0.0);//0 printf("%d\n",0.0/0.0);//0 printf("%lld\n",1.0/0.0);//9218868437227405312 printf("%lld\n",0.0/0.0);//-2251799813685248 printf("%lf\n",1.0/0.0);//1.#INF00 printf("%lf\n",0.0/0.0);//-1.#INF00 cout<<1.0/0.0<<endl;//inf cout<<0.0/0.0<<endl;//nan return 0; }

SuCicada

关于linux 下pycharm 输入法不跟随的问题(未解决)

http://tieba.baidu.com/p/3858968877#70635782254l https://neue.v2ex.com/t/306947 貌似linux无解

SuCicada