Skip to content

Instantly share code, notes, and snippets.

View waqasakram117's full-sized avatar
🏠
Working from home

waqas akram waqasakram117

🏠
Working from home
View GitHub Profile
@waqasakram117
waqasakram117 / ffmpeg.md
Created June 16, 2020 08:47 — forked from protrolium/ffmpeg.md
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

package app.strikeready.common
import android.annotation.SuppressLint
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Bundle
import android.speech.tts.TextToSpeech
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
/**
*
* @param to source class
* @param from convert source class fields to this
* @param mapper used to bypass specific field to another field
*/
fun <U: Any> convertInto(to:Any, from :KClass<U>, mapper:Map<String, String> = hashMapOf()):U{
import os
import random
path = os.getcwd()
def get_random_number(dp, base):
inner_base = 330
if base < inner_base:
package com.lightbeem.securemessages.common
import android.content.Context
import android.util.Log
import android.view.inputmethod.InputMethodManager
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentActivity
import com.lightbeem.securemessages.BuildConfig
package com.lightbeem.myapplication.common
import android.annotation.SuppressLint
import android.content.pm.PackageManager
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.content.PermissionChecker
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
def lifecycle_version = "2.2.0"
def savedstate_version = "1.0.0"
def arch_version = "2.1.0"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.okta.android:oidc-android:1.0.8'
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
@waqasakram117
waqasakram117 / best location Algo.java
Last active June 15, 2017 10:09
this is best approach to get approx best accuracy of user's current location
private static final int TWO_MINUTES = 1000 * 60 * 2;
/** Determines whether one Location reading is better than the current Location fix
* @param location The new Location that you want to evaluate
* @param currentBestLocation The current Location fix, to which you want to compare the new one
*/
public static boolean isBetterLocation(Location location, Location currentBestLocation) {
if (currentBestLocation == null) {
// A new location is always better than no location
return true;
if (getWindow() != null){
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS ,
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
// A method to find height of the status bar this will useful with navigation drawer
public int getStatusBarHeight() {
int result = 0;
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = getResources().getDimensionPixelSize(resourceId);
}
return result;
}