profile
viewpoint
Mahmoud Al-Qudsi mqudsi NeoSmart Technologies Chicago, IL http://neosmart.net/

mqudsi/cJSON 2

Unofficial mirror of cJSON from SourceForge. Dead-simple JSON parser and generator in C.

mqudsi/aria2 0

aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink.

mqudsi/auto-hyperlink-urls 0

Fork of Scott Reilly (coffe2code)'s WordPress plugin to automatically hyperlink urls in posts, with small improvements.

mqudsi/autojump 0

A cd command that learns - easily navigate directories from the command line

mqudsi/base16-vim 0

Base16 for Vim

mqudsi/bbcp 0

bbcp, an ultra-fast peer-to-peer file transfer utility created by Stanford

mqudsi/bottom 0

Yet another cross-platform graphical process/system monitor.

mqudsi/build_nginx 0

Automated nginx build script

mqudsi/cc-rs 0

Rust library for build scripts to compile C/C++ code into a Rust library

issue commentneosmart/open

Already have it.

Shouldn't this difference be noted in README? Maybe with usage examples?

heavyuser

comment created time in 13 hours

startedmqudsi/lrmi

started time in 2 days

CommitCommentEvent

push eventridiculousfish/littlecheck

Fabian Homborg

commit sha da7ebddce447bfc3b1e927b3372d7e0eefa6e692

Don't use autojunk This does weird things and I don't like it.

view details

Fabian Homborg

commit sha 0f6841bbc1674e89f512b5f19d1ad4e0227d2934

Hack SequenceMatcher to do the regex matching This solves an edgecase we actually hit in our tests: python_missing_output.py complained: 1 <= no check matches this, previous check on line 13 even tho a CHECK totally *did*, and Fourth <= does not match CHECK '{{\\d}}' on line 40 even tho that CHECK already matched the previous number. The underlying problem was that we'd pass non-matching CHECKs as their regex-source, which means they could never match the *next* line (or any other line). This means that the SequenceMatcher has to know about regex. Unfortunately, it can't. What we do is to add an __eq__() method to both CheckCmd and Line that knows about regex matching, and to force it to be used we override the __hash__ so it always collides. Then we pass the actual Line/CheckCmd objects instead of the escaped test. This is because python dictionaries first check __hash__, and on collision check __eq__. Any better solution would require us to include our own diffing implementation, as python's difflib unfortunately doesn't have any better facilities for including this.

view details

push time in 3 days

startedmqudsi/syngesture

started time in 3 days

startedmqudsi/syngesture

started time in 4 days

push eventridiculousfish/littlecheck

Fabian Homborg

commit sha 9836e67024d6071bcd8cace7a383baf0d19747bc

Reformat

view details

push time in 6 days

PR closed ridiculousfish/littlecheck

Diff output enhancement

One of the issues with our current output is that it only handles the first mismatch, and it won't figure out if there's a line missing, so e.g. if the test output is

1
3
4
5

and we have CHECKs for 1, 2, 3, 4 and 5, it will complain that "3" does not match "2".

This isn't wrong, but it's quite misleading, and you really need to pay attention.

This PR changes the output so that it basically runs a diff on the lines and CHECKs. The trick is that we match the checks before, and for every CHECK that does we add the matched string, for every that didn't we add the literal CHECK.

Then we use python's difflib.SequenceMatcher to get a diff, and we print that.

The header is still just the first error, but that's also probably the most important, so it's okay.

This replaces the before/after context, because we now always do a hard-coded 3 lines of context around every diff point, so the information is already in there.

Some example output:

Screenshot_20201116_105356

