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 lv.tdd; | |
public class BiggerAndSmaller { | |
private int bigger = Integer.MIN_VALUE; | |
private int smaller = Integer.MAX_VALUE; | |
public void find(int[] numbers){ | |
for (int n : numbers) { | |
if (n > bigger) bigger = n; | |
if (n < smaller) smaller = n; |
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 lv.roman; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class RomanNumeral { | |
Map<String, Integer> table; | |
public RomanNumeral() { | |
table = new HashMap<String, Integer>(); | |
table.put("I", 1); |
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
from IPython.display import clear_output | |
import random | |
def display_board(board): | |
clear_output() | |
print(" | |") | |
print(board[7] + ' | ' + board[8] + ' | ' + board[9]) | |
print(" | |") |
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 random | |
suits = ('🖤','◆','♠','♣') | |
ranks = ( '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A') | |
values = { '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, '10':10, 'J':10, 'Q':10, 'K':10, 'A':11} | |
playing = True | |
class Card: |
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
/*Given 2 strings, return 2 character iterables (Iterable<Character> in Java) such that: | |
The first Iterable iterates over the characters that exist in the first string but not in the second string | |
The second Iterable iterates over the characters that exist in the second string but not in the first string | |
*/ | |
package com.company; | |
import java.util.*; |
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
TextFormField( | |
... | |
textInputAction: TextInputAction.next, | |
... | |
) |
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 _formKey = GlobalKey<FormState>(); | |
var _formview = Container( | |
color: Colors.grey.shade300, | |
margin: EdgeInsets.all(8.0), | |
padding: EdgeInsets.all(8.0), | |
child: SingleChildScrollView( | |
child: Form( | |
key: _formKey, | |
child: Column( | |
children: <Widget>[ |
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
RaisedButton calculateButton() { | |
return RaisedButton( | |
onPressed: _calculator, | |
color: Colors.pinkAccent, | |
child: Text( | |
'Calculate', | |
style: TextStyle(fontSize: 16.9), | |
), | |
textColor: Colors.white70, | |
); |
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 'dart:convert'; | |
import 'package:http/http.dart' show Client; | |
import '../model/item_model.dart'; | |
final _root = 'https://earthquake.usgs.gov/earthquakes/feed/v1.0'; | |
class WakeProvider { | |
Client client = Client(); | |
fetchFeatures() async { |
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 'geometry.dart'; | |
import 'properties.dart'; | |
class ItemModel { | |
final String type; | |
final Properties properties; | |
final Geometry geometry; | |
final String id; | |
ItemModel.fromJson(Map<String,dynamic> parsedJson): | |
type = parsedJson['type'], |
OlderNewer