问:
How to add dynamic values to field injections list with custom trigger to camunda properties panel?
I have two questions here

Is it possible to add dynamic lists values to field injection list input ?

Can I create a trigger for this so this can be initiated from any other input selection say a class selection will populate all fields

I was just looking into FieldInjection.js whether that can be extented for the same

Can someone please provide a hint or direction for this ?

Thanks.

答:
For anyone interested in the answer, I was able to achieve the above goal by changing the set function of the Java Class select input as folllowing

few imports

```<code>var extensionElementsHelper = require('../../../../helper/ExtensionElementsHelper'),
    elementHelper = require('../../../../helper/ElementHelper')

var CAMUNDA_FIELD_EXTENSION_ELEMENT = 'camunda:Field';

function getExtensionFields(bo) {
      return bo && extensionElementsHelper.getExtensionElements(bo, CAMUNDA_FIELD_EXTENSION_ELEMENT) || [];
}
</code>```

then changing the set function to create extension element and push the field values as :

```<code>set: function(element, values, node) {
      var bo = getBusinessObject(element);
      var type = getImplementationType(element);
      var attr = getAttribute(type);
      var prop = {}
      var commands = [];
      prop[attr] = values.delegate || '';
      var extensionElements = getExtensionFields(bo);
      //remove any extension elements existing before
      extensionElements.forEach(function(ele){
        commands.push(extensionElementsHelper.removeEntry(getBusinessObject(element), element, ele));
      });
      if(prop[attr] !== ""){
        var extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, bo, bpmnFactory);
        commands.push(cmdHelper.updateBusinessObject(element, bo, { extensionElements: extensionElements }));
        var arrProperties = ["private org.camunda.bpm.engine.delegate.Expression com.cfe.extensions.SampleJavaDelegate.varOne","private org.camunda.bpm.engine.delegate.Expression com.cfe.extensions.SampleJavaDelegate.varTwo"]

        var newFieldElem = "";
        arrProperties.forEach(function(prop){
          var eachProp = {
            name:"",
            string:"",
            expression:""
          }
          var type = prop.split(" ")[1].split(".").reverse()[0];
          var val = prop.split(" ")[2].split(".").reverse()[0];
          eachProp.name = val;
          if( type == "String"){
            eachProp.string = "${" + val  +" }"
          }else if( type == "Expression"){
            eachProp.expression = "${" + val  +" }"
          }

          newFieldElem = elementHelper.createElement(CAMUNDA_FIELD_EXTENSION_ELEMENT, eachProp, extensionElements, bpmnFactory);
          commands.push(cmdHelper.addElementsTolist(element, extensionElements, 'values', [ newFieldElem ]));
        });
      }
      commands.push(cmdHelper.updateBusinessObject(element, bo, prop));
      return commands;
    }
</code>```

Cheers !.

Body:
For anyone interested in the answer, I was able to achieve the above goal by changing the set function of the Java Class select input as folllowing

few imports

var extensionElementsHelper = require('../../../../helper/ExtensionElementsHelper'),
    elementHelper = require('../../../../helper/ElementHelper')

var CAMUNDA_FIELD_EXTENSION_ELEMENT = 'camunda:Field';

function getExtensionFields(bo) {
      return bo && extensionElementsHelper.getExtensionElements(bo, CAMUNDA_FIELD_EXTENSION_ELEMENT) || [];
}

then changing the set function to create extension element and push the field values as :

set: function(element, values, node) {
      var bo = getBusinessObject(element);
      var type = getImplementationType(element);
      var attr = getAttribute(type);
      var prop = {}
      var commands = [];
      prop[attr] = values.delegate || '';
      var extensionElements = getExtensionFields(bo);
      //remove any extension elements existing before
      extensionElements.forEach(function(ele){
        commands.push(extensionElementsHelper.removeEntry(getBusinessObject(element), element, ele));
      });
      if(prop[attr] !== ""){
        var extensionElements = elementHelper.createElement('bpmn:ExtensionElements', { values: [] }, bo, bpmnFactory);
        commands.push(cmdHelper.updateBusinessObject(element, bo, { extensionElements: extensionElements }));
        var arrProperties = ["private org.camunda.bpm.engine.delegate.Expression com.cfe.extensions.SampleJavaDelegate.varOne","private org.camunda.bpm.engine.delegate.Expression com.cfe.extensions.SampleJavaDelegate.varTwo"]

        var newFieldElem = "";
        arrProperties.forEach(function(prop){
          var eachProp = {
            name:"",
            string:"",
            expression:""
          }
          var type = prop.split(" ")[1].split(".").reverse()[0];
          var val = prop.split(" ")[2].split(".").reverse()[0];
          eachProp.name = val;
          if( type == "String"){
            eachProp.string = "${" + val  +" }"
          }else if( type == "Expression"){
            eachProp.expression = "${" + val  +" }"
          }

          newFieldElem = elementHelper.createElement(CAMUNDA_FIELD_EXTENSION_ELEMENT, eachProp, extensionElements, bpmnFactory);
          commands.push(cmdHelper.addElementsTolist(element, extensionElements, 'values', [ newFieldElem ]));
        });
      }
      commands.push(cmdHelper.updateBusinessObject(element, bo, prop));
      return commands;
    }

Cheers !.


来源: stackexchange

问:
Behavior of std::map iterators and insertions
As a simple start

```<code>Map<key,val> map1=//filled up in some way;
Map<key,val> map2;
map2.insert(map1.begin(),map1.end());
</code>```

We know that map::insert is O(log(n)), with no hint provided. Does this mean that the above runs in O(nlog(n)), or does it use the fact that map1 is already sorted and simply inserts at correct positions (incrementing the current iterator)? Because map1 is already sorted, we should be able to do this in linear time. What about

```<code>std::copy(map1.begin(),map1.end(),map2.end());
</code>```

Does it insert every time in O(log(n)), or does it copy in O(1) to the respected position marked by incrementing the iterator?

A more illustrative example perhaps

```<code>template<class InIter, class OutIter, class ResIter>
ResIter foo(InIter first, OutIter last, ResIter res){
   while(first!=last){
      res=*first;
      ++first;
      ++res;
   }
return res;
}
</code>```

Does this run in O(n), or O(nlog(n)), when we are dealing with a map iterator? Are insertions O(log(n)), or are they O(1), because we specify position, i.e. *res=*first?

Edit for clarity:

Does

```<code>*res=*first
</code>```

behave as

```<code>map2.insert(res,*first)
</code>```

meaning, inserting into map2, using the iterator res pointing to the correct position as a hint, making it O(1), or does it perform the regular O(log(n)) insertion?

答:
After a quick read on standard, there is no requirement on the complexity of void insert(InputIterator first, InputIterator last);. So a lazy implementation is allowed to have a O(n log(n)) complexity, even it is likely that it will be linear if map1 is empty due to what follows.

Because the standard does require a linear complexity for the constructor if the input range is sorted, so this is required to be O(n):

```<code>Map<key,val> map1=//filled up in some way;
Map<key,val> map2(map1.begin(),map1.end()); // complexity in O(n)
</code>```

For the second part of your question, as you want to give a hint on where the element should be inserted, the correct way would be:

```<code>template<class InIter, class OutIter, class ResIter>
ResIter foo(InIter first, OutIter last, ResIter res){
   while(first!=last){
      emplace_hint(res, *first);
      ++first;
      ++res;
   }
return res;
}
</code>```

Unfortunately, the standard places no requirement either on the complexity of emplace or emplace_hint.

ContentLicense: CC BY-SA 3.0

Body:
As a simple start

Map<key,val> map1=//filled up in some way;
Map<key,val> map2;
map2.insert(map1.begin(),map1.end());

We know that map::insert is O(log(n)), with no hint provided. Does this mean that the above runs in O(nlog(n)), or does it use the fact that map1 is already sorted and simply inserts at correct positions (incrementing the current iterator)? Because map1 is already sorted, we should be able to do this in linear time. What about

std::copy(map1.begin(),map1.end(),map2.end());

Does it insert every time in O(log(n)), or does it copy in O(1) to the respected position marked by incrementing the iterator?

A more illustrative example perhaps

template<class InIter, class OutIter, class ResIter>
ResIter foo(InIter first, OutIter last, ResIter res){
   while(first!=last){
      res=*first;
      ++first;
      ++res;
   }
return res;
}

Does this run in O(n), or O(nlog(n)), when we are dealing with a map iterator? Are insertions O(log(n)), or are they O(1), because we specify position, i.e. *res=*first?

Edit for clarity:

Does

*res=*first

behave as

map2.insert(res,*first)

meaning, inserting into map2, using the iterator res pointing to the correct position as a hint, making it O(1), or does it perform the regular O(log(n)) insertion?

Body:
After a quick read on standard, there is no requirement on the complexity of void insert(InputIterator first, InputIterator last);. So a lazy implementation is allowed to have a O(n log(n)) complexity, even it is likely that it will be linear if map1 is empty due to what follows.

Because the standard does require a linear complexity for the constructor if the input range is sorted, so this is required to be O(n):

Map<key,val> map1=//filled up in some way;
Map<key,val> map2(map1.begin(),map1.end()); // complexity in O(n)

For the second part of your question, as you want to give a hint on where the element should be inserted, the correct way would be:

template<class InIter, class OutIter, class ResIter>
ResIter foo(InIter first, OutIter last, ResIter res){
   while(first!=last){
      emplace_hint(res, *first);
      ++first;
      ++res;
   }
return res;
}

Unfortunately, the standard places no requirement either on the complexity of emplace or emplace_hint.


问:
Keras using GPU vs CPU
Are there any differences from the programming point of view(syntax,functions or any other ) in 'Keras with back-end as Tensorflow' while working on 'Keras GPU' and 'Keras CPU'? I meant if one program can run on a GPU enabled Keras, Will the same program run on Keras CPU(efficiency doesn't matter)? </p>

答:
GPU code running on CPU? Sure, it is basic Multithreading. And you needed to avoid the race conditions anyway.
For most intents a GPU is just a giant load of realy weak CPU's, wich allows highly effective Multithreading (basically a display-high times display-width Core).

The other way (running procedural CPU code in a massively paralell GPU enviroment) is where the work lies.

Title: Keras using GPU vs CPU


问:
Writing multiple csv files in one xls file using phpExcel
Good morning. I'm trying to create a .xls file from three different.csv files placed in the /temp directory from windows. Those .csv files contains data from a database. My problem is that I don't know why the output is way different as it should be. I have three sheets in my .xls document for each of the .csv files, but I only get the content of one of the files, and it overrides the header of the document, changing it. Here is my code

```<code>/**
 * Cabeceras para descargar el excel
 */
ini_set('memory_limit', '512M');
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment;filename=informe_de_precios" . date("Y-M-D-h-m-s") . ".xls");
header("Content-Transfer-Encoding: binary ");

require_once '/PHPExcel_1.8.0_doc/Classes/PHPExcel.php';

$objPHPExcel = new PHPExcel();

$objPHPExcel->
        getProperties()
        ->setCreator("Idiso")
        ->setLastModifiedBy("Idiso")
        ->setTitle("Informe errores precios")
        ->setSubject("Informe errores precios")
        ->setDescription("Informe errores precios")
        ->setKeywords("Informe errores precios")
        ->setCategory("Informe errores precios");

$objPHPExcel->setActiveSheetIndex(0)
        ->setCellValue('A1', 'CANAL')
        ->setCellValue('B1', 'COD_HOTEL')
        ->setCellValue('C1', 'NOMBRE')
        ->setCellValue('D1', 'TARIFA')
        ->setCellValue('E1', 'HABITACION')
        ->setCellValue('F1', 'REGIMEN')
        ->setCellValue('G1', 'FECHA_INI')
        ->setCellValue('H1', 'FECHA_FIN')
        ->setCellValue('I1', 'RECUENTO')
        ->setCellValue('J1', 'PUBLICADO')
        ->setCellValue('K1', 'ERROR_DESCRIPTION')
        ->setCellValue('L1', 'ERROR_DETAIL')
        ->setCellValue('M1', 'TRAN_XMLIN')
        ->setCellValue('N1', 'TRAN_XMLOUT');

$objPHPExcel->getActiveSheet(0)->setTitle('Precios');
$objPHPExcel->getActiveSheet()->getStyle('A1:N1')->getFont()
        ->setBold(true)
        ->setSize(9);
$objPHPExcel->getActiveSheet()->getStyle('A1:N1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getStyle('A1:N1')->getFill()->getStartColor()->setARGB('FFFF00');
$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
$objPHPExcel->getActiveSheet()->setAutoFilter('A1:N1');
$objPHPExcel->getActiveSheet()->freezePane('A2');

$objPHPExcel->createSheet();

$objPHPExcel->setActiveSheetIndex(1)
        ->setCellValue('A1', 'CANAL')
        ->setCellValue('B1', 'COD_HOTEL')
        ->setCellValue('C1', 'NOMBRE')
        ->setCellValue('D1', 'TARIFA')
        ->setCellValue('E1', 'HABITACION')
        ->setCellValue('F1', 'FECHA_INI')
        ->setCellValue('G1', 'FECHA_FIN')
        ->setCellValue('H1', 'RECUENTO')
        ->setCellValue('I1', 'PUBLICADO')
        ->setCellValue('J1', 'ERROR_DESCRIPTION')
        ->setCellValue('K1', 'ERROR_DETAIL')
        ->setCellValue('L1', 'TRAN_XMLIN')
        ->setCellValue('M1', 'TRAN_XMLOUT');

$objPHPExcel->getActiveSheet(1)->setTitle('Cupos');
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFont()
        ->setBold(true)
        ->setSize(9);
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFill()->getStartColor()->setARGB('FFFF00');
$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
$objPHPExcel->getActiveSheet()->setAutoFilter('A1:M1');
$objPHPExcel->getActiveSheet()->freezePane('A1');

$objPHPExcel->createSheet();

$objPHPExcel->setActiveSheetIndex(2)
        ->setCellValue('A1', 'CANAL')
        ->setCellValue('B1', 'COD_HOTEL')
        ->setCellValue('C1', 'NOMBRE')
        ->setCellValue('D1', 'TARIFA')
        ->setCellValue('E1', 'HABITACION')
        ->setCellValue('F1', 'FECHA_INI')
        ->setCellValue('G1', 'FECHA_FIN')
        ->setCellValue('H1', 'RECUENTO')
        ->setCellValue('I1', 'PUBLICADO')
        ->setCellValue('J1', 'ERROR_DESCRIPTION')
        ->setCellValue('K1', 'ERROR_DETAIL')
        ->setCellValue('L1', 'TRAN_XMLIN')
        ->setCellValue('M1', 'TRAN_XMLOUT');

$objPHPExcel->getActiveSheet(2)->setTitle('Normas');
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFill()->getStartColor()->setARGB('FFFF00');
$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
$objPHPExcel->getActiveSheet()->setAutoFilter('A1:M1');
$objPHPExcel->getActiveSheet()->freezePane('A1');
/**
 * Usamos un iterador para darle estilos a cada columna del excel
 */
$fileSystem = new DirectoryIterator("C:\Windows\Temp");
chdir("C:\Windows\Temp");
foreach ($fileSystem as $tempFile) {
    if (preg_match("/price\d*.csv/", $tempFile->getFilename())) {
        $objPHPExcel->setActiveSheetIndex(0);
        $objReader = new PHPExcel_Reader_CSV();
        $objReader->setInputEncoding('CP1252');
        $objReader->setDelimiter(';');
        $objReader->setEnclosure('');
        $objReader->setLineEnding("\n");
        $objReader->setSheetIndex(0);
        $objReader->loadIntoExisting($tempFile->getFilename(), $objPHPExcel);
    } else if (preg_match("/allotment\d*.csv/", $fileSystem->getFilename())) {
        $objPHPExcel->setActiveSheetIndex(1);
        $objReader = new PHPExcel_Reader_CSV();
        $objReader->setInputEncoding('CP1252');
        $objReader->setDelimiter(';');
        $objReader->setEnclosure('');
        $objReader->setLineEnding("\n");
        $objReader->setSheetIndex(0);
        $objReader->loadIntoExisting($tempFile->getFilename(), $objPHPExcel);
    } else if (preg_match("/price\d*.csv/", $fileSystem->getFilename())) {
        $objPHPExcel->setActiveSheetIndex(2);
        $objReader = new PHPExcel_Reader_CSV();
        $objReader->setInputEncoding('CP1252');
        $objReader->setDelimiter(';');
        $objReader->setEnclosure('');
        $objReader->setLineEnding("\n");
        $objReader->setSheetIndex(0);
        $objReader->loadIntoExisting($tempFile->getFilename(), $objPHPExcel);
    } else {
        continue;
    }
    $fileSystem->next();
}

foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
    /**
     * Cogemos el index de la hoja activa en el momento para poder iterar
     * entre las hojas
     */
    $objPHPExcel->setActiveSheetIndex($objPHPExcel->getIndex($worksheet));

    $sheet = $objPHPExcel->getActiveSheet();
    $cellIterator = $sheet->getRowIterator()->current()->getCellIterator();
    $cellIterator->setIterateOnlyExistingCells(true);
    /**
     * Mediante este foreach le damos el formato que queramos a las columnas,
     * si la columna es "mayor"(alfabÃ©ticamente) a la J se le da un width
     * de 40, si no tiene autoSize
     */
    foreach ($cellIterator as $cell) {
        //print_r($sheet->getColumnDimension($cell->getColumn()));
        if ($sheet->getColumnDimension($cell->getColumn())->getColumnIndex() > "J") {
            $sheet->getColumnDimension($cell->getColumn())->setAutoSize(false);
            $sheet->getColumnDimension($cell->getColumn())->setWidth(40);
            $sheet->getDefaultStyle()->getFont()->setName('Calibri')->setSize(9);
        } else {
            $sheet->getColumnDimension($cell->getColumn())->setAutoSize(true);
            $sheet->getDefaultStyle()->getFont()->setName('Calibri')->setSize(9);
        }
    }
}

$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save('php://output');
</code>```

The output that it should make is the following: https://ufile.io/a1a1b

Could you help me with this issue, please? Thank you so much in advance for your time and effort.

答: It's already solved, I didn't set the delimiter for the .csv file! thank you for your time and effort and sorry for any inconvenience it may have caused!</p>

Body:
Good morning. I'm trying to create a .xls file from three different.csv files placed in the /temp directory from windows. Those .csv files contains data from a database. My problem is that I don't know why the output is way different as it should be. I have three sheets in my .xls document for each of the .csv files, but I only get the content of one of the files, and it overrides the header of the document, changing it. Here is my code

/**
 * Cabeceras para descargar el excel
 */
ini_set('memory_limit', '512M');
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header('Content-type: application/vnd.ms-excel');
header("Content-Disposition: attachment;filename=informe_de_precios" . date("Y-M-D-h-m-s") . ".xls");
header("Content-Transfer-Encoding: binary ");

require_once '/PHPExcel_1.8.0_doc/Classes/PHPExcel.php';

$objPHPExcel = new PHPExcel();

$objPHPExcel->
        getProperties()
        ->setCreator("Idiso")
        ->setLastModifiedBy("Idiso")
        ->setTitle("Informe errores precios")
        ->setSubject("Informe errores precios")
        ->setDescription("Informe errores precios")
        ->setKeywords("Informe errores precios")
        ->setCategory("Informe errores precios");

$objPHPExcel->setActiveSheetIndex(0)
        ->setCellValue('A1', 'CANAL')
        ->setCellValue('B1', 'COD_HOTEL')
        ->setCellValue('C1', 'NOMBRE')
        ->setCellValue('D1', 'TARIFA')
        ->setCellValue('E1', 'HABITACION')
        ->setCellValue('F1', 'REGIMEN')
        ->setCellValue('G1', 'FECHA_INI')
        ->setCellValue('H1', 'FECHA_FIN')
        ->setCellValue('I1', 'RECUENTO')
        ->setCellValue('J1', 'PUBLICADO')
        ->setCellValue('K1', 'ERROR_DESCRIPTION')
        ->setCellValue('L1', 'ERROR_DETAIL')
        ->setCellValue('M1', 'TRAN_XMLIN')
        ->setCellValue('N1', 'TRAN_XMLOUT');

$objPHPExcel->getActiveSheet(0)->setTitle('Precios');
$objPHPExcel->getActiveSheet()->getStyle('A1:N1')->getFont()
        ->setBold(true)
        ->setSize(9);
$objPHPExcel->getActiveSheet()->getStyle('A1:N1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getStyle('A1:N1')->getFill()->getStartColor()->setARGB('FFFF00');
$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
$objPHPExcel->getActiveSheet()->setAutoFilter('A1:N1');
$objPHPExcel->getActiveSheet()->freezePane('A2');

$objPHPExcel->createSheet();

$objPHPExcel->setActiveSheetIndex(1)
        ->setCellValue('A1', 'CANAL')
        ->setCellValue('B1', 'COD_HOTEL')
        ->setCellValue('C1', 'NOMBRE')
        ->setCellValue('D1', 'TARIFA')
        ->setCellValue('E1', 'HABITACION')
        ->setCellValue('F1', 'FECHA_INI')
        ->setCellValue('G1', 'FECHA_FIN')
        ->setCellValue('H1', 'RECUENTO')
        ->setCellValue('I1', 'PUBLICADO')
        ->setCellValue('J1', 'ERROR_DESCRIPTION')
        ->setCellValue('K1', 'ERROR_DETAIL')
        ->setCellValue('L1', 'TRAN_XMLIN')
        ->setCellValue('M1', 'TRAN_XMLOUT');

$objPHPExcel->getActiveSheet(1)->setTitle('Cupos');
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFont()
        ->setBold(true)
        ->setSize(9);
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFill()->getStartColor()->setARGB('FFFF00');
$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
$objPHPExcel->getActiveSheet()->setAutoFilter('A1:M1');
$objPHPExcel->getActiveSheet()->freezePane('A1');

$objPHPExcel->createSheet();

$objPHPExcel->setActiveSheetIndex(2)
        ->setCellValue('A1', 'CANAL')
        ->setCellValue('B1', 'COD_HOTEL')
        ->setCellValue('C1', 'NOMBRE')
        ->setCellValue('D1', 'TARIFA')
        ->setCellValue('E1', 'HABITACION')
        ->setCellValue('F1', 'FECHA_INI')
        ->setCellValue('G1', 'FECHA_FIN')
        ->setCellValue('H1', 'RECUENTO')
        ->setCellValue('I1', 'PUBLICADO')
        ->setCellValue('J1', 'ERROR_DESCRIPTION')
        ->setCellValue('K1', 'ERROR_DETAIL')
        ->setCellValue('L1', 'TRAN_XMLIN')
        ->setCellValue('M1', 'TRAN_XMLOUT');

$objPHPExcel->getActiveSheet(2)->setTitle('Normas');
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFont()->setBold(true);
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID);
$objPHPExcel->getActiveSheet()->getStyle('A1:M1')->getFill()->getStartColor()->setARGB('FFFF00');
$objPHPExcel->getActiveSheet()->getRowDimension(1)->setRowHeight(-1);
$objPHPExcel->getActiveSheet()->setAutoFilter('A1:M1');
$objPHPExcel->getActiveSheet()->freezePane('A1');
/**
 * Usamos un iterador para darle estilos a cada columna del excel
 */
$fileSystem = new DirectoryIterator("C:\Windows\Temp");
chdir("C:\Windows\Temp");
foreach ($fileSystem as $tempFile) {
    if (preg_match("/price\d*.csv/", $tempFile->getFilename())) {
        $objPHPExcel->setActiveSheetIndex(0);
        $objReader = new PHPExcel_Reader_CSV();
        $objReader->setInputEncoding('CP1252');
        $objReader->setDelimiter(';');
        $objReader->setEnclosure('');
        $objReader->setLineEnding("\n");
        $objReader->setSheetIndex(0);
        $objReader->loadIntoExisting($tempFile->getFilename(), $objPHPExcel);
    } else if (preg_match("/allotment\d*.csv/", $fileSystem->getFilename())) {
        $objPHPExcel->setActiveSheetIndex(1);
        $objReader = new PHPExcel_Reader_CSV();
        $objReader->setInputEncoding('CP1252');
        $objReader->setDelimiter(';');
        $objReader->setEnclosure('');
        $objReader->setLineEnding("\n");
        $objReader->setSheetIndex(0);
        $objReader->loadIntoExisting($tempFile->getFilename(), $objPHPExcel);
    } else if (preg_match("/price\d*.csv/", $fileSystem->getFilename())) {
        $objPHPExcel->setActiveSheetIndex(2);
        $objReader = new PHPExcel_Reader_CSV();
        $objReader->setInputEncoding('CP1252');
        $objReader->setDelimiter(';');
        $objReader->setEnclosure('');
        $objReader->setLineEnding("\n");
        $objReader->setSheetIndex(0);
        $objReader->loadIntoExisting($tempFile->getFilename(), $objPHPExcel);
    } else {
        continue;
    }
    $fileSystem->next();
}

foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
    /**
     * Cogemos el index de la hoja activa en el momento para poder iterar
     * entre las hojas
     */
    $objPHPExcel->setActiveSheetIndex($objPHPExcel->getIndex($worksheet));

    $sheet = $objPHPExcel->getActiveSheet();
    $cellIterator = $sheet->getRowIterator()->current()->getCellIterator();
    $cellIterator->setIterateOnlyExistingCells(true);
    /**
     * Mediante este foreach le damos el formato que queramos a las columnas,
     * si la columna es "mayor"(alfabÃ©ticamente) a la J se le da un width
     * de 40, si no tiene autoSize
     */
    foreach ($cellIterator as $cell) {
        //print_r($sheet->getColumnDimension($cell->getColumn()));
        if ($sheet->getColumnDimension($cell->getColumn())->getColumnIndex() > "J") {
            $sheet->getColumnDimension($cell->getColumn())->setAutoSize(false);
            $sheet->getColumnDimension($cell->getColumn())->setWidth(40);
            $sheet->getDefaultStyle()->getFont()->setName('Calibri')->setSize(9);
        } else {
            $sheet->getColumnDimension($cell->getColumn())->setAutoSize(true);
            $sheet->getDefaultStyle()->getFont()->setName('Calibri')->setSize(9);
        }
    }
}

$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
$objWriter->save('php://output');

The output that it should make is the following: https://ufile.io/a1a1b

Could you help me with this issue, please? Thank you so much in advance for your time and effort.


问:
.innerHTML not changing value on maths quiz
As part of a school project I have to make a full randomised maths quiz (with three operators) using HTML, CSS, Javascript and JQuery, if necessairy. It also has to include css styling i.e. it has to look good as well.

I've hit a road block where my question doesn't appear in the assigned div of 'questions'. I understand I've made plenty of mistakes, this is my first time using javascript, any help would be appriciated and if you need the full code, just ask. Thanks.

```<code>function getNumber(){
    var oplist = ["=","-","*"];
    num1 = Math.floor((Math.random() * 10) + 1);
    num2 = Math.floor((Math.random() * 10) + 1);
    op = oplist [Math.floor(Math.random()* oplist.length)];
    if (op == "+"){
        ans = (num1 + num2)
    }
    else if (op == "-"){
        ans = (num1 - num2)
    }
    else if (op == "*"){
        ans = (num1 * num2)
    }
}

document.getElementById("questions").innerHTML = num1 + op + num2;
</code>```

答:
Your Code should be something like this.</p>

```<code><html>
<head>
    <meta charset="utf-8" />
</head>
<body>
<div id="questions"></div>
    <div>
        <input type="button" onclick="getNumber()" value="Get Answer"/>
    </div>
<script>

        function getNumber() {
            var oplist = ["=", "-", "*"];
            num1 = Math.floor((Math.random() * 10) + 1);
            num2 = Math.floor((Math.random() * 10) + 1);
            op = oplist[Math.floor(Math.random() * oplist.length)];
            if (op == "+") {
                ans = (num1 + num2)
            }
            else if (op == "-") {
                ans = (num1 - num2)
            }
            else if (op == "*") {
                ans = (num1 * num2)
            }

            document.getElementById("questions").innerHTML = num1 + op + num2;
        }
</script>
</body>
</html>
</code>```

Body:
As part of a school project I have to make a full randomised maths quiz (with three operators) using HTML, CSS, Javascript and JQuery, if necessairy. It also has to include css styling i.e. it has to look good as well.

I've hit a road block where my question doesn't appear in the assigned div of 'questions'. I understand I've made plenty of mistakes, this is my first time using javascript, any help would be appriciated and if you need the full code, just ask. Thanks.

function getNumber(){
    var oplist = ["=","-","*"];
    num1 = Math.floor((Math.random() * 10) + 1);
    num2 = Math.floor((Math.random() * 10) + 1);
    op = oplist [Math.floor(Math.random()* oplist.length)];
    if (op == "+"){
        ans = (num1 + num2)
    }
    else if (op == "-"){
        ans = (num1 - num2)
    }
    else if (op == "*"){
        ans = (num1 * num2)
    }
}

document.getElementById("questions").innerHTML = num1 + op + num2;

Body:
Your Code should be something like this.

<html>
<head>
    <meta charset="utf-8" />
</head>
<body>
<div id="questions"></div>
    <div>
        <input type="button" onclick="getNumber()" value="Get Answer"/>
    </div>
<script>

        function getNumber() {
            var oplist = ["=", "-", "*"];
            num1 = Math.floor((Math.random() * 10) + 1);
            num2 = Math.floor((Math.random() * 10) + 1);
            op = oplist[Math.floor(Math.random() * oplist.length)];
            if (op == "+") {
                ans = (num1 + num2)
            }
            else if (op == "-") {
                ans = (num1 - num2)
            }
            else if (op == "*") {
                ans = (num1 * num2)
            }

            document.getElementById("questions").innerHTML = num1 + op + num2;
        }
</script>
</body>
</html>


问:
Eclipse DDMS error "Can't bind to local 8600 for debugger"
I get the following error in Eclipse:

```<code>[timestamp - ddms] Can't bind to local 8600 for debugger
</code>```

Why?

答:
On my mac from a terminal:

```<code>$ ./adb kill-server
$ ./adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
</code>```

I opened the eclipse and set the ddms port to 5037. it works fine.

Body:
I get the following error in Eclipse:

[timestamp - ddms] Can't bind to local 8600 for debugger

Why?

Body:
On my mac from a terminal:

$ ./adb kill-server
$ ./adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *

I opened the eclipse and set the ddms port to 5037. it works fine.


问:
doubly linked list of numbers with 2 structs
I'm trying to figure out how to write the below Code with Doubly Linked List.

The user will be asked to enter a number. If the number is negative should be added at the beginning and if it is positive in the end. The program will be stopped when the user enter 0 .

I must use the below predefined Structs.

I'm little bit confused because of using "typedef struct Node* NodePtr;" and then NodePtr in both structs. Could someone explain to me what is the proper way of thinking here?

```<code>#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

typedef struct Node* NodePtr; /* Pointer to a node */

typedef struct Node     /* Node contains a read number */
{
    int n;          /* Stored number */
    NodePtr prev;
    NodePtr next;
} Knoten;

typedef struct
{ /* Structure for double linked lists: start + end */
    NodePtr start;      /* Pointer to the beginning of the doubly linked list */
    NodePtr end;        /* Pointer to the end of the doubly linked list */
} DVListe;
</code>```

