profile
viewpoint

cs2dsb/github-game-jam-2018 39

Entry for github game jam 2018. A lemmings runner game hybrid.

cs2dsb/stm32-usb.rs 10

A dev board designed to facilitate the development of USB firmware for STM32

cs2dsb/lcsc-scrape.rs 5

Scraper that creates a local SQLite database from parts in the JLCPCB SMT assembly service by looking up parameters from the LCSC product page

cs2dsb/max31855.rs 3

Driver for MAX31855 SPI thermocouple converter

cs2dsb/itm_logger.rs 1

An implementation of the log facade that sends logging information over ITM stim port 0

cs2dsb/adafruit-alphanum4.rs 0

Small wrapper on top of the `ht16k33` crate to drive an Adafruit 14-segment LED Alphanumeric Backpack

cs2dsb/amethyst 0

Data-oriented game engine written in Rust

cs2dsb/awesome-embedded-rust 0

Curated list of resources for Embedded and Low-level development in the Rust programming language

cs2dsb/beaglebone-ubuntu-scripts 0

Some scripts I use to maintain Ubuntu on the Beaglebone platform

issue commentcs2dsb/lcsc-scrape.rs

The last query command does not work

I wonder if adding a GUI shell for this tool will be more intuitive. Searched rust gui, seems that Rust is not GUI yet.

JLCPCBofficial

comment created time in 9 days

startedcs2dsb/lcsc-scrape.rs

started time in 10 days

issue commentcs2dsb/lcsc-scrape.rs

The last query command does not work

okay. now it does output a file and also with the right content, but the file only contains 515 parts while according to LCSCs webpage there are 18055 parts in the category of MLCC. In the README.md you wrote “...the cache is completely usable 99% of the time.” but it seems to miss like almost all of LCSCs component library. What's going on here?

JLCPCBofficial

comment created time in 10 days

issue commentcs2dsb/lcsc-scrape.rs

The last query command does not work

I tried but i ran into two different problems: 1: The columns in the .csv file get messed up because there's a comma in the description of some parts which then get identified as a comma for a column. Possible solutions would be to use a different character as a column spacer or to just exclude those columns with commas in it (like the " JLC_Description" column), but i don't know how to do so. screenshot

2: I tried simply replacing the Category (Power Management ICs/DC-DC Converters) with a different one (Multilayer Ceramic Capacitors MLCC - SMD/SMT), but that gave out a completely empty file. Did i messed something up? screenshot2

JLCPCBofficial

comment created time in 10 days

issue commentcs2dsb/lcsc-scrape.rs

The last query command does not work

Anything I can help with? I've just added a pre-compiled windows binary to the release in case it's windows you are having problems with.

I had trouble starting the linux version, cuz i'm just getting started with linux and the only linux distro i currently have is Tails, but the windows executable solved that problem. Thanks. Now i'm trying to figure out how i can export a certain group of parts (like, all C0G, NP0 Ceramic Capacitors) to a .csv file so that i can import it to LibreOffice Calc to then do some advanced Price comparison (like, Capacity per $).

The Program is running now, i just don't understand the usage. Can you help?

JLCPCBofficial

comment created time in 10 days

issue commentcs2dsb/lcsc-scrape.rs

The last query command does not work

I'm having trouble starting the program in the first place. Srsly, why doesn't offer lcsc that option on their webpage? Every other big component distributor has it like mouser or digikey.

JLCPCBofficial

comment created time in 10 days

startedfluffysquirrels/monitor-rs

started time in 11 days

startedfluffysquirrels/rt-graph-rs

started time in 11 days

startedfluffysquirrels/mqtt-async-client-rs

started time in 11 days

issue openedcs2dsb/lcsc-scrape.rs

The last query command does not work

Hi,

Very cool project! I tested it and found the last query command should be:

./lcsc-scrape query \
'SELECT part_number, Description, JLC_Description, Datasheet, JLC_Datasheet
FROM parts 
WHERE part_number = "C14867"'

-- Atommann Technical Writer from JLCPCB

created time in 15 days

startedcs2dsb/lcsc-scrape.rs

started time in 17 days

push eventfluffysquirrels/mqtt-async-client-rs

Alex Helfet

commit sha d175d1410562588b192e9bede6dadcde08cf8c93

Fix the build in nightly: add `<>` to links.

view details

push time in 23 days

pull request commentfluffysquirrels/mqtt-async-client-rs

Implement Debug for Client and ClientOptions.

Your changes are in 0.1.7, just published to crates.io.

marcelbuesing

comment created time in a month

PR closed fluffysquirrels/mqtt-async-client-rs

Improve Publish efficiency by avoid allocations.

Changes:

  • Abstract out Payload with a minimum fixed buffer of 8 bytes. Anything larger goes into a Vec<u8>.
  • Standard conversions of standard types to Payload.
  • Use Cow<'static, str> for Publish topic to enable using constant strings as topics.

