import com.google.gson.Gson | |
import com.google.gson.GsonBuilder | |
import com.google.gson.TypeAdapter | |
import com.google.gson.TypeAdapterFactory | |
import com.google.gson.reflect.TypeToken | |
import com.google.gson.stream.JsonReader | |
import com.google.gson.stream.JsonWriter | |
import kotlin.jvm.internal.Reflection | |
import kotlin.reflect.KClass |
- Open android studio Tools->Flutter->Clean
- Go to File -> Invalidate Caches / Restart
- Or open terminal run "flutter clean"
- Remove pubspec.lock
- Double check the Flutter SDK Path config correcty - https://tppr.me/qn6dP
Or open the terminal and try this script:
flutter clean
import 'dart:math'; | |
void main() async { | |
var duration = _runCPUBoundTask(); | |
print('The duration for CPU bound task is $duration'); | |
} | |
Future<Duration> _runCPUBoundTask() async { | |
var startTime = DateTime.now(); | |
print('Starting ...'); |
void main() async { | |
var tweetId = 12345; | |
// Get tweet details by tweet Id | |
final networkData = await fetchTweetById(tweetId); | |
final jsonData = jsonDecode(networkData); | |
} | |
Future<Tweet> fetchTweetById(int tweetId) async { | |
final url = Uri.parse("www.twitter.com" + "/$tweetId"); | |
final response = await http.get(url); |
I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.
So below I made a list of leetcode problems that are as close to grokking problems as possible.
fun fetchUsers() { | |
val call = api.getUsersOverNetwork() | |
call.addCallback { result -> | |
when (result) { | |
is Success<User> -> { | |
// do something with the result | |
} | |
is Error -> { | |
// handle the error | |
} |
The ViewGroup,View under Android Event Distribution Mechanism Source Code https://programmer.ink/think/the-viewgroup-view-under-android-event-distribution-mechanism-source-code.html
Deflating the LayoutInflater and working with findViewById() https://obvious.in/blog/deflating-the-layoutinflater-working-with-findviewbyid
/* package whatever; // don't place package name! */ | |
import java.util.*; | |
import java.lang.*; | |
import java.io.*; | |
/* Name of the class has to be "Main" only if the class is public. */ | |
class FileCopy | |
{ | |
public static void main (String[] args) throws java.lang.Exception |