FAQ Database Discussion Community


Why does hasattr execute the @property decorator code block

python,python-2.7,properties
In Python when I call the hasattr on a @property decorator the hasattr function actually runs the @property code block. Eg A class: class GooglePlusUser(object): def __init__(self, master): self.master = master def get_user_id(self): return self.master.google_plus_service.people().get(userId='me').execute()['id'] @property def profile(self): # this runs with hasattr return self.master.google_plus_service.people().get(userId='me').execute() Running the flowwing code calls...

How can I access an array/object?

php,arrays,class,object,properties
I have the following array and when I do print_r(array_values($get_user));, I get: Array ( [0] => 10499478683521864 [1] => 07/22/1983 [2] => [email protected] [3] => Alan [4] => male [5] => Malmsteen [6] => https://www.facebook.com app_scoped_user_id/1049213468352864/ [7] => stdClass Object ( [id] => 102173722491792 [name] => Jakarta, Indonesia ) [8]...

Referencing properties in mongoose

node.js,mongodb,properties,reference,family-tree
I make some file.js like this: File Children.js var mongoose = require('mongoose'); var ChildrentSchema = new mongoose.Schema ({ name: String }); module.exports = mongoose.model("Childrent", ChildrentSchema);` File Dad.js var mongoose = require('mongoose'); var DadSchema = new mongoose.Schema ({ name: String, child: { type: mongoose.Schema.Types.ObjectId, ref: 'Childrent' } }); module.exports = mongoose.model("Dad",...

Passing keys to children in React.js

javascript,properties,reactjs
I am running through a react tutorial on tutsplus that is a bit old, and the code doesn't work as it was originally written. I actually am totally ok with this as it forces me to learn more independently, however I have spent a while on a bug that I...

C# Auto-Implemented Properties Assistance

c#,properties
In C# I'm confused about properties. Specifically when you set get and set as just { get; set;}. What does it mean when you do that? For example I have class property: public Dictionary<string, string> clientDict { get; set; } I've seen properties where they actually define get and set....

Java - Running JAR refuses to load file in the same directory

java,file,file-io,properties
Quick one, gentlemen. I'm trying to deploy a program, which borks at the following code. I want to read a properties file named, adequately, properties. Properties props = new Properties(); InputStream is; // First try - loading from the current directory try { File f = new File("properties"); is =...

Read-only attributes via properties versus via documentation

python,properties,attributes,private,readonly
In Python I'm writing a class where some attributes must remain constant during the object lifetime. One way is to use properties: class Foo: def __init__(self, x, y): '''Create a Foo object x -- list of int (READ-ONLY) y -- float ''' # Save x and y and ensure they...

Spring 4 PropertySourcesPlaceholderConfigurer doesn't resolve ${..} placeholders across modules

java,spring,properties,configuration,placeholder
I have two modules in my applications: core web The core module contains the following property place-holder configuration in the spring/applicationContext-core.xml context: <bean id="coreProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="locations"> <list> <value>classpath:/properties/*.properties</value> <value>classpath:/profiles/${build.profile.id}/properties/*.properties</value>...

C#: How can I expose a class property to one class but not to another?

c#,properties,hide,visibility
I have a data contract "StudentInformation" in my class library, something like this: public class StudentInformation { public int StudentId { get; set; } public bool CanChangeBus { get; set; } public List<int> AvailableBuses { get; set; } } public class BusChangeRequestModel { public StudentInformation StudentInfo { get; set; }...

Extracting a property several levels deep from JSON

javascript,json,properties
Code: IEnumerator Radar() { radarURL = "https://maps.googleapis.com/maps/api/geocode/json?latlng="+ "43.761223" + "," + "11.280470" + "&key=" + APIkey; WWW googleResp = new WWW(radarURL); yield return googleResp; googleRespStr = googleResp.text; JSONNode jsonReturn = JSON.Parse(googleResp.text); string results = jsonReturn["results"]["formatted_address"].Value; Debug.Log(jsonReturn["results"]["formatted_address"].Value); textDebug.text = jsonReturn; Debug.Log(jsonReturn); } Output JSON: { "results" : [ { "address_components" :...

How can I find the value of a property in Javascript?

javascript,properties,value
How can I find the value of the same property in different objects in Javascript only using property? Example: var o={ y:'efgh', x:'abcd' }; var m={ x:'abcd' }; ...

How to show Data in JLabel and Jext Boxes java swing dynamically from properties file Without knowing data in properties file

java,swing,properties,core
Ii am working on a module of java swing in which i want to return data into java swing textboxes and labels. The text boxes and JLabel should be varies dynamically according to data retrieve and I don't know about the properties name and their values...but i have to retrieve...

how to extract values from .properties file, having two values corresponding to one property name

java,properties,selenium-webdriver
how to extract values from .properties file, having two values corresponding to one property name Example of property file is iFrame=className=demo-frame DateTextBox=id=datepicker datePicker=xpath="//td[not(contains(@class,'ui-datepicker-other-month'))]/a[text()='"+value+"']" Q: main help required for 3rd property as value contains special characters as well....

How comes properties act like functions?

javascript,properties,getter
If you install colors you will see you can write scripts like this: var colors = require('colors'); console.log('hello'.green); console.log('i like cake and pies'.underline.red) console.log('inverse the color'.inverse); console.log('OMG Rainbows!'.rainbow); console.log('Run the trap'.trap); How is is possible that properties behave like functions (like [5, 6, 4].count?). I understand 'Run the trap'.trap() but...

Javascript Iterate on Dynamic Object Created

javascript,jquery,object,properties
Here is my code. The problem is stated at the code lines <script> // sample data created var names = ['egard', 'roger']; // object k is populated with a key and dynamic values // depending on the list of names // declare a new object var k = {}; //...

Where is the source code for maven-properties-plugin?

maven,properties
The maven-properties-plugin sources used to be hosted on Codehaus (http://mojo.codehaus.org/properties-maven-plugin), but I cannot find the new home for the sources anywhere. Does anyone know if they have been migrated somewhere? I checked the CodeHaus' github repo, but can't find them there. The last known version was 1.0-alpha2....

OrientDB import CSV is modifying my property name

csv,properties,import,character,orient-db
I'm no expert in OrientDB, and I'm having a problem with an odd character showing up in the command line. Oddly enough, it's in the name of my property. Because the name of the property is different, my queries are breaking. For example, I can't execute SELECT * FROM Class...

Changing Font-Family Property of a Label via Nativescript on Android

android,fonts,properties,nativescript
I have the following code with js to change the Font-Family of a Label. The idea is to access the native API of android to change the Font-Family, but it seems not to work. Any ideas what the problem is ? foo.xml: <Label text="foo" id="blogHead" textWrap="true" cssClass="margin-20 verticalCenter" fontSize="24" />...

Configure local variable in Spring PropertyPlaceholderConfigurer

java,spring,properties
Before I start, I have already read this and this, and still could not figure out the issue. I have a Spring application (you'll realise soon that my Spring knowledge is not very extensive) and four different environments (test, production...). Before, my properties file used in the PropertyPlaceholderConfigurer was identical...

How to get value of unknown properties (part solved already with reflection)

c#,reflection,properties
I have an existing c# application to modify and need to loop through an object with unknown properties and have half solved the problem with reflection. I'm trying to populate a dictionary with the property name and the property value. The code is below and I've given a description of...

How to load properties files dynamically when using servlet with war file?

java,properties,jboss,resources,war
I'm using JBoss AS 7. How can I use properties files which I download everytime(with translations) from an external folder? I'm deploying the servlet as a .WAR file and I want to use these properties files from a random temp folder from the disk. How do I that ? The...

Guice Names.bindProperties(binder(), properties) on output of a module?

properties,guice
I use an external service to provide properties, but want to make those properties available as @Named(..) vars. Trying to do this in a configure method fails with npe: Names.bindProperties(binder(), myPropRetriever.getProperties()); is failing because the myPropRetriever isn't appearing until guice has done it's work. I can see why this makes...

How to prohibit making a copy of a public field or property in C#

c#,properties,field,wrapper
Is it possible to prohibit making a reference copy of a public field or property like in the following example? Foo foo = new Foo(); foo.bar.DoSomething(); // That's fine Bar myRefToBar = foo.bar; // Don't allow this! When "bar" gets exchanged inside "foo", "myRefToBar" will still point to the original...

Grails , domain properties .. How can i get at the value?

grails,properties
In a domain class I have a property class Domain { String someValue } I can get at that directly via the property value - domainInstance.someValue I now have a requirement to create a hierarchy such that if someValue isn't set I get it from some other property of the...

wrong number of template arguments (3, should be 4)

c++,templates,properties,arguments,getter-setter
I tried to use property on c++ to use it instead of too many setter and getter function in data class have lots of member variable. there are two property class. first one has fixed setter and getter function by default set, get. second one support using custom setter and...

Error message in a property

wpf,vb.net,data-binding,properties
This is my problem. If a user type a number in the textbox is all right, but if he type a char, I don't see the messagebox () in the property. Why ? <TextBox HorizontalAlignment="Left" TabIndex="12" Text="{Binding Time_HH, UpdateSourceTrigger=PropertyChanged,StringFormat='{}{##}'}" FlowDirection="RightToLeft" MaxLength ="2" Height="30" Width="30" /> And this is the property...

Localization in the hmc structure

xml,properties,localization,structure,hybris
I have a problem. I have this part of hmc.xml structure: <type name="Order" mode="append"> <!-- LOLLO --> <organizer> <search mode="append"> <condition attribute="versionID" operator="is null" /> </search> <editor mode="append"> <tab name="positions_and_prices" position="0" mode="append"> <section name="original_totals" position="1" mode="append"> <listlayout> <attribute name="subTotalOriginal" descriptionattribute="currency" labelwidth="530" width="124">...

Get @CucumberOptions tag property using System.getProperty()

java,eclipse,properties,cucumber-jvm,test-runner
I am running a maven project in Eclipse for my Cucumber tests. My test runner class looks like this: @RunWith(Cucumber.class) @CucumberOptions( tags = { "@Now" }, // tags = { "@Ready" }, // tags = { "@Draft" }, features = { "src/test/java/com/myCompany/FaultReporting/Features" }, glue = { "com.myCompany.myApp.StepDefinitions" } ) public...

Spring: @NestedConfigurationProperty List in @ConfigurationProperties

spring,properties,configuration,spring-boot
Hi I am trying to get the following configuration up and running. @ConfigurationProperties(prefix="my") public class Config { @NestedConfigurationProperty private List<ServerConfiguration> servers = new ArrayList<ServerConfiguration>(); public List<ServerConfiguration> getServers() { return this.servers; } } @ConfigurationProperties(prefix = "server") public class ServerConfiguration { private String name; private String description; } So, I want to...

Not allowed to use property observer

swift,properties,sprite-kit
I want two SKSpriteNodes to be at the same position and static to each other. I first tried setting this up in the update() function. sprite1.position = sprite2.position It gives sprite1 the position of sprite2 one frame before. With high speeds (changes in sprite2's position ) it gets clear they...

C++ (Builder XE7) enum type property misterious behaviour

properties,enums,c++builder,c++builder-xe7
I'm not an expert in C++ but need to update an old project to Embarcadero C++ Builder XE7. This code does not compile (the fpFixed line): #include <System.UITypes.hpp> ... NewText->Font->Pitch = fpFixed; Where Pitch is: __property System::Uitypes::TFontPitch Pitch = {read=GetPitch, write=SetPitch, default=0}; void __fastcall SetPitch(const System::Uitypes::TFontPitch Value); and enum class...

How can I POST JSON values without property expansion in soapUI?

json,post,properties,parameters,soapui
In soapUI, I am trying to perform an HTTP POST with the following JSON: { "myNode":{ "myOtherNode":"${MY_VALUE}" } } The POST operation is successful, but in the response the value for myOtherNode is blank. I'm guessing this is because soapUI is treating it as parameter and trying to replace it....

Excel VB Listbox losing Value and Text Property

excel,excel-vba,properties,listbox
I'm trying to solve this problem along 2 days but I've not found the solution. I have a lot of listboxes on my excel and each of these listboxes are filled with different data, also I use these listboxes to change some filters at a pivot table using a VB...

How pass BeanShell param from one Thread Group to a Counter in another Thread Group

multithreading,variables,properties,jmeter,beanshell
I need to pass a value from one Thread Group to another Thread Group, in particular I have to pass a value from BeanShell sampler to Counter. This is my BeanShell code: Counter.Calendar c = Calendar.getInstance(); long now = c.getTimeInMillis(); c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); long passed...

How can I change the GUI controls' properties programatically in Matlab?

matlab,user-interface,properties,matlab-guide
As the question title says, I don't know how to change programatically the properties of the different controls that come with the Matlab GUI. Let's say that I have an edit control, whose String property I want to modify. What code do I write? I researched both the on-line and...

Python 2.7 @property usage results in error “global name '_c__pro' is not defined”

python,python-2.7,oop,properties,encapsulation
I wrote a simple class in Python2.7 that should use the @property functionality. class c(): def __init__(self): __pro = 1 @property def pro(self): return __pro *10 def setpro(self, x): __pro = x Now when I create an object from this class and try to access the pro property, I get...

SoapUI correlation (property transfer)

properties,soapui,correlation
I have a REST request that respond with the following: { "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IlQwWE8xNnAtMmZzMWxremV5", "expires_in": 2592000, "token_type": "Bearer" } I want to take the value of access_token, store it in a property and reuse it for two subsequent requests. Following some tutorial here, when running the request that obtains the access_token...

Readonly version of a class only for non inherent classes

c#,inheritance,properties
I need a protected properties version of a class. Meaning that external classes can't change the values, but the inherent class can. Here is a sample code, as you can see, I'm using a "smelly bool solution". How should I do that in a more elegant way? I hope there...

Setting controller property from inside a component

javascript,ember.js,properties,components
I'm having some trouble getting this to work. I have an image upload component that I want to set a controller property with so that I can later use it in a cropping component that finally will set a property that gets saved to my backend. In index.hbs I render...

Itcl What is the read property?

properties,tcl,itcl
I want to control read access to an Itcl public variable. I can do this for write access using something such as: package require Itcl itcl::class base_model_lib { public variable filename "" } itcl::configbody base_model_lib::filename { puts "in filename write" dict set d_model filename $filename } The configbody defines what...

How to get enabled property of a control?

delphi,properties
In Delphi it is possible to get the process name and class name of any control which is clicked system wide via windows api. process name: GetWindowThreadProcessId(Hwnd, ProcessId) by process ID one can get to the process name class name: SetLength(ClassName, 255); SetLength(ClassName, GetClassName(Hwnd, pchar(ClassName), 255)); Is there an easy...

spring 4 @PropertySource relative path

java,spring,properties
I have a folder. And a jar app in this folder. Also I have a properties file in this folder. My conf. class is: @Configuration @Import({com.blabla.MyClass.class}) @ComponentScan(basePackages = "com.blabla") [email protected]("file:///worker.core.properties")** @EnableTransactionManagement public class MainConfig { @Autowired private Environment env; And this declaration does not sees my file, but it`s in...

Objective-C public get set method for private property

objective-c,properties,private,synthesize
I wonder if it is possible to use @synthesize on a private @property so that the get/set methods have public access. Right now my code looks something like this SomeClass.h #import <Foundation/Foundation.h> @interface SomeClass : NSObject { @private int somePrivateVariable; } @end SomeClass.m #import "SomeClass.h" @interface SomeClass () @property int...

Objective C: Accessing properties of an object instance that's in an array that's a property of an object

ios,objective-c,osx,properties,casting
This seems like it would be a simple thing to do but I'm having trouble finding the exact syntax. I have an object called myObject. It has a property called companies. Each object in that array is an object of type Company which has a property called myid. I'm simply...

Creating a custom property class for multiple re-use within a class

c#,properties
Suppose I have a C# class that has multiple properties that all look like this: private bool _var1Dirty = true; private Double? _var1; public Double? Var1 { get { if (_var1Dirty) { _var1 = Method_Var1(); _var1Dirty = false; } return _var1; } } And the only differences between each of...

Objective-c readonly copy properties and ivars

objective-c,properties,automatic-ref-counting
I'm try to grok properties declared as both copy and readonly in objective-c, and specifically, whether I have to do the copy myself. In my init methods. Evidence suggests I do: @interface A : NSObject @property(nonatomic, copy, readonly) NSData *test; - (instancetype)initWithData:(NSData *)data; @end @implementation A - (instancetype)initWithData:(NSData *)data {...

iOS: do something on each property change

ios,objective-c,properties
I have several properties in my class, I would like to call saveToFile on each property change. I prefer not to override the setter of each property. Should I override -[NSObject methodForSelector]? What is the best way to go?...

Assigning methods to object at run-time - Design Pattern

c#,.net,design-patterns,properties,lazy-loading
I have created an architecture in my C# code which does exactly what I want, but seems it would be very difficult to maintain in the long-run and am hoping there's a design pattern / better architecture I could be pointed towards. I have created an object Test which, again,...

How to declare in Swift a function parameter that is a property name

swift,properties,closures
I want to have a class that can access a specified property in another class at runtime. I am guessing it is possible if I pass a closure or a function in as a parameter. For example: class X { let pointFunction : (Thing) -> (CGPoint) init(pointFunction : (Thing) ->...

access the user control property at clinet side

asp.net,properties,user-controls
I have a User Control - FilterPanel.ascx which is used twice on QuickSearch.aspx <dx:ASPxRoundPanel ID="filterPanel" ClientInstanceName="filterPanel" runat="server" ShowCollapseButton="True" CssClass="contentPanel" CornerRadius="0"> <ContentPaddings Padding="0px" /> <HeaderStyle CssClass="contentPanelHeader" ImageSpacing="0px" ForeColor="#FFFFFF" BackColor="#5A81B3" /> <PanelCollection> <dx:PanelContent> <dx:ASPxTextBox runat="server" ID="txtdxKeyword" Width="139px" Height="18px" Visible="True"...

can es6 class have public properties as well as functions?

javascript,class,properties,public,ecmascript-6
All the examples of classes I see are class myClass{ constructor(){} someFunction(){} what I want to add is someObject {myvalue:value} } this doesn't seem to compile. An old fashioned object would be { somefunction: function(){} someProperty: {myvalue:value} } is this not possible in es6 classes?...

unwanted object property changed when changing another object property c#

c#,object,properties,copy,instance
from what i understand in other posts i know that my objects use same place in memory but how to separate these objects? i tried to use new but it didn't work or i didn't used it correctly. Note that i didnt paste setter and getter here. class Supermarket {...

Read a specific word properties value in java

java,file,properties
I have a properties file which contain a key and its value, in which its value is a string consist of many values: transmit=[D-1]0.0 [D-2]0.0 [D-3]0.039236154 key=transmit value=[D-1]0.0 [D-2]0.0 [D-3]0.039236154 It means that transmit is in [D-1] Document 1 with value 0.0, and in [D-2] Document 2 with value 0.0,...

Using EF6 code-first, reference same property name

c#,entity-framework,properties,mapping
How to reference both ShippingAddressId and BillingAddressId properties in Customer class to Address class which has a diffrent key named AddressId? Running update-database -verbose causes error: Unable to determine the principal end of an association between the types 'Project1.Customer' and 'Project1.Address'. The principal end of this association must be explicitly...

PHP magic method __get and [] make value disappear

php,arrays,properties,get
I've faced one interesting problem. Creating an array property and assigning a value into it in the same operation using [] seems to go wrong. class T { public function __get($property) { if (!isset($this->{$property})) { $this->{$property} = array(); } return $this->{$property}; } public function __set($key, $val) { $this->{$key} = $val;...

How to create an variable property based on the other property in the class

swift,variables,properties
class someClass { // This is a list of restaurant names var restaurantNames = ["Cafe Deadend", "Homei", "Teakha", "Cafe Loisl", "Petite Oyster", "For Kee Restaurant", "Po's Atelier", "Bourke Street Bakery", "Haigh's Chocolate", "Palomino Espresso", "Upstate", "Traif", "Graham Avenue Meats", "Waffle & Wolf", "Five Leaves", "Cafe Lore", "Confessional", "Barrafina", "Donostia", "Royal...

How to add Copyright and Authors info to Images created in PHP?

php,image,file,properties,file-attributes
Is there any way to add Copyright info to the image file created by PHP? To be clearer, you can add copyright info to a file with photoshop, so when you get its properties, you see something similar to: I want to Add/Edit Details info of a file in php....

Get and add all properties of type Mname from a list of objects and add them dynamically too a drop down

c#,linq,list,object,properties
Ok so I have an object type called monsters and a list of all monsters I need to get all the strings from the property called MName and add each one to a Drop down text box. here is the class so far.(sorry Im really new to coding.) using System;...

The method getProperty(String) is undefined for the type Properties

java,jsp,servlets,properties
I am new in jsp, servlet, MVC. I am writing CRUD application using jsp,servlet.I have DBUtil class which contains the configuration of database. I have property file which contains the DB details. I am trying to load the property file with this class but I am getting an error on...

if a property sample work

python,properties,descriptor
In book of "Core Python Programming", there is a sample about how to use property. The code is like this: class Hidex(object): def __init__(self, x): self.__x = x @property def x(): def fget(self): return ~self.__x def fset(self, x): assert isinstance(val, int), 'val must be int' self.__x = ~x return locals()...

How to left pad zeroes to number between 1 to 1000 while reading it from file?

java,file,properties
I have to left pad 0's while printing it on console. Here I am reading number from a file.. The code is as below: public class FormatNumber { public static void main(String[] args) { Properties properties=new Properties(); File newFile=new File("FormatNo.properties"); try { newFile.createNewFile(); properties.load(new FileInputStream(newFile)); } catch (IOException e) {...

Accessing Javascript/Google Apps Script properties via Object.keys TypeError

javascript,properties,google-apps-script,typeerror
I'm trying to write a generic script to loop thru an array of objects and return the values of the properties at each cycle. Rather than access the properties via myArray[0].someProperty; myArray[0].anotherProperty; I'm storing property names in an array using Object.keys(myArray[0]). However at runtime I get TypeErrors. Could anyone tell...

Full support for JavaFX properties in POJOs

java,properties,javafx,aspectj
There are quite a few questions on SO regarding adding JavaFX property support to existing POJO classes. Properties for those classes can be created by using adapters in javafx.beans.property.adapter package. However, properties created in such way will not reflect changes made using setter methods of POJO classes, unless PropertyChangeSupport is...

Getting runtime properties with ReflectionClass

php,class,object,properties,access-modifiers
So I am exploring the use of the Reflection class. I noticed a few thing. Had to set the accessibility of my property before being able to use the value or name of the property Even from within the Origin class. What I would like to know is it possible...

Exception in thread “main” java.lang.ExceptionInInitializerError Caused by: java.lang.NullPointerException

java,properties
I am using config.properties file in order to set port. After running I am facing an error: Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Properties.java:434) at java.util.Properties.load0(Properties.java:353) at java.util.Properties.load(Properties.java:341) at HttpServer.setPort(HttpServer.java:83) at HttpServer.(HttpServer.java:26) The main class: public class HttpServer { static final boolean SSL = System.getProperty("ssl") != null;...

VB.NET - Extend property in child class

vb.net,inheritance,properties,expand
Maybe somebody can help me out please, i can imagine it is a common need: I have a base and a child class. The base class has a property named "hello". Now I need to add extended functionality in the property Set of the child - How can I achive...

Make report viewer body invisible?

c#,asp.net,properties,reportviewer
I have a report viewer whose body I want to make invisible except for head where you can choose the desired format. Here's my ASP.NET code: <rsweb:ReportViewer runat="server" ID="report" Font-Names="Calibri" Font-Size="12pt" WaitMessageFont-Names="Calibri" WaitMessageFont-Size="14pt" Width="383px" Height="30px"> <LocalReport ReportPath="ReportFatture.rdlc"> <DataSources> <rsweb:ReportDataSource DataSourceId="ObjectDataSource2" Name="DataSet2" /> </DataSources> </LocalReport> </rsweb:ReportViewer>...

How to set a lot a class properties from an object with the same property names?

javascript,class,properties
I'm working in JS and I've got the following object with a lot of properties: var foo = { prop1: 123, prop2: 456, prop3: 789, ... propX: 321 } I want to set a class with exactly the same properties. I can do it like that: this.prop1 = foo.prop1 this.prop2...

Xcode Property Not Retaining Value

ios,objective-c,xcode,properties,nsstring
I have a view controller called LoginWindowViewController.h that declared a property called usernameTextField: @property (strong, nonatomic) IBOutlet UITextField *usernameTextField; A string called James is associated to this TextField. I then import another view controller,FirstViewController.h into my LoginWindowViewController.m and I also imported LoginWindowViewController.h into FirstViewController.m . In my FirstViewController.h there is...

How can I override an inherited object's property in the constructor in javascript?

javascript,object,inheritance,properties,pixi
I'm trying to create a new Object by inheriting pixi.js's PIXI.Container object. The PIXI.Container object has the properties height and width, which I would like to set from the parameters of my constructor. Every time I attempt to do so, the 'this.height' parameter is always 0. I'm so confused! var...

Get properties of runtime created list item in Unity

list,unity3d,properties
I have a scroll list with runtime generated items. Each item has some properties and has 3 buttons Like, Comment and Delete. Now I want to catch the onClick event of the Like button of an item, so how can I get the property of the item from the onClick()?...

Get List of Elements in Tree with specific Field Value

vb.net,linq,properties,interface
I have an Interface like this: Public Interface TreeSelectorAttributes Property selectedInTreeSelector As Boolean Property Name As String ReadOnly Property childs As IEnumerable(Of TreeSelectorAttributes) End Interface and I have a TreeView which has a List of this TreeSelectorAttributes: Public Property rootList As IEnumerable(Of TreeSelectorAttributes) now after the User chooses which elements...

getting property of circular socket object nodejs

javascript,jquery,node.js,sockets,properties
So, I have this strange problem: First, I connect to a socket like this: window.GLOBAL_socket = io.connect('http://localhost:8080'); Then, if I print out the window.GLOBAL_socket variable, I get a circular variable which contains the property 'connected' which is set true if the connection is succesfull, and false if it isn't as...

Overriding properties to make them readonly - what about the setter?

c#,inheritance,properties,polymorphism,setter
I have the following design goal in a class hierarchy: There is a BaseClass defining some properties, which would usually be read/write: public class Media { public virtual object Content { get; set; } public virtual double recordingLength { get; set; } } The intention is to have some subclasses...

What CSS prefixes for properties I should use? [closed]

css,properties,prefix,use
If I want to use box-shadow for example which prefix I need to add after the simple box-shadow property? I read which browsers supports it, but I also got these prefixes: -moz- -webkit- -apple- -o- -xv- -ms- -mso- -atsc- -wap- -khtml- -prince- -ah- -hp- -ro- -rim- -tc- So which of...

Why is happened property write error?

properties,borland-c++
c++ : Run time error is happened with error message like this. "RevStrings1-> Height of reading included in error: The property is write-protected." ("RevStrings1->Height の読み込中のエラー : プロパティは書き込み禁止です.") I'm using c++ builder 3. This source code can be successfully compiled setting library, include path and etc. But run time error is...

Passing a class instance as a parameter to one of its own functions

objective-c,function,class,methods,properties
When a class of properties (let's call it class_X) is being instantiated from another class, all of class_X's methods and functions are also included in every instance. Q1: Wouldn't that add substantial overheads, especially if there are multiple instances of that class? The class instance (class_X) could then be passed...

Execute a method when a variable value changes in Swift

ios,swift,properties,singleton
I need to execute a method when a variable value changes. More specifically I have a singleton class which has a shared variable called labelChange. Values of this variable are taken from another class called Model. Moreover I have two VC classes one of them has a button and a...

EF 6 database first make all properties virtual in generated entity classes

c#,entity-framework,properties,virtual
I have a db first edmx model. The partial classes it generates have non-virtual simple properties. E.g. //------------------------------------------------------------------------------ // <auto-generated> // This code was generated from a template. // // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be...

Share array or list between C++ and QML via property

c++,list,properties,qml
There's a list of unsigned ints in C++ class. The list can be modified inside the class in some way. There's a QML object that has to use this list. How should I declare the list to make the object able to use the values from the list and after...

Java Arraylist want to merge the objects if they have the same property value java,object,arraylist,properties,merge
Java ArrayList, filled with objects called packinglistrows which hold three key values ( ISBN, PalletNumber, Quantity), along with other properties. I have this ArrayList with all the same ISBN values in it. I want to be able to merge the items with the same PalletNumbers quantity value. For example: ArrayList...

Updating a PFObject from a different view controller

ios,properties,parse.com,pfobject
I am seeing some interesting behavior when attempting to access and modify the same PFObject from within two different view controllers. I have one view controller that has a strong property for the PFObject. When I present the second view controller, it has a weak property of the same type,...

How to Change Properties in SimpleCV's SVMClassifier

python,properties,classification,svm,simplecv
In the Documentation: SVMClassifier Documentation there are class SimpleCV.MachineLearning.SVMClassifier.SVMClassifier(featureExtractors, properties=None) Code of class SVMClassifier mSVMProperties = { 'KernelType':'RBF', #default is a RBF Kernel 'SVMType':'NU', #default is C 'nu':None, # NU for SVM NU 'c':None, #C for SVM C - the slack variable 'degree':None, #degree for poly kernels - defaults to...

Wrong keys are printed using for..in on Object.keys()

javascript,object,for-loop,properties
Consider this object: var obj = {10: 0, 11: 1, 12: 2}; Using the method Object.keys(obj), you can see that obj has three keys: 10,11,12. However, if you wanted to iterate over each key (for example, in order to get the value for each key), a standard for loop returns...

User defined properties in C# cause StackOverflowException on construction

c#,properties
I have been writing some code in the Unity3d engine and have been teaching myself C#. I have been trying to find an answer to my question but to no avail. I've come from java and been trying to use properties and I'm afraid that I don't understand them very...

How to loop through the properties of a Class? [duplicate]

c#,class,reflection,properties
This question already has an answer here: How do I automatically display all properties of a class and their values in a string? 5 answers I have found that this question is quite common, but i didn't found what i am looking for. Maybe 'cause i want to do...

Property not storing between pages:

vb.net,properties
I have a .vb file on a site which stores a few dozen properties that are used on various pages of the site. I'm new to the company and the only web-developer, but I didn't make the site myself. I'm here to try and update it. I've added two properties...

Java - Check properties file at compile time

java,maven,ant,properties
I need some advices from you today. I am working on a project which uses a huge constants holding class. There are lots of public static final String CONST_NAME = "const_value"; I am getting those using MyConstClass.CONST_NAME but now I need to externalise them in order to configure the project....

Comment tag @code doesn't work with properties

ios,objective-c,properties,documentation,comments
I'm documenting my Objective-C code for the Quick help function in Xcode like this: but I have a little problem in documenting the properties: it's possibile use the tag @code ? Because this comment doesn't work: /** the URL base for backend APIs @code codeexample; @endcode */ @property (nonatomic, strong)...

Using ECMAScript 5 get/set properties with revealing module pattern

javascript,properties
Consider the following contrived bit of JavaScript based on the revealing module pattern: var RevealingModuleSample = function () { var moduleName = "DefaultModuleName", init = function (name) { moduleName = name }, issueAlert = function () { alert(moduleName + " module is running"); } return { init: init, issueAlert: issueAlert...

How to expose internal control's property to its parent UserControl in WPF

wpf,xaml,properties,user-controls
I have a DialogPrompt UserControl that will have an Image and a TextBlock. Here is the template: <UserControl> <Button x:Name="_OkButton" Content="OK"/> <DockPanel > <Image/> <TextBlock x:Name="_DialogTextBox" /> </DockPanel> </UserControl> How do I expose Source property of the Image and Text property of the TextBlock inside my UserControl?...

Passing a condition into Func of a Tuple>

c#,properties,tuples
I am trying to create a list of tuples with properties and conditions for their validation. So I had this idea in mind: List<Tuple<string, string, Func<bool>>> properties = new List<Tuple<string, string, Func<bool>>> { Tuple.Create(FirstName, "User first name is required", ???), }; ... How can I pass expression of type (FirstName...

Variable value assign and retrieve

c#,variables,properties
How does variable assigning (setting) and retrieve value works in the background? For example: { int myValue; myValue = 5; //here we assign value (set) Console.WriteLine(myValue); // here we retrieve value } So here we first declare value. In next line we assign value (does it work the same way...

TypeBuilder - Adding attributes

c#,dynamic,properties,custom-attributes,typebuilder
I have a helper class that uses a TypeBuilder to construct a dynamic type. It is used as follows : var tbh = new TypeBuilderHelper("MyType"); tbh.AddProperty<float>("Number", 0.0f); tbh.AddProperty<string>("String", "defaultStringValue"); tbh.Close(); var i1 = tbh.CreateInstance(); var i2 = tbh.CreateInstance(); I now want to add support for property attributes (existing attribute types,...

unknown behaviour in C# windows form application

c#,class,properties,set
I have one class Product in several properties. The problem is when I set the Count of Product for Customer property the Count of Product for Supermarket would be changed too. I have these classes and properties: class Supermarket { string _name; string _address; string _phoneNumber; List<Product> _products = new...

Properties and auto-implementations

c#,properties,field
I'm using .NET 4.5 in a VSTO addin for outlook 2013. I'm having some trouble fully grasping properties and accessors. Auto-implemented accessors which I assume are when you just write get; set; rather than get { //code }, etc. are also giving me trouble. I have a dictionary I use...

Why does binding image path to Image.Source does not work this way

wpf,image,xaml,binding,properties
I have an image path declared as following: public static string _edit_vector32 = "pack://application:,,,/Resources/Images/Icons/32/edit-vector2-32.png"; I try to add a simple property that returns an ImageSource to my ViewModel as following: public ImageSource ClockImage { get { return new BitmapImage(new Uri(RuntimeSettings._clock24)) as ImageSource; } } Then bind in XAML: <Image Source="{Binding...

What's wrong with Property without set?

c#,wcf,serialization,properties,datacontract
I have a class used with a WCF service. Interface defined [WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetMyStuff/?p={param}", BodyStyle = WebMessageBodyStyle.Bare)] MyResponseObject MyMethod(string param); Among it's properties I had public bool IsDecorated { get { return !String.IsNullOrEmpty(Decoration); } } resulting request refused to load. After I added a set { }...

Using value of propertie in his own custom attribute

c#,.net,properties,attributes
We use some DTOs in your business logic. I also use these DTOs for printing. So there is a custom attribute printable which will be used in the print-framework to recognize which properties to print. In some cases it is necessary to preformat the value for the printengine. My idea...

Best way to include relative path with file array

c#,arrays,class,properties
I'm new to C# and need advice on how to proceed with a problem: I'm writing code to sync folders. To determine if two files are the same file I need to compare their relative paths (subfolders from their base directory and filename). I've created a FileInfo array with the...