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
@Singleton | |
class MyServiceInterceptor @Inject constructor( | |
private var sessionToken: String = "" | |
) : Interceptor { | |
fun setSessionToken(sessionToken: String) { | |
this.sessionToken = sessionToken | |
} | |
override fun intercept(chain: Interceptor.Chain): Response { |
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() { | |
//abcabc => cba => aa = 2 | |
val two = stringReduceChallenge("abcabc") | |
println(two) | |
// aaaa = 4 | |
val four = stringReduceChallenge("aaaa") | |
println(four) | |
// abcab => cbb => ab => c = 1 |
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 arr = arrayOf(9, 3, 6, 7, 3, 2, 1, 5, 4, 7, 5) | |
mergeSort(arr) | |
println(arr.contentToString()) | |
} | |
fun mergeSort(inputArray: Array<Int>) { | |
val inputLength = inputArray.size | |
if (inputLength < 2) return |
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.Arrays; | |
public class MergeSort { | |
public static void main(String[] args) { | |
int[] arr = new int[]{9, 3, 6, 7, 3, 2, 1, 5, 4, 7, 5}; | |
mergeSort(arr); | |
System.out.println(Arrays.toString(arr)); | |
} |
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 'package:flutter/material.dart'; | |
// The line below is to stop lint warning "Prefer const with constant constructors" | |
// ignore_for_file: prefer_const_constructors | |
void main() { | |
runApp(MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: Scaffold( | |
appBar: AppBar( | |
backgroundColor: Colors.white, |
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
// ignore_for_file: prefer_const_constructors | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp( | |
debugShowCheckedModeBanner: false, | |
home: DefaultTabController( | |
length: 4, | |
initialIndex: 1, | |
child: Scaffold( |
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 'dart:convert'; | |
import 'dart:io'; | |
void main() { | |
stdout.write("text: "); | |
String text = stdin.readLineSync(encoding: utf8) ?? ""; | |
stdout.write("how many shifts: "); | |
int shiftNumber = int.tryParse(stdin.readLineSync(encoding: utf8) ?? "")!; | |
stdout.write("operation is (1 for encrypt, 0 to decrypt): "); | |
bool operation = int.tryParse(stdin.readLineSync(encoding: utf8) ?? "")! == 1; |
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 'dart:convert'; | |
import 'dart:io'; | |
void main() { | |
var pass = stdin.readLineSync(encoding: utf8) ?? ""; | |
getPasswordStrength(pass); | |
} | |
void getPasswordStrength(String pass) { | |
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 'package:http/http.dart' as http; | |
void main(){ | |
// Uri uri1 = Uri.parse('https://example.com/whatsit/create'); | |
// http.get(uri1).then((value) => print(value.statusCode)); | |
// Uri uri2 = Uri.parse('https://jsonplaceholder.typicode.com/albums/1'); | |
// http.get(uri2).then((value) => print(value.statusCode)); |
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 'package:flutter/material.dart'; | |
void main() { | |
runApp(MaterialApp(home: Screen())); | |
} | |
class Screen extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( |
OlderNewer