Questions tagged [resources]

Assets (like memory, disk space, CPU power or alike) necessary for effective operation or physical files (like images, configuration files or other) to provide some externalized enrichment to an application.

Typically resources are materials or other assets that are transformed to produce benefit and in the process may be consumed or made unavailable

9303 questions
230
votes
6 answers

Where to place and how to read configuration resource files in servlet based application?

In my web application I have to send email to set of predefined users like finance@xyz.example, so I wish to add that to a .properties file and access it when required. Is this a correct procedure, if so then where should I place this file? I am…
sansknwoledge
  • 4,209
  • 9
  • 38
  • 61
220
votes
4 answers

How to create and use resources in .NET

How do I create a resource that I can reference and use in various parts of my program easily? My specific problem is that I have a NotifyIcon that I want to change the icon of depending on the state of the program. A common problem, but one I've…
Matthew Scharley
  • 127,823
  • 52
  • 194
  • 222
207
votes
6 answers

TextView bold via XML file?

Is there a way to bold the text in a TextView via XML? ?? Thanks
user291701
  • 38,411
  • 72
  • 187
  • 285
192
votes
19 answers

Checking Kubernetes pod CPU and memory utilization

I am trying to see how much memory and CPU is utilized by a kubernetes pod. I ran the following command for this: kubectl top pod podname --namespace=default I am getting the following error: W0205 15:14:47.248366 2767 top_pod.go:190] Metrics…
aniztar
  • 2,443
  • 4
  • 18
  • 24
190
votes
2 answers

REST Complex/Composite/Nested Resources

I'm trying to wrap my head around the best way to address concepts in a REST based API. Flat resources that don't contain other resources are no problem. Where I'm running into trouble are the complex resources. For instance, I have a resource for a…
jgerman
  • 2,161
  • 3
  • 13
  • 10
186
votes
17 answers

How to get a path to a resource in a Java JAR file

I am trying to get a path to a Resource but I have had no luck. This works (both in IDE and with the JAR) but this way I can't get a path to a file, only the file contents: ClassLoader classLoader =…
noripcord
  • 3,412
  • 5
  • 29
  • 26
182
votes
14 answers

Android, getting resource ID from string?

I need to pass a resource ID to a method in one of my classes. It needs to use both the id that the reference points to and also it needs the string. How should I best achieve this? For example: R.drawable.icon I need to get the integer ID of this,…
Hamid
  • 4,410
  • 10
  • 43
  • 72
180
votes
6 answers

How do you obtain a Drawable object from a resource id in android package?

I need to get a Drawable object to display on an image button. Is there a way to use the code below (or something like it) to get an object from the android.R.drawable.* package? for example if drawableId was…
Blaskovicz
  • 6,122
  • 7
  • 41
  • 50
172
votes
27 answers

What does MissingManifestResourceException mean and how to fix it?

The situation: I have a class library, called RT.Servers, containing a few resources (of type byte[], but I don't think that's important) The same class library contains a method which returns one of those resources I have a simple program (with a…
Timwi
  • 65,159
  • 33
  • 165
  • 230
168
votes
6 answers

DisplayName attribute from Resources?

I have a localized application, and I am wondering if it is possible to have the DisplayName for a certain model property set from a Resource. I'd like to do something like this: public class MyModel { [Required] …
Palantir
  • 23,820
  • 10
  • 76
  • 86
166
votes
12 answers

How can I access a folder inside of a resource folder from inside my jar File?

I have a resources folder/package in the root of my project, I "don't" want to load a certain File. If I wanted to load a certain File, I would use class.getResourceAsStream and I would be fine!! What I actually want to do is to load a "Folder"…
Mostafa Zeinali
  • 2,456
  • 2
  • 15
  • 23
164
votes
33 answers

android.view.InflateException: Binary XML file line #12: Error inflating class

I am receiving many errors of kind displayed in the subj. These errors seems to be occasional and I cannot reproduce them. From stack I can learn that such error may occurs for my different layout resources. The line of XML is also varying. Can…
Solvek
  • 5,158
  • 5
  • 41
  • 64
159
votes
26 answers

What is in your Mathematica tool bag?

We all know that Mathematica is great, but it also often lacks critical functionality. What kind of external packages / tools / resources do you use with Mathematica? I'll edit (and invite anyone else to do so too) this main post to include…
Timo
  • 4,246
  • 6
  • 29
  • 42
156
votes
9 answers

References to other resources are not supported by build-time PNG generation

AndroidStudio 3.0 / Android Gradle plugin 3.0 I get this error: references to other resources are not supported by build-time PNG generation Will it be possible to…
langme
  • 1,672
  • 2
  • 9
  • 18
150
votes
6 answers

Correct way to quit a Qt program?

How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: call exit(EXIT_FAILURE) call QApplication::quit() call QCoreApplication::quit() And…
daisy
  • 22,498
  • 29
  • 129
  • 265