text:
Q: Sign in to Azure B2C with a Google Service Account I'd like to start with a Google Service Account credential (either opaque access token or ID JWT) and end with an Azure B2C credential. Is something like this possible with Azure? I'm not seeing any APIs for doing it: https://learn.microsoft.com/en-us/azure/active-directory-b2c/openid-connect
Note: this is conceptually similar (but different in terms of target identity) from another question I asked earlier:
Impersonate Azure Service Principal from a Google Service Account
EDIT: Our use case for this is exchanging Google Service Account credentials that represent an untrusted client (e.g. a user in the system), for a user token in Azure B2C. Unfortunately, this eliminates the client credentials flow, as mentioned in the comments.

A: Azure AD B2C only supports interactive federation flows with other identity providers.
Google service accounts are non interactive authentications. The only way AAD B2C can pass these credentials to Google would be through its REST API interface.
https://learn.microsoft.com/en-us/azure/active-directory-b2c/restful-technical-profile
The credentials would need to be hard coded into the policy or through AAD B2C "policy keys".
https://learn.microsoft.com/en-us/azure/active-directory-b2c/secure-rest-api?tabs=windows&pivots=b2c-custom-policy
From what I can see, AAD B2C REST API interface doesn't support an authentication method that Google needs. So I would conclude it's not possible.


text:
Q: Add existing ssh key for git I am and my friend working on the same project, he has ssh permission for repo, he gave me his ssh key and I want to import it to my  id_rsa.pub, but after I get Permission denied error when want to clone project. Can somebody help me? Thanks!

A: To get remote access to a server it needs to know about your key. Therefor you have a private key and the server has the public key in its ~/.ssh/authorized_keys
The reason why your friend gets access is probably because he has uploaded his public key to the server.
But your friend probably doesnt want you to have his private key - because then you could authenticate as him on all servers he has uploaded his public key to.
So to get access - you need to upload your public key into the account that you are using.
If this is a plain ssh server - then you can scp it over and append the key to the '~/.ssh/authorized_keys'. In which case the content of the file now will contain two keys.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Little-o, Big-O and differentiation The functions $f,g, h: \mathbb{R} \rightarrow \mathbb{R}$ have the origin 0 as an internal point of their domain.

*

*Prove that if $f = \mathcal{O}(x^{k})$, $f = \mathcal{o}(x^{k-1})$

*Prove that if $g = \mathcal{o}(x)$, g is differentiable in 0. Next assume that for $m \in \mathbb{N}_{\leq 1}$, $g = \mathcal{o}(x^{m})$ and $g$ is $m$ times differentiable. Calculate $g^{(k)}(0)$ for $k \in \{0, 1, ..., m\}$

*Assume $h$ is $n+1$ times differentiable with $h^{(n+1)}$ continuous and $h = \mathcal{o}(x^{n})$. Prove that $h = \mathcal{O}(x^{n+1})$.

What I have tried is the following.

*

*As $f = \mathcal{O}(x^{k})$, there exists an open interval $I \subset Dom(f)$ with $0 \in I$ and $C>0$ so that if $x \in I$, $0 \leq |f(x)| \leq C |x|^{k}$. Using the squeeze theorem it follows that $\lim_{x \rightarrow 0} f(x) = 0$, and because $0$ is an internal point of the domain of $f$, $f(0)=0$ so that the first condition for $f$ to be an element of $\mathcal{o}(x^{k-1})$ has been met. Next observe that $I = ]a,b[$ for some $a, b \in \mathbb{R}$ with $a < b$. Because $0 \in I$, $a < 0 < b$. Let $\delta < min\{|a|,|b|,1\}$ and name $D = ]-\delta,\delta[$. It follows that $0 \in D \subset I$. For $x \in D$, $|x| < 1$ and $|x|^{k} < |x|^{k-1}$, so $|h(x)| \leq C|x|^{k} \leq C|x|^{k-1}$.

Is this the right direction to go in? Because I cant find the answer from here.

*Because $g = \mathcal{o}(x)$, g(0) = 0 and $lim_{x \rightarrow 0} \frac{g(x)}{|x|} = 0$. Then $lim_{x \rightarrow 0} \frac{g(x)}{|x|} = lim_{x \rightarrow 0} \frac{g(x)-g(x)}{|x|-0} = lim_{x \rightarrow 0} \frac{g(x)-g(x)}{x-0} = g'(0) = 0$.

Doesnt it follow from this that every higher derivative of $g$ also equals 0?

*Nothing much, cause I have no idea how to start.

Any help is greatly appreciated.

edit:
The definitions used are:

*

*$f = \mathcal{o}(x^{k}) \leftrightarrow f(0) = 0, \lim_{x \rightarrow 0} \frac{f(x)}{|x|^{k}} = 0$

*$f = \mathcal{O}(x^{k}) \leftrightarrow \forall x \in I, |f(x)| \leq C|x|^{k}$

For $I \subset Dom(f)$ open containing $0$, and $C > 0$.

A: You do things very complicate...
1) Let $C>0$ such that $|f(x)|\leq C|x^k|$. In particular $$\left|\frac{f(x)}{x^{k-1}}\right|\leq C|x|\underset{x\to 0}{\longrightarrow }0$$
what prove the claim.
2) Let $\varepsilon>0$ and $\delta>0$ such that
$$\left|\frac{g(x)}{x}\right|<\varepsilon$$
if $|x|<\delta$.
In particular
$$\left|\frac{g(x)-g(0)}{x-0}-0\right|=\left|\frac{g(x)}{x}\right|<\varepsilon$$
if $|x|<\delta$, what prove the claim. Suppose $g$ is $m$ times differentiable. You can observe that $g'(0)=0$ and that
$$0=\lim_{x\to 0}\left|\frac{g(x)}{x^m}\right|=\lim_{x\to 0}\frac{1}{m}\left|\frac{g'(x)}{x^{m-1}}\right|$$ by l'Hopital rule and the fact that $x\mapsto |x|$ is continuous at $x=0$. Therefore $g'(x)=o(x^{m-1})$ and thus, by induction $g^{(k)}(x)=0$ for all $k=0,...,m$.
3) By 2) we have that $h^{(n)}(0)=0$. Moreover, by continuity of $h^{(n+1)}$, $$\lim_{x\to 0}h^{(n+1)}(x)=\lim_{x\to 0}\frac{h^{(n)}(x)}{x}=h^{(n+1)}(0).$$
Then there is a $\delta>0$ such that
$$|h^{(n+1)}(x)|\leq 1+|h^{(n+1)}(0)|$$
if $|x|<\delta$. We can conclude that $h^{(n+1)}(x)=\mathcal O(1)$ and thus that $h(x)=\mathcal O(x^{n+1)}$. Indeed, it's very easy to prove that
$$|h^{(n+1)}(x)|\leq C\implies |h^{(n)}(x)|\leq C(|x|+\underbrace{h^{(n)}(0)}_{=0})=C|x|\implies ...\implies |h(x)|\leq C|x|^{n+1}$$
if $|x|<\tilde \delta$ for a certain $\tilde\delta>0$.


text:
Q: How to add tags to logretention custom function using AWS CDK I am using AWS CDK Typescript to generate my lambda function
import { Function as lambdaFunction } from '@aws-cdk/aws-lambda'

const my_lambda = new lambdaFunction(this, 'my Lambda', {
            code: Code.fromBucket(
                lambdaBucket,
                'python36/helloworld/hello-world-python3.zip'
            ),
            runtime: Runtime.PYTHON_3_8,
            handler: 'lambda_function.lambda_handler',
            functionName: 'MyLambda',
            logRetention: RetentionDays.ONE_MONTH,
        })

This works fine, but behind the scenes, CDK is creating another lambda responsible for adding the logs.
It is easy to add tags to the lambda function I created using Tags.of(my_lambda).add('Name','tag name')
I would like to add tags to the underlying lambda function. Does anyone know a way of tagging the underlying function?

A: Move tagging code to stack level, this will apply tags to all resources created within the stack
import aws_cdk.core as _core

tags = _core.Tags.of(<<Your Stack Name>>)
tags.add("environment", env_name)

This will tags to all resources created within your stack


text:
Q: Laravel decrypt() throws "DecryptException The payload is invalid." I have my authenticated user, and for debugging, I am trying to show his password using decrypt (as it is encrypted using encrypt().
To simplify things, I create a new route /test and I can see the encrypted password of the authenticated user like so:
Route::get('/test', function() {
    dd(Auth::user()->password)
});

This returns me: $2y$10$gdhYnCekBownWU62OitC6uSwoONfDWGO23FnaVwIgFPAeJI9L6DEa

But if I try using, it throws me this error:
Route::get('/test', function() {
    dd(decrypt(Auth::user()->password))
});

DecryptException: The payload is invalid.

I tried searching around regarding this issue, and two things I found were:
1) "Make sure app key is proper." It was there before, but to be sure, I run php artisan key:generate again. Nothing has changed.
2) "It is a CSRF issue". I disabled the csrf from middleware kernel in web, nothing has changed either. And I am not using post request, so I doubt this is my issue.

I need it because the scenario looks like this: I need to decrypt the password because I am generating a random password using this approach beforehand, and saved it to database; and I want to keep this approach.
$randomPassword = rand(111111,999999);
$user->password = encrypt($randomPassword);
$user->save();

Does anyone know what is the reason of this or how to overcome it?

A: You can't (link). Passwords aren't encrypted, they're hashed. It's one way, and once it's hashed, it cannot be un-hashed.
What you're trying to do is something that should be avoided. I can't think of any use case where you'd need to decrypt a user's password. I think you need to come up with a new strategy, maybe derive a password from a user like: lastname/yearofbirth


text:
Q: Linux: using backtrace(), /proc/self/maps and addr2line together results in invalid result I'm trying to implement a way to record callstacks of my program into a file then display it later.
Here are the steps:

*

*Write the content of /proc/self/maps to a log file.

*

*In this example, the content of /proc/self/maps is:

*00400000-05cdc000 r-xp 00000000 00:51 12974779926     helloworld

*Which means the base address of helloworld program is 0x400000.

*In the program, whenever an interesting code needs to have its callstack recorded, I use the function backtrace() to obtain the callstack's addresses then write to the log file. Let say the callstack in this example is:

*

*0x400001

*0x400003

*At some point later, in a separate log viewer program, the log file is opened and parsed. An address in the callstack will be deducted by the base address of the program. In this case:

*

*0x400001 - 0x400000 = 1

*I then use this deducted offset to obtain the line number using addr2line program:

*

*addr2line -fCe hellowork 0x1

*However this produces ??? result, i.e. invalid offset.

*But if I don't deduct the callstack's address, but pass the actual value to add2line command:

*

*addr2line -fCe hellowork 0x400001, then it returns correct file and line number.

The thing is if the address in within a shared object, then an absolute address won't work while a deducted offset will.
Why is there such a difference in the way the addresses are mapped for the main executable and the shared objects? Or maybe this is backtrace implementation specific, such that it always returns an absolute address for a function within the main executable?

A:
Why is there such a difference in the way the addresses are mapped for the main executable and the shared objects?

The shared libraries are usually linked at address 0 and relocated. The non-position executable is usually linked at address 0x400000 on x86_64 Linux and must not be relocated (or it wouldn't work).
To find out where a given ELF binary is linked, look at the p_vaddr address of the fist PT_LOAD segment (readelf -Wl foo will show you that). In addition, only ET_DYN ELF binaries can be relocated, while ET_EXEC binaries must not be.
Note that position-independent executables exist, and for them you need to do the subtraction.
Note that shared libraries are usually linked at address 0 (and so subtraction works), but they don't have to. Running prelink on a shared library will result in a shared library linked at non-0 address, and then the subtraction you use will not work either.
Really, what you need to do is subtract at-runtime load address from linked-at address to get relocation (which would be 0 for non-PIE executables, and non-0 for shared libraries), and then subtract that relocation from the program counter recorded by backtrace to get the symbol value.
Finally, if you iterate over all loaded ELF images with dl_iterate_phdr, the dlpi_addr it provides is exactly the relocation that you need to subtract.


text:
Q: Determine if there is a solution to the congruence $x^6+5x^2 \equiv 2\mod 7$ I've checked if $x = 1, 2, \ldots, 6$ and they are not congruent to $2 \mod 7$ so, $x$ would have to be a fraction if anything. How would I be able to show it?

A: First observe that $x\equiv 0\mod 7$ is not a solution. So we may suppose $x$ is not divisible by $7$, and by lil' Fermat, we know that $x^6\equiv 1\mod 7$. Therefore, we obtain the congruence
$$5x^2\equiv 1\mod 7 \iff x^2\equiv 3\mod 7,$$
since the inverse of $5\bmod 7$ is $3$.
What is the list of non-zero squares mod. $7$, knowing the non-zero elements are $\pm 1,\pm 2,\pm 3$?

A: $\bmod 7\!:\ x\not\equiv 0\,\Rightarrow\, \color{#c00}{x^{\large 6}\equiv 1}\,$  so it is $\,1\equiv -2x^{\large 2}\,\overset{\large (\ \ )^{\LARGE 3}}\Longrightarrow\,1\equiv -\color{#c00}{x^{\large 6}}\equiv -\color{#c00}1\,\Rightarrow\!\Leftarrow$

A: If you've checked $x = 0, 1, 2,3,4,5, 6$ and have found that $x^6+5x^2$ is never  congruent to $2 \bmod 7$, then there is nothing else to prove.

A: Apparently you are already done.
But we have $5x^2\cong1\pmod 7$ by Fermat's little theorem, if $x\neq0$.   A quick check reveals:
$0: 0^6+ 5\cdot 0^2\cong0\not\cong 2\\1:5\cdot1^2\cong5\not\cong1\\2:5\cdot 2^2\cong20\cong6\not\cong1\\3:5\cdot3^2\cong45\cong3\not\cong1\\4:5\cdot 4^2\cong80\cong 3\not\cong1\\5:5\cdot5^2\cong125\cong6\not\cong1\\6:5\cdot 6^2\cong180\cong5\not\cong1$, all $\pmod7$.


text:
Q: Javascript: How to populate text field with async value before submitting form? I want to submit a transaction from the client to Ethereum blockchain, get back a transaction hash, and then submit this hash to my backend.
On the front-end I have a form like this:
<form id="formConfirm" method="POST" action="/step2" onSubmit="processStep1">
  <input id="textWalletAddress" name="walletAddress" type="text" readonly />
  <input id="textEncodedFunctionCall" th:value="${encodedFunctionCall}" readonly />
  <input type="text" id="textTxHash" readonly />
  <input type="submit" value="Submit" />
</form>

Inside the function, I want to submit the transaction, get back the corresponding hash, and populate a field with it so that I can push it to my backend.
async function processStep1(e) {
  // edit1: trying out preventDefault
  alert('Before preventDefault');
  e.preventDefault();
  alert('After preventDefault');

  let efc = document.getElementById('textEncodedFunctionCall').value;
  let walletAddress = document.getElementById('textWalletAddress').value;
  const txParams = {
    to: CONTRACT,
    from: walletAddress,
    'data': efc
  };

  if (window.ethereum) {
    try {
      const txHash = await window.ethereum.request({
        method: "eth_sendTransaction",
        params: [txParams]
      });
      document.getElementById('textTxHash').value = txHash;
      // how/where do I preventDefault()?
    } catch (err) {
      alert('ERROR! ' + err);
    }
  } else {
    alert('MetaMask is not installed!');
  }
}

The problem I encounter is that the form goes ahead with the submission without the hash. The transaction does go through (with MetaMask prompts and all) but on my backend I get an error.
I read that I am supposed to preventDefault() but I am not sure how to apply it. Can someone guide me on how to do this? Plain JavaScript would be the most ideal as I am trying to reduce dependencies on external libraries.

Edit1: I tried preventDefault at the beginning but I don't even see any alerts.
Edit2: Added the fields that were missing in my question

A: Well I'd go with:

*

*Removing onSubmit="processStep1()" and replacing it with javascript: document.getElementById('formConfirm').onsubmit = processStep1;. Note the lack of () here! EDIT: as someone already pointed out, removing () in onSubmit="processStep1()" should also do the trick

*Then, your function gets an event as parameter, co you can do async function processStep1(event) { ... }

*Now the last thing is to call event.preventDefault() somewhere at the beginning. Remember that you are preventing default action, so you are not submitting the form - you probably want to use fetch() to submit the form manually.

Other than that you can replace input type="submit" with a custom button with your function on click, so you don't have to call event.preventDefault(). But imo no big difference.

A: Some errors:

*

*onSubmit takes a function and not a function call so it should be:

<form ... onSubmit="processStep1"> ...

*If you want to stop the form action you need to call the preventDefault method of the event, which stops the browser to contacting the form action at first place:

async function processStep1(event) {
   // I suggest as first row so you are sure
   // the form will stop before any other operation/error
   // made by this function
   event.preventDefault();
   ...

*You then need to call your backend with a XHR (XMLHttpRequest - MDN) because you stopped the normal call that your browser would have done (by preventing the default of the event):

function sendForm(form) {
   var formData = new FormData();
   var inputs = form.querySelectorAll('input');

   inputs.forEach(function(input) {
      var data;
      // simplified version for files (since it seems you don't need it)
      if (input.type === 'file') { data = input.files[0]; }
      else { data = input.value; }
      formData.append(input.name, data);
   });

   return new Promise(function(y, n) {
      var xhr= new XMLHttpRequest();
      xhr.onreadystatechange = function () {
          if (xhr.readyState === XMLHttpRequest.DONE) {
             if (status === 0 || (status >= 200 && status < 400)) {
                y(xhr.responseText);
          }
          else { n(xhr); }
      };
      xhr.open(form.method, form.action);
      xhr.send(formData);
   });
}

async function processStep1(event) {
   ...
   // at the end of your function
   try {
     var response = await sendForm(this);
     // threat response
   } catch(ex) {
     /// threat exceptions
   }
}

For more info on FormData Object (MDN) I suggest you to follow the link for a better reading.

A: Here. I just put the whole code.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <form id="formConfirm">
      <input id="textWalletAddress" name="walletAddress" type="text" />
      <input id="textEncodedFunctionCall" th:value="${encodedFunctionCall}" />
      <input type="text" id="textTxHash" readonly />
      <input type="submit" value="Submit" />
    </form>

    <script>
      const form = document.getElementById("formConfirm")

      async function processStep1(e) {
        // let efc = document.getElementById("textEncodedFunctionCall").value
        // let walletAddress = document.getElementById("textWalletAddress").value
        // const txParams = {
        //   to: CONTRACT,
        //   from: walletAddress,
        //   data: efc,
        // }

        // if (window.ethereum) {
        //   try {
        //     const txHash = await window.ethereum.request({
        //       method: "eth_sendTransaction",
        //       params: [txParams],
        //     })

        //     document.getElementById("textTxHash").value = txHash
        //     // how/where do I preventDefault()?
        //   } catch (err) {
        //     alert("ERROR! " + err)
        //   }
        // } else {
        //   alert("MetaMask is not installed!")
        // }
        document.getElementById("textTxHash").value = "HASH"
      }

      form.addEventListener("submit", async function (e) {
        e.preventDefault()

        await processStep1()
      })
    </script>
  </body>
</html>


text:
Q: Windows 7 Pinned taskbar items roaming profiles I am using roaming profiles on a Windows server 2003 domain. On my Windows 7 box in the office i have have multiple items pinned to the taskbar.  however when i boot up offline (say at home) i don't get my pinned items.   is there a way to make these available offline?

A: You would have to merge both your roaming and local profiles, to force them to update when making changes to the others.  You can do this via the users section of system -> control panel.  Or via system -> advanced system setting -> User Profiles.


text:
Q: Ubuntu 18.04 - GNOME Shell more than one window behaviour problem I installed Ubuntu 18.04 on two systems and it resulted in two different behaviours of the GNOME shell when one application has more than two Windows.
For example Firefox (wanted behaviour):
1 open Window + 2nd private window open. In the Ubuntu dock the Firefox Icon now has two dots. When clicking the Firefox Icon a little preview opens where i can choose which one to open.

For some reason this doesn't work on my second installation of Ubuntu 18.04 and I couldn't find any settings regarding this. When having two windows open and clicking the icon in the dock it automatically opens the recently used Window.
I really don't want to re-install from scratch because it took me a long time setting the system up and everything else is working perfectly fine.

A: Open Terminal and run the following command on your second installation
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'previews'

This would provide the little preview windows you're looking for.


text:
Q: issues with adding item to list in VB This is a homework assignment for Visual Basic (using Visual Studio 2013). This is my first question on this site (or any site).
I am trying to make a phone directory that utilizes lists. The directory should be able to search, add and delete contacts.
On my form, I have a list box that has names already entered through the collection property. I have a label that outputs the corresponding phone number. I have added 10 names and 10 phone numbers. (phone numbers were added with a list - at design time)
At run time, the user should be able to click the "add contact" button to add another contact to the list. I am using two input boxes; first prompts for the name to add and the second prompts for the phone number.
First contact that I try to add, seems to be working out just fine. My issue is when I try to add a second contact to the list, the phone number from the first add changes to reflect the same number that is being added for the second add. (looks like second contact phone number is overriding what I put for the first add) Just to be clear, when the program runs, I start out with 10 names in a list box and 10 numbers that can only be viewed if you click on the name in the list box. When I added the first one, it made the count 11 and then adding the second one, the count went to 12. The phone numbers are being added to a list (not list box).
I do not receive any error messages, just the information is not getting put into the list correctly (the list that is similar to an array).
Here is the code I have:
Let me know if I need to be more clear on what the issue is.
FYI: I just tested it again before submitting my question. I am just adding a name and a one digit number just to test it. When I enter first added contact, I used the number 5. Added second contact, I used the number 6. When I check at that point, the first contact showed a 6 and the second contact showed a 6. However, I tested doing 3 added contacts. Same number for the first add (5), same number for the second add (6) and used 7 for the third added contact. When I checked the results, first added contact changed to 7, second contact stayed at 6 and third contact shows 7. I have no idea what is going on??
Option Explicit On
Option Strict On

'=========== Class mainForm =================
Public Class mainForm

    Const MAX_SUBSCRIPT_Integer As Integer = 9

    Dim inputNameString As String                'user contact name input
    Dim inputPhoneString As String               'user phone number input

    Private phoneList As New List(Of String)

    '============== mainForm_Load ====================

    Private Sub mainForm_Load(ByVal sender As Object, _
         ByVal e As System.EventArgs) Handles Me.Load
        splashForm.ShowDialog()

        phoneList.Add("555 - 266 - 9563")
        phoneList.Add("555 - 266 - 5461")
        phoneList.Add("555 - 266 - 7412")
        phoneList.Add("555 - 266 - 5642")
        phoneList.Add("555 - 266 - 6721")
        phoneList.Add("555 - 266 - 1465")
        phoneList.Add("555 - 266 - 3541")
        phoneList.Add("555 - 266 - 2874")
        phoneList.Add("555 - 266 - 9114")
        phoneList.Add("555 - 266 - 2245")

    End Sub

    '======= namesListBox_SelectedIndexChanged() =====================
    Private Sub namesListBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles namesListBox.SelectedIndexChanged

        If namesListBox.SelectedIndex >= 0 Then
            phoneNumberLabel.Text = (phoneList(CInt(namesListBox.SelectedIndex.ToString())))
            Dim count As Integer
            contactPictureBox.Image = contactImageList.Images(namesListBox.SelectedIndex)
            count += 1

        End If

    End Sub

    '============== addButton_Click =====================

    Private Sub addButton_Click(sender As Object, e As EventArgs) Handles addButton.Click

        inputNameString = (InputBox("Enter name of Contact. Ex. Doctor: Dr. Sigmund Freud ", "Add Contact"))
        inputPhoneString = (InputBox("Enter contact phone number. Ex. 555-555-1212", "Add Contact Phone Number"))
        namesListBox.Items.Add(inputNameString.ToString())
        phoneList.Add(inputPhoneString.ToString())
        AddElementToPhoneString(inputPhoneString)

    End Sub

    '============== AddElementToPhoneString() ========================

    Public Sub AddElementToPhoneString(ByVal stringToAdd As String)

        phoneList(MAX_SUBSCRIPT_Integer + 1) = stringToAdd
        Dim countInteger As Integer
        countInteger = phoneList.Count()
        countLabel.Text = CStr(CInt(phoneList.Count))

    End Sub

End Class

A: Looks like there might be a few issues, but here's the one that's tripping you up right now:
phoneList(MAX_SUBSCRIPT_Integer + 1) = stringToAdd

You have MAX_SUBSCRIPT_Integer set as a constant, so you're always adding item 10 to the list, no matter how many items you've added.  You should be doing something like:
phoneList.add(stringToAdd)

That will ensure you're always adding a new item to the list, instead of overwriting the last item.

A: This is the fix to adding a contact issue: I removed AddElementToPhoneString completely. I thought it was doing something productive but it was actually causing the problem.
Option Explicit On
Option Strict On
'=========== Class mainForm =================
Public Class mainForm
Const MAX_SUBSCRIPT_Integer As Integer = 9

Dim inputNameString As String                'user contact name input
Dim inputPhoneString As String

Private phoneList As New List(Of String) 'user phone number input

'============== mainForm_Load ====================

Private Sub mainForm_Load(ByVal sender As Object, _
     ByVal e As System.EventArgs) Handles Me.Load
    splashForm.ShowDialog()

    phoneList.Add("555 - 266 - 9563")
    phoneList.Add("555 - 266 - 5461")
    phoneList.Add("555 - 266 - 7412")
    phoneList.Add("555 - 266 - 5642")
    phoneList.Add("555 - 266 - 6721")
    phoneList.Add("555 - 266 - 1465")
    phoneList.Add("555 - 266 - 3541")
    phoneList.Add("555 - 266 - 2874")
    phoneList.Add("555 - 266 - 9114")
    phoneList.Add("555 - 266 - 2245")

End Sub

'======= namesListBox_SelectedIndexChanged() ====================
Private Sub namesListBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles namesListBox.SelectedIndexChanged

    If namesListBox.SelectedIndex >= 0 Then
        phoneNumberLabel.Text = (phoneList(CInt(namesListBox.SelectedIndex.ToString())))
        Dim count As Integer
        contactPictureBox.Image = contactImageList.Images(namesListBox.SelectedIndex)
        count += 1

    End If

End Sub

'============== addButton_Click =====================

Private Sub addButton_Click(sender As Object, e As EventArgs) Handles addButton.Click

    inputNameString = (InputBox("Enter name of Contact. Ex. Doctor: Dr. Sigmund Freud ", "Add Contact"))
    inputPhoneString = (InputBox("Enter contact phone number. Ex. 555-555-1212", "Add Contact Phone Number"))
    namesListBox.Items.Add(inputNameString.ToString())
    phoneList.Add(inputPhoneString.ToString())

End Sub

End Class


text:
Q: Retina button not working in Apple Mail (iOS6 and iOS7) I was having an issue in Apple Mail where the retina image wouldn't resize. My code was:
@media only screen and (-webkit-min-device-pixel-ratio: 2) {
    .retina {
        background: url(image@2x.png) no-repeat center 24px !important;
        background-size: 40px 28px;
    }
}

I've updated the retina media queries and added !important declarations to background-size and the button displays fine. However, now the link on the button does not work in Apple Mail running iOS7.
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (-moz-min-device-pixel-ratio: 2),
only screen and (-o-min-device-pixel-ratio: 2/1),
only screen and (min-device-pixel-ratio: 2),
only screen and (min-resolution: 2dppx) {
    .retina {
        background: url(image@2x.png) no-repeat center 24px !important;
        background-size: 40px 28px !important;
    }
}

The button works as a link in all other mail clients, including Mail.app running OSX 10.8.5 when the window is made smaller to show the "mobile" version. Any solution to how I can get the button working as a link?


text:
Q: How are you supposed to get Lockpicking 99? Found this chest in Temperantia and at first I figured I could open it just because it was a fairly low level area compared to me. Then this happened. Like, seriously?
Or is this chest just not intended to be opened?

A: As luck would have it, this is actually related to a particular quest: Hero of the Nopon (from Boreas). No need for 99 lockpicking.

A: That chest is for Boreas' Blade Quest later in the game. You will have to have him and you will have to fill all four of his food boxes in the Argentum Warehouse first. There is a thieving Nopon that will open it for you. I think it's just not supposed to be opened until that quest.


text:
Q: MySql Insert Adapter easy INSERT QUERY for class I have create a MySql-Adapter to load MySql Data Into Gerneric Class.
(Easy create Class http://json2csharp.com/)
First property is the id - index of this.
But my Problem is, to create an Insert Command,
more precisely to fill the instance with values from Generic T:
public bool SqlInsertOrUpdate<T>(T insertObj, string table, bool updateOnDuplicateKey = true)
{
  try
  {
    using ( var connection = new MySql.Data.MySqlClient.MySqlConnection(connectionString) )
    using ( var command = connection.CreateCommand() )
    {
      command.CommandText = "INSERT INTO " + table;

      var properties = typeof(T).GetProperties();
      var instance = (T)Activator.CreateInstance(typeof(T));

      string commandCols = "";
      string commandValues = "";
      string commanDuplicateKey = "";

      for ( int i = 0; i < properties.Length; i++ )
        if ( properties[i] != null )
        {
          if ( i == 0 )
          {
            commandCols += "(";
            commandCols += properties[i].Name;
            commandValues += " VALUES (?";
            commandValues += "?" + properties[i].Name;
          }
          else if ( i != properties.Length )
          {
            commandCols += ",";
            commandCols += properties[i].Name; commandValues += ", ?";
            commandValues += properties[i].Name;
            commanDuplicateKey += properties[i].Name
                                + "=values(?" + properties[i].Name + "), ";
          }
          else if ( i == properties.Length )
          {
            commandCols += ")";
            commandValues += ")";
            commanDuplicateKey += properties[i].Name
                                + "=values(" + properties[i].GetValue(insertObj) + ")";
          }
          //Value of Generic T ? insert Objekt[0] (properties).insertObj[0] ?
          command.Parameters.AddWithValue("?" + properties[i].Name,
                                                properties[i].GetValue(insertObj));
        }
      command.CommandText += commandCols;
      command.CommandText += commandValues;
      if ( updateOnDuplicateKey )
      {
        command.CommandText += commanDuplicateKey;
      }
      connection.Open();
      command.ExecuteNonQuery();
      connection.Close();
    }
  }
  catch ( Exception ex )
  {
    return false;
  }
  return true;
}


text:
Q: Sql help to find username in a data set Data
     row  data
      1  (172.32.313.20:5892) User 'ant\john' requested
      2  User ant\john logged on from 172.31.13.2129
      3  user=ant\john domain=ant.amazon.com server=172.31.19.541 protocol=LDAPS result=0:Success

I need to pull the username (john) from this dataset .
select message,replace(TRIM(split_part(split_part(message, 'requested', 1), 'User ', 2)), 'ant\\', '') username1,
replace(TRIM(split_part(split_part(message, 'requested', 1), 'user=', 2)), 'ant\\', '')username2
from test_kemp_log.archive
where message like '%john%'

Is there a better way to extract User(user)  ant/  information from dataset?

A: The following could work in your case.
SELECT regexp_substr(data, 'ant\\\\'||'([a-z]+)', 1,1, 'e'), data From test_kemp_log.archive
WHERE message like '%john%';

'e' is for extracting the first group. In our case, it's the first thing that matches ([a-z]+) after "ant\".


text:
Q: Drawing a scattering Feynman diagram with TikZ I am trying to produce a scattering diagram with TikZ but I have become stuck.
The Desired Structure

I am trying to achieve this layout of lines, including their arrow directions. In my diagram.
Minimum Working Example
\documentclass[11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage{tikz}
\usetikzlibrary{trees}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

\begin{document}

\tikzset{
photon/.style={decorate, decoration={snake}, draw=red},
particle/.style={draw=blue, postaction={decorate},
    decoration={markings,mark=at position .5 with {\arrow[draw=blue]{>}}}},
antiparticle/.style={draw=blue, postaction={decorate},
    decoration={markings,mark=at position .5 with {\arrow[draw=blue]{<}}}},
gluon/.style={decorate, draw=black,
    decoration={coil,amplitude=4pt, segment length=5pt}}
 }

\begin{tikzpicture}[
    thick,
    % Set the overall layout of the tree
    level/.style={level distance=1.5cm},
    level 2/.style={sibling distance=3.5cm},
]
\coordinate
    child[grow=down]{
        edge from parent [antiparticle]
        child {
        node{$E$}
        edge from parent [particle]
        }
        child {
         node{$D$}
         edge from parent [gluon]
        }
        node [above=3pt] {$C$}
     }
    % I have to insert a dummy child to get the tree to grow
    % correctly to the right.
    child[grow=right, level distance=0pt] {
        child {
        node{$A$}
        edge from parent [gluon]
        }
        child {
        node{$B$}
        edge from parent [particle]
        }
    };
\end{tikzpicture}

\end{document}

Output

So far, I have the basic structure, except one of my lines is 'wandering'. The one that's labelled $A$ should be 'reflected' from where it is by 180 degrees.
Edit
Using @GonzaloMedina's approach, and with his helpful suggestion to the TikZ lirary, I found I can get the following diagram, which is very close to what I wanted:
\begin{document}
\tikzset{
particle/.style={thick,draw=blue, postaction={decorate},
    decoration={markings,mark=at position .5 with {\arrow[blue]{triangle 45}}}},
gluon/.style={decorate, draw=black,
    decoration={coil,aspect=0}}
 }
\tikzset{
particle/.style={thin,draw=blue, postaction={decorate},
decoration={markings,mark=at position .5 with {\arrow[blue]{stealth}}}},
gluon/.style={decorate, draw=black, decoration={snake=coil}}
}

\begin{tikzpicture}[node distance=1cm and 1.5cm]
\coordinate[label=left:$G$] (e1);
\coordinate[below right=of e1] (aux1);
\coordinate[above right=of aux1,label=right:$N$] (e2);
\coordinate[below=1.25cm of aux1] (aux2);
\coordinate[below left=of aux2,label=left:$N$] (e3);
\coordinate[below right=of aux2,label=right:$G$] (e4);

\draw[gluon] (e1) -- (aux1);
\draw[particle] (aux1) -- (e2);
\draw[particle] (e3) -- (aux2);
\draw[gluon] (aux2) -- (e4);
\draw[particle] (aux2) -- node[label=right:$N$] {} (aux1);
\end{tikzpicture}
\end{document}

I looked in the TikZ manual (on page 95) and found how to make a coil (like a spring), but it didn't seem to work.

A: These diagrams are very easy to produce with the new tikz-feynman package (see also the project page), based on this answer.  The only requirement for using automatic positioning of the vertices is to compile the document with lualatex:
\documentclass[tikz]{standalone}
\usepackage[compat=1.1.0]{tikz-feynman}
\begin{document}
\feynmandiagram [vertical=b to a] {
  i1 [particle=\(\textup{e}^{-}\)] -- [fermion] a -- [fermion] i2 [particle=\(\textup{e}^{-}\)],
  a -- [photon,edge label'=\(\gamma\)] b,
  f1 [particle=\(\textup{e}^{-}\)] -- [fermion] b -- [fermion] f2 [particle=\(\textup{e}^{-}\)],
};

\tikzfeynmanset{
  every fermion={draw=blue},
}
\feynmandiagram [vertical=b to a] {
  i1 [particle=\(N\)] -- [fermion] a,
  i2 [particle=\(G\)] -- [photon] a,
  a  -- [fermion,edge label'=\(N\)] b,
  b  -- [photon] f1 [particle=\(G\)],
  b  -- [fermion] f2 [particle=\(N\)],
};
\end{document}

A: Here is my take on this. I think it produces beautiful output and doesn't require running any special programs like feynmp. Drawback: you have to put in the nodes manually, but that's very managable imho. Bonus: it retains full flexibility for using any kind of tikz decorations and so on while at the same time making it easy to use due to the tree approach.
\documentclass{standalone}

\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{trees}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

\begin{document}

% Define styles for the different kind of edges in a Feynman diagram
\tikzset{
    gageboson/.style={decorate,decoration={snake},draw=tud9a},
    electronin/.style={draw=tud1a,postaction={decorate},decoration={markings,mark=at position .55 with {\arrow[draw=tud1a]{<}}}},
    electronout/.style={draw=tud1a,postaction={decorate},decoration={markings,mark=at position .55 with {\arrow[draw=tud1a]{>}}}},
    gluon/.style={decorate,draw=magenta,decoration={coil,amplitude=4pt,segment length=5pt}}
}

\begin{tikzpicture}[thick,
        % Set the overall layout of the tree
        level/.style={level distance=1.2cm},
        level 2/.style={sibling distance=2.6cm},
        level 3/.style={sibling distance=2cm}
    ]
    \coordinate
        child[grow=up]{
            child {
                node {$k^{'}_{1}$}
                edge from parent [electronout]
            }
            child {
                node {$k_1$}
                edge from parent [electronin]
            }
            edge from parent [gageboson] node [right=3pt] {$q$}
        }
        child[grow=down,level distance=0pt]{
            child {
                node {$k_{2}$}
                edge from parent [electronin]
            }
            child {
                node {$k^{'}_2$}
                edge from parent [electronout]
            }
        };
    \fill[black] (0,0) circle (.05cm);
    \fill[black] (0,1.2cm) circle (.05cm);
\end{tikzpicture}

\end{document}

Yields:

However, when you look closely, the wriggly line of the phonon is not perfect. Anybody know how to get rid of that linear part?
In the particular case asked above, the code would be:
\documentclass{standalone}

\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{trees}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

\begin{document}

% Define styles for the different kind of edges in a Feynman diagram
\tikzset{
    gageboson/.style={decorate,decoration={snake},draw=black},
    electronin/.style={draw=tud1a,postaction={decorate},decoration={markings,mark=at position .55 with {\arrow[draw=red]{<}}}},
    electronout/.style={draw=tud1a,postaction={decorate},decoration={markings,mark=at position .55 with {\arrow[draw=red]{>}}}},
    gluon/.style={decorate,draw=magenta,decoration={coil,amplitude=4pt,segment length=5pt}}
}

\begin{tikzpicture}[
        thick,
        % Set the overall layout of the tree
        level/.style={level distance=1.5cm},
        level 2/.style={sibling distance=2.6cm},
        level 3/.style={sibling distance=2cm}
    ]
    \coordinate
        child[grow=up]{
            child {
                node {$N$}
                edge from parent [electronout]
            }
            child {
                node {$G$}
                edge from parent [gageboson]
            }
            edge from parent [electronout] node [right=3pt] {$N$}
        }
        child[grow=down,level distance=0pt]{
            child {
                node {$N$}
                edge from parent [electronin]
            }
            child {
                node {$G$}
                edge from parent [gageboson]
            }
        };
    \fill[black] (0,0) circle (.05cm);
    \fill[black] (0,1.5cm) circle (.05cm);
\end{tikzpicture}

\end{document}

and results in this

A: One possibility: instead of a tree, I just used some coordinates and decorated paths; I used the triangle 45 arrow tip from the arrows library, changed the gluon style to use decoration={coil,aspect=0}, and suppressed parts of the original code not relevant here:
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

\begin{document}

\tikzset{
particle/.style={thick,draw=blue, postaction={decorate},
    decoration={markings,mark=at position .5 with {\arrow[blue]{triangle 45}}}},
gluon/.style={decorate, draw=black,
    decoration={coil,aspect=0}}
 }

\begin{tikzpicture}[node distance=1cm and 1.5cm]
\coordinate[label=left:$e^{-}$] (e1);
\coordinate[below right=of e1] (aux1);
\coordinate[above right=of aux1,label=right:$e^{-}$] (e2);
\coordinate[below=1.25cm of aux1] (aux2);
\coordinate[below left=of aux2,label=left:$e^{-}$] (e3);
\coordinate[below right=of aux2,label=right:$e^{-}$] (e4);

\draw[particle] (e1) -- (aux1);
\draw[particle] (aux1) -- (e2);
\draw[particle] (e3) -- (aux2);
\draw[particle] (aux2) -- (e4);
\draw[gluon] (aux1) -- node[label=right:$\gamma$] {} (aux2);
\end{tikzpicture}
\end{document}

After an edit to the question, here's some new code with the required coil decoration:
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}

\begin{document}
\tikzset{
particle/.style={thick,draw=blue, postaction={decorate},
    decoration={markings,mark=at position .5 with {\arrow[blue]{triangle 45}}}},
gluon/.style={decorate, draw=black,
    decoration={coil,aspect=0.3,segment length=3pt,amplitude=3pt}}
 }

\begin{tikzpicture}[node distance=1cm and 1.5cm]
\coordinate[label=left:$G$] (e1);
\coordinate[below right=of e1] (aux1);
\coordinate[above right=of aux1,label=right:$N$] (e2);
\coordinate[below=1.25cm of aux1] (aux2);
\coordinate[below left=of aux2,label=left:$N$] (e3);
\coordinate[below right=of aux2,label=right:$G$] (e4);

\draw[gluon] (e1) -- (aux1);
\draw[particle] (aux1) -- (e2);
\draw[particle] (e3) -- (aux2);
\draw[gluon] (aux2) -- (e4);
\draw[particle] (aux2) -- node[label=right:$N$] {} (aux1);
\end{tikzpicture}
\end{document}

A: You can also use the feynMP package to create Feynman diagrams. It uses metapost instead of tikz, but provides a nice interface for creating different types of Feynman diagrams. For example:
\documentclass{article}
\usepackage{feynmp}
\DeclareGraphicsRule{*}{mps}{*}{}

\begin{document}
\unitlength = 1mm
\begin{fmffile}{gluon}
\begin{fmfgraph*}(40,30)
  \fmfleft{i1,i2}
  \fmflabel{$e^{-}$}{i1}
  \fmflabel{$e^{-}$}{i2}
  \fmfright{o1,o2}
  \fmflabel{$e^{-}$}{o1}
  \fmflabel{$e^{-}$}{o2}
  \fmf{fermion, fore=blue}{i1,v1,o1}
  \fmf{fermion, fore=blue}{i2,v2,o2}
  \fmf{photon,label=$\gamma$}{v1,v2}
  \fmfdot{v1,v2}
\end{fmfgraph*}
\end{fmffile}
\write18{mpost gluon}
\end{document}

Run this twice with pdflatex --shell-escape filename, and you will get


text:
Q: Can't find FinishMonsterBuffer() method I created a table following the flatbuffers tutorial and compiled it to C++ code. Say, its name is Doc.
In the tutorial, it is said:

Regardless of whether you used CreateMonster or MonsterBuilder, you
  now have an offset to the root of your data, and you can finish the
  buffer using:
FinishMonsterBuffer(fbb, mloc);

However, I can't find any method named FinishDocBuffer. The generated Doc class only has one method named Verify() in addition to getters. The generated DocBuilder class only has one method named Finish(). And there's only one function named CreateDoc() defined outside of those two classes.
Did I do something wrong, or should the official doc be updated?
FYI, I'm using latest flatbuffers code cloned from the git repo.
Update:
I found the example code didn't call any Finish*Buffer() method either.

A: Found the reason. I need to add this line to my doc.fbs file:

root_type Doc;


text:
Q: Stop scanning XML file after first match found with Twig handler I have been using the perl module XML::Twig for a while now. I use the module to load entire XML files into memory before scanning them and also twig handlers. I have a verge large XML file (usually 100s of Megabytes in size) stored in a zip archive. The file in question contains a single tag that I need to find. I use Twig handlers to find the tag and extract one of its attributes. The tag resides at the top of the XML file.
The problem I have is that the time to find the tag and its associated attribute value can take a few minutes. This is because the handler scans the entire file. Is there a way to stop the handler after the match has been found (will always only be one) and not have to continue scanning the file? Here is the code I use:
use strict;
use warnings;
use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
use XML::Twig;
use Data::Dumper;
my $File_To_Analyse='ZipFile1.zip';
my $start_Z=time;
my $zip = Archive::Zip->new();
$zip->read($File_To_Analyse);
my $XML_File = $zip->contents('XML_File.xml');
my $duration_Z = time - $start_Z;
my $duration_Split_Z=CalcTimeHMS($duration_Z);
print "Total Time for ZIP part:" . $duration_Split_Z . "\n";
#
#
#
#
my @Data=(-1);
my $start_T=time;
my $t1= XML::Twig->new(twig_roots =>
                      {'tagToLookFor' =>
                       sub {Get_Tag_Info(@_,\@Data);}})->parse($XML_File);
#
my $duration_T = time - $start_T;
my $duration_Split_T=CalcTimeHMS($duration_T);
print "Total Time for TWIG part:" . $duration_Split_T . "\n";
print Dumper \@Data;
#
#
#
sub Get_Tag_Info{
    my( $t, $elt, $Data)= @_;
    my $Accession = $elt->att('attname');
    if(defined $Accession){
        print "Res:" . $Accession . "\n";
        $Data[0]=$Accession;
    }
    $elt->purge;
}

I put the timings in to see that loading the zipfile part was not taking too long. This takes a couple of seconds on my system. the "Res" print statement follows a couple of seconds afterwards and then the program terminates after a further 2 minutes. This tells me that the majority of the time is taken to scan the file after I have found my match. Can I stop this?


text:
Q: Earth connection through resonant inductive coupling with Schumann resonances possible? I have been playing around with Tesla coils for a while now, but one limiting factor for portability is the fact that it requires an earth connection on the secondary coil.
Since a Tesla coil works with resonant inductive coupling, I was wondering if it would be theoretically possible to wirelessly couple the secondary coil to the earth by letting it resonate with one of the Schumann resonances present in the earth, achieving the same result as you would when you connect it via a wire to the earth.
Thanks!


text:
Q: Do not allow more than 4 same values in a JS stack So I have here a JavaScript stack built after this function:
function Stack()    //Creating Stack Object
    {
    // Create an empty array of cards.
    this.cards = new Array();  //cards array inside stack object
    this.push  = pushdata;      //Call pushdata function on push operation
    this.pop   = popdata;        //Call popdata function on pop operation
    this.printStack = showStackData; //Call showStackData function on printstack operation

    this.populate = function populate() {

            this.push(rand());
            this.push(rand());
            this.push(rand());
            this.push(rand());
        }
    }

(Where rand() is just a function generating a random number between 0 and 10 - I hope the syntax is alright because I had to delete a lot of commented out functions to make it suitable for this post).
So what I am wanting to achieve is to not allow than 4 same values in this Stack/Array.
I figured out I could check each number generated by rand() before it is pushed onto the Stack and add 1 to a counter variable and add a condition to not add this number when its counter already is on four.
But this would mean a new variable for every possible number that may be pushed onto the stack what seems to be a really unnecessary overkill to me and I think you can understand that this is not the most elegant solution.
So how would you approach this?
Thanks a lot in advance!

A: Instead of
this.push(rand());

Check if the value has already been in the array four times
var randNum = rand();
var count = 0;
for(var i = 0; i < this.length; i++){
  if(this[i] === randNum) count++;
}
if(count <= 4) this.push(randNum);


text:
Q: Do I need to drop database before doing SP-remove? I'm currently testing doing some stuff on a site collection with a console app. I'd like to redo the test by deleting and then restoring the site collection, but I'm not sure if I need to delete something in Sql before? Any best practice tips?

A: Do not remove the site collection from the database! Just remove it via the GUI (Site settings -> Delete site) or use the PowerShell cmdlet Remove-SPSite (outlined here). This will make sure it is deleted the right way


text:
Q: Troubles setting up BottomNavigationView + Navigation Componenent I'm converting my app to use  one activity and added the BottomnavigationView, and in an effort to prevent fragments being recreated, making unecessary api calls, when navigating between fragments. However I can't make it work:

*

*No fragment is shown

*Icons are not swithed

*Touching bottom menu items doesn't switch fragments

*Touching the selected item crashes the app with a TypeCastException:  kotlin.TypeCastException: null cannot be cast to non-null type androidx.navigation.fragment.NavHostFragment at com.example.testapp.NavigationExtensionsKt$setupItemReselected$1.onNavigationItemReselected
Activity's layout:
<androidx.fragment.app.FragmentContainerView
        android:id="@+id/nav_host_container"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@+id/nav_view"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/nav_view"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginEnd="0dp"
        android:layout_marginStart="0dp"
        app:menu="@menu/bottom_nav_menu" />

BottomNav menu:
<menu xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:id="@+id/navigation_1"
        android:icon="@drawable/ic_1"
        android:title="@string/title_1" />

    <item
        android:id="@+id/homeFragment"
        android:icon="@drawable/ic_2"
        android:title="@string/home" />

    <item
        android:id="@+id/navigation_3"
        android:icon="@drawable/ic_3"
        android:title="@string/title_3" />
</menu>

In the MainActivity:
    class MainActivity : DaggerAppCompatActivity() {

    private var currentNavController: LiveData<NavController>? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        nav_view.itemIconTintList = null

        if(savedInstanceState == null){
            setupBottomNavigationBar()
        } // Else, need to wait for onRestoreInstanceState

    }

    override fun onRestoreInstanceState(savedInstanceState: Bundle) {
        super.onRestoreInstanceState(savedInstanceState)
        // Now that BottomNavigationBar has restored its instance state
        // and its selectedItemId, we can proceed with setting up the
        // BottomNavigationBar with Navigation
        setupBottomNavigationBar()
    }

    private fun setupBottomNavigationBar() {
        val bottomNavigationView = findViewById<BottomNavigationView>(R.id.nav_view)

        val navGraphIds = listOf(R.navigation.mobile_navigation, R.navigation.settings)
        val menuItemsIds = listOf(R.id.navigation_1, R.id.homeFragment, R.id.navigation_3)
        val defaultIconsIds = listOf(R.drawable.ic_1,  R.drawable.ic_2, R.drawable.ic_3)
        val selectedIconsIds = listOf(R.drawable.ic_1a, R.drawable.ic_2a, R.drawable.ic_3a)

        // Setup the bottom navigation view with a list of navigation graphs (custom extension)
        val controller = bottomNavigationView.setupWithNavController(
            navGraphIds = navGraphIds,
            menuItemsIds = menuItemsIds,
            defaultIconsIds = defaultIconsIds,
            selectedIconsIds = selectedIconsIds,
            fragmentManager = supportFragmentManager,
            containerId = R.id.nav_host_container,
            intent = intent
        )

        currentNavController = controller

        // updating icons
        nav_view.menu.iterator().forEach {
            if (it.isChecked) {
                it.setIcon(selectedIconsIds[menuItemsIds.indexOf(it.itemId)])
            } else {
                it.setIcon(defaultIconsIds[menuItemsIds.indexOf(it.itemId)])
            }
        }
    }

    override fun onSupportNavigateUp(): Boolean {
        return currentNavController?.value?.navigateUp() ?: false
    }
}

NavigationExtensions:
   //.....
    //....

    private fun BottomNavigationView.setupItemReselected(
    menuItemsIds: List<Int>,
    defaultIconsIds: List<Int>,
    selectedIconsIds: List<Int>,
    graphIdToTagMap: SparseArray<String>,
    fragmentManager: FragmentManager) {
    setOnNavigationItemReselectedListener { item ->

        this.menu.iterator().forEach { it ->
            it.setIcon(defaultIconsIds[menuItemsIds.indexOf(it.itemId)])
        }

        item.setIcon(selectedIconsIds[menuItemsIds.indexOf(item.itemId)])

        val newlySelectedItemTag = graphIdToTagMap[item.itemId]
        val selectedFragment = fragmentManager.findFragmentByTag(newlySelectedItemTag) as NavHostFragment //TypeCastException happens here
        val navController = selectedFragment.navController
        // Pop the back stack to the start destination of the current navController graph
        navController.popBackStack(
            navController.graph.startDestination, false
        )
    }
}

The screen is blank without any fragment view rendered.
Anyone can help me fix this? Am I missing something?
PS: The code is taken from an open source app that can be found here
[Edit] Adding NavGraph:

*

*mobile_navigation

<fragment
    android:id="@+id/homeFragment"
    android:name="com.example.testapp.homeFragment"
    android:label="@string/home"
    tools:layout="@layout/home_fragment" >

    <action
        android:id="@+id/homrFragment_to_detailsFragment"
        app:launchSingleTop="true"
        app:enterAnim="@anim/fragment_open_enter"
        app:exitAnim="@anim/fragment_open_exit"
        app:destination="@id/detailsFragment" />
</fragment>

<fragment
    android:id="@+id/navigation_1"
    android:name="com.example.testapp.Fragment_S"
    android:label="@string/fragment_s"
    tools:layout="@layout/fragment_s" >
    <action
       android:id="@+id/action_navigation_1_to_detailsFragment"
        app:destination="@id/detailsFragment"
        app:enterAnim="@anim/slide_in_right"
        app:exitAnim="@anim/slide_in_left" />
</fragment>

<fragment
    android:id="@+id/navigation_3"
    android:name="com.example.testapp.Fragment3"
    android:label="@string/fragment_ss"
    tools:layout="@layout/fragment_ss" />

<dialog
    android:id="@+id/detailsFragment"
    android:name="com.example.testapp.DetailsFragment"
    android:label="InDetails"
    tools:layout="@layout/layout_details">

    <argument
        android:name="arg1"
        android:defaultValue=""
        app:argType="string"/>

    <argument
        android:name="arg2"
        android:defaultValue=""
        app:argType="string" />
</dialog>

*Navigation Settings:
 <?xml version="1.0" encoding="utf-8"?>

A: Setting up a BottomNavigationView may be a little tricky to setup with Navigation Components, but I think the code you are following as example is a little over engineered and/or serves purposes way more complex than those of an initial code.
I'd have asked in a comment (don't have enough rep), but can you post the NavGraph as well? Setting up the Navigation Controller is extremely easy once you have the NavGraph, the menu and the layout properly set, but all these must be meticulously synced and the documentation in this area is not really that good.
Until you reply with the navgraph, I'll try to help with the solution:
First, change your
<androidx.fragment.app.FragmentContainerView

to
<fragment

but add the following tags
        android:name="androidx.navigation.fragment.NavHostFragment"
        app:navGraph="@navigation/your_nav_graph.xml"

then, make sure the id's on your menu.xml match the same id for the destination you want, as described in your Nav Graph, for example, you should have 3 destinations called
android:id="@+id/navigation_1"

android:id="@+id/homeFragment"

android:id="@+id/navigation_3"

You won't need to setup any actions.
After that, just execute this in the activity with the BottomNavigationView:
NavigationUI.setupWithNavController(your_bottom_navigation_view, findNavController(R.id.your_navigation_fragment))

Navigation should work properly after this, without the need to setup everything  on that "setupBottomNavigationView()" method, or the navigation extensions you also posted.
This way, navigation handles everything, from backtstack, to highlighting the proper button on the BottomNavigationView.


text:
Q: Why does this golang pointer address not change when replaced in goroutine? It's my understanding that when I create an object with the foo := &bar{} I'm allocating new memory for that object. Why then, when I attempt to replace *foo in a goroutine does it not get a new pointer address?
package main

import (
    "fmt"
    "math/rand"
    "sync"
    "time"
)

type pointerToObjects struct {
    objs *objects
}
type objects struct {
    sliceOfObject []*object
}
type object struct {
    number  int
    boolean bool
}

func main() {
    p := &pointerToObjects{objs: newObjects()}
    mu := &sync.Mutex{}

    for _, o := range p.objs.sliceOfObject {
        o.setBool(true)
    }
    // goroutine 1
    go func() {
        ticker := time.NewTicker(time.Second)
        defer ticker.Stop()
        for range ticker.C {
            mu.Lock()
            fmt.Printf("objects pointer: %v\n", &p.objs)
            for i, o := range p.objs.sliceOfObject {
                fmt.Printf("i: %d p: %v n: %d b: %t\n", i, &o, o.number, o.boolean)
            }
            fmt.Print("---\n")
            mu.Unlock()
        }
    }()
    // goroutine 2
    go func() {
        ticker := time.NewTicker(time.Second * 2)
        defer ticker.Stop()
        for range ticker.C {
            newObjects := &objects{sliceOfObject: newSliceOfObject()}
            mu.Lock()
            p.objs = newObjects
            mu.Unlock()
            fmt.Printf("replaced: %v <-- %v \n", &p.objs, &newObjects)
        }
    }()

    // let the goroutines run for 10 seconds
    time.Sleep(time.Second * 10)
}
func newObjects() *objects {
    objs := &objects{}
    objs.sliceOfObject = newSliceOfObject()
    return objs
}

func newSliceOfObject() []*object {
    var sliceObjs []*object
    for i := 0; i < 3; i++ {
        sliceObjs = append(sliceObjs, newObject())
    }
    return sliceObjs
}
func newObject() *object {
    return &object{number: rand.Int()}
}

func (obj *object) setBool(b bool) {
    obj.boolean = b
}

playground link
actual:
objects pointer: 0xc00000e030
i: 0 p: 0xc00009a010 n: 5577006791947779410 b: true
i: 1 p: 0xc00009a010 n: 8674665223082153551 b: true
i: 2 p: 0xc00009a010 n: 6129484611666145821 b: true
---
replaced: 0xc00000e030 <-- 0xc00000e040
objects pointer: 0xc00000e030
i: 0 p: 0xc00000e050 n: 4037200794235010051 b: false
i: 1 p: 0xc00000e050 n: 3916589616287113937 b: false
i: 2 p: 0xc00000e050 n: 6334824724549167320 b: false

expected:
objects pointer: 0xc00000e030
i: 0 p: 0xc00009a010 n: 5577006791947779410 b: true
i: 1 p: 0xc00009a010 n: 8674665223082153551 b: true
i: 2 p: 0xc00009a010 n: 6129484611666145821 b: true
---
replaced: 0xc00000e030 <-- 0xc00000e040
objects pointer: 0xc00000e040
i: 0 p: 0xc00000e050 n: 4037200794235010051 b: false
i: 1 p: 0xc00000e050 n: 3916589616287113937 b: false
i: 2 p: 0xc00000e050 n: 6334824724549167320 b: false

when run, the values update as I would expect, but the pointer in p to objects remains unchanged. I would expect it to be updated when I call *p.objs = *newObjects
is this a trick of the compiler? How can I get "objects pointer" to update to the new location? do I need to use more explicit pointers to pointers?
EDIT: fixed race condition and tried to assigned with p.objs = newObjects without success.

A: With the exception of the printed output, the program works as you expect.
To print the value of a variable, use the variable in the fmt.Printf argument list. Do not pass the address of the variable.  The value of a variable and the address of a variable are different things.
To best view pointers, print pointers with the %p verb instead of %v.
Here's one example. Change
        fmt.Printf("replaced: %v <-- %v \n", &p.objs, &newObjects)

to
        fmt.Printf("replaced: %p <-- %p \n", p.objs, newObjects)

The issue unrelated to the use of goroutines as mentioned in the title.


text:
Q: Como devolver un único valor usando Ajax para mostrar un mensaje de alerta estoy tratando de implementar un buscador. Es decir en base a un valor que se ingresa en un campo de texto necesito devolver un mensaje de alerta indicando si dicho valor se encuentra o no en la base de datos mostrando un mensaje de alerta. Para ello estoy realizando lo siguiente.

var sugestion = false;

function validarAutosugestion(event, input) {
  var cod = event.which;
  if (cod == null) cod = event.keyCode;
  if ((cod == 8) || (cod >= 48 && cod <= 57) || (cod >= 96 && cod <= 105)) {
    if ((cod == 8) || (cod >= 48 && cod <= 57) || (cod >= 96 && cod <= 105)) sugestion = true;
    return true;
  } else return false;
}

function activarAutosugestion(input) {
  if (sugestion) {
    sugestion = false;
    $("#imagen").empty();
    busquedaPaciente(input.value);
  }
}

function busquedaPaciente(texto) {
  if (texto.length == 0) {
    return false;
  }
  $.ajax({
      "url": "lib/gestion/historia_clinica/procesar_busqueda_paciente.php",
      "type": "post",
      "dataType": "json",
      "data": {
        "clave": texto
      }
    }).done(function(data, statusText) {
      for (var i = 0; i < data.valor.length; i++) {
        if (data.valor[i].resultado == 1) {
         alert('El paciente cuenta con una historia clinica.');
        }
        alert('El paciente no tiene con una historia clinica.');
      }
    })
    .fail(function(data, statusText) {
      alert(statusText);
    });
}

  <input id="textCampoBuscar" type="text" class="form-control" onkeyup="activarAutosugestion(this)" onkeypress="return validarAutosugestion(event,this)" placeholder="Ingrese el dni del paciente" maxlength="8" autofocus/>

Codigo PHP
<?php
   $clave = filter_input(INPUT_POST,"clave");
   //echo $clave;
   require_once '../../../files/clases/Conexion.php';
   $respuesta = '{"valor":[]}';
   $conexion = Conexion::establecer();
   if(!$conexion->connect_error){
       $sql = "SELECT IF(COUNT(id_historia_clinica) > 0,1, 0) as resultado FROM Historia_Clinica_Paciente WHERE paciente_id = ( SELECT id_paciente FROM Paciente WHERE dni = '".$clave."%'";
       if($resultado = $conexion->query($sql)){
           $respuesta = '{"valor":'.json_encode($resultado->fetch_all(MYSQLI_ASSOC)).'}';

           $resultado->free_result();
           }
       else echo $conexion->error;
       $conexion->close();
   }

   echo $respuesta;

?>

Como debería ser la comunicación con la base de datos usando ajax? Dado que me esta devolviendo un "parsererror".
Lo que estaría necesitando es devolver un valor y luego analizarlo desde JavaScript y no recorrer un objeto json. Esto es posible?
Muchas gracias

A: podrias probar a hacer lo siguiente en la petición :
function busquedaPaciente(texto) {
  if (texto.length == 0) {
    return false;
  }
  $.ajax({
      "url": "lib/gestion/historia_clinica/procesar_busqueda_paciente.php",
      "type": "post",
      "dataType": "json",
      "data": {
        "clave": texto
      }
    }).done(function(data, statusText) {
       //verifica de la presencia de datos al interno de la respuesta
       if (!$.isEmptyObject(data.valor)) {
          for (var i = 0; i < data.valor.length; i++) {
              if (data.valor[i].resultado == 1) {
                  alert('El paciente cuenta con una historia clinica.');
              }else
                  alert('El paciente no tiene con una historia clinica.');
          }
       }else
          alert ("El paciente buscado no esta presente en nuestro database");
    })
    .fail(function(data, statusText) {
      alert(statusText);
    });
}

en este modo gracias a $.isEmptyObject() controlamos si el valor restituido esta vacio,en este caso con la negacion ! comprabamos si tiene contenido. Si esta ultima condición se cumple entramos a ver si el paciente buscado tiene un historial o menos, en caso contrario comunicamos que el paciente buscado no esta al interno del database.
espero que te sea de ayuda! exitos


text:
Q: Probable jar conflict/missing causes BeanCreationException in Fosstrak I have imported a Java project (Fosstrak fc-server 1.2.0) in eclipse kepler for Java EE developers using Maven. It is a web project that I deployed in Tomcat7 using JRE 7. My notebook is a Macbook Pro running MacOSX 10.7.5. The project uses Spring 3.0.7
I get an exception during Tomcat startup. The exception trace is the following:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aleApplicationContext' defined in file [/Applications/apache-tomcat-7.0.47/webapps/fc-server/WEB-INF/classes/org/fosstrak/ale/server/ALEApplicationContext.class]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: caught exception during setup of the critical components.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:529)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.IllegalStateException: caught exception during setup of the critical components.
    at org.fosstrak.ale.server.ALEApplicationContext.initializeApplication(ALEApplicationContext.java:84)
    at org.fosstrak.ale.server.ALEApplicationContext.setServletContext(ALEApplicationContext.java:69)
    at org.springframework.web.context.support.ServletContextAwareProcessor.postProcessBeforeInitialization(ServletContextAwareProcessor.java:75)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:396)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1505)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
    ... 21 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'logicalReaderManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.fosstrak.ale.server.ALE org.fosstrak.ale.server.readers.impl.LogicalReaderManagerImpl.ale; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ale': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.fosstrak.ale.server.impl.ALEImpl.setAleSettings(org.fosstrak.ale.server.ALESettings); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aleSettings': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.fosstrak.ale.server.ALESettings.vendorVersion; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'project.version' in string value "${project.version}"
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:272)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1125)
    at org.fosstrak.ale.server.ALEApplicationContext.getBean(ALEApplicationContext.java:118)
    at org.fosstrak.ale.server.ALEApplicationContext.initializeApplication(ALEApplicationContext.java:75)
    ... 26 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.fosstrak.ale.server.ALE org.fosstrak.ale.server.readers.impl.LogicalReaderManagerImpl.ale; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ale': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.fosstrak.ale.server.impl.ALEImpl.setAleSettings(org.fosstrak.ale.server.ALESettings); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aleSettings': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.fosstrak.ale.server.ALESettings.vendorVersion; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'project.version' in string value "${project.version}"
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
    ... 37 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ale': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.fosstrak.ale.server.impl.ALEImpl.setAleSettings(org.fosstrak.ale.server.ALESettings); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aleSettings': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.fosstrak.ale.server.ALESettings.vendorVersion; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'project.version' in string value "${project.version}"
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)
    ... 39 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.fosstrak.ale.server.impl.ALEImpl.setAleSettings(org.fosstrak.ale.server.ALESettings); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aleSettings': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.fosstrak.ale.server.ALESettings.vendorVersion; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'project.version' in string value "${project.version}"
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:604)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
    ... 50 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aleSettings': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.fosstrak.ale.server.ALESettings.vendorVersion; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'project.version' in string value "${project.version}"
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
    ... 52 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.fosstrak.ale.server.ALESettings.vendorVersion; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'project.version' in string value "${project.version}"
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
    ... 63 more
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'project.version' in string value "${project.version}"
    at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:173)
    at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:161)
    at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125)
    at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:255)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:767)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:780)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)
    ... 65 more

