Skip to content

Instantly share code, notes, and snippets.

View TheAnimatrix's full-sized avatar
🎯
Focusing

TheAnimatrix

🎯
Focusing
View GitHub Profile
{
// Place your coingecko_dart workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
void main() {
runApp(MainApp());
}
class MainApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
MiniApp miniApp = MiniApp();
return StreamBuilder<Object>(
import 'dart:async';
import 'package:flutter/material.dart';
class CountdownList extends StatefulWidget {
@override
_CountdownListState createState() => _CountdownListState();
}
class _CountdownListState extends State<CountdownList> {
void main()
{
int n = 0;
while(n!=10)
{
print(fibonacci(n));
@TheAnimatrix
TheAnimatrix / basic.dart
Last active September 15, 2019 14:39
doubt
import 'package:http/http.dart' as http;
void main() async{
int i = 1;
bool run = true;
var url = 'http://example.com/whatsit/create';
var future =
http.post(url, body: {'name': 'doodle', 'color': 'blue'});
#alright,
#MERGE SORT basically involves recursive merging of smaller arrays to form sorted larger arrays
#so the most important step in implementing this in O(nlogn) is to make sure merging is done in O(n) and then there are O(logn) steps
# merging
# i'll need to create a resultant array that has len of a+b, assuming a and b are sorted
@TheAnimatrix
TheAnimatrix / p5_dag.js
Created February 16, 2019 10:19
Create a simple directed acyclic graph by double-clicking! (made with p5.js)
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
line(2,2,2,400);
line(2,2,400,2);
}
function arrow(x,y,angle){
@TheAnimatrix
TheAnimatrix / bomberman.py
Last active February 5, 2019 19:41
bomberman.py
#!/bin/python
import math
import os
import random
import re
import sys
import copy
# Complete the bomberMan function below.

The most common attributes of logarithmic running-time function are that:

the choice of the next element on which to perform some action is one of several possibilities, and only one will need to be chosen. or

the elements on which the action is performed are digits of n This is why, for example, looking up people in a phone book is O(log n). You don't need to check every person in the phone book to find the right one; instead, you can simply divide-and-conquer by looking based on where their name is alphabetically, and in every section you only need to explore a subset of each section before you eventually find someone's phone number.

Of course, a bigger phone book will still take you a longer time, but it won't grow as quickly as the proportional increase in the additional size.