text:
Q: Google Maps doesn't load on Bootstrap 3 with a tab on modal I'm working with Bootstrap using tabs into a modal, in the second tab I have a div for Google Maps. Works perfectly, only by Google Maps that I used on Bootstrap tab inside a modal. The problem is that doesn't show the map, only the Google on the corner and nothing else.
I tried to use
$('#dlgProductDetail').on('shown.bs.modal', function () {
            google.maps.event.trigger(map, 'resize');
        });

And
$('a[href="#detailProductLocation"]').on('shown', function (e) {
            google.maps.event.trigger(map, 'resize');
        });

This is my modal

General

Location

                                            Autoservicio:
                                            <input type="text" class="form-control" maxlength="5" id="txtDetailProduct">

                                            Address:
                                            <textarea class="form-control" id="txtDetailProductAddress" style="height: 33px;"></textarea>

                                            Latitud:
                                            <input type="text" class="form-control" maxlength="30" id="txtDetailProductLatitude" >

                                            Longitud:
                                            <input type="text" class="form-control" maxlength="30" id="txtDetailProductLongitude" >

                <button class="btn btn-default btn-flat" id="btnCancelGralProduct">Cerrar</button>

This is my script
var map;
var markers = [];

function initMap () {
    mexico_center = { lat: 22.841611, lng: -102.109821 };

    map = new google.maps.Map(document.getElementById('product_map'), {
        zoom: 4,
        center: mexico_center,
        mapTypeId: 'terrain'
    });
}


text:
Q: Error while loading MNIST database in Python I'm trying to work with MNIST handwritten digits database but the below two lines are giving me error. Where am I going wrong??
from sklearn import datasets
dataset = datasets.fetch_mldata('MNIST original')

The error which I am getting is as followed:
Traceback (most recent call last):
  File "E:/HWrecognition/deep-belief-network-gpu-update/kk.py", line 5, in <module>
    dataset = datasets.fetch_mldata('MNIST original')
  File "C:\Python27\lib\site-packages\sklearn\datasets\mldata.py", line 142, in fetch_mldata
    mldata_url = urlopen(urlname)
  File "C:\Python27\lib\urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "C:\Python27\lib\urllib2.py", line 397, in open
    response = meth(req, response)
  File "C:\Python27\lib\urllib2.py", line 510, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python27\lib\urllib2.py", line 429, in error
    result = self._call_chain(*args)
  File "C:\Python27\lib\urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 605, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "C:\Python27\lib\urllib2.py", line 391, in open
    response = self._open(req, data)
  File "C:\Python27\lib\urllib2.py", line 409, in _open
    '_open', req)
  File "C:\Python27\lib\urllib2.py", line 369, in _call_chain
    result = func(*args)
  File "C:\Python27\lib\urllib2.py", line 1173, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "C:\Python27\lib\urllib2.py", line 1148, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error [Errno 10109] getaddrinfo failed>

redpajama_set_name: RedPajamaStackExchange


text:
Q: Can the Icon be disposed safely after a call to Imaging.CreateBitmapSourceFromHIcon? for a user control that shows, among other things, file paths and the associated file icon for a set of given files we extract the Icon of those files and create ImageSource instances for later use.
Roughly:
FileIcons aIcon = new FileIcons(filePath);
System.Drawing.Icon i = aIcon.GetSmallIconWithTypeName(isFolder, out typeName);
ImageSource imgSource = Imaging.CreateBitmapSourceFromHIcon(i.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());

Irrelevant but just for info: The FileIcons class uses SHGetFileInfo and ExtractIconEx of the Shell32.dll to get the Icon.
The interesting part is after the call to Imaging.CreateBitmapSourceFromHIcon(...):
Can I safely .Dispose() the Icon the ImageSource was created from AND keep using the ImageSource afterwards?
Thanks for the help,
Frank

A: You can, there is no link between the bitmap and the icon, the former being an independent in-memory image derived from, but not linked to the latter.
Don't forget to p/invoke DestroyIcon() for i as well.


text:
Q: Getting 404 Error on Second Domain - Magento 2 Multi-Store So I have a LEMP stack set up on a staging server and on my local. I have it set up as a Multi-Store. The staging server and local are identical. Except that the local is running off of Laravel Valet and the Staging server is just a regular LEMP stack.
I have the Multi-Store setup, on my local it works perfectly. For the secondary domain it shows me exactly what I should expect to see. But on the Staging server I can verify it's loading the secondary site, but I get a 404 error.
The only difference that I can find is that on my local Laravel Valet is running off of /index.php and that is where I had to set the variables to load the secondary site. But on the Staging server I'm running a specific Magento config and it's loading based on /pub/index.php And this is the site that comes up with a 404 error on the secondary domain.
I can't figure this one out. The index.php files are similar but there are a few differences. All I can assume is that slight difference in document root is causing the issue. The ideal configuration I'm sure is that the document root be set to the /pub/ directory, but this is the method that I can't seem to get working. Any help is much appreciated.
UPDATE: I tried to set the staging server to just use / instead of /pub like my local is using. Unfortunately I still got a 404 on the secondary domain, and then on the primary all the assets were missing because of an incorrect path on those elements now.
UPDATE: I didn't have a home page created but it stilled showed on local. I created one anyway, still doesn't work. Oddly enough all other URL's work. Try to go to a category page, it works. Try to go to the login page, it works. The only thing that I think doesn't work is the home page that I've found so far.

A: Don't have enough for comments.
Check the .htaccess file and clear the cache and reindex everything.

A: So I finally figured the problem.
I never set the default Home Page under:
Stores >> Settings >> Configuration >> General >> Web >> Default Pages
Now granted it was automatically picking up the default but the default was ear marked as only available for the other website not for all stores. And I did create a new page ear marked for the second website, but I didn't know that it also had to be set here as the default page. Silly mistakes, but I hope someone can learn from me.


text:
Q: pysftp - IOError - No such file when I can see the full file on the other end I have a program which transfers files to different endpoints. Only one endpoint in particular fails on this conn.put():
try:
  conn.put(fileToPush, pushedFile)
except IOError as ioe:
    self.logPush('IOError: {} - Exiting...'.format(str(ioe)))

The output:
IOError: [Errno 2] No such file - Exiting...
But I sftp to the destination from the command line and I do an "ls -ltr" and one of the two files I'm trying to push is there.
The file's size is 900117 bytes.
Then on sftp, I can also see the file size as 900117 bytes.
How does it transfer 1 whole file and still run into an IOError?


text:
Q: logstash with jdbc gets PsychParser error Background environment:
logstash using the microsoft jdbc driver to connect to sql server with integrated security.
When the jruby gets to PsychParser.java in 'parse' method, it throws an error:
<Psych:: SyntaxError: (<unknown>) 'reader' unacceptable character ' ' (0x0) special characters are not allowed in "'reader'", position 0 at line 0 column 0>

It used to work fine until the last week and suddenly it stop working and showing that error.
TNX for your help.

A: I runned logstash-jdbc with
clean_run => "true"

configuration once, and now it seems to work fine again.


text:
Q: Loop Motion Planning Algorithms Happy New Year.
In a similar spirit of question  Motion planning algorithm, we consider a path connected topological space $X$, and equip its free loop space $X^{S^1}$ with the open compact topology. We call a loop motion planning algorithm of $X$, any continuous section $s:X\times X \longrightarrow X^{S^1}$ of the evaluation $$ev: X^{S^1} \longrightarrow X\times X, \; \gamma\mapsto (\gamma(0), \gamma(1/2))$$
We have shown that such section exists if and only if $X$ is contractible. Hence, we denote $\mathcal{M}^{LP}(X)$ the non empty set of such sections, topologized with the open compact topology (as subset of ${\rm map}(X\times X,X^{S^1})$.
Question: Is it true that $\mathcal{M}^{LP}(X)$ is contractible when $X$ is ?
General Question: The space of sections for a fibration with section E ---> B
where E, and B are both contractible is again contractible?
Any remarks or comments are welcome, thank


text:
Q: Using r, which metric should I use for determining the best model? library("forecast")
ss<-c(29,36,36,48,93,28,35,28,37,50,37,3,25,28,40,45,38,43,34,44,43,25,33,34)
ss<-ts(ss,f=12,start=c(2016,1))
for (i in 1:12){
ssfc <- ses(ss[c(i:(11+i))],h=1)
ssfc2 <- meanf(ss[c(i:(11+i))],h=1)
ssfc3 <- naive(ss[c(i:(11+i))],h=1)
ssfc4 <- snaive(ss[c(i:(11+i))],h=1)
ssfc5 <- rwf(ss[c(i:(11+i))],h=1,drift=TRUE)
ssfc6 <- croston(ss[c(i:(11+i))],h=1)
ssfc8 <- holt(ss[c(i:(11+i))],h=1)
ssfc9<-holt(ss[c(i:(11+i))],h=1,damped=TRUE)
print(round(accuracy(ssfc),4))
print(ssfc8[["model"]])
print(round(accuracy(ssfc2),4))
print(round(accuracy(ssfc3),4))
print(round(accuracy(ssfc4),4))
print(round(accuracy(ssfc5),4))
print(round(accuracy(ssfc6),4))
print(round(accuracy(ssfc8),4))
print(round(accuracy(ssfc9),4))
}

and got the following output for the training set:

Now if I just use MSE and MAE, one response would be to use holt based on MSE, but MAE (or MASE) says use SES.  Maybe too much info is not a good thing in this case.  I also only gave you 12 months of data, but the set contains 24, which I roll through with a 12 month window.  There are no zeros in the dataset, but for some reason Croston's method wins out in most cases.  Totally confused.

A: *

*Are you sure 12 rolling window tests warrant so many digits in your result table? In other words, what is the uncertainty on your error estimates and how does that compare to the observed differences? Statistically speaking, can you distinguish 19.40 from from 19.99?

*Keep in mind: finding "those 4 methods perform well, it doesn't matter which of them we take" is a valid result. More than one method may be equally suitable.
I don't work with time series, so I don't know how to interpret ses, meanf, holt and holt damped to achieve similar predictive performance.  But with my spectroscopic data, if I found, say, that principal component regression and partial least squares do equally well, whereas OLS and neural network don't that would not be  surprising. Interpretation would be that linear models are suitable, but some regularization is needed.


text:
Q: Is it possible to hide some line numbers in the minted environment? With the following code:
\begin{text}{minted}
a
b
c
d
e
\end{minted}

Is it possible to have line numbers for only b and c?

A: Just an idea you possibly haven't think:
\documentclass[a4paper,12pt]{report}
\usepackage{minted}
\begin{document}
\begin{minted}{text}
a
\end{minted}
\vspace{-26pt}
\begin{minted}[linenos]{text}
b
c
\end{minted}
\vspace{-26pt}
\begin{minted}{text}
d
e
\end{minted}
\end{document}

Feel free to ask me to delete.
PS: The d is missing because  forgot the second argument of second environment.. fixed in code.


text:
Q: CodeBlocks MinGW on XP noob. Is it possible to overwrite the same exe every time I compile? Further explanation inside I have looked through both the CodeBlocks and MinGW FAQ and wiki to no avail. As stated above I am a noob.
I want CodeBlocks to act like a Unix compiler in that it overwrites a single output file every time it compiles unless told to do otherwise.
In Unix:
[cc example.c] -> [a.out], [cc example2.c] -> [a.out]. If I want to save the output file from being overwritten i just [cc -o newname example3.c] - [newname.out].
If this is possible with CodeBlocks/MinGW on XP I'd like to know how to do it. If not I would appreciate recommendations for another GUI compiler/IDE that could. Any help is appreciated. Thank you.

A:
I want CodeBlocks to act like a Unix
  compiler in that it overwrites..

First of all, C::B isn't a compiler -- it's an IDE. Saying you want C::B to act like a compiler makes no more sense then saying you want vim, emacs, or visual studio to 'act' like a compiler.
Second, you change the name of the final executable by right-clicking a project in your workspace. Goto properties->Build targets tab->select which build target you want to change. On the right side of this you'll see Output filename. Enter the executable filename the linker should output here. Alternatively, you can just navigate to the location of your existing executable and just rename it to something else.
And thirdly, chances are you're not even going to be checking back on this site so I'm probably just wasting my time giving an answer to your post.


text:
Q: Inheritance relationship confusion I have three classes-User, Vendor, and Customer. Now Customer 'is-a' User and have same attributes as User has, so it should inherit User class. But the confusion is in case of Vendor. A Vendor 'is-not-a' User according to business rule as a vendor is not supposed to use the application, but it also has the same attributes the User has. Should Vendor be inherited from a User class in this particular case or not?

A: Logically, I'd say no. If I were designing such a system, I'd envision a User object having methods such as Login, ChangePassword, GetLastLoginDate, etc. On the other hand a Vendor might have methods such as AddProduct, ReceivePurchaseOrder, etc.
Just because it has attributes such as First Name and Last Name and other such variables doesn't make it a user. An object is more than just properties, it also includes the actions (methods). I would assume the methods that would be part of a User class would be very different than a Vendor based on what I know of both users of an application and vendors. If Vendors were a type of user that logged into your application, but had different access than Customers, then I'd say yes. However, based on your description they are very different things.

A: There are two ways to approach this:
1) Have both User and Vendor inherit from the same parent object, maybe Account. Account contains the attributes common to User and Vendor, and will allow you to later add specialized attributes to Users that Vendors don't get.
2) If the attributes of Vendor will always match the attributes of User, you could add a "Can Log In" attribute to User and have Vendor inherit from it. This would be less complex in the short term but could cause problems later if User and Vendor diverge.


text:
Q: Android Menu Item Title not displaying I've been fiddling with android, and I've been following the menu sample, and it runs almost fine, but the "title" field of the menu items isn't displaying.
I think it's related to this question:
https://stackoverflow.com/questions/3286093/android-menu-item-not-showing-text
but I'm not sure what his answer means.
Anyway, it properly gets that I have 2 menu items, it just isn't displaying the text. I'm not quite sure where the error is and figured extra sets of eyes would be good.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<menu xmlns:android="https://schemas.android.com/apk/res/android">
 <item android:id="@+id/options"
  android:title="@string/main_options" />
 <item android:id="@+id/options2"
  android:title="@string/main_options2" />
</menu>

Inflator:
@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.main_menu, menu);
        return true;
    }

If anything else is needed, let me know.
edit:
string file:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="hello">Hello World!</string>
    <string name="app_name">LifeInColor</string>
 <string name="main_options">Options</string>
 <string name="main_options2">Something goes here</string>
</resources>

changing the xml to:
 <?xml version="1.0" encoding="UTF-8"?>
    <menu xmlns:android="https://schemas.android.com/apk/res/android">
     <item android:id="@+id/options"
      android:title="@string/main_options" />
     <item android:id="@+id/options2"
      android:title="Something goes here" />
    </menu>

gets the same result. I have a picture, but it won't let me post it because I'm new.

A: In your menu file replace https://schemas.android.com/apk/res/android with http://schemas.android.com/apk/res/android (https -> http). So it looks like the error was due to incorrect schema address.

A: Maybe the icon is too large. If you use an icon of more than 48x48 on an hdpi screen, the user will either see no title or see a truncated title.
See http://developer.android.com/guide/practices/ui_guidelines/icon_design_menu.html#size9

A: I had to specify an icon with android:icon="@null"to each item, then the title was shown. This works if using Toolbar.

A: Directly we can add menu items like this , it working fine for me
       @Override
        public boolean onCreateOptionsMenu(Menu menu)
           {
        // TODO Auto-generated method stub
             super.onCreateOptionsMenu(menu);
             MenuItem item1=menu.add(0, 4, 0,"text1");
            item1.setIcon(R.drawable.car);
            MenuItem item2=menu.add(0, 0, 0, "text2");
             item2.setIcon(R.drawable.share);
            MenuItem item3=menu.add(0, 2, 0, "text3");
           item3.setIcon(R.drawable.history);
           MenuItem item4=menu.add(0, 3, 0, "text4");
           item4.setIcon(R.drawable.settings);
    return true;
}


text:
Q: Approximating a function I'm sorry if this question in not well formed...
I would like to perform a computation of the following function:
f() = -2*X1 -1*X2 +0*X3 + 1*X4 +2*X5

(The function can be of more variables, but is always finite and the coefficients are always of this form: -n..-3,-2,-1,0,1,2,3,..n ). Each Xi is also a sum other xi's, that is:
Xi = (xi1 +xi2 + ... xim).
I need some kind of approximation or something like that so I will be able to compute this efficiently, with limit set of operations, because n and m can be large numbers and I need to run this in MATLAB many times.
I can compute sums of the xi's and the Xi's very efficiently, (in O(1)), and I would like if possible to use this.
Suggestions for additional information and examples will be welcomed.
Thanks.

A: Your question can be resumed to the following form:
$$f(x_{i,j})=\sum^n_{i=1} a_{i} X_{i}=\sum^n_{i=1} a_{i} \sum^m_{j=1} x_{i,j}$$
with $a_i \in \Bbb Z$. For the largest coefficient $a_{i}^{max}$ you could define:
$$g(x_{i,j})=a_{i}^{max} \sum^n_{i=1} \sum^m_{j=1} x_{i,j}$$
$f$ would not exceed $g$. It should be to good extent efficient to calcualte $f\approx g$. I hope I understood your question correct.

possible optimization
$$g(x_{i,j})=g^{(p)}-|g^{(n)}|=p_{i}^{max} \sum^k_{i=1} \sum^l_{j=1} x_{i,j}-|n_{i}^{max}| \sum^k_{i=1} \sum^l_{j=1} y_{i,j}$$
while $p$ is for positive and $n$ for negative integers.
Then approximate separately:
$$f^{(p)}\approx g^{(p)}$$
$$f^{(n)}\approx |g^{(n)}|$$
So you may split your approximation to avoid cancellation in the series' approximation.


