Skip to main content
Filter by
Sorted by
Tagged with
-2 votes
2 answers
126 views

Suppose I have the following: df1 <- data.frame(id=c(1,2,3)) df2 <- data.frame(id=c(2,3,4)) I want to print: (1) The number of IDs in df1 but not in df2, (2) the number of IDs in df2 but not in ...
robertspierre's user avatar
-4 votes
1 answer
90 views

Here is the prompt for my class assignment: Create an interactive program for ice cream sales you must sell at least four flavors of ice cream and you must us an evaluate statement. The ice cream ...
Katie Smith's user avatar
3 votes
2 answers
122 views

I was playing around in assembly and noticed that it's possible to overwrite a string in a variable as long as the new string does not exceed the size of the original string: MESSAGE DB 'Hello World', ...
Lavonen's user avatar
  • 702
5 votes
0 answers
142 views

My colleague Zag found that warning C4706: assignment used as a condition is detected by MSVC with /Wall switch only for some expressions and not for others. In the following example: #include <...
Fedor's user avatar
  • 24.7k
1 vote
1 answer
183 views

When looking up something in the Yocto project reference manual, I sometimes encounter ??= or ?= operators. Normally, a simple = is used in recipes instead. What's the difference between ??= and a ...
Mo_'s user avatar
  • 2,070
0 votes
6 answers
477 views

For example, there is a code: #include <stdio.h> int main(void) { int n = 54; int index = 2 * n; printf("%d\n",index); n++; printf("%d\n",index); ...
ALICEZzz's user avatar
  • 639
-2 votes
2 answers
143 views

I need to read a three-line text like: 4 10 foo into three variables: num1, num2, name. I tried IFS=$'\n' read num1 num2 name <<< $data, but that only initializes the num1, leaving the rest ...
Mikhail T.'s user avatar
  • 4,256
2 votes
1 answer
86 views

I'm having this error but I don't understand why. I'm creating a structure of size 3x4x4 with 6 fields within loops. Then, I would like to create two more fields for the whole structure. How can I do ...
GMIC's user avatar
  • 41
13 votes
5 answers
2k views

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 ...
Ghassen's user avatar
  • 179
0 votes
0 answers
48 views

I downloaded 11 years of reports from a government website and they each came in their own folder in a parent directory. The name of each subfolder is the year, and the file inside is named the same ...
Jon's user avatar
  • 163
0 votes
0 answers
33 views

Sometimes it may be necessary (yes, likely against best practices) to deal with nested objects, such as lists, which can require multi-level indexation. I am curious of the following: 1. In Python, is ...
cherry_popsicle's user avatar
1 vote
3 answers
131 views

This question is in relation to the question asked here: How to declare a variable but not assign it? My problem is slightly different. MRE: let var: MyGenericType; for value in ...
kesarling's user avatar
  • 2,322
0 votes
2 answers
213 views

So I'm learning to code (in C) for a few months now and I'm focusing here on memory allocation. My code is very simple, everything works, and yet at the end, it doesn't return a 0 but instead I get a -...
Fulmineo's user avatar
0 votes
0 answers
39 views

I've created the following Nginx Rewrite: rewrite ^/([0-9A-Za-z]*)$ /index.php?redirect_reference=$1; Then in my index.php I have: <?php echo $redirect_reference . "\r\n"; ...
Ron Piggott's user avatar
1 vote
1 answer
89 views

Selective assignment (with replicate on the left) works as expected: d←'bob' (1 0 0/d)←'B' d Bob But the same thing (though expressed with a commute) does not: d←'bob' (d/⍨1 0 0)←'B' ...
justin2004's user avatar
1 vote
2 answers
194 views

Consider the following code which opens a file for writing in a job, stops that job, then opens the same file for writing again: $filePath = [system.io.path]::GetTempFileName() $job = Start-...
alx9r's user avatar
  • 4,333
0 votes
1 answer
78 views

After I set a string variable in an if() statement, the variable does not exist. if (wallThicknessCBO.SelectedItem.ToString() == "2x6") { if (wallH <= 8) { MessageBox.Show(...
Davesexcel's user avatar
  • 6,992
0 votes
1 answer
68 views

I am a little confused regarding the assignment statement inside the code block of a for loop. EXAMPLE CODE: my_list = ['1', '2', '3', '4'] my_new_list = [] for element in my_list: element = int(...
Randy2792's user avatar
1 vote
2 answers
102 views

Suppose I do the following y <- c(1,2,3) x <- y Now I want to know what variable was used in the assignment of x. I want it to return "y". Any idea how to do that?
Peter Bonate's user avatar
3 votes
2 answers
150 views

I am learning omp and came across this issue... consider following code where: Arrays a, b, and c are initialized #pragma omp parallel num_threads(4) { #pragma omp for schedule(static, 64) ...
ABUL_SALASA's user avatar
0 votes
4 answers
132 views

I try to write a batch script comparing the input with 2 integers and if it's in their range, the value is assigned to a variable. The other string parameters can be also passed as an argument so I ...
Mikolaj's user avatar
  • 140
1 vote
0 answers
91 views

In Python, obviously it's possible to assign to names, e.g. a = 1. It's also valid to assign to attributes (a.b = 1 - AFAIK this corresponds to the __setattr__ special method) and indexing operations (...
user200783's user avatar
  • 14.5k
0 votes
1 answer
45 views

I am trying to optimize a code, which has allocations inside a function that is repeatedly called in a loop. I ran some performance tests using jupyter and results were counterintuitive for me. As a ...
cap's user avatar
  • 377
2 votes
1 answer
80 views

Trying to make a barebones Pokemon game and switching wont work When trying to switch Pokemon I can get the code to recognize activePlayerMon= has had a value switch when running through the ...
Polish Newscaster's user avatar
0 votes
0 answers
29 views

So I am following this book Programming: Principles and Practice Using C++ 3rd edition and in section 2.3 Author gives the following code: cout << "Please enter your first name and age\n&...
petat_irrumator's user avatar

1
2 3 4 5
90