Search Results

Search found 6533 results on 262 pages for 'resource leak'.

Page 4/262 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • C++ static array leading to memory leak?

    - by MDonovin
    Lets say I have something like... void foo() { char c[100]; printf("this function does nothing useful"); } When foo is called, it creates the array on the stack, and when it goes out of scope, is the memory deallocated automatically? Or is c destroyed, but the memory remains allocated, with no way to access it/get it back except restarting the computer?

    Read the article

  • wpf Image resources and visual studio 2010 resource editor

    - by Berryl
    Hello My motivation for this question is really just to specify an image to be used in a user control via a dependency property for ImageSource. I'm hitting some pain points involving the management, access, and unit testing for this. Is the resource editor a good tool to use to maintain images for the application? What is the best way to translate the Bitmap from the editor to an ImageSource? How can I grab the resource Filename from the editor? Cheers, Berryl

    Read the article

  • How to assign WPF resources to other resource tags

    - by Tom
    This is quite obscure, I may just be missing something extremely simple. Scenario 1 Lets say I create a gradient brush, like this in my <Window.Resources> section: <LinearGradientBrush x:Key="GridRowSelectedBackBrushGradient" StartPoint="0,0" EndPoint="0,1"> <GradientStop Color="#404040" Offset="0.0" /> <GradientStop Color="#404040" Offset="0.5" /> <GradientStop Color="#000000" Offset="0.6" /> <GradientStop Color="#000000" Offset="1.0" /> </LinearGradientBrush> Then much later on, I want to override the HighlightBrushKey for a DataGrid. I have basically done it like this (horrible); <LinearGradientBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" GradientStops="{Binding Source={StaticResource GridRowSelectedBackBrushGradient}, Path=GradientStops}" StartPoint="{Binding Source={StaticResource GridRowSelectedBackBrushGradient}, Path=StartPoint}" EndPoint="{Binding Source={StaticResource GridRowSelectedBackBrushGradient}, Path=EndPoint}" /> This is obviously not the most slick way of referencing a resource. I also came up with the following problem, which is almost identical. Scenario 2 Say I created two colors in my <Window.Resources> markup, like so: <SolidColorBrush x:Key="DataGridRowBackgroundBrush" Color="#EAF2FB" /> <SolidColorBrush x:Key="DataGridRowBackgroundAltBrush" Color="#FFFFFF" /> Then later on, I want to supply them in an Array, which feeds the ConverterParameter on a Binding so I can supply the custom Converter with my static resource instances: <Setter Property="Background"> <Setter.Value> <Binding RelativeSource="{RelativeSource Mode=Self}" Converter="{StaticResource BackgroundBrushConverter}"> <Binding.ConverterParameter> <x:Array Type="{x:Type Brush}"> <SolidColorBrush Color="{Binding Source={StaticResource DataGridRowBackgroundBrush}, Path=Color}" /> <SolidColorBrush Color="{Binding Source={StaticResource DataGridRowBackgroundAltBrush}, Path=Color}" /> </x:Array> </Binding.ConverterParameter> </Binding> </Setter.Value> </Setter> What I've done is attempt to rereference an existing resource, but in my efforts I've actually recreated the resource, and bound the properties so they match. Again, this is not ideal. Because I've now hit this problem at least twice, is there a better way? Thanks, Tom

    Read the article

  • hook up resource manager in windows form

    - by peterchen0303
    In Visual Studio 2008, develop legacy windows form (not wpf), I wrote customized resource manager which fetched data from sql server rather than assembly. In windows form, there is property related to language setting. Once I change language, I want to form being updated automatically. Is there any elegant way to hook up my resource manager?

    Read the article

  • Getting a Web Resource Url in non WebForms Applications

    - by Rick Strahl
    WebResources in ASP.NET are pretty useful feature. WebResources are resources that are embedded into a .NET assembly and can be loaded from the assembly via a special resource URL. WebForms includes a method on the ClientScriptManager (Page.ClientScript) and the ScriptManager object to retrieve URLs to these resources. For example you can do: ClientScript.GetWebResourceUrl(typeof(ControlResources), ControlResources.JQUERY_SCRIPT_RESOURCE); GetWebResourceUrl requires a type (which is used for the assembly lookup in which to find the resource) and the resource id to lookup. GetWebResourceUrl() then returns a nasty old long URL like this: WebResource.axd?d=-b6oWzgbpGb8uTaHDrCMv59VSmGhilZP5_T_B8anpGx7X-PmW_1eu1KoHDvox-XHqA1EEb-Tl2YAP3bBeebGN65tv-7-yAimtG4ZnoWH633pExpJor8Qp1aKbk-KQWSoNfRC7rQJHXVP4tC0reYzVw2&t=634533278261362212 While lately excessive resource usage has been frowned upon especially by MVC developers who tend to opt for content distributed as files, I still think that Web Resources have their place even in non-WebForms applications. Also if you have existing assemblies that include resources like scripts and common image links it sure would be nice to access them from non-WebForms pages like MVC views or even in plain old Razor Web Pages. Where's my Page object Dude? Unfortunately natively ASP.NET doesn't have a mechanism for retrieving WebResource Urls outside of the WebForms engine. It's a feature that's specifically baked into WebForms and that relies specifically on the Page HttpHandler implementation. Both Page.ClientScript (obviously) and ScriptManager rely on a hosting Page object in order to work and the various methods off these objects require control instances passed. The reason for this is that the script managers can inject scripts and links into Page content (think RegisterXXXX methods) and for that a Page instance is required. However, for many other methods - like GetWebResourceUrl() - that simply return resources or resource links the Page reference is really irrelevant. While there's a separate ClientScriptManager class, it's marked as sealed and doesn't have any public constructors so you can't create your own instance (without Reflection). Even if it did the internal constructor it does have requires a Page reference. No good… So, can we get access to a WebResourceUrl generically without running in a WebForms Page instance? We just have to create a Page instance ourselves and use it internally. There's nothing intrinsic about the use of the Page class in ClientScript, at least for retrieving resources and resource Urls so it's easy to create an instance of a Page for example in a static method. For our needs of retrieving ResourceUrls or even actually retrieving script resources we can use a canned, non-configured Page instance we create on our own. The following works just fine: public static string GetWebResourceUrl(Type type, string resource ) { Page page = new Page(); return page.ClientScript.GetWebResourceUrl(type, resource); } A slight optimization for this might be to cache the created Page instance. Page tends to be a pretty heavy object to create each time a URL is required so you might want to cache the instance: public class WebUtils { private static Page CachedPage { get { if (_CachedPage == null) _CachedPage = new Page(); return _CachedPage; } } private static Page _CachedPage; public static string GetWebResourceUrl(Type type, string resource) { return CachedPage.ClientScript.GetWebResourceUrl(type, resource); } } You can now use GetWebResourceUrl in a Razor page like this: <!DOCTYPE html> <html <head> <script src="@WebUtils.GetWebResourceUrl(typeof(ControlResources),ControlResources.JQUERY_SCRIPT_RESOURCE)"> </script> </head> <body> <div class="errordisplay"> <img src="@WebUtils.GetWebResourceUrl(typeof(ControlResources),ControlResources.WARNING_ICON_RESOURCE)" /> This is only a Test! </div> </body> </html> And voila - there you have WebResources served from a non-Page based application. WebResources may be a on the way out, but legacy apps have them embedded and for some situations, like fallback scripts and some common image resources I still like to use them. Being able to use them from non-WebForms applications should have been built into the core ASP.NETplatform IMHO, but seeing that it's not this workaround is easy enough to implement.© Rick Strahl, West Wind Technologies, 2005-2011Posted in ASP.NET  MVC   Tweet (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • Reading train stop display names from a resource bundle

    - by Frank Nimphius
    v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0 false false false false EN-US X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";} In Oracle JDeveloper 11g R1, you set the display name of a train stop of an ADF bounded task flow train model by using the Oracle JDeveloper Structure Window. To do so Double-click onto the bounded task flow configuration file (XML) located in the Application Navigator so the task flow diagram open In the task flow diagram, select the view activity node for which you want to define the display name. In the Structure Window., expand the view activity node and then the train-stop node therein Add the display name element by using the right-click context menu on the train-stop node, selecting Insert inside train-stop > Display Name Edit the Display Name value with the Property Inspector Following the steps outlined above, you can define static display names – like "PF1" for page fragment 1 shown in the image below - for train stops to show at runtime. In the following, I explain how you can change the static display string to a dynamic string that reads the display label from a resource bundle so train stop labels can be internationalized. There are different strategies available for managing message bundles within an Oracle JDeveloper project. In this blog entry, I decided to build and configure the default properties file as indicated by the projects properties. To learn about the suggested file name and location, open the JDeveloper project properties (use a right mouse click on the project node in the Application Navigator and choose Project Properties. Select the Resource Bundle node to see the suggested name and location for the default message bundle. Note that this is the resource bundle that Oracle JDeveloper would automatically create when you assign a text resource to an ADF Faces component in a page. For the train stop display name, we need to create the message bundle manually as there is no context menu help available in Oracle JDeveloper. For this, use a right mouse click on the JDeveloper project and choose New | General | File from the menu and in the opened dialog. Specify the message bundle file name as the name looked up before in the project properties Resource Bundle option. Also, ensure that the file is saved in a directory structure that matches the package structure shown in the Resource Bundle dialog. For example, you would save the properties file in the View Project's src > adf > sample directory if the package structure was "adf.sample" (adf.sample.ViewControllerBundle). Edit the properties file and define key – values pairs for the train stop component. In the sample, such key value pairs are TrainStop1=Train Stop 1 TrainStop2=Train Stop 2 TrainStop3=Train Stop 3 Next, double click the faces-config.xml file and switch the opened editor to the Overview tab. Select the Application category and press the green plus icon next to the Resource Bundle section. Define the resource bundle Base Name as the package and properties file name, for example adf.sample.ViewControllerBundle Finally, define a variable name for the message bundle so the bundle can be accessed from Expression Language. For this blog example, the name is chosen as "messageBundle". <resource-bundle>   <base-name>adf.sample.ViewControllerBundle</base-name>   <var>messageBundle</var> </resource-bundle> Next, select the display-name element in the train stop node (similar to when creating the display name) and use the Property Inspector to change the static display string to an EL expression referencing the message bundle. For example: #{messageBundle.TrainStop1} At runtime, the train stops now show display names read from a message bundle (the properties file).

    Read the article

  • Avoiding resource (localizable string) duplication with String.Format

    - by Hrvoje Prgeša
    I'm working on a application (.NET, but not relevant) where there is large potential for resource/string duplication - most of these strings are simple like: Volume: 33 Volume: 33 (dB) Volume 33 dB Volume (dB) Command - Volume: 33 (dB) where X, Y and unit are the same. Should I define a new resource for each of the string or is it preferable to use String.Format to simplify some of these, eg.: String.Format("{0}: {1}", Resource.Volume, 33) String.Format("{0}: {1} {2}", Resource.Volume, 33, Resource.dB) Resource.Volume String.Format("{0} ({1})", 33, Resource.dB) String.Format("{0} ({1})", Resource.Volume, Resource.dB) String.Format("Command - {0}: {1} {2}", Resource.Volume, 33, Resource.dB) I would also define string formats like "{0}: {1}" in the resources so there would be a possibility of reordering words... I would not use this approach selectivly and not throughout the whole application.. And how about: String.Format("{0}: {1}", Volume, Resource.Muted_Volume) // = Volume: Muted Resource.Muted_Volume String.Format("{0}: {1} (by user {2})", Volume, Resource.Muted_Volume, "xy") // = Volume: Muted (by user xy) The advantage is cutting the number of resource by the factor of 4-5. Are there any hidden dangers of using this approach? Could someone give me an example (language) where this would not work correctly?

    Read the article

  • Database Security: The First Step in Pre-Emptive Data Leak Prevention

    - by roxana.bradescu
    With WikiLeaks raising awareness around information leaks and the harm they can cause, many organization are taking stock of their own information leak protection (ILP) strategies in 2011. A report by IDC on data leak prevention stated: Increasing database security is one of the most efficient and cost-effective measures an organization can take to prevent data leaks. By utilizing the data protection, access control, account management, encryption, log management, and other security controls inherent in the database management system, entities can institute first-level control over the widest range of protected information. As a central repository for unstructured data, which is growing at leaps and bounds, the database should be the first layer providing information leakage protection. Unfortunately, most organizations are not taking sufficient steps to protect their databases according to a survey of the Independent Oracle User Group. For example, any operating system administrator or database administrator can access the all the data stored in the database in most organizations. Without any kind of auditing or monitoring. And it's not just administrators, database users can typically access the database with ad-hoc query tools from their desktop and by-pass any application level controls. Despite numerous regulations calling for controls to limit the powers of insiders, most organizations still put too many privileges in the hands of their employees. Time and time again these excess privileges have backfired. Internal agents were implicated in almost half of data breaches according to the Verizon Data Breach Investigations Report and the rate is rising. Hackers also took advantage of these excess privileges very successfully using stolen credentials and SQL injection attacks. But back to the insiders. Who are these insiders and why do they do it? In 2002, the U.S. Secret Service (USSS) behavioral psychologists and CERT information security experts formed the Insider Threat Study team to examine insider threat cases that occurred in US critical infrastructure sectors, and examined them from both a technical and a behavioral perspective. A series of fascinating reports has been published as a result of this work. You can learn more by watching the ISSA Insider Threat Web Conference. So as your organization starts to look at data leak prevention over the coming year, start off by protecting your data at the source - your databases. IDC went on to say: Any enterprise looking to improve its competitiveness, regulatory compliance, and overall data security should consider Oracle's offerings, not only because of their database management capabilities but also because they provide tools that are the first layer of information leak prevention. Learn more about Oracle Database Security solutions and get the whitepapers, demos, tutorials, and more that you need to protect data privacy from internal and external threats.

    Read the article

  • Add collection or array to wpf resource dictionary

    - by Chris Cap
    I've search high and low and can't find an answer to this. I have two questions How do you create an array or collection in XAML. I've got an array I want to stick in there and bind to a combo box. My first idea was to put an ItemsControl in a resource dictionary, but the ItemsSource of a combo box expects IEnumerable so that didn't work. Here's what I've tried in my resource dictionary and neither works <ItemsControl x:Key="stateList"> <sys:String>AL</sys:String> <sys:String>CA</sys:String> <sys:String>CN</sys:String> </ItemsControl> <ItemsControl x:Key="stateList2"> <ComboBoxItem>AL</ComboBoxItem> <ComboBoxItem>CA</ComboBoxItem> <ComboBoxItem>CN</ComboBoxItem> </ItemsControl> and here's how I bind to it <ComboBox SelectedValue="{Binding Path=State}" ItemsSource="{Binding Source={StaticResource stateList2}}" > </ComboBox> EDIT: UPDATED I got this first part to work this way <col:ArrayList x:Key="stateList3"> <sys:String>AL</sys:String> <sys:String>CA</sys:String> <sys:String>CN</sys:String> </col:ArrayList> However, I'd rather not use an array list, I'd like to use a generic list so if anyone knows how please let me know. EDIT UPDATE: I guess XAML has very limited support for generics so maybe an array list is the best I can do for now, but I would still like help on the second question if anyone has an anser 2nd. I've tried referencing a merged resource dictionary in my XAML and had problems because under Window.resources I had more than just the dictionary so it required me to add x:Key. Once I add the key, the system can no longer find the items in my resource dictionary. I had to move the merged dictionary to Grid.Resources instead. Ideally I'd like to reference the merged dictionary in the app.xaml but I have the same problem Here's some sample code. This first part required an x:key to compile because I have converter and it complained that every item must have a key if there is more than one <UserControl.Resources> <win:BooleanToVisibilityConverter x:Key="VisibilityConverter" /> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/ResourcesD.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </UserControl.Resources> I had to change it to this <UI:BaseStep.Resources> <win:BooleanToVisibilityConverter x:Key="VisibilityConverter" /> </UI:BaseStep.Resources> <Grid> <Grid.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/ResourcesD.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Grid.Resources> </Grid> Thank you

    Read the article

  • Problem installing CTG 6.1 cicseci.rar ECI Resource Adapter in WAS 6.1

    - by Nick
    I have a problem with the CICS connection in my J2EE application. I am trying to install the cicseci.rar for the ECI Resource Adapter through the Admin console in WAS 6.1. The question is why am I receiving the following error while trying to install the cicseci.rar: Errors occurred during installation of the RAR file. Refer to the log files on node Node01 for more information. com.ibm.websphere.management.exception.ConfigServiceException: javax.management.MBeanException: Exception thrown in RequiredModelMBean while trying to invoke operation getResourceAdapterFromRAR Note: I have downloaded the cc03.zip containing fixes for file permissions related to the ECI Resource Adapters.

    Read the article

  • RIA Services Localization, where to place Resource Files

    - by kmacmahon
    I have the following Solution: SomeProject.Ria (non Silverlight code) SomeProject.Ria.Silverlight (Silverlight light code, namespace is still SomeProject.Ria) SomeProject.Ria.MyServices (RIA Services Domain Service) SomeProject.Ria.MyServices.Proxies (RIA Services Silverlight Generated Code) SomeProject.Shell (Silverlight Applicaiton) SomeProject.Web (Web Application) I would like to use Resource Files for my Annotations on the meta data class in SomeProject.Ria.MyServices. The format for that appears to be: [Required(AllowEmptyStrings=false,ErrorMessageResourceName="ThisFieldIsRequired", ErrorMessageResourceType(MyResource))] Which project does MyResource belong in? (Assuming that someday I need to support other culture files). Also the use of the string in here really seems to breed room for error, is it possible to do something like this and still achieve localization, or does this just get compiled into the meta data? If not, how can I get round the resource name being a string? [Required(AllowEmptyStrings=false,ErrorMessage=MyResources.RequiredMessage)]

    Read the article

  • Reading file resource in Unix and MacOS

    - by Sanjeev
    Hi, I am writing my first wxWidgets application which aims to be cross-platform. The program uses dll file for plugins and in Windows, reads dll resource part for information regarding plugin name, author name etc. I have never used Unix or MacOS (little Linux though) and am wondering whether compiling binary for these other OSes will require changes to the code written for Windows. For instance, is there a DLL equivalent in Unix and MacOS? Are there any provisions of compiling resource strings and files into a such files? Thanks, Sanjeev

    Read the article

  • Java WebApp: Loading resource from .jar located in WEB-INF

    - by shaman.sir
    There are a lot of similar questions, but, probably, mine is a little bit different: What is the right way to load resource from inside of .jar file located in WEB-INF/lib folder (if I know the jar file name and the name of the class it resource belongs to), while Web Application is running? Should I use getServletContext().getResourceAsStream(?) for this purpose or the <name-of-known-class>.getResourseAsStream(?), and what path do I need to specify there? So, the structure is: /WEB-INF /classes /some/package/name ?.class #some Java code or Servlet that tries to read 'required-file.xml' /lib /<jar-with-known-name>.jar /another/package/with/known/name SomeKnownClass.class required-file.xml

    Read the article

  • embed ttf as embeded resource can't reference it

    - by HoNgOuRu
    Hi, I've just added a ttf file to the project (c# 2008 express) as "file" and build option to embeded resource. I'm having problems when trying to set this font like this: (I know the next line is wrong...) this.label1.Font = AlarmWatch.Properties.Resources.Baby_Universe; Error 1 Cannot implicitly convert type 'byte[]' to 'System.Drawing.Font' C:\Users\hongo\Documents\Visual Studio 2008\Projects\AlarmWatch\AlarmWatch\Form1.Designer.cs 57 32 AlarmWatch I know it is byte[] cause I've set the option build as embeded resource, but...comparing with this line that is correct "this.label1.Font = new System.Drawing.Font("OCR A Extended", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));" How can I set this.label1 to use the new font??? thanks

    Read the article

  • Bitmap files added in .rc not listed in resource.h

    - by ame
    I added a large number of bitmap files to my MFC project in resource view (Visual Studio). However, the resource.h file does not list any of these files. I would want them to be listed with exactly the same name as they are added in .rc bitmap list (say the name is xxx) I want it listed as #define IDB_xxx If I try to click on the bitmap in the .rc list and import it, it gets listed as IDB_BITMAP1. Owing to the large number of files it is not feasible for me to manually rename them for use in my code.

    Read the article

  • Regex, replace path to resource, modify resource name

    - by jerome
    Hi all, I'd like to use a JS regex to take a string such as the following: 'http://www.somedomain.com/some_directory/some_other_directory/some_image.jpg' And turn it into this: 'http://www.some_other_domain.com/another_directory/yet_another_directory/size1_some_image.jpg' Any hints? Additionally, any pointers for books or other resources that give a gentle introduction to mastering regexes in JS and other languages?

    Read the article

  • Reading from an embedded resource stream

    - by shadeMe
    I've been trying to access an image resource named "IndexPointer.jpg" in an embedded RESX file called "Images.resx". GetManifestResourceNames() returns a single value - SCtor.Images.resources". Assembly::GetExecutingAssembly()-GetManifestResourceStream("SCtor.Images.resources.IndexPointer.jpg") only returns a nullptr. Obviously, I've got the manifest name wrong. What would be the correct one ?

    Read the article

  • Embed resource in .NET Assembly without assembly prefix?

    - by Robert Fraser
    Hi all, When you embed a reosurce into a .NET assembly using Visual Studio, it is prefixed with the assembly name. However, assemblies can have embedded resources that are not assembly-name-prefixed. The only way I can see to do this is to disassemble the assembly using ildasm, then re-assemble it, adding the new resource -- which works, but... do I really need to finish that sentence? (Desktop .NET Framework 3.5, VS 2008 SP1, C#, Win7 Enterprise x64) Thanks, All the best, Robert

    Read the article

  • Do Resource Adapters make RPC calls

    - by Subramanian
    The J2EE Conn Architecture deals with resource adapters to communicate with data stores - databases or EIS. From the adapter/driver perspective would it be right to say that they make a RPC call to the datastore? Or does RPC necessarily have to be a "discover and invoke" (lookup and call) type of call?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >