text:
Q: WKWebView ViewportSizing logs in SwiftUI In using SwiftUI, the WKWebView loads successfully when implemented within a UIViewRepresentable wrapper. However, the following logs appear in the Debug area of Xcode Version 13.4.1:
[ViewportSizing] maximumViewportInset cannot be larger than frame
[ViewportSizing] minimumViewportInset cannot be larger than frame

How can these logs be resolved?
These logs can be reproduced with the following minimal reproducible example:
WebApp.swift
import SwiftUI
import WebKit

@main
struct WebApp: App {
    var body: some Scene {
        WindowGroup {
            WebView()
        }
    }
}

struct WebView: UIViewRepresentable {
    func makeUIView(context: Context) -> some UIView {
        let webView = WKWebView()
        webView.load(URLRequest(url: URL(string: "https://www.google.com")!))

        return webView
    }

    func updateUIView(_ uiView: UIViewType, context: Context) {}
}

PROGRESS:
These logs seem to originate from the following WebKit browser engine source code:

*

*maximumViewportInset: https://github.com/WebKit/webkit/blob/main/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm#L1623

*minimumViewportInset: https://github.com/WebKit/webkit/blob/main/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm#L1638
These logs persist despite commenting out the webView.load(URLRequest(url: URL(string: "https://www.google.com")!)) line. So, it's concludable that it's not a website issue.

A: This can be resolved by setting the frame to more than zero by changing this:
let webView = WKWebView()

To this:
let webView = WKWebView(frame: CGRect(x: 0.0, y: 0.0, width: 0.1, height: 0.1))


text:
Q: React Close dropdown when other dropdown is opened I tried but i can't. Do I need to create separate function for each dropdown? I think there should be a brevity. I want other open dropdowns to close when the user clicks on a dropdown. I hope someone can help me. it took me a long time still i couldn't find any result. this way i will add 2 more dropdown menus.
    import React, { useState } from "react";

export const AsideItems = () => {
  const [menuOpened, setMenuOpened] = useState(false);
  const [menuOpenedSecond, setMenuOpenedSecond] = useState(false);

  const handleMenu = () => {
    setMenuOpened((menuOpened) => !menuOpened);
  };
  const handleMenuSecond = () => {
    setMenuOpenedSecond((menuOpenedSecond) => !menuOpenedSecond);
  };

  return (
    <>

        Computers & Laptops

      <span
        onClick={handleMenu}
        className={`list-icon${menuOpened ? " " : " open-list"}`}
      >
        +

      <span
        onClick={handleMenu}
        className={`list-icon${menuOpened ? " open-list" : " "}`}
      >
        -

      <div className={`sub-menu${menuOpened ? " open-sub" : " "}`}>

              Computer Accessories

      Game Consoles

    <span
      onClick={handleMenuSecond}
      className={`list-icon${menuOpenedSecond ? " " : " open-list"}`}
    >
      +

    <span
      onClick={handleMenuSecond}
      className={`list-icon${menuOpenedSecond ? " open-list" : " "}`}
    >
      -

    <div className={`sub-menu${menuOpenedSecond ? " open-sub" : " "}`}>

            Consoles

    </>
  );
};

A: Instead of using multiple boolean state values, you can use a single state value that holds the name (or index) of the open menu. This way you only need one state variable and only one menu can be open at a time. To indicate that no menu is open, you can set the state value to null.
Here's an example:
const menuNames = {
    first: "first",
    second: "second",
    // ...
}

export const AsideItems = () => {
    const [openMenuName, setOpenMenuName] = React.useState(null);

    return (
        <>
             setOpenMenuName(menuNames.first)}
                className={`list-icon${openMenuName === menuNames.first ? " " : " open-list"}`}
            >
                +

             setOpenMenuName(menuNames.second)}
                className={`list-icon${openMenuName === menuNames.second ? " " : " open-list"}`}
            >
                +

        </>
    )
}

Note you don't have to define an object containing the menu names, but it's safer than just using string literals.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to save/load keras model with several branches I define a keras (2.0.6) model with two branches the merge these
 left=Sequential()

  ...

  right=Sequential()

  ...

  model = Sequential()

  model.add(Merge([left,right], mode='concat'))

 model.save('mymodel.model')

Then later if I want to reuse my model after model = load('mymodel.model') I am getting
"ValueError: You are trying to load a weight file containing 5 layers into a model with 1 layers.".

So it seems the save command has only saved the 'model' part of my model, not the left and right branches. How can a save the entire model? Or will I need three model files, one for the left branch, one for the right and one for the merged model?
Seems there has been a discussion on this previously (https://github.com/fchollet/keras/issues/1349) but there was no solution, as far as I can see.
Does anyone know whether/how this has been solved?

A: Do not use the Sequential API for this, prefer the Functional API to build such a model with branches. Then you will only have a single model and it will be saved as such.


text:
Q: Stream Collections Error and understanding I'm trying to read in a CSV using java 8's Stream API and create a matrix from it.
This is mainly to learn Streams (there are of course other ways to do this without Streams).
Here is the code:
public class MatrixCreator {

    public static Function<String, List<Double>> mapLineToListOfDoubles = (line) -> {
        String [] elements = line.split(",\\s*");
        return Arrays.stream(elements).map((String stringElement) -> Double.parseDouble(stringElement)).collect(Collectors.toList());
    };

    //Error from this -- listed below
    public static Collector<List<Double>, List<Double>, List<Double>> listCollector = Collector.of(ArrayList<Double>::new, List<Double>::addAll, (ArrayList<Double> left, List<Double> right) -> {
        left.addAll(right);
        return left;
    });

    /**
     * Creates a matrix from the specified file.
     * @param filePath Path to CSV, matrix, file
     */
    public static Matrix createMatrix(String filePath) throws IOException {
        FileInputStream fileInputStream = new FileInputStream(filePath);
        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(fileInputStream));
        List<Double> x = bufferedReader.lines().map(mapLineToListOfDoubles).collect(listCollector);
        return null;  // for the moment.
    }
}

The following error is given:
Error:(26, 96) java: no suitable method found for of(ArrayList<[...]::new,List<Doubl[...]ddAll,(ArrayList[...]ft; })
    method java.util.stream.Collector.<T,R>of(java.util.function.Supplier<R>,java.util.function.BiConsumer<R,T>,java.util.function.BinaryOperator<R>,java.util.stream.Collector.Characteristics...) is not applicable
      (inferred type does not conform to equality constraint(s)
        inferred: java.util.List<java.lang.Double>
        equality constraints(s): java.util.List<java.lang.Double>,java.util.ArrayList<java.lang.Double>)
    method java.util.stream.Collector.<T,A,R>of(java.util.function.Supplier<A>,java.util.function.BiConsumer<A,T>,java.util.function.BinaryOperator<A>,java.util.function.Function<A,R>,java.util.stream.Collector.Characteristics...) is not applicable
      (cannot infer type-variable(s) T,A,R
        (actual and formal argument lists differ in length))

Clearly Java cannot determine the method to use, but I cannot determine where to go from here.
I'd appreciate any help regarding the reason for this error.

A: The only Collector.of method that can match the number of arguments you supplied is :
static <T,R> Collector<T,R,R>   of(Supplier<R> supplier, BiConsumer<R,T> accumulator, BinaryOperator<R> combiner, Collector.Characteristics... characteristics)

You declare the return type to be Collector<List<Double>, List<Double>, List<Double>>, so both T and R are List<Double>.
However, in your arguments list, the combiner (the 3rd argument) receives a lambda expression with two parameters ArrayList<Double> left and List<Double> right that returns an ArrayList<Double>. But the method signature expects a BinaryOperator<R> which means both parameters + the return value of the lambda expression must be of the same type.
I suggest you change your code to :
public static Collector<List<Double>, List<Double>, List<Double>> listCollector = Collector.of(ArrayList<Double>::new, List<Double>::addAll, (List<Double> left, List<Double> right) -> {
    left.addAll(right);
    return left;
});

I'm not sure if that's the only problem (I can't test it), but there's a good chance it is, since that's what the error message you get from the compiler implies :
  (inferred type does not conform to equality constraint(s)
    inferred: java.util.List<java.lang.Double>
    equality constraints(s): java.util.List<java.lang.Double>,java.util.ArrayList<java.lang.Double>)

The remainder of the error message is irrelevant, since the other Collector.of method expects an additional argument, and therefore is not relevant to your code.


text:
Q: My sed command is throwing error sed: -e expression #1, char 22: unknown option to `s' I tried below command in my script and got error,
sed -i -e 's/\(dataTable\)/$replace \1/' file.txt

Error Message,
sed: -e expression #1, char 22: unknown option to `s'

Please help me in correcting the command to avoid error.
Thanks!

A: I'm assuming that you are actually using double quotes around your sed expression rather than single quotes, or you would not get that error.
I'm also assuming that you are using a string in your $replace value that contains a slash (/).  When the variable is expanded, its value is injected into the sed statement and since it contains a slash, it breaks the syntax for the s/// command.
You can solve this by changing the delimiter that you use in the sed command to some other character that is not present in $replace.
If you choose @, for example,
sed -i -e 's@\(dataTable\)@'"$replace"' \1@' file.txt

Note that you will still have issue is your $replace string contains the substrings \x (where x is any digit), or & (which would be replaced by the part of the string that matches the expression).  You will have to escape these special strings.
See e.g.

*

*How to ensure that string interpolated into `sed` substitution escapes all metachars
As a special case, if you plan on replacing a single whole line with new (static) contents, you could do that as follows:
printf '%s\n' "$replace" | sed -e '/some pattern/{ r /dev/stdin' -e 'd; }' file.txt

This finds the line matching /some pattern/ and then reads in the replacement text from standard input (from printf). It then deletes the old  line.


text:
Q: Howto: install JOGL for Eclipse in Mac OSX 10.6? I got Snow Leopard 64 bit, and I'm wondering how I am to install JOGL in order to develop with Eclipse.
A nice tut from A-Z would have been nice, since I'm suspecting some of my steps are very wrong.
--Edit: 28.aug.2012--
JOGL 1.1 is only compatible with Java JDK 1.6 not JDK 1.7. Tested on OSX Mountain Lion (10.8.1).

A: *

*Download jogl

*Create a new project, and unzip the lib folder from the file you downloaded into the project.

*Add the jogl.jar and gluegen-rt.jar to the build path. Right click jogl.jar in the package explorer in the build path. Click "Properties", and set the "Native Libraries" option to point to the same lib folder that should also contains four *.jnilib files.

A: When using JogAmp JOGL 2 you only need to include jogl-all.jar and gluegen-rt.jar to your project. All the macos x specific native jars will be automatically found at runtime if they are located next to the jogl-all.jar and gluegen-rt.jar
http://jogamp.org/wiki/index.php/Downloading_and_installing_JOGL


text:
Q: Single Event with different argument type I have a class with methods that report the current state of the process.
I usually use a UIHandle.Writline where UIHandle is an interface with 2 methods.
UIHandle.WritLine(string StringInput)

Or
UIHandle.WritLine(List<string> StringInput)

Which is used this way:
UIHandle.WriteLine("Checking for error...");
UIHandle.WriteLine(CheckForMissing(newCollection)); //Where CheckForMissing returns a list of strings

I was wondering if there is a possibility that I was not aware of to trigger the methods through an event rather than the class such as:
TriggerTheResponseEvent("Checking for error...");
TriggerTheResponseEvent(CheckForMissing(newCollection));

I though it would be better to avoid interface as I currently use. And I could add a log file more easily...


text:
Q: how to add an external spring application as a portlet to a liferay portal I have developed a Primefaces- Spring Application.
I have installed Liferay IDE/Plugings/server. I Want to deploy the Primeface-Spring application a s a portlet to my Liferay Portal. How do i achieve it? Please help.

A: Mmm... if I well undestood, you create a standard web application and need to deploy it as a portlet?
I'm sad to say that it is impossible: you need to convert your webapp to a "portlet application" before deploy.
By the way Liferay tries to meet your need... you can deploy your webapp inside your application server like any other web application. So your webserver will be able to serve Liferay (in root context) or your application in its context. Then you have to embed it inside a liferay "Embedded page": just create an "Embedded" page using your Liferay admin features.
This solution uses an iframe, so if you prefer you can try to use a "web-proxy" portlet (to integrate your code server side): see here http://www.liferay.com/it/community/wiki/-/wiki/Main/Web+Proxy+Portlet
Next time you develop a portlet application a good starting point is to understand basics on portlet lifecycle, then to develop it directly thinking on a portlet.

A: It should be possible to deploy your PrimeFaces+Spring web application as a portlet in Liferay using Liferay Faces Bridge. The purpose of the bridge is to provide developers with a way to develop JSF applications without being concerned about the Portlet API. The Liferay Faces project has a primefaces4-portlet demo and a jsf2-spring-portlet demo that you can download in order to verify that these technologies work in your Liferay Portal environment.


text:
Q: Updating app that includes pre-populated database I have an application that is using a quite large database with approximately 3.000 records. Previously i have loaded the database when starting up the app for the first time but with the number of records i have now i am implementing a pre-populated database to save time.
My question is what is happening when updating the app, from appstore, to the device will the app know that there is an updated version of the database and load the new database or continue to use the database that is already active with the app?
I am using this code in my app to use the pre-populated Core Data DB:
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
  if (persistentStoreCoordinator != nil) {
    return persistentStoreCoordinator;
}

NSString *storePath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"database.sqlite"];

/*
 Set up the store.
 For the sake of illustration, provide a pre-populated default store.
 */
NSFileManager *fileManager = [NSFileManager defaultManager];
// If the expected store doesn't exist, copy the default store.
if (![fileManager fileExistsAtPath:storePath]) {
    NSString *defaultStorePath = [[NSBundle mainBundle] pathForResource:@"database" ofType:@"sqlite"];
    if (defaultStorePath) {
        [fileManager copyItemAtPath:defaultStorePath toPath:storePath error:NULL];
    }
}

NSURL *storeUrl = [NSURL fileURLWithPath:storePath];

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: [self managedObjectModel]];

NSError *error;
if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:options error:&error]) {
    // Update to handle the error appropriately.
    NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
    exit(-1);  // Fail
}

return persistentStoreCoordinator;

}

A: Let's say that you app currently in the app store is version 1.0. This app downloaded a DB on its first launch.
Now, you are going to publish a new version 1.1, which will bundle the DB within the app itself.
When a user of the existing app (1.0) will upgrade to 1.1, what happens is fully under your control. Indeed, version 1.1 could check, on its first launch, for the existence of the DB in the user directory where version 1.0 installed it. In case, it is there, then version 1.1 knows it should upgrade the DB by copying it over from the resource directory.
Actually, the DB must be copied over to the user directory in any case, so by checking the you could make sure that no user data will be wiped out.
In general, you might store a version number in NSUserDefaults, so that each future version of your app has a way to know whether it is an upgrade os a new install (if the version number is there, then it is an upgrade from that specific version, otherwise it is a new install).

A: When you update the app, the files already created will still be there, so older versions of your app will still use the old database that you created in your old version


text:
Q: storing an account number with or without dashes I'm sure this has been asked somewhere, but I keep only finding discussions about phone numbers.
I'm designing a system for a supplier group that controls multiple online stores. There are 5 different types/levels of stores (based on their buying group, blah).
These accounts can order products from our warehouse and also have their own collection of customers that can order products from them.
Since both store accounts and their customer accounts will be stored in and accessed by our system, but stores will be accessing their customer accounts independently I want to set up an 'organized' structure for account numbers, that works for both sides of the system.
I was planning on doing 10 digit account numbers, with the first 5 digits identifying the store (the first of which will identify the store type/level), and the last 5 the customer.
For example,
First LEVEL1 store account : 10001-00000
Their customer accounts : 10001-00001, 10001-00002, etc.

Third LEVEL2 store account : 20003-00000
Their customer accounts : 20003-00001, 20003-00002, etc.

This should allow for enough growth to support our potential number of stores and their number of customers.
My question is, should I separate the numbers with a dash or not?
It certainly makes it clearer for humans, but it feels like it would be better in the database to be stored as a true int, though I don't know how often I'd be comparing them, etc.
Should I store it as an INT with no dash, and just format it when displaying it to users? (then obviously be sure to  accept account number input with or without a dash)

A: 1NF says that values in each attribute must be atomic. You are violating the 1NF by adding dashes and storing two attributes as one.

What must you (ideally) do?
Each store has an ID, so the store's table should have an ID column that contains that.
Next, the customers should also have their own IDs in their table.
Finally, the relationship (or junction) table between store and customer should contain store's ID and customer's ID as each row.
Alternatively, the customer can have a foreign key which tells which store the customer should be shopping from, assuming a customer is tied to only one store.


text:
Q: Interpolating in 3D, plotting with matplotlib - something is going wrong Here is some toy data:
import pandas as pd
import numpy as np

testDF = pd.DataFrame(np.linspace(100.,200.,40).reshape(10,4),
                      columns=list('abcd'))

It looks like this (the face is just there for illustration, the top line of each parallelogram is what we are interested in):

Which for the purposes of my application I turn into an ordered dictionary:
OrderedDict([('a', array([[ 0.  ,  0.  ,  1.62],
                     [ 1.  ,  1.  ,  1.62],
                     [ 2.  ,  2.  ,  1.62],
                     [ 3.  ,  3.  ,  1.62],
                     [ 4.  ,  4.  ,  1.62],
                     [ 5.  ,  5.  ,  1.62],
                     [ 6.  ,  6.  ,  1.62],
                     [ 7.  ,  7.  ,  1.62],
                     [ 8.  ,  8.  ,  1.62],
                     [ 9.  ,  9.  ,  1.62]])),
             ('b', array([[  0.  ,   1.  ,   1.12],
                     [  1.  ,   2.  ,   1.12],
                     [  2.  ,   3.  ,   1.12],
                     [  3.  ,   4.  ,   1.12],
                     [  4.  ,   5.  ,   1.12],
                     [  5.  ,   6.  ,   1.12],
                     [  6.  ,   7.  ,   1.12],
                     [  7.  ,   8.  ,   1.12],
                     [  8.  ,   9.  ,   1.12],
                     [  9.  ,  10.  ,   1.12]])),
             ('c', array([[  0. ,   4. ,   0.7],
                     [  1. ,   5. ,   0.7],
                     [  2. ,   6. ,   0.7],
                     [  3. ,   7. ,   0.7],
                     [  4. ,   8. ,   0.7],
                     [  5. ,   9. ,   0.7],
                     [  6. ,  10. ,   0.7],
                     [  7. ,  11. ,   0.7],
                     [  8. ,  12. ,   0.7],
                     [  9. ,  13. ,   0.7]])),
             ('d', array([[  0.  ,   9.  ,   0.56],
                     [  1.  ,  10.  ,   0.56],
                     [  2.  ,  11.  ,   0.56],
                     [  3.  ,  12.  ,   0.56],
                     [  4.  ,  13.  ,   0.56],
                     [  5.  ,  14.  ,   0.56],
                     [  6.  ,  15.  ,   0.56],
                     [  7.  ,  16.  ,   0.56],
                     [  8.  ,  17.  ,   0.56],
                     [  9.  ,  18.  ,   0.56]]))])

Now I am trying to interpolate in the third dimensions i.e. the one with values [1.62,1.12,0.7,0.56] - I would like to get some idea of what is happening in between.
This is my function:
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
from matplotlib import cm

class jointInterpolation(object):
    """
    Class for performing various forms of interpolation.
    """
    def __init__(self,trajDict):
        # Concat dictionary into (n_i x D) for all i in speeds.
        D = np.vstack(trajDict.values())
        # Grid the data: [time,angle,velocity]
        self.X = D[:,0]
        self.Y = D[:,1]
        self.Z = D[:,2]

    def myRegularGridInterpolator(self,df):
        pass
        from scipy.interpolate import RegularGridInterpolator as RGI

    def standardGridInterpolation(self,intMethod,plot=False):
        """
        Interpolate unstructured D-dimensional data.
        """
        # [time,angle,velocity]

        # Time
        xi = np.linspace(self.X.min(),self.X.max(),100)
#         # Angle
        yi = np.linspace(self.Y.min(),self.Y.max(),100)
        # Velocity
#         zi = np.linspace(self.Z.min(),self.Z.max(),100)
        # VERY IMPORTANT: tell matplotlib how the observations are organised
        zi = griddata((self.X, self.Y), self.Z, (xi[None,:], yi[:,None]), method=intMethod)
#         yi = griddata((self.X, self.Z), self.Y, (xi[None,:], zi[:,None]), method=intMethod)

        if plot:
            fig = plt.figure(figsize=(10,10))
            ax = fig.gca(projection='3d')
            xig, yig = np.meshgrid(xi, yi)
#             xig, zig = np.meshgrid(xi, zi)
            surf = ax.plot_wireframe(xig, yig, zi, #xig, zig, yi
                                     rstride= 4,
                                     cstride= 4,
                                     color = 'darkviolet',
                                     linewidth = 1.5,
                                     alpha=0.7,
                                     antialiased = True)
            plt.show()

But I seem to be messing up the order somehow, I just don't see how:
intstuff = jointInterpolation(myDict)
intstuff.standardGridInterpolation('nearest',True)

EDIT:
I am not entirely sure if this qualifies as a a unstructured grid.
Also an updated version with less points, on request.
testDF = pd.DataFrame(np.linspace(0.,10.,40).reshape(10,4),
                      columns=list('abcd'))

A: Ok so I figured it out:
class jointInterpolation(object):
    """
    Class for performing various forms of interpolation.
    """
    def __init__(self,trajDict):
        # Concat dictionary into (n_i x D) for all i in speeds.
        D = np.vstack(trajDict.values())
        # Grid the data: [time,angle,velocity]
        self.X = D[:,0]
        self.Y = D[:,1]
        self.Z = D[:,2]

    def myRegularGridInterpolator(self,df):
        pass
        from scipy.interpolate import RegularGridInterpolator as RGI

    def standardGridInterpolation(self,intMethod,plot=False):
        """
        Interpolate unstructured D-dimensional data.
        """
        # [time,angle,velocity]

        # Velocity
        zi = np.linspace(self.Z.min(),self.Z.max(),100)

        # Angle
        xi = np.linspace(self.X.min(),self.X.max(),100)

        # Velocity
        # VERY IMPORTANT: tell matplotlib how the observations are organised
        yi = griddata((self.Z, self.X),
                      self.Y,
                      (zi[None,:], xi[:,None]),
                      method=intMethod)

        if plot:
            fig = plt.figure(figsize=(10,10))
            ax = fig.gca(projection='3d')
            zig, yig = np.meshgrid(zi, xi)
            surf = ax.plot_wireframe(zig, yig, yi, #xig, zig, yi
                                     rstride= 5,
                                     cstride= 5,
                                     color = 'darkviolet',
                                     linewidth = 1.5,
                                     alpha=0.7,
                                     antialiased = True)

