resources

How to combine imported and local resources in WPF user control

让人想犯罪 __ 提交于 2019-12-18 10:02:11
问题 I'm writing several WPF user controls that need both shared and individual resources. I have figured out the syntax for loading resources from a separate resource file: <UserControl.Resources> <ResourceDictionary Source="ViewResources.xaml" /> </UserControl.Resources> However, when I do this, I cannot also add resources locally, like: <UserControl.Resources> <ResourceDictionary Source="ViewResources.xaml" /> <!-- Doesn't work: --> <ControlTemplate x:Key="validationTemplate"> ... <

IntelliJ hot swapping classes, but not JSF pages

偶尔善良 提交于 2019-12-18 09:38:13
问题 First of all, I would like to say that there is plenty of pages on StackOverflow and I tried all I found related, but I am doing something wrong. I have IntelliJ server set up to: server Tomcat 8 JDK 8u65 Maven IntelliJ 14 In Run/Debug configuration I have set VM Options: On Update action: Update resources On frame deactivation: Update classes and resources Before launch: Build xxx.war exploded Deployment tab set to deploy xxx.war exploded If I change the body of any class (e.g.returned value

Default segment name in rails resources routing

三世轮回 提交于 2019-12-18 08:59:04
问题 I want to create a route in my rails application along the lines of /panda/blog /tiger/blog /dog/blog where panda, tiger, and dog are all permalinks (for an animal class) The normal way of doing this map.resources :animals do |animal| animal.resource :blog end would create routes along the lines of /animals/panda/blog /animals/tiger/blog /animals/dog/blog But i do not want the first segment, as it will always be the same. I know I could do this by manual routing, but I want to know how to do

Android: targeted res folders for debugging in eclipse

左心房为你撑大大i 提交于 2019-12-18 08:00:07
问题 I have a project which I have a number of different branded versions, with two different res folders. ie. res-customer1, res-customer2 Using Maven build profiles I can easily build the project using the specified res folder. However when it comes to eclipse its another story. What I want to do is to have a setting so that I can specify the res folder that I want, whilst debugging in eclipse. Anyone know how I can do this? My current work around is to copy the res-customer1 folder into the res

Setting an Android Notification Icon to a remote URL

情到浓时终转凉″ 提交于 2019-12-18 07:38:21
问题 I want to use a remote URL (like a favicon) for a notification icon, however the constructor for a notification accepts only a resource ID (which is an integer) instead of something more useful like a FileInputStream . How can I either define a new resource for a stream source download an icon, add to my resources, and then dynamically get an ID? 回答1: You can't do this in Android currently, because resources can only be loaded from the /res/ directory of your APK. See Resources and

How can I retrieve an embedded xml resource?

安稳与你 提交于 2019-12-18 06:16:15
问题 I added an XML file as an embedded resource in my class library by using the accessing the project properties in Visual Studio and then Resources | Add Resource | Add Existing File... I've tried to access the file using the following code, but I keep getting a null reference returned. Anyone have any ideas? var path = Server.MapPath("~/bin/MyAssembly.dll"); var assembly = Assembly.LoadFile(path); var stream = assembly.GetManifestResourceStream("MyNamespace.filename.xml"); 回答1: The MSDN page

How to locate resources in Orchard

瘦欲@ 提交于 2019-12-18 06:06:40
问题 I am writing an Orchard theme, and I'd like to be able to locate some of the resources packaged with the theme (images/swfs etc). What is the best way of doing this? I've had a look at ResourceManifest files, using builder.Add.DefineResource but I can't seem to find it's counterpart in the view. Or do I just put the full path in? Any hints? Cheers Carl 回答1: In stylesheets, relative paths (from the stylesheet path) should be used. In views, you should use Url.Content. 回答2: If you need to

Windows PE Resources

こ雲淡風輕ζ 提交于 2019-12-18 05:58:08
问题 there are many windows PE resource viewers programs. But how do they work? Do they decode function calls to winapi, or does PE have some section for GUI information? Like Android has XML GUI definitons? Thanks. 回答1: There are probably different implementation strategies, so it's not possible to answer this universally for all tools. The PE file format specification is publicly available. It specifies the section structure of a PE file, how to find the .rsrc section in the file, and how to

How to use image resource in asp.net website?

时光怂恿深爱的人放手 提交于 2019-12-18 05:49:04
问题 I have a c# site which makes use of a lot of images with embedded english text. How can I use a standard resource file to swap out images depending on the language? I have a resx file in my App_GlobalResources directory, but I can't seem to get it plugged into an asp:image control for the imageurl correctly. Ideas? UPDATE: For some further information, here is the image tag code: <asp:image runat="server" ID="img2" ImageUrl="<%$Resources: Resource, cs_logo %>" /> The result on the client side

Spring get files and images from external folder on disk, outside webapps?

99封情书 提交于 2019-12-18 05:11:09
问题 I have webproject which has images inside src/main/webapp folder. I would like to place images in different folder on the disk. But I have no idea how to manage requests to reach this images. Should I create some kind of httpServlet like shown here: http://balusc.omnifaces.org/2007/07/fileservlet.html Or as I use Spring MVC with java configuration, there is more suitable and simpler way. Looking forward for your suggestions. 回答1: Use the spring mvc support for static resources, its location