一个同事给了我一个难题,我无法弄清楚这个C程序实际上是如何编译和运行的。这个>>>=运算符和奇怪的1P1字面值是什么?我在Clang和GCC中进行了测试。没有警告,输出为“??”

#include <stdio.h>

int main()
{
    int a[2]={ 10, 1 };

    while( a[ 0xFULL?'\0':-1:>>>=a<:!!0X.1P1 ] )
        printf("?");

    return 0;
}

最近谷歌和英特尔已经发布了一种新的方式来运行模拟器,这应该比以前的版本(已经模拟ARM CPU)更好。这里有一些关于它的链接:这个和这个。

但是,在安装新组件并按照指示创建新的模拟器配置之后,我得到一个错误,也看不到任何改进。我已经尝试了API 10和API 15, GPU启用和禁用。这些配置都没有帮助。我也在两台不同的电脑上尝试过,没有任何提升(而且出现了同样的错误)。

似乎在我读过的帖子中,没有人有任何问题,所有人都报告了一个更快的模拟器。

它显示的错误是:

emulator: Failed to open the HAX device!
HAX is not working and emulator runs in emulation mode
emulator: Open HAX device failed

为什么会发生这种情况,有办法解决吗?还有其他人得到这些错误吗?反之亦然?

顺便说一下,我有一个英特尔的CPU,如果这有问题的话。


编辑:

这是我在BIOS中看到的,所以它应该是可用的…:

"foo" instanceof String //=> false
"foo" instanceof Object //=> false

true instanceof Boolean //=> false
true instanceof Object //=> false
false instanceof Boolean //=> false
false instanceof Object //=> false

12.21 instanceof Number //=> false
/foo/ instanceof RegExp //=> true

// the tests against Object really don't make sense

数组字面量和对象字面量匹配…

[0,1] instanceof Array //=> true
{0:1} instanceof Object //=> true

为什么不是所有人?或者,为什么不都不呢? 那么,它们是什么实例呢?

在FF3、IE7、Opera和Chrome中也是如此。至少它是一致的。

我想从命令行设置Android开发环境,遇到以下问题:

wget http://dl.google.com/android/android-sdk_r22.0.5-linux.tgz

解压完成后,运行

tools/android update sdk --no-ui

但是,它跑起来太慢了

Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml

结果是在文件夹build-tools中什么都没有,我想要的是apapt和apkbuilder,因为我想从命令行构建apk而没有ant。

URI、URL和URN之间的区别是什么?我读过很多网站(甚至维基百科),但我不懂。

URI: http://www.foo.com/bar.html URL: http://www.foo.com/bar.html URN: bar.html

这对吗?

我知道这是一个非常基本的问题,但令我惊讶的是,我找不到任何关于Android SDK构建工具的文档。 除了Android SDK Tools和Android SDK Platform-tools,还有一堆Android SDK Build-tools,如图所示。有没有人能指出一个来源来解释所有这些,并帮助澄清一个特定版本的Android SDK构建工具是如何被选择使用的?

编辑(2014-02-27):

我仍然没有完全理解所有的工具。以下是我根据谷歌最新的资料所作的有限了解:

Android SDK Build-tools used to be components of Android SDK Platform-tools. They have been decoupled from Android SDK Platform-tools, so that the build tools can be updated independently of the integrated development environment (IDE) components. Android SDK Platform-tools are customized to support the features of the latest Android platform. They are backward compatible so that you always use the latest update of Android SDK Platform-tools even your app targets older Android platforms. SDK tools are platform independent and are required no matter which Android platform you are developing on.

I still do not understand the rationale of taking Android SDK Build-tools out of Android SDK Platform-tools which has a single instance and is easy to manage the update. The only possible reason that I can think of is that some apps have to rely on older build components to build them. Google's document mentions this, but does not explain why. Looking at the release notes, you will notice that updates of Android SDK Build-tools are primarily for fixing bugs or/add support for new platforms. The only reason that I can think of for some apps to use older versions of Android SDK Build-tools is that they rely on certain bugs of Android SDK Build-tools. These apps would not function normally without being built with these bugs. I wish Google could explain this better by giving one or two examples showing why these bugs in the tools are critical for certain apps.

我时常会看到一个网站的版权日期是旧的。在我的脑海里,我总是在想“看看那个忘记更新版权年份的笨蛋!”然后,当我把版权年份硬编码到我目前正在设计的网站中时,我突然想到:

我要怎么记得更新这个?

我的第一反应就是使用一些服务器端代码来自动显示当前年份。Bam,固定。

后来我开始思考,如果谷歌这么高大聪明的人都能忽视这一点,也许这样做有什么不对。也许我做错了什么?我想我真正想知道的是,为什么我觉得有必要保持版权年的最新。是有原因吗,还是我的慢性强迫症?

如果有一个很好的理由让它们保持最新,为什么没有更多的开发人员使用服务器端代码呢?我看到这些“错误”无处不在。

我得到了这样的URI:

https://google.com.ua/oauth/authorize?client_id=SS&response_type=code&scope=N_FULL&access_type=offline&redirect_uri=http://localhost/Callback

我需要一个包含已解析元素的集合:

NAME               VALUE
------------------------
client_id          SS
response_type      code
scope              N_FULL
access_type        offline
redirect_uri       http://localhost/Callback

确切地说,我需要一个与c# /等价的Java。净HttpUtility。ParseQueryString方法。

由于最近Oracle Java SE支持路线图策略更新(特别是在2019年3月之后结束Oracle的免费发布更新),我一直在寻找Oracle Java的替代品。我发现OpenJDK是一个开源的替代品。我还找到了AdoptOpenJDK(现在称为Adoptium),这是一个预构建的二进制文件。这谜题。

OpenJDK和Adoptium/AdoptOpenJDK有什么区别?

这是Uri。IsWellFormedUriString和Uri。TryCreate方法,但它们似乎为文件路径返回true,等等。

我如何检查字符串是否是一个有效的(不一定是活动的)HTTP URL用于输入验证目的?