I think the issue is related to some missing dependencies or jar conflicts (because other guys can successfully run the project). This is the list of the included libraries:
activation-1.1.jar
comm-2.0.3.jar
jaxb-api-2.0.jar
jsr173_api-1.0.jar
mail-1.4.jar
servlet-api-2.5.jar
ant-1.7.0.jar
ant-launcher-1.7.0.jar
ant-optional-1.5.1.jar
antlr-2.7.6.jar
aopalliance-1.0.jar
asm-3.3.1.jar
axiom-api-1.2.7.jar
axiom-dom-1.2.7.jar
axiom-impl-1.2.7.jar
axis2-jws-api-1.4.1.jar
castor-0.9.9.1.jar
cglib-nodep-2.2.2.jar
cloning-1.8.2.jar
commons-beanutils-1.7.0.jar
commons-beanutils-core-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.2.jar
commons-configuration-1.4.jar
commons-digester-1.8.jar
commons-io-1.4.jar
commons-jxpath-1.2.jar
commons-lang-2.3.jar
commons-logging-1.0.4.jar
commons-logging-api-1.0.4.jar
cxf-api-2.6.1.jar
cxf-rt-bindings-soap-2.6.1.jar
cxf-rt-bindings-xml-2.6.1.jar
cxf-rt-core-2.6.1.jar
cxf-rt-databinding-jaxb-2.6.1.jar
cxf-rt-frontend-jaxws-2.6.1.jar
cxf-rt-frontend-simple-2.6.1.jar
cxf-rt-transports-http-2.6.1.jar
cxf-rt-ws-addr-2.6.1.jar
cxf-rt-ws-policy-2.6.1.jar
derby-10.4.1.3.jar
easymock-3.1.jar
geronimo-activation_1.1_spec-1.0.1.jar
geronimo-javamail_1.4_spec-1.7.1.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
hal-commons-0.5.0.jar
hal-impl-feig-0.5.0.jar
hal-impl-impinj-0.5.0.jar
hal-impl-sim-0.5.0.jar
jaxb-impl-2.0.1.jar
jaxb-xjc-2.2.5.jar
jaxen-1.1.1.jar
jdom-1.0.jar
junit-4.8.1.jar
llrp-adaptor-1.2.1.jar
log4j-1.2.12.jar
ltkjava-1.0.0.7.jar
ltkjava-generator-1.0.0.7.jar
mina-core-1.1.7.jar
mysql-connector-java-5.1.6.jar
neethi-3.0.2.jar
objenesis-1.2.jar
postgresql-8.3-603.jdbc4.jar
reader-rp-proxy-0.5.0.jar
reader-rprm-core-0.5.0.jar
slf4j-api-1.5.0.jar
slf4j-log4j12-1.5.0.jar
snmp4j-1.7.6.jar
snmp4j-agent-1.0.1.jar
spring-aop-3.0.7.RELEASE.jar
spring-beans-3.0.7.RELEASE.jar
spring-context-3.0.7.RELEASE.jar
spring-core-3.0.7.RELEASE.jar
spring-expression-3.0.7.RELEASE.jar
spring-web-3.0.7.RELEASE.jar
stax2-api-3.1.1.jar
tdt-1.0.0.jar
woodstox-core-asl-4.1.2.jar
wsdl4j-1.6.2.jar
wstx-asl-3.2.4.jar
xalan-2.7.0.jar
xerces-1.2.3.jar
xercesImpl-2.9.1.jar
xml-apis-1.3.04.jar
xml-resolver-1.2.jarxmlschema-core-2.0.2.jar

