resources

Where to put Application level resources in a mixed WinForms + WPF application.

At present we host a number of WPF controls in a WinForms application. I would like to create a number of global resources at the application level, where is the best place to do this? If this were a straight WPF application I'd put them in them App.xaml but we never create a System.Windows.Application, the controls just go into the Win...

Load GIF from Resource to Dynamic form.

Hi, I have this piece of code: SELDR_WH := FindControl(FindWindow(nil,'PhoneDB Filtering')) as TForm; if seldr_wh <> nil then begin SELDR_WH.ClientHeight := SELDR_WH.ClientHeight + 20; gif := TGIFImage.Create; with gif do begin Parent := SELDR_WH; Top := SELDR_WH.ClientHeight - 20; Left := 30; try ...

Read a file from a resource and write it to disk in C#

I have some files, which are embedded in a resource. How can I save these files on disk via C#? ...

Managing restful resources in Rails 3

I am trying to convert my Rails 2 app to Rails 3, but I can't delete any resources using my old Rails 2 code. To be precise I am trying to delete a resource, using this link: <%= link_to image_tag("misc/delete.png"), @book, :confirm => 'Are you sure?', :method => :delete %> And yet it doesn't work at all! It just behaves as if the :co...

How to create custom URI handler to retreive image resources in DLL file?

Hi! I have several image filés embedded as resources in a DLL file! I want to create my own custom protocol handler to be able to write HTML code to access these resources. For example, on a computer where this DLL is located i want to be able to (in IE) run HTML code like this: < IMG SRC="customuri://res/image01.jpg"/ > This should ...

Windows resource editor from linux (without using wine)

Is there some resource editor for windows executables I could run from a CentOS box? Something like Resource hacker, that allows to update icon and fileversion. But I don't want to install wine because it's not my server and I want to change much. I would like to run it from a .py script so anything that works from a terminal will do....

Is there a tutorial for Ruby programmers who want to learn Perl?

I'm a Ruby developer (bioinformatics analysis, haven't done Ruby on Rails for a couple of years), and in my spare time I've been given responsibility for a very simple Perl-based website. Although there are plenty of resources that teach Perl, I'm hoping for something aimed at Ruby programmers, so that I can take advantage of the simila...

Which edition of Art of Computer Programming should I buy?

I want to purchase Knuth's Art of Computer Programming but I'm unsure of which edition to buy. What's the latest edition? Should I go with the latest edition or is another edition better? ...

What's more resource intensive? PHP or Python?

Hey all, My current web host allows for up to 25 processes running at once. From what I can figure, Python scripts take up a spot in processes, but PHP doesn't? I get a 500 error if more than 25 processes are running at once (unlikely, but still a hassle), so I was wondering if it would be easier on the server if I were to port my sit...

RESTful Rails Put/Post fail problem

So using Rails' REST resources routing, we end up with auto-generated routes that coordinate with Controller actions (I'll refrain from ranting about how I've replicated models twice, as well as relationships twice (as models and then as (often) nested resources; as well as actions twice (as I limit my resources with onlys/excepts where ...

Android raw resource can't be found

Hi, I'm using a raw resource by creating a folder res/raw/myfile and then using the code InputStream is = Resources.getSystem().openRawResource(R.raw.myfile); This code throws a resource not found exception and in the logs it says "resources don't contain package for resource number 0x7f04000" The code I used above is by my guess the ...

PHP memory_get_usage

Hello! I came across the PHP's memory_get_usage() and memory_get_peak_usage(). the problem is that I found that these two functions do not provide the real memory used by the current script. My test script is: <?php echo memory_get_usage(); echo '<br />'; $a = str_repeat('hello', 100000); echo '<br />'; echo memory_get_usage(); ...

loading resource file in class library and know which resource file to use

I have a class library and was to add a resource file to it to support both English and Spanish. Any tips as how I can do this? The language will be dictated by the user visiting the site. Would like to have to only load each resource file once and cache or set in static variable and avoid any overheads. ...

Loading an image from resource and converting to bitmap in memory

I've searched around using google but I'm completely confused on how to load an image (PNG in my case) from resource and then converting it to a bitmap in memory for use in my splash screen. I've read about GDI+ and libpng but I don't really know how to do what I want. Could anyone help? ...

What language resource files are used in different programming languages/frameworks?

As the question suggests, I would like to know as many different language resource file name & formats as possible based on the programming language. For example, in .net we have the .resx files in an XML format. Thank you ...

Adding a drawable resource

This must be something I’m just overlooking or possibly my ADT install is out of date. When I attempt to add a new drawable resource to my project I don’t see a type of Drawable in the “New Android XML file dialog.” Here’s what I see when adding a resource: http://img221.imageshack.us/img221/2977/drawable.jpg What am I missing here? ...

Rendering different controller actions in Rails when using resource-oriented controllers

Say I'm making a Q&A site like StackOverflow. I have two resources: Question and Answer. I'm using default Rails RESTful resource routes, so each resource has its own controller and methods for creating it. In the /questions/show view, I want to allow the user to submit an answer for the particular question. The form will POST to /answe...

Resources seem not to be copied to iPhone

I've created a prototype app which uploads a bunch of photos to a webserver. Everything works fine in the simulator. But when I want to try it on an actual device it does not find the images. I've included them under the resources group in Xcode. Anyone? Best –f ...

How do I use a macro in the data portion of a resource script?

I have the following macros header file (system.h), #define rt_metadata 8000 #define dir_metadata "db\metadata" and resource file (system.db.metadata.rc) #include "system.h" SY_ALLOWDATE rt_metadata db\metadata\SY.AllowDate.xml How do I replace the db\metadata with dir_metadata in the resource file so that it will become some...

How can I use xml resource file as url.

I have to use one API with params like XYS(LPWSTR UrlOfXmlFile); This API is exposed from a third party COM dll. Now I want to call this api with a url of xml file .This works fine when user is online. But if user if offline then I want to embed xml file as resource in VC++ with some values and want to pass this xml file as url to t...