Skip to content

Instantly share code, notes, and snippets.

Avatar
🐼

Vyacheslav Egorov mraleph

🐼
View GitHub Profile
View gist:525e9d8ff91b7a320dd336d98caed8e7
This file has been truncated, but you can view the full file.
+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| Library | Method | Diff (Bytes) |
+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
View comparison.txt
This file has been truncated, but you can view the full file.
+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
| Library | Method | Diff (Bytes) |
+------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+
View recase.patch
diff --git a/lib/recase.dart b/lib/recase.dart
index da14cec..42a1251 100644
--- a/lib/recase.dart
+++ b/lib/recase.dart
@@ -1,44 +1,94 @@
+import 'dart:typed_data';
+
/// An instance of text to be re-cased.
class ReCase {
- final RegExp _upperAlphaRegex = new RegExp(r'[A-Z]');
View session.md

First create a hello.dart file with the following content.

void main(List<String> args) {
  print('Hello, World!');
}

Next we precompile this file using PRODUCT AOT compiler (equivalent of running flutter build aot --release).

View locate-symbol.dart
// Copyright (c) 2020, the Dart project authors.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following
// disclaimer in the documentation and/or other materials provided
View test.dart
void sayHello() => print('Hello, World!');
View pi_calculator.dart.patch
diff --git a/SuperPi_flutter/lib/pi_calculator.dart b/SuperPi_flutter/lib/pi_calculator.dart
index 39faf59..b519f6a 100644
--- a/SuperPi_flutter/lib/pi_calculator.dart
+++ b/SuperPi_flutter/lib/pi_calculator.dart
@@ -30,7 +30,7 @@ class PiCalculator {
double yk1 ;
for (int i = 0; i < k; i++) {
yk1 = (1 - math.pow((1 - yk * yk * yk * yk),(0.25)))/(1 + math.pow((1 - yk * yk * yk * yk),(0.25)));
- ak1 = ak * math.pow((1 + yk1), 4) - math.pow(2, 2 * i + 3) * yk1 * (1 + yk1 + yk1 * yk1);
+ ak1 = ak * math.pow((1 + yk1), 4.0) - math.pow(2.0, (2 * i + 3) + 0.0) * yk1 * (1 + yk1 + yk1 * yk1);
View test.cc
#include <stdio.h> // for fprintf()
#include <fcntl.h>
#include <unistd.h> // for close(), read()
#include <sys/epoll.h> // for epoll_create1(), epoll_ctl(), struct epoll_event
#include <string.h> // for strncmp
#include <errno.h>
const int kMaxEvents = 5;
const int kReadSize = 5;
View flutter.md
  1. Make a folder somewhere that will contain engine and framework checkouts. The rest of instructions assumes that $flt points to that folder.
  2. Into $flt/flutter get flutter by
    $ cd $flt
    $ git clone https://github.com/flutter/flutter
  3. Add $flt/flutter/bin to your path, run flutter doctor and fix issues if any are reported.
  4. Into $flt/engine get engine checkout following these instructions. Make sure to run dependency installation scripts as described there.
  5. In $flt/engine/src/third_party/dart switch to master and pull upto HEAD
View main.dart
Future<void> f() async {
print("f invoked");
await Future.value(10);
print("f continued");
}
Future<void> g() async {
print("g invoked");
await Future.value(10);
print("g continued");