More comprehensive reverse JHS formula for computing latitude,longitude given northing, easting of a projection.
reference: Geomatics guidance Note number 7 part 2 - 3.5.3.1
(EPSG Dataset coordinate operation method code 9807)
from sqlalchemy.schema import DropTable | |
from sqlalchemy.ext.compiler import compiles | |
from sqlalchemy.dialects.postgresql.base import PGDDLCompiler | |
from typing import Any | |
@compiles(DropTable, "postgresql") | |
def _compile_drop_table(element: DropTable, compiler: PGDDLCompiler, **kwargs: Any) -> str: | |
return compiler.visit_drop_table(element) + " CASCADE" |
Example:
python -c "print(hash('hello world'))"
generates random numbers,
while python -c "print(hash(4.2))"
always returns a constant value
This code will run forever ( and eat all your RAM ):
T = TypeVar("T") | |
class MyProtocol(Protocol[T]): | |
def my_method(self, first_param: int, args: T) -> int: | |
... | |
@dataclass | |
class Imp1Args: | |
x: float | |
y: float | |
class Imp1(MyProtocol[Imp1Args]): |
import 'package:collection/collection.dart'; | |
import 'package:flutter/material.dart'; | |
extension WidgetListSpacing on List<Widget> { | |
List<Widget> withSizedBoxBetween({double? width, double? height}) { | |
final box = SizedBox(width: width, height: height); | |
return mapIndexed((index, widget) => index == 0 || index == length ? [widget] : [box, widget]).flattened.toList(); | |
} | |
} |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Clubbi code challenge', | |
debugShowCheckedModeBanner: false, |
# put file in /etc/X11/xorg.conf.d/40-microsoft-mouse.conf | |
# use xinput list-props "Microsoft Microsoft® Classic IntelliMouse®" to get all options | |
# use xinput set-prop "Microsoft Microsoft® Classic IntelliMouse®" "OPTION" "OPTIONVALUE" to test an option | |
Section "InputClass" | |
Identifier "Microsoft Mouse" | |
MatchProduct "Microsoft Microsoft® Classic IntelliMouse®" | |
Driver "libinput" | |
Option "TransformationMatrix" "2.4 0 0 0 2.4 0 0 0 1" | |
EndSection |
import 'package:flutter/material.dart'; | |
class TabControllerWithOnChange extends TabController { | |
TabControllerWithOnChange({ | |
int initialIndex = 0, | |
required int length, | |
required TickerProvider vsync, | |
required void Function(int) onChange, | |
}) : super(initialIndex: initialIndex, length: length, vsync: vsync) { | |
addListener(() { |
import 'dart:io'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:qr_code_scanner/qr_code_scanner.dart'; | |
class ScannerWidget extends StatefulWidget { | |
final BarcodeFormat format; | |
final void Function(String?) onScan; | |
ScannerWidget({ |
use std::fmt; | |
#[derive(Debug, Clone, Copy)] | |
struct Point { | |
x: f64, | |
y: f64, | |
} | |
impl fmt::Display for Point { | |
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { |