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
def and2 (x:Boolean, y:Boolean) = println( x&y) | |
and2: (x: Boolean, y: Boolean)Unit | |
scala> and2(true,true) | |
true | |
scala> and2(true,false) | |
false | |
scala> and2(false,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
scala> def squp (x:Int) = x*x | |
squp: (x: Int)Int | |
scala> squp(2) | |
res8: Int = 4 | |
scala> squp(3) | |
res9: Int = 9 |
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
scala> def or2 (x:Boolean, y:Boolean) = (x, y) match { | |
| case (false, false) => false | |
| case (_, _) => true | |
| } | |
or2: (x: Boolean, y: Boolean)Boolean | |
scala> or2(true,false) | |
res18: Boolean = true |
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
<html> | |
<head> | |
<title>Tic-Tac-Toe</title> | |
<style> | |
body { | |
font-family: sans-serif; | |
color: #535353; | |
} | |
.cell { | |
width: 100px; |
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
<?php | |
// | |
// Appstore Production Purchase Validation | |
// | |
// Created by Eduardo Irías on 6/3/16. | |
// | |
$filebinary = basename($_FILES['receipt-data']['name']); | |
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
//: Swift sorting algorithms | |
//: Bubble Sort | |
func bubbleSort(list : [Int]) -> [Int] { | |
var list = list | |
let listCount = list.count | |
for oputer in (2..<listCount).reverse() { |
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 Node : NSObject { | |
var index : Int = -1 | |
var data : AnyObject? | |
var left : Node? = nil | |
var right : Node? = nil | |
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
// Part 1 | |
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); | |
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( | |
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); | |
drawer.setDrawerListener(toggle); | |
toggle.syncState(); | |
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); | |
navigationView.setNavigationItemSelectedListener(this); | |
navigationView.setCheckedItem(R.id.nav_camera); |
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
extension Messaging { | |
static private let accessToken = "" //Server Web Key | |
struct Topic : Decodable { | |
var name : String? | |
var addDate : String? | |
} | |
struct Rel : Decodable { |
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
protocol Vehicle { | |
var currentSpeed : Double { get } | |
func accelerate() | |
func decelerate() | |
} | |
extension Vehicle { | |
var isMoving : Bool { get { return currentSpeed != 0 } } | |
} |
OlderNewer