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
var sourceArr = [ | |
{ | |
"article_id": 71942, | |
"event_code": "A9", | |
"start_date": "2016-11-25", | |
"end_date": "2016-12-30", | |
"quantity_alloted": 120, | |
"first_delivery_date": "2016-11-25", | |
"year": 2016, |
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
1.upto(10_000) do |i| | |
Thread.new { sleep } | |
puts i | |
end |
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
#Create user by using following commands | |
#create user just_cinemas with password 'password123'; | |
#create database just_cinemas; | |
#GRANT ALL PRIVILEGES ON DATABASE just_cinemas to just_cinemas; |
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
It is not necessary to check all numbers. In fact, the most common algorithm for determining if a number is prime begins at the number 5 (after checking if the number was 2 or 3), and updates by 6 each iteration, and always checks 2 conditions. | |
So far, it has only been proven that we only need check up the square root of the number we're testing, which is the reason for checking all numbers up to that point. If you're interested, below is a common algorithm for testing for primality. | |
if(n <= 3) | |
return n > 1; | |
else if(n % 2 == 0 || n % 3 == 0) | |
return false; |
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 com.kishan; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.Scanner; | |
public class BakFileDestroyer | |
{ |
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
class ViewController: UIViewController { | |
var session:AVCaptureSession! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
override func viewWillAppear(animated: Bool) { |
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
# Add the remote, call it "upstream": | |
git remote add upstream https://github.com/whoever/whatever.git | |
# Fetch all the branches of that remote into remote-tracking branches, | |
# such as upstream/master: | |
git fetch upstream | |
# Make sure that you're on your master branch: |
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
http://www.fredonia.edu/faculty/math/JonathanCox/math/SumOfSquares/SumOfSquares.html |
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
http://dev-maziarz.blogspot.in/2015/01/running-docker-sock-permission-denied.html |
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
Is Fibonacci | |
- Either 5x^2+4 or 5x^2-4 must be a perfect square | |
No of perfect squares between a and b | |
- floor(sqrt(b)) - ceil(sqrt(a)) + 1 | |
GCD (Euclid's algorithm) - | |
p>0 q>0. If q is 0 p is gcd. If not divide p by q | |
and take the remainder r. The gcd is the gcd(q,r). |
NewerOlder