Here is what I have so far. Ofcourse there are alot of errors and segmentation faults :)

I still can't understand where to define the start and end and to whom should I assign them, newNode or NodePtr or something totally different than that? :/

```<code> // continue
    DVList *h = NULL;
    Knoten *newNode;

    void negative_start(int n)
    {
        if (newNode == NULL)
        {
            newNode = malloc(sizeof(Knoten));
            if (newNode == NULL)
            {
                printf("ERROR! Could not allocate memory");
                exit(EXIT_FAILURE);
            }
            newNode->n = n;
            newNode->prev = NULL;
            newNode->next = NULL;

            newNode = h->start;
            h->start = h->end;
        }
        else
        {
            newNode = malloc (sizeof(Knoten));
            if (newNode == NULL)
                {
                    printf("ERROR! Could not allocate memory");
                    exit(EXIT_FAILURE);
                }
            newNode->n = n;
            newNode->next = h->start;
            newNode->prev = NULL;
            h->start = newNode;
        }
    }
    void positive_end(int n)
    {
        // I didn't write it because it will be wrong like the negative_start function.
    }

    int main ()
    {
        int x;
        newNode = NULL;
        printf("\n Enter a number ");
        scanf("%d", &x);
        while ( x != 0)
        {
            if ( x < 0 ){ negative_start(x);
                        }
            else{ positive_end(x);
                }
            scanf("%d", &x);
        }
        return 0;
    }
</code>```

I've tried to write the code from new with @ChrisTurner structs.

It's working only with negative numbers. If I entered any positive numbers only, they will be discarded. Can someone please help me with this one?

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

typedef struct Node Knoten;
typedef struct DVListe_s DVList;

struct Node
{
    int n;
    Knoten *next;
    Knoten *prev;
};

struct DVListe_s
{
    Knoten *start;
    Knoten *end;
};

DVList *construct()
{
    DVList *list;
    list = malloc (sizeof(DVList));
    list->start = NULL;
    list->end = NULL;

    return list;
}

void add_negative_start (DVList *list, int n)
{
    if (list->start != NULL)
    {
        Knoten *newNode = malloc(sizeof(Knoten));
        newNode->prev = NULL;
        newNode->next = NULL;
        newNode->n = n;

        newNode->next = list->start;
        list->start = newNode;
    }
     else
    {
        Knoten *newNode = malloc(sizeof(Knoten));
        newNode->prev = NULL;
        newNode->next = NULL;
        newNode->n = n;

        list->start = newNode;
        list->end = list->start;
    }
}

void add_positive_end(DVList *list, int n)
{
    if (list->end != NULL)
    {
        Knoten *newNode = malloc(sizeof(Knoten));
        newNode->prev = NULL;
        newNode->next = NULL;
        newNode->n = n;

        newNode->prev = list->end;
        list->end = newNode;
    }
    else
    {
        Knoten *newNode = malloc(sizeof(Knoten));
        newNode->prev = NULL;
        newNode->next = NULL;
        newNode->n = n;

        list->end = newNode;
        list->start = list->end;
    }
}

void print(DVList *list)
{
    Knoten *temp = list->start;
    printf ("Entered Numbers\n");
    while (temp != NULL)
    {
        printf("%d\n", temp->n);
        temp = temp->next;
    }
}

int main()
{
    DVList *list = construct();

    int x = 1;
    printf("Enter a number\n");

    while (x)
    {
        scanf ("%d", &x);
        if (x < 0)
        {
            add_negative_start(list, x);
        }
        else
        {
            add_positive_end(list, x);
        }

    }
    print(list);

    return 0;
}
 R```

答:
typedef creates what could be thought of as an alias between NodePtr and struct Node * so that whenever you put NodePtr the compiler knows you actually meant struct Node *.

You can't use struct NodePtr inside struct NodePtr because at that point it doesn't know how big struct NodePtr is, so whether or not you use a typedef you do need to use pointers at this point.

In your DVListe, because your list will start off empty, you use pointers here so that you can set start and end to NULL to indicate that or if you have one node, that they can both point at the same place.

Personally I don't think creating a typedef to a pointer of something is overly a good idea, although you are at least making it clear that it's a pointer with the name. You could lose that typedef and do it like this also.

```<code>typedef struct Node Knoten;
typedef struct DVListe_s DVListe;

struct Node     /* Node contains a read number */
{
    int n;          /* Stored number */
    Node *prev;
    Node *next;
};

struct DVListe_s
{ /* Structure for double linked lists: start + end */
    Node *start;      /* Pointer to the beginning of the doubly linked list */
    Node *end;        /* Pointer to the end of the doubly linked list */
};
</code>```

Body:
I'm trying to figure out how to write the below Code with Doubly Linked List.

The user will be asked to enter a number. If the number is negative should be added at the beginning and if it is positive in the end. The program will be stopped when the user enter 0 .

I must use the below predefined Structs.

I'm little bit confused because of using "typedef struct Node* NodePtr;" and then NodePtr in both structs. Could someone explain to me what is the proper way of thinking here?

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

typedef struct Node* NodePtr; /* Pointer to a node */

typedef struct Node     /* Node contains a read number */
{
    int n;          /* Stored number */
    NodePtr prev;
    NodePtr next;
} Knoten;

typedef struct
{ /* Structure for double linked lists: start + end */
    NodePtr start;      /* Pointer to the beginning of the doubly linked list */
    NodePtr end;        /* Pointer to the end of the doubly linked list */
} DVListe;

Here is what I have so far. Ofcourse there are alot of errors and segmentation faults :)

I still can't understand where to define the start and end and to whom should I assign them, newNode or NodePtr or something totally different than that? :/

 // continue
    DVList *h = NULL;
    Knoten *newNode;

    void negative_start(int n)
    {
        if (newNode == NULL)
        {
            newNode = malloc(sizeof(Knoten));
            if (newNode == NULL)
            {
                printf("ERROR! Could not allocate memory");
                exit(EXIT_FAILURE);
            }
            newNode->n = n;
            newNode->prev = NULL;
            newNode->next = NULL;

            newNode = h->start;
            h->start = h->end;
        }
        else
        {
            newNode = malloc (sizeof(Knoten));
            if (newNode == NULL)
                {
                    printf("ERROR! Could not allocate memory");
                    exit(EXIT_FAILURE);
                }
            newNode->n = n;
            newNode->next = h->start;
            newNode->prev = NULL;
            h->start = newNode;
        }
    }
    void positive_end(int n)
    {
        // I didn't write it because it will be wrong like the negative_start function.
    }

    int main ()
    {
        int x;
        newNode = NULL;
        printf("\n Enter a number ");
        scanf("%d", &x);
        while ( x != 0)
        {
            if ( x < 0 ){ negative_start(x);
                        }
            else{ positive_end(x);
                }
            scanf("%d", &x);
        }
        return 0;
    }

I've tried to write the code from new with @ChrisTurner structs.

It's working only with negative numbers. If I entered any positive numbers only, they will be discarded. Can someone please help me with this one?

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

typedef struct Node Knoten;
typedef struct DVListe_s DVList;

struct Node
{
    int n;
    Knoten *next;
    Knoten *prev;
};

struct DVListe_s
{
    Knoten *start;
    Knoten *end;
};

DVList *construct()
{
    DVList *list;
    list = malloc (sizeof(DVList));
    list->start = NULL;
    list->end = NULL;

    return list;
}

void add_negative_start (DVList *list, int n)
{
    if (list->start != NULL)
    {
        Knoten *newNode = malloc(sizeof(Knoten));
        newNode->prev = NULL;
        newNode->next = NULL;
        newNode->n = n;

        newNode->next = list->start;
        list->start = newNode;
    }
     else
    {
        Knoten *newNode = malloc(sizeof(Knoten));
        newNode->prev = NULL;
        newNode->next = NULL;
        newNode->n = n;

        list->start = newNode;
        list->end = list->start;
    }
}

void add_positive_end(DVList *list, int n)
{
    if (list->end != NULL)
    {
        Knoten *newNode = malloc(sizeof(Knoten));
        newNode->prev = NULL;
        newNode->next = NULL;
        newNode->n = n;

        newNode->prev = list->end;
        list->end = newNode;
    }
    else
    {
        Knoten *newNode = malloc(sizeof(Knoten));
        newNode->prev = NULL;
        newNode->next = NULL;
        newNode->n = n;

        list->end = newNode;
        list->start = list->end;
    }
}

void print(DVList *list)
{
    Knoten *temp = list->start;
    printf ("Entered Numbers\n");
    while (temp != NULL)
    {
        printf("%d\n", temp->n);
        temp = temp->next;
    }
}

int main()
{
    DVList *list = construct();

    int x = 1;
    printf("Enter a number\n");

    while (x)
    {
        scanf ("%d", &x);
        if (x < 0)
        {
            add_negative_start(list, x);
        }
        else
        {
            add_positive_end(list, x);
        }

    }
    print(list);

    return 0;
}
 R

Body:
typedef creates what could be thought of as an alias between NodePtr and struct Node * so that whenever you put NodePtr the compiler knows you actually meant struct Node *.

You can't use struct NodePtr inside struct NodePtr because at that point it doesn't know how big struct NodePtr is, so whether or not you use a typedef you do need to use pointers at this point.

In your DVListe, because your list will start off empty, you use pointers here so that you can set start and end to NULL to indicate that or if you have one node, that they can both point at the same place.

Personally I don't think creating a typedef to a pointer of something is overly a good idea, although you are at least making it clear that it's a pointer with the name. You could lose that typedef and do it like this also.

typedef struct Node Knoten;
typedef struct DVListe_s DVListe;

struct Node     /* Node contains a read number */
{
    int n;          /* Stored number */
    Node *prev;
    Node *next;
};

struct DVListe_s
{ /* Structure for double linked lists: start + end */
    Node *start;      /* Pointer to the beginning of the doubly linked list */
    Node *end;        /* Pointer to the end of the doubly linked list */
};


问:
ubuntu setting wallpaper in terminal
how to setting wallpaper in terminal on Ubuntu 16.04.
I have tried many times in this command, it won't work:

```<code>gsettings get org.gnome.desktop.background picture-uri file:///home/jintain/Pictures/WallPapers/images/2017_03_29.jpg
</code>```

file followed my picture path, which I compeletely sure it is exist.
But this command just don't work at all, I am so confused, did I am wrong???? But I got this command in Ubuntu Forum they told this should be work. Any idea???? I am starting doubt my life.

答:
You need to use set instead of get:

```<code>gsettings set org.gnome.desktop.background picture-uri file:///home/jintain/Pictures/WallPapers/images/2017_03_29.jpg
</code>```

Title: ubuntu setting wallpaper in terminal

Body:
how to setting wallpaper in terminal on Ubuntu 16.04.
I have tried many times in this command, it won't work:

gsettings get org.gnome.desktop.background picture-uri file:///home/jintain/Pictures/WallPapers/images/2017_03_29.jpg

file followed my picture path, which I compeletely sure it is exist.
But this command just don't work at all, I am so confused, did I am wrong???? But I got this command in Ubuntu Forum they told this should be work. Any idea???? I am starting doubt my life.

Body:
You need to use set instead of get:

gsettings set org.gnome.desktop.background picture-uri file:///home/jintain/Pictures/WallPapers/images/2017_03_29.jpg


问:
on scroll moving the two divs in v shape
As I am new to CSS and jQuery I am trying to learn the different animations. Right now I want to do the animation similar to domain.me.

I am using jQuery's scrolltop() to get the position and based on the scroll position displayed in the console using console.log I manually added the if statement and addClass(). Below is my complete code (style and script in same file)

js fiddle

$(window).scroll(example);

function example() {
  var tempScrollTop = $(window).scrollTop();
  console.log("Scroll from Top: " + tempScrollTop.toString());

  if (tempScrollTop > 20 && tempScrollTop < 50) {
    $("#div1").addClass("slide");
    $("#div2").addClass("slider");
  }

  if (tempScrollTop > 50 && tempScrollTop < 100) {
    $("#div1").addClass("slide1");
    $("#div2").addClass("slider1");
  }

  if (tempScrollTop > 100 && tempScrollTop < 200) {
    $("#div1").addClass("slide2");
    $("#div2").addClass("slider2");
  }

  if (tempScrollTop > 200 && tempScrollTop < 300) {
    $("#div1").addClass("slide2");
  }
};```
<pre class="snippet-code-css lang-css prettyprint-override"><code>#mainbord {
  border: 5px solid black;
  height: 100%;
  width: 100%;
  background-image: url("2.jpg");
}

