问:
sort property list according to inheritance
I have certain classes that all inherit from other classes. Each class, only inherits from one other class, never two classes.
I've also got a Base-Class that is the "top" of my inheritance tree.
Classes are for example:

```<code>public class IfcAlignment : IfcLinearPositioningElement
{
    public IfcAlignmentTypeEnum PredefinedType {get; set;}
}
public class IfcLinearPositioningElement : IfcProduct
{
   public IfcCurve Axis {get; set;}
}
public class IfcProduct : IfcObject
{
   public IfcObjectPlacement ObjectPlacement {get; set;}
   public IfcProductRepresentation Representation {get; set;}
}
public class IfcObject: IfcRoot
{
   IfcLabel ObjectType {get; set;}
}
public class IfcRoot : IfcBase
{
   public IfcGloballyUniqueId GlobalId {get; set;}
   public IfcOwnerHistory OwnerHistory {get; set;}
   public IfcLabel Name {get; set;}
   public IfcText Description {get; set;}
}
public abstract class IfcBase
{
   public int _ID {get; set;}
}
</code>```

This is one set of inheritance within my structure. When I now call the properties of IfcAlignment and loop through them, I get them in this order:

PredefinedType

Axis

ObjectPlacement

Representation

ObjectType

GlobalId

OwnerHistory

Name

Description

_ID

However I need these properties in the order "top-to-bottom" so:

_ID

GlobalId

OwnerHistory

Name

Description

ObjectType

ObjectPlacement

Representation

Axis

PredefinedType

Therfore I wanted to implement a method in every class, that you can call and that would sort the properties in the correct order. the method looks like this so far:

```<code>        override public List<PropertyInfo> SortMyProperties(object entity)
        {
            List<PropertyInfo> returnValue = new List<PropertyInfo>();
            if (entity is IfcBase && !entity.GetType().Name.Contains("IfcBase"))
            {
                //Here I need to get the actual parent object:
                // I tried the following, which did no work unfortunately:
                // var parent = entity.GetType().BaseType;

                PropertyInfo propInfo = parent.SortMyProperties(parent);

                //get my own properties:
                Type type = entity.GetType();
                var genuineProps = typeof(/*type of the current class*/).GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
                foreach (var prop in genuineProps)
                {
                    returnValue.Add(prop);
                }
                return returnValue;
            }
            else
            {
                var properties = this.GetType().GetProperties();
                foreach (var prop in properties)
                {
                    returnValue.Add(prop);
                }
                return returnValue;
            }
        }
</code>```

Does anyone have an idea how to access the parent oject and not just the parent type, which I'm doing in my current code? Are any other suggestions how to solve the problem?

答:
Can you try this. This will be the better solution to achieve your requirement</p>

```<code>            var type = typeof(IfcAlignment);
            List<string> PropertyNames= new List<string>();
            while(type!=null)
            {
                  var properties = type.GetProperties().Where(x => x.DeclaringType == type).Select(x=>x.Name).Reverse().ToList();
                  foreach(string name in properties)
                  {
                       PropertyNames.Add(name);
                  }
                type = type.BaseType;

            }
            PropertyNames.Reverse();
</code>```

Body:
I have certain classes that all inherit from other classes. Each class, only inherits from one other class, never two classes.
I've also got a Base-Class that is the "top" of my inheritance tree.
Classes are for example:

public class IfcAlignment : IfcLinearPositioningElement
{
    public IfcAlignmentTypeEnum PredefinedType {get; set;}
}
public class IfcLinearPositioningElement : IfcProduct
{
   public IfcCurve Axis {get; set;}
}
public class IfcProduct : IfcObject
{
   public IfcObjectPlacement ObjectPlacement {get; set;}
   public IfcProductRepresentation Representation {get; set;}
}
public class IfcObject: IfcRoot
{
   IfcLabel ObjectType {get; set;}
}
public class IfcRoot : IfcBase
{
   public IfcGloballyUniqueId GlobalId {get; set;}
   public IfcOwnerHistory OwnerHistory {get; set;}
   public IfcLabel Name {get; set;}
   public IfcText Description {get; set;}
}
public abstract class IfcBase
{
   public int _ID {get; set;}
}

This is one set of inheritance within my structure. When I now call the properties of IfcAlignment and loop through them, I get them in this order:

PredefinedType

Axis

ObjectPlacement

Representation

ObjectType

GlobalId

OwnerHistory

Name

Description

_ID

However I need these properties in the order "top-to-bottom" so:

_ID

GlobalId

OwnerHistory

Name

Description

ObjectType

ObjectPlacement

Representation

Axis

PredefinedType

Therfore I wanted to implement a method in every class, that you can call and that would sort the properties in the correct order. the method looks like this so far:

        override public List<PropertyInfo> SortMyProperties(object entity)
        {
            List<PropertyInfo> returnValue = new List<PropertyInfo>();
            if (entity is IfcBase && !entity.GetType().Name.Contains("IfcBase"))
            {
                //Here I need to get the actual parent object:
                // I tried the following, which did no work unfortunately:
                // var parent = entity.GetType().BaseType;

                PropertyInfo propInfo = parent.SortMyProperties(parent);

                //get my own properties:
                Type type = entity.GetType();
                var genuineProps = typeof(/*type of the current class*/).GetProperties(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
                foreach (var prop in genuineProps)
                {
                    returnValue.Add(prop);
                }
                return returnValue;
            }
            else
            {
                var properties = this.GetType().GetProperties();
                foreach (var prop in properties)
                {
                    returnValue.Add(prop);
                }
                return returnValue;
            }
        }

Does anyone have an idea how to access the parent oject and not just the parent type, which I'm doing in my current code? Are any other suggestions how to solve the problem?

Body:
Can you try this. This will be the better solution to achieve your requirement

            var type = typeof(IfcAlignment);
            List<string> PropertyNames= new List<string>();
            while(type!=null)
            {
                  var properties = type.GetProperties().Where(x => x.DeclaringType == type).Select(x=>x.Name).Reverse().ToList();
                  foreach(string name in properties)
                  {
                       PropertyNames.Add(name);
                  }
                type = type.BaseType;

            }
            PropertyNames.Reverse();


来源: stackexchange

问:
Using a JSON script in HTML and show data
Here is the Link to JSON.
http://api.wunderground.com/api/c3d8a6a640832fd0/conditions/forecast/alert/q/29.9205347,73.8706849.json

This JSON file give data about weather

And I want to show this data, given by the above link into my HTML file. I am using JSON for the first time. So I need help linking this JSON file into my HTML document.

```<code><html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> </script>
</head>

<body>

<div class="wrapper">
<span id="temp"></span>
<span id="high"></span>
<span id="low"></span>
<span id="windspeed"></span>
<span id="description"></span>
<span id="city"></span>
<span id="iconorimage"></span>
<span id="time"></span>
<span id="any thing else"></span>
</div>
</body>
</html>
</code>```

I am ok, If I can show only temperature, city, weather icon [rain,sunny], a text description about weather, high/low, wind speed and time.

答:
I don't mean to be  patronizing but I think the word you're looking for is parse.

Start by parsing something simpler: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse

The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string.

It will help boost your confidence and you'll be glad you took the scenic route as opposed to jumping head first.

ContentLicense: CC BY-SA 3.0

Body:
Here is the Link to JSON.
http://api.wunderground.com/api/c3d8a6a640832fd0/conditions/forecast/alert/q/29.9205347,73.8706849.json

This JSON file give data about weather

And I want to show this data, given by the above link into my HTML file. I am using JSON for the first time. So I need help linking this JSON file into my HTML document.

I am ok, If I can show only temperature, city, weather icon [rain,sunny], a text description about weather, high/low, wind speed and time.


问:
How to create summed variables using object values from List of objects in Scala?
I have an class

```<code>class Test(val first: Int, val second: Int, val third: Int)
</code>```

Class Test may have other attributes than first, second, and third.

And I have a list:

```<code>val list: List[Test] = List(new Test(0,1,2), new Test(1,14,2), new Test(7,15,2))
</code>```

How would I use foldLeft here to add together all first`s, second's, third's together to end up with variables:

allFirsts = 8

allSeconds = 30

allThirds = 6

I already have something like this worked out:

```<code>val (totalFirsts, totalSeconds, totalThirds) = list.foldLeft(0, 0, 0){ (sum, l) => (sum._1 + l.first , sum._2 + l.second, sum._3 + l.third) }
</code>```

It seems to work fine, but I don't like the readability of _1, _2, and _3.  Maybe I can use case here to decompose values but I am just not sure how to make it all work together.

答:
You're right, tuple indexing can be a bit clunky. In this case you can use pattern matching instead.

```<code>val (totalFirsts, totalSeconds, totalThirds) =
  list.foldLeft(0, 0, 0){case ((a,b,c), test) =>
    (a+test.first, b+test.second, c+test.third)}
</code>```

But the syntax can be streamlined even further. If your Test class were a case class then it would have an extractor you could use in the pattern match.

```<code>case class Test(first: Int, second: Int, third: Int)
. . .
val (totalFirsts, totalSeconds, totalThirds) =
  list.foldLeft(0, 0, 0){case ((a,b,c), Test(f,s,t)) => (a+f, b+s, c+t)}
</code>```

Body:
I have an class

class Test(val first: Int, val second: Int, val third: Int)

Class Test may have other attributes than first, second, and third.

And I have a list:

val list: List[Test] = List(new Test(0,1,2), new Test(1,14,2), new Test(7,15,2))

How would I use foldLeft here to add together all first`s, second's, third's together to end up with variables:

allFirsts = 8

allSeconds = 30

allThirds = 6

I already have something like this worked out:

val (totalFirsts, totalSeconds, totalThirds) = list.foldLeft(0, 0, 0){ (sum, l) => (sum._1 + l.first , sum._2 + l.second, sum._3 + l.third) }

It seems to work fine, but I don't like the readability of _1, _2, and _3.  Maybe I can use case here to decompose values but I am just not sure how to make it all work together.

Body:
You're right, tuple indexing can be a bit clunky. In this case you can use pattern matching instead.

val (totalFirsts, totalSeconds, totalThirds) =
  list.foldLeft(0, 0, 0){case ((a,b,c), test) =>
    (a+test.first, b+test.second, c+test.third)}

But the syntax can be streamlined even further. If your Test class were a case class then it would have an extractor you could use in the pattern match.

case class Test(first: Int, second: Int, third: Int)
. . .
val (totalFirsts, totalSeconds, totalThirds) =
  list.foldLeft(0, 0, 0){case ((a,b,c), Test(f,s,t)) => (a+f, b+s, c+t)}


问:
Issue with deleting items from array in for loop
So I am having a problem with deleting items from an array while in a for loop

var div = document.querySelector('div');
var array = [
"iPad",
"iPod",
"iPhone"
];

for (let i = 0; i < array.length; i++) {
  let p = document.createElement('p');
  p.textContent = array[i];
  div.appendChild(p);

  p.onclick = function() {
    array.splice(array.indexOf(this, 1));
    this.remove();
    console.log(array);
  }

}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>repl.it</title>
  </head>
  <body>

    <div>

    </div>

  </body>
</html></code>```

So the problem is that when I click on an item to delete it, it doesn't delete that specific one. No matter which one I click on, it deletes starting from the bottom ("iPhone" to "iPod" to "iPad").

Visually, it deletes the right one but when I go to the console I can see that it deletes from the bottom up. Any help would be so very much appreciated.

答:
```<code>for (let i = 0; i < array.length; i++) {
  let p = document.createElement('p'),
      a = array[i];
  p.textContent = a;
  div.appendChild(p);

  p.onclick = function() {
    array.splice(array.indexOf(a),1);
    this.remove();
    console.log(array);
  }
}
</code>```

Body:
So I am having a problem with deleting items from an array while in a for loop

var div = document.querySelector('div');
var array = [
"iPad",
"iPod",
"iPhone"
];

for (let i = 0; i < array.length; i++) {
  let p = document.createElement('p');
  p.textContent = array[i];
  div.appendChild(p);

  p.onclick = function() {
    array.splice(array.indexOf(this, 1));
    this.remove();
    console.log(array);
  }

}

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>repl.it</title>

So the problem is that when I click on an item to delete it, it doesn't delete that specific one. No matter which one I click on, it deletes starting from the bottom ("iPhone" to "iPod" to "iPad").

Visually, it deletes the right one but when I go to the console I can see that it deletes from the bottom up. Any help would be so very much appreciated.


问:
Performance problem in Flex using a heatMap
I am using a heatMap in Flex 3.5 but I have a huge performance problem because I'm trying to set between 3.000 and 10.000 markers in the map. At the moment that the map begins the render process the Browser collpase.

The implementation that I'm using is a GoogleMpas one, created by "flex epiphanies" I used http://sunild.com/proto/Earthquakes2/Earthquakes.html as base.

Basically my implementation calls a service that calls a ZipCode latLon generator in the server side to calculate latLon of every registry that I have to show, that returns a big array (between 3.000 and 10.000 items) every item has a latitude and a longitude because I need to show every single mark.

The problem that I have is RENDERING the items in the Map, because the service that I'm calling is really fast.

I dont know if that is the best way to implement a heatMap but I'm sure that is not really efficient when the numbers of markers excced the 3.000.

I'll appreciate your support if anyone can give me suggestions or another heatMap implementation.3

答:
What do you mean exactly when you say you've to show every single mark? This thing you're trying to build would probably be helped with two kinds of optimizations:

1) Aggregate what you can server side. No need to leave that much processing to flash when the server can probably do it faster. If you don't literally need to show every point - and just need the heatmap itself - see if you can modify it to take an array of already aggregated marker counts, perhaps "chunks" in the range of several lats/longs square. If you're not showing some specific kind of information about each point, I don't think you'll actually have to "show every single mark". If you're pulling data straight out of some service you've no control over, perhaps you could make a simple middle layer just to aggregate the data before passing it to flash.

2) Optimize the heatmap functionality. If you know enough Actionscript I'd recommend porting the heatmap code to pure AS3 - and maybe the whole project if it's not too complex; for 10,000 pts you'll need a lot of the resources that the Flex framework will gobble up. If you're a crazy algorithmist, you'll probably see some other ways to optimize, but if not I'd just read a lot of posts by Grant Skinner (http://gskinner.com/blog) because optimizing actionscript is all that guy ever talks about.

I am doing something similar that will have to deal with points in the range of thousands to hundreds of thousands, and this is the approach i'll be taking.

ContentLicense: CC BY-SA 2.5


问:
How can i get extract integer number from float number modulus?

const int npart = 500;
double  x[npart], y[npart], z[npart];
bedheight of yaxis, ly=20, x_axis lx=20 and z_axis lz=20
int cell_height=4;

const int number_cell = 5;// (ly/cell_height);
int counter2[number_cell];
int cell_particle;

for (h=0;h<number_cell;h++)
      {
    counter2[h]=0;
      }
          for (i = 0; i < npart; i++)
          {
                 //cell_particle=int(y[i]) % cell_height;
                 cell_particle= int(fmod (y[i],cell_height));
              counter2[cell_particle]=counter2[cell_particle]+1;
           }
cout<<"particle counter="<<counter2[j]<<"      cell number="<<cell_particle<<"     position="<<(y[j])<<endl;
 sol_fract=counter2[i]*(Volume of particle/(lx*lz*cell_height));

Could you please tell why the counter2[cell_particle] and sol_fract is contain wrong value? I am waiting for your suggestion.```
</div>
</div>
</p>

```int number_cell=20;
int  counter2[20];
double y[500];
int cell_height=4;

for (h=0;h<number_cell;h++)

      {
        counter2[h]=0;
      }
        for (i = 0; i < npart; i++)

        {
         cell_particle=int((y[i]) % cell_height);
         counter2[cell_particle]=counter2[cell_particle]+1;
            }
cout<<"particle counter="<<counter2[j]<<"      cell number="<<cell_particle<<endl;

output: error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator%
```

How can i get interger number from double values of modulus? It is noted that the value of y[i]=4.5, 8.9, 6 etc. I need integer value to put on counter2 array, but the problem is that conversion (error message is error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator% ). Could you please tell me how can i solve the problem?

答: To get 5 out of 5.4 or 6 out of 5.6 , you can easily round the number ceil(5.4) if you want to get the higher proportions or floor(5.6) if to Lowers ones

Body:
const int npart = 500;
double  x[npart], y[npart], z[npart];
bedheight of yaxis, ly=20, x_axis lx=20 and z_axis lz=20
int cell_height=4;

const int number_cell = 5;// (ly/cell_height);
int counter2[number_cell];
int cell_particle;

for (h=0;h<number_cell;h++)
      {
    counter2[h]=0;
      }
          for (i = 0; i < npart; i++)
          {
                 //cell_particle=int(y[i]) % cell_height;
                 cell_particle= int(fmod (y[i],cell_height));
              counter2[cell_particle]=counter2[cell_particle]+1;
           }
cout<<"particle counter="<<counter2[j]<<"      cell number="<<cell_particle<<"     position="<<(y[j])<<endl;
 sol_fract=counter2[i]*(Volume of particle/(lx*lz*cell_height));

Could you please tell why the counter2[cell_particle] and sol_fract is contain wrong value? I am waiting for your suggestion.

int number_cell=20;
int  counter2[20];
double y[500];
int cell_height=4;

for (h=0;h<number_cell;h++)

      {
        counter2[h]=0;
      }
        for (i = 0; i < npart; i++)

        {
         cell_particle=int((y[i]) % cell_height);
         counter2[cell_particle]=counter2[cell_particle]+1;
            }
cout<<"particle counter="<<counter2[j]<<"      cell number="<<cell_particle<<endl;

output: error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator%

How can i get interger number from double values of modulus? It is noted that the value of y[i]=4.5, 8.9, 6 etc. I need integer value to put on counter2 array, but the problem is that conversion (error message is error: invalid operands of types ‘double’ and ‘double’ to binary ‘operator% ). Could you please tell me how can i solve the problem?


问:
How do I promisify native XHR?
I want to use (native) promises in my frontend app to perform XHR request but without all the tomfoolery of a massive framework.

I want my xhr to return a promise but this doesn't work (giving me: Uncaught TypeError: Promise resolver undefined is not a function)

function makeXHRRequest (method, url, done) {
  var xhr = new XMLHttpRequest();
  xhr.open(method, url);
  xhr.onload = function() { return new Promise().resolve(); };
  xhr.onerror = function() { return new Promise().reject(); };
  xhr.send();
}

makeXHRRequest('GET', 'http://example.com')
.then(function (datums) {
  console.log(datums);
});
```

答:
For anyone who searches for this now, you can use the fetch function.
It has some pretty good support.

```<code>fetch('http://example.com/movies.json')
  .then(response => response.json())
  .then(data => console.log(data));
</code>```

I've firstly used @SomeKittens's answer, but then discovered fetch that does it for me out of the box :)

Title: How do I promisify native XHR?

Body:
For anyone who searches for this now, you can use the fetch function.
It has some pretty good support.

fetch('http://example.com/movies.json')
  .then(response => response.json())
  .then(data => console.log(data));

I've firstly used @SomeKittens's answer, but then discovered fetch that does it for me out of the box :)

ContentLicense: CC BY-SA 4.0


问:
How to insert arrays into a main array in PHP to make it 2d array?
I have these 3 arrays:

```<code>$date = array('2017-06-10',
              '2017-06-11',
              '2017-06-12');
$time_start = array('02:00 PM',
                    '03:00 PM',
                    '04:00 PM');
$time_end = array('05:00 PM',
                  '06:00 PM',
                  '07:00 PM');
</code>```

I want to put these arrays into one array that will produce this form:

```<code>$frequency = array(array('2017-06-10','02:00 PM','05:00 PM'),
                   array('2017-06-11','03:00 PM','06:00 PM'),
                   array('2017-06-12','04:00 PM','07:00 PM'));
</code>```

I tried array_combine and array_merge but they showed different results as what I wanted to produce. Please help.

Body:
I have these 3 arrays:

$date = array('2017-06-10',
              '2017-06-11',
              '2017-06-12');
$time_start = array('02:00 PM',
                    '03:00 PM',
                    '04:00 PM');
$time_end = array('05:00 PM',
                  '06:00 PM',
                  '07:00 PM');

I want to put these arrays into one array that will produce this form:

$frequency = array(array('2017-06-10','02:00 PM','05:00 PM'),
                   array('2017-06-11','03:00 PM','06:00 PM'),
                   array('2017-06-12','04:00 PM','07:00 PM'));

I tried array_combine and array_merge but they showed different results as what I wanted to produce. Please help.

Body:
You can do like below

<?php
$complete_array = array();

$date = array('2017-06-10',
              '2017-06-11',
              '2017-06-12');
$time_start = array('02:00 PM',
                    '03:00 PM',
                    '04:00 PM');
$time_end = array('05:00 PM',
                  '06:00 PM',
                  '07:00 PM');

array_push($complete_array, $date, $time_start, $time_end);
echo "<pre>";
print_r($complete_array);
?>

Output:

Array
(
    [0] => Array
        (
            [0] => 2017-06-10
            [1] => 2017-06-11
            [2] => 2017-06-12
        )

    [1] => Array
        (
            [0] => 02:00 PM
            [1] => 03:00 PM
            [2] => 04:00 PM
        )

    [2] => Array
        (
            [0] => 05:00 PM
            [1] => 06:00 PM
            [2] => 07:00 PM
        )

)


问:
In Codeigniter extends one controller into another controller
I am using codeigniter(3.1.5) and Ihave two controllers in my application/controllers/ folder. with name controller A and Controller B. I want to extends Controller A in Controller B so that I can use methods of Controller A. But it generates class not found error.

Here is my sample code:

A_Controller.php:

```<code>defined('BASEPATH') OR exit('No direct script access allowed');
class A_Controller extends CI_Controller {
  public function index()
  {
  }

  public function display(){
     echo 'base controller function called.';
  }
 }
</code>```

B_Controller.php:

```<code> defined('BASEPATH') OR exit('No direct script access allowed');
 class B_Controller extends A_Controller {

 }
</code>```

I want to execute display() method of controller A in controller B.
If i put controller A in application/core/ folder and in application/config/config.php file make

$config['subclass_prefix'] = 'A_';

then I can able to access methods of controller A.

Please suggest.
Thanks in advance.

答:
Try to use following code.     </p>

```<code>defined('BASEPATH') OR exit('No direct script access allowed');
     class B_Controller extends A_Controller {
        public function test()
        {
            $this->display();
        }
     }
</code>```

Body:
I am using codeigniter(3.1.5) and Ihave two controllers in my application/controllers/ folder. with name controller A and Controller B. I want to extends Controller A in Controller B so that I can use methods of Controller A. But it generates class not found error.

Here is my sample code:

A_Controller.php:

defined('BASEPATH') OR exit('No direct script access allowed');
class A_Controller extends CI_Controller {
  public function index()
  {
  }

  public function display(){
     echo 'base controller function called.';
  }
 }

B_Controller.php:

 defined('BASEPATH') OR exit('No direct script access allowed');
 class B_Controller extends A_Controller {

 }

I want to execute display() method of controller A in controller B.
If i put controller A in application/core/ folder and in application/config/config.php file make

$config['subclass_prefix'] = 'A_';

then I can able to access methods of controller A.

Please suggest.
Thanks in advance.

Body:
Try to use following code.

defined('BASEPATH') OR exit('No direct script access allowed');
     class B_Controller extends A_Controller {
        public function test()
        {
            $this->display();
        }
     }


问:
how to play high size audio files in audio tag HTML
```<code><audio src="/audioFiles/song.mp3" controls>
Your browser does not support the audio element.
</audio>
</code>```

This is the code i have used to play audio files. It is working fine with low sized files. Is there any way to play high sized audio files in html ?

答:
i have installed sox  and converted the high size audio file using this shell exec

```<code>shell_exec("/usr/local/bin/sox $oldVoice -r 8000 -c1 $newVoice -q -G");
</code>```

Now its playing!

Body:
<audio src="/audioFiles/song.mp3" controls>
Your browser does not support the audio element.
</audio>

This is the code i have used to play audio files. It is working fine with low sized files. Is there any way to play high sized audio files in html ?

Body:
i have installed sox  and converted the high size audio file using this shell exec

shell_exec("/usr/local/bin/sox $oldVoice -r 8000 -c1 $newVoice -q -G");

Now its playing!


问:
heterogeneous database link from Oracle 12c to SQLServer 2012
My problem: I want to link a Oracle 12c Enterprise with SQLServer 2012. I tried different tutorials but I didn't succeed. On my latest approach with heterogeneous services i got the following error when i try to query something:

select * from conf@PAS;

ORA-28545: Unable to retrieve text of NETWORK/NCR message 65535

conf is a table from the SQL Server and PAS is the name of my database link.

The different guides I followed said that I have to change 3 files to make the connection. I will post them below:

Note: Both of my databases are running on the same machine.

listener.ora:

```<code>SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\OracleDB\product\12.1.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\OracleDB\product\12.1.0\dbhome_1\bin\oraclr12.dll")
    )
    (SID_DESC =
        (SID_NAME=PAS)
        (ORACLE_HOME = C:\OracleDB\product\12.1.0\dbhome_1)
        (PROGRAM = dg4odbc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = PASSRV1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
</code>```

tnsnames.ora:

```<code>ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = PASSRV1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

PAS =
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1433))
      (CONNECT_DATA=(SID=PAS))
      (HS=OK)
    )
</code>```

initPAS.ora:

```<code>HS_FDS_CONNECT_INFO = PAS
HS_FDS_TRACE_LEVEL = OFF
</code>```

I created the link with this command:

```<code>CREATE DATABASE LINK PAS CONNECT TO "user" IDENTIFIED BY "password" USING 'PAS';
</code>```

The thing is that i don't really know the cause of the error and I don't know how to resolve it. So I hope one of you can help me.

If there is a easier way to create the link I would appreciate it if you tell me. I am open for suggestions.

Thank you!

答: I solved the problem by using the oracle gateway and following a simple tutorial. </p>

Body:
My problem: I want to link a Oracle 12c Enterprise with SQLServer 2012. I tried different tutorials but I didn't succeed. On my latest approach with heterogeneous services i got the following error when i try to query something:

select * from conf@PAS;

ORA-28545: Unable to retrieve text of NETWORK/NCR message 65535

conf is a table from the SQL Server and PAS is the name of my database link.

The different guides I followed said that I have to change 3 files to make the connection. I will post them below:

Note: Both of my databases are running on the same machine.

listener.ora:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = C:\OracleDB\product\12.1.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:C:\OracleDB\product\12.1.0\dbhome_1\bin\oraclr12.dll")
    )
    (SID_DESC =
        (SID_NAME=PAS)
        (ORACLE_HOME = C:\OracleDB\product\12.1.0\dbhome_1)
        (PROGRAM = dg4odbc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = PASSRV1)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

tnsnames.ora:

ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = PASSRV1)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

PAS =
  (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1433))
      (CONNECT_DATA=(SID=PAS))
      (HS=OK)
    )

initPAS.ora:

HS_FDS_CONNECT_INFO = PAS
HS_FDS_TRACE_LEVEL = OFF

I created the link with this command:

CREATE DATABASE LINK PAS CONNECT TO "user" IDENTIFIED BY "password" USING 'PAS';

The thing is that i don't really know the cause of the error and I don't know how to resolve it. So I hope one of you can help me.

If there is a easier way to create the link I would appreciate it if you tell me. I am open for suggestions.

Thank you!


问:
Cross-compiling OpenCV with MinGW using CMake(in Linux for Windows)
I'm trying to compile OpenCV library with MinGW in Linux for Windows using cmake-gui. I use toolchain file for cross-compilation Toolchain-mingw.cmake

```<code>SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
SET(CMAKE_FIND_ROOT_PATH  /usr/x86_64-w64-mingw32  )
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
</code>```

When I try to configure, there are a lot of errors and I have no idea how to solve it

```CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:172    (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

The CXX compiler identification is GNU 4.8.0
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:167 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

The C compiler identification is GNU 4.8.0
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:171 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineRCCompiler.cmake:65 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake:64 (enable_language)
/usr/local/share/cmake-2.8/Modules/Platform/Windows-GNU-CXX.cmake:1 (include)
/usr/local/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:56 (include)
CMakeLists.txt:61 (project)

Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++
Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++ -- works
Detecting CXX compiler ABI info
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:31 (try_compile):
Cannot copy output executable

'/media/data/distr/opencv-2.4.6.1/release4/CMakeFiles/CMakeTmp/cmTryCompileExec3943396232.exe'

to destination specified by COPY_FILE:

'/media/data/distr/opencv-2.4.6.1/release4/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_CXX.bin'

Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:68 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:61 (project)

Detecting CXX compiler ABI info - done
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:71 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc
Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc -- works
Detecting C compiler ABI info
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:31 (try_compile):
Cannot copy output executable

'/media/data/distr/opencv-2.4.6.1/release4/CMakeFiles/CMakeTmp/cmTryCompileExec2142254710.exe'

to destination specified by COPY_FILE:

'/media/data/distr/opencv-2.4.6.1/release4/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_C.bin'

Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:75 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:61 (project)

Detecting C compiler ABI info - done
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:78 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

Detected version of GNU GCC: 48 (408)
CMake Error at cmake/OpenCVVersion.cmake:19 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:229 (include)

Performing Test HAVE_CXX_FSIGNED_CHAR
Performing Test HAVE_CXX_FSIGNED_CHAR - Success
Performing Test HAVE_C_FSIGNED_CHAR
Performing Test HAVE_C_FSIGNED_CHAR - Success
Performing Test HAVE_CXX_MSTACKREALIGN
Performing Test HAVE_CXX_MSTACKREALIGN - Success
Performing Test HAVE_C_MSTACKREALIGN
Performing Test HAVE_C_MSTACKREALIGN - Success
Performing Test HAVE_CXX_W
Performing Test HAVE_CXX_W - Success
Performing Test HAVE_C_W
Performing Test HAVE_C_W - Success
Performing Test HAVE_CXX_WALL
Performing Test HAVE_CXX_WALL - Success
Performing Test HAVE_C_WALL
Performing Test HAVE_C_WALL - Success
Performing Test HAVE_CXX_WERROR_RETURN_TYPE
Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success
Performing Test HAVE_C_WERROR_RETURN_TYPE
Performing Test HAVE_C_WERROR_RETURN_TYPE - Success
Performing Test HAVE_CXX_WERROR_ADDRESS
Performing Test HAVE_CXX_WERROR_ADDRESS - Success
Performing Test HAVE_C_WERROR_ADDRESS
Performing Test HAVE_C_WERROR_ADDRESS - Success
Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success
Performing Test HAVE_C_WERROR_SEQUENCE_POINT
Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success
Performing Test HAVE_CXX_WFORMAT
Performing Test HAVE_CXX_WFORMAT - Success
Performing Test HAVE_C_WFORMAT
Performing Test HAVE_C_WFORMAT - Success
Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success
Performing Test HAVE_C_WERROR_FORMAT_SECURITY
Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success
Performing Test HAVE_CXX_WMISSING_DECLARATIONS
Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
Performing Test HAVE_C_WMISSING_DECLARATIONS
Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
Performing Test HAVE_CXX_WMISSING_PROTOTYPES
Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed
Performing Test HAVE_C_WMISSING_PROTOTYPES
Performing Test HAVE_C_WMISSING_PROTOTYPES - Success
Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed
Performing Test HAVE_C_WSTRICT_PROTOTYPES
Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
Performing Test HAVE_CXX_WUNDEF
Performing Test HAVE_CXX_WUNDEF - Success
Performing Test HAVE_C_WUNDEF
Performing Test HAVE_C_WUNDEF - Success
Performing Test HAVE_CXX_WINIT_SELF
Performing Test HAVE_CXX_WINIT_SELF - Success
Performing Test HAVE_C_WINIT_SELF
Performing Test HAVE_C_WINIT_SELF - Success
Performing Test HAVE_CXX_WPOINTER_ARITH
Performing Test HAVE_CXX_WPOINTER_ARITH - Success
Performing Test HAVE_C_WPOINTER_ARITH
Performing Test HAVE_C_WPOINTER_ARITH - Success
Performing Test HAVE_CXX_WSHADOW
Performing Test HAVE_CXX_WSHADOW - Success
Performing Test HAVE_C_WSHADOW
Performing Test HAVE_C_WSHADOW - Success
Performing Test HAVE_CXX_WSIGN_PROMO
Performing Test HAVE_CXX_WSIGN_PROMO - Success
Performing Test HAVE_C_WSIGN_PROMO
Performing Test HAVE_C_WSIGN_PROMO - Failed
Performing Test HAVE_CXX_WNO_NARROWING
Performing Test HAVE_CXX_WNO_NARROWING - Success
Performing Test HAVE_C_WNO_NARROWING
Performing Test HAVE_C_WNO_NARROWING - Success
Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Success
Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
Performing Test HAVE_CXX_WNO_LONG_LONG
Performing Test HAVE_CXX_WNO_LONG_LONG - Success
Performing Test HAVE_C_WNO_LONG_LONG
Performing Test HAVE_C_WNO_LONG_LONG - Success
Performing Test HAVE_CXX_FOMIT_FRAME_POINTER
Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success
Performing Test HAVE_C_FOMIT_FRAME_POINTER
Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success
Performing Test HAVE_CXX_MSSE
Performing Test HAVE_CXX_MSSE - Success
Performing Test HAVE_C_MSSE
Performing Test HAVE_C_MSSE - Success
Performing Test HAVE_CXX_MSSE2
Performing Test HAVE_CXX_MSSE2 - Success
Performing Test HAVE_C_MSSE2
Performing Test HAVE_C_MSSE2 - Success
Performing Test HAVE_CXX_FFUNCTION_SECTIONS
Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Success
Performing Test HAVE_C_FFUNCTION_SECTIONS
Performing Test HAVE_C_FFUNCTION_SECTIONS - Success
Looking for fseeko
Looking for fseeko - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/zlib/CMakeLists.txt:24 (check_include_file)

Looking for unistd.h
Looking for unistd.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:168 (check_include_file)
3rdparty/zlib/CMakeLists.txt:34 (check_type_size)

Looking for sys/types.h
Looking for sys/types.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:169 (check_include_file)
3rdparty/zlib/CMakeLists.txt:34 (check_type_size)

Looking for stdint.h
Looking for stdint.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:170 (check_include_file)
3rdparty/zlib/CMakeLists.txt:34 (check_type_size)

Looking for stddef.h
Looking for stddef.h - found
Check size of off64_t
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:91 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:177 (__check_type_size_impl)
3rdparty/zlib/CMakeLists.txt:34 (check_type_size)

CMake Error at 3rdparty/zlib/CMakeLists.txt:39 (configure_file):
configure_file Problem configuring file

Performing Test HAVE_C_WNO_ATTRIBUTES
Performing Test HAVE_C_WNO_ATTRIBUTES - Success
Performing Test HAVE_C_WNO_STRICT_PROTOTYPES
Performing Test HAVE_C_WNO_STRICT_PROTOTYPES - Success
Performing Test HAVE_C_WNO_MISSING_PROTOTYPES
Performing Test HAVE_C_WNO_MISSING_PROTOTYPES - Success
Performing Test HAVE_C_WNO_MISSING_DECLARATIONS
Performing Test HAVE_C_WNO_MISSING_DECLARATIONS - Success
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:10 (check_include_file)

Looking for assert.h
Looking for assert.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:11 (check_include_file)

Looking for fcntl.h
Looking for fcntl.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:12 (check_include_file)

Looking for io.h
Looking for io.h - found
Looking for jbg_newlen
Looking for jbg_newlen - not found
Looking for mmap
Looking for mmap - not found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:15 (check_include_file)

Looking for search.h
Looking for search.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:16 (check_include_file)

Looking for string.h
Looking for string.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:18 (check_include_file)

Looking for unistd.h
Looking for unistd.h - found
CMake Error at 3rdparty/libtiff/CMakeLists.txt:24 (configure_file):
configure_file Problem configuring file

Performing Test HAVE_C_WNO_UNUSED_BUT_SET_VARIABLE
Performing Test HAVE_C_WNO_UNUSED_BUT_SET_VARIABLE - Success
Performing Test HAVE_C_WNO_UNDEF
Performing Test HAVE_C_WNO_UNDEF - Success
Performing Test HAVE_C_WNO_UNUSED
Performing Test HAVE_C_WNO_UNUSED - Success
Performing Test HAVE_C_WNO_SIGN_COMPARE
Performing Test HAVE_C_WNO_SIGN_COMPARE - Success
Performing Test HAVE_C_WNO_CAST_ALIGN
Performing Test HAVE_C_WNO_CAST_ALIGN - Success
Performing Test HAVE_C_WNO_SHADOW
Performing Test HAVE_C_WNO_SHADOW - Success
Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED
Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED - Success
Performing Test HAVE_C_WNO_POINTER_TO_INT_CAST
Performing Test HAVE_C_WNO_POINTER_TO_INT_CAST - Success
Performing Test HAVE_C_WNO_INT_TO_POINTER_CAST
Performing Test HAVE_C_WNO_INT_TO_POINTER_CAST - Success
Performing Test HAVE_C_WNO_UNUSED_PARAMETER
Performing Test HAVE_C_WNO_UNUSED_PARAMETER - Success
Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS
Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS - Success
Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER
Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER - Success
Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION
Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION - Success
Performing Test HAVE_C_WNO_UNINITIALIZED
Performing Test HAVE_C_WNO_UNINITIALIZED - Success
Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER
Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER - Success
CMake Error at 3rdparty/openexr/CMakeLists.txt:14 (configure_file):
configure_file Problem configuring file

CMake Error at 3rdparty/openexr/CMakeLists.txt:16 (configure_file):
configure_file Problem configuring file

Performing Test HAVE_CXX_WNO_SHADOW
Performing Test HAVE_CXX_WNO_SHADOW - Success
Performing Test HAVE_CXX_WNO_UNUSED
Performing Test HAVE_CXX_WNO_UNUSED - Success
Performing Test HAVE_CXX_WNO_SIGN_COMPARE
Performing Test HAVE_CXX_WNO_SIGN_COMPARE - Success
Performing Test HAVE_CXX_WNO_UNDEF
Performing Test HAVE_CXX_WNO_UNDEF - Success
Performing Test HAVE_CXX_WNO_UNINITIALIZED
Performing Test HAVE_CXX_WNO_UNINITIALIZED - Success
Performing Test HAVE_CXX_WNO_SWITCH
Performing Test HAVE_CXX_WNO_SWITCH - Success
Performing Test HAVE_CXX_WNO_PARENTHESES
Performing Test HAVE_CXX_WNO_PARENTHESES - Success
Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS
Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success
Performing Test HAVE_CXX_WNO_EXTRA
Performing Test HAVE_CXX_WNO_EXTRA - Success
CMake Error at cmake/OpenCVFindLibsGUI.cmake:8 (TRY_COMPILE):
Failed to open

/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp/CMakeLists.txt

Нет такого файла или каталога
Call Stack (most recent call first):
CMakeLists.txt:397 (include)

CMake Error at cmake/OpenCVFindLibsVideo.cmake:7 (TRY_COMPILE):
Failed to open

/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp/CMakeLists.txt

Нет такого файла или каталога
Call Stack (most recent call first):
CMakeLists.txt:398 (include)

CUDA compilation is disabled (due to only Visual Studio compiler supported on your platform).
Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.4", minimum required is "2.0")
Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is exact version "2.7.4")
Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
Could NOT find OPENCL (missing:  OPENCL_LIBRARY OPENCL_INCLUDE_DIR)
CMake Error at cmake/OpenCVExtraTargets.cmake:4 (CONFIGURE_FILE):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:446 (include)

Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS
Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS - Success
CMake Error at cmake/OpenCVGenHeaders.cmake:12 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:493 (include)

