properties

Problem loading java properties

I am trying to load properties from a file (test.properties) The code I use is as follows: URL url = getClass().getResource("../resources/test.properties"); properties.load(url.openStream()); But when executing the second line I get a NPE. (null pointer exception) I'm not sure what's wrong here... I have checked that the file exists...

C# property exactly the same, defined in two places

I have the following classes: Defect - represents a type of data that can be found in a database FilterQuery - provides a way of querying the database by setting simple Boolean filters Both Defect and FilterQuery implement the same interface: IDefectProperties. This interface specifies particular fields that are in the database. D...

Does Java have "properties" that work the same way properties work in C# (see the body of my text)?

In C#, you can use properties to make a data field publicly accessible (allowing the user to directly access it), and yet retain the ability to perform data validation on those directly-accessed fields. Doese Java have something similar? For Instance, suppose there exists a C# class with the following implementation(see below): public...

Building Android app from ant via Hudson - chicken and egg problem

When using an Android-generated ant build file, the file references your SDK installation via an sdk.dir property inside the local.properties files which is generated by "android update project -p .". The comments in build.xml suggest that local.properties should NOT be checked into version control. BUT, when you run your build from Hu...

How to retry opening a properties file in Java

I'm trying to handle an FileNotFoundException in Java by suspending the thread for x seconds and rereading the file. The idea behind this is to edit properties during runtime. The problem is that the programm simply terminates. Any idea how to realize this solution? ...

What are the best practices for unit testing properties with code in the setter?

I'm fairly new to unit testing and we are actually attempting to use it on a project. There is a property like this. public TimeSpan CountDown { get { return _countDown; } set { long fraction = value.Ticks % 10000000; value -= TimeSpan.FromTicks(fractio...

empty() behavior

Maybe I'm asking a stupid question, but I can't understand this behavior: <?php $this->meeting->google_id = 'test'; $test = $this->meeting->google_id; var_dump(empty($test)); var_dump(empty($this->meeting)); var_dump(empty($this->meeting->google_id)); ?> gives output: bool(false) bool(false) bool(true) Why the ...

Creating Class Properties in Visual Studio

Using the standard VS IDE, is there a fast way to create class properties that are linked to the local variables? The class diagram seems to provide something, but it basically just created a property stub. Is there something better / easier out there ? ...

How to determine Delphi DBGrid Row Count

I have a DBGrid that shows a filtered view of a dBASE table. DBGrid has a property called RowCount but is marked private. How do I determine the row count? All I really need to know, is whether the count is more than zero. Using delphi Turbo Professional ...

C# UserControl Custom Properties

i am creating a usercontrol which provides all of the common validations for a range of textbox styles: alpha, number, decimal, SSN, etc. so, when a developer using this control selects the alpha style, they can also select another property which defines a string of special characters that could also be allowed during validation. but ...

Is it faster to access a property file or static constants from a class file?

I develop a webservice application in a tomcat container, I have a lot of properties for the webapp like constants, error messages and so on. What is the better and faster way to? ...

Update "Properties" model when adding a new record in CakePHP

Hi, I'm writing an application in CakePHP that, for now, is to be used to make quotes for customers. So Quote is a model. I want to have a separate model/table for something like "Property," which may be used by other models. Each time a user gets to the "Add Quote" action, I basically want to pull a Property called "nextQuoteNumber"...

How should i use navigation properties while writing a query using eSQL?

i am trying to write a query using eSQL where in my entity has got navigation properties. i am not able to include these navigation properties in the query. Like in Linq to SQL we have this .Include method, how will it be possible in eSQL? ...

WCF Service and Properties

Hi all, Here is my question, I have a solution with 4 projects in it for a WCF Service : DLL Library : Service Interface. DLL Library : Service Code. Form Application : Service hosting application. Form Application : Service client application. I'd like to have certain properties of the service accessible for the hosting application...

struts 2 - where should I set global application variables?

Hi I'm using struts 2 and I'd like to read some custom-defined parameters (global variables), preferably from web.xml or some custom ".properties" file (i.e. not hardcoded in the Java sources). This problem has been driving me mad for the past half hour as I can't google any reasonable solution. What is the best way to do this? I find ...

Can I use XInclude with Java 1.5 XML Properties?

Since JDK 1.5 Properties can be loaded from a simple XML file (see IBM article). Is it possible to use XInclude in one of these XML properties files to compose multiple files? ...

Binding to object properties in C++

I've seen in WPF where you can bind control values to properties of other controls. How is that binding accomplished in C++? For example, if I have a class called Car and a guage control called RPM, how do I tie the value of RPM to the member variable Car.RPM, so that when Car.RPM changes, it is automatically (as in without a specific u...

MSBuild Validating Properties

I'm working on a reusable MSBuild Target that will be consumed by several other tasks. This target requires that several properties be defined. What's the best way to validate that properties are defined, throwing an Error if the are not? Two attempts that I almost like: <?xml version="1.0" encoding="utf-8" ?> <Project ToolsVersion="...

set pdf properties from reporting services

Hello, I have a RDL that I call from .net code and I render it as PDF. RS sets values for the properties of the documents such as author, title, subject. Can I change those properties at runtime when the RDL is executed? Thanks a lot, Edgar ...

Adding Custom Properties

Hi All I have created a user control, and now I want to add custom properties to it so they will appear in the Properties toolbar in Vis. Studio. How can this be done? My custom property will be: "Animation Type" with options "Fade | Blink | Scroll | Blend" thank you ...