This file contains hidden or 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> | |
| #define ABS(x) ((x) > 0 ? (x) : -(x)) | |
| double sqrt_babilonia(double num, double precision) { | |
| if (num < 0) { | |
| return -1; | |
| } | |
| double x, nx = num / 2; |
This file contains hidden or 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 countdown; | |
| import java.util.*; | |
| import java.util.function.Consumer; | |
| public class CountDown { | |
| private int seconds; | |
| private Timer timer; | |
| private CountDownTask task; |
This file contains hidden or 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 'package:calculator/constants.dart'; | |
| import 'package:flutter/material.dart'; | |
| class CalculatorHomePage extends StatefulWidget { | |
| @override | |
| _CalculatorHomePageState createState() => _CalculatorHomePageState(); | |
| } | |
| class _CalculatorHomePageState extends State<CalculatorHomePage> { | |
| int answer = 24; |
This file contains hidden or 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:math'; | |
| class Player implements Comparable<Player> { | |
| String name; | |
| String gender; | |
| int level; | |
| Player(this.name, this.gender, this.level); | |
| @override |
This file contains hidden or 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.google.temp | |
| data class WinningPlace( | |
| val gameType: String, | |
| val shopName: String, | |
| val address: String, | |
| val lat: Double, | |
| val lng: Double | |
| ) |
This file contains hidden or 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 counter | |
| import react.RBuilder | |
| import react.RComponent | |
| import react.RProps | |
| import react.RState | |
| class Counter : RComponent<RProps, RState>() { | |
| override fun RBuilder.render() { | |
| } |
This file contains hidden or 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
| div { ... } | |
| Editor { | |
| attrs { | |
| ... | |
| } | |
| } |
This file contains hidden or 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 java.io.File | |
| val hangman = listOf(""" | |
| ---- | |
| | | | |
| | O | |
| | /|\ | |
| | / \ | |
| | | |
| ------ |
This file contains hidden or 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
| tailrec fun countSegments(str: String, index: Int = 0, segments: Int = 0): Int = | |
| if(index == -1) segments | |
| else countSegments(str, | |
| nextCharacter(str, index), | |
| segments + 1) |
This file contains hidden or 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
| # Two lists have to have same length | |
| list1 = [ 13, 34, 78, 54, 92 ] | |
| list2 = [ 26, 84, 89, 64, 46 ] | |
| # [ 26, 84, 89, 64, 92 ] | |
| result = [max(list1[x], list2[x]) for x in range(len(list1))] |
NewerOlder