This produces the required figure:
intstuff.standardGridInterpolation('linear',True)


text:
Q: How to bulk-insert data? Is it possible to bulk-insert data into a table using Magento?
I am working on extending the Magento import/export feature for a custom module, and noticed that each row is added one-at-a-time in a while loop. For a CSV containing thousands of rows of data, this could take a VERY long time to insert. Instead, is there a bulk-insert function laying around that takes an array of record data and bulk-inserts them?
Crude example (in reality the row data would be added to the $data array in the while loop):
$data = array(
    array('column1' => 'value', 'column2' => 'value', ...),
    array('column1' => 'value', 'column2' => 'value', ...),
    ...
);

Mage::getModel('module/model')->insert($data,true);

Where the second parameter in insert indicates a bulk-insert operation?
If not, why not? I am aware some PDOs don't have the functionality to do bulk-insert, in which case Magento would default to doing a foreach anyway. However, for PDOs that DO support bulk-insert (such as MySql) it would save a lot of time compared to touching the db for every insert. If this is not already in Magento, how would I go about implementing it? Can I have a link to the Magento feature suggestion page (Google suggests Magento Forum but I would like a second opinion before posting there).
Thanks.

A: Magento uses Zend_Db at it's core. However, AFAIK there is no way to do bulk inserts using Zend_Db.  That said, you could create a method in your collection to accept the input as an array and then iterate over that array saving each entry.


text:
Q: Disable dropdownlist in jQuery I want to disable a dropdownlist with jQuery code below. In IE 11 the dropdownlist  is disabled but in chrome it remains enabled. Any one know of a much more reliable way of getting this to work across browsers?
 if (!userEmail.trim()) {
            $("#DropDownList1").dropdownchecklist("disable");
         }

And below is the definition of the dropdownlist
<div id="divList">
  @Html.DropDownList("DropDownList1", new SelectList(ViewBag.MyList as System.Collections.IEnumerable, "Value", "Text", 0))
</div>

A: Try:
$("#DropDownList1").prop("disabled", true);

Here's a fiddle too:
http://jsfiddle.net/k5es6na0/1/

A: you can try
$("#dropDown").attr("disabled", true);

This will work for all browsers


text:
Q: Microsoft Crm 4.0 On Premise to Microsoft Crm 2011 On Demand Migration I am moving a system from Microsoft Crm 4.0 On Premise to Microsoft Crm 2011 On Demand (hosted).  What is the best way to migrate all of the data?  Is there a data mapping built in for that or any tool recommendations?

A: There is no dedicated tool for migrating an on premise organization to Dynamics CRM Online.
The first step of such a migration would be an upgrade of your local system to Dynamics CRM 2011. This ensures that you are on the same customization level.
For the migration itself, you could use for example Scribe or you could script it by yourself. This should be rather "easy" as you only have to transfer the data. The data structure itself, remains the same.

A: We've just completed the development of a tool which automatically manages the transfer of data from a CRM 2011 On Premise database to CRM Online.  We're in the process of making this available publicly, in the mean time if you're interested then please contact info@synchronicity-systems.com
UPDATE: Our software is now available for download, for more information check out the website here http://www.synchronicity-systems.co.uk/echo/


text:
Q: C:multithreading- Parent thread exits before output Update included after the first block of code
I am new to multithreading and am having an issue outputting the results of various threads in a C program. Specifically, I am attempting to output the average, maximum, and minimum within an array of integers to the user using a different thread for each. However, the parent thread which is supposed to print the three values terminates upon completion of the its children threads.
For the sake of testing, I currently print the results within the children thread, but I need to print these values in the parent thread. The code is as follows:
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>

void *avgThread(int *nums,int*out)
{
    //sleep(1);
    int total = 0,x,avg;
    for(x=0;x<7;x++) total+=nums[x];
    avg = total/7;
    *out = avg;
    printf("%d\n",avg);
}

void *minThread(int *nums,int*out)
{
    int min = nums[0],x;
    for(x=1;x<7;x++)  if(nums[x]<min) min=nums[x];
     *out = min;
    printf("%d\n",min);

}

void *maxThread(int *nums,int*out)
{
    int max = nums[0],x;
    for(x=1;x<7;x++) if(nums[x]>max) max=nums[x];
    *out = max;
    printf("%d\n",max);

}

void *parentThread(int*nums)
{
    int average,minimum,maximum;
    pthread_t avg,min,max;
    pthread_attr_t avgfun,minfun,maxfun;

    pthread_attr_init(&avgfun);
    pthread_attr_init(&minfun);
    pthread_attr_init(&maxfun);

    pthread_create(&avg, &avgfun, avgThread(nums,&average), NULL);
    pthread_create(&min, &minfun, minThread(nums,&minimum), NULL);
    pthread_create(&max, &maxfun, maxThread(nums,&maximum), NULL);

    pthread_join(avg, NULL);
    pthread_join(min, NULL);
    pthread_join(max, NULL);

    printf("%d\n",maximum);
    printf("%d\n",average);
    printf("%d\n",minimum);
    pthread_join(pthread_self(),NULL);

    return NULL;
}

int main()
{
    int nums[] = {90, 81, 78, 95, 79, 72, 85};
    pthread_t prnt;
    pthread_attr_t parent;
    pthread_attr_init(&parent);
    pthread_create(&prnt,&parent,parentThread(nums),NULL);
    pthread_join(prnt,NULL);
    sleep(3);

    exit(0);
}

Update
Thank you to Pavel and others for pointing out some things I am doing wrong. I have made the necessary modifications to the thread initialization and call. I am also able to output the calculated average, max, and min in the parent thread, but only by making said variables global in scope. If anyone can tell me if I can keep:
int average,maximum,minimum

inside *parentThread and still calculate them inside the child threads, that would be great. Here is my code as it stands now:
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <unistd.h>

int average,minimum,maximum;

void *avgThread(void *numsptr)
{
    sleep(1);
   int *nums=(int*)numsptr;

    int total = 0,x;
   for(x=0;x<7;x++) total+=(int)nums[x];
   average = total/7;
    return NULL;
}

void *minThread(void *numsptr)
{
    sleep(2);
    int *nums=(int*)numsptr,x;
    minimum = nums[0];
    for(x=1;x<7;x++)  if((int)nums[x]<minimum) minimum=(int)nums[x];
    return NULL;
}

void *maxThread(void *numsptr)
{
    sleep(3);
    int *nums=(int*)numsptr,x;

    maximum = nums[0];
    for(x=1;x<7;x++) if((int)nums[x]>maximum) maximum=(int)nums[x];
    return NULL;
}

void *parentThread(void *numsptr){
    int *nums=(int*)numsptr;
    //int average,minimum,maximum;
    pthread_t avg,min,max;
    pthread_attr_t avgfun,minfun,maxfun;

    pthread_attr_init(&avgfun);
    pthread_attr_init(&minfun);
    pthread_attr_init(&maxfun);

    pthread_create(&avg, &avgfun, &avgThread,(void*)nums);
    pthread_create(&min, &minfun, &minThread,(void*)nums);
    pthread_create(&max, &maxfun, &maxThread,(void*)nums);

    pthread_join(avg, NULL);
    printf("The average value is %d\n",average);
    pthread_join(min, NULL);
    printf("The minimum value is %d\n",minimum);
    pthread_join(max, NULL);
    printf("The max value is %d\n",maximum);

    return NULL;
}

int main()
{
   int nums[] = {90, 81, 78, 95, 79, 72, 85};
    pthread_t prnt;
    pthread_attr_t parent;
    pthread_attr_init(&parent);
    pthread_create(&prnt,&parent,&parentThread,(void*)nums);
    pthread_join(prnt,NULL);

    exit(0);
}

A: You do not start threads properly. You have to pass function that will execute, but you are actually calling your function and passing its return value to pthread_create:
// call parentThread(nums) and then create thread.
pthread_create(&prnt, &parent, parentThread(nums),NULL);

What you wanted to do is this:
void *parentThread(void *nums_ptr)
{
    int *nums = (int*)nums_ptr;
    ...
    return NULL;
}

int main()
{
    int nums[] = {90, 81, 78, 95, 79, 72, 85};
    pthread_t prnt;
    pthread_create(&prnt, NULL, &parentThread, (void*)nums);
    ...
}

Same applies for all your other threads.
Other issues that you have:

*

*your thread function (that pthreads expect) should take a void pointer and return void pointer. E.g.: void *threadFunc(void *nums)

*your function should return something (e.g. return NULL;)

*you shouldn't try to joint your own thread: pthread_join(pthread_self(),NULL);

If anyone can tell me if I can keep: int average,maximum,minimum
  inside *parentThread and still calculate them inside the child threads

Sure you can do that. Define some struct that stores all that data and pass pointer to that data to your threads:
struct myState
{
    int average, minimum, maximum;
    int *nums
};

void *avgThread(void *data)
{
    sleep(1);
    myState *state = (myState*)data;

    int total = 0,x;
    for(int x=0; x<7; x++)
        total += state->nums[x];
    state->average = total/7;
    return NULL;
}

void *parentThread(void *nums_ptr)
{
    int *nums = (int*)nums_ptr;
    myState state;
    state.nums = nums;
    ...
    pthread_create(&avg, &avgfun, &avgThread, &state);
    ...
    pthread_join(avg, NULL);
    printf("The average value is %d\n", state.average);
    ...
    return NULL;
}


text:
Q: ionic overwrite active element css style I'd like to change the css style of an activated element.
Here's a ionic-list you can see.
I tried to set the css style of the aktivated element like this:
.item-content.activated{
    background-color: rgba(0,100,255, 0.5);
}

That doesn't change anything
In the css-framework of ionic I have this line that sets the style of the activated elements:
.item.active, .item.activated, .item-complex.active .item-content, .item-complex.activated .item-content, .item .item-content.active, .item .item-content.activated
{
   border-color: #ccc;
   background-color: #D9D9D9;
}

If I change it in the framework, it works. But I only want it to be applied on list items and in my own css-stylesheet ... How can I do that?

A: You need to use the selector:
.item .item-content.activated
It has the additional .item so more specificity which is why it is overriding the one you have written.

A: You can do it as follows
.item.active,
.item.activated,
.item-complex.active .item-content,
.item-complex.activated .item-content,
.item .item-content.active,
.item .item-content.activated {
    color: #493F0B;
    font-weight: bold;
    border-color: #eee;
    background-color: #fafafa;
}


text:
Q: what's the meaning of "to place on the edge of"? what's the meaning of "to place on the edge of"?
Important for understanding displacements and borderlands associated with
global transformation is growing insecurity as the "free market" devalues labor
by challenging "local" wage rates and relations and nationally constituted environmental and labor laws in ways that place economically vulnerable populations on the edge of legal protections and secure rights
is it meaning that people has no rights?

A: It refers to the fact that displacements and borderlands associated with the trend in global transformation place economically vulnerable people (on the  edge) on a risky position with respect to legal protections and secure rights.

A: It might be easier to explain backwards than forwards:

legal protections and secure rights.

Okay, this bit's easy enough, protections that are provided by law and rights that are secure and hence that people can feel secure in.

on the edge of legal protections and secure rights.

