text:
Q: java.lang.NoSuchMethodError: No such DSL method 'sshagent' found among steps [archive, bat, build, catchError Jenkins I use Jenkins CI/CD and do the building for the script below
def secret = 'server'
def server = 'jenkins@103.171.85.155'
def directory = 'wayshub-frontend'
def branch = 'master'

pipeline{
        agent any
    stages{
            stage ('compose down and pull'){
            steps{
                sshagent([secret]) {
                    sh '''
                    ssh -o StrictHostkeyChecking=no ${server} << EOF
                    cd ${directory}
                    docker-compose down
                    docker system prune -f
                    git pull origin ${branch}
                    exit
                    EOF
                    '''
                }
            }
        }
    stage ('build images'){
            steps{
                sshagent([secret]) {
                    sh '''
                    ssh -o StrictHostkeyChecking=no ${server} << EOF
                    cd ${directory}
                    docker-compose build
                    exit
                    EOF
                    '''
                 }
             }
        }
        stage ('deploy'){
            steps{
                sshagent([secret]) {
                    sh '''
                    ssh -o StrictHostkeyChecking=no ${server} << EOF
                    cd ${directory}
                    docker-compose up -d
                    exit
                    EOF
            '''
                }
            }
        }
    }
}

i got error during build
Error build
java.lang.NoSuchMethodError: No such DSL method 'sshagent' found among steps [archive, bat, build, catchError, checkout, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, emailext, emailextrecipients, envVarsForTool, error, fileExists, findBuildScans, getContext, git, input, isUnix, junit, library, libraryResource, load, mail, milestone, node, parallel, powershell, properties, publishChecks, publishHTML, pwd, pwsh, readFile, readTrusted, resolveScm, retry, script, sh, sleep, stage, stash, step, timeout, timestamps, tm, tool, unarchive, unstable, unstash, validateDeclarativePipeline, waitUntil, warnError, withChecks, withContext, withCredentials, withDockerContainer, withDockerRegistry, withDockerServer, withEnv, withGradle, wrap, writeFile, ws] or symbols [GitUsernamePassword, all, allBranchesSame, allOf, always, ant, antFromApache, antOutcome, antTarget, any, anyOf, apiToken, architecture, archiveArtifacts, artifactManager, authorizationMatrix, batchFile, bitbucketServer, booleanParam, branch, brokenBuildSuspects, brokenTestsSuspects, buildButton, buildDiscarder, buildDiscarders, buildRetention, buildUser, buildingTag, builtInNode, caseInsensitive, caseSensitive, certificate, changeRequest, changelog, changeset, checkoutToSubdirectory, choice, choiceParam, cleanWs, clock, command, contributor, credentials, cron, crumb, culprits, defaultFolderConfiguration, defaultView, demand, developers, disableConcurrentBuilds, disableResume, docker, dockerCert, dockerServer, dockerTool, dockerfile, downstream, dumb, durabilityHint, email-ext, envVars, envVarsFilter, environment, equals, expression, extendedEmailPublisher, file, fileParam, filePath, fingerprint, fingerprints, frameOptions, freeStyle, freeStyleJob, fromDocker, fromScm, fromSource, git, gitBranchDiscovery, gitHubBranchDiscovery, gitHubBranchHeadAuthority, gitHubExcludeArchivedRepositories, gitHubExcludeForkedRepositories, gitHubExcludePrivateRepositories, gitHubExcludePublicRepositories, gitHubForkDiscovery, gitHubIgnoreDraftPullRequestFilter, gitHubPullRequestDiscovery, gitHubSshCheckout, gitHubTagDiscovery, gitHubTopicsFilter, gitHubTrustContributors, gitHubTrustEveryone, gitHubTrustNobody, gitHubTrustPermissions, gitTagDiscovery, gitUsernamePassword, github, githubProjectProperty, githubPush, gradle, headRegexFilter, headWildcardFilter, hyperlink, hyperlinkToModels, inheriting, inheritingGlobal, installSource, isRestartedRun, jdk, jdkInstaller, jgit, jgitapache, jnlp, jobBuildDiscarder, jobName, junitTestResultStorage, label, lastDuration, lastFailure, lastGrantedAuthorities, lastStable, lastSuccess, legacy, legacySCM, list, local, location, logRotator, loggedInUsersCanDoAnything, mailer, masterBuild, maven, maven3Mojos, mavenErrors, mavenGlobalConfig, mavenMojos, mavenWarnings, modernSCM, myView, namedBranchesDifferent, newContainerPerStage, node, nodeProperties, nonInheriting, none, not, organizationFolder, overrideIndexTriggers, paneStatus, parallelsAlwaysFailFast, parameters, password, pattern, permanent, pipeline, pipeline-model, pipeline-model-docker, pipelineTriggers, plainText, plugin, pollSCM, preserveStashes, projectNamingStrategy, proxy, pruneTags, queueItemAuthenticator, quietPeriod, rateLimit, rateLimitBuilds, recipients, requestor, resourceRoot, retainOnlyVariables, run, runParam, sSHLauncher, schedule, scmRetryCount, scriptApproval, scriptApprovalLink, search, security, shell, simpleBuildDiscarder, skipDefaultCheckout, skipStagesAfterUnstable, slave, sourceRegexFilter, sourceWildcardFilter, ssh, sshPublicKey, sshUserPrivateKey, standard, status, string, stringParam, suppressAutomaticTriggering, suppressFolderAutomaticTriggering, swapSpace, tag, teamSlugFilter, text, textParam, timestamper, timestamperConfig, timezone, tmpSpace, toolLocation, triggeredBy, unsecured, untrusted, upstream, upstreamDevelopers, userSeed, usernameColonPassword, usernamePassword, viewsTabBar, weather, withAnt, x509ClientCert, zip] or globals [currentBuild, docker, env, params, pipeline, scm]
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:219)
Github repository : https://github.com/pinoezz/Jenkins-Frontend
Guess what's wrong please help

A: It seems you have not installed the sshagent plugin. Here is the documentation for the plugin. Go to manage Jenkins and make sure it's installed.


text:
Q: Scripted value field not showing zero values in kibana dashboard area graph? I have created a scripted field to show data distribution of hours in the day by using a area graph.But the  when i get scripted field to x-axis it don't show the zero values.
Scripted field is

["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"][doc['@timestamp'].value.hourOfDay]

But the result shown in the inspect is as below

01 19
02 19
03 36.4
04 19.2
05 17.25
06 13.25
09 16
10 154
18 6
19 20.5
20 16.25
21 6
22 15.75
23 19

You can clearly see there are no values for day 7,8,11,12,13,14,15,16,17. If the value for those days are zero how can i apper it?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Using Buttons To Show Particular Divs and hide the rest OK, I'm still mind boggled. I've done a ton here, and still can't see why the things aren't loading. I thought maybe it had to do with CORS, so I added a cookies rule to the script, but even then I find this weird, because I was able to display the podcast player locally just fine when I wasn't trying to hide and activate one or the other.
The code seems to be just fine however, I can't seem to pick out the problem.
document.cookie = "cookiename=cookievalue; SameSite=None; Secure; path="
  // Add active class to default player and button
  document.getElementById("player1-button").classList.add("active");
  document.getElementById("player1").classList.add("active");

  // Add event listeners to the buttons to listen for clicks and execute a function
  document.getElementById("player1-button").addEventListener("click", function() {
    //Remove active class from the current player and button
    document.getElementById("player2-button").classList.remove("active");
    document.getElementById("player2").classList.remove("active");
    // Add active class to player1 and player1-button
    document.getElementById("player1").classList.add("active");
    this.classList.add("active");
  });
  document.getElementById("player2-button").addEventListener("click", function() {
    //Remove active class from the current player and button
    document.getElementById("player1-button").classList.remove("active");
    document.getElementById("player1").classList.remove("active");
    // Add active class to player2 and player2-button
    document.getElementById("player2").classList.add("active");
    this.classList.add("active");
  });

This is my new javascript.
Furthermore, here's the related CSS:
.podcast-player div:not(.active) {
  display: none;
}
.podcast-player div.active {
  display: block;

    }

and as well, the HTML for the player element:

I've been combing through this for the past few hours, and to me it all seems like it should work. I'm baffled.

A: Can you check the following code, and let me know if this is what you were looking for?
<!DOCTYPE html>

  <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>

  <button disabled id="small-player-button">Activate Player Small</button>
  <button id="large-player-button">Activate Player Large</button>


text: Q: how to translate api-platform fieldGuesser values I have a <FieldGuesser /> from api-platform/admin and want to translate it's values, something like <SelectInput /> has an option called translateChoice. Is there something similar?


text:
Q: How to disable Windows + S shortcut in Unity When I do Windows+S I see this effect.

How can I disable this?

A: *

*Install CompizConfig Settings Manager
(CCSM).
sudo apt-get install compizconfig-settings-manager

*Click on the Ubuntu Button (in the top-left corner) and search for CompizConfig Settings Manager and open it.

*There scroll down to Desktop section and look for Expo and click it. Click on the Expo key's key-binding and uncheck Enable. That will disable the expo feature. You could also alternatively assign a different key-binding to it.


text:
Q: Disabling utf-8 in all terminals? This question pertains to my Ubuntu 18 system, as follows ...
% uname -a
Linux myhost.name.net 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I don't know how long the following has been going on in the midst of my regular system upgrades, but I have now noticed that all my terminal windows are writing UTF-8 characters. I want all terminal windows to use us.ascii (or possibly iso-8859-1). I can't find anywhere where this is set.
Furthermore, all keyboard input seems to be coming in as UTF-8, and I also want it to be us.ascii or iso-8859-1.
By default, the LANG variable is set to en_US.UTF-8 in all shells that run in my terminal windows, but I am not knowingly setting it that way within any config files.
This occurs under xterm, rxvt, and urxvt, and none of these programs are configured to utilize UTF-8, that I know of.
I'm running XFCE4, if that makes any difference. I can't find any settings for this in the XFCE4 settings, either.
Can anyone suggest a way to reset my system so that all terminal windows always display us.ascii or iso-8859-1, and all keyboard input is also us.ascii or iso-8859-1?
Thank you very much.

A: You aren't finding any specific settings because the overwhelming majority of modern Linux software decides the character set to be used by the locale environment variables. Use the locale command to view the full set of current locale settings.
Have you checked /etc/default/locale? It is the standard Debian configuration file for setting the system default locale. If you want to use iso-8859-1 instead of UTF-8, you should:

*

*make sure that the en_US ISO-8859-1 line is uncommented in /etc/locale.gen and run sudo locale-gen after editing the file if it wasn't

*specify the LANG locale variable (or at least LC_CTYPE) as en_US.iso88591 (or whatever is the correct form according to locale -a | grep en_US)

If the problem is that you're connecting from your Ubuntu 18 UTF-8 system to legacy systems that use ISO-8859-1 instead of UTF-8, you might consider inserting a character mapping layer on your outgoing connections instead of downgrading your entire system to deal with the legacy encoding. Make a tiny script (or a shell function) like this:
#!/bin/sh
luit -encoding 'ISO 8859-1' ssh "$@"

(If you want to enforce strict US-ASCII for the remote endpoint, replace ISO 8859-1 with ASCII.)
Name it whatever you want. Use this script/function instead of the regular ssh command when connecting to the systems using legacy character encoding.


