Skip to content

Instantly share code, notes, and snippets.

View JoeCodeswell's full-sized avatar

Joe Dorocak aka Joe Codeswell JoeCodeswell

View GitHub Profile
@JoeCodeswell
JoeCodeswell / A Python w3schools XPath Example.md
Last active October 27, 2022 15:53
W3Schools XPath Examples using Python and lxml

A Python w3schools XPath Example

The w3schools XPath Examples are PRETTY GREAT.

However they are implemented using JavaScript. I mostly use Python so I thought I'd try to mimic the output using Python 3.10 with lxml on Windows 10.

  1. Put the books.xml file in the same directory as the w3BooksTest.py .
  2. Run with Python 3.10 on Windows with lxml installed
@JoeCodeswell
JoeCodeswell / C19data.dart
Last active October 7, 2020 20:02
C19data.dart
/// C19data.dart
/// [gist](https://gist.github.com/JoeCodeswell/2f492c65c15a299f3176b06b0d178d5c)
/// [Dartpad](https://dartpad.dev/2f492c65c15a299f3176b06b0d178d5c)
/// Predecessor TimeSeriesC19.dart
/// C19app1Pj\jchart_c19\lib\c19_data.dart
/// [gist](https://gist.github.com/JoeCodeswell/cdff0e68ae266fa624eaac5c286f20b2)
/// https://dartpad.dev/cdff0e68ae266fa624eaac5c286f20b2
///
/// Because of the limitations of DartPad, this has moved to
/// jchart_c19\C19DataSets.dart
@JoeCodeswell
JoeCodeswell / TimeSeriesC19.dart
Last active October 7, 2020 14:33
TimeSeriesC19
/// TimeSeriesC19.dart
/// C19app1Pj\jchart_c19\lib\c19_data.dart
/// [gist](https://gist.github.com/JoeCodeswell/cdff0e68ae266fa624eaac5c286f20b2)
/// https://dartpad.dev/cdff0e68ae266fa624eaac5c286f20b2
/// See VERY HELPFUL ANSWERS IN [Mapping JSON into Class Objects](https://stackoverflow.com/a/45189401/601770)
/// [HTML - Using getString() to load a file](https://dart.dev/tutorials/web/fetch-data#using-getString-function)
/// google: dart await result
/// [Asynchronous programming: futures, async, await](https://dart.dev/codelabs/async-await)
///
///
@JoeCodeswell
JoeCodeswell / dartTypicodeJsonDecodeProblem.dart
Last active October 5, 2020 15:54
dart problem typicode jsonDecode with \n
/// zoldCode\dartTypicodeJsonDecodeProblem.dart
/// https://gist.github.com/JoeCodeswell/a565c505e8244bf9105048e874a6adc8
/// https://dartpad.dev/a565c505e8244bf9105048e874a6adc8
///
/// dart fails to jsonDecode valid json string from typicode Posts with \n in it
/// https://github.com/dart-lang/convert/issues/10
///
/// to see non error behaviour comment out lines 29 & 30
///
///
@JoeCodeswell
JoeCodeswell / AsyncAwaitPlay.dart
Last active August 1, 2020 20:32
Playing with AsyncAwait in dart. :)
/// AsyncAwaitPlay.dart
/// Playing with AsyncAwait in dart. :)
/// https://gist.github.com/JoeCodeswell/04689586c58fca438a3906796463e719
/// https://dartpad.dev/04689586c58fca438a3906796463e719
void main() { }
void aFunction(){
//
}
@JoeCodeswell
JoeCodeswell / JSONplay.dart
Last active October 5, 2020 15:55
Playing with JSON in dart. :)
/// JSONplay.dart
/// Playing with JSON in dart. :)
/// https://gist.github.com/JoeCodeswell/864394a7d86087113a7ad2ef2d80d542
/// https://dartpad.dev/864394a7d86087113a7ad2ef2d80d542
/// google: dart json
/// [Using JSON](https://dart.dev/guides/json)
/// [dart:convert - decoding and encoding JSON, UTF-8, and more](https://dart.dev/guides/libraries/library-tour#dartconvert---decoding-and-encoding-json-utf-8-and-more)
/// [dart:convert library](https://api.dart.dev/stable/2.8.4/dart-convert/dart-convert-library.html)
/// [How to parse Json in Flutter for Beginners](https://medium.com/flutter-community/how-to-parse-json-in-flutter-for-beginners-8074a68d7a79)
/// [JSON and serialization](https://flutter.dev/docs/development/data-and-backend/json)
@JoeCodeswell
JoeCodeswell / ListComprehensionsInDart.dart
Last active July 26, 2020 18:53
List Comprehensions in Dart
/// [List Comprehensions in Dart](https://medium.com/@DavidMPotter/list-comprehensions-in-dart-a57d3a06b703)
/// https://gist.github.com/JoeCodeswell/ListComprehensionsInDart.dart
/// /// https://dartpad.dev/18472e3fc8e84ed7ece391b8dc6a3ced
///
void main() {
var intList = [1, 2, 3, 4];
// py [x + 1 for x in intList]
@JoeCodeswell
JoeCodeswell / DartDataTableExp1.dart
Last active July 26, 2020 15:58
DartDataTableExp1
void main() {
// DartDataTableExp1
// https://gist.github.com/JoeCodeswell/34f5fca2d4e3df65155189b3be033da3
// https://dartpad.dev/34f5fca2d4e3df65155189b3be033da3
JoesDataList jdl = JoesDataList();
print(jdl.listOfDataItems[0].name); // Sarah
print(' ');
// jdl.Map(); // The method 'Map' isn't defined for the type 'JoesDataList' - line 4
@JoeCodeswell
JoeCodeswell / dartFinalConst.dart
Last active July 14, 2020 17:02
Dart Final vs. Const
// https://dartpad.dev/e31c87278033dbaf3bb4d55bfa8fd721
// e31c87278033dbaf3bb4d55bfa8fd721
// [Dart Final vs. Const](https://www.appbrewery.co/courses/548873/lectures/9988849)
void main() {
// int myNumber = 1; // if we want no change after this
// use `const` OR `final`
// const int myConst = 2;
// final int myFinal = 3;
@JoeCodeswell
JoeCodeswell / FlutterColumnOfExpandeds.dart
Last active July 12, 2020 13:46
Flutter Column Of Expanded Widgets
// on dartpad: https://dartpad.dev/391f0c9c13d49962573a83b0ce9fc305
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {