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
1436
votes
214 answers

What is the single most influential book every programmer should read?

If you could go back in time and tell yourself to read a specific book at the beginning of your career as a developer, which book would it be? I expect this list to be varied and to cover a wide range of things. To search: Use the search box in the…
NotMyself
  • 29,209
  • 17
  • 56
  • 74
787
votes
27 answers

Should I use Singular or Plural name convention for REST resources?

Some RESTful services use different resource URIs for update/get/delete and Create. Such as Create - using /resources with POST method (observe plural) at some places using /resource (singular) Update - using /resource/123 with PUT method Get -…
JPReddy
  • 63,233
  • 16
  • 64
  • 93
668
votes
17 answers

Android: How do I get string from resources using its name?

I would like to have 2 languages for the UI and separate string values for them in my resource file res\values\strings.xml: Books Quotes
Ivan
  • 6,388
  • 3
  • 24
  • 30
572
votes
34 answers

Change app language programmatically in Android

Is it possible to change the language of an app programmatically while still using Android resources? If not, is it possible to request a resource in an specific language? I would like to let the user change the language of the app from the app.
hpique
  • 119,096
  • 131
  • 338
  • 476
568
votes
14 answers

Should a RESTful 'PUT' operation return something....

I was wondering what people's opinions are of a RESTful PUT operation that returns nothing (null) in the response body.
AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152
524
votes
8 answers

What's the difference between StaticResource and DynamicResource in WPF?

When using resources such as brushes, templates and styles in WPF, they can be specified either as StaticResources or as a DynamicResource
Isak Savo
  • 34,957
  • 11
  • 60
  • 92
413
votes
17 answers

How to read text file from classpath in Java?

I am trying to read a text file which is set in CLASSPATH system variable. Not a user variable. I am trying to get input stream to the file as below: Place the directory of file (D:\myDir) in CLASSPATH and try below: InputStream in =…
Chaitanya MSV
  • 6,706
  • 12
  • 40
  • 46
347
votes
15 answers

Reading a resource file from within jar

I would like to read a resource from within my jar like so: File file; file = new File(getClass().getResource("/file.txt").toURI()); BufferedReader reader = new BufferedReader(new FileReader(file)); //Read the file and it works fine when running…
Koi
  • 3,573
  • 3
  • 13
  • 5
326
votes
16 answers

Get a list of resources from classpath directory

I am looking for a way to get a list of all resource names from a given classpath directory, something like a method List getResourceNames (String directoryName). For example, given a classpath directory x/y/z containing files a.html,…
Marat Salikhov
  • 6,367
  • 4
  • 32
  • 35
277
votes
24 answers

Read resource text file to String in Java

Is there a way to read a text file in the resource into a String? I suppose this is a popular requirement, but I couldn't find any utility after Googling.
Loc Phan
  • 4,304
  • 4
  • 29
  • 35
274
votes
12 answers

Add floating point value to android resources/values

I'm trying to add a little space between lines to my TextViews using android:lineSpacingMultiplier from the documentation: Extra spacing between lines of text, as a multiplier. Must be a floating point value, such as "1.2". As I'm using this…
slup
  • 5,484
  • 4
  • 19
  • 14
263
votes
9 answers

Scala Programming for Android

I have followed the tutorial at Scala and Android with Scala 2.7.3 final. The resulting Android App works but even the most basic application takes several minutes (!) to compile and needs 900 kb compressed, which is a show stopper for mobile…
Lemmy
  • 3,177
  • 3
  • 17
  • 16
252
votes
27 answers

getResourceAsStream returns null

I'm loading a text file from within a package in a compiled JAR of my Java project. The relevant directory structure is as follows: /src/initialization/Lifepaths.txt My code loads a file by calling Class::getResourceAsStream to return a…
user1131435
243
votes
17 answers

Get OS-level system information

I'm currently building a Java app that could end up being run on many different platforms, but primarily variants of Solaris, Linux and Windows. Has anyone been able to successfully extract information such as the current disk space used, CPU…
Steve M
  • 10,517
  • 12
  • 52
  • 63
239
votes
1 answer

What is the JSF resource library for and how should it be used?

The JSF , and components have a library attribute. What is this and how should this be used? There are a lot of examples on the web which use it as follows with the common content/file type css,…
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
1
2 3
99 100