Can you help me figure out the problem?
Thanks!
Roberto
UPDATE:
This is my applicationContext.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:p="http://www.springframework.org/schema/p"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:util="http://www.springframework.org/schema/util"
  xmlns:jaxws="http://cxf.apache.org/jaxws"
  xmlns:context="http://www.springframework.org/schema/context"
  xsi:schemaLocation="
      http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <context:annotation-config />
    <context:property-placeholder location="classpath*:ale.properties"/>
    <context:component-scan base-package="org.fosstrak.ale" />

    <jaxws:endpoint id="ALEService"
       implementor="org.fosstrak.ale.wsdl.ale.epcglobal.ALEServicePortTypeImpl"
       endpointName="e:ALEServicePortType"
       serviceName="s:ALEService"
       address="/ALEService"
       xmlns:e="http://service.jaxws.cxf.apache.org/endpoint"
       xmlns:s="http://service.jaxws.cxf.apache.org/service"/>

    <jaxws:endpoint id="ALELRService"
        implementor="org.fosstrak.ale.wsdl.alelr.epcglobal.ALELRServicePortTypeImpl"
        endpointName="e:ALELRServicePortType"
        serviceName="s:ALELRService"
        address="/ALELRService"
        xmlns:e="http://service.jaxws.cxf.apache.org/endpoint"
        xmlns:s="http://service.jaxws.cxf.apache.org/service"/>

    <jaxws:endpoint id="ALEController"
        implementor="org.fosstrak.ale.server.controller.ALEControllerImpl"
        endpointName="e:ALEControllerServicePortType"
        serviceName="s:ALEControllerService"
        address="/ALEControllerService"
        xmlns:e="http://service.jaxws.cxf.apache.org/endpoint"
        xmlns:s="http://service.jaxws.cxf.apache.org/service"/>

     <jaxws:endpoint id="LLRPController"
        implementor="org.fosstrak.ale.server.llrp.LLRPControllerImpl"
        endpointName="e:LLRPControllerServicePortType"
        serviceName="s:LLRPControllerService"
        address="/LLRPControllerService"
        xmlns:e="http://service.jaxws.cxf.apache.org/endpoint"
        xmlns:s="http://service.jaxws.cxf.apache.org/service"/>
 </beans>

