text:
Q: Transition matrix calculation from text book "Introduction to information retrieval" According to the example on page in  the text book, the graph of documents is as follows:
$1\rightarrow2, 3\rightarrow2, 2\rightarrow1, 2\rightarrow3$ with $\lambda = 0.5$ which would form an adjacency matrix as follows:
Then if we multiply the $\lambda$ by $$A = \begin{bmatrix} 0&1 &0 \\ 1&0 &1 \\ 0&1 &0 \end{bmatrix}$$ we would get a matrix:
$$A = \begin{bmatrix} 0&1/2 &0 \\ 1/2&0 &1/2 \\ 0&1/2 &0 \end{bmatrix}$$
Now if we add $\frac{1 - \lambda}{N}$ to the matrix A, we would get a transition matrix
$$P = \begin{bmatrix} 1/6&2/3 &1/6 \\ 2/3&1/6 &2/3 \\ 1/6&2/3 &1/6 \end{bmatrix}$$ According to the book, the transition probability matrix of surfer's walk with teleportation is:
$$P = \begin{bmatrix} 1/6&2/3 &1/6 \\ 5/12&1/6 &5/12 \\ 1/6&2/3 &1/6 \end{bmatrix}$$
I got the answer by:

*

*Dividing each 1 in A by the number of 1s in its row.

*Multiply the resulting matrix by $1 - \lambda$

*Add $\frac{\lambda}{N}$

My transition matrix and one form book are a bit different. What are the calculations behind the books matrix?

A: I think I know where I went wrong. This is how the graph looks like:

Now we need to create an adjacency matrix based on the number of outgoing links of a page.
so the graph looks something like:

We assign each outgoing link of node 2, a probability of $0.5$ since each link has an equal chance of the emission. In simple words, we assign $\frac{1}{L}$ to each outgoing link of the particular node, where $L$ is the number of outgoing links of that node. The matrix $A$ would look something like:
$$ A = \begin{bmatrix} 0 & 1 &0 \\ 1/2 & 0 & 1/2 \\ 0 & 1 & 0 \end{bmatrix} $$
This would give the correct answer.


text:
Q: Is it ok to use "what's" instead of "what does"? Actually is this construction common in NY English?

A: It would depend on the context. In an informal situation between a group of close friends discussing a Rube Goldberg machine, most people would consider it perfectly acceptable to say:

What's it do?

insted of:

What does it do?

On the other hand, in a formal situation such as  a corporate tour of an engineering workshop when the chief engineer is taking questions on machines, it would probably be in-appropriate to say:

What's it do?

Therefore it would be better to say:

What does it do?

From this we can deduce that context is everything. The first phrase is appropriate in an informal context and but is in-appropriate in a formal context.
As a general rule use the more formal phrase over the informal phrase if you are unsure of the formality of the context.
P.S. (Post Script) Please feel free to correct my spelling/grammar/formatting as I am dyslexic and so am not good at things.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Not able to cache the entity object in Doctrine using Zend framework 2 I tried caching the Doctrine entity object using zend cache service.
It works fine if the entity object does not have any foreign key reference but fails when the
entity object has a foreign key reference and points to an entity belonging to different namespace.
It was throwing this error -
The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition DoctrineORMModule\Proxy__CG__\Attachment\Entity\Attachment of the object you are trying to operate on was loaded before unserialize() gets called or provide a __autoload() function to load the class definition in /home/vaishnavi/NetBeansProjects/testsuite/module/Test/view/test/test/view-test-case.phtml
Fixed the above error by autoloading the proxy classes in init_autoloader.php by providing this -
use Doctrine\ORM\Proxy\Autoloader;

$proxyDir = __DIR__."/data/DoctrineORMModule/Proxy";
$proxyNamespace = "DoctrineORMModule\Proxy";
Autoloader::register($proxyDir, $proxyNamespace);

Now the above error does not come but does not display the property values of foreign key reference class. Can somebody help?

A: Serializing doctrine entities is not recommended. You can read more about it here.
As an alternative solution you could just hydrate entity with all necessary associations to array and then cache it.


text:
Q: How to display data in angular js by using ng-table along with dynamic data-title with nested array Below is the json which I need to populate in the ng - table. Column name should be dynamic
var data = [
          {
          "name": "abc",
          "Data": [
            {key: "FIRST_COL", value: 50},
            {key: "SECOND_COL", value: 10},
            {key: "THIRD_COL", value: 30},
            {key: "FOURTH_COL", value: 40}
          ]
          }, {
            "name": "xyz",
            "Data": [
            {key: "FIRST_COL", value: 300},
            {key: "SECOND_COL", value: 20},
            {key: "THIRD_COL", value: 400},
            {key: "FOURTH_COL", value: 60}
            ]
          }
            ];

And table should be like this :
Table structure :
FIRST_COL    SECOND_COL     THIRD_COL       FOURTH_COL
50              10              30              40
300             20              400             60

A: you can use ng-repeat to populate the data.
Demo

angular.module("app",[])
.controller("ctrl",function($scope){

$scope.tableData = [
          {
          "name": "abc",
          "Data": [
            {key: "FIRST_COL", value: 50},
            {key: "SECOND_COL", value: 10},
            {key: "THIRD_COL", value: 30},
            {key: "FOURTH_COL", value: 40}
          ]
          }, {
            "name": "xyz",
            "Data": [
            {key: "FIRST_COL", value: 300},
            {key: "SECOND_COL", value: 20},
            {key: "THIRD_COL", value: 400},
            {key: "FOURTH_COL", value: 60}
            ]
          }
            ];
})

      {{val.key}}

      {{val.value}}


text:
Q: Looking for good book similar Stability/Conditioning in Numerical Linear Algebra I am currently reading Numerical Linear Algebra by Trefethen and Bau and I am finding it quite difficult to read. In particular, I have been trying to read the sections on Floating Point Arithmetic, Stability, and Conditioning, and they are pretty confusing to me; it has taken me 3-4 hours to go through the four pages on floating point arithmetic, and there are still a couple things I am unclear on.
I am looking for a book which goes over similar material as Trefefthen and Bau, but  which fleshes things out a bit more.
Thanks!

A: You might be interested in "Things Every Programmer Should Know About Floating Point Arithmetic" : https://www.itu.dk/~sestoft/bachelor/IEEE754_article.pdf
As for stability / conditioning, these are pretty universal topics in numerical analysis, my recommendation is the next time you're near the library is to just go browse through some books (QA297-299) and see what looks friendly.


text:
Q: Produce a report with the details of borrowers who currently have books overdue I am grateful you are here to contribute in my learning.
I currently have an assgnment in dataBase course. My real problem is understanding the question.I have a table named as Borrower with details in it.Borrower (borrowerNo,borrowerName, borrowerAddress). Also I have another table called BookLoan (copyNo,dateOut,dateDue,borrowerNo). borrowerNo is the foreign key.
The question is asking to produce a report with details of the borrowers who have books overdue.
I am confused because we  dont have such info displayed in the table?

A: Is the key not in the field dateDue? If this is lower than the current time then the book is overdue.
So its a join between Borrower and Bookloan on the borrowerNo key with a WHERE clause to filter on the dueDate column.
Don't want to spoil your learning by answering the question for you, just point in the right direction. Post back if you're still stuck.
Regards,
James

A: In your table structures, you cant identify which are overdue.
Because there is no field that will identify if the books are returned or not.
Borrower - is the lists of borrowers
BookLoan - is the lists of borrowers who borrowed books from date (dateOut) and expected return of books (dateDue).
If the books was returned beyond the dateDue then it is overdue - so you can not determined overdue books by looking @ the field dateDue alone.  You need to compare it with the dateReturn - which is not existing in your structure.
    //BookLoan (copyNo,dateOut,dateDue,borrowerNo,dateReturn)
    //dateReturn will be the tagging if the borrowed books by borrowerNo has returned the books borrowed.
    //by then you can determined which books are overdue if
    1. dateDue is already reached (passed by parameter) and the dateReturn is blank or empty
    2. dateReturn is greater than dateDue


text:
Q: How to deal with data inconsistencies for a categorical variable? I have a categorical column with 2 similar data entries: "Mobile Phone" & "Phone" but recorded as 2 different entries. How do I change one of the entries without affecting the other entries (in R)?
For example, I would want to change all "Phone" entries into "Mobile Phone".
Below are my codes that I tried but it somehow it changed my other categorical values to a NA:
dataset2$PreferredLoginDevice <- factor(dataset2$PreferredLoginDevice,
                      levels = 'Phone',
                      labels = 'Mobile Phone')

Summary statistics of my categorical column


text:
Q: Can't install Ubuntu on VAIO T13 (Window 7) I've tried to install Ubuntu on my VAIO T13 (Ivy Bridge) Windows 7 laptop using windows installer but it doesn't work. After the system restarts, it said that I don't have the root folder and advised me to change in the partition (which I don't understand)
What should I do next?
P.S.
1) I've read this solution but I don't understand
http://ubuntuforums.org/showthread.php?t=2127699
2) I'm very new to Linux, so may I have a bit detailed process please
Thank You

A: This may or may not be helpful, but I had to open my bios and set anti theft to disabled before I could install Ubuntu. Before I did that Ubuntu could not detect the hard drive.


text:
Q: How to make progress dialog for database copying? I have a game with a sqlite database, 10MB large. So, after installing the game, and upon first game start the database is being copied to internal memory and that takes a while, maybe 30 seconds, with black screen. This is pretty bad cause a user can think that the game froze. I was thinking, is there a way to show something like on the image below, saying "Copying DB in progress" or something, once the main menu opens? And how can I do that?
I'm copying my db from Assets folder using this code:
TestAdapter mDbHelper = new TestAdapter(this);
        DataBaseHelper myDbHelper = new DataBaseHelper(this);

        if(!myDbHelper.checkDataBase()){
        mDbHelper.createDatabase();
        }

A: Progress bar can be used with asyncTask. As you know the UI thread should be spared
 from heavy operation that can affect the responsiveness of the UI. Now this is when you
 use worker threads.
It can be very easy to use progressBar with async task... But since u didnt want asyncTask here is one example.
  btnStartProgress = (Button) findViewById(R.id.btnStartProgress);//the button that starts your function
    btnStartProgress.setOnClickListener(
             new OnClickListener() {

       @Override
       public void onClick(View v) {

        // prepare for a progress bar dialog
        progressBar = new ProgressDialog(v.getContext());
        progressBar.setCancelable(true);
        progressBar.setMessage("File downloading ...");
        progressBar.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        progressBar.setProgress(0);
        progressBar.setMax(100);
        progressBar.show();

        //reset progress bar status
        progressBarStatus = 0;

        //reset filesize
        fileSize = 0;

        new Thread(new Runnable() {
          public void run() {
            while (progressBarStatus < 100) {

              // process some tasks
              progressBarStatus = doSomeTasks();

              // your computer is too fast, sleep 1 second
              try {
                Thread.sleep(1000);
              } catch (InterruptedException e) {
                e.printStackTrace();
              }

              // Update the progress bar
              progressBarHandler.post(new Runnable() {
                public void run() {
                  progressBar.setProgress(progressBarStatus);
                }
              });
            }

            // ok, file is downloaded,
            if (progressBarStatus >= 100) {

                // sleep 2 seconds, so that you can see the 100%
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }

                // close the progress bar dialog
                progressBar.dismiss();
            }
          }
           }).start();

           }

            });

    }

// file download simulator... a really simple
public int doSomeTasks() {

    while (fileSize <= 1000000) {

        fileSize++;

        if (fileSize == 100000) {
            return 10;
        } else if (fileSize == 200000) {
            return 20;
        } else if (fileSize == 300000) {
            return 30;
        }
        // ...add your own

    }

    return 100;

}

Click here for the sourcecode.
EDIT:
Check this tutorial .Click here.


text:
Q: NHibernate inner Join an Oracle and Sql Server Database I am building an object from multiple datasources. Does anyone know whether this is possible in NHibernate and how. I should mention that one source is SQL the other ORACLE.

A: If you are able to create a database link on the Oracle database, NHibernate should be able to effectively pick up the objects from either database. I have used a similar pattern, although connecting to two instances of Oracle.


text:
Q: Having a problem encrypting password from a Spring Boot using OpenShift I'm trying to deploy a Spring Boot app reading encrypted password for my database details using OpenShift.
Here is my application.yml looks like
  jpa:
    hibernate:
      ddl-auto: none

  datasource:
    username: admin
    password: '{cipher}600547f6485119b897e2fbeaee2786addb7550d967f2841f1643ws9'
    driver-class-name: org.postgresql.Driver ```
i'm getting this error

``` 19-06-20 15:08:58.683  WARN 1 --- [io-8888-exec-10] o.s.c.c.s.e.CipherEnvironmentEncryptor   : Cannot decrypt key: spring.jpa.datasource.password (class java.lang.IllegalStateException: Unable to invoke Cipher due to bad padding)
2019-06-20 15:12:06.884  WARN 1 --- [nio-8888-exec-9] o.s.c.c.s.e.CipherEnvironmentEncryptor   : Cannot decrypt key: spring.datasource.password (class java.lang.IllegalStateException: Unable to invoke Cipher due to bad padding)
2019-06-20 15:12:29.940  WARN 1 --- [io-8888-exec-10] o.s.c.c.s.e.CipherEnvironmentEncryptor   : Cannot decrypt key: spring.jpa.datasource.password (class java.lang.IllegalStateException: Unable to invoke Cipher due to bad padding)
2019-06-20 15:12:55.770 WARN 1 --- [nio-8888-exec-7] o.s.c.c.s.e.CipherEnvironmentEncryptor : Cannot decrypt key: spring.datasource.password (class java.lang.IllegalStateException: Unable to invoke Cipher due to bad padding) ```

A: Please check whether you configured JCE in your system and also verify whether encrypt-key was presented in bootstrap.yml file .


text:
Q: cx_freezer with subroutine I have a problem, I have a python script that runs just fine when I run it, but I'm trying to create an executable it crashes.
setup.py
import sys
from cx_Freeze import setup, Executable
import os

os.environ['TCL_LIBRARY'] = r'C:\Users\x_sal\Anaconda3\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Users\x_sal\Anaconda3\tcl\tk8.6'

build_exe_options = {"packages": [
    "os",
    "sys",
    "matplotlib",
    "subprocess",
    "serial",
    "numpy",
    "msvcrt",
    "time",
    "dataCollectionE"
    ]}

setup(
    name = "Data Collection",
    version = "1",
    description = "Read data from Arduino",
    options = {"build_exe": build_exe_options},
    executables = [Executable("dataCollection.py")])

dataCollection.py
if __name__ == "__main__":
    fid = fileN()
    dir = os.path.dirname(os.path.abspath(sys.argv[0])))
    cmdline = 'python -c "from dataCollection import printSerial; printSerial() "'
    rc = call("start cmd /K " + cmdline, cwd=dir, shell=True) # run `cmdline` in `dir`
    while fid == fileN():
        time.sleep(1)
    livePlot(dados = "f")

livePlot is a function that makes a live plot and printSerial is to read for COM4.
When I run
rc = call("start cmd /K " + cmdline, cwd=dir, shell=True)

my objective is to open a new command window and run that, once the two processes can't run in the same cmd. This works properly if I just run it, but when it is an exe it gives an error:
ModuleNotFoundError: No module named 'dataCollection'

If someone thinks the rest of the code is relevant let me know, since it is a bit extensive I'm not posting it for now.
Thank you.


text:
Q: Asp. Net: Testing Concurrency We have a website where companies have to upload zip files, and after the file is uploaded, the application check some things on the database, and then make some inserts.
The problem is that given the highen concurrency, the website is working really bad, and after speaking with the infraestructure team, we decided to re-design and re-develop the asp .net web application.
So, we are developing the application, and for avoiding the concurrency problem we had, i would like to know how can i test concurrency (telling a lot of people to upload files to the website is not an option) and monitor...
This is the first time i am doing something like this, so, i will appreciate ideas, articles, etc.

A: The short simple and straightforward answer is Jmeter or e.g. NeoLoad. You may also consider Visual Studio web tests as an option if you have the Ultimate edition.
However I personally would just start with coding this in C# and paralleling the execution. Don't know your background, but since there's [C#] tag in question...
    private volatile int threads;

    [TestMethod]
    private void Main()
    {
        const int threadCount = 10;
        for (int i = 0; i < threadCount; i++)
        {
            ++threads;
            new Thread(LoadFile).Start();
        }
        while (threads > 0)
        {
            Thread.Sleep(10);
        }
    }

    private void LoadFile()
    {
        var watch = Stopwatch.StartNew();
        //todo: do POST call
        Console.WriteLine(watch.ElapsedMilliseconds);
        --threads;
    }

Take this as a starting point, this is definitely not something finished/ready for production. Logging, timing accumulation, threads count, replacing volatile int with EventWaitHandles...
Hope this helps.

A: The problem
The issue you're facing is indicating a much larger issue at hand... You could attempt to tackle it using Unit tests and optimizing things, but that's just sweeping the issue under the carpet...
You need a new approach from an architectural perspective, begin integrating a more service-oriented architecture. With the information you've provided, it's apparent that you have one web application attempting to take on too many responsibilities. You need to start splitting up responsibilities to different services and spread the load.

The solution
You don't have to instantly process everything on the main web application, and attempting to do so will always bite back.
You can't control how many users will upload a document at any given moment, but you can manage the processing side of things which is where your issue is occurring.
Whenever a user uploads a file, store it, and add it to a queue to be processed by a different service, so from the web application you would add the document that's been uploaded to a queue, then a separate service that is running independently can go and process this item at the rate that you specify


text:
Q: Discrete Random Variable measure theoretic I'm reading a book on measure foundations for probability theory.
On a page, after defining r.v. as measurable functions, speaking of the probability distribution associated with the r.v., the authors define a r.v. like this:
$X(\omega)=a$, with probability p.
$X(\omega)=b$, with probability (1-p).
This doesn't seem like a proper definition, since 'with prob. p' could be translated into '$P(X^{-1}(B))=p$, when $a\in B$ '. So, we're defining $X$ with itself, but not in a consistent way I think...
Is there a way to define it without itself?
Any help would be appreciated.

A: $X(\omega)=a$ with probability $p$ means, that $X(\omega)=a$ for all $\omega \in \Omega_a$, such that $P(\Omega_a)=p$. Similarly you define $X(\omega)=b$ for all $\omega \in \Omega_b$, such that $P(\Omega_b)=1-p$. Now we can see, that we defined r.v. $X$ on set of measure 1 (the intersection of $\Omega_a$ and $\Omega_b$ is clearly empty if $a \neq b$). Therefore it is proper definition of r.v.
Edit:
To defined $\Omega_a$ and $\Omega_b$ first you have to define $\Omega$ and $P$. Since you did not do it, I define the space $\Omega$ having just two elements  $\Omega=\{\omega_a,\omega_b\}$ and $P(\omega_a)=p$ and $P(\omega_b)=1-p$ and then I define $X(\omega_a)=a$ and $X(\omega_b)=b$.
But you must accept, that this concept with space $\Omega$ is abstract, and in dealing with r.v. you do not need to know (in fact you do not care) about what $\Omega_a$ is exactly, you just need to know its measure.
Also to your example:
$$P(X^{-1}(B))=P(\{\omega \in \Omega :X(\omega) \in B\}$$
so we immediately see, that for borel $B$ we have 4 cases:
$P(X^{-1}(B))=1$ if both $a,b \in B$,
$P(X^{-1}(B))=p$ if $a \in B$ and $b \notin B$,
$P(X^{-1}(B))=1-p$ if $a \notin B$ and $b \in B$,
$P(X^{-1}(B))=0$ if both $a,b \notin B$.


text:
Q: How To CustomToken - Cocoa with Objective-C or MacRuby I try to build an Input which is able to show one or more Token at the beginning of line.
You can see an example what I'm trying to receive in the image below. (screenshot shows google-macsearch)
http://www.freeimagehosting.net/uploads/4a268855a0.jpg
Cocoa provides the NSToken class, but I like to do it by myself and custom, but I don't know what or how to do.
I tempt to draw the Token. This works fine, but now its on my View and without any functionality. I expect i shout place it somehow into the TextView.
I hope you will give me a hint.
Salut

A: This is what the NSTokenField class is for.  Basically, the token field asks its delegate for information about its tokens, and then draws the tokens itself.

A: There is a sample, a little tweak can help in your way.
SSToken - A custom NSTokenField
Download the sample, you will find a class called SSToken. Include the class in your project.
Since SSToken is built on composition with NSTextField and interface is similar like NSTokenField, it would be easier for you to customise the tokens and show it in the way you wanted.
It also grows vertically on adding new tokens like in native Mail App.


text:
Q: how can i kill other tasks when i click on new button? I'm developing an android application, so i have a nice GUI with many buttons. Every one when clicked, declenche w new task to load data from distant server (for that i'm using Hessian). for more detail: supposing we have two buttons:

*

*the first one for loading Events and the other for doing something else.

*when i click on the first one and before the load is complete, i clicked on the other button.

*at that time i want to annulate the first task(i'm using AsyncTask) and start the second.
How can i do it?


text:
Q: How to check if a suspend function has completed executing Hello I have a suspend function updateUserWithNewPersonalDetails(), I want check if the function has been executed and once executed I want to call success() function.
I am unable to use invokeOnCompletion  on the function call
How can I do this please or what is the other way I can call success() function once updateUserWithNewPersonalDetails is executed
suspend function
suspend fun updateUserWithNewPersonalDetails(details: PersonalDetails) {
    userDao.get().collect { cachedUser ->
        val updatedCachedUser = UserDB(cachedUser.id, ...)
        userDao.save(updatedCachedUser)
    }
}

from viewmodel I want to call the above function and on success or invoke successfull I want to call success function
 userRepo.updateUserWithNewPersonalDetails(details). invokeOnCompletion{

                        success()
}

Thanks
R

A: Currently your function updateUserWithNewPersonalDetails never completes because the Flow returned by Room never completes (it monitors for DB changes forever).
Assuming you are interested only in the first change you can do:
suspend fun updateUserWithNewPersonalDetails(details: PersonalDetails) {
        val cachedUSer = userDao.get().first() // this will get the current value from the DB
        val updatedCachedUser = UserDB(cachedUser.id, ...)
        userDao.save(updatedCachedUser)
    }

Here first() gets the current value from the DB (or throws if it doesn't exist) and does NOT observe forever. Alternatively you can use firstOrNull().
Then your other function becomes:
updateUserWithNewPersonalDetails()
success()


text:
Q: how to install SCIP I use YALMIP which has to use SCIP to solve my problem. I don't know how to install it on my computer(Win 7).  I have download it and the install file told me to enter "make" in my computer.
Where should I enter this commend? I typed it in "matlab" and "CMD". But it didn't work.

A: make is a UNIX tool. You cannot use it under Windows unless you're inside a Linux/UNIX environment like Cygwin.
If you want to install SCIP on Windows you need to compile the code first, e.g. using Visual Studio.
Another possibility might be to use the precompiled binaries/executables of the previous version SCIP 3.1.0.

A: From the YALMIP Wiki entry SCIP:

To use the solver in YALMIP and MATLAB, a mex interface is required. YALMIP uses the interface available in the OPTI Toolbox.


text:
Q: EntityFrameworkCore tracks changes on NoTrackingBehavior MyContext.cs
public class MyContext: DbContext
{
    public MyContext(DbContextOptions<DBContext> options) : base(options)
    {
        ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
        ChangeTracker.LazyLoadingEnabled = false;
        ChangeTracker.AutoDetectChangesEnabled = false;
        this.Database.EnsureCreated();
    }
}

BaseRepository.cs
 public abstract class BaseRepository<TDBEntity> where TDBEntity : class, new()
 {
        protected readonly MyContext dbContext;

        public BaseRepository(MyContext dbContext)
        {
            this.dbContext = dbContext;
        }

        public virtual void Update(TDBEntity model)
        {
            dbContext.Entry(model).State = EntityState.Modified;
        }

        public Task CommitAsync()
        {
            return dbContext.SaveChangesAsync();
        }
  }

If I update the same entity two times, I will get the following error:
 The instance of entity type 'Foobar' cannot be tracked because another instance with the same key value for {'Id'} is already being tracked.
 When attaching existing entities, ensure that only one entity instance with a given key value is attached. Consider using 'DbContextOptionsBuilder.EnableSensitiveDataLogging' to see the conflicting key values.

I am on a 'connected DbContext scenario' but I don't want any tracking behaviour. I want to use EntityFrameworkCore for 'just' generating SQL-Statements.

A: If you check the QueryTrackingBehavior enum docs for NoTracking you will see next:

The change tracker will not track any of the entities that are returned from a LINQ query. If the entity instances are modified, this will not be detected by the change tracker and SaveChanges() will not persist those changes to the database.

So it is responsible for "automatic" change tracking for instances returned by your queries, to do updates and inserts EF still will need to track entities and with dbContext.Entry(model).State = EntityState.Modified; you attach entity (and all references to other entities which it has as written in this doc) to context so it starts tracking this entity and marks it as modified.

A: Well, it is a tricky thing. I have debugged EF Core sources for several hours to find better way, but with no luck.
Problem that ChangeTracker searches for EntityEntry by the reference. If not found by reference it searches by entity keys and if entry found - you have this exception.
So, these extension methods are born. Not super effective even using Internals, but it shows how to do that.
public static class ChangeTrackerExtensions
{
    public static EntityEntry<T> GetEntry<T>(this DbContext ctx, T entity, out bool isNew) where T : class
    {
        var entityType = ctx.Model.FindEntityType(typeof(T));
        var stateManager = ctx.GetService<IStateManager>();

        isNew = false;
        foreach (var key in entityType.GetKeys())
        {
            var keyArray = key.Properties
                .Where(p => p.PropertyInfo != null || p.FieldInfo != null)
                .Select(p =>
                    p.PropertyInfo != null
                        ? p.PropertyInfo.GetValue(entity)
                        : p.FieldInfo.GetValue(entity)).ToArray();

            if (keyArray.Length == key.Properties.Count)
            {
                var entry = stateManager.TryGetEntry(key, keyArray);

                if (entry != null)
                {
                    return ctx.Entry((T)entry.Entity);
                }
            }
        }

        isNew = true;
        var newEntry = ctx.Entry(entity);

        return newEntry;
    }

    public static EntityEntry<T> UpdateEntry<T>(this DbContext ctx, T entity) where T : class
    {
        bool isNew;
        var entry = ctx.GetEntry(entity, out isNew);

        if (isNew)
        {
            entry.State = EntityState.Modified;
        }
        else
        {
            entry.CurrentValues.SetValues(entry);
        }
        return entry;
    }
}

So, update in your case should looks like
   public virtual void Update(TDBEntity model)
   {
       dbContext.UpdateEntry(model);
   }


text:
Q: Having Trouble Showing New Assets So, when I was changing the assets throughout my application, for some odd reason, when I build my application some old versions of image assets are incorrectly used throughout my application. They are not even present anywhere within the application's directory.
Note: These image assets had used the same names as the old versions.
EDIT: This is only the behavior for images used for the "selected" states of buttons throughout my app.

A: 1 - Check in derived data folder of your project - accessible from organizer.
2 - Check your iOS simulator folder (~/Library/Application Support/iPhone Simulator/Username/) for your app and see what version of images it shows. Reset iOS simulator and launch your app again.
3 - Restart XCode.


text:
Q: Reveal modal positioned wrong when using jQuery Isotope I have this issue on a couple of projects, both times using jQuery Isotope in conjunction with Zurb Foundation, and specifically the Reveal plugin for displaying a modal.
http://www.budeblog.com
In the Videos launched in a modal appear to have incorrect z-index, and be positioned somehow relative to their parent container, rather than being presented in the center of a full screen overlay, as would be the expected behaviour. Also, some of the subsequent items are still shown, on top of the overlay. The overlay was working normally until Isotope was introduced.
I've added 'animationEngine: jQuery' to make sure CSS transitions are not used.
Stumped at this point. Any ideas welcome, thanks.

A: Never did get Reveal.js to work but seemingly using Fancybox as the overlay in combination with the Recommended CSS at the bottom of http://isotope.metafizzy.co/docs/filtering.html seems to be working ok.
Also Fancybox stops the video (I need to output Vimeo embeds via WordPress) automatically on close of the overlay, which Reveal required an extra function for, so a better solution in both respects.


text:
Q: java.security.NoSuchAlgorithmException: RIPEMD160 MessageDigest not available We have a project where it initializes various algorithms while starting the an saml application. While starting, it throws the below error (please check the log) of not getting RIPEMD160,HMACRIPEMD160 and RIPEMD160withRSA. I tried to dig in for RIPEMD160 and found that the RIPEMD160 is mapped to the URL "http://www.w3.org/2001/04/xmlenc#ripemd160" in the DigestMethod.java file inside the rt.jar.
But could not find the cause of why the only algorithms failing are RIPEMD160, RIPEMD160withRSA, HMACRIPEMD160 and not the others.
14:28:38.930 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'BlockEncryption' with URI 'http://www.w3.org/2001/04/xmlenc#tripledes-cbc': org.opensaml.xmlsec.algorithm.descriptors.BlockEncryptionDESede
    14:28:38.930 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#tripledes-cbc
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmldsig-more#md5': org.opensaml.xmlsec.algorithm.descriptors.DigestMD5
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#md5
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmlenc#ripemd160': org.opensaml.xmlsec.algorithm.descriptors.DigestRIPEMD160
    14:28:38.931 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#ripemd160
    14:28:38.944 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - AlgorithmDescriptor failed runtime support check: http://www.w3.org/2001/04/xmlenc#ripemd160
    java.security.NoSuchAlgorithmException: RIPEMD160 MessageDigest not available
        at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)
        at java.security.Security.getImpl(Security.java:695)
        at java.security.MessageDigest.getInstance(MessageDigest.java:167)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.checkRuntimeSupports(AlgorithmRegistry.java:267)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.index(AlgorithmRegistry.java:203)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.register(AlgorithmRegistry.java:138)
        at org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer.init(GlobalAlgorithmRegistryInitializer.java:49)
        at org.opensaml.core.config.InitializationService.initialize(InitializationService.java:56)
        at com.practicehs.common.IQConnectAuth.SamlHelper.init(SamlHelper.java:111)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.createSamlHelper(SamlAssertionFixture.java:138)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.<init>(SamlAssertionFixture.java:119)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1270)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.main(SamlAssertionFixture.java:501)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    14:28:38.944 [main] INFO org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmlenc#ripemd160
    14:28:38.948 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2000/09/xmldsig#sha1': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA1
    14:28:38.948 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2000/09/xmldsig#sha1
    14:28:38.949 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmldsig-more#sha224': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA224
    14:28:38.949 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#sha224
    14:28:38.949 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmlenc#sha256': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA256
    14:28:38.949 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#sha256
    14:28:38.950 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmldsig-more#sha384': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA384
    14:28:38.950 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#sha384
    14:28:38.950 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'MessageDigest' with URI 'http://www.w3.org/2001/04/xmlenc#sha512': org.opensaml.xmlsec.algorithm.descriptors.DigestSHA512
    14:28:38.950 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#sha512
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-md5': org.opensaml.xmlsec.algorithm.descriptors.HMACMD5
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-md5
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160': org.opensaml.xmlsec.algorithm.descriptors.HMACRIPEMD160
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160
    14:28:38.951 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - AlgorithmDescriptor failed runtime support check: http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160
    java.security.NoSuchAlgorithmException: Algorithm HMACRIPEMD160 not available
        at javax.crypto.Mac.getInstance(Mac.java:181)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.checkRuntimeSupports(AlgorithmRegistry.java:263)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.index(AlgorithmRegistry.java:203)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.register(AlgorithmRegistry.java:138)
        at org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer.init(GlobalAlgorithmRegistryInitializer.java:49)
        at org.opensaml.core.config.InitializationService.initialize(InitializationService.java:56)
        at com.practicehs.common.IQConnectAuth.SamlHelper.init(SamlHelper.java:111)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.createSamlHelper(SamlAssertionFixture.java:138)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.<init>(SamlAssertionFixture.java:119)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1270)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.main(SamlAssertionFixture.java:501)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    14:28:38.952 [main] INFO org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmldsig-more#hmac-ripemd160
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2000/09/xmldsig#hmac-sha1': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA1
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2000/09/xmldsig#hmac-sha1
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha224': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA224
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-sha224
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha256': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA256
    14:28:38.952 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-sha256
    14:28:38.953 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha384': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA384
    14:28:38.953 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-sha384
    14:28:38.953 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Mac' with URI 'http://www.w3.org/2001/04/xmldsig-more#hmac-sha512': org.opensaml.xmlsec.algorithm.descriptors.HMACSHA512
    14:28:38.953 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#hmac-sha512
    14:28:38.954 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'KeyTransport' with URI 'http://www.w3.org/2001/04/xmlenc#rsa-1_5': org.opensaml.xmlsec.algorithm.descriptors.KeyTransportRSA15
    14:28:38.954 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#rsa-1_5
    14:28:38.954 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'KeyTransport' with URI 'http://www.w3.org/2009/xmlenc11#rsa-oaep': org.opensaml.xmlsec.algorithm.descriptors.KeyTransportRSAOAEP
    14:28:38.954 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2009/xmlenc11#rsa-oaep
    14:28:38.955 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'KeyTransport' with URI 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p': org.opensaml.xmlsec.algorithm.descriptors.KeyTransportRSAOAEPMGF1P
    14:28:38.955 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p
    14:28:38.955 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2000/09/xmldsig#dsa-sha1': org.opensaml.xmlsec.algorithm.descriptors.SignatureDSASHA1
    14:28:38.955 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2000/09/xmldsig#dsa-sha1
    14:28:38.956 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2009/xmldsig11#dsa-sha256': org.opensaml.xmlsec.algorithm.descriptors.SignatureDSASHA256
    14:28:38.956 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2009/xmldsig11#dsa-sha256
    14:28:38.956 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA1
    14:28:38.956 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1
    14:28:38.958 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA224
    14:28:38.958 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224
    14:28:38.959 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA256
    14:28:38.959 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256
    14:28:38.960 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA384
    14:28:38.960 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384
    14:28:38.960 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512': org.opensaml.xmlsec.algorithm.descriptors.SignatureECDSASHA512
    14:28:38.960 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#rsa-md5': org.opensaml.xmlsec.algorithm.descriptors.SignatureRSAMD5
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#rsa-md5
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160': org.opensaml.xmlsec.algorithm.descriptors.SignatureRSARIPEMD160
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160
    14:28:38.961 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - AlgorithmDescriptor failed runtime support check: http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160
    java.security.NoSuchAlgorithmException: RIPEMD160withRSA Signature not available
        at java.security.Signature.getInstance(Signature.java:229)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.checkRuntimeSupports(AlgorithmRegistry.java:259)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.index(AlgorithmRegistry.java:203)
        at org.opensaml.xmlsec.algorithm.AlgorithmRegistry.register(AlgorithmRegistry.java:138)
        at org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer.init(GlobalAlgorithmRegistryInitializer.java:49)
        at org.opensaml.core.config.InitializationService.initialize(InitializationService.java:56)
        at com.practicehs.common.IQConnectAuth.SamlHelper.init(SamlHelper.java:111)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.createSamlHelper(SamlAssertionFixture.java:138)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.<init>(SamlAssertionFixture.java:119)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
        at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170)
        at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
        at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:271)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1270)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1127)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:541)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:760)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
        at com.practicehs.common.IQConnectAuth.SamlAssertionFixture.main(SamlAssertionFixture.java:501)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
    14:28:38.963 [main] INFO org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Algorithm failed runtime support check, will not be usable: http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160
    14:28:38.963 [main] DEBUG org.opensaml.xmlsec.config.GlobalAlgorithmRegistryInitializer - Registering AlgorithmDescriptor of type 'Signature' with URI 'http://www.w3.org/2000/09/xmldsig#rsa-sha1': org.opensaml.xmlsec.algorithm.descriptors.SignatureRSASHA1
    14:28:38.963 [main] DEBUG org.opensaml.xmlsec.algorithm.AlgorithmRegistry - Registering algorithm descriptor with URI: http://www.w3.org/2000/09/xmldsig#rsa-sha1

A: Added bouncycastle in my project and it worked fine.
Add below dependency in the pom:
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.60</version>
    </dependency>

And added this line in the main method:
Security.addProvider(new BouncyCastleProvider());


text:
Q: Python Flask Jinja How create dynamic column with if else statement I have web applicaction.
This is part of my code:
mailaliases.html
{% extends "bootstrap/base.html" %}

{% block title %}
Strona do edycji aliasów
{% endblock %}

{% block styles %}
{{super()}}
<link rel="stylesheet" href="{{url_for('.static', filename='starter-template.css')}}">
{% endblock %}

{% block content %}

          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            Toggle navigation

          </button>
          Badaj.to / SLA

Główna

Zmiana hasła

Panel Administratora

Wyloguj się

Wybierz użytkownika, któremu chcesz ustawić alias.

                  {{ tablepoczta }}

{% endblock %}

here are definied classes
class UserPoczta(UserMixin, dbpoczta.Model):
    __bind_key__ = 'dbpocztamysql'
    __tablename__ = "flask_test_poczty"
    id = dbpoczta.Column(dbpoczta.Integer, primary_key=True)
    address = dbpoczta.Column(dbpoczta.String(60), unique=True)
    goto = dbpoczta.Column(dbpoczta.String(800), unique=False)
    active = dbpoczta.Column(dbpoczta.Integer, unique=False)

class AliasesResult(Table):
    __bind_key__ = 'dbpocztamysql'
    id = Col('Id', show=False)
#    id = Col('Id')
    address = Col('Adres e-mail')
    goto = Col('Aliasy')
    active = Col('Aktywny')
    editpoczta = LinkCol('Edytuj', 'editpoczta', url_kwargs=dict( id = 'id'))

class UserPocztaForm(Form):
    __bind_key__ = 'dbpocztamysql'
    __tablename__ = "flask_test_poczty"
    id = StringField('Id')
    address = StringField('e-mail')
    goto = StringField('Aliasy')
    active = StringField('Aktywny')

here is route
@app.route('/mailaliases')
@login_required
def mailaliases():
    if current_user.role == 'admin':
        qrypoczta = dbpoczta.session.query(UserPoczta).order_by(UserPoczta.address.desc())
        resultspoczta = qrypoczta.all()
        tablepoczta = AliasesResult(resultspoczta)
        tablepoczta.border = True
        return render_template('mailaliases.html', tablepoczta=tablepoczta)
    return render_template('notauthorized.html', name=current_user.username)

I would like to add column to table on website fe column name error_addresses. In this table should be addresses which are in goto column in row and not exist in column addresses in database. This table show e-mail address and aliases in goto column. For example I have some mail like mail1@mail.pl, mail2@mail.pl, mail3@mail.pl and if anyone add to aliass alia1@mail.pl addresses mail1@mail.pl, mail20@mail.pl I would like show mail20@mail.pl in new column error_addresses in row with this aliases.

A: I'm tried using loop for and if
if current_user.role == 'admin':
    if userpoczta:
        form = UserPocztaForm(formdata=request.form, obj=userpoczta)
        if request.method == 'POST' and form.validate():
            save_changes(userpoczta, form)
            for adresy in dbpoczta.session.query(UserPoczta.address):
                if userpoczta.goto not in adresy:
                    return ("error")
                return redirect('/mailaliases')
        return render_template('edit_aliases.html', form=form)
    else:
        return 'Error loading #{id}'.format(id=id)
return render_template('notauthorized.html', name=current_user.username)


text:
Q: Change checked value checkboxes in a DataGridView with conditions I'm trying to create a DataGridViewCheckBoxColumn in my DataGridView and change its Checked status depending on a query.
Here's how I try to do it :
DataGridViewCheckBoxColumn cbAdmin = new DataGridViewCheckBoxColumn();
cbAdmin.CellTemplate = new DataGridViewCheckBoxCell();
bAdmin.HeaderText = "Administrateur";
cbAdmin.Name = "Admin";
cbAdmin.FalseValue = 0;
cbAdmin.TrueValue = 1;
dataGridViewAdmin.Columns.Insert(3, cbAdmin);

using (SqlConnection con = new SqlConnection(conString))
{
    con.Open();
    for (int i = 0; i < dataGridViewAdmin.Rows.Count - 1; i++)
    {
        using (SqlCommand cmd = new SqlCommand("SELECT [isAdmin] FROM [TTH].[dbo].[Admins] WHERE [user] = '" + dataGridViewAdmin.Rows[i].Cells[0].Value.ToString() + "'", con))
        {
            using (SqlDataReader reader = cmd.ExecuteReader())
            {
                if (reader.Read())
                {
                    if (reader["isAdmin"].ToString() == "1")
                    {
                        dataGridViewAdmin.Rows[i].Cells["Admin"].Value = true;
                    }

                    else
                    {
                        dataGridViewAdmin.Rows[i].Cells["Admin"].Value = false;
                    }
                }
            }
        }
    }
}

While debugging I see that I get true and false values where I need them but the checkboxes are all unchecked and I can't even check them in my program when they are clicked.


text:
Q: doc() in apply-templates and the context item I want to apply templates to a document loaded by doc() which works fine:
<xsl:apply-templates select="doc('snippets.xml')//snippet" />

I want to select the <snippet> to be processed by using an attribute of the current context item:
<xsl:apply-templates select="doc('snippets.xml')//snippet[@id=@snippet]" />

Which does not work, because obviously doc() changes the context item.
Is there a way to access the context from the surrounding template other than setting a variable like this:
<xsl:variable name="snippet_id" select="@snippet" />
<xsl:apply-templates select="doc('snippets.xml')//snippet[@id=$snippet_id]" />

Where can I find a specification how the context is influenced by doc()?

A: This has nothing to do with the doc() function, and everything to do with how a predicate is evaluated:
https://www.w3.org/TR/xpath20/#id-predicates
XSLT has a special function to deal with exactly this problem:
https://www.w3.org/TR/xslt20/#current-function
Here, you would use:
<xsl:apply-templates select="doc('snippets.xml')//snippet[@id=current()/@snippet]" />


text:
Q: AWS EC2 - If a server fails and restarts, how do other servers connect to it? Lets say I have an application server and a database server on Amazon EC2. If the db server fails and restarts, how can the app server know the new internal ip of the db server and automatically continue working with it?

A: A reboot will keep it's settings. If you bring up a new instance then you'll need some way to manage the IP's. A startup script is probably the way to go. Pull the instance metadata and update a config file (perhaps in S3) or DNS entry. You can also use an elastic IP and configure a cname which will resolve to the internal address within the EC2 environment. To do this, assign an elastic IP and note the public DNS string (there's a pattern but it's good to check) and create the cname record with it. The advantage with elastic IP cnames is you don't have to wait for DNS propagation.

A: You could have the DB server tell the application server where it is by writing a simple externally facing update URL on your application server. You can get the internal IP from the boot metadata from the DB server. Maybe a simple shell script like this in rc.local on the DB server (assuming you are using a linux instance):
LOCALIP=`curl http://169.254.169.254/latest/meta-data/local-ipv4`
curl http://<yourexternalappname.com>/updatedbip?ip=$LOCALIP&somesharedsecret=<password>


text:
Q: dialogflow, how to return whatever-else entity I'm trying to build a "search intent" for books/articles.
I created a book-tag which has all predefined tags of our books.
book-tags-entity
I created another entity named "intent-action"
intent-action-entity
and a entity for search term:
search-term-should-match-whatever-else-entity
Now, I want to have a intent which will could understand what's user searching for.
For example:
Input: search medical book of diabetes
Expected output:
Intent-action: "search"  correct
Book-tag: "medical"  correct
Search-term: it should match anything else, for this example, it should be "book of diabetes".
search-book-intent
Is there any chance of making this happen?
Update 1: with @sys-any
Thanks for helping.
I try with "sys-any". It works with predefined search-term. I manually map "book of diabetes", "article of copd", " book of headache" to sys-any,
but it still can't recognize any new search-term.
try with sys-any
Update 2, response from Dialogflow support
Thanks for reaching out to Dialogflow support.
Currently, Dialogflow doesn't provide such ready-to-use functionality. You may enable fulfillment for the intent and try developing your own custom business logic in the fulfillment code to process the parameter values and original user query text from the request sent from Dialogflow and send results back to Dialogflow as responses.
Update 3, working solution here.
In dialogflow intent -> training phrases
There are 2 different training model here, "Example model" & "Template model".
What we need is "Template model", and set a template "@sys.any:search-term  @intent-action:intent-action @sys.any:search-term "
Done.

A: Yes, you can make the "diabetes" and "copd" terms of entity type @sys.any. To do this, you can select the word in your test phrases and type in or select @sys.any. It should look something like this when you're done:

If you wish, you can change the parameter name from "any" to another name that makes more sense.
Update 1
You need to manually select the phrase, so for the one in your updated example, you need to select it and set it to @sys.any.
Keep in mind that your sample phrases are just that - samples. They won't be what it specifically looks for. By marking it for the @sys.any Entity type, you're saying that anything will match for that parameter.
You might also need to select "required" for your case.
Typically, @sys.any works best when there are other words that are also excluded from it, but are part of the phrase. Trying to capture "everything else" is difficult, and usually not what you want. Do you really want to capture the "of" part of the phrase? Should "article" or "book" be their own Entity type and the subject be the @sys.any parameter?


text:
Q: How to write a stdout statement in a .log file in spring boot application
*

*I am trying to write System.out.print statement in log file

*I use the following application.properties file

logging.level.org.springframework.web=INFO
logging.level.org.hibernate=ERROR
logging.level.com.cirq.configurator=INFO
logging.path=${mypath}
logging.file=filename.log

*

*But using the above code, I am not able to write System.out.print statement in the log file

*First, I create .jar file of my spring-boot project and run in undertow application server