text:
Q: Style checkboxes in mat-select with multiple options I have a mat-select that I'm using with the multiple option (see this example from docs).
I want to style the color of checkboxes when they are selected (by default it's blue).
So from this:

I need to get this:

but I don't know which css selector/rule I should use.
Normally for checkboxes I would use this:
/deep/.mat-checkbox-checked.mat-accent .mat-checkbox-background, .mat-checkbox-indeterminate.mat-accent .mat-checkbox-background {
    background-color: #A5C73C;
}

but the options are not seen as checkboxes.
HTML:
<mat-form-field>
  <mat-select placeholder="Toppings" [formControl]="toppings" multiple>
    <mat-option *ngFor="let topping of toppingList" [value]="topping">{{topping}}</mat-option>
  </mat-select>
</mat-form-field>

A: The following CSS appears to work, as shown in this stackblitz:
::ng-deep .mat-primary .mat-option.mat-selected:not(.mat-option-disabled) {
    color: unset;
}

::ng-deep .mat-option-pseudo-checkbox.mat-pseudo-checkbox-checked {
    background-color: #A5C73C;
}


text:
Q: How to create a react native state with key and value array? I've a flatlist with a list of options and a checkboxes in each row, and I need  a state for the checkboxex, using hooks. I tought create a key-value relationship, an associative array somehow, so I can access to the proper state using the "item.option" as key:
export default function Questions({ navigation, route }) {

    const [questionNumber, setQuestionNumber] = useState(0);
    const data = route.params.data;
    const numberOfQuestions = Object.keys(data.questions).length;

    const [selectedOption, setSelectedOption] = useState([null]);
    const [toggleCheckBox, setToggleCheckBox] = useState([false])

    [...]

    const renderItemMultipleChoice = ({ item }) => {
        console.log(toggleCheckBox[item.option],item.option); //******here I get undefined
        return (
            <View style={[styles.option]}>
                <CheckBox style={styles.checkBox}
                    disabled={false}
                    value={toggleCheckBox[item.option]}
                    onValueChange={(newValue) => multipleChoiceHandler(item.option, newValue)}
                />
                <Text style={styles.optionText}>{item.option}</Text>
            </View>

        );
    };

    const multipleChoiceHandler = (item, newValue) => {
        var newHash = toggleCheckBox
        newHash[item] = newValue;
        setToggleCheckBox({toggleCheckBox: newHash});
    }

    useEffect(() => {
        if (data.questions[questionNumber].type_option != "open_choice") {
            for (i = 0; i < Object.keys(data.questions[questionNumber].options).length; i++) {
                var newHash = toggleCheckBox
                newHash[data.questions[questionNumber].options[i].option] = false;
//*******every checkbox is false at the beginning...
                setToggleCheckBox({toggleCheckBox: newHash});
                console.log("toggle checkbox:",toggleCheckBox[data.questions[questionNumber].options[i].option],
 data.questions[questionNumber].options[i].option); //****** here I get all false, the value I setted.

            }
            setSelectedOption([null]);
        }
    }, [questionNumber])

     return(
             <FlatList style={styles.flatlistOption}
                    data={data.questions[questionNumber].options}
                    renderItem={renderItemMultipleChoice}
                    keyExtractor={(item) => item.option}
                />
     )
}

I'm supernoob about react, so to insert the intial state of toggleCheckBox for each element (using the parameter option to refer to the proper array element), I've used a for cycle... I know it's not proper and quite spaghetti code. Btw it should work, but when I try to access from the checklist to the toggleCheckBox state I get a undefined, so the checkbox state doesn't work properly. I don't know what I'm missing...


text:
Q: Passing Ajax/service data between components in React.js I am trying to pass data received in one component of a React application. On success I am taking the received data and setting the state and then trying to pass that data as a property of the next component. Once inside the second component I need to access the passed data via this.state so I can change the state in that component later. I seem to be encountering an issue with the DOM rendering before the data is received from the service. I have tried passing an already loaded array of values in place of this.state.data in <List data={this.state.data}/> and it seems to execute fine. How can assure that I have received the data from the service before rendering the DOM so that the data is passed all the way down to each component.
EDIT: added full implementation of the List element so explain the use of this.state
This is basically what I am trying to do:
var Box = React.createClass({

  getInitialState: function() {
    return {data: []};
  },

  loadTodosFromServer: function() {
    $.ajax({
      url: this.props.url,
      dataType: 'json',
      type: 'GET',
      cache: false,
      success: function(dataResponse) {
        this.setState({data: dataResponse});
      }.bind(this),
      error: function(xhr, status, err) {
        console.error(this.props.url, status, err.toString());
      }.bind(this)
    });
  },

  componentDidMount: function() {
    this.loadFromServer();
  },

  render: function() {
    return (<List data={this.state.data}/>);
  }
});

var List = React.createClass({

  getInitialState: function() {
    return {data: this.props.data};
  },

dragStart: function(e) {
  this.dragged = e.currentTarget;
  e.dataTransfer.effectAllowed = 'move';
  // Firefox requires dataTransfer data to be set
  e.dataTransfer.setData("text/html", e.currentTarget);
},

dragEnd: function(e) {
  this.dragged.style.display = "block";
  this.dragged.parentNode.removeChild(placeholder);
  // Update data
  var data = this.state.data;
  var from = Number(this.dragged.dataset.id);
  var to = Number(this.over.dataset.id);
  if(from < to) to--;
  if(this.nodePlacement == "after") to++;
  data.splice(to, 0, data.splice(from, 1)[0]);
  this.setState({data: data});
},

dragOver: function(e) {
  e.preventDefault();
  this.dragged.style.display = "none";
  if(e.target.className == "placeholder") return;
  this.over = e.target;
  // Inside the dragOver method
  var relY = e.clientY - this.over.offsetTop;
  var height = this.over.offsetHeight / 2;
  var parent = e.target.parentNode;

  if(relY > height) {
    this.nodePlacement = "after";
    parent.insertBefore(placeholder, e.target.nextElementSibling);
  }
  else if(relY < height) {
    this.nodePlacement = "before"
    parent.insertBefore(placeholder, e.target);
  }
},

  render: function() {
    var results = this.state.data;
      return (

            {
              results.map(function(result, i) {
                return (

{result}

                )
              })
            }

      );
    }
  });

ReactDOM.render(
  <Box url="/api/comments"/>, document.getElementById('content')
);

A: The reason why your data load subsequent to component load is not rendering the data is because of this line in your List.render function:
var results = this.state.data;

Essentially, you have made a copy of your original props and assigned them to the state in the List component using the getInitialState method. And after that your state and props are delinked. Which means that if the props.data changes on the List component, the state doesn't know about it, so therefore nothing gets re-rendered.
So, instead of using state to initialize the results variable, use props.
var results = this.props.data

Here's how it would look like:
var List = React.createClass({

  render: function() {
    var results = this.props.data;
      return (

            {
              results.map(function(result, i) {
                return (

{result}

                )
              })
            }

      );
    }
  });

Now anytime the data changes, props get updated and eventually the results get re-rendered.
Updated to address the comments from the OP:
If you want to update the state of the list but want to be notified every time the props at the parent change, then you want to use the method componentWillReceiveProps so that when the data is obtained the child List is notified. And in this method you can set the new state:
componentWillReceiveProps: function(newProps) {
    this.setState({data: this.props.data});
}

Once you do this, react will re-render the list for you.
Another update: To illustrate how this works I have put together an example here.
And here's the JS code for this:
let todos = ["Run","Swim","Skate"];

class MyList extends React.Component{
  componentWillMount() {
    console.log("Props are: ", this.props);
    this.setState({list: this.props.items});
  }

  componentWillReceiveProps(newProps) {
    console.log("Received Props are: ", newProps);
    this.setState({list: newProps.items});
  }

  render() {
    return (

            {this.state.list.map((todo) =>
{todo}
)}

);
  }
}

class App extends React.Component{
  constructor() {
      super();
      console.log("State is: ", this.state);
  }

  componentWillMount() {
    this.setState({items: ["Fly"]});
  }

  componentDidMount() {
    setTimeout(function(){
      console.log("After 2 secs");
      this.setState({items: todos});
    }.bind(this), 2000);
  }

  render() {
      return (<MyList items={this.state.items}/>);
  }
}

ReactDOM.render(<App/>, document.getElementById("app"));


text:
Q: Unable to write JSON data into InfluxDB 2.x using python client I'm trying to insert a simple json data into the InfluxDB 2.x using python client: influxdb_client.
The code create the measurement and all the fields and tags but it does not insert the data.
This is how I'm connecting to InfluxDB:
from datetime import datetime
from influxdb_client import InfluxDBClient as FluxDBClient
from influxdb_client import Point, WriteOptions
from influxdb_client .client.write_api import SYNCHRONOUS

api_token = "gC4vfGRHOW_OMHsXtLBBDnY_heI76GkqQgZlouE8hNYZOVUVLHvhoo79Q-5b0Tvj82rmTofXjywx_tBoTXmT8w=="
org = "0897e8ca6b394328"
client = FluxDBClient(url="http://localhost:8086/", token=api_token, org=org, debug=True, timeout=50000)

Here is the code to insert data:
points = [{
    "measurement": "temp",
    "time": datetime.now(),
    "tags": {
        "weather_station": "LAHORE",
        "module_detail_id": 1,
    },
    "fields": {
        "Rad1h": 1.2,
        "TTT": 100,
        "N": 30,
        "VV": 20,
        "power": 987,
    }
}]

options = WriteOptions(batch_size=1, flush_interval=8, jitter_interval=0, retry_interval=1000)
_write_client = client.write_api(write_options=options)
_write_client.write("Test", "0897e8ca6b394328", points)
_write_client.__del__()
client.__del__()

When I run the script, I get 204 response in return, which means that the write query is executed successfully. But I'm getting no record, as you can see in the image below:


text:
Q: Avoid caching for Facebook app links I intergrated Facebook App Links in my Android app and it worked quite good. I followed the guide of Facebook for existing content on web (add meta-data in html web page).
However, there is an issue when I shared a link twice or more on facebook and also change the meta-data tag (like al:android:package or al:android:app_name). It seems that Facebook still work with old meta-data and cannot find my app.
Is there any way to avoid this or please give me an idea for complete Facebook App Links.
Thanks in advance.


text:
Q: Why is relative positioning only working after page refresh? (floating action button on material UI AppBar) I am having a lot of trouble debugging this issue as it only occurs immediately after I run 'npm run start', after performing a single page refresh everything shows up in the correct position as if there were no issues at all...
There are three floating buttons on my application's top bar which I have set relative positions so that they are shifted down slightly to overlap the work area.
They show up in the perfect place after a page refresh has been performed. And the positioning changes (left or right) relative to a drawer which may or may not be open and on screen.
Does anyone know what might cause this issue on the first page load only?
I have tried absolute positioning, which sets all the floating buttons uttermost left of the page on first load, but then in the correct positions after refresh.
I'm keen to know what would cause the page to render these buttons in strange positions on the first load if anyone has any ideas I am all ears.
Thanks
Floating action buttons with styles
import { makeStyles, styled } from '@mui/styles';
import React, { useState } from 'react';
import { Add, ChevronLeft, Remove } from '@mui/icons-material';
import AppBar from '@mui/material/AppBar';
import Box from '@mui/material/Box';
import Fab from '@mui/material/Fab';
import Toolbar from '@mui/material/Toolbar';
import Tooltip from '@mui/material/Tooltip';

const drawerWidth = 440;

const useStyles = makeStyles((theme) => {
    return{
        bar: {
            display: "flex",
            flexDirection: "row-reverse",
            backgroundColor: deepPurple[500],
        },
        drawer: {
            width: drawerWidth
        },
        origAppbar: theme.mixins.drawer,
        zoomFab: {
            position: 'relative',
            zIndex: 1,
            top: 80,
            left: (drawerOpen) => {return drawerOpen ? 0 : 430},
            right: 10,
        },
        zoomOutFab: {
            position: 'relative',
            zIndex: 1,
            top: 80,
            left: (drawerOpen) => {return drawerOpen ? 10 : 440},
            right: 0,
        },
        hideLinesFab: {
            position: 'relative',
            zIndex: 1,
            top: 80,
            left: (drawerOpen) => {
                    return drawerOpen ? -10 : 420;
                },
            right: 20,
        }
    }
})

const ExpandFab = styled(Fab)({
    position: 'absolute',
    zIndex: 1,
    top: 2,
    left: 540,
    right: 0,
});

const CollapseFab = styled(Fab)({
    position: 'absolute',
    zIndex: 1,
    top: 10,
    left: 200,
});

export default function Layout({ children }) {
    const [drawerOpen, setDrawerOpen] = useState(true);
    const classes = useStyles(drawerOpen);

    return(

                <Box sx={{ flexGrow: 1 }}>
                    <AppBar elevation={4} ref={widthRef}>
                        <Toolbar className={classes.bar}>
                            {userView ?
 : <Tooltip title="Zoom Out (CTR + Wheel)"><Fab className={classes.zoomOutFab} onClick={() => changeZoomCallback(false)} size={'small'}>
                                <Remove sx={{ width: 36, height: 36 }}/>
                            </Fab></Tooltip>}
                            {userView ?
 : <Tooltip title="Zoom In (CTR + Wheel)"><Fab className={classes.zoomFab} collapsed={drawerOpen.toString()} onClick={() => changeZoomCallback(true)} size={'small'}>
                                <Add sx={{ width: 36, height: 36 }}/>
                            </Fab></Tooltip>}
                            {userView ?
 : <Tooltip title="Hide Page Links"><Fab className={classes.hideLinesFab} collapsed={drawerOpen.toString()} onClick={() => setHideLines(!hideLines)} size={'small'}>
                                <VisibilityOffTwoTone sx={{ width: 36, height: 36 }}/>
                            </Fab></Tooltip>}
                            {userView ?
 : <ExpandFab left={drawerOpen ? 10 : 500} onClick={() => setDrawerOpen(true)} size={'small'} sx={drawerOpen ? {display: 'none'} : {}}>
                                <ChevronLeft sx={{ width: 36, height: 36 }}/>
                            </ExpandFab>}
                        </Toolbar>
                    </AppBar>
                    {RIGHT HAND DRAWER ALSO GOES HERE (REMOVED TO SIMPLIFY CODE BASE)}
                </Box>

    )
}

A: Simple solution to this one. The two floating action buttons were rendering into absolute position before everything else had rendered on the first load.
After a page refresh they were rendering into the correct position.
I just had to update from absolute position to relative position to force them to wait for the appbar to render to get them in the right position.
If you have this type of issue which occurs only on the first page load then make sure you haven't set anything with absolute positioning.


text:
Q: Throwing balls into bins, where some of the bins are closed after one ball My question is a variant of the balls-in-bins problem (similar to the coupon collector problem), where I'm interested in how many of the $n$ bins will be empty after throwing $k$ balls.
As far as I understand, this normally equals $\mathbf{E}[X] = n\left(\frac{n-1}{n}\right)^k$. Where I get lost is when I try and extend this problem as follows:
Rather than $n$ bins that can hold any number of balls, let us say that $m$ of the bins are no longer available after receiving one ball (i.e. without replacement). The other $n-m$ bins continue to act as normal. If $m=n$, then of course $X=n-k$ bins will be empty after throwing $k$ balls.
For other values of $m$ though, how does this affect the number of empty bins?
Let me know if I need to clarify anything. This is my first time posting! Thank you for your help :)


