21,615 questions
0
votes
2
answers
110
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 ...
3
votes
1
answer
114
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: ...
2
votes
3
answers
150
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....
4
votes
2
answers
142
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 ...
1
vote
2
answers
125
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
1
answer
73
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-...
4
votes
1
answer
87
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
99
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
vote
1
answer
86
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 ...
0
votes
0
answers
34
views
Why does Python use different syntax for split() and join()? [duplicate]
In Python, when we use split(), the syntax looks like this:
list_result = string.split(separator)
But when we use join(), it's written like this:
string_result = separator.join(list_of_strings)
Why is ...
4
votes
4
answers
199
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 ...
1
vote
3
answers
140
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
...
2
votes
1
answer
82
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(''...
-1
votes
1
answer
103
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, ...
6
votes
2
answers
199
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];
...
2
votes
2
answers
101
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
...
0
votes
0
answers
26
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++...
1
vote
1
answer
97
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 ...
-4
votes
3
answers
117
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)...
1
vote
1
answer
267
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: { ...
2
votes
2
answers
101
views
How can I capture the text inside a pair of parentheses, if that text may itself contain parentheses, in Vim?
I'm looking at writing a C++ syntax file, in which I hope to be able to highlight some blocks and constructs.
One thing I want to highlight is an if block. I've figured out how to highlight the whole ...
0
votes
1
answer
35
views
Writing Textmate rules to match GABC/NABC sections in a .gabc file
I'm writing a VSCode extension to add syntax highlighting to .gabc files. I would like to match GABC and NABC sections within the code (so I can apply different patterns for each section), as follows:
...
-1
votes
2
answers
218
views
Why ISO C++ forbid taking the address of a bound member function to form a pointer to member function?
Here is the error in GCC (which i have already fixed):
ISO C++ forbid taking the address of a bound member function to form a pointer to member function
This is the error line of my code:
threads[i] ...
3
votes
1
answer
97
views
What is the difference between <Type>::method() AND Type::method()?
In Rust, is there difference between <Type>::method() and Type::method()? Any easy way to see the differences?
For example, this rocket swagger code uses <String>::responses(...).
0
votes
2
answers
59
views
Is `auto` a valid value for the HTML attributes `height` and `width`?
Is auto a valid value for the HTML attributes height and width ?
Please provide a reputable source. I was unable to find a reputable source saying yes or no (i.e. specifically settling this issue one ...