text:
Q: Identify and parse function signatures in a C-like source file? Suppose I have a C source file (or a language close enough to C).

*

*It may have #include directives.

*It may have other preprocessor directives.

*It may have zero, one or multiple function declarations with a definition.

*It may also have declarations without definitions

*The syntax is valid and the file would compile if its includes were made (But you can't really rely on that without applying the preprocessor and making the includes, which you won't).

Now, what is an efficient, hopefully established, way of programattically locating function signatures in this file, preferably with some kind of parse tree or syntax tree for the signature - without recourse to any other files?
Obviously this cannot be 100% fool-proof: One could use weird preprocessor tricks to "hide" or obfuscate declarations; one could use crazy spacing and indentation etc. But - I only need to catch "plain vanilla" function definitions with no funny business.
Notes:

*

*The program which needs to locate C headers can be C++ or C. This question is "cleaner" if I said I want to do it in C, but in reality I'm writing C++, so...

*I'm trying to avoid something as heavy as cppast which would also probably need to be able to find those include files.

*I think I might have had a related question at some point in time, but I can't find it...

*You may assume the function does not have any function pointer parameters, nor does it return a function pointer.

*The richer the AST the better, but I won't be too picky.

*I was thinking maybe something like the parsers which IDEs use, which have to be somewhat robust against syntax errors and missing files, and have to produce something useful even for broken files. But that's just a flight of fancy.


text:
Q: How to mark-up a button for WCAG 2.0 Compliance? In striving for WCAG 2.0 Compliance, I'm finding quite a bit of varied information regarding proper treatment of buttons, specifically what is required to consider the button accessible and compliant.
What is the appropriate way to mark-up a <button>? What attributes or combination do they need to have?
My buttons fall into three categories:

*

*Buttons that have text that describes their intended action. (e.g. "Learn More" to launch a modal with more product information)

*Buttons that have text that does not describe their action. (e.g. "X" or text that titles a section of accordion content)

*Buttons that do not have text that describes their intended action or otherwise. (e.g. An icon / image that switches the context of a carousel)

For instance, in the following simple example of 3 above: http://codepen.io/ga-joe/pen/ggeLeW
Is it acceptable to add only an aria-label attribute for a button with no text? Are name and / or value always required? Please send help! Thank you!
These seem to be the relevant WCAG Guidelines:

*

*https://www.w3.org/TR/WCAG20/#text-equiv-all

*https://www.w3.org/TR/WCAG20/#navigation-mechanisms-refs

*https://www.w3.org/TR/WCAG20/#ensure-compat-rsv

A: These kinds of questions always depend on context. Let me give it a shot sans context.

*

*<button>Learn More</button> does the trick as long as contextually someone will understand what they will learn more about. Usually the button is preceded by some descriptive text. However, if it just brings someone to another page as opposed to firing a modal, I would use a link.

