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
// Immutable | |
const COLOR_ARRAY = ['#CC231E', '#0F8A5F', '#F8D54C', '#C0C0C0', '#405685'] | |
const MUSIC_ELEMENT_ID = 991 | |
const mySong = new Audio("https://cdn.pixabay.com/download/audio/2022/12/06/audio_eeecf6c32f.mp3?filename=we-wish-you-a-merry-christmas-128367.mp3"); | |
const image = new WebImage("https://miro.medium.com/max/256/1*xBsr6BcIR71gq8xMbJ67nw.png") | |
// Mutable | |
var currentColor = Color.BLACK | |
var isPlaying = false |
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 io.plaidapp.ui.recyclerview; | |
import android.support.annotation.NonNull; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import io.plaidapp.data.DataLoadingSubject; | |
/** |
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 android.os.Bundle; | |
import android.os.Handler; | |
import android.os.Looper; | |
import android.transition.Fade; | |
import androidx.appcompat.app.AppCompatActivity; | |
/** VoiceActivity 2.0 */ | |
public class VoiceActivity extends AppCompatActivity { | |
VoiceFragment mVoiceFragment = new VoiceFragment(); |
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.*; | |
import java.util.*; | |
/* | |
* To execute Java, please define "static void main" on a class | |
* named Solution. | |
* | |
* If you need more classes, simply define them inline. | |
456654 => true |
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.util.*; | |
class Main { | |
public static void main(String[] args) { | |
List<String> words = new ArrayList<>(Arrays.asList("a", "b", "a", "d")); | |
List<List<String>> g = groupAnamgrams(words); | |
System.out.println(g); | |
} | |
public static List<List<String>> groupAnamgrams(List<String> anagrams){ | |
if (anagrams == null || anagrams.isEmpty()) { |
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
/* This class will be given a list of words (such as might be tokenized | |
* from a paragraph of text), and will provide a method that takes two | |
* words and returns the shortest distance (in words) between those two | |
* words in the provided text. | |
* Example: | |
* WordDistanceFinder finder = new WordDistanceFinder(Arrays.asList("the", "quick", "brown", "fox", "quick")); | |
* assert(finder.distance("fox", "the") == 3); | |
* assert(finder.distance("quick", "fox") == 1); | |
* | |
* "quick" appears twice in the input. There are two possible distance values for "quick" and "fox": |
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"?> | |
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.design.widget.AppBarLayout | |
android:id="@+id/appbar" | |
android:layout_width="match_parent" |
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.util.*; | |
public class SantaSecret { | |
public static void main(String[] args) { | |
String[][] list = generateList(new String[]{"amilcar", "andrade", "garcia"}); | |
for (int i = 0; i < list.length; i++) { | |
System.out.println("From: " + list[i][0] + " To: " + list[i][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
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.design.widget.AppBarLayout | |
android:layout_width="match_parent" | |
android:layout_height="128dp" |
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
public class LinkifyTextView extends TextView { | |
public LinkifyTextView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
init(); | |
} | |
public LinkifyTextView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
init(); |
NewerOlder