- Feature Name: numeric-conversions
- Start Date: 2019-10-30
- RFC PR: rust-lang/rfcs#0000
- Rust Issue: rust-lang/rust#0000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use embedded_svc::storage::RawStorage; | |
use embedded_svc::storage::Storage; | |
use embedded_svc::storage::StorageBase; | |
use esp_idf_svc::nvs::EspDefaultNvs; | |
use esp_idf_svc::nvs_storage::EspNvsStorage; | |
use esp_idf_sys::EspError; | |
use std::sync::Arc; | |
pub fn default(namespace: &str) -> Result<PostcardStorage<EspNvsStorage>, EspError> { | |
let read_write = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Make a PDF file editable in LibreOffice. | |
LibreOffice Draw can import and export PDF files, effectively making it a PDF editor. | |
However text in imported documents often looks broken, such as with | |
text rendered with a different font and overflowing into the next column. | |
What I suspect happens is that PDF files typically embed every font they use, | |
but LibreOffice’s internal document model does not support embedded fonts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/home/simon/.virtualenvs/weasyprint/bin/python | |
import weasyprint | |
import markdown | |
import os | |
here = os.path.dirname(__file__) | |
with open(os.path.join(here, "resume.md"), encoding="utf-8") as f: | |
html = markdown.markdown(f.read(), extensions=["def_list"]) | |
doc = weasyprint.HTML(string=html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Cargo Build Timings — servo 0.0.1</title> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
html { | |
font-family: sans-serif; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Cargo Build Timings — servo 0.0.1</title> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
html { | |
font-family: sans-serif; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if address :is ["To"] ["[email protected]"] { | |
if header :is ["X-GitHub-Reason"] ["manual", "author", "comment", "mention", "assign"] { | |
fileinto "Mozilla.Servo.mentions"; | |
stop; | |
} | |
if header :matches ["Subject"] "Re: *" { | |
fileinto "Mozilla.Servo.replies"; | |
stop; | |
} | |
fileinto "Mozilla.Servo"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://twitter.com/mraleph/status/559477604659773440 | |
// merge two sorted arrays in O(1) memory and O(n) time. nice excercise | |
// sort array of length k + m such that a[0] <= ... <= a[k-1] & a[k] <= ... <= a[k+m-1], in place in O(k+m) time | |
#![allow(unstable)] | |
// data.len() == k + m | |
fn merge(data: &mut [u8], k: usize) { | |
// M = data[..a] is merged | |
// A = data[a..b] is initially the first sub-array, of length k |
https://medium.com/@slsoftworks/why-should-one-keep-an-eye-out-for-servo-6d53eb6f64ff
Servo is currently basically the only browser engine that supports native rendering of vertical texts
As much as I love hearing from people that Servo is awesome, this is not correct.
First, vertical text support in Servo is currently (2014-12-01) experimental (behind an off-by-default flag), in early stages of development, and very buggy. So saying that we support is is a bit of a stretch :)
Second, other browsers have it too, although I don’t know how complete or how buggy. Microsoft has had some form of it since IE 5 (!), WebKit/Blink have it prefixed, and Firefox has it in Nightly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::str; | |
use std::iterator::{Iterator}; | |
use std::str::{eq, eq_slice, ByteIterator}; | |
use std::vec; | |
use std::ops; | |
use std::char; | |
struct IPv6Address { | |
data: [u16, ..8] | |
} |
NewerOlder