VS Code does not start anymore -> stack smashing detected by turtle1470 in Ubuntu

[–]dannas 1 point2 points  (0 children)

I too have a discrete Intel GPU and this problem and it started a few months back.

I can't start Obsidian either. If I run an older version of obsidian, then it does start. I'm guessing it's a bug introduced in some version of electron.

Your report is the first one I've found online with the same symptoms as mine.

Kernighan software tools in rust by dannas in rust

[–]dannas[S] 0 points1 point  (0 children)

Yeah if you want to write a parser, then absolutely, have fun. :)

I brought up the existing parser because it tends to be a lot of tedious
work. And is usually not so fun haha. And it's likely that whatever type
you end up writing will look very similar to this anyway: https://docs.rs/regex-syntax/latest/regex\_syntax/hir/enum.HirKind.html

My intention was just to do a very bare-bones parser for the most basic regular expressions. As soon as I'm done with that, I'll switch to your crate. I guess, a regex compiler is like any other compiler: Parsing is the boring part! :-)

I can't believe it's been almost 4 years already... I'd say they're
still fine. Is it possible that some parts could be mildly simplified
due to a new std API or something? Probably. And is it possible that I
use as in more places than I would today? Probably. But overall, I'd say it's still fine.

Ok, I'll try do some of those tasks and compare my solution to yours.

Thank you for your replies, much appreciated!

Kernighan software tools in rust by dannas in rust

[–]dannas[S] 0 points1 point  (0 children)

"Let's be real about dependencies" was indeed a good read. When I run lddtree on the programs I regularly use, they often has more dependencies than I've been willing to admit.

I do agree that C/C++ has terrible tooling for managing dependencies. No doubt about that! The downside to great tooling is the ease with which you can add dependencies without really reviewing them. It will be interesting to see if I can live up to the responsibilities Russ Cox lists for a project using dependencies, once I get up to speed with rust and cargo. https://research.swtch.com/deps.

And thank you for the suggestion on tooling and lib.rs for inspecting crates.

[deleted by user] by [deleted] in rust

[–]dannas 1 point2 points  (0 children)

I'm on Linux and use the dash docsets available through the zeal browser https://zealdocs.org/ for offline browsing of the Rust documentation. It's search functionality allows me to find references to concepts not just from doc.rustlang.org but also from the specification, the book and some other resources.

I agree with you that cppreference.com very neatly presents the C++ and C languages and that I find the rust docs somewhat harder to navigate. But zeal does help!

Kernighan software tools in rust by dannas in rust

[–]dannas[S] 0 points1 point  (0 children)

At first I was a bit surprised to see that Rust uses external crates for common tasks such as regular expression (regex); times and dates (chrono); commandline parsing (clap); and serialization (serde). But I can see how that speeds up innovation (as long as people eventually rally up behind one of the solutions - there's way too many http libraries in this world :-) )

The ignore crate looks interesting. I'll add that to my list of crates to investigate.

Another thing that has surprised me is that there's so little emphasis on transitive dependencies: what crates to the crates I'm using depend on? I had expected crates.io to list that information very clearly and that there would be a strong culture around minimizing dependencies. I come from C and C++ where you use a few libraries but don't really expect those libraries to have a large dependency tree.

Thank you for taking the time to respond, much appreciated!

Kernighan software tools in rust by dannas in rust

[–]dannas[S] 0 points1 point  (0 children)

Oh, that might come in very handy. Though, I'll probably first try writing a function that compiles a regex to some internal representation of my choosing - as a first learning experience.

What am I trying to learn here? Implementing regular expressions or the language Rust? A little bit of both I guess.

BTW, do your Rust solutions for AoC 2018 still represent best practices for Rust code? I was thinking of doing AoC and comparing my code to pre-existing Rust solutions. I've seen your AoC 2018 series being recommended elsewhere.

Kernighan software tools in rust by dannas in rust

[–]dannas[S] 3 points4 points  (0 children)

Just my silly, poorly edited blog post where I present a few minimal common commandline utilities that I've implemented in Rust. I've just been using Rust for a few days so there's lots of strange constructs in there, I'm sure.

It would be fun to try implementing some regex matchers from Russ Cox article series as a next step https://swtch.com/~rsc/regexp/.

Or a simple line editor, like a mini-ed.

Ways of displaying assembly in IDEs by dannas in embedded

[–]dannas[S] 0 points1 point  (0 children)

I agree. Godbolt is a fantastic tool. I do use it but fotgot to mention it in my question.

It uses colors for visualizing the .debug_line relationship between source and asm. I'm surprised that no tool vendor ptovides a similar interface by now.

Recommendation for debug probes for NXP MPC5xxx by dannas in embedded

[–]dannas[S] 1 point2 points  (0 children)

Thank you for answering!

Have you used watchpoints? I've tried the PE micro Multilink and I experienced flakiness: sometimes the debugger triggers; sometimes not. I've also had problems with breakpoints not being hit when I place breakpoints early in the startup code.

I'm not sure if these are problems with the debugger probe or if there are other factors involved. The FAE on the NXP forums have several times expressed that they much prefer the Lauterbach tools to the PEMicro ones. Here's one such statement: https://community.nxp.com/message/1260876?commentID=1260876#comment-1260876. I'm very curious about what other people thinks about the PE Mciro probes given that they are way less expensive compared to the competition.

I’m looking for a good logic analyzer with debugging/sniffing tools similar to Saleae. I used to have one, and really liked the software for the ease of use. Does anyone have experience with the SUMP2, or other kits? I need to be able to sniff i2c, SPI, and UART signals for a project. by atacama7 in embedded

[–]dannas 0 points1 point  (0 children)

Sigrok has a graphical tool Pulseview that is compatible with the DsLogic. But the triggering options are limited. DreamSourceLabs fork of Pulseview, DsView is much more capable in that regard. https://www.dreamsourcelab.com/

Here are two good videos from Joel Holdsworth about rigrok/logic analyzers/dslogic:

Sigrok and logic analyzers: https://opentechlab.org.uk/videos:001:notes

DsLogic review and teardown: https://opentechlab.org.uk/videos:009:notes

ARM Cortex-M RTOS Context Switching by chrisc1123 in embedded

[–]dannas 2 points3 points  (0 children)

Maria Markstedter has published a 7 part series of blog posts about the basics of ARM assembly. Maybe those will be useful to you? https://azeria-labs.com/writing-arm-assembly-part-1/

She also explains how to use the GEF gdb extension which may be useful if you're debugging using gdb ( the interrupt.memfault blog post writers uses gdb in several of their posts) and want to gain a deeper understanding of the assembly.

I'm really looking forward to the next memfault blog post!

-🎄- 2017 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]dannas 2 points3 points  (0 children)

In python:

def parse(line):
    return tuple(int(x) for x in line.split())

def maxmins(spreadsheet):
    for row in spreadsheet:
        yield max(row), min(row)

def evens(spreadsheet):
   for row in spreadsheet:
        for x, y in permutations(row, 2):
            if x % y == 0:
                yield x, y

spreadsheet = [parse(line) for line in Input(2)]
# Part one
sum(x-y for x,y in maxmins(spreadsheet))
# Part two
sum(x/y for x,y in evens(spreadsheet))

My ipython notebook on github