text:
Q: How to create ERD from Heroku PostgreSQL database? I would like to create ERD from my Heroku PostgreSQL database? How can I generate ERD?
Is there any external tool that will help with this? Can you use Dbeaver for this?
Thanks,
Hema.

A: You can use Moon Modeler to create ERD from Heroku Postgres.


text:
Q: How to std::queue in parallel threads on winapi using std::mutex I want to make asynchronous writes in stream.
In code below functions streaming and push_stream runs in parallel threads by using CreateThread winapi function. And std::lock_guard<std::mutex> should lock the queue from random access.
But I have some issue with this instance of code. When queue pops items, I get Microsoft Visual C++ Runtime Library error __acrt_first_block == header
std::ofstream somestream;
std::queue<std::string> queue;
std::mutex mutexQueue;

void streaming() {
  while (true) {
    if (!queue.empty()) {
      std::lock_guard<std::mutex> lock(mutexQueue);

      while (!queue.empty()) {
          somestream << queue.front();
          queue.pop();
      }
    }
  }
}

void push_stream(std::string str) {
  std::lock_guard<std::mutex> lock(mutexQueue);
  queue.push(str);
}

How to make this kind of asynchronous writes? I've tried concurrent_queue but it hasn't a thread-safe item removing.
UPD
Problem was in .dll and .exe static linked with RT. Functions implemented in .exe, push_stream called from .dll.
Which cause the Debug Assertion Failed! Expression: _pFirstBlock == pHead
Now issue is fixed.


text:
Q: Still error display: Missing required parameter I facing the issue Missing required parameter for [Route: search.customer] [URI: agency/{slug}] [Missing parameter: slug]
Here is below my code
Route::get('/agency/{slug}', [SearchController::class, 'listing'])->name('search.customer');

@if ($agents->isNotEmpty())
     @foreach ($agents as $value)
         $value->agency_slug]) }}" class="btn btn-danger btn-sm btn_hover">View More
     @endforeach
@endif


text:
Q: How safe is Asymmetric Encryption How secure is asymmetric encryption when sender encrypts with private key and reciever decrypts with public key but public key has visibility? any one can decrypt it

A: It's the other way around.. Sender encrypts with public key, and receiver decrypts with its private key..
What you are saying applies to signature.. sender signs with private key, receiver validates signature with public key


text:
Q: How to remove white space for string " $ … 123.56 " in javascript i have getting my input as $                                                …                                          123.56. How to change it has "$ 123.56" in javascript

A: I guess you're looking for this?
var priceInput = " $ … 123.56 ";
var priceOutput = priceInput.replace('… ', '');


text:
Q: Setting a button permanently enabled I have a list of different buttons named stage1 to stage10. then the stage1 button is the only button that is enabled and the rest are disabled. after the user finished all the questions inside stage1, it will unlock stage2. How can I permanently set a button enabled so that every time the user exits the application and re open it, the button that is set enabled should still be enabled.

A: You could store the information about which buttons were enabled in SharedPreferences. Once you come back you check which buttons were enabled last time and enable them programatically.

A: Use some sort of storage, to save whether the user has already unlocked the stage.
It can be done with:

*

*SharedPreferences

*Database

*File

After it's done, you can check every button's 'flag', and set them accordingly when the page loads.

A: Depending on your needs, there are different persistent storage solutions. You can check the options from Android Storage Options. Examples are included there.

A: First you create a shared preferences class:
  public class AppPreferences {
      private static final String APP_SHARED_PREFS = "com.aydabtu.BroadcastSMS_preferences"; //  Name of the file -.xml
         private SharedPreferences appSharedPrefs;
         private Editor prefsEditor;

         public AppPreferences(Context context)
         {
             this.appSharedPrefs = context.getSharedPreferences(APP_SHARED_PREFS, Activity.MODE_PRIVATE);
             this.prefsEditor = appSharedPrefs.edit();
         }

         public boolean getOnOrOff() {
             return appSharedPrefs.getBoolean("get_on_or_off", false);

         }

         public void setOnOrOFF(Boolean text) {
             prefsEditor.putBoolean("get_on_or_off", text);
             prefsEditor.commit();
         }

Then from your main activity:
appPrefs = new AppPreferences(getApplicationContext());

Button buttonOff = (Button)findViewById(R.id.B_off);
//to get preferences and set button
buttonOff.setEnabled(appPrefs.getOnOrOff());
//to set preferences
appPrefs.setOnOrOff(true);


text:
Q: react-native-screens has been ignored because it contains invalid configuration. Reason: "dependency.platforms.android.componentDescriptors" not allow I'm facing this issue

Package react-native-screens has been ignored because it contains invalid configuration. Reason: "dependency.platforms.android.componentDescriptors" is not allowed


text:
Q: way to reinitialize a page each time it is shown I have some pages which are filled dynamically by content loaded with Ajax. My problem is that each time I go to this page, the old content is still there if it hasn't been replaced by new content...
I've thought about 2 home solutions like:

*

*Creating a "template" page. By calling "pagebeforeshow", I'll copy the code from the template in the target page, and add there the dynamic content...

*Each DOM where dynamic content must be put into, I had a class "clearcache" and by calling "pagebeforeshow" I do a $(".clearcache").empty();

I don't know how to deal with that. Have you ever got the same issue?

EDIT:

I bind the "tap" event to store the block-id into localstorage, to load dynamic content in the #PageBlock
Everything works very well (tap event, localstorage for the var, ajax loading). The issue comes really when I go from block to other blocks. The new content overwrite old content instead of beginning from a new "blank" page.
For example I have a list where I append datas I get from Ajax. If I switch to another block, the list is completed and not refreshed..
I could do something like empty the list, and then appending content, but I'd like something better because I have several pages/lists/dom like that...
Thanks for your help ;)

A: I faced a similar problem where the new contents where not shown on the page when i tried to append it.There is a simple solution where you can just replace append with prepend.
Example:
Replace
$("#divid").append(content)
with
$("#divid") .prepend(content)


text:
Q: How do I request a xml page and parse through it without actually loading it From within my .aspx page I am trying to make a request to an xml page that is on the web and return the value of one of the nodes. The page in question will be a service that accepts a query string and outputs the results to my own aspx page.
For learning purposes though I am just trying to make a simple example. I have found this page: http://www.w3schools.com/xml/note.xml What I would like to do is have a button that when clicked will display to a textbox the value of the  < body>< /body> node?
I have been trying to do it with the WebClient Class but I'm not positive if this is the correct way to go about it. I have been following this example http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=33798 but I am encountering exception (407) Proxy Authentication Required.

A: You could use LINQ to XML like so to load the XML and retrieve the elements you wish:
XDocument document = XDocument.Load("http://www.w3schools.com/xml/note.xml");
string xml = document.Root.ToString();

Using your example (http://www.w3schools.com/xml/note.xml), the above would output the following:
<note>
    <to>Tove</to>
    <from>Jani</from>
    <heading>Reminder</heading>
    <body>Don't forget me this weekend!</body>
</note>

Hope this helps.
Edit (Based on comment)
If you are sitting behind a proxy server and have default credentials setup you can try the following (untested as not behind proxy):
HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create("http://www.w3schools.com/xml/note.xml");
webRequest.Proxy = WebRequest.DefaultWebProxy;
using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse())
{
    using (StreamReader streamReader = new StreamReader(webResponse.GetResponseStream()))
    {
        XDocument document = XDocument.Load(new StringReader(streamReader.ReadToEnd()));
        string xml = document.Root.ToString();
        MessageBox.Show(xml);
    }
}

Note
(From MSDN WebRequest.DefaultWebProxy Property)

The DefaultWebProxy property reads proxy settings from the app.config
  file. If there is no config file, the current user's Internet Explorer
  (IE) proxy settings are used.

A: I think you can load the XML into an XmlDataDocument like this:
XmlDataDocument xmlDoc = new XmlDataDocument();
xmlDoc.Load("http://mydomain.com/exportsearch?param=SearchText");

Once you have the XML in the document, it should be fairly easy to query it.


