21,615 questions
1
vote
1
answer
79
views
Stored Procedure Syntax Error (SQL Error [1064] [42000]) [duplicate]
DELIMITER //
CREATE PROCEDURE CreateProductTable()
BEGIN
CREATE TABLE IF NOT EXISTS product (
product_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
product_name ...
Advice
0
votes
13
replies
101
views
string String^ System::String^ what the difference in C++
I am started coded in C++ not so far ago, and I still don't understand some things.
For example, what is system. And if I declared using namespace system; at the top of code then I should write just ...
Best practices
1
vote
4
replies
65
views
Rust: unpack tuple in place (like *args in Python)
I have a tuple-struct and I want to init it with the values from another tuple, and I want to do it in one line, like I would with the `*args`:
pub struct Dimensions(pub u32, pub u32);
...
// let ...
1
vote
1
answer
85
views
Syntax match issue with lookahead (regex \@=)
My understanding is the match resulting from \@= SHOULD NOT INCLUDE the lookahead characters. Here is an example that has me perplexed:
syn match InspectKeyword '\v(\+\s)\@=\w+'
Results in:
The ...
0
votes
0
answers
45
views
Angular dialog popup with query parameters (without using materials package)
need to know the syntax for router.navigate for dialog Popup from a click event
below routing works ( as a non dialog webpage) & wanted convert into a popup !
but how do I open it as a dialog(...
0
votes
0
answers
65
views
Bootloader stopped working after I changed the syntax from gas to nasm
I have this bootloader I made a while ago and I would like it to be in nasm:
.intel_syntax noprefix
.code16
.equ STACK_TOP, 0x7C00
.equ SELF_LOAD, 0x7C00
.equ ELF_HDR_LOAD, 0x7E00
.equ SECT_SIZE, ...
Best practices
1
vote
1
replies
36
views
What are the pros and cons of a terse property/method-syntax?
In designing a language from scratch, should methods use a self variable to access properties and other methods? Or should they imply their target with .prop? Or should they treat properties as local ...
2
votes
2
answers
213
views
Why is the position of `[:space:]` within a character class seemingly important?
I'd like to use constants to build regular expressions. However, in this case I got an unexpected syntax error:
#!/usr/bin/perl
use strict;
use warnings;
use constant CR_SAFE => '[:alnum:]@,._\-...
-2
votes
2
answers
141
views
Is there a way to capture a value from the left expression and use it on the right expression?
I want to modify or compute a value before assigning it to a const. Is there a way to do this in a single line expression?
I can use labeled block syntax, but I’m wondering if there’s another syntax ...
Advice
0
votes
1
replies
231
views
Why are double brackets required?
The following minimal example does not compile in Delphi 12.1:
program Project1;
{$APPTYPE CONSOLE}
uses
System.RTTI;
var
Value: TValue;
begin
TValue.Make (0, TypeInfo (TObject), Value);
...
-4
votes
1
answer
93
views
C++ preprocessor VARARGS - invalid syntax in a NodejS header file
I'm experimenting a bit with trying to build NodeJS 24.11.1 with GCC 13.4.0 on an older OS X system, mostly as a can-it-be-done project.
Regardless of the reasons, among the hurdles that could be ...
0
votes
2
answers
137
views
Windows 11 powershell run executable with parameter switches when IF statement false
Windows 11 Power shell
I'm trying to run the following IF statement in power shell - basically to check if a file exists on encrypted drive P, if it doesn't then create the encrypted drive. I get an ...
23
votes
1
answer
3k
views
How does the compiler interpret '____'?
I have found a piece of code that defines register access permissions for a chip. Using arm-none-eabi-gcc it compiles correctly.
Here is the code:
static const uint8_t defaultRegisterAccess[...
3
votes
1
answer
145
views
PowerShell Script: When the Ethernet Port status changes why doesn't the status report show the actual port status?
I am an occasional casual programmer (for about 60 years now!). I wrote 2 functional SNMP PowerShell desktop shortcut scripts 4 years ago. Now I am writing two scripts for my old Windows 10 system: ...
0
votes
0
answers
127
views
New dbt Prehook Depreciation Syntax?
I have a prehook in the config section of my model. I don't want it to be part of the project yml, just in my model query itself. It's been working fine up until this week where I started getting ...
2
votes
3
answers
175
views
Calling exe with Start-Process is not getting arguments correctly
I have a tool for editing the VersionInfo portion of our executables so that we can tie all of the different components to one installer part number. The tool I am using is resourcehacker (https://www....
-1
votes
1
answer
62
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 ...
4
votes
2
answers
156
views
Can I instantiate an object in PowerShell and set a property in a single command?
I know how to instantiate object in PowerShell but I am struggling to find out if its possible to instantiate an object and set one of its properties in the same command.
The following commands work ...
0
votes
2
answers
102
views
TypeScript error when linking to nested route with parentheses "Type '/(auth)/register' is not assignable to type 'RelativePathString'"
I'm building a React Native app using expo-router, and I’ve set up my authentication routes inside a group folder:
app/
├── (auth)/
│ ├── login.tsx
│ └── register.tsx
├── (tabs)/
│ └── index.tsx
...
1
vote
2
answers
132
views
Adjusting syntax table for a derived mode in .emacs
In order to view/edit Doxygen files, I am using
(define-derived-mode dox-mode
html-mode "dox"
"Major mode for Doxygen."
)
(add-to-list 'auto-mode-alist '("\\.dox\\'&...
0
votes
0
answers
46
views
I have an Analysis in Quicksight AWS and I want to create a vlookup to select a row within the dataset
Within AWS Quicksight we have created an analysis that has
several transactions all in different currencies that are all on different dates
there is a column that shows the GBP FX rate for that ...
0
votes
1
answer
91
views
Why does only .Range("A2") work when I'm setting a value between two sheets? How can I make variable references work?
Very new to VBA for excel.
I'm trying to put values from one sheet into another sheet. I've scoured the internet for solutions, and nothing has worked. Every time I get a 1004 Error: Application-...
0
votes
0
answers
92
views
VIM keywords in syntax regex
I am currently writing a c3 syntax file for vim and I have some issues with a highlight.
I have this line:
syntax match ModuleName "\<module\>\s*\zs[a-z][a-zA-Z0-9_]*\ze;" display
and ...
4
votes
1
answer
108
views
Windows PowerShell parsing json - bracket vs dot
Using Windows PowerShell terminal for running a PS script.
I need to do (among the rest) some json file parsing. I ended up in a strange situation, here below posting a minimal example:
Json file:
{
...
0
votes
1
answer
79
views
Timestamp format fix needed
I'm trying to query a time-series container with 10M+ IoT records, but my TQL query fails with
GS3008: [TQL] Syntax error near '>' (position: 45)
Here is the query:
SELECT sensor_id, AVG(value)
...
0
votes
1
answer
106
views
Could anyone explain this syntax of XAML?
Could anyone explain this syntax of XAML?
<Window x:Class="WpfApp1.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://...
-1
votes
1
answer
59
views
Linking union query to subquery
I'm trying to write a query that will join a subquery with a large union query and I'm having some trouble.
Below is the subquery:
SELECT DISTINCT X.JOB, FOO.PART FROM
(SELECT C.PART, C.ORDER_NO, C....
1
vote
1
answer
120
views
What is the proper syntax for Postgres SET expression
There's a sql batch script that mostly consists of truncate copy and insert instructions.
Script is tended to be executed as psql -f ./script.sql
After the tables being moved to specific schema trying ...
-3
votes
1
answer
86
views
if (a is not 1 and not 2) vs if(a is not 1 and 2)
Straightforward question, how can I differentiate these ifs?
if (a is not 1 and not 2)
{
...
}
and
if (a is not 1 and 2)
{
...
}
As I understand it, first one can be written as if (a != 1 &...
2
votes
4
answers
156
views
Declaring volatile pointer to a pointer which points to non-volatile data
When accessing a hardware register in C/C++, I usually create #defines like this:
#define HW_REGISTER ((volatile uint16_t *)0xFFFF8A00)
I.e. 0xFFFF8A00 is a pointer to a volatile uint16_t value and ...
4
votes
4
answers
221
views
Is there something better than <<- EOF in bash?
I recently tried to use the <<- operator for heredocs in bash to keep indentation in my bash functions:
cat <<- EOF
Hello World
EOF
However it turns out this only strips literal tab ...
3
votes
1
answer
108
views
Const expression optional fields
Imagine that you want a way to remove fields at compile time depending on generic parameters. You can do this:
struct MyStruct<T, const B: usize>
{
optional: [T; B]
}
If B = 0 then the ...
1
vote
3
answers
155
views
Reusable subroutine in batch file
Trying to figure out the syntax in a batch file subroutine so it could be reused with a passed parameter.
Main portion of batch file...
Set PC=THISISATEST
Call :ToLowerCase
Subroutine...
:ToLowerCase
...
0
votes
0
answers
45
views
Why is createPayment undefined?
Payment error: TypeError: Cannot read properties of undefined (reading 'createPayment')
I have checked that I'm using SquareClient and not Client. I have simplified my code to use only commonJS and ...
2
votes
1
answer
84
views
Why use this syntax `{": "}` in React instead of just writing a colon
I saw this code snippet on the React dev page (https://react.dev/reference/react/memo#updating-a-memoized-component-using-state):
export default function MyApp() {
const [name, setName] = useState(''...
0
votes
1
answer
74
views
What is wrong with the syntax of this SQL Anywhere script
Can anyone tell me what is wrong with the syntax of the following SQL Anywhere script:
BEGIN
DECLARE myoutput_line LONG VARCHAR;
DECLARE mytable_name VARCHAR(128);
DECLARE ...
-1
votes
1
answer
110
views
How do I specify a default value for a template template parameter? [duplicate]
I have a function which takes a template template parameter, e.g.:
template <template <typename K, typename V> typename Map>
void foo();
I want to specify a default value for Map; namely, ...
9
votes
1
answer
288
views
Why can this C++ code pass compile check? [duplicate]
I accidentally added a semicolon in an expression constructing std::string, but the compiler happily accepted it without complaining anything.
I did a minimum reproducible example below, kindly teach ...
6
votes
2
answers
204
views
Associativity of '*' operator in a 'new' statement in C++
I have a user-defined class Person and I want to create a variable-sized array (size taken at runtime) of Person pointers.
The following code works as expected.
Person **arr = new Person* [size];
...
1
vote
3
answers
179
views
Apply Where-Object shorthand operators to entire object
Where-Object's params providing shorthands for builtin operators, one can skip the scriptblock and write:
Get-ChildItem | Where-Object { $_.Name -match '\.(txt|md)$' }
as:
Get-ChildItem | Where-...
2
votes
2
answers
132
views
Powershell prompt, red trailing character on error
I am trying to create my own Powershell prompt in $profile.
For now, i have the following :
$ESC = [char]27
$RESET = "$ESC[0m"
$pwd = $executionContext.SessionState.Path.CurrentLocation
...
-2
votes
1
answer
375
views
Html syntax to add a website link to a craigslist post
Curious to know why the acceptable syntax in html for adding a website link fails when attempting to add an html website link to a craigslist ad when there are posts created by others with functional ...
0
votes
0
answers
27
views
I get the error MIPS: 'spim: syntax error on line 9 addi x10, x0, 0'
New to mips, so some of the text or formatting is from the professors instructions.
Trying to translate the following C-Code into Mips Assembly language using Qtspim and Notepad
a=0
for(i=0;i<10;i++...
2
votes
1
answer
52
views
Curry generic types [duplicate]
I have the following syntactical problem: I want to declare a generic function of another more general, also generic type: The following example should make clear what I mean:
The general type could ...
1
vote
1
answer
115
views
How can I improve this UML diagram code for an ordering system?
I'm working on a UML diagram using PlantUML to represent a simple ordering system. I’ve written the code, but I’m not sure if it's fully accurate. What can I improve or correct?
Diagram produced by ...
21
votes
3
answers
1k
views
Why Does R Allow Omitting {} in Function Definitions?
I have a question regarding R function syntax. I've noticed that the following function works fine without curly braces {}:
sign_function <- function(x)
if (x > 0) "Positive" else ...
-4
votes
3
answers
118
views
Could the vector begin() be deduced? [closed]
I wonder why C++ is designed to insist on the iterator syntax? Why is it not possible to ommit the begin() iterator in some contexts? For example:
std::copy(v.begin() + 1, v.begin() + 3, w.begin() + 6)...
0
votes
1
answer
62
views
Unexpected vim region match
I'm relatively new to vim's syntax highlighting and its regex engine, which seems to be very differnt from others I've used (mainly perl, pcre, posix). This vim syntax highlighting problem has been ...
1
vote
1
answer
327
views
ABAP newline in ABAP ADT Console
How can I add a new line on a string in ABAP on Eclipse?
This is my code below and I just want to put a newline after the first line so my code will not be redundant:
OUT->write( |Firstname: { ...
3
votes
2
answers
149
views
Calling member arrow operator -> recursively
The member arrow operator is treated by the compiler in a special way. Since an overloaded arrow operator can have an arbitrary return type, several such operators from different classes may need to ...