我正在使用DevKit在Windows 8.1上运行Ruby 2.2.1的干净安装.安装后我运行:
gem install rails
rails new testapp
cd testapp
rails server
Run Code Online (Sandbox Code Playgroud)
保留其他所有内容.
该进程在最后一行失败,而不是运行服务器,我收到错误消息
in 'require': cannot load such file -- 'nokogiri\nokogiri' (LoadError)
Run Code Online (Sandbox Code Playgroud)
它每次都会发生,我环顾四周,尝试了我发现的所有东西,但到目前为止还没有任何效果.
这里有什么问题,如何让一个简单的测试Rails应用程序工作?
我正在尝试编写一个简单的 Python IRC 客户端。到目前为止,我可以读取数据,如果自动化,我可以将数据发送回客户端。我在 a 中获取数据while True,这意味着我无法在读取数据的同时输入文本。如何在控制台中输入文本,只有在我按下 Enter 时才会发送,同时运行无限循环?
基本代码结构:
while True:
read data
#here is where I want to write data only if it contains '/r' in it
Run Code Online (Sandbox Code Playgroud) 我发现了这行代码:this.red = (float)(par4 >> 16 & 255) / 255.0F;其中red已被声明为a float.
我试图了解它的作用,特别是因为完整的代码是:
this.red = (float)(par4 >> 16 & 255) / 255.0F;
this.blue = (float)(par4 >> 8 & 255) / 255.0F;
this.green = (float)(par4 & 255) / 255.0F;
this.alpha = (float)(par4 >> 24 & 255) / 255.0F;
GL11.glColor4f(this.red, this.blue, this.green, this.alpha);
Run Code Online (Sandbox Code Playgroud)
所以我猜这个以某种方式使用int(par4)的不同位置来着色文本.在这种情况下par4等于553648127.
这四行是什么意思,特别是>> 16 & 25?