Sorry, since you don't have a rustfmt.toml, it messes up your formatting a bit.

+197 -25

1 comment

1 changed file

schungx

pr closed time in a month

pull request commentfluffysquirrels/mqtt-async-client-rs

Improve Publish efficiency by avoid allocations.

As discussed in #11, I'm going to close this without benchmarks to show they speed things up.

schungx

comment created time in a month

issue closedfluffysquirrels/mqtt-async-client-rs

Avoid allocations in publications

It seems inefficient to always build a Vec<u8> to hold publish data if the data length is relatively constant. For example, if always publishing i32 or f32/f64, etc., it is a waste to always have to create a new Vec<u8> every time.

A suggestion is to make Publish with a minimum buffer size (something like 8 bytes should work for most primitive data types):

pub enum Payload {
    Fixed([u8; 8], u8),    // 8-byte buffer, length
    Vec(Vec<u8>),        // Variable length
}

pub struct Publish {
    topic: Cow<'static, str>,
    payload: Payload,
    qos: QoS,
    retain: bool,
}

fn new_4<T: Into<Cow<'static, str>>(topic: T, payload: [u8; 4]) -> Publish {
        let mut buf = [0_u8; 8];
        buf[0..4].copy_from_slice(payload);
        Publish { topic: topic.into(), payload: Payload::Fixed(buf, 4), qos: QoS::AtMostOnce, retain: false, }
    }
}

pub fn new_i32<T: Into<Cow<'static, str>>(topic: T, payload: i32) -> Publish {
    Self::new_4(topic, payload.as_le_bytes())
}

This also uses Cow<'static, str> to avoid allocations when topic names are constants (which may happen a LOT).

closed time in a month

schungx

issue commentfluffysquirrels/mqtt-async-client-rs

Avoid allocations in publications

Thanks for the input but I'm going to close this now without positive benchmarks to show it helps.

schungx

comment created time in a month

delete branch fluffysquirrels/mqtt-async-client-rs

delete branch : marcelbuesing-dependencies

delete time in a month

created tagfluffysquirrels/mqtt-async-client-rs

tagv0.1.7

An MQTT client written in Rust

created time in a month

push eventfluffysquirrels/mqtt-async-client-rs

Alex Helfet

commit sha a1e067e6f5d1653d7fe93617d16aa474a2be093b

Version 0.1.7.

view details

push time in a month

push eventfluffysquirrels/mqtt-async-client-rs

marcelbuesing

commit sha e73f535ff45077a9bbad16dd7337b8749d4dba13

Implement Debug for Client and ClientOptions.

view details

Alex Helfet

commit sha 546971c0ecf3eea55933d154cefa10707b25664d

Merge pull request #19 from marcelbuesing/debug-impl Implement Debug for Client and ClientOptions.

view details

push time in a month

PR merged fluffysquirrels/mqtt-async-client-rs

Implement Debug for Client and ClientOptions.

Ran into this missing Debug implementation when using the tracing crate.

Notice: I intentionally left out password in the ClientOptions.

+28 -0

1 comment

1 changed file

marcelbuesing

pr closed time in a month

pull request commentfluffysquirrels/mqtt-async-client-rs

Implement Debug for Client and ClientOptions.

Thanks for this.

marcelbuesing

comment created time in a month

push eventfluffysquirrels/mqtt-async-client-rs

marcelbuesing

commit sha 8e08e6eec0e11ef476db45942900219f95d28908

Reduce mandatory dependencies.

view details

marcelbuesing

commit sha 3dbcafc289b6252519c7f2b68e0d57c2aae497bb

Make rustls optional

view details

Alex Helfet

commit sha e6d9df625cd16005787cff09daf97c4f5f87cdf8

Merge pull request #18 from marcelbuesing/dependencies Reduce dependencies

view details

push time in a month

PR merged fluffysquirrels/mqtt-async-client-rs

Dependencies

Hi, just wanted to let you it has been a great experience to use this crate, by far the best mqtt client rust crate i have used so far.

I noticed that some dependencies can be made optional by moving them to dev dependencies. Had to move the bin to the example folder for this. Furthermore I added a tls feature but made it part of the default features. So people can opt out if they want to.

Before:

├── bytes v0.4.12
│   ├── byteorder v1.3.2
│   └── iovec v0.1.4
│       └── libc v0.2.66
├── env_logger v0.7.1
│   ├── atty v0.2.14
│   │   └── libc v0.2.66
│   ├── humantime v1.3.0
│   │   └── quick-error v1.2.3
│   ├── log v0.4.8
│   │   └── cfg-if v0.1.10
│   ├── regex v1.3.3
│   │   ├── aho-corasick v0.7.6
│   │   │   └── memchr v2.3.0
│   │   ├── memchr v2.3.0
│   │   ├── regex-syntax v0.6.13
│   │   └── thread_local v1.0.1
│   │       └── lazy_static v1.4.0
│   └── termcolor v1.1.0
├── futures-core v0.3.1
├── futures-util v0.3.1
│   ├── futures-core v0.3.1
│   ├── futures-macro v0.3.1
│   │   ├── proc-macro-hack v0.5.11
│   │   │   ├── proc-macro2 v1.0.8
│   │   │   │   └── unicode-xid v0.2.0
│   │   │   ├── quote v1.0.2
│   │   │   │   └── proc-macro2 v1.0.8 (*)
│   │   │   └── syn v1.0.13
│   │   │       ├── proc-macro2 v1.0.8 (*)
│   │   │       ├── quote v1.0.2 (*)
│   │   │       └── unicode-xid v0.2.0
│   │   ├── proc-macro2 v1.0.8 (*)
│   │   ├── quote v1.0.2 (*)
│   │   └── syn v1.0.13 (*)
│   ├── futures-task v0.3.1
│   ├── pin-utils v0.1.0-alpha.4
│   ├── proc-macro-hack v0.5.11 (*)
│   ├── proc-macro-nested v0.1.3
│   └── slab v0.4.2
├── log v0.4.8 (*)
├── maplit v1.0.2
├── mqttrs v0.2.0
│   └── bytes v0.4.12 (*)
├── rustls v0.16.0
│   ├── base64 v0.10.1
│   │   └── byteorder v1.3.2
│   ├── log v0.4.8 (*)
│   ├── ring v0.16.9
│   │   ├── lazy_static v1.4.0
│   │   ├── libc v0.2.66
│   │   ├── spin v0.5.2
│   │   └── untrusted v0.7.0
│   │   [build-dependencies]
│   │   └── cc v1.0.50
│   ├── sct v0.6.0
│   │   ├── ring v0.16.9 (*)
│   │   └── untrusted v0.7.0
│   └── webpki v0.21.0
│       ├── ring v0.16.9 (*)
│       └── untrusted v0.7.0
├── structopt v0.3.7
│   ├── clap v2.33.0
│   │   ├── ansi_term v0.11.0
│   │   ├── atty v0.2.14 (*)
│   │   ├── bitflags v1.2.1
│   │   ├── strsim v0.8.0
│   │   ├── textwrap v0.11.0
│   │   │   └── unicode-width v0.1.7
│   │   ├── unicode-width v0.1.7
│   │   └── vec_map v0.8.1
│   └── structopt-derive v0.4.0
│       ├── heck v0.3.1
│       │   └── unicode-segmentation v1.6.0
│       ├── proc-macro-error v0.4.4
│       │   ├── proc-macro-error-attr v0.4.3
│       │   │   ├── proc-macro2 v1.0.8 (*)
│       │   │   ├── quote v1.0.2 (*)
│       │   │   ├── rustversion v1.0.1
│       │   │   │   ├── proc-macro2 v1.0.8 (*)
│       │   │   │   ├── quote v1.0.2 (*)
│       │   │   │   └── syn v1.0.13 (*)
│       │   │   ├── syn v1.0.13 (*)
│       │   │   └── syn-mid v0.4.0
│       │   │       ├── proc-macro2 v1.0.8 (*)
│       │   │       ├── quote v1.0.2 (*)
│       │   │       └── syn v1.0.13 (*)
│       │   ├── proc-macro2 v1.0.8 (*)
│       │   ├── quote v1.0.2 (*)
│       │   └── syn v1.0.13 (*)
│       │   [build-dependencies]
│       │   └── rustversion v1.0.1 (*)
│       ├── proc-macro2 v1.0.8 (*)
│       ├── quote v1.0.2 (*)
│       └── syn v1.0.13 (*)
├── tokio v0.2.9
│   ├── bytes v0.5.3
│   ├── fnv v1.0.6
│   ├── iovec v0.1.4 (*)
│   ├── lazy_static v1.4.0
│   ├── memchr v2.3.0
│   ├── mio v0.6.21
│   │   ├── cfg-if v0.1.10
│   │   ├── iovec v0.1.4 (*)
│   │   ├── libc v0.2.66
│   │   ├── log v0.4.8 (*)
│   │   ├── net2 v0.2.33
│   │   │   ├── cfg-if v0.1.10
│   │   │   └── libc v0.2.66
│   │   └── slab v0.4.2
│   ├── pin-project-lite v0.1.2
│   ├── slab v0.4.2
│   └── tokio-macros v0.2.3
│       ├── quote v1.0.2 (*)
│       └── syn v1.0.13 (*)
├── tokio-rustls v0.12.2
│   ├── futures-core v0.3.1
│   ├── rustls v0.16.0 (*)
│   ├── tokio v0.2.9 (*)
│   └── webpki v0.21.0 (*)
└── webpki-roots v0.18.0
    └── webpki v0.21.0 (*)