*<button aria-label="Close">×</button> for a close button (I am using the character entity for ×, which is more symmetrical than x. Again, if the button is at the top of a modal (for example), perhaps adjacent to its heading, then that is probably adequate.

*<button aria-label="Image 1">[icon]</button> can work for a carousel. Note that a font icon can be lost if the typeface does not download. A background image will disappear in Windows High Contrast Mode (WHCM) for IE11 and older versions of Edge. The aria-label will not help the WHCM users. Probably best to use an image (even an SVG) and its alt attribute instead, which means then you do not need aria-label.
You do not need a name attribute. It does nothing useful here.
Do not use a role="button" attribute. That role is automagically part of the <button> element. If you assign another role, then you have a big problem.
Definitely do not use a title attribute. That does more harm than good.

A:
Buttons that have text that describes their intended action. (e.g. "Learn More" to launch a modal with more product information)

You can read the recommendations for WCAG 2.4.9 Link Purpose (Link Only) even if we're not talking about links. The text "Learn more" can be understood when in context, but for low vision users who require screen magnifier, for instance, it can be difficult to understand the action from the button text itself.
For instance the text Learn more about "Wheels on the bus" may seem more appropriate.

Buttons that have text that does not describe their action. (e.g. "X" or text that titles a section of accordion content)

I answered that subject in another post:
What is aria-label and how should I use it?
You have to use both aria-label (useful for screenreaders) and title attributes (for standard users using standard browsers which may need more support):
<button
    aria-label="Back to the page"
    title="Close" onclick="myDialog.close()">X</button>

Buttons that do not have text that describes their intended action or otherwise. (e.g. An icon / image that switches the context of a carousel)

The same reasoning can apply to this point. But for blind people, moving a carousel to the left or to the right is a different experience, sometimes useless. If they can ignore that what they see is a carousel, without losing any content, navigating with the keyboard or their assistive technology, then you are doing what is expected.
Also, you have to never forget that accessibility does not only target blind users, but also children, old people, people with cognitive or sensitive disabilities. For instance, the aria-label will never be sufficient enough to help those people when needed. They do not have a screen reader, and they do not read the HTML source code.
In the case of users using "speech-recognition software" (yep, they are not a lot but let's improve their life), not having any visible text can also lead to difficulties.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Why doesn't this overload? Writing on a Jooq helper class. (More business-specific methods to be added as soon as I've figured this out ...)
import org.jooq.*
import org.springframework.stereotype.Repository
import javax.inject.Inject
import javax.inject.Provider

/**A helper class facilitating database manipulations.
 * Uses jOOQ for its manipulations.
 * Relies on the application context being properly initialized s.t. Spring creates and injects the correct
 * [DSLContext].*/
@Repository
class DatabaseManipulator{

    private val provider: Provider<DSLContext>
    private val create:DSLContext
        get() = provider.get()

    @Inject
    constructor(provider: Provider<DSLContext>) {
        this.provider = provider
    }

    /**Executes non-[Select]-type SQL queries on the database.
     * Does not perform any kind of checks and trusts the client to know what they're doing.
     * @param query the query to be executed.
     *
     * @return depending on the type of the [query]:
     *

     *
 Delete : the number of deleted records

     *
 Insert : the number of inserted records

     *
 Merge : result may be meaningless

     *
 Truncate : result may be meaningless

     *
 Update : the number of updated records

     *

     */
    fun execute(query:DSLContext.()-> Query):Int{
        return create.query().execute()
    }

    /**Executes [Select]-type [query] and returns its result*/
    fun <T:Record> execute(query:DSLContext.()->Select<T>):Result<T>{
        return create.query().fetch()
    }
}

So far, so good. Now let's add some tests
@RunWith(SpringJUnit4ClassRunner::class)
@SpringBootTest
@Transactional
class DatabaseManipulatorIT {

    @Inject
    private lateinit var manipulate:DatabaseManipulator

    @Inject
    private lateinit var em:EntityManager

    @Test
    fun executeSelectQuery() {
        //given
        val expectedNumberOfOrganizations = em.createQuery("SELECT COUNT (o) FROM Organization o")
            .singleResult as Long

        //when
        val reportedNumberOfOrganizations = manipulate.execute {
            selectCount().from(ORGANIZATION)
        }.first().value1().toLong()

        //then
        assertThat(reportedNumberOfOrganizations).isEqualTo(expectedNumberOfOrganizations)
    }

    @Test
    fun executeNonSelectQuery() {
        //given
        val expectedNumberOfDeletions = em.createQuery(
            "SELECT COUNT (o) FROM Organization o WHERE o.usageCreditLimited = true"
        ).singleResult as Long

        //when
        val actualNumberOfDeletions = manipulate.execute {(
            deleteFrom(ORGANIZATION)
                .where(ORGANIZATION.USAGECREDITLIMITED.eq(true))
            ) as Query
        }

        //then
        assertThat(actualNumberOfDeletions).isEqualTo(expectedNumberOfDeletions)

    }
}

That fails to compile because
Error:(50, 50) Kotlin: Type inference failed: fun <T : Record> execute(query: DSLContext.() -> Select<T>): Result<T>
cannot be applied to
(DSLContext.() -> DeleteConditionStep<OrganizationRecord!>!)
Error:(50, 58) Kotlin: Type mismatch: inferred type is DSLContext.() -> DeleteConditionStep<OrganizationRecord!>! but DSLContext.() -> Select<???> was expected

No shit, I don't want you to use that method, I want you to use the other.
Let's try making that explicit:
//when
val actualNumberOfDeletions = manipulate.execute {(
    deleteFrom(ORGANIZATION)
        .where(ORGANIZATION.USAGECREDITLIMITED.eq(true))
    ) as Query
}

still fails to compile the second test case because
Error:(50, 50) Kotlin: Type inference failed: fun <T : Record> execute(query: DSLContext.() -> Select<T>): Result<T>
cannot be applied to
(DSLContext.() -> Query)
Error:(50, 58) Kotlin: Type mismatch: inferred type is DSLContext.() -> Query but DSLContext.() -> Select<???> was expected

How do I get Kotlin to call the correct method?

A: The Select is essentially Query so the method you want to use cannot be inferred correctly.

The compiler resolves everything about the method invocation without paying any attention to the generic constraints involved until the very last moment – where it notices that the chosen method isn't valid, and fails with an error.

This problem occur with generics, the compiler recognize the methods as two different method but when trying to resolve the method it may not find the correct method based on available data. If you want to know why check this article, Overloading and Generic constraints by Jon Skeet.


text:
Q: Python SSH server (twisted.conch) command filtering and port forwarding I need to create an SSH server (twisted.conch has been chosen for the job) which would do the following:

*

*Perform port forwarding (the attached code does not do that and I do
not know what to modify)

*Filter commands BEFORE they are executed (or at least log them before or after).

The code attached below creates a perfect SSH and SFTP server, BUT it is missing one main component - port forwarding (and command filtering, but that is not as important as port forwarding)
I searched where I possibly could, but could not find these two.. Please help me out, - it is the last peace of the puzzle.
#!/usr/bin/env python
from twisted.conch.unix import UnixSSHRealm
from twisted.cred.portal import Portal
from twisted.cred.credentials import IUsernamePassword
from twisted.cred.checkers import ICredentialsChecker
from twisted.cred.error import UnauthorizedLogin
from twisted.conch.ssh.factory import SSHFactory
from twisted.internet import reactor, defer
from twisted.conch.ssh.transport import SSHServerTransport
from twisted.conch.ssh.userauth import SSHUserAuthServer
from twisted.conch.ssh.connection import SSHConnection
from twisted.conch.ssh.keys import Key
from zope.interface import implements
from subprocess import Popen,PIPE
from crypt import crypt

publicKey = 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAGEArzJx8OYOnJmzf4tfBEvLi8DVPrJ3/c9k2I/Az64fxjHf9imyRJbixtQhlH9lfNjUIx+4LmrJH5QNRsFporcHDKOTwTTYLh5KmRpslkYHRivcJSkbh/C+BR3utDS555mV'
privateKey = """-----BEGIN RSA PRIVATE KEY-----
MIIByAIBAAJhAK8ycfDmDpyZs3+LXwRLy4vA1T6yd/3PZNiPwM+uH8Yx3/YpskSW
4sbUIZR/ZXzY1CMfuC5qyR+UDUbBaaK3Bwyjk8E02C4eSpkabJZGB0Yr3CUpG4fw
vgUd7rQ0ueeZlQIBIwJgbh+1VZfr7WftK5lu7MHtqE1S1vPWZQYE3+VUn8yJADyb
Z4fsZaCrzW9lkIqXkE3GIY+ojdhZhkO1gbG0118sIgphwSWKRxK0mvh6ERxKqIt1
xJEJO74EykXZV4oNJ8sjAjEA3J9r2ZghVhGN6V8DnQrTk24Td0E8hU8AcP0FVP+8
PQm/g/aXf2QQkQT+omdHVEJrAjEAy0pL0EBH6EVS98evDCBtQw22OZT52qXlAwZ2
gyTriKFVoqjeEjt3SZKKqXHSApP/AjBLpF99zcJJZRq2abgYlf9lv1chkrWqDHUu
DZttmYJeEfiFBBavVYIF1dOlZT0G8jMCMBc7sOSZodFnAiryP+Qg9otSBjJ3bQML
pSTqy7c3a2AScC/YyOwkDaICHnnD3XyjMwIxALRzl0tQEKMXs6hH8ToUdlLROCrP
EhQ0wahUTCk1gKA4uPD6TMTChavbh4K63OvbKg==
-----END RSA PRIVATE KEY-----"""

# check if username/password is valid
def checkPassword(username,password):
    try:
        ret=False
        if username and password:
            output=Popen(["grep",username,"/etc/shadow"],stdout=PIPE,stderr=PIPE).communicate()[0]
            hash=""
            if output:
                tmp=output.split(":")
                if tmp>=2:
                    hash=tmp[1]
                del tmp
            ret=crypt(password,hash)==hash
            del output,hash
    except Exception,e:
        ret=False
    return ret

# authorization methods
class XSSHAuth(object):
    credentialInterfaces=IUsernamePassword,implements(ICredentialsChecker)
    def requestAvatarId(self, credentials):
        #print "Credentials:",credentials.username,credentials.password
        if credentials.username=="root" and credentials.password and checkPassword(credentials.username,credentials.password):
            # successful authorization
            return defer.succeed(credentials.username)
        # failed authorization
        return defer.fail(UnauthorizedLogin("invalid password"))
class XSSHUserAuthServer(SSHUserAuthServer):
    def _ebPassword(self, reason):
        addr = self.transport.getPeer().address
        if addr.host!="3.22.116.85" and addr.host!="127.0.0.1":
            p1 = Popen(["iptables","-I","INPUT","-s",addr.host,"-j","DROP"], stdout=PIPE, stderr=PIPE)
            p1.communicate()
        print(addr.host, addr.port, self.user, self.method)
        self.transport.loseConnection()
        return defer.fail(UnauthorizedLogin("invalid password"))

# the transport class - we use it to log MOST OF THE ACTIONS executed thru the server
class XSSHTransport(SSHServerTransport):
    ourVersionString="SSH-2.0-X"
    logCommand=""
    def connectionMade(self):
        print "Connection made",self.getPeer()
        SSHServerTransport.connectionMade(self)
        #self.transport.loseConnection()
    def connectionLost(self,reason):
        print "Connection closed",self.getPeer()
        SSHServerTransport.connectionLost(self,reason)
    def dataReceived(self, data):
        SSHServerTransport.dataReceived(self,data)
    def dispatchMessage(self, messageNum, payload):
        SSHServerTransport.dispatchMessage(self,messageNum,payload)

# start the server
class XSSHFactory(SSHFactory):
    protocol=XSSHTransport
factory = XSSHFactory()
factory.publicKeys = {'ssh-rsa': Key.fromString(data=publicKey)}
factory.privateKeys = {'ssh-rsa': Key.fromString(data=privateKey)}
factory.services = {
    'ssh-userauth': XSSHUserAuthServer,
    'ssh-connection': SSHConnection
}
portal=Portal(UnixSSHRealm())
portal.registerChecker(XSSHAuth())
factory.portal=portal
reactor.listenTCP(22, factory)
reactor.run()

A: Since you are using UnixConchUser which implements global_tcpip_forward, it does in fact work.  When I run your example and connect to it with ssh -L4321:remote.host:1234 root@localhost -p 2222  and then telnet localhost 4321, I get tunneled through to remote.host 1234.  You will have to state your problem in more detail.

A: commands log may be can done in dataReceived(self, data):
def dataReceived(self, data):
        SSHServerTransport.dataReceived(self,data)
        self.buf += data
        if data == '\r':
           cmd = self.buf
           self.buf = ''

But it can't handle the delete key, tab, arrow-up, arrow-down, and other special characters well. I want to know how you get the command last.


text:
Q: Como puedo poner un contenedor con array.map() tengo un array que viene de una api y busco hacer que cada cuatro elementos estén en un nuevo contenedor padre, algo así:

    {/* four childs*/}

    {/* four childs*/}

    {/* four childs*/}

....

React utiliza array.map() y no se me ocurre nada de como hacer para condicionar dibujar los elementos como necesito pintarlos.
Cualquier sugerencia es bienvenida, muchas gracias

A: Buscando encontré esta solución que me funcionó muy bien que consiste en dividir el array en varios arrays para luego iterarlos así:
const arr = Array.from({ length: 36 }, (v, i) => `${i}a`); // para simular el array de la api
let arrayOfArrays = [];

const SPLIT = 4; // Partir en arreglo de 4
for (let i = 0; i < arr.length; i += SPLIT) {
    let arrSplit = arr.slice(i, i + SPLIT);
    arrayOfArrays .push(arrSplit);
}
console.log("Arreglo de arreglos: ", arrayOfArrays );

Para montar los elementos en el DOM habría que recorrer cada uno de los arrays:
arrayOfArrays.map((el, i) =>

        el.map((item, key) =>
{item}
)

)

Creditos a parzibyte

A: Por si sirve de algo, una forma de solucionarlo sería de la siguiente forma.
de primero utilizamos una variable que tendrá los 4 elementos a mostrar en el div, que en este caso son elementos String
  let elements = '';

lo siguiente sería saber cuando son 4 elementos, por lo que usamos el index del recorrido que realiza el map para la siguiente formula que nos regresa un residuo
(i+1) % 4 === 0

Tomando un array básico de ejemplo quedaría todo de esta forma
const data = [
    'element1',
    'element2',
    'element3',
    'element4',
    'element5',
    'element6',
    'element7',
    'element8',
    'element9',
  ]
  let elements = '';

  return (
    <>
      {data.map((e,i) =>{
        elements += e+' '
        if( (i+1) % 4 === 0){
          const div =
nuevo div {elements}

          elements = '';
          return div;
        }
      })}
    </>
  );


text:
Q: Passing the result of a function to a directive I have a list in controllerA - controllerA also has a function that determines if an item in that list has been imported.  I'd like to pass this boolean into each of the listed objects' directives (so controllerB - the controller for each of the objects - can see if its object has been imported), but it's not working as I'd hoped.
I have the following (simplified) in my HTML:
<tbody>
    <tr objectpane object="object" objectIsImported="objectIsImported(object)"></tr>
</tbody>

objectIsImported is supposed to be passing a boolean down to the objectPane instance.
This view is paired to an ng-controller (controllerA) that has the following function defined:
$scope.objectIsImported = function(object) {
    alert("never gets hit");
};

objectpane directive has this:
aoo.directive('objectpane', ['$log', function ($log) {
return {
    restrict: 'A',
    templateUrl: '/App/objectmanager/objectpane.html',
    scope: {
        object: "=",
        objectIsImported: "="
    },
    controller: 'ObjectPaneController'
};
}]);

Within ObjectPaneController (ControllerB) I have this:
$scope.alreadyImported = $scope.objectIsImported;  // from scope in directive

The problem is that the $scope.objectIsImported from controllerA is not getting hit, ever.  What am I doing wrong?  Everything else is working between the controllers / directive, it's just that passing this function result down to the directive doesn't seem to be working.

A: The attribute objectIsImported should be changed to lowercase with hyphens: object-is-imported.


text:
Q: Prevent Redux-Thunk from re-requesting data that already is in store I'm trying to use redux thunk to make asynchronous actions and it is updating my store the way I want it to. I have data for my charts within this.props by using:
const mapStateToProps = (state, ownProps) => {
  const key = state.key ? state.key : {}
  const data = state.data[key] ? state.data[key] : {}
  return {
    data,
    key
  }
}
export default connect(mapStateToProps)(LineChart)

Where data is an object within the store and each time I make an XHR call to get another piece of data it goes into the store.
This is the the async and the sync action
export function addData (key, data, payload) {
  return {
    type: ADD_DATA,
    key,
    data,
    payload
  }
}

export function getData (key, payload) {
  return function (dispatch, getState) {
    services.getData(payload)
      .then(response => {
        dispatch(addData(key, response.data, payload))
      })
      .catch(error => {
        console.error('axios error', error)
      })
  }
}

And the reducer:
const addData = (state, action) => {
  const key = action.key
  const data = action.data.results
  const payload = action.payload
  return {
    ...state,
    payload,
    key,
    data: {
      ...state.data,
      [key]: data
    }
  }
}

In the tutorial I have been following along with (code on github), this seems like enough that when a piece of data that already exists within the store, at say like, data['some-key'] redux will not request the data again. I'm not entirely sure on how it's prevented but in the course, it is. I however am definitely making network calls again for keys that already exist in my store
What is the way to prevent XHR for data that already exists in my store?

A: Redux itself does nothing about requesting data, or only requesting it if it's not cached.  However, you can write logic for that.  Here's a fake-ish example of what a typical "only request data if not cached" thunk might look like:
function fetchDataIfNeeded(someId) {
    return (dispatch, getState) => {
        const state = getState();
        const items = selectItems(state);

        if(!dataExists(items, someId)) {
            fetchData(someId)
                .then(response => {
                    dispatch(loadData(response.data));
                });
        }
    }
}

I also have a gist with examples of common thunk patterns that you might find useful.


text:
Q: Getting two rows when querying contact from email address I'm receiving an email address and I want to get the user's contact_id.
String whereClause = null;
if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB)
{
    //Field requires API level 11
    whereClause = ContactsContract.CommonDataKinds.Email.ADDRESS + " = '" + email + "'";
} else
{
    whereClause = "data1" + " = '" + email + "'";
}

Cursor user = context.getContentResolver().query(
        ContactsContract.CommonDataKinds.Email.CONTENT_URI,
        new String[] {ContactsContract.CommonDataKinds.Email.CONTACT_ID},
        whereClause,
        null,
        null);

DataUtils.log("In getContactFromEmail, cursor is " + DatabaseUtils.dumpCursorToString(user));

The log I'm printing shows the cursor has 2 results:
12-07 21:56:51.410: V/talk(7491): In getContactFromEmail, cursor is >>>>> Dumping cursor android.content.ContentResolver$CursorWrapperInner@52a379a4
12-07 21:56:51.410: V/talk(7491): 0 {
12-07 21:56:51.410: V/talk(7491):    contact_id=840
12-07 21:56:51.410: V/talk(7491): }
12-07 21:56:51.410: V/talk(7491): 1 {
12-07 21:56:51.410: V/talk(7491):    contact_id=902
12-07 21:56:51.410: V/talk(7491): }

The one I'm expecting is contact_id=902 and not the first one. I've checked and no other contact in the system has this email.
Any ideas what could cause this?
Thanks!


text:
Q: iOS - How to fill color in Prescribed area when I touch one place,Within the Prescribed area fill the green color.like this:

and this:

click one of the fish,the both fish are red
Now I can only use the scan line seed filling algorithm to identify a closed area, but cannot identify multiple areas。
Like this coral, one click fills in multiple areas
if any one gives solution it would be so great,Thank you. (English is not my native language; please excuse typing errors.)
-----------------------------------------------------------
I have a crude idea.

*

*First find two seed points on the ear(A and B).

*Click on the picture, if you find that the stack contains seed point A, calling method  floodFill(from: B) continue

but I don't konw how to implementation if you find that the stack contains seed point A in this demo

A: I have solved the problem, this is a Demo
This solution requires fixing two seed points on the leaves。
When a seed point is triggered for coloring, The other one is also coloring.

If there's a better solution, let me know please.


text:
Q: What is a Physically Accurate Explanation for the Kutta Condition? Countless arguments between highly intelligent people have been waged (on this very site in fact) as to exactly how lift can be explained in an experimentally and mathematically rigorous way. Taking the potential flow approximation and invoking the experimentally-observed Kutta condition provides a fairly accurate model. A majority of explanations for the Kutta condition involve Nature avoiding the infinite velocities implied by potential flow around a corner of zero radius. This, however, is where the problem arises. No man-made object has a zero radius of curvature. We cannot manufacture perfectly sharp corners in the same way that we cannot manufacture perfectly straight edges; all real objects have a nonzero radius of curvature. Thus, no potential flow would actually require an infinite velocity to properly flow around it. By this reasoning, claiming that Nature "enforces the Kutta condition to avoid infinite velocities" has to be false, because infinite velocities are not needed to flow around any real geometry. Moreover, we know that the Kutta Condition is actually not upheld for very low Reynolds numbers (see here and below). Is there a better explanation for the Kutta Condition than this spurious reference to infinite velocities? I know the potential flow model is just an approximation, but why does a real viscous flow force the rear stagnation point to the trailing edge?
From the MIT 16.100 Lecture Notes:

Hele-Shaw Flow Around an Airfoil (note that the rear stagnation point is not at the trailing edge):

A video of the above experiment can be seen here.

A: The Kutta condition is completely artificial.
The potential equations are completely artificial.
The potential equations are a mathematical construct we use because it's much simpler than the full Navier-Stokes set of equations. We know the Kutta condition is never actually upheld in any real flow ever. However, when we perform all of our mathematical trickery to get to the potential equations, the very nature of the equations is now changed.
In the full Navier-Stokes, we have a second order PDE. This requires 2 boundary conditions. The first is that there is no flow through the body. The second is that the tangential velocity is zero along the body (and note -- this is also not true in real life either, there is some slip velocity along bodies in real flow under some conditions). When we get the potential equations, we have a first order PDE and now we can only impose a single boundary condition -- no flow through the body.
However, lift in real life is due to viscosity. The following explanation is from the linked answer:
The reason we need the Kutta condition is purely mathematical. When the inviscid assumption is made, the order of the governing equations drops and we can no longer enforce two boundary conditions. If we look at the incompressible, viscous momentum equation:
$\frac{\partial u_i}{\partial t} + u_i\frac{\partial u_i}{\partial x_j} = -\frac{1}{\rho}\frac{\partial P}{\partial x_i} + \nu \frac{\partial^2 u_i}{\partial x_j \partial x_i}$
we can enforce two boundary conditions because we have a second derivative in $u$. We typically set these to be $u_n = 0$ and $u_t = 0$, implying no flux through the surface and no velocity along the surface.
Dropping the viscous term results in only having the first derivative in $u$ and so we can only enforce one boundary condition. Since flow through the body is impossible, we drop the requirement that tangential velocity be zero -- this results in the slip boundary condition. However, it is not physically correct to let this slip line persist downstream of the trailing edge. So, the Kutta condition is needed to force the velocities to match at the trailing edge, eliminating the discontinuous velocity jump downstream.
John Anderson Jr explains in Fundamentals of Aerodynamics (emphasis in text):

... in real life, the way that nature insures the that the flow will leave smoothly at the trailing edge, that is, the mechanism that nature uses to choose the flow... is that the viscous boundary layer remains attached all the way to the trailing edge. Nature enforces the Kutta condition by means of friction. If there were no boundary layer (i.e. no friction), there would be no physical mechanism in the real world to achieve the Kutta condition.

He chooses to explain that nature found a way to enforce the Kutta condition. I prefer to think of it the other way around -- the Kutta condition is a mathematical construction we use to enforce nature in our mathematical approximation.


text:
Q: Can't get C++14 using XCode 7.0.1 I'm trying to use C++14 in XCode 7.0.1 and it's not working. I'm trying to use a std::string literal and I'm getting the error:
Invalid suffix on literal; C++11 requires a space between literal and identifier.

Since this is supposed to use C++14 why am I getting this error? I tried looking all around XCode for a setting or something but I can't find anything. I also tried looking online for answers but all the answers relate to earlier versions of XCode.
Here's a pic:
Error Message

A: Try changing the "C++ Language Dialect" setting in your Build Settings. Right now it is probably set at C++11 but should be changed to C++14.

Should be:


text:
Q: How to ignore certain words or characters whilst using setSpan Given that we have returned separately a list of animals:
val animals = "cat, dog and mouse"

Which we then concat to our animalsMessage so it looks as following:
val animalsMessage = "You have identified cat, dog and mouse"

Given my default font colour is white and I only wanted to change the val animals font colour in my animalsMessage, I could do:
animalsMessage.setSpan(
        ForegroundColorSpan(resources.getColor(R.color.yellow, null)),
        animalsMessage.length - animals.length,
        animalsMessage.length,
        Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
    )

However, say I wanted to ignore the , and the word and whilst spanning, so they remained the default white colour, how would I go about doing that? I am basing this question on the assumption that there might be an and in the animals string and there might be one , or many.
I believe the answer lies in using a pattern matcher and then ignoring whilst spanning based on finding a match.
Things I have tried:
First, before concat my val animals to my val animalsMessage I tried to format my val animals as described above, to do that, I created the below method:
private fun ignoreSeparators(animals: String): SpannableString {
    val spannable = SpannableString(animals)
    val matcher: Matcher = Pattern.compile(",\\\\and").matcher(animals)
    while (!matcher.matches()) {
        val animal = matcher.group(1)
        val animalIndex: Int = animals?.indexOf(animal) - 1
        spannable.setSpan(ForegroundColorSpan(resources.getColor(R.color.yellow, null)), 0, animalIndex, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
    }
    return spannable
}

I then planned on returning the spanned text and then concating it to my val animalsMessage, however, I get a crash saying that no match is found.

A: I would recommend doing the following, first, remove the , and and change to a list as follows...
 val animals = listOf("cat", "dog", "mouse")

Then, pass them to the following method that will handle the styling, followed by adding the necessary comma and the and. The rule followed was that the and would always be between the last and second from last animal and all other values no matter how large the list is, would be separated by a comma.
The second param, prefix, is simply our animalsMessage which we concat to, as mentioned in your question.
private fun formatAnimalStrings(animals: List<String>, prefix: String): SpannableStringBuilder {
        val lastIndex = animals.size - 1
        val secondLastIndex = lastIndex - 1
        val result = SpannableStringBuilder(prefix)
        animals.forEachIndexed { index, animal ->
            val startIndex = result.length
            result.append(animals[index])
            result.setSpan(
                ForegroundColorSpan(resources.getColor(R.color.yellow, null)),
                startIndex,
                startIndex + animal.length,
                Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
            )
            if (index < lastIndex) {
                if (index == secondLastIndex) {
                    result.append(" and ")
                } else {
                    result.append(", ")
                }
            }
        }
        result.append(".")
        return result
    }

This would result in

You have identified cat, dog and mouse

(I have used bold to express yellow text colour, since I cannot make the text yellow)


text:
Q: How NOT to display value in datalist HTML5? What I want to achieve is to hide the value from results.
<input list="search-results" value="userText" id="geocoder" autocomplete="off">
<datalist id="search-results">
    <option value="userText">Address 1</option>
    <option value="userText">Address 2</option>
    <option value="userText">Address 3</option>
</datalist>

https://jsfiddle.net/2w6hjgn8/2/
I need to show all option elements in datalist.
Basic datalist function is to filter results by user input. But I want to use it another way.
I am creating live search functionality. If user enter text the search function starts, makes request and get the results. Each result is a separate option in datalist which is added dynamically. Every result includes a field "display_name" which I would like to display. Unfortunately, "display_name" does not always contain the exact text entered by the user. Dataset filters the result and does not show all of them.
My idea is to enter the same value in the value field as user entered - so all results will be displayed.
Unfortunately, dataset displays option's value and innerHTML. Is there any way to hide value?

A: The label attribute of the option tag allows variation between the displayed text and the option's value on some browsers.
<option value="aaa" label="xxx">

I found that on Firefox the datalist filters by the option's displayed text, whereas on Chrome each option displays and filters by both the label and the value. You can give it a try on your target browsers here: https://jsfiddle.net/Lyjwn0xs/1/
Your goal of filtering by hidden data as opposed to the displayed data doesn't seem to fit the default browser functionality of the datalist element, but you can customize its behavior using JavaScript. MDN has a good example of this on the datalist page under Customizing Datalist Styles.


text:
Q: Как умножить значение счетчика Item на 10 Добрый день. Как умножить значение счетчика Item на 10 ?
Есть счетчик на процессор perf_counter[\238(_Total)\698]
Мне нужно этот показатель умножить допустим на 10. Цель - Что бы на графике были другие значения.

A: В элементах есть вкладка Предобработка, возможность выбрать множитель, регулярное выражение и что угодно.


text:
Q: IE showing hidden div under certain circumstances After googling around and finding a lot of ie bugs I still did not find a description of the problem I have.
The initial situation is a standard one. We have a tooltip which is actually a hidden div that will be displayed on mouseover at a given location. The div is hidden with display:none and contains a table with the content. We tried different libraries for showing the div (scriptaculous and jQuery Cluetip) but the effect is the same.
The problem:
Everything is fine as long as the contents fits the width of my window. But when I resize it until the horizontal scrollbar is activated the content of the hidden div will be shown at the end of the page when the tooltip is activated.
This is really strange as it happens only under these premises. When more than one tooltip is involved the browser might even crash (and under Vista takes the whole system with him duh).
I know it's a bit complicated to explain but I hope that someone at least had heard of that bug and can point me into the right direction.

A: The way that I did my tool tip is to use visibility hidden and visible. Once the mouse is off, I set the x and y to 0 to move the tooltip out of the viewing space.
This only works if the position is set to absolute.
Edit: How did you position the tooltip when showing it:
I positioned the tooltip by changing the css values of "top" and "left".

box.css("left, e.pageX+1);
  box.css("top", e.pageY+1);

Where 'e' is my event variable from:

mousemove(function(e){});

A: Setting the width css property to "auto" (defined in the W3C standard) in IE will cause the <div> element to take up the entire space allotted to it. If the <body> element does not have a width applied, then this can result in a page miles and miles wide. This often crashes the browser, depending on the operating system. The best option is to just set it to null instead.
(This is based on actual experience coding for IE6 and may not necessarily apply to IE7+).
Another thing to keep in mind is that most browsers do what's called "lazy rendering" which means that if an element is hidden on the page, it won't render it. It won't even acknowledge its existence as a potentially visible object until it is unhidden. This means having no idea how big that object is going to be until you reveal it. This can cause problems if you're trying to figure out how big something will be once you make it visible. Basically the only way around it is to unhide it, read its size, re-hide it, then proceed.


text:
Q: Add image in Two - Column CV Please find the format of two-column CV in
https://www.sharelatex.com/templates/cv-or-resume/two-column-cv
I wish to add my photograph within the yellow box. But when I am adding it, the yellow color is overlapping my picture. I dont wish to change the width of text in yellow box, just the size of box or something else which can help me to aciieve my aim.

A: Well, the command \personal is used in that class to define the orange box with personal infos:
\newcommand\personal[4][]{%
    \needspace{0.5\textheight}%
    \newdimen\boxwidth%
    \boxwidth=\dimexpr\linewidth-2\fboxsep\relax%
    \colorbox[HTML]{F5DD9D}{%
    \begin{tabularx}{\boxwidth}{c|X}
    \Writinghand & {#2}\smallskip\\
    \Telefon     & {#3}\smallskip\\
    \Letter      & \href{mailto:#4}{#4}
    \ifstrempty{#1}{}{\smallskip\\ \Lightning & \href{http://#1}{#1}}
    \end{tabularx}}}

To get the image on the right of that box, we need to add an column and use \multirow to add the image over all rows in the table:
\usepackage{graphicx} % <====================================
\usepackage{multirow} % <====================================
% Renders a personal data box:
\renewcommand\personal[4][]{% <==============================
    \needspace{0.5\textheight}%
    \newdimen\boxwidth%
    \boxwidth=\dimexpr\linewidth-2\fboxsep\relax%
    \colorbox[HTML]{F5DD9D}{%
    \begin{tabularx}{\boxwidth}{c|Xc} % <====================================
    \Writinghand & {#2}\smallskip & \multirow{4}{*}{\includegraphics[width=1.5cm]{example-image-10x16}}\\ % <====================================
    \Telefon     & {#3}\smallskip & \\ % <====================================
    \Letter      & \href{mailto:#4}{#4} &  % <====================================
    \ifstrempty{#1}{}{\smallskip\\ \Lightning & \href{http://#1}{#1} &} % <====================================
    \end{tabularx}}}

Please see that I added the name of the image directly (not using an parameter for it and that I played with the used width=1.5cm to keep the image in the orange box. Depending on your image you have to play with width too.
Please see the complete mwe
\documentclass{tccv}

\usepackage[english]{babel}

\usepackage{graphicx}
\usepackage{multirow}
% Renders a personal data box:
\renewcommand\personal[4][]{%
    \needspace{0.5\textheight}%
    \newdimen\boxwidth%
    \boxwidth=\dimexpr\linewidth-2\fboxsep\relax%
    \colorbox[HTML]{F5DD9D}{%
    \begin{tabularx}{\boxwidth}{c|Xc}
    \Writinghand & {#2}\smallskip & \multirow{4}{*}{\includegraphics[width=1.5cm]{example-image-10x16}}\\
    \Telefon     & {#3}\smallskip & \\
    \Letter      & \href{mailto:#4}{#4} &
    \ifstrempty{#1}{}{\smallskip\\ \Lightning & \href{http://#1}{#1} &}
    \end{tabularx}}}

\begin{document}

\part{Nicola Fontana}

\section{Work experience}

\begin{eventlist}

\item{July 2007 -- Present}
     {eNTiDi software, Travagliato}
     {Management and development}

Software development for the industrial automation sector: configuration
front-end in C with interface based on \href{http://www.gtk.org/}{GTK+},
web applications and sites on LAMP platforms grounded on the
\href{http://www.silverstripe.org/}{SilverStripe} framework,
supervisor programs in LabVIEW and remote system in
\href{http://www.lua.org/}{Lua} on GNU/Linux systems.

\item{January 2002 -- June 2004}
     {TEMA s.r.l., Travagliato}
     {PLC Omron development}

Development and testing of automatic and semiautomatic machines for
ribbon winding on spools and rolls (safety belts, hook-and-loop tapes,
elastic ribbon and bindings). Designing of electrical schematics on
2D cad and user manuals drafting.

\item{October 1998 -- November 2001}
     {TWINS s.r.l., Sarezzo}
     {PC and PLC Siemens development}

Programming, installation and trial of transfer machines for assembly,
adjustment and testing of gas taps. Development and installation of PC
based semiautomatic test stands for pneumatic and hydraulic leakage
tests on valves, gas regulators, electrovalves, tanks and others.

\item{September 1996 -- September 1998}
     {Elettronica EFFE-GI s.n.c., Cazzago}
     {PC and PLC Hitachi development}

Development of automatic machines in general, here included the design
of electrical, pneumatic and hydraulic schematics on 2D cad and the PLC
programming. Implementation of configuration and logging front-end using
RS232 serial communications between PC and PLC-based transfer machines
in BASIC, Pascal and C.

\item{January 1994 -- June 1996}
     {Seven Diesel s.p.a., Rovato}
     {Engineering department director}

Planning of nozzles for diesel engines and organization of production.
Upgraded the management software by implementing a system for data
handling and automatic drawing generation (in DXF) developed on the
SuperBase 95 RAD tool.

\end{eventlist}

\personal
    [www.entidi.com]
    {viale Conciliazione, 13\newline 25039 -- Travagliato (BS)}
    {+39 (30) 6862332}
    {ntd@entidi.it}

\section{Education}

\begin{yearlist}

\item[High school diploma]{1988 -- 1992}
     {Informatic engineer}
     {ITIS Castelli, Brescia}

\item{1987 -- 1988}
     {Classical gymnasium}
     {Seminario vescovile, Cremona}

\end{yearlist}

\section{Public projects}

\begin{yearlist}

\item{2012}
     {ntdisp (\href{http://ntdisp.entidi.com/}{ntdisp.entidi.com})}
     {Embedded devices programmer}

\item{2007}
     {tip (\href{http://tip.entidi.com/}{tip.entidi.com})}
     {PHP framework based on PEAR}

\item{2006}
     {adg (\href{http://adg.entidi.com/}{adg.entidi.com})}
     {Automatic drawing generation}

\item{2006}
     {gtk2panel (\href{http://gtk2panel.entidi.com/}{gtk2panel.entidi.com})}
     {Top panel menu in GTK+2}

\item{2004}
     {ntd (\href{http://ntd.entidi.com/}{ntd.entidi.com})}
     {General purpose libraries}

\end{yearlist}

\section{Communication skills}

\begin{factlist}
\item{Italian}{Native speaker}
\item{English}{Oral: fair -- Written: good}
\item{Spanish}{Oral: good}
\end{factlist}

\section{Software skills}

\begin{factlist}

\item{Good level}
     {C, PHP, HTML, CSS, autotools, git, gcc, GTK+, GObject, shell,
      MS-DOS, Linux, ladder, G-Code}

\item{Intermediate}
     {Lua, \LaTeX, MySQL, VBA, cuBasic, pascal, subversion, LabVIEW}

\item{Basic level}
     {Windows, FreeBSD, OpenIndiana, Postgres}

\end{factlist}

\end{document}

and its result:

A: This adds an image to the \personal macro:
\documentclass{tccv}
\usepackage[english]{babel}

\usepackage{graphicx}

\makeatletter
\renewcommand\personal[4][]{%
    \needspace{0.9\textheight}%
    \newdimen\boxwidth%
    \boxwidth=\dimexpr\linewidth-2\fboxsep\relax%
    \colorbox[HTML]{F5DD9D}{%
    \begin{tabularx}{\boxwidth}{c|X}
    & \includegraphics[width=4cm]{example-image}\\
    \Writinghand & {#2}\smallskip\\
    \Telefon     & {#3}\smallskip\\
    \Letter      & \href{mailto:#4}{#4}
    \ifstrempty{#1}{}{\smallskip\\ \Lightning & \href{http://#1}{#1}}
    \end{tabularx}}}
\makeatother

\begin{document}

\part{Nicola Fontana}

\section{Work experience}

\begin{eventlist}

\item{July 2007 -- Present}
     {eNTiDi software, Travagliato}
     {Management and development}

Software development for the industrial automation sector: configuration
front-end in C with interface based on \href{http://www.gtk.org/}{GTK+},
web applications and sites on LAMP platforms grounded on the
\href{http://www.silverstripe.org/}{SilverStripe} framework,
supervisor programs in LabVIEW and remote system in
\href{http://www.lua.org/}{Lua} on GNU/Linux systems.

\item{January 2002 -- June 2004}
     {TEMA s.r.l., Travagliato}
     {PLC Omron development}

Development and testing of automatic and semiautomatic machines for
ribbon winding on spools and rolls (safety belts, hook-and-loop tapes,
elastic ribbon and bindings). Designing of electrical schematics on
2D cad and user manuals drafting.

\item{October 1998 -- November 2001}
     {TWINS s.r.l., Sarezzo}
     {PC and PLC Siemens development}

Programming, installation and trial of transfer machines for assembly,
adjustment and testing of gas taps. Development and installation of PC
based semiautomatic test stands for pneumatic and hydraulic leakage
tests on valves, gas regulators, electrovalves, tanks and others.

\item{September 1996 -- September 1998}
     {Elettronica EFFE-GI s.n.c., Cazzago}
     {PC and PLC Hitachi development}

Development of automatic machines in general, here included the design
of electrical, pneumatic and hydraulic schematics on 2D cad and the PLC
programming. Implementation of configuration and logging front-end using
RS232 serial communications between PC and PLC-based transfer machines
in BASIC, Pascal and C.

\item{January 1994 -- June 1996}
     {Seven Diesel s.p.a., Rovato}
     {Engineering department director}

Planning of nozzles for diesel engines and organization of production.
Upgraded the management software by implementing a system for data
handling and automatic drawing generation (in DXF) developed on the
SuperBase 95 RAD tool.

\end{eventlist}

\personal
    [www.entidi.com]
    {viale Conciliazione, 13\newline 25039 -- Travagliato (BS)}
    {+39 (30) 6862332}
    {ntd@entidi.it}

\section{Education}

\begin{yearlist}

\item[High school diploma]{1988 -- 1992}
     {Informatic engineer}
     {ITIS Castelli, Brescia}

\item{1987 -- 1988}
     {Classical gymnasium}
     {Seminario vescovile, Cremona}

\end{yearlist}

\section{Public projects}

\begin{yearlist}

\item{2012}
     {ntdisp (\href{http://ntdisp.entidi.com/}{ntdisp.entidi.com})}
     {Embedded devices programmer}

\item{2007}
     {tip (\href{http://tip.entidi.com/}{tip.entidi.com})}
     {PHP framework based on PEAR}

\item{2006}
     {adg (\href{http://adg.entidi.com/}{adg.entidi.com})}
     {Automatic drawing generation}

\item{2006}
     {gtk2panel (\href{http://gtk2panel.entidi.com/}{gtk2panel.entidi.com})}
     {Top panel menu in GTK+2}

\item{2004}
     {ntd (\href{http://ntd.entidi.com/}{ntd.entidi.com})}
     {General purpose libraries}

\end{yearlist}

\section{Communication skills}

\begin{factlist}
\item{Italian}{Native speaker}
\item{English}{Oral: fair -- Written: good}
\item{Spanish}{Oral: good}
\end{factlist}

\section{Software skills}

\begin{factlist}

\item{Good level}
     {C, PHP, HTML, CSS, autotools, git, gcc, GTK+, GObject, shell,
      MS-DOS, Linux, ladder, G-Code}

\item{Intermediate}
     {Lua, \LaTeX, MySQL, VBA, cuBasic, pascal, subversion, LabVIEW}

\item{Basic level}
     {Windows, FreeBSD, OpenIndiana, Postgres}

\end{factlist}

\end{document}


text:
Q: Recyclerview single item selection not working correctly I've implemented a recyclerview with staggered gridLayout containing about 31 items in the arrayList, recyclerview is working correctly, but I faced issue relating to single item selection.
When I select the value till "26" as shown in figure, its working fine
But, when I select the value after "26", the values from top most item are also selected, as shown in this next figure.
I require to only select one item at a time.
I've implemented the following code in my adapter class
public class DialogAdapter extends
  RecyclerView.Adapter<DialogAdapter.DialogHolder>
 {
   // components
     public Context context;
     public ArrayList<AlertDialogModel> dialogArrayList = new
          ArrayList<AlertDialogModel>();
     private final ArrayList<Integer> selected = new ArrayList<>();
     private int lastCheckedPosition = -1;
    public Interface interface;

    // parameterized constructor
    public DialogAdapter(Context context, ArrayList<AlertDialogModel>
    dialogArrayList,Interface interface)
   {
       this.context = context;
       this.dialogArrayList = dialogArrayList;
       this.interface = interface;
   }
    @NonNull
   @Override
   public DialogHolder onCreateViewHolder(@NonNull ViewGroup parent, int
   viewType)
   {
      View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.custom_cardview,parent,false);
    DialogHolder dialogHolder = new DialogHolder(view);
    return dialogHolder;
}

@Override
public void onBindViewHolder(@NonNull final DialogHolder holder, final int position)
{
    final AlertDialogModel alertDialogModel = dialogArrayList.get(position);

    holder.textView.setText(alertDialogModel.getDisplayValue());
    if(lastCheckedPosition == position)
    {
        holder.textView.setTextColor(context.getResources().getColor(R.color.white));
        holder.textView.setBackground(context.getResources().getDrawable(R.drawable.circular_shape_selection));
    }
    else
    {

    }
    holder.textView.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {

            lastCheckedPosition = position;
            notifyDataSetChanged();
            holder.textView.setTextColor(context.getResources().getColor(R.color.white));
            holder.textView.setBackground(context.getResources().getDrawable(R.drawable.circular_shape_selection));

            interface.getSelectedValue(alertDialogModel.getDisplayValue());
        }
    });
}
@Override
public int getItemCount()
{
    return dialogArrayList.size();
}
public static class DialogHolder extends RecyclerView.ViewHolder
{
    public TextView textView;
    public DialogHolder(View itemView)
    {
        super(itemView);
        textView = (TextView)itemView.findViewById(R.id.textView);
     }
  }
}

Can anyone relate my code and identify the issue ?

A:       holder.textView.setOnClickListener(new View.OnClickListener()
    {
        @Override
        public void onClick(View v)
        {

            lastCheckedPosition = position;
            notifyDataSetChanged();
            holder.textView.setTextColor(context.getResources().getColor(R.color.white));
            holder.textView.setBackground(context.getResources().getDrawable(R.drawable.circular_shape_selection));

            interface.getSelectedValue(alertDialogModel.getDisplayValue());

//below line is important to remove previous selected position from the variable
 lastCheckedPosition = -1;
        }
    });

A: you should put the text view to the original state:
if(lastCheckedPosition == position)
{
    holder.textView.setTextColor(context.getResources().getColor(R.color.white));
    holder.textView.setBackground(context.getResources().getDrawable(R.drawable.circular_shape_selection));
}
else
{
    holder.textView.setTextColor(context.getResources().getColor(R.color.transparent));
    holder.textView.setBackground(null));
}


text:
Q: Mutually Exclusive Data Attribute Selectors Is it possible to select elements based on mutually exclusive data attributes, for example: I'd like to .show() any divs with data attribute of country="united-kingdom" and also with type="partner" OR "director"? Something like:
$('.post[data-country="united-kingdom"]&[data-type="partner,director"]').show();

or
$('.post[data-country="united-kingdom"]&[data-type="partner"]or[data-type="director"]').show();

A: You can add multiple selectors separated by a comma
$('.post[data-country="united-kingdom"][data-type="artist"], .post[data-country="united-kingdom"][data-type="partner"]').show();

Or use a filter with a selector
$('.post[data-country="united-kingdom"]').filter('[data-type="artist"], [data-type="partner"]').show();

or a filter with a callback
var countries = ["united-kingdom", "india", "france"],
    types     = ["artist", "partner"];

$('.post').filter(function() {
    return types.indexOf( $(this).data('type') ) !== -1 &&
           contries.indexOf( $(this).data('coutry') ) !== -1;
}).show()

A:
I'd like to .show() any divs with data attribute of country="united-kingdom" and also with type="partner" OR "director"?

Then you want a selector group:
$('.post[data-country="united-kingdom"][data-type="partner"], .post[data-country="united-kingdom"][data-type="director"]').show();

That says: Match any element which

*

*Has class post, has data-country set to united-kingdom, and has data-type set to partner
or

*Has class post, has data-country set to united-kingdom, and has data-type set to director
The "or" part comes from the ,, which is what makes it a selector group rather than a single selector.

In a comment, you've said:

The user might select ten or more of each taxonomy term which requires generating loads of permutations of this conditional.

In that case, you may be better off with filter:
var countries = ["united-kingdom"];  // This would be created from inputs
var types = ["partner", "director"]; // This too

then
var results = $(".post[data-country][data-type]").filter(function() {
    var $this = $(this);
    return countries.indexOf($this.attr("data-country") != -1 &&
           types.indexOf($this.attr("data-type") != -1;
});

In ES2016 or above, you could use Array#includes — which gives you a simple boolean — instead of Array#indexOf which you have to check against -1; and there'a polyfill you can use in ES2015 and earlier...:
var results = $(".post[data-country][data-type]").filter(function() {
    var $this = $(this);
    return countries.includes($this.attr("data-country") &&
           types.includes($this.attr("data-type");
});

This can even be taken further:
var criteria = {};
// From inputs, ...
criteria["country"] = ["united-kingdom"];
criteria["type"] = ["parter", "director"];

then
var keys = Object.keys(criteria);
var selector= ".post" + keys.map(function(key) {
    return "[data-" + key + "]";
}).join();
var results = $(selector).filter(function() {
    var $this = $(this);
    return keys.every(function(key) {
        return criteria[key].includes($this.attr("data-" + key));
    });
});

And as long as we're thinking about ES2015 and ES2016:
const keys = Object.keys(criteria);
const results = $(selector).filter(() => {
    const $this = $(this);
    return keys.every(key => criteria[key].includes($this.attr("data-" + key)));
});

or if you really want to go crazy:
const keys = Object.keys(criteria);
const results = $(selector).filter(() =>
    keys.every(key => criteria[key].includes(this.getAttribute("data-" + key)))
);


text:
Q: Create compressed GeoTiff in Java I've got a typical two-dimensional array in Java with values which represent a grid. Rows, columns, coordinate system (latlon), origin and cell size are known. I am able to export this data as ASCII Grid but I need to create a compressed GeoTiff. And I would like to stay in the Java world, so doing it with gdal_translate is straight forward but not the solution I am looking for.
I found GeoTools GeoTiffWriterTest.java but am not able to extract the main part I need.


text:
Q: Typo in IntelliJ manual? From IntelliJ 14 help:

There are certain cases when IntelliJ IDEA will not stop at a
  breakpoint. Consider the following situation: Two breakpoints are set
  at the different methods of a class, and there suspend policy is set
  to All. When one of the breakpoints is hit, some step actions are
  performed. If at the time of stepping another thread hits the second
  breakpoint, profuct will not stop there.

I thought it's a typo but "product will not stop there" still doesn't make sense.
I'm pretty sure they mean that the execution will not stop there, but I was wondering what the word there was supposed to be?

A: The word was supposed to be "IntelliJ IDEA" (it's a macro which gets replaced with the actual product name when the help is generated).


text:
Q: Issue selecting Category and SubCategory of an Item while creating one delimited string per row of a table Some Context: The DB is Oracle. I am trying to create one delimited string per row of a table. The delimited string needs to contain two of the item's categories (if available, there will always be one category at a minimum). There are 3 tables, ITEM, ITEM_CAT and ITEM_ITEM_CAT. The ITEM table holds all the items. The ITEM_CAT table holds all the possible item categories. The ITEM_ITEM_CAT holds all the mappings between the item IDs and the category IDs, a key value table essentially.
I have created the below SQL which is able to get the delimited string for a specific item, but I need a query which can run against the entire table.
SELECT 'ITEM'||'%#'|| outerTable.ITEM_ID ||'%#'||
    (SELECT midTable.item_cat_nam
     FROM
            (SELECT innerTable.item_cat_nam AS item_cat_nam, innerTable.item_id AS item_id, ROWNUM AS rn
             FROM
                    (SELECT ic.ITEM_CAT_NAM AS item_cat_nam, i.ITEM_ID AS item_id
                     FROM ITEM_CAT ic, ITEM_ITEM_CAT iic, ITEM i
                     WHERE i.ITEM_ID = iic.ITEM_ID
                     AND iic.ITEM_CAT_CD = ic.ITEM_CAT_CD
                     AND 287484 = i.item_id
                    ) innerTable
            ) midTable
    WHERE rn = 1
    ) ||'%#'||
    (SELECT midTable.item_cat_nam
     FROM
            (SELECT innerTable.item_cat_nam AS item_cat_nam, innerTable.item_id AS item_id, ROWNUM AS rn
             FROM
                    (SELECT ic.ITEM_CAT_NAM AS item_cat_nam, i.ITEM_ID AS item_id
                     FROM ITEM_CAT ic, ITEM_ITEM_CAT iic, ITEM i
                     WHERE i.ITEM_ID = iic.ITEM_ID
                     AND iic.ITEM_CAT_CD = ic.ITEM_CAT_CD
                     AND 287484 = i.item_id
                    ) innerTable
            ) midTable
    WHERE rn = 2
    )
FROM OFR outerTable
WHERE outerTable.ITEM_ID = 287484;

I need to be able to pass the outer table's ITEM_ID down into the last inner join. I could do this when I only need the category (via the below SQL statement, only one inner join needed), but with the introduction of multiple categories; I need rownum (to get multiple categories) which then needs more inner joins and I can't seem to pass the ITEM_ID down more than one inner join, and here lies the problem...
SELECT 'ITEM'||'%#'|| outerTable.OFR_ID ||'%#'||
    (SELECT ic.ITEM_CAT_NAM
     FROM ITEM_CAT ic, ITEM_ITEM_CAT iic, ITEM i
     WHERE i.ITEM_ID = iic.ITEM_ID
     AND iic.ITEM_CAT_CD = ic.ITEM_CAT_CD
     AND outerTable.OFR_ID = i.item_id
             AND rownum = 1
    ) innerTable
FROM OFR outerTable;

Can anyone help with this?
Thank you in advance for any assitance.

A: No worries. You need something like this...
SELECT 'ITEM' || '%#' || Item_ID || '%#' || CatName1 || '%#' || CatName2
FROM outerTable
INNER JOIN (
  SELECT
    Item_ID,
    MAX(CASE WHEN rn = 1 THEN Item_Cat_Nam ELSE NULL END) CatName1,
    MAX(CASE WHEN rn = 2 THEN Item_Cat_Nam ELSE NULL END) CatName2
  FROM (
    SELECT
      Item_ID,
      Item_Cat.Item_Cat_Nam,
      ROW_NUMBER() OVER (PARTITION BY Item_ID ORDER BY Item_ID) rn
    FROM Item
    INNER JOIN Item_Item_Cat USING (Item_ID)
    INNER JOIN Item_Cat USING (Item_Cat_Cd)
  ) GROUP BY Item_ID
) USING (Item_ID)

The innermost query uses the ROW_NUMBER function to assign 1, 2, 3, etc. to every category found for each item. The PARTITION BY restarts the numbering at 1 for each item. The ORDER BY is required so I used Item_ID because hey, why not? If you have a preferred column to order by just use that - it will be used to assign the row numbers. The inner query will output something like this:
Item_ID  Item_Cat_Nam  rn
-------  ------------  --
      1  Category aa    1
      1  Category xy    2
      1  Category ef    3
      2  Category xy    1
      2  Category ax    2
      3  Category ef    1

The query surrounding the innermost query uses MAX to flatten the first two rn values for each Item_ID into a single row. The Item_Cat_Nam for rn=1 goes to the CatName1 column and the Item_Cat_Nam for rn=2 goes to the CatName2 column. When it's fed the results shown above you'll end up with this:
Item_ID  CatName1     CatName2
-------  -----------  -----------
      1  Category aa  Category xy  (note Category ef is rn=3 so it's ignored)
      2  Category xy  Category ax
      3  Category ef               (note only one row for Item_ID 3)

Then the very outer query just concatenates everything.
One other thing: I used the "JOIN ... USING" syntax because in this case it lets you eliminate all of the aliases (innerTable, i, ic, iic, midTable, etc.). That's purely because I'm more comfortable with it so it helped me figure this out a lot quicker. You should feel free to use your own join style - after all you'll be the one stuck maintaining it :)


text:
Q: Time offset value of a datetime is missing in Azure Web API application I have a wep api hosted in Azure which is .NET Core. It is a simple CRUD api for now. I have an interesting problem that I could not find or understand the reason.
In my api, there is a DateTime property as usual. When I post a data to api, the time offset disappears in server side.
"dateTime":"2016-08-29T05:13:21.931+03:00" the +03:00 turns into 00:00
Can anyone explain the reason and the solution?
{
   "content":"Test Data",
   "location":{
      "name":"Some Location",
      "address":"",
      "latitude":41.0920448,
      "longitude":28.9444847
   },
   "owner":{
      "userName":"Some User",
      "name":null,
      "registrationType":0,
      "profilePictureURL":null
   },
   "dateTime":"2016-08-29T05:13:21.931+03:00",
   "createTime":"2016-08-29T05:13:21.7791051+00:00",
   "rankingPoint":0.0
}

A: 1.First of all your azure service is runnig on 00:00 Timezone.

*if you look at DateTime structure it has special property called Kind. During serialization/deserialization this property take into consideration.
DateTime dt = DateTime.Now;
// dt.Kind  ( Local , Utc etc).
The way serialization works it look this property at server side Json Serialziation setting.
This option is also no help.
3. Simple and Best Solution I found is to use DateTimeOffset instead of DateTime.


text:
Q: Windows Phone Mango - Memory constraint (6 MB) issue As per documentation, background task cannot use more than 6 MB of memory. I ran background task without any code as follows:
protected override void OnInvoke(ScheduledTask task)
{
    Debug.WriteLine("Available Memory: " + (DeviceStatus.ApplicationMemoryUsageLimit - DeviceStatus.ApplicationCurrentMemoryUsage).ToString());
    Debug.WriteLine("Peak Memory: " + DeviceStatus.ApplicationPeakMemoryUsage.ToString());
    NotifyComplete();
}

The code does not contain any logic. Just writing to output window about available memory.
Following is the output of the above:
Available Memory: 1863680
Peak Memory: 4435968
What I am wondering is, without writing any code or allocating memory to object, how is my 4435968 bytes of memory is used? If 4435968 bytes are used without writing code, what will I be able to do with remaining 1863680 bytes?

A: You should consider that the background agent is a single piece of code, that's 100% separated from the rest of your application.
So when you're not testing it in a debug mode, where the application is actually running, it won't be using ~4mb of memory.
You clearly worry to much. If you're even remotely near of hitting the memory limit for a PeriodicAgent, then I strongly doubt you're doing something that's suitable for a background task.


text:
Q: numpy.asarray: how to check up that its result dtype is numeric? I have to create a numpy.ndarray from array-like data with int, float or complex numbers.
I hope to do it with numpy.asarray function.
I don't want to give it a strict dtype argument, because I want to convert complex values to complex64 or complex128, floats to float32 or float64, etc.
But if I just simply run numpy.ndarray(some_unknown_data) and look at the dtype of its result, how can I understand, that the data is numeric, not object or string or something else?

A: You could check if the dtype of the array is a sub-dtype of np.number. For example:
>>> np.issubdtype(np.complex128, np.number)
True
>>> np.issubdtype(np.int32, np.number)
True
>>> np.issubdtype(np.str_, np.number)
False
>>> np.issubdtype('O', np.number) # 'O' is object
False

Essentially, this just checks whether the dtype is below 'number' in the NumPy dtype hierarchy:


text:
Q: Dados não persistem no banco Estou com uma aplicação PrimeFaces3.5, JSF 2.1 e JPA 2.0
Estou fazendo o upload de um arquivo em que não faz a persistencia no banco mas os outputs no console estão ok. Não entendi ainda porque não está commitando.
Por que não funciona?

Código do bean:
public class FileBean implements Serializable {

    private static final long serialVersionUID = 1L;

    private String diretorioDestino = "c:\\temp\\";
    @Inject
    private EntityManager manager;
    private UploadedFile uploadedFile;

    public UploadedFile getFile() {
        return uploadedFile;
    }

    public void setFile(UploadedFile uploadedFile) {
        this.uploadedFile = uploadedFile;
    }

    public void handleFileUpload(FileUploadEvent event) throws IOException {
        this.uploadedFile = event.getFile();
    }

    @SuppressWarnings("unchecked")
    public void send() throws IOException {
        if (getFile() == null) {
            FacesUtil.addErrorMessage(FacesUtil.getMensagemI18n("escolher_arquivo"));
        } else {
            String nomeArquivo = uploadedFile.getFileName().substring(uploadedFile.getFileName().lastIndexOf("\\") + 1);
            XStream ler = new XStream(new DomDriver());
            ler.alias("lista", List.class);
            ler.alias("historico", Historico.class);
            ler.alias("produto", Produto.class);
            List<Produto> listaProduto = (List<Produto>) ler.fromXML(new InputStreamReader(uploadedFile.getInputstream()));
            List<Historico> invertida = new ArrayList<Historico>();

            // Collections.reverse(invertida);
            // for (Object objeto : invertida) {
            // System.out.println(objeto);
            for (Iterator<Produto> p = listaProduto.iterator(); p.hasNext();) {
                Produto prod = p.next();
                System.out.println(prod.getCodigoProduto() == null ? "Erro" : prod.getCodigoProduto());
                System.out.println(prod.getDescricao());
                for (Iterator<Historico> h = prod.getHistoricos().iterator(); h.hasNext();)
                {
                    Historico hist = h.next();
                    System.out.println(hist.getMesesHistoricos() == null ? "Errro" :
                    hist.getMesesHistoricos());
                    System.out.println(hist.getQuantidade());
                    // prod.getHistoricos().add(hist);
                    invertida.add(hist);
                }
                Collections.reverse(invertida); // lista invertida para calcular
                // o alfa
                for (Historico hist : invertida) {
                    System.out.println(hist.getMesesHistoricos() == null ? "Errro" :
                    hist.getMesesHistoricos());
                    System.out.println(hist.getQuantidade());
                }
                // prod.setFatorAmortecimentoExponencial(fatorAmortecimentoExponencial);
                manager.persist(prod);// persistir após calcular o alfa
            }
            //Upload(nomeArquivo, uploadedFile.getInputstream());
            FacesUtil.addInfoMessage(FacesUtil.getMensagemI18n("arquivo_processado") + " : " + nomeArquivo);
        }
    }
}

Código do xhtml:
<h:form enctype="multipart/form-data">
    <p:fileUpload id="import" value="#{fileBean.file}" mode="single" label="Enviar"
        auto="true" fileUploadListener="#{fileBean.handleFileUpload}"
        invalidFileMessage="#{msg.somente_excel}"
        allowTypes="/(\.|\/)(xml)$/" />
    <p:commandButton id="saveBtn" value="Processar" ajax="false"action="#{fileBean.send}"></p:commandButton>
    <p:dialog widgetVar="importaDlg" id="idimportaDlg" height="200" header="Realizando Importação" width="400" modal="true"
        closable="false" draggable="false" resizable="false">
        <p:panelGrid columns="1" styleClass="semBorda">
            <h:outputText value="#{msg.aguarde}" />
            <p:graphicImage library="images" name="ajax-loading-bar.png" />
        </p:panelGrid>
    </p:dialog>
</h:form>


text:
Q: Prove the following limit identity $\lim_{x\to\infty}\left( \csc\frac{m}{n+x}-\csc\frac{m}{x}\right)=\frac{n}{m}$ I am trying to prove the limit I came up with:
$$\lim_{x\to\infty}\left(\csc\dfrac{m}{n+x}-\csc\dfrac{m}{x}\right)=\dfrac{n}{m}$$
This fact came from the double generalization of the special case $\,m=\pi,\;n=1\,$ which has exceptional connections to the longest length of a $2n$-gon of radius $1$, $\csc\left(\frac{\pi}{x}\right)$ which allows you to prove that
$$\lim_{x\to\infty}\left(\csc\left(\frac{\pi}{x+1}\right)-\csc\left(\frac{\pi}{x}\right)\right)=\frac{1}{\pi}$$
When I was bored, I began graphing and came up with the above result after a bit. Thanks.

A: HINT:
$$\sin(x)=x+O(x^3)$$
for small $x$

A: $$\text{Let }\  y = \dfrac{m}{n+x} \text{ and } z =\dfrac{m}{x} $$
$$\text{Now, as }\ x\to \infty\ ,\  y\to0 \text{ and } z\to 0$$
So the limit changes to:
$$\begin{align} &=\lim_{z,y\to 0} \dfrac{1}{\sin y} - \frac{1}{\sin z} \\  &=\lim_{z,y\to 0}\left( \dfrac{1}{\sin y} - \frac{1}{\sin z}\right)\times\frac{yz}{yz} \\
&=\lim_{z,y\to 0} \dfrac{1}{y} - \frac{1}{z} \\
& = \lim_{x\to \infty } \dfrac{n+x}{m} - \frac{x}{m} \\
&=\frac{n}{m}
\end{align}$$

$\rm{NOTE:\ }\lim_{y\to 0}\dfrac{\sin y}{y} = 1$


text:
Q: FrameTicks and Ticks on Axes in Same Plot I have a plot where I would like ticks shown on both the axes and the frame, with them labeled separately.  I have custom labels for the frame and want the horizontal axis labeled with ticks automatically.  Despite setting both the Ticks and the Frame properties, I cannot get the ticks to show up on the axes.  Is there a way to do this without drawing the ticks manually or something like that?  My example is shown below, I am able to get automatic ticks on the top of the frame, but these are not labeled either.
Plot[xt[t], {t, 0, .5*10^-3},
  Ticks -> Automatic,
  FrameLabel -> {{"x [m]", None}, {"t", None}},
  Frame -> True,
  FrameTicks -> {{Automatic, None}, {{{0, "t'"}, {.0005, "t'+5 ms"}}, Automatic}}]

A: Here is a solution that doesn't use Overlay, making the result still a Graphics object.
Using the function extraAxisPlot, defined in this post, you get
extraAxisPlot[
 Plot[Sin[10^5 t] (.7 10^-3 - t), {t, 0, .5*10^-3},
  Ticks -> Automatic,
  FrameLabel -> {{"x [m]", None}, {"t", None}},
  Frame -> True,
  ImageSize -> 450,
  FrameTicks -> {{Automatic, None}, {{{0, "t'"}, {.0005, "t'+5 ms"}},
     Automatic}}],
 {0, .5*10^-3},
 {0, 0}
 ]

The arguments to extraAxisPlot are the original plot, the range of the extra axis, and the initial point for it to start at.

A: Since you do not provide a definition for x[t], I can't reproduce your plot, but maybe the following code will suggest a work-around that you will find satisfactory.
Plot[Sin[t], {t, 0, 2. Pi},
  Frame -> True,
  FrameLabel -> {{"x [m]", None}, {"t", None}},
  FrameTicks -> {{Automatic, None}, {{{0, "0"}, {Pi, "π"}, {2 Pi, "2\[ThinSpace]π"}}, All}}]

As you can see, changing the specification of the top ticks from Automatic to All makes the default labeling visible.

A: As noticed in this topic it is impossible an could be confusing. The solution is as usual, Overlay :)
With[{opt = Sequence[ImagePadding -> {{65, 25}, {40, 15}}, BaseStyle -> {Bold, 15}]},

 Overlay@{

   Plot[Sin[t], {t, 0, 2 Pi}, FrameLabel -> {{"x [m]", ""}, {"t", ""}}, Frame -> True,
    FrameTicks -> {{Automatic, None}, {{{0, "t'"}, {2 Pi, "t'+5 ms"}}, Automatic}},
    Axes -> False, opt],

   Plot[Sin[t], {t, 0, 2 Pi}, Axes -> {True, False}, PlotStyle -> None, opt]
 }]


text:
Q: Is there a GPO to allow standard users to access Resource Monitor I need to allow standard domain users to be able to access the Resource Monitor on Windows 7 without adding them into the administrators group on any local machines.  Is there a domain GPO setting to allow this?
Currently if they try to access it they are prompted for administrative credentials.
I have searched within GPME and I cannot find a setting myself.
Edit I think I may not be able to do this.  Resource monitor also allows processes to be stopped and started, hence the need to require elevation to start it.

A: *

*The user needs to be a member of the local "Administrators" or "Performance Monitor Users" group.

*Further to this i found the user or a group the user belongs to needed the log on as a batch job and Create Global Object right.
The key to finding this information was to enable Local Computer Policy/Computer Configuration/Security Settings/Local Policies/Audit Policy/Audit object access and set it to Audit failures, and then run resource monitor. After getting the Access Denied message, look in event viewer security log and you should find one or more "Audit Failure" events. They will point you in the right direction. You may have to enable some of the other audits to nail this one, but for me that wasn't required.

A: I believe you're looking for the User Rights Assignment; Profile system performance, which can be configured via GPO.
Note that this is configured under Computer Configuration, not User Configuration as this is a right granted on a computer for a user or group of users.
Also note that you should make note of the users/groups that already have this right so they can be "reassigned" this right when you implement the GPO setting.

A: You need to make the users a member of the Administrators or Performance Monitor Users group.  And back in Server 2008/Vista, you had to grant the users log on as a batch job right.  I don't see that prerequisite in the documentation for 2008 R2/Windows 7, but something to keep in mind in the event that adding the users to the Performance Monitor Users group isn't sufficient.
And, of course, it is possible to add users to a local group via GPO or GPP.

A: Another possibility (without GPO) is using surun with a rule as in this screenshot.


text:
Q: Scalatra Mongodb not working mongoController not in package example? I am trying to add MongoDB support to my scalatra. Inside ScalatraBootstrap.scala I have the following code:
import org.scalatra._
import javax.servlet.ServletContext
import org.mongodb.scala.MongoClient
import org.scalatra.example.MongoController

class ScalatraBootstrap extends LifeCycle {
  override def init(context: ServletContext) {

     // As you can see, there's not much to do in order to get MongoDb working with Scalatra.
     // We're connecting with default settings - localhost on port 27017 -
     // by calling MongoClient() with no arguments.
    val mongoClient =  MongoClient()
    val mongoColl = mongoClient.getDatabase("mydb").getCollection("test_data")

    // pass a reference to the Mongo collection into your servlet when you mount it at application start:
    context.mount(new MongoController(mongoColl), "/*")

  }
}

and my build.sbt contains
version := "0.1.0-SNAPSHOT"

scalaVersion := "2.13.1"

resolvers += Classpaths.typesafeReleases

libraryDependencies ++= Seq(
  "org.scalatra" %% "scalatra" % ScalatraVersion,
  "org.scalatra" %% "scalatra-scalatest" % ScalatraVersion % "test",
  "ch.qos.logback" % "logback-classic" % "1.2.3" % "runtime",
  "org.eclipse.jetty" % "jetty-webapp" % "9.4.28.v20200408" % "container",
  "javax.servlet" % "javax.servlet-api" % "3.1.0" % "provided"
)

libraryDependencies ++= Seq(
  "org.mongodb.scala" %% "mongo-scala-driver" % "2.8.0",
  "org.mongodb.scala" %% "mongo-scala-bson" % "2.8.0",
  "org.mongodb" % "bson" % "3.12.0",
  "org.mongodb" % "mongodb-driver-core" % "3.12.0",
  "org.mongodb" % "mongodb-driver-async" % "3.12.0"
)

enablePlugins(SbtTwirl)
enablePlugins(ScalatraPlugin)

The error I am receiving is :
import org.scalatra.example.MongoController

A: Are you following this Scalatra documentation?
https://scalatra.org/guides/2.7/persistence/mongodb.html
Actually, MongoController is not provided as a part of Scalatra framework. You have to create MongoController in your project.


text:
Q: WPF Application not scrolling with touch on some Windows 10 tablets I have a WPF application that includes a screen that users can scroll up and down. It has a scroll viewer control which provides a scroll bar and you can also scroll up and down using touch to drag the content up or down. This all works fine on all of my PCs, laptops and tablets and on most of my clients laptops and tablets.
However, I have one client who can only scroll the form up and down using the scroll bar. Using touch to drag and drop the contents of the form does not work.
I have seen this before on another tablet and we found that by installing all of the Windows updates the problem was resolved. However, on this tablet Windows is saying there are no more updates and the problem still exists.
The tablet is a Linx 10 that had Windows 10 on it from the start - it's not an upgrade. My hunch is that it needs the relevant Windows update but that Windows isn't reporting it as a required update.
Has anyone experienced this and identified what files/updates are needed to resolve it?
Just to re-iterate the application works fine on most PCs and tablets, so I don't think it's a basic coding problem which is why I haven't included any code.


text:
Q: How to download ganache on windows? I've been trying to download ganache on my windows machine, but I keep getting a 'failed authorization' error message.

A: Since the goal is to download and install Ganache on your windows, you can get the desired version executable .exe through the steps below:

*

*Navigate to https://github.com/trufflesuite/ganache-ui/tags

*Select any desired tag with "Downloads" as shown below

*Scroll down to "Assets" section and select the setup exe for download as shown below

*Install the downloaded file.


text:
Q: End tag div seen-validator I have some problems with tag "div" on my web-site in validator:
Unclosed element div:  and

1620 Pebblewood Ln. Ste. 132

 Naperville, IL 60563

                                (630)741-4445

(630) 741-4445

(630) 741-4445

(630) 741-4445

(630) 741-4445

                                    <img src="<?=CONFIG::TEMPLATE_ROOT?>design/img/logo.jpg" alt="">

                                <form action="/search">

                                    <input class="input__field input__field--hoshi" type="text" id="search" name="keyword" placeholder="Search..."/>

                                <input id="search-btn" type="submit" style="display: none;"/>
                                </form>

                                    In cart:

                                        Bouquet <?=$_SESSION['sum_count']?$_SESSION['sum_count']:0 ?>
                                        Price
                                        $<?=$_SESSION['sum_count']?$_SESSION['sum_price']:0 ?>

                                <? $menu = $this->_db->select('catalog ', ' category = "main" AND active = 1 ORDER BY sort'); ?>
                                <? foreach ($menu as $item) {
                                if($item['id'] != 229){?>

<a href="/catalog/<?= $item['link'] ?>" class="<?if($url->id == $item['link'])echo "active-menu";?>" ><?= $item['title_en'] ?>

                                <? }}?>

Can you help me with that? I think that I did not close ? Where Did I lose ? I can not understand it :(
Thanks for help!

A: You forget to close tag for the following:

So add 4 closing tag after

A:

1620 Pebblewood Ln. Ste. 132

Naperville, IL 60563

                (630)741-4445

(630) 741-4445

(630) 741-4445

(630) 741-4445

(630) 741-4445

                                    <img src="<?=CONFIG::TEMPLATE_ROOT?>design/img/logo.jpg" alt="">

                <form action="/search">

                                    <input class="input__field input__field--hoshi" type="text" id="search" name="keyword" placeholder="Search..."/>

                  <input id="search-btn" type="submit" style="display: none;" />
                </form>

                  In cart:

                    Bouquet <?=$_SESSION['sum_count']?$_SESSION['sum_count']:0 ?>
                    Price
                    $<?=$_SESSION['sum_count']?$_SESSION['sum_price']:0 ?>

                <? $menu=$ this->_db->select('catalog ', ' category = "main" AND active = 1 ORDER BY sort'); ?>
                <? foreach ($menu as $item) { if($item[ 'id'] !=2 29){?>

                  <a href="/catalog/<?= $item['link'] ?>" class="<?if($url->id == $item['link'])echo " active-menu ";?>">
                    <?=$ item[ 'title_en'] ?>

                <? }}?>

4 more closing
 needed


text:
Q: Descriptive statistics in Python /with Pandas with std in parentheses This question concerns the best-practice to do descriptive statistics in Python with a formatted output that correspond to tables found in academic publications: means with their respective standard deviations in parenthesis below. Final goal is to be able to export it in a Latex tabular format (or an other format, html, etc).
Example (Deucherta & Eugster (2018)):

Pandas:
The classical solution to do descriptive statistics in Pandas is to use the describe() method of a DataFrame.
import numpy as np
import pandas as pd

# Generate a DataFrame to have an example
df = pd.DataFrame(
    {"Age" : np.random.normal(20,15,5),
     "Income": np.random.pareto(1,5)*20_000 }
    )
# The describe method to get means and stds
df.describe().loc[["mean", "std"]].T
>>>
                mean            std
Age        15.322797      13.449727
Income  97755.733510  143683.686484

What I would like to have is the following output:
Age        15.32
          (13.44)
Income  97755.73
        (143683.68)

It would be nice to have a solution that works with Multi-index Dataframe:
df2 = pd.DataFrame(
    {"Age" : np.random.normal(20,15,5),
     "Income": np.random.pareto(1,5)*20_000 }
    )
df_c = pd.concat([df,df2], keys = ["A", "B"])
>>>

and get
                A           B
Age          23.15       21.33
            (11.62)      (9.34)
Income    68415.53    46619.51
         (95612.40)  (64596.10)

My current solution:
idx = pd.IndexSlice
df_desc = (df_c
      ).groupby(level = 0, axis = 0).describe()
df_desc = df_desc.loc[idx[:],idx[:,["mean", "std"]]].T
df_desc.loc[idx[:,["std"]],idx[:]] = df_desc.loc[idx[:,["std"]],idx[:]
                                               ].applymap(
                                               lambda x: "("+"{:.2f}".format(x)+")")
print(df_desc)

>>>
                     A           B
Age    mean     23.1565     21.3359
      std      (11.62)      (9.34)
Income mean     68415.5     46619.5
      std   (95612.40)  (64596.10)

Problem 1 :

I did not find the solution to hide the second index column [mean, std, mean,std].
Then I want to export my df to latex:
df_desc.to_latex()

>>>
\begin{tabular}{llll}
\toprule
       &     &            A &           B \\
\midrule
Age & mean &       5.5905 &     29.5894 \\
       & std &      (16.41) &     (13.03) \\
Income & mean &       531970 &     72653.7 \\
       & std &  (875272.44) &  (79690.18) \\
\bottomrule
\end{tabular}

Problem 2:

The & characters of the table are not aligned which makes it a bit tedious to edit (I use extensions for aligning & in VSCode)
Overall I find this solution tedious and not elegant.
Solution(s) ?
I do not know what I should do to obtain the desired result without complex string manipulation.
I have looked at Pandas styling, but I don't think that it is the best solution.
There is also StatModels Tables, but I did not find a simple solution to my problem. Statsmodels Tables seems the most promising solution. But I do not know how to implement it. There are some descriptive stats functions in StatsModels, but I read on GitHub that they are to some extent deprecated.
So what is the best way to make those tables?

A: I just ran into a similar problem and found your post, so here's how I dealt with the issues you mentioned.
Problem 1: Hide second index column
I prefer solution b), but leave a) here for illustrative purposes.
a) droplevel & set_index
df_desc.index.droplevel(level=1)

>>>
Index(['Age', 'Age', 'Income', 'Income'], dtype='object')

Use this piece of code along with a set_index expression:
df_desc.set_index(df_desc.index.droplevel(level=1), inplace=True)

This results in:
print(df_desc)

>>>
                  A           B
Age         17.1527     23.9678
Age         (19.73)     (12.01)
Income       293271     12178.8
Income  (400059.27)  (14483.35)

which doesn't look satisfying yet, as the index values Age and Income appear twice, respectively.
That's why I came up with the following.
b) Create new DataFrame using pd.DataFrame.values and assign index manually
First, reset index:
df_desc = df_desc.reset_index(drop=True)

print(df_desc)

>>>
            A           B
0      17.306      11.425
1     (14.40)     (16.67)
2     88016.7     67280.4
3  (73054.44)  (54953.69)

Second, create new DataFrame specifying the index and column names manually.
Note that I used df_desc.values as the data argument (first position).
df_new = pd.DataFrame(df_desc.values, index=["Age", "", "Income", ""], columns=["A", "B"])

print(df_new)

>>>
                 A           B
Age        27.7039     20.8031
           (13.99)     (13.92)
Income     20690.7     7370.44
        (29470.03)  (13279.10)

Problem 2: Align LaTeX table
Note that running
df_new.to_latex()

indeed produces a somewhat messy str output:
>>>
'\\begin{tabular}{lll}\n\\toprule\n{} &           A &           B \\\\\n\\midrule\nAge    &     27.7039 &     20.8031 \\\\\n       &     (13.99) &     (13.92) \\\\\nIncome &     20690.7 &     7370.44 \\\\\n       &  (29470.03) &  (13279.10) \\\\\n\\bottomrule\n\\end{tabular}\n'

However, wrapping it inside a print statement produces the desired output:
print(df_new.to_latex())

>>>
\begin{tabular}{lll}
\toprule
{} &           A &           B \\
\midrule
Age    &     27.7039 &     20.8031 \\
       &     (13.99) &     (13.92) \\
Income &     20690.7 &     7370.44 \\
       &  (29470.03) &  (13279.10) \\
\bottomrule
\end{tabular}

Moreover, exporting the table to a LaTeX document is fairly simple.
As you noted yourself, to_latex() already creates a tabular, so you just need to write that to a file, and use \input in your LaTeX document.
Following the example here, do the following:
i) Save the table as a text file
with open('mytable.tex','w') as tf:
    tf.write(df_new.to_latex())

ii) Use the exported table in a LaTeX document
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\input{mytable}
\end{document}

This example here assumes that mytable.tex and the LaTeX document are in the same folder.
The booktabs package is required, since to_latex() uses the booktabs commands for table rules.
The final pdf output looks like this:


text:
Q: How to programmatically add, remove, or block people on Steam through a button There are many sites such as www.tf2outpost.com and www.bazaar.tf where users can add other steam users through the click of a button. How exactly do you accomplish this? There's nothing in the web API that shows you how to add friends.
EDIT: I have found this code: steam://friends/add/some_steam_id Can you modify this code to block/remove people if you have their steam id?

A: All that URL does is ask your locally installed Steam client to add a fried of the id matching the number after /add/. So if you have another users steam id you can add them by putting their id in that URL like this: steam://friends/add/your_new_friends_id
you can try this yourself by just pasting the url in most any internet browser and steam will popup with a message saying "Your New Friend has been added to your friends list"
Currently the friends command accepts the following subcommands:

*

*add/<id>
Adds user with specified id number

*friends/<id>
Shows list of users with whom you recently played

*joinchat/<id>
Joins a chat with a specified id number

*message/<id>
Send a message

*players
Shows table of recent players you've played with

*settings/hideoffline
Toggle offline friends from friends list

*settings/showavatars
Toggle avatars in friends list

*settings/sortbyname
Sorts friends list by name

*status/away
Sets status as away

*status/busy
Sets status as busy

*status/trade
Sets status as looking to trade

*status/play
Sets status as looking to play

*status/offline
Sets status as offline

*status/online
Sets status as online

It appears there currently is no command (at least not public) for blocking/removing people. Such a command would be fairly useless, and would allow for... mischief. You should just manually remove/block people you no longer wish to be friends with; there would be no convenience added from being able to do this from a browser. What exactly are you trying to accomplish?
See the Steam Browser API documentation for complete details about the friends command and other commands.
P.S. its probably a good idea to avoid posting other peoples steam user ids here.


text:
Q: Google Sign In: ApiException 12500 (only on Android 10 devices) Summarize the problem
I want to/already have integrate/integrated the Google-Login as described by Google here.
It works... at least I thought so.
After publishing the app in the Play store I got feedback that the login via google isn't working on devices that have Android 10 installed --> only on Android 10, weird
In Android Studio I get the following message/error when trying it with Android 10:
Exception com.google.android.gms.common.api.ApiException: 12500:

Describe what you have tried
I have tried multiple things:

*

*Everything is up-to-date

*targetSdkVersion set to Android 10, sane thing for compileSdkVersion

*Literally anthing mentioned here (Support mail set; Fingerprint is corret, ... as said before, it works on e.g. Android 9 devices)

Info: I am not using firebase.
This is my first post here, hopefully I didn't mess up my question.
Thanks for your help!

A: https://stackoverflow.com/a/53147523/14286853
This worked for me... in the beginning.
I just found out that changing the SHA1 back to the release key that I have locally --> it worked.
I have no idea why it worked in the first place and after some time it stopped.
If you have the same problem:

*

*Double check SHA1 key set in Google/Firebase

*I found out that OAuth-Screen that could also cause this problem --> be aware of that


text:
Q: Mountain Lion display sleep function and screen saver does not activate Since upgrading to Mountain Lion, the display sleep function appears not to work, and the screen saver is flaky. I can leave my machine for a couple of hours and when I come back the screen is as I left it.
I would expect the display sleep to be in effect, and if not that, at least the screen saver should appear. I have tested with various settings. In particular the screen saver set for 1 minute, and the display sleep set for 2 minutes. These functions just are not working. Note: I have Computer Sleep set to never, and usually 10 minutes for display sleep.
There have been no hardware changes to my system, and blue tooth is turned off. The system is on a LAN, but wake on network access is turned off. I am not sure if these network connections should affect the screen sleep/saver functions, but have heard of such issues in the past so have set them so as not to interfere.
I don't have any special programs running that should interfere with the display. Time Machine is running. However, before this upgrade, I did not notice a problem with any programs.
Here is the output from pmset:
$ pmset -g
Active Profiles:
AC Power        -1*
Currently in use:
 hibernatemode        0
 halfdim              1
 womp                 0
 networkoversleep     0
 sleep                0 (sleep prevented by )
 powerbutton          0
 ttyskeepawake        1
 hibernatefile        /var/vm/sleepimage
 autorestart          0
 disksleep            10
 displaysleep         2

Any ideas?
Addendum: while this issue has been going on for several days since the upgrade to ML, I notice that today the issue appears to be gone. Both the screen saver and the screen sleep are working.
Since the problem has been in existence for about a week solid, but has corrected itself without any action by me, I am not that confident that it is actually solved. No changes to the machine have been done.

A: After a long while now, the problem has come back.
I found very detailed and useful info at http://web.archive.org/web/20150405031645/http://mactips.dwhoard.com/mactips/system/display-sleep. For me the workaround was just to logout and login again. Then test and the problem is fixed. The referenced page gives other, perhaps better workarounds.
Please note that the normal "why doesn't my Mac sleep" issues such as given at http://support.apple.com/kb/HT1776 are not the problem, and that some bug is the problem.