We have a figurative use of the spatial meaning of edge. We can picture someone who enjoys legal protections as being "within" them. We can picture someone does not who enjoy legal protections as being "outside" of them. Someone who has an incomplete, dubious or unreliable access to legal protections, we can hence consider as "on the edge of" them. Likewise with secure rights.

place economically vulnerable populations on the edge of legal protections and secure rights.

Continuing the figurative use of spatial terms (or rather starting it, since we've moved backwards to this point), to place someone on the edge means to make it such that they are now positioned there. Hence here, this means that those economically vulnerable populations are caused to be put into a situation where their legal protections are incomplete or unreliable.
And as such, "to place [someone] on the edge of [something]" means here, to make it so that [someone] is in a position in which they are neither fully within or fully outside of [something].


text:
Q: For loop range function When we execute the code
for i in range(10,0,-1):
    print('''          ''',i)

We get the result as 10 to 1(including 1)
But we do know that stop value is always n-1. So shouldn't it come until -1. Or does n-1 depend on the step value? Like if positive step value comes then n-1  and when negative step value comes n+2.

A: Stop value is not n-1 but it is n-step, and your step = -1
So,
Stop value = n - step = 0 - (-1) = 1

A: From the Python documentation

class range(start, stop[, step])
<snip>
For a positive step, the contents of a range r are determined by the formula r[i] = start + step*i where i >= 0 and r[i] < stop.
For a negative step, the contents of the range are still determined by the formula r[i] = start + step*i, but the constraints are i >= 0 and r[i] > stop.

So, in case of range(10,0,-1) the return values all have to be bigger than 0.


text:
Q: Investigate of convergence $\int_0^1 \frac1{\sqrt {1-x^3}} dx$
Investigate of convergence $\int_0^1 \frac1{\sqrt {1-x^3}} dx$

I tried to use asymptotic convergence  criterion however for all function $g$ and $f$ I got $\frac{f(x)}{g(x)}\rightarrow 0$ so I couldn't use it. That is why I think that it is not convergent but I can't prove it. Can you help me?

A: Hint:
$$\int_0^1 \frac1{\sqrt {1-x^3}} dx<\int_0^1 \frac1{\sqrt {1-x^2}} dx$$

A: $$\int_0^1 \frac{1}{\sqrt{1-x^3}}dx = \int_0^1 \frac{1}{\sqrt{1-x}\sqrt{1+x+x^2}} dx$$
$$ \lim_{x\rightarrow 1}\frac{1}{\sqrt{1+x+x^2}} = \frac{1}{\sqrt{3}} \neq 0,\infty$$
so $$ \int_0^1 \frac{1}{\sqrt{1-x^3}}dx \text{ is convergent} \qquad \Leftrightarrow \qquad\int_0^1 \frac{1}{\sqrt{1-x}} dx\text{ is convergent} $$


text:
Q: How to optimise the process of loading data in a 'for each' loop? I'm creating an application based around the Twitter API 1.1. User defined Twitter profile images are pulled in and displayed in the app, and once clicked the latest tweet of the particular account is displayed. Currently this process is initiated on click, using AJAX and a 'for each' loop which finds and displays the correct tweet included in a separate php page.
Although this process works fine, once the user has clicked on a profile image the app takes far too long to load the required tweet. I need some advice on how to optimise the process of loading tweets? Perhaps it might not need to be dependent on click, but I'm just not sure how to optimise my code.
Any help will be greatly appreciated.
Here's the code to help your understanding:
Code which initiates the latest tweet dependent on a particular profile image:
// Create all Tweeter objects
foreach ($tweeters as $i => $tweeter){
$tweeters[$i] = new Tweeter($tweeter, $tmhOAuth);
}

// Display all Tweeters
foreach ($tweeters as $tweeter){
$r+=1;
echo '';
echo 'getImage() . '" width="240px" height="240px" />';
}

Code that gets the tweets in a separate page:
require_once('config/FrameFunctions.php');

foreach ($tweeters as $i => $tweeter){
$tweeters[$i] = new Tweeter($tweeter, $tmhOAuth);
}

foreach ($tweeters as $tweeter){
$r+=1;
echo '

Latest tweet from ' . $tweeter->getName() . ':
';

foreach ($tweeter->getTweets() as $tweet){
    echo $tweet['text'] . '
';
    echo "Sent: " . $tweet['created_at'] . "

";
 }
}

A: You need to decouple the tweet retrieval from the user click. Move the AJAX to a JQuery ajax() call set to run at intervals. Add a hidden element to hold the latest tweets and update that with the result of the AJAX call. Also change the fancybox call to use the content of the hidden elements instead of having the fancybox making the AJAX call.
Main HTML:
    <!DOCTYPE html>

            <title></title>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

            <link rel="stylesheet" type="text/css" href="scripts/jquery.fancybox.css?v=2.1.4" media="screen" />

    <?php

    //Setting up objects, you won't need this part
    $tweeters = array("one", "two", "three");
    $tmhOAuth = 0;
    $r =0;

    Class Tweeter{
        function __construct(){
            return array("bob", "sue", "derek");
        }

        function getImage(){
            return "images/turpin.gif";
        }
    }
    //end set up objects

     // Create all Tweeter objects
    foreach ($tweeters as $i => $tweeter){
        $tweeters[$i] = new Tweeter($tweeter, $tmhOAuth);
        }

        // Display all Tweeters
        foreach ($tweeters as $tweeter){
        $r+=1;
        echo '';
        echo 'getImage() . '" width="240px" height="240px" />';
        echo 'Tweet text will go here';
    }

    ?>

Update Tweets code (Ajax php) :
    <?php
    //Setting up objects, ignore this part
    $tweeters = array("bob", "sue", "derek");
    $tmhOAuth = 0;
    $r =0;

    Class Tweeter{
        private $thetweeter;

        function __construct($tweeter){
            $this->theTweeter =  $tweeter;
        }

        function getTweet(){
            return $this->theTweeter  . "'s tweet at ". date('H:i:s') ;
        }
    }
    //end set up

    foreach ($tweeters as $i => $tweeter){
        $theTweeter = new Tweeter($tweeter, $tmhOAuth);
        $tweeters[$i] = $theTweeter->getTweet();
    }

    header("Content-type: application/json");
    echo json_encode($tweeters);
    ?>


text:
Q: How to use the value of the variable in the previous interval as an input to the equation....? Is it possible to use the previous value of the time varying variable
for eg:
Suppose I have pipe whose inlet temperature is 298K with a specified uniform mass flow(m_flow), now suppose i am heating the pipe using a heater of 100 watts.
The outlet temperature will be attain a higher temperature of suppose 302K, now if i have to use this outlet temperature as my inlet temperature (in the sense i am recircuilating the water), how would i be doing it?
is it possible to update the value of the inlet temperature based on the outlet temperature at the previous timestep? so that for the next iteration the inlet temperature will be the same as the oulet temperature in the previous iteration (in other words the fluid would be recirculating).
Thanks

A: You cannot access the value in the previous time step. The closest you can get in Modelica is using delay(exp,T) to get the value T units of time ago.

A: The timestep does not enter into it at all.  A model that uses information about timestep is just wrong.  Nature doesn't know or care about integration time steps, the model should reflect that.
It seems to me what you want to capture is transport delay.  Transport delay is the delay introduced by the time it takes for molecules, electrons, etc. through the system.  So presumably what you wish to model is the time it takes the inlet fluid to reach the exit.  Again, this has nothing to do with the integration timestep but rather the velocity of the fluid and the distance it must travel.  Once you know how long that takes (by either a priori knowledge of the system of by looking at the simulation results themselves), you can follow Marco's suggestion of using the delay operator.

A: In order to setup a proper model for the system you described I suggest you to look at the example :

Modelica.Thermal.FluidHeatFlow.Examples.IndirectCooling

of the modelica standard library ver. 3.2. Instead of one pipe you can put an ambient or control volume component to better suit you needs. Moreover using continous and differentiable equations (the delay function is not) you will benefit from some of the advantages of the Modelica code, e.g. you will be able to reuse your models in a much wider range of cases, solve inverse problems, solve initial value problems, ...
I hope this helps,
Marco


text:
Q: CakePHP - HABTM and different databases for models Lets say I have two different databases with the following tables:
Auth database:
users

App database:
fanpages
fanpages_users

Obviously my User model uses the Auth database, but how do I force HABTM relation to use the App database instead of the Auth database?
The error I am getting states:
Table fanpages_users for model FanpagesUser was not found in datasource Auth.

A: You need to create another model called FanspagesUser and define $hasMany relation on User model and on Fanpage model.
FanpagesUser.php
    <?php
    class FanpagesUser extends AppModel{
        public  $useDbConfig = 'your database configuration on databases.php';
        public $belongsTo = array('User','Fanpage');

    }

Fanpage.php
    <?php
    class Fanpage extends AppModel{
        public  $useDbConfig = 'your database configuration on databases.php';
        public $hasMany= array('FanpagesUser');

    }

User.php
    <?php
    class User extends AppModel{
        public  $useDbConfig = 'your database configuration on databases.php';
        public $hasMany= array('FanpagesUser');

    }


text:
Q: How to manage products in category on store view Basis I have multiple store views with same root category, also with the same categories for all the store-views. Can we add different products in a category on the basis of store view.
If not, is there any way to do the same ?

A: You can't add different products to the same categories on different stores views.
A workaround would be to duplicate the categories, assign different products to them and disable them based on store view. The drawback here is that you won't be able to use the same URL key for them.
Maybe it's useful to mention that you could use rewrites to 'mimic' the same URL key in the stores (say if you want to the same url_key in the menu or somewhere else), here's how to: https://docs.magento.com/user-guide/marketing/url-rewrite-product.html


text:
Q: How can return a view from another action in asp.net core I have 3 methods (PrintPersonsById, PrintPage, Print) in one controller (ReportsController) in Admin area. first I should call PrintPersonsById method (Through Ajax) and generate a list to prepare to print. then i should redirect to PrintPage action method. and finally, I should return View("PrintPage") that i use stimulsoft to show the report that call Print method. but the "return View("PrintPage")" code not working for me! And I can't go to the PrintPage view And see the print page. plz help me how i can solve this problem? Where am I wrong?
thanks
[Area(nameof(Admin))]
public class ReportsController : Controller
{
    public async Task<IActionResult> PrintPersonsById(string personsId=null)
    {
        if (personsId==null || string.IsNullOrWhiteSpace(personsId))
        {
            _message.SetMessage(Utilities.Errors.MessageType.DANGER, "not selected any record");
            return Json(_message);
        }
        List<int> personsArrayId = new List<int>();
        personsArrayId = personsId.Split(',').Select(s => int.Parse(s)).ToList();
        var listToPrint = await _person.GetAllPerson(personsArrayId);
        if (listToPrint.ToList()==null || listToPrint.ToList().Count<=0)
        {
            _message.SetMessage(Utilities.Errors.MessageType.DANGER, "not exists records to print");
            return Json(_message);
        }
        TempData.Set("ListToPrint",listToPrint.ToList());
        return RedirectToAction("PrintPage","Reports", new { area = "Admin" });
    }

    public IActionResult PrintPage()
    {
        if (TempData.Get<List<PersonClone>>("ListToPrint") ==null)
        {
            return RedirectToAction("Index", "People", new { area = "Admin" });
        }
        TempData.Keep("ListToPrint");
        return View("PrintPage");
    }

    public async Task<IActionResult> Print()
    {
        var listToPrint = TempData.Get<List<PersonClone>>("ListToPrint") as List<PersonClone>;
        StiReport stiReport = new StiReport();
        stiReport.Load(StiNetCoreHelper.MapPath(this, "wwwroot/Reports/ReportAllPerson.mrt"));

        stiReport.RegData("AllPerson", listToPrint);
        stiReport.Dictionary.Variables.Add("PersianDate", DateTime.Today.ToShamsiDate());
        stiReport.Dictionary.Variables.Add("ReportTitle", "List of exist people in system");
        return StiNetCoreViewer.GetReportResult(this, stiReport);
    }
}


text:
Q: Moving photos into folders on iphone 5s How do I move photos from camera roll or My photo stream into other albums or folders in the iphone 5s? I'm using iOS 7.

A: in ios7:

*

*go to camera roll.

*in top right, choose 'select' select the photos

*you want to move by clicking them one after another.

*when done go to the bottom and click 'add to' then create a new album in bottom of
list and they will be added.

A: There's meanwhile the iOS app Utiful for moving photos into folders. Utiful is a complementary photo library, so you can freely move photos between the Camera Roll and the Utiful folders. So, unlike the Photos app than only duplicates photos into albums, Utiful makes it finally possible to physically MOVE photos out of the Camera Roll.
It's available both for iPhone and iPad, here's the link to the App Store: https://itunes.apple.com/us/app/utiful-divide-rule-your-photo/id1034958660?ls=1&mt=8


text:
Q: How add prototype method to all arrays in Angular2?

I have created a function for summing values from an array and I want to add it as prototype for all arrays. But I get the following error:
app/training.ts(30,48): error TS2339: Property 'sum' does not exist on type 'Exercise[]'.
[0] app/training.ts(41,41): error TS2339: Property 'sum' does not exist on type 'Exercise[]'.

app/array.ts
export interface Array<T> {
  sum:(exp?:(item)=>number)=>number;
}

Array.prototype['sum'] = function (exp?:(item)=>number){
    var result = 0;

    this.map(exp || ((item) => item)).forEach( (val) => result += val);

    return result;
};

app/main.ts
import {bootstrap}    from 'angular2/platform/browser'
import {Array} from './array';
import {TrainingComponent} from './training.component'

bootstrap(TrainingComponent);

A: Create a Class lets Say MyCustomArray.ts
export class MyCustomArray extends Array<T>{
  //all methods u want to add on array.
   sum(){
  //ur logic goes here
  }
}

And whenever u want to use ,
Make a object of MyCustomArray.
i.e
_customArrayObj=new MyCustomArray<String>();


text:
Q: Tango API linking against private native libraries API24+ Are there any solutions for this problem?
Running the Tango API displays a warning dialog on the library
Our team has the same problem. The guide mentioned doesn't really help. Not "libtango_client_api.so" is private, as far as i did understand:
"libbinder.so"
"libcutils.so"
"libutils.so"
"libgui.so"
"libandroid_runtime.so"
"libui.so"

are the private platform libs we can still use in api version 24, but in 24+ they will not be accessible anymore. The warning also appears on the latest c-examples. There must be a solution for that, caused by the fact that there exists applications without any warnings like this (Rtabmap).
I would be grateful for any help.

A: I assume you duplicated the question because you are unable to comment yet.  I have the same issue so I cannot respond on that thread either but I can give you a workaround which seems very poor but I don't have any other solution.
For each missing file you can include the prebuilt library as the Developer Site suggests:

...you should update your app to either include its own copy of those libraries or only use the public NDK APIs.

I added the following to the make file and put a copy of the files in the relevant folder:
include $(CLEAR_VARS)
LOCAL_MODULE          := binder
LOCAL_SRC_FILES := ../jni/lib/$(TARGET_ARCH_ABI)/libbinder.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE          := cutils
LOCAL_SRC_FILES := ../jni/lib/$(TARGET_ARCH_ABI)/libcutils.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE          := utils
LOCAL_SRC_FILES := ../jni/lib/$(TARGET_ARCH_ABI)/libutils.so
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE          := android_runtime
LOCAL_SRC_FILES := ../jni/lib/$(TARGET_ARCH_ABI)/libandroid_runtime.so
include $(PREBUILT_SHARED_LIBRARY)

This does not seem like the correct way to do this and I suspect there will be many dependencies.  GDB log shows which symbols I cannot load which I will include below.  I did start going through one by one seeing which one logcat complained about next in the hope it won't need them all but that may be in vain.  I can't believe I have to add all of the following symbols:
/system/lib64/libcutils.so
/system/lib64/libutils.so
/system/lib64/liblog.so
/system/lib64/libbinder.so
/system/lib64/libnativeloader.so
/system/lib64/libandroid_runtime.so
/system/lib64/libwilhelm.so
/system/lib64/libc++.so
/system/lib64/libm.so
/system/lib64/libbacktrace.so
/system/lib64/libnativehelper.so
/system/lib64/libmemtrack.so
/system/lib64/libandroidfw.so
/system/lib64/libexpat.so
/system/lib64/libnetutils.so
/system/lib64/libui.so
/system/lib64/libgui.so
/system/lib64/libinput.so
/system/lib64/libinputflinger.so
/system/lib64/libcamera_client.so
/system/lib64/libcamera_metadata.so
/system/lib64/libskia.so
/system/lib64/libsqlite.so
/system/lib64/libEGL.so
/system/lib64/libGLESv1_CM.so
/system/lib64/libGLESv2.so
/system/lib64/libvulkan.so
/system/lib64/libETC1.so
/system/lib64/libhardware.so
/system/lib64/libhardware_legacy.so
/system/lib64/libselinux.so
/system/lib64/libsonivox.so
/system/lib64/libcrypto.so
/system/lib64/libssl.so
/system/lib64/libicuuc.so
/system/lib64/libicui18n.so
/system/lib64/libmedia.so
/system/lib64/libjpeg.so
/system/lib64/libusbhost.so
/system/lib64/libharfbuzz_ng.so
/system/lib64/libz.so
/system/lib64/libaudioutils.so
/system/lib64/libpdfium.so
/system/lib64/libimg_utils.so
/system/lib64/libnetd_client.so
/system/lib64/libradio.so
/system/lib64/libsoundtrigger.so
/system/lib64/libminikin.so
/system/lib64/libprocessgroup.so
/system/lib64/libnativebridge.so
/system/lib64/libradio_metadata.so
/system/lib64/libmemunreachable.so
/system/lib64/libhwui.so
/system/lib64/libregionalization.so
/system/lib64/libstagefright.so
/system/lib64/libstagefright_foundation.so
/system/lib64/libeffects.so
/system/lib64/libstagefright_http_support.so
/system/lib64/libbase.so
/system/lib64/libunwind.so
/system/lib64/libstdc++.so
/system/lib64/libsync.so
/system/lib64/libpng.so
/system/lib64/libft2.so
/system/lib64/libdng_sdk.so
/system/lib64/libpiex.so
/system/lib64/libwpa_client.so
/system/lib64/libpcre.so
/system/lib64/libpackagelistparser.so
/system/lib64/libnbaio.so
/system/lib64/libspeexresampler.so
/system/lib64/libprotobuf-cpp-lite.so
/system/lib64/libRS.so
/system/lib64/libRScpp.so
/system/lib64/libdrmframework.so
/system/lib64/libmediautils.so
/system/lib64/libopus.so
/system/lib64/libstagefright_omx.so
/system/lib64/libstagefright_yuv.so
/system/lib64/libvorbisidec.so
/system/lib64/libpowermanager.so
/system/lib64/libstagefright_enc_common.so
/system/lib64/libstagefright_avc_common.so
/system/lib64/liblzma.so
/system/lib64/libbinary_parse.so
/system/lib64/libimage_type_recognition.so
/system/lib64/libtiff_directory.so
/system/lib64/libRS_internal.so
/system/lib64/libbcinfo.so
/system/lib64/libLLVM.so
/system/vendor/lib64/libavenhancements.so
/system/lib64/libstagefright_httplive.so
/system/lib64/libmediaplayerservice.so
/system/lib64/libstagefright_wfd.so
/system/vendor/lib64/libExtendedExtractor.so
/system/lib64/libdashplayer.so
/system/lib64/libart.so
/system/lib64/libsigchain.so
/system/lib64/liblz4.so
/system/framework/arm64/boot.oat
/system/framework/arm64/boot-core-libart.oat
/system/framework/arm64/boot-conscrypt.oat
/system/framework/arm64/boot-okhttp.oat
/system/framework/arm64/boot-core-junit.oat
/system/framework/arm64/boot-bouncycastle.oat
/system/framework/arm64/boot-ext.oat
/system/framework/arm64/boot-framework.oat
/system/framework/arm64/boot-telephony-common.oat
/system/framework/arm64/boot-voip-common.oat
/system/framework/arm64/boot-ims-common.oat
/system/framework/arm64/boot-apache-xml.oat
/system/framework/arm64/boot-org.apache.http.legacy.boot.oat
/system/framework/arm64/boot-tcmiface.oat
/system/framework/arm64/boot-telephony-ext.oat
/system/framework/arm64/boot-WfdCommon.oat
/system/framework/arm64/boot-oem-services.oat
/system/framework/arm64/boot-qcom.fmradio.oat
/system/framework/arm64/boot-qcmediaplayer.oat
/system/lib64/libandroid.so
/system/lib64/libcamera2ndk.so
/system/lib64/libGLESv3.so
/system/lib64/libjnigraphics.so
/system/lib64/libmediandk.so
/system/lib64/libmediadrm.so
/system/lib64/libOpenMAXAL.so
/system/lib64/libOpenSLES.so
/system/lib64/libwebviewchromium_plat_support.so
/system/vendor/lib64/libOpenCL.so
/system/vendor/lib64/libgsl.so
/system/vendor/lib64/libCB.so
/system/vendor/lib64/libqti_performance.so
/system/vendor/lib64/libqti-perfd-client.so
/system/vendor/lib64/libtango_hal.so
/system/vendor/lib64/libLiftParser.so
/system/vendor/lib64/libadsprpc.so
/system/vendor/lib64/libtango_hardware.so
/system/vendor/lib64/libtango_surface_texture.so
/system/vendor/lib64/lib-ims-rcscmjni.so
/system/vendor/lib64/lib-imsrcscmclient.so
/system/vendor/lib64/lib-imsrcscm.so
/system/vendor/lib64/lib-imsdpl.so
/system/vendor/lib64/lib-imsqimf.so
/system/vendor/lib64/libdiag.so
/system/vendor/lib64/libqmiservices.so
/system/vendor/lib64/libdsi_netctrl.so
/system/vendor/lib64/libtime_genoff.so
/system/vendor/lib64/lib-imsxml.so
/system/vendor/lib64/libidl.so
/system/vendor/lib64/libqmi.so
/system/vendor/lib64/libqdi.so
/system/vendor/lib64/libnetmgr.so
/system/vendor/lib64/libdsutils.so
/system/vendor/lib64/libconfigdb.so
/system/vendor/lib64/libqmi_cci.so
/system/vendor/lib64/libqmi_common_so.so
/system/vendor/lib64/libqmi_client_qmux.so
/system/vendor/lib64/libqmi_client_helper.so
/system/vendor/lib64/libmdmdetect.so
/system/vendor/lib64/libxml.so
/system/vendor/lib64/libqmi_encdec.so
/system/vendor/lib64/libsmemlog.so
/system/vendor/lib64/lib-imsrcscmservice.so
/system/vendor/lib64/libcxsparse.so
/system/lib64/libart-compiler.so
/system/lib64/libvixl.so
/system/lib64/libjavacore.so
/system/lib64/libopenjdk.so
/system/lib64/libopenjdkjvm.so
/system/lib64/hw/memtrack.msm8996.so
/system/vendor/lib64/libqti-at.so
/system/vendor/lib64/libqti-gt.so
/system/lib64/libxml2.so
/system/lib64/libmedia_jni.so
/system/lib64/libmtp.so
/system/lib64/libexif.so
/system/lib64/libstagefright_amrnb_common.so
/system/lib64/libextmedia_jni.so
/system/lib64/libjavacrypto.so
/system/lib64/libkeystore-engine.so
/system/lib64/libkeystore_binder.so
/system/lib64/libkeymaster_messages.so
/system/lib64/libsoftkeymasterdevice.so
/system/lib64/libkeymaster1.so
/system/vendor/lib64/egl/libEGL_adreno.so
/system/vendor/lib64/libadreno_utils.so
/system/vendor/lib64/egl/libGLESv2_adreno.so
/system/vendor/lib64/libllvm-glnext.so
/system/vendor/lib64/egl/libGLESv1_CM_adreno.so
/system/vendor/lib64/egl/eglSubDriverAndroid.so
/system/vendor/lib64/hw/gralloc.msm8996.so
/system/lib64/libmemalloc.so
/system/lib64/libqdMetaData.so
/system/lib64/libqdutils.so
/system/lib64/libqservice.so
/system/lib64/libcompiler_rt.so
/system/lib64/libwebviewchromium_loader.so
/data/app/com.sample.moreteapots-1/oat/arm64/base.odex
/system/framework/oat/arm64/QPerformance.odex

I will be watching the other thread you referred to which I have upvoted and hope that someone will give us a sensible solution.  It seems unlikely that API 24 has only messed up Tango developers.
I programmatically generated make file code from the log and my program has compiled and run.  The Tango config returns null but that is a new issue I suppose.  Here are the prebuilt includes. Just add the files to the source path.


text:
Q: Mask - Mascara javascript Estava transcrevendo algumas funções que tenho no PHP para o javascript.
Como eu poderia deixar este código mais eficiente ?
String.prototype.substrCount = function(str){
    if(str == undefined){
        return 0;
    }
    var r = new RegExp(str, 'g');
    return (this.match(r) || []).length;
}

String.prototype.mask = function(mask){
    var value = onlyNumber(this);   // REMOVE TUDO QUE NAO SEJA NUMERO

    for(var i = 0; i <= mask.substrCount('#'); i++){

        if(typeof(value[i]) === 'undefined'){
            break;
        }

        var k = mask.indexOf('#');  // CAPTURA O PROXIMO INDICE DE #
        mask = mask.split('');
        mask[k] = value[i];
        mask = mask.join('');
    }

    return mask;
}

No PHP eu tenho ele simplesmente assim :
function maskNumber($mask,$str){
    $str = onlyNumber($str);    // REMOVE TUDO QUE NAO SEJA NUMERO

    $count = mb_substr_count($mask, '#');
    for($i = 0; $i < $count; $i++){
        $mask[strpos($mask,"#")] = $str[$i];
    }

    return $mask;
}

A: Escrevi algo abaixo que vai te auxiliar, mas acho melhor utilizar alguma biblioteca para mask, em jquery, em angular, js puro.
Abaixo segue o código embutido e no plunker:
mask code no plunker

String.prototype.mask = function(mask){
    var result = '';
    var value = this.replace(/\D/g, '');   // REMOVE TUDO QUE NAO SEJA NUMERO

    for (i = 0, j = 0; i < mask.length; i++) {
      if (mask[i] == '#') {
        result += value[j] ? value[j] : '';
        j++;
      } else {
        result += mask[i];
      }
    }
    return result;
}

document.getElementById('xpto').innerHTML = '72081338831'.mask('###.###.###-##');
<!DOCTYPE html>

    <link rel="stylesheet" href="style.css">

initial value


text:
Q: CKEditor Strips H1 class when switching from source to view mode When I switch from source view to wysiwyg it strips my h1 classes and other inline stuff, I've looked around and I enabled config.allowedContent = true; in the config file but this does not solve the problem, how can I solve this?
Thanks

A: Ok, I found the solution, in the config.js file just add this line:
CKEDITOR.config.allowedContent = true;
Do not add the bolean change inside
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:

// config.language = 'fr';

// config.uiColor = '#AADC6E';

};
I was adding it there with config.allowedContent = true; and that wasnt working.