text:
Q: JS Syntax Error and Function Execution Context In a YouTube video (https://www.youtube.com/watch?v=iLWTnMzWtj4&list=PLlasXeu85E9cQ32gLCvAvr9vNaUccPVNP&index=3), it was said that when we run the JS code, a global execution context is created. Execution context is created in two phases: Memory Creation and Code Execution phase.
In the memory creation phase var are assigned undefined and whole function body is assigned to the function name something like this:
a: undefined
foo: {whole function body}

A new Execution Context is created for each function WHEN THEY ARE INVOKED. Then the memory is assigned to its local variables.
The question is if memory is not assigned to a function local variables until it is invoked, then why do they throw SyntaxError if we make a syntax mistake in a function and the whole code doesn't run at all?
for e.g. the below code throws SyntaxError and doesn't run at all whereas the memory is allocated to foo after it is invoked which is after the first line
console.log("hello");

function foo() {
    vard world = "world";
  console.log(world);
}

foo();

Can anyone please explain when does the JS engine knows that there is actually a SyntaxError? Obviously it is not after the function is invoked because even if we don't invoke the function at all, the SyntaxError will still be thrown
Does the Global Execution Context gets created if there is a syntax error in the code? What is the sequence? Which happens first and later means the Global Execution Context gets created first or the parsing the code to machine language is done first?

A: I am no expert on this topic but I'll throw in my two cents of knowledge.
Javascript is an interpreted language which (as you correctly stated) means that the code is run line-by-line and other errors are thrown at runtime. However as with most interpreted languages the js interpreter will run a syntax check before executing any code. This is what throws the SyntaxErrors you're seeing, the interpreter noticing code that is not valid js syntax before any of the code is executed.

A: That's just how a Syntax Error works. It's basically saying, this program is not valid. So it just doesn't run.

Can anyone please explain when does the JS engine knows that there is
actually a SyntaxError?

Because it parses it first and while parsing the code, it finds an error which makes it stop because it doesn't know what you meant by it.


text:
Q: Sharepoint 2013 file move with drag & drop not working I created a new folder and intended to move a file (or more files) from the root of Shared Documents to the new folder.
It does not matter if I use Firefox 44, Microsoft Edge, or Internet Explorer 11, I can only select the objects and no drag icon appeared.
If I select 1 item, the drag icon appears (in Edge), but it does nothing when I drop.
This is what I see:

How should I make this "feature" work?

A: You could always open the document library with explorer, from here you can drag and drop any document to a folder. (You have to use Internet Explorer.)

Edit:
However, on your picture it looks like you selected on of the checkboxes and just highlighed the other document... Check the checkbox on every document that you wanna move and drag them to the folder.

A: There is a key element in that drag and drop that should be emphasized.
You should drag the ICON, and not the document itself. Using the document icons, the moving can be done.


text:
Q: Add a column of derived data to a data.frame Suppose I have a simple table of sales data
> df<-data.frame(country=c("A", "A", "B", "B"), outlet=c(1,2,1,2), sales=c(300, 900,10,40))
> df
  country outlet sales
1       A      1   300
2       A      2   900
3       B      1    10
4       B      2    40

and would like to add a column showing the fraction of all sales in that country contributed by each outlet. I can do this with a split, iterating then recombining using rbind, but this looks quite ugly to me
> do.call("rbind",lapply(split(df, df$country), function(x) { x$frac <- NA; tot<-sum(x$sales); for (o in x$outlet) {s<-x[x$outlet== o,]$sales; x[x$outlet == o,]$frac <- s/tot}; return(x)}))
    country outlet sales frac
A.1       A      1   300 0.25
A.2       A      2   900 0.75
B.3       B      1    10 0.20
B.4       B      2    40 0.80

Is there an cleaner way of doing this simple task (other than writing a function for it which merely sweeps the ugliness into a script)?
(and for bonus points, is there a way of preventing rbind from adding row names like A.1 to the resulting data.frame?)

A: Another alternative:
df$frac <- df$sales / ave(df$sale, df$country, FUN = sum)
df
#  country outlet sales frac
#1       A      1   300 0.25
#2       A      2   900 0.75
#3       B      1    10 0.20
#4       B      2    40 0.80

A: Here is an easier way
x <- tapply(df$sales, df$country, sum) #total sales by country
df$frac <- df$sales/x[match(df$country, names(x), nomatch=-1)]
df

A: You can just add the new column directly to the data frame like so:
value <- # The code to calculate frac
df$frac <- value

I split it into two lines to make it more readable.
You can set deparse.level = 0 in the rbind call to have the function construct no labels.


text:
Q: Fundamental motivation for several complex variables I have 3 general abstract reasons to care about complex analysis in a single variable:

*

*The laplacian is, up to a constant multiple, the only isometry invariant PDO in the plane, and so it is abstractly very important.  Holomorphic functions are intimately related to harmonic functions, so holomorphic functions are important.

*Holomorphic mappings are conformal if they have nonvanishing derivatives

*Many results which are real variable in nature are most easily understood in the light of complex analysis (factorization of real polynomials, radius of convergence of real power series, etc)
I currently have no such justification for several complex variables.  The connection to harmonic functions mostly breaks down.  Conformality breaks down.  I have not seen applications to real variable phenomena.
Can anyone give me some insight into the big picture here?  Where do the phenomena studied in several complex variables (domains of holomorphy and their ilk) come up in the rest of mathematics?

A: So far, the motivations have been mostly of analytic flavor. Let me add an alien motivation.
Suppose you were an alien that only knows the complex number field $\mathbb{C}$ as a fundamental object (say, because it's Cauchy complete and algebraically closed) and considers $\mathbb{R}$ just as a minor object (much like we consider -say- the Eisenstein integers). And suppose you came up with the concept of increment and of derivative and then of differential: then, which Analysis would you study? And suppose you were able to imagine the notion of a manifold as a space with local coordinates in your favourite field: which geometry would you naturally study?
Of course, the answers are, respectively, "Complex Analysis" and "Holomorphic manifolds".
So, even if you're a Terrestrial, blinded by notions of linear order, isn't $\mathbb{C}$ a very fundamental object anyway? If so, then doing SCV and Complex Analytic Geometry is just doing the natural things with it.

A: If those are your reasons for caring about complex analysis, then I'm not sure to what extent I can convince you to care about SCV.
But here is why I like SCV: I like multivariable calculus, and I like complex numbers.  I've always wondered what would happen if you put the two together.  And apparently pretty wild things happen (compared with either the single-variable or real-variable case).
I'm also really interested in complex geometry.  The local theory of complex manifolds involves SCV.
One final comment: Your reason (1) for caring about holomorphic functions is in fact my reason for caring about harmonic functions (for which I would otherwise desire motivation).

A: To complement Alexandre's answer, there is an application of SCV in physics, in quantum field theory. One can prove that certain quantities ($n$-point functions $G(x_1,\ldots,x_n)$) appearing in (free) quantum field models are analytic in their $n$ $R^4$ arguments (while their Fourier transforms are essentially hyperfunctions). The analytic continuation into $n$ $\mathbb{C}^4$ arguments of the $n$-point functions and their Fourier transforms then allows one to prove some physically important results. For example, the proof of the spin-statistics theorem (fermions have half-integral spin, and bosons have integral spin) in the classic book of Streater & Wightman uses some results from SVC (Edge of the Wedge theorem and some analytic properties of Fourier transforms).

A: Siegel developed the theory of holomorphic functions of several complex variables in order to study hermitian symmetric spaces (especially the Siegel modular space).

A: On my opinion, there are two very general reasons why analytic functions are important.

*

*Solutions of many (almost all) important differential (and functional) equations are analytic.
For example,
all elementary and special functions arise in this way. Moreover, they are also usually
analytic functions of parameters.

*Harmonic analysis. Fourier (Laplace) transforms.
This includes generating functions as a special case.
They are in many cases analytic.
I think almost every occurence of analytic functions in mathematics and in real life can be traced
to one of these two general sources.
Both these fundamental motivations apply not only to analytic functions of one variable but to
analytic functions of several variables.
Historically, it seems that the first analytic functions of several variables that were studied
were Abelian functions, which occur in the inversion problem of Abelian integrals
(that is they occur as solutions of certain systems of differential equations). These differential
equations appear both in pure mathematics (inversion of Abelian integrals) and in physics
(integrable systems). They were studied long before the general theory of several complex
variables was developed.
Then comes the second source (already in XX century): Wiener-Paley theorem and its multi-dimensional
generalizations, Fourier analysis, which itself was developed as a method of solving PDE.
You specifically mention applications in algebraic geometry? Just open Griffiths Harris book!
And for applications in "real analysis", look at least at the table of contents of Hormander's
Linear differential operators!

A: The reason I care about functions with several complex variables is the resolvent formalism. To solve a problem in linear algebra, you translate it into a problem in complex analysis (with several variables) and allow tools like Cauchy's Theorem and the Argument Principle (for functions of a single complex variable) to chew it up. The nicest proof I know that a matrix has a Jordan normal form proceeds in this way, and is nicely explained HERE. I presented this proof in the introductory Complex Analysis course I have just finished teaching as an illustration of the power of complex analysis, never mind the number of variables!
The nicest thing about resolvents is that they work just as well when the dimension is infinite (studying operators on Hilbert spaces instead of plain old linear transformations on finite dimensional vector spaces). They are thus a basis for Fredholm Theory.

A: To say that $F$ is holomorphic is to say in a sense that it depends on only "half" of the variables $(\partial F/\partial\bar z_j=0)$. This is analogous to the wave functions of quantum mechanics depending only on $q$, i.e. only on "half" the phase space variables $(p,q)$. The analogy is made precise by the theory of polarizations in geometric quantization and the orbit method.
For instance, a reductive Lie group has some of its irreducible unitary representations attached to hyperbolic coadjoint orbits (consisting of matrices with real eigenvalues), others to elliptic orbits (consisting of matrices with imaginary eigenvalues). While the former admit real polarizations which lead to representations in $L^2$ sections over a space half the dimension (i.e., real analysis), the latter admit complex polarizations which lead to representations in holomorphic sections over the orbit (or Dolbeault cohomology thereof; i.e., complex analysis).
A classic example of the elliptic story is the Borel-Weil(-Bott) realization of all irreducible representations of compact Lie groups. This involves holomorphic functions on the complexified group in an essential way.


text:
Q: Deprecated: stripos(): Error in Wordpress After Updating to php 8.1 Showing this error msg after upgrading to php 8.1 in wordpress

Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /public_html/wp-includes/functions.wp-styles.php on line 90

Here is the function which i found in the functions.wp-styles.php
function wp_add_inline_style( $handle, $data ) {
    _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );

    if ( false !== stripos( $data, '</style>' ) ) {
        _doing_it_wrong(
            __FUNCTION__,
            sprintf(
                /* translators: 1: #is', '$1', $data ) );
    }

    return wp_styles()->add_inline_style( $handle, $data );
}

Here is the 90 number line inside this code which causes the error,
if ( false !== stripos( $data, '</style>' ) ) {
I upgraded to php 8.1 and then i got this error message, i want to solve this problem.

A: It means that $data is null and you cannot pass null to string methods since 8.1.
You should investigate why $data is null first, and fix that as this may be alluding you to a real issue.
However, if you're after a quick-fix you can just change:
if ( false !== stripos( $data, '</style>' ) ) {

to
if ( false !== stripos( $data ?? '', '</style>' ) ) {

This will ensure that a string is always provided as the first parameter, even if $data is null or unset.

A: This is a WordPress core problem. For best results use php 8.0 or earlier with WordPress, or turn off WP_DEBUG.
Your site works fine with deprecation notices, they are just a nuisance.
Avoid changing core code on your site if possible.
In the core team, work to eliminate php 8.x deprecation notices is ongoing. Read this.


text:
Q: A different Google Earth tour every 24 hours (unmanned) I have some code that generates a new KMZ file every 24 hours (each tour has many points and takes about 18 hours to complete). And I have a webpage with the Google Earth plugin which automatically loads and runs the tour (called latest.kmz).
Now I'm trying to set up an unmanned computer in the lobby with the browser (Chrome) pointing to my website. Every morning, e.g. at 8am I want the webpage to refresh and start the new tour.
Unfortunately, even though I overwrite the latest.kmz during the night, when the page refreshes (using http://...etc...">) it still continues to use the cached version of latest.kmz.
How can I force it to reload the latest version of the kmz from disk?

A: Force cache no-validation using content headers if you are not doing so already. This can be achieved by firing your KMZ file with the following header:
Cache-Control: max-age=0, must-revalidate

This will force the useragent to consider the file stale immediately, which means that on the next request, it will not use its cache. Check your current headers just in case, as you may have something in that header already - and adjust accordingly.

A: Two ways, you can simply append a time-stamp or random query string to the KMZ request url. This essentially makes each request for the data unique thus avoiding any caching issues.
For example, you could create the url to your KMZ and append a UNIX timestamp like so.
var kmz = "http://localhost/your.kmz?x=" + (new Date()).getTime();

Producing unique results like this.
http://localhost/your.kmz?x=1365635454757
http://localhost/your.kmz?x=1365635478881

The other way would be to load your KMZ file using networklinks (if you aren't doing so already) this way you can control exactly when to check for new data again avoiding caching issues. This way the page doesn't need to refresh at all - a simple network link in a kml file that points to your data would work by setting the refresh interval to the number of seconds until the file is reloaded.
Something like.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <NetworkLink>
    <name>your file</name>
    <flyToView>1</flyToView>
    <Link>
      <href>http://localhost/your.kmz</href>
      <refreshMode>onInterval</refreshMode>
      <refreshInterval>86400</refreshInterval><!-- 24 hours -->
    </Link>
  </NetworkLink>
</kml>


text:
Q: How to force variable to be public kotlin i have the following code:

@Entity
@Table(name = "`users`")
class User(
    var name: String,
    var avatar: ByteArray
) {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    var id: Long = -1

    fun getAvatarAsImage(): BufferedImage? {
        val img: InputStream = ByteArrayInputStream(avatar)
        return ImageIO.read(img)
    }

    fun setAvatarAsImage(img: BufferedImage) {
        val out = ByteArrayOutputStream()
        ImageIO.write(img, "PNG", out)
        avatar = out.toByteArray()
    }

}

but hibernate says that id is private (thats because kotlin auto-generating getters and setters),
so compiled to java it seems like:
@Id
@GeneratedValue(
   strategy = GenerationType.AUTO
)
private long id;

public long getId() {
   return this.id;
}

public void setId(long var1) {
   this.id = var1;
}

QUESTION: how to make it compiled like:
@Id
@GeneratedValue(
   strategy = GenerationType.AUTO
)
public long id;

???
idk what is this....

A: I'm not sure you have interpreted the error message from Hibernate properly, as the @Id-annotation seems correct. But I'm wondering if you perhaps forgot to use the kotlin-jpa compiler plugin that helps creating Hibernate-friendly classes?
Read more here: https://kotlinlang.org/docs/no-arg-plugin.html#jpa-support
Maybe you can try putting the annotations on the getter instead to force Hibernate to use property-based access... Try modifying the annotations to:
@get:Id
@get:GeneratedValue(strategy = GenerationType.AUTO)
var id: Long = -1

... or even worst case expose the field as public (as you are asking for) with...
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@JvmField
var id: Long = -1


text:
Q: Получения изображения из Яндекс диска Я создаю электронный каталог товаров на системе opencart. Картинок очень много, поэтому я загрузил все в каталог на яндекс диск. Теперь нужно на сайте вывести картинки продуктов прямо из яндекс диска. Я загружаю товары из .xls файла. В файле ссылка на картинку выглядит так:
image/product1.jpg

в opencart я изменил  /catalog/model/tool/image.php четвёртую строку так:
if (!file_exists(DIR_IMAGE . $filename) || !is_file(DIR_IMAGE . $filename)) {
return HTTP_IMAGE.$filename;
}

HTTP_IMAGE объявлено в config.php и admin/config.php:
define('HTTP_IMAGE', 'https://yadi.sk/d/LgdasdGasdfLC/');

HTTP_IMAGE.$filename возвращает:
https://yadi.sk/d/LgdasdGasdfLC/image/product1.jpg

но картинка на сайте не открывается. Как мне правильно загрузить картинки прямо из яндекс диска?

A: По хорошему никак. Картинки из кэша берутся, а туда они из оригинала изображения под разные размеры конвертируются. На сайт выводится не оригинал image.jpg, а измененное изображение image-150x150, например.

A: Я использую этот SDK для PHP, там работает вот такой кусок для получения изображения:
$resource = $disk->getResource(DIR_IMAGE . $filename);
$link = $resource->getLink();


text:
Q: SQL Injection prevention with dynamic SQL ALTER USER query Is this good way to prevent sql injection in dynamic sql alter user query:
BEGIN
    z_ident :=  DBMS_ASSERT.ENQUOTE_NAME(ident);
    z_pass := DBMS_ASSERT.ENQUOTE_NAME(password);
    z_sql := 'alter user ' || z_ident || ' identified by ' || z_pass;
    EXECUTE IMMEDIATE z_sql;
END;

Because, sometimes you have function to generate random password with " character, and when you do:
SELECT DBMS_ASSERT.ENQUOTE_NAME('"asd') FROM DUAL;

You get an ORA-06512 / ORA-06502 exception.

A: You shouldn't try to prevent SQL injection only on database level. Once they got there, they mostly already got you. You should use parameters, mask input and remove bad characters already in the layer above. Tools(Frameworks?) like Entity Framework automatically remove dangerous characters.
Using DBMS_ASSERT.ENQUOTE_NAME is doing very well here, but I'd recommend doing this as well in the layers above.
General rule (that you follow here):
Use security mechanisms that are established and proven, don't reinvent them!
Moreover, a statement like
select * from users where username = 'IAm"WayUp';

is absolutely legal and not dangerous.
And how do you call the function/procedure in the DB? You're vulverable there as well, aren't you?.


text:
Q: How to pass parameter from spec to reporter in Jasmine? I am writing a jasmine reporter, and I want to be able to pass parameters from individual specs to the reporter. For example:
the spec:
// I prefer this way
it("my spec 1", function() { ... }, { myParam: true });

// But this way would also be fine if it can work
it("my spec 2", function() {
    this.myParam = true;
    ...
});

the reporter:
this.specDone = function(specResult) {
   var myParam = // some way to access myParam
   ...
}

I haven't found any documentation for something like this, nor any example of something similar in other reporters.
I also tried debugging the flow of jasmine to see what objects get passed to each method but so far I had no luck in finding a simple solution.
How can this be done?

A: I found one possible solution - in boot.js
var jasmineInterface = {
    it: function(desc, func, properties) {
      var spec = env.it(desc, func);
      spec.result.myParam = (properties || {}).myParam;
      return spec;
    },
...

and then in the reporter:
this.specDone = function(specResult) {
   var myParam = specResult.myParam;
   ...
}

of course you can (and should) make this more generic to fit other cases.


text:
Q: TFS 2017/2018 Kanban board share and add parent link to cards Found issues online but no solutions yet, and uservoice is down. I have two questions:

*

*Is there a way to make a kanban board template and be able to use that in other projects? Ex. a team wants to create an additional project but wants all of their customization changes to be added to the new project (like board columns and rules).

*When looking at the user story portfolio backlog kanban board, is there a way to add the parent link to each card?
Thanks

A:
Q1:

Unfortunately, for now there isn't such a feature in VSTS/TFS to share Kanban template across teams in a project.
There's already an user voice submitted to suggest the feature: share kanban format across teams, you can vote it and follow up there.

Q2:

No, you cannot add the parent link to each card/wit, you can only open the specific work item (user story here) and add parent link manually.


text:
Q: What is a set of generators for $PSL(2,p)$ for $p$ prime? What is a set of generators for $PSL(2,p)$ when $p$ is prime, in particular when $p$ is a Mersenne prime? I know that for $p=7=2^3-1$, we can view $PSL(2,7)$ as the group of linear fractional transformations and the generators are $k\mapsto -1/k$, $k\mapsto k+1$, and $k\mapsto 2k$. This works because the quadratic residues modulo 7 are powers of 2, $\{1,2,4\}$. How does this generalize, for example to $p=31$?

A: Any $SL(2,p)$ is a quotient of $SL(2,\mathbb{Z})$ under obvious coefficient reduction. (While it seems "obvious", this is a theorem and not entirely trivial. It also holds for larger dimensions.)
This means that for any prime $p$ you can just take the two generators $k\mapsto -1/k$ and $k\mapsto k+1$ for $PSL(2,p)$, regardless of quadratic residues.


text:
Q: Firebase Analytics Setting User Property Multiple Times In my app, I want to track the users based on business name. To track this, I'm setting value every time the user starts the app.
FirebaseAnalytics.getInstance(this).setUserProperty(Global.FIREBASE_ANALYTICS_BIZ, loginSP.getString(Global.BIZ_NM, ""));

*

*Is this is the correct way to do it? Or, can I do this only once when they logged in?

*If I set this only once when they logged in, can I see the users in active users list if they are active.

*Is the setting of user property is persisted across app restarts?

A: User properties are designed for values that only change rarely, if at all, so they are well suited for your purpose.  The value of a user property persists and is reported with every bundle of events, across multiple runs of the app, reboots of the phone, etc.  Uninstalling the app will erase user property values.
1. You only need to set the value the first time the user starts the app, and whenever the value changes.
2. You do not need to set a user property or log a custom event for an active user to be counted.  If the user runs the app they will be counted.
3. Yes.


text:
Q: Generate a key in PHP for AES 256 How can I securely generate a key suitable for hashing data with AES 256 using PHP?
I've tried Googling and found plenty of information about how to encrypt data using AES 256 using PHP, however all of these examples used existing pre-generated keys, wheras I need to generate the key in PHP.

A: The openssl-pkey-new() function is exactly what you are looking for.
As for the IV, you can look at How to securely generate an IV for AES CBC Encryption? which recommends using openssl-random-pseudo-bytes
But if you are really looking for a helpful page, Google "Implement AES in PHP" - as the first hit you will find http://www.movable-type.co.uk/scripts/aes-php.html which surely will teach you everything you need to know...

A: As of php7 you can use random_bytes() function to generate cryptographically secure pseudo-random bytes.
The sources of randomness used for this function are as follows:

*

*On Windows, » CryptGenRandom() will always be used.

*On Linux, the » getrandom(2) syscall will be used if available.

*On other platforms, /dev/urandom will be used.

*If none of the aforementioned sources are available, then an
Exception will be thrown

see the php manual for more info

A: If you don't want to rely on a library, you can use this function on Linux/Unix machines. It is identical to openssl-random-pseudo-bytes:
<?php
$key_size = 256;  //For a 256 bit key, you can use 128 or 512 as well.
$key = uuid_gen(($key_size / 8)); //8 bits in a byte

echo 'key length is ' .strlen($key) ."\n"; //The number of bytes

/* Returns Raw Binary */
function uuid_gen($length) {

    $fp = @fopen('/dev/urandom','rb');

    if ($fp !== FALSE) {
        $result .= @fread($fp, $length);
        @fclose($fp);
    } else {
        trigger_error('Can not open /dev/urandom.');
    }

    return $result;
}


text:
Q: Make Array accessible from multiple functions (javascript)? I'm trying to make a basic login/password array feature to work with my html/css files. I am used to java - making the array public by declaring it outside the functions but I'm not sure if thats correct. I can't seem to find what's going wrong with my code, any help would be much appreciated!
JavaScript:
var count = 2;
var unArray = ["Philip", "George", "Sarah", "Michael"];
var pwArray = ["Password1", "Password2", "Password3", "Password4"];

function validate() {
    var un = document.myform.username.value;
    var pw = document.myform.pword.value;
    var valid = false;

    for (var i=0; i <unArray.length; i++) {
        if ((un == unArray[i]) && (pw == pwArray[i])) {
            valid = true;
            break;
        }
    }

    if (valid) {
        alert ("Login was successful");
        window.location = "http://www.google.com";
        return false;
    }

    var t = " tries";
    if (count == 1) {
        t = " try";
    }

    if (count >= 1) {
        alert ("Invalid username and/or password.  You have " + count + t + " left.");
        document.myform.username.value = "";
        document.myform.pword.value = "";
        setTimeout("document.myform.username.focus()", 25);
        setTimeout("document.myform.username.select()", 25);
        count --;
    } else {
        alert ("Still incorrect! You have no more tries left!");
        document.myform.username.value = "No more tries allowed!";
        document.myform.pword.value = "";
        document.myform.username.disabled = true;
        document.myform.pword.disabled = true;
        return false;
    }

}

function addMember(){
    var newun = document.signup_form.new_username.value;
    var newpw = document.signup_form.new_pword.value;
    var valid=true;

    for (var i=0; i <unArray.length; i++) {
        if (newun == unArray[i]) {
            valid = false;
            break;
        }
    }

    if(valid){
        unArray.push("newun"");
        pwArray.push("newpw");
        alert ("Signup was successful");
        return false;
    } else {
        alert ("Username Taken");
        return false;
    }
}
}

html:
<!doctype html>

    <meta charset="utf-8" />
    <title>AI Blog</title>
    <link rel="stylesheet" href="LoginPage.css">

                <button id="Home" onclick="location.href= 'AIWebsite.html';" style="border:none" ;> HOME </button>
                <button id="RecentNews" onclick="location.href= 'RecentNewsPage.html'" style="border:none;">RECENT NEWS</button>
                <button id="R&D" onclick="location.href= 'ResearchPage.html';" style="border:none;">RESEARCH & DEVELOPMENT</button>
                <button id="Timeline" onclick="location.href= 'TimelinePage.html'" style="border:none;">TIMELINE</button>
                <button id="Ethics" onclick="location.href= 'EthicsPage.html'" style="border:none;">ETHICS</button>
                <button id="Journals" onclick="location.href= 'JournalsPage.html'" style="border:none;">JOURNALS</button>
                <button id="Login" onclick="location.href= 'LoginPage.html'" style="border:none;">LOGIN</button>

        <form name="myform">

                    ENTER USER NAME <input type="text" name="username"> ENTER PASSWORD <input type="password" name="pword">
                    <input type="button" value="Log in" name="Submit" onclick="validate()">

        </form>

 Or Sign Up

        <form name="signup_form">

                    Enter User Name <input type="text" name="new_username"> Enter Password <input type="password" name="new_pword">
                    <input type="button" value="Sign Up" name="Sign_up" onclick="addMember()">

        </form>

css:
*{
    margin:0px;
    padding:0px;
}
header, section, footer, aside, nav, article, hgroup{
    display:block;
}
body{
    width:100%;
    display:-webkit-box;
    -webkit-box-orient: vertical;
    -webkit-box-flex: 1;
    background: blue;
    background-size: 100%;
}
#container{
    text-align:center;
    padding-bottom: 30px;
}
#top_menu button{
    display:inline-block;
    font: 18px Neue Helvetica;
    padding-top: 30px;
    margin-left:10px;
    margin-right:10px;
    color:#D0D0D0;
    background:none;
    cursor:pointer;
}
#Login{
    float:right;
}
#login_area{
    clear:both;
    text-align:center;
    margin-top: 100px;
}
#signup_area{
    clear:both;
    text-align:center;
    margin-top: 100px;
}
h2{
    margin-top: 150px;
}
button:focus {outline:0;}


