WatchOS2, ClockKit, CLKRelativeDateTextProvider being truncated prematurely - watchkit

I am using the following snippet to show the relative time in a Modular Large complication.
textTemplate.body1TextProvider = [CLKRelativeDateTextProvider
textProviderWithDate:timeOfEntry
style:CLKRelativeDateStyleNatural
units:(NSCalendarUnitMinute)];
Usually (but not always), the relative time is shown correctly the first time, something like,
42 MIN (with plenty of room for more text on the same line)
...but soon after, updates appear as show in the screenshot below,
42 M... (again, with plenty of room for more text on the same line)
As shown, it it prematurely truncated with ellipsis and always after the first letter of the time unit (M.. for minutes, H.. for hours).
The body2 line is empty, should it want to overflow (I've even tried setting it to nil, and #"", just to make absolutely sure of that).
The problem appears on the simulator (38mm and 42mm), and on my actual 38mm watch.
If this was a watchos2 bug, I'd expect it to be obvious and fixed by now.
Anyone else seeing this, or know the solution?
Thanks.

Related

Is there a way of highlighting an entire code block loop in R, particularly RStudio?

I'm using RStudio 1.4.1106 for MacOS.
I'm continuing with writing my package functions. Some of them are quite long and involve branching methods depending on the nature of the input data. The branching involves if loops, and there are sub-if loops as well.
I comment the close brackets so I can back track to the start line of the loop (I don't use line numbers because I am frequently modifying code and the line numbers change). My current method to verify I have the correct loop selected is to go to the left of the close bracket and then identify the open bracket by the fact it is highlighted.
Is there a method of highlighting an entire loop code block? In particular, this would make it easier for me to comment out an entire block of code without worrying I have commented out too much or too little.
There are a few things that will make your life easier:
There are arrows next to the line numbers that will collapse a code block (I think determined by the braces {}). You can collapse from the top (e.g. line 109 in the screenshot attached) or the bottom (line 125 in the screenshot).
The other thing that can help if you want to examine code within a block is that double clicking just before or after the opening or closing brace will highlight all the code enclosed by the matching braces. See second screenshot below: .
Edit: Just noticed the comment - as mentioned you can also highlight code while the section is collapsed, and it will stay highlighted when expanded.

R Shiny + Future + Plumber

Preamble
Inspired by the presentation by Barret Schloerke at studio::global(2021) (I will add the link as soon as it becomes available), I tried to implement an app to see the differences between using {future}, {plumber}, both or none into a Shiny app running a sequence of fast-slow-slow-fast computations (both on distinct output and in a sequence within the same one).
Gist
You can find here my attempt, including the app.R Shiny app and the plumber.R APIs.
Results
execution selected (5 s for "slow")
result
expectation
comments
Standard run
~20 seconds before anything appear, next everything appears in the same moment
~20 seconds, appearing sequentially somehow
Why did not appear sequentially?
{future} only
~5 seconds before anything appear, next everything appears in the same moment
~20 with "first fast" and "second fast" appearing almost immediatly and next (~5) "first slow" or "second slow," next (~10) the other, and finally (~20) "Sequential")
I would expect that something similar to what happened here for the combined type of run... how is possible that "sequential" completed in 5 seconds???
{plumber} only
same as the standard run (r should remain busy until each API call would be resolved, right?)
same time (~20) but appearing sequentially some how
why shiny rendered everything the same time?
{future} and {plumber}
same as the standard run
I do not expect this at all!, What I expected here is to have "_fast"s appearing immediately, "_slow"s quite the same time after ~5 seconds, and "sequential" after ~10 seconds from the start (i.e., ~10 seconds overall)
I am totally confused here :-(
Doubts
One of the main things I did not understand is why when activating {future} (both with or without {plumber}), "first fast" does not appear immediately. And in general, why the output does not appear in a single sequence when {future} is not involved. And how is it possible that with {future} alone, "sequential" stay ~5 seconds?
So, clearly, I made something the wrong way, and I do not understand something correctly.
Questions
Can someone help me understand where/what (and maybe try to infer "why") I made the app wrong, and/or the API wrong, or their interaction wrong?
Thank you,
Corrado.

My looping code in prolog won't work with the rest of my code

I am working on a school assignment where I have to find the smallest hitting set of a list of lists. Right now I am working on finding all the hitting sets before I narrow it down to the smallest one. I implemented a way for my code to find out if two lists have at least one number in common. To my knowledge it works as intended by itself but whenever I try to connect it to the main part of my code it won't work or runs indefinitely. Any help would be appreciated.
Minimal, Reproducible Example:
This code has been made in a way that it will return true anytime a two arrays have at least one number that intersects between the two. I have tested this code and to my knowledge it works as intended. The first result back is always correct when I tested it.
checkForIntersection([],[]):- false.
checkForIntersection([Head|Tail],[Head2|Tail2]):-
Head = Head2;
checkForIntersection(Tail,[Head2|Tail2]);
checkForIntersection([Head|Tail],Tail2).
This part of the code is where I believe an error occurs. I have an AnswerSet as the list that I want to check for intersections. The [Check|NextCheck] is a list of lists and I want to check each of them against the AnswerSet. I loop through it until the [Check|NextCheck] is empty. The issue is that when I call it the results I get is an infinite amount of trues even if the answer should be false.
loopThroughListOfLists(CheckListsAgenstThisList,[]).
loopThroughListOfLists(CheckListsAgenstThisList,[ListToCheck|NextListToCheck]):-
checkForIntersection(ListToCheck,CheckListsAgenstThisList),
loopThroughListOfLists(CheckListsAgenstThisList,NextListToCheck).
loopCheck([3],[[1], [1], [3], [4], [4]]). This is one of the cases I used to test my code with. Instead of returning false it returns an infinite amount of trues whenever I test it.
Thank you so much for reading, I am sorry if this is a really stupid question, I am really struggling with Prolog.

Assigning result of chain matrix multiplication to a variable in Maxima

I'm trying to assign the result of a chain matrix multiplication in Maxima to a new variable. I'm not sure as a new user why line %o6 isn't the same as the previous and fully evaluate the chain. Also why when I enter the new variable name "B" I simply have "B" returned back to me and not ([32, 32], [32, 32]). Basic questions I know but I've searched the documentation for a number of hours, and tutorials, and the syntax that I'm supposed to use here to get what I guess I was expecting as output, is still unclear to me.
I can't tell for sure, but it appears that the problem is that B : A.A.A is entered holding the shift key for at least one of the spaces, and Shift+Space is interpreted as non-breaking space instead of ordinary space. This appears to be a known bug or at least a serious misfeature in wxMaxima; see: https://github.com/wxMaxima-developers/wxmaxima/issues/1031
(I say misfeature because Shift+Space --> non-breaking space is documented in the wxMaxima documentation, but it seems like a classic example of "bad affordance"; it is all too easy to do the wrong thing without knowing it. Anyway this is just my opinion.)
I built wxMaxima from current source code and it appears that Shift+Space is now not interpreted as non-breaking space in code, so B : A.A.A should have the expected effect even if shift key is held while typing space. The current version is 19.07.0-DevelopmentSnapshot. I poked through the commit log a bit, but I can't figure out which commit changed the behavior of Shift+Space, so it's possible that the problem is not fixed and it is just fortuitous that I am not encountering it.
There are two workarounds, if one doesn't want to hazard an upgrade. (1) Omit spaces. (2) Be careful to only type space without shift.
Hope this is helpful in some way.

White squares when using plotmath expressions

Whenever I try to use symbols in a plotmath expression in R, I get white squares. For example, when I run demo(plotmath), I get the following.
Does anyone have an idea where the problem may lie? I am using R 3.4.1 in Rstudio on Mac OS X 10.11.6.
Update:
As mentioned in the comments, it seems to be an issue with my fonts.
When I look at Symbol, I have two "Symbol Regular"s, and the second one appears as question marks when viewing both together. However, when I click on the second one individually, the fonts appear normally. I tried to validate fonts and remove duplicates, but Font Book did not detect any problems. What should I do?
If you go to Fontbook.app and examine the Symbol font, is it perhaps duplicated or can you see any other evidence of corruption? – 42- 25 mins ago
#42- Thanks very much, it does seem to be an issue with the Symbol font. I listed what I see above; do you know what I should do with the font to fix it? – angryavian 9 mins ago
Delete it. It will get replaced from some magic Apple storeroom buried deep in the bowels of the System.
I don't know how this happens, but it used to happen to me fairly often. Doesn't seem to be happening lately. I remain puzzled. I'm guessing there may be answers at Ask Different (but I didn't find an answer.) Whatever the mechanism it's been around for a long, long time:
http://hints.macworld.com/article.php?story=20031025010930633

Resources