1,760 questions
1
vote
1
answer
84
views
Correct semantic markup for a quote's author: <cite> vs. <span> [closed]
Based on the HTML examples provided, is it considered better practice to mark up an author's name with the cite tag or a span tag? I've read that the cite tag is intended for referencing a work (like ...
-1
votes
1
answer
55
views
Syntactically required and semantically relevant tokens in Python grammars
I am trying to parse code into AST. I want to keep minimum keywords and delimiters in the AST while keeping the semantics.
In Python function definition def foo():, the last : is syntactically ...
1
vote
1
answer
55
views
MemberExpression evaluation order of null/undefined base
Why does the following code throw TypeError: Cannot set properties of null instead of Error: property key evaluated?
var base = null;
var prop = {
toString: function() {
throw new Error("...
13
votes
5
answers
2k
views
How Does the Left-Hand Side (LHS) of an Assignment Evaluate in C?
I’m working on understanding pointers in C by breaking down the language into three key areas: syntax, semantics, and idioms.
To grasp pointers, I’ve been focusing on fundamental concepts:
what’s an ...
0
votes
2
answers
198
views
How do I infer the weakest precondition when a loop invariant is given?
I previously asked this question on StackOverflow about using loop invariants to catch a bug in my program. Now, I want to take the next step and understand how to compute the weakest precondition ...
1
vote
2
answers
97
views
How do I use a loop invariant to catch a bug in my program?
I’m learning about weakest preconditions, loop invariants, and verifying program correctness (e.g., with an SMT solver). From the slides here in slide 11, I see how placing a loop invariant can help ...
1
vote
0
answers
204
views
Customize Accessibility on Horizontal Pager Jetpack Compose
I'm trying to customize the accessibility for the horizontal pager.
This is how the pager looks. The previous and next view are partially visible. But I don't want these partially visible views to ...
0
votes
0
answers
22
views
Computing weakest preconditions with conditional value dependencies
I'm trying to compute weakest preconditions working backwards from the postcondition c > 10. Specifically, I want to determine what conditions func_1() should satisfy (i.e., what value of b it ...
0
votes
0
answers
61
views
How to compute weakest preconditions for class methods with object state in Python?
I am working on a tool to compute weakest preconditions for certain Python programs, and I’m struggling with handling class objects and their variables. Here's a minimal example of the problem:
For a ...
0
votes
2
answers
102
views
Zig(`sytax/declaration`) Semantic of error as only return type of function. Or what actually do `catch`
I don't know if this is correct behavior according to the author, or if there's a mistake in compilation.
const std = @import("std");
const expect = std.testing.expect;
const expectError = ...
4
votes
4
answers
185
views
What's the point of declaring the main function's formal arguments as "int argc, char* argv[argc+1]"?
I typically declare the main function's formal arguments as either int argc, char* argv[] or int argc, char** argv to take in the actual arguments from the command line. But I noticed a senior C ...
2
votes
2
answers
208
views
Is `int x;` really just a declaration or an implicit definition too?
In C, suppose an object is declared, for instance int x; as an automatic variable. Without initializing it with any value, is it still considered just a declaration and not definition?
Cause ChatGPT ...
2
votes
0
answers
24
views
Using sub-classes as anchors and classes as positives and negatives in a Siamese network with triplet loss?
I’m experimenting with a Siamese network using triplet loss to categorize sub-classes into broader classes. My setup differs from traditional triplet loss models: It involves using the sub-class as ...
0
votes
1
answer
70
views
Syntax vs Semantics in Ontology Mappings
I’m working with two ontologies, A and B, which share the same semantics but are expressed using different syntaxes. Does the difference in syntax mean that it’s impossible to find correspondence/...
1
vote
0
answers
69
views
Accessibility - How to Programmatically Shift Screen Reader Focus to a Specific Widget in Flutter?
I am working on a Flutter project and incorporating accessibility features within a quiz.
My question:
How can I ensure that after a user selects an answer, the screen reader automatically focuses ...
1
vote
2
answers
122
views
Signal-only channel at the beginning of goroutine
I ran into the next piece of code (simplified) and can't understand purpose of channel check. This snippet was found right before a function end.
check := make(chan struct{}, 1)
go func() {
check &...
0
votes
2
answers
219
views
Should function parameters be named as a plural or singular object? [closed]
This is probably a dumb question so forgive me. I've used many cmdlets that have a parameter that is named as a singular object, yet it accepts multiple objects.
This makes sense to me for the ...
-2
votes
3
answers
142
views
Confusion to interpret declarations in C
I'm working on improving my C programming skills and have encountered a confusing aspect related to pointer declarations. I'm hoping to gain a better understanding of the differences between these two ...
1
vote
1
answer
147
views
Flutter Semantics showing empty array for scrollview
I am facing a problem with Flutter semantics with the scroll view. If there is a SingleChildScrollView of ListView the flutter semantics announce an unlabeled item.
The code is really simple.
...
0
votes
1
answer
622
views
Is there a way to use the Python SDK to implement hybrid search + semantic reranking in AzureAI search?
As implied by this article: https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-cognitive-search-outperforming-vector-search-with-hybrid/ba-p/3929167 it is possible to perform a ...
0
votes
0
answers
50
views
Small corpus, want to find associations. Word2Vec?
I'm a psychologist, and I'm diving into the field of AI. I could really use some help for a project. This semester, I discovered Word2Vec and was mesmerized by its capability to find associations. So, ...
1
vote
1
answer
95
views
Correct semanticly select styling [closed]
I want to create a custom-styled select element in my web app. However, I'm concerned about the approach I should use. Styling the default select gives me some options, but I can't fully style the pop-...
0
votes
2
answers
93
views
Can the semantics of a translation unit depend on a function declaration that is never used?
Can the semantics of a well-formed C++ translation unit depend on the
presence of a function or function template declaration that is never
used? By "used", I mean it is selected by ...
-3
votes
2
answers
116
views
Perceived changes in the last decade (or more?) with respect to the semantics of char** and char*[] declarations in the c language
compiler context
First off, I'm currently using Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.7.5. (Just in case this question is more about the tools I'm using than the ...
0
votes
2
answers
191
views
Shared triples between two knowledge graphs
I want to compare two semantic Knowledge Graphs, to see if they have any triple in common, using cypher.
MATCH (n1)-[r1]-(c1)
MATCH (n2)-[r2]-(c2)
WHERE r1.filePath = "../data/graph1.json" ...
2
votes
2
answers
123
views
eval vs Function() return semantics
We have the product (normal desktop app) that wants to pull some data from the Adobe products (from the documents, opened in these products). Since the Apple events are too slow, we implemented a ...
1
vote
2
answers
802
views
Is a hidden heading in the <footer> needed for accessibility?
Is it necessary or helpful for accessibility of my website to add a heading saying footer in the footer? I know the footer is a landmark en therefor a user of a screen reader could find out the ...
0
votes
1
answer
760
views
How to make talkback read out Text and switch together in Android?
Hello I am trying to make talkback read out text from Text() and default line from Switch() using compose semantics. This is my code:
var toggle by remember {
mutableStateOf(true)
...
0
votes
1
answer
298
views
How Vespa addresses memory limitations in big data applications
I'm trying to index over 200 million documents using HNSW in Vespa, but it consumes significant memory as the number of files increases. My server has 64GB of memory, and I estimate storing all data ...
0
votes
1
answer
280
views
Custom HLSL Structure
Is it possible to replace built-in packed variables like float4 or int4 with custom HLSL structures without changing the functionality of the data? For example, instead of using a uint4 (x,y,z,w), ...
0
votes
2
answers
85
views
Inconsistency in application of the increment operator when used in expressions
In JavaScript we have postfix (x++) and prefix (++x)increment like many other C derivative syntax. I know that both prefix and postfix increment has a higher precedence than addition.
So if we do the ...
1
vote
0
answers
392
views
Is it a semantic or syntax error to not have an argument list after a name prefixed by the template keyword?
According to [temp.names]p6, "A name prefixed by the keyword template shall be followed by a template argument list or refer to a class template...".
The example provided shows
A<T> a;
...
0
votes
1
answer
57
views
For..of loops confusion
So I've been writing 'for' loops only with the (let i = 0; i < arr.length; i++) set up until now. This is visually something you can break down and understand so its been logical for me. Now I'm ...
2
votes
2
answers
794
views
showSemanticsDebugger does not work anymore
When I set showSemanticsDebugger to true, it should show the semantics tree representations, it worked fine about 2 months ago, but it's not anymore. I suspect it's an issue related to the latest ...
-2
votes
1
answer
593
views
Flutter, automatically add Semantics value to all Text Widgets
I need to add Semantics value to all Text Widgets, Is there a way to do it automatically, to avoid manual addition?
-1
votes
1
answer
91
views
Are there any scenarios where it would be appropriate to use an H1 in a document after an H1 has already been used? [duplicate]
With consideration to semantics and accessibility, can I do something like this?
<h1>My Lightbox Demo</h1>
<h2>Thank you for trying this</h2>
<div>
<button aria-...
0
votes
1
answer
256
views
TextField onValueChange - Announce Additional Semantics
Using a custom TextField implementation, but it still uses the BasicTextField provided by compose.
BasicTextField(
modifier = Modifier
.fillMaxWidth()
.semantics(mergeDescendants = ...
1
vote
0
answers
100
views
Semantics (Subtyping)
I am trying to bring the following grammar into the Haskell language :
data Expr
= Var String
| Bool Bool
| Int Int
| Float Float
| BinaryOp Op Expr Expr
| UnaryOp UnaryOp Expr
| App ...
3
votes
0
answers
329
views
Is there a good way to add semantic enrichment to Enums using pydantic?
I want to add semantic enrichment to the JSON schema generated by pydantic BaseModels. The problem occurs when I want an element of the model to be an enumerated type. I can't figure out the correct ...
0
votes
1
answer
872
views
Axe devtools throwing unnecessary violations
So I have this navigation bar with the following structure:
click for code snippet
I am following the same structure that is present in https://www.w3.org/WAI/ARIA/apg/patterns/menubar/examples/...
-1
votes
2
answers
49
views
Footer is on top. Any solutions without adding a wrapper? [duplicate]
How to make a footer always pressed to bottom?
Whenever I make a new page and there's still no content, considering that my header is fixed, my footer always jumps to top. I want to get rid of this ...
1
vote
1
answer
1k
views
Flutter semantics accessibility issues [flutter]
I am attempting to add a header, similar to an HTML h1 tag, to my login webpage created with Dart/Flutter. This is to comply with WCAG accessibility guidelines. To achieve this, I am utilizing the ...
-1
votes
1
answer
56
views
What does the ? operator do in C#? [duplicate]
I'm looking through this piece of code: https://github.com/aras-p/UnityGaussianSplatting/blob/main/package/Runtime/GaussianSplatRenderer.cs and line 65 has,
m_CommandBuffer?.Dispose();
Which I don't ...
0
votes
0
answers
42
views
Is this nesting of HTML elements invalid or semantically incorrect? main > section > header > h1 [duplicate]
I submitted a solution on a front-end component and I was told that the header should not have H1s within it, that it is a landmark outside the main tag and it has a "banner" role meaning it ...
6
votes
1
answer
174
views
Semantics of set() versus Set() versus Set.new
Should &set, Set, and Set.new have different semantics? If so, why?
Consider the following code:
my @array = 1, 2;
my @other-array = ([3, 4],);
dd set(@array, @other-array); #OUTPUT: Set....
-2
votes
1
answer
1k
views
Ideal HTML semantics for Customer Review
I need to include a few customer reviews on my page and am unsure if my approach is semantically and practically correct.
I might be overthinking this a little bit, so input would be welcome!
I would ...
1
vote
0
answers
1k
views
How to specify custom semantic roles in flutter semantics?
I'd like to use flutter's semantics to make my page more accessible.
From what I understand there are web standards that define which elements on the page should have which role, as defined e.g. here. ...
0
votes
2
answers
93
views
How do I make a text appear normal in a <div> included in an Anchor Element?
to learn HTML more in depth I'm building the website of a famous fashion brand, trying to emulate and build all the functions that I see with the HTML knowledge that I have.
I'm coding a part of the ...
1
vote
2
answers
178
views
Strange behaviour of the alternative operator //
Using JQ 1.5 I've problems understanding the output of the alternative operator // in a specific situation.
Given this input:
{
"a": 42,
"b": false,
"c": null
...
3
votes
1
answer
293
views
Appium and Compose NoSuchMethodError crash
Upgraded to the lastest version of compose, then oversuddenly i get this crash on the app. Not sure if this is caused by Appium or the app itself:
java.lang.NoSuchMethodError: No super method ...