After (without tls feature):

├── bytes v0.4.12
│   ├── byteorder v1.3.4
│   └── iovec v0.1.4
│       └── libc v0.2.80
├── futures-core v0.3.7
├── futures-util v0.3.7
│   ├── futures-core v0.3.7
│   ├── futures-macro v0.3.7
│   │   ├── proc-macro-hack v0.5.19
│   │   ├── proc-macro2 v1.0.24
│   │   │   └── unicode-xid v0.2.1
│   │   ├── quote v1.0.7
│   │   │   └── proc-macro2 v1.0.24 (*)
│   │   └── syn v1.0.48
│   │       ├── proc-macro2 v1.0.24 (*)
│   │       ├── quote v1.0.7 (*)
│   │       └── unicode-xid v0.2.1
│   ├── futures-task v0.3.7
│   │   └── once_cell v1.4.1
│   ├── pin-project v1.0.1
│   │   └── pin-project-internal v1.0.1
│   │       ├── proc-macro2 v1.0.24 (*)
│   │       ├── quote v1.0.7 (*)
│   │       └── syn v1.0.48 (*)
│   ├── pin-utils v0.1.0
│   ├── proc-macro-hack v0.5.19
│   ├── proc-macro-nested v0.1.6
│   └── slab v0.4.2
├── log v0.4.11
│   └── cfg-if v0.1.10
├── maplit v1.0.2
├── mqttrs v0.2.0
│   └── bytes v0.4.12 (*)
└── tokio v0.2.22
    ├── bytes v0.5.6
    ├── fnv v1.0.7
    ├── iovec v0.1.4 (*)
    ├── lazy_static v1.4.0
    ├── memchr v2.3.4
    ├── mio v0.6.22
    │   ├── cfg-if v0.1.10
    │   ├── iovec v0.1.4 (*)
    │   ├── libc v0.2.80
    │   ├── log v0.4.11 (*)
    │   ├── net2 v0.2.35
    │   │   ├── cfg-if v0.1.10
    │   │   └── libc v0.2.80
    │   └── slab v0.4.2
    ├── pin-project-lite v0.1.11
    ├── slab v0.4.2
    └── tokio-macros v0.2.5
        ├── proc-macro2 v1.0.24 (*)
        ├── quote v1.0.7 (*)
        └── syn v1.0.48 (*)
+353 -370

3 comments

8 changed files

marcelbuesing

pr closed time in a month

pull request commentfluffysquirrels/mqtt-async-client-rs

Dependencies

This is great, thanks!

marcelbuesing

comment created time in a month

pull request commentfluffysquirrels/mqtt-async-client-rs

Dependencies

Thanks for your kind words, I'm happy that you've found this crate useful.

This is a nice change: disabling tls saves 22s (37%) off the initial compile on my machine.

Can you add a line to the lib.rs doc comment (

https://github.com/fluffysquirrels/mqtt-async-client-rs/blob/9a0e03c3688a24b3d793368bd76c6aca46610cd5/src/lib.rs#L1-L9 ) explaining the feature that you've added? I.e. that tls is a feature, enabled by default, which supports connections over TLS with rustls? Thanks!

Just added it. It also makes cross compiling significantly easier if TLS is not required. Otherwise ring apparently needs some specific setup. E.g. you can reproduce this via:

cargo build --target armv7-unknown-linux-musleabihf --release --example mqttc
failed to run custom build command for `ring v0.16.15`
marcelbuesing

comment created time in a month

Pull request review commentfluffysquirrels/mqtt-async-client-rs

Implement Debug for Client and ClientOptions.

 pub(crate) struct ClientOptions {     pub(crate) connect_retry_delay: Duration, } +impl fmt::Debug for ClientOptions {+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {+        f.debug_struct("ClientOptions")+         .field("host", &self.host)+         .field("port", &self.port)+         .field("username", &self.username)+         .field("keep_alive", &self.keep_alive)

Good point, just added it.

marcelbuesing

comment created time in a month

pull request commentfluffysquirrels/mqtt-async-client-rs

Dependencies

Thanks for your kind words, I'm happy that you've found this crate useful.

This is a nice change: disabling tls saves 22s (37%) off the initial compile on my machine.

Can you add a line to the lib.rs doc comment (https://github.com/fluffysquirrels/mqtt-async-client-rs/blob/9a0e03c3688a24b3d793368bd76c6aca46610cd5/src/lib.rs#L10) explaining the feature that you've added? I.e. that tls is a feature, enabled by default, which supports connections over TLS with rustls? Thanks!

marcelbuesing

comment created time in a month

more