.divv {
  border: 1px solid black;
  width: 200px;
  height: 200px;
  margin-top: 300px;
  margin-left: 500px;
  border-radius: 50%;
}

.div2 {
  border: 1px solid black;
  width: 400px;
  height: 50px;
  margin-left: 400px;
}

.div3 {
  border: 1px solid black;
  width: 500px;
  height: 500px;
  margin-top: 200px;
}

.div4 {
  border: 1px solid black;
  width: 500px;
  height: 500px;
  margin-top: 200px;
}

.slide {
  background-color: green;
  border: 1px solid black;
  width: 180px;
  height: 180px;
  margin-top: 250px;
  margin-left: 420px;
  -moz-transform: scale(0.2);
  transition: all 600ms ease-in;
  */
}

.slide1 {
  background-color: red;
  border: 1px solid black;
  width: px;
  height: 160px;
  margin-top: 160px;
  margin-left: 400px;
  transition: all 600ms ease-in;
}

.slide2 {
  background-color: blue;
  border: 1px solid black;
  width: 100px;
  height: 100px;
  margin-top: 200px;
  margin-left: 350px;
  -moz-transform: scale(0.2);
  transition: all 600ms ease-in;
}

.slider {
  margin-left: 550px;
  margin-top: background-color:green;
  transition: all 600ms ease-in;
  width: 300px;
}

.slider1 {
  margin-left: 700px;
  background-color: red;
  transition: all 600ms ease-in;
  width: 250px;
}

.slider2 {
  margin-left: 730px;
  background-color: blue;
  transition: all 600ms ease-in;
  width: 250px;
}</code>```

```

答: You have to remove/toggle the CSS class. In your example, the elements has every Class (slide, slide1, slide2) at the end.</p>

Body:
As I am new to CSS and jQuery I am trying to learn the different animations. Right now I want to do the animation similar to domain.me.

I am using jQuery's scrolltop() to get the position and based on the scroll position displayed in the console using console.log I manually added the if statement and addClass(). Below is my complete code (style and script in same file)

js fiddle

$(window).scroll(example);

function example() {
  var tempScrollTop = $(window).scrollTop();
  console.log("Scroll from Top: " + tempScrollTop.toString());

  if (tempScrollTop > 20 && tempScrollTop < 50) {
    $("#div1").addClass("slide");
    $("#div2").addClass("slider");
  }

  if (tempScrollTop > 50 && tempScrollTop < 100) {
    $("#div1").addClass("slide1");
    $("#div2").addClass("slider1");
  }

  if (tempScrollTop > 100 && tempScrollTop < 200) {
    $("#div1").addClass("slide2");
    $("#div2").addClass("slider2");
  }

  if (tempScrollTop > 200 && tempScrollTop < 300) {
    $("#div1").addClass("slide2");
  }
};

#mainbord {
  border: 5px solid black;
  height: 100%;
  width: 100%;
  background-image: url("2.jpg");
}

.divv {
  border: 1px solid black;
  width: 200px;
  height: 200px;
  margin-top: 300px;
  margin-left: 500px;
  border-radius: 50%;
}

.div2 {
  border: 1px solid black;
  width: 400px;
  height: 50px;
  margin-left: 400px;
}

.div3 {
  border: 1px solid black;
  width: 500px;
  height: 500px;
  margin-top: 200px;
}

.div4 {
  border: 1px solid black;
  width: 500px;
  height: 500px;
  margin-top: 200px;
}

.slide {
  background-color: green;
  border: 1px solid black;
  width: 180px;
  height: 180px;
  margin-top: 250px;
  margin-left: 420px;
  -moz-transform: scale(0.2);
  transition: all 600ms ease-in;
  */
}

.slide1 {
  background-color: red;
  border: 1px solid black;
  width: px;
  height: 160px;
  margin-top: 160px;
  margin-left: 400px;
  transition: all 600ms ease-in;
}

.slide2 {
  background-color: blue;
  border: 1px solid black;
  width: 100px;
  height: 100px;
  margin-top: 200px;
  margin-left: 350px;
  -moz-transform: scale(0.2);
  transition: all 600ms ease-in;
}

.slider {
  margin-left: 550px;
  margin-top: background-color:green;
  transition: all 600ms ease-in;
  width: 300px;
}

.slider1 {
  margin-left: 700px;
  background-color: red;
  transition: all 600ms ease-in;
  width: 250px;
}

.slider2 {
  margin-left: 730px;
  background-color: blue;
  transition: all 600ms ease-in;
  width: 250px;
}


问:
ReactNative StackNavigator inside DrawerNavigator
Code first:

```<code>import React, { Component } from 'react';
import {AppRegistry, Image, TouchableHighlight} from 'react-native';
import { StackNavigator, DrawerNavigator } from 'react-navigation';

import ScreenHome from './screens/Home'
import ScreenRegister from './screens/Register'
import FontAwesome from "react-native-vector-icons/FontAwesome";

const StackScreens = StackNavigator({
    Home: { screen: ScreenHome },
    Register: { screen: ScreenRegister },
},{
    headerMode: "screen",
    navigationOptions : {
        header: {
            visible: true,
            title: (
                <Image
                    source={require("./images/logo_colored.png")}
                    style={{width: 150, height: 25, marginLeft: 15, marginRight: 15}}
                    resizeMode={"contain"}
                />
            ),
            left: (
                <TouchableHighlight
                    underlayColor='rgba(94, 3, 67, 0.5)'
                    onPress={() => {
                        // ERROR HERE: this.props.navigation is undefined
                        //this.props.navigation.navigate('DrawerOpen')
                    }}>
                <FontAwesome name='bars' size={20} color={"#333333"} style={{paddingLeft: 20}}/>
                </TouchableHighlight>
            ),
            right: (
                <FontAwesome name='user-o' size={20} color={"#333333"} style={{paddingRight: 20}}/>
            )
        }
    }
});

const App = DrawerNavigator({
    Home: { screen: ScreenHome },
    Register: { screen: StackScreens }
})

AppRegistry.registerComponent('ReactApp', () => App);
</code>```

When i want to call this.props.navigation.navigate('DrawerOpen') i get an error (is undefined ...). Inside the ScreenRegister this works as intended and the Drawer Menu opens. How can i call this.props.navigation inside the navigationOptions of my StackNavigator Header? This header will then be displayed in all my further screens with the icon to open the drawer menu.

答:
Updated your header section with below code.</p>

```<code>    header:({ navigate })=>({
        visible: false,
        title: (
            <Image
                source={require("./images/logo_colored.png")}
                style={{width: 150, height: 25, marginLeft: 15, marginRight: 15}}
                resizeMode={"contain"}
            />
        ),
        left: (
            <TouchableHighlight
                underlayColor='rgba(94, 3, 67, 0.5)'
                onPress={() => {
                    // UPDATED HERE
                    navigate('DrawerOpen')
                }}>
            <FontAwesome name='bars' size={20} color={"#333333"} style={{paddingLeft: 20}}/>
            </TouchableHighlight>
        ),
        right: (
            <FontAwesome name='user-o' size={20} color={"#333333"} style={{paddingRight: 20}}/>
        )
    })
</code>```

Body:
Code first:

import React, { Component } from 'react';
import {AppRegistry, Image, TouchableHighlight} from 'react-native';
import { StackNavigator, DrawerNavigator } from 'react-navigation';

import ScreenHome from './screens/Home'
import ScreenRegister from './screens/Register'
import FontAwesome from "react-native-vector-icons/FontAwesome";

const StackScreens = StackNavigator({
    Home: { screen: ScreenHome },
    Register: { screen: ScreenRegister },
},{
    headerMode: "screen",
    navigationOptions : {
        header: {
            visible: true,
            title: (
                <Image
                    source={require("./images/logo_colored.png")}
                    style={{width: 150, height: 25, marginLeft: 15, marginRight: 15}}
                    resizeMode={"contain"}
                />
            ),
            left: (
                <TouchableHighlight
                    underlayColor='rgba(94, 3, 67, 0.5)'
                    onPress={() => {
                        // ERROR HERE: this.props.navigation is undefined
                        //this.props.navigation.navigate('DrawerOpen')
                    }}>
                <FontAwesome name='bars' size={20} color={"#333333"} style={{paddingLeft: 20}}/>
                </TouchableHighlight>
            ),
            right: (
                <FontAwesome name='user-o' size={20} color={"#333333"} style={{paddingRight: 20}}/>
            )
        }
    }
});

