#How to connect multiple Android devices with ADB over TCP
According to a post on xda-developers, you can enable ADB over Wi-Fi from the device with the commands:
su
setprop service.adb.tcp.port 5555
stop adbd
start adbd
@Override | |
public void onNext(ArrayList<Phrase> phrases) { | |
ArrayList<Integer> phraseIDs = new ArrayList<>(); | |
Observable | |
.from(phrases) | |
.collect(phraseIDs, new Action2<ArrayList<Integer>, Phrase>() { | |
@Override | |
public void call(ArrayList<Integer> integers, Phrase phrase) { | |
integers.add(phrase.getId()); | |
} |
// it returns a square thumbnail. | |
func getAssetThumbnail(asset: PHAsset, size: CGFloat) -> UIImage { | |
let retinaScale = UIScreen.mainScreen().scale | |
let retinaSquare = CGSizeMake(size * retinaScale, size * retinaScale) | |
let cropSizeLength = min(asset.pixelWidth, asset.pixelHeight) | |
let square = CGRectMake(0, 0, CGFloat(cropSizeLength), CGFloat(cropSizeLength)) | |
let cropRect = CGRectApplyAffineTransform(square, CGAffineTransformMakeScale(1.0/CGFloat(asset.pixelWidth), 1.0/CGFloat(asset.pixelHeight))) | |
let manager = PHImageManager.defaultManager() |
Result: 1 | |
Items { | |
TemplateId: "BADGE_BATTLE_ATTACK_WON" | |
Badge { | |
BadgeType: BADGE_BATTLE_ATTACK_WON | |
BadgeRanks: 4 | |
Targets: "\nd\350\007" | |
} | |
} | |
Items { |
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
from instaloader import Instaloader, Profile | |
import datetime | |
MAX_DAYS = 50 | |
LIKES_WEIGHT = 1 | |
COMMENTS_WEIGHT = 1 | |
NUM_FOLLOWERS_WEIGHT = 1 | |
NUM_POSTS_WEIGHT = 1 |
loader = Instaloader() | |
NUM_POSTS = 10 | |
def get_hashtags_posts(query): | |
posts = loader.get_hashtag_posts(query) | |
users = {} | |
count = 0 | |
for post in posts: | |
profile = post.owner_profile | |
if profile.username not in users: |
import android.content.Context | |
import android.hardware.Sensor | |
import android.hardware.SensorEvent | |
import android.hardware.SensorEventListener | |
import android.hardware.SensorManager | |
import androidx.compose.animation.ExperimentalAnimationApi | |
import androidx.compose.animation.core.animateFloatAsState | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.* |