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 os | |
for i in range(5000): | |
os.system("adb shell input tap 600 1600") |
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 argparse | |
import xml.etree.ElementTree as ET | |
import os | |
import re | |
def rgb_to_grayscale(r, g, b): | |
"""Convert RGB to grayscale using the luminance formula.""" | |
return round(0.299 * r + 0.587 * g + 0.114 * b) | |
def hex_to_rgb(hex_color): |
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 com.example.mytestapplication | |
import android.app.ListActivity | |
import android.content.Context | |
import android.os.Bundle | |
import android.view.View | |
import android.view.ViewGroup | |
import android.widget.BaseAdapter | |
import android.widget.LinearLayout | |
import android.widget.TextView |
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
function chuaClearAllMarks() { | |
for (let x = 1; x < 9; x++) { | |
for (let y = 1; y < 9; y++) { | |
var elem = document.getElementsByClassName('piece square-0' + x + '0' + y); | |
if (elem.length > 0) { | |
if (elem[0].style.hasOwnProperty('backgroundColor') && elem[0].style.backgroundColor) { | |
elem[0].style.backgroundColor = null; | |
elem[0].style.animation = null; | |
console.log(elem[0].classList[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
package com.example; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* Just simple and more convenient replacement of java.util.Observable/Observer | |
* to implement observer pattern | |
*/ | |
public class SimpleObservable<T> { |
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 com.example; | |
import android.support.annotation.NonNull; | |
import android.view.View; | |
/** | |
* Simple solution for classic "debouncing" problem (ability of user to click simultaneously | |
* on several UI elements or fast clicking on one element with asynchronous result ) | |
*/ | |
public abstract class DebouncedClickListener implements View.OnClickListener{ |
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 com.brainwave_research_institute.app.brainwave.util; | |
/** | |
* Created by fedex on 13.10.17. | |
*/ | |
public class Holder<T> { | |
public T value; | |
public Holder(T value) { |