const App = DrawerNavigator({
    Home: { screen: ScreenHome },
    Register: { screen: StackScreens }
})

AppRegistry.registerComponent('ReactApp', () => App);

When i want to call this.props.navigation.navigate('DrawerOpen') i get an error (is undefined ...). Inside the ScreenRegister this works as intended and the Drawer Menu opens. How can i call this.props.navigation inside the navigationOptions of my StackNavigator Header? This header will then be displayed in all my further screens with the icon to open the drawer menu.

Body:
Updated your header section with below code.

    header:({ navigate })=>({
        visible: false,
        title: (
            <Image
                source={require("./images/logo_colored.png")}
                style={{width: 150, height: 25, marginLeft: 15, marginRight: 15}}
                resizeMode={"contain"}
            />
        ),
        left: (
            <TouchableHighlight
                underlayColor='rgba(94, 3, 67, 0.5)'
                onPress={() => {
                    // UPDATED HERE
                    navigate('DrawerOpen')
                }}>
            <FontAwesome name='bars' size={20} color={"#333333"} style={{paddingLeft: 20}}/>
            </TouchableHighlight>
        ),
        right: (
            <FontAwesome name='user-o' size={20} color={"#333333"} style={{paddingRight: 20}}/>
        )
    })


问:
How to eliminate the first delay in playing video in ionic
I am trying to play a video inside the ion-content tags.

Issues:

The video takes some time to play. In this time it shows a dark screen.

After few minutes the video will play.

Question:

How do I avoid the first delay time and play the video when the user opens the app?

Code:

```<code>   <ion-content>
     <video  id='play_video' controls="controls"  width="100%" height="100%"    preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline" class="videoPlayer">
     <source id='mp4Source' src="http://scontent-lht6-1.cdninstagram.com/t50.2886-16/17411365_1330668097014253_7208742851285352448_n.mp4" type="video/mp4"/>
     </video>
    </ion-content>
</code>```

答:
If the video is taking this much time to play it is quite likely a server side issue.

The most common issue is the part of the video file which contains the Metadata being at the end of the file rater than the start in mp4 files.

This means the client cannot play the video until it has downloaded the whole video.

There is a common technique to move the Metadata 'block' or 'atom' to the start.

More info here (take a look at delivery setup):

https://gpac.wp.imt.fr/mp4box/

and here:

https://github.com/danielgtaylor/qtfaststart

Usage is very simple - for example with qtfaststart:

$ bin/qtfaststart infile [outfile]

Body:
I am trying to play a video inside the ion-content tags.

Issues:

The video takes some time to play. In this time it shows a dark screen.

After few minutes the video will play.

Question:

How do I avoid the first delay time and play the video when the user opens the app?

Code:

   <ion-content>
     <video  id='play_video' controls="controls"  width="100%" height="100%"    preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline" class="videoPlayer">
     <source id='mp4Source' src="http://scontent-lht6-1.cdninstagram.com/t50.2886-16/17411365_1330668097014253_7208742851285352448_n.mp4" type="video/mp4"/>
     </video>
    </ion-content>


问:
how can make this divs as responsive?
css stylings:

```<code>.products {
    display: inline-block;
    position: relative;
    align-items: ;
    margin-top: -4px;
}
.product-cell {
    float: left;
    display: inline-block;
    width: 50%;
    box-sizing: border-box;
}
.product-img {
    position: relative;
}
.product-overlay {
    background: rgba(0, 0, 0, 0.73);
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    z-index: 1;
}
p.product-name {
    position: absolute;
    top: 40%;
    color: #fff;
    z-index: 2;
    left: 38%;
    font-family: 'Kaushan Script', cursive;
    transform: translate(-30%,40%);
    font-size: 30px;
}
.product-list {
    padding: 5px 0px 0px 10px;
}
</code>```

HTML code:

I am using  bootstrap.but for mobile i am not getting expected output as shown in the images below.for mobile i made .product-cell width as 100%. if it possible us js fiddle to explain.thanks for your valuable information.

i need like this :

.

but I am getting like this:

```<code><div class="products">
                <div class="product-cell">
                    <div class="product-img">
                        <img src="images/products-electronic.png" class="img-responsive" >
                        <div class="product-overlay"></div>
                        <p class="product-name">ELECTRONICS ENGINEERING</p>
                    </div>
</div>
</code>```

答:
You need to make your website responsive, to do that we use something called media queries which is basically just extra markup in your css syntax.

A great framework to use since you're just starting out with responsive design would be using Bootstrap, it's easily customised to fit the needs of your project.

This should also help give you a better understanding about how fluid grid systems are incorporated into your site.

Hope this helps!

Title: how can make this divs as responsive?

Body:
css stylings:

.products {
    display: inline-block;
    position: relative;
    align-items: ;
    margin-top: -4px;
}
.product-cell {
    float: left;
    display: inline-block;
    width: 50%;
    box-sizing: border-box;
}
.product-img {
    position: relative;
}
.product-overlay {
    background: rgba(0, 0, 0, 0.73);
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    z-index: 1;
}
p.product-name {
    position: absolute;
    top: 40%;
    color: #fff;
    z-index: 2;
    left: 38%;
    font-family: 'Kaushan Script', cursive;
    transform: translate(-30%,40%);
    font-size: 30px;
}
.product-list {
    padding: 5px 0px 0px 10px;
}

HTML code:

I am using  bootstrap.but for mobile i am not getting expected output as shown in the images below.for mobile i made .product-cell width as 100%. if it possible us js fiddle to explain.thanks for your valuable information.

i need like this :

.

but I am getting like this:

ELECTRONICS ENGINEERING


问:
UNNotificationContentExtension not displaying
I'm trying to make a custom notification alert.   I added my extension target and changed the UNNotificationExtensionCategory value to 'drawing'.

In my push notification I added a "category" : "drawing" element to the aps block.  The didReceive(_:) method from that extension is never getting called though.  What did I forget to do?

答: Have u added this in your target's info.plist file instead of ACTIONABLE add drawing


问:
extract all the possible text from a webpage in R
I used this script to extract the text from a webpage

```<code>url <- "http://www.dlink.com/it/it"

doc <- getURL(url)

#get the text from the body
html <- htmlTreeParse(doc, useInternal = TRUE)
txt <- xpathApply(html, "//body//text()[not(ancestor::script)][not(ancestor::style)][not(ancestor::noscript)]", xmlValue)
txt<-toString(txt)
</code>```

but the problem is that it takes just the words in the first page, how can I extend it to the whole website?

答:
I'd go with rvest to scrape the links and purrr to iterate:

```<code>library(rvest)
library(purrr)

url <- "http://www.dlink.com/it/it"

r <- read_html(url) %>%
    html_nodes('a') %>%
    html_attr('href') %>%
    Filter(function(f) !is.na(f) & !grepl(x = f, pattern = '#|facebook|linkedin|twitter|youtube'), .) %>%
    map(~{
        print(.x)
        html_session(url) %>%
            jump_to(.x) %>%
            read_html() %>%
            html_nodes('body') %>%
            html_text() %>%
            toString()
    })
</code>```

I filtered out social nets and dead links from the list of links, some more tuning might be in order.

Be advised that you will be scraping a lot of garbage. Some more targeting on what to scrape inside each page might be needed (ie: something more specfic than the whole body tag)

Body:
I used this script to extract the text from a webpage

url <- "http://www.dlink.com/it/it"

doc <- getURL(url)

#get the text from the body
html <- htmlTreeParse(doc, useInternal = TRUE)
txt <- xpathApply(html, "//body//text()[not(ancestor::script)][not(ancestor::style)][not(ancestor::noscript)]", xmlValue)
txt<-toString(txt)

but the problem is that it takes just the words in the first page, how can I extend it to the whole website?

Body:
I'd go with rvest to scrape the links and purrr to iterate:

library(rvest)
library(purrr)

url <- "http://www.dlink.com/it/it"

r <- read_html(url) %>%
    html_nodes('a') %>%
    html_attr('href') %>%
    Filter(function(f) !is.na(f) & !grepl(x = f, pattern = '#|facebook|linkedin|twitter|youtube'), .) %>%
    map(~{
        print(.x)
        html_session(url) %>%
            jump_to(.x) %>%
            read_html() %>%
            html_nodes('body') %>%
            html_text() %>%
            toString()
    })

I filtered out social nets and dead links from the list of links, some more tuning might be in order.

Be advised that you will be scraping a lot of garbage. Some more targeting on what to scrape inside each page might be needed (ie: something more specfic than the whole body tag)

ContentLicense: CC BY-SA 4.0


问:
WAMP Server Apache won't start
There are several topics that are very similar to this one, however, after looking over them the ones that were solved I did not have the same issue, and the rest weren't solved.

I have installed a new version of WAMP.  No changes made to any files.

Opening wamp the icon never goes from red to green.

Put online gives error:
Could not execute menu item (internal error) [Exception] Could not perform service action: The service has not been started

That's the same error I get if I do apache->service->start service

I have not ever had skype running, but I uninstalled it just in case and because I no longer use it.

Doing apache->service->test port 80 says "Your port 80 is not actually used."  Install service gives no complaints either.

I've clicked the apache version apache->version->number

I have apache 2.4.9
Running windows 7
Wamp version 2.5(fresh installer like 2 hours ago...)

In cmd running "httpd.exe -e debug" in directory apache\apache2.4.9\bin prints the folowing:

```<code>[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module access_compat_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_access_compat.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module actions_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_actions.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module alias_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_alias.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module allowmethods_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_allowmethods.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module asis_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_asis.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module auth_basic_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_auth_basic.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authn_core_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authn_core.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authn_file_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authn_file.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authz_core_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authz_core.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authz_groupfile_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authz_groupfile.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authz_host_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authz_host.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authz_user_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authz_user.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module autoindex_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_autoindex.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module cache_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_cache.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module cache_disk_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_cache_disk.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module cgi_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_cgi.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module deflate_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_deflate.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module dir_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_dir.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module env_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_env.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module file_cache_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_file_cache.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module include_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_include.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module isapi_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_isapi.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module log_config_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_log_config.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module mime_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_mime.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module negotiation_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_negotiation.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module setenvif_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_setenvif.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module vhost_alias_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_vhost_alias.so
[Sat Jan 31 23:05:21.720128 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module php5_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/php/php5.5.12/php5apache2_4.dll
</code>```

Running httpd.exe no longer gives me any issues.

But regardless WAMP will not go online.

Addition:
Could this maybe be caused by windows UAC?  I'm an admin and I even run wamp as an admin.  But I'm unsure what "Access Denied" means, and I don't seem to get any issues running httpd.exe by hand. (Although I don't know if it was functioning I was not getting errors)

