13,136 questions
Advice
0
votes
5
replies
89
views
Can overusing the [[assume]] attribute cause problems?
I wonder if using the [[assume]] attribute can have negative effects on my code, even if the expressions inside are always true.
In my code, I defined the following macro:
#ifdef DEBUG
#include &...
0
votes
2
answers
108
views
Is it possible to use generic argument of a type for its attribute parameter (JsonConverter)?
Use case: I want to write a JsonConverter for a generic type like this, but I cannot apply it to the type itself:
public class EditingModelConverter<T> : JsonConverter<EditingModel<T>&...
1
vote
0
answers
26
views
C# Setting MessageContractAttribute WrapperNamespace from appsettings
I have a soap service reference file that has MessageContractAttribute. I need to set the WrapperNamespace from appsettings depending on the environment.
[System.ServiceModel.MessageContractAttribute(...
0
votes
1
answer
75
views
Automate removal of div/span attributes for code clean-up and easier merging
<span class="SpellingError SCXO166867203 BCX8" style="margin:0px;padding:0px;background-repeat:repeat-x;background-position:left bottom;">bv</span><span class="...
3
votes
4
answers
94
views
Why must classes be defined in order of appearance in python module?
Let's say I have a python file test.py that looks like this:
class MyFirstClass():
prop=3
class MySecondClass():
prop1 = 0.
prop2 = MyFirstClass()
Then I can run this and it works:
from ...
0
votes
0
answers
34
views
Adding global attributes to existing netCDF file in Xarray
I have netCDF files of oceanographic data processed in Python, that I'd like to update the global attributes of (i.e., add the same attributes to a bunch of files). Tried doing it in Xarray per their ...
0
votes
1
answer
39
views
WindowsDowndate tool error: AttributeError: type object 'PathEx' has no attribute '_from_parts'
I've been trying to use a python tool called WindowsDowndate from github (for educational purposes, I've been given the task to demonstrate some Windows exploit) but running the code just does not ...
0
votes
1
answer
55
views
Apply contenteditable to selected columns in HTML Table
Is it possible to applay the contenteditable attribute to selected columns in an HTML table?
According to https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/col and https://...
4
votes
2
answers
82
views
How to use ValidateScript on a collection instead of the elements in the collection?
Microsoft docs mention that if I apply the ValidateScript attribute to a collection, it will evaluate each element of the collection:
If this attribute is applied to a collection, each element in the ...
1
vote
1
answer
64
views
How do I get value of one node's attribute based on value of another nodes attribute?
Using Saxon parser freebie.
This is a snip of a larger XML file.
<osmChange>
<modify>
<node id="28377390">
<tag k="name" v="Holywell"/>...
0
votes
0
answers
83
views
Sanitize HTML input in a C# class attribute
If one wishes to sanitize HTML input, he has to use a library like HtmlSanitizer. Example:
var sanitizer = new HtmlSanitizer();
var sanitized = sanitizer.Sanitize(model.htmlInput);
Is it possible to ...
0
votes
3
answers
83
views
HMTL form to PayPal fails if an attribute has single or double quotes in the field
I occassionally receive:
Error Processing Payment
We're sorry, we can't complete your payment at this time. Please try again later.
This error occurs when being sent to PayPal, so no user interaction ...
0
votes
1
answer
218
views
In CSS, how do I conditionally style the :root pseudo-element using attributes?
I have some JS which needs to effect some styling of an entire rendered HTML document. What I current use is the following CSS:
[myattr="true"] { direction: rtl; }
[myattr="false"]...
1
vote
1
answer
74
views
Dynamic read-only attributes in python instances
EDIT This code contains several bugs, see jsbueno's answer below for a correct version
I would like to create read-only attributes that dynamically retrieve values from an internal dictionary. I have ...
0
votes
1
answer
41
views
Use the details name attribute in a shadow DOM
How can the name attribute be used if a details element is inside of a shadow DOM?
When a name is set, multiple dialogs are supposed to be grouped, which allows them to be opened exclusively from each ...
0
votes
1
answer
41
views
Error: Download error: Error: 'Ytube' object has no attribute 'get_video_url'
if format == 'mp3':
download_url = yt_video.get_audio_url()
elif format == 'mp4':
download_url = yt_video.get_video_url()
here is the code, when I run it I get this error: Download error: ...
1
vote
0
answers
50
views
When importing from Printify service to Woocmmerce
When importing from Printify service to Woocommerse, the variations in attributes do not match color, size and price. I transferred attributes to global and variations are posted in a scatter. Here is ...
0
votes
1
answer
224
views
In Visual Studio 2022, is there a way to output two executables from a single project
I'm using Microsoft Visual Studio 2022 Community edition.
I want to create two executables from the same project using conditional attributes.
Example:
using System;
public class MyClass
{
...
0
votes
2
answers
87
views
Windows PowerShell error when attempting to bulk edit the Cost Center (costCenter) attribute
I'm trying to change the "costCenter" attribute. I noticed in the Schema the description was originally "Cost Center". I thought maybe the space was an issue so changed it to &...
0
votes
1
answer
92
views
What does __fortify_function do under GCC?
I am working on a program I wrote a while ago and have come across something I can't figure out why I did it.
__fortify_function void DoLog(const char* format,...)
As suggested by the name the ...
2
votes
0
answers
182
views
Differences between pure, const, reproducible, unsequenced in C
Recently C23 added two new attributes: unsequenced and reproducible, which are now supported by GCC alongside the existing pure and const.
I am slightly confused by the exact differences between all ...
1
vote
1
answer
47
views
(Python) cant access attribute of an object unless I check nullity, why? [closed]
A LeetCode problem which is about linked lists that goes with this structure:
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = ...
0
votes
0
answers
88
views
Can a Camel Bean be supplied or injected with additional data?
According to Camel's doc the Bean component has a parameters query parameter. If I understand Parameter binding correctly this works with bean handler methods only, right?
Now, with a class:
class ...
1
vote
1
answer
58
views
How to add a namespace prefix to XML attribute
I have a class that represents XML element:
[System.SerializableAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")][System.Xml.Serialization.XmlTypeAttribute(AnonymousType ...
0
votes
1
answer
85
views
Statically get all attributes of class
I want to be able to call a static method of a class (or classmethod) to only get the attributes of that class. By the attributes of the class, I mean the ones that are set in the constructor of the ...