text:
Q: What is the purpose of importing 'android.os.Bundle' in Android App Development? What is the purpose of importing android.os.bundlein Android App Development?

A: Bundle is a utility class that lets you store a set of name-value pairs. You will always find this import along with the import for Activity class because both onCreate() and onFreeze() methods take Bundle as a parameter. Into a Bundle object, you can put integers, longs, strings, arrays, etc along with the keys to identify them. When needed, these values can be obtained by using those keys.
So, as you can see, a bundle object is ideal for storing a set of state variables in the onFreeze method; and the same state variables can be read back in the onCreate method.
So, for example, in the snake game a series of state variables (direction, move delay, score, snake trail, etc) can be stored in a Bundle object (whether they are arrays, integers, strings, etc.).
http://www.infinitezest.com/articles/a-few-basic-imports-in-an-android-application-program.aspx


text:
Q: Response.Redirect() target in to a div Can i redirect a page into a div using Response.Redirect()?

A: No, a <div> exists client side. With a redirect you can only say that the current request should be submitted again at the new address. You can't specify where that redirect should end (frame, iframe, div, window ..).
You will have to do it from the client side: have the div (or whatever) load from some url (which could do a redirect).

A: Whtr u need to display div on the same page or div on the another page? Or u want to display the particular div in a pop-up?


text:
Q: Decomposing an optimisation problem Take the following optimisation problem
$$
(*) \hspace{1cm} h(u_1,u_2,u_3)\equiv \min_{p_1,p_2,p_3} \sum_{j=1}^3(f(u_j,p_j))^2\\
\text{s.t. } g(u_j,p_j)\leq b_j \text{ }\forall j \in \{1,2,3\}\\
$$
where

*

*$u_j$, is an $m$-dimensional vector of real numbers, known by the researcher, for each $j\in \{1,2,3\}$.

*$p_j$ is an $n$-dimensional vector of real numbers, unknown by the researcher, for each $j\in \{1,2,3\}$.

*$b_j$ is a $k$-dimensional vector of real numbers, known by the researcher, for each $j\in \{1,2,3\}$.

*$f:(u_j, p_j)\in \mathbb{R}^m\times  \mathbb{R}^n\mapsto f(u_j, p_j)\in \mathbb{R}$ is a function, known by the researcher, for each $j\in \{1,2,3\}$.

*$g:(u_j, p_j)\in \mathbb{R}^m\times  \mathbb{R}^n\mapsto g(u_j, p_j)\in \mathbb{R}^k$ is a function, known by the researcher, for each $j\in \{1,2,3\}$.

Suppose we decompose problem $(*)$ in three optimisation problems indexed by $j\in \{1,2,3\}$:
$$
h_j(u_j)\equiv \min_{p_j} (f(u_j,p_j))^2\\
\text{s.t. } g(u_j,p_j)\leq b_j\\
$$
Question: Assume that problem $(*)$ is feasible. Is it true that
$$
h(u_1,u_2,u_3)=\sum_{j=1}^3 h(u_j)
$$
?


text:
Q: how to find three identical values in a row in python Suppose that random numbers are selected one at a time with replacement from among the set 0, 1, 2, ..., 8, 9. Use 10,000 simulations to estimate the average number of values required to select three identical values in a row.
Here is the code I tried:
import numpy as np

newlist = 0*[0]
ct = 0
set = [0,1,2,3,4,5,6,7,8,9]
random = np.random.choice(set, size=1)
for i in range(10000):
    if random == random:
        ct +=1
        while ct == 3:
            newlist.append()
print(random)

A: I think this is what you are trying to do. The code runs the test 10000 times and when the last three values are equal we append the number of iterations it took to the results and continue to the next loop:
import numpy as np
from collections import deque

results = []
number_selection = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

for _ in range(10000):
    _iterations = 1
    d = deque(maxlen=3)

    while True:
        random_value = np.random.choice(number_selection, size=1)
        if len(d) == 3 and len(set(d)) == 1:  # if last three items added to deque were equal we add the number of iterations to results and break to next loop
            results.append(_iterations)
            break  # break the while loop

        _iterations += 1
        d.append(random_value.item())

print('Average is: {0}'.format(float(sum(results)) / max(len(results), 1)))

Hope this helps!

A: Algorithm

*

*Generate a window of 3 randomly selected items from your set

*Initialize a counter that will hold the number of times an equality of 3 items is found

*At each iteration, shift the window to the left and add a new randomly selected item

*If all items in the window are equal, increment the counter

*Repeat 3 and 4 until you finished 10000 simulations

Code
import random

# [1, 2, 3] + 4 => [2, 3, 4]
def shift_left(arr, new_value):
    arr[0:len(arr) - 1] = arr[1:len(arr)]
    arr[len(arr) - 1] = new_value
    return arr

# [1, 1, 1] => True | [1, 2, 3] => False
def all_equal(window):
    for j in range(len(window) - 1):
        if window[j] != window[j+1]:
            return False
    return True

# Where real work happens
def avg(number_of_simulations, row_size, possible):
    number_of_equals = 0
    window = [random.choice(possible) for _ in range(row_size)] # window generation
    if all_equal(window):
        number_of_equals += 1

    for i in range(number_of_simulations - row_size):
        # Add new random number AND remove number from 3 iterations before
        window = shift_left(window, random.choice(possible))
        if all_equal(window):
            number_of_equals += 1 # Increment if all items are equal

    return number_of_equals

if __name__ == '__main__':
    possible_values = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
    number_of_simulations = 10000
    row_size = 3
    answer = avg(number_of_simulations, row_size, possible_values)
    print(f'Found {answer} among {number_of_simulations}')

A: how about:
opts = list(range(9))

# simulate once
def get_three():
    c = 1
    x = np.random.choice(opts, 1)
    i = 1
    while c < 3:
        x1 = np.random.choice(opts, 1)
        if x == x1:
            c += 1
        else:
            x = x1
            c = 1
        i += 1
    return i

# simulate n times
n = 10000
result = sum([get_three() for i in range(n)]) / n
result # 90.5146

A: Theoretically you should expect the expected value to be n * 1/n^3 which is 1/n^2 , given that you have n numbers in your initial list.
For simulating it, I would go for the following:
import numpy as np

count = 0
num_iterations = 1000
numbers = [0,1,2,3,4,5,6,7,8,9]
for _ in range(num_iterations):
    if len(set(np.random.choice(numbers, 3, replace=True))) == 1:
        count += 1

print("Avg is {}".format(count/num_iterations))

Explanation:
Since numpy.choice with replacement uniformly selects three members from numbers, the case of three consecutive choices of the same number is equivalent to having a set with cardinality of 1. If you increase num_iterations to something around 10000, you would see that it simulates the case with an acceptable precision (the average would be around 0.01) which is expected.


text:
Q: Select markers from multiple JSON layers within some radius I would like to combine at least 2 json layers in order to make all their markers researchable within some radius after clicking.
There are two files, which in code looks like this:
var url = "Peterborough.json";
var url2 = "Test.json";

then code looks like in the example under this link:
https://gis.stackexchange.com/questions/334170/leaflet-select-markers-from-multiple-json-files-within-the-radius-given/334192#334192
down to the moment, where we must set the SelectPoints(lat,lon) function.
Afterwards I did something like this:

