Questions tagged [operations]
298 questions
-1
votes
1 answer
What does python to compare two strings?
What exactly is the meaning of comparing one string to another using greater (>) or lesser (<) operators and get true of false, like in this code:
shopping_list=['heineken', 'patagonia', 'backer', 'austria',…

Mauricio Reis
- 11
- 4
-1
votes
5 answers
Java: Any way to set variable to certain operation with another variable?
So is there an easy way to make it so a variable will change when another one changes?
Essentially:
int a = 0;
int b = a + 5;
int a = 1;
Is there a way to change b because a changed?
Thanks!

Kevin Liang
- 15
- 3
-1
votes
1 answer
What can i do to resolve a java warning during compilation?
I have a class DAG which extends another class ARCO. When I compile it, the prompt reports this warning in two lines:
Note: .\ARCO.java uses unchecked or unsafe operations
Recompile with -Xlint: unchecked for details
What is the problem? (class…

James The Beard
- 205
- 4
- 10
-1
votes
1 answer
K&R C Invert Function
Exercise 2-7. Write a function invert(x,p,n) that returns x with the n bits that begin at position p inverted (i.e., 1 changed into 0 and vice versa), leaving the others unchanged.
#include
int invert(unsigned int x, int p, int n)
{
…

Tommy Saechao
- 1,099
- 4
- 17
- 28
-1
votes
1 answer
C argv[] to double and operate with it
Is there a way to get a double with the ARGV[] function?
I've tried this, but it did not work in the way i want it to. My "solution" code is:
int MarkGenerator(double argc, double argv[])
{
if (argc > 3){
OnError("Too few arguments for…

Dominic Järmann
- 361
- 1
- 7
- 18
-1
votes
1 answer
Adding Byte Arrays of unlimited size in Java
Is there a simple way how to make byte arrays adding?
I mean a mathematical adding (no concatenation):
00 00 FF
00 00 FF
--------
00 01 FE
I can achieve that by converting the byte array to a numeric format, but this approach is limited by max…

Jolinar
- 866
- 8
- 16
-1
votes
1 answer
GUI freezes during for-loop once the button is clicked
In more details, I have a loop that takes in mathematical operations and a switch case in which it translates those operations in order to apply addition or subtraction.. etc.
The loop (int i) is the number of operations it reads. The condition is…

Nee
- 1
-1
votes
1 answer
SQL Operation to add 1000 to every number in a database row
I have some game servers that I run, and as my players play, they collect in game money for time played and PVP players killed, and use it to purchase gear in game. I recently had some downtime and want to give all my players a bonus of 1000 in game…

Ajster1989
- 197
- 1
- 12
-1
votes
1 answer
How do I extend infix and stack priorities to additional operators?
How would the infix and stack priorities be extended to include the operators <, >, <=, >=, ==, !=, !, &&, and ||?
When parsing an infix expression, for example: P + (Q – F) / Y#, each symbol has a priority which is relevant to their order of…

twodayslate
- 262
- 1
- 4
- 13
-1
votes
2 answers
Understanding Substr
I have a block of javascript here. Simple script that does as it is supposed to here:
var char, num, i, line, j;
char = input[0];
num = input[1];
l = "";
var Lines = new Array();
for ( i=0; i <= num; i++ ) {
l = l+char+char+char;
…

ninja_unmatched
- 1
- 2
-1
votes
2 answers
C++ looping a menu
I have the below code which compiles however I would like it to loop back to the original menu after the user has selected a choice so another can be picked.
Any help would be greatly appreciated.
#include
#include
using…

user3536870
- 249
- 1
- 2
- 13
-2
votes
2 answers
Java simple bitwise operation
We are given integer n, value v (v=0 or 1) and a position p. Write a sequence of operators that modifies n to hold the value v at the position p from the binary representation of n. Example:
n = 5 (00000101), p=3, v=1 -> 13 (00001101)
n = 5…

k1op0ly
- 1
- 1
- 1
- 2
-2
votes
1 answer
Counting number of comparisons in code
for(int i = 0; i < N * N; i = i + 1)
for(int j = 1; j < i + 1; j = j + 1)
junk = junk + 1;
I need to determine the relationship between the number of < operations executed and N. I should give an exact answer, such as 27N + 18.
Any…

Dale McCaughan
- 77
- 5
-2
votes
1 answer
file operations in java
Possible Duplicate:
how can I import a file in java programming language
How can we read and write a file in java? What are the basic operations to do this?

Niya Simon C
- 279
- 2
- 4
- 10
-2
votes
4 answers
Print First Repeat Character in a string and it's positions using java
Could please optimize the code below..
Requirement : Print the First repeat character in a string and their positions.
Example :
Case 1: String value is "XYABXB"
Out put should be : First Repeat Character is : X at position : 1 and repeat…

coder1608
- 171
- 6
- 14