text:
Q: How can I compare a two digit month variable with a single digit month variable? Here is what I have:
select case when cast(datepart(mm, enrollments.enddate) as varchar)<cast(datepart(mm, getdate()) as varchar)
            then 'Expired'
            when cast(datepart(m, enrollments.enddate) as varchar)=cast(datepart(m, getdate()) as varchar)
            then 'Renewal required by end of this month'
            when cast(datepart(m, enrollments.enddate) as varchar)-1=cast(datepart(m, getdate()) as varchar)
            then 'Renewal required by end of next month'
            when cast(datepart(m, enrollments.enddate) as varchar)>cast(datepart(m, getdate()) as varchar)
            then 'Current'
            Else null
         End) as [Certification Status]

All logics work except for the first one in which when 12 for the month of the enrollments.enddate is compared to the getdate month 3, result shows that 12<3 leading to the output 'Expired' instead of 12>3 'Current'
Using SQL Server 2008

A: Why are you doing the comparisons as strings instead of number?  If you want strings, why use datepart() instead of datename()?
So:
select (case when datepart(month, enrollments.enddat) < datepart(month, getdate())
             then 'Expired'
             when datepart(month, enrollments.enddate) = datepart(month, getdate())
             then 'Renewal required by end of this month'
             when datepart(month, enrollments.enddate) - 1 = datepart(month, getdate())
             then 'Renewal required by end of next month'
             when datepart(month, enrollments.enddate) as > datepart(month, getdate()
             then 'Current'
        End) as [Certification Status]

Notes:

*

*Use month instead of m or mm for datepart().  month is unambiguous and clear both to you and to other who might be reading the code.

*Use datename() if you want a string and datepart() if you want a number.


text:
Q: How to setup Ubuntu? I got a dell PC for my 17th birthday. It came with Ubuntu 16.04 LTS, and I am very new to Linux and Ubuntu and I don't know how to setup Ubuntu once I have installed it.
If someone can help me that would be awesome, thank you.

A: Same here. I have a brand new Dell Inspiron 3000 (3567). It arrived with Ubuntu 16.04 on it. It's been put aside for a week because I didn't know what to do with it. This morning I started it up and it kept losing wifi connection (none of my other machines do).
So I clicked on search your computer, typed in "updates", clicked on "Software updater" and a window opened checking for updates. It found loads and I clicked to install them.  I thought all the updates took longer to install than Windows 7 ever did and at first it still kept losing connection during the update process. But I persisted and after a while my wifi stayed connected and the updates continued.
All updates have now been installed and I haven't lost wifi connection since.

A: Looks like the main question is answered; however, factory_image.iso will be the master CD image, should you need to re-install.
Personally, I used to keep installation CDs until I realised I never ever wanted to revert to an ancient image; it's easier to download a fresh one.
You should keep at least one spare bootable thing, be it a CD, a flash drive, external HDD or whatever, or you may end up having to borrow a PC to make one somewhen!
So I'd recommend installing a CD-Writer (eg k3b) & making the CD for now, or copying to USB stick, just as backup while you learn. The simplest is to stick in a spare USB stick (capacity larger than size of .iso file) & copy it from a terminal - the 'how' has been heavily covered on here :) but don't just copy it with the mouse, that doesn't work.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Question about RMAN-01009,RMAN-01007 After i created the tablespace named "rman" and created the user named"rman" and accredited to the user.
I connected to the recovery catalog database successfully.
But when i got into the next step.It mentioned ERROR.

Anyone could help me?
Thanks

A: Connecting to the Target Database and Recovery Catalog
The syntax will be below mention like that
rman TARGET / CATALOG rman/cat@catdb;

where
rman is Owner of the recovery catalog having RECOVERY_CATALOG_OWNER privilege.
cat is The password for user RMAN specified in the recovery catalog's orapwd file.
catdb is The net service name for the recovery catalog database.
for your further ref Connecting to Databases with RMAN


text:
Q: Dynamically add Items to ListView with Efficient Adapter Can anyone tell me, How am I load an image at runtime in listview with the help of efficientAdapter in android.

A: I suppose you're thinking about Efficient Adapter sample code from Api Demos.


text:
Q: Authentication with ssh and scp works but not WinSCP I have a Ubuntu server with 3 user accounts (root, user1, user2).
user1 has access via WinSCP, scp and ssh. No problems here. Then I've created another user2 but with this user I can't access the server via WinSCP but scp and ssh through console works like a charm. WinSCP says that authentication fails but I'm 100% sure that I have made no typo (I can say this after 433245 retries). Now I'm trying to find the differences between the two user accounts and the only differences are their username, password and user2 is in the sudoers group.
Any suggestions what else I can try?

A: Changing password of user2 fixed the issue. Now I am not sure if it has something to do with encoding or escaping of the password inside of WinSCP or any other weird problem.
EDIT 1:
I changed the password back to the one not working and tried to find the special char causing problems.
It was a the non-ASCII char '§' causing the problem. I tried another password with non-ASCII char 'ß' and this one didn't work too. So non-ASCII chars in UNIX-passwords are not a good idea.
EDIT 2:
Bugreport was added to the WinSCP forum:
http://winscp.net/forum/viewtopic.php?p=56296#56296

A: Use WinSCP 5.9 or newer. These versions do encode usernames and passwords using UTF-8 encoding.
See https://winscp.net/tracker/1014


text:
Q: How do I call a method from Java's ScriptEngine(javascript) staticly, with type parameters? I am loading a class from a jarfile at runtime (because the script won't always use that exact jar), so I have a Class object of it. I am also doing that from javax.script.ScriptEngine (javascript). That class has the method public static <T> User get(T base). I need to call it. What is the best way to do it?
It seems to me that there isn't much documentation on scripting for java...
I just need to find a method called "get" in a class with an argument of type T using Class's getMethod(String name, Class[] argumentTypes)...


text:
Q: Make Word's automatic spell-checking pick up dictionary changes In MS Word it's possible to add words to a custom dictionary so they're recognized. If a word is not recognized, Word automatically puts a red squiggly line underneath it. If you add that word to the custom dictionary, this line disappears. What I'd like to do is perform this process automatically via a macro. It appears that one has to manually open the dictionary file and write the new word, as there is no method on the Word Dictionary object to add words to a given dictionary. This is no problem, except that Word doesn't automatically pick up the new word and remove the red squiggly lines underneath the newly-added word. I've even tried clearing the custom dictionaries and adding them back in, but it doesn't seem to reload the dictionary until you manually run a spell check. Sample code for this follows:
Dim x As Dictionary
Dim fname As String

fname = "C:\Users\me\AppData\Roaming\Microsoft\UProof\md.dic"

' code to add word to dictionary goes here

With CustomDictionaries
    .ClearAll
    .Add fname
    .ActiveCustomDictionary = CustomDictionaries.Item(fname)

End With

Is there any way to make Word recognize the newly added word(s) in a custom dictionary without running the interactive spell check? It does this silently if you manually add words, but I can't seem to replicate this behavior in VBA. I'd like the red lines to go away automatically just like they do when you manually add words.

A: I haven't exactly solved the problem, but I think I figured out a work around. You can get a collection of Range objects which represent spelling errors using ActiveDocument.SpellingErrors. I'm going to search this collection for text matching the word I've added to the dictionary, and then set .NoProofing = True on the object. This appears to make the red lines go away, and having added the new word to the dictionary will prevent them from coming back the next time I open the document. I haven't fully tested this approach, but it looks promising.
EDIT
This approach is flawed, as additional instances of the word which are entered during the same session will have the red squigglies underneath them because they haven't been explicitly ignored and the spell check isn't yet using the updated dictionary. If you just pull up the custom dictionary dialog manually and click OK, something happens in the background to re-read the dictionary. I just can't figure out how to do this in code.


text:
Q: Is there a way to capture the Micrometer @Timed annotation into the Prometheus metrics store/registry? I want to capture the data from Micrometer's @Timed annotation into the Prometheus metrics store/registry. I can't find any explanations on how to do this online.
These are the versions I am using:
compile 'org.springframework.boot:spring-boot-starter-web:2.1.4.RELEASE' // This already includes micrometer I believe
compile "io.micrometer:micrometer-registry-prometheus:1.1.4'

I'm trying to time a repository call:
interface HouseRepository {

@Timed
@Query(some long complicated query)
House deleteByAddressAndLastModifiedBefore(
    Address address,
    Instant instant
)

}

How do I do this? I tried adding some different configs to the @Timer annotation, such as:
  @Timed(description = 'this.is.my.metric', value = 'my.metric', extraTags = ['my.metric.name', 'test'])

But I don't see my output in Prometheus (/prometheus).
Surely, this is possible to do?

A: According to the micrometer docs:

Micrometer's Spring Boot configuration does not recognize @Timed on arbitrary methods.

To enable the @Timed annotation to work as you would like it to, you probably need to configure a TimedAspect bean.
@Configuration
public class TimedConfiguration {
   @Bean
   public TimedAspect timedAspect(MeterRegistry registry) {
      return new TimedAspect(registry);
   }
}

Applying TimedAspect makes @Timed usable on any arbitrary method.


text:
Q: Child Window's Closebox is Hidden Behind MenuStrip of Parent (C# .Net 5.0) I appreciate if somebody help me to solve a problem related to maximize a child window inside parent. Here is code to create child;
                    Form2 frm = new Form2();
                    frm.TopLevel = false;
                    frm.MdiParent = this;
                    frm.TopMost = true;
                    frm.Show();

It actually shows as expected;

However, the problem occurs when I maximize child form. Closebox goes behind menustrip item of parent. Windows highlights them by a blue rectangle when I move mouse over their expected location;

They (minimize, maximize and close ) respond when I click blue rectangles :)
I manipulated MinimizeBox, MaximizeBox, Opacity, and Topmost properties of forms and got no result.
Any idea?


text:
Q: Install mac os x
Possible Duplicates:
Mac installation disk
Installing Mac OS X with a different disc

My friend jus bought a new mac book pro and installed with snow leopard. Is that possible i use her OS Disk to upgrade my mac book from leopard to snow leopard?

A: Only with the retail disk (the one with the leopard on the front) but the grey disks are computer specific so only if you have the same computer will it work.


text:
Q: Дублируются данные в шаблонах списка ListView Разрабатывается чат вконтакте, который поддерживает медиавложения. Был написан обращённый список ListView, поддерживающий виртуализацию данных и использующий  интерфейс ISupportIncrementalLoading. Получение сообщений происходит по сети от апи вконтакте. Шаблон сообщения содержит контрол, который занимается созданием медиавложений (документы, фото, виде, товары и т.д.).
Проблема заключается в следующем:
При первом появлении сообщения вложения, если они есть, отображаются хорошо. Однако, если скролить дальше или зайти в беседу с другим человеком, то могут появится эти самые вложения в сообщениях, в которых их быть не должно. Из-за чего такое может происходить?
Я грешу на эту самую виртуализацию. Если использовать виртуализацию данных прямого доступа, то проблема исчезнет? Такая же самая ошибка встречается и при построении записей на стене. Т.е. в новых элементах появляются куски ранее просмотренных записей.
Код
<DataTemplate x:DataType="models:Message"
              x:Key="InPrivateMessageTemplate">
    <attachments:MessagesAttachmentsController Attachments="{x:Bind Attach}" />
</DataTemplate>

// то, что создаёт вложения.
public class MessagesAttachmentsController : Control
{
    private StackPanel _layouRoot;
    private MediaItemPresenter _mediaItemPresenter;

    public MessagesAttachmentsController()
    {
        DefaultStyleKey = typeof(MessagesAttachmentsController);
    }

    public MediaItemPresenter MediaItemPresenter =>
        _mediaItemPresenter ?? (_mediaItemPresenter = new MediaItemPresenter());

    public List<IAttachment> Attachments
    {
        get => (List<IAttachment>)GetValue(AttachmentsProperty);
        set => SetValue(AttachmentsProperty, value);
    }

    public static readonly DependencyProperty AttachmentsProperty =
        DependencyProperty.Register(nameof(Attachments), typeof(List<IAttachment>), typeof(MessagesAttachmentsController), new PropertyMetadata(null, (s, e) =>
        {
            if (Equals(e.NewValue, e.OldValue) || e.NewValue == null)
            {
                return;
            }

            (s as MessagesAttachmentsController)?.ReBuild();
        }));

    protected override void OnApplyTemplate()
    {
        base.OnApplyTemplate();

        _layouRoot = GetTemplateChild("LayoutRoot") as StackPanel;

        ReBuild();
    }

    private void ReBuild()
    {
        if (_layouRoot == null || Attachments == null)
        {
            return;
        }

        _layouRoot.Children.Clear();

        foreach (var item in Attachments)
        {
            switch (item)
            {
                case Core.Entity.Attachments.Sticker sticker:
                    {
                        CreateStiсker(sticker);
                        return;
                    }
                case Core.Entity.Attachments.Link link:
                    {
                        CreateLink(link);
                        return;
                    }
                case IAttachmentPreview ap:
                    {
                        MediaItemPresenter.Attachments.Add(ap);
                        break;
                    }
                default:
                    break;
            }
        }

        if (_mediaItemPresenter != null)
        {
            _layouRoot.Children.Add(_mediaItemPresenter);
        }
    }

    private void CreateStiсker(Core.Entity.Attachments.Sticker sticker)
    {
        var s = new Sticker
        {
            PhotoUrl = sticker.Photo128,
            Size = 128
        };
        _layouRoot.Children.Add(s);
    }

    private void CreateLink(Core.Entity.Attachments.Link link)
    {
        var l = new Link
        {
            PhotoUrl = link.Photo?.Photo604,
            Title = link.Title,
            Description = link.Description,
            Url = link.Url
        };
        _layouRoot.Children.Add(l);
    }
}

A: Как я уже писал, всё дело в виртуализации. Наилучшее решение, которое нашёл на данный момент - принудительная очистка панели темплейта, содержащая все вложения.
Делается посредством вызова Children.Clear(), после чего панель заполняется новыми элементами. Ну и да, всё это необходимо делать асинхронно через
CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, handler),

иначе происходят сильные тормоза

A: При проверке данных в
public static readonly DependencyProperty AttachmentsProperty =
            DependencyProperty.Register(nameof(Attachments),
            typeof(List<IAttachment>), typeof(MessagesAttachmentsController),
new PropertyMetadata(null, (s, e) =>
{
    if (Equals(e.NewValue, e.OldValue) || e.NewValue == null) // Всегда будет равен false
    {
        return;
    }

    (s as MessagesAttachmentsController)?.ReBuild(); // Вот тут все и дублируется
}));

Удалите проверку и все будет работать корректно.
Либо попробуйте не вызывать ReBuild() в OnApplyTemplate()


text:
Q: systemd-resolved wont redirect home. domain requests I have a DNS resolver that resolves a domain home., let's say at 192.168.1.1. When I send a request directly to the resolver, I get a response.
$ kdig @192.168.1.1 home
;; ->>HEADER<<- opcode: QUERY; status: NOERROR; id: 14140
;; Flags: qr rd ra; QUERY: 1; ANSWER: 1; AUTHORITY: 0; ADDITIONAL: 0

But when I try to send it to the local resolver, I get SERVFAIL.
$ kdig home
;; ->>HEADER<<- opcode: QUERY; status: SERVFAIL; id: 61653
;; Flags: qr aa rd ra; QUERY: 1; ANSWER: 0; AUTHORITY: 0; ADDITIONAL: 0

The packet doesn't leave lo, so I assume that systemd-resolved "eats" this query. But when I query a subdomain, it works as it should
kdig a.ns.home
;; ->>HEADER<<- opcode: QUERY; status: NOERROR; id: 6449
;; Flags: qr rd ra; QUERY: 1; ANSWER: 1; AUTHORITY: 0; ADDITIONAL: 0

so it must only have a problem with the TLD.
I read something about systemd-resolved, I tried setting it up like this (add home in Domains)
$ resolvectl status
Global
       Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub

Link 2 (eno1)
    Current Scopes: DNS
         Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.1.1
       DNS Servers: 192.168.1.1
        DNS Domain: lan ~home

and home without tilde (~), but without success. Does anyone have any idea why this is happening?


text:
Q: Use Diskshadow with Powershell For a utility diskpart, Powershell allows me to pass data to the console
by following
'list vol' | diskpart

very similar to the this, can we pass data to diskshadow utility ?
When i try, i get the following error:
PS C:\Users\administrator> 'list vol' | diskshadow
Microsoft DiskShadow version 1.0
Copyright (C) 2007 Microsoft Corporation
On computer:  myserver,  11/8/2012 1:13:32 PM

**DISKSHADOW> Error reading from console. Win32 error: 0x6
The handle is invalid.**

Please suggest if i need to something different?

A: You'll have to create a temp file with your command(s) and run diskshadow with that script.
$script = "./tmp.dsh"
"list shadows all" | Set-Content $script
diskshadow /s $script
Remove-Item $script

A: I have followed the solution offered by Ansgar above and was banging my head trying to understand why Diskshadow ignores the content of my script and only returning this output:
Microsoft DiskShadow version 1.0
Copyright (C) 2013 Microsoft Corporation
On computer:  AS-C01-EX01,  12/2/2021 4:20:29 PM

->

Turns out that Diskshadow is sensitive to the script file encoding.
To solve this, I simply needed to set the encoding to ASCII using the -encoding parameter of Set-Content (or Out-File)


text:
Q: Issue with adding an existing git repository using EGit I'm a beginner when it comes to version control. I've cloned a repository and started working on it, also for versioning am using EGit on eclipse because it's much easier.
So my problem is when I try to add the existing local git repository (Git Repositories -> Add an existing local repository to this view) to eclipse it says that no repository found (screenshot below). I think the reason is that he didn't find the .git folder on the project directory, because somehow the .git folder disappears and just after that I faced this issue. Maybe some of you will say that I need just to clone again the project and copy the .git folder and put it on the existing project, but the problem is that the remote project received many commits after my first clone, so can that affect my local project?
Thank you :D
click here to display the image

A: Clarification about .git folder
Without a .git folder you have not really a git repository!
The folder contains all repository data.
So your "repository" is currently only a normal file structure and has lost all git information - it's only the last working copy.
Wanted
As far as I understood, you want to apply your changes to the repository (and maybe later create a PR to origin/remote one...) but you lost the git data completely and you want to fix this.
Suggestion
Maybe you could do following

*

*clone the remote repository to another, new location at your machine

*checkout same branch where you formerly did your changes

*search for the exact commit id where you started your uncommitted changes
(it's important to exactly checkout the same commit as before, so you have no merge problems later)

*do a "git checkout $commitNumber"

*now create your own branch from this point
(At this point we are on the same position as when you started your
former local changes - means same base)

*copy files from your old location (containing your changes) recursively
into the new location - but ensure relative pathes do match!
(so GIT will recognize file changes as diff...)

*open your Eclipse IDE

*try to add the new location as an existing local repository inside
Eclipse
(this will work now)

*open the "Git Staging" view
Now you should see your delta to your own branch, means your changes.

*add your changes to index and commit them to your branch

*merge your branch into wanted target main/master branch

IMHO this should solve your problem.


text:
Q: Ads or offers for in-app purchases that are not clearly distinguishable from your app content I have a letter from Google Play support that update for my game was rejected because of

Ads or offers for in-app purchases that are not clearly distinguishable from your app content

Does anyone face this rejection?
Since I don't have in-app purchases I believe the reason for me is

Ads are not clearly distinguishable from your app content

Google Play support attach the screen with violation but I have no idea what is the fix they wanted.

A: Previous variant

Description "Watch video and get reward!" and button with text "Watch"

That was not clear enough from the Google Play Team point of view to support Family Policy and have a rate 3+.
A working variant which was published successfully

Description "Watch video ad and get reward!" and button with text "Watch ad"

A: I have exactly the same review of my app Nonogram Colors for an update.
Here is the screenshot provided by Google:

I suppose the wording to watch the video ad is not clear enough for the user. Maybe something like "Watch an ad video to get a reward" could fix the issue. I'll try something like this.
Please keep me in touch is you succeeded to update your app.


text:
Q: Example 1, Section 5.2 of Hoffman's Linear Algebra Definition: Let $K$ be a commutative ring with identity and $n\in \Bbb{N}$. Let $D:M_{n\times n}(K)\to K$. We say $D$ is $n$-linear, if $\forall 1\leq i\leq n$, $D(\alpha_1,..,c\cdot\alpha_i+\alpha'_i,..,\alpha_n)$ $=c\cdot D(\alpha_1,..,\alpha_i,..,\alpha_n)$ $+$ $D(\alpha_1,..,\alpha'_i,..,\alpha_n)$, where $\alpha_1,..,\alpha_i,..,\alpha_n$ are rows of $A$ and $\alpha'_i\in M_{1\times n}(K)$.

Example 1. Let $k_1,…,k_n$ be positive integers, $1\leq k_i\leq n$, and let $a\in K$. For each $n\times n$ matrix $A$ over $K$, define $D(A)=aA(1,k_1)\dotsb A(n,k_n)$. Then the function $D:M_n(K)\to K$ is $n$-linear.
Proof: For, if we regard $D$ as a function of the $i$th row of $A$, the others being fixed, we may write $D(A)$ $=D(\alpha_i)$ $=A(i,k_i)b$, where $b$ is some fixed element of $K$. Let $\alpha'_i= (A'_{i1}, . . ., A'_{in})$. Then we have $D(c\alpha_i+\alpha'_i)$ $=[cA(i,k_i)+A'(i,k_i)]b$ $=cD(\alpha_i)+D(\alpha'_i)$. Thus $D$ is a linear function of each of the rows of $A$.

