resources

Accessing and using .jsf files from the database

允我心安 提交于 2020-01-02 07:06:23
问题 What is the best way to enable my webapplication to use JSF files stored in the database? I'd like to be able to dynamically (during runtime) create new JSF pages which will be made available without having to redeploy the application. So in other words: I would like to store the bigger part of my JSF pages in the database and would like JSF to use the database as a datasource for getting JSF files. I've thought long about a solution and found some possible ways. However, I haven't been able

Accessing and using .jsf files from the database

左心房为你撑大大i 提交于 2020-01-02 07:06:06
问题 What is the best way to enable my webapplication to use JSF files stored in the database? I'd like to be able to dynamically (during runtime) create new JSF pages which will be made available without having to redeploy the application. So in other words: I would like to store the bigger part of my JSF pages in the database and would like JSF to use the database as a datasource for getting JSF files. I've thought long about a solution and found some possible ways. However, I haven't been able

Why setImageResource displays nothing?

余生颓废 提交于 2020-01-02 06:11:11
问题 I would like to display an icon in my ListView depending on the database value. I follow this answer to do so. But in result nothing is displayed. Here is what I have in my row.xml : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:id="@+id/movie_subscribed_icon" android:padding="3dip" android:layout_width="wrap_content" android:layout_height=

How to properly implement a finalizer for detecting resource leaks in Java

此生再无相见时 提交于 2020-01-02 04:35:11
问题 Let's say I have created some resource class with a close() method for cleaning up the resource, and I want to override finalize() to free the resource (and print a warning) if someone has forgotten to call close(). How can this be done properly? Is it recommended only for native (JNI-allocated) resources? What happens if you use a reference to another object that has been finalized, from a finalizer? If there are cyclic dependencies I don't see how the garbage collector can prevent you from

c++ modify resources at runtime

狂风中的少年 提交于 2020-01-02 03:12:23
问题 Is it possible to edit resources for an executable at runtime programmatically? If so, how? If not, is there another program that can easily be used to modify resources? Thanks, Derek. 回答1: Yes, it is possible, though not especially easy. It basically requires writing a resource compiler (at least for the resource types you want to modify). For example I once wrote a menu compiler that took its input out of a database at run-time (at then saved the result back to the DB). If the source tables

Android strings.xml resource - arabic language and dynamic formatted strings

烈酒焚心 提交于 2020-01-02 02:19:06
问题 Hello I have a question about arabic formatting how should I properly format this strings, it seems i can't manage this: تحميل %1$s… تم تحميل الكلمات. %1$d/%2$d! This is in sublime text 2 - but i think that there is Left-to-Right order EDITED: In Eclipse this copied from Sublime Text gets messed up a little. I hire some person to translate from english to arabic strings.xml. He used Word editor but things get messed up when coping to eclipse and I suggested to changed it in Sublime Text, that

How to check Android Asset resource?

点点圈 提交于 2020-01-02 01:19:07
问题 I want to check, whether a file exists or not in the /assets/ folder. How could I do it? Please help. 回答1: You have to perform your own checks. As I know, there is no method for this job. 回答2: I added a helper method to one of my application classes. I'm assuming that; the list of assets doesn't change while the app is running. the List<String> isn't a memory hog (only 78 assets in my app). checking exists() on the List is faster than trying to open a File and handle an exception (I haven't

Can't load resources file from jar

倾然丶 夕夏残阳落幕 提交于 2020-01-01 19:18:31
问题 I'm using configuration JSON file stored in src/test/resources/config.json . I'm getting it like this: String configFile = this.getClass().getResources("config.json").getPath(); I have getPath() method, because I need its String value, then check if file exists and finally parse it. In Eclipse IDE everything works fine, because I parse file /bin/config/config.json , but when I create JAR file, the path is program.jar!/config/config.json and function !Files.exists() returns false. How can i

iTextSharp - How to input image (PNG) from project resource?

耗尽温柔 提交于 2020-01-01 15:56:08
问题 I have iTextSharp creating a pdf for me in VB.net. Everything was working famously, except now I want to embed an image. I tried this: Dim test = My.Resources.MyImage Dim logo = Image.GetInstance(test) This an error though: 'GetInstance' cannot be called with these arguments It appears as though it expects a path, and is getting a System.Drawing.Bitmap type. Is there any way that I can add a project resource image to my PDF? Thanks in advance! 回答1: One of the overloads for iTextSharp.text

Create your own system colors

倾然丶 夕夏残阳落幕 提交于 2020-01-01 14:23:46
问题 Basically, how can I create my own set of Colors in a static class or the such so that I can do something like this: What exists : <Setter ... Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/> What I want : <Setter ... Value="{DynamicResource {x:Static MyColors.Color1}}"/> 回答1: Resource Keys can be anything, so you can use a Color as a key and value at the same time: public static class MyColors { static MyColors() { App.Current.Resources.Add(MyHighlightColorKey,