CMake Error at cmake/OpenCVGenHeaders.cmake:35 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:493 (include)

CMake Error at cmake/OpenCVGenPkgconfig.cmake:71 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:496 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:122 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:124 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:145 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:146 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:178 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:179 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

General configuration for OpenCV 2.4.6.1 =====================================
Version control:               unknown

Platform:
Host:                        Linux 3.8.7-1-ARCH x86_64
Target:                      Windows
CMake:                       2.8.10.2
CMake generator:             Unix Makefiles
CMake build tool:            /usr/bin/make
Configuration:               Release

C/C++:
Built as dynamic libs?:      YES
C++ Compiler:                /usr/bin/x86_64-w64-mingw32-g++  (ver 4.8.0)
C++ flags (Release):         -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -msse -msse2 -ffunction-sections -O2 -DNDEBUG  -DNDEBUG
C++ flags (Debug):           -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -msse -msse2 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG -ggdb3
C Compiler:                  /usr/bin/x86_64-w64-mingw32-gcc
C flags (Release):           -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -msse -msse2 -ffunction-sections -O2 -DNDEBUG  -DNDEBUG
C flags (Debug):             -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -msse -msse2 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG -ggdb3
Linker flags (Release):
Linker flags (Debug):
Precompiled headers:         YES

OpenCV modules:
To be built:                 core imgproc flann highgui features2d calib3d ml video objdetect contrib photo legacy gpu nonfree stitching superres ts videostab
Disabled:                    world
Disabled by dependency:      -
Unavailable:                 androidcamera java ocl python