Que: (1) What is $A(i,k_i)$, $\forall i\in J_n$? (2) From context I think $b=a\prod_{j\in J_n\setminus \{i\}}A(j,k_j)\in K$. Am I right? (3) I don't really understand following equality: $D(c\alpha_i+\alpha'_i)$ $=[cA(i,k_i)+A'(i,k_i)]b$. I have made some partial progress. Let $A=(\alpha_1,..,\alpha_i,..,\alpha_n)$ and $A'=(\alpha_1,..,\alpha'_i,..,\alpha_n)$. Then $c\cdot D(A)+D(A')$ $=c\cdot D(\alpha_i)+D(\alpha'_i)$ $=c\cdot (A(i,k_i)b)+A'(i,k_i)b'$. To get desired result we conclude, $b'$ $=a\prod_{j\in J_n\setminus \{i\}}A'(j,k_j)$ $= a\prod_{j\in J_n\setminus \{i\}}A(j,k_j)$ $=b$. So $c\cdot (A(i,k_i)b)+A'(i,k_i)b'$ $= [c\cdot (A(i,k_i))+A'(i,k_i)]b$. Let $A''=(\alpha_1,..,c\alpha_i+\alpha'_i,..,\alpha_n )$. We need to show $D(A'')$ $=D(c\alpha_i +\alpha'_i)$ $= [c\cdot (A(i,k_i))+A'(i,k_i)]b$. Then $D(A'')$ $=A''(i,k_i)b''$ $=A''(i,k_i)b$ $=[cA_{ik_i}+A'_{ik_i}]b$ $=[cA(i,k_i)+A'(i,k_i)]b$.

A:
(1) What is $A(i,k_i)$, $\forall i\in J_n$

It is any element of row $i$ of $A$.

(2) From context I think $$b=a\prod_{j\in J_n\setminus \{i\}}A(j,k_j)\in K.\tag{1}$$ Am I right?

Yes this is what it is.

(3) I don't really understand following equality: $D(c\alpha_i+\alpha'_i)$ $=[cA(i,k_i)+A'(i,k_i)]b$.

The authors have defined $D(\alpha_i)$ so we can focus on just the $i$th row. Only $\alpha_i'$ differs from $A$, not the whole matrix.

Then $c\cdot D(A)+D(A')$ $=c\cdot D(\alpha_i)+D(\alpha'_i)$ $=c\cdot (A(i,k_i)b)+A'(i,k_i)b'$.

But with the definition of $A'$ which you have used,
$$A'=(\alpha_1,..,\alpha'_i,..,\alpha_n)
\tag{2}
$$
and (1), all of the rows except for the $i$ row are the same, so $b'=b$.

$D(\alpha_1,..,c\cdot\alpha_i+\alpha'_i,..,\alpha_n)=c\cdot D(\alpha_1,..,\alpha_i,..,\alpha_n)+D(\alpha_1,..,\alpha'_i,..,\alpha_n)$

There is no different $b'$ from $D(A')$.
The point of this is to show that this $D$ function which picks just one element from each row is a valid $n$-linear function on $A(K)$, so we need some other matrix to work with, and they define $D(\alpha_i)$ just to make the notation simpler.


text:
Q: How to use authorization header I have a curl command:
curl -X POST "https://api.*****.com/servers/d13****-9703******/power-on" -H "accept: application/json" -H "Authorization: Apikey a****************3"

The code I tried is:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api.*****.com/servers/d13****-9703******/power-on");
curl_setopt($ch, CURLOPT_POST, 1);
headers = array(
  'Authentication:Apikey 3****************fa',
);

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$server_output = curl_exec($ch);

if ($server_output === false) {
  print_r('Curl error: ' . curl_error($ch));
}

curl_close ($ch);
print_r($server_output);

It returns "Unauthenticated".
The key is ok. I tested on Postman and it's ok.
https://i.stack.imgur.com/VXTSX.png
Here is my code:
https://i.stack.imgur.com/BQPdM.png
the api provider accepts both dataform and object input data


text:
Q: Show soft keyboard when AppBar is active using focus makes the content jump back to the top Currently just started developing a UWP WinJS app, testing on Windows 10 Mobile.
I have an appbar and a contenteditable div - if I press a button on the appbar to bold some word in the content area, the div will bold it, but will also jump completely to the top when editor.focus() is called. I'd like for it to stay in its current position.
What I'm trying to do is to have the keyboard appear even when a button is pressed on the AppBar. (Without editor.focus(), the keyboard disappears on button tap.) Unfortunately, with that additional line of code, I have the above scrolling issue.

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam tristique convallis aliquet. Proin ac urna ut diam luctus facilisis vel in ligula. Morbi porta volutpat est eget semper. Sed elementum tincidunt libero. Cras a felis leo. Fusce lacinia turpis vel turpis facilisis sollicitudin. Suspendisse blandit, nisi gravida fermentum placerat, velit ipsum volutpat mi, ut finibus enim mauris at massa. Etiam placerat et mi eget iaculis. Aliquam et semper nisl. Integer id magna non sapien tempus suscipit at eget sem. Integer quam risus, placerat sit amet iaculis ac, ultrices non diam. Aliquam at convallis velit, vitae iaculis lectus. Morbi non orci eget mi placerat aliquet. Sed at neque a eros efficitur egestas. Donec sed luctus leo, ac ullamcorper dui.

    Nullam volutpat ultricies leo, ut congue risus egestas euismod. Suspendisse nisi ligula, volutpat id tempor convallis, facilisis in justo. Nulla porta neque eget ante tincidunt pellentesque. Integer felis libero, rutrum eu interdum eu, finibus a felis. Vestibulum vel est dictum, tempor ex vel, facilisis lorem. Nulla facilisi. Nulla ut ornare tortor, vitae blandit augue. Quisque imperdiet pretium turpis, ac fermentum diam imperdiet vitae. Pellentesque vel mollis odio. Quisque tempus eget neque non pretium.

    Cras eu velit sit amet dolor pulvinar ultricies at id lectus. Suspendisse quis metus sem. Etiam lectus mauris, lobortis volutpat consectetur at, sodales in nisl. Fusce euismod magna in leo tempor, quis bibendum leo gravida. Nulla varius velit vel ultrices sollicitudin. Morbi at odio efficitur, iaculis odio ut, auctor mauris. Phasellus nec lacus arcu. Duis porttitor, urna sit amet tempor dapibus, velit libero malesuada erat, eget pulvinar velit quam id leo. Quisque vulputate vehicula ante, vel condimentum dui consectetur eget.

    Curabitur lobortis porta justo quis pulvinar. Aliquam quam nisl, aliquam vel risus et, semper molestie nulla. Aenean mollis facilisis odio vel convallis. Suspendisse vestibulum nec sapien ut pretium. Duis vehicula, mi sed rutrum luctus, odio magna hendrerit nisl, laoreet eleifend augue neque vestibulum dui. Proin vitae metus convallis, condimentum enim in, volutpat nisl. Aliquam at est id felis placerat fermentum. Duis suscipit commodo convallis. Aliquam imperdiet mollis tortor, sit amet placerat tellus malesuada in. Nunc fringilla sem lorem, nec efficitur purus lobortis mollis. Duis non eros aliquam, luctus libero sed, ullamcorper odio.

    Fusce orci est, rutrum non urna a, finibus suscipit dolor. Mauris suscipit mi ut dolor cursus, quis laoreet est porta. Etiam bibendum fringilla turpis et sagittis. Aenean vehicula maximus dui ut pretium. Vestibulum iaculis id sapien nec condimentum. Donec a aliquet enim. Donec non mauris convallis, tincidunt elit sit amet, ultrices nulla. Duis vel auctor nisl, vitae ultrices mi. Suspendisse potenti. Vivamus sit amet lacus urna. Fusce a sagittis risus. Cras facilisis porta purus, vitae scelerisque mauris vehicula eu.

        <button  data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id: 'boldBtn', icon: 'bold', section:'selection', tooltip:'bold'}"></button>

Javascript:
element.querySelector("#boldBtn").addEventListener("click", toggleBold, false);

function toggleBold() {
    document.execCommand('bold', false, null);
    editor.focus();   // this will cause the div to jump back to the top if it's not already at the top
}

Tried another solution using tryShow(), to detect when the keyboard is about to be hidden. Once detected, force the keyboard to appear. Also, show the AppBar (since it disappeared), place the editor in focus and then scroll back to where you were before. This takes a few seconds to execute and the scrolling is too obvious for it to be a viable solution.

A: If you want to scroll the screen to your selected position, you should calculate the offset of the coordinate, which is moved cause by the showing of a software keyboard.
Here is my Javascript code:
(function () {
    "use strict";
var app = WinJS.Application;
var activation = Windows.ApplicationModel.Activation;

var userHeight, cursorY0, range;

app.onactivated = function (args) {
    if (args.detail.kind === activation.ActivationKind.launch) {
        if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
            // TODO: This application has been newly launched. Initialize your application here.
        } else {
            // TODO: This application was suspended and then terminated.
            // To create a smooth user experience, restore application state here so that it looks like the app never stopped running.
        }
        args.setPromise(WinJS.UI.processAll().done(
            function () {

                //var editor = document.getElementById("editor");
                //editor.addEventListener("click", toggleBold, false);
                var button = document.getElementById("boldBtn");
                var text = document.getElementById("editor");
                var oRange = document.createRange();
                button.addEventListener("click", toggleBold, false);
                text.addEventListener('mouseup',function(e){

                    if (window.getSelection) {
                        var selection = window.getSelection();
                    } else if (document.selection) {
                        var selection = document.selection.createRange();
                    }
                    range = selection.getRangeAt(0);
                    cursorY0 = window.event.pageY;
                    console.log(cursorY0);
                })
                /*text.addEventListener("click", function () {
                    cursorY0 = window.event.pageY;
                    console.log(cursorY0);
                }, false);*/
                //console.log(window.innerHeight);
                userHeight = window.innerHeight;
            })
            );
    }
};

app.oncheckpoint = function (args) {
    // TODO: This application is about to be suspended. Save any state that needs to persist across suspensions here.
    // You might use the WinJS.Application.sessionState object, which is automatically saved and restored across suspension.
    // If you need to complete an asynchronous operation before your application is suspended, call args.setPromise().
};

function toggleBold() {
    var text = document.getElementById("editor");
    //Array.prototype.slice.apply(document.querySelectorAll("b")).forEach(function (b) {
    //    b.parentNode.replaceChild(b.firstChild, b);
    //});

    text.focus();
    var currentHeight = window.innerHeight;
    var cursorY1 = window.event.pageY;
    if (cursorY1 > currentHeight) {
        window.scrollTo(0, currentHeight - (cursorY1 - cursorY0));
    }

    var selectionContents = range.extractContents();
    var boldDom = document.createElement("b");

    boldDom.appendChild(selectionContents);
    range.insertNode(boldDom);

}

app.start();
})();

