text:
Q: code works to a point The following code looks good to me but works to a point. The function should display the grade levels of students based on exam performance but it does not run the last two else statements and so, if a student scores lower than 50 the function still displays "pass".
CREATE OR REPLACE FUNCTION stud_Result(integer,numeric) RETURNS text
AS
$$
DECLARE
    stuNum ALIAS FOR $1;
    grade ALIAS FOR $2;
    result TEXT;
BEGIN
    IF grade >= 70.0 THEN SELECT 'distinction' INTO result FROM student,entry
        WHERE student.sno = entry.sno AND student.sno = stuNum;

    ELSIF grade >=50.0 OR grade <=70.0 THEN SELECT 'pass' INTO result FROM student,entry
        WHERE student.sno = entry.sno AND student.sno = stuNum;

    ELSIF grade >0 OR grade< 50.0 THEN SELECT 'fail' INTO result FROM student,entry
        WHERE student.sno = entry.sno AND student.sno = stuNum;

    ELSE SELECT 'NOT TAKEN' INTO result FROM student,entry
        WHERE student.sno = entry.sno AND student.sno = stuNum;
    END IF;

    RETURN result;
END;$$
LANGUAGE PLPGSQL;

Can anyone point me to the problem?

A: This is a PostgreSQL gotcha that has tripped me up as well.  You need to replace your ELSE IFs with ELSIF.
You're seeing that error because each successive ELSE IF is being interpreted as starting a nested IF block, which expects its own END IF;.
See the documentation on conditionals for more information on the proper syntax.

A: Your logic in the conditionals is a bit strange. You have these:

*

*grade >= 70.0

*grade >= 50.0 OR grade <= 70.0

*grade >  0    OR grade <  50.0
Note that zero satisfies the second condition as do a lot of other values that you don't want in that branch of the conditonal. I think you want these:

*

*grade >= 70.0

*grade >= 50.0 AND grade <= 70.0

*grade >  0    AND grade <  50.0
You also seem to be using your SELECTs to check if the person is in the course but if the grade is given and they're not in the course, you will end up with a NULL result. Either the "in the course" check should be outside your function or you should convert a NULL result to 'NOT TAKEN' before returning.
This looks like homework so I'm not going to be anymore explicit than this.

A: Generally, I don't think it is a good idea to hide data in code. Data belongs in tables:
SET search_path='tmp';

-- create some data
DROP TABLE tmp.student CASCADE;
CREATE TABLE tmp.student
    ( sno INTEGER NOT NULL
    , grade INTEGER
    , sname varchar
    );
INSERT INTO tmp.student(sno) SELECT generate_series(1,10);
UPDATE tmp.student SET grade = sno*sno;

DROP TABLE tmp.entry CASCADE;
CREATE TABLE tmp.entry
    ( sno INTEGER NOT NULL
    , sdate TIMESTAMP
    );
INSERT INTO tmp.entry(sno) SELECT generate_series(1,10);

-- table with interval lookup
DROP TABLE tmp.lookup CASCADE;
CREATE TABLE tmp.lookup
    ( llimit NUMERIC NOT NULL
    , hlimit NUMERIC
    , result varchar
    );

INSERT INTO lookup (llimit,hlimit,result)  VALUES(70, NULL, 'Excellent'), (50, 70, 'Passed'), (30, 50, 'Failed')
    ;

CREATE OR REPLACE FUNCTION stud_result(integer,numeric) RETURNS text
AS $BODY$
DECLARE
    stunum ALIAS FOR $1;
    grade ALIAS FOR $2;
    result TEXT;
BEGIN

SELECT COALESCE(lut.result, 'NOT TAKEN')  INTO result
    FROM student st, entry en
    LEFT JOIN lookup lut ON (grade >= lut.llimit
                    AND (grade < lut.hlimit OR lut.hlimit IS NULL) )
    WHERE st.sno = en.sno
     AND st.sno = stunum
    ;
  RETURN result;
END; $BODY$ LANGUAGE PLPGSQL;

-- query joining students with their function values
SELECT st.*
    , stud_result (st.sno, st.grade)
    FROM student st
    ;

But wait: you can just as well do without the ugly function:
-- Plain query
SELECT
    st.sno, st.sname, st.grade
    , COALESCE(lut.result, 'NOT TAKEN') AS result
    FROM student st
    LEFT JOIN lookup lut ON ( 1=1
        AND   lut.llimit <= st.grade
        AND ( lut.hlimit > st.grade OR lut.hlimit IS NULL)
        )
    JOIN entry en ON st.sno = en.sno
    ;

Results:
 sno | grade | sname | stud_result
-----+-------+-------+-------------
   1 |     1 |       | NOT TAKEN
   2 |     4 |       | NOT TAKEN
   3 |     9 |       | NOT TAKEN
   4 |    16 |       | NOT TAKEN
   5 |    25 |       | NOT TAKEN
   6 |    36 |       | Failed
   7 |    49 |       | Failed
   8 |    64 |       | Passed
   9 |    81 |       | Excellent
  10 |   100 |       | Excellent
(10 rows)

 sno | sname | grade |  result
-----+-------+-------+-----------
   1 |       |     1 | NOT TAKEN
   2 |       |     4 | NOT TAKEN
   3 |       |     9 | NOT TAKEN
   4 |       |    16 | NOT TAKEN
   5 |       |    25 | NOT TAKEN
   6 |       |    36 | Failed
   7 |       |    49 | Failed
   8 |       |    64 | Passed
   9 |       |    81 | Excellent
  10 |       |   100 | Excellent
(10 rows)

A: Get rid of the function altogether and use a query:
SELECT
  s.*,
  CASE e.grade
    WHEN >= 0 AND < 50 THEN 'failed'
    WHEN >= 50 AND < 70 THEN 'passed'
    WHEN >= 70 AND <= 100 THEN 'excellent'
    ELSE 'not taken'
  END
FROM
 student s,
 entry e
WHERE
 s.sno = e.sno;


text:
Q: PHP/HTML upload from server to server I want to upload a file from my server via form to another server.
Just like a normal upload form but the file is not stored at the client.
<form enctype="multipart/form-data" action="http://server2.com/upload.api">
<input type="file" name="file"> <!-- serverfile instead of local/client file ?! -->
<input type="submit">
</form>

A: as to be able to manipulate your file, i think its mandatory to first upload it to your web server.
Secondly you can use some php feature to perform a file upload to another server.
In my case i used ssh2, using the function scp-send to send my files to a remote server, then removing them from the web server. but here you will have an additional cost in setting this new feature that cannot be taken lightly.

A: Thanks, I've finally managed to solve my problem via cURL

redpajama_set_name: RedPajamaStackExchange


text:
Q: Another idea for close-vote queue rejuvenation: Show the number of items added today, not the total number This is just one more idea for a way to rejuvenate people's interest in the SO CV queue - which, at the time of this writing, is at 84.7k reviews needed.
Some people are working hard to try to drum up more interest in the queue - Robert has a great idea with the proposed contest for close review queue posse. Still, it seems that the big number scares many people off.

What can we do about this? From what I can see, the problem stems primarily from the big number. So let's get rid of the big number! But we can't lie. Lying is bad.
So, I propose that we stop showing the total number of reviews needed all big and bold like that - let's just show the total number of reviews added today minus the number of reviews performed today:

Much better!
When the community is making progress on the queue, let's show that:

Basically what I'm getting at is some kind of a delta-reviews (delta-R) system - thereby making the big number seem a little less huge.
I'd even be in favor of showing both numbers simultaneously, though this would probably be bordering on too complicated:

Thoughts?


text:
Q: What is exact xpath for the first childnodes of a node? I have a XML code like this:
<?xml version="1.0" encoding="utf-8" ?>
<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Grid>
            <Label/>
            <Label/>
            <Label/>
    </Grid>
</Window>

In code, this is represented as a XML Document. The question is in the code that follows:
public XmlNodeList GetAllChildrenOfName(XmlNode parent, string childName)
{
    string xpath = childName;
    //string xpath = "/" + childName;
    //string xpath = "//" + childName;

    return parent.SelectNodes(xpath);
}

If I call the method for the grid xml node (GetAllChildrenOfName(gridNode,"Label")) from the xml code above, it does not return the expected list of 3 labels for any of the suggested xpath values.
Any guesses, how should the xpath look like?
Thanks

A: child:: is the default axis, so if parent is the Grid, then parent.SelectNodes("Label") should work, assuming that Label is in the default namespace. If you have xml-namespaces you'll need to qualify it by creating a namespace manager:
var nsmgr = new XmlNamespaceManager(parent.OwnerDocument.NameTable);
nsmgr.AddNamespace("foo","blah/your/namespace");
return parent.SelectNodes("foo:Label", nsmgr);

A: This worked for me:
static int Main(string[] args)
{
    XmlDocument xDoc = new XmlDocument();
    xDoc.LoadXml("<Grid><Label /><Label /><Label /></Grid>");
    Response.Write(GetAllChildrenOfName(xDoc.FirstChild, "Label").Count.ToString());
}

public XmlNodeList GetAllChildrenOfName(XmlNode parent, string childName)
{
    string xpath = childName;
    return parent.SelectNodes(xpath);
}

And the output was 3.

A: Because I did not find why the sollution, that works for others, does not work for me, I simply used my own method like this:
private List<XmlNode> SelectNamedChildNodes(XmlNode parent, string name)
        {
            List<XmlNode> list = new List<XmlNode>();
            foreach (XmlNode node in parent.ChildNodes)
            {
                if (node.Name == name) list.Add(node);
            }
            return list;
        }

It is possible to work with the result just the same way as with the XmlNodeList.


text:
Q: Will Child processes run and exit in the order they were created If you were to create children processes that all have the same parent will they run and exit in the order they were created ? For example if you created PID 1 and PID 2 is it possible for PID 2 to finish and exit before PID 1?

A: In general each process can exit as it likes. Nothing on most systems forces them to wait for "siblings" created earlier to exit first.
Some very simple test will show if this is true on the system you use.


text:
Q: Can't find variable itemData in react-native Code :
import React, { useState } from 'react';
import { StyleSheet, Text, View, Button, TextInput, ScrollView, FlatList } from 'react-native';

import GoalItem from './components/GoalItem';

export default function App() {
    const [enteredGoal, setEnteredGoal] = useState('');

    const [courseGoals, setCourseGoals] = useState([]);

    const goalInputHandler = (enteredText) => {

        setEnteredGoal(enteredText);
    };

    const addGoalHandler = () => {

        //console.log(enteredGoal);

        setCourseGoals(currentGoals => [...currentGoals, { id: Math.random().toString(), value: enteredGoal }]);
    };
    return (

        <View style={styles.screen}>
            <View style={styles.inputContainer}>

                <TextInput placeholder="Course Goal" style={styles.input}
                    onChangeText={goalInputHandler} value={enteredGoal} />
                <Button title="Add" onPress={addGoalHandler} />

            </View>
            <FlatList keyExtractor={(item, index) => item.id} data={courseGoals}
                renderItem={itemData => <GoalItem title={itemData.item.value} />}

            />

        </View>

    );
}