GUI:
QT:                          NO
Win32 UI:                    NO
OpenGL support:              NO

Media I/O:
ZLib:                        build (ver 1.2.7)
JPEG:                        build (ver 62)
PNG:                         build (ver 1.5.12)
TIFF:                        build (ver 42 - 4.0.2)
JPEG 2000:                   build (ver 1.900.1)
OpenEXR:                     build (ver 1.7.1)

Video I/O:
Video for Windows:           NO
DC1394 1.x:                  NO
DC1394 2.x:                  NO
FFMPEG:                      YES (prebuilt binaries)
codec:                     YES (ver 53.61.100)
format:                    YES (ver 53.32.100)
util:                      YES (ver 51.35.100)
swscale:                   YES (ver 2.1.100)
gentoo-style:              YES
OpenNI:                      NO
OpenNI PrimeSensor Modules:  NO
PvAPI:                       NO
GigEVisionSDK:               NO
DirectShow:                  YES
Media Foundation:            NO
XIMEA:                       NO

Other third-party libraries:
Use IPP:                     NO
Use Eigen:                   NO
Use TBB:                     NO
Use OpenMP:                  NO
Use GCD                      NO
Use Concurrency              NO
Use C=:                      NO
Use Cuda:                    NO
Use OpenCL:                  NO

Python:
Interpreter:                 /usr/bin/python2 (ver 2.7.4)

Java:
ant:                         NO
JNI:                         NO
Java tests:                  NO

Documentation:
Build Documentation:         NO
Sphinx:                      NO
PdfLaTeX compiler:           /usr/bin/pdflatex

Tests and samples:
Tests:                       YES
Performance tests:           YES
C/C++ Examples:              NO

Install path:                  /media/data/distr/opencv-2.4.6.1/release4/install

cvconfig.h is in:              /media/data/distr/opencv-2.4.6.1/release4
-----------------------------------------------------------------

