这是我第一次使用libgdx,我想尝试安装后提供的默认应用程序gdx-setup-ui.当我点击eclipse上的运行按钮时,它运行正常
[2014-05-01 21:40:14 - my-gdx-game-android] Uploading my-gdx-game-android.apk onto device 'emulator-5554'
[2014-05-01 21:40:15 - my-gdx-game-android] Installing my-gdx-game-android.apk...
[2014-05-01 21:40:16 - my-gdx-game-android] Success!
[2014-05-01 21:40:16 - my-gdx-game-android] Starting activity com.me.mygdxgame.MainActivity on device emulator-5554
[2014-05-01 21:40:16 - my-gdx-game-android] ActivityManager: WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
[2014-05-01 21:40:16 - my-gdx-game-android] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.me.mygdxgame/.MainActivity }
Run Code Online (Sandbox Code Playgroud)
但不幸的是,在模拟器上,我的LibGDX游戏停止了.
这些显示在logCat中:
05-01 17:02:04.936: D/dalvikvm(2034): Trying to load lib /data/app-lib/com.me.mygdxgame-1/libgdx.so 0xb103cb78 …Run Code Online (Sandbox Code Playgroud) 我对android视图感到疯狂.我想要一个布局,顶部有一个栏(A),一个栏位于我的应用程序的底部(C)height="wrap_content".中间的完整剩余空间(B)应该是具有另一个布局或其他内容的内容区域TextView.但我不能让这个工作.我尝试了很多布局,但是当我android:layout_height="match_parent"对B 做的时候,C就消失了.有任何想法吗?提前致谢
我在svg元素中添加了九个矩形.如何为每个人添加点击事件?
var nodeValues = [0, 1, 2, 3, 4, 5, 6, 7, 8];
var colors = ["aqua", "darkblue", "black", "red", "green", "gray", "navy", "orange", "teal"];
var main = d3.select("#main");
var svg = main.append("svg")
.data(nodeValues)
.attr("width", 300)
.attr("height", 300);
var elementAttr = function (index) {
return {
x: (index % 3) * 100,
y: Math.floor((index / 3)) * 100,
width: 95,
height: 95
}
}
for (var index in nodeValues) {
var rect = svg.append("rect")
.attr(elementAttr(index))
.style("fill", "red" );
}
Run Code Online (Sandbox Code Playgroud)
这是 …
我有一个根文件夹'www'的网站,但我把所有的php文件包括index.php放在root的子文件夹中.我给自己写了一个.htaccess文件来重定向,所以如果我输入www.test.com,它会跳转www.test.com/folder并显示index.php.
下面是.htaccess我把它放在根目录中.
RewriteEngine On
RewriteBase /
RewriteRule ^folder2 - [L]
#ignore folder2 in which I put important files, but no works for the website
RewriteCond %{REQUEST_URI} !^/folder(.*)
RewriteRule (.*) /folder/$1
Run Code Online (Sandbox Code Playgroud)
现在,我想更改.htaccess文件以达到以下目标:
www.test.com,www.test.com/folder像往常一样跳转,但显示没有文件夹的URL .文件夹中的所有页面都将显示没有文件夹名称的URL.如
www.test.com/shop/page1 - > www.test.com/page1
我搜索了一些脚本,但没有一个可以工作.
我有一个简单的方法来获取string.xml中使用它的字符串名称定义的字符串数组的id?我有一个字符串数组的字符串名称,我需要一种方法来引用该数组.下面是一个示例xml.
<string-array name="categories_array">
<item>Clothes</item>
<item>Electronics</item>
<item>Gifts</item>
<item>Food</item>
</string-array>
<string-array name="clothes">
<item>Clothes</item>
<item>Electronics</item>
<item>Gifts</item>
<item>Food</item>
<item>Books</item>
<item>Music</item>
<item>Bags</item>
</string-array>
<string-array name="electronics">
<item>Clothes</item>
<item>Electronics</item>
<item>Gifts</item>
<item>Food</item>
<item>Books</item>
<item>Music</item>
<item>Bags</item>
</string-array>
<string-array name="gifts">
<item>Clothes</item>
<item>Electronics</item>
<item>Gifts</item>
<item>Food</item>
<item>Books</item>
<item>Music</item>
<item>Bags</item>
</string-array>
<string-array name="food">
<item>Clothes</item>
<item>Electronics</item>
<item>Gifts</item>
<item>Food</item>
<item>Books</item>
<item>Music</item>
<item>Bags</item>
</string-array>
Run Code Online (Sandbox Code Playgroud)
现在,如果我有阵列名称"衣服",我怎么会得到它的ID?
我最近从koans学习ruby ,我注意到有关符号和字符串对象的一件事.当我分配两个不同的变量相同的符号时,我发现object_id是相同的.
2.1.1 :017 > symbol1 = :a
=> :a
2.1.1 :018 > symbol2 = :a
=> :a
2.1.1 :019 > symbol1.object_id
=> 361768
2.1.1 :020 > symbol2.object_id
=> 361768
Run Code Online (Sandbox Code Playgroud)
现在看到这个我认为它应该是真正的字符串和整数.但是当我对字符串做同样的事情时,对象id最终变得不同了.
2.1.1 :021 > string1 = "test"
=> "test"
2.1.1 :022 > string2 = "test"
=> "test"
2.1.1 :023 > string1.object_id
=> 13977640
2.1.1 :024 > string2.object_id
=> 13932280
Run Code Online (Sandbox Code Playgroud)
为什么符号和字符串的行为不同?