const styles = StyleSheet.create({

    screen: {
        padding: 50
    },
    inputContainer: {
        flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center'

    },

    input: {

        width: '70%', borderBottomColor: 'black', borderWidth: 1, padding: 10
    },

});

GoalItem Components :
import React from 'react';

import { View, Text, StyleSheet } from 'react-native';

const GoalItem = props => {

    return (
        <View style={styles.listItem}>
            <Text>{props.title}</Text>
        </View>
    );

};

const styles = StyleSheet.create({

    listItem: {

        padding: 10, backgroundColor: '#ccc', borderColor: 'black', borderWidth: 1, marginVertical: 10

    }

});
export default GoalItem;

Error : Below is the code, please check Can't find variable itemData
  in react-native

Pls i am a newbie in react-native i just got for about two hours. Any
help would be appreciated. Thanks in advance. Look into the code and share some advice so that the code works well..
Thanks :)

A: It should be
<FlatList keyExtractor={(item, index) => item.id}
          data={courseGoals}
          renderItem={(itemData) => <GoalItem title={itemData.item.value} }/>

Or
<FlatList keyExtractor={(item, index) => item.id}
          data={courseGoals}
          renderItem={({item}) => <GoalItem title={item.value} }/>

A: it should be like this :
<FlatList
       data={courseGoals}
       renderItem={itemData => (

        <View  style={styles.listItem}>
          <Text>{itemData.item}</Text>
          </View>
          )}
          />


text:
Q: Combining AngularJS files into one file I'm building an AngularJS application. I don't have external dependencies, but I do have my application broken up into different files for controllers, services, etc.
I'd like to combine all this JS into a single file, so the browser has to make one request to get all the code rather than multiple requests (one for each file). Minification would also be nice.
From what I've been reading so far, Browserify is what I need to use. Does that sound about right? Is there anything folks recommend over this solution?

A: You can start using Grunt or Gulp. With these tools you can do much more than just concat and minify your files. For example if you choose to use Gulp:

*

*you will have to download gulp-cli $ npm install --global gulp-cli

*then create a gulpfile.js in your project and add gulp as dependency $ npm install gulp --save

*then add gulp-concat package which will concatenate your files $ npm install gulp-concat --save

*and finally add some code which will concat your files. Here is an example.

Leave a comment if you need any further help. Good luck!

Using Grunt here is an example gruntfile, assuming you have three different directories for controllers, directives and services for example. I also added watch plugin in case you need it.
$ npm i grunt-cli -g
$ npm i -D grunt
$ npm i -D grunt-contrib-concat
$ npm i -D grunt-contrib-uglify
$ npm i -D grunt-contrib-watch


text:
Q: Get list references from remote private repository LibGit2Sharp Hello!
I want connect to private repository. I have login and password, but program stopped in SSL Verification..
Error: Additional information: this remote has never connected
How i can fix this error?
My code:
        String urls = "url";
        HttpWebRequest request = HttpWebRequest.CreateHttp(urls);
        request.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => false;
        Console.WriteLine(request.AuthenticationLevel);

        var credentials = new UsernamePasswordCredentials
        {
            Username = "user",
            Password = "password"
        };

        var remote = Repository.ListRemoteReferences("url", (url, fromUrl, types) => credentials);

        foreach (var reference in remote)
        {
            Console.WriteLine(reference.TargetIdentifier);
        }

Can you suggest how to disable the check properly when connected to a repository?

A: All is decided!
The error was in ignorance of the full server repository!


text:
Q: Fetching GeoTiff data from WCS via GDAL in code? UPDATE: We seem to have found where the trouble lies, but sadly it is a problem that is built into GDAL's handling of WCS requests and it doesn't seem like we can bypass it. Instead we are going to write our own WCS client to fetch the GeoTiff data and then load in into GDAL from memory. See "EDIT 4" at the bottom for details.

The trouble I'm having is in writing the xml string which I send to the server. I either get an error message from the server when I try to fetch the Dataset src or it passes but I've apparently fetched all the data on the server (which can be seen on the size of the raster) despite wanting just a piece of it.
using(OSGeo.GDAL.Dataset src = OSGeo.GDAL.Gdal.Open(xml, OSGeo.GDAL.Access.GA_ReadOnly))
{
    int rasters = src.RasterCount;
    for(int i = 1; i <= rasters; ++i)
    {
        using(OSGeo.GDAL.Band raster = src.GetRasterBand(i))
        {
            //Yet to be written code
        }
    }
}

I've been unable to find a list of which attributes that can be sent to the server. The attributes I've tried are all attributes which I've seen other people try while I've been googling for help.
Some attributes I've seen different alternatives for, and I've tried each. For projection I've tried SRS, CRS and Projection. For image size I've tried WIDTH and HEIGHT and also SizeX and SizeY. For bounding box I've tried BoundingBox and BBOX.
This is one way that I've attempted to construct the xml string:
string xml = "<WCS_GDAL>";
xml += "<ServiceURL>http://example.com/geoserver/wcs?</ServiceURL>";
xml += "<VERSION>1.1.0</VERSION>";*
xml += "<REQUEST>GetCoverage</REQUEST>";
xml += "<CoverageName>coverage_name</CoverageName>";
xml += "<SRS>EPSG:3006</SRS>";
xml += "<CRS>EPSG:3006</CRS>";
xml += "<Projection>EPSG:3006</Projection>";
xml += "<GetCoverageExtra>";
{
    xml += "&CRS=EPSG:3006";
    xml += "&BBOX=372500.0,6164500.0,373000.0,6165000.0" + ",EPSG:3006";**
    xml += "&WIDTH=200&HEIGHT=200";
    xml += "&FORMAT=GTiff";
}
xml += "</GetCoverageExtra>";
xml += "</WCS_GDAL>";

*I've also tried 1.0.0.
**1.1.0 requires a projection to be part of the bounding box while for 1.0.0 GDAL doesn't allow more than 4 entries in the list.
This is another way that I tried to do it. In this case by affecting the final ServiceURL directly. GDAL will automatically append version and request type before the first ampersand, so I had to include them in the XML so that it doesn't append the wrong ones. GDAL will also cast an exception if CoverageName is not included in the XML.
string link = "http://example.com/geoserver/wcs?";
//link += "&VERSION=1.1.0";
//link += "&REQUEST=GetCoverage";
link += "&coverage=coverage_name";
link += "&CRS=EPSG:3006";
link += "&BBOX=372500.0,6164500.0,373000.0,6165000.0,EPSG:3006";
link += "&WIDTH=200";
link += "&HEIGHT=200";
link += "&FORMAT=GTiff";

string xml = "<WCS_GDAL>";
xml += "<ServiceURL>";
xml += link;
xml += "</ServiceURL>";
xml += "<VERSION>1.1.0</VERSION>";*
xml += "<REQUEST>GetCoverage</REQUEST>";
xml += "<CoverageName>coverage_name</CoverageName>";
xml += "</WCS_GDAL>";

If "<REQUEST>GetCoverage</REQUEST>" isn't included it seems that GDAL defaults to DescribeCoverage. (EDIT: This is incorrect. GDAL doesn't allow you to do DescribeCoverage. GDAL automatically does DescribeCoverage before it does GetCoverage.) And if version is not included GDAL seems to default to 1.0.0.
Depending on what attributes I include, what values I've given them and what version I specify I get a few different Java exceptions from the server. Sometimes it says java.util.ArrayList cannot be cast to org.geotools.geometry.GeneralEnvelope (with version 1.0.0) and sometimes it says java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String.
The exception that I think managed to go the furthest and which I can't seem to get past is org.geotools.coverage.grid.InvalidGridGeometryException: Unspecified image's size..
When I use the version that directly affects the link I can bypass the problem of GDAL not allowing 5 entries for the bounding box with version 1.0.0, which makes the server not cast the ArrayList to GeneralEnvelope cast exception. However, it seems that it then completely ignores the bounding box and returns all the data on the server. If I switch version to 1.1.0 then I get the unspecified image's size exception.
There should be a version 2.0.0 of WCS, but considering the problems I'm having and the fact that I have yet to see any examples of someone else using it has made me unwilling to try it right now. EDIT: Scratch that, GDAL doesn't seem to support it... At least that's what the exceptions tells me.
In short: I need help with finding a way to fetch a GeoTiff of a small area via WCS.

EDIT: This is the XML which I'm currently trying to use, as asked for by iant:
<WCS_GDAL>
    <ServiceURL>http://example.com/geoserver/wcs?</ServiceURL>
    <SERVICE>WCS</SERVICE>
    <VERSION>1.1.0</VERSION>
    <REQUEST>GetCoverage</REQUEST>
    <CoverageName>coverage_name</CoverageName>
    <CRS>urn:ogc:def:crs:EPSG:3006</CRS>
    <GetCoverageExtra>&BoundingBox=372500.0,6164500.0,373000.0,6165000.0,urn:ogc:def:crs:EPSG:3006&WIDTH=200&HEIGHT=200&RESX=200&RESY=200&SizeX=200&SizeY=200&FORMAT=image/GeoTiff</GetCoverageExtra>
</WCS_GDAL>

As you can see, I've resorted to using a lot of redundancy in hope that one of the attributes will be right. This XML isn't written like this btw. I do as I showed above where I build them in a string. Though some of the attributes and values are different since I wrote that.

EDIT 2: iant actually asked for the generated URL string. Here it is:
/geoserver/wcs?SERVICE=WCS&VERSION=1.1.0&REQUEST=GetCoverage&IDENTIFIER=coverage_name&FORMAT=image%2Ftiff&BOUNDINGBOX=200025,7699925,200075,7699975,urn:ogc:def:crs:EPSG::3006&RangeSubset=contents
It seems like GDAL has messed up the URL big time. It's supposed to include everything in the GetCoverageExtra tags straight of, from what I hear. Yet it doesn't have the WIDTH & HEIGHT... It also messed up the values in the bounding box for some reason.

EDIT 3: After URL-escaping the ampersands in the GetCoverageExtra tag the URL is more complete:
/geoserver/wcs?SERVICE=WCS&VERSION=1.1.0&REQUEST=GetCoverage&IDENTIFIER=swe%3Anh_riks_Sweref_99_TM_geotiff&FORMAT=image%2Ftiff&BOUNDINGBOX=200025,7699925,200075,7699975,urn:ogc:def:crs:EPSG::3006&RangeSubset=contents&BOUNDINGBOX=372500.0,6164500.0,373000.0,6165000.0,urn:ogc:def:crs:EPSG:3006&WIDTH=200
Something is still off though. There's two bounding boxes! Both the one which is wrong, which seems like some kind of default value, and the one which I wrote. WIDTH is included, but not HEIGHT, however I found that this was my own fault because I screwed up the ampersand before HEIGHT. After fixing it I get the following exception from the server: java.util.ArrayList cannot be cast to net.opengis.ows11.BoundingBoxType. The default value seems to have double colons between EPSG and 3006, but even after adding another colon I get the same error. I also tried to remove the ".0" from the bounding box values.

EDIT 4 (final?): By looking at the GDAL source code we seem to have found what GDAL is doing wrong. When opening a Dataset via WCS GDAL first automatically sends a DescribeCoverage to the server and uses the returned data to set a bounding box. This means that the bounding box is set to cover all the data in the coverage I'm asking for. This bounding box is then sent with the GetCoverage request regardless of what data you try to give GDAL and the server seems to be unable to handle receiving two bounding boxes in a single request. So there seems to be no way of getting a specified area in WCS via GDAL. My colleague is writing a separate class to fetch specific areas from the server without GDAL and then load that data into GDAL from memory. It seems to be the only way for now, other than compiling our own version of GDAL.

A: GeoServer includes a helpful WCS request builder (on the demos page) that produced the following XML for me:
Version 1.0.0
<?xml version="1.0" encoding="UTF-8"?>
<GetCoverage version="1.0.0" service="WCS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wcs" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xsi:schemaLocation="http://www.opengis.net/wcs http://schemas.opengis.net/wcs/1.0.0/getCoverage.xsd">
  <sourceCoverage>training:output</sourceCoverage>
  <domainSubset>
    <spatialSubset>
      <gml:Envelope srsName="EPSG:3006">
        <gml:pos>372500.0 6164500.0</gml:pos>
        <gml:pos>373000.0 6165000.0</gml:pos>
      </gml:Envelope>
      <gml:Grid dimension="2">
        <gml:limits>
          <gml:GridEnvelope>
            <gml:low>0 0</gml:low>
            <gml:high>0 0</gml:high>
          </gml:GridEnvelope>
        </gml:limits>
        <gml:axisName>x</gml:axisName>
        <gml:axisName>y</gml:axisName>
      </gml:Grid>
    </spatialSubset>
  </domainSubset>
  <output>
    <crs>EPSG:3006</crs>
    <format>GeoTIFF</format>
  </output>
</GetCoverage>

Version 1.1.0
<?xml version="1.0" encoding="UTF-8"?>
<GetCoverage version="1.1.1" service="WCS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.opengis.net/wcs/1.1.1" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xsi:schemaLocation="http://www.opengis.net/wcs/1.1.1 http://schemas.opengis.net/wcs/1.1.1/wcsAll.xsd">
  <ows:Identifier>training:output</ows:Identifier>
  <DomainSubset>
    <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::3006">
      <ows:LowerCorner>6164500.000000001 372499.99999999994</ows:LowerCorner>
      <ows:UpperCorner>6165000.000000001 372999.99999999994</ows:UpperCorner>
    </ows:BoundingBox>
  </DomainSubset>
  <Output store="true" format="image/tiff">
    <GridCRS>
      <GridBaseCRS>urn:ogc:def:crs:EPSG::3006</GridBaseCRS>
      <GridType>urn:ogc:def:method:WCS:1.1:2dSimpleGrid</GridType>
      <GridOffsets>NaN NaN</GridOffsets>
      <GridCS>urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS</GridCS>
    </GridCRS>
  </Output>
</GetCoverage>

In both cases you would want to POST these files to the server.
If you want to go down the GET route then the best place to look is the WCS spec (page 40) where you will find a table with all the options. You are required to use SERVICE=WCS, VERSION=1.0.0, REQUEST=GetCoverage, COVERAGE=name,CRS=crs_identifier,BBOX=minx,miny,maxx,maxy or TIME=time1,time2, WIDTH=w,HEIGHT=h or RESX,RESY, FORMAT=format


text:
Q: Add return of stock data with function Delt() to a list of dataframe I have a list of data frames with stock data and want to add a new column with return of the stock price to each data frame in the list. The data frames looks as:
        ABB.ST.Open ABB.ST.High ABB.ST.Low ABB.ST.Close ABB.ST.Volume ABB.ST.Adjusted       Date
    1         166.4       167.4      165.5        166.0        944525        162.1181 2015-01-02
    2         165.6       166.6      164.4        164.4       1013670        160.5555 2015-01-05
    3         161.2       161.6      159.1        159.1       2546062        155.3794 2015-01-07
    4         160.3       163.3      159.2        163.0       1946157        159.1882 2015-01-08
    5         162.8       162.8      160.0        160.6       1885969        156.8444 2015-01-09
    6         161.5       162.6      160.6        161.1       1795966        157.3327 2015-01-12
    7         159.8       160.6      158.3        160.0       2445040        156.2584 2015-01-13
    Delt.1.arithmetic
1                  NA
2       -0.0066959806
3       -0.0127628163
4        0.0168292916
5       -0.0002389207
6        0.0141549696
7       -0.0044953302

This goes on down till the date od today, i.e. approx 1300 rows.
Now want to add the return of the first column ABB.ST.Open with the function Delt from package quantmod.
This code work when I apply it to just the data frame, outside the list:
ABB.ST$Return <- Delt(ABB.ST[,1])

But how do I add this column to all data frame in a list?
My list name is master_df and I have tried this code, but it does not work...
Return <- function(x){
  master_df[[x]]$Return <- Delt(master_df[[x]][,1])
}

test2 <- lapply(master_df, Return(x))

UPDATE:
I have data.frame in the list, where my list name is master_df, this is my code where I download data from yahoo finance:
as.matrix(LargeCapOMXS[,7]) is my list of symbols names from yahoo
Stocklist <- as.matrix(LargeCapOMXS[,7]) #get names of stocks
master_df <- list() #create list to fill with data

for(i in seq(length(Stocklist))){ #loop to fill list with downloaded stock data, by company
  Stockindex = Stocklist[i]
  getSymbols(Stockindex, src="yahoo", from="2015-01-01", to="2020-01-01", verbose = TRUE)
  master_df[[i]] <- as.data.frame(get(Stockindex))
  master_df[[i]]$Date = row.names(master_df[[i]])
  row.names( master_df[[i]]) = NULL
}
}

A: I manage to solve the problem with the following for loop:
for(i in seq(length(master_df))){
  master_df[[i]]$Return <- Delt(master_df[[i]][,1])
}

Does anyone have an idea to use an apply function? this for loop is fairly fast, but for curiosity.

A: Below is some code to get the data from yahoo, into a list and add the Delt column to each xts object. No need for creating data.frames. You can always do this later.
library(quantmod)

stock_list <- c("ABB", "ABT")

master_df <- lapply(stock_list, getSymbols, from = "2015-01-01", to = "2020-01-01", auto.assign = FALSE)
names(master_df) <- stock_list

# need to merge the xts with the outcome of Delt as Delt only returns 1 column
# function Op selects the open column.
master_df <- lapply(master_df, function(x) merge(x, Delt(Op(x))))

Or using tidyquant if you want a giant data.frame.
library(tidyquant)
library(dplyr)

master_df_tq <- tq_get(stock_list)
master_df_tq <- master_df_tq %>%
  group_by(symbol) %>%
  tq_mutate(select = open,
            mutate_fun = Delt)


text:
Q: Usage of an article in front of the structure "adjective + non countable noun."

*

*They blamed the accident on shoddy construction.

*They blamed the accident on a shoddy construction.

-
Are both of these two sentences correct?
I think the usage of an article could be possible in front of an uncountable noun, while the abstract uncountable noun is more specified by an adjective.
But, I've never seen this method used before words like research, evidence, information etc. So I'm confused with my shabby knowledge on the word "construction."
How about the usage of an article in front of "shoddy construction"?

A: Here's a parallel to "shoddy construction":
'beautiful explanation' versus 'a beautiful explanation'
The noun 'explanation' may be considered uncountable, but it's always possible to refer to a certain explanation, say of a plan, poem or mystery.
Both with or without an indefinite article, your sentence makes sense and grammatically correct, I believe.

A: If the noun is a mass noun (uncountable) the article is not appropriate.
Example sentence 1 ("They blamed the accident on shoddy construction") sounds fine.
Example sentence 2 ("They blamed the accident on a shoddy construction") does not, especially if trying to consider "construction" as a count noun.  "They blamed the accident on a shoddy construction job" sounds much better.
Sankarane's example doesn't seem to work because "explanation" is countable as used there.
Consider this correct sentence: "The contractor delivered white sand."
and this incorrect one: "The contractor delivered a white sand."
and this correct one: "They enjoyed a day at a white sand beach."


text:
Q: Sub-Select com MAX / SUM / INNER JOIN? Preciso fazer um SUM dentro de um MAX para retornar o maior faturamento do produto dentro de uma sumarização.
Consegui fazendo isso:
SELECT MAX(Faturamento) MAX_Faturamento
FROM (SELECT SUM(P.preco * I.qtde) Faturamento
    FROM produto P
    INNER JOIN itens I ON P.cod_prod = I.cod_prod
    GROUP BY P.descricao) AS tabela_aux;

Porém também preciso trazer a descrição do produto, somente do produto que teve o maior faturamento. Tentei usando isso:
SELECT Descricao, MAX(Faturamento) MAX_Faturamento
FROM (SELECT P.descricao, SUM(P.preco * I.qtde) Faturamento
    FROM produto P INNER JOIN itens I ON P.cod_prod = I.cod_prod
    GROUP BY P.descricao) AS tabela_aux
GROUP BY Descricao;`

Porém ele me retorna todos os registros e eu preciso somente do que teve o maior faturamento.

A: Obrigado, Motta! Consegui usando as ferramentas que você me proporcionou. Ficou mais ou menos assim:
'SELECT Descricao, MAX(Faturamento) Faturamento FROM (SELECT SUM(P.preco * I.qtde) Faturamento, P.descricao FROM produto P INNER JOIN itens I ON P.cod_prod = I.cod_prod GROUP BY P.descricao) AS tab_aux GROUP BY Descricao ORDER BY Faturamento DESC LIMIT 1;'


text:
Q: SQL Server Ordering time by most recent, then closest I have tables as posted in this question.
•Measurements (MeasureID, Time, Distance, Value)
•Events(EventID, Time Value)
•EventValues (EventDataID, EventID, Type, Value)
I currently can get the most recent events for each measurement, however what i would like to do is get the most recent event, but if one doesnt exist (i.e. the measurement is BEFORE the first event) i would like to get the CLOSEST event (so basically the first event)
I am thinking to maybe order by time difference showing positive times first then negative times last in my subquery, is this possible and how can i acheive it?

A: Havent tested, but I think something like the case logic below would work.
(SELECT TOP 1 EV.value FROM [Event] E JOIN EventValues EV ON E.EventID = EV.EventID
  WHERE M.Time >= E.Time
  ORDER BY case when M.Time > E.Time then 1 else 2 end,
           abs(M.Time-E.Time)) AS Data


text:
Q: Push a commit in two branches with Git how do I push a commit in two branches?
I can't use "git push", because then it pushes to three branches, and i just want the commit in two of them..
Ive tried a "git merge HEAD --commit id from branch A--" in branch B, but then it takes everything from branch A and merges with branch B. I just want the last commit and not everything else merged with branch B.
Anyone know what to do?

A: Short answer
You can apply already existing commit to another branch using cherry-pick command, and then push both branches using git push origin branchA branchB.

Why pushing a commit in two branches might be useful
Assume you have a repository with this structure:
A--B--C--D  ← master ← HEAD
      \--E  ← v1-release

After some development (commits A, B, C) project was released and v1-release branch was created (so that v1 can be supported with bugfixes and next version can be developed in master). Commit E was used to specify version information (added release notes, etc). Commit D introduced new feature, which is planned for the next version and should not appear in v1-release.
Now, if a bug is found in v1-release, it must be fixed in both branches, so that users can continue using v1 and it does not appear in the next version.
After fixing the bug in master, repository should look like this:
A--B--C--D--F  ← master ← HEAD
      \--E     ← v1-release

Now commit F with a bugfix must be applied to v1-release branch.
How to actually do it
Commits cannot be exactly copied (since commit is a directory saved state), but you can apply changes made in commit to another commit.
cherry-pick command does exactly that. It applies changes made by a specified commit to the current branch, creating new commit:
git checkout v1-release
git cherry-pick F

After this, repository should look like this:
A--B--C--D--F  ← master
      \--E--G  ← v1-release ← HEAD

Commit G introduces same changes as F.
You may have to resolve conflicts (exactly like after merge).
Error message

The previous cherry pick was now empty ...

means that changes made by cherry-picked commit are already present in current branch. You probably forgot to checkout correct branch.
In case of errors or conflicts cherry-pick can be aborted using git cherry-pick --abort.
Finally, you can return to master branch and push both branches to remote repository:
git checkout master
git push origin master v1-release

Final repository structure:
A--B--C--D--F  ← master ← HEAD
      \--E--G  ← v1-release

A: Try this:
git push origin <commitId>:<brancnName_1>
git push origin <commitId>:<brancnName_2>

It works on my side.


text:
Q: Laravel collection - get max value as float/int There was a problem. Previously, the share_price column was a float, after which we had to change it to a string, because the client requested the use of not only floats, but also words.
To display the minimum and maximum values in the filter, use the min and max function.
But since appeared string, max value is now always string.
How to convert column to float in max wrapper?
$companyList = $companyList->get();
$maxValue = $companyList->max('share_price');

UPDATE
It seems you misunderstood me a bit. This does not mean the conversion of the already obtained value, but when selecting the max value.
Example:

*

*1.52

*2.43

*3.35

*STRING

When i get ->max() - i get STRING, but need to get 3.35

A: The Illuminate\Support\Traits\EnumeratesValues::max method accepts only one argument that can be either:

*

*a string that acts as the key to check in the collection

*or a callable (a function) that you may use to filter out strings in your case.

In your case, you can use a callback function that removes the strings, or precisely, treats the strings as null.
/** we will simply tell the "max" method to treat strings as "null" */
$maxValue = $companyList->get()->max(fn($value) => is_string($value) ? null:$value);

The above code will:

*

*return the maximum number if at least 1 integer/float is found in the collection.

*return null if the collection is empty or contains only strings.

The code sample above DOES NOT convert strings to their float/integer representation and even if you have a valid, castable string in your collection (like "100") it will be treated as null.

A: Since you're already using a collection, I'd suggest using filter to filter out all non-numeric items.
$companyList->get()
    ->filter(fn ($value, $key) => is_numeric($value->share_price))
    ->max('share_price');

A: You can try floatval function of PHP.
floatval($string);

or you can also cast your string value into float like below:
(float)$string;

A: Cast $maxValue as int or float
$int = (int)$num;
$float = (float)$num;

or the hacky way
$maxValue = $companyList->max('share_price') + 0;


text:
Q: .NET - Unit Testing Your Code and State in Your Database Assumptions: We use .NET coding against SQL Server 2005
I was just wondering how most people incorporate state into the Unit Tests that affect their database? I know when and where to use mocking, but when you want to move past that and actually do some database tests... what strategies do you use to setup and teardown your database? Do you do this per test? or setup a certain scenario in the database and run several tests against that "state of the world". Any advice would help. Thanks.

A: I run most of the testcases against an empty database, meaning that only the database schema exists, but no data. The actual data is created and deleted by the test cases or the setup and teardown as needed. This takes longer than having an a prepared database, but is more resistent against database schema changes.

A: Here's what I do in NUnit...Start a database Transaction in a method marked with the [Setup] Attribute.  Setup the database state as you would like.  NUnit then runs the test against that state.  Roll back the database transaction in a method marked with the [TearDown] attribute.  You never change the state of the database that way.

A: First of all, all my Database DDL 'scripts' are written in C# classes.  I use Migrator.NET to do this: I have several classes in where every class contains some logic to upgrade or downgrade my DB.
I have a database that is called 'projectname_test' that I use to run my unittests against that need to have DB access.
This DB is being upgraded by my Migrator.NET classes.  This DB is upgraded by a CI process (CC.NET).
The unittests that access that DB will remove everything that is in that DB after they ran.
And, when I want to play it drastically, I can simply drop my test DB; it will be rebuilt by the CC.NET process. :)

A: Take a look at this question and answers
How do I test database-related code with NUnit?

A: If you use NHibernate as ORM it is easy to swap the real SQL Server database (a few lines in app.config) with an in-memory SQLite database that is easily recreated on every test. This way your integration/build server which will execute the unit tests no longer needs to access an SQL Server.

A: In most products whether its a Large Hosted WebSite or Shrink Wrapped product with a DB, you usually have 2 scenarios you want to Unit Test (I understand this to some may cross over to much more than simply Unit Testing)

*

*The Fresh Install Path - When you create the DB from scratch

*

*Automating the DB Creation using MsBuild and SQLCMD, passing parameters in

*Use PowerShell for any Server Level Administrative stuff

*The Upgrade Path - When you are upgrading the DB of an existing customer

*

*Restore a backup of a cleansed Real World DB as your Baseline

*If necessarily apply upgrades after upgrades

*Again use PowerShell, MsBuild, SQLCMD to orchestrate the harness

For me, even when Unit Testing I like to test with "Real World" Data especially real world Volume of data, to catch issues as close to the Implementation Phase as early as possible.  So in general I don't even do Mock Testing and go for a better Unit Testing Harness that can be rebuilt and run ondemand.  Basically the Continuous Integration approach, or partial CI (oxymoron) approach.
Notice that if you take the Continuous Integration approach, what you are keeping in Mind even during Implementation and Development is the Automation of Deployment of the Deliverables/Release into Production.  Basically keeping the End in mind from the very Beginning, because your new feature isn't worth a thing if its not easily deployable.  This is especially the case when Big Data horizontal scalability today usually means you are separating Customers in different DB's and have to repeatably run the Deployment Scripts on several of those DBs, in a predictable fashion.
How many times has a Developer declared they are "done", but then you have no clue how to even start doing functional testing on it, because it can't be deployed to anywhere other than the Developer's Environment.
So the Unit Testing harness you are creating, really test not just your Code but also the Deployment Scripts.  In general to achieve this I use Jenkins, MsBuild, PowerShell.  And if browsers are involved I use VirtualBox for the VM to launch different browsers.


text:
Q: How to ssh into a specific computer on server? When ssh into a collection of computers on my University server I get assigned a particular machine and the machine changes every time (I assume based on how much each is being used). In other words when I type,
ssh username@servername

I get
username@nws##:~$

where ## is some number between 1-25. However, I would like to create processes on several machines and would rather select which computer I am ssh into. Is there a way for me to choose which machine I want to use?

A: All you need is the specific hostname (or more likely, the specific IP address) of the server you want to access, and then
ssh username@specifichostname

It is possible that the individual machines are not directly accessible from wherever you are ssh'ing from, in which case, you might have to
ssh username@servername
ssh username@specifichostname


text:
Q: Nested one-to-many relationship sqlalchemy filtering I'm trying to filter nested one-to-many relationship in sqlalchemy, but it gives the filter only in the inner join ( second one), how Can I specify the filter in the outer join not the internal one?
I have

*

*one-to-many school -->classes

*one-to-many class -> student

I'm trying to get all the students in specific school, in specific class
Models.py
class School(Base):
    __tablename__ = 'schools'
    id = Column(Integer, primary_key=True)
    name = Column(String)
    #  # Relationship for one-many - parent of classes
    classes = relationship("Class")

    def __repr__(self):
        return "<School(name='%s')>" % self.name

class Class(Base):
    __tablename__ = 'classes'
    id = Column(Integer, primary_key=True)
    name = Column(String)
    # foreign Key for the parent - child of school
    school_id = Column(Integer, ForeignKey('schools.id'))
    # Relationship for one-many - parent of students
    students = relationship("Student")

    def __repr__(self):
        return "<Class(name='%s')>" % self.name

class Student(Base):
    __tablename__ = 'students'
    id = Column(Integer, primary_key=True)
    name = Column(String)
    fullname = Column(String)
    nickname = Column(String)
    # foreign Key for the parent - child of school
    class_id = Column(Integer, ForeignKey('classes.id'))

    def __repr__(self):
        return "<Student(name='%s', fullname='%s', nickname='%s')>" % (
            self.name, self.fullname, self.nickname)

the query is
info = session.query(SchoolModel). \
                options(subqueryload(SchoolModel.classes).subqueryload(ClassModel.students)). \
                filter(SchoolModel.id == parent_lookup_class__student). \
                filter(ClassModel.id == parent_lookup_class). \
                filter(StudentModel.id == pk). \
                first()

The output is giving all students with all the info related to it, what's wrong with my query?

A: the problem was I'm using subqueryload and it actually can't be modified, instead I ued contains_eager() to filter my results
the new query is
 info = session.query(SchoolModel). \
            join(SchoolModel.classes). \
            join(ClassModel.students). \
            options(contains_eager(SchoolModel.classes), contains_eager(SchoolModel.classes, ClassModel.students)). \
            filter(SchoolModel.id == parent_lookup_class__student). \
            filter(ClassModel.id == parent_lookup_class). \
            filter(StudentModel.id == pk). \
            populate_existing(). \
            first()


text:
Q: Angular 1.5 - How to add element to a scoped array I have an Angular controller that defines a scoped variable that consist of an array of objects. Each object is a tagName and its value is a list of services associated to those tags:
$scope.recordedServices = [{"myTag" : [{ url : "http://service0"}, { url : "http://service1" }] }];

After the page is loaded {{recordedServices}} prints correctly:
[{"myTag":[{"url":"http://service0"},{"url":"http://service1"}]}]

In that controller I have a replaceList function that replaces the whole $scoped.recordedServices list:
  $scope.replaceList = function(){
      $scope.recordedServices = [ {"myTag" : [{url:"http://replacedList"}] }];
  }

When calling it, everything works as expected, {{recordedServices}} is now:
[{"myTag":[{"url":"http://replacedList"}]}]

Now the problem. What I really want to do is add a new service to "myTag":
  $scope.addToList = function(){
      $scope.recordedServices["myTag"].push({url:"http://addedService"});
  }

But it fails because $scope.recordedServices["myTag"] doesn't exist, the actual structure of the $scoped.recordedServices list is:
$scope.recordedServices: Array[1]
0 : Object
  $$hashKey : "object:33"
  myTag : Array[1]
    0 : Object
      $$hashKey : "object:36"
      url : "http://replacedList"

What is the correct (Angular) way to add an element to that array?
UPDATE:
One possible solution would be doing:
 $scope.addToList2 = function(){
      if($scope.recordedServices[0] == null){
          $scope.recordedServices[0] = [];
      }
      if($scope.recordedServices[0]["myTag"] == null){
          $scope.recordedServices[0]["myTag"] = [];
      }
      $scope.recordedServices[0]["myTag"].push({url:"http://addedService"});
  }

But this works only if $scope.recordedServices was initialized in the controller (for instance: $scope.recordedServices = [{"myTag" : [{ url : "http://service0"}, { url : "http://service1" }] }];). However if initially it is $scope.recordedServices = [] it doesn't work.
{{recordedServices}} prints [[]]
Inspecting the variable the content is as follows. It looks similar with the only differenced that myTag[0] doesn't contain $$hashKey.
$scope.recordedServices: Array[1]
0 : Array[0]
  $$hashKey : "object:68"
  length : 0
  myTag : Array[1]
    0 : Object
      url : "http://addedService"

A: $scope.recordedServices is an array. You should use an index:
Change this:
$scope.recordedServices["myTag"].push({url:"http://addedService"});

to this:
$scope.recordedServices[0]["myTag"].push({url:"http://addedService"});

UPDATE
You can check if it is empty, if so, add myTag object too:
if ($scope.recordedServices.length == 0){
    $scope.recordedServices.push({"myTag": [{url:"http://addedService"}]});
}else{
    $scope.recordedServices[0]["myTag"].push({url:"http://addedService"});
}

A: You can define your $scope.recordedServices=[] as an empty array inside your controller. So now you can play with it inside the controller and view as you wish.
Push new record like this -
$scope.addToList = function(){
  $scope.recordedServices.push({url:"http://addedService"});
}


text:
Q: Saxon-CE Installing problems I'm trying to use Saxen-CE. But when I run the following  code with Eclipse on my localhost I receive 2 Errors:

*

*Error: Permission denied to access property 'document'
CECE12D2976993D3B12B21ED2115A689.cache.html:1

*Error: Permission
denied to access property 'Saxonce'
CECE12D2976993D3B12B21ED2115A689.cache.html:2042

I tried to change the permissions but without success. Am I missing something? Even when I import Saxonce.nocache.js directly I'm not able to call the Saxon.run function.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="../Saxonce/Saxonce.nocache.js"></script>
    <script type="text/javascript">
      var onSaxonLoad = function() {
        Saxon.run(
        {
          stylesheet: "transformation.xsl",
          source:     "xmlfile.xml",
          logLevel:   "INFO"
        })};
    </script>
</head>
<body>
    TEST
</body>
</html>

Is there any other XSLT 2.0 Processor? Maybe jquery?


text:
Q: Profile a Thread in Linux System using 'Perf stat' We know how to count the instructions of a process dynamically over some time using 'perf' :
perf stat -p <pid> -- sleep <period>

I want to be able to do the same thing on a thread. Assuming a Process with PID 1500 has threads with SPID(TID) 1501, 1502, 1503, and 1504. I want to count each threads instructions using
perf stat -p <spid> -- sleep <period>

However, when I do so, I get:
Performance counter stats for process id '1502':
<not counted> instructions
0.504 seconds time elapsed.

Some events weren't counted. Try disabling NMI watchdog:
echo 0 > /proc/sys/kernel/nmi_watchdog
perf stat ...
echo 1 > /proc/sys/kernel/nmi_watchdog

I am using perf on Raspberry Pi, Raspbian Jessie. There is no '/proc/sys/kernel/nmi_watchdog'. The problem I suspect is that I am trying to profile a Thread ID. I would appreciate if there is a workaround or attribute to the 'perf stat' command to check out thread stats.
Thanks..


text:
Q: Why my RDLC report is not getting populated with latest data? I have an rdlc report which is loading data from database table via Datatable but problem is that it only shows 27 records, not more. Even the sql table and datatable in c# has populated data but not populating in RDLC report.
I have used same code and same problem everywhere.
protected void Page_Load(object sender, EventArgs e)
    {
        //ASP.controls_resultlabel_ascx ResultLabel = new ASP.controls_resultlabel_ascx();

        if (!IsPostBack)
        {

            Fill_AuditsReport();

        }
    }

    public void Fill_AuditsReport()
        {
            ReportViewer1.AsyncRendering = false;
            ReportViewer1.SizeToReportContent = true;
            ReportViewer1.ZoomMode = ZoomMode.FullPage;
            this.ReportViewer1.Reset();

            DataTable dt = new DataTable();
            Audits.ManageAudits MngAudits = new Audits.ManageAudits();

            dt = MngAudits.SelectAuditsInfo();

            ReportViewer1.ProcessingMode = ProcessingMode.Local;
            ReportViewer1.LocalReport.ReportPath = Server.MapPath("~/DataManagementReports/AuditsReport.rdlc");
            ReportDataSource rpds = new ReportDataSource("DataSetAudits", dt);
            ReportViewer1.LocalReport.DataSources.Clear();
            ReportViewer1.LocalReport.DataSources.Add(rpds);
            ReportViewer1.Visible = true;
        }

Even datatable is getting populated with full data while debugging.


text:
Q: How to populate a field from an array of objects of another a collection that it's not a model in mongoose for example I have two collections,
1st collection schema (test):
const testSchema = new mongoose.Schema(
  {
    _id: mongoose.Schema.Types.ObjectId,
    name: {
      type: String,
      required: [true, "le nom d'examen est obligatoire!"],
    },
    year: {
      type: Number,
      required: [true, "l'année est obligatoire"],
    },
    questions: [
      {
        type: mongoose.Schema.Types.ObjectId,
        ref: "Question",
      },
    ],
    clinicalCase: [
      {
        _id: {
          type: mongoose.Schema.Types.ObjectId,
          index: true,
          required: true,
          auto: true,
        },
        text: String,
      },
    ],
  },
  {
    timestamps: true,
  }
);

2nd schema:
const questionSchema = new mongoose.Schema({
  test: {
    type: mongoose.Schema.Types.ObjectId,
    ref: "Test",
  },
  questionString: {
    type: String,
    required: [true, "la question est obligatoire"],
  },
  explanation: String,
  options: [option],
  tag: {
    type: mongoose.Schema.Types.ObjectId,
    ref: "Tag",
  },
  clinicalCase: {
    type: mongoose.Schema.Types.ObjectId,
  }
});

so my problem here is when I query 2nd schema, I want to populate the clinicalCase field with 1st schema, is it possible to do it with populate method or not ? can you help me with it please


text:
Q: Возможно ли использовать в теги audio плейлист с песнями от DropBox? Всем привет и с наступающим, один из последних вопросов в этом году у меня звучит так.
Возможно ли использовать в теги audio плейлист с песнями от DropBox?
A: Используйте dropbox api, думаю это реально.


text:
Q: How to read a Cookie using Symfony 2? I'm building a replacement for a web application the company I work for uses. It was built using CakePHP 1.3, and I'm rewriting it from the ground up using Symfony 2. The two systems will run side by side, with various features being transferred to Symfony 2 and removed from the old CakePHP application.
To avoid confusion with log in details, I want CakePHP to handle the user log in side of things until I'm at a point where I can turn off CakePHP altogether and rely on Symfony 2's security. In the meantime, the CakePHP application generates a cookie with contains a user ID. I want to use this cookie for Symfony as a rudimentary form of security.
However, I'm unable to get Symfony to read or load the cookie that's been created. Here is my code:
public function securitytestAction()
{

    $request = $this->getRequest($_COOKIE);
    $cookie = $request->headers->getCookies('CakeCookie[passport]');

    print_r($cookie);

    return $this->render('InstructorBundle:Default:test.html.twig');
}

Using Firebug, the Cookie that CakePHP generates during the login is named 'CakeCookie[passport]'. It isn't encrypted either.
The error I get is this:

FatalErrorException: Error: Call to undefined method
  Symfony\Component\HttpFoundation\HeaderBag::getCookies() in
  DefaultController.php line 713

What could I do to get this working?
EDIT
Cheesemacfly had suggested replacing:
$request = $this->getRequest($_COOKIE);
$cookie = $request->headers->getCookies();

With just this:
$request = $this->getRequest()->cookies->all();

I get the following response:

Array ( [PHPSESSID] => gptbmh61mfkqn6p86d3suhnt13 )

EDIT 2
I've been looking at the code that CakePHP used to generate the Cookie, and it wasn't giving the domain for the cookie. I have now fixed it so that the domain is .domain.org, so that it can be accessed by subdomains as well.
Now, when I go to the Symfony2 application using Firebug, I can see the Cookie listed along with the other two CakePHP session cookies (which I don't need). The 3 CakePHP domains all use www.domain.org even when viewing the subdomain new.domain.org, while the one cookie Symfony2 uses displays it's domain name as new.domain.org.Symfony2 though still refuses to load the Cookie I want.

A: I figured it out with help to a friend.
Essentially, the cookie that was being set in CakePHP didn't include a path. To combat this, I added the following PHP code:
$value = $someone['User']['id'];
setcookie("passport", $value, time()+1200, "/", ".domain.org");

I then checked Symfony2, without changing the code from the previous edit, and Symfony2 can then pick up the cookie.
Thank you everyone for the help!

A: During each request, Symfony2 will set a global template variable app in both Twig and PHP template engines by default. The app variable is a GlobalVariables instance which will give you access to some application specific variables automatically:
app.security - The security context.
app.user - The current user object.
app.request - The request object.
app.session - The session object.
app.environment - The current environment (dev, prod, etc).
app.debug - True if in debug mode. False otherwise.

Examples:
In twig: {{ app.request.method }}
In PHP: echo $app->getRequest()->getMethod() In twig: {{ app.user.username }}
But for the session object:
In twig: {{ app.session.varname }}
In PHP: // I don't know, do you know how to call it?


text:
Q: Can I use Firebase's authentication to protect data on my own private server? Due to some constraints of my project I need to manage my api server and database separately from firebase, however there is nothing stoping me from using their other tools like analytics and in this particular case authentication.
I wanted to ask if following scenario is possible:

*

*I authenticate user on my client app using their SDK's

*I send relevant jwt data in headers of my API

Can I then somehow validate this on my server, so in essence avoid complex auth service and use firebase for this instead? Are there any examples, preferably for NodeJS server.

A: Yes you can, it's very common use case and firebase auth has been made with such usage in mind. As you said, send jwt data on headers, then on the server, you verify the token with firebase service:
var admin = require('firebase-admin');

admin.initializeApp(); //may require other steps, see last link

// idToken comes from the client app
admin.auth().verifyIdToken(idToken, true)//second argument is optional, checks whether the ID token was revoked
  .then(function(decodedToken) {
    let uid = decodedToken.uid;
    // ...
  }).catch(function(error) {
    // Handle error
  });

https://firebase.google.com/docs/auth/admin/verify-id-tokens
https://firebase.google.com/docs/reference/admin/node/admin.auth.Auth#verifyidtoken
https://firebase.google.com/docs/admin/setup


text:
Q: how to get selected text of drop down list in jsp This is my drop down list in jsp:
<form action="any.jsp">
  <select name="item">
     <option value="1">Cricket</option>
     <option value="2">Football</option>
     <option value="3">Hockey</option>
  </select>
<input type="submit" value="Submit">
</form>

in any.jsp I want to access the selected text of the drop down list not the value. so can anyone please help me with that.

A: You can achieve that easily using JQuery in your JSPs, you can give an id to select field. And then get the value of selected field using JQUery.
First give an id to select field:
<select name="item" id="id1">

then you would get the value of the selected option the following way:
var value = $( "#id1 option:selected" ).text();

This value variable will contain the text of the selected field.
Or if you don't want to deal with the importing JQuery library etc, you can use simple JavaScript inside your JSP to get the text of selected option like this:
var abc = document.getElementById("id1");
var value= abc.options[abc.selectedIndex].text;


text:
Q: lack of memory in C program I wrote the program below ti implement an algorithm with big arrays but when N is over 820 i have a segmentation fault problem (core dump) because of memory. I use 3 big arrays to implement my code. How can i fix this error?
#define N 400

void upper(float A[N][N], float x[N], float b[N])
{
    int i,j;
    float sum;
    x[N-1] = b[N-1]/A[N-1][N-1];

    for(i=N-2; i>=0; i--){
        sum = b[i];
        for(j=i+1; j<N; j++){
            sum = sum - x[j]*A[i][j];
        }
        x[i] = sum /A[i][i];
    }
}

void lower(float A[N][N], float x[N], float b[N])
{
    int i,j;
    float sum;
    x[0] = b[0]/A[0][0];
    for(i=1; i<N; i++){
        sum = b[i];
        for(j=0; j<i; j++){
            sum = sum - x[j]*A[i][j];
        }
        x[i] = sum /A[i][i];
    }
}

void cholesky(float A[N][N],float L[N][N])
{
    int i,j,k;
    float sum;

    for(i=0; i<N; i++){
        for(j=i-4; j<i; j++){ //j-4 because i have 0 and i want to do less computations
            if(j<0)
                continue;
            sum = A[i][j];
            for(k=i-4; k<i; k++){
                if(k>=0)
                    sum = sum - L[i][k]*L[j][k];
            }
            L[i][j] = sum /L[j][j];
        }
        sum = A[i][i];
        for(k=i-4; k<i; k++){
            if(k>=0)
                sum = sum - L[i][k]*L[i][k];
        }
        L[i][i] = sqrt(sum);
    }
}

void transpose(float L[N][N], float LT[N][N])
{
    int i,j;
    for(i=0; i<N; i++){
        for(j=0; j<N; j++){
            LT[i][j] = L[j][i];
        }
    }
}

void table(float A[N][N], float aii, float aone, float athree)
{
    int i,j;

    for(i=0; i<N; i++){
        for(j=0; j<N; j++){
            if(i==j){
                A[i][j] = aii;
            }
            else if((i+1 ==j) || (i-1==j)){
                A[i][j] = aone;
            }
            else if(i+3==j || i-3==j){
                A[i][j] = athree;
            }
            else{
                A[i][j] = 0;
            }
        }
    }
}

void vector(float b[N], float b1, float b2, float all)
{
    int i;
    for(i=0; i<N; i++){
        b[i] = all;
    }
    b[0] = b[N-1] = b1;
    b[1] = b[N-2] = b2;
    b[2] = b[N-3] = b2;
}

int main()
{
    float A[N][N];
    float L[N][N],LT[N][N];
    float x[N];
    float y[N];
    float b[N];
    int i,j;

    table(A,12,-5,1);
    vector(b,4,-1,0);

    table(L,0,0,0);
    cholesky(A,L);
    transpose(L,LT);
    lower(L,y,b);
    upper(LT,x,y);

    for(i=0; i<N; i++){
        printf("%f\n",x[i]);
    }
}

A: You allocate large matrices on the stack in main. When N is 840, each matrix requires about 2.8 MB. Your stack cannot accommodate these matrices and it overflows.
You could tamper with your system's stack settings, but it is usually better to allocate large matrices and vectors on the heap:
float (*A)[N] = malloc(N * sizeof(*A));
float (*L)[N] = malloc(N * sizeof(*L));
float (*LT)[N] = malloc(N * sizeof(*LT));
float *x = malloc(N * sizeof(*x));
float *y = malloc(N * sizeof(*y));
float *b = malloc(N * sizeof(*b));

Ensure that all arrays have been allocated properly before using them:
if ((A && L && LT && x && y && b) == 0) {
    fprintf(stderr, "Allocation failed.\n");
    exit(1);
}

Don't forget to clean up the resources after you have used them at the end of main:
free(A);
free(L);
free(LT);
free(x);
free(y);
free(b);

A: Your segmentation fault is caused by a stack overflow. You can use a heap instead. A simple way to use a heap is by declaring your arrays in the global scope.
Refer to this answer on explicitly using heaps: https://stackoverflow.com/a/571961/2791719


text:
Q: SQL - Get matches where match is NULL or parameter with one-to-many Table Rule:

RuleID    RuleName
1         Rule1
2         Rule2
3         Rule3
4         Rule4

Table Equipment:

EquipmentID     EquipmentName     EquipmentCode
1               Equip1            E1
2               Equip2            E2
3               Equip3            E3

Table RuleEquipment:

EquipmentRuleID   RuleID    EquipmentID
1                 1         1
2                 1         2
3                 2         1
4                 2         3
5                 3         2

A user will query using one and only one EquipmentCode.  I want to return the Rules which either have no associated Equipment or have the matching equipment.
So, if a user queries for E1, the result set should be

RuleID    RuleName
1         Rule1
2         Rule2
4         Rule4

I cannot put my finger on the WHERE clause for this.  Any suggestions?

A: SELECT * FROM Rule
WHERE Rule.ID NOT IN (SELECT RuleID FROM RuleEquipment)
OR Rule.ID IN
(
   SELECT RuleID
   FROM RuleEquipment
      INNER JOIN Equipment ON RuleEquipment.EquipmentID = Equipment.EquipmentID
   WHERE Equipment.EquipmentCode = @inputEquipmentCode
)

A: select *
from [Rule] as R
where R.RuleID in (select RE.RuleID
                   from RuleEquipment as RE
                     inner join Equipment as E
                       on RE.EquipmentID = E.EquipmentID
                   where E.EquipmentCode = 'E1') or
      R.RuleID not in (select RE.RuleID
                       from RuleEquipment as RE)

A: SELECT Rule.*
FROM Rule
LEFT OUTER JOIN RuleEquipment ON RuleEquipment.RuleID = Rule.RuleID
Where Rule.RuleID = 1 or RuleID IS NULL


text:
Q: Onsen Carousel and Onsen Sliding Menu Collision I have a sliding menu on my index.html

<ons-sliding-menu
    menu-page="menu.html" main-page="welcome.html" side="left"
    var="menu" type="reveal" max-slide-distance="260px" swipable="false" swipe-target-width="50">
  </ons-sliding-menu>

But when I want to use a carousel after I the user goes to a new page with a menu.setMainPage

<ons-list-item class="menu-item" ng-click="menu.setMainPage('connect.html', {closeMenu: true});">
    <ons-icon icon="ion-ios-people" fixed-width="true"></ons-icon>
    Connect
  </ons-list-item>

My carousel items seem to layered under the sliding menu. An example would be if I swipe the carousel item at a target-width="70" to try and move the carousel. It will not budge. It only moves with the index setting while the menu is sliding. Is there any way to make the carousel and sliding menu from the index function together? Or does the sliding menu have to be written on every page?

A: Change  swipable="false" to swipeable="false"

A: If your slider displays in it's own page, you can also try adding:
<ons-page sliding-menu-ignore="true">

This will override the sliding-menu's touch events.


text:
Q: How to fix this Crash :java.lang.AbstractMethodError I got crash when I work with googlemap I tried to search but I didnt got the correct answer !!
 I tried many suggested answers but it doesn't work with me !
It alwayes makes problem with GoogleApiClient.
public class SelectEndPoint extends AppCompatActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, com.google.android.gms.location.LocationListener {
private GoogleMap mMap;
private GoogleApiClient mGoogleApiClient;
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 9000;
private static String TAG = "MAP LOCATION";
Context mContext;
TextView mLocationMarkerText;
private LatLng mCenterLatLong;
Spinner LocationSpinner;

/**
 * Receiver registered with this activity to get the response from FetchAddressIntentService.
 */
private AddressResultReceiver mResultReceiver;
/**
 * The formatted location address.
 */
protected String mAddressOutput;
protected String mAreaOutput;
protected String mCityOutput;
protected String mStateOutput;
EditText mLocationAddress;
TextView mLocationText;
private static final int REQUEST_CODE_AUTOCOMPLETE = 1;
Toolbar mToolbar;
double pinLatitude,pinLongitude;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.select_end_point);
    mContext = this;
    // Obtain the SupportMapFragment and get notified when the map is ready to be used.
    SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
            .findFragmentById(R.id.map);

    mLocationMarkerText = (TextView) findViewById(R.id.locationMarkertext);

    mapFragment.getMapAsync(this);
    mResultReceiver = new AddressResultReceiver(new Handler());

    if (checkPlayServices()) {
        // If this check succeeds, proceed with normal processing.
        // Otherwise, prompt user to get valid Play Services APK.
        if (!AppUtils.isLocationEnabled(mContext)) {
            // notify user
            AlertDialog.Builder dialog = new AlertDialog.Builder(mContext);
            dialog.setMessage("Location not enabled!");
            dialog.setPositiveButton("Open location settings", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface paramDialogInterface, int paramInt) {
                    Intent myIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                    startActivity(myIntent);
                }
            });
            dialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface paramDialogInterface, int paramInt) {
                    // TODO Auto-generated method stub

                }
            });
            dialog.show();
        }
        buildGoogleApiClient();
    } else {
        Toast.makeText(mContext, "Location not supported in this device", Toast.LENGTH_SHORT).show();
    }

}

/**
 * Manipulates the map once available.
 * This callback is triggered when the map is ready to be used.
 * This is where we can add markers or lines, add listeners or move the camera. In this case,
 * we just add a marker near Sydney, Australia.
 * If Google Play services is not installed on the device, the user will be prompted to install
 * it inside the SupportMapFragment. This method will only be triggered once the user has
 * installed Google Play services and returned to the app.
 */
@Override
public void onMapReady(GoogleMap googleMap) {
    Log.d(TAG, "OnMapReady");
    mMap = googleMap;

    mMap.setOnCameraChangeListener(new GoogleMap.OnCameraChangeListener() {
        @Override
        public void onCameraChange(CameraPosition cameraPosition) {
            Log.d("Camera postion change" + "", cameraPosition + "");
            mCenterLatLong = cameraPosition.target;

            mMap.clear();

            try {

                Location mLocation = new Location("");
                 mLocation.setLatitude(mCenterLatLong.latitude);
                mLocation.setLongitude(mCenterLatLong.longitude);
                pinLatitude=mCenterLatLong.latitude;
                pinLongitude=mCenterLatLong.longitude;
                startIntentService(mLocation);
                mLocationMarkerText.setText("Lat : " + mCenterLatLong.latitude + "," + "Long : " + mCenterLatLong.longitude);

            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        // TODO: Consider calling
        //    ActivityCompat#requestPermissions
        // here to request the missing permissions, and then overriding
        //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
        //                                          int[] grantResults)
        // to handle the case where the user grants the permission. See the documentation
        // for ActivityCompat#requestPermissions for more details.
        return;
    }
    mMap.setMyLocationEnabled(true);
    mMap.getUiSettings().setMyLocationButtonEnabled(true);

     // Add a marker in Sydney and move the camera
     //  LatLng sydney = new LatLng(-34, 151);
     // mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
     //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));

}

@Override
public void onConnected(Bundle bundle) {
    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        // TODO: Consider calling
        //    ActivityCompat#requestPermissions
        // here to request the missing permissions, and then overriding
        //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
        //                                          int[] grantResults)
        // to handle the case where the user grants the permission. See the documentation
        // for ActivityCompat#requestPermissions for more details.
        return;
    }
    Location mLastLocation = LocationServices.FusedLocationApi.getLastLocation(
            mGoogleApiClient);
    if (mLastLocation != null) {
        changeMap(mLastLocation);
        Log.d(TAG, "ON connected");

    } else
        try {
            LocationServices.FusedLocationApi.removeLocationUpdates(
                    mGoogleApiClient, this);

        } catch (Exception e) {
            e.printStackTrace();
        }
    try {
        LocationRequest mLocationRequest = new LocationRequest();
        mLocationRequest.setInterval(10000);
        mLocationRequest.setFastestInterval(5000);
        mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
        LocationServices.FusedLocationApi.requestLocationUpdates(
                mGoogleApiClient, mLocationRequest, this);

    } catch (Exception e) {
        e.printStackTrace();
    }

}

@Override
public void onConnectionSuspended(int i) {
    Log.i(TAG, "Connection suspended");
    mGoogleApiClient.connect();
}

@Override
public void onLocationChanged(Location location) {
    try {
        if (location != null)
            changeMap(location);
        LocationServices.FusedLocationApi.removeLocationUpdates(
                mGoogleApiClient, this);

    } catch (Exception e) {
        e.printStackTrace();
    }
}

@Override
public void onConnectionFailed(ConnectionResult connectionResult) {

}

protected synchronized void buildGoogleApiClient() {
    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(LocationServices.API)
            .build();

}

@Override
protected void onStart() {
    super.onStart();
    try {
        mGoogleApiClient.connect();

    } catch (Exception e) {
        e.printStackTrace();
    }
}

@Override
protected void onStop() {
    super.onStop();
    try {

    } catch (RuntimeException e) {
        e.printStackTrace();
    }
    if (mGoogleApiClient != null && mGoogleApiClient.isConnected()) {
        mGoogleApiClient.disconnect();
    }
}

private boolean checkPlayServices() {
    int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
    if (resultCode != ConnectionResult.SUCCESS) {
        if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
            GooglePlayServicesUtil.getErrorDialog(resultCode, this,
                    PLAY_SERVICES_RESOLUTION_REQUEST).show();
        } else {
            //finish();
        }
        return false;
    }
    return true;
}

private void

changeMap(Location location) {

    Log.d(TAG, "Reaching map" + mMap);

    if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
        // TODO: Consider calling
        //    ActivityCompat#requestPermissions
        // here to request the missing permissions, and then overriding
        //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
        //                                          int[] grantResults)
        // to handle the case where the user grants the permission. See the documentation
        // for ActivityCompat#requestPermissions for more details.
        return;
    }

    // check if map is created successfully or not
    if (mMap != null) {
        mMap.getUiSettings().setZoomControlsEnabled(false);
        LatLng latLong;

        latLong = new LatLng(location.getLatitude(), location.getLongitude());

        CameraPosition cameraPosition = new CameraPosition.Builder()
                .target(latLong).zoom(19f).tilt(70).build();

        mMap.setMyLocationEnabled(true);
        mMap.getUiSettings().setMyLocationButtonEnabled(true);
        mMap.animateCamera(CameraUpdateFactory
                .newCameraPosition(cameraPosition));

        //mLocationMarkerText.setText("Lat : " + location.getLatitude() + "," + "Long : " + location.getLongitude());
        startIntentService(location);
        new AsyncGeocoder().execute(new AsyncGeocoderObject(
                new Geocoder(this),
                location,
                mLocationMarkerText
        ));

    } else {
        Toast.makeText(getApplicationContext(),
                "Sorry! unable to create maps", Toast.LENGTH_SHORT)
                .show();
    }

}

/**
 * Receiver for data sent from FetchAddressIntentService.
 */
class AddressResultReceiver extends ResultReceiver {
    public AddressResultReceiver(Handler handler) {
        super(handler);
    }

    /**
     * Receives data sent from FetchAddressIntentService and updates the UI in MainActivity.
     */
    @Override
    protected void onReceiveResult(int resultCode, Bundle resultData) {

        // Display the address string or an error message sent from the intent service.
        mAddressOutput = resultData.getString(AppUtils.LocationConstants.RESULT_DATA_KEY);

        mAreaOutput = resultData.getString(AppUtils.LocationConstants.LOCATION_DATA_AREA);

        mCityOutput = resultData.getString(AppUtils.LocationConstants.LOCATION_DATA_CITY);
        mStateOutput = resultData.getString(AppUtils.LocationConstants.LOCATION_DATA_STREET);

        displayAddressOutput();

        // Show a toast message if an address was found.
        if (resultCode == AppUtils.LocationConstants.SUCCESS_RESULT) {
            //  showToast(getString(R.string.address_found));

        }

    }

}

/**
 * Creates an intent, adds location data to it as an extra, and starts the intent service for
 * fetching an address.
 */
protected void startIntentService(Location mLocation) {
    // Create an intent for passing to the intent service responsible for fetching the address.
    Intent intent = new Intent(this, FetchAddressIntentService.class);

    // Pass the result receiver as an extra to the service.
    intent.putExtra(AppUtils.LocationConstants.RECEIVER, mResultReceiver);

    // Pass the location data as an extra to the service.
    intent.putExtra(AppUtils.LocationConstants.LOCATION_DATA_EXTRA, mLocation);

    // Start the service. If the service isn't already running, it is instantiated and started
    // (creating a process for it if needed); if it is running then it remains running. The
    // service kills itself automatically once all intents are processed.
    startService(intent);
}

the logcat is :
       java.lang.AbstractMethodError: abstract method "com.google.android.gms.common.api.Api$zze com.google.android.gms.common.api.Api$zza.zza(android.content.Context, android.os.Looper, com.google.android.gms.common.internal.zzf, java.lang.Object, com.google.android.gms.common.api.GoogleApiClient$ConnectionCallbacks, com.google.android.gms.common.api.GoogleApiClient$OnConnectionFailedListener)"
                                                                 at com.google.android.gms.common.api.GoogleApiClient$Builder.zza(Unknown Source)
                                                                 at com.google.android.gms.common.api.GoogleApiClient$Builder.zzarg(Unknown Source)
                                                                 at com.google.android.gms.common.api.GoogleApiClient$Builder.build(Unknown Source)
                                                                 at com.wneet.white.services.SelectPosition.buildGoogleApiClient(SelectPosition.java:471)
                                                                 at com.wneet.white.services.SelectPosition.onCreate(SelectPosition.java:156)
                                                                 at android.app.Activity.performCreate(Activity.java:6876)
                                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
                                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
                                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
                                                                 at android.app.ActivityThread.access$1100(ActivityThread.java:222)
                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                 at android.os.Looper.loop(Looper.java:158)
                                                                 at android.app.ActivityThread.main(ActivityThread.java:7229)
                                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

thanx in advance..


text:
Q: Gatsby : Error running "gatsby --help" after installing node, Homebrew, and npm After successfully installing Node (v13.5.0), npm (v6.13.4), Homebrew (v2.2.1), and Gatsby-cli globally, I run into this error:
$ gatsby --help
/usr/local/lib/node_modules/gatsby-cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: Cannot find module '@babel/code-frame'
Require stack:
- /usr/local/lib/node_modules/gatsby-cli/lib/reporter/prepare-stack-trace.js
- /usr/local/lib/node_modules/gatsby-cli/lib/reporter/errors.js
- /usr/local/lib/node_modules/gatsby-cli/lib/reporter/index.js
- /usr/local/lib/node_modules/gatsby-cli/lib/create-cli.js
- /usr/local/lib/node_modules/gatsby-cli/lib/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:17)
    at Function.Module._load (internal/modules/cjs/loader.js:859:27)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/lib/reporter/prepare-stack-trace.js:13:19)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
    at Module.load (internal/modules/cjs/loader.js:988:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1028:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/gatsby-cli/lib/reporter/prepare-stack-trace.js',
    '/usr/local/lib/node_modules/gatsby-cli/lib/reporter/errors.js',
    '/usr/local/lib/node_modules/gatsby-cli/lib/reporter/index.js',
    '/usr/local/lib/node_modules/gatsby-cli/lib/create-cli.js',
    '/usr/local/lib/node_modules/gatsby-cli/lib/index.js'
  ]
}

Anything I am missing?
Thanks

A: Not sure why you're having the problem but you can install the missing module to your project with:
npm install --save-dev babel-code-frame


text:
Q: Disable log4j logging to console I have the following log4j.properties file:
# Direct log messages to a log file
log4j.appender.fileerror=org.apache.log4j.RollingFileAppender
log4j.appender.fileerror.File=C\:\\logs_eba\\loging-error.log
log4j.appender.fileerror.MaxFileSize=20MB
log4j.appender.fileerror.MaxBackupIndex=1
log4j.appender.fileerror.layout=org.apache.log4j.PatternLayout
log4j.appender.fileerror.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.appender.fileerror.threshold = WARN

# Direct log messages to stdout
#log4j.appender.stdout=org.apache.log4j.ConsoleAppender
#log4j.appender.stdout.Target=System.out
#log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
#log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

# Root logger option
log4j.rootLogger = WARN, fileerror

But my application keeps directing logs to my Console, it even shows logs at info level even though I defined WARN threshold.
For reference, this is how I get my Logging objects:
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

    private static final Logger log = LoggerFactory.getLogger(MyClass.class.getSimpleName());
log.warn("My log message");

Can it be related to my use of slf4j?
PS. I am using Spring + Hibernate as my architecture, and their logs are also being redirected to console.

A: Log4J by default looks up for log4j.properties file in the classpath and will consider the one found first. So if your application is depending on a library which itself is dependent on log4j and also provides log4j.properties of its own, then there is a chance that it is getting selected.
So I would recommend you to specify custom location for your properties using
java -Dlog4j.configuration=customName

Or use -Dlog4j.debug to find helpful info about the log4j configuration.

A: As mentioned in the answer by Narendra, this might be because one of your dependent libraries has a log4j.properties of its own, which is being picked up by the application (Your log4j.properties is being ignored). Ideally, this should not happen as most open source libraries do not include a log4j.properties file. They expect the calling module to provide one.
Find out which module this properties file is coming from. If it is an internal project that you have control over, you should remove the log4j.properties from it. If this is an external jar, try overriding your log4j.properties file over it. How you do this will depend on how you are deploying your jars together e.g. using maven, file copy etc.
PS: IMHO, no standard open source project should include its own log4j.properties file for this exact reason. If you are using such a library, may be its not very mature and you might want to have a look at alternatives.


text:
Q: Default DB Size of Heroku App I am pretty new to web dev and thought I needed a 20gb shared db in order to test out apps that have larger than 5mb stored.
My friend let me know this was not true because I am using single app. He told me shared dbs were used for sharing data between multiple applications.
If so, what is Heroku's default, unshared db size? I had difficulty in finding this information on Heroku's website and google searches.
Could anyone chime in?

A: A shared database in this case means the server itself is shared -- so the server's CPU will be used to serve other databases in addition to your own.
A dedicated database server's CPU's are yours and yours alone.
If you need to exceed the 5MB threshold, you need to add the 20GB add on. More information: http://www.heroku.com/pricing


text:
Q: Powerbuilder WebApp Access on my website I'm running PB11.5.
I just upoaded my webapp to my website.
Cannot seem to run it from website, but I can run it from my PC.
I'm using a MS Access DB.

A: As Colin says, the information you've provided at this point is a little sparse, but that may reflect the problem. You only mention uploading files. In fact, there are several steps involved in getting a PB WebForms app to run, including registering .NET assemblies, adjusting a system path, etc.... The Deploying Applications and Components to .NET manual should be able to get you further than what it sounds like you've achieved.
Good luck,
Terry.


text:
Q: os.platform returns browser instead of actual OS - React & Electron I am trying to retrieve the appdata folder location for the application, and since each os has a separate path for the appdata or application support folder, I tried retrieving the os type to specify which path to use. The issue is os.platform() returns 'browser'. I have tried running it on windows and mac, but they all return browser. If i run process.platform in electron.js it gives me the correct os, but in react I get browser. How can I get the proper OS?

A: In a browser you can use a combination of navigator.platform, navigator.userAgent, and navigator.userAgentData.platform to get the information you want, but it might take some testing and parsing.
AFAIK, navigator.userAgentData.platform is available only on Chrome/Chromium-based browsers, but gives the most straight-forward result when available.
Checking which platform you're using, rather than checking for specific features, is generally consider not to be a good idea -- but I've found it hard to avoid sometimes myself, especially when working around platform-specific quirks and bugs.

A: This is because you are running process.platform in the renderer process.
In order to get the correct value you need to run platform.process either on main process (usually the background.js file) or via @electron/remote, like this:
window.require('@electron/remote').process.platform

@electron/remote's usage depends on your electron version, I recommend you to check @electron/remote readme.

A: Have you tried using Electron's app.getPath(name) method?
This method will return the users application data directory.
Only once the app is "ready" can you retrieve this path.
// Electron module(s).
const electronApp = require('electron').app;

// Application is now ready to start.
electronApp.on('ready', () => {

    // Get the users app data directory.
    let appData = electronApp.getPath('appData');

    // Get the users home directory.
    let home = electronApp.getPath('home');
})


text:
Q: What part of speech is 'almost' in "these tiny flowers transform into pulp-filled pods almost the size of rugby balls"? Now, before I get jumped on because almost is always an adverb, please allow me to explain.
If almost is an adverb, which it most definitely is (I checked several dictionaries and it is only listed as an adverb), then it must be modifying a verb, or an adjective or another adverb, but its relation is with the noun phrase the size, and really, so it seems, between pods and the size. Adverbs don't modify nouns. It appears to be functioning as a preposition, and indeed about or around, which are true prepositions, would produce equivalent meaning.
The only other option I can see is that almost is modifying the main verb transform which it is not - the flowers do not almost transform, they do indeed transform, so that cannot be the relation.
Ah, come to think of it, there does seem to be one more possibility, namely the demon ellipsis.

These tiny flowers transform into pulp-filled pods (that are) almost
  the size of rugby balls.

So, its a clause, where almost is modifying the elided verb. I think that's the answer but I still want to hear what folks have to say. Ellipsis seems to be a very strong factor in the evolution of grammar.
Some will say that adverbs can modify noun phrases, and some dictionaries do mention this use as rare but possible (e.g. Cambridge). However, dictionaries are hardly the arbiters of what is grammatical and others do not attribute this function to the adverb class (e.g. Lexico and Dictionary.com. Some sidestep the issue by saying they can modify "phrases". Ha!
It sees a rather bold step to alter the class definition of adverbs with the function of the adjective class, which breaks the distinction, the very usefulness of classes, and seems wrong to me. It seems more fitting to broaden the scope of words, as they evolve in usage, to include another class function, such as almost, which seems to be commonly used as both a preposition and an adjective.
I'm quite stuck with this one. The use is quite common and undeniably well understood. Perhaps this is the language changing again, and it's time to reconsider the scope of this word to include a prepositional function. But maybe someone more knowledgeable than I has a better explanation.

A: Original:  These tiny flowers transform into pulp-filled pods almost the size of rugby balls.
=> These tiny flowers transform into pulp-filled pods (that are) almost the size of rugby balls.
that are the size, that are exactly the size, that are almost the size
"Almost" is an adverb that answers the question "to what degree" are they the same size.

A: I think it might be helpful to look at a top-down analysis of the structure:
[sentence] --> [subject] [predicate]
[subject] --> [noun-phrase] ("...flowers")
[predicate] --> [verb-phrase] ("transform...")

[verb-phrase] --> [verb] [adverb]
[verb] = "transform"
[adverb] --> [prep-phrase] ("into...")

[prep-phrase] --> [preposition] [noun-phrase]
[preposition] = "into"
[noun-phrase] = "pods..."

[noun-phrase] --> [noun] [dependent-adj-phrase]
[noun] = "pods"
[dependent-adj-phrase] = "Ø Ø almost the size of rugby balls"

We just reached the grammatically tricky part:  the "zero" relative (i.e., an implicit "that/which are").
[dependent-adj-phrase] --> [relative-pronoun] [verb-phrase]
[relative-pronoun] = "Ø"
[verb-phrase] = "Ø almost the size of rugby balls"

[verb-phrase] --> [verb] [predicate-nominative]
[verb] = "Ø"
[predicate-nominative] = "...size..."

[predicate-nominative] --> [adverb] [determiner] [noun] [adj-phrase]
[adverb] = "almost"
[determiner] = "the"
[noun] = "size"
[adj-phrase] = "of rugby balls"

I think that is far enough to show how almost fits in and why and how it is an adverb.


text:
Q: What does back to back table references mean in SQL from clause I am looking at a query from crystal reports and it shows a table name immediately followed by a table name. see below if that didn't make sense but I am trying to understand what this syntax is/does? thank you in advance for any insight
select * from {oj ((table_name table_name inner join ......))}

A: The 2nd name is the alias. It allows you to refer to the table using a different name.
For example, you may want to shorten the references to that table throughout the rest of the statement in order to make things more readable. Or, more importantly, you may want to use the same table twice in the same statement (in which case an alias is required).


text:
Q: How to modify the shortcut so that a certain program runs with high priority? This says I got to do something like
https://www.tenforums.com/tutorials/89548-set-cpu-process-priority-applications-windows-10-a.html
C:\Windows\System32\cmd.exe /c start "" /AboveNormal "C:\Windows\System32\mspaint.exe"

How does the command really work? I know /c means run this. Then empty quote? Empty parameter?
There isn't really easier way to do this? Like option boxes or something?
According to this
https://ss64.com/nt/start.html
It effectively run program with title window "". But then it puts the path of the program in the command section of "start" parameter. I am getting confused. Is this correct?

A: I am getting confused. Is this correct?
Yes. The title parameter is required (but may be empty) if the remainder of the command line contains something in double "s.
In your case, if you don't include"" the cmd shell will use "C:\Windows\System32\mspaint.exe" as the window title and there will be no command to run.
You can, however, fill in the empty title with your own text. For example:
C:\Windows\System32\cmd.exe /c start "My super duper title" /AboveNormal "C:\Windows\System32\mspaint.exe"

This is (partially) explained in the link you quoted:

Always include a TITLE this can be a simple string like "My Script" or just a pair of empty quotes ""
According to the Microsoft documentation, the title is optional, but depending on the other options chosen you can have problems if it is omitted.

Source: Start - Start a program - Windows CMD - SS64.com


text:
Q: How to create a random variable whose parameters are themselves random variables in SymPy? I have a random variable Y whose distribution is Poisson with parameter that is itself a random variable X, which is Poisson with parameter 10.
How can I use SymPy to automatically calculate the covariance between X and Y?
The code
from sympy.stats import *
x1 = Poisson("x1", 3)
x2 = Poisson("x2", x1)
print(covariance(x2,x1))

raises an error
ValueError: Lambda must be positive

The documentation is not clear to me on this matter, and playing around with the function given did not seem to work.

A: This kind of manipulation is not implemented in SymPy. But you can pass a symbol (z1 below) for the parameter of a distribution. Then after the first step of computation, replace z1 by x1 and take expected value.
from sympy import Symbol
from sympy.stats import Poisson, E
z1 = Symbol("z1")
x1 = Poisson("x1", 3)
x2 = Poisson("x2", z1)
Ex2 = E(E(x2).subs(z1, x1))
Vx2 = E(E((x2-Ex2)**2).subs(z1, x1))
cov = E(E((z1-E(x1))*(x2-Ex2)).subs(z1, x1))
print("E(x2) = {}, var(x2) = {}, cov(x1, x2) = {}".format(Ex2, Vx2, cov))

Output:
E(x2) = 3, var(x2) = 6, cov(x1, x2) = 3

Notice the appearance of Ex2 instead of E(x2) in the formulas for variance and covariance. Using E(x2) here would give  incorrect results because E(x2) is an expression involving z1. For the same reason I'm not using variance or covariance functions (as they'd involve the variable E(x2) instead of the correct value 3), expressing everything explicitly as an expected value.


text:
Q: dxFileUploader to component, not URL I started using DevExtreme modules in my Angular app.
I have an dxFileUploader in my component template that needs an "uploadUrl" to upload the file.
In fact, I don't wanna to really upload this file to my backend, but to store it on a local storage key. (yes, I know the limitations of local storage but I will go that way in this case).
Is there any known way to call a Angular function instead of a url on dxFileUploader?
Case not, is there any way I can have an angular component to receive POST requests? So I will put this component as the uploadUrl and then save on local storage.
Thanks in advance.

A: You actually don't want to post anywhere, what you really want is to store the value on the browser storage, so:
On value change
dxFileUploader: { onValueChanged: valueChanged }

Get the file
 $scope.valueChanged = function(e)
{
   //get the value here and store in the localStorage.
}