// Unit testing with junit
testImplementation 'junit:junit:4.13.2'
// Core library
androidTestImplementation 'androidx.test:core:1.3.0'
// AndroidJUnitRunner and JUnit Rules,Runner
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
tasks.register("addSpaceToEndOfLines") { | |
description = "Add space to the end of each line in .kt files and commit changes to Git" | |
doLast { | |
println("Starting magic") | |
project.exec { | |
commandLine("git", "checkout", "-b" , "refactor/submitCode") | |
} |
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
fun main(){ | |
val company = Company("DevMaster") | |
val department = Department("Programming") | |
val employeeAhmed = Employee("Mahmoud", 26) | |
val employeeMahmoud = Employee("Ammar", 1) | |
val employeeMariam = Employee("Mariam", 23) | |
department.addEmployee(employeeAhmed) | |
department.addEmployee(employeeMahmoud) |
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
private fun makeViewFullWidth(view: View) { | |
val point = Point() | |
// point will be populated with screen width and height | |
activity?.windowManager?.defaultDisplay?.getSize(point) | |
val param = view.layoutParams | |
param.width = point.x | |
param.height = point.y | |
view.layoutParams = param | |
} |
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
for i in `seq 1001`; | |
do | |
text2image --text $i.gt.txt --outputbase /home/owner/Downloads/output/im$i --xsize 680 --ysize 200 --fonts_dir /usr/share/fonts/truetype/Amiri/ --font 'Amiri' --margin 0 --ptsize 30 --degrade_image --char_spacing 1; | |
done | |
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.inova.algym.utils | |
import android.Manifest | |
import android.content.Context | |
import android.content.pm.PackageManager | |
import android.location.Location | |
import android.location.LocationListener | |
import android.location.LocationManager | |
import android.os.Bundle | |
import androidx.core.content.ContextCompat |
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
void main() { | |
RegExp exp = new RegExp(r"[a-zA-Z]+"); | |
String str = "Parse my string"; | |
print('${getByToken(str, '[a-zA-Z]+')}'); | |
} | |
List<String> getByToken(var str , var token){ | |
RegExp exp = new RegExp("${token}"); | |
print('${exp.pattern}'); | |
Iterable<RegExpMatch> matches = exp.allMatches(str); |
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.firstapp; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.app.Activity; | |
import android.content.ComponentName; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.os.Bundle; | |
import android.util.Log; |
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
implementation 'com.google.code.gson:gson:2.8.5' | |
implementation 'com.jakewharton:butterknife:10.1.0' | |
annotationProcessor "com.jakewharton:butterknife-compiler:10.1.0" | |
implementation "com.balsikandar.android:crashreporter:1.0.9" | |
implementation 'com.squareup.retrofit2:retrofit:2.3.0' | |
implementation 'com.squareup.retrofit2:converter-gson:2.3.0' |
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 java.util.Scanner; | |
public class Try { | |
public static void main(String[] args) { | |
Scanner in=new Scanner(System.in); | |
int n=in.nextInt(); | |
Scanner S=new Scanner(System.in); | |
String []s=new String[30]; | |
for (int i = 0; i < n; i++) { | |
s[i]=S.nextLine(); | |
} |