Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version
This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.
package com.filipkowicz.headeritemdecorator | |
/* | |
solution based on - based on Sevastyan answer on StackOverflow | |
changes: | |
- take to account views offsets | |
- transformed to Kotlin | |
- now works on viewHolders |
#!/usr/bin/env bash | |
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
# well, so I wrote my own script to do the simple job of converting package names. | |
# | |
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
# | |
# It'll run faster on a clean build because then there are fewer files to scan over. | |
# | |
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version
This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.
import java.io.IOException; | |
import okhttp3.HttpUrl; | |
import okhttp3.Interceptor; | |
import okhttp3.OkHttpClient; | |
import okhttp3.Request; | |
/** An interceptor that allows runtime changes to the URL hostname. */ | |
public final class HostSelectionInterceptor implements Interceptor { | |
private volatile String host; |
//based on http://stephendnicholas.com/archives/974 | |
package it.my.app; | |
import android.content.ContentProvider; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import android.content.ContentProvider; | |
import android.content.ContentValues; | |
import android.content.UriMatcher; |
To remove a submodule you need to:
git stash show -p stash@{0} > Stash0.patch |
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<item> | |
<shape | |
android:shape="rectangle"> | |
<!-- Set the border color of your layout here --> | |
<stroke android:width="1dp" android:color="#3AFB03" /> | |
<solid android:color="#3AFB03" /> | |
</shape> |
public class Solution { | |
public int removeDuplicates(int[] A) { | |
int length=A.length; | |
if(length==0 || length==1) return length; | |
int i=1; | |
for(int j=1; j<length; j++) | |
{ | |
if(A[j]!=A[j-1]) | |
{ | |
A[i]=A[j]; |