This is a Non-JQuery method, I think you can also import a JQuery package, and use the method here to calculate the offset.


text:
Q: Fastest way to copy feature dataset from ArcSDE to File Geodatabase in ModelBuilder? What geoprocessing tool is the fastest for copying feature datasets from ArcSDE to a file geodatabase?
I want to make a model in ModelBuilder that copies an entire featuredataset from my SDE database to a file geodatabase. I don't know what the fastest tool is. I tried "Copy element" but that is painstakingly slow compared to if you copy-pasting in ArcCatalog. Featureclass to Geodatabase, only copies the featureclasses in the dataset, and places them in the root of the fgdb. Featureclass to featureclass is a lot of drag and dropping, and I don't know about the speed.

A: Consensus from the comments seems to be that this may depend on a number of factors.
Consequently, in order to be sure what the fastest is in your configuration, I think the best option will be for you to try the various ways that you have found that it is possible to perform the copy, and then to time them.


text:
Q: MySQL Update query not updating table Here is the table

and this is the MySQL Query -
UPDATE loan_accounts SET `Int_Rate` = TRUNCATE(`Int_Rate`*0.5/100+`Int_Rate`,2) WHERE `Loan_Amount`>400000;

Above query is not updating the table by increasing the interest rate by 0.5% for all the loans for which the loan amount is more than 400000.
Kindly help me in finding my mistake.
Data Type of Int_Rate is DECIMAL(7,2) I have to use this format only, due to this I used TRUNCATE function

A: If you are hoping to bump the interest rate from, say, 10.00 to 10.50, all you have to do is addition like this:
update loan_accounts
set int_rate = int_rate + 0.5
where loan_amount > 400000;

(Moved the information from comment to an answer so as to put closure to OP's question).


text:
Q: Mocking DateFormat, SimpleDateFormat, Date class I need to mock the required class(es) and get the desired date result.
I've already tried mocking the format() function in the DateFormat class but didn't work.
class XYZ {

   private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMddHHmmss");
   private static final TimeZone UTC = TimeZone.getTimeZone("UTC");

   public void buildStr(StringBuilder str){
     DATE_FORMAT.setTimeZone(UTC);
     Date date = getDate();
     str.append(DATE_FORMAT.format(date));
   }

   private Date getDate(){
     return new Date();
   }

}

In this code I expect the star to be appended with "20190430000000" (exactly this value)
but I'm getting the current UTC time.

A: You could use a fixed date
LocalDate date = LocalDate.parse("20190430000000", DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));

This code example will work with java8 or higher.
EDIT1:
Assumption: You want to write a test that uses a fixed date yet in production uses the current date. You can use JUnit, dependency injection of some sort and Mockito.
This is an abstract example which won't compile directly.
class XYZ {
    @Inject
    private DateProvider dateProvider;

    public void buildStr(StringBuilder str){
        LocalDate date = dateProvider.getDate();

        // do something with date
    }
}

class DateProvider {
    public Date getDate() {
        return new Date();
    }
}

class XYZTest {
    @Mock
    private DateProvider dateProvider;

    @InjectMocks
    private XYZ xyz;

    @Test
    public void test() {
        LocalDate fixedDate = LocalDate.parse("20190430000000", DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
        when(dateProvider.getDate()).thenReturn(fixedDate);

        StringBuilder builder = new StringBuilder();
        xyz.buildStr(builder);

        // verify builder contains what you expect
    }
}

In your service class you define an additional component which provides the date (here DateProvider). In the test you get a testable instance of your service via the annotation @InjectMocks provided by Mocktio. It will inject any field annotated with @Mock into your testable instance as a mock. In your test you define what the mock is supposed to do by when().thenReturn(). Your production code will use the actual implementation of DateProvider and you get the current date.

A: java.time
You are using terrible date-time classes that were supplanted years ago by the modern java.time classes as defined in JSR 310.
Clock
The java.time classes take an optional Clock argument. Pass a Clock object with the behavior you need for your test. The Clock class has static methods providing several special behaviors. These include a fixed moment, a rolling moment set a certain amount of time ahead or behind the true clock, and altered cadence such as incrementing on whole minutes.
This has been covered many times already on Stack Overflow. Search to learn more.
LocalDate ld = LocalDate.of( 2019 , Month.APRIL , 30 ) ;
ZoneId z = ZoneId.of( "America/Edmonton" ) ;
ZonedDateTime zdt = ld.atStartOfDay( z ) ;
Instant instant = zdt.toInstant() ;
Clock clock = Clock.fixed( instant , z ) ;

Now inject that clock object in your tests.
ZonedDateTime zdt = ZonedDateTime.now( clock ) ;

When you want a true clock, use:
Clock clock = Clock.system( z ) ;


text:
Q: DocuSign upload documents I want to upload a document to DocuSign with DocuSign API and I'm using an example that uploads a document and sends email to the recipient but I can't upload only the document.
This is the example: http://iodocs.docusign.com/APIWalkthrough/requestSignatureFromDocument
Do you know if I can upload the document to my DocuSign account without sending an email? And to another user account  using my credentials?

A: If you set status to "created" in the API request (instead of setting it to "sent" as the example code does), then this will result in the creation of a "Draft" envelope in DocuSign.  The Draft envelope will contain the document(s) that you uploaded with your 'create Envelope' API request, but no email(s) will be sent to recipient(s), because the Envelope is just a draft -- i.e., it hasn't been sent yet (email(s) won't be sent until the Envelope is sent).
It is possible to create a Draft envelope in another user's account, by using "Send On Behalf Of" functionality.  See Send On Behalf Of Functionality in the DocuSign REST API starting on page 16 in the REST API Guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf) for details about how this works.


text:
Q: How to analyze this pre-post control-intervention data set? I have control and intervention groups (N = 50 and 75, respectively) for whom 15 tests (all having quantitative results) were done at baseline and at 3 months.
It is not a randomized study and the baseline values in control group ARE different from those of intervention group.
My precise question is:
"Does the intervention causes a significant change in values of these tests"
What is the best method for this? Should I perform unpaired t-tests on baseline-follow up differences in 2 groups or should I use anova/regression?
Also, how do I correct for multiple tests being done here?
If this has already been discussed, please point me to the right link(s). Thanks for your help.
Edit: Data is in following format:
ID_NO   GRP prepost test1   test2
1   active  pre     10      0.074
2   control pre     11      0.053
1   active  post    10.8    0.042
2   control post    10.5    0.039
....

For anova, following can be used (in R):
summary(aov(testresult ~ GRP * prepost + Error(ID_NO/prepost), data=mydata))

Following can be used for regression:
summary(lm(testresult_difference ~ testresult_basal + GRP , data=mydata))

Unpaired t-tests can be used for testing difference (change) in controls vs change in intervention group. Similarly unpaired t-test can be used for comparing post/pre ratio in controls vs that intervention group.
Which method should I use?

A: You should do an independent T-test between the two groups using the difference in each student's pre- and post- scores as the dependent variable.


text:
Q: Families of quadratic polynomials over $\mathbb{F}_p$ Consider the set $\mathcal{P}$ of polynomials $f \in \mathbb{F}_p[x, y]$ in two variable over the field with $p$ elements, that are quadratic in $x$ and of unrestricted degree in $y$. For each fixed $y \in \mathbb{F}_p$ there are at most 2 solutions $x$ to the equation $f(x, y) = 0$. I will consider the subset of these polynomials, lets call it $\mathcal{P}_{\textrm{nice}}$, where this number is exactly 2 whenever $y \neq 0$:
$$\mathcal{P}_\textrm{nice} = \{ f \in \mathcal{P} : |\{x : f(x, y) = 0\}| = 2 \textrm{ for all }  y \in \mathbb{F}_p^*\} $$
A really easy example of a polynomial in $\mathcal{P}_\rm{nice}$ is $f(x, y) = x(x - y)$ which for each non-zero $y$ has the two element zero-set $x = 0$, $x = y$.
A rather different example, for $p = 5$ is given by $f(x, y) = x^2 + (y + 1)x - (y^2 + 2y + 2)$ which for $y = 0, 1, 2, 3, 4$ gives the zero-sets $\{1, 3\}, \{3, 0\}, \{0, 2\}, \{2, 4\}, \{4, 1\}$. (I included the $y = 0$ case only to illustrate the nice cyclic structure on the zero-sets)
Generally speaking each element of $f$ gives us a list of pairs of elements of $\mathbb{F}_p$, indexed by elements of $\mathbb{F}_p^*$. The question is if every list of pairs, indexed by non-zero elements occurs in this way, so:

Let a list of $p - 1$ triples $(a, b, c) \in \mathbb{F}_p^* \times \mathbb{F}_p \times \mathbb{F}_p$ be given such that

*

*$a$ runs through all elements of $\mathbb{F}_p^*$ and

*$b \neq c$ for each fixed triple $(a, b, c)$ in the list.
Q: is it true that then there is always a polynomial $f \in \mathcal{P}$ such that for each $(a, b, c)$ in the list we have that $f(b, a) = f(c, a) = 0$?

(Note that such a polynomial would automatically lie in $\mathcal{P}_\rm{nice}$.)
It sounds to me like it should be false, but then I discovered (by brute force, when looking for something else, so rather accidentally) that it is true for $p = 5$.
Now I am a bit confused. If it is true, it sounds like there should be an easy way to construct the polynomial from the list of triples $(a, b, c)$, but I don't see it.

A: Given a set map $\theta:\mathbb{F}_p\to \mathbb{F}_p$ (or from $\mathbb{F}_p^*\to\mathbb{F}_p$), there exists a polynomial $f(y)\in\mathbb{F}_p[y]$ such that $\theta(a)=f(a)$ for all $a$. This is an elementary application of Van der Monde matrix.
Assuming this and given your $p-1$ triples, define $\theta_1(a)=-(b+c), \theta_2(a)=bc$. Then there exists polynomials $f(y), g(y)$ such that $\theta_1(a)=f(a), \theta_2(a)=g(a)$ for all $a$. Now consider the polynomial $x^2+f(y)x+g(y)$. Then for any $a$, we get the polynomial $x^2+f(a)x+g(a)=x^2-(b+c)x+bc=(x-b)(x-c)$, which is what you need.


