This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package newyearchaos; | |
import java.util.Scanner; | |
/** | |
* | |
* @author Slava | |
* | |
* It's New Year's Day and everyone's in line for the Wonderland rollercoaster ride! | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package servicelane; | |
import java.util.Scanner; | |
/** | |
* | |
* @author Slava | |
* | |
*/ | |
public class ServiceLane { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Watson gives two integers (A and B) to Sherlock and asks if he can count the number of square integers between A and B (both inclusive). | |
* | |
* Note: A square integer is an integer which is the square of any integer. For example, 1, 4, 9, and 16 are some of the square integers as they are squares of 1, 2, 3, and 4, respectively. | |
* | |
* Input Format | |
* The first line contains T, the number of test cases. T test cases follow, each in a new line. | |
* Each test case contains two space-separated integers denoting A and B. | |
* | |
* Output Format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// Function to get absolute value of the number given by user. | |
float absolute(float num) | |
{ | |
if(num < 0){ | |
num = -num; | |
} | |
return num; | |
} | |
// Function to calculate square root of the number using Newton-Raphson method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float sqrtBinarySearch(n) { | |
low = 0.0; | |
high = (float)n+1; | |
while ((high-low) > 0.00001) { | |
mid = (low+high) / 2; | |
if (mid*mid < n) { | |
low = mid; | |
} | |
else { | |
high = mid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Change VM instance size | |
Get-AzureVM -ServiceName slavaceorneavm1 -Name slavaceorneavm1 | | |
Set-AzureVMSize -InstanceSize ExtraSmall | | |
Update-AzureVM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Select current azure subscription | |
Select-AzureSubscription -SubscriptionName 'Visual Studio Professional with MSDN' -Current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Import publish settings | |
Import-AzurePublishSettingsFile C:\temp\azureaccount.publishsettings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get publish settings file | |
Get-AzurePublishSettingsFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package finddigits; | |
import java.util.Scanner; | |
/** | |
* | |
* @author Slava | |
* | |
* Given an integer, N , traverse its digits (d1,d2,...,dn) | |
* and determine how many digits evenly divide N |
NewerOlder