FAQ Database Discussion Community


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...

Magento-Change Attribute of All Products

sql,magento,attributes
I have created a Yes/No attribute in Magento with default value of "No". I have more 100+ products and changing the value of this attribute to "Yes" of each product separately is a pain. Is there any other way suing MySql or SSH to change this attribute of all products...

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...

Microstrategy documents - matching differen attributes with the same value

attributes,document,matching,value,microstrategy
I'm building a document with a dashboard-like appearance. I'm using radio buttons for selecting the year. Sadly in one of my datasets the attribute year is another attribute, even if contains exactly the same values. How can I solve the problem of matching attributes basing on their values in documents?...

Seeking example of how to tell Autofac which service to inject by name

c#,attributes,autofac,inject
I need an attribute like [WithNamed("x")] that will tell Autofac how to inject each 'service' with the correct parameter as shown. The constructor to be injected with two versions of FlagXCtlr: public CoupDo( [WithName("FLAG6")]ItemUserFlagCtrl Flag6Ctlr, [WithName("FLAG5")]ItemUserFlagCtrl Flag5Ctlr) { ... } Registering is done as so: builder.RegisterType<ItemUserFlagCtrl>() .Named<IItemUserFlagCtrl>("FLAG6") .WithParameter("userFlagParm", "FLAG6") .SingleInstance();...

FadeOut element

jquery,attributes,fadeout
I am trying to fadeout elements using the code $('[title!="head"]').each (function(){ $(this).fadeOut(100); }); With the above code, all the elements are fading out including the ones with $('[title="head"]'). The code works perfectly for the condition $('[title="head"]') Any comments would be highly appreciated....

Accessing _all_ downstream annotations of a node in Rascal

attributes,rascal
I read this question while trying to do something similar. The answer given there does not solve my problem. I want to use a visit statement to determine the 'mass' of each subtree, so for each node I want to sum the masses of all descendants. For example, a visiting...

get Id of input field using JavaScript

javascript,attributes
I have input in grid, which each unique ID, output as following; <a href="#" class="SearchUser_Icon Hyperlink_Text" onclick="load_getUserListByGroupID()" id="2"></a> I want to know what is equivalent to $(this).attr("ID") in javaScript function load_getUserListByGroupID() { var selectedGroupID = document.getElementById('input'); alert(selectedGroupID); } ...

How to move an attribute and its value from one element to another

xml,xslt,attributes,xslt-1.0
I have the following XML: <?xml version="1.0" encoding="UTF-8"?> <Orders> <Order Weight="1.00"> <Items> <Item ItemLength="5.00" ItemQty="1"> <ItemCharge Description="Chair" Amount="5.50"></ItemCharge> </Item> </Items> </Order> <Order Weight="2.50"> <Items> <Item Length="5.00" ItemQty="1"> <ItemCharge Description="Chair" Amount="8.50"></ItemCharge> </Item> </Items> </Order> </Orders> I need the attributes and values in the...

Data attributes with css selectors [duplicate]

css,data,attributes
This question already has an answer here: Select elements by data attribute in CSS 3 answers Hi I am trying to remove a div targeting it with a data selector. css [data-id="b5c3cde7-8aa1"] { display:none; } does not work. Is is possible?...

options[options.length] not working