I'd like some feedback on the output, but do note that I'm trying to not make colors mandatory (in particular because Github Actions doesn't show them!), so this should still be readable without.

+246 -84

3 comments

15 changed files

faho

pr closed time in 6 days

pull request commentridiculousfish/littlecheck

Diff output

Merged as 1e1b5e0..b9c24a3

faho

comment created time in 6 days

push eventridiculousfish/littlecheck

Fabian Homborg

commit sha 1e1b5e05d617908d86b984b9c27ced3cfb41cd48

Escape line.text This is needed for unambiguous output. We don't want to print color sequences and such.

view details

Fabian Homborg

commit sha a467638e094613ee65797d0d6b0e6940a0859b59

Remove before/after This is going to be superfluous soon

view details

Fabian Homborg

commit sha b9c24a3e818eb2d67e46655d5a616b54e1c88314

Create a diff between the lines and the checks This creates output like ``` Failure in test/files/python_missing_output.py: The CHECK on line 8 wants: NotPrinted which failed to match line stdout:2: Second Context: First <= nothing to match CHECK 'NotPrinted' on line 8 Second Third 1 <= no check matches this, previous check on line 13 2 3 4 [...] from line 34 (stdout:14): 6 6 6 Fourth <= does not match CHECK '{{\\d}}' on line 40 when running command: /usr/bin/python test/files/python_missing_output.py ``` (with color). Instead of just listing the first error (CHECK on line 8 doesn't have a match), we manage to list the other errors as well, and we also figure out that there's a line *missing*, instead of chalking it up to "Second" not matching "NotPrinted", or "no more CHECKS left". Really the breakthrough here is that we go through the entire list, and if a regex matches *add the literal text* to the list. That way we can use diffing libs because now it's all just strings.

view details

push time in 6 days

Pull request review commentridiculousfish/littlecheck

Diff output

 Failure in python_whitespace.py:     {{^}} four    which failed to match line stdout:4:-    four+       four

I see, I was looking at the wrong lines in python_whitespace.py.

Either option is fine by me. I think it's okay like this, without a delimiter.

not e.g. on Github Actions in a browser

https://github.com/fish-shell/fish-shell/runs/1402741560?check_suite_focus=true looks like monospace. Anyway, even without the | it will look weird in a non-monospace font, I think we can ignore that.

faho

comment created time in 9 days

Pull request review commentridiculousfish/littlecheck

Diff output

+Failure in python_missing_check.py:++  The CHECKERR on line 7 wants:+    BETA++  which failed to match line stderr:1:+    ALPHA++  Context:+    ALPHA (nothing to match)+    BETA+    GAMMA1 (nothing to match)

I like diff -u, but this the current version with "nothing to match" is really easy to read.

Maybe hardcode a context of 3-5 lines, so we don't print too many matching lines. Mismatched lines should probably all be printed.

faho

comment created time in 9 days

Pull request review commentridiculousfish/littlecheck

Diff output

 Failure in python_whitespace.py:     {{^}} four    which failed to match line stdout:4:-    four+       four

It seems inconsistent though, four only has 4+3 spaces, while the one from the context has 4+4 spaces.

That's because it actually is that way in the test file. The output just shows what is there. (which is inconsistent and not necessary, but it's not caused by this patch)

The indent seems alright as long as the structure of the output suggests that the indented part is the actual line, and the non-indented part is just metadata.

That's why I'm asking if we add a delimiter. Because output like

  Context:
    a
      b

doesn't really make clear that there are 2 spaces before the b, because it's 2+4 already.

Do we change it to

  Context:
  |a
  |  b

so the line starts right after the |? (note that this will only really work in a monospace font, which is a given in a terminal, but not e.g. on Github Actions in a browser)

faho

comment created time in 9 days

Pull request review commentridiculousfish/littlecheck

Diff output

 Failure in python_whitespace.py:     {{^}} four    which failed to match line stdout:4:-    four+       four

The indent seems alright as long as the structure of the output suggests that the indented part is actual line, and the non-indented part is just metadata.

It seems inconsistent though, four only has 4+3 spaces, while the one from the context has 4+4 spaces.

faho

comment created time in 9 days

issue closedneosmart/pevents

WaitForMultipleThreads

Hi team,

I was wondering if there is any plan to support WaitForMultipleThreads just like calling WaitForMultipleObjects on threads in windows?

Thanks. Wenbo

closed time in 9 days

w-Yuan

issue commentneosmart/pevents

WaitForMultipleThreads

I think this is irrelevant with this repo. Sorry about spam.

w-Yuan

comment created time in 9 days

issue openedneosmart/pevents

WaitForMultipleThreads

Hi team,

I was wondering if there is any plan to support WaitForMultipleThreads just like calling WaitForMultipleObjects on threads in windows?

Thanks. Wenbo

created time in 11 days

pull request commentridiculousfish/littlecheck

Diff output

Okay, I added the line number to any mismatch (the "does not match" bit), and then introduced two random errors in fish's andandoror test.

Here's the output: Screenshot_20201116_183038

Note: the tests haven't yet been adjusted for the line numbers, and if no CHECK is found, we don't have a line number to show - maybe show the number of the previous check ("no check after line 23")?

faho

comment created time in 12 days

Pull request review commentridiculousfish/littlecheck

Diff output

+Failure in python_missing_check.py:++  The CHECKERR on line 7 wants:+    BETA++  which failed to match line stderr:1:+    ALPHA++  Context:+    ALPHA (nothing to match)+    BETA+    GAMMA1 (nothing to match)

This does the thing that diff -u also does, which is to only show X lines of context for every mismatch (with X currently being hardcoded as 3)

So the only way this might print a lot is if there is a lot of output that doesn't have corresponding CHECKs?

I'm guessing in that case it depends on why there was that much more output? In case of stderr we already know that it might e.g. be asan output.

Do we truncate that output at e.g. 5 lines? Is that configurable? Or do we provide a logfile with the full output?

Truncating of course means that you might waste a run, and in case something is tough to reproduce that might be quite annoying, so I'd lean on the side of caution and give more output than strictly necessary.

faho

comment created time in 12 days

Pull request review commentridiculousfish/littlecheck

Diff output

+Failure in python_missing_check.py:++  The CHECKERR on line 7 wants:+    BETA++  which failed to match line stderr:1:+    ALPHA++  Context:+    ALPHA (nothing to match)+    BETA+    GAMMA1 (nothing to match)

I think it's fine, although printing the whole list might be a bit much.

faho

comment created time in 12 days

pull request commentridiculousfish/littlecheck

Diff output

I love this - the lack of information made tracking down a test failure quite hard, as I think I've mentioned before, and this is a great improvement.

faho

comment created time in 12 days

Pull request review commentridiculousfish/littlecheck

Diff output

+Failure in python_missing_check.py:++  The CHECKERR on line 7 wants:+    BETA++  which failed to match line stderr:1:+    ALPHA++  Context:+    ALPHA (nothing to match)+    BETA+    GAMMA1 (nothing to match)

Or possibly just print "(no CHECKs left)" once and then omit it since nothing after could match?

faho

comment created time in 12 days

Pull request review commentridiculousfish/littlecheck

Diff output

+Failure in python_missing_check.py:++  The CHECKERR on line 7 wants:+    BETA++  which failed to match line stderr:1:+    ALPHA++  Context:+    ALPHA (nothing to match)+    BETA+    GAMMA1 (nothing to match)

I'm not sold on all these (nothing to match). They seem a bit much, but like I said I don't want to rely on color, so we'd have to find some kind of text.

(also possible are leading symbols, or to switch the entire thing to unified diff format)

faho

comment created time in 12 days

Pull request review commentridiculousfish/littlecheck

Diff output

 Failure in python_whitespace.py:     {{^}} four    which failed to match line stdout:4:-    four+       four

This now prints leading whitespace, which we typically ignore, but in cases like this we don't, explicitly.

I've also needed leading whitespace a few times, e.g. when checking that the ^ carets are aligned correctly, so this seems better.

We could also strip leading whitespace for matching expressions, or show a leading | to mark where the line starts?

faho

comment created time in 12 days

PR opened ridiculousfish/littlecheck

Diff output enhancement

One of the issues with our current output is that it only handles the first mismatch, and it won't figure out if there's a line missing, so e.g. if the test output is

1
3
4
5

and we have CHECKs for 1, 2, 3, 4 and 5, it will complain that "3" does not match "2".

This isn't wrong, but it's quite misleading, and you really need to pay attention.

This PR changes the output so that it basically runs a diff on the lines and CHECKs. The trick is that we match the checks before, and for every CHECK that does we add the matched string, for every that didn't we add the literal CHECK.

Then we use python's difflib.SequenceMatcher to get a diff, and we print that.

The header is still just the first error, but that's also probably the most important, so it's okay.

This replaces the before/after context, because we now always do a hard-coded 3 lines of context around every diff point, so the information is already in there.

Some example output:

Screenshot_20201116_105356

I'd like some feedback on the output, but do note that I'm trying to not make colors mandatory (in particular because Github Actions doesn't show them!), so this should still be readable without.

+220 -84

0 comment

15 changed files

pr created time in 12 days

push eventridiculousfish/littlecheck

Fabian Homborg

commit sha 7d232ee79c6a03593d4c280f7a422afee60e9c17

Remove accidental duplicated output

view details

push time in 14 days

push eventridiculousfish/littlecheck

Fabian Homborg

commit sha da3a2eb56ce7823d3a82ed7c9bfffd5923be998e

Cleanup context printing

view details

Fabian Homborg

commit sha 5f7deafcea4e58dd3d369eae069a3781bb6ce75e

Print multiple "error annotation lines" When there is an error on stdout *and* on stderr, we currently only print one "error annotation line". That's not great if e.g. there's a large error message. So instead we just print *all* the error lines. If it turns out to be a problem, we can add a limit or log file or something.

view details

Fabian Homborg

commit sha e3141ece1cfd3a13b27a76563383faa8435e30e7

Add a whitespace test This is super simple - we just check that we ignore whitespace by default, and that adding a regex makes us care.

view details

push time in 14 days

issue closedneosmart/AspSqliteCache

Async initializer

Hello @mqudsi

Can we have a new version that use async initializer?

Thank you!

haiduong87

closed time in 16 days

haiduong87

issue commentneosmart/AspSqliteCache

Async initializer

Hi @mqudsi ,

Thanks for the explanation about the cache initialization.

I just create this issue because I see those lines about the async initialization. Actually I tried to do it locally, but I don't know much about the caching logic.

So we can happy with the current state :D

Thank you!

haiduong87

comment created time in 16 days

issue openedneosmart/AspSqliteCache

Async initializer

Hello @mqudsi

Can we have a new version that use async initializer?

Thank you!

haiduong87

created time in 17 days

more