Posts

Showing posts from November, 2016

Swift 3 by example

//: Playground - noun: a place where people can play
import UIKit
// Mutable variable var str = "Hello, playground"
// Array var myarr : [String] = ["Watsh", "Rajneesh"]

// Dictionary var mydict : [String:String] = ["tic": "tac", "ping": "pong"]
// constants let conststr = "My Const String" let countup = ["one", "two"] let mapNameToParkingSpace = ["Alice": 10, "Rajneesh": 12]
// subscript of array let elem = countup[1]

// Initializers let emptyString = String() let emptyArr = [Int]()
let emptySet = Set<Float>()
let defaultNum = Int()
let defaultBool = Bool()
let defaultFloat = Float()

// initializing a set let availableRoomsSet = Set([1,2,3, 4])

// Properties emptyArr.count availableRoomsSet.count conststr.isEmpty

// Optionals - can be value of the said datatype or nil var anOptionalFloat: Float? var anOptionalArrayOfStrings: [String]? var anOptionalArrayOfOptionalStrings: [String?]?
var rea…

Understanding Bitcoin technology

Image
A short summary of what i understood so far about Bitcoin technology:
It is a digitalcryptocurrency - uses asymmetric encryption (private/public key pairs) during transactions and hashing (SHA256) to generate bitcoin addresses (which is analogous to a bank account number)The main author of this technology and initial software is Satoshi Nakamoto but no one knows him/her/them. Satoshi released the bitcoin software in Jan 2009. It is decentralized - like gold and unlike paper currency which is centrally managed by governments of countries - so it is also called Digital Gold.An upper limit is set to the number of bitcoins that will be mined or generated. It is 21 million bitcoins (or BTC or XBT) and this number will be reached by the year 2040. At present the total bitcoins are around 16 million at the time of this writing (https://blockchain.info/charts/total-bitcoins). That the upper limit is fixed so the value of the bitcoin will keep increasing as time goes by. This is called deflati…

git clone shows all files as deleted or changed

When git clone shows all files as deleted or changed then do the following:

Ensure the following property is set or else windows will not be able to handle file path names longer than 260 chars. Thus resulting in odd behavior of git.

git config --system core.longpaths true
git reset --hard origin/[your_branch]-- this will reset local git repo index to match the one at remote branch.