javascript,jquery,html,attributes
I have jquery code that who takes values and update them in database. The problem is that it seems not working now. it says: Uncaught TypeError: Cannot read property 'length' of undefined Here is some portion of code: $('#response_title').val(''); $("#response_new_enter").hide(); $("#response_own_enter").show(); img.attr("src","images/add_btn.png"); var options = $('#response_').attr('options'); options[options.length] = new Option(response_title,...

Working with HTML output tag to view scalable image and assign src

javascript,html,css,attributes
I have the following code, which returns an image using the output attribute from HTML. I want to be able to scale/edit this image with max-width and max-height. I also want to assign this image an SRC. My HTML: <input type="file" id="files" name="files[]" file-model="myFile"/> <output id="list" class="resize-image" alt="Image"></output> My JS:...

CSS :not() with [attribute*=value] selector not works properly

css,html5,css3,attributes,css-selectors
I'm using [class*="menu-class-"]:not(.menu-class-2) for my <li> elements, it works properly. The problem is when I want to point to the <a> tag inside the <li>, [class*="menu-class-"]:not(.menu-class-2) a. For some reason it doesn't work. CSS: .nav-menu .menu-class > .sub-menu li[class*="menu-class-"]:not(.menu-class-2) { display: table-cell; } .nav-menu .menu-class > .sub-menu li[class*="menu-class-"]:not(.menu-class-2) a {...

Leverage MultipleApiVersions in Swagger with attribute versioning

attributes,asp.net-web-api2,swagger,swagger-ui,swashbuckle
Is it possible to leverage MultipleApiVersions in Swagger UI / Swashbuckle when using attribute routing? Specifically, I implemented versioning by: using System.Web.Http; namespace RESTServices.Controllers.v1 { [Route("api/v1/Test")] public class TestV1Controller : ApiController { ... } Version 2 would be in a v2 namespace. In a controller named TestV2Controller. The route would...

I need help displaying an Xml file with php in table form

php,xml,table,attributes
So all-knowing community, once more I seek your help. I have been working on something for the past few days and it is starting to drive me insane. I need to grab the contents of an xml file and display it in a table. Since it has various levels I...

Python - How to pull an attribute out of list of custom objects and convert it to a float?

python,lambda,floating-point,attributes
I am a novice Python user so I hope I haven't missed something basic but I feel I've done my due diligence in trying to research this problem on my own so here goes. In brief, I am writing a program that will analyze sports statistics and ultimately generate a...

Magento Ignore Child Attributes in Layered Navigation

magento,attributes,layered
I have some bundled products that have attributes associated with them. The child products also have the same attributes associated with them, however they are sometimes different. My issue is that with layered navigation, it is looking at both the bundled product and all the child products' attributes. I was...

Xaml: < and > in Attributs like: Text=“<- vor”

xaml,attributes,unicode-escapes
I want to write something as that what I wrote in the title in a XAML attribute. I know I have a book in that it stays but its a really thick book and I dont find it anymore. Also I cant search it with Google, because it dont accept...

Creating an Attribute class that allows adjusting a base value?

python,python-3.x,get,attributes,set
I want to create an Attribute class so I can do stuff like: class Creature: def __init__(self, health=100, armor=0): self.health = Attribute(health) self.armor = Attribute(armor) Now when I do c1 = Creature() c1.health += 10 It actually doesn't change the real value, but it keeps health's base value at 100,...

Why do I always get the error “list” object has no attribute 'tranpose'?

python,matrix,attributes
This is my code: class Matrix(object): """List of lists, where the lists are the rows of the matrix""" def __init__ (self, m=3,n=3,ma=[[1,2,3],[4,5,6], [7,8,9]]): self.n_rows=m self.n_cols=n self.matrix=ma=list(ma) def __repr__(self): """String representation of a Matrix""" output= "Matrix: \n{} \n Your matrix has \n {} columns \n {} rows"\ .format(self.matrix, self.n_cols, self.n_rows) return...

Python list of objects, get all 'orientations' of attributes

python,list,object,attributes,swap
I have a list of objects(rectangles). Each object has 2 attributes(height and width). I would like to get all 'orientations'(not sure how to call it exactly) of this list, so all the 2^n(for a list of n rectangles) orientations in which height and width of the rectangles are (possibly) swapped....

jQuery link elements by attribute

jquery,attributes
I have this script: $('.bx').each(function () { $(this).mouseover(function () { $(this).css("background-color", "blue"); if (this.id == $('.tester').attr("id")) { $('div.tester').css("display", "inline-block"); } }); $(this).mouseout(function () { $(this).css("background-color", "white"); $('.tester').css("display", "none"); }); }); What I want to do is this: when I hover over some of these input fields, a hidden div should...

Listing Product Attributes in Alphabetical Order (Woocommerce)

php,wordpress,attributes,woocommerce,product
For starters thank you for taking a look / any assistance you may offer. I am trying to create a custom page template that creates a list in alphabetical order displaying all the results for a specific (Woocommerce) product attribute across my site. So in my case the product attribute...

Using reflection to get attribute names in struct returns value__

c#,reflection,struct,attributes
I want to populate a combo box with all of the available item types in my struct ItemTypes: public enum ItemTypes { Ore, Ice, Mineral, Pi } In order not to add a new item type in 2 places if I do have to add one eventually (not likely, but...

How to get all the src and href attributes of a web site

javascript,image,website,attributes,src
I want a way to get all the src and href attributes(like images and links) in a website. How can i make this in javascript? I try this: var ilist=document.links; for(var i = 0; i < ilist.length; i++) { if(ilist[i].href) { alert(ilist[i].href) } } But for a something, this not...

Should I use the same VBO for passing different vertex attributes? Or should I use 2?

c++,opengl,attributes,shared,vbo
I know the glVertexAttribPointer will use the values from the VBO that was bound when it was called. But can you buffer twice onto the same object? Would it replace what was in? Or can you clear a buffer? I don't know if this approach is correct: glBindVertexArray(VAO); glBindBuffer(GL_ARRAY_BUFFER, VBO);...

Difference between ContentPropertyAttribute and ContentProperty [duplicate]

c#,wpf,attributes
This question already has an answer here: What's the difference between [Something] and [SomethingAttribute] [duplicate] 3 answers I hope this wasn't asked already. But i found nothing. If something exists, thanks for the note. The title says it all i think. I've seen these two variants. But in my...

jQuery select when attribute NAME starting with? [duplicate]

javascript,jquery,html,asp.net-mvc,attributes
This question already has an answer here: jQuery - How to select value by attribute name starts with 3 answers I want to remove all attributes with name starting data-val-range. I.e. from the following element I wanna remove the matching attributes: <input data-val-range-min="*" data-val-range-max="$" data-val-range="hallelujah"/> Is this possible?...

Setting the attribute of an object to be and attribute of another object

ruby-on-rails,ruby,attributes
Im very new to Ruby on rails. I am trying to set a Product object (:userid) to the user object id (user.id). So far I have got this class Product < ActiveRecord::Base before_create :set_userid def set_userid self.userid = User.new(params[:id]) end end Is there any other way to set the value...

Set value of specific property by custom attribute

c#,properties,configuration,attributes
I am currently developing a software that will be used by users that should not be able to access the back-end of it all but should still be able to easily change configuration/settings for the application. I decided the best approach would be a custom "configuration file (.cfg)" located in...

How can I get childnode's attribute from xml in java dom4j?

java,xml,attributes,dom4j,child-nodes
I'm trying to get the childnode's attribute from my xml file.For example,the file's name is bb.xml, The xml is just like this: <?xml version="1.0" encoding="utf-8"?> <aaa> <bbb name="MainMenu"> <ccc name="abc" Classes="1" A="2" B="3"/> </bbb> <bbb name="Mainwindow"> <ccc name="abc" Classes="4" A="3" B="2"/> </bbb> </aaa> and main java file is this: public...

Validation doesn't fire (System.ComponentModel.DataAnnotations)

c#,validation,attributes,system.componentmodel
I have this class here with 2 properties Name and Age using System.ComponentModel.DataAnnotations; public class Person { [Required(AllowEmptyStrings = false)] [StringLength(25, MinimumLength = 2)] [RegularExpression(@"^[a-zA-Z]+$")] public string Name { get; set; } [Range(0, 100)] public int Age { get; set; } } and I try to validate the values Person...

Hide attribute of an element from DOM

javascript,attributes,hidden
As the title says, I would like to add a new hidden attribute to an element. To avoid any confusion, I want the attribute to be hidden, not the element. I have a div: <div id="hello_div">Hello!</div> I add an attribute: $('#hello_div').attr('my_attr', 'attr_value'); So I can get it later: var v...

How large of a String should generally be stored in one core data entity attribute?

ios,core-data,attributes,entity
How large of a String should generally be stored in one core data entity attribute? At what point should the String be broken into multiple attributes or even multiple entities with relationships? I don't know how space-dense Strings are. Imagine wanting to save text from 100 pages into 1 attribute:...

Add element with text from class name in jQuery

javascript,jquery,attributes
I need help adding a <code> element that contains the text of a specific class name. This is my base markup: <div class="ctnr"> <div class="up-triangle"></div> </div> It should look like this after adding the <code> element which in turns has its sibling's element's class name: <div class="ctnr"> <code class='info'>.up-triangle</code> <div...

Should I use a single object or individual values as attributes in an Angular directive?

javascript,html,angularjs,angularjs-directive,attributes
This is kind of a 'best practices' question, but I still think there may be a correct answer. I have a directive with six configurable options. Should I set up six different attributes on the directive (like below): <my-directive my-width="300" my-height="300" my-status="true" my-foo="yes" my-bar="no"> </my-directive> or, should I pass a...

Declaring a local variable within class scope with same name as a class attribute

c++,class,variables,attributes,local
While observing another person's code, i realized that within class A's method he declared a local int with the same name as an attribute of class A. For example: //classA.h class A{ int Data; void MethodA(); }; //classA.cpp #include "classA.h" using namespace std; void A::MethodA(){ int Data; //local variable has...

Sending a Class' attribute to an outside function in the function call

python,class,tkinter,attributes
I'm trying to generalise a function in my script by sending in the Class' attribute through the function call to an outside function, but since I have to call the attribute self.attribute_name inside the class and object_name.attribute.name outside it, I either get an error that no self.attribute_nameexists outside the code...

Python: Appending elements to list of a class

python,list,class,attributes
I have a class that looks like this class Someclass(something): name = "SomeClass" field=[XShortField("Field", 0x1000)] This class is used by another function, but before it is used i would like to append elements to the field, like if option == 0: #nothing is added pass elif option == 1: #one...

Compare Variable with Model Attributes

c#,regex,attributes
I have a class: public class Email { [RegularExpression("^[a-zA-Z0-9_\\+-]+(\\.[a-zA-Z0-9_\\+-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z]{2,4}$", ErrorMessage = "Must enter valid email.")] [StringLength(256)] public string Address { get; set; } } I have a DB that contains "bad" data where Address is no longer supported by my new RegEx. my code is as follows: Email newUser =...

What's the difference between the square bracket and dot notations in Python?

python,object,collections,attributes,member
I come from a Javascript background (where properties can be accessed through both . and [] notation), so please forgive me, but, what, exactly is the difference between the two in Python? From my experimentation it seeems that [] should always be used, both to get the index of a...

why does empty attribute break script?

javascript,jquery,attributes,title,uncaught-typeerror
It is my lovely title. So I tried to manipulate with title for Scrollme.js. And here my script code which it got it from here. I have some manipulate with that and: $("[title*='aniscroll']").each(function() { $(this).addClass("scrollme animateme"); var title = this.title, when = this.title.match(/when=(.*?)(\s|$)/), from = this.title.match(/from=(.*?)(\s|$)/), ... crop = this.title.match(/crop=(.*?)(\s|$)/)...

Java Atribute In Class and Subclass

java,class,attributes,subclass
I have the class Mappa with a subclass MappaFermi and an attribute mappaName (to choose from an Enum). I am trying to write a test whith the constructor MappaFermi() but i can't seem to write it correctly. public class Mappa { private Name mappaName; public Mappa (Name mappaName){ this.mappaName=mappaName; ......

Should I use a cite attribute, at its current state?

html,html5,attributes,cite
So, the citeattribute is used with an URL as a value to indicate the source of a quote (for <q> and <blockquote>) or a page that can provide additional information (for <del> and <ins>). Because this URL isn't shown in any way to the end user by the browser, the...

Ruby Update Attribute with Sum of Database Attributes

ruby-on-rails,ruby,database,attributes,sum
I have a database with three values: tips_value, profile_value, and value. For each entry in the database, whenever I update the entry, I want to take the sum of tips_value and profile_value and assign it to value, but it's not working. Here is my update function: def update @affinity =...

Delete attribute from class instance python

python,class,oop,attributes
I have example class: class A(): other_attribute = 2 def __init__(self): setattr(A,"my_attribute",1) a = A() How can I delete my_attribute and other_attribute from instance? PS. I edited code to better explain problem. For example I have class, which dynamically adds attributes class A(): def __init__(self, attribute_name, attribute_value): setattr(A, attribute_name, attribute_value)...

XML transformation: Creating node in output xml from node attribute of input xml using xslt

xml,xslt,attributes,transform
I have searched many sites to accomplish below requirement without success. Hope to get some hint here. I want to transform input XML in a particular format as shown below to output format, The attributes of a node from input XML is used as a node in output XML Input...

Save attributes to values

jquery,table,checkbox,attributes
In my current program I am trying to pull the data-price value and the value=" " as well. I know I need to somehow implement the $(this).attr( ) but it isn't pulling the right information. I am trying to declare a value called id for the seat name and value...

How to access the property of an object that was created dynamically using __getattr__

python,python-2.7,attributes
I have some classes of resources: class Tokens(): def __init__(self, a, b): self.a = a self.b = b def create(self): return "Tokens resource" class Users(): def __init__(self, a, b): self.a = a self.b = b def create(self): return "Users resource" I have a client class: class Client(): def __init__(self, account,...

set super product attributes 'Attribute Name' to 'use default '

magento,attributes
How can i change programmatically for all configurable products 'Attribute Name' use default ? I need to checked options. The place where I want to checked is marked in red http://i.imgur.com/LFxR8mj.png

Recursion, parsing xml file with attributes into treeview c#

c#,xml,recursion,attributes,treeview
I'm currently working on a project where an application will take on XML files and display it into a treeview in C#. I'm using Visual Studio 10 to write this code. I cannot limit number of times the attributes are displayed. I used a foreach loop to loop through each...

Can I restrict a custom attribute to void methods only?

c#,attributes,custom-attributes,postsharp
I have a custom attribute which I would like to restrict to methods with return type void. I know I can restrict to methods using [AttributeUsage(AttributeTargets.Method)] but there doesn't seem to be a way to restrict the return type or any other aspect of the methods signature. The [System.Diagnostics.Conditional] attribute...

Java attributes

java,object,attributes
I am trying to build a UML class model for an android game that I have developed. I'm finding it difficult to understand the difference between objects, attributes and operations. Any suggestions?

Is it bad to have an empty attribute class?

c#,reflection,attributes
I have created an attribute which will define which properties have "special" data. My Attribute looks something like this: [AttributeUsage(AttributeTargets.Property)] public class TestAttribute : Attribute { } I don't need anything in the body of the class because all it's doing is identifying the properties. Is this bad practice? If...

Visual Studio: replace default doubleclick-event

c#,winforms,visual-studio,events,attributes
I am aware of DefaultEventAttribute but I am still a bit clueless of how to implement it correctly. I have made a simple control class that inherits from NumericUpDown: public class NumericControl : System.Windows.Forms.NumericUpDown I want to use it in my project instead of a default NumericUpDown control, and I...

How to filter out nodes from an XML using PERL script

xml,perl,filter,attributes,libxml2
This question is all over the internet but all the examples I see do not take into account my apparently unique circumstances. Here is an excerpt from my XML: <message type="error" from="Realtime" timestamp="Mon Nov 24 19:28:55 2014"> Could not receive from Loader </message> <message type="warning" from="Dcd_Mux" timestamp="Mon Dec 1 02:31:18...

Custom Vertex Attributes GLSL

c++,opengl,attributes,vertex
I want to make a couple of vec4 vertex attributes in my shaders. I've done quite a bit of googling, but I can't seem to find consistent information for specifically what I want to do. My goal here is to move skinning to the GPU, so I need a list...

Length of elements using jQuery is 0

jquery,list,attributes
I am trying to populate a ul with the following code item = [] item.push('<li title ="head"' + 'id="' + innerValue + '">' + innerKey + " : " + innerValue + '</li>'); alert('<li title ="head"' + 'id="' + innerValue + '">' + innerKey +" : " + innerValue +...

return RSS attribute values via BeautifulSoup

python,attributes,rss,beautifulsoup
RSS: (in a file called myfeed.rss) <?xml version="1.0" encoding="utf-8" ?> <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:newznab="http://www.newznab.com/DTD/2010/feeds/attributes/"> <channel> <title>MyFeed</title> <link>http://website</link> <description>RSS Feed</description> <language>en-us</language> <item> <title>title goes here</title> <pubDate>Tue, 09 Jun 2015 15:15:23 -0600</pubDate>...

XSLT sort by attribute and attribute value (with exclude)

sorting,xslt,attributes,xslt-1.0,alphabetical
I have a following XML code: <module> <component> <output> <output-test> <exclude-output/> <orderEntry type="specific"/> <orderEntry type="other"/> <orderEntry type="module" module-name="module1"/> <orderEntry type="module" module-name="module3"/> <orderEntry type="module" module-name="module2"/> <orderEntry type="library" name="library1"/> <orderEntry type="library" name="library3"/> <orderEntry type="module" module-name="module4"/> <orderEntry...

Python attribute button error

python,button,tkinter,attributes
Hey guys im just trying to create a simple button gui (absolute n00b ) but i can seem to figure out whats wrong with my code: ``__author__ = 'Isaac' from Tkinter import * class Application(Frame): """ My smart board application""" def __init__(self, master): Frame.__init__(self, master) self.grid() self.create_widgets() def create_widgets(self): #Button1...

How to change an attribute of a javascript prototype object

javascript,object,attributes,prototype
html base <html> <head> </head> <body> <input type="text" class="abc"/> </body> </html> So I have my prototype object function AnArray(){ this.anArray=[]; } AnArray.prototype.getAnArray=function(val){ return this.anArray[val]; } AnArray.prototype.setData=function(index,val){ this.anArray[index].data=val; } var objAnArray=new AnArray(); the object ends up looking like this id: 1, pid: "questions-worth-asking", num: 1, data: null and I'm trying to...

PHP - get value of an XML attribute

php,xml,attributes
source.xml <property> <name>a</name> <description>aaa</description> <example value="b" description="bbb">b1</example> <example value="c" description="ccc">c1</example> </property> search.php $xmlDoc=new DOMDocument(); $xmlDoc->load("source.xml"); $x=$xmlDoc->getElementsByTagName('property'); $z=$x->item(0); $c=$z->childNodes; for ($j=4;$j<($cd->length);$j++) { echo ("<div>" . $c->item($j)->attributes()->description ....

Python Passing a Function to an Object

python,oop,object,attributes
I am trying to create a class which allows users to create a custom button object, which holds the button's appearance attributes, as well as a function, which I want to be able to then run when I call the button's executeFunction() command. def foo(): print "bar" class Button(object): def...

Assigning graph attributes using a function in R

r,attributes,igraph
I am working on a set of functions that will allow me to plot network data in various ways. Because some procedures are being used in multiple functions, to avoid copying and pasting I try to turn such procedures into mini-function that I can then simply recall whenever necessary. Right...

Python class attributes and their initialization

python,class,attributes
I'm quite new in python and during these days I'm exploring classes. I have a question concerning attributes and variables inside classes: What is the difference between defining an attribute via just q=1 in the body of the class and via defining self.q=1 inside the __init__? For example, what is...

Get textColor attr from what was defined in xml

android,xml,attributes,textview
I am trying to get the android:textColor that was set inside the xml layout in my CustomTextView. How can I get it from the AttributeSet attrs?

DDD: Can an entity have attributes of primitive data types?

object,attributes,entity,domain-driven-design,value
The domain driven design differentiates two model types: entities and value objects. In the most examples the attributes of an entity are value objects or other entities, while the attributes of a value object are mostly simple strings, integers etc. (i. e. primitive data types). That leads me to the...

XSL for transformation of text node

xml,xslt,attributes,element,transformation
There is a xml (for the example the xml is simplified) <object attr1="1" attr2="2"> xxxxxxxxx <someattrs> <someattr1>a</someattr1> <someattr2>b</someattr2> <someattr3>c</someattr3> <someattr4 attr3="3"> yyyyyyy <someattr5>d</someattr5> <someattr6>e</someattr6> <someattr7 attr8="f"> <![CDATA[ zzzzzzz zzzzzz zzzzzz zzzzzzzzzzzz ]]> </someattr7> </someattr4> </someattrs> </object> With the xls transformation which is meant to...

AttributeError: 'NoneType' object has no atribute 'insert'

python,attributes
I am having a problem with my code. I keep getting the following error: AttributeError: 'NoneType' object has no attribute 'insert' Could anyone tell me why I am getting this error? Here is my code and the snippit where it is causing the most problem below that. class Heap(object): def...

Render outcome of “action” attribute?

jsf,attributes,action,renderer
i want to completely rewrite a <h:commandButton> renderer. Now i'm stuck at rendering the "action" attribute of the button. Is there a possibility to render this attribute the same way it gets rendered by the standard renderer ? Is there a possibility to retrieve the generated script from somewhere ?...

Cannot get attribute from PropertyInfo c#

c#,asp.net,asp.net-mvc,reflection,attributes
I have a class and interface set up like this: public partial interface INav_Item { [FieldID("df918977-369c-4a06-ac38-adb8741b5f75")] string Title {get; set;} } public partial class Nav_Item : INav_Item { [FieldID("df918977-369c-4a06-ac38-adb8741b5f75")] public virtual string Title {get; set;} } And then I have this class inherited: public class MenuItem : Nav_Item { public...

What happens if Vertex Attributes not match Vertex Shader Input

opengl,attributes,glsl,vertex-shader,pixel-shader
As I know, if the vertex buffer has an attribute that shader does not use, there will be no problem. What happens if the vertex buffer does not have an attribute that the vertex shader uses for OpenGL? I know for DirectX11, nothing will draw if the attribute needed in...

Error when appending a node of XmlNodeType::Attribute to an XmlNode

xml,dom,attributes,appendchild,xmlnode
Could someone please explain what I am doing here wrong that I get this error: The specified node cannot be inserted as the valid child of this node, because the specified node is the wrong type. on the last line in this code? XmlDocument^ xmlDoc = gcnew XmlDocument(); XmlNode^ xmlNode...

Dynamic annotation/attribute values

c#,validation,annotations,attributes
I run into a problem using data annotations in c#. I am using custom required and range attributes and I want to set an object as the error message. [MyOwnRequired(ErrorCode=GlobalMessages.Message01] public string Description { get; set; } The problem is that I do have a class holding several objects (GlobalMessages.Message01,...

how to access xml tag by attribute of the parent

php,html,xml,xpath,attributes
This is part of the xml: <?xml version="1.0"?> <menu> <pizzas> <pizza number="0"> <title>Tomato &amp; Cheese</title> <small>550</small> <medium></medium> <large>975</large> </pizza> PHP: <?php session_start(); ?> <div id="basket"> <h3 style="text-align:center; position:static;">Your Order:</h3> <?php $numberSelected = ''; $_SESSION['link'] = $numberSelected; class dom{} $dom = new dom; $dom = simplexml_load_file("../../menu.xml");...

Attr value is declared in two different libraries

android,design,attributes,styles
I added a library to my project in Android Studio. But as soon as I tried to compile my project I got this error: Attribute barColor has already been declared. After that I checked the whole project and noticed that another library is already declaring that same attribute! How can...

Accessing a custom attribute from within an instanced object

c#,attributes
I'm trying to find a way to get access to attributes which have been applied at the property level from within an object, but am hitting a brick wall. It appears that the data is stored at the type level, but I need it at the property level. Here's an...

How to fetch attribute value of parent node from child nodelist.(XPath)

xml,xpath,xml-parsing,attributes,parent-node
Here's the requirement I have a xml document which looks something like this -<page height="777" width="777"> -<block r="777" l="777" blockType="Separator"> +<region> +<separator> -<block r="777" l="777" blockType="Separator"> +<region> +<separator> -<block r="777" l="777" blockType="Text"> +<region> +<text> </page> I have all the separator blocks in separatorNodeList String expression = "//page/block/separator"; XPathExpression expr =...

JavaScript - Child attribute value is automatically changing when changing parent attribute value

javascript,jquery,html,drag-and-drop,attributes
I am new for drag and drop functionality. Here is may app link in codepen http://codepen.io/anon/pen/myzVxq This is how it works, data-appt in drop class is used to specify number of .drag placed in it. Only two .drag can be placed in a .drop class. data-appt in drag class is...

remove disabled property from a html object in jquery

javascript,jquery,attributes
I am adding html on my page on click of a button.So when i adding the html i want to remove all the disabled property from the html variable so that the new html don't have any disabled inputs : Code: var current_td = $(thisobj).closest('tr').html(); var next_td = $(thisobj).closest('tr').siblings('tr.add').html(); var...

Creating a status attribute for a model

ruby-on-rails,ruby,activerecord,model,attributes
I want to create a status attribute for my Taskmodel that would indicate where it is in a three part progress in this order: open => in-progress => complete. It would work in a way similar to how an Amazon package is delivered: ordered => shipped => delivered. I was...

Extract attributes of an string

java,string,attributes,extract
I got to deal here with a problem, caused by a dirty design. I get a list of string and want to parse attributes out of it. Unfortunately, I can't change the source, where these String were created. Example: String s = "type=INFO, languageCode=EN-GB, url=http://www.stackoverflow.com, ref=1, info=Text, that may contain...

How to add an extra metdata to a field of an object?

c#,attributes,metadata
I have an abstract class Node that everybody should implement in our office: public abstract class Node { public abstract void run(); } The implemented classes should also contain at least one input and one output properties. Please look at the following example: public class LineNode : Node { public...

XLS Copy Child Element to Parent Attribute

xslt,attributes,parent-child,xls,elements
I'm just starting to learn about XLS just do modify my XML below. In particular, I would like to copy the value of the <description> element and replace it into the name attribute of its parent <game>. Source XML: <?xml version="1.0"?> <menu> <game name="$100000P" index="" image=""> <description>$100,000 Pyramid (1988)</description> <cloneof></cloneof>...

Form Tag Helpers Cannot Process '-' in Rails 4

ruby-on-rails,validation,attributes,form-helpers,parsley
I am trying to use Parsley for Rails 4 with Form Tag Helpers. As said in the documentation "Options" provide a way for custom attributes; However, Parsley uses the notation "data-parsley". Rails cannot interpret the "-" and application brings out an error. Is there a workaround? Thanks,...

How to properly escape quotes inside form INPUT attribute assignments?

attributes,cgi,quoting
I have various things that need to end up in a CGI form, thus: <INPUT TYPE="TEXT" SIZE=64 MAXLENGTH=64 NAME="name" VALUE="thing"> ...my understanding (limited, but I'm learning) is that CGI inputs require double quotes as delimiters. However, some of the things I need to put in there have double quotes. Some...

Woocommerce Filter Product by Attribute

filter,attributes,woocommerce,product
I've been searching for many blogs and forum but this seems not yet answered yet. So i am trying to find a way how to filter product by attribute. I am using ajax to pull data and append it.The question is what will be the query to make a loop...

Reflection doesn't recognize that class is inherited C#

c#,inheritance,reflection,attributes
My Problem is I want to get the data from custom Attributes, I don't know which argutement to give the typeof() Method to take the current type. [AttrN("test1")] [AttrC("test2")] public class cl2 :cl1 { //should find attributes and set fields from base public cl2() : base() { } } public...

Python AttributeError: I don't know why this is not working [closed]

python,tkinter,attributes,syntax-error,trackback
from tkinter import * def Exit(): print() def newClassResults(): #assigns variable to an input so it can be reffered to later amount = int(input("How many people would you like to add? ")) #starts for loop for counter in range(amount): #assigns inputto a variable called 'newName' newName = input("\nEnter the new...

No such column for attribute in a join table

ruby-on-rails,activerecord,attributes,associations,jointable
I'm trying to create an app where a user chooses volunteers to complete their task. The way that volunteers are considered participants is through the selected boolean attribute placed on the TaskVolunteer join table. Unfortunately when I try to find the participants of a particular class I get the following...

Is it possible to get an HTML attribute to CSS?

html,css,attributes
I'm making a carousel and I wanna set a background image for every carousel item and I want the background image to be the same image that's inside the item, so the image has a src attribute and I want to get it into the CSS automatically to set it...

Changing an attribute of a variable selector in Jquery?

javascript,jquery,variables,attributes,selector
I'm playing around with some Jquery as a hobby and I've run into a problem with changing the attribute of whatever the user clicks on. I have a bunch of tabs and didn't want to have create an event thingy for each of them, so I'm trying to put it...

Retrieving Entities from Core Data: Printing properties gives me incomplete/unwanted results?

objective-c,core-data,printing,attributes
I've recently decided to move all my application data from plists to Core Data. This was pretty straightforward. I had a class with a couple properties I would read all my plist info to using a dictionary. This was mimicked by creating an entity with the same exact attributes. I...

How to mark function argument as output

c++,c,gcc,attributes,out
C# allows to mark function argument as output only: void func(out int i) { i = 44; } Is it possible to do something similar in C/C++? This could improve optimization. Additionally is should silence out warnings "error: 'myVar' may be used uninitialized in this function", when variable is not...

how to select all elements with matching attribute of this in jQuery?

javascript,jquery,html,attributes,this
I would like to select all elements within a div that have the same attribute as the selected element, using the this selector. So in my example, when I click on an element with a class of .foo, I would like to find all elements within .container that share the...

check all jquery not working for dynamically populated checkbox

jquery,checkbox,attributes
I have a jquery function to select all checkboxes , which are populated in PHP loop. The output of the loop is similar to below: <label class="check"><input type="checkbox" name="selectall" value="All"/> Select All</label> <label class="col-md-3 col-xs-12 control-label">Types Of function</label> <div class="col-md-6 col-xs-12"> <div class="col-md-7"> <label class="check"><input type="checkbox" name="chkUser" class="icheckbox"/> Birthday</label> </div>...

Yii, changing original posted attributes

php,yii,attributes
I'd like to ask, is it possible to change the original posted attributes in actionCreate()? For example I have 3 attributes: name, phNumber, address In the _form.php, it automatically posts these 3 attributes. BUT what if I want to change the posted name attribute to all Uppercases? Do I need...

What is the % CSS Color Attribute supposed to mean?

css,attributes
I have a client that has asked for the following color for the background of an element: PMS227 75% What color is this? What is the 75% supposed to mean? ...

How to increase the size of a variable using XSLT

xml,xslt,attributes
I have an XSLT file that contains the following attribute set <xsl:attribute-set name="related-links__content"> <xsl:attribute name="start-indent"><xsl:value-of select="$side-col-width"/></xsl:attribute> </xsl:attribute-set> The value of $side-col-width is a number with a unit (such as 24pt). What I need to do is increase this value by a specific about. Semantically, this is what I'm trying to...