*Please help me....
Thanks in advance

A: if you are deploying .jar file in undertow application server, then System.out.print statement will not work(means it will not write in log file).
For that you have to use log4j which is in-built in Spring Boot.
Example:
final static Logger logger = LoggerFactory.getLogger(YourController.class);
logger.info("Your print statement");
Refer link

A: You need to add this dependency in your pom.xml file:
<dependency>
   <groupId>uk.org.lidalia</groupId>
   <artifactId>sysout-over-slf4j</artifactId>
   <version>1.0.2</version>
</dependency>

Then in the main method before you do anything call this code:
SysOutOverSLF4J.sendSystemOutAndErrToSLF4J();
That way anything that is written in sysout or syserr gets caught in the logging system


text:
Q: How to join spatial data file with geocoded csv file I have a polygon spatial file that is used to map school zones in nyc, and a csv containing geocoded property locations with longitude and latitude coordinates. I need to join the two together so that every property that is say within school zone 1 is joined to it along with the other unique columns associated with the two datasets.
I've been able to map the school zone data, and property data by themselves in Tableau and QGIS, but I'm unable to join them together in Tableau as they lack a similar unique identifier and I've been unable to get a spatial join in QGIS to work either. I've also attempted a few things in R converting the spatial file to get it's coordinates without success. I'm willing to use any of the resources listed here or anything else that may be needed.


text:
Q: HTML5 number spinbox controls not triggering a change event? We are currently using jQuery to trigger a recalculation on a form input field. Using HTML5 we get nice spinboxes in Safari (at least on 5.0.3 Mac). However updating the field with the spinbox controls doesn't seem to trigger a change event at all. It's like the field hasn't been updated. Is this just an oversight in WebKit? Or are there ways around this?
Edit: Changing the spinbox doesn't even trigger an input event.

A: You want to use the oninput event.  Use something like $("...").bind("input", fn);.
See http://msdn.microsoft.com/en-us/library/gg592978(VS.85).aspx

A: $.click() works fine. If you click and hold, it doesn't until you release.

A: change event is triggered when input lost focus and the value is changed, by clicking the spinbox, input does not lost its focus, so change event will not fired.

A: This works for me in Chrome 11 and Opera 11.10:
<fieldset class="col" oninput="exoutput.value = exnumber.valueAsNumber * exnumber.valueAsNumber;">
    <legend>Output event handler</legend>
    <label for="exnumber">Number: </label>
    <input type="number" id="exnumber" placeholder="Enter a number" min="0" value="4" required>
    <label for="exoutput">Output: </label>
    <output for="exnumber" id="exoutput">16</output>
</fieldset>

Firefox 4 doesn't do valueAsNumber, but a minor change makes it work in all three.  Sorry I don't have Safari available to test on right now.


text:
Q: extracting cell numbers from multiple counties in R I'm new to R so please excuse any terminology mistakes... I'm trying to extract the cell numbers for every county in the state of Oklahoma and paste them on top of each other so that I can use them to look at different temperatures throughout Oklahoma state. I have a shapefile of counties in the US, so I made a vector of all the county ID numbers for the state of OK. I then tried to extract the cell numbers and max temp values for every county in a loop. That extract line that I wrote works when I do it one county at a time, I think it's the okcounty=rbind line that's the problem but I don't know what the best way to do this is.
Thank you for your help! I really appreciate it.
`okcounties=which(counties$STATE_NAME=="Oklahoma") #contains 58 counties
 county = NULL
 for (i in 1:58){
   countyvalues=extract(OK.tmax[[1]], extent(counties[okcounties[i],]), cellnumbers=T)
   county=rbind(county, countyvalues) #add data from each of 58 counties
 }`

A: I am finding your code a bit confusing and can see a few places it is going wrong. You are overthinking things a bit. I am not sure why you are extracting cellnumbers and not just taking advantage of extract and the stack object.
The "okcounties" object could be a sp class subset of the counties object, that you could pass directly to extract eg., okcounties <- counties[counties$STATE_NAME=="Oklahoma",] .
If you drop the call to extent, which is returning a bounding box for each county and not the county boundary, things get much simpler. To leverage the stack you could just let extract provide a data.frame of the raster values. Here is a worked example on synthetic data. I approximated your object naming convention for this example. The final object "ok.county" I believe would be the same as the "county" object that you are trying to create.
First, let's create some example data and plot
library(raster)
library(sp)

# create polygons
p <- raster(nrow=10, ncol=10)
  p[] <- runif(ncell(p)) * 10
  counties <- rasterToPolygons(p, fun=function(x){x > 9})
  counties$county <- paste0("county",1:nrow(counties))
  counties$STATE_NAME <- c(rep("CA",3),
                          rep("OK",nrow(counties)-3))

# Create raster stack
r <- raster(nrow=100, ncol=100)
  r[] <- runif(ncell(r), 40,70)
  r <- stack(r, r+5, r+10) # stack
  names(r) <- c("June", "July", "Aug")

plot(r[[1]])
  plot(p, add=TRUE, lwd=4)

We can use an index to subset to the state we are interested in.
ok <- counties[counties@data$STATE_NAME == "OK",]

Now we can use extract on the entire raster stack. The resulting object will be a list where each polygon has its own element in the list containing a data.frame. Each column of the data.frame represents a layer in the raster stack object.
ok.county <- extract(r, ok)
  class(ok.county)
  head(ok.county[[1]])

However, if you want to collapse the list into a single data.frame, unique polygon identifiers are missing. Here we are going to use the ID column in the SpatialPolygonsDataFrame object. Since the list is ordered the same as the polygon object you can assign unique values from the polygon object. In your case it would likely be the county names and the method would follow the same as the example.
cnames <- unique( counties@data$county )
  for(i in 1:length(ok.county)) {
    ok.county[[i]] <- data.frame(county = cnames[i], ok.county[[i]])
  }
head(ok.county[[1]])

Now that we have a unique identifier assigned to each data.frame in the list we can collapse it using do.call.
ok.county <- as.data.frame(do.call("rbind", ok.county))
  str(ok.county)

Using an apply function we can pull the maximum value for a given column (time-period) for each unique ID.
tapply(ok.county[,"June"],  ok.county$county, max)

As to your original code, something like this would work (obviously, not tested) but there is no unique polygon ID tying results back to the county and it is still the bounding box of the county and not the polygon boundaries.
okcounties <- counties[counties$STATE_NAME=="Oklahoma",]
 county = NULL
 for (i in 1:nrow(okcounties)){
   county <- rbind(county, extract(OK.tmax[[1]],
        extent(okcounties[i,]), cellnumbers=T))
 }


text:
Q: Multiplication and Data Validation between two lists I would like to validate data and perform some math using two lists. First I would like to ensure that the first element each list matches then I would like to mulitply the second, third and fourth items of the second list by the second item of the first list. I would like to create a new list, then sum the elements of that list.
The lists look something like this:
lista = [(1, 500), (2, 600), (3, 333)]