text:
Q: How to fetch every package from Melpa for Emacs package-install on OS X? I am on emacs version 26.3 for OS X.
This is my ~/.emacs.d/init.el file
(require 'package)

(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)

I have run M-x eval-buffer on this init.el file. I would like to install packages from Melpa such as move-text. However M-x package-list doesn't show move-text. This is the case for many packages. How do I get alllll the packages from Melpa available for M-x package-install?

A: It took a few things to fix this. First of a M-x package-list is outdated by M-x list-packages (thanks @Y.E.).
Now when I M-x list-packages I got the following error: Can't use the package manager. It says The TLS Connection to elpa.org:443 is insecure.
To fix this I found this link (https://www.reddit.com/r/emacs/comments/pyevj8/what_should_i_do_cant_use_the_package_manager_it/) which advises adding package-archives for gnu and a mirror of melpa. My init.el now looks like this:
(require 'package)

(add-to-list 'package-archives
             '("melpa" . "http://melpa.org/packages/") t)

'(package-archives
   '(("gnu" . "http://elpa.gnu.org/packages/")
     ("melpa" . "http://www.mirrorservice.org/sites/stable.melpa.org/packages/")))
(package-initialize)

And it seems that it Can fetch all packages from Melpa. I don't entirely understand why gnu is necessary but it seems to be.


text:
Q: How many tables which it's elements are 1 and -1? I tried to solve this by induction but wasn't successful. Problem is:

Determine the number of $(2^n -1) \times (2^n-1)$tables with 1 or -1 entries such that each entry is the product of neighboring entries. (Two entries are neighboring if they have an edge in common)

A: Here is a partial answer : I make some computations that hold for every
$n$, and I show that for $n=3$ there is only one solution, the trivial
solution (all entries equal to $1$).
Let $M=(2^n-1)$. You are looking for the matrices
$(t_{ij})_{1\leq i,j \leq M}$ satisfying your property.
It is easier to work additively than multiplicatively, so let
$\phi : \lbrace -1,1 \rbrace \to {\mathbb F}_2$ be the isomorphism defined
by $\phi(-1)=1$ and $\phi(1)=0$.
Then the matrix $S=(s_{ij})_{1\leq i,j \leq M}$ defined by
$s_{ij}=\phi(t_{ij})$ satifies : for any entry $(i,j)$, $s_{ij}$ is the sum
modulo $2$ of its neighbors. If we define a function $f: {\mathbb Z}^2 \to {\mathbb F}_2$ by $f(i,j)=s_{ij}$ if $1\leq i,j \leq M$ and $0$ otherwise, then we deduce
$$
f(i,j)=f(i-2,j)+f(i-1,j-1)+f(i-1,j)+f(i-1,j+1) (i,j \in {\mathbb Z}) \tag{1}
$$
Let us put $g(j)=f(1,j)$ for $j\in {\mathbb Z}$. Using (1) with $i=2$, we have
$$
f(2,j)=g(j-1)+g(j)+g(j+1) \ \ (j \in {\mathbb Z}) \tag{2}
$$
Using (1) with $i=3$ and combining it with (2), we see that
$$
f(3,j)=g(j-2)+g(j+2) \ \ (j \in {\mathbb Z}) \tag{3}
$$
Continuing this way, we see by induction that there is for each $i$
a set $A_i \subseteq \mathbb Z$ such that for any $j$,
$$
f(i,j)=\sum_{t\in A_i}g(j+t) \tag{4}
$$
Here are some $A_i$'s :
$$
\begin{array}{lcl}
A_1 &=& \lbrace 0 \rbrace \\
A_2 &=& \lbrace 0; \pm 1 \rbrace \\
A_3 &=& \lbrace \pm 2 \rbrace \\
A_4 &=& \lbrace 0; \pm 2; \pm 3 \rbrace \\
A_5 &=& \lbrace 0; \pm 2; \pm 4 \rbrace \\
A_6 &=& \lbrace 0; \pm 3; \pm 4; \pm 5 \rbrace \\
A_7 &=& \lbrace 0; \pm 6 \rbrace \\
A_8 &=& \lbrace 0; \pm 1; \pm 3;\pm 4; \pm 6\pm 7 \rbrace \\
\end{array}
$$
There is no obvious pattern as far as I can see.
Let us look at what happens when $n=3,M=7$ : by the value of $A_8$ above, one
has
$$
\begin{array}{lclcl}
0 &=& f(8,1) &=&  g(1)+g(2)+g(4)+g(5)+g(7) \\
0 &=& f(8,2) &=&  g(1)+g(2)+g(3)+g(5)+g(6) \\
0 &=& f(8,3) &=&  g(2)+g(3)+g(4)+g(6)+g(7) \\
0 &=& f(8,4) &=&  g(1)+g(3)+g(4)+g(5)+g(7) \\
0 &=& f(8,5) &=&  g(2)+g(4)+g(5)+g(6) \\
0 &=& f(8,6) &=&  g(3)+g(5)+g(6)+g(7) \\
0 &=& f(8,7) &=&  g(1)+g(4)+g(6)+g(7) \\
\end{array}
$$
Solving the system, we see that all the $g(j) (1\leq j \leq 7)$ are zero, so that in
that case  there is only the trivial solution.


text:
Q: How do I have a method in code-behind called when a property is updated? What I need is to be able to execute code in a code-behind for my view class when a property on my view-model is updated.  My understanding is that I need to use a dependency-property.
My view-model does implement INotifyPropertyChanged.
Here is the property in my view-model:
private DisplayPosition statusPosition;
public DisplayPosition StatusPosition
{
    get { return this.statusPosition; }
    set
    {
        this.statusPosition = value;
        this.OnPropertyChanged("StatusPosition");
    }
}

Here is my dependency property in my view:
public DisplayPosition StatusPosition
{
    get { return (DisplayPosition)GetValue(StatusPositionProperty); }
    set { SetValue(StatusPositionProperty, value); }
}
public static readonly DependencyProperty StatusPositionProperty =
        DependencyProperty.Register(
        "StatusPosition",
        typeof(DisplayPosition),
        typeof(TranscriptView),
        new PropertyMetadata(DisplayPosition.BottomLeft));

Here is where I set up my binding in my view class (handler for this.DataContextChanged):
private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
{
    Binding myBinding = new Binding("StatusPosition");
    myBinding.Source = this.DataContext;
    myBinding.NotifyOnTargetUpdated = true;
    this.SetBinding(TranscriptView.StatusPositionProperty, myBinding);
}

When I put a break-point on the setter for the property in my view, it never gets hit even after I watch the value change in the view-model, and the PropertyChanged event raised.  Ultimately, my goal is to be able to put more code in the setter.
The hairy detail, if you're curious, is that I need to move a TextBlock around between multiple StackPanels based on this value.  I can't seem to find a XAML-only way of doing that.
More often than not, these problems are simple little obvious things that I've missed.  Nothing I'm trying is helping me sort this one out, though.

A:
When I put a break-point on the setter for the property in my view, it never gets hit even after I watch the value change in the view-model, and the PropertyChanged event raised. Ultimately, my goal is to be able to put more code in the setter.

You can't do this.  When you're using DependencyProperties, the setter is never called when the bound property changes.  It's only purpose is to allow you to set the DP from code.
You need to, instead, add a PropertyChangedCallback to the metadata on your DP, and add the extra code there.  This will get called when the DP value updates, whether via binding, code, etc.


text:
Q: Xamarin Android Support v7 Cardview Sample Fails When I run the Xamarin Android Support v7 Cardview SAMPLE project, I get the following error: "Error inflating class android.support.v7.widget.CardView". How can I get this to work? Find below the stack trace.
Android.Views.InflateException: Binary XML file line #1: Error inflating class android.support.v7.widget.CardView ---> Java.Lang.Reflect.InvocationTargetException:  ---> Java.Lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/cardview/R$styleable; ---> Java.Lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
  at --- End of managed exception stack trace ---
  at java.lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
  at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
  at at android.support.v7.widget.CardView.initialize(CardView.java:203)
  at at android.support.v7.widget.CardView.<init>(CardView.java:101)
  at at java.lang.reflect.Constructor.newInstance(Native Method)
  at at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
  at at android.view.LayoutInflater.createView(LayoutInflater.java:607)
  at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
  at at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
  at at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
  at at android.app.Activity.setContentView(Activity.java:2153)
  at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.n_onCreate(Native Method)
  at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.onCreate(MainActivity.java:28)
  at at android.app.Activity.performCreate(Activity.java:5976)
  at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
  at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
  at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
  at at android.app.ActivityThread.access$800(ActivityThread.java:144)
  at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
  at at android.os.Handler.dispatchMessage(Handler.java:102)
  at at android.os.Looper.loop(Looper.java:135)
  at at android.app.ActivityThread.main(ActivityThread.java:5221)
  at at java.lang.reflect.Method.invoke(Native Method)
  at at java.lang.reflect.Method.invoke(Method.java:372)
  at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
  at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
  at Suppressed: java.lang.ClassNotFoundException: android.support.v7.cardview.R$styleable
  at at java.lang.Class.classForName(Native Method)
  at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
  at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
  at ... 28 more
  at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
  --- End of inner exception stack trace ---
  at --- End of managed exception stack trace ---
  at java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/cardview/R$styleable;
  at at android.support.v7.widget.CardView.initialize(CardView.java:203)
  at at android.support.v7.widget.CardView.<init>(CardView.java:101)
  at at java.lang.reflect.Constructor.newInstance(Native Method)
  at at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
  at at android.view.LayoutInflater.createView(LayoutInflater.java:607)
  at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
  at at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
  at at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
  at at android.app.Activity.setContentView(Activity.java:2153)
  at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.n_onCreate(Native Method)
  at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.onCreate(MainActivity.java:28)
  at at android.app.Activity.performCreate(Activity.java:5976)
  at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
  at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
  at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
  at at android.app.ActivityThread.access$800(ActivityThread.java:144)
  at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
  at at android.os.Handler.dispatchMessage(Handler.java:102)
  at at android.os.Looper.loop(Looper.java:135)
  at at android.app.ActivityThread.main(ActivityThread.java:5221)
  at at java.lang.reflect.Method.invoke(Native Method)
  at at java.lang.reflect.Method.invoke(Method.java:372)
  at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
  at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
  at Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
  at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
  at ... 27 more
  at Suppressed: java.lang.ClassNotFoundException: android.support.v7.cardview.R$styleable
  at at java.lang.Class.classForName(Native Method)
  at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
  at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
  at ... 28 more
  at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
  --- End of inner exception stack trace ---
  at --- End of managed exception stack trace ---
  at java.lang.reflect.InvocationTargetException
  at at java.lang.reflect.Constructor.newInstance(Native Method)
  at at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
  at at android.view.LayoutInflater.createView(LayoutInflater.java:607)
  at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
  at at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
  at at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
  at at android.app.Activity.setContentView(Activity.java:2153)
  at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.n_onCreate(Native Method)
  at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.onCreate(MainActivity.java:28)
  at at android.app.Activity.performCreate(Activity.java:5976)
  at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
  at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
  at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
  at at android.app.ActivityThread.access$800(ActivityThread.java:144)
  at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
  at at android.os.Handler.dispatchMessage(Handler.java:102)
  at at android.os.Looper.loop(Looper.java:135)
  at at android.app.ActivityThread.main(ActivityThread.java:5221)
  at at java.lang.reflect.Method.invoke(Native Method)
  at at java.lang.reflect.Method.invoke(Method.java:372)
  at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
  at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
  at Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/cardview/R$styleable;
  at at android.support.v7.widget.CardView.initialize(CardView.java:203)
  at at android.support.v7.widget.CardView.<init>(CardView.java:101)
  at ... 25 more
  at Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
  at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
  at ... 27 more
  at Suppressed: java.lang.ClassNotFoundException: android.support.v7.cardview.R$styleable
  at at java.lang.Class.classForName(Native Method)
  at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
  at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
  at ... 28 more
  at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
  --- End of inner exception stack trace ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /Users/builder/data/lanes/3236/ee215fc9/source/mono/external/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:143
  at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (IntPtr jobject, IntPtr jclass, IntPtr jmethod, Android.Runtime.JValue* parms) [0x00084] in /Users/builder/data/lanes/3236/ee215fc9/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1029
  at Android.App.Activity.SetContentView (Int32 layoutResID) [0x00070] in /Users/builder/data/lanes/3236/ee215fc9/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.App.Activity.cs:4403
  at AndroidSupportSample.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x0000e] in /Users/Dennis/projects/cobalt-git/Rideshare-01/Components/xamandroidsupportv7cardview-23.1.1.1/samples/AndroidSupportSample/AndroidSupportSample/MainActivity.cs:27
  at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (IntPtr jnienv, IntPtr native__this, IntPtr native_savedInstanceState) [0x00011] in /Users/builder/data/lanes/3236/ee215fc9/source/monodroid/src/Mono.Android/platforms/android-15/src/generated/Android.App.Activity.cs:2212
  at at (wrapper dynamic-method) System.Object:855888e7-3749-47dd-bc4c-c0cf15ffd7a6 (intptr,intptr,intptr)
  at --- End of managed exception stack trace ---
  at android.view.InflateException: Binary XML file line #1: Error inflating class android.support.v7.widget.CardView
  at at android.view.LayoutInflater.createView(LayoutInflater.java:633)
  at at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
  at at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
  at at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
  at at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
  at at android.app.Activity.setContentView(Activity.java:2153)
  at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.n_onCreate(Native Method)
  at at md5b5c4d68d7f0084075bca6dac9c5e1a71.MainActivity.onCreate(MainActivity.java:28)
  at at android.app.Activity.performCreate(Activity.java:5976)
  at at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
  at at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
  at at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
  at at android.app.ActivityThread.access$800(ActivityThread.java:144)
  at at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
  at at android.os.Handler.dispatchMessage(Handler.java:102)
  at at android.os.Looper.loop(Looper.java:135)
  at at android.app.ActivityThread.main(ActivityThread.java:5221)
  at at java.lang.reflect.Method.invoke(Native Method)
  at at java.lang.reflect.Method.invoke(Method.java:372)
  at at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
  at at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
  at Caused by: java.lang.reflect.InvocationTargetException
  at at java.lang.reflect.Constructor.newInstance(Native Method)
  at at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
  at at android.view.LayoutInflater.createView(LayoutInflater.java:607)
  at ... 22 more
  at Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/cardview/R$styleable;
  at at android.support.v7.widget.CardView.initialize(CardView.java:203)
  at at android.support.v7.widget.CardView.<init>(CardView.java:101)
  at ... 25 more
  at Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.cardview.R$styleable" on path: DexPathList[[zip file "/data/app/com.xamarin.supportv7cardview.sample-1/base.apk"],nativeLibraryDirectories=[/data/app/com.xamarin.supportv7cardview.sample-1/lib/arm, /vendor/lib, /system/lib]]
  at at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
  at ... 27 more
  at Suppressed: java.lang.ClassNotFoundException: android.support.v7.cardview.R$styleable
  at at java.lang.Class.classForName(Native Method)
  at at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
  at at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
  at at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
  at ... 28 more
  at Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

A: If you find any issues in added library project fix those things
In eclipse do Project > Clean on the library project and the Android project will solve the problem


text: Q: AWS (Amazon web services) - Elastic Beanstalk В общем я задеплоил приложение на Elastic Beanstalk AWS через их оболочку, но мне хотелось бы иметь доступ к командной строке линукса этого сервера на котором лежит мое приложение, никак не могу догнать как к нему подключиться, в гугле не нашел. Если это вообще возможно.


text:
Q: How to add custom plugin with migrations for kong We're trying to set up Kong using Helm. We have a custom plugin that we want to load and enable, as part of the deployment process. The plugin has migrations, so folder structure looks like:
plugin-folder
|- handler.lua
|- schema.lua
|- daos.lua
|- migrations
   |- init.lua
   |- 000_base.lua

Now, we've gotten helm to install Kong and we've managed to load the plugin, by creating a configMap, using the root of the folder as --from-path when creating the configMap. Unfortunately, configMaps are flat, so the created map did not include the migrations, and it doesn't look like it can.
This seems to suggest, that using configMaps/secrets for loading custom plugins into Kong just won't work, if you need to run migrations.
We've tried to create the configMap from a packed .rock file as well - this did not work, far as I could see.
Edit 1
By reading the values.yml file that is available in the Helm charts for kong, I've come across this:
# Custom Kong plugins can be loaded into Kong by mounting the plugin code
# into the file-system of Kong container.
# The plugin code should be present in ConfigMap or Secret inside the same
# namespace as Kong is being installed.
# The `name` property refers to the name of the ConfigMap or Secret
# itself, while the pluginName refers to the name of the plugin as it appears
# in Kong.
# Subdirectories (which are optional) require separate ConfigMaps/Secrets.
# "path" indicates their directory under the main plugin directory: the example
# below will mount the contents of kong-plugin-rewriter-migrations at "/opt/kong/rewriter/migrations".
plugins: {}
  # configMaps:
  # - pluginName: rewriter
  #   name: kong-plugin-rewriter
  #   subdirectories:
  #   - name: kong-plugin-rewriter-migrations
  #     path: migrations

So, in other words, you use another configmap to mount in the migrations folder. This works now and Kong loads the plugin and sees the migrations folder.
HOWEVER, another problem immediately presented itself: Kong didn't run those migrations. Instead, the init container for Kong (the wait-for-db container) just got stuck in a loop. It saw that the database was ready, but there were migrations available, so it never moved on.
What we're seeing is:
nginx: [error] init_by_lua error: /usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:20: New migrations available; run 'kong migrations up' to proceed
stack traceback:
        [C]: in function 'error'
        /usr/local/share/lua/5.1/kong/cmd/utils/migrations.lua:20: in function 'check_state'
        /usr/local/share/lua/5.1/kong/init.lua:506: in function 'init'
        init_by_lua:3: in main chunk

Edit 2
Turns out that uninstalling and installing made it work. Seems a glitch caught it in a loop the first time round - second time, no such problems.


text:
Q: How to set focus on first input field using jQuery in IE? I can set focus on first input, that works in all browsers(except IE):
  $('#login').on('shown', function () {
  $(login).find('input:visible:first').focus();
})

I need to call it after Bootstrap modal showing will be finished, so I'm calling it in shown function.
Also tried this code(not working):
 $('#sign_up').on('shown', function () {
    setTimeout(function () {
    $(sign_up).find('input:visible:first').focus();
  }, 100);
 ///working everywhere except explorer
$('#login').on('shown', function () {
  $('#user_email').focus();
})

A: javascript
<script type="text/javascript">
function formfocus() {
  document.getElementById('element').focus();
}
window.onload = formfocus;
</script>

JAVASCRIPT DEMO
jquery
$(document).ready(function(){
  $('#element').focus();
});

JQUERY DEMO
JQUERY FOR IE 8
$(document).ready(function(){
  setTimeout(function() {
     $('#element').focus();
  }, 10);
});

IE 8 DEMO
HTML
<form>
  <input id="element" />
  <input />
  <input />
</form>


text:
Q: Animate plots using echarts4r when quarto slides are on-screen I am making a Revealjs presentation using Quarto in R Studio. I am using the package {echarts4r} to make my plots. {echarts4r} comes with default animations. When I render the presentation the default animation has already loaded for all the slides.
I want to run the default echarts4r animations when the slide is active (i.e. when the slide is in view) and reset when some other slide is in view. Could someone help me with this?
Here is the code for the quarto presentation.
---
title: "A Title"
subtitle: "A Subtitle"
author: "First Last"
institute: "Some Institute"
date: today
self-contained: true
format: revealjs
---

## Introduction

Hello There!

## Pie Chart

```{r}
library(tidyverse)
library(echarts4r)

data <- tibble(name = c("A", "B", "C", "D", "E", "F", "G"),
             number = c(9.7, 2.1, 2.1, 1.9, 1.9, 1.9, 80.4))

data %>%
e_charts(name) %>%
e_pie(number, radius = c("50%", "70%")) %>%
e_legend(orient = "vertical", right = "5", top = "65%")
```

A: This isn't a fix or a Quarto method. However, this workaround is dynamic. I worked out what needs to happen with both echarts4r and highcharter because of the comment by @bretauv.
Assign Element IDs
The only thing you'll change with your charts is that you need to give them an element ID. IDs need to be unique across the entire presentation. It's perfectly okay to use something like 'ec0', 'ec1'... and so on for your plots' ids. (You only need to do this to plots that animate.)
Here's an example.
```{r pltEchart, echo=F}

iris |> group_by(Species) |>
  e_charts(Sepal.Length, elementId = "pltEcht") |>  # <--- id is here
  e_scatter(Sepal.Width)

```

For highcharter, and most other widget style packages, adding the element id isn't built in. Here's how you add the id for highcharter.
```{r penquins,echo=F}

hc <- hchart(penguins, "scatter",
             hcaes(x = flipper_length_mm, y = bill_length_mm, group = species))

hc$elementId <- "hc_id"

hc

```

Re-Animating Plots
For each of echarts4r plots, to apply this next part you need the slide it's on and it's element id.
For highcharter, you also need to know the order in which it appears in your presentation (only in terms of other highcharter plots).
Whether you use the less dynamic approach or the more dynamic approach, what remains is adding a JS chunk to your QMD. This chunk can go anywhere in the script file. (I usually put any JS in my RMDs/QMDs at the end.)

If you were not aware, JS is built-in. You don't need to do anything new or different to use JS this way. However, if you were to run this chunk in the source pane, it won't do anything. You have to render it to see it in action. If you end up changing the JS or writing more of your own, don't assume what you see in RStudio's viewer or presentation pane is exactly what you'll see in your browser.

I would skim over what you have to change for both methods before you decide! If you're not comfortable using JS, the second is definitely your best bet.
Customized Information For Each Presentation For Each Re-Animated Plot
For each plot you re-animate, you'll have to identify:

*

*a substring of the slide title OR the slide number (where slide numbers are included on the slides via YAML declaration)

*plot element ids

*plot order (plot order or sequence is for Highcharts only).

For the slide title substring, as you use it in the JS:

*

*it's a substring of the title based on the hash or anchor that is assigned in the background

*substring is all lowercase

*no special characters

*must be unique to that slide

If you're unsure what to use or how to find what's unique—there's an easy way to find that information. If you open your presentation in your browser from the presentation pane in RStudio, the URL of the slides will look similar to this.
Every slide will have the same initial component to the URL, http://localhost:7287/#/, but beyond that, every slide will be unique.
http://localhost:7287/#/another-hc

The string after the # is the title anchor for that slide. You can use exactly what's in the URL (after #/).
Put it Altogether
This continuously checks if the slide has changed (10-millisecond interval). If there's a slide change, it then checks to see if one of the three plots is on that slide. If so, the slide animation is restarted.
What you need to personalize in the JS
ecReloader for charts4r has 2 arguments:

*

*title substring OR slide number

*plot element ID

hcReloader for highcharter has 3 arguments:

*

*title substring OR slide number

*plot element ID

*plot sequence number

In the setInterval function (chunk named customizeMe, you will need to write a function call for each plot you want to re-animate. In my example, I reanimated three plots. This is the ONLY part you modify. (Note that each line needs to end with a semi-colon.)
  ecReloader('code', 'pltEcht');        /* slide title. plot element id */
  hcReloader('highchart', 'hc_id', 0);  /* slide title, id, sequence */
  hcReloader(6, 'another_hc_id', 1);    /* slide number, id, sequence */

     /* assuming only one on slide */
setInterval(function() {
  var current = window.location.hash;
  tellMe = keepLooking(current);
  if(tellMe) {                        /* if the slide changed, then look */
  ecReloader('code', 'pltEcht');
  hcReloader('highchart', 'hc_id', 0);
  hcReloader(6, 'another_hc_id', 1);    /* second highcharter plot */
  }
}, 10); // check every 10 milliseconds

In your presentation, you need to take both of the JS chunks to make this work. (Chunk names are customizeMe and reloaders.)

I'm sure there's a way to customize the appearance of the slide numbers; this code is based on the default, though.

Here's all the JS to make this work.

```{r customizeMe,echo=F,engine='js'}

     /* assuming only one on slide */
setInterval(function() {
  var current = window.location.hash;
  tellMe = keepLooking(current);
  if(tellMe) {                        /* if the slide changed, then look */
  ecReloader('code', 'pltEcht');
  hcReloader('highchart', 'hc_id', 0);
  hcReloader(6, 'another_hc_id', 1);    /* second highcharter plot */
  }
}, 10); // check every 10 milliseconds

```

```{r reloaders,echo=F,engine='js'}

// more dynamic; a couple of key words for each plot

// multiple options for addressing Echarts plots
function ecReloader(slide, id) {
  /* slide (string)  slide title unique substring (check URL when on the slide)
                --or--
           (integer) as in the slide number
     id (string)     element id of the plot to change */
  if(typeof slide === 'number') {                        // slide number provided
    which = document.querySelector('div.slide-number');  // page numbers like '6 / 10'
    validator = Number(which.innerText.split(' ')[0]);
    if(slide === validator) {                            // slide number matches current slide
      var ec = document.getElementById(id);
      ele = echarts.init(ec, get_e_charts_opts(ec.id));
      thatsIt = get_e_charts_opts(ec.id);          /* store data */
      ele.setOption({xAxis: {}, yAxis: {}}, true); /* remove data */
      ele.setOption(thatsIt, false);               /* append original data */
    }
  } else {                                               // unique element in slide title
    if(window.location.hash.indexOf(slide) > -1) {
      var ec = document.getElementById(id);
      ele = echarts.init(ec, get_e_charts_opts(ec.id));
      thatsIt = get_e_charts_opts(ec.id);          /* store data */
      ele.setOption({xAxis: {}, yAxis: {}}, true); /* remove data */
      ele.setOption(thatsIt, false);               /* append original data */
    }
  }
}

// multiple options for addressing Highcharts plots, assumes 1 chart per slide!
function hcReloader(slide, id, order) {
  /* slide (string)  slide title unique substring (check URL when on the slide)
                --or--
           (integer) as in the slide number
     id (string)     element id of the plot to change
     order (integer) 0 through the number of charts in the plot, which one is this plot?
                  (in order of appearance) */
  if(typeof slide === 'number') {                        // slide number provided
    which = document.querySelector('div.slide-number');  // page numbers like '6 / 10'
    validator = Number(which.innerText.split(' ')[0]);
    if(slide === validator) {                            // slide number matches current slide
      var hc1 = document.getElementById(id).firstChild;
      Highcharts.chart(hc1, Highcharts.charts[order].options); // re-draw plot
    }
  } else {                                               // unique element in slide title
    if(window.location.hash.indexOf(slide) > -1) {
      var hc1 = document.getElementById(id).firstChild;
      Highcharts.chart(hc1, Highcharts.charts[order].options); // re-draw plot
    }
  }
}

/* Current Slide Section (bookmark #) */
oHash = window.location.hash;

/* check if the slide has changed */
function keepLooking (nHash) {
  if(oHash === nHash) {
    return false;
  } else {
    oHash = nHash;          /* if slide changed, reset the value of oHash */
    return true;
  }
}

```

Here is the entire QMD script I used to create and test this so you can see how it works.

---
title: "Untitled"
format:
  revealjs:
    slide-number: true
editor: source
---

## Quarto

```{r basics, echo=F}
library(echarts4r)
library(tidyverse)
library(htmltools)
library(highcharter)

```

```{r data, include=F,echo=F}

data("iris")
data(penguins, package = "palmerpenguins")

```

word

## Bullets

more words

## More Plots; How about Highcharter?

```{r penquins,echo=F}

hc <- hchart(penguins, "scatter",
             hcaes(x = flipper_length_mm, y = bill_length_mm, group = species))

hc$elementId <- "hc_id"

hc

```

## Code

`echarts` style plot

```{r pltEcht, echo=F}

iris |> group_by(Species) |>
  e_charts(Sepal.Length, elementId = "pltEcht") |> e_scatter(Sepal.Width)

```

## Another HC

```{r penquins2,echo=F}

hc2 <- hchart(iris, "scatter",
              hcaes(x = Sepal.Length, y = Sepal.Width, group = Species))

hc2$elementId <- "another_hc_id"

hc2

```

```{r customizeMe,echo=F,engine='js'}

     /* assuming only one on slide */
setInterval(function() {
  var current = window.location.hash;
  tellMe = keepLooking(current);
  if(tellMe) {                        /* if the slide changed, then look */
  ecReloader('code', 'pltEcht');
  hcReloader('highchart', 'hc_id', 0);
  hcReloader(6, 'another_hc_id', 1);    /* second highcharter plot */
  }
}, 10); // check every 10 milliseconds

```

```{r reloaders,echo=F,engine='js'}

// more dynamic; a couple of key words for each plot

// multiple options for addressing Echarts plots
function ecReloader(slide, id) {
  /* slide (string)  slide title unique substring (check URL when on the slide)
                --or--
           (integer) as in the slide number
     id (string)     element id of the plot to change */
  if(typeof slide === 'number') {                        // slide number provided
    which = document.querySelector('div.slide-number');  // page numbers like '6 / 10'
    validator = Number(which.innerText.split(' ')[0]);
    if(slide === validator) {                            // slide number matches current slide
      var ec = document.getElementById(id);
      ele = echarts.init(ec, get_e_charts_opts(ec.id));
      thatsIt = get_e_charts_opts(ec.id);          /* store data */
      ele.setOption({xAxis: {}, yAxis: {}}, true); /* remove data */
      ele.setOption(thatsIt, false);               /* append original data */
    }
  } else {                                               // unique element in slide title
    if(window.location.hash.indexOf(slide) > -1) {
      var ec = document.getElementById(id);
      ele = echarts.init(ec, get_e_charts_opts(ec.id));
      thatsIt = get_e_charts_opts(ec.id);          /* store data */
      ele.setOption({xAxis: {}, yAxis: {}}, true); /* remove data */
      ele.setOption(thatsIt, false);               /* append original data */
    }
  }
}

// multiple options for addressing Highcharts plots, assumes 1 chart per slide!
function hcReloader(slide, id, order) {
  /* slide (string)  slide title unique substring (check URL when on the slide)
                --or--
           (integer) as in the slide number
     id (string)     element id of the plot to change
     order (integer) 0 through the number of charts in the plot, which one is this plot?
                  (in order of appearance) */
  if(typeof slide === 'number') {                        // slide number provided
    which = document.querySelector('div.slide-number');  // page numbers like '6 / 10'
    validator = Number(which.innerText.split(' ')[0]);
    if(slide === validator) {                            // slide number matches current slide
      var hc1 = document.getElementById(id).firstChild;
      Highcharts.chart(hc1, Highcharts.charts[order].options); // re-draw plot
    }
  } else {                                               // unique element in slide title
    if(window.location.hash.indexOf(slide) > -1) {
      var hc1 = document.getElementById(id).firstChild;
      Highcharts.chart(hc1, Highcharts.charts[order].options); // re-draw plot
    }
  }
}

/* Current Slide Section (bookmark #) */
oHash = window.location.hash;

/* check if the slide has changed */
function keepLooking (nHash) {
  if(oHash === nHash) {
    return false;
  } else {
    oHash = nHash;          /* if slide changed, reset the value of oHash */
    return true;
  }
}

```

You can put the JS anywhere in your QMD.
If you see delays in loading (flashing, that sort of thing), you can lower the milliseconds between intervals. (That number is at the end of the setInterval function, where you see }, 10).
If something goes wrong, you can just set the JS to eval=F. You didn't actually change anything in your presentation permanently.


text:
Q: Does a Java container offer a fail-safe iterator Here is my problem:
This piece of code throws a java.util.ConcurrentModificationException, because the Vector listeners is modified while there exists an Iterator for this data structure.
The java-doc says that this container offers only a fail-fast iterator.
Is there a possibility to get an Iterator over a standard container like Vector or List in Java that offers me an Iterator, that does not get invalid (is not fail-fast), if there is an element removed during that Iterator "lives"?
I should have the same behavior like the std::list in C++. There the iterator is always valid even if the current iterator is remove. Than the iterator is set to the next element in the list.
public class ClientHandle {
private final Vector<ClientHandleListener> listeners = new Vector<ClientHandleListener>();

public synchronized void  addListener(ClientHandleListener chl) {
    listeners.add(chl);
}

public synchronized void  removeListener(ClientHandleListener chl) {
    listeners.remove(chl);
}

private void fireConnectionClosed() {
    final ClientHandle c = this;

    final Iterator<ClientHandleListener> it = listeners.iterator();
    new Thread(){
        @Override
        public void run() {
            while (it.hasNext()) {
                it.next().connectionClosed(c); //FIXME the iterator gets modified
            }
            };
    }.start();
}}

public class ClientHandlePool implements ClientHandleListener, TaskManagerListener {

        /*...*/
    public synchronized void  removeClientHandle(ClientHandle ch) {
                //here the listeners Vector from the ClientHandle gets modified
        ch.removeListener(this);
        ch.removeListener(currentListener);
        clientHandles.remove(ch);
    }

    @Override
    public void connectionClosed(ClientHandle ch) {
        removeClientHandle(ch);
    }
}

A: As far as I know there's no way to retroactively add that ability to any default Collection implementation (Iterable in fact).
But there are implementations that support that kind of behaviour by having well-defined responses to concurrent modification while iterating.
One example is the CopyOnWriteList.

A: In case of listeners, you might think about using java.util.concurrent.CopyOnWriteArrayList as you typically have way more reads than writes.

A: have a look at java.util.concurrent package you will find everything you need.

A: A lazy way to create a fast, fail-safe iterator: take a copy of the list as an array while locked, and foreach() over the array while unlocked... Can be done with any type of List
private void fireConnectionClosed() {
   final ClientHandle c = this;

   final ClientHandleListener[] listenersArr;
   synchronized(this) {
       listenersArr=listeners.toArray(new ClientHandleListener[0]);
   }
   new Thread(){
       @Override
       public void run() {
          for(ClientHandleListener listener : listenersArr )
              listener.connectionClosed(c);
          }
       };
   }.start();
}


text:
Q: prevent firebase user from deleting himself If I open a website with firebase installed and i execute this
firebase.auth().currentUser.delete() in browser console after a user has logged in, the current user will be deleted. How can i prevent a user from calling the delete function. is there a way to disable this?

A: There is no way to prevent a user from deleting their Firebase Authentication account. But whether you expose such functionality in your app is of course up to you.
It sounds a bit like an XY problem. What app-level problem are you trying to accomplish by disabling users from deleting their Firebase Authentication account?

A: You can now prevent users from deleting their own accounts by unchecking "Enable delete" in the Firebase console. This was available only in Cloud Identity Toolkit console before.

Using deleteUser() will throw an error "Firebase: Error (auth/admin-restricted-operation)."


text:
Q: Android Navigation Error: java.lang.IllegalArgumentException: navigation destination com.example--- is unknown to this NavController I am getting an Error: java.lang.IllegalArgumentException, the error occurs only when i navigate to RegisterFragment from LoginFragment and then press back button to go to previous fragment(LoginFragment) and enter email and password and press login button. When i comment the line view!!.findNavController().navigate(LoginFragmentDirections.actionLoginFragmentToHomeContainerFragment()), the error doesn't occur, but i have to navigate to HomeFragment. How to fix it?
Note: The Error doesn't occur when you don't navigate to RegisterFragment
LoginFragment:
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View?
{
    val binding: FragmentLoginBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_login, container, false)

    val login = binding.loginBtn
    val emailField = binding.inputEmail
    val passwordField = binding.inputPassword
    val signUp = binding.loginSignup

    binding.viewModel = viewModel
    binding.lifecycleOwner = this

    signUp.setOnClickListener {
        view!!.findNavController().navigate(LoginFragmentDirections.actionLoginFragmentToRegisterFragment())
    }

    login.setOnClickListener {
        val email = emailField.text.toString().trim()
        val password = passwordField.text.toString().trim()

        if(email.isEmpty())
        {
            .................
        }

        if(!Patterns.EMAIL_ADDRESS.matcher(email).matches())
        {
            .................
        }

        viewModel.userLogin(email,password)
    }

    viewModel.loginAuthData.observe(this, Observer { userAuthData ->
        if(userAuthData.checkAuth != null)
        {
            if(userAuthData.checkAuth!!)
            {
                Snackbar.make(activity!!.findViewById(android.R.id.content), "Auth Pass", Snackbar.LENGTH_SHORT).show()
                //The error doesn't occur if i comment this line >>
                view!!.findNavController().navigate(LoginFragmentDirections.actionLoginFragmentToHomeContainerFragment())
            }
            else
            {
                Snackbar.make(activity!!.findViewById(android.R.id.content), "Auth Fail", Snackbar.LENGTH_SHORT).show()
            }
        }
    })

    return binding.root
}

Error:
  Process: com.example.---, PID: 24721
  java.lang.IllegalArgumentException: navigation destination com.example.---:id/action_loginFragment_to_homeContainerFragment is unknown to this NavController
    at androidx.navigation.NavController.navigate(NavController.java:789)
    at androidx.navigation.NavController.navigate(NavController.java:730)
    at androidx.navigation.NavController.navigate(NavController.java:716)
    at androidx.navigation.NavController.navigate(NavController.java:907)
    at com.example.---.ui.login.LoginFragment$onCreateView$3.onChanged(LoginFragment.kt:71)
    at com.example.---.ui.login.LoginFragment$onCreateView$3.onChanged(LoginFragment.kt:20)
    at androidx.lifecycle.LiveData.considerNotify(LiveData.java:131)
    at androidx.lifecycle.LiveData.dispatchingValue(LiveData.java:149)
    at androidx.lifecycle.LiveData.setValue(LiveData.java:307)
    at androidx.lifecycle.MutableLiveData.setValue(MutableLiveData.java:50)
    at com.example.---.viewModel.LoginViewModel.authCallBack(LoginViewModel.kt:37)
    at com.example.---.viewModel.LoginViewModel.access$authCallBack(LoginViewModel.kt:12)
    at com.example.---.viewModel.LoginViewModel$firebaseUserAuth$1.invoke(LoginViewModel.kt:15)
    at com.example.---.viewModel.LoginViewModel$firebaseUserAuth$1.invoke(LoginViewModel.kt:12)
    at com.example.---.data.FirebaseUserAuth$login$1.onComplete(FirebaseUserAuth.kt:27)
    at com.google.android.gms.tasks.zzj.run(Unknown Source)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)