text:
Q: How to access bean attribute in JSP? How can we access the bean attribute in JSP?
I tried
<core:forEach var="header" items="${command.headerList}" >
<core:out value="${header.columnName}"/>
</core:forEach>

where headerList is the list of myBean which is having the attribute columnName [ getter / setter are defined in the class ]
Expected: it should print the value in columnName
Actual:  it is not printing anything at all
also how can i access the nth element in the List? i tried
${command.headerList[i]}

Output: nothing displayed.
Edit:#
When i write
${command.headerList}

it displays
com.bean.MyBean@14ecb90, com.bean.MyBean@169b35, com.bean.MyBean@27d572
This is just to let you know that the list is having something
and when i write
${header}

inside the forEach loop it displays:
javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects$7@d9d714
That means even header is having value, then why i am unable to print values using
${header.columnName}

A: header is an implicit object in JSPs that maps to request (HTTP) headers. See the JSP spec for a full list of implicit objects.
Try referencing the bean with respect to the scope you have stored it in (e.g. requestScope.header). Preferably, change the name to something else.

A:
How can we access the bean attribute in JSP?
  I tried
<core:forEach var="header" items="${command.headerList}" >
<core:out value="${header.columnName}"/>
</core:forEach>

where headerList is the list of myBean which is having the attribute columnName [ getter / setter are defined in the class ]