Addition 2
I found a miscillaneous comment about wamp services on another stackoverflow question.  In Windows+R -> services.msc right clicking wampapache64 and selecting start returns "Error 5: Access is denied"

Addition 3
It seems this computer may have some other issues.  Attempting to change the firewall returns an error as well.  Maybe I have some sort of deeper issue.

Additional firewall issue details:
Clicking windows firewall in control panel says "Update your Firewall settings - Windows firewall is not using the recommended settings to protect your computer." then there is a "Use Recommended Settings" button, and clicking it says "Windows Firewall can't change some of your settings.  Error code 0x80070424"

答:
Sometimes you cannot even run wampapache from services that is: because some other software on your system is using port 80 for its communication so best thing is to shut it down so try turning down:
Skype
IIS
or usb router services

Title: WAMP Server Apache won't start

Body:
There are several topics that are very similar to this one, however, after looking over them the ones that were solved I did not have the same issue, and the rest weren't solved.

I have installed a new version of WAMP.  No changes made to any files.

Opening wamp the icon never goes from red to green.

Put online gives error:
Could not execute menu item (internal error) [Exception] Could not perform service action: The service has not been started

That's the same error I get if I do apache->service->start service

I have not ever had skype running, but I uninstalled it just in case and because I no longer use it.

Doing apache->service->test port 80 says "Your port 80 is not actually used."  Install service gives no complaints either.

I've clicked the apache version apache->version->number

I have apache 2.4.9
Running windows 7
Wamp version 2.5(fresh installer like 2 hours ago...)

In cmd running "httpd.exe -e debug" in directory apache\apache2.4.9\bin prints the folowing:

[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module access_compat_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_access_compat.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module actions_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_actions.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module alias_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_alias.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module allowmethods_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_allowmethods.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module asis_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_asis.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module auth_basic_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_auth_basic.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authn_core_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authn_core.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authn_file_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authn_file.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authz_core_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authz_core.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authz_groupfile_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authz_groupfile.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authz_host_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authz_host.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module authz_user_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_authz_user.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module autoindex_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_autoindex.so
[Sat Jan 31 23:05:21.548528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module cache_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_cache.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module cache_disk_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_cache_disk.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module cgi_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_cgi.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module deflate_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_deflate.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module dir_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_dir.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module env_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_env.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module file_cache_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_file_cache.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module include_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_include.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module isapi_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_isapi.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module log_config_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_log_config.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module mime_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_mime.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module negotiation_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_negotiation.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module setenvif_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_setenvif.so
[Sat Jan 31 23:05:21.704528 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module vhost_alias_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/apache/apache2.4.9/modules/mod_vhost_alias.so
[Sat Jan 31 23:05:21.720128 2015] [so:debug] [pid 532:tid 132] mod_so.c(266): AH01575: loaded module php5_module from C:/Users/Chase/Google Drive/Web Dev/wamp/bin/php/php5.5.12/php5apache2_4.dll

Running httpd.exe no longer gives me any issues.

But regardless WAMP will not go online.

Addition:
Could this maybe be caused by windows UAC?  I'm an admin and I even run wamp as an admin.  But I'm unsure what "Access Denied" means, and I don't seem to get any issues running httpd.exe by hand. (Although I don't know if it was functioning I was not getting errors)

Addition 2
I found a miscillaneous comment about wamp services on another stackoverflow question.  In Windows+R -> services.msc right clicking wampapache64 and selecting start returns "Error 5: Access is denied"

Addition 3
It seems this computer may have some other issues.  Attempting to change the firewall returns an error as well.  Maybe I have some sort of deeper issue.

Additional firewall issue details:
Clicking windows firewall in control panel says "Update your Firewall settings - Windows firewall is not using the recommended settings to protect your computer." then there is a "Use Recommended Settings" button, and clicking it says "Windows Firewall can't change some of your settings.  Error code 0x80070424"


问:
Python property magic
When is the inner() function actually getting called in this simple code snippet?
I have read about python properties, but I am unsure what magic is it doing here.

```<code>>>> class Magic:
...     @property
...     def __repr__(self):
...         def inner():
...             return "It works!"
...         return inner
...
>>> repr(Magic())
'It works!'
</code>```

When I remove "@property", I get an expected error:

```<code>TypeError: __repr__ returned non-string (type function)
</code>```

答:
__repr__ is supposed to give a human-readable representation of the object...

Return a string containing a printable representation of an object.

For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(), otherwise the representation is a string enclosed in angle brackets that contains the name of the type of the object together with additional information often including the name and address of the object. A class can control what this function returns for its instances by defining a __repr__() method.

You are returning a function.
Try:

```<code>>>> class Magic:
...     def __repr__(self):
...         def inner():
...             return "It works!"
...         return inner()
...
>>> repr(Magic())
'It works!'
</code>```

It's also worth reading up on the @property decorator, and decorators in general... See this answer.

To answer youy "When is the inner() function actually getting called?", see below. It's getting called when repr() calls Magic.__repr__() on your behalf.

#!/usr/bin/env python3

def my_decorator(info):
    def my_dec_inner(self):
        return "Testing"
    return my_dec_inner

class Magic:
    @my_decorator
    def __repr__(self):
        def inner():
            return "It works!"
        return inner

m = Magic()

# these are nearly synonymous
print(m.__repr__())
print(repr(m))

# this is actually a 'bound function' - my_decorator
print(m.__repr__)
```

<pre class="lang-none prettyprint-override"><code>Testing
Testing
<bound method Magic.my_dec_inner of Testing>
</code>```

Title: Python property magic

Body:
When is the inner() function actually getting called in this simple code snippet?
I have read about python properties, but I am unsure what magic is it doing here.

>>> class Magic:
...     @property
...     def __repr__(self):
...         def inner():
...             return "It works!"
...         return inner
...
>>> repr(Magic())
'It works!'

When I remove "@property", I get an expected error:

TypeError: __repr__ returned non-string (type function)

Body:
__repr__ is supposed to give a human-readable representation of the object...

Return a string containing a printable representation of an object.

For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(), otherwise the representation is a string enclosed in angle brackets that contains the name of the type of the object together with additional information often including the name and address of the object. A class can control what this function returns for its instances by defining a __repr__() method.

You are returning a function.
Try:

>>> class Magic:
...     def __repr__(self):
...         def inner():
...             return "It works!"
...         return inner()
...
>>> repr(Magic())
'It works!'

It's also worth reading up on the @property decorator, and decorators in general... See this answer.

To answer youy "When is the inner() function actually getting called?", see below. It's getting called when repr() calls Magic.__repr__() on your behalf.

#!/usr/bin/env python3

def my_decorator(info):
    def my_dec_inner(self):
        return "Testing"
    return my_dec_inner

class Magic:
    @my_decorator
    def __repr__(self):
        def inner():
            return "It works!"
        return inner

m = Magic()

# these are nearly synonymous
print(m.__repr__())
print(repr(m))

# this is actually a 'bound function' - my_decorator
print(m.__repr__)

Testing
Testing
<bound method Magic.my_dec_inner of Testing>


问:
I want to create a label which keeps track of how many times a view controller has been visited
I have a table view cell that performs a segue. Now my question is:

I want to put a label that counts how many times a particular view controller has been visited/viewed. Is there anything that we can do to when we click a table cell which performs a segue to another view controller and label in another view controller increments like:
Visited 1 times,
Visited 2 times,
Visited 3 times.

I did not implement this basic thing, I have something like

```<code>func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    let val2 = mySongsArray[indexPath.row] performSegue(withIdentifier: "JustinTableViewCell" , sender: val2)
}
</code>```

I am using Swift 3.

答:
```<code>override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    var visitCount = (UserDefaults.standard.value(forKey:  "visitCount") as? Int) ?? 0
    visitCount += 1

    self.lblVisitedCount.text = "Page Visited \(visitCount) times"

    UserDefaults.standard.set(visitCount, forKey: "visitCount")
}
</code>```

This will update count and label text everytime the view controller is visited/viewed. If you put the code in viewDidLoad, it will not update count when the VC is visited after getting popped from its next viewController. But, if you do it the way i have told by keeping it in viewWillAppear function, the count will increment everytime the VC appears.

Hope it helped. Cheers :]

Body:
I have a table view cell that performs a segue. Now my question is:

I want to put a label that counts how many times a particular view controller has been visited/viewed. Is there anything that we can do to when we click a table cell which performs a segue to another view controller and label in another view controller increments like:
Visited 1 times,
Visited 2 times,
Visited 3 times.

I did not implement this basic thing, I have something like

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    let val2 = mySongsArray[indexPath.row] performSegue(withIdentifier: "JustinTableViewCell" , sender: val2)
}

I am using Swift 3.

Body:
override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    var visitCount = (UserDefaults.standard.value(forKey:  "visitCount") as? Int) ?? 0
    visitCount += 1

    self.lblVisitedCount.text = "Page Visited \(visitCount) times"

    UserDefaults.standard.set(visitCount, forKey: "visitCount")
}

This will update count and label text everytime the view controller is visited/viewed. If you put the code in viewDidLoad, it will not update count when the VC is visited after getting popped from its next viewController. But, if you do it the way i have told by keeping it in viewWillAppear function, the count will increment everytime the VC appears.

Hope it helped. Cheers :]


答:
Not builtin, but because your plan is not that complex

```<code>switch ((int) (($c - 1) / 100)) {
    case 0: /* action here */ break;
    case 1: /* action here */ break;
    case 2: /* action here */ break;
    case 3: /* action here */ break;
    default: /* action here */ break;
}
</code>```

Another solution which works with arbitrary limits. I assume, that there is an upper limit

```<code>$c; // value to test
$ranges = array(101,201,199); // and so on
$index = 0;
while ($ranges[$index] >= $c) { $index++; }
// Do something useful with "$index"
</code>```

ContentLicense: CC BY-SA 2.5

Title: Faster way to check if integer is in any of ranges?

Body:
I wonder if there is another way to shorten this ? Here is the example im looking for to do same thing just shorter.

