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
| <html> | |
| <head> | |
| <title>Bitcoin Price in Words - Sylvain Saurel</title> | |
| <link rel="preconnect" href="https://fonts.gstatic.com"> | |
| <link href="https://fonts.googleapis.com/css2?family=Sriracha&display=swap" rel="stylesheet"> | |
| <style> | |
| #top { |
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
| <html> | |
| <head> | |
| <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed&display=swap" rel="stylesheet"> | |
| <style> | |
| #hexatime { | |
| width: 300px; | |
| text-align: center; | |
| margin: 0 auto; | |
| margin-top: 500px; |
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
| function hexislight(color) { | |
| var hex = color.replace('#', ''); | |
| var red = parseInt(hex.substr(0, 2), 16); | |
| var green = parseInt(hex.substr(2, 2), 16); | |
| var blue = parseInt(hex.substr(4, 2), 16); | |
| // it is a known formula, nothing magical here | |
| var brightness = ((red * 299) + (green * 587) + (blue * 114)) / 1000; | |
| return brightness > 155; | |
| } |
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
| function hexaTime() { | |
| var date = new Date(); | |
| // we convert in the 0 .. 255 range | |
| var seconds = parseInt(date.getSeconds() * 255 / 59); | |
| var minutes = parseInt(date.getMinutes() * 255 / 59); | |
| var hours = parseInt(date.getHours() * 255 / 23); | |
| return "#" + toHex(hours) + toHex(minutes) + toHex(seconds); | |
| } |
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
| function toHex(d) { | |
| var hex = ("0" + (Number(d).toString(16))).slice(-2).toUpperCase(); | |
| return hex; | |
| } |
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
| <html> | |
| <head> | |
| <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed&display=swap" | |
| rel="stylesheet"> | |
| <style> | |
| #hexatime { | |
| width: 300px; | |
| text-align: center; | |
| margin: 0 auto; |
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.ssaurel.myanagram; | |
| import android.app.Dialog; | |
| import android.os.Bundle; | |
| import android.view.View; | |
| import android.widget.Button; | |
| import android.widget.EditText; | |
| import android.widget.TextView; | |
| import androidx.appcompat.app.AlertDialog; |
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
| private void loadWords() { | |
| new Thread(() -> { | |
| Anagram.loadWords(MainActivity.this); | |
| runOnUiThread(() -> { | |
| validate.setEnabled(Anagram.isLoaded()); | |
| }); | |
| }).start(); | |
| } |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:padding="16dp" | |
| android:orientation="vertical" | |
| tools:context=".MainActivity"> | |
| <!-- We add a Dummy layout to prevent EditText to gain focus --> |
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.ssaurel.myanagram; | |
| import android.content.Context; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; |