Configuring incomplete, errors occurred!
```

答:
I had the same problem, after using an old version of CMAKE 2.8.8 everything was working again without any error.

You can check the following link for more details:
https://sourceforge.net/p/podofo/mailman/podofo-users/thread/BLU157-ds114B45D1CA3DC934BF77C3E1CB0@phx.gbl/

Hope this will help.

Body:
I'm trying to compile OpenCV library with MinGW in Linux for Windows using cmake-gui. I use toolchain file for cross-compilation Toolchain-mingw.cmake

SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
SET(CMAKE_FIND_ROOT_PATH  /usr/x86_64-w64-mingw32  )
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

When I try to configure, there are a lot of errors and I have no idea how to solve it

CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineSystem.cmake:172    (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

The CXX compiler identification is GNU 4.8.0
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:167 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

The C compiler identification is GNU 4.8.0
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:171 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineRCCompiler.cmake:65 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/Platform/Windows-GNU.cmake:64 (enable_language)
/usr/local/share/cmake-2.8/Modules/Platform/Windows-GNU-CXX.cmake:1 (include)
/usr/local/share/cmake-2.8/Modules/CMakeCXXInformation.cmake:56 (include)
CMakeLists.txt:61 (project)

Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++
Check for working CXX compiler: /usr/bin/x86_64-w64-mingw32-g++ -- works
Detecting CXX compiler ABI info
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:31 (try_compile):
Cannot copy output executable

'/media/data/distr/opencv-2.4.6.1/release4/CMakeFiles/CMakeTmp/cmTryCompileExec3943396232.exe'

to destination specified by COPY_FILE:

'/media/data/distr/opencv-2.4.6.1/release4/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_CXX.bin'

Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:68 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:61 (project)

Detecting CXX compiler ABI info - done
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:71 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc
Check for working C compiler: /usr/bin/x86_64-w64-mingw32-gcc -- works
Detecting C compiler ABI info
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeDetermineCompilerABI.cmake:31 (try_compile):
Cannot copy output executable

'/media/data/distr/opencv-2.4.6.1/release4/CMakeFiles/CMakeTmp/cmTryCompileExec2142254710.exe'

to destination specified by COPY_FILE:

'/media/data/distr/opencv-2.4.6.1/release4/CMakeFiles/2.8.10.2/CMakeDetermineCompilerABI_C.bin'

Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:75 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:61 (project)

Detecting C compiler ABI info - done
CMake Error at /usr/local/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:78 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:61 (project)

Detected version of GNU GCC: 48 (408)
CMake Error at cmake/OpenCVVersion.cmake:19 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:229 (include)

Performing Test HAVE_CXX_FSIGNED_CHAR
Performing Test HAVE_CXX_FSIGNED_CHAR - Success
Performing Test HAVE_C_FSIGNED_CHAR
Performing Test HAVE_C_FSIGNED_CHAR - Success
Performing Test HAVE_CXX_MSTACKREALIGN
Performing Test HAVE_CXX_MSTACKREALIGN - Success
Performing Test HAVE_C_MSTACKREALIGN
Performing Test HAVE_C_MSTACKREALIGN - Success
Performing Test HAVE_CXX_W
Performing Test HAVE_CXX_W - Success
Performing Test HAVE_C_W
Performing Test HAVE_C_W - Success
Performing Test HAVE_CXX_WALL
Performing Test HAVE_CXX_WALL - Success
Performing Test HAVE_C_WALL
Performing Test HAVE_C_WALL - Success
Performing Test HAVE_CXX_WERROR_RETURN_TYPE
Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Success
Performing Test HAVE_C_WERROR_RETURN_TYPE
Performing Test HAVE_C_WERROR_RETURN_TYPE - Success
Performing Test HAVE_CXX_WERROR_ADDRESS
Performing Test HAVE_CXX_WERROR_ADDRESS - Success
Performing Test HAVE_C_WERROR_ADDRESS
Performing Test HAVE_C_WERROR_ADDRESS - Success
Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Success
Performing Test HAVE_C_WERROR_SEQUENCE_POINT
Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Success
Performing Test HAVE_CXX_WFORMAT
Performing Test HAVE_CXX_WFORMAT - Success
Performing Test HAVE_C_WFORMAT
Performing Test HAVE_C_WFORMAT - Success
Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Success
Performing Test HAVE_C_WERROR_FORMAT_SECURITY
Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Success
Performing Test HAVE_CXX_WMISSING_DECLARATIONS
Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Success
Performing Test HAVE_C_WMISSING_DECLARATIONS
Performing Test HAVE_C_WMISSING_DECLARATIONS - Success
Performing Test HAVE_CXX_WMISSING_PROTOTYPES
Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed
Performing Test HAVE_C_WMISSING_PROTOTYPES
Performing Test HAVE_C_WMISSING_PROTOTYPES - Success
Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed
Performing Test HAVE_C_WSTRICT_PROTOTYPES
Performing Test HAVE_C_WSTRICT_PROTOTYPES - Success
Performing Test HAVE_CXX_WUNDEF
Performing Test HAVE_CXX_WUNDEF - Success
Performing Test HAVE_C_WUNDEF
Performing Test HAVE_C_WUNDEF - Success
Performing Test HAVE_CXX_WINIT_SELF
Performing Test HAVE_CXX_WINIT_SELF - Success
Performing Test HAVE_C_WINIT_SELF
Performing Test HAVE_C_WINIT_SELF - Success
Performing Test HAVE_CXX_WPOINTER_ARITH
Performing Test HAVE_CXX_WPOINTER_ARITH - Success
Performing Test HAVE_C_WPOINTER_ARITH
Performing Test HAVE_C_WPOINTER_ARITH - Success
Performing Test HAVE_CXX_WSHADOW
Performing Test HAVE_CXX_WSHADOW - Success
Performing Test HAVE_C_WSHADOW
Performing Test HAVE_C_WSHADOW - Success
Performing Test HAVE_CXX_WSIGN_PROMO
Performing Test HAVE_CXX_WSIGN_PROMO - Success
Performing Test HAVE_C_WSIGN_PROMO
Performing Test HAVE_C_WSIGN_PROMO - Failed
Performing Test HAVE_CXX_WNO_NARROWING
Performing Test HAVE_CXX_WNO_NARROWING - Success
Performing Test HAVE_C_WNO_NARROWING
Performing Test HAVE_C_WNO_NARROWING - Success
Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Success
Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Success
Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Success
Performing Test HAVE_CXX_WNO_LONG_LONG
Performing Test HAVE_CXX_WNO_LONG_LONG - Success
Performing Test HAVE_C_WNO_LONG_LONG
Performing Test HAVE_C_WNO_LONG_LONG - Success
Performing Test HAVE_CXX_FOMIT_FRAME_POINTER
Performing Test HAVE_CXX_FOMIT_FRAME_POINTER - Success
Performing Test HAVE_C_FOMIT_FRAME_POINTER
Performing Test HAVE_C_FOMIT_FRAME_POINTER - Success
Performing Test HAVE_CXX_MSSE
Performing Test HAVE_CXX_MSSE - Success
Performing Test HAVE_C_MSSE
Performing Test HAVE_C_MSSE - Success
Performing Test HAVE_CXX_MSSE2
Performing Test HAVE_CXX_MSSE2 - Success
Performing Test HAVE_C_MSSE2
Performing Test HAVE_C_MSSE2 - Success
Performing Test HAVE_CXX_FFUNCTION_SECTIONS
Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Success
Performing Test HAVE_C_FFUNCTION_SECTIONS
Performing Test HAVE_C_FFUNCTION_SECTIONS - Success
Looking for fseeko
Looking for fseeko - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/zlib/CMakeLists.txt:24 (check_include_file)

Looking for unistd.h
Looking for unistd.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:168 (check_include_file)
3rdparty/zlib/CMakeLists.txt:34 (check_type_size)

Looking for sys/types.h
Looking for sys/types.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:169 (check_include_file)
3rdparty/zlib/CMakeLists.txt:34 (check_type_size)

Looking for stdint.h
Looking for stdint.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:170 (check_include_file)
3rdparty/zlib/CMakeLists.txt:34 (check_type_size)

Looking for stddef.h
Looking for stddef.h - found
Check size of off64_t
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:91 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/CheckTypeSize.cmake:177 (__check_type_size_impl)
3rdparty/zlib/CMakeLists.txt:34 (check_type_size)

CMake Error at 3rdparty/zlib/CMakeLists.txt:39 (configure_file):
configure_file Problem configuring file

Performing Test HAVE_C_WNO_ATTRIBUTES
Performing Test HAVE_C_WNO_ATTRIBUTES - Success
Performing Test HAVE_C_WNO_STRICT_PROTOTYPES
Performing Test HAVE_C_WNO_STRICT_PROTOTYPES - Success
Performing Test HAVE_C_WNO_MISSING_PROTOTYPES
Performing Test HAVE_C_WNO_MISSING_PROTOTYPES - Success
Performing Test HAVE_C_WNO_MISSING_DECLARATIONS
Performing Test HAVE_C_WNO_MISSING_DECLARATIONS - Success
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:10 (check_include_file)

Looking for assert.h
Looking for assert.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:11 (check_include_file)

Looking for fcntl.h
Looking for fcntl.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:12 (check_include_file)

Looking for io.h
Looking for io.h - found
Looking for jbg_newlen
Looking for jbg_newlen - not found
Looking for mmap
Looking for mmap - not found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:15 (check_include_file)

Looking for search.h
Looking for search.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:16 (check_include_file)

Looking for string.h
Looking for string.h - found
CMake Error at /usr/local/share/cmake-2.8/Modules/CheckIncludeFile.cmake:40 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
3rdparty/libtiff/CMakeLists.txt:18 (check_include_file)

Looking for unistd.h
Looking for unistd.h - found
CMake Error at 3rdparty/libtiff/CMakeLists.txt:24 (configure_file):
configure_file Problem configuring file

Performing Test HAVE_C_WNO_UNUSED_BUT_SET_VARIABLE
Performing Test HAVE_C_WNO_UNUSED_BUT_SET_VARIABLE - Success
Performing Test HAVE_C_WNO_UNDEF
Performing Test HAVE_C_WNO_UNDEF - Success
Performing Test HAVE_C_WNO_UNUSED
Performing Test HAVE_C_WNO_UNUSED - Success
Performing Test HAVE_C_WNO_SIGN_COMPARE
Performing Test HAVE_C_WNO_SIGN_COMPARE - Success
Performing Test HAVE_C_WNO_CAST_ALIGN
Performing Test HAVE_C_WNO_CAST_ALIGN - Success
Performing Test HAVE_C_WNO_SHADOW
Performing Test HAVE_C_WNO_SHADOW - Success
Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED
Performing Test HAVE_C_WNO_MAYBE_UNINITIALIZED - Success
Performing Test HAVE_C_WNO_POINTER_TO_INT_CAST
Performing Test HAVE_C_WNO_POINTER_TO_INT_CAST - Success
Performing Test HAVE_C_WNO_INT_TO_POINTER_CAST
Performing Test HAVE_C_WNO_INT_TO_POINTER_CAST - Success
Performing Test HAVE_C_WNO_UNUSED_PARAMETER
Performing Test HAVE_C_WNO_UNUSED_PARAMETER - Success
Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS
Performing Test HAVE_CXX_WNO_MISSING_DECLARATIONS - Success
Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER
Performing Test HAVE_CXX_WNO_UNUSED_PARAMETER - Success
Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION
Performing Test HAVE_C_WNO_IMPLICIT_FUNCTION_DECLARATION - Success
Performing Test HAVE_C_WNO_UNINITIALIZED
Performing Test HAVE_C_WNO_UNINITIALIZED - Success
Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER
Performing Test HAVE_C_WNO_UNUSED_BUT_SET_PARAMETER - Success
CMake Error at 3rdparty/openexr/CMakeLists.txt:14 (configure_file):
configure_file Problem configuring file

CMake Error at 3rdparty/openexr/CMakeLists.txt:16 (configure_file):
configure_file Problem configuring file

Performing Test HAVE_CXX_WNO_SHADOW
Performing Test HAVE_CXX_WNO_SHADOW - Success
Performing Test HAVE_CXX_WNO_UNUSED
Performing Test HAVE_CXX_WNO_UNUSED - Success
Performing Test HAVE_CXX_WNO_SIGN_COMPARE
Performing Test HAVE_CXX_WNO_SIGN_COMPARE - Success
Performing Test HAVE_CXX_WNO_UNDEF
Performing Test HAVE_CXX_WNO_UNDEF - Success
Performing Test HAVE_CXX_WNO_UNINITIALIZED
Performing Test HAVE_CXX_WNO_UNINITIALIZED - Success
Performing Test HAVE_CXX_WNO_SWITCH
Performing Test HAVE_CXX_WNO_SWITCH - Success
Performing Test HAVE_CXX_WNO_PARENTHESES
Performing Test HAVE_CXX_WNO_PARENTHESES - Success
Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS
Performing Test HAVE_CXX_WNO_ARRAY_BOUNDS - Success
Performing Test HAVE_CXX_WNO_EXTRA
Performing Test HAVE_CXX_WNO_EXTRA - Success
CMake Error at cmake/OpenCVFindLibsGUI.cmake:8 (TRY_COMPILE):
Failed to open

/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp/CMakeLists.txt

Нет такого файла или каталога
Call Stack (most recent call first):
CMakeLists.txt:397 (include)

CMake Error at cmake/OpenCVFindLibsVideo.cmake:7 (TRY_COMPILE):
Failed to open

/CMakeFiles/CMakeTmp/CMakeFiles/CMakeTmp/CMakeLists.txt

Нет такого файла или каталога
Call Stack (most recent call first):
CMakeLists.txt:398 (include)

CUDA compilation is disabled (due to only Visual Studio compiler supported on your platform).
Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.4", minimum required is "2.0")
Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is exact version "2.7.4")
Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY JAVA_INCLUDE_PATH JAVA_INCLUDE_PATH2 JAVA_AWT_INCLUDE_PATH)
Could NOT find OPENCL (missing:  OPENCL_LIBRARY OPENCL_INCLUDE_DIR)
CMake Error at cmake/OpenCVExtraTargets.cmake:4 (CONFIGURE_FILE):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:446 (include)

Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS
Performing Test HAVE_CXX_WNO_DEPRECATED_DECLARATIONS - Success
CMake Error at cmake/OpenCVGenHeaders.cmake:12 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:493 (include)

CMake Error at cmake/OpenCVGenHeaders.cmake:35 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:493 (include)

CMake Error at cmake/OpenCVGenPkgconfig.cmake:71 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:496 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:122 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:124 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:145 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:146 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:178 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

CMake Error at cmake/OpenCVGenConfig.cmake:179 (configure_file):
configure_file Problem configuring file
Call Stack (most recent call first):
CMakeLists.txt:502 (include)

General configuration for OpenCV 2.4.6.1 =====================================
Version control:               unknown

Platform:
Host:                        Linux 3.8.7-1-ARCH x86_64
Target:                      Windows
CMake:                       2.8.10.2
CMake generator:             Unix Makefiles
CMake build tool:            /usr/bin/make
Configuration:               Release

C/C++:
Built as dynamic libs?:      YES
C++ Compiler:                /usr/bin/x86_64-w64-mingw32-g++  (ver 4.8.0)
C++ flags (Release):         -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -msse -msse2 -ffunction-sections -O2 -DNDEBUG  -DNDEBUG
C++ flags (Debug):           -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -msse -msse2 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG -ggdb3
C Compiler:                  /usr/bin/x86_64-w64-mingw32-gcc
C flags (Release):           -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -msse -msse2 -ffunction-sections -O2 -DNDEBUG  -DNDEBUG
C flags (Debug):             -fsigned-char -mstackrealign -W -Wall -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -fomit-frame-pointer -msse -msse2 -ffunction-sections -g  -O0 -DDEBUG -D_DEBUG -ggdb3
Linker flags (Release):
Linker flags (Debug):
Precompiled headers:         YES

OpenCV modules:
To be built:                 core imgproc flann highgui features2d calib3d ml video objdetect contrib photo legacy gpu nonfree stitching superres ts videostab
Disabled:                    world
Disabled by dependency:      -
Unavailable:                 androidcamera java ocl python

GUI:
QT:                          NO
Win32 UI:                    NO
OpenGL support:              NO

Media I/O:
ZLib:                        build (ver 1.2.7)
JPEG:                        build (ver 62)
PNG:                         build (ver 1.5.12)
TIFF:                        build (ver 42 - 4.0.2)
JPEG 2000:                   build (ver 1.900.1)
OpenEXR:                     build (ver 1.7.1)

Video I/O:
Video for Windows:           NO
DC1394 1.x:                  NO
DC1394 2.x:                  NO
FFMPEG:                      YES (prebuilt binaries)
codec:                     YES (ver 53.61.100)
format:                    YES (ver 53.32.100)
util:                      YES (ver 51.35.100)
swscale:                   YES (ver 2.1.100)
gentoo-style:              YES
OpenNI:                      NO
OpenNI PrimeSensor Modules:  NO
PvAPI:                       NO
GigEVisionSDK:               NO
DirectShow:                  YES
Media Foundation:            NO
XIMEA:                       NO

Other third-party libraries:
Use IPP:                     NO
Use Eigen:                   NO
Use TBB:                     NO
Use OpenMP:                  NO
Use GCD                      NO
Use Concurrency              NO
Use C=:                      NO
Use Cuda:                    NO
Use OpenCL:                  NO

Python:
Interpreter:                 /usr/bin/python2 (ver 2.7.4)

Java:
ant:                         NO
JNI:                         NO
Java tests:                  NO

Documentation:
Build Documentation:         NO
Sphinx:                      NO
PdfLaTeX compiler:           /usr/bin/pdflatex

Tests and samples:
Tests:                       YES
Performance tests:           YES
C/C++ Examples:              NO

Install path:                  /media/data/distr/opencv-2.4.6.1/release4/install

cvconfig.h is in:              /media/data/distr/opencv-2.4.6.1/release4
-----------------------------------------------------------------

Configuring incomplete, errors occurred!


问:
Why is "and" evaluated before "equal"
In Javascript precedence of strict equal (10) is greater than logical and (6) then how does this code works

var a;
console.log("value of a is", a);
if (a && a.test === "test") {}```