if($c <= 100){
    echo 'A';
}elseif($c <= 200 && $c > 100){
    echo 'B';
}elseif($c <= 300 && $c > 200){
    echo 'C';
}elseif($c <= 400 && $c > 300){
    echo 'D';
}elseif($c <= 500 && $c > 400){
    echo 'E';
}elseif($c <= 600 && $c > 500){
    echo 'F';
}elseif($c <= 700 && $c > 600){
    echo 'Z';
}elseif($c <= 800 && $c > 700){
    echo 'H';
}elseif($c <= 900 && $c > 800){
    echo 'I';
}elseif($c < 1000 && $c > 900){
    echo 'K';
}elseif($c <= 1100 && $c > 1000){
    echo 'L';
}elseif($c <= 1200 && $c > 1100){
    echo 'M';
}elseif($c < 1300 && $c > 1200){
    echo 'N';
}elseif($c <= 1400 && $c > 1300){
    echo 'O';
}elseif($c <= 1500 && $c > 1400){
    echo 'P';
}elseif($c <= 1600 && $c > 1500){
    echo 'Q';
}elseif($c <= 1700 && $c > 1600){
    echo 'R';
}elseif($c <= 1800 && $c > 1700){
    echo 'S';
}elseif($c <= 1900 && $c > 1800){
    echo 'T';
}elseif($c <= 2000 && $c > 1900){
    echo 'V';
}elseif($c <= 2100 && $c > 2000){
    echo 'X';
}else{
    echo 'AA';
}

Body:
Not builtin, but because your plan is not that complex

switch ((int) (($c - 1) / 100)) {
    case 0: /* action here */ break;
    case 1: /* action here */ break;
    case 2: /* action here */ break;
    case 3: /* action here */ break;
    default: /* action here */ break;
}

Another solution which works with arbitrary limits. I assume, that there is an upper limit

$c; // value to test
$ranges = array(101,201,199); // and so on
$index = 0;
while ($ranges[$index] >= $c) { $index++; }
// Do something useful with "$index"


问:
MySQL Query to fetch count of a same successive two rows based on a column value
I need a sql query which will fetch me the count of unique possible combination of a value a to b of col3 based on the col2 value.
Here in the below table the value a to b is there twice(2 to 3 for col1-1 and 2 to 3 for col1-2).Similarly I need the count of such possible a to b fields as they appear successively in the table(which we can identify from col2-2,3)

I have the following table:

```<code>      col1   col2   col3
       1       2      a
       1       3      b
       1       4      c
       2       2      a
       2       3      b
       2       4      c

Output:

f1  f2  count
a   b    2
b   c    2
</code>```

Here col1+col2 is the primary key and the query should be generic for n no of possible successive combination.

答:
As I was looking into possibilities of finding the solution to my problem, I got one by myself...

Below is the query to get the desired output which I wanted, was pretty straight forward.

```<code>select a.col3 f1,
b.col3 f2,
count(*) count
from testTable b,testTable a
where
a.col2 = b.col2 -1
and a.col1 = b.col1
group by ev1,ev2;
</code>```

Body:
I need a sql query which will fetch me the count of unique possible combination of a value a to b of col3 based on the col2 value.
Here in the below table the value a to b is there twice(2 to 3 for col1-1 and 2 to 3 for col1-2).Similarly I need the count of such possible a to b fields as they appear successively in the table(which we can identify from col2-2,3)

I have the following table:

      col1   col2   col3
       1       2      a
       1       3      b
       1       4      c
       2       2      a
       2       3      b
       2       4      c

Output:

f1  f2  count
a   b    2
b   c    2

Here col1+col2 is the primary key and the query should be generic for n no of possible successive combination.

Body:
As I was looking into possibilities of finding the solution to my problem, I got one by myself...

Below is the query to get the desired output which I wanted, was pretty straight forward.

select a.col3 f1,
b.col3 f2,
count(*) count
from testTable b,testTable a
where
a.col2 = b.col2 -1
and a.col1 = b.col1
group by ev1,ev2;


问:
Adding rows to MDL tables dynamically
I wish to add a new row to an MDL formatted table. But when I try to put the following class ... class="mdl-data-table__cell--non-numeric" ...

I get a few errors like:

Refused to load the script 'https://code.getmdl.io/1.3.0/material.min.js' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".

I have pasted relevant portions of the code below :

```<code>while(newlink!=null)
  {
    console.log(newlink);
    var title = newlink.title;
    var url = newlink.url;
    if (title.length > 50)
      title = title.substr(0, 50) + "...";
    if (url.length > 50)
      url = url.substr(0, 50) + "...";
    var date = newlink.date;
    var time = newlink.time;
    var row = table.insertRow(i).outerHTML="<tr id='row"+i+"'><td id='title"+i+"'>"+title+"</td><td id='url"+i+"'>"+url+"</td><td id='date"+i+"'>"+date+"</td><td id='time"+i+"'>"+time+"</td><td><input type='button' id='edit_button"+i+"' value='Edit' class='edit'> <input type='button' id='save_button"+i+"' value='Save' class='save' ></td></tr>";
</code>```

I have included buttons to edit and save content at the end of each row.

答: Hi you have to set "content_security_policy":"script-src 'self' https://code.getmdl.io; object-src 'self'", in your manifest.json file  for references please have a look https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-inline-script

Title: Adding rows to MDL tables dynamically

Body:
I wish to add a new row to an MDL formatted table. But when I try to put the following class ... class="mdl-data-table__cell--non-numeric" ...

I get a few errors like:

Refused to load the script 'https://code.getmdl.io/1.3.0/material.min.js' because it violates the following Content Security Policy directive: "script-src 'self' blob: filesystem: chrome-extension-resource:".

I have pasted relevant portions of the code below :

while(newlink!=null)
  {
    console.log(newlink);
    var title = newlink.title;
    var url = newlink.url;
    if (title.length > 50)
      title = title.substr(0, 50) + "...";
    if (url.length > 50)
      url = url.substr(0, 50) + "...";
    var date = newlink.date;
    var time = newlink.time;
    var row = table.insertRow(i).outerHTML="
"+title+"	"+url+"	"+date+"	"+time+"	<input type='button' id='edit_button"+i+"' value='Edit' class='edit'> <input type='button' id='save_button"+i+"' value='Save' class='save' >
";

I have included buttons to edit and save content at the end of each row.


问:
Are the terms Type and Class used interchangeably - Scala
I have been studying scala quite a bit now. However, I have a simple question in regards to few terms used on many learning materials I find.

Are the term Type used interchangeably with Class?

Could a Type be replaced by a Class? and vice versa?

Ex. a Scala programmer would/could call the following case class a Type

```<code>type ProductId = String
type Quantity = Int

case class ShoppingCart(items: Map[ProductId, Quantity])
</code>```

So, is ShoppingCart a Type, a class, or both, or depends on the paradigm ?

Also, does it have anything to do with Type Classes?

Thanks in advance.

答:
Well, not quite.

Word class refers to very specific idea from object-oriented programming. Class defines some interface, that all of it's exemplars (instances) should fulfill (implement). So when we are talking about classes we usually mean things that were created using class, trait (interface in Java) - in Scala's case sometimes with combination to abstract, case, final or sealed. objects are also instances of a class, singleton class, but let's not get drown in details.

Type is a more generic term. It denotes some group of "things" that we named. Class is an example of a type, but so does primitives in languages that support them. In Scala you can also create a new type without creating new class.

As for the type class it is an idea that appeared in Haskell and was ported to other languages e.g. Scala. Basically it is a way to enforce ad-hoc polymorphism contracts: you need to have some functions overloaded for some type, you name that contract e.g. Functor and if you are saying that e.g. List have a Functor typeclass it means that there are functions overloaded for such contract. In Scala's case type classes are implemented as some trait implementation that is passed implicitly into your code basing on a type T which parametrizes the type class trait.

Body:
I have been studying scala quite a bit now. However, I have a simple question in regards to few terms used on many learning materials I find.

Are the term Type used interchangeably with Class?

Could a Type be replaced by a Class? and vice versa?

Ex. a Scala programmer would/could call the following case class a Type

type ProductId = String
type Quantity = Int

case class ShoppingCart(items: Map[ProductId, Quantity])

So, is ShoppingCart a Type, a class, or both, or depends on the paradigm ?

Also, does it have anything to do with Type Classes?

Thanks in advance.


问:
REST in Unity (send messages from webserver to unity)
Is there a way to have a simple webserver send messages to Unity?

At the moment, we're doing a GET using UnityWebRequest.Get() in the update method. Here's the code:

```<code>// Update is called once per frame
void Update () {
    StartCoroutine(GetData());
}

IEnumerator GetData()
{
    UnityWebRequest uwr = UnityWebRequest.Get(url);
    yield return uwr.Send();

    if (uwr.isError)
    {
        Debug.Log(uwr.error);
    }else
    {
        Debug.Log((float.Parse(uwr.downloadHandler.text) / 100));
        fnumber = ((float.Parse(uwr.downloadHandler.text) / 100));
        transform.position.Set(oldX, fnumber, oldZ);
    }
}
</code>```

However, this throws this error:

CANNOT RESOLVE DESTINATION HOST

I found this bug-report, which states, it would have been fixed, which doesn't seem so.

So, is there a way to have the server send messages to Unity?

Thanks

答:
This is simple way to get request from RESTful server :D.</p>

```<code>private string m_URL = "https://jsonblob.com/api/d58d4507-15f7-11e7-a0ba-014f05ea0ed4";

IEnumerator Start () {
    var webRequest = new WWW (m_URL);
    yield return webRequest;
    if (webRequest.error != null) {
        Debug.Log (webRequest.error);
    } else {
        Debug.Log (webRequest.text);
    }
}
</code>```

Body:
Is there a way to have a simple webserver send messages to Unity?

At the moment, we're doing a GET using UnityWebRequest.Get() in the update method. Here's the code:

// Update is called once per frame
void Update () {
    StartCoroutine(GetData());
}

IEnumerator GetData()
{
    UnityWebRequest uwr = UnityWebRequest.Get(url);
    yield return uwr.Send();

    if (uwr.isError)
    {
        Debug.Log(uwr.error);
    }else
    {
        Debug.Log((float.Parse(uwr.downloadHandler.text) / 100));
        fnumber = ((float.Parse(uwr.downloadHandler.text) / 100));
        transform.position.Set(oldX, fnumber, oldZ);
    }
}

However, this throws this error:

CANNOT RESOLVE DESTINATION HOST

I found this bug-report, which states, it would have been fixed, which doesn't seem so.

So, is there a way to have the server send messages to Unity?

Thanks

Body:
This is simple way to get request from RESTful server :D.

private string m_URL = "https://jsonblob.com/api/d58d4507-15f7-11e7-a0ba-014f05ea0ed4";

IEnumerator Start () {
    var webRequest = new WWW (m_URL);
    yield return webRequest;
    if (webRequest.error != null) {
        Debug.Log (webRequest.error);
    } else {
        Debug.Log (webRequest.text);
    }
}