Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
If A=01, B=02...Z=26 and also every block consists of 2 letters, then how the number 83 will be decrypted?
For example, 0102 (or 102) makes AB.
I suggest that 83 will be 083, where 08 is H, but I don't know how to handle the 3
A=01, B=02...Z=26
lets add 64 to every int
A=64+01, B=64+02...Z=64+26
that will give u the correspending decimal number in the ascii-table http://www.ascii-code.com/
every block consists of 2 letters, wich mean 83 is 0083,
assuming 00 is or (space) < > 83 would be <">
another possibility; if we only use letters, then we r sure that the max int here is 26, so 3 can be used as 30 to mark the END of the message
If 00 had some meaning the number could be 0083, but it looks like your index starts with one so that would not be the case
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 years ago.
Improve this question
I looked at the game superloop.
You are a character which is either red, green, blue, or yellow. You get a shape assigned: either triangle, quad, pentagon, or circle.
You are traversing on one of three lanes on which are obstacles which are aligned to form a wall on the lanes. You can pass those obstacles if your character matches the shape or color.
The obstacles are all unique ( no one shares the color nor shape).
My question: Is there a chance to not pass through the barrier of obstacles?
I do not really get the question. However If you have one of 4 colors. Moreover you have one of 4 shapes so there are 16 combiations of your character.
To pass obstacle you have to be matched to its color or shape, so with 10 different obstacles there is 100% chance to pass . You are able to create 9 different obstacles character will not pass.
Lets say we use two groups of variables {1,2,3,4} and {a,b,c,d}. Character is 2c, so all the obstacles impassible to be passed are:
1a, 1b, 1d
3a, 3b, 3d
4a, 4b, 4d
10th combination will always match.
Mathematically if you have two groups of x and y elements there is no more than (x-1)(y-1) possibilities of "not passing", and in group of (x-1)(y-1)+1 unique "obstancles" you will always pass at least once.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
In the book 'Clean Code' by Robert C. Martin, he recommends making use of:
Circle makeCircle(Point center, double radius);
over
Circle makeCircle(double x, double y, double radius);
He basically argues that making a class to avoid using multiple method arguments is preferred.
What is your opinions on this? Please explain to me the benefits, or disadvantages of either.
There are a few reasons for this.
First, it helps to group parameters meaningfully. In this trivial example, it's immediately obvious that x and y go together, but it might not be as immediately obvious when dealing with a more obscure example.
Perhaps more importantly, it cuts down on having too many parameters to keep track of meaningfully; once you have a method that takes more than 3 or 4 parameters, it gets more and more cumbersome to keep track of which parameter is which. Binding parameters together in a class or struct helps avoid that.
Consider this example:
int HowManyMinutesToAirport(int AirportIdentifier, string AirportName, int PlainIdentifier, string PlainName, int PlaneSpeed, string PlaneCompassDirection);
vs.
int HowManyMinutesToAirport(Airport airport, Plane plane);
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
*[ ms = milliseconds ]
Imagine that you have a timeline starting at 162000 ms (00:02:42.000), and ending at 10358500 ms (02:52:28.500). You have a marker placed at 4974123 ms (01:22:44.123).
Now, this timeline can be dragged in any way - as long as the start time is smaller that the end time. For example, this is valid: 580000 ms to 610000 ms. This is not: 610000 ms to 580000 ms.
So, imagine that we drag this timeline to start at 338100 ms (03:00:32.100), and ending at 10842200 ms (03:00:32.200). So: What time is the marker placed on now? And how do I calculate this?
Your assumption is wrong -- this is a very simple mathematical issue. If the initial interval is from 100 to 300 and the marker is at 120, it is located (120 - 100)/(300-100) = 10 % of the span from the starting point.
If you change the interval to 500 to 530, the marker should still (I suppose you mean like that) be 10 % of the span from 500 to 530, that is, at 500 + 0.1 * 30 = 503.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm asking this question here because I believe this is more of a programmatic issue than anything else.
I'm using a TI-84 Plus Sliver Edition calculator that contains logical operators that can test for less-than, greater-than, and equality. I find that when I input the expression:
2^34 == 2^34 - 1
it gives me a surprising 1 for true. It's worth mentioning that my calculator can't precisely output the result of 2^34. Rather, it uses the exponential notation for it and any other powers greater than 33. Is this a potential factor in the boolean output?
Furthermore, the equality test only returns true if the second expression is subtracting by 1 to 9. When the number is >= 10 it then correctly returns false.
Could it be a rounding error? Why is this expression returning true?
Your calculator cant keep track of numbers that large.
Every calculator has a set level of precision (lets say 10 digits). Every answer the calculator gives is rounded so that the answer has that many digits, then it shifts the decimal place as much as it needs to in order to make the number big or small (in your case very large).
Your number is so large that when you subtract 1, that causes a change after the 10th digit. This then gets rounded back to what you started with, and then compared. So naturally, it thinks they are the same number (to the precision it is capable of).
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 14 years ago.
Improve this question
if digit is the name for a number on base 10, what would be the name for a number on base 16? Hexgit?
It's a "nibble" (i.e., half a byte).
http://en.wikipedia.org/wiki/Nibble
Digit. Simply a hexadecimal one.
Are you looking for an analogue to bit for binary digit? Hexgit wouldn't be my choice; it doesn't really roll off the tongue. As for the unit of storage, a hex digit represents a nibble's worth (or nybble).
define: digit
One of the elements that collectively form a system of numeration.
The word 'digit' can be used in any number system. The only exceptions are 'bit' which is really just short for 'binary digit' and 'trit' which is short for 'ternary digit'. (You can still call bits and trits 'digits', however.)
Still "digit", as long as you have 16 fingers ;-)
"Hexdigit" and "hex digit" are both in wide use in textbooks.
There isn't really a consensus, I don't think, but see Units of information for some options.
Personally, I'd just say "hex digit".
"Hexgit" would be a bad choice since "hex" formally suggests base six rather than 16.
"Hexdecit" would retain the 6+10 representation, but I would stick with "digit".