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
public class RealPathUtil { | |
public static String getRealPath(Context context, Uri fileUri) { | |
String realPath; | |
// SDK < API11 | |
if (Build.VERSION.SDK_INT < 11) { | |
realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri); | |
} | |
// SDK >= 11 && SDK < 19 | |
else if (Build.VERSION.SDK_INT < 19) { |
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 pandas as pd | |
from sklearn.cluster import KMeans | |
# Read the video games dataset into a DataFrame | |
data = pd.read_json('../data/nintendo-games.json') | |
features = data[['meta_score', 'esrb_rating', 'genres']] | |
# convert categorical features to numerical using one-hot encoding | |
features = pd.get_dummies(features, columns=['meta_score', 'esrb_rating', 'genres']) |
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 { getGamesAmerica, GameUS, EshopError } from 'nintendo-switch-eshop'; | |
import * as fs from 'fs'; | |
import { HTMLElement, parse } from "node-html-parser"; | |
import fetch from 'node-fetch'; | |
const dest = './nintendo-games.json'; | |
const allowedLettersInTitle = /[^a-zA-Z0-9 ]+/g; | |
const PAGE_SIZE = 25 |
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 main | |
import ( | |
"encoding/json" | |
"errors" | |
"fmt" | |
"io/ioutil" | |
"os" | |
"regexp" | |
"os/exec" |
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
invoke-static {p0}, Landroidx/preference/e;->a(Landroid/content/Context;)Landroid/content/SharedPreferences; | |
move-result-object v0 | |
const-string v1, "preferencePremium" | |
const/4 v2, 0x1 | |
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor; | |
move-result-object v0 | |
invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor; | |
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V |
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
$('li[data-issue-status-name="wontfix"]').each((i, e) => { e.click() }) | |
$('input[name="commit"]').each((i, e) => { e.click() }) |
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
+--- androidx.databinding:viewbinding:4.1.2 | |
| \--- androidx.annotation:annotation:1.0.0 -> 1.2.0 | |
+--- org.jetbrains.kotlin:kotlin-stdlib:1.4.32 | |
| +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.4.32 | |
| \--- org.jetbrains:annotations:13.0 | |
+--- com.squareup.leakcanary:leakcanary-android:2.7 | |
| +--- com.squareup.leakcanary:leakcanary-android-core:2.7 | |
| | +--- com.squareup.leakcanary:shark-android:2.7 | |
| | | \--- com.squareup.leakcanary:shark:2.7 | |
| | | \--- com.squareup.leakcanary:shark-graph:2.7 |
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
/** | |
* Utility class for access to runtime permissions. | |
*/ | |
public abstract class PermissionUtils { | |
/** | |
* Requests the fine location permission. If a rationale with an additional explanation should | |
* be shown to the user, displays a dialog that triggers the request. | |
*/ | |
public static void requestPermission(AppCompatActivity activity, int requestId, |
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
// add classpath dependency before | |
// classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:$detektVersion" | |
def configFile = files("$rootDir/config/detekt/detekt.yml") | |
def baselineFile = file("$rootDir/config/detekt/baseline.xml") | |
def analysisDir = file(projectDir) | |
def kotlinFiles = "**/*.kt" | |
def javaFiles = "**/*.java" | |
def resourceFiles = "**/resources/**" |
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
@Test | |
fun labelsAreDisplyed_SameFragment() { | |
// some other assertions | |
onView(withId(R.id.tvAccountNumberLabel)) | |
.perform(nestedScrollTo()) | |
.check(matches(isDisplayed())) | |
// here as well | |
} |
NewerOlder