text:
Q: Discord.py cant load cogs i tried to link the cogs in my main.py. But it always give an error.
We also Check if some package are missing but it dont.
The bot start without the listdir but after we try to link it it doesnt work.
we also write:
class Help(commands.Cog):
def init(self, client):
self.client = client
Into the whole py's. But still not working.
import discord
import os
import sys
import asyncio
import importlab
import importlib
from discord.ext import commands

TOKEN = "Tokeninhere"

client = commands.Bot(command_prefix ="!")
PREFIX = "!"

@client.event
async def on_ready():
    print('Bot is ready')
    activity = discord.Activity(type=discord.ActivityType.listening, name=F"{PREFIX}help")
    await client.change_presence(status=discord.Status.idle, activity=activity)

for filename in os.listdir('./Cog'):
    if filename.endswith('.py'):
        client.load_extension(f'./Cog/{filename[:-3]}')

client.run(TOKEN)

The Error that pops up:
Traceback (most recent call last):
Traceback (most recent call last):
  File "main.py", line 23, in <module>
    client.load_extension(f'./Cog/{filename[:-3]}')
  File "/home/runner/Tijon-Bot-Main/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 670, in load_extension
    name = self._resolve_name(name, package)
  File "/home/runner/Tijon-Bot-Main/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 629, in _resolve_name
    return importlib.util.resolve_name(name, package)
  File "/nix/store/p21fdyxqb3yqflpim7g8s1mymgpnqiv7-python3-3.8.12/lib/python3.8/importlib/util.py", line 32, in resolve_name
    raise ValueError(f'no package specified for {repr(name)} '
ValueError: no package specified for './Cog/mods' (required for relative module names)


Thanks for help!

A: Try this:
 client.load_extension(f'Cog.{filename[:-3]}')

And make sure you have a setup function in your cog.
def setup(bot):
    client.add_cog(Help(bot))


text:
Q: Azure cloud service app (web role) goes down for ~10 mins occasionally due to Windows Updates? How can I schedule them? It seems to happen every couple months or so and while it auto-recovers on its own usually within ~10 minutes I'd still like to find out how to change the Windows Update schedule since it frequently occurs during business hours.
We have several web apps in various Azure subscriptions, and they all behave this way.  Once we get a notification that one goes down, the others usually go down over the next few days/week.
I used remote desktop to view the Event Viewer for the web role and see the following (this down time took place between 9:48am and 10:02am on the east coast, so definitely not ideal):
8/6/2020 1:48:15 PM - "Automatic Updates is now paused."
Followed by several services stopping, and then:
8/6/2020 1:52:53 PM - "The process C:\43..61\Setup.exe (RD..33) has initiated the restart of computer RD..3 on behalf of user NT AUTHORITY\SYSTEM for the following reason: Other (Planned)
Reason Code: 0x80000000
Shutdown Type: restart
Comment: "
8/6/2020 1:52:53 PM - "Automatic Updates is now resumed."
8/6/2020 1:53:10 PM - "The operating system is shutting down at system time 2020-08-06T13:53:10.614704600Z."
8/6/2020 1:53:12 PM - The operating system started at system time 2020-08-06T13:53:12.487679900Z.
Obviously it takes a while for everything to come back up, and I finally get notified that the site is back up about 9 minutes later.
Is there a way to specify when the Windows Updates should take place?

A: I can tell you clearly that it is not possible to schedule windows updates.
The windows update in this cloud services is about once a month. The time is not fixed. There is no way to control this.
Azure Guest OS releases and SDK compatibility matrix
solution:
We can create 2 webroles so that we can solve the situation that the program is closed due to windows update.
principle:
Create 2 webroles to load balance the server pressure. When the windows is updated, it will not be updated at the same time, but a planned instance update ends, and the next instance update is performed.
In this way, as long as you create >=2 webrols, there will be 2 instances, so that the program can guarantee that it will not stop due to updates.


text:
Q: how to display array data in in acceding order on date wise in react-native // I am trying to display array value in acceding order date wise .
like "rechargeHistoryDetails"[] it contains 4 value each value has chargeDate ,what I am trying to achieve that,vale with recent date should come first on screen and then next and so on .. I tried sort() function but its not working here . I have to display data in below 4 date format , value with "2017-01-14" should come top on the list and then "2015-11-14" and then next ..
Please suggest how I can do taht .
1.2017-01-14
2.2015-11-14
3.2015-02-14
4.2014-08-13

 const {customer,rechargeDeatails} = this.props;

   rechargeHistoryDetails: Array(4)
    0:
    balance: 100
    chargeDate: "2014-08-13T14:16:23.000+01:00"
    serialNumber: 2627423951927890
    __typename: "RechargeHistoryDetails"

    1:
    balance: 5006
    chargeDate: "2015-02-14T22:48:53.000+01:00"
    serialNumber: 1696013838876544
    __typename: "RechargeHistoryDetails"

    2:
    balance: 5002
    chargeDate: "2017-01-14T22:48:53.000+01:00"
    serialNumber: 1696013838876548
    __typename: "RechargeHistoryDetails"

    3:
    balance: 5000
    chargeDate: "2015-11-14T22:48:53.000+01:00"
    serialNumber: 1696013838876550
    __typename: "RechargeHistoryDetails"

          {
              rechargeDeatails.rechargeHistoryDetails.map(
                ({balance,cardType,chargeDate,serialNumber},index)=>{
                return (
                <View style={{marginBottom: 10}} key={index}>
                    <Card>
                    <CardItem header style={{backgroundColor: '#fff', width: '100%', justifyContent: 'space-between', borderBottomColor: '#f1f1f1', borderBottomWidth: 1}}>
                      <View style={{flexDirection:'column',justifyContent: 'space-between'}}>
                        <View>
                          <RegularText text={`₦ ${balance}`} style={{ fontWeight: 'bold' }}/>
                          <SmallText text={`Recharged on ${formatDateTime(chargeDate)}`} textColor="grey"/>
                        </View>
                      </View>

                    </CardItem>
                      <CardItem>
                        <Body>
                          <View style={{flexDirection:'row', width: '100%',justifyContent: 'space-between',}}>
                            <View style={{ flexDirection:'row', flexWrap: 'wrap',alignItems: "flex-start"}}>
                                <View>
                                    <SmallText  text="Serial#" textColor="grey"/>
                                    <Text style={{ fontWeight: 'bold', fontSize:12 }}>{serialNumber}</Text>
                                </View>
                            </View>
                            <View style={{ flexDirection:'row', flexWrap: 'wrap',alignItems: "flex-start"}}>
                              <View>
                                <SmallText  text="Channel" textColor="grey"/>
                                <Text style={{ fontWeight: 'bold', fontSize:12 }}>Voucher</Text>
                              </View>
                            </View>

                          </View>
                        </Body>
                      </CardItem>
                    </Card>
                  </View>
                );
              })
            }

// Thanks

A: forget about above thing ,just modify below ,
     import _ from 'lodash';
   _.sortBy(rechargeDeatails.rechargeHistoryDetails, ["chargeDate"]).reverse().map(

A: what function is the sort in? if it's not in render() then that is your problem

A: @Abhigyan Gaurav
try like below code
sortdatalist = (data) =>  {
        return data.sort((a, b) => {
            let result = null;
            if (a.userprio != null) {
                var dateA = new Date(a.chargeDate).getTime();
                var dateB = new Date(b.chargeDate).getTime();
            }
            result = dateA < dateB ? 1 : -1;
            return result;
        });
    }

let sortedData = this.sortdatalist(rechargeHistoryDetails)

thanks


text:
Q: Azure Partner Center VM from shared image gallery not available in any region I have trouble configuring my VM offer in the partner center. I have a shared image gallery with an image definion and version in it.
I provided it as a source for my vm offer.I selected all regions in plan overview > pricing and availability > marktes.
All tests pass and I want to crate a VM from the offer I created. But then the azure portal notifies me, that this vm offer is not available in my region.
How can this be? Do I have to configure the regions anywhere else?
Thank you in advance!

A: The underlying problem was a discrepancy in the naming.
There are some characters that cannot be used, but the wizard did not prohibit them from being entered. Hence the image could not be found.


text:
Q: MongoDB shell version error (Server has startup warnings) I installed MongoDB under Ubuntu server and when inter to MongoDB shell i got this error and warnings.
MongoDB shell version: 2.4.7
connecting to: test
Server has startup warnings:
Sun Oct 27 09:58:39.360 [initandlisten]
Sun Oct 27 09:58:39.360 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Sun Oct 27 09:58:39.360 [initandlisten] **       32 bit builds are limited to less than 2GB of data (or less with --journal).
Sun Oct 27 09:58:39.360 [initandlisten] **       Note that journaling defaults to off for 32 bit and is currently off.
Sun Oct 27 09:58:39.360 [initandlisten] **       See http://dochub.mongodb.org/core/32bit
Sun Oct 27 09:58:39.360 [initandlisten]

how I hide this warnings
Thanks

A: I don't believe there is a way to suppress only that warning, but you can always start your mongod instance with the --quiet flag.

--quiet Runs the mongod instance in a quiet mode that attempts to limit the amount of output. This option suppresses:

*

*output from database commands, including drop, dropIndexes,

*diagLogging, validate, and clean. replication activity. connection

*accepted events. connection closed events.

Reference - http://docs.mongodb.org/manual/reference/program/mongod/#cmdoption--quiet

So when you use this flag, you are actually disabling quite a lot of useful information. As you can see from the content of the warning, using the 32bit version will seriously limit the amount of data you will be able to store. I think you should consider upgrading to the 64bit version.


text:
Q: What does AND operator do when operated between two objects in C++? In OpenCV CamShift implementation there is a line ( just before the switch statement in onMouse() function in the code below ) of code which goes like this ,
selection &= Rect(0, 0, image.cols, image.rows);

where, selection is a Rect datatype of user defined dimensions ( selected by mouse callback ) and image is a frame from a video. The dimensions of selection and image do not match. What I don't understand is what is the purpose of this &= operator. I commented out this line of code and I couldn't figure out any difference. The code compilers just fine. I am not sure about what goes on inside when two objects are AND-ed. I could not find any resource that addresses this particular issue.
This is the original code:
#include "opencv2/video/tracking.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"

#include <iostream>
#include <ctype.h>

using namespace cv;
using namespace std;

Mat image;

bool backprojMode = false;
bool selectObject = false;
int trackObject = 0;
bool showHist = true;
Point origin;
Rect selection;
int vmin = 10, vmax = 256, smin = 30;

static void onMouse( int event, int x, int y, int, void* )
{
    if( selectObject )
    {
        selection.x = MIN(x, origin.x);
        selection.y = MIN(y, origin.y);
        selection.width = std::abs(x - origin.x);
        selection.height = std::abs(y - origin.y);

        selection &= Rect(0, 0, image.cols, image.rows);
    }

    switch( event )
    {
    case CV_EVENT_LBUTTONDOWN:
        origin = Point(x,y);
        selection = Rect(x,y,0,0);
        selectObject = true;
        break;
    case CV_EVENT_LBUTTONUP:
        selectObject = false;
        if( selection.width > 0 && selection.height > 0 )
            trackObject = -1;
        break;
    }
}

static void help()
{
    cout << "\nThis is a demo that shows mean-shift based tracking\n"
            "You select a color objects such as your face and it tracks it.\n"
            "This reads from video camera (0 by default, or the camera number the user enters\n"
            "Usage: \n"
            "   ./camshiftdemo [camera number]\n";

    cout << "\n\nHot keys: \n"
            "\tESC - quit the program\n"
            "\tc - stop the tracking\n"
            "\tb - switch to/from backprojection view\n"
            "\th - show/hide object histogram\n"
            "\tp - pause video\n"
            "To initialize tracking, select the object with mouse\n";
}

const char* keys =
{
    "{1|  | 0 | camera number}"
};

int main( int argc, const char* argv[] )
{
    help();

    VideoCapture cap;
    Rect trackWindow;
    int hsize = 16;
    float hranges[] = {0,180};
    const float* phranges = hranges;
    CommandLineParser parser(argc, argv, keys);
    int camNum = parser.get<int>("1");

    cap.open(argv[1]);

   /* if( !cap.isOpened() )
    {
        help();
        cout << "***Could not initialize capturing...***\n";
        cout << "Current parameter's value: \n";
        parser.printParams();
        return -1;
    }*/

    namedWindow( "Histogram", 0 );
    namedWindow( "CamShift Demo", 0 );
    namedWindow( "ROI", 0 );
    setMouseCallback( "CamShift Demo", onMouse, 0 );
    createTrackbar( "Vmin", "CamShift Demo", &vmin, 256, 0 );
    createTrackbar( "Vmax", "CamShift Demo", &vmax, 256, 0 );
    createTrackbar( "Smin", "CamShift Demo", &smin, 256, 0 );

    Mat frame, hsv, hue, mask, hist, histimg = Mat::zeros(200, 320, CV_8UC3), backproj;
    bool paused = false;

    for(;;)
    {
        if( !paused )
        {
            cap >> frame;
            if( frame.empty() )
                break;
        }

        frame.copyTo(image);

        if( !paused )
        {
            cvtColor(image, hsv, COLOR_BGR2HSV);

            if( trackObject )
            {
                int _vmin = vmin, _vmax = vmax;

                inRange(hsv, Scalar(0, smin, MIN(_vmin,_vmax)),
                        Scalar(180, 256, MAX(_vmin, _vmax)), mask);
                int ch[] = {0, 0};
                hue.create(hsv.size(), hsv.depth());
                mixChannels(&hsv, 1, &hue, 1, ch, 1);

                if( trackObject < 0 )
                {
                    Mat roi(hue, selection), maskroi(mask, selection);
                    calcHist(&roi, 1, 0, maskroi, hist, 1, &hsize, &phranges);
                    normalize(hist, hist, 0, 255, CV_MINMAX);

                    trackWindow = selection;
                    trackObject = 1;

                    histimg = Scalar::all(0);
                    int binW = histimg.cols / hsize;
                    Mat buf(1, hsize, CV_8UC3);
                    for( int i = 0; i < hsize; i++ )
                        buf.at<Vec3b>(i) = Vec3b(saturate_cast<uchar>(i*180./hsize), 255, 255);
                    cvtColor(buf, buf, CV_HSV2BGR);

                    for( int i = 0; i < hsize; i++ )
                    {
                        int val = saturate_cast<int>(hist.at<float>(i)*histimg.rows/255);
                        rectangle( histimg, Point(i*binW,histimg.rows),
                                   Point((i+1)*binW,histimg.rows - val),
                                   Scalar(buf.at<Vec3b>(i)), -1, 8 );
                    }
                imshow("ROI",roi);
                }

                calcBackProject(&hue, 1, 0, hist, backproj, &phranges);
                backproj &= mask;
                RotatedRect trackBox = CamShift(backproj, trackWindow,
                                    TermCriteria( CV_TERMCRIT_EPS | CV_TERMCRIT_ITER, 10, 1 ));
                cout<<trackWindow.x<<"    "<<trackWindow.y<<endl;
                if( trackWindow.area() <= 1 )
                {
                    int cols = backproj.cols, rows = backproj.rows, r = (MIN(cols, rows) + 5)/6;
                    trackWindow = Rect(trackWindow.x - r, trackWindow.y - r,
                                       trackWindow.x + r, trackWindow.y + r) &
                                  Rect(0, 0, cols, rows);
                }

                if( backprojMode )
                    cvtColor( backproj, image, COLOR_GRAY2BGR );
                ellipse( image, trackBox, Scalar(0,0,255), 3, CV_AA );
            }
        }
        else if( trackObject < 0 )
            paused = false;

        if( selectObject && selection.width > 0 && selection.height > 0 )
        {
            Mat roi(image, selection);
            bitwise_not(roi, roi);
        }

        imshow( "CamShift Demo", image );
        //imshow( "Histogram", histimg );

        char c = (char)waitKey(50);
        if( c == 27 )
            break;
        switch(c)
        {
        case 'b':
            backprojMode = !backprojMode;
            break;
        case 'c':
            trackObject = 0;
            histimg = Scalar::all(0);
            break;
        case 'h':
            showHist = !showHist;
            if( !showHist )
                destroyWindow( "Histogram" );
            else
                namedWindow( "Histogram", 1 );
            break;
        case 'p':
            paused = !paused;
            break;
        default:
            int a=1;
            //continue;

        }

    }

    return 0;
}

Any comments or suggestions will be appreciated.

A: The &-operator of two Rect objects results in a new Rect object, which is their intersection. Here they intersect the selection with the entire image-frame. I suspect that this is merely a precaution, done so that selection does not accidentally exceed the boundaries of the image.

A: the & and | operators are overloaded for cv::Rect, & is the intersection, | the union of 2 Rects,
see for yourself:
Rect a(2,2,5,5);
Rect b(4,4,5,5);

Rect c = a & b;
Rect d = a | b;

cerr << a << endl << b << endl << c << endl << d << endl ;

[5 x 5 from (2, 2)]
[5 x 5 from (4, 4)]
[3 x 3 from (4, 4)] // intersection
[7 x 7 from (2, 2)] // union

in you code example above,
selection &= Rect(0, 0, image.cols, image.rows);

'selection' gets cropped to the valid image borders


text:
Q: Need Assistance for this Htaccess Rewrite Rule I have a problem with my .htaccess, a short explanation I would like to set http://example.com/newest on my website. However, it always redirects to http://example.com/postname. Where I just need the exact "newest" page. Here is my code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteBase /
RewriteRule ^[^/]+$ %{REQUEST_URI}/ [L,R=301]
RewriteRule ^/category/(.*)$ page.php?f=$1
RewriteRule ^/search/(.*)$ search.php?f=$1
RewriteRule ^(.*)/$ post.php?f=$1 <- If this is removed, my post htaccess will not work
RewriteRule ^newest/$ index.php?f=newest <- I want to execute this code

I really don't know what this is called, I have been looking for the whole stackoverflow but I did not get any answer. Please remain me if this is a duplicate question.

A: As Mohammed implied in comments, your directives are in the wrong order. The line above your "newest" rewrite is a catch-all and rewrites all requests, so the last line will never match.

http://example.com/newest

Note that your rules imply that your URLs should end in a trailing slash. So, you should be linking to http://example.com/newest/ (with a trailing slash), not http://example.com/newest, otherwise your users will get a lot of unnecessary redirects.
However, you appear to be under the belief that the RewriteCond directive applies to all the directives that follow. This is not the case. It only applies to the first RewriteCond directive. You also need some L flags to prevent further processing.
You also have a slash prefix on the "category" and "search" rewrite patterns, so these would never match in a .htaccess context.
Try something like the following instead:
RewriteEngine On
RewriteBase /

# Don't process the request further if it maps to an existing file
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

# Append trailing if omitted
# Although strictly speaking this only redirects if there are no slashes at all in the URL
RewriteRule ^[^/]+$ %{REQUEST_URI}/ [L,R=301]

RewriteRule ^category/(.*)$ page.php?f=$1 [L]
RewriteRule ^search/(.*)$ search.php?f=$1 [L]
RewriteRule ^newest/$ index.php?f=newest [L]
RewriteRule ^(.*)/$ post.php?f=$1 [L]


text:
Q: CFG to define a language I need to generate a context free grammar for this language L= { a^i b^j c^k | i, j, k ≥ 0 , i = j or i = k }
what I already have is
S : aSc | T | abS
T : bT | cT | ԑ
Do you guys think that the above grammar can correctly define the language? if not, is there any better suggestion?

A: No, that grammar does not correctly define the language. It accepts "bc", for instance.