我的应用程序中有一个自动错误报告工具,其中包含有用的调试信息.
我想要包括的一件事是ROM提供商.特别是我想知道用户是否正在运行自定义ROM,最好是使用版本号.
知道如何以编程方式检索此信息吗?
---取自Quintin(见下文)
public static String getReadableModVersion() {
String modVer = getSystemProperty(Constants.SYS_PROP_MOD_VERSION);
return (modVer == null || modVer.length() == 0 ? "Unknown" : modVer);
}
Run Code Online (Sandbox Code Playgroud)
这个常数是这样的:
public static final String SYS_PROP_MOD_VERSION = "ro.modversion";
Run Code Online (Sandbox Code Playgroud)
这是getSystemProperty();
public static String getSystemProperty(String propName){
String line;
BufferedReader input = null;
try
{
Process p = Runtime.getRuntime().exec("getprop " + propName);
input = new BufferedReader(new InputStreamReader(p.getInputStream()), 1024);
line = input.readLine();
input.close();
}
catch (IOException ex)
{
Log.e(TAG, "Unable to read sysprop " + propName, …Run Code Online (Sandbox Code Playgroud) int[] x = new int [] { 1, 2, 3};
int[] y = new int [] { 4, 5 };
int[] z = // your answer here...
Debug.Assert(z.SequenceEqual(new int[] { 1, 2, 3, 4, 5 }));
Run Code Online (Sandbox Code Playgroud)
-
现在我用
int[] z = x.Concat(y).ToArray();
Run Code Online (Sandbox Code Playgroud)
有更简单或更有效的方法吗?
如何编写可以为常规.NET 3.5 Framework或.NET 3.5 Compact Framework重新编译的.NET类库?
我在我的视图控制器视图中有代码像这样加载..但UIBarButtonItem不在工具栏的右侧.它在左侧.任何帮助?如何给工具栏的标题?
UIToolbar *toolbar = [UIToolbar new];
toolbar.barStyle = UIBarStyleBlackTranslucent;
// create a bordered style button with custom title
UIBarButtonItem *playItem = [[[UIBarButtonItem alloc] initWithTitle:@"Play"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(flipToSchedules:)] autorelease];
self.navigationItem.rightBarButtonItem = playItem;
NSArray *items = [NSArray arrayWithObjects: playItem, nil];
toolbar.items = items;
// size up the toolbar and set its frame
// please not that it will work only for views without Navigation toolbars.
[toolbar sizeToFit];
CGFloat toolbarHeight = [toolbar frame].size.height;
CGRect mainViewBounds = self.view.bounds;
[toolbar setFrame:CGRectMake(0, 20,
CGRectGetWidth(mainViewBounds), toolbarHeight)];
[self.view …Run Code Online (Sandbox Code Playgroud) 假设我有两列整数,A和B.现在我想从这些中得到不同的值,这意味着如果A和B都有1,我只需要1次.
注意:我对获得不同的行不感兴趣.我只想从这个表中获得唯一的整数值,可以是A或B
我可以在某个临时表的一列中插入A和B的值,并对该列执行select选择.
有什么更复杂的(表现性的)?
简介:在RHEL 5.3 64位上构建Python 3.1 --enable-shared无法编译所有扩展.建立"正常"工作没有任何问题.
请注意,这个问题似乎模糊了编程和系统管理之间的界限.但是,我认为,因为它必须直接处理语言支持,并且它与支持编程过程非常相关,我将在此处交叉发布.另请参见:https://serverfault.com/questions/73196/python-3-1-1-with-enable-shared-will-not-build-any-extensions.谢谢!
问题:
在RHEL 5.3 64位上构建Python 3.1 --enable-shared无法编译所有扩展.建立"正常"工作没有任何问题.
我可以很好地构建python 3.1,但是当构建为共享库时,它会发出许多警告(见下文),并拒绝构建任何c基于模块的模块.尽管失败了,我仍然可以针对它构建mod_wsgi 3.0c5,并在apache下运行它.毋庸置疑,Python的功能大大减少了......
有趣的是,Python 3.2a0(来自svn)使用--enable-shared进行编译,并且mod_wsgi可以很好地编译它.但是当启动apache时,我得到:
Cannot load /etc/httpd/modules/mod_wsgi.so into server: /etc/httpd/modules/mod_wsgi.so: undefined symbol: PyCObject_FromVoidPtr
这个项目是一个长期项目,所以如果需要,我可以使用alpha质量软件.以下是有关该问题的更多详细信息.
主办:
建立:
./configure./configure --enable-shared(export CFLAGS="-fPIC"已经完成)
输出
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -fPIC -DPy_BUILD_CORE -c ./Modules/_weakref.c -o Modules/_weakref.o
building 'bz2' extension
gcc -pthread -fPIC …
在ASP.NET WebForms中,您可以使用以下语法直接在标记中引用appSettings:
<%$ MySettingKey %>
Run Code Online (Sandbox Code Playgroud)
不幸的是,这在ASP.NET MVC中不起作用,因为正如MSDN所指出的,这种语法仅适用于服务器控件.
我遇到过一些我喜欢在ASP.NET MVC视图(WebFormsViewEngine)中使用这种语法糖的情况.有谁知道是否有办法让这个工作?
好像我们可以从WebFormsViewEngine派生出来并将其添加为一个功能,或许?
我一直使用32位机器.我知道64位也是常见的,但我从未详细了解它如何帮助开发人员或一般情况.所以我的问题是 - 128位操作系统对软件开发人员意味着什么?
UPDATE
我总体上问过这件事.无论是恶作剧还是其他什么都没关系.
.net ×1
android ×1
asp.net ×1
asp.net-mvc ×1
c# ×1
compilation ×1
distinct ×1
iphone ×1
javascript ×1
mod-wsgi ×1
python ×1
python-3.x ×1
sql ×1
sql-server ×1
vb6 ×1
web-config ×1