A: You're using viewModel.loginAuthData.observe(this, Observer {}) in onCreateView(), i.e., using the Fragment (via this) as the LifecycleOwner for your observing. This is always wrong - you should instead use viewLifecycleOwner when observing from onCreateView():
viewModel.loginAuthData.observe(viewLifecycleOwner, Observer {
   ...
})

How LiveData works is that it continues to stay registered until the given LifecycleOwner is destroyed. When you pass this, it waits for the Fragment itself to be destroyed. However, Fragments are not destroyed while on the back stack (only their view and hence their viewLifecycleOwner is destroyed). This means that the original LiveData never unregisters its Observer.
This means that when onCreateView() happens a second time (i.e., you hit the back button and the view is recreated), a second Observer is created and registered. You now have two Observers running simultaneously. As they both run, the first one successfully runs and calls navigate(). When the second one runs, the NavController has already moved to the next destination, so any actions registered on the previous destination are no longer found, giving you an IllegalArgumentException.
By using viewLifecycleOwner, the original LiveData is correctly destroyed when the Fragment's view is destroyed. This means when you hit back and onCreateView is called again, only one Observer is active at a time and you won't run into this issue.

A: Try getting the NavController of the containing Activity Activity.findNavController(IdOfView) instead of view!!.findNavController()
For more on Navigation:
https://developer.android.com/reference/kotlin/androidx/navigation/package-summary#findnavcontroller


