resources

Avoiding duplicate icon resources in a .NET (C#) project

大城市里の小女人 提交于 2019-12-18 03:04:30
问题 I'm using Visual C# 2008 Express. I'd like to use the same icon for the application (ie, the icon shown for the .exe), and for the main form. Unfortunately, VC# doesn't seem to be very smart about this, and insists on duplicating the icon data. There doesn't seem to be a way of selecting an "already embedded" icon for use in the form or project icon (only selecting a file), and using the same file for both icons just embeds the file twice as far as I can see. It's not a big deal (hard drive

Android. Obtaining image size from it's resource id

流过昼夜 提交于 2019-12-18 01:53:41
问题 This is a part of my Activity: private ImageView mImageView; private int resource; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); resource = getIntent().getIntExtra("res", -1); Matrix initMatrix = new Matrix(); mImageView = new ImageView(getApplicationContext()); mImageView.setScaleType( ImageView.ScaleType.MATRIX ); mImageView.setImageMatrix( initMatrix ); mImageView.setBackgroundColor(0); mImageView.setImageResource(resource); } I try to

Android. Obtaining image size from it's resource id

北城余情 提交于 2019-12-18 01:53:26
问题 This is a part of my Activity: private ImageView mImageView; private int resource; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); resource = getIntent().getIntExtra("res", -1); Matrix initMatrix = new Matrix(); mImageView = new ImageView(getApplicationContext()); mImageView.setScaleType( ImageView.ScaleType.MATRIX ); mImageView.setImageMatrix( initMatrix ); mImageView.setBackgroundColor(0); mImageView.setImageResource(resource); } I try to

Resident Set Size (RSS) limit has no effect

北战南征 提交于 2019-12-17 23:24:02
问题 The following problem occurs on a machine running Ubuntu 10.04 with the 2.6.32-22-generic kernel: Setting a limit for the Resident Set Size (RSS) of a process does not seem to have any effect. I currently set the limit in Python with the following code: import resource # (100, 100) is the (soft, hard) limit. ~100kb. resource.setrlimit(resource.RLIMIT_RSS, (100, 100)) memory_sink = ['a']*10000000 # this should fail The list, memory_sink, succeeds every time. When I check RSS usage with top, I

Maven: Include resources into JAR

霸气de小男生 提交于 2019-12-17 22:49:36
问题 I have some terrible beaviour. I have the following Maven configuration: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <artifactId>Test2Certificate</artifactId> <version>0.1.0-SNAPSHOT</version> <packaging>jar</packaging> <parent> <groupId>com.test</groupId> <artifactId>build</artifactId> <version>1.0

What is the difference between managed and native resources when disposing? (.NET)

时光怂恿深爱的人放手 提交于 2019-12-17 22:27:18
问题 I was reading the MSDN article about how to implement IDisposable and I am uncertain about the difference between managed and native resources cited in the article. I have a class that must dispose 2 of its fields when it is disposed. Should I treat them as Managed (dispose only when disposing = true) or Native resources? 回答1: A managed resource is another managed type, which implements IDisposable . You need to call Dispose() on any other IDisposable type you use. Native resources are

Android Resources converting to string TypedValue warning

时间秒杀一切 提交于 2019-12-17 22:25:41
问题 Ok I'm looking right past something here.. Every time I'm in my app and I change activities, logcat reports series of warnings: 02-04 14:42:36.524: WARN/Resources(1832): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f08002b} 02-04 14:42:36.524: WARN/Resources(1832): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f08002c} 02-04 14:42:36.524: WARN/Resources(1832): Converting to string: TypedValue{t=0x12/d=0x0 a=2 r=0x7f08002d} Other apps are not showing such warnings. Is this a

Find out if resource is used

白昼怎懂夜的黑 提交于 2019-12-17 22:08:43
问题 I am looking for an efficient way to find out if a resource (mostly a drawable) is used in Java or in an XML file. The problem is, that on my current project the drawables are changed often and now I have some drawables, which might never be used. Is there a tool/way to find those unused drawables without search each filename in the whole project? 回答1: I wrote a tool based on python to solve this problem. As this is not the place to share it directly, I created a project page which is now

How to consume reusable gui element/widget with resources in android

北战南征 提交于 2019-12-17 21:35:32
问题 I try to use the dateslider in my android project to have a combined date-time picker im my gui. The authors of the widget suggest to include the java- and resource-sources directly into my app. 1st try copy java and resources into main app: Result: The widget java classes cannot compile because the resourceids R.xxxx cannot be resolved. Reason: The widget classes are implemented in package "com.googlecode.android.widgets.DateSlider" and my app has a different namespace "my.namespace.myApp"

Get Path to Subdirectory in Resources Folder

*爱你&永不变心* 提交于 2019-12-17 21:30:41
问题 i'm trying to get an array of all png files in a subdirectory of the Resources Folder. In my apps Resources Folder I have created a Folder named "images". This folder holds all the png-files I need to display. This is the way I tried to get the Path: NSString *imagepath = [NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle] bundlePath],@"images/"]; NSLog(@"Path to Images: %@", imagepath); NSArray * paths = [NSBundle pathsForResourcesOfType: @"png" inDirectory:imagepath]; NSMutableArray