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
42
votes
5 answers

Spring 3.0 inject files as resources

In my Spring 3.0 app, I have some resources in /WEB-INF/dir. At runtime I need some of them as an InputStream (or some other type). How can I retrieve them? Is it possible to inject them as a normal Resource?
Randomize
  • 8,651
  • 18
  • 78
  • 133
41
votes
2 answers

How to reference JSF image resource as CSS background image url

I often, change the images of my buttons using the image attribute, but someone told me that it is a good practice to do it using .css I tried but i cant, what i am doing wrong? This is what i did: 1-The resources of my project are stored like…
javing
  • 12,307
  • 35
  • 138
  • 211
41
votes
4 answers

Class.getResource and ClassLoader.getSystemResource: is there a reason to prefer one to another?

I saw both Class.getResource and ClassLoader.getSystemResource used to locate a resource in Java. Is there any reason to prefer one to another?
vitaut
  • 49,672
  • 25
  • 199
  • 336
41
votes
14 answers

Genetic algorithm resource

Lately I'm interested in the topic of genetic algorithms, but I couldn't find any good resource. If you know any good resource, book or a site I would appreciate it. I have solid knowledge of algorithms and Artificial Intelligence but I'm looking…
Siblja
  • 859
  • 2
  • 12
  • 19
41
votes
5 answers

Maven (Surefire): copy test resources from src/test/java

Maven's Surefire (testing) pluginmvn test-compile copies files in src/test/resources to target/test-classes. It compiles .java in src/test/java, and copies the compiled .class files to target/test-classes. But it doesn't copy resources from…
tpdi
  • 34,554
  • 11
  • 80
  • 120
41
votes
3 answers

Android compiled resources - resources.arsc

I am trying to figure out what it mean to "compile resources". What I did in order to understand this issue: I have read many articles about the subject but didn't find a simple answer. The best one I have read was this: How does the mapping between…
ZiviMagic
  • 1,034
  • 2
  • 10
  • 25
41
votes
4 answers

Free Large datasets to experiment with Hadoop

Do you know any large dataset to experiment with Hadoop which is free/low cost? Any pointers/links related are appreciated. Preference: At least one GB of data. Production log data of webserver. Few of them which I found so far: Wikipedia…
Sundar
  • 1,204
  • 1
  • 14
  • 17
40
votes
4 answers

Get path of Android resource

My question is: is it possible to get the absolute path of a resource (in a subdirectory of the res/ folder) in Android? Most of the answers I see to this question on google suggest getting a file descriptor, implying that this is not possible. Is…
Prime
  • 4,081
  • 9
  • 47
  • 64
40
votes
8 answers

VC++ resources in a static library

Is it possible to build resources into a static library and reuse them by simply linking with the library? I'm primarily thinking about the case where you call a function in the library which in turn accesses resources.
sharkin
  • 12,162
  • 24
  • 86
  • 122
40
votes
1 answer

Access resource files in Android

I have a resource file in my /res/raw/ folder (/res/raw/textfile.txt) which I am trying to read from my android app for processing. public static void main(String[] args) { File file = new File("res/raw/textfile.txt"); FileInputStream…
Selzier
  • 101
  • 1
  • 6
  • 19
40
votes
5 answers

Where can I obtain an English dictionary with structured data?

I would like to download an English dictionary -- not just a word list -- in a structured format such as TXT, XML, or SQL. Specifically, I need phonetic pronunciation and parts of speech (definition is not required). Surprisingly, I can't find this…
Portman
  • 31,785
  • 25
  • 82
  • 101
40
votes
8 answers

Using HTML inside resource files

I am developing a standard small ASP.NET MVC website which will be made multilingual using ASP.NET resource files. My question is about the resource files. See if you have a block of text which should be shown in paragraphs, is it appropriate to add…
Peter
  • 14,221
  • 15
  • 70
  • 110
40
votes
4 answers

How do I make a PNG resource?

I've got a form with a large TImage on it as a background. Problem is, this is stored directly in the DFM as a bitmap, which takes up about 3 MB. The original PNG file is ~250K. I'd like to try to reduce bloat by embedding the PNG in a resource,…
Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
40
votes
3 answers

Using IDisposable object in method that returns IEnumerable

Imagine you have a method that internally uses an IDisposable object (for example a streamreader), and yield returns items as they are read from the file. Like this: public IEnumerable Read(string filename) { using(var filestream =…
Thomas
  • 7,933
  • 4
  • 37
  • 45
39
votes
3 answers

WebView, add local .CSS file to an HTML page?

In android I'm using WebView to display a part of a webpage which I fetched from the internet using HttpClient from Apache. To only have the part I want from the html, I use Jsoup. String htmlString = EntityUtils.toString(entity4); // full html as a…
user717572
  • 3,626
  • 7
  • 35
  • 60