resources

How do I refer to an image resource from CSS in grails?

久未见 提交于 2019-12-21 03:43:27
问题 I want to refer to an image in my main stylesheet for a Grails app and I can't get it to work. My image lives in the standard location in my Grails app... project\web-app\images\outbound-blue.png In my stylesheet I want to use it as a background image for a class... .messageimg { height:17px; width:16px; background-image:url(images/outbound-blue.png); background-repeat:no-repeat; } This doesn't work for some reason. My stylesheet is in the normal location too, i.e. project\web-app\css\main

Properly disposing of browser resources

烈酒焚心 提交于 2019-12-21 03:32:45
问题 I have a web application which dynamically loads in data over a long period of time. Within the data there are links to images which are then rendered in the browser. e.g. var object = { Name: ko.observable("Foo"), Ref: ko.observable("Bar"), ImageUrl: ko.observable("http://.....") } I am using Knockoutjs 's template binding to render the data on the screen. <img data-bind="attr: { src: imageUrl }" /> So every time the object changes via an Ajax call, the Knockoutjs template is re-rendered

Android: How to re-use strings in multi-language resources

旧巷老猫 提交于 2019-12-21 02:48:09
问题 This one puzzles me since my first android project. Consider multi-language string resources with 'en' as the default: res/values/strings.xml <--- The default language 'en' res/values-de/strings.xml <--- de res/values-fr/strings.xml <--- fr res/values-it/strings.xml <--- it With that folder structure the Android Market entry for this app shows language support for "default, german, french and italian only". Yes, english is missing in that list. Is it possible to "include" the complete default

C#: Change the resource file without re-building?

断了今生、忘了曾经 提交于 2019-12-21 02:20:14
问题 For an Asp.Net MVC 3 application, I will use resources files to store my I18N( How-to ). It's not me which will translate all fields in all language, I juste have to create in one language and create empty language files for the two other language. And in the implementation I will use those three files. So for the development I've not any problem, but after I've created the website, it's the customer which will translate all those fields. I found a great app which allows to translate from one

JSF1064 “Unable to find or serve resource” warning on jsf 2.0

我怕爱的太早我们不能终老 提交于 2019-12-20 23:31:14
问题 I'm working on an Enterprise project with Java EE 5 and JSF 2.0 (Mojarra 2.0.3) on Weblogic 10.3.3 I don't have an error, but a very annoying warning in my console when going through my application. Whenever I perform a redirect in JSF, I get a warning in my console of the following form: Nov 7, 2011 5:36:46 PM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource WARNING: JSF1064: Unable to find or serve resource, images/jquery-theme/ui-icons_cc0000_256x240.png. Nov 7,

Should we store format strings in resources?

自闭症网瘾萝莉.ら 提交于 2019-12-20 17:39:27
问题 For the project that I'm currently on, I have to deliver specially formatted strings to a 3rd party service for processing. And so I'm building up the strings like so: string someString = string.Format("{0}{1}{2}: Some message. Some percentage: {3}%", token1, token2, token3, number); Rather then hardcode the string, I was thinking of moving it into the project resources: string someString = string.Format(Properties.Resources.SomeString, token1, token2, token3, number); The second option is in

How to find View from string instead of R.id

前提是你 提交于 2019-12-20 17:26:22
问题 Let's assume I have this in layout of res in my app <TextView android:id="@+id/titleText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/app_name" android:textColor="#ffffffb0" android:padding="5px" /> In my activity, I get the TextView using this command TextView tv = (TextView)findViewById(R.id.titleText); But I am looking for another method like this TextView tv = (TextView)findViewByString("R.id."+"titleText"); because I need to enumerate

Android: converting between Strings, SpannedStrings and Spannablestrings

点点圈 提交于 2019-12-20 17:03:13
问题 I have a string resource called "foo". It may be a simple string... or it may contain HTML. This may change over time: I should be able to box it up as at least a SpannableString immediately upon reading whether it's HTML or not ( but how?? ) I want to get that raw CharSequence and first be able to display it as-is (the exact characters, not Android's "interpretation" of it). Right now I can't do that... toString() decides to rip out the parts it doesn't think I want to see. I'd then like to

WinForms strings in resource files, wired up in designer

穿精又带淫゛_ 提交于 2019-12-20 12:40:36
问题 I'm trying to localise a WinForms app for multiple languages. I'm trying to find a way to set my form labels/buttons text properties to read from the resources file in the designer (rather than having to maintain a chunk of code that sets them programatically). I've found I can set form.Localizable=true, but then the resources are read from a file alongside the form, but many of mine are shared across multiple forms. Is there any way to set a label's text in the designer, to a value stored in

Create a control in Resources and reuse it in XAML WPF

☆樱花仙子☆ 提交于 2019-12-20 11:22:29
问题 I just try to create a simple Symbol/Geometry/Control and change and reuse it in several places in the same window. Example: a black square with a circle in the middle. The circle should then change between red and green (similar to a one-light stoplight). Doing it with images would work. I try to solve it as a Window resource, but I do not unterstand. The idea: I write it into a resource, here I try into a Canvas: <Window.Resources> <Canvas x:Key="Ampel"> <Rectangle Fill="Black"