Tag: go

60 votes
5 answers
476 views
How do I calculate a point on a circle’s circumference?

How can the following function be implemented in various languages? Calculate the (x,y) point on the circumfe

avatar
Joseph
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
48 votes
19 answers
456 views
Mapping two integers to one, in a unique and deterministic way

Imagine two positive integers A and B. I want to combine these two into a single integer C. There can be no

avatar
Benton
0 1 0 9
asked 07 September, 2021
63 votes
22 answers
1.1K views
How does C compute sin() and other math functions?

I've been poring through .NET disassemblies and the GCC source code, but can't seem to find anywhere

avatar
Thurman
0 1 0 9
asked 07 September, 2021
56 votes
19 answers
646 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
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
62 votes
11 answers
1.3K views
Fast ceiling of an integer division in C / C++

Given integer values x and y, C and C++ both return as the quotient q = x/y the floor of the floating point eq

avatar
Patsy
0 1 0 9
asked 07 September, 2021
63 votes
26 answers
2.7K views
How to check if a number is a power of 2

Today I needed a simple algorithm for checking if a number is a power of 2. The algorithm needs to be: Simpl

avatar
Majorie
0 1 0 9
asked 07 September, 2021
57 votes
6 answers
2.2K views
How do I determine whether my calculation of pi is accurate?

I was trying various methods to implement a program that gives the digits of pi sequentially. I tried the Tayl

avatar
Hilario
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
473 views
Calculate distance between two latitude-longitude points? (Haversine formula)

How do I calculate the distance between two points specified by latitude and longitude? For clarification, I&

avatar
Forrest
0 1 0 9
asked 07 September, 2021
62 votes
30 answers
1.1K views
Easy interview question got harder: given numbers 1..100, find the missing number(s) given exactly k are missing

I had an interesting job interview experience a while back. The question started really easy: Q1: We have a b

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
57 votes
10 answers
1.9K views
How can I temporarily disable a foreign key constraint in MySQL?

Is it possible to temporarily disable constraints in MySQL? I have two Django models, each with a foreign key

avatar
Hildegard
0 1 0 9
asked 07 September, 2021
56 votes
3 answers
2.8K views
How can I specify or get the resource id of a nativescript textfield

We are using nativescript with angular for our mobile app. I want to use the Google Play pre-launch report fea

avatar
Wei
0 1 0 9
asked 07 September, 2021
51 votes
4 answers
3.1K views
Chrome Devtools opens as a search rather then the dev tools themselves

Trying to run a Nativescript debug session and every time I enter chrome-devtools://devtools/bundled/inspect

avatar
Suzan
0 1 0 9
asked 07 September, 2021
55 votes
10 answers
758 views
Representing and solving a maze given an image

What is the best way to represent and solve a maze given an image? Given an JPEG image (as seen above), wha

avatar
Serina
0 1 0 9
asked 07 September, 2021
56 votes
6 answers
732 views
How to send a correct authorization header for basic authentication

I am trying to POST data from my API but I can't pass the basic authentication. I try: $.ajax({ type: &

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
60 votes
11 answers
1.3K views
Google Maps v2 - set both my location and zoom in

My question is, does anyone know how to set google maps up, to open up both my location and in a zoomed-in vie

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
53 votes
11 answers
2.8K views
Do Google refresh tokens expire?

I have used the refresh token several times in just a short period for testing purposes, but I wonder whether

avatar
Virgil
0 1 0 9
asked 07 September, 2021
53 votes
11 answers
1.7K views
How can I verify a Google authentication API access token?

How can I verify a Google authentication access token? I need to somehow query Google and ask: Is [given acce

avatar
Juliane
0 1 0 9
asked 07 September, 2021
48 votes
2 answers
1.7K views
HTTP Error: 401 while setting up firebase cloud functions for android project

I`m trying to set up firebase functions, but I get an error after running firebase init. Error: HTTP Error: 4

avatar
Juliane
0 1 0 9
asked 07 September, 2021