Should it not throw error

cannot read test of undefined.

And to add salt to the wound precedence of member access is higher than both of them (19).

What am i missing?

答:
Some programming languages, like JavaScript, evaluate logical expressions lazily. This means that if the first part of your expression (a) is false, the interpreter sees no reason for even executing the second part (a.test === "test") and thus no error is thrown.

To clarify, precedence does not define the actual order in which an expression is executed, only the effective order. So that the member access operator hast highest precedence does not mean it will be executed first. The interpreter can still evaluate a first, without affecting the outcome of any of the higher precedence operators. You can think of precedence as implicit brackets, if you write the expression as (a) && ((a.test) === "test") you can clearly see that a can and will be evaluated first, as it is at the very left of expression.

Title: Why is "and" evaluated before "equal"

Body:
In Javascript precedence of strict equal (10) is greater than logical and (6) then how does this code works

var a;
console.log("value of a is", a);
if (a && a.test === "test") {}

Should it not throw error

cannot read test of undefined.

And to add salt to the wound precedence of member access is higher than both of them (19).

What am i missing?


问:
Extjs: two parallel ajax call
my code creates two ajax call at the same time (i assume the parallelism would be more efficient). I want to load a table if both calls succeed. What's the proper way of doing this?</p>

答:
```<code>var succeeded = {};

function callBackOne(){
     succeeded.one = true;
     // your other stuff
     if (succeeded.two) { bothHaveSucceeded());
}

function callBackTwo(){
     succeeded.two = true;
     // your other stuff
     if (succeeded.one) { bothHaveSucceeded());
}
</code>```

Title: Extjs: two parallel ajax call


问:
spring-jdbc: How to manage transactions using namedJdbcTemplate to do CRUD with Oracle db
As the following code, I use spring-jdbc to access Oracle db. I use namedJdbcTemplate to update and insert.

Now I want to manage transaction with DatasourceTransactionManager. What can I do to code this?

Dao code:

```<code>@Autowired
@Qualifier("svsJdbcTemplate")
JdbcTemplate jdbcTemplate;

protected NamedParameterJdbcTemplate namedJdbcTemplate;

private static final Logger logger = LoggerFactory
        .getLogger(DashboardDaoImpl.class);

@PostConstruct
public void setup() {
    namedJdbcTemplate = new NamedParameterJdbcTemplate(
            jdbcTemplate.getDataSource());
}
</code>```

application-jdbc.xml configuration:

```<code><bean id="svsJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <property name="dataSource" ref="svsDataSource"></property>
</bean>

<!-- JNDI Data Source -->
<bean id="svsDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<!--
    <property name="resourceRef" value="true" />
    <property name="jndiName" value="jdbc/svsDB" />
 -->
    <property name="jndiName" value="java:comp/env/jdbc/svsDB"/>
</bean>

<tx:annotation-driven proxy-target-class="true"
    transaction-manager="transactionManager" />

<!-- Creating TransactionManager Bean, since JDBC we are creating of type
    DataSourceTransactionManager -->
<bean id="transactionManager"
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="svsDataSource" />
</bean>
</code>```

答:
In the spring config file replace

```<code><bean id="svsJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <property name="dataSource" ref="svsDataSource"></property>
</bean>
</code>```

with

```<code><bean id="svsJdbcTemplate"
 class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
<constructor-arg ref="dataSource"></constructor-arg>
</bean>
</code>```

and in the dao class autowire svsJdbcTemplate as follows.

```<code>@Autowired
NamedParameterJdbcTemplate  svsJdbcTemplate;
</code>```

Now for managing the transactions use the @Transactional annotation in the service classes.

Body:
As the following code, I use spring-jdbc to access Oracle db. I use namedJdbcTemplate to update and insert.

Now I want to manage transaction with DatasourceTransactionManager. What can I do to code this?

Dao code:

@Autowired
@Qualifier("svsJdbcTemplate")
JdbcTemplate jdbcTemplate;

protected NamedParameterJdbcTemplate namedJdbcTemplate;

private static final Logger logger = LoggerFactory
        .getLogger(DashboardDaoImpl.class);

@PostConstruct
public void setup() {
    namedJdbcTemplate = new NamedParameterJdbcTemplate(
            jdbcTemplate.getDataSource());
}

application-jdbc.xml configuration:

<bean id="svsJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <property name="dataSource" ref="svsDataSource"></property>
</bean>

<bean id="svsDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">

    <property name="jndiName" value="java:comp/env/jdbc/svsDB"/>
</bean>

<tx:annotation-driven proxy-target-class="true"
    transaction-manager="transactionManager" />

<bean id="transactionManager"
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="svsDataSource" />
</bean>

Body:
In the spring config file replace

<bean id="svsJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
    <property name="dataSource" ref="svsDataSource"></property>
</bean>

with

<bean id="svsJdbcTemplate"
 class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate">
<constructor-arg ref="dataSource"></constructor-arg>
</bean>

and in the dao class autowire svsJdbcTemplate as follows.

@Autowired
NamedParameterJdbcTemplate  svsJdbcTemplate;

Now for managing the transactions use the @Transactional annotation in the service classes.


问:
MS Access import and append type conversion fail on date field
I am trying to import data from a text file and append it to a table in an MS Access 2010 database. All data imports and appends properly, with the exception of a date field.

The date field is in the format: yyyy-mm-dd hh:mm:ss

I can import the text file into a new table without issue. This works if I specify the field as text or date/time with various foramts. Where it fails is when I try to append it to an existing table. It does not matter whether the destination field data type is text or date/time.

It isn't the end of the world if I have to import the text file into a new table. But I find it very strange that I cannot import data form a text file to a text field.

If anyone can shed some light on what is causing this issue I would be very grateful.

答:
I had the same issue last week and believe it or not it took me a full day to sort it out.

I was creating a link to an Excel document where I was importing records to a table through an import query. All good except the date field which Access had mapped it like Text (the first 80-100 records of the field were blank, then a date and then blanks again).

Long story short, I tried a number of different approaches but on all of them I was getting a datatype mismatch error so I ended up with the solution below.

In my import query:

```<code>IIF(IsNull([Date Field]),NULL,CDate([Date Field]))
</code>```

Body:
I had the same issue last week and believe it or not it took me a full day to sort it out.

I was creating a link to an Excel document where I was importing records to a table through an import query. All good except the date field which Access had mapped it like Text (the first 80-100 records of the field were blank, then a date and then blanks again).

Long story short, I tried a number of different approaches but on all of them I was getting a datatype mismatch error so I ended up with the solution below.

In my import query:

IIF(IsNull([Date Field]),NULL,CDate([Date Field]))


问:
how to set an parameter to not filter the SQL query when not set
I have a page with a list of artists and three buttons; photographers, makeup artists, all

I want to query the database to select each type through $_GET when any of the buttons is clicked which is easy for the first two I can set the url to ?type=photographers

however when I want to set the type to all, there's no value in the type column called all, i tried to set the type to * but it doesn't work

```<code>SELECT name, location, score, type FROM artists WHERE type = ?
</code>```

how to set type to show all what should the variable be equal to?

edit: I'm already using the !empty method, now I want to add more rules to my query and it's getting complicated, any other solution where I don't have to have two queries in the if and else?

答:
The following code block will do across the issue you are facing: </p>

```<code>$query = "SELECT name, location, score, type FROM artists";
if(!empty($_GET)) {
    $whereArgs = "WHERE type = ".$_GET['your-query-string'];
}
// Run your query using `$query` here.
</code>```

Body:
I have a page with a list of artists and three buttons; photographers, makeup artists, all

I want to query the database to select each type through $_GET when any of the buttons is clicked which is easy for the first two I can set the url to ?type=photographers

however when I want to set the type to all, there's no value in the type column called all, i tried to set the type to * but it doesn't work

SELECT name, location, score, type FROM artists WHERE type = ?

how to set type to show all what should the variable be equal to?

edit: I'm already using the !empty method, now I want to add more rules to my query and it's getting complicated, any other solution where I don't have to have two queries in the if and else?

Body:
The following code block will do across the issue you are facing:

$query = "SELECT name, location, score, type FROM artists";
if(!empty($_GET)) {
    $whereArgs = "WHERE type = ".$_GET['your-query-string'];
}
// Run your query using `$query` here.


问:
Replacing outlier 2.5%, 97.5% code error in R
I used the following code to try to replace variables's value that are below the bottom 2.5% and above the top 97.5% with specific values.You can perform that code. It provides open data file.

```<code>credit<-read.csv("http://freakonometrics.free.fr/german_credit.csv", header=TRUE)
fun <- function(x){
  quantiles <- quantile( x, c(.025, .975 ) )
  x[ x < quantiles[1] ] <- quantiles[1]
  x[ x > quantiles[2] ] <- quantiles[2]
  x
}
fun(credit)
</code>```

But the error message is appeared.

```<code>Error in `[.data.frame`(x, order(x, na.last = na.last, decreasing = decreasing)) :
  undefined columns selected
</code>```

What's the problem? I happy to any help!

+Addition comment

I found that the above function does not work in the data frame but works only in the vector.

I can change the outlier of each variable in the data file with the following code:

```<code>credit$Duration.of.Credit..month. <- pmax(quantile(credit$Duration.of.Credit..month.,.025),
                                          pmin(credit$Duration.of.Credit..month., quantile(credit$Duration.of.Credit..month.,.975)))
</code>```

However, my data file has so many variables that it is inconvenient to enter code one by one.

So how can I change the outliers of the variables that a specific value not pmax&pmin?

答:
There's actually nothing wrong with your function as long as you apply it to a column. I'd use mutate_at or mutate_all (if you really want to apply it to all columns) of the dplyr package. Something like this:

```<code>library(dplyr)
credit_trunc <- credit %>%
   mutate_at(vars(Credit.Amount, Creditability), funs(fun))
</code>```

or

```<code>credit_trunc <- credit %>%
   mutate_all(funs(fun))
</code>```

or if you also have columns of another type (e.g. factor, character) in your data frame, you can use:

```<code> credit_trunc <- credit %>%
   mutate_if(is.numeric, funs(fun))
</code>```

This will give you back the data frame with the chosen / all columns / all numeric columns modified as you wanted it.

Body:
I used the following code to try to replace variables's value that are below the bottom 2.5% and above the top 97.5% with specific values.You can perform that code. It provides open data file.

credit<-read.csv("http://freakonometrics.free.fr/german_credit.csv", header=TRUE)
fun <- function(x){
  quantiles <- quantile( x, c(.025, .975 ) )
  x[ x < quantiles[1] ] <- quantiles[1]
  x[ x > quantiles[2] ] <- quantiles[2]
  x
}
fun(credit)

But the error message is appeared.

Error in `[.data.frame`(x, order(x, na.last = na.last, decreasing = decreasing)) :
  undefined columns selected

What's the problem? I happy to any help!

+Addition comment

I found that the above function does not work in the data frame but works only in the vector.

I can change the outlier of each variable in the data file with the following code:

credit$Duration.of.Credit..month. <- pmax(quantile(credit$Duration.of.Credit..month.,.025),
                                          pmin(credit$Duration.of.Credit..month., quantile(credit$Duration.of.Credit..month.,.975)))

However, my data file has so many variables that it is inconvenient to enter code one by one.

So how can I change the outliers of the variables that a specific value not pmax&pmin?

Body:
There's actually nothing wrong with your function as long as you apply it to a column. I'd use mutate_at or mutate_all (if you really want to apply it to all columns) of the dplyr package. Something like this:

library(dplyr)
credit_trunc <- credit %>%
   mutate_at(vars(Credit.Amount, Creditability), funs(fun))

or

credit_trunc <- credit %>%
   mutate_all(funs(fun))

or if you also have columns of another type (e.g. factor, character) in your data frame, you can use:

 credit_trunc <- credit %>%
   mutate_if(is.numeric, funs(fun))

This will give you back the data frame with the chosen / all columns / all numeric columns modified as you wanted it.


问:
How to manipulate php time data and get a result in hour:minute format
I am trying to create a program where it calculates start hour and finish hour and gets the time in between to see how many hours have been worked (the start and stop variables are replaced by time values from a database in the real code)

Here is an example:

```<code>$start = "11:15:35"
$stop = "17:30:13"

$start2 = date( 'G:i' ,strtotime($start) );
$stop2 = date( 'G:i' ,strtotime($stop) );

echo $stop2 ."<br>". $start2;
echo "<br><br>";
echo $stop2 - $start2;
</code>```

I need the code to output something like 6.25 or 6h and 15min, currently it is only doing hours and outputting just a 6.

i have tried
$stop2[1] & start2[1]

and changing around the 'G:i' bit with various other letters from http://php.net/manual/en/function.date.php

Sorry if this is a simple question, any answers appreciated!

Edit: misspelt minute

答:
Simple way to get the difference between time as follows</p>

```

    $a = new DateTime('11:15:35');
    $b = new DateTime('17:30:13');
    $interval = $a->diff($b);

    echo $interval->format("%H:%i:%S");

```

Body:
I am trying to create a program where it calculates start hour and finish hour and gets the time in between to see how many hours have been worked (the start and stop variables are replaced by time values from a database in the real code)

Here is an example:

$start = "11:15:35"
$stop = "17:30:13"

$start2 = date( 'G:i' ,strtotime($start) );
$stop2 = date( 'G:i' ,strtotime($stop) );

echo $stop2 ."
". $start2;
echo "

";
echo $stop2 - $start2;

I need the code to output something like 6.25 or 6h and 15min, currently it is only doing hours and outputting just a 6.

i have tried
$stop2[1] & start2[1]

and changing around the 'G:i' bit with various other letters from http://php.net/manual/en/function.date.php

Sorry if this is a simple question, any answers appreciated!

Edit: misspelt minute

Body:
Simple way to get the difference between time as follows

    $a = new DateTime('11:15:35');
    $b = new DateTime('17:30:13');
    $interval = $a->diff($b);

    echo $interval->format("%H:%i:%S");


问:
MSBuild 2015 publish: Can't find the valid AspnetMergePath
I have a build on TeamCity that packages a web project ready for later deployment, currently using MSBuild 2013. When I pushed some code recently I got build errors (due to the fact that I was using some C# 6 features) so I went to change the build configuration to use MSBuild 2015 instead and got this error:

[Error] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(132, 5): Can't find the valid AspnetMergePath

This error has been mentioned in other questions before (such as here: VS 2012 Publish: Can't find the valid AspnetMergePath) but unfortunately none of the fixes mentioned in those questions have worked for me.

Things I have already tried or were already the case:

Web and WebApplication directories from local machine (at C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0) have been copied up to build server (they've always been there)

Added
<TargetFrameworkSDKToolsDirectory>C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\</TargetFrameworkSDKToolsDirectory> to
Microsoft.Web.Publishing.AspNetCompileMerge.targets file

Added /p:AspnetMergePath="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\" to MSBuild command

I'm at a bit of a loss with this one: pretty much the only thing I haven't tried is installing Visual Studio on the build server, but I'd really like to avoid that if I can (because I think it's ridiculous that you should have to install a full IDE on a CI server!).

Some further info:

everything continues to work just fine if you switch the build back to MSBuild 2013 (although, obviously, we don't want to get stuck in the past)

we have a number of other pure compilation builds that are running against MSBuild 2015 with no errors

答:
The accepted answer is just symptom treatment and doesn't address the underlying issue. Please run MSBuild with diagnostic logging. If you look at the Microsoft.Web.Publishing.AspNetCompileMerge.targets you will see that it attempts to concatenate TargetFrameworkSDKToolsDirectory with AspnetMergeName. If you search in your MSBuild log, you will find that TargetFrameworkSDKToolsDirectory is empty. TargetFrameworkSDKToolsDirectory is build from TargetFrameworkSDKDirectory which is also empty.

That is what you need to fix. In my case:

Install the Windows 7.1 SDK (using this workaround on Windows Server 2016).

In VS2017 the path is determined based on /configuration/msbuildToolsets/toolset/property[@name="FrameworkSDKRoot] which is in my case Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\NETFXSDK\4.6.1@InstallationFolder. In my case this node was only available in the WOW6432Node, it needs to be available in the 64-bit registry too. You need to copy the node to the equivalent location in the 64-bit registry.