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
class ClassName { | |
factory ClassName(Object complicatedObject) => ClassName.internal( | |
complicatedObject, | |
// Creation of this object is handled in the constructor | |
Object(), | |
); | |
@visibleForTesting | |
ClassName.internal( | |
this._complicatedObject, |
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
from collections import defaultdict | |
""" | |
""" | |
class Solution(object): | |
def minTransfers(self, transactions): | |
""" | |
:type transactions: List[List[int]] | |
:rtype: int | |
""" |
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
#Stage 1 - Install dependencies and build the app | |
FROM debian:latest AS build-env | |
# Install flutter dependencies | |
RUN apt-get update | |
RUN apt-get install -y curl git wget unzip libgconf-2-4 gdb libstdc++6 libglu1-mesa fonts-droid-fallback lib32stdc++6 python3 | |
RUN apt-get clean | |
# Clone the flutter repo | |
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter |
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 operator | |
import math | |
from itertools import permutations | |
import functools | |
class Solution(object): | |
def getProbability(self, balls): | |
""" | |
:type balls: List[int] | |
:rtype: float |
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 pprint | |
class Solution(object): | |
def getProbability(self, balls): | |
""" | |
:type balls: List[int] | |
:rtype: float | |
""" | |
trie = {} |
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
class Solution(object): | |
def getProbability(self, balls): | |
""" | |
:type balls: List[int] | |
:rtype: float | |
""" | |
trie = {} | |
newballs = balls + balls[0:-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:typed_data'; | |
import 'dart:convert'; | |
void main() { | |
final j = {'k' : 'ජෝන්', 'non_unicode': 'abc'}; | |
/// Existing Version | |
final oldencoded = json.encode(j); | |
final oldutfencoded = Uint8List.fromList(oldencoded.codeUnits); |
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() { | |
final a = ['a', 'b', 'c']; | |
final b = [ | |
for (final s in a) | |
for (final t in a) if (s != t) '${s}_$t' | |
]; | |
print(b); |
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
#! /bin/bash | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
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
apt-get update && apt-get install -y \ | |
sox \ | |
curl \ | |
libicu-dev \ | |
g++ \ | |
git \ | |
python \ | |
python-dev \ | |
python-setuptools \ |
NewerOlder