text:
Q: Can I Achieve this Layout in Xaml? I have an array of objects that is basically a grid of Ids/Values for various Categories.  If I bind the collection ordered by category can I bind a "grid" of textboxes in a ListView? The ID values will be known. Example to clarify below. I can handle the UI, but I can't figure out how to "place" by the ID but show/bind the value unless I punt and create the UI in the code-behind.
public class MyItem {
   string ID;
   string Value;
   string Category;
}

with values:
  { id1,  value1a, catA}
  { id2, value1b, catA}
  { id1,  value2a, catB}
  { id2, value2a, catB}

Desired UI binding (ListView with each row showing values of each category):
value1a       value1b
value2a       value2b

A: You can create a ListView and bind some properties to your Model. For example
   <ListView>
        <ListView.ItemTemplate>
            <DataTemplate>

                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                        <ColumnDefinition Width="*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                <TextBlock  Grid.Column="0"  Text="{Binding ID}" />
                <TextBlock  Grid.Column="1"  Text="{Binding Value}" />
                <TextBlock Text="{Binding Category}" />
                <Etc />

                </Grid>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

A: In your case I would suggest you use GridView instead of the ListView
<GridView x:Name="categoryGrid" SizeChanged="GridView_SizeChanged" >
    <GridView.ItemContainerStyle>
        <Style TargetType="GridViewItem">
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        </Style>
    </GridView.ItemContainerStyle>
       <GridView.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Value}"/>
                            </DataTemplate>
       </GridView.ItemTemplate>
</GridView>

Use the SizeChanged event handler to set the width of the GridViewItem.
private async void GridView_SizeChanged(object sender, SizeChangedEventArgs e)
{
    try
    {
        ItemsWrapGrid itemsWPGrid = (ItemsWrapGrid)((GridView)sender).ItemsPanelRoot;
        double viewWidth = ApplicationView.GetForCurrentView().VisibleBounds.Width;
        itemsWPGrid.ItemWidth = (viewWidth) / 2;
    }
    catch
    {

    }
}

And don't forget to set the categoryGrid.ItemsSource = yourCustomList;