Looks fine. What happens instead?

also how can i access the nth element in the List? i tried
${command.headerList[i]}

Looks fine as long as i is initialized and in scope. What happens instead?

When i write
${command.headerList}

it displays
com.bean.MyBean@14ecb90, com.bean.MyBean@169b35, com.bean.MyBean@27d572

It should include [ in the front and ] in the tail, but for the remnant it looks fine as long as you didn't override Object#toString() in MyBean class. What had you expected?

and when i write
${header}

inside the forEach loop it displays:
javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects$7@d9d714

Looks fine. What had you expected?
Summarized: I don't understand your problem. Please elaborate more. Post an SSCCE. Tell about the expected input/output. Tell about the actual input/output.
Edit you've edited your question. Well, here are the updated answers.

${header.columnName}

Expected: it should print the value in columnName
  Actual: it is not printing anything at all

Then it actually didn't contain a value. To test it properly, override Object#toString() something like as follows:
public String toString() {
    return "header[" + columnName + "]";
}

And test it using ${command.headerList}. You can also add some System.out or Logger statement to the getter method to see if it is actually invoked and actually returned a value. Or if you understand how to use it, just run a code debugger. Every decent IDE ships with one.
Next:

${command.headerList[i]}

Output: nothing displayed.

Then there's no means of a valid i. To test it properly, do the following to get the first item:
${command.headerList[0]}


text:
Q: How does WebKit handle html5 download attribute? I want to download plain text with the new HTML5 attribute download of an  tag.
The HTML code is:
<!doctype html>

    download txt

This works under FireFox 32 and Chrome 37 but not under IE 11 and Qt 5.2 (WebKit)
Is it possible to get this website to work with WebKit (Qt)? Are Blops the way to go?
Edit:
I figured out that WebKit is mainly from Apple and in Qt 5.2 Html5 or at least the download attribute is not supported.
My workaround is to use my own mime-type and handle the unsupportedContent Exception.


text:
Q: How the list.html(Magento_Checkout/web/template/payment-methods/list.html) is works to render and display the payment methods in checkout page I wish to know how the list.html works while displaying the payment methods.
1)How it loops to display the payment methods using below template
list.html

        <each args="data: getRegion($group().displayArea), as: 'method'" render=""/>

list.js
define([
    'underscore',
    'ko',
    'mageUtils',
    'uiComponent',
    'Magento_Checkout/js/model/payment/method-list',
    'Magento_Checkout/js/model/payment/renderer-list',
    'uiLayout',
    'Magento_Checkout/js/model/checkout-data-resolver',
    'mage/translate',
    'uiRegistry'
], function (_, ko, utils, Component, paymentMethods, rendererList, layout, checkoutDataResolver, $t, registry) {
    'use strict';

    return Component.extend({
        defaults: {
            template: 'Magento_Checkout/payment-methods/list',
            visible: paymentMethods().length > 0,
            configDefaultGroup: {
                name: 'methodGroup',
                component: 'Magento_Checkout/js/model/payment/method-group'
            },
            paymentGroupsList: [],
            defaultGroupTitle: $t('Select a new payment method')
        },

        /**
         * Initialize view.
         *
         * @returns {Component} Chainable.
         */
        initialize: function () {
            this._super().initDefaulGroup().initChildren();
            paymentMethods.subscribe(
                    function (changes) {
                        checkoutDataResolver.resolvePaymentMethod();
                        //remove renderer for "deleted" payment methods
                        _.each(changes, function (change) {
                            if (change.status === 'deleted') {
                                this.removeRenderer(change.value.method);
                            }
                        }, this);
                        //add renderer for "added" payment methods
                        _.each(changes, function (change) {
                            if (change.status === 'added') {
                                this.createRenderer(change.value);
                            }
                        }, this);
                    }, this, 'arrayChange');

            return this;
        },

        /** @inheritdoc */
        initObservable: function () {
            this._super().
                    observe(['paymentGroupsList']);

            return this;
        },

        /**
         * Creates default group
         *
         * @returns {Component} Chainable.
         */
        initDefaulGroup: function () {
            layout([
                this.configDefaultGroup
            ]);

            return this;
        },

        /**
         * Create renders for child payment methods.
         *
         * @returns {Component} Chainable.
         */
        initChildren: function () {
            var self = this;

            _.each(paymentMethods(), function (paymentMethodData) {
                self.createRenderer(paymentMethodData);
            });

            return this;
        },

        /**
         * @returns
         */
        createComponent: function (payment) {
            var rendererTemplate,
                    rendererComponent,
                    templateData;

            templateData = {
                parentName: this.name,
                name: payment.name
            };
            rendererTemplate = {
                parent: '${ $.$data.parentName }',
                name: '${ $.$data.name }',
                displayArea: payment.displayArea,
                component: payment.component
            };
            rendererComponent = utils.template(rendererTemplate, templateData);
            utils.extend(rendererComponent, {
                item: payment.item,
                config: payment.config
            });

            return rendererComponent;
        },

        /**
         * Create renderer.
         *
         * @param {Object} paymentMethodData
         */
        createRenderer: function (paymentMethodData) {
            var isRendererForMethod = false,
                    currentGroup;

            registry.get(this.configDefaultGroup.name, function (defaultGroup) {
                _.each(rendererList(), function (renderer) {

                    if (renderer.hasOwnProperty('typeComparatorCallback') &&
                            typeof renderer.typeComparatorCallback == 'function'
                            ) {
                        isRendererForMethod = renderer.typeComparatorCallback(renderer.type, paymentMethodData.method);
                    } else {
                        isRendererForMethod = renderer.type === paymentMethodData.method;
                    }

                    if (isRendererForMethod) {
                        currentGroup = renderer.group ? renderer.group : defaultGroup;

                        this.collectPaymentGroups(currentGroup);

                        layout([
                            this.createComponent(
                                    {
                                        config: renderer.config,
                                        component: renderer.component,
                                        name: renderer.type,
                                        method: paymentMethodData.method,
                                        item: paymentMethodData,
                                        displayArea: currentGroup.displayArea
                                    }
                            )]);
                    }
                }.bind(this));
            }.bind(this));
        },

        /**
         * Collects unique groups of available payment methods
         *
         * @param {Object} group
         */
        collectPaymentGroups: function (group) {
            var groupsList = this.paymentGroupsList(),
                    isGroupExists = _.some(groupsList, function (existsGroup) {
                        return existsGroup.alias === group.alias;
                    });

            if (!isGroupExists) {
                groupsList.push(group);
                groupsList = _.sortBy(groupsList, function (existsGroup) {
                    return existsGroup.sortOrder;
                });
                this.paymentGroupsList(groupsList);
            }
        },

        /**
         * Returns payment group title
         *
         * @param {Object} group
         * @returns {String}
         */
        getGroupTitle: function (group) {
            var title = group().title;

            if (group().isDefault() && this.paymentGroupsList().length > 1) {
                title = this.defaultGroupTitle;
            }

            return title + ':';
        },

        /**
         * Checks if at least one payment method available
         *
         * @returns {String}
         */
        isPaymentMethodsAvailable: function () {
            return _.some(this.paymentGroupsList(), function (group) {
                return this.getRegion(group.displayArea)().length;
            }, this);
        },

        /**
         * Remove view renderer.
         *
         * @param {String} paymentMethodCode
         */
        removeRenderer: function (paymentMethodCode) {
            var items;

            _.each(this.paymentGroupsList(), function (group) {
                items = this.getRegion(group.displayArea);

                _.find(items(), function (value) {
                    if (value.item.method.indexOf(paymentMethodCode) === 0) {
                        value.disposeSubscriptions();
                        value.destroy();
                    }
                });
            }, this);
        }
    });
});

