Skip to content

Instantly share code, notes, and snippets.

View AAQ-AND-DEV's full-sized avatar
💭
Android Kotlin/Java Developer

Aaron A Quaday AAQ-AND-DEV

💭
Android Kotlin/Java Developer
  • San Francisco Bay Area
View GitHub Profile
@AAQ-AND-DEV
AAQ-AND-DEV / FileSelector.java
Last active May 23, 2019 18:15
seeing if access may be altered
package edu.duke;
import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.filechooser.FileFilter;
/**
@AAQ-AND-DEV
AAQ-AND-DEV / main.dart
Created March 25, 2019 01:36
lists, maps, iterators
void main(){
var list = [10, "what", 4, 99];
var list2 = <Object>[10, "what", 4, 99];
print(list[1]);
//print(list.runtimeType); //error in dartPad
print(list.length);
for(int i = 0; i<list.length; i++){
print("Index $i contains ${list[i]}");
}
print(list2.runtimeType);
@AAQ-AND-DEV
AAQ-AND-DEV / main.dart
Last active March 24, 2019 20:23
basic class w/named ctor
//dart does not do interfaces, but rather all classes
//seem to be able to be implemented
abstract class IsFerocious {
void intimidate();
String whatTheFearfulSay();
}
class Animal{
String name;
String lastName;
@AAQ-AND-DEV
AAQ-AND-DEV / main.dart
Created March 24, 2019 01:32
switches, expressions, conditionals
void main(){
var num = 34;
var age = 18;
var nameTracker;
do {
print("going...");
num++;
}while(num <38);
@AAQ-AND-DEV
AAQ-AND-DEV / main.dart
Created March 21, 2019 04:55
first dart nested function
void main(){
var num = 47;
//is and is!
print(num is String);
print(num is! bool);
print(num is int);
//If statement
if(num is! int){
@AAQ-AND-DEV
AAQ-AND-DEV / main.dart
Created March 21, 2019 04:54
some arithmetic operators work
void main() {
var result = 4 / 2;
print(result);
print(result.runtimeType);
var result2 = 4.0 / 2.0;
print(result2);
print(result2.runtimeType);
@AAQ-AND-DEV
AAQ-AND-DEV / main.dart
Created March 21, 2019 01:39
booleans and logical operators (XOR, OR, AND)
void main() {
String name = "James";
String lastName = "Bond";
int age = 45;
print('his name is ${name + ' ' + lastName} he is $age years old');
print('his name is $name $lastName he is $age years old');
print('${lastName.toUpperCase()}');
bool isTheBest = false;
@AAQ-AND-DEV
AAQ-AND-DEV / main.dart
Created March 20, 2019 20:03
const and final workbook
void main() {
//each of these must be initialized and can't be changed
const pi = 3.14;
final pi2 = 3.14;
//final collections may be mutable, const collections immutable
const immutableList = [2,3,4,5,6];
//get 'unsupported operation: add' exception
@AAQ-AND-DEV
AAQ-AND-DEV / main.dart
Created March 20, 2019 19:32
first Dart var exploration
void main(){
var country = 'United States';
String name;
var dynamo;
var preType = dynamo.runtimeType;
print(preType);
//print(name is dynamic);
//looks like everything is dynamic?!?
dynamo = 47;