I've prepared this in case I get sick or just too lazy to speak during the workshop, so that you won't be left high and dry.
Here's a table comparing terms:
Human Btrfs LVM ZFS
from typing import Callable, TypedDict | |
def string_ret() -> str: | |
return "string" | |
def int_ret() -> int: | |
return 1 | |
class Func(TypedDict): |
class BlogAdmin(admin.ModelAdmin): | |
list_display = ('__str__', 'get_num_comments') | |
def get_queryset(self, request): | |
qs = super().get_queryset(request) | |
return qs.annotate( | |
num_comments=models.Count('comment') | |
) | |
def get_num_comments(self, obj): |
Come Demo vorrei farvi vedere quello che ha fatto napo in un suo post ma in modo diverso. | |
Come dati useremo sempre il dataset del Consip su Bandi e gare del 2017. | |
Che ho già scaricato qui. Ora per vedere cosa c'è dentro facciamo un head da terminale. Ah! | |
Ci sono problemi con gli accenti perchè evidentemente in Consip non è arrivato ancora unicode. | |
Per risolvere problemi di questo tipo la cosa più semplice è caricare il file in LibreOffice, | |
indovinare l'encoding (conviene scommettere su windows 1252) e riesportarlo in UTF-8. | |
Visto che ci siamo togliamo anche il commento nell'header che ci da solo fastidio. | |
Ora che abbiamo un csv utilizzabile andiamo direttamente su superset. Dalla versione 0.23 che |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
Base: | |
- tavoli e sedie | |
- prolunghe elettriche | |
- ciabatte con eventuali adattatori shuko | |
- chiavette usb |
from bootstrap3.renderers import FieldRenderer, FormsetRenderer | |
class ConcordiaFormsetRenderer(FormsetRenderer): | |
def render_form(self, form, **kwargs): | |
html = super(ConcordiaFormsetRenderer, self).render_form(form, **kwargs) | |
if self.layout == 'tabular': | |
return '<tr>{html}</tr>'.format(html=html) | |
return html | |
def render_form_labels(self): |
import sys, re | |
import requests | |
""" | |
You need a microsoft account to use the bing search api, see http://datamarket.azure.com/dataset/bing/search | |
# It could make sense to query only for bigger files | |
find . -size +100M > Downloads.find | |
# get md5 digest | |
md5deep -f Downloads.find > Downloads.md5 |
<!DOCTYPE html> | |
<html class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="keywords" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
--- static/js/bootstrap-datepicker.orig.js 2013-10-23 10:49:52.107728856 +0200 | |
+++ static/js/bootstrap-datepicker.js 2013-10-23 12:04:45.769781994 +0200 | |
@@ -43,6 +43,8 @@ | |
this.isInput = this.element.is('input'); | |
this.component = this.element.is('.date') ? this.element.find('.add-on, .btn') : false; | |
this.hasInput = this.component && this.element.find('input').length; | |
+ var altParent = this.element.offsetParent(); | |
+ this.altParent = altParent.find('body').length ? false : altParent; | |
if(this.component && this.component.length === 0) | |
this.component = false; |