Add Timestamp to Log Entries

Currently, the logging I'm getting doesn't appear to have any timestamps.  It would be helpful to have that so if something goes wrong, you know when it happened, and also, to be able to look at it and see that you have recent entries.

This is an enhancement request, but I can't figure out how to flag it as such.

What locast2tuner (and locast2dvr as well) does is that if you start it from the command line and have a terminal (or tty in UNIX), it will display the timestamp. If it doesn't have a tty (because it's piped to another process, or the output is handled by syslog), it will remove the timestamp, because otherwise the timestamp will be in the log file twice. I could add an option to always show the timestamp.

Yeah, something like that would be good.  I tried to set the logging in WinSW (that I'm using to run locast2tuner as a service) to do the timestamps, but it doesn't appear to be capable of adding them.

Interesting.. I'll add the option!


Support quantifiers in function contract clauses.

Requested feature: Support existential and universal quantifiers in the requires and ensures clauses of function contracts. This would be especially useful to write specifications on vectors.
For example,
#[kani::ensures(forall(|i: usize| -> bool {(0 <= i < vec.len()) => (vec[i] > 0)})]
#[kani::ensures(exists(|x: i32| -> bool {x == ret})]

Now a duplicate of #2546


Warning on non-issuer to non-issuer token offer

In Main.daml in manual testing script, when trying to offer a token from current owner which is not an issuer to another party (also not issuer) following warning message appears:

Tried to fetch or exercise -homePackageId-:Token:Token on contract 001f8b1d815e42f839d23a224e5e352f2b3cfe32b5d866c72a7d232b545c865e27 but none of the reading parties [Bob] are contract stakeholders [Alice,UserAdmin]. Use of divulged contracts is deprecated and incompatible with pruning. To remedy, add one of the readers [Bob] as an observer to the contract.

Though contracts behave as expected.
It would be nice to:

[ ] figure out why the warning appears
[ ] eliminate the cause.

After charlie accepts the TokenOffer, the Token that gets created as a result of the offer acceptance is not visible to him. Solution to the problem is to state owner Party as contract observer in Token  module.


fix: memory leaks.

There were a number of memory leaks of the form of a = a[i:].
These were replaced with a = append(a[:0], a[i:]...)

Could we extract the pattern? i.e.
a.PushBack(<slice>)
a.PopFront(<slice>)
a.Peek(index) <slice>

We already have codegen tools for the various slice types and it would make me feel better.

Also this repo should be review-protected!

Mostly I'm worried about someone relying on these slices not being mutated, if we had the pattern extracted that would prevent future errors. i.e. these two are not equivalent:
a := []int{1,2,3}
b := a[:1]
fmt.Println(a[0])

a := []int{1,2,3}
b := append(a[0:], a[:1]...)
fmt.Println(a[0])

Possibly a better interface:
a.PushBack()
a.PopFront()
a.PeekFront()


Connection error while fetching messages: Connection error Errno::EBADF: Bad file descriptor

Simply start a consumer. Lets say for the sake of simplicity that there is nothing to consumer. When I shutdown a consumer I get the following error in my logs.
D, [2018-06-13T11:01:18.380510 #23536] DEBUG -- : Closing socket to x.x.x.x:9092
D, [2018-06-13T11:01:18.380584 #23536] DEBUG -- : Closing socket to x.x.x.x:9092
E, [2018-06-13T11:01:18.380668 #23536] ERROR -- : Connection error while fetching messages: Connection error Errno::EBADF: Bad file descriptor

Version of Ruby:2.3.1
Version of Kafka:0.5.2
Version of ruby-kafka:0.3.7

Sorry I think this can be opened in racecar before. Although the error is generated in line in ruby-kafka. I will open it there. Closing here.


Redesign the input API a bit

Redesign the input API a bit to guide the caller toward proper use and to divide state. (See commit message.)
test_inkey_0s_raw_ctrl_c fails but only when running py.test blessed/tests/test_keyboard.py --tb=short, not when running the whole suite:
_________________________________________ test_inkey_0s_raw_ctrl_c __________________________________________
blessed/tests/test_keyboard.py:424: in test_inkey_0s_raw_ctrl_c
    os.write(master_fd, u'\x03'.encode('latin1'))
E   OSError: [Errno 5] Input/output error

I'm not sure offhand why. Any ideas?
And then test_key_mode_no_kb's raises() appears to not work when running the whole suite. When running just test_keyboard, it's fine.
____________________________________________ test_key_mode_no_kb ____________________________________________
blessed/tests/test_keyboard.py:229: in test_key_mode_no_kb
    child()
blessed/tests/accessories.py:122: in __call__
    assert exc_output == '', exc_output_msg
E   AssertionError: Output in child process:
E   ========================================
E     File "/Users/grinch/Checkouts/blessings/blessed/tests/accessories.py", line 76, in __call__
E       self.func(*args, **kwargs)
E     File "/Users/grinch/Checkouts/blessings/blessed/tests/test_keyboard.py", line 227, in child
E       with term.key_mode():
E     File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__
E       return self.gen.next()
E     File "/Users/grinch/Checkouts/blessings/blessed/terminal.py", line 577, in key_mode
E       raise NoKeyboard
E   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
E   NoKeyboard
E   ========================================

But that aside, this is ready for feedback.
What do you think? I'm particularly interested in your opinion on key_mode() raising an immediate NoKeyboard exception if there's no keyboard or tty attached. I don't see much call for setting cbreak or raw mode unless you can also take input (in which case we'd defer the error until key() was called), but you may know something I don't.

@jquast Here this is, in case you didn't get pinged.

This is an identity of NoKeyboard exception due to a forked process, NoKeyboard exception must be imported within the child() function, upcoming PR to address.
I'm surprised you now favor to raise NoKeyboard exception, great lengths were made to allow programs to be piped to less(1) which may use keyboard input. ./bin/progress_bar.py | less now raises exception, for example. Your call anyhow. This completely negates BufferedKeyboard._has_tty, as it would always be False in such case, upcoming PR to remove that, then.
I'm trying to update README about how key_mode returns a callable, and I have to say it certainly makes for a quite a mouth-full to document -- previously, only referring to term.inkey, now it is "the callable returned by the context manager key_mode".
Renaming Keystroke as Key and naming the callable return key is also certainly confusing, we now must document this Key class and the "callable returned by..." phrase, which you named key -- it is such a common idiom for dictionaries in python, such as exceptions KeyError. This is very difficult to wire a brain to read about without rejecting the built-in concept of key.

I'm surprised you now favor to raise NoKeyboard exception, great lengths were made to allow programs to be piped to less(1) which may use keyboard input. ./bin/progress_bar.py | less now raises exception, for example. Your call anyhow. This completely negates BufferedKeyboard._has_tty, as it would always be False in such case, upcoming PR to remove that, then.

Eek! You're right. Let me rethink.
I also had second thoughts about renaming Keystroke as soon as I pushed the commit.=

About "key" and "keystroke": I waffled back and forth between those. dict.keys() is plural, but one does talking about "key" in the singlar from time to time. Your point about KeyError pushes me the rest of the way back over to keystroke. I'll make the change.

great lengths were made to allow programs to be piped to less(1) which may use keyboard input

I gave this some thought. I think there are limits to how much pipeability we can accomplish automatically. I always said that one should examine vars like does_styling and explicitly decide, based thereon, whether to draw—well—"frippery" was the word I used. Now, in most cases, we could return '' as if the call to key() timed out. However, if somebody calls the block-forever variant key(0), we're out of luck. Can you think of any way to make it behave on a no-input Terminal that won't confuse and surprise the caller, which had quite reasonably assumed some input? I could hear arguments for key(>0) quietly returning '', but I'm honestly having trouble coming up with a scenario in which piping an interactive program makes sense in principle. Perhaps there might be some batch job that would churn happily along if unmolested, but if you pressed P it would pause.
After typing the above, I could see making key(>0) quietly return '' and key(0) raise NoKeyboard. How does that strike you? (I may change my mind again halfway through implementing; I'm inventing rather than extracting here, always a dangerous proposition. So please do inform my musings with concrete usage scenarios from your BBS.)

I implemented the ability to do timed polling w/o keyboard to continue the blessed philosophy of "everything is safe for piping".  I could provide examples, but they're trivial. It's your call, I made great effort in trying to remain compatible with blessings API, you're certainly free to change your mind about any such things. If you haven't seen pull #74, it fixes the ./bin programs so that you may try/test keyboard input, as well as the test cases.

Looks like you changed your mind about Key, then? Everybody, and I mean everybody, uses "key" to refer to dictionary values (or a dictionary key, or the first item of a 2-tuple in series, or something to do with using zip or iterators) I just picked out a ~8,000 LOC project laying here, it has 220 uses of the phrase "key" and they all have this meaning.
This would be like naming a class Value() for something that provides "business value", or a function named 'object' that, when called with an argument, returns "An objective opinion". It is hard to document, read, and write without triggering unrelated portions of the brain that cause cross-talk and delay comprehension. But the worst offense of all is search/grep-ability.

(As for my bbs, the Terminal is always in character-at-a-time mode and uses the inkey() method, so the context manager with key_mode() would be an unnerving complication and introduce over-indentation. blessed will have to remain at least here as well as all other projects already using blessed that would require porting.)

I should also not that it is necessary to derive and modify getch(), kbhit(), and inkey() in my bbs, another reason I couldn't switch back to blessings with this api change.

I'm further concerned about separating state using the context manager.
Scripts that are written with different functions, each accepting input and using this context manager might end up slicing the input stream into parts.
This might not be noticed during local development, but only occur when a program is run over say, ssh, the methods formally known as kbhit() and getch() may only receive 2 out of 5 bytes of a multibyte sequence or utf-8 sequence, the inkey() method with a small timeout (say, 0 or 0.01) would return -- and then a function might return to a different context manager callable return of key_mode(), which would then receive the 2nd half of a multibyte sequence.   Do I make sense?
This fix would be (as I have done in the bin/ example programs) is to explicitly pass the callable returned by the context manager to any delegating functions (sometimes in additional to the terminal instance).  This would have to be carefully documented, as well.

Hey, Jeff. Wow, that's a lot of prose. I'll look at it piece by piece.
First, let's not stack up pull requests on top of other pull requests. That's how we got into such a tangle with git last time.  For now, I propose merging #73 to blessed-integration for expediency (even though it isn't perfect), and #74 on top of it (which I haven't even really looked at yet, but I'm going out on a limb) and, in the future, trying to stick to independent PRs.

Well then the PR can be discarded entirely, since it is just documenting and fixing tests for this PR ...

I'm attending a Project Night tonight and will mull over this some more.

How does this strike you? I believe it addresses most of your points and makes porting from blessed mostly a matter of renaming:
class Terminal(object):
    """Input buffer moves back onto Terminal."""

    with keystroke_input():  # Renamed from "keystroke_mode", since none of the other mgrs say "mode".

    def keystroke():
        """Keep original, single-char-returning fallback behavior for when tty is in cooked mode, but raise NoKeyboard when timeout is None, lest the program hang forever. If we wanted to be nice, we could even return '' immediately when there is a timeout but no keyboard."""

    def _next_char():
    def _char_is_ready():
        """These 2 methods move back onto Terminal."""

P.S. A few points illuminating motivations:

Part of my motivation for moving the input buffer to BufferedKeyboard before was to implicitly flush the input buffer between with key_mode invocations. It doesn't, I now see, since the buffering I was looking at is actually just to catch undecodable partial code points. (Ultimately, I predict we'll want to add a flush method to Terminal to avoid unintended buffering between disparate parts of a program: for example, one that makes the user choose from a menu, then does several minutes of processing, then asks for another menu choice. A mistaken key bounce on the initial choice or a cat walking across the keyboard during the processing phase would result in an unintended input on the second menu.)
Just to clarify, it was always my intent for callers to pass the key() routine around, but, if we're willing to keep the (still kind of strange, I think) single-char fallback behavior of keystroke(), that is one fewer thing to pass around, as you say.

was to implicitly flush

It is the very difficulty of describing this implicitness in documentation -- the code and tests for managing edge-cases, instructing the user why they need it, or not, and how to work with or around it, Pep 20 rule number 2, "Explicit is better than implicit." I don't know how to address the "be careful with the context manager state, make sure to pass it around, danger if you don't" documentation in a "easy for newcomers quick-start guide". It would have to be addressed early (most people don't read beyond the first paragraph -- until they have trouble, anyway) without being too verbose with details.
All of the other existing context managers (other than fullscreen -- though safe, has unexpected behavior) may extend into multiple scopes without side effects.

is actually just to catch undecodable partial code points.

Are you saying you don't believe this to be a problem?
This is exactly what I'm tried very hard to prevent.

Just to clarify, it was always my intent for callers to pass the key() routine around

It is my experience that very few places where inkey() is used without something else from Terminal, where there is input, there is often output prompting for input.

fallback behavior for when tty is in cooked mode,

Well, we don't know this to be true at all ... your shells default to canonical input, that's all. blessed previously advertised that it could be intermixed with curses programs -- this advertisement would have to be removed or occluded by a caveat: for keyboard input you must use our context manager. And you don't have to! it works fine, and actually its pretty darn great for debugging:
In [1]: import blessed
In [2]: blessed.Terminal().inkey()
^[[A
Out[2]: KEY_UP

In [7]:

I predict we'll want to add a flush method to Terminal

its a rare need, actually many users expect their input to be queued, there are very, very few examples of programs in a unix terminal that behave otherwise (i can't think of a one).  The only place I can think of this as possible is x86 assembler when reading raw scan codes.
If you're going to navigate menus, you don't want to rapidly chose "1, 2, 3", only to be stuck at menu number 2, it actually causes quite a bit of confusion to the user, especially as they become more familiar.  As you add latency (such as ssh), this becomes particularly rude.
Cases in which I would use it is, "I just pasted an entire wikipedia article into this editor, but an error or exception occurred, and its prompting me to make a decision". Anyway I do supply such a property in x/84, session.flush_event('input')). I actually don't use it anywhere. You can easily do without such a method, you would just do:
while term.inkey(0):
    pass

Anyway I'm fine with the renames, even though I really preferred my original names, this battle has gone on far enough, I can see you simply don't like them.

It is the very difficulty of describing this implicitness in documentation -- the code and tests for managing edge-cases, instructing the user why they need it, or not, and how to work with or around it

It doesn't matter now, but that's the reason I was returning the "inkey" callable from the context manager: you can't possibly screw it up, because there was no Terminal-dwelling inkey() to call outside the mgr's scope. (Using as "as" variable outside the scope might be technically possible but would definitely qualify as weird.

Anyway I'm fine with the renames, even though I really preferred my original names, this battle has gone on far enough, I can see you simply don't like them.

Great. I will have a go.

What does the underscore at the beginning of _intr_continue signify?

nothing

py.test is running the tests in a continual loop, failing all the while. How do you make it act normally?

This happens when you cause an exception after fork, the sub-process is
also py.test, and wants to continue onto the next test after an
exception is raised so you have a "forked testrunner".
Find and fix the first exception and fix it.

Wow, that's exotic. -x it is.

This is the unittest.TestCase fix:
https://github.com/pexpect/pexpect/pull/152/files
you'd need something similar the as_subprocess decorator, I imagine.

How about that? Your design is basically unchanged. All that's mine is the names.
Incidentally, I'm getting a test failure (on OS X), but I was getting it on blessed-integration as well:
% py.test blessed/tests/test_keyboard.py --tb=short
============================================ test session starts ============================================
platform darwin -- Python 2.7.3 -- py-1.4.26 -- pytest-2.6.4
collected 36 items

blessed/tests/test_keyboard.py ...............F....................

================================================= FAILURES ==================================================
____________________________________ test_keystroke_0s_raw_input_ctrl_c _____________________________________
blessed/tests/test_keyboard.py:456: in test_keystroke_0s_raw_input_ctrl_c
    os.write(master_fd, u'\x03'.encode('latin1'))
E   OSError: [Errno 5] Input/output error
==================================== 1 failed, 35 passed in 9.22 seconds ====================================

Obviously, we'll want to reposition your fixes to the demo programs over that.

What is your output for ./tools/display-sighandlers.py ?
travis-ci appears to fail because of a PEP8 check. I will copy the branch to my project so I can run it on my build server farm (osx, linux, solaris).

% ./tools/display-sighandlers.py
name       value description
---------------------------------
SIGABRT    6     default(SIG_DFL)
SIGALRM    14    default(SIG_DFL)
SIGBUS     10    default(SIG_DFL)
SIGCHLD    20    default(SIG_DFL)
SIGCONT    19    default(SIG_DFL)
SIGEMT     7     default(SIG_DFL)
SIGFPE     8     default(SIG_DFL)
SIGHUP     1     default(SIG_DFL)
SIGILL     4     default(SIG_DFL)
SIGINFO    29    default(SIG_DFL)
SIGINT     2     <built-in function default_int_handler>
SIGIO      23    default(SIG_DFL)
SIGIOT     6     default(SIG_DFL)
SIGKILL    9     None
SIGPIPE    13    ignored(SIG_IGN)
SIGPROF    27    default(SIG_DFL)
SIGQUIT    3     default(SIG_DFL)
SIGSEGV    11    default(SIG_DFL)
SIGSTOP    17    None
SIGSYS     12    default(SIG_DFL)
SIGTERM    15    default(SIG_DFL)
SIGTRAP    5     default(SIG_DFL)
SIGTSTP    18    default(SIG_DFL)
SIGTTIN    21    default(SIG_DFL)
SIGTTOU    22    default(SIG_DFL)
SIGURG     16    default(SIG_DFL)
SIGUSR1    30    default(SIG_DFL)
SIGUSR2    31    default(SIG_DFL)
SIGVTALRM  26    default(SIG_DFL)
SIGWINCH   28    default(SIG_DFL)
SIGXCPU    24    default(SIG_DFL)
SIGXFSZ    25    ignored(SIG_IGN)

same here (osx, passing), how about ./tools/display-terminalinfo.py ?

% ./tools/display-terminalinfo.py
os.isatty(0) => True
locale.getpreferredencoding() => UTF-8
           pathconf   value
------------------- ---------------------------
       PC_MAX_INPUT   1024
        PC_VDISABLE   255
         PC_SYNC_IO   0
        PC_NAME_MAX   [Errno 22] Invalid argument
       PC_MAX_CANON   1024
         PC_PRIO_IO   0
PC_CHOWN_RESTRICTED   200112
        PC_ASYNC_IO   1
        PC_NO_TRUNC   [Errno 22] Invalid argument
    PC_FILESIZEBITS   [Errno 22] Invalid argument
        PC_LINK_MAX   32767
        PC_PIPE_BUF   512
        PC_PATH_MAX   [Errno 22] Invalid argument

Input Mode   Value   Description
---------- -------   ----------------------------------
    IGNPAR     off   ignore (discard) parity errors
     ICRNL      on   map CR to NL (ala CRMOD)
    BRKINT      on   map BREAK to SIGINTR
    ISTRIP     off   strip 8th bit off chars
      IXON      on   enable output flow control
     INLCR     off   map NL into CR
     IXANY      on   any char will restart after stop
     IUCLC   undef   translate upper case to lower case
     INPCK     off   enable checking of parity errors
    PARMRK     off   mark parity and framing errors
    IGNBRK     off   ignore BREAK condition
     IGNCR     off   ignore CR
   IMAXBEL      on   ring bell on input queue full
     IXOFF     off   enable input flow control

Output Mode   Value   Description
----------- -------   ----------------------------------
      OPOST      on   enable following output processing
      ONLCR      on   map NL to CR-NL (ala CRMOD)
      ONOCR     off   No CR output at column 0
     ONLRET     off   NL performs CR function
      OLCUC   undef   translate lower case to upper case
      OCRNL     off   map CR to NL
     ONOEOT   undef   discard EOT's `^D' on output)
     OXTABS   undef   expand tabs to spaces

Control Mode   Value   Description
------------ -------   -------------------------------
  CCTS_OFLOW   undef   CTS flow control of output
      PARENB     off   parity enable
      CLOCAL     off   ignore modem status lines
  CRTS_IFLOW   undef   RTS flow control of input
      MDMBUF   undef   flow control output via Carrier
      PARODD     off   odd parity, else even
         CS6      on   6 bits
     CRTSCTS     off   same as CCTS_OFLOW
       CSIZE      on   character size mask
         CS8      on   8 bits
       CREAD      on   enable receiver
         CS5     off   5 bits (pseudo)
         CS7      on   7 bits
       HUPCL      on   hang up on last close
      CSTOPB     off   send 2 stop bits

Local Mode   Value   Description
---------- -------   ----------------------------------
     ECHOE      on   visually erase chars
NOKERNINFO   undef   no kernel output from VSTATUS
    TOSTOP     off   stop background jobs from output
    ECHONL     off   echo NL even if ECHO is off
    NOFLSH     off   don't flush after interrupt
    PENDIN      on   XXX retype pending input (state)
      ECHO      on   enable echoing
   ECHOPRT     off   visual erase mode for hardcopy
    IEXTEN      on   enable DISCARD and LNEXT
 ALTWERASE   undef   use alternate WERASE algorithm
   ECHOCTL      on   echo control chars as ^(Char)
    ICANON      on   canonicalize input lines
    FLUSHO     off   output being flushed (state)
    ECHOKE      on   visual erase for line kill
   EXTPROC   undef   external processing
      ISIG      on   enable signals INTR, QUIT, [D]SUSP

        Special line Characters
Index               Name    Value
-----------------   ------- ----------
VLNEXT              LNEXT   '\x16'
VDISCARD            DISCARD '\x0f'
VWERASE             WERASE  '\x17'
VEOL                EOL     _POSIX_VDISABLE
VKILL               KILL    '\x15'
VREPRINT            REPRINT '\x12'
VSUSP               SUSP    '\x1a'
VEOF                EOF     '\x04'
VERASE              ERASE   '\x7f'
VEOL2               EOL2    _POSIX_VDISABLE
VSTATUS             STATUS  undef
VMIN                ---     '\x01'
VQUIT               QUIT    '\x1c'
VSTART              START   '\x11'
VTIME               ---     '\x00'
VSTOP               STOP    '\x13'
VINTR               INTR    '\x03'
VDSUSP              DSUSP   undef

os.ttyname(0) => /dev/ttys000
os.ctermid() => /dev/ttys000

No difference there, either. Build is passing on OSX, Linux, and Travis-CI with the pep8 fix.
Travis-CI has similar issues and is disabled there. The effect is that ^C is sent to the the "master pty" towards the child process, which is interpreted as a literal KeyboardInterrupt signal, (raw mode is not honored by the pty), so the process and its pipe is broken. but it's hard to say unless I can reproduce and sprinkle in some debugging.
I tested manually, seems to work
In [5]: with term.keystroke_input(raw=True):
   ...:     inp = term.keystroke()
   ...:
### (pressed ^C here)
In [6]: inp
Out[6]: u'\x03'

https://teamcity-master.pexpect.org/viewQueued.html?itemId=2100
https://travis-ci.org/jquast/blessed/builds/47881484

also, pep8 fix is 29181e1fc7147c0e0a1a5a3f137d72f88d86dde2 of the same branch name on my repository (i can't push to yours), its simple anyway:
--- a/blessed/tests/test_keyboard.py
+++ b/blessed/tests/test_keyboard.py
@@ -172,7 +172,11 @@ def test_char_is_ready_interrupted_no_continue():

 def test_char_is_ready_interrupted_nonetype_no_continue():
-    "_char_is_ready() may be interrupted when _intr_continue=False with timeout None."
+    """
+    _char_is_ready() may be interrupted.
+
+    When _intr_continue=False with timeout None.
+    """

also, i'm using bash and tox to execute tests, if it makes any difference. I manually installed pytest and mock into a virtualenv and used vanilla py.test, i have to clear out the current environment a bit (build/ folder, all *.pyc and pycache files and folders), but it still works.

looks like you're missing coverage for statement raise NoKeyboard(, https://coveralls.io/files/436593228#L689

And, inexplicably, my tests now pass locally, 100%. I'll take it.

I move to fix all those PEP 8 issues in one go. None of the docstrings in there wrap to 80 columns, and they all violate PEP 257 with their non-triple quotes.

Oh, the actual test are failing? Blech. Alright, I'll patch up that one pep 8 thing.

Merged to blessed-integration, so you can rebase your bin/ fixes and such if you like and open a PR.

So keyboard_input is still a context manager in the branch blessed-integration... are you really set on having this as a context manager? It really is a bit of a no-go for me, I can't even begin to document the "How you should use the callable returned by the context manager" for a laymen, nevermind the "and here's why you shouldn't do this and that, because of these edge case behaviours", nor testing for them.

raise NoKeyboard has no test coverage https://coveralls.io/builds/2015588/source?filename=blessings%2Fterminal.py#L689


Investigate .cargo_vcs_info.json

{
  "git": {
    "sha1": "7d93f00ea02acbb9f45c68f9d4bcf1f04f392e46"
  }
}

So it is present in some crates when downloading them (unlike .cargo-ok which is added after the fact). I  guess we will just calculate it into the giest normally.
When available, when creating review, we could use it to fill the revision and revision-type fields.


Add Finchley Catholic High School

@jm1sley First stage of verification passed, official domain is finchleycatholic.org.uk as far as I verified. This is just an informational note. Pull request is still in the review. I appreciate your patience while waiting for the final decision.


migrate onboard for az

This checklist is used to make sure that common guidelines for a pull request are followed.

For new extensions:

[ ] My extension description/summary conforms to the Extension Summary Guidelines.

If this PR is for a new extension or change to an existing extension, use the following to try out the changes in this PR:
docker run -it microsoft/azure-cli:latest
export EXT=<NAME>
pip install --upgrade --target ~/.azure/cliextensions/$EXT "git+https://github.com/Azure/azure-cli-extensions.git@autorest-az-migrate-onboard#subdirectory=src/$EXT&egg=$EXT"

closed it after discussion with @qiaozha


refreshing digits home view will unload deleted and load newly added …

scheduler not only loads jobs from disk but also removes jobs from its internal list that are not present on the disk anymore

home view calls scheduler.load_past_jobs() on refresh

Sorry but I'm not going to merge this. When you have hundreds of jobs on your machine, calling scheduler.load_past_jobs() can take several seconds. And most people don't delete job directories manually.
The right way to fix this is with something like https://github.com/NVIDIA/DIGITS/pull/566. I've had to push that off for a while behind other priorities, but that's the way we'll address the issue going forward.
Thanks for the PR, though! Even though I can't merge it into master, this could still be a useful workaround for others.

Sure it will take long? The jobs that are already loaded are not touched,
so most of the time nothing is loaded if the method is called a second
time. Only new ones are loaded.
Anyway. Happy to help :)
2016-03-15 17:46 GMT+01:00 Luke Yeager<EMAIL_ADDRESS>
Closed #633 https://github.com/NVIDIA/DIGITS/pull/633.
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
https://github.com/NVIDIA/DIGITS/pull/633#event-590588196


Deployement

User Story
As a boot camp student,
I want the prework notes to be structured on a webpage,
So that I can easily find and read the information
Acceptance Criteria
GIVEN a prework Study Guide website,
WHEN I visit the website using the URL,
THEN I can access my website from any browser

a


Validators

There is no way to overpass the password validation other than passing false to the LoginTheme (showFormFieldErrors: false).
I think this is misleading.
The general use case:
As of user, I want to be able to use my own validator on fields and decide when to apply it.

You're certainly right! I will add optional validators for custom validation and bool parameters to decide whether to validate or not. Let me know if you need any additional parameters apart from these.

Not so far! I'm just starting playing with it :-)

@bahricanyesil : Maybe one thing, regroup theming stuff in the LoginTheme, an example would be => actionButtonStyle

@bahricanyesil : Maybe one thing, regroup theming stuff in the LoginTheme, an example would be => actionButtonStyle

Do you mean for example under a "LoginButtonStyles" class?

Maybe move the property to the LoginTheme.
Because when when want to them the Login, we need to do it in the
AnimatedLogin class for certain things and LoginTheme for others
On Wed, 10 Nov 2021 at 09:25, Bahrican Yesil @.***>
wrote:

@bahricanyesil https://github.com/bahricanyesil : Maybe one thing,
regroup theming stuff in the LoginTheme, an example would be =>
actionButtonStyle
Do you mean for example under a "LoginButtonStyles" class?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/bahricanyesil/flutter-animated-login/issues/5#issuecomment-965262784,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJL6EZ2JAMIXNUQL63AUVMDULJ6FLANCNFSM5HW3DQBA
.
Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Maybe move the property to the LoginTheme. Because when when want to theme the Login, we need to do it in the AnimatedLogin class for certain things and LoginTheme for others

Ah, yeah. I got your point now. Thank you for the suggestion, that makes more sense. I'm creating a new issue for that.


 We can't really ask people to translate until we clean it up.

 We can't really ask people to translate until we clean it up.

We can add a no_translate label

I'll leave this here unsure if no_label would help us now, as json was formatted inappropriately from the start.


Implement toString() method, add "unit" property, update build tools.

Add unit property in Interval class to retrieve time unit.
Implement toString() method in Interval class.
Update build tools.

Codecov Report

Merging #6 into master will decrease coverage by 4.03%.
The diff coverage is 70.58%.

@@            Coverage Diff            @@
##           master      #6      +/-   ##
=========================================
- Coverage   71.64%   67.6%   -4.04%
=========================================
  Files           2       2
  Lines          67      71       +4
  Branches        5       9       +4
=========================================
  Hits           48      48
- Misses         15      19       +4
  Partials        4       4

Impacted Files
Coverage Δ

time/src/main/kotlin/com/kizitonwose/time/Time.kt
81.48% <70.58%> (-6.52%)
:arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dcf7d8...597b8f4. Read the comment docs.


Card backs do not print

Do you want to request a feature or report a bug?
Report a bug.
What is the current behavior?
The back sides of the cards show in the generated window, but do not print.  When I attempt to print a back page, it simply prints blank.
If the current behavior is a bug, please provide the steps to reproduce, along with the following information:

OS:  Windows 7
Browser:  Mozilla Firefox 68.0.2
Page settings (from the "Page Settings" section of the generator)

Page Size:  US Letter
Card Size:  3.5" x 5.0"
Cards/page:  2 x 2
Arrangement:  Double sided printing

What is the expected behavior?
Card backs will print.

From the FAQ:

Cards are generated without icons and background colors, what's wrong?
Enable printing backround images in your browser print dialog

Even though the FAQ also claims that Firefox is supported, I had no luck so far printing the backside. Instead of black, there's just nothing in my case though. I use chromium for printing after I'm done, that works.

Nowasays it works on Firefox too.

Nowadays it works on Firefox too.


Makefile: build_all_ios.sh - No rule to make target 'distclean'.  Stop.

System information

Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS High Sierra 10.13.5
TensorFlow installed from (source or binary): source
TensorFlow version (use command below): master
Python version:  -
Bazel version (if compiling from source): -
GCC/Compiler version (if compiling from source): -
CUDA/cuDNN version: -
GPU model and memory: -
Exact command to reproduce:  just execute ./build_all_ios.sh

Hello,
when building TensorFlow for iOS using the Makefile (./build_all_ios.sh), I am getting the following error:
................
rm -f gogo/cpp_no_group/datasets/google_message1/proto2/.deps/cpp_no_group_benchmark-benchmark_message1_proto2.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message1/proto3/.deps/cpp_no_group_benchmark-benchmark_message1_proto3.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message2/.deps/cpp_no_group_benchmark-benchmark_message2.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message3/.deps/cpp_no_group_benchmark-benchmark_message3.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message3/.deps/cpp_no_group_benchmark-benchmark_message3_1.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message3/.deps/cpp_no_group_benchmark-benchmark_message3_2.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message3/.deps/cpp_no_group_benchmark-benchmark_message3_3.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message3/.deps/cpp_no_group_benchmark-benchmark_message3_4.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message3/.deps/cpp_no_group_benchmark-benchmark_message3_5.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message3/.deps/cpp_no_group_benchmark-benchmark_message3_6.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message3/.deps/cpp_no_group_benchmark-benchmark_message3_7.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message3/.deps/cpp_no_group_benchmark-benchmark_message3_8.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message4/.deps/cpp_no_group_benchmark-benchmark_message4.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message4/.deps/cpp_no_group_benchmark-benchmark_message4_1.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message4/.deps/cpp_no_group_benchmark-benchmark_message4_2.pb.Po
rm -f gogo/cpp_no_group/datasets/google_message4/.deps/cpp_no_group_benchmark-benchmark_message4_3.pb.Po
rm -f python/.deps/libbenchmark_messages_la-python_benchmark_messages.Plo
rm -f util/.deps/gogo_data_scrubber-gogo_data_scrubber.Po
rm -f util/.deps/protoc_gen_gogoproto-protoc-gen-gogoproto.Po
rm -f Makefile
Making distclean in third_party/googletest
make[1]: *** No rule to make target `distclean'.  Stop.
make: *** [distclean-recursive] Error 1

The issue is in tensorflow/contrib/makefile/compile_ios_protobuf.sh

Do you solve this issue?I also have this issue, and i tried a lot of methods that didn't solve it.

No, I also tried different things to solve it but no luck so far.
  This error does not happen to me with TensorFlow 1.8, only with
  TensorFlow 1.9-rc2 from master.

On 10/07/18 03:05, 杨伟超 wrote:

  Do you solve this issue?I also have this issue, and i tried a
    lot of methods that didn't solve it.
  —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub, or mute the thread.
  {"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/tensorflow/tensorflow","title":"tensorflow/tensorflow","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/tensorflow/tensorflow"}},"updates":{"snippets":[{"icon":"PERSON","message":"@ChaosYang in #20624: Do you solve this issue?I also have this issue, and i tried a lot of methods that didn't solve it."}],"action":{"name":"View Issue","url":"https://github.com/tensorflow/tensorflow/issues/20624#issuecomment-403665877"}}}
  [

{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/tensorflow/tensorflow/issues/20624#issuecomment-403665877",
"url": "https://github.com/tensorflow/tensorflow/issues/20624#issuecomment-403665877",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [tensorflow/tensorflow] Makefile: build_all_ios.sh - No rule to make target 'distclean'.  Stop. (#20624)",
"sections": [
{
"text": "",
"activityTitle": "杨伟超",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@ChaosYang",
"facts": [
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n"commandName": "IssueComment",\n"repositoryFullName": "tensorflow/tensorflow",\n"issueId": 20624,\n"IssueComment": "{{IssueComment.value}}"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n"commandName": "IssueClose",\n"repositoryFullName": "tensorflow/tensorflow",\n"issueId": 20624\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/tensorflow/tensorflow/issues/20624#issuecomment-403665877"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n"commandName": "MuteNotification",\n"threadId": 354082352\n}"
}
],
"themeColor": "26292E"
}
]
--

            Dr. Javier
                  Bonilla Cruz
            Unidad de Desalación
                Solar - Solar Desalination Unit

            CIEMAT -
                  Plataforma Solar de Almería
            Ctra. de Senés km 4.5,
                E-04200 Tabernas, Almería (SPAIN)
            Tfno. / Phone: +34 950
                387 800 (Ext. 908)
<EMAIL_ADDRESS>

I'm also getting same in master branch. Should I pull code from branch r1.9?

@laxmansahni, I haven't tested branch r1.9. The error happens to me in the master branch.

@laxmansahni, have a look at this #5297, it may help.

Code of tensorflow/contrib/makefile/compile_ios_protobuf.sh
build_target() {
117 | case "$1" in
118 | i386)  make distclean
… |
148 | package_pb_library "iossim_386"
149 | ;;
150 |
151 | x86_64) make distclean
152 | ./configure
153 | --host=x86_64-apple-${OSX_VERSION} \

I tried all steps mentioned in bug #5297. However, it didn't work out.

@laxmansahni Same for me, I'm running the script from MacOS HighSierra 10.13.6 and I have the latest TF version from master branch.

Same error...

I have the same error~~
Can any one give me the solve?

@gunan can you please take a look? Thanks

@petewarden has created this build, I have very little experience with it.

Nagging Assignee @bignamehyp: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @bignamehyp: It has been 29 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @bignamehyp: It has been 44 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @bignamehyp: It has been 59 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @bignamehyp: It has been 74 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

Nagging Assignee @bignamehyp: It has been 89 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

I have the same error~~
Can any one give me the solve?

vi tensorflow/contrib/makefile/compile_ios_protobuf.sh
change:
make distclean
to:
make distclean-am
make clean

then it works

@toniz What did you mean?
make distclean ./configure
to
make distclean-am ./configure
and where to insert ?
make clean
make distclean appears five time starting in line 118
I got this:
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/MYUSER/Documents/MYFOLDER/dev/code_patterns/object-detection-anki-overdrive-cars/tensorflow/tensorflow/contrib/makefile/gen/protobuf_ios/lib/iossim_x86_64/lib/libprotobuf.a and /Users/MYUSER/Documents/MYFOLDER/dev/code_patterns/object-detection-anki-overdrive-cars/tensorflow/tensorflow/contrib/makefile/gen/protobuf_ios/lib/libprotobuf.a have the same architectures (x86_64) and can't be in the same fat output file

@gadagashwini I haven’t tried recently, but I guess this issue it’s already solved.

Hi @JaviBonilla, Glad to know that it is resolved, Moving this issue to closed status. Thank you!


Add color provider and completion provider.

I made a color provider and completion provider.
Could you review them and add them to this extension? :)

Hi @paddycup1
Sorry, I didn't notice your contribution, I'm really sorry.
Could you please assist in resolving the conflict and submit again? Thank you

I have check it out. 😊


Disable warning in driftignore parsing

Description
I would like to add comment in my driftignore, but when running driftctl it output multiples warnings.
We could skip lines starting with a # and empty lines
Example
# intern laptop admin credentials
# TODO : remove tf-admin user and provision a key for intern user
aws_iam_user.tf-admin
aws_iam_access_key.XXXXXXXXXXXXXXX
aws_iam_policy_attachment.tf-admin-arn:aws:iam::aws:policy/AdministratorAccess

# Terraform bucket for state storage
aws_s3_bucket.remote-states

Hi @eliecharra , I would like to give it a try if it's possible!

Sure go on it would be awesome to merge your contribution !


Prefer expanding selected items upon right arrow key stroke on sidebar.

This PR tweaks the right arrow keyboard shortcut on the sidebar to expand currently selected items if applicable rather than navigating to the timeline list. This results from a more predictable response to user actions.
https://user-images.githubusercontent.com/8158163/173612072-757fd66d-eb25-438d-89eb-88a81d756150.mov

@brentsimmons this PR changes an established behavior in NetNewsWire. Is this something that was discussed in #work that I missed?

This isn’t something we’ve discussed. NetNewsWire’s arrow key behavior dates back to 2002, and is part of the character of NetNewsWire, and we don’t plan to change it.
(Note: cmd-rightArrow works to expand folders in the feeds list.)


Fix the shell-script issues flagged by Ebert.

Coverage remained the same at 85.864% when pulling 88986f6206255880c1f5ee19555fae0ec7709624 on fix-ebert-shell-warnings into 67d27b43b3e35ad3c168cc4c7f2d254c00ae3a18 on master.


Warning: React does not recognize the activeUserAgent prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase activeuseragent instead. If you accidentally passed it from a parent component, remove it from the DOM element.

Warning: React does not recognize the `activeUserAgent` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `activeuseragent` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

v6.4.0, v7.0.0 에서 해당 이슈가 수정되었습니다.


feat(NotFoundView): replace AboutView with 404 redirect demo

fwiw, i think it's a little confusing having an actual /404 route... and this doesn't really demonstrate redirect functionality. i think it might make more sense to leave the AboutView with a link from homepage, and then include another link "Go to BLAHBLAHBLAH" and actually link to an unknown route to demonstrate redirect functionality... thoughts?

the more i think about it, this isn't how Redirect is meant to be used... from [the docs]
(https://github.com/rackt/react-router/blob/master/docs/API.md#redirect)....

A <Redirect> sets up a redirect to another route in your application to maintain old URLs.

the correct way to catch 404s is to map a path to wildcard in root:
  <Route path='/' component={CoreLayout}>
    <IndexRoute component={HomeView} />
    <Route path='/about' component={AboutView} />
    <Route path='*' component={NotFoundView} />
  </Route>

ie. this way <Link to='/fakeroute'>Broken Link</Link> will render NotFoundView component, but the url will still represent the intended target https://example.com/fakeroute, which is the expected bahavior from user's perspective
i'm sitting down for dinner now, i'll put together a pr when i'm back at my desk

That route structure makes sense, but only if you don't want an actual /404 landing page -- which is totally up to the implementor. I had the functionality of some websites in mind where they do in fact have a /404 landing page (www.bloomberg.com/404) but I'm willing to reconsider.
The link to the /404 page is strange, I admit, but I don't think another placeholder view achieves much.


Marathon constraints

@keyki
Changes:

refactor container constraint creation into an individual class from ClusterContainerRunner.java
black list mesos slaves where an ambari agent has already been deployed

Jenkins build finished, all tests passed.
Refer to this link for build results: http://ci.sequenceiq.com/job/cloudbreak-pull-request/2191/


feat: add copy to clipboard

smaller line height
add copy to clipboard icon
add small border around code block

https://github.com/hendriknielaender/double-trouble/issues/25


Turn off LED in EV_JOINED, EV_JOIN_TXCOMPLETE and EV_TXCANCELED events

The LED was turned on at the start of a transmission and should be
turned off as these events signal an end of transmission.

Just to clarify the intent of this: sometimes my device's attempts at OTAA joining fail, and the event emitted by LMIC for this is  only EV_JOIN_TXCOMPLETE, which currently does not turn off the LED. Another join attempt is soon attempted of course but I think it's preferable to turn off the LED in between so that the LED really does indicate "transmission in progress".

Thanks for your feedback.
Yes, you're right. This was something I still had to improve.


Virtual producers

The current producers will react to any changes to their dependencies and will inevitably output changes to the state. However, if that which they produce is not used by any other producer then the computation is unnecessary while bloating the state.
In the jsonmvc framework, these were called Models, and represent a derived data from the current state which can be recomputed at any given time. More so, being derived they can be computed only when required.
Virtual producers augment the state without fundamentally altering it - meaning the state can be retrieved with or without these augmentation - in an essential or derived state.
By implementing virtual producers things that would otherwise be considered too expensive or too redundant can now be considered as perfectly viable options.
Imagine having a collection with items and you would like to augment each item with a new field - let's say adding two numbers together:
const item = {
   price: 10,
   extra: 2
}
item.total =  (price, extra) => price + extra

If the collection would have 10.000 items then when defining this computation it will run 10.000 times occupying both memory (storing all those result) as well as cpu.
Instead, you could define a virtual producer which will do that computation only when it's needed.
Note! The above example is very simple and doesn't capture the true intent of virtual producers so we need to add a bit of complexity.
Imagine now that you would want to have other listeners on the total of each item. Then have other listeners that listen to those listeners and now let's keep doing this until we get 10 levels deep. Having these many dependencies in place would mean doing several million operations.
Now imagine that we only need to show the final computation for item 1423. With a virtual producer, we would only need 10 function calls and have a result - without virtual producers, we would need exhaustive cpu and memory usage to run before we could even ask the question regarding item 1423.
By having virtual producers we bypass any unnecessary computation and as such we can split any kind of complex logic in tiny bits of computation which is defined over any large set of data without any worry of making a system slow or using up too much memory.
Reasons for implementing virtual producers:

Keeps the state clean and ensuring any essential data is kept separate from derived data
Opens the path to small, reusable computations that can be fitted in different ways to produce a certain output
Makes a different mental model for developers when thinking of changes to the state - splitting into essential and non-essential changes
Drastically improves performance when large amount of data is used
Drastically improves performance when deep hierarchies of computation are used

This might be implemented using an onDemand flag in the ProducerConfig.

We should keep the model keyword instead of something that resembles producers.
Models are quite restrictive as they operate just on the state, need to be pure and sync, etc. As such they do not resemble a producer in function nor in structure.
The keywords model, view, producer put together, provide a good vocabulary to express the responsibilities of different parts of the codebase.


[Bug] Minor Visual Bug:  collect Description Truncated in --help Text

Hello, @nedbat,
First of all, thank you for your tool!
When trying to set up Scriv for one of my repositories, I encountered a minor visual bug in the --help text of the application.  When calling
scriv --help

with the latest version, v0.17.0, installed from the Python Package Index, the description of the subcommand collect is truncated; see line 12:
Usage: scriv [OPTIONS] COMMAND [ARGS]...

  Manage changelogs.

  Version 0.17.0

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  collect         Collect fragments and produce a combined entry in the...
  create          Create a new scriv changelog fragment.
  github-release  Create or update GitHub releases from the changelog.

This is neither a critical nor an urgent bug, it is just reported for completeness.

Sadly, click has an issue about this behavior which has been closed and locked without a real answer: https://github.com/pallets/click/issues/486

Thank you for the link!  I have found the answer which I am going to submit in a new Pull Request.

https://github.com/pallets/click/issues/486#issuecomment-185790528 is a workaround which I submitted as #65 -- with a changelog entry, of course.

Fixed in 28d6326.


Solovay Kitaev Decomposition doesn't correctly load saved approximations from file

Environment

Qiskit version: 1.1.0
Python version: 3.10.11
Operating system: Windows 11 23H2
Numpy version: 1.26.4

What is happening?
After specifying a file to save the approximations of generate_basic_approximations into, attempting to load this into a new SolovayKitaevDecomposition gives a runtime error.
This is somewhat easily fixable by replacing this line with the following temporary fix:
        for gatestring, matrix in data.flat[0].items():

After this, the SolovayKitaevDecomposition object can be instantiated, but still contains a separate logic error. Some inputs can cause the circuits generated by this object to have different global phases than the ones generated by a SolovayKitaevDecomposition which did not load these approximations from a file (see example).
How can we reproduce the issue?
Minimal Example
from qiskit.synthesis.discrete_basis.solovay_kitaev import (
    SolovayKitaevDecomposition,
)
from qiskit.synthesis.discrete_basis import generate_basic_approximations

import numpy as np
from qiskit.synthesis.discrete_basis.gate_sequence import (
    _convert_so3_to_su2,
)

generate_basic_approximations(["t", "tdg", "h"], 10, "test.npy")
sk = SolovayKitaevDecomposition()
sk_file = SolovayKitaevDecomposition("test.npy")
# first issue occurs on line above

rotation = np.array([[0, 0, 1], [0, 1, 0], [-1, 0, 0]])

qc = sk.run(_convert_so3_to_su2(rotation), 2)
qc_file = sk_file.run(_convert_so3_to_su2(rotation), 2)

print(f"{qc.global_phase = }")
print(f"{qc_file.global_phase = }")

print(f"qc =\n{qc.draw()}")
print(f"qc_file =\n{qc_file.draw()}")

Output
Runtime Error on loading file
Traceback (most recent call last):
  File "[omitted]\saved_approximations.py", line 13, in <module>
    sk_file = SolovayKitaevDecomposition("test.npy")
  File "[omitted]\env\lib\site-packages\qiskit\synthesis\discrete_basis\solovay_kitaev.py", line 54, in __init__
    self.basic_approximations = self.load_basic_approximations(basic_approximations)
  File "[omitted]\env\lib\site-packages\qiskit\synthesis\discrete_basis\solovay_kitaev.py", line 80, in load_basic_approximations
    for gatestring, matrix in data.items():
AttributeError: 'numpy.ndarray' object has no attribute 'items'. Did you mean: 'item'?

After Runtime Error Fix
qc.global_phase = 3.141592653589793
qc_file.global_phase = 0.0
qc =
global phase: π
   ┌───┐┌───┐┌───┐┌───┐┌───┐
q: ┤ H ├┤ T ├┤ T ├┤ T ├┤ T ├
   └───┘└───┘└───┘└───┘└───┘
qc_file =
   ┌───┐┌───┐┌───┐┌───┐┌───┐
q: ┤ H ├┤ T ├┤ T ├┤ T ├┤ T ├
   └───┘└───┘└───┘└───┘└───┘

What should happen?
The circuit created using the SolovayKitaevDecomposition created with saved approximations (qc_file) should behave the same as the one without (qc) - they should both give the same result gates and global phase, as well as run without runtime errors.
Any suggestions?

The temporary fix for the AttributeError issue should probably not be used (or at least checked before used). On my system, at least, the value of data at line 79 in solovay_kitaev.py is a 0 dimensional np.ndarray containing the object loaded from the file. I am not sure whether this is consistent on other systems or numpy versions.

Also, data.size is not checked in this one-line solution, so there could be some sort of security vulnerability if this is used.

It seems that only the gates and product are saved into the file (source code here). It is also mentioned explicitly in the constructor docstring of SolovayKitaevDecomposition, so I'm unsure if this is intentional. If not and this needs to be changed, this documentation should also be updated.

Thanks for reporting this! Your fix was almost there; by unwrapping the numpy array upon loading the npy file we can fix the behavior without changing the normal loading path. #12579 should fix this.


Cannot read property 'forEach' of undefined

Cannot read property 'forEach' of undefined

Please provide a more detailed error description :relaxed:

Please provide a more detailed error description ☺

when added extend custom loader in nuxt.conf
  build: {
    /*
     ** You can extend webpack config here
     */
    extend(config, ctx) {
      config.module.rules.push({
        test: /\.less$/,
        loader: 'less-loader',
        options: {
          javascriptEnabled: true
        }
      })
    }
  }

Nuxt is already using less-loader by default. Adding it again will cause the issue
Src: https://github.com/nuxt/nuxt.js/blob/c010addb34db2f41886236fcd89688d0a5cd0377/packages/webpack/src/config/base.js#L288-L292
you can configure the loader easily via loaders: https://nuxtjs.org/api/configuration-build#loaders


Game Mode Change

I started in Normal mode on a Dedicated server.
and I opened this save data in SOTFEdit, changed the Mode in "GAME SETUP" on the Game tab to Custom, changed all ENEMIES from Normal to Low, saved it overwrite, and when I opened the same file, the Mode remained Normal.
I just want to make the enemies weaker.

This should usually work. Was the savegame replaced by the original one? Did you try to stop, overwrite and the start the server?

Sorry for asking multiple times.
I changed the game mode from Normal to Custom and restarted the server. After that, I downloaded the server's SaveData and tried opening it with SOTFEdit, but the _currentSeason in WEATHER STATE had disappeared.
Game mode: Normal (Previous state)

Game mode: Custom

Because of this, I can't change the weather. Is this a server-side bug? Should I just leave it as it is?
Thank you for reading.

currentSeason is not read by the game anyway. You can read it up here:
https://github.com/codengine/SOTFEdit/blob/master/README.md#weather

thank you so much.


Add RepoChangeSet

@jsingle Specialized object for just doing this one thing.

Cool, merge it when you need it for your stuff


Missing Comma

I think the title is self-explanatory :)

Product is discontinued and no future developments on this repo. Hence closing the PR


BBC iPlayer broken.

Heya, it seems the iPlayer extractor is broken.
youtube-dl -F --verbose http://www.bbc.co.uk/iplayer/episode/b062nqpd/
[debug] System config: []
[debug] User config: [u'-o %(title)s.%(ext)s', u'--console-title', u'--ignore-errors', u'--no-overwrites', u'--prefer-ffmpeg', u'--write-description', u'-f', u'bestvideo[height<=?1080]+bestaudio/best']
[debug] Command-line args: [u'-F', u'--verbose', u'http://www.bbc.co.uk/iplayer/episode/b062nqpd/']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2015.07.21
[debug] Python version 2.7.8 - Windows-8-6.2.9200
[debug] exe versions: ffmpeg N-73510-g033dc39, ffprobe N-73510-g033dc39, rtmpdump 2.4
[debug] Proxy map: {}
[bbc.co.uk] b062nqpd: Downloading video page
[bbc.co.uk] b062nq8w: Downloading media selection XML
ERROR: int() argument must be a string or a number, not 'NoneType'
Traceback (most recent call last):
File "youtube_dl\YoutubeDL.pyo", line 656, in extract_info
File "youtube_dl\extractor\common.pyo", line 275, in extract
File "youtube_dl\extractor\bbccouk.pyo", line 361, in _real_extract
File "youtube_dl\extractor\bbccouk.pyo", line 281, in _download_media_selector
File "youtube_dl\extractor\bbccouk.pyo", line 218, in _extract_video
TypeError: int() argument must be a string or a number, not 'NoneType'

This issue will be fixed in the next version. Thanks for the report.


Request for Pre-trained Swin-L (1 dec layer) Model with COCO Outlier Supervision

Hello,
I have been searching through your model zoo for the Swin-L (1 dec layer) model, specifically the version pre-trained only using the COCO dataset for Outlier Supervision, but it seems to be missing. I am wondering if this particular training setup was not conducted? If it has been, would it be possible for you to provide access to this model?
Thank you for your time and assistance, I look forward to your response!

Greetings @xiaoran-roosevelt ,
We have not conducted the experiment with swin-L (1 dec layer) using solely the COCO dataset but we have done it with COCO + Mapillary and you can find it in the MODEL ZOO in the repo. If you're interested in swin-L (1 dec layer) solely with COCO, we provide the weights of swin-L (1 dec layer) trained on cityscapes only in the MODEL ZOO which you can very easily finetune on COCO using the same config setup of swin-B which we also provide, it can be done on a single GPU and customized as much as needed with the config file. If you need more help on conducting this experiment let us know so that we can share more fine-grained details about it.

ok，i got it.Thank you very much!


vrapi: Expose hand tracking pointer

Oculus exposes the hand tracking pointer pose (the same ray used to interact with the OS), but LÖVR currently isn't exposing it.  The hand/left/point and hand/right/point devices are made for this sort of thing.  The math/logic built into computing that ray is pretty complex, so it would be great to be able to make use of it.

Added in oculus-pinch-pointer, but their pointer sucks!  It lags behind the hand and jumps back and forth as though the tracking rate is too slow.  It also doesn't match what is used in the menu, so Oculus apparently is using their own solution for it.
Not sure if it's better to expose it despite it being pretty unusable, it's better than nothing and might get fixed in the future.

The pointer position and orientation provided by vrapi are not of sufficient quality to expose in LÖVR.  Dropping.

diff --git a/src/modules/headset/headset_vrapi.c b/src/modules/headset/headset_vrapi.c
index ae26416f..8419be6d 100644
--- a/src/modules/headset/headset_vrapi.c
+++ b/src/modules/headset/headset_vrapi.c
@@ -191,40 +191,51 @@ static const float* vrapi_getBoundsGeometry(uint32_t* count) {
 }

 static bool vrapi_getPose(Device device, float* position, float* orientation) {
-  if (device != DEVICE_HAND_LEFT && device != DEVICE_HAND_RIGHT && device != DEVICE_HEAD) {
-    return false;
-  }
-
-  ovrPosef* pose;
-  bool valid;
+  uint32_t index;
+  switch (device) {
+    case DEVICE_HAND_LEFT_POINT:
+    case DEVICE_HAND_RIGHT_POINT:
+      index = device - DEVICE_HAND_LEFT_POINT;
+      if (state.hands[index].Type == ovrControllerType_Hand) {
+        ovrPosef* pose = &state.handInput[index].PointerPose;
+        vec3_set(position, pose->Position.x, pose->Position.y + state.offset, pose->Position.z);
+        quat_init(orientation, &pose->Orientation.x);
+        return state.handPose[index].HandConfidence == ovrConfidence_HIGH;
+      }
+      return false;
+
+    case DEVICE_HAND_LEFT:
+    case DEVICE_HAND_RIGHT:
+      index = device - DEVICE_HAND_LEFT;
+      if (state.hands[index].Type == ovrControllerType_Hand) {
+        ovrPosef* pose = &state.handPose[index].RootPose;
+        vec3_set(position, pose->Position.x, pose->Position.y + state.offset, pose->Position.z);
+        quat_init(orientation, &pose->Orientation.x);
+
+        // Apply rotation adjustment to make hands face -Z
+        float rotation[4];
+        if (device == DEVICE_HAND_LEFT) {
+          float q[4];
+          quat_fromAngleAxis(rotation, (float) M_PI, 0.f, 0.f, 1.f);
+          quat_mul(rotation, rotation, quat_fromAngleAxis(q, (float) M_PI / 2.f, 0.f, 1.f, 0.f));
+        } else if (device == DEVICE_HAND_RIGHT) {
+          quat_fromAngleAxis(rotation, (float) M_PI / 2.f, 0.f, 1.f, 0.f);
+        }
+        quat_mul(orientation, orientation, rotation);

-  uint32_t index = device - DEVICE_HAND_LEFT;
-  if (index < 2 && state.hands[index].Type == ovrControllerType_Hand) {
-    pose = &state.handPose[index].RootPose;
-    valid = state.handPose[index].HandConfidence == ovrConfidence_HIGH;
-  } else {
-    ovrTracking* tracking = &state.tracking[device];
-    pose = &tracking->HeadPose.Pose;
-    valid = tracking->Status & (VRAPI_TRACKING_STATUS_POSITION_VALID | VRAPI_TRACKING_STATUS_ORIENTATION_VALID);
-  }
-
-  vec3_set(position, pose->Position.x, pose->Position.y + state.offset, pose->Position.z);
-  quat_init(orientation, &pose->Orientation.x);
-
-  // Make tracked hands face -Z
-  if (index < 2 && state.hands[index].Type == ovrControllerType_Hand) {
-    float rotation[4];
-    if (device == DEVICE_HAND_LEFT) {
-      float q[4];
-      quat_fromAngleAxis(rotation, (float) M_PI, 0.f, 0.f, 1.f);
-      quat_mul(rotation, rotation, quat_fromAngleAxis(q, (float) M_PI / 2.f, 0.f, 1.f, 0.f));
-    } else if (device == DEVICE_HAND_RIGHT) {
-      quat_fromAngleAxis(rotation, (float) M_PI / 2.f, 0.f, 1.f, 0.f);
+        return state.handPose[index].HandConfidence == ovrConfidence_HIGH;
+      }
+    // fallthrough
+    case DEVICE_HEAD: {
+      ovrTracking* tracking = &state.tracking[device];
+      ovrPosef* pose = &tracking->HeadPose.Pose;
+      vec3_set(position, pose->Position.x, pose->Position.y + state.offset, pose->Position.z);
+      quat_init(orientation, &pose->Orientation.x);
+      return tracking->Status & (VRAPI_TRACKING_STATUS_POSITION_VALID | VRAPI_TRACKING_STATUS_ORIENTATION_VALID);
     }
-    quat_mul(orientation, orientation, rotation);
-  }

-  return valid;
+    default: return false;
+  }
 }

 static bool vrapi_getVelocity(Device device, float* velocity, float* angularVelocity) {


Feature/180 custom visitor ID

Small changes here to add a public variable which allows apps to set the custom user ID for the shared tracker's current visitor object. I used the existing structure that was defined already, so this PR is really just connecting the plumbing and enhancing the docs/example app.

Thanks @niksawtschuk, for this PR. I would like to add your GitHub handle to the CHANGELOG.md. Are you fine with that?

No problem @brototyp.


Question about loading data and tracking collections with an existing store.

Apologies if this is the wrong place for a usage question, I've been pulling my hair out for a week over this one. I'm looking for an example of collections (and nested collections). I've poured over the docs, and I'm a little confused about when to use modelReducer(), formReducer(), combineForms(), createForms(), and track().
I'm working in a private repo with an existing form solution (migrating to react-redux-form), so I'll do my best to explain the current setup.
In my page's componentDidMount(), I am fetching data from an API. My existing reducer handles the fetching/success/error actions and stores the data in redux:
// My combine reducers:
const appReducer = combineReducers<IApplicationState>({
    feeTemplateState: feeTemplateReducer,
});

// Example of state after fetching of data:
feeTemplateState: {
    feeTemplateGroups: [{
        id: 0,
        reportingRegion: 1,
        feeType: 0,
        items: [{
            amount: 1000,
            description: 'Example Description',
            name: 'Example Fee 1',
            id: 2
        }, {
            amount: 500,
            description: 'Example Description',
            name: 'Example Fee 2',
            id: 1
        }],
    }],
    isFetching: false,
    isPosting: false,
    fetched: true,
    error: null
}

// Pseudo example of my Form implementation:
<Form
    model="feeTemplates"
    onSubmit={this.handleSubmit}
>
    // Fee templates are from mapStateToProps
    {this.props.feeTemplates.map((template, index) => (
        <Control.text
            model={`.[${index}].name`}
            controlProps={{
                placeholder: 'Name',
            }}
        />
        <Control.text
            model={`.[${index}].description`}
            controlProps={{
                placeholder: 'Description',
            }}
        />
        <Control.text
            model={`.[${index}].amount`}
            controlProps={{
                placeholder: 'Amount',
            }}
        />
    ))}
</Form>

What is the best approach for:

Loading existing data into the form?
Tracking the ID's with track() so that I can add/delete rows.
When/where/how do I use modelReducer/formReducer/combineForms etc?
Preferably looking for a repo with some examples.

Note: I'm using Typescript and also looking for some info on testing collections with Jest/Enzyme.

Loading existing data into the form?

Dispatching an actions.load action once you receive your data:
dispatch(actions.load('user', userData));

Tracking the ID's with track() so that I can add/delete rows.

The documentation is pretty thorough about this: http://davidkpiano.github.io/react-redux-form/docs/guides/tracking.html

When/where/how do I use modelReducer/formReducer/combineForms etc?
Preferably looking for a repo with some examples.

Use combineForms - modelReducer and formReducer are lower-level and better left abstracted. There's a bunch of guides and examples in the documentation.
Hope that helps!

Thanks for the response! I think I was just missing the actions.load in my setup, I will try that out.


Add additional test coverage for helper functions in Util

Summary
Currently helper functions in Util lacks test coverage
This commit adds test coverage helper functions in Util
Ref #4380
Change Type
Mark the type of change your PR introduces:

[ ] Bug fix (resolves an issue without affecting existing features)
[ ] Feature (adds new functionality without breaking changes)
[ ] Breaking change (may impact existing functionalities or require documentation updates)
[ ] Documentation (updates or additions to documentation)
[x] Refactoring or test improvements (no bug fixes or new functionality)

Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist:

[x] Reviewed my own code for quality and clarity.
[x] Added comments to complex or tricky code sections.
[ ] Updated any affected documentation.
[ ] Included tests that validate the fix or feature.
[x] Checked that related changes are merged.

coverage: 53.686% (+0.4%) from 53.264%
when pulling 1395938c2065cedbc31ab5ac6abf1759e080606c on gajananan:improve-test-coverage-util-helpers
into 49f192a44c7dd19ddadb0e03cbeba4c45dde0bda on stacklok:main.

@gajananan
It looks like this is close to the finish line -- any chance you can incorporate the feedback (and fix conflicts) in the next week?

Hi @gajananan,
We'd love to get this merged!  If you don't have time to work on this, we'll probably have someone over here at Stacklok apply the requested changes and merge it.

Hey @gajananan -- we'd love to get this PR in.  I ran into one of your co-workers at KubeCon, and they said that your work schedule might be preventing you from updating.  A quick note of "I can get to this within a week" or "please carry this forward, I'm busy now" would be handy.
Thanks again for your work so far!