A: Check below example, It might be help to you
File path :

vendor/magento/module-checkout/view/frontend/layout/checkout_index_index.xml

<item name="payments-list" xsi:type="array">
    <item name="component" xsi:type="string">Vendor_ModuleName/js/view/payment/list</item> //Call custom Js here
    <item name="displayArea" xsi:type="string">custom-payment-methods-list</item>
    <item name="config" xsi:type="array">
        <item name="deps" xsi:type="array">
            <item name="0" xsi:type="string">checkout.steps.billing-step.payment.renders</item>
            <item name="1" xsi:type="string">checkout.steps.billing-step.payment.additional-payment-validators</item>
        </item>
    </item>
</item>

vendor/magento/module-checkout/view/frontend/web/template/payment.html

     //Call custom template

Check this file & change template path
vendor/magento/module-checkout/view/frontend/web/js/view/payment/list.js

template path like this : 'Vendor_ModuleName/payment-methods/list' //Define custom templage path here
This is just example, you need to create a all files in your custom module.


text:
Q: What are some good introductory/elementary books on the Riemann zeta function? I want to start learning things about the Riemann zeta function, I would like to cover things like its different representations, its universality property and its connections with prime numbers (I know very little about number theory!).
What are some good books on the topic? I'd like to focus exclusively in the $\zeta$ function (and perhaps some topics in analysis required to understand the other content).


text:
Q: Create nested Component Angular 6 want to create nested component in angular 6 . Folder structure is src->app->content->1.home,2.product
want create component in product.
 i did this am on already in folder product  c:/users/admin/project/test/src/app/content/product> ng g component advisory on cmd
Getting Error as : Unexpected token / in JSON at position 1122

A: Go to the root directory where angular-cli is there
and give the command as follows
c :/users/admin/project/test/src/app/content > ng g c product/advisory

A: Source copied from the official angular-cli doc
ng generate component my-new-component
ng g component my-new-component  // using the alias

// components support relative path generation
// if in the directory src/app/feature/ and you run
ng g component new-cmp
// your component will be generated in src/app/feature/new-cmp
// but if you were to run
ng g component ./newer-cmp
// your component will be generated in src/app/newer-cmp
// if in the directory src/app you can also run

    ng g component feature/new-cmp

// and your component will be generated in src/app/feature/new-cmp

A: C:\depot\sandbox>ng g c outside
CREATE src/app/outside/outside.component.html (22 bytes)
CREATE src/app/outside/outside.component.spec.ts (635 bytes)
CREATE src/app/outside/outside.component.ts (274 bytes)
CREATE src/app/outside/outside.component.scss (0 bytes)
UPDATE src/app/app.module.ts (546 bytes)

C:\depot\sandbox>ng g c outside/inside
CREATE src/app/outside/inside/inside.component.html (21 bytes)
CREATE src/app/outside/inside/inside.component.spec.ts (628 bytes)
CREATE src/app/outside/inside/inside.component.ts (270 bytes)
CREATE src/app/outside/inside/inside.component.scss (0 bytes)
UPDATE src/app/app.module.ts (636 bytes)

C:\depot\sandbox>ng g c outside/inside-too
CREATE src/app/outside/inside-too/inside-too.component.html (25 bytes)
CREATE src/app/outside/inside-too/inside-too.component.spec.ts (650 bytes)
CREATE src/app/outside/inside-too/inside-too.component.ts (285 bytes)
CREATE src/app/outside/inside-too/inside-too.component.scss (0 bytes)
UPDATE src/app/app.module.ts (740 bytes)

Example taken from angular bug tracker on github.


text:
Q: Pandas - How To Clean Up Scrape My goal is to access a clinical trials page, and pull the last row of a given table.
My current code, when pulling this last row, pulls more information than needed. (See attached)
I would like for only the date to pull (Highlighted in green).
import pandas as pd
import time
from selenium import webdriver
driver = webdriver.Chrome()

url='https://clinicaltrials.gov/ct2/show/NCT03328858?cond=brain+tumor&draw=2&rank=4'
driver.get(url)
time.sleep(1)

df=pd.read_html(url)[3]
df3=df.iloc[-1]
print(df3)

A: So if you like to get the last value of last series you can use .iloc[] method this way:
df.iloc[-1,-1]

or by series name if you will know it or sure it will be 'Unnamed: 1':
df['Unnamed: 1'].iloc[-1]

Will give you:
January 31, 2020


text:
Q: HTML/CSS. Вертикальное перекрытие блоков На странице есть блок .footer, приатаченный к низу. На широких экранах футер и предыдущий блок совпадают ровно по границам, когда высота футера - минимально-заданная классом. Но когда при масштабировании страницы футер увеличивает высоту, то закрывает часть предыдущего блока на дельту от текущей своей высоты и заданного минимума в классе .footer.
CSS:
.footer {
    bottom: 0;
    height: auto;
    min-height: 3em;
}

Блок перед футером имеет стилизацию по умолчанию от браузера.
Подскажите как можно убрать это перекрытие?


text:
Q: How can I get endless expectations? I use Selenium and I need to endlessly wait for the page to load (because it takes a couple of hours to load) and then parse data from it. How can I do this?
I use some code like this:
wait = WebDriverWait(driver, 10)
wait.until(EC.visibility_of_element_located((By.CLASS_NAME, "modal-title")))

A: You can use WebDriverWait() to achieve that. For example, the following code waits for five hours or until it finds the element.
hours_to_wait = 5

element = WebDriverWait(driver, hours_to_wait *60*60).until(
EC.visibility_of_all_elements_located((By.XPATH, 'hereIsYourXpath')))

Or:
element = WebDriverWait(driver, hours_to_wait *60*60).until(
        EC.presence_of_element_located((By.ID, "myDynamicElement"))
    )

Or in your case:
element = WebDriverWait(driver, hours_to_wait *60*60).until(
        EC.presence_of_element_located((By.CLASS_NAME, "modal-title"))
    )

You need to import these:
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


text:
Q: Triggering KeyEvents Not Working In my currentactivity I have been trying to trigger a keyevent using the following code:
this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));

This is the only code I call within my method.
but when this part of the code runs nothing happens and it doesn't simulate the back button being pressed. Before people recommend finish() or onBackPressed(), they will not work for my required implementation because I need both the home button and the recents button to be triggered too and that apparently can be done by triggering keyevents.
Anyone know whats going wrong here?
EDIT: I added:
this.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK));

to release the key and this worked but it wont work for KeyEvent.KEYCODE_HOME or KeyEvent.KEYCODE_APP_SWITCH. Do I need to declare permissions in my manifest to perform these?


text:
Q: Reading a file name from piped command So I'm trying to get the C program to read a filename from the command line in the following format:
cat (filename path) | (program name)
i can get it to read the name of the input file when its entered as a command line argument, but it won't read from the concatenated argument
here's the code, right now its reading the name of the file as if written after the program name on the command line.
#include <stdio.h>
#include <string.h>

//initialize file pointer
FILE *file;

//initialize global variables
#define DEFAULT_LEN 70

//main
int main(int argv, char *argc[]){

 //open File for reading
 file = fopen (argc[1],"r");
 //test for failure of file open, if failed, print message, quit
 if(file == NULL){
      printf("I'm sorry Dave, I'm araid I can't do that.\n");
  printf("Open the file \"%s\" that is.\n", argc[1]);
  return(0);
 }

 //read the first line of a file into an array
 char temp[DEFAULT_LEN]; //where the read data is put
 fgets(temp,DEFAULT_LEN,file); //stops at DEFAULT_LEN on \n

 //print out temp
 printf("%s\n", temp);

 //close file, return 0 for main
 fclose(file);
 return(0);
}

any help would be appreciated

A: The reason your program can't get the file name is because you're not giving it to it.
If you run your program as:
prog hello.txt

it's given the argument hello.txt in argc/argv.
However, what you're doing is:
cat hello.txt | prog

which means the shell is opening the file and feeding it into the standard input of your program. Actually, to be more accurate, cat is opening the file and the shell is simply connecting the standard output of cat to the standard input of prog.
One way around this is to check the number of arguments (argc is usually the count, argv[] the values, despite the roundabout way you have it in your code) and, if it's zero, argc == 1, read your file from standard input.
Only if an argument is given do you open that file and read it. That's the way a lot of UNIX utilities work:
od -xcb hello.txt        # will dump the file.
cat hello.txt | od -xcb  # will dump the file, but using standard input.
echo hello | od -xcb     # will dump your "hello" string.

Some even change their behaviour depending on how they're invoked, wc being one example - it shows the file name(s) if it knows them:
pax> wc -l qq.c
     29 qq.c
pax> cat qq.c | wc -l
     29
pax> wc -l *.c
      0 a b.c
    168 binmath.c
     49 qq-save.c
     29 qq.c
     11 qq2.c
      5 qqq.c
     18 xx.c
    280 total
pax> cat *.c | wc -l
    280

Note that last case - because all files are being presented over the single standard input stream, there's no way to tell how many files there are. wc will just tally up the entire contents of that stream.
Try this instead:
#include <stdio.h>
#include <string.h>

#define DEFAULT_LEN 70

int main (int argc, char *argv[]) {
    FILE *file;

    // Either select standard input or open the given file.

    if (argc == 1) {
        file = stdin;
    } else {
        file = fopen (argv[1], "r");
        if (file == NULL) {
            printf ("I'm sorry Dave, I can't do that\n");
            printf (" (open the file '%s', that is).\n", argv[1]);
            return 1;
        }
    }

    // Now you're connected to stdin or the file itself, no
    //  difference in handling them (unless you do weird fseek
    //  sort of stuff).

    char temp[DEFAULT_LEN];
    fgets (temp, DEFAULT_LEN, file);

    printf ("%s\n", temp);

    // Only close file if you opened it yourself.

    if (argc != 1)
        fclose (file);
    return 0;
}