This is the project's pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <!-- =========================================================== -->
  <!-- Basics                                                      -->
  <!-- =========================================================== -->

  <groupId>org.fosstrak.fc</groupId>
  <artifactId>fc-server</artifactId>
  <version>1.2.2-SNAPSHOT</version>
  <parent>
    <artifactId>fc</artifactId>
    <groupId>org.fosstrak.fc</groupId>
    <version>1.2.2-SNAPSHOT</version>
  </parent>
  <packaging>war</packaging>
  <modelVersion>4.0.0</modelVersion>
  <name>fc-server</name>
  <description>Filtering and Collection Middleware implementing the EPCglobal ALE spec</description>

  <developers>
     <developer>
        <id>1</id>
        <name>Benoit Plomion</name>
     </developer>
     <developer>
        <id>2</id>
        <name>Wafa Soubra</name>
     </developer>
     <developer>
        <id>3</id>
        <name>Samuel Wieland</name>
     </developer>
     <developer>
        <id>4</id>
        <name>Christian Floerkemeier </name>
     </developer>
  </developers>

  <!-- =========================================================== -->
  <!-- Infrastructure                                              -->
  <!-- =========================================================== -->

    <scm>
            <connection>https://fosstrak.googlecode.com/svn/fc/trunk/fc-server</connection>
        <developerConnection>scm:svn:https://fosstrak.googlecode.com/svn/fc/trunk/fc-server</developerConnection>
            <url>https://fosstrak.googlecode.com/svn/fc/trunk/fc-server</url>
    </scm>

  <!-- =========================================================== -->
  <!-- Dependencies                                                -->
  <!-- =========================================================== -->

  <dependencies>
    <dependency>
      <groupId>org.fosstrak.fc</groupId>
      <artifactId>fc-commons</artifactId>
      <version>${project.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.fosstrak.reader</groupId>
      <artifactId>reader-rprm-core</artifactId>
      <version>0.5.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
      <groupId>xerces</groupId>
      <artifactId>xerces</artifactId>
    </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.fosstrak.hal</groupId>
      <artifactId>hal-commons</artifactId>
      <version>0.5.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.fosstrak.hal</groupId>
      <artifactId>hal-impl-sim</artifactId>
      <version>0.5.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.fosstrak.tdt</groupId>
      <artifactId>tdt</artifactId>
      <version>1.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.fosstrak.llrp</groupId>
      <artifactId>llrp-adaptor</artifactId>
      <version>${fosstrak.llrp.version}</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.fosstrak.reader</groupId>
      <artifactId>reader-rp-proxy</artifactId>
      <version>0.5.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
      <groupId>xerces</groupId>
      <artifactId>xerces</artifactId>
    </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>xerces</groupId>
      <artifactId>xercesImpl</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
    </dependency>
    <dependency>
        <groupId>uk.com.robust-it</groupId>
        <artifactId>cloning</artifactId>
        <version>1.8.2</version>
    </dependency>
  </dependencies>

  <!-- =========================================================== -->
  <!-- Build settings                                              -->
  <!-- =========================================================== -->

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/bin-with-dependencies.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-dependency-plugin</artifactId>
         <version>2.6</version>
         <executions>
           <execution>
             <id>unpack</id>
             <phase>compile</phase>
             <goals>
               <goal>unpack</goal>
             </goals>
             <configuration>
               <artifactItems>
                 <artifactItem>
                   <groupId>org.fosstrak.tdt</groupId>
                   <artifactId>tdt</artifactId>
                   <type>jar</type>
                   <overWrite>false</overWrite>
                   <outputDirectory>${project.build.directory}/classes/tdtschemes</outputDirectory>
                   <includes>**/*.xml,**/*.xsd</includes>
                   <excludes>**/*test.class</excludes>
                 </artifactItem>
               </artifactItems>
             </configuration>
           </execution>
         </executions>
       </plugin>
    </plugins>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
  </build>

</project>

There is another project named fc-commons included in the fc-server build path. I can't paste its pom.xml here because of length limitations. You can read it here: http://pastebin.com/raw.php?i=vLv4wPdN


text:
Q: apex How set attribute to process dynamicly in other item dynamic action in js or pl/sql section? I use Excel2Collection plugin (https://github.com/antonscheffer/excel2collections/tree/master/plugin) to download xls.
I need to load information from multiple tabs in my excel file (e.g. 1, 3, 8 or lists of attraction in 'London', 'Paris' and 'New-York' sheets).
I have installed the plugin and it is loading the file OK but only the data from
 the first tab.
P.S. And please, if you put a minus to my question, please explain me why? English is not my native language. So please, tell me where I made a grammatical or spelling mistake(s) or failed to complete the question. I searched everywhere in documentation and on the Internet and found no answer. Help me if you can.


text:
Q: Bootstrap full width container with set width divs I'm trying to divide the background in 2 parts. Left with an image parallax and some text and the right one with 1 color and a button.
The problem is that if I don't set container-fluid the left side is not going to reach the edge of the screen but by setting that my text starts at the very beginning of the screen.
Here's my current code
HTML

Get 50 Free Beats

                    Download 50 Free Beats and start recording today!

                    Download Now

CSS
.bg-theme { background-color : #4c51e0 }

A: One solution would be to used bootstraps offset classes.  You won't get the exact gutter you would have otherwise but it will get you off the edge.  Something like the following gets you close:

UPDATE:
You'll also need to duplicate the container+overlay css that you are using for the container-fluid class.
[data-overlay-dark] .container-fluid, [data-overlay-light] .container-fluid, [data-overlay-color] .container-fluid {
    position: relative;
    z-index: 2;
}

Here is my code pen with it in action:
http://codepen.io/egerrard/pen/YGjPkR


text:
Q: import sklearn.model_selection.train_test_split vs import sklearn.model_selection as sm >>> import sklearn.model_selection.train_test_split
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'sklearn.model_selection.train_test_split'

The interpreter is unable to find the train_test_split module.
>>> import sklearn.model_selection as sm
>>> sm.train_test_split
<function train_test_split at 0x000001841E8FB7B8>

But importing using as solves the issue, why? Is there any difference between import and import module as name. According to Python : 'import module' vs 'import module as' these should be same.

A: You can't import a function in python. you should import it from the library in python with the following format
from sklearn.model_selection import train_test_split

or import a module and the use a function from it
import sklearn.model_selection as sm
sm.train_test_split

A: You can't do that.
The format to import a function is :
from sklearn.model_selection import train_test_split

or you can import the entire module and call its function like:
import sklearn.model_selection

model_selection.train_test_split(params)

OR:
import sklearn.model_selection as sk

sk.train_test_split(params)

A: There is an essential difference in what you are comparing. In the first line you are doing import function vs. second line from package import module as ALIAS. The first one is incorrect, you can import the module, but the function specifically. In the second case, you are importing the module with an alias, which is correct. If you were to import the module without alias, you would also be fine.
import sklearn.model_selection.train_test_split

Is not comparable to:
import sklearn.model_selection as sm

This line, is comparable and will work the same as:
import sklearn.model_selection


text:
Q: Reversing subtraction in polynomial division? I'm reading the derivation of the geometric sum formula here:
http://www.purplemath.com/modules/series7.htm
It says that the polynomial property:
$$\frac{x^n-1}{x-1} = 1+x+x^2+...+x^{n-1}$$ (i.e. any polynomial of the form $x^n-1$ is divisible by $x-1$)
Applies to the geometric series $1+r+r^2+...+r^{n-1}$ producing:
$$\frac{1-r^n}{1-r}$$
where the subtraction has been reversed.
I can't see why this reversing is legal.

A: It's exactly the same, because
$$
\frac{r^n-1}{r-1}=\frac{-(1-r^n)}{-(1-r)}=\frac{1-r^n}{1-r}
$$
Why is it written this way? Because, if $|r|<1$, then
$$
\lim_{n\to\infty}r^n=0
$$
and so
$$
\lim_{n\to\infty}\frac{1-r^n}{1-r}=\frac{1-0}{1-r}=\frac{1}{1-r}
$$
Of course it would be the same writing
$$
\lim_{n\to\infty}\frac{r^n-1}{r-1}=\frac{0-1}{r-1}=
\frac{-1}{-(1-r)}=\frac{1}{1-r}
$$
Just a matter of opinion about what's the clearer presentation.