Tag: io

68 votes
3 answers
3K views
Can I hex edit a file in Visual Studio?

I want to edit a binary file, but I don't want to use another tool other than Visual Studio because it&ap

avatar
Solomon
0 1 0 9
asked 07 September, 2021
56 votes
11 answers
1.1K views
Select all occurrences of selected word in VSCode

Are there any trick or extension to select all instances of selected word in visual studio code, to facilitate

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
61 votes
7 answers
703 views
Set language for syntax highlighting in Visual Studio Code

Before the confusion begins, this question is about Code, the new lightweight Visual Studio Editor. You can ge

avatar
Serina
0 1 0 9
asked 07 September, 2021
59 votes
6 answers
2.1K views
How do I force Sublime Text to indent two spaces per tab?

Is there a way to force Sublime Text 2 to always indent two spaces per tab when working with Ruby files? I kn

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
48 votes
15 answers
3K views
Open two instances of a file in a single Visual Studio session

I have a file, xyz.cpp. I want to open two instances of this file in Visual studio (BTW, I am using Visual St

avatar
Alba
0 1 0 9
asked 07 September, 2021
53 votes
19 answers
740 views
How do I duplicate a line or selection within Visual Studio Code?

Using Microsoft's Visual Studio Code, how do I duplicate a line of code and then move it up and down? (Si

avatar
Charis
0 1 0 9
asked 07 September, 2021
51 votes
24 answers
824 views
Turning off auto indent when pasting text into vim

I am making the effort to learn Vim. When I paste code into my document from the clipboard, I get extra space

avatar
Mikki
0 1 0 9
asked 07 September, 2021
53 votes
30 answers
405 views
Indent multiple lines quickly in vi

It should be trivial, and it might even be in the help, but I can't figure out how to navigate it. How do

avatar
Wei
0 1 0 9
asked 07 September, 2021
53 votes
9 answers
2.8K views
Is log(n!) = Θ(n·log(n))?

I am to show that log(n!) = Θ(n·log(n)). A hint was given that I should show the upper bound with nn and sh

avatar
Santiago
0 1 0 9
asked 07 September, 2021
63 votes
6 answers
1.9K views
What is the behavior of integer division?

For example, int result; result = 125/100; or result = 43/100; Will result always be the floor of the

avatar
Hallie
0 1 0 9
asked 07 September, 2021
56 votes
19 answers
644 views
The most efficient way to implement an integer based power function pow(int, int)

What is the most efficient way given to raise an integer to the power of another integer in C? // 2^3 pow(2,3

avatar
Stacia
0 1 0 9
asked 07 September, 2021
62 votes
7 answers
938 views
Why is division in Ruby returning an integer instead of decimal value?

For example: 9 / 5 #=> 1 but I expected 1.8. How can I get the correct decimal (non-integer) result? Wh

avatar
Robt
0 1 0 9
asked 07 September, 2021
53 votes
23 answers
2K views
How to determine if a list of polygon points are in clockwise order?

Having a list of points, how do I find if they are in clockwise order? For example: point[0] = (5,0) point[1

avatar
Charis
0 1 0 9
asked 07 September, 2021
67 votes
30 answers
1.2K views
Fastest way to list all primes below N

This is the best algorithm I could come up. def get_primes(n): numbers = set(range(n, 1, -1)) primes

avatar
Alba
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
3K views
Calculate distance between 2 GPS coordinates

How do I calculate distance between two GPS coordinates (using latitude and longitude)?

avatar
Stacia
0 1 0 9
asked 07 September, 2021
66 votes
16 answers
2.8K views
What is the difference between '/' and '//' when used for division?

Is there a benefit to using one over the other? In Python 2, they both seem to return the same results: >&

avatar
Thurman
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
791 views
Divide a number by 3 without using *, /, +, -, % operators

How would you divide a number by 3 without using *, /, +, -, %, operators? The number may be signed or unsig

avatar
Bryant
0 1 0 9
asked 07 September, 2021
52 votes
18 answers
1.6K views
How to perform an integer division, and separately get the remainder, in JavaScript?

In JavaScript, how do I get: The whole number of times a given integer goes into another? The remainder?

avatar
Dusty
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
1K views
Fastest way to determine if an integer's square root is an integer

I'm looking for the fastest way to determine if a long value is a perfect square (i.e. its square root is

avatar
Margo
0 1 0 9
asked 07 September, 2021
54 votes
4 answers
2.4K views
Is there an R function for finding the index of an element in a vector?

In R, I have an element x and a vector v. I want to find the first index of an element in v that is equal to x

avatar
Basil
0 1 0 9
asked 07 September, 2021