properties

IzPack: Passing variables/ properties from one panel to another

I am customising my IzPack, I have a custom IzPanel which parses some files (created by a previous installation of the same program), and is attempting to populate the In MyCustomIzPanel.java (a customised IzPanel) //idata is the InstallData object String oLicenceFile = ... // Code to obtain where this file is idata.setVar...

Java: How do you use key/value datastores like memcached with Java property file code?

We are trying to move away from property files as files on the file system and more want to use a server based key/value store. Does anyone have any code to do this with Java. Are there systems already built to connect to a server like memcached and build a property object with key values? I want to do this in a struts web based proje...

Android: Edit project properties

I have a project which I created before few days like test project and now after I done some very nice stuff with it I need to change some basic information about a project. I use Eclipse IDE and I menage to change some tings, class names itd. But problem i have now is I can found a place where to change a project name ??? In...

how to access property in usercontrol.ascx from usercontrol.ascx.cs

Hello all, I want create for paging a usercontrol. How can I access properties in usercontrol.ascx from usercontrol.ascx.cs? Property in usercontrol.ascx.cs: /// <summary> /// gets actual page index /// </summary> public int PageIndex { get { return _pageIndex; ...

C# - copying property values from one instance to another, different classes

I have two C# classes that have many of the same properties (by name and type). I want to be able to copy all non-null values from an instance of Defect into an instance of DefectViewModel. I was hoping to do it with reflection, using GetType().GetProperties(). I tried the following: var defect = new Defect(); var defectViewModel = n...

Reference Spring properties file using path relative to config file

I am moving properties from inside my Spring config file to a separate properties file. This is included in the config file with <bean class="org.springframework.beans.factory.config.PropertyPlaceHolderConfigurer"> <property name="location" value="file:properties/${CONFIG_MODE}/service.properties" /> </bean> As it stands, the locat...

Help with asp.net mvc reflection and properties

I need a way to dynamically populate this query... to avoid repeating the same query which I will have to do about 20 times public decimal percentage_of_property(string property) { var total = Routines().Where(r=>r.property==true).Count(); return (decimal)100 * total / routines_total(); } This obviously doesn't work... but I p...

Accessing a class's properties two ways.

I'm stuck on creating a class architecture to do this: I have very many (About 78) types of block. The level for the game is made of these blocks. In the level's ByteArray, there are simply numbers, denoting the type of block. So for collision handling, I can just retrieve the number at the wanted position and get that block's propertie...

How to get the context root directory in Java EE6 application from a POJO?

Hi, I have a JEE 6 application with JSF 2 and Tomcat 7. Now I have a POJO. This POJO should read a properties file. The properties file is is located in WEB-INF/classes. The current directory is the users home directory /home/myUser. How does the POJO get the context's root directory or some similar path, so that it can read the prop...

How to read a properties file in java in the original order

I need to read a properties file and generate a Properties class in Java. I do so by using: Properties props = new Properties(); props.load(new FileInputStream(args[0])); for (Enumeration e = props.propertyNames(); e.hasMoreElements();) { } However, the properties returned by props.propertyName is not in the order of the original prop...

linq to sql only selecting data from columns in object that are not null

hi there i am trying to build up a string containing the values of fields in a linq to sql object. the thing is, i only want to grab the fields that are not null i am sure there is a way to do this. can anyone enlighten me? mylinqdatacontext dc = new mylinqdatacontext; StringBuilder sb = new StringBuilder(); mylinqtype item = (from x...

Are C++ initializers called in Objective-C synthesized properties?

Are C++ initializers called in Objective-C synthesized properties? Meaning if I write a custom initializer for creation from another object of the same type (C++) does the synthesized property setter call that initializer? ...

What was the name of the set accessor that only lets the value to be set in the constructor?

public class MyClass { public string Name {get; KEYWORD set;} public MyClass(string name) { this.Name = name; } } Any ideas what the KEYWORD was? I searched all over but it's hard to find the get/set accessors in google. ...

what is the max size of TextProperty on google app engine .

class JsTree_JsonData(db.Model): JsonData=db.TextProperty() i can;t find what is the TextProperty did you know ? thanks ...

PHP: What is the purpose of encapsulation?

I'm talking specifically about the public, private and protected keywords that can apply to properties and methods. I've looked everywhere and I know what they do and how to use them, but don't see how they would be practical when programming. Could somebody explain or give an example? ...

Class extending - best practice/best solution

First thing to note - I KNOW DELEGATION AND DECORATOR PATTERNS! Second - I am using C# .NET 4.0, so if you come up with a solution that is specific for it, that's fine. But if solution will work for any OOP language and platform, that would be great. And here the question goes... I have a partial class (lets name it Class1), which I c...

Lock Properties File in Java

Hello, I am using the java properties file construct. At the beginning I read it to populate a dialog, but I also give the users the ability to change the values in the dialog and click save. This causes me to call the setProperty method of the properties file. Now, since this webapp can exist over multiple browsers, all changing the sa...

Hibernate log4j.properties print DB uname & pass

My story is as follows. I have a java app with hibernate connected to a embedded db(derby). The funny thing was, that my hibernate app printed the uname at start, because i was using slf4j-simple, and so i set my App to use log4j. Hibernate db uname&pass are set in code, using property object. I tried using the same trick on log4j prope...

Filtering out auto-generated methods (getter/setter/add/remove/.etc) returned by Type.GetMethods()

I use Type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) to retrieve an array of methods for a given type. The problem is the returned MethodInfo could include methods that are generated by the compiler which I don't want. For example: property bool Enabled { get; } will get bo...

asp.net mvc client side validation for camel case property name

Hi all, I am using the MS shipped client side validation in asp.net mvc 2. The model in question has one property called "FirstName". Our client side developer really like to have camel-case in the elements id, so instead of using the normal html helper Html.TextBoxFor(m => m.FirstName), we wrote out the html input view instead like: ...