This allows you to use both the file and standard input method as follows:
pax> prog prog.c
#include <stdio.h>

pax> echo hello | prog
hello

A: Piping content into a process does not put the values into argv; rather, it puts the values onto that process's stdin.
You need to check if argc is greater than 1.  If it is, then argv[1] has the filename you've been given (well, the first argument to the program, anyway).  If not, you need to read from stdin to get the filename.

A: To read from the contantenated, you need to read from STDIN
char c = (char)fgetc(stdin)


text:
Q: How to not select weekend dates using month calender when selecting multiple dates I have MonthCalender control on my form and I want to be able to select 10 days (2 business weeks) without selecting any weekends.
Is this possible?


text:
Q: Do browsers evaluate URL path patterns like ../? I have a php site with a web root directory /var/www/html/limesurvey/. Let's say this maps to the URL https://mylimesurveysite.com/.
The default runtimePath where logs are saved is /var/www/html/limesurvey/tmp/runtime/. If I wanted to download a log file, I could visit the URL https://mylimesurveysite.com/tmp/runtime/application.log and my browser would automatically download the log file. I've tested this.
If I set the runtimePath to /var/limesurvey_runtime/, are my log files in this directory still accessible to the internet somehow?
I tried to visit https://mylimesurveysite.com/../../../limesurvey_runtime/application.log and it doesn't seem like the log file can be accessed this way. So it seems URLs aren't evaluated like programming language paths.

A: TLDR; Browsers and webservers work together to try to ensure that only designated resources in the web root are accessible. It would be a major security violation if a web client could access arbitrary files on the server.
First, the browser automatically canonicalizes pathnames in URLs. This means that any XXX/.. pairs are automatically removed, so if you have a URL with /a/b/../c/d it's converted to /a/c/d. Next, any leading ../ are removed, so the URL https://mylimesurveysite.com/../../../limesurvey_runtime/application.log is converted to https://mylimesurveysite.com/limesurvey_runtime/application.log.
But we can't depend on browsers for security, because hackers can bypass browsers and write scripts that send arbitrary paths to the server. So servers are normally configured to block any access outside the defined web root directory. There's also optional settings to allow accessing directories in user directories, typically with paths beginning with ~username/; this is typically mapped by the server to something like /home/username/public_html/.
In either case, any ../ in the path that would go outside the web root or public_html directory are prohibited, and should result in a 404 Not found error.
If you want to allow access to something outside the web root, the usual way to do it is with a script that fetches files after validating that it's allowed. You may also be able to use symbolic links in the web root that point outside, although this may also be disabled in webserver configurations.

A: You could try creating a php file in your "public_html" or root web directory that reads that log file. For example in the PHP file you could say:
readfile("/var/www/html/limesurvey/tmp/runtime/application.log");


text:
Q: Broadcasting error when forming numpy array with elements as two other numpy arrays I am trying to generate a numpy array with elements as two other numpy arrays, as below.
W1b1 = np.zeros((256, 161))
W2b2 = np.zeros((256, 257))
Wx = np.array([W1b1, W2b2], dtype=np.object)

this gives an error:
ValueError: could not broadcast input array from shape (256,161) into shape (256).

However, if I take entirely different dimensions for of W1b1 and W2b2 then I do not get an error, as below.
A1 = np.zeros((256, 161))
A2 = np.zeros((257, 257))
A3 = np.array([A1, A2], dtype=np.object)

I do not get what is wrong in the first code and why is numpy array trying to broadcast one of the input arrays.
I have tried on below versions (Python 2.7.6, Numpy 1.13.1) and (Python 3.6.4, Numpy 1.14.1).

A: Don't count on np.array(..., object) making the right object array.  At the moment we don't have control over how many dimensions it makes.  Conceivably it could make a (2,) array, or (2, 256) (with 1d contents).  Sometimes it works, sometimes raises an error.  There's something of a pattern, but I haven't seen an analysis of the code that shows exactly what is happening.
For now it is safer to allocate the array, and fill it:
In [57]: arr = np.empty(2, object)
In [58]: arr[:] = [W1b1, W2b2]

np.array([np.zeros((3,2)),np.ones((3,4))], object) also raises this error.  So the error arises when the first dimensions match, but the later ones don't.  Now that I think about, I've seen this error before.
Earlier SO questions on the topic
numpy array 1.9.2 getting ValueError: could not broadcast input array from shape (4,2) into shape (4)
Creation of array of arrays fails, when first size of first dimension matches
Creating array of arrays in numpy with different dimensions


text:
Q: tar contents in current directory to stdout I am trying to tar the current directory and stream to stdout (ultimately to Amazon S3)...I have this command:
tar  -cf -  .

but I get this error:

tar: Refusing to write archive contents to terminal (missing -f
  option?) tar: Error is not recoverable: exiting now

from what I can tell -f - means the file is to stdout, although -f /dev/stdout is probably more explicit.
does anyone know how to form the command correct?

A: Like many programs, tar checks to see whether its output is going to a terminal device (tty) and modifies its behavior accordingly. In GNU tar, we can find the relevant code in buffer.c :
static void
check_tty (enum access_mode mode)
{
  /* Refuse to read archive from and write it to a tty. */
  if (strcmp (archive_name_array[0], "-") == 0
      && isatty (mode == ACCESS_READ ? STDIN_FILENO : STDOUT_FILENO))
    {
      FATAL_ERROR ((0, 0,
                    mode == ACCESS_READ
                    ? _("Refusing to read archive contents from terminal "
                        "(missing -f option?)")
                    : _("Refusing to write archive contents to terminal "
                        "(missing -f option?)")));
    }
}

You will find that once you connect stdout to something, it will happily write to it:
$ tar -cf- .
tar: Refusing to write archive contents to terminal (missing -f option?)
tar: Error is not recoverable: exiting now

whereas
$ tar -cf - . | tar -tf -
./
./001.gif
./02.gif
./1234.gif
./34.gif

A: A gratuitous cat will work, also:
$ tar -cf - . | cat


text:
Q: o110.pyWriteDynamicFrame. null I have created a visual job in AWS Glue where I extract data from Snowflake and then my target is a postgresql database in AWS.
I have been able to connect to both Snowflak and Postgre, I can preview data from both.
I have also been able to get data from snoflake, write to s3 as csv and then take that csv and upload it to postgre.
However when I try to get data from snowflake and push it to postgre I get the below error:
o110.pyWriteDynamicFrame. null

A: So it means that you can get the data from snowflake in a Datafarme and while writing the data from this datafarme to postgres, you are failing.
You need to check was glue logs to get more understanding why is this failing while writing the data into postgres.
Please check if you have the right version of jars (needed by postgres) compatible with scala(on was glue side).


text:
Q: Looping in php to add an array key I have this array:
array(3) {
    [0] = > array(4) {
        [0] = > int(11)[1] = > string(14)"28/07/14 13:05" [2] = > string(8)"a" [3] = > string(15)"b"
    }[1] = > array(4) {
        [0] = > int(12)[1] = > string(14)"28/07/14 15:15" [2] = > string(7)"c" [3] = > string(6)"d"
    }[2] = > array(4) {
        [0] = > int(13)[1] = > string(14)"28/07/14 15:30" [2] = > string(8)"e" [3] = > string(8)"f"
    }
}

Coming from a PHP foreach statement, now.. my question is very simple: it is possible (Notice: using another for each loop) to add for each rows of the array a [4] key and a new value? In order to obtain this:
array(3) {
        [0] = > array(5) {
            [0] = > int(11)[1] = > string(14)"28/07/14 13:05" [2] = > string(1)"a" [3] = > string(1)"b" [4] = > string(8)"NEWVALUE"
        }[1] = > array(5) {
            [0] = > int(12)[1] = > string(14)"28/07/14 15:15" [2] = > string(1)"c" [3] = > string(1)"d" [4] = > string(8)"NEWVALUE"
        }[2] = > array(5) {
            [0] = > int(13)[1] = > string(14)"28/07/14 15:30" [2] = > string(1)"e" [3] = > string(1)"f" [4] = > string(8)"NEWVALUE"
        }
    }

I hope you understand, thanks in advance
EDIT: Probably i'm not clear.. i will post my php code:
...
$xpath = new DOMXPath($document);
$expression = '(//table[@cellpadding="3"])[1]/tr[position() > 1]';
$rows = $xpath->query($expression);

$results = array();
$result = array();
foreach ($rows as $row) {

  $td = $row->childNodes;

  $data = $td->item(2)->nodeValue;
  $immagine = $td->item(4)->firstChild->attributes->getNamedItem("src")->nodeValue;
  $team1 = $td->item(10)->nodeValue;
  $team2 = $td->item(14)->nodeValue;
  $unixTime = time()*1000;

  $result[0] = $unixTime;
  $result[1] = $data;
  $result[2] = $team1;
  $result[3] = $team2;
  $results[] = $result;

  }

$expression1 = '(//table[@cellpadding="3"])[1]/tr[position() > 1]/td[19]/a[1]/@href';
$rows1 = $xpath->query($expression1);
$result = array();

foreach ($rows1 as $row) {

  $result[4] = $row->value;
  $results[] = $result;

}

var_dump($results);

Thanks for these answers
EDIT: I have put $result = array(); before foreach, but now i have this strange result: it is printed a "130" items array which consists on "65" elements that contained the 4 keys and after other "65" items in which are displayed all the 5 keys! But the first 4 keys are not looped!!
Example
for 0th to 64th element:
[0]=> array(4) { [0]=> int(11) [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c"
...
[64]=> array(4) { [0]=> int(74) [1]=> string(2) "a1" [2]=> string(2) "b1" [3]=> string(2) "c3"

for 65th to 130th element:
[65]=> array(5) { [0]=> int(11) [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c" [4]=> string(36) "popup.asp?tp=2100&lang=en&idm=556296" }
...
[130]=> array(5) { [0]=> int(11) [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c" [4]=> string(36) "popup.asp?tp=2100&lang=en&idm=452452" }

EDIT: Now it is displayed a 65 rows array, correctly number, but the first 4 are not looped! Example:
for 0th to 64th elements:
[0]=> array(4) { [0]=> int(11) [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c" [4]=> string(36) "popup.asp?tp=2100&lang=en&idm=452452"
[1]=> array(4) { [0]=> int(11) [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c" [4]=> string(36) "popup.asp?tp=2100&lang=en&idm=333352"
...
[65]=> array(4) { [0]=> int(11) [1]=> string(1) "a" [2]=> string(1) "b" [3]=> string(1) "c" [4]=> string(36) "popup.asp?tp=2100&lang=en&idm=999999"

A: You should use & because it is only refference and it will be changed in $array so.
foreach($array as &$bit) {
  $bit[] = "New value";
}

The output is same variable as input $array.

A: You can use the original $array in the foreach like this:
//$array our array

foreach($array as $key => $value){
 $array[$key][] = 'NEW VAL';
 //equivalent to use $value = 'NEW VAL' but it should be referenced
}

A: Yes this is possible using the [] operator.
You can enter any key into the brackets, or if the keys are numeric like in your case: simple leave it empty to increment the numeric count by 1 and add 1 element.
foreach($array as $value) {
    $value[] = "NEWVALUE";
}