listb = [(1, 10, 11, 10.5), (2, 99, 100, 100), (3, 50, 51, 50)]

Before listc is created, I would like to ensure the first elements of each sub-list match between the lists. Then I would like to get a list that multiples the elements that looks like:
listc = [(1, 5000, 5500, 5250), (2, 59400, 60000, 60000), (3, 16650, 16983, 16650)]

Then I would like to create a fourth list where the elements are summed, like so:
listd = [(6 (doesn't necessarily have to sum this element), 81050, 81650, 81900)]

I have been looking into the "zip" function. I know that the function could do the multiplication, but how can it do the validation?

A: You can try this in Python3:
from functools import reduce
lista = [(1, 500), (2, 600), (3, 333)]
listb = [(1, 10, 11, 10.5), (2, 99, 100, 100), (3, 50, 51, 50)]
if not all(c == d for (c, e), (d, *h) in zip(lista, listb)) or len(lista) != len(listb) or any(any(b is None for b in i) for i in lista) or any(any(b is None for b in i) for i in listb):
   raise ValueError("lists not validated")
new_listing = [(c, *[d*i for i in e]) for (c, d), (h, *e) in zip(lista, listb) if c == h]
final_listing = [reduce(lambda x, y:(x[0]+y[0], *[a+b for a, b in zip(x[1:], y[1:])]), new_listing)]
print(new_listing)
print(final_listing)

Output:
[(1, 5000, 5500, 5250.0), (2, 59400, 60000, 60000), (3, 16650, 16983, 16650)]
[(6, 81050, 82483, 81900.0)]

Edit:
Solution that sorts initial input:
from functools import reduce
lista = [(1, 500), (2, 600), (3, 333)]
listb = [(1, 10, 11, 10.5), (2, 99, 100, 100), (3, 50, 51, 50)]
lista = sorted(lista, key=lambda x:x[0])
listb = sorted(listb, key=lambda x:x[0])
new_listing = [(c, *[d*i for i in e]) for (c, d), (h, *e) in zip(lista, listb) if c == h]
final_listing = [reduce(lambda x, y:(x[0]+y[0], *[a+b for a, b in zip(x[1:], y[1:])]), new_listing)]

Edit 2:
Python 2.7 solution:
lista = [(1, 500), (2, 600), (3, 333)]
listb = [(1, 10, 11, 10.5), (2, 99, 100, 100), (3, 50, 51, 50)]
if not all(c == d[0] for (c, e), d in zip(lista, listb)) or len(lista) != len(listb) or any(any(b is None for b in i) for i in lista) or any(any(b is None for b in i) for i in listb):
   raise ValueError("lists not validated")

new_listing = [tuple([c]+[d*i for i in h[1:]]) for (c, d), h in zip(lista, listb) if c == h[0]]
final_listing = [reduce(lambda x, y:tuple([x[0]+y[0]]+[a+b for a, b in zip(x[1:], y[1:])]), new_listing)]


text:
Q: How is group theory related to particle physics? I've always heard of such statements as $SU$ group describing our world even before I seriously learned physics.

*

*When learning about spin, someone spoke of $SU(2)$ but did not seriously explain.

*When learning isospin and hypercharge for particles made of $u, d, s,$ someone spoke of $SU(3)$ but did not give detailed explanation.

*When talking about the discovery of J/ψ, teacher (a experimentalist) say, well now with the charm quark, we need $SU(4)$.
I am crazy, $SU$ is just special unitary matrix group, what are they talking about when relating these matrix with spin or particles? I hope someone could give me a detailed explanation about how these group is related to real world substances or recommend a book.


text:
Q: Ubuntu 20.04 LTS Fingerprint not recognizing I have enrolled the fingerprint but it doesn't recognize my fingerprint on the login screen.

OS: Ubuntu 20.04 LTS
Laptop: Asus Zenbook 14 UX430UAR
I checked if my device is supported or not in supported list. It is supported:
------@-------:~$ sudo lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 04f3:0903 Elan Microelectronics Corp. ELAN:Fingerprint
Bus 001 Device 003: ID 8087:0a2b Intel Corp.
Bus 001 Device 002: ID 13d3:5694 IMC Networks USB2.0 HD UVC WebCam
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The result of fprintd-verify
---------@------------:~$ fprintd-verify
Using device /net/reactivated/Fprint/Device/0
Listing enrolled fingers:
 - #0: left-index-finger
 - #1: right-index-finger
Verify started!
Verifying: left-index-finger
Verify result: verify-no-match (done)

This is the image of the sensor. Capacitance Fingerprint sensor. Top right square

I have checked that Ubuntu supports the fingerprint sensor. I had windows on this laptop before and with windows hello it worked perfectly. On Ubuntu I'm able to register the fingerprint but during login screen it is not recognizing the fingerprint. I'm sliding my finger across the sensor unlike how i tapped in windows hello authentication.


text:
Q: Emulator "will run unaccelerated" and qemu-system error We have Windows 7 (x64) at work, and I wanted to learn about Xamarin.Forms. Specifically, I wanted to create a very basic app that will eventually run in an iphone and Android.
I installed VS2017 and tried running Build your first Xamarin.Forms App. I get this warning, but click on "Start Anyway":

The emulator pops up, but after a few seconds I get error message qemu-system-i386.exe has stopped working:

I'm new to mobile apps development and Xamarin.Forms (3 days to be exact). With that said, I googled possible solutions, and I found this error message "qemu-system-i386.exe has stopped working" and other questions with similar solutions.
The problem is that the solution requires that I download Android Studio, and I don't want to download anything else until I see something run from VS2017.
I tried running emulator.exe -avd "Android_Accelerated_x86_Oreo" -wipe-data and yet another error:

Finally, I tried installing Hyper-V manager using this Microsoft TechNet link, but I don't have the option Remote Server Administration Tools.
What can I do next? I'm pretty much ready to give up on Xamarin in Windows 7. I still haven't been able to debug an application.
After enabling Intel Virtualization in the BIOS and installing and making sure intelhaxm is running, I opened the project and ran it again.
The "Performance Warning" popup doesn't show up anymore, and there's progress with the android emulator, but it still crashes. This is the screenshot now:


text:
Q: MariaDB Galera Cluster hang after issue cluster command When trying to cluster two MariaDB Galera servers on RHEL 6 together using the command:
mysqld -uroot --wsrep_cluster_address=gcomm://

and the screen then sits there, and looks at me with this output:
130805 10:26:50 InnoDB: The InnoDB memory heap is disabled
130805 10:26:50 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130805 10:26:50 InnoDB: Compressed tables use zlib 1.2.3
130805 10:26:50 InnoDB: Using Linux native AIO
130805 10:26:50 InnoDB: Initializing buffer pool, size = 128.0M
130805 10:26:50 InnoDB: Completed initialization of buffer pool
130805 10:26:50 InnoDB: highest supported file format is Barracuda.
130805 10:26:50  InnoDB: Waiting for the background threads to start
130805 10:26:51 Percona XtraDB (http://www.percona.com) 1.1.8-29.3 started; log sequence number 5715012
130805 10:26:51 [Note] Plugin 'FEEDBACK' is disabled.
130805 10:26:51 [Note] Event Scheduler: Loaded 0 events
130805 10:26:51 [Note] WSREP: Read nil XID from storage engines, skipping position init
130805 10:26:51 [Note] WSREP: wsrep_load(): loading provider library 'none'
130805 10:26:51 [Note] mysqld: ready for connections.
Version: '5.5.29-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server, wsrep_23.7.3.rXXXX

As far as I can tell, it seems to be working. I then issued the command to connect to this cluster master:
$ mysqld -uroot --wsrep_cluster_address=gcom://mariadbclstr02.local.net

130805 11:27:21 InnoDB: The InnoDB memory heap is disabled
130805 11:27:21 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130805 11:27:21 InnoDB: Compressed tables use zlib 1.2.3
130805 11:27:21 InnoDB: Using Linux native AIO
130805 11:27:21 InnoDB: Initializing buffer pool, size = 128.0M
130805 11:27:21 InnoDB: Completed initialization of buffer pool
130805 11:27:21 InnoDB: highest supported file format is Barracuda.
130805 11:27:21  InnoDB: Waiting for the background threads to start
130805 11:27:22 Percona XtraDB (http://www.percona.com) 1.1.8-29.3 started; log sequence number 1598129
130805 11:27:22 [Note] Plugin 'FEEDBACK' is disabled.
130805 11:27:22 [Note] Event Scheduler: Loaded 0 events
130805 11:27:22 [Note] WSREP: Read nil XID from storage engines, skipping position init
130805 11:27:22 [Note] WSREP: wsrep_load(): loading provider library 'none'
130805 11:27:22 [Note] mysqld: ready for connections.
Version: '5.5.29-MariaDB'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MariaDB Server, wsrep_23.7.3.rXXXX

Now they're both just sitting there, and nothing is happening as far as I can tell. Is there a way to see if they are doing this correctly? I'm following the documentation at the MariaDB website: https://kb.askmonty.org/en/getting-started-with-mariadb-galera-cluster/. I can also use netcat to connect to both servers using nc -vz mariadbclstr02.local.net 3306 and also nc -vz mariadbclstr01.local.net 3306

A: From what I discovered, instead of issuing the commands like I did, I had to edit the /etc/my.cnf and add those lines. Instead thought, I created a /etc/my.cnf.d/zabbix_cluster.cnf file and put the lines specified at https://kb.askmonty.org/en/getting-started-with-mariadb-galera-cluster/. Then I was able to start MySQL properly. Then after editing the /etc/my.cnf/zabbix_cluster.cnf config file, I had to start the cluster up by issuing /etc/init.d/mysql start --wsrep_cluster_address=gcomm:// which would then initialize a new cluster and allow others to join.


text:
Q: Jasper date_sub error I have a query in Jasper:
     SELECT
         date_format(
         DATE_SUB(a.start_stamp, INTERVAL 5 hour),
         "%Y-%m-%d %H:%i:%s"
         ) as date,
    FROM
    a

which runs fine if I run it separately from Jasper, but in Jasper gives an error. If I hover over the hour word it says: extraneous input hour, expecting ')'. Also if I remove the DATE_SUB it gives no error.
How can I fix this?(I am using Jaspersoft Studio 5.5.0)

A: Does Jasper accept this?
SELECT DATE_FORMAT(a.start_stamp-INTERVAL 5 HOUR,'%Y-%m-%d %H:%i:%s') AS `date`
  FROM a

The query in your question has a extra comma after as date. It also gives date as a column name in a resultset, notwithstanding the fact that DATE is a reserved SQL word. It also uses double quotes to surround the format string, even thought single quotes are usually used for this purpose in MySQL.
I have also changed the date arithmetic operation.

A: SELECT
   date_format(
     DATE_SUB(a.start_stamp, INTERVAL 5 hour),
     "%Y-%m-%d %H:%i:%s"
  ) as date
FROM
   a

Date_Format return the value in string so that is the reason it is giving an error.
Solution
Remove date_Format from Query and use text field Date Format option.
Try with below 1 so you can test it.
 SELECT date_format(
        DATE_SUB(CURRENT_TIMESTAMP(), INTERVAL 5 hour),
        "%Y-%m-%d %H:%i:%s"
) as date


text:
Q: Gem "audited-activerecord", "~> 4.0 gives undefined method `audits' I am using:
Rail 4.1.7
Ruby 2.1.4
I just installed Audited GEM:
gem "audited-activerecord", "~> 4.0"
$ rails generate audited:upgrade
$ rake db:migrate

Model
class Opportunity < ActiveRecord::Base
    ...
    audited
    ...
end

And when I run:
Opportunity.audits.count

I get this error:
2.1.4 :001 > Opportunity.audits.count
NoMethodError: undefined method `audits' for #<Class:0x007ff7946656f0>
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activerecord-4.1.7/lib/active_record/dynamic_matchers.rb:26:in `method_missing'
    from (irb):1
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/railties-4.1.7/lib/rails/commands/console.rb:90:in `start'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/railties-4.1.7/lib/rails/commands/console.rb:9:in `start'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:69:in `console'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/railties-4.1.7/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/railties-4.1.7/lib/rails/commands.rb:17:in `<top (required)>'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `block in require'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:247:in `require'
    from /Users/andreucasadella/rails_projects/crm/bin/rails:8:in `<top (required)>'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:241:in `load'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:241:in `block in load'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:232:in `load_dependency'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:241:in `load'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/commands/rails.rb:6:in `call'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/command_wrapper.rb:38:in `call'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/application.rb:183:in `block in serve'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/application.rb:156:in `fork'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/application.rb:156:in `serve'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/application.rb:131:in `block in run'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/application.rb:125:in `loop'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/application.rb:125:in `run'
    from /Users/andreucasadella/.rvm/gems/ruby-2.1.4/gems/spring-1.2.0/lib/spring/application/boot.rb:18:in `<top (required)>'
    from /Users/andreucasadella/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/andreucasadella/.rvm/rubies/ruby-2.1.4/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from -e:1:in `<main>'2.1.4

I am using Ruby 2.1.4 and there is a warning sign "Audited may work just fine with a Ruby version not listed above (Latested 2.1.2), but we can't guarantee that it will. If you'd like to maintain a Ruby that isn't listed, please let us know with a pull request."
Has anyone experienced this before?

A: The audits method is an instance method, i.e. it is for one opportunity, not the entire Opportunity class.
Your code:
Opportunity.audits.count  # Fails because audits is not a class method.

Solution code:
opportunity = Opportunity.first  # any search you want
opportunity.audits.count  # Succeeds because audits is an instance method.


text:
Q: C# KeyDown alphanumeric culture dependent ! How to determine if the pressed Key is an alphabetical key
regard to the culture specific keys:
e.g.:
'[' = 'ú' = 'ü' ... is the same key but with different value on different language Keyboards.
I've tried to compare the ordinal key value: (int)e.Key >= 0x20E ..and <= ..
but it does not work well, as modifier keys have sometimes same ordinal codes.
Any idea?
Thanks
EDITED:
Hmm and how about this ?
System.Text.RegularExpressions.Regex objAlphaNumericPattern = new System.Text.RegularExpressions.Regex("[^a-zA-Z0-9]");
            if (!objAlphaNumericPattern.IsMatch(e.Key.ToString()))
            {
                lp.IsDropDownOpen = true;
            }

A: Is char.IsLetter method helpful in your case?
char.IsLetter('['); //Return false
char.IsLetter('ú'); //Return true

With your sample, we can write:
if (!char.IsLetterOrDigit((char)e.Key))
{
    lp.IsDropDownOpen = true;
}


text:
Q: How to have better performance when updating database from AWS EC2 using SQLAlchemy (Flask) I wanted to update all entries of column state in the Org table based on another column location and pass in location as a string into python module usaddress.tag(). However, using the following way, due to the volume of data entries in Org table, the AWS EC2 server crashed:
orgs = db.session.query(Org).filter(Org.location != None).all()
for org in orgs:
      address_dict = usaddress.tag(Org.location)
      org.state_abbr = address_dict[0].get("StateName", None)
db.session.commit()

I have also tried to use update() method directly, but it tells me that usaddress.tag() expects a string or binary format:
orgs = db.session.query(Org).filter(Org.location != None).update({"state_abbr": usaddress.tag(Org.location)[0].get("StateName", None)}, synchronize_session=False)

I cannot write a SQL query directly because it is easier to obtain state from location using the module usaddress.
Is there any way to update database without overwhelming the server?
Any help would be much appreciated. Thank you all very much in advance.


text:
Q: Different results with caret when classProbs=TRUE When I train to models, one using classProbs=TRUE and the other without computing the probabilities, I get different results:
library(caret)

set.seed(7)
myControl <- trainControl(method='cv',number=3,savePredictions=TRUE)
set.seed(7)
model <- train(Species~., iris, tuneLength=4,method='svmRadial', trControl=myControl)

set.seed(7)
myControl <- trainControl(method='cv',number=3,savePredictions=TRUE,classProbs=TRUE)
set.seed(7)
modelProbs <- train(Species~., iris, tuneLength=4, method='svmRadial', trControl=myControl)

The model with classProbs=FALSE (var model) is:
C     Accuracy   Kappa      Accuracy SD  Kappa SD
0.25  0.9266667  0.8900100  0.03055050   0.04584410
0.50  0.9333333  0.8999840  0.02309401   0.03469643
1.00  0.9400000  0.9099880  0.02000000   0.03004800
2.00  0.9400000  0.9100059  0.02000000   0.02999416

And the model with classProbs=TRUE (var modelProb) is:
C     Accuracy   Kappa     Accuracy SD  Kappa SD
0.25  0.9266667  0.890010  0.03055050   0.04584410
0.50  0.9333333  0.899984  0.02309401   0.03469643
1.00  0.9400000  0.909988  0.02000000   0.03004800
2.00  0.9466667  0.919980  0.02309401   0.03466529

resulting even in different final models after parameter selection (C=1 when classProbs=FALSE and C=2 when classProbs=TRUE).
I have found out that all predictions are equal for both models except those where the classifier is not very sure of which class to predict. For example:
> model$pred[423,]
          pred        obs rowIndex     sigma    C Resample
423 versicolor versicolor       69 0.8071298 0.25    Fold3

> modelProbs$pred[423,]
         pred        obs     setosa versicolor virginica rowIndex        sigma    C Resample
423 virginica versicolor 0.03307154  0.4813102 0.4856182       69 0.8071298 0.25    Fold3

In this experiment, differences are very small but I have tried with more complex data, and differences are huge. Can anybody explain how the classProbs attribute affects to predictions? I thought it was used to view the probabilities for each class but that it didn't change the results.