function SelectPoints(lat,lon){
var dist = document.getElementById("miles").value;

xy = [lat,lon];  //center point of circle

var theRadius = parseInt(dist) * 1609.34  //1609.34 meters in a mile
//dist is a string so it's convered to an Interger.

selPts.length =0;  //Reset the array if selecting new points

job.eachLayer(function (layer) {
// Lat, long of current point as it loops through.
layer_lat_long = layer.getLatLng();

// Distance from our circle marker To current point in meters
distance_from_centerPoint = layer_lat_long.distanceTo(xy);

// See if meters is within radius, add the to array
if (distance_from_centerPoint <= theRadius) {
     selPts.push(layer.feature);
}

job2.eachLayer(function (layer) {
// Lat, long of current point as it loops through.
layer_lat_long = layer.getLatLng();

// Distance from our circle marker To current point in meters
distance_from_centerPoint = layer_lat_long.distanceTo(xy);

// See if meters is within radius, add the to array
if (distance_from_centerPoint <= theRadius) {
     selPts.push(layer.feature);
}

});

But unfortunately I got a blank space instead (even map dissapears).
What can be wrong here?
I've red about the iteration of this function here:
Leaflet eachLayer function does not iterate through all Layers
but it haven't brought a clear solution to me.
I want to have these 2 layers eligible to be selected after clicking the marker instead of 1 only.
When I use the 2nd JSON file as a layer and copy the
$.getJSON(url2, function(data) {

code, then I see all clearly on the map, but they are not selected after clicking.
Could be possible to clarify it?

A: It looks like I placed the ; in a wrong place.
The code should look like this:
 job.eachLayer(function (layer) {
    // Lat, long of current point as it loops through.
    layer_lat_long = layer.getLatLng();

    // Distance from our circle marker To current point in meters
    distance_from_centerPoint = layer_lat_long.distanceTo(xy);

    // See if meters is within radius, add the to array
    if (distance_from_centerPoint <= theRadius) {
         selPts.push(layer.feature);
    }
  })

job2.eachLayer(function (layer) {
    // Lat, long of current point as it loops through.
    layer_lat_long = layer.getLatLng();

    // Distance from our circle marker To current point in meters
    distance_from_centerPoint = layer_lat_long.distanceTo(xy);

    // See if meters is within radius, add the to array
    if (distance_from_centerPoint <= theRadius) {
         selPts.push(layer.feature);
    }
  })

according to the example:
http://www.gistechsolutions.com/leaflet/DEMO/sports/


text:
Q: How to do bind mounting in azure kubernetes to view the files from pod to azure fileshare? I have yaml file that has deployment and persistant volume with azure fileshare.
Scenario 1 - The file mount happens successfully when trying to mount only the logs folder with azure files share. This pretty much works as expected.
Scenario 2 -  When I try to mount the application configuration file, the file mount fails with azure fileshare. The pod keeps restarting each time and I am unable to find the files as well.
What am I trying to achieve here?
I have the Azure Fileshare folder that is empty before running the yaml and after running the yaml I am expecting the application files from the pod to be shown in the Azure Fileshare... I guess that isn't happening and actually Azure Fileshare empty folder overwrites the folder/files in the pod that has the application.
Is there any way to view the pod application files in the Azure Fileshare while starting?
ex- just like the bind mount in docker-compose
Please find the yaml file below
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-product
  namespace: my-pool
  labels:
    app: my-product
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-product
  template:
    metadata:
      labels:
        app: my-product
    spec:
      containers:
      - image: myproductimage:latest
        name: my-product
        imagePullPolicy: Always
        envFrom:
        - configMapRef:
            name: configmap
        env:
            - name: env-file
              value: my-product
        volumeMounts:
          - name: azure
            mountPath: /opt/kube/my-product
      imagePullSecrets:
      - name: secret1
      hostname: my-product

      volumes:
        - name: azure
          persistentVolumeClaim:
            claimName: fileshare-pvc
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: fileshare-pv
  labels:
    usage: fileshare-pv
spec:
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  storageClassName: azure-file
  azureFile:
    secretName: secret2
    shareName: myfileshare-folder
    readOnly: false
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: fileshare-pvc
  namespace: my-pool
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: azure-file
  resources:
    requests:
      storage: 5Gi
  selector:
    # To make sure we match the claim with the exact volume, match the label
    matchLabels:
      usage: fileshare-pv


text:
Q: Visual Studio and Android Device Monitor doesn't detect any devices I've just installed VS2015 Community with Xamarin to develop some mobile apps. The problem is, I can't achieve debugging Android apps on any device. Android Device Monitor shows empty list. I tried connecting different phones, which I know are detected on my friend's PC. I can explore their files from windows explorer, from there computer sees them.

*

*USB Debugging on the phone is turned on.

*USB connection mode is set to camera, no change at all.

*I have Google USB driver installed in Android SDK manager.

*I tried adb kill-server, adb start-server. Nothing changed. adb devices
shows empty list.

This is device manager while Developers options are disabled on the phone.

And here with enabled Developers options

I also tried updateing driver to google usb driver, but windows said it's up to date.

A: Sometimes just restarting Visual Studio might help

A: You most likely did not grant access to the device. Try to go into the developer settings on the smartphone and revoke the USB debugging authorisation. Then connect the phone to the pc and and wait for a popup on the phone which you should accept. After accepting you should see your device with adb devices.
You can also try to set the connection mode to MTP (instead of the camera PTP).
Hope it helps!

A: Try the this:
1 - Close Visual Studio
2 - connect your device
3 - Restart visual studio with the device already connected by usb (with the device options checked)

A: This just happened to me. And it seems setting the startup project to your Android project fixed it.

A: Enable the device for development
Goto: Device > Settings > Developer Options > tick USB debugging

A: My understanding is that the Google USB Drivers from the Android SDK Manager only work for Google Nexus devices (at least according to https://developer.android.com/studio/run/win-usb.html); annoyingly enough, to use other kinds of devices you'll probably need to download vendor-specific drivers. For example, I definitely had to download Motorola's drivers to use my Droid for debugging purposes. Unfortunately, for whatever reason Windows wasn't able to automatically detect that that's what it needed to download, so I had to download them manually.

A: I had the same problem, using a Samsung Galaxy A5

*

*Google Drivers Installed

*Samsung Drivers Installed

*Phone shows up in file explorer

Plugging the phone in while Visual Studio was opened resulted in a pop up asking for permission. After authorising, everything worked perfectly. I didn't have to go into the developer settings on the smartphone and revoke the USB debugging authorisation.

A: To preface, I had connected my phone (a blackberry which had Android and full Google Play Store access) via Android Studio before so I KNOW it's possible, but when I was trying to do it with Xamarin I was having issues, Visual Studio just wouldn't recognize my device.
Found the problem appears to be the USB cable I was using.  When I standardly plug in the USB, blackberry gives me the option to just charge the phone, or to enable File Transferring. But the first cable I was using always just charged the phone and didn't give me options.  I tried switching the usb cable and voila, I got the prompt, and I can see the device now in the Start Debugging dropdown.  So it looks like there's charge-only usb cables as well as Data cables.  Be sure you're using a Data cable else it won't be able to see your Device

A: I had the same issue after updating Visual Studio found that in recent versions is better if you open VS in administrator mode to properly work, this should fix the problem.

A: I had previously revoked debug auth on my phone, but my phone didn't prompt me to allow debugging on my PC when I connected it again. Ended-up restarting my LG V30 while connected to my PC and I was prompted to allow debugging.
After that, Visual Studio 2019 version 16.10.0 adds my phone to the device list.

A: Running on Windows 11. Visual Studio 2022. But, I don't think the versions are really relevant here - included for completeness.
Followed all instructions re enabling USB debugging from the device. Also, the USB Drivers for my Samsung device were successfully installed on the Windows machine.
I was running the Duet Display application as I had previously installed it for use with my iOS devices. This appears to have created a conflict when connecting the Android device, as the prompt related to Duet would appear but not the prompt to allow USB debugging from the computer along with the RSA thumbprint. Once I exited the Duet app from my system tray and reconnected the Android device I got the prompt and it immediately appeared in Visual Studio 2022.

A: Here's some things I check when having an issue with Android device not appearing:

*

*Enable developer mode on the device from settings

*Install (e.g. to windows) the manufacturer's* developer USB drivers for the device

*Ensure the Minimum Android Version in the AndroidManifest.xml is lower or equal to your device

*And as always, try a different lead and restart both PC and Device!!

*Manufacturer Android USB Development driver links I know of:
Sony | Samsung | Google/Nexus | Blackberry

A: I have just updated from VS2015 (14.0.25402.00 Update 3) to VS2017 (15.7.5).
Amongst other things, I had to migrate a .forms app from 2.3.x to 3.1.x...
As it (according to MS) now should be possible to install also the Xamarin integration software in parallel to older versions of VS, I first (for security reasons) wanted to leave my "old" .forms app under VS2015 and .forms 2.3x and start to update to .forms 3.x with VS2017.
First, everything looked good - I was able to open my "old" .forms 2.3.x project in VS2015 (what was not possible in the earlier migration from VS2013 to VS2015).
But, I was not able to bring my two dev mobiles (both Samsung Galaxy S7) to work under VS2015 again, although, they were showed to my dev-machine (windows explorer) correct.
After wasting about a full day (doing every suggested workaround, I found on the web), I gave up und started to migrate the .forms project under VS2017.
Under VS2017 both mobiles were showed immediately without any problems and I was able to debug to the device.
So.. it seems, as the installation of VS2017 (with Xamarin integration SW) has "destroyed" something in the VS2015 installation regarding the access to the mobile devices...

A: I wasn't getting the USB debugging prompt on the device to trust the PC it was connected to and it wasn't appearing in the drop down list of devices in Visual Studio or ADB. Tried many things but installing the USB driver for the device (in my case Sony Xperia XA1 from: https://developer.sony.com/develop/drivers/
After installing this device driver by right-clicking the ADB Interface device in Device Manager and choosing the downloaded driver it showed the prompt to allow the PC and now works fine. This was on Windows 8.1 . I don't remember having to do the same for my Windows 10 PC.

A: I tried all the options but the only way I got it working is to unplug the USB cable and connect it on a different USB port.

A: After downloading phone specific drivers and restarting computer / restarting visual studio etc etc. What fixed it for me was from developer options

*

*Disable USB Debugging

*Enable USB Debugging
This was on a Samsung Galaxy, looks like although it was saying USB debugging was enabled it was in fact not enabled until I retriggered it using the above method.


text:
Q: How do I use Reg-Free COM for a vb6 dll reference in a .net project? I've been trying to solve this issue for a long time, and nothing seems to work.
I have a COM DLL written in vb6. I add a reference to this DLL in .net, with the 'isolated' and 'copy local' properties set to true on the reference. Apparently this is supposed to enable reg-free com.
But it doesn't work. If I try on another computer, or unregister the DLL with regsvr32, trying to access the DLL throws an exception (essentially saying the desired com class does not exist). The DLL and manifest files are in the same folder as the EXE, but it apparently just totally ignores them.
What am I doing wrong? I've read a ton of scattered articles about this but none of them give me a working solution. I've tinkered with visual studio to no avail. I've tinkered a small amount with make-my-manifest, but it didn't work (even on a test project).

A: I was creating and using the com class on a non-ui thread. Apparently Reg-Free com on vb6 DLLs doesn't work in that situation. This test code shows it:
Private Sub RunTest() Handles Button1.Click
    Try
        Dim x As New RegTestProject.RegTestCall
        MsgBox(x.RegTestFunction())
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
End Sub

Private Sub RunThreadedTest() Handles Button2.Click
    'fails if reg-free COM is used'
    Dim t As New Threading.Thread(AddressOf RunTest)
    t.Start()
End Sub

When I run this with the DLL registered normally, both tests succeed. If I use reg-free com, the threaded test fails even though the normal test still succeeds. Looks like this is going to be a huge pain to work-around.

A: I'm pretty sure that when you reference COM components in this way, the COM component import happens every time you build. That means that the COM component must be registered the traditional way on every machine the project will be built on.

A: Here's a link that describes using registration free com interop. If you've already done this please post your manifest file. You might have a typo your missing.
Edit
Just a thought might be simpler to just register the dll the first time the app runs on a new machine. Registration free com interopt is only available on Windows XP and newer so if your targeting any dinosaurs out there it won't work.

A: Here's an excerpt from the Troubleshooting section of an MSDN article on reg-free COM. Apologies if you've already seen it. The good news is you are already part of the way through the steps. It suggests reproducing the problem in Windows Server 2003 (maybe with Virtual PC?) and then the event log should help.

First get ... your client working with
  a registered server; then unregister
  the server and verify that your error
  message is what you expected; and
  finally... craft and deploy manifest
  files. This way your troubleshooting
  efforts ... will be confined to the
  structure of your manifest files (and
  the correct embedding of the assembly
  manifest if you choose to do so).
When troubleshooting registration-free
  COM issues, the Event Viewer on
  Windows Server 2003 is your friend...
  look in the System Event Log for events from the COM server.
  I don't suggest that you look at the
  Windows XP Event Log...
  it will invariably contain a
  message... which doesn't help
  identify the problem.


text:
Q: how to pass data from child to child component in angular? deals-transaction.component is rendered by app-transactions-details and deals-transaction.component renders the app-deals-approval component.
How do I get the deals-transaction.component testPage() result or output and pass the data to app-deals-approval component and access the value on app-deals-approval component ngOnit ?
Is @Viewchild a good solution ? should it be pass as input ? . Thanks.
Thanks .
#deals-transaction.component html (this renders the app-deals-approval) I want to pass the data to app-deals-approval

    <app-deals-approval > </app-deals-approval>

#deals-transaction.component.ts
@Component({
  selector: 'app-deals-transaction',
  templateUrl: './deals-transaction.component.html',
  styleUrls: ['./deals-transaction.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DealsTransactionComponent implements OnInit {
  @ViewChild(TableMultiSortComponent, { static: true }) tableMultiSortComponent: TableMultiSortComponent;
  transactionSubscripion: Subscription;
  tableOptions: any;
  @Input() transaction: any;
  isLoading: boolean;
  accountId: any;
  dealDetails: any;

  constructor(
    private _snackBar: MatSnackBar,

    private dealService: DealService,

  ) {}
  ngOnInit(): void {
    this.leaseId = this.transaction.leaseId;
    this.propertyId = this.transaction.propertyId;
    const actions = ["Copy", "Delete", "For Approval"];
    this.testPage();
  }
  private testPage() {
    this.searchInput = '';
    const status = 'ForApproval'
    this.isLoading = true;
    this.dealService
      .getAllDeals(
        status,
        this.accountId,
        this.transaction.id,
        this.table.pageIndex + 1,
        this.table.pageSize,
        this.searchInput,
        this.table.sortParams,
        this.table.sortDirs
      )
      .pipe(finalize(() => (this.isLoading = false)))
      .subscribe((res) => {
        this.testPageOutput = res.items;
      }, (err) => this.notificationService.showError(err)
    );
  }

#deals-approval.component.ts code
@Component({
  selector: 'app-deals-approval',
  templateUrl: './deals-approval.component.html',
  styleUrls: ['./deals-approval.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DealsApprovalComponent implements OnInit {
  transactionSubscripion: Subscription;
  @ViewChild(TableMultiSortComponent, { static: true }) tableMultiSortComponent: TableMultiSortComponent;
  tableOptions: any;
  hasApproval = false;
  @Input() transaction: any;
  @Input() dataTest: any;
  isLoading: boolean;
  DEAL_TYPES = DEAL.TYPES;
  totalDeals : number;

  dealType$: Observable<string> = new Observable<string>()
  firstSub: Subscription;
  accountId: any;
  data: any;
  searchInput: string;
  table: any;
  dealType: string;
  totalDealsForApproval = 0;
  constructor(
    private dealService: DealService,
    private notificationService: NotificationService,
    private trasactionService: TransactionService,
    private route: Router,
    private dealTransactionService: DealTransactionService

  ) { }

  ngOnInit(): void {

 }

A: Inside deals-transaction.component
<app-deals-approval [testPageOutput]="testPageOutput"> </app-deals-approval>

Inside app-deals-approval component
// use set since your `testPage()` is generating result in async
_testPageOutput: any;
@Input() set testPageOutput(value: any) {
    this._testPageOutput = value;
    // other operation you want to perform upon `testPageOutput` value changes
}

A: It's because the testPageOutput is set by an asynchronous task in DealsTransactionComponent - that's why it is not available in ngOnInit() of DealsApprovalComponent. Try to access it in ngOnChanges() instead of ngOnInit() of DealsApprovalComponent.
@Component({
  selector: 'app-deals-transaction',
  templateUrl: './deals-transaction.component.html',
  styleUrls: ['./deals-transaction.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DealsTransactionComponent implements OnInit, OnChanges {
  testPageOutput: any;

  constructor(
      private _snackBar: MatSnackBar,
      private dealService: DealService) {}

  ngOnInit(): void {
    this.testPage();
  }

  private testPage() {
    this.dealService.getAllDeals(/*...*/)
      .pipe(finalize(() => (this.isLoading = false)))
      .subscribe(
         (res) => {
           this.testPageOutput = res.items;
         },
         (err) => this.notificationService.showError(err)
      );
  }
}

Template:

  <app-deals-approval [testPageOutput]="testPageOutput">
  </app-deals-approval>

DealsApprovalComponent
@Component({
  selector: 'app-deals-approval',
  templateUrl: './deals-approval.component.html',
  styleUrls: ['./deals-approval.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class DealsApprovalComponent implements OnInit {

  @Input() testPageOutput: any;

  constructor() {
  }

  ngOnInit(): void {
  }

  ngOnChanges(changes: any): void {
    if (changes.testPageOutput?.currentValue) {
      // do your stuff here
    }
  }
}


text:
Q: How to disable Ubuntu Software Centre for user? As administrator I want to be sure user can not download inappropriate applications.

A: If "user" is not an administrator they will not be able to install software without the administrator password.
Go to System Settings > User Accounts, click unlock at the top and change "user" to standard if needed.

A: Since user needs administration rights to install software, you can remove him from sudoers. Use command visudo to open sudoers file and remove the user you want.


text:
Q: Use stored procedure in Select query I have a stored procedure that I want to use in a SELECT like below but I get an error.
The stored procedure's output is a table with one column of type int
select * from users where resCode in (EXEC getUserResselers 1)

-- stored procedure
create procedure getUserResselers
    @userCode int
as
    ;WITH Directories AS (SELECT  code FROM Resseler WHERE code =(select resselerCode from Users where code=@userCode)
    UNION ALL SELECT d.code FROM Resseler d INNER JOIN Directories p ON  d.parent = p.code)
        SELECT  * FROM    Directories d

A: Direct selection from a stored procedure is not supported. However, this type of operation is a good candidate for a table-valued user-defined function, which might look something like:
Note that you have misspelled "resellers". I've left the misspelling so that you could test with your existing schema.
CREATE FUNCTION getUserResselers
(
    @UserCode INT
)
RETURNS TABLE AS
RETURN(
    WITH Directories AS (

       SELECT  code FROM Reseller WHERE code = (select resselerCode from Users where code=@userCode)
       UNION ALL SELECT d.code FROM Resseler d INNER JOIN Directories p ON  d.parent = p.code
    )
    SELECT  * FROM   Directories
)

You could then include a join to the function in your query, or you could continue to use IN, which should be something like:
select * from users where resCode in (SELECT Code FROM getUserResselers(1));


text:
Q: PHP/Apache Nice URL I'm trying to create nice URLs for the website.
I have this file structure:
public:
  user:
    user.php
  index.php

I want to make it so that someone can enter the url:
http://www.example.com/user/{user name here}

and the request will be sent to:
user.php?name={user name here}

but I don't want them to see the file.
I think I may have to do this with .htacces but I'm not sure how.
I'm sorry if my question layout is not very good.

A: Place this rule in /user/.htaccess:
Options -MultiViews
RewriteEngine On
RewriteBase /user/

RewriteCond %{THE_REQUEST} /user\.php\?name=([^\s&]+) [NC]
RewriteRule ^ %1? [R=302,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ user.php?name=$1 [L,QSA]


text:
Q: Replace a character in a string with another string without using built in functions I have two strings. s={"Mangalore"} and p={"Man"}. Iwant to replace every occurance of 'a' with string "man". i.e.
input: Mangalore
output: MManngManlore
I tried this program. But I'm stuck at one point. Here my function:
string_replace(char *s,char *p)
{
 char t[25];
 int i,j,len1,len2;
 len1=strlen(s);
 len2=strlen(p);
 for(i=0;i<len1;i++)
 {
  if(s[i]=='a')
   {
     for(j=0;j<len2;j++)
       t[i+j]=p[j];
    }
    else
     {
      t[i]=s[i];
     }
  }
}

My doubt is in the statement t[i]=s[i];. What i need to write in place of this. Please help me. I need to write it without using built in functions.
Thanks in Advance..

A: The length of the result t can be longer than the length of the input, so just using a fixed length of 25 for the output might not be a good idea. Indeed the statement t[i]=s[i] is problematic, as the index for the result t eventually needs to be larger. I suggest using an additional variable to keep track of the next position of t to write to.

A: use one more variable k. which is initially k=i; then after the for loop,
if(s[i]=='a')
   {
     for(j=0;j<len2;j++)
       t[i+j]=p[j];

add
k=k+j

and increment k with i in outer for loop.
this is because making t[i]=s[i] results in making t[]=s[] so no changes to the array. so change it to
t[k]=s[i]

the full code can be like,
for(i=0,k=0;i<len1;i++,k++)
 {
  if(s[i]=='a')
   {
     for(j=0;j<len2;j++)
       t[k+j]=p[j];
     k=k+j;
    }
    else
     {
      t[k]=s[i];
     }
  }
}

A: You need to keep track of the characters in the buffer pointed to by s.
#define MAX_LEN

string_replace(char *s, char *p) {
    char t[MAX_LEN];
    char ch = 'a';  // char to be replaced by string pointed to by p
    while(*s) {
        if(*s == ch) {
            while(*p)
                *t++ = *p++;  // copy the string pointed to by p to t
        }
        else
            *t++ = *s++;   // copy the characters of s to t which are not ch
    }
    *t = '\0';   // append the null byte to t to make it a string
}


text:
Q: How to start an android web server service? I have a WebServerService which I would like to start when a toggle button is pressed. The same button also launches a dialog and notifies the user.
I have tried the following code from my main activity:
startService(new Intent(MyActivity.this, WebServerService.class));

But the application UI freezes and the dialog doesn't show up and the application force closes. The code for the WebServerService class is:
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class WebServerService extends Service {
    private WebServer server = null;

    @Override
    public void onCreate() {
        Log.i("HTTPSERVICE", "Creating and starting httpService");
        super.onCreate();
        server = new WebServer(this);
        server.startServer();
    }

    @Override
    public void onDestroy() {
        Log.i("HTTPSERVICE", "Destroying httpService");
        server.stopServer();
        super.onDestroy();
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}

I have been trying hard to get this to work. I have also looked at AsyncTask but I'm not sure if that is applicable in my case. Any help or a pointer in the right direction would be greatly appreciated.
The WebServer class is as follows:
package com.xlnc.webapp;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;

import org.apache.http.HttpException;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.impl.DefaultHttpResponseFactory;
import org.apache.http.impl.DefaultHttpServerConnection;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.protocol.BasicHttpContext;
import org.apache.http.protocol.BasicHttpProcessor;
import org.apache.http.protocol.HttpRequestHandlerRegistry;
import org.apache.http.protocol.HttpService;
import org.apache.http.protocol.ResponseConnControl;
import org.apache.http.protocol.ResponseContent;
import org.apache.http.protocol.ResponseDate;
import org.apache.http.protocol.ResponseServer;

import android.content.Context;

public class WebServer {

public static boolean RUNNING = false;
public static int serverPort = 8080;

private static final String ALL_PATTERN = "*";
private static final String EXCEL_PATTERN = "/*.xls";
private static final String HOME_PATTERN = "/home.html";

private Context context = null;

private BasicHttpProcessor httpproc = null;
private BasicHttpContext httpContext = null;
private HttpService httpService = null;
private HttpRequestHandlerRegistry registry = null;

public WebServer(Context context) {
    this.setContext(context);

    httpproc = new BasicHttpProcessor();
    httpContext = new BasicHttpContext();

    httpproc.addInterceptor(new ResponseDate());
    httpproc.addInterceptor(new ResponseServer());
    httpproc.addInterceptor(new ResponseContent());
    httpproc.addInterceptor(new ResponseConnControl());

    httpService = new HttpService(httpproc,
        new DefaultConnectionReuseStrategy(), new DefaultHttpResponseFactory());

    registry = new HttpRequestHandlerRegistry();

    registry.register(HOME_PATTERN, new HomeCommandHandler(context));

    httpService.setHandlerResolver(registry);
}

private ServerSocket serverSocket;

public void runServer() {
    try {
        serverSocket = new ServerSocket(serverPort);

        serverSocket.setReuseAddress(true);

        while (RUNNING) {
            try {
                final Socket socket = serverSocket.accept();

                DefaultHttpServerConnection serverConnection = new DefaultHttpServerConnection();

                serverConnection.bind(socket, new BasicHttpParams());

                httpService.handleRequest(serverConnection, httpContext);

                serverConnection.shutdown();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (HttpException e) {
                e.printStackTrace();
            }
        }

        serverSocket.close();
    } catch (SocketException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    RUNNING = false;
}

public synchronized void startServer() {
    RUNNING = true;
    runServer();
}

public synchronized void stopServer() {
    RUNNING = false;
    if (serverSocket != null) {
        try {
            serverSocket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

public void setContext(Context context) {
    this.context = context;
}

public Context getContext() {
    return context;
}
}

Edit:
Here are logs:

08-01 22:55:04.406: I/PackageManager(65): /data/app/vmdl40565.tmp changed; unpacking
08-01 22:55:04.550: D/installd(31): DexInv: --- BEGIN '/data/app/vmdl40565.tmp' ---
08-01 22:55:04.637: D/dalvikvm(143): GC freed 2787 objects / 185600 bytes in 239ms
08-01 22:55:05.226: D/dalvikvm(205): DexOpt: load 39ms, verify 132ms, opt 1ms
08-01 22:55:05.236: D/installd(31): DexInv: --- END '/data/app/vmdl40565.tmp' (success) ---
08-01 22:55:05.526: I/installd(31): move /data/dalvik-cache/data@app@vmdl40565.tmp@classes.dex -> /data/dalvik-cache/data@app@com.xlnc.webapp.apk@classes.dex
08-01 22:55:05.526: D/PackageManager(65): New package installed in /data/app/com.xlnc.webapp.apk
08-01 22:55:05.696: D/MountListener(65): handleEvent ums_disabled
08-01 22:55:05.756: D/MountListener(65): handleEvent ums_disconnected
08-01 22:55:05.766: D/AndroidRuntime(162): Shutting down VM
08-01 22:55:05.766: D/dalvikvm(162): DestroyJavaVM waiting for non-daemon threads to exit
08-01 22:55:05.766: D/dalvikvm(162): DestroyJavaVM shutting VM down
08-01 22:55:05.776: D/dalvikvm(162): HeapWorker thread shutting down
08-01 22:55:05.776: D/dalvikvm(162): HeapWorker thread has shut down
08-01 22:55:05.776: D/jdwp(162): JDWP shutting down net...
08-01 22:55:05.776: I/jdwp(162): adbd disconnected
08-01 22:55:05.789: D/dalvikvm(162): VM cleaning up
08-01 22:55:05.826: E/AndroidRuntime(162): ERROR: thread attach failed
08-01 22:55:05.826: D/dalvikvm(162): LinearAlloc 0x0 used 621708 of 5242880 (11%)
08-01 22:55:06.396: D/dalvikvm(65): GC freed 4364 objects / 319160 bytes in 245ms
08-01 22:55:06.596: D/MediaScannerService(179): start scanning volume internal
08-01 22:55:06.716: I/ActivityManager(65): Start proc com.android.mms for broadcast com.android.mms/.transaction.MmsSystemEventReceiver: pid=212 uid=10014 gids={3003, 1015}
08-01 22:55:07.306: D/installd(31): DexInv: --- BEGIN '/system/app/Mms.apk' ---
08-01 22:55:07.476: D/AndroidRuntime(210): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-01 22:55:07.496: W/ResourceType(65): Resources don't contain package for resource number 0x7f0700e5
08-01 22:55:07.496: D/AndroidRuntime(210): CheckJNI is ON
08-01 22:55:07.508: W/ResourceType(65): Resources don't contain package for resource number 0x7f020031
08-01 22:55:07.508: W/ResourceType(65): Resources don't contain package for resource number 0x7f020030
08-01 22:55:07.508: W/ResourceType(65): Resources don't contain package for resource number 0x7f050000
08-01 22:55:07.516: W/ResourceType(65): Resources don't contain package for resource number 0x7f060000
08-01 22:55:07.667: W/ResourceType(65): Resources don't contain package for resource number 0x7f060001
08-01 22:55:08.236: D/AndroidRuntime(210): --- registering native functions ---
08-01 22:55:10.246: I/MediaProvider(179): Upgrading media database from version 0 to 78, which will destroy all old data
08-01 22:55:10.656: D/dalvikvm(219): DexOpt: load 677ms, verify 1526ms, opt 36ms
08-01 22:55:10.746: D/installd(31): DexInv: --- END '/system/app/Mms.apk' (success) ---
08-01 22:55:10.757: I/ActivityManager(65): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.xlnc.webapp/.WirelessDropActivity }
08-01 22:55:10.827: D/AndroidRuntime(210): Shutting down VM
08-01 22:55:10.827: D/dalvikvm(210): DestroyJavaVM waiting for non-daemon threads to exit
08-01 22:55:10.836: D/dalvikvm(210): DestroyJavaVM shutting VM down
08-01 22:55:10.836: D/dalvikvm(210): HeapWorker thread shutting down
08-01 22:55:10.836: D/dalvikvm(210): HeapWorker thread has shut down
08-01 22:55:10.836: D/jdwp(210): JDWP shutting down net...
08-01 22:55:10.836: I/jdwp(210): adbd disconnected
08-01 22:55:10.836: D/dalvikvm(210): VM cleaning up
08-01 22:55:10.916: E/AndroidRuntime(210): ERROR: thread attach failed
08-01 22:55:10.927: D/dalvikvm(210): LinearAlloc 0x0 used 637292 of 5242880 (12%)
08-01 22:55:11.076: I/ActivityManager(65): Start proc com.xlnc.webapp for activity com.xlnc.webapp/.WirelessDropActivity: pid=227 uid=10024 gids={3003}
08-01 22:55:11.746: D/(212): unable to unlink '/data/data/com.android.mms/shared_prefs/com.android.mms_preferences.xml.bak': No such file or directory (errno=2)
08-01 22:55:11.746: I/dalvikvm(165): Debugger has detached; object registry had 1 entries
08-01 22:55:11.756: D/(212): unable to unlink '/data/data/com.android.mms/shared_prefs/_has_set_default_values.xml.bak': No such file or directory (errno=2)
08-01 22:55:11.926: I/ARMAssembler(65): generated scanline__00000177:03515104_00000001_00000000 [ 73 ipp] (95 ins) at [0x3e1138:0x3e12b4] in 1170007 ns
08-01 22:55:12.026: I/ARMAssembler(65): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x44e5b8:0x44e6c4] in 585431 ns
08-01 22:55:12.486: D/ddm-heap(212): Got feature list request
08-01 22:55:12.597: D/ddm-heap(227): Got feature list request
08-01 22:55:12.666: D/ddm-heap(165): Got feature list request
08-01 22:55:13.176: D/ddm-heap(179): Got feature list request
08-01 22:55:13.227: I/ActivityManager(65): Displayed activity com.xlnc.webapp/.WirelessDropActivity: 2203 ms (total 2203 ms)
08-01 22:55:13.346: I/ARMAssembler(65): generated scanline__00000077:03545404_00000A04_00000000 [ 29 ipp] (51 ins) at [0x437570:0x43763c] in 411860 ns
08-01 22:55:13.776: D/(165): unable to unlink '/data/data/com.android.alarmclock/shared_prefs/AlarmClock.xml.bak': No such file or directory (errno=2)
08-01 22:55:13.808: W/BackupManagerService(65): dataChanged but no participant pkg='com.android.providers.settings' uid=10017
08-01 22:55:13.877: W/BackupManagerService(65): dataChanged but no participant pkg='com.android.providers.settings' uid=10017
08-01 22:55:13.916: I/ActivityManager(65): Start proc com.android.email for broadcast com.android.email/com.android.exchange.BootReceiver: pid=240 uid=10023 gids={3003, 1015}
08-01 22:55:14.126: D/ddm-heap(240): Got feature list request
08-01 22:55:14.176: D/dalvikvm(29): GC freed 276 objects / 10576 bytes in 266ms
08-01 22:55:14.309: D/installd(31): DexInv: --- BEGIN '/system/app/Email.apk' ---
08-01 22:55:14.346: D/dalvikvm(29): GC freed 45 objects / 2000 bytes in 164ms
08-01 22:55:14.487: D/dalvikvm(29): GC freed 2 objects / 48 bytes in 139ms
08-01 22:55:17.596: D/dalvikvm(246): DexOpt: load 283ms, verify 2203ms, opt 85ms
08-01 22:55:17.665: D/installd(31): DexInv: --- END '/system/app/Email.apk' (success) ---
08-01 22:55:17.806: I/ActivityThread(240): Publishing provider com.android.email.provider: com.android.email.provider.EmailProvider
08-01 22:55:17.866: I/ActivityThread(240): Publishing provider com.android.email.attachmentprovider: com.android.email.provider.AttachmentProvider
08-01 22:55:18.036: D/Exchange(240): BootReceiver onReceive
08-01 22:55:18.086: D/EAS SyncManager(240): !!! EAS SyncManager, onCreate
08-01 22:55:18.456: D/EAS SyncManager(240): !!! EAS SyncManager, onStartCommand
08-01 22:55:18.586: D/EAS SyncManager(240): !!! EAS SyncManager, stopping self
08-01 22:55:19.186: I/ActivityManager(65): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=252 uid=10012 gids={}
08-01 22:55:19.386: D/ddm-heap(252): Got feature list request
08-01 22:55:19.416: D/Eas Debug(240): Logging:
08-01 22:55:19.456: D/installd(31): DexInv: --- BEGIN '/system/app/PicoTts.apk' ---
08-01 22:55:19.736: D/dalvikvm(258): DexOpt: load 40ms, verify 22ms, opt 1ms
08-01 22:55:19.736: D/installd(31): DexInv: --- END '/system/app/PicoTts.apk' (success) ---
08-01 22:55:19.821: D/EAS SyncManager(240): !!! EAS SyncManager, onDestroy
08-01 22:55:19.947: D/MediaScanner(179): opendir /system/media/ failed, errno: 2
08-01 22:55:19.966: D/MediaScanner(179):  prescan time: 12539ms
08-01 22:55:19.980: D/MediaScanner(179):     scan time: 48ms
08-01 22:55:19.980: D/MediaScanner(179): postscan time: 1ms
08-01 22:55:19.980: D/MediaScanner(179):    total time: 12588ms
08-01 22:55:20.124: D/MediaScannerService(179): done scanning volume internal
08-01 22:55:23.136: I/Notification(227): show Notification Entered
08-01 22:55:23.546: I/HTTPSERVICE(227): Creating and starting httpService
08-01 22:55:28.896: W/ResourceType(65): Resources don't contain package for resource number 0x7f0700e5
08-01 22:55:28.896: W/ResourceType(65): Resources don't contain package for resource number 0x7f020031
08-01 22:55:28.896: W/ResourceType(65): Resources don't contain package for resource number 0x7f020030
08-01 22:55:28.896: W/ResourceType(65): Resources don't contain package for resource number 0x7f050000
08-01 22:55:28.987: W/ResourceType(65): Resources don't contain package for resource number 0x7f060000
08-01 22:55:28.987: W/ResourceType(65): Resources don't contain package for resource number 0x7f060001
08-01 22:55:59.739: W/WindowManager(65): Key dispatching timed out sending to Service Started
08-01 22:55:59.739: W/WindowManager(65): Dispatch state: null
08-01 22:55:59.746: W/WindowManager(65): Current state:  {{null to Window{44e51758 Service Started paused=false} @ 1343861759751 lw=Window{44e51758 Service Started paused=false} lb=android.os.BinderProxy@44e515e0 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{44e51758 Service Started paused=false}}}
08-01 22:55:59.816: I/ActivityManager(65): ANR in process: com.xlnc.webapp (last in com.xlnc.webapp)
08-01 22:55:59.816: I/ActivityManager(65): Annotation: keyDispatchingTimedOut
08-01 22:55:59.816: I/ActivityManager(65): CPU usage:
08-01 22:55:59.816: I/ActivityManager(65): Load: 1.45 / 0.77 / 0.29
08-01 22:55:59.816: I/ActivityManager(65): CPU usage from 30971ms to 54ms ago:
08-01 22:55:59.816: I/ActivityManager(65):   system_server: 4% = 2% user + 1% kernel / faults: 24 minor
08-01 22:55:59.816: I/ActivityManager(65):   com.svox.pico: 1% = 0% user + 0% kernel / faults: 2607 minor
08-01 22:55:59.816: I/ActivityManager(65):   d.process.acore: 0% = 0% user + 0% kernel / faults: 3 minor
08-01 22:55:59.816: I/ActivityManager(65):   m.android.phone: 0% = 0% user + 0% kernel / faults: 1 minor
08-01 22:55:59.816: I/ActivityManager(65):   qemud: 0% = 0% user + 0% kernel
08-01 22:55:59.816: I/ActivityManager(65):   adbd: 0% = 0% user + 0% kernel
08-01 22:55:59.816: I/ActivityManager(65):   com.xlnc.webapp: 0% = 0% user + 0% kernel
08-01 22:55:59.816: I/ActivityManager(65):   pdflush: 0% = 0% user + 0% kernel
08-01 22:55:59.816: I/ActivityManager(65):   logcat: 0% = 0% user + 0% kernel
08-01 22:55:59.816: I/ActivityManager(65): TOTAL: 5% = 3% user + 1% kernel
08-01 22:55:59.816: I/Process(65): Sending signal. PID: 227 SIG: 3
08-01 22:55:59.816: I/dalvikvm(227): threadid=7: reacting to signal 3
08-01 22:55:59.836: I/dalvikvm(227): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:00.069: I/Process(65): Sending signal. PID: 65 SIG: 3
08-01 22:56:00.069: I/dalvikvm(65): threadid=7: reacting to signal 3
08-01 22:56:00.146: I/dalvikvm(65): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:00.413: I/Process(65): Sending signal. PID: 252 SIG: 3
08-01 22:56:00.413: I/dalvikvm(252): threadid=7: reacting to signal 3
08-01 22:56:00.436: I/dalvikvm(252): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:00.655: I/Process(65): Sending signal. PID: 240 SIG: 3
08-01 22:56:00.655: I/dalvikvm(240): threadid=7: reacting to signal 3
08-01 22:56:00.676: I/dalvikvm(240): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:00.886: I/Process(65): Sending signal. PID: 165 SIG: 3
08-01 22:56:00.886: I/dalvikvm(165): threadid=7: reacting to signal 3
08-01 22:56:00.906: I/dalvikvm(165): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:01.142: I/Process(65): Sending signal. PID: 212 SIG: 3
08-01 22:56:01.142: I/dalvikvm(212): threadid=7: reacting to signal 3
08-01 22:56:01.256: I/dalvikvm(212): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:01.397: I/Process(65): Sending signal. PID: 179 SIG: 3
08-01 22:56:01.397: I/dalvikvm(179): threadid=7: reacting to signal 3
08-01 22:56:01.418: I/dalvikvm(179): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:01.630: I/Process(65): Sending signal. PID: 118 SIG: 3
08-01 22:56:01.630: I/dalvikvm(118): threadid=7: reacting to signal 3
08-01 22:56:01.716: I/dalvikvm(118): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:01.859: I/Process(65): Sending signal. PID: 143 SIG: 3
08-01 22:56:01.859: I/dalvikvm(143): threadid=7: reacting to signal 3
08-01 22:56:01.877: I/dalvikvm(143): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:02.135: I/Process(65): Sending signal. PID: 116 SIG: 3
08-01 22:56:02.135: I/dalvikvm(116): threadid=7: reacting to signal 3
08-01 22:56:02.176: I/dalvikvm(116): Wrote stack trace to '/data/anr/traces.txt'
08-01 22:56:02.406: W/WindowManager(65): No window to dispatch pointer action 1
08-01 22:56:02.476: W/WindowManager(65): No window to dispatch pointer action 1
08-01 22:56:02.646: I/ARMAssembler(65): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x480dd8:0x480e94] in 473574 ns
08-01 22:56:02.769: I/ARMAssembler(65): generated scanline__00000177:03515104_00001001_00000000 [ 91 ipp] (114 ins) at [0x480e98:0x481060] in 786862 ns
08-01 22:56:05.066: I/ActivityManager(65): Killing process com.xlnc.webapp (pid=227) at user's request
08-01 22:56:05.086: I/Process(65): Sending signal. PID: 227 SIG: 9
08-01 22:56:05.226: I/ActivityManager(65): Process com.xlnc.webapp (pid 227) has died.
08-01 22:56:05.226: W/ActivityManager(65): Scheduling restart of crashed service com.xlnc.webapp/.WebServerService in 83846ms
08-01 22:56:05.236: I/WindowManager(65): WIN DEATH: Window{44e72108 com.xlnc.webapp/com.xlnc.webapp.WirelessDropActivity paused=false}
08-01 22:56:05.236: I/WindowManager(65): WIN DEATH: Window{44e51758 Service Started paused=false}
08-01 22:56:05.346: E/gralloc(65): [unregister] handle 0x4811e8 still locked (state=40000001)
08-01 22:56:05.367: I/UsageStats(65): Unexpected resume of com.android.launcher while already resumed in com.xlnc.webapp
08-01 22:56:05.637: W/InputManagerService(65): Got RemoteException sending setActive(false) notification to pid 227 uid 10024
08-01 22:56:05.676: E/ActivityThread(65): Failed to find provider info for android.server.checkin
08-01 22:56:05.687: W/Checkin(65): Can't log event SYSTEM_SERVICE_LOOPING: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/events

A: The onCreate() in the Service is called from the GUI thread. You are trying to run the whole web server in the GUI thread: you not return but end up "forever" in WebServer.runServer(). For any "long" running task, you need to put this into a new, non-GUI thread, to NOT block the GUI thread.
The Thread class even gives you functions to cancel the thread, which throws an easy catchable InteruptedException for selects() and other things waiting. There is no need of some potentially dangerous STATIC "running" flag. Please always try to work around any kind of static data.


text:
Q: Kiwi-tcms v8.0 database migration problem with test runs I just migrated Kiwi tcms from v7.1 on a server A to v8.0 on a server B (I virtualized our application server).
I use a pgsql container for the db.
For the migration I used the backup-restore method.
The db volume on server B is brand new and I created the schema using /Kiwi/manage.py migrate
Then I restored the .json. But I ran into schema problem because of the changes in v8.0 of the primary key. I just replaced in the json file the old names by the new one and the restoration passed.
The application runs fine except that I have now a problem with test runs when I go to the "search for test runs" page:

DataTables warning: table id=resultsTable - Requested unknown parameter 'run_id' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4

I am not sure if I made any mistake during the migration or if there is actually a bug in the migration process.
For info: I tried on my test container in v7.3 to migrate the database in v8.0. Everything went fine but I had the same problem at the end.
Thank you by advance for you support !
EDIT 1
I solved my problem following the advice of @Alexander Todorov and restarting from scratch the migration steps:

*

*I uploaded the image of kiwi 7.1 on my docker registry so I migrated to my server B with kiwi 7.1. Now I can focus on upgrade.

*I use pgsql container, so I didn't need to update mariadb container before migrating.

*I upgraded to kiwi 8.0 using the kiwitcms/kiwi:latest image.
I am not sure why the upgrade from the 7.3 version didn't work the first time but from the 7.1 to 8.0 everything went fine.
It is possible that I backed up from 7.1 and restored on a 7.3. Everything was fine using 7.3 at this moment but I had trouble with the migration to 8.0...
Anyway, thanks for your support !
EDIT 2
I don't know how it is possible but, I can't reproduce the exact same migration on another instance. I get the issue each time I try.
What I have now:

*

*A preprod instance of kiwi working fine in v8.0

What I want:

*

*A production instance in v8.0

What I tried:

*

*Create a new instance in v8.0 and backup the preprod db to restore it on the prod => fails with the error I had before...

DataTables warning: table id=resultsTable - Requested unknown parameter 'run_id' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4

*

*Create a new instance in v7.1 and migrate in the exact same way as I did on my preprod => fails with the same error...

I am really clueless on this :/

A:
I just migrated Kiwi tcms from v7.1 on a server A to v8.0 on a server B (I virtualized our application server).

That is what is causing your problems. You are trying to restore one version of DB schema + data onto another version (on the second server). In between the 2 versions there are quite a lot of DB migrations and what you are trying to do will always lead to failure.
You can use server A and upgrade in place to the latest version, then dump the data, move to server B (with the same version) and restore the data into the clean DB and decommission server A.
You may also setup server B to have the older version of Kiwi TCMS, migrate the data there and then upgrade server B to v8.0.

A: No idea why it worked but I did the following, and everything seems to be fixed. My symptoms were exactly like those described here (7.3->8.0, mariaDB, pruned after 8.0, DataTables warning)
$ cd Kiwi
$ sudo docker exec -it kiwi_db bash
$ mysql -ukiwi -p -h 127.0.0.1 (pw kiwi from yml)

Then within mariaDB
use kiwi;
show tables;
describe testruns_testrun;
select * from testruns_testrun;

It was here I refreshed the page to pull out the ID value to look against when all of a sudden my test runs loaded. I did a
sudo docker-compose down && sudo docker-compose up -d

To verify the issue doesn't come back and it didn't. I'm no DBA, just poking around. I did make a new run from a plan, which worked until I navigated away, and tried searching for the test run. I did the above afterwards.


text:
Q: Use dbt to load JSON files into staging Is it possible to use dbt to copy data from files into the database?
I've got some files as data sources and I would like to load them into an staging layer before starting to process them.
Something such as this command in postgresql:
COPY staging.test (json_content) from 'C:\tmp\46002.json'

But as far as I see in the documentation, the models require a SELECT statement and the COPY statement fails when running dbt run

A: From raw local files? No.
Your two dbt direct data options are:

*

*Load some size limited datasets via dbt seeds which only supports csv's currently.

*load data from cloud hosted storage like s3 buckets via external-tables.

This is the best resource to explain why this application doesn't attempt to support the EL part of the ELT (Extract-Load-Transformation) process:
What is dbt - dbtLabs Blog
Without getting into tool recommendation, you'll need an additional component to your data stack to handle the extraction process for you. dbt presumes the data has been loaded into a "pre-processing" or "raw" area of your warehouse generally following Lewis Gavin's excellent architecture here:
How to architect the perfect Data Warehouse - Lewis Gavin

Edit: Additional notes on the seed data - currently comma separated is the only format supported. Some discussion in this issue about extending that to other delimiters and escape formats.
No current support for seeding json files. Also under discussion.


text:
Q: Tkinter window in front of specific window (or all windows) I'm writing a small GUI program with python in tkinter for windows.
My window has to be in front of a fullscreen game-window.
At the moment, I use this line:
self.root.attributes("-topmost", 1)

which works for normal windows (browser, explorer, ...), but if I start the game to fullscreen mode, my window is hidden behind the game.
Why does this happen? Calls the game maybe something similar to -topmost True that overrides my attribute?
Is there another solution to my problem? Maybe it is possible to tell windows, that my window should be in front of a specific window (the game window)?

A: Well, in windows according to this, you should be using the following code to make your job done:
import win32ui, win32con, win32gui
hwnd = int(eval(<toplevel>.wm_frame())) # Get the window info from the
window manager
win32gui.SetWindowPos(hwnd, win32con.HWND_TOPMOST, 0, 0, 0, 0,
win32con.SWP_NOMOVE | win32con.SWP_NOSIZE)

But for this I have my finger crossed as you know the behavior for windows program remains in mystery because its closed source..


text:
Q: Java intent send me blank page to create an application for a restaurant as an internship, i made an intent to be sent to the command page. however the intent send me a blank page. here is how the code is made:
mButtonCommande.setOnClickListener(new View.OnClickListener() {

  @Override
    public void onClick(View view) {
        OpenCommandeActivity();

    }

    });

}
private void OpenCommandeActivity() {
    Intent connect = new Intent(MainActivity.this, CommandeActivity.class);
    startActivity(connect);
}

intitially, the page is black, so if anyone could help me, thank you in advance.
here is the XML fro the starting page:
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="horizontal"></LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="horizontal">

        />

            <TableLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:stretchColumns="*">

                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />

                <TableRow
                    android:layout_width="match_parent"
                    android:layout_height="match_parent" />
            </TableLayout>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="horizontal">

            <Button
                android:id="@+id/buttonAccessCommande"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/commandAccessButton"
                app:backgroundTint="@color/orange"
                android:onClick="openCommandeActivity"
                tools:ignore="OnClick" />
        </LinearLayout>
    </LinearLayout>

and here is the Java for the second page:
package com.example.tacoskingapp;

import java.util.ArrayList;

import android.content.Intent;
import android.view.View;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.AdapterViewAnimator;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import android.widget.Toast;

public class CommandeActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener {
    private Button mButtonFinalCommande;
    private EditText mNomClient;
    private EditText mAdresseClient;
    private Spinner mListProduit;
    private ArrayList<String>ListProducts;// liste d'items ayant pour titre

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState, @Nullable PersistableBundle persistentState) {
        super.onCreate(savedInstanceState, persistentState);
        setContentView(R.layout.activity_commaande);
        mButtonFinalCommande=findViewById(R.id.button2);
       // mListProduit=findViewById(R.id.spinner_produit);
        ArrayAdapter<CharSequence>AdapterProduct = ArrayAdapter.createFromResource(this, R.array.product_array, android.R.layout.simple_spinner_item);
        AdapterProduct.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        mListProduit.setAdapter(AdapterProduct);// je connect ici mon spinner et mon adapteur
        mListProduit.setOnItemSelectedListener(this);
        Intent connect = getIntent();
    }

    @Override
    public void onItemSelected(AdapterView<?> parent, View view, int position, long l) {
    String text = parent.getItemAtPosition(position).toString();
        Toast.makeText(parent.getContext(), text, Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onNothingSelected(AdapterView<?> adapterView) {

    }
}

A: If you only want to go to Commande Activity on click button, use this.
mButtonCommande.setOnClickListener(new View.OnClickListener() {
  @Override
    public void onClick(View view) {
        OpenCommandeActivity();
    }
}

private void OpenCommandeActivity() {
    Intent connect = new Intent(MainActivity.this, CommandeActivity.class);
    startActivity(connect);
}

But if you want to add another function on the way going to Commande Activity, make sure to put the code of the function before the OpenCommandeActivity(), like this one.
mButtonCommande.setOnClickListener(new View.OnClickListener() {
  @Override
    public void onClick(View view) {
        Toast.makeText(getApplicationContext(),"OK",Toast.LENGTH_SHORT).show();
        OpenCommandeActivity();
    }
}

private void OpenCommandeActivity() {
    Intent connect = new Intent(MainActivity.this, CommandeActivity.class);
    startActivity(connect);
}

And don't forget to specify it in the AndroidManifest.xml, as below.
<activity
    android:name=".MainActivity"
    android:exported="true" />
<activity
    android:name=".CommandeActivity"
    android:exported="true" />

A: try with
setContentView(r.layout.activity_commande)


text:
Q: Postpone Synchronize Backbone.js Collection with Server I have a Backbone Collection that users are performing CRUD-type activities on. I want to postpone any changes from being propagated back to the server — the Collection.sync() should not happen until the user initiates it (like POSTING a form).
As it stands, I have been able to implement on-the-fly updates with no issue (by calling things like Model.destroy() on the models when deleted, or Collection.add() to add new models to the collection. As I understand, I could pass the {silent:true} option to my models, preventing .sync() from being called during .add()/.destroy(), but from what I can tell, that could lead to some headaches later.
I have considered overriding Backbone.sync, but I am not sure if that is the best route — I feel like there is some way to hook into some events, but I am not sure. Of course I have read through the Backbone docs, annotated source, and relevant SO questions before posting this, but I have hit a wall trying to extrapolate for this particular situation.
Eventually I will need to implement this in many places in my application, which is why I am concerned about best-practices at this stage. I am looking for some guidance/suggestions/thoughts on how to proceed with preventing the default behavior of immediately syncing changes with the remote server. Any help is appreciated — thank you for your time!
EDIT:
I went with Alex P's suggestion of refactoring: in my collection I set up some attributes to track the models that have been edited, added, or deleted. Then, when the user triggers the save action, I iterate through the lists and do the appropriate actions.

A: The first step is to ensure that your collection is being synchronised when you suspect it is. Collection.add() shouldn't trigger a Collection.sync() by default (it's not mentioned in the method documentation or the list of events, and I couldn't see a trigger in the annotated source).
Model.destroy() does trigger a sync(), but that shouldn't be a surprise - it's explicitly defined as "destroying a model on the server", and that sync() is performed on the model, not the collection. Your destroyed models will be removed from any collections that contain them, but I wouldn't expect those collections to sync() unless explicitly asked.
If your collections really are sync()ing when you're not expecting them to, then the most likely culprit is an event listener somewhere. Have you added any event listeners that call sync() for you when they see add or remove events? If your collection should sync() only on user interaction, can you remove those event listeners?
If not, then passing {silent: true} into your methods might be a viable approach. But remember that this is just stopping events from being emitted - it's not stopping that code from running. If something other than an event listener is triggering your sync()s, then preventing those events from being emitted won't stop them.
It would also be worth considering a wider refactor of your app. Right now you modify the collection and models immediately, and try to delay all sync()s until after the user clicks a button. What if you cached a list of all models to destroy & items to add, and only performed the actions when the button is clicked? Storing the model IDs would be sufficient to destroy them, and storing the collection ID and model ID would let you add items. It also means you don't have to fetch() the collection again if the user decides not to save their changes after all.


text:
Q: Normal subgroups of F Let $G=GL_3(\mathbb{C})$. Take the action of G on the set of its subgroups for conjugacy:
$g \in G$, and H a subgroups of G $g.H=gHg^{-1}={ghg^{-1}, h \in H}$
a)Let T be the subgroup of G of the diagonal matrixes. Show that the stabilizator N of T respect this action is given by the invertible matrixes that has only one coefficient not equal to 0 in each row and each column.
b)Show that T is a normal subgroup of N
c)Show that, using ismorphism theorem, that $N/T~S_3$ the group of the permutations of 3 elements
d)Generalize to $GL_n(\mathbb{C})$


text:
Q: Why it report error "DLL load failed while importing _openmm" while i have installed openmm I try to run code about molecular dynamics simulationI have installed openmm in anaconda environment
I even don't know how to try


text:
Q: ActiveMq Inflight Count not decreasing I am using activemq 5.5.0 version in my project.
I am facing one problem due to some reason my inflight count keep on increasing ,
Rate of increment is not high.
After some days it will become equal to prefetch size then my queue stops responding.
Could anyone can help me how to make inflight count 0 without deleting the queue ?

A: You can make the in-flight count go to 0 by purging the queue from the web console (there's a Purge link on each queue on the Queues page); that will delete all messages in the queue without deleting the queue itself.
That will satisfy the question as you've asked it, though I suspect it's not really what you want and what you meant was "without deleting any messages from the queue".  But if I'm wrong and this is what you wanted, then great; if not, answer my questions in the comment I added and we'll go from there.


text:
Q: get customer id by email magento2? I am using below code to get customer id by email
use Magento\Customer\Model\Session;

protected $_objectManager;
protected $currentCustomer;
protected $_customer;
protected $_storeManager;
 public function __construct(
    Session $customerSession,
    \Magento\Customer\Model\CustomerFactory $customer,
    \Magento\Framework\ObjectManagerInterface $objectmanager,
    \Magento\Store\Model\StoreManagerInterface $storeManager
)
{
    $this->session = $customerSession;
    $this->_customer = $customer;
    $this->_objectManager = $objectmanager;
    $this->_storeManager = $storeManager;
}

 public function execute()
{
  $email = 'test@gmail.com';
 $customerModel = $this->_objectManager->create('Magento\Customer\Model\Customer');
        $storeId = $this->getWebsiteId();
        $customerModel->setWebsiteId($storeId);
        $customerModel->loadByEmail($email);
        $userId = $customerModel->getId();
 }
 public function getWebsiteId(){
   return $this->_storeManager->getStore()->getWebsiteId();
}

I am not getting customerid, Please anyone suggest me, how to get customer id by email.

A: Use this below code :
protected $_customer;
protected $_storemanager;
public function __construct(
    .....
    \Magento\Customer\Model\CustomerFactory $customer,
    \Magento\Store\Model\StoreManagerInterface $storemanager,
    .....
){
    .....
    $this->_customer = $customer;
    $this->_storemanager = $storemanager;
    ...
}
public function execute() {
    $email = 'test@test.com';
    $websiteID = $this->_storemanager->getStore()->getWebsiteId();
    $customer = $this->_customer->create()->setWebsiteId($websiteID)->loadByEmail($email);
    $customerId = $customer->getId();
}

A: There is another way you can get Customer id by Customer Email.In this use service contact Class \Magento\Customer\Api\CustomerRepositoryInterface
namespace {NameSpace};

class {YOUR_CLass}
{

    /**
     * @var \Magento\Customer\Api\CustomerRepositoryInterface
     */
    protected $customerRepository;

    public function __construct(
        \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
    )
    {
        $this->customerRepository = $customerRepository;
    }

    /**
     * @return \Magento\Customer\Api\Data\CustomerInterface
     * @throws \Magento\Framework\Exception\LocalizedException
     * @throws \Magento\Framework\Exception\NoSuchEntityException
     */
    public function  getCustomer()
    {

        try{
            $customer = $this->customerRepository->get('amit@gmail.com');
            $customerId = $customer->getId();
        }catch(\Magento\Framework\Exception\NoSuchEntityException $exception){

        }catch(\Magento\Framework\Exception\LocalizedException $exception){

        }
        return $customer;
    }
}


text:
Q: Limiting the amount of fuzzy string comparisons by comparing by subgroup I have two datasets as follows:
DT1 <- structure(list(Province = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3), Year = c(2000,
2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002, 2000, 2000, 2000,
2001, 2001, 2001, 2002, 2002, 2002, 2000, 2000, 2000, 2001, 2001,
2001, 2002, 2002, 2002), Municipality = c("Something", "Anything",
"Nothing", "Something", "Anything", "Nothing", "Something", "Anything",
"Nothing", "Something", "Anything", "Nothing", "Something", "Anything",
"Nothing", "Something", "Anything", "Nothing", "Something", "Anything",
"Nothing", "Something", "Anything", "Nothing", "Something", "Anything",
"Nothing"), Values = c(0.59, 0.58, 0.66, 0.53, 0.94, 0.2, 0.86,
0.85, 0.99, 0.59, 0.58, 0.66, 0.53, 0.94, 0.2, 0.86, 0.85, 0.99,
0.59, 0.58, 0.66, 0.53, 0.94, 0.2, 0.86, 0.85, 0.99)), row.names = c(NA,
-27L), class = c("tbl_df", "tbl", "data.frame"))

DT2 <- structure(list(Province = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3), Year = c(2000,
2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002, 2000, 2000, 2000,
2001, 2001, 2001, 2002, 2002, 2002, 2000, 2000, 2000, 2001, 2001,
2001, 2002, 2002, 2002), Municipality = c("Some", "Anything",
"Nothing", "Someth.", "Anything", "Not", "Something", "Anything",
"None", "Some", "Anything", "Nothing", "Someth.", "Anything",
"Not", "Something", "Anything", "None", "Some", "Anything", "Nothing",
"Someth.", "Anything", "Not", "Something", "Anything", "None"
), `Other Values` = c(0.41, 0.42, 0.34, 0.47, 0.0600000000000001,
0.8, 0.14, 0.15, 0.01, 0.41, 0.42, 0.34, 0.47, 0.0600000000000001,
0.8, 0.14, 0.15, 0.01, 0.41, 0.42, 0.34, 0.47, 0.0600000000000001,
0.8, 0.14, 0.15, 0.01)), row.names = c(NA, -27L), class = c("tbl_df",
"tbl", "data.frame"))

I am trying to match them as follows, suggested in this link, by Arthur Yip.
library(fuzzyjoin); library(dplyr);
stringdist_join(DT1, DT2,
                by = "Municipality",
                mode = "left",
                ignore_case = TRUE,
                method = "jw",
                max_dist = 10,
                distance_col = "dist") %>%
  group_by(Municipality.x) %>%
  top_n(1, -dist)

The issue is that the code completely fries my computer, so I would like to split up the code into groups to limit the amount of string comparisons. I tried:
library(fuzzyjoin); library(dplyr);
stringdist_join(DT1, DT2,
                by = c("Municipality","Year", "State"),
                mode = "left",
                ignore_case = TRUE,
                method = "jw",
                max_dist = 10,
                distance_col = "dist") %>%
  group_by(Municipality.x) %>%
  top_n(1, -dist)

stringdist_join(DT1, DT2,
                by = "Municipality",
                mode = "left",
                ignore_case = TRUE,
                method = "jw",
                max_dist = 10,
                distance_col = "dist") %>%
  group_by(Municipality, Year, Province) %>%
  top_n(1, -dist)

But both give me the following respective errors:
Error: All columns in a tibble must be vectors.
x Column `col` is NULL.
Run `rlang::last_error()` to see where the error occurred.

And:
Error: Must group by variables found in `.data`.
* Column `Municipality` is not found.
* Column `Year` is not found.
* Column `Province` is not found.
Run `rlang::last_error()` to see where the error occurred.

What would be the proper way to do this?

A: You were on the right track - just a few typos/bugs and you need to finish changing/replacing the column names.
Also, in your first one, you will need to figure out how you want to pick the "best match" based on Municipality.dist, Province.dist, and Year.dist.
Maybe the second one works better if you get the years and provinces sorted out first.

DT1 <- structure(list(Province = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3), Year = c(2000, 2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002, 2000, 2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002, 2000, 2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002), Municipality = c("Something", "Anything", "Nothing", "Something", "Anything", "Nothing", "Something", "Anything", "Nothing", "Something", "Anything", "Nothing", "Something", "Anything", "Nothing", "Something", "Anything", "Nothing", "Something", "Anything", "Nothing", "Something", "Anything", "Nothing", "Something", "Anything", "Nothing"), Values = c(0.59, 0.58, 0.66, 0.53, 0.94, 0.2, 0.86, 0.85, 0.99, 0.59, 0.58, 0.66, 0.53, 0.94, 0.2, 0.86, 0.85, 0.99, 0.59, 0.58, 0.66, 0.53, 0.94, 0.2, 0.86, 0.85, 0.99)), row.names = c(NA, -27L), class = c("tbl_df", "tbl", "data.frame"))

DT2 <- structure(list(Province = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3), Year = c(2000, 2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002, 2000, 2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002, 2000, 2000, 2000, 2001, 2001, 2001, 2002, 2002, 2002), Municipality = c("Some", "Anything", "Nothing", "Someth.", "Anything", "Not", "Something", "Anything", "None", "Some", "Anything", "Nothing", "Someth.", "Anything", "Not", "Something", "Anything", "None", "Some", "Anything", "Nothing", "Someth.", "Anything", "Not", "Something", "Anything", "None"), `Other Values` = c(0.41, 0.42, 0.34, 0.47, 0.0600000000000001, 0.8, 0.14, 0.15, 0.01, 0.41, 0.42, 0.34, 0.47, 0.0600000000000001, 0.8, 0.14, 0.15, 0.01, 0.41, 0.42, 0.34, 0.47, 0.0600000000000001, 0.8, 0.14, 0.15, 0.01)), row.names = c(NA, -27L), class = c("tbl_df", "tbl", "data.frame"))

library(fuzzyjoin); library(dplyr);

stringdist_join(DT1, DT2,
                by = c("Municipality", "Year", "Province"),
                mode = "left",
                ignore_case = TRUE,
                method = "jw",
                max_dist = 10,
                distance_col = "dist") %>%
    group_by(Municipality.x) %>%
    slice_min(Municipality.dist)
#> # A tibble: 135 x 12
#> # Groups:   Municipality.x [3]
#>    Province.x Year.x Municipality.x Values Province.y Year.y Municipality.y
#>         <dbl>  <dbl> <chr>           <dbl>      <dbl>  <dbl> <chr>
#>  1          1   2000 Anything        0.580          1   2000 Anything
#>  2          1   2000 Anything        0.580          1   2001 Anything
#>  3          1   2000 Anything        0.580          1   2002 Anything
#>  4          1   2000 Anything        0.580          2   2000 Anything
#>  5          1   2000 Anything        0.580          2   2001 Anything
#>  6          1   2000 Anything        0.580          2   2002 Anything
#>  7          1   2000 Anything        0.580          3   2000 Anything
#>  8          1   2000 Anything        0.580          3   2001 Anything
#>  9          1   2000 Anything        0.580          3   2002 Anything
#> 10          1   2001 Anything        0.94           1   2000 Anything
#> # ... with 125 more rows, and 5 more variables: `Other Values` <dbl>,
#> #   Municipality.dist <dbl>, Province.dist <dbl>, Year.dist <dbl>, dist <lgl>

stringdist_join(DT1, DT2,
                by = "Municipality",
                mode = "left",
                ignore_case = TRUE,
                method = "jw",
                max_dist = 10,
                distance_col = "dist") %>%
    group_by(Municipality.x, Year.x, Province.x) %>%
    slice_min(dist)
#> # A tibble: 135 x 9
#> # Groups:   Municipality.x, Year.x, Province.x [27]
#>    Province.x Year.x Municipality.x Values Province.y Year.y Municipality.y
#>         <dbl>  <dbl> <chr>           <dbl>      <dbl>  <dbl> <chr>
#>  1          1   2000 Anything        0.580          1   2000 Anything
#>  2          1   2000 Anything        0.580          1   2001 Anything
#>  3          1   2000 Anything        0.580          1   2002 Anything
#>  4          1   2000 Anything        0.580          2   2000 Anything
#>  5          1   2000 Anything        0.580          2   2001 Anything
#>  6          1   2000 Anything        0.580          2   2002 Anything
#>  7          1   2000 Anything        0.580          3   2000 Anything
#>  8          1   2000 Anything        0.580          3   2001 Anything
#>  9          1   2000 Anything        0.580          3   2002 Anything
#> 10          2   2000 Anything        0.580          1   2000 Anything
#> # ... with 125 more rows, and 2 more variables: `Other Values` <dbl>,
#> #   dist <dbl>

Created on 2020-12-07 by the reprex package (v0.3.0)


text:
Q: Two TypeScript functions with static return types. Syntax differs, but they seem to do the same thing? I'm learning TypeScript and am trying to define a function with a static return type and some static parameters. Both of these definitions seem to do that, but the syntax is different. Why? Do these differ in some way that I'm missing?
// function with statically typed parameters and return type defined
function addNums(n1: number, n2: number, n3: number): void
{
    let sum = n1 + n2 + n3;
    alert(sum);
}

// This seems to accomplish the same thing but needlessly more complex
let alsoAddNums : (one: number, two: number, three: number) => void
    = function(n1, n2, n3)
    {
        let sum = n1 + n2 + n3;
        alert(sum);
    }

A: the first one is a function definition, and the second one is a variable, that has a function assigned to it. that's what you do, if you need to store a reference to a function:
function addNums(n1: number, n2: number, n3: number): void
{
    let sum = n1 + n2 + n3;
    alert(sum);
}

let alsoAddNums : (one: number, two: number, three: number) => void = addNums

interaction with both of them is identical.


text:
Q: Must an Akka actor distinguish whether, when a message is passed, a returned future is expected? As I understand it, an actor can be sent a message "fire and forget" style with the ! operator, or "Send-And-Receive-Future" style with the ? operator. An actor that is passed a message via ? must call a self.reply or the sender will receive a timeout exception. On the other hand, an actor that is passed a message via ! cannot have self.reply if the message is not being passed from another actor.
My question is, is the Actor supposed to know at compile time whether it will be invoked with ! or ? ??? Or if the necessity of self.reply can be determined at runtime, how can this be determined? Perhaps self.tryReply is involved, but the akka documentation seems to imply that a failed attempt to reply is an error case, whereas if the sender is not an actor, it is not really an error to fail to reply if the message is passed with !
Edit:
Here's some code:
package akTest

import akka.actor.Actor

object Main1 {
  val worker = Actor.actorOf[ak].start()

  def main(args: Array[String]) {
    val resp = worker ? "Hi"
    resp.get
    println(resp)
  }
}

class ak extends Actor {
  def receive = {
    case msg:String  => {
      val response = "Received: " + msg
      println(response)
      response
    }
  }
}

This gets
Exception in thread "main" akka.dispatch.FutureTimeoutException: Futures timed out after [4995] milliseconds
So I add a self.reply to the actor:
class ak extends Actor {
  def receive = {
    case msg:String  => {
      val response = "Received: " + msg
      println(response)
      self.reply(response)
      response
    }
  }
}

This change fixes the timeout error. But now if I have a Main2 which sends a fire and forget message:
object Main2 {
  val worker = Actor.actorOf[ak].start()

  def main(args: Array[String]) {
    val resp = worker ! "Hi"
    println(resp)
  }
}

, a new error is produced: [ERROR]   [2/1/12 2:04 PM] [akka:event-driven:dispatcher:global-1] [LocalActorRef]
   No sender in scope, can't reply.
How can I write my actor to eliminate the coupling between its manner of response and the sender's method of invoking? I don't want to have 1 version of the actor for ! and a second version of the actor for ?

A: if senderFuture.isDefined then you have a future to reply to