Install.php available after xcopy deployment

Question: I created a Drupal 7 site with Sqlite on my dev machine. When I go to localhost/install.php it says: Drupal is already installed.
After deploying the whole bunch to shared hosting (windows) the install.php is available again although the site works. It is even available to anonymous users and when the site is in maintenance mode. What should I do to disable that? Or should I deploy another way?
Answer: What the installer checks for, is whether or not the settings file has database information for the site.
While this sounds simple in theory, and shouldn't lead to install.php being executed, there are many components involved.

There's DNS, which may or may not respond to various sub-domains.
There's the webserver configuration, which may or may not serve sub-domains, and may or may not re-write them before they hit Drupal.
Drupal, since 7, supports a sites.php file which can map domains to sites/ directories.
Finally, there's the sites directory itself, where Drupal can find a settings.php file, check for a valid $db_url, and decide whether or not to allow installation.

Due to the many components, and the technical complexity of setting them all up right, it's very easy to end up in a situation where install.php decides to allow installation. This should generally not be a problem, as anonymous users should not be able to create new databases, but it looks quite wrong regardless.
While removing install.php is a solution, it's technically hacking core, and makes future deployments needlessly complicated.
I normally do two things to counteract this.
The first thing is to run the site from a directory named after the domain, such as sites/example.com/ and make sites/default a link to the main site. This way, any unexpected domains being requested by Drupal will be served by the main domain.
Second, I always just block access to install.php completely on any production systems with this vhost file:
# ssh -L 8080:127.0.0.1:80 example.com
<Location /install.php>
  Deny from all
  Allow from 127.0.0.1
</Location>

<Location /update.php>
  Deny from all
  Allow from 127.0.0.1
</Location>

This ensures apache blocks access to both install and update. The comment at the top is a reminder for how I can open an ssh tunnel to the server so my traffic looks like it's coming from 127.0.0.1, thus allowing developers access to run update.php.
Something similar in IIS below. Note that I have not tested this. Someone with ISS experience, please update or comment so I can improve this part.
<location path="install.php">
    <system.webServer>
        <security>
            <authorization>
                <remove users="*" roles="" verbs="" />
                <add accessType="Allow" roles="Administrators" />
            </authorization>
        </security>
    </system.webServer>
</location>

Comment: Windows - IIS hosting...
Comment: Added IIS example.
Comment: I'm sorry but this simply doesn't explain why install.php is even available and how to resolve the real cause. It is not supposed to serve the installation wizard when the site is already installed.
Comment: Significantly expanded the answer with more information.
Answer: One way is just to delete the install.php file altogether. Another option is to set permissions on the file so that it is unusable by the user that providing content through apache (presumably)
Comment: Windows - IIS hosting...


Fields and proper subfields.

Question: Specific question: Let $F$ be a field and assume that $\mathbb{Q}$ is a proper subfield of $F$. Can $F$ be isomorphic to $\mathbb{Q}$?

Studying the foundaments of field theory I have to ask: Can a field be isomorphic to one of its proper subfields?
Comment: See [here](http://math.stackexchange.com/questions/137906/algebraic-closure-of-mathbbcx-is-isomorphic-to-mathbbc) for an example - namely, that the algebraic closure of $\Bbb C(x)$ is isomorphic to $\Bbb C$.
Answer: Yes, given any field $k$, $k(x)$ is isomorphic to $k(x^2)$.

Fields and proper subfields.


How to forward a TCP/UDP broadcast to another VLAN on a Cisco switch?

Question: I have client software which sends out a broadcast on some TCP and UDP port numbers. The broadcast it sends out is designed to look for the server. But the server is sitting on another VLAN so the broadcast ends. I've heard of ip-helper but have no idea what command to use to forward the broadcast to travel to the correct VLAN and find the server. Any help appreciated.
Answer: you can use the ip helper-address command on a vlan interface to forward all broadcasts in this vlan directly to a host (mostly used for dhcp) or to another broadcast address.
example: broadcasts in vlan 10 are send directly to host 10.1.2.1 in vlan 20:
interface vlan10
  ip address 10.1.1.254 255.255.255.0
  ip helper-address 10.1.2.1
!
interface vlan20
  ip address 10.1.2.254 255.255.255.0
!

example: broadcasts in vlan 10 are send to broadcast address of vlan 20
interface vlan10
  ip address 10.1.1.254 255.255.255.0
  ip helper-address 10.1.2.255
!
interface vlan20
  ip address 10.1.2.254 255.255.255.0
!

Comment: Only the default protocols are forwarded, if you need others then you can use the 'ip forward-protocol' command to specify what should be forwarded.
Answer: you'll want to look into the cisco command "ip directed-broadcast" to achieve want you want to do. note, this isn't a recommended configuration for security reasons.


Backwards compatible openssh configuration?

Question: My ~/.ssh/config contains this:
HostKeyAlgorithms +ssh-dss

I copy this configuration across many systems. Recently I copied it to a system running OpenSSH v5.3 and that entry is now an error:
/home/sparr/.ssh/config line 3: Bad protocol 2 host key algorithms '+ssh-dss'.

Is there a way to make this configuration backwards compatible, so that the new option is used for newer clients and ignored for older clients?
Answer: The old OpenSSH does not support the + sign. But you can write it the way you list all of the algoriths (that are common for these versions):
HostKeyAlgorithms email@example.com,email@example.com,firstname.lastname@example.com,firstname.lastname@example.com,email@example.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa,ssh-dss
Or just really update your server and do not use DSA host keys, since they are insecure.


What are these slashed noteheads?

Question: This is taken from a piece of sheet music (which I originally thought was for piano) for "Save Tonight" by Eagle-Eye Cherry.
I do not recognize these notes in the beginning - can somebody tell me what they mean?
Comment: Why so mysterious - what's the piece? More information might help people to answer.
Comment: @endorph, You're missing the point. Your answer couldn't explain the up/down bow symbols, so I'm trying to get a larger excerpt. There are many questions on this site about specific pieces. If the question is asked in a general way, as this one is, there's no problem.
Comment: @replete I'd be careful about making the question specific to a piece. They tend to get closed.
Comment: @replete That's fair, I guess. We're just a little trigger happy on closing questions that are specific to a piece, so I don't want to fly too close to the sun, so to speak.
Comment: @replete - there's enough information contained in the question. The red herring is it's from a piano piece. It's unusual to have a section showing rhythm guitar parts, and strange that bass is included - but without any pitch involved. That'd be my question. And if it's muted, quite possibly, it ought to have x heads instead., as I suspect the question is more about head shape than other signs (V, etc.)
Comment: @Tim, yes, the question is only about noteheads so all these other points are by the by.
Comment: I might have guessed those refer to the "drums" mentioned in the text.  In any case, it sure isn't piano music.    Looks like @endorph has sussed it out.
Answer: This notation (slashed noteheads) is used to show rhythm, without showing specific notes. The player must choose which notes to play, based on the chord symbols.
It's sort of a half-way point between a chord chart, and full notation. I often see it used in a chord chart or lead sheet to notate an important rhythm. They don't use full notation because it's not particularly useful in this context.
The articulations are intended to indicate whether the guitar player should use an upstroke [the V-like symbol] or a downstroke [the other one, like a square n]. This is because the text underneath indicates that this is a guitar riff (with bass and drums on the second time through). This articulation doesn't really apply to keyboard. You may choose to accent the notes differently, or possibly not play the riff at all (especially if you have a guitarist). You'll have to decide what sounds best.
Comment: To add to this answer: if this was music for singers, it would indicate you speak rather than sing the words.
Comment: @AliceHeaton Isn't speech usually indicated with a cross for the notehead, rather than a diagonal line?

What are these slashed noteheads?


Delphi 2007 - Error handling, not hitting the 'except' section

Question: I wrote a primitively simple code where I tried to debug the situation that arose in my project. I'm trying to get into an exception when creating a new window, but I don't get there, why is this? Tell me what's wrong? or what to read for understanding.
So I get to the 'except' section!
procedure TForm1.Button1Click(Sender: TObject);
var
  Local: TForm2;
begin
  try
    //Local := TForm2.Create(nil);
    //Local.Show;

    raise Exception.Create('not implement');
  except
    on E: Exception do
    begin

    end;
  end;
end;

I need to handle this situation. I don't get into the 'except' section like that
Module Form1.pas
procedure TForm1.Button1Click(Sender: TObject);
var
  Local: TForm2;
begin
  try
    Local := TForm2.Create(nil);
    Local.Show;
  except
    on E: Exception do
    begin

    end;
  end;
end;

Module Form2.pas
procedure TForm2.FormCreate(Sender: TObject);
begin
  raise Exception.Create('not implement');
end;

Comment: First create the object, then enter the try..except section.
Comment: The project was provided to me for support, unfortunately when there is a lot of that. Otherwise, the problem cannot be solved? It is necessary in all places where such code is found to rewrite the creation of the object after the try ... except section ?
Comment: Do you currently get a messagebox with the exception message?
Comment: Make sure you have the debuuger option `Stop on language exceptions` unchecked, otherwise the debugger will intercept the exception before the app has a chance to handle it.
Comment: Blurry Sterk Yes. And I want to catch it and not lift it. And even after the exception, the Form2 window opens, which should not be.
Comment: And its not the usual "Stop on language exceptions"?
Comment: MartynA, I checked this out and tried all sorts of different options to turn exceptions on and off. (there is enough information on this topic on the Internet, but did not get the desired result)
Comment: Blurry Sterk, I tried "Stop on language exceptions", did not help" !
Comment: You shouldn't be catching exceptions at all. This is one of the great mistakes people make. Don't handle the exceptions. Let the top level exception handler deal with them.
Comment: David Heffernan, I believe that you are right, but I already have such a code, and I already need to do something with it, at least not open the window that appears after the exception. (now Form2 window opens)
P.S. The project was transferred to me for support. It already contains similar lines of code.
Comment: I am curious... What are the exceptions caused in the `OnCreate` that you need to catch? Shouldn't you be preventing "errors" and catch the others inside `OnCreate` itself?
Comment: Blurry Sterk, At the moment, I have met only classic Exception.Create("..."). I have not seen any unique (written by the previous developer) exceptions in the code.
Comment: If you inherited a project then I assume that you are going to do some extra work to get this working so you can do it right from the start in anyway
Comment: Blurry Sterk, yes, I'm trying to figure out if this situation can be corrected or if everything needs to be rewritten. If you write to me that "it cannot be fixed", then I will accept the information as is and will rewrite the code.

Сomplaints from customers are usually like this: An error occurred and then a window was opened (which should not have opened).
Comment: Nobody here knows what your code actually looks like so you will have to make that decision. You will have to do your best to try and glue all advice from here together to form some sort of coherent solution. I gave you an answer based on your specific question but that might not be the best solution for your complete project. You will have to decide
Comment: Blurry Sterk, I will rewrite, thank.
Comment: "at least not open the window that appears after the exception. (now Form2 window opens)" That only happens because your code handles exceptions!!
Comment: David Heffernan, if my code had handled the exception, then the `Local.Show()` code would not have been executed.
Answer: You will see that DoCreate that is called from TCustomForm.Create has OnCreate inside a try and its exception passes the exception to TApplication.HandleException which will pass it to TApplication.OnException if one is assigned.
If think if you override your form's HandleCreateException you can return a result of False which will allow the exception to passthrough
Comment: Blurry Sterk, сan you give an example please?


How to replace two parts of an input with values from two other inputs, in jQuery?

Question: I have a followup to the question I had answered (very satisfactorily) here:
How to replace part of one text field with a value from another text field in jQuery?
This answered how to update a subid in a link within an input.
I'm trying to extend this by having "mydomain.com" update from a second input:
http://jsbin.com/ojosag/3/edit
As soon as I try and change {mydomain.com}, I lose the {subid} part. Can anybody put me out of my misery?
Comment: Can you put your question into the question? It's just a bunch of links at present.
Answer: Expanding on what Zero Distraction suggested for your original question, the following should do the trick:
$(document).ready(function(){

    var valueTemplate = "http://{subdomain}.{domain}.com";
    var defaultSubDomain = "subdomain";
    var defaultDomain = "mydomain";

    var alphaOne = $("input#alpha");
    var alphaTwo = $("input#alphatwo");

    alphaOne.add(alphaTwo).keyup(function(){

        var value = (alphaOne.val()) ? alphaOne.val() : defaultSubDomain;
        var valueTwo = (alphaTwo.val()) ? alphaTwo.val() : defaultDomain;

        $("input#bravo").val(valueTemplate.replace("{subdomain}", value).replace("{domain}", valueTwo));

    });

});

When you start typing in either the first or second input, the value of the third will be updated. If either of the fields is empty, it will use the value of the defaultSubDomain and defaultDomain variables.
Answer: Here is one solution. Probably could be made even more efficient.
$(document).ready(function(){
    var domainstr="http://subdomain.mydomain.com";
    $("input#alpha,input#alphatwo").keyup(function(){
        var alphaVal = $("input#alpha").val();

        var retVal = domainstr;
        if(alphaVal !== '')
          retVal = domainstr.replace("subdomain",alphaVal);

        var alphaTwoVal = $("input#alphatwo").val();
        if(alphaTwoVal !== '')
          retVal = retVal.replace("mydomain",alphaTwoVal);

        $("input#bravo").val(retVal);
     });
});


Drupal local configuration clone. Only home page is accessible

Question: I have cloned an existing drupal installation, the problem is, I can see only the home page, other url's are not working.My apache rewrite module is configured. I can not log in as any kind of user.
Comment: can you login as admin?
Comment: no,anything than home I cant acess
Comment: what is the error? how did you install it? using drush? the install wizard?
Comment: What does your apache log say? Is example.com/?q=user working? Where did you clone it? Local? What Drupal Version? Give us more information, so we can help you.
Comment: Apache error log say "File does not exist",installed it using wizard,in the access log returning 304
Comment: What is in your .htaccess file ? Are there any differences in what are owner, group and permission settings for both your sites and .htaccess files inside ?
Answer: I did face with a similar problem when moving my site from local machine to dev server. but here is what i did

Install Backup and Migrate to download the existing database and Backup and Migrate Files to your local drupal installation.
Go to http://local-site/admin/config/system/backup_migrate and then backup the default database and local files to download

Install fresh copy of drupal with new database at the server(or to the location where you are cloning.
Copy from http://local-site/sites/all/modules and http://local-site/sites/all/themes to their respective directories at the server(or your cloning destination)
Enable both the modules in step 1, from http://local-site/admin/modules
Go to http://cloned-site/admin/config/system/backup_migrate/restore and restore the database and local files by browsing for the exported data at step 2

and don't forget to enable the theme which you used on the local-site before using backup and migrate.
Answer: Maybe you missed to update the <code>$base_url</code> from sites/default/settings.php to your new sites url. For multi-site installation please enter the appropriate url(e.g. http://clone-location/site1)


NFL game in which a team scores a late TD to pull within one point and then attempts a two-point conversion?

Question: Has there ever been a regular season or playoff game in the NFL in which a team trailed by 7 points in the final 2 minutes, scored a touchdown to pull within one point, and instead of kicking the extra point, they attempted a two-point conversion?
Comment: If anyone has more time than me and wants to put together a definitive list, here are all games post-merger where a team scored at least 6 points in the 4th quarter, went for a 2pt conversion at some point during the game, and had a final point differential of 1.
Comment: Not all of these will fit the criteria, but everything that fits the criteria would be in this list.  https://www.pro-football-reference.com/play-index/tgl_finder.cgi?request=1&match=game&year_min=1970&year_max=2019&game_type=E&game_num_min=0&game_num_max=99&week_num_min=0&week_num_max=99&temperature_gtlt=lt&c1stat=points_diff&c1comp=eq&c1val=1&c2stat=two_pt_att&c2comp=gte&c2val=1&c3stat=quarter_4_score_tgl&c3comp=gte&c3val=6&c5val=1.0ℴ_by=quarter_4_score_tgl
Comment: @kuhl your query does not include these games that fit my criteria: [game1](https://www.espn.com/nfl/game/_/gameId/401128120), [game2](https://www.espn.com/nfl/game?gameId=401128121), [game3](https://www.espn.com/nfl/game/_/gameId/320101034)
Comment: Weird...  I can't seem to get those games to show up no matter how I change that query.  Well, nevermind then.
Answer: I came across some more non-playoff games while trying to find out if it has ever happened in a playoff game (I am 99.9% certain it has not, but I have no citation):

The first time it happened was in Week 15 of 2002, when the Vikings were successful on a 2-point conversion (despite Daunte Culpepper fumbling the snap) with 5 seconds left against the Saints and won 32-31.
The Texans were unsuccessful on a 2-point conversion with 14 seconds left against the Titans in Week 17 of 2011 and lost 23-22.
The Raiders were successful on a 2-point conversion with 47 seconds left against the Saints in Week 1 of 2016 and won 35-34.
The Vikings were successful on a 2-point conversion with no time left against the 49ers in the preseason of 2017 and won 32-31.
The Chargers were successful on a 2-point conversion with 4 seconds left against the Chiefs in Week 15 of 2018 and won 29-28.
The Broncos were successful on a 2-point conversion with 31 seconds left against the Bears in Week 2 of 2019 to take a 14-13 lead, but lost 16-14 after the Bears made a field goal as time expired.
The Dolphins were unsuccessful on a 2-point conversion with 6 seconds left against the Redskins in Week 6 of 2019 and lost 17-16.
Answer: One game springs to mind:
Tennessee Titans 19 - 20 LA Chargers, Wembley Stadium, 2018-10-21
The Titans were trailing by 7 going into the 2 minute warning. With 31 seconds left, Marcus Mariota found TE Luke Stocker for a 1 yard TD. The Titans head coach Mike Vrabel elected to go for a two-point try to win the game, that subsequently failed.


Atributo required num input text javascript

Question: Pretendo colocar o atributo required neste input criado em javascript
  // Celula 4 -Local
    // Cria um
    var locall = row.insertCell(4);
    // Cria o input
    var local = document.createElement('input');
    // Input do tipo texto
    local.type = 'text';
    local.name = 'local[]';
    local.id = 'local';
    local.placeholder='Local';
    local.title = "Local";
    local.className = "form-control";
    locall.appendChild(local);

Answer: Para isso, depois coloca a instrução:
local.required=true;

Comment: coloquei a seguir do id tal como disse e o input desaparece
Comment: Desculpa, tinha percebido de outra maneira, tenta assim.
Comment: Isso funciona, ja tinha experimentado, esqueci-me foi que o input era button e nao submit , acontece
Comment: Button ou radio button?
Comment:   Guardar
Comment: No problem, já alterei :)


Prove the inverse map of an injective linear function with closed graph from $U$ to $V$ (Banach spaces) is continuous iff the image is closed in $V$.

Question: Let $U$ and $V$ be Banach spaces, let $A⊆U$ be a subspace, and let $f:A⊆U→V$ be an injective linear map with closed graph. Show that the inverse map $f^{-1} : B \to U$ is continuous if and only if $B = f(A)$ is closed in $V$.
For the forward implication, I basically did what was outlined here Closed Graph of a function and the continuous inverse implies the image is closed.
For the other direction, I need to show that if $B$ is closed in $V$, then whenever $b_i \to b \in B$, we have that $f^{-1}(b_i) \to f^{-1}(b)$. I don't really know how to begin.. as continuity requires $b_i \to b \in B$ to begin with, I don't see how to use the fact that $B$ is closed.
Answer: Let me denote the linear map by $T$ :)
Define the following norm on $A$ (graph norm of $T$):
$$
\|x\|_A:= \|x\|_X + \|Tx\|_Y.
$$
Then $(A,\|\cdot\|_A)$ is a Banach space. Moreover, $T: A\to T(A)$ is bijective,
$(A,\|\cdot\|_A)$ and $(T(A),\|\cdot \|_Y)$ are Banach spaces, so $T^{-1}$ is continuous and bounded. Then there is a constant $c>0$ such that
$$
\|y\|_Y \ge \|T^{-1}y\|_A = \|T^{-1}y\|_X + \|y\|_Y
$$
for all $y\in T(A)$. This implies that $T^{-1}$ continuous from $T(A)$ to $(A,\|\cdot\|_X)$.


Display the nearest latitude and longitude in the SQLite based from the user's location

Question: I created an app composed of google map and listview of places. The data of places is in the SQLite together with the latitude and longitude. I decided to add a button wherein if the user clicks it, nearby location will appear based on the location of the user in listview and it will replace the previous listview and the markers will appear in the map. I dont have an idea how to display the nearby location once I click a button. In my project, all the list of places already displays in the listview and once the users selects in the list, map will automatically get the latitude of longitude. Please help me.
public class MainActivity extends AppCompatActivity implements LocationListener {

    GoogleMap map;

    List<LocationModel> GetLocation;
    Context context = this;
    DatabaseHelper dbhelper;
    DatabaseHelper db = new DatabaseHelper(this);
    ListView lv;
    View yourListView,yourProfileView;
    Button buttonnearby;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        dbhelper = new DatabaseHelper(MainActivity.this);

        buttonnearby = (Button) findViewById(R.id.button);
        buttonnearby.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View convertView) {

            }

        });

        try{
            dbhelper.createDataBase();
        }
        catch(IOException e){
            e.printStackTrace();
        }
        try {
            dbhelper.openDataBase();
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        GetLocation = dbhelper.getLocation();
        lv = (ListView) findViewById(R.id.listView);
        lv.setAdapter(new ViewAdapter());

        lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {

                LatLng latlngtofocus = new LatLng(Double.parseDouble(GetLocation.get(i).getlatitude()),  Double.parseDouble(GetLocation.get(i).getlongitude()));

                map.animateCamera(CameraUpdateFactory.newLatLngZoom(latlngtofocus, 17.0f));

                MarkerOptions markerOptions = new MarkerOptions();
                markerOptions.position(latlngtofocus);
                //adding marker to the map
                map.addMarker(markerOptions);

                yourListView = findViewById(R.id.layout);
                ViewGroup parent = (ViewGroup) yourListView.getParent();
                parent.removeView(yourListView);
// inflate your profile view (or get the reference to it if it's already inflated)
                yourProfileView = getLayoutInflater().inflate(R.layout.profile_location, parent, false);
// add it to the parent
                parent.addView(yourProfileView);

            }

        });

        //To get MapFragment reference from xml layout
        MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);

        //To get map object
        map = mapFragment.getMap();
        map.getUiSettings().setZoomControlsEnabled(true);

       /* //to show current location in the map
        map.setMyLocationEnabled(true);

        map.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
            @Override
            public void onMapClick(LatLng latLng) {

                Toast.makeText(getApplicationContext(), latLng.toString(), Toast.LENGTH_LONG).show();
            }
        });*/

        //To setup location manager
        LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

        //To request location updates
        locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1, 1, this);

    }

    @Override
    public void onLocationChanged(Location location) {

        //To clear map data
        map.clear();

        //To hold location
        LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());

        //To create marker in map
        MarkerOptions markerOptions = new MarkerOptions();
        markerOptions.position(latLng);
        markerOptions.title("My Location");
        //adding marker to the map
        map.addMarker(markerOptions);

        //opening position with some zoom level in the map
        map.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 17.0f));
    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {

    }

    @Override
    public void onProviderEnabled(String provider) {

    }

    @Override
    public void onProviderDisabled(String provider) {

    }

    /****************************************************************************************
     *                                      CUSTOM LIST
     ****************************************************************************************/
    public class ViewAdapter extends BaseAdapter {

        LayoutInflater mInflater;

        public ViewAdapter() {
            mInflater = LayoutInflater.from(context);
        }

        @Override
        public int getCount() {
            return GetLocation.size();
        }

        @Override
        public Object getItem(int position) {
            return null;
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(final int position, View convertView, ViewGroup parent) {

            if (convertView == null) {
                convertView = mInflater.inflate(R.layout.item_location,null);
            }

            final TextView place = (TextView) convertView.findViewById(R.id.location);
            final TextView latitude = (TextView) convertView.findViewById(R.id.latitude);
            final TextView longitude = (TextView) convertView.findViewById(R.id.longitude);

            location.setText(GetLocation.get(position).getlocation());
            latitude.setText(GetLocation.get(position).getlatitude());
            longitude.setText(GetLocation.get(position).getlongitude());

            return convertView;
        }
    }

    @Override
    public void onBackPressed() {
        if(yourProfileView != null && yourProfileView.getParent() != null) {
            // remove your profile view
            ViewGroup parent = (ViewGroup) yourProfileView.getParent();
            parent.removeView(yourProfileView);

            // a reference to yourListView has to be saved somewhere; just get it

            // add your listview to the parent
            parent.addView(yourListView);
        } else {
            super.onBackPressed();
        }
    }

}

DatabaseHelper

public List<LocationModel> getLocation() {

        List<LocationModel> lList = new ArrayList<LocationModel>();
        {
            String selectQuery =
                    "SELECT id,location,latitude,longitude FROM places ";
            Log.e("places query: ", selectQuery);
            SQLiteDatabase db = this.getWritableDatabase();
            Cursor cursor = db.rawQuery(selectQuery, null);

            // looping through all rows and adding to list
            if (cursor.moveToFirst()) {
                do {
                    LocationModel lm = new LocationModel();
                    lm.setid(Integer.parseInt(cursor.getString(0)));
                    lm.setlocation(cursor.getString(1));
                    lm.setlatitude(cursor.getString(2));
                    lm.setlongitude(cursor.getString(3));

                    lList.add(lm);
                } while (cursor.moveToNext());
            }
            db.close();
        }
        return lList;
    }
}

Answer: If you want to get the distance between two lat lng pairs the easiest way is to  use the .distanceBetween() function in Location:
float [] distResult = new float[1];
Location.distanceBetween(latA, lonA, latB, lonB, distResult);
float dist = distResult[0];

Comment: how to use that code in my code?sorry newbie in android especially in google map
Comment: nice :D this is really simple.
Comment: Maybe I misunderstood.  What exactly do you need help with?  This code will help you find the distance between points, the smallest of which will indicate the closest point to the user's location.
Answer: After you get your user location, you will need to calculate the distance between your list of location and show it on the map based on a radius limit you might want to show to the user, for example: to show location within 2miles radius of the current user location.
Comment: i dont have idea how to code it since im only beginner to android
Answer: Please keep in mind that distances between longs and lats can vary in some circumstances. At the north pole the distance between two longs isn't as much as it is near the equator (see the wikipedia picture down below to get an idea).
This specific issue you can solve by this function:
public static double geoCoordToMeter(double latA, double lonA, double latB, double lonB) {
    double earthRadius = 6378.137d; // km
    double dLat = (latB - latA) * Math.PI / 180d;
    double dLon = (lonB - lonA) * Math.PI / 180d;
    double a = Math.sin(dLat / 2d) * Math.sin(dLat / 2d)
               + Math.cos(latA * Math.PI / 180d)
                 * Math.cos(latB * Math.PI / 180d)
                 * Math.sin(dLon / 2d) * Math.sin(dLon / 2);
    double c = 2d * Math.atan2(Math.sqrt(a), Math.sqrt(1d - a));
    double d = earthRadius * c;
    return (d * 1000d);
}

That being said you will focus on the values you receive. Here you can loop through the database and check whats the lowest. To deal with this is not so hard... pseudo coding:
private int mMinValue = 10000; // field (member which stores the lowest..)

private checkMin(int newMin){
           if(mMinValue < newMin) mMinValue = newMin;
    }

If you don't want to deal with geo-data yourself, maybe the Geofence-API will do the mathematical stuff for you. ;)  I don't have any experiances with this API, maybe you have to do some research, to know if it's useful or not.
Hope it helps.
Comment: Can u please help me here? http://stackoverflow.com/questions/33492505/how-to-retrieve-a-set-of-locations-within-particular-range-from-users-location?noredirect=1#comment54808178_33492505
Comment: if you want to display correct values, you better "convert" them, yes.. otherwise an user in Africa will see other values then a Norwegian (when they stay in real **both** 500m away from their point of interest).
Comment: i still didnt get it sorry :( i dont know how to apply it in my code @MartinPfeffer


Exception while Installing Spinnaker

Question: I am trying to install Spinnaker but facing issue every time.
1. Tried to deploy using Google Launcher it is not starting anything on port 9000
2. Now trying to install using steps mentioned in https://github.com/spinnaker/spinnaker. Here I ../spinnaker/dev/run_dev.sh I am getting an exception
<code>Invocation of init method failed; nested exception is com.netflix.astyanax.connectionpool.exceptions.NoAvailableHostsException: NoAvailableHostsException: [hos
t=None(0.0.0.0):0, latency=0(0), attempts=0]No hosts to borrow from
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:661)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
</code>
I have also installed Cassandra (Using steps https://hostpresto.com/community/tutorials/how-to-install-apache-cassandra-on-ubuntu-14-04/)  and have checked I am able to do cqlsh.
Any help please
Thanks,
Amol
Answer: The Google Spinnaker Cloud Launcher indeed appears to be broken. I recently tried several times to deploy Spinnaker using it and experienced the same issues as you.
When you say:

Now trying to install using steps mentioned in https://github.com/spinnaker/spinnaker.

do you mean you're setting up the development environment? That's meant to be used when you actually want to write code for Spinnaker, not for normal use of the project.
The recommended way of getting a running Spinnaker installation is to use Halyard, the Spinnaker deployment tool.
Comment: Thanks @mdirkse. Now I am trying to install using Halyard. and Stuck with another issue. Now Installation wants openJDK-8 which does not work on Ubuntu 14.04 LTS and on Google Cloud next option which I have is version 16. And Spinnaker installation does not work on on any other version.
Comment: Strange, I provisioned a GCP VM with 14.04, installed halyard according to the docs and it worked fine, including the install of JDK 8. It should be available.
Comment: Was able to install after I installed oracle JDK manually and then disable autorun in hal deploy apply. Then it created a script. I commented the JDK install section there. It worked after that.  Thanks For your help

Exception while Installing Spinnaker


How do I add unsigned 64 bit drivers to WDS

Question: Windows Deployment Services on 2008 R2.
I'm trying to add a 64 bit driver package. Dell provides the drivers but they are unsigned. WDS does not allow adding unsigned 64 bit drivers. Is it possible to override this requirement and add them anyway, or is there a simple way to sign these drivers myself?
To be clear, I'm not trying to inject drivers into the boot image, just have them available in the driver pool during installation.
Answer: I think your only option would be injecting the driver into the image using dsim.exe with the /forceunsigned switch.
Comment: Is it possible to add the driver while creating the image or can I only add it to the offline image?
Comment: To be honest I never tried creating an image with unsigned drivers preinstalled. Might work.


Ajuda com deslocamento de bits em C++

Question: Bom, em um exercício de programação foi me dado o seguinte programa, e perguntava qual é sua saída
 using namespace std;

 union U1 {
    union U2{
      unsigned a: 3;
      unsigned b: 4;
      unsigned c: 1;
    }u2;
    int d;
    void Exibe(unsigned, unsigned, unsigned, int);
}u1;

int main(){
   u1.u2.a=2;
   u1.u2.a<<=1;
   u1.u2.b=16;
   u1.u2.b-=4;
   u1.u2.c=(u1.u2.b)>>3;
   u1.d=17;
   cout << u1.u2.a << "   " << u1.u2.b << "   " << u1.u2.c << "   " << u1.d << endl;
}

Após a execução do código a saída é '1 1 1 17' , minha dúvida está no porquê dessa saída, pesquisei sobre deslocamento de bits e juntando com o pouco que foi dado em aula ainda não consegui entender, poderiam me ajudar a entender?
Comment: Você executou o código? Se sim, ao menos tem a saída. Perguntar sobre o significado/razão da saída é outra coisa bem diferente, aí sim mais válida. Desculpe comentar, mas do jeito que a pergunta está parece exercício de programação + preguiça de digitar e compilar. Vc é bem vindo aqui, mas observe que este site não é um fórum. Se não fez ainda, faça o [tour].
Comment: Sim, eu executei, a saída é '1   1   1   17' , é que eu não entendi mesmo qual é a lógica dessa saída, pesquisei sobre deslocamento de bits mas ainda assim estou perdido. E sim, é uma questão de um exercício de programação onde todas as questões são mais ou menos nesse contexto, pedi ajuda nessa para entender como fazer.
Comment: Ok. Então edite a pergunta, e adicione nela essas informações que me passou. Aí eu voto para reabrir. ;)
Answer: O deslocamento de bits move os bits para a direita ou para a esquerda e acaba significando uma multiplicação ou divisão por 2 do valor que lá estava, mas é um pouco mais complicado que isso.
Para ajudar, vamos seguir seu programa linha por linha, mostrando os valores binários:
int main(){
   u1.u2.a=2;
   u1.u2.a<<=1;
   u1.u2.b=16;
   u1.u2.b-=4;
   u1.u2.c=(u1.u2.b)>>3;
   u1.d=17;
   cout << u1.u2.a << "   " << u1.u2.b << "   " << u1.u2.c << "   " << u1.d << endl;
}

1) A variável u1.u2.a no seu caso, é iniciada com o valor 2 e tem 3 bits.
a = 010

2) A variável então é deslocada um bit para a esquerda.
a = 100 (que é a mesma coisa que multiplicar por 2) e o valor vira 4

3) A variável b é iniciada com 16 e tem 4 bits. O que significa que o valor inserido passa do valor aceito por ela... Então isso já começa a desandar o entendimento do que está acontecendo (note que isso é um bug e não deveria ser feito).
16 = 10000
b = 0

4) Subtraindo 4 de b, deixaria o valor negativo, mas ele é unsigned, então você tem outro problema aqui, mas os bits seriam alterados.
b = 1100

5) Então é feito o deslocamento dos bits de b para atribuir em c. 3 bits para a direita.
b>>3 = 1
c = 1

6) Então ao atribuir 17 em d, tudo o que foi feito é apagado.
17 = 10001

Porém, como a U2 é uma union, ao fazer isso, você está alterando também a, b e c:
a = 001 (três bits de 17)
b = 0001 (quatro bits de 17)
c = 1 (um bit de 17)
d = 17 (ele continua sendo um inteiro)

Ajuda com deslocamento de bits em C++


Making both divs responsive

Question: I have two div tags. One automatically adjusts the height to content. The other one has fixed height(This one contains gmaps.js plugin). The one that has fixed height contains Google maps, and I have to add the height, if I don't it just doesn't show the map.
How could I make them have same height all the time, even when resizing the window.
JSfiddle https://jsfiddle.net/ntq3xp6b/
THE CODE FROM JS FIDDLE

CSS
.left{
    display:block;
    width:49.9%;
    float:left;
    background-color:red;
}

.right{
    display:block;
    width:49.9%;
    float:left;
    background-color:blue;
    height:300px;
}

Answer: Put them in a parent div with a specific height. Then set the height of each .box to 100%, with a min-height of 300px to ensure the Google Maps will fit.

.parent {
  height: 400px;
}
.box {
  width: 49.9%;
  float: left;
  height: 100%;
  min-height: 300px;
}
.box.left {
  background-color: red;
}
.box.right {
  background-color: blue;
}

Comment: This doesn't work, for some reason the gmaps.js plugin has to have the height defined in px. If it is in % it doesn't show the map.
Comment: I had no idea you were using a plugin. Please include that in your original question
Answer: Maybe also add a top and bottom padding?

.parent {
  height: 400px;
}
.box {
  width: 49.9%;
  float: left;
  height: 100%;
  min-height: 300px;
  padding-top:10px
  padding-bottom:10px;
}
.box.left {
  background-color: red;
}
.box.right {
  background-color: blue;
}

Answer: I would suggest that you try the jQuery matchHeight -plugin.
 $(function() {
    $('.box').matchHeight();
});

It will give the boxes fixed height of the tallest of them. The height value will update when the window is resized.

Making both divs responsive


Mac Os Core Data App that shares database between two computers

Question: I made a mac os app (with a large database implemented with Core Data). This app is private, I use this app only for my job (it is not sold on the mac app store). Now I would use this app from two different computers (two users) and it would be great to share the database between two users.
How can I make this?
I know about Cloudkit, but it is necessary to pay Apple development program to use it.
Is there any other solution, perhaps (free and) more easy of Cloukit?
thx
Comment: You can use sqlite or mysql for free with one machine acting as host. It's better to use a 3rd machine as the host.
Answer: Core Data is designed to work as the local data store of a single app. Apple's CloudKit is the only way it really supports syncing. You could try putting the data store in a folder synced by Dropbox, iCloud Drive, etc, but it's unlikely to work reliably. If getting syncing in your app isn't worth $99 to you then you probably need to look at third party solutions like Firebase, but that probably means redesigning the app to not use Core Data.


Tool for get image sources parsed from css

Question: Task is simple. Have a tool which will parse CSS on network website, read the links to images from there and download all of them to structured folders to local disc.
The important is that tool should ready to use, and designer should be able to use. Answer "you can write the tool itself is OK", but not acceptible for ready tool .
Answer: You can get urls from css manually with regular expressions.
Comment: yes thats true, but tool (already done) is what I´m looking for. Lets say GUI tool that styler-man and no only programer, can use.
Comment: How about writing one based on the knowledge you gather from these answers?
Comment: You are true on it. Actualy instead of do self made FTP client I use Filezilla. If there will be no solution to take it and use I will do.
Comment: Marked as answer while looks this tool is not present on market. Inspiration for everyone.
Answer: To accompany Roman's answer:
/\burl\(['"]?([^'"\)]+)['"]?\)\b/g

will match as $1 almost all images (almost all meaning, that the central part ['"\)] is a bit too strict and will not match URLs with either of these characters in it).
Note that you might get external stylesheets ('@import'), too, with this regexp.


Falta de memória em Java mesmo o computador tendo memória disponível

Question: A Java Virtual Machine "JVM" pode ficar sem memória mesmo se a máquina física tiver memória disponível?
Comment: Pode. Quando dá por exemplo um `OutOfMemoryError` em um programa Java é porque a JVM não conseguiu alocar memória, mesmo havendo mais memória disponível na máquina hospedeira. Existem configurações de inicialização para dizer à JVM quanto de memória ela será capaz de alocar no total.
Comment: Internamente a JVM é [dividida em várias áreas de memória](https://dzone.com/articles/java-memory-management) e o tamanho de cada uma pode ser configurado. E como essas áreas tem limites de tamanho próprios, elas podem estourar, mesmo que o servidor tenha mais memória disponível.
Answer: Imagino que você esteja recebendo erro de falta de memória. Isto não quer dizer que toda memória foi ocupada mas sim que não teve como fazer alocação. Mesmo com GC existe alguma fragmentação e existem alguns padrões que o garbage collector usa que pode precisar alocar algo de uma certa forma que não é possível, ainda que para o que precisaria seria.
Em alguns casos uma das partes pode sofrer exaustão mesmo que tenha espaço em outras. O heap não é uma área única. Inclusive tem casos que o problema pode ser na memória não gerenciada que pode reportar algo anormal.
Além disto pode estar pedindo para alocar um objeto muito grande, para ele não tem espaço, mas ainda tem muito espaço disponível para outros objetos um pouco menores.
Então erro de falta de memória não significa que toda memória foi consumida, apenas que não não foi possível alocar o que foi pedido, por diversas razões.
Answer: Pode sim, a JVM não utiliza toda a memória disponível na máquina, ela inicialmente é limitada, podendo ocasionar erros como OutOfMemory. Para solucionar esse tipo de problema, você pode, ao iniciar a aplicação, definir a memória que será utilizada pela JVM passando parâmetros como -Xms, -Xmx, entre outros.
Answer: A JVM trabalha com uma mentalidade de segmentação de memória, onde existem subdivisões bem específicas cada uma voltada para certa finalidade.

Heap Memory: Usado para armazenar os objetos que você aloca. Aqui você pode configurar as mesmas usando as flags -Xms (Tamanho inicial) e -Xmx (Tamanho máximo)
Non-Heap Memory: Usado para meta-dados e outros (Classes que foram alocadas,informações de campos/métodos, constantes...). Também configurável pela flag "-XX:MaxPermSize"
E a memória alocada para a própria JVM, afinal ela deve existir em algum lugar :^)

Aqui faz-se necessário distinguir a memória alocada para JVM da memória usada pelo seu programa. Caso, a memória usada tenda a querer passar a memória alocada, isso virá a gerar uma exceção (O famoso OutofMemory). É aqui que entrará a sua estratégia de programação para minimizar o desperdício de recursos e otimizar o ciclo de vida dos objetos que estão sendo usados.


How to resend simplenews content for many times - Simplenews module

Question: I use drupal 7 and simplenews module.I want to send a simplenews for several times.by default simple news module support onetime send to user.but i want to send simplenews to user for several times by UI .
Is any way for resending support in simplenews module ?
Is any other module for edit contents before sending by mail and send it for several times to subscribers?
Comment: I solved my problem with use simplenes_content_selection module.
Answer: I had a similar issue for Drupal 8. I created a module to do this:
https://www.drupal.org/project/simplenews_resend
This module adds a reset status link to the newsletter operations.
Answer: solution:
simplenews Status Reset module .


How to call a SSL secured REST service within AWS Lambda

Question: Is it possible to do an REST call to
https://owapi.net/api/v3/u/<Playername>-<BattleTagNumber>/stats
via the JAX RS REST client withi AWS Lambda and if so, what do I have to set up with the Java SSL? Currently I do the following:
  System.setProperty("javax.net.debug", "all");
  SSLContext sc = SSLContext.getInstance("TLSv1.2");
  System.setProperty("https.protocols", "TLSv1.2");//Java 8

  TrustManager[] trustAllCerts = { new InsecureTrustManager() };
  sc.init(null, trustAllCerts, new java.security.SecureRandom());
  HostnameVerifier allHostsValid = new InsecureHostnameVerifier();

  client = ClientBuilder.newBuilder().sslContext(sc).hostnameVerifier(allHostsValid).build();

But if I do so, I always get the following error:
javax.ws.rs.ProcessingException: javax.net.ssl.SSLException: Received fatal alert: internal_error

With that javax.net.debug protocol:
trigger seeding of SecureRandom
done seeding SecureRandom
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384
Ignoring unavailable cipher suite: TLS_RSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384
Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
Ignoring unavailable cipher suite: TLS_DHE_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
Ignoring unavailable cipher suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
Allow unsafe renegotiation: false
Allow legacy hello messages: true
Is initial handshake: true
Is secure renegotiation: false
main, setSoTimeout(0) called
%% No cached client session
*** ClientHello, TLSv1.2
RandomCookie:  GMT: 1483983009 bytes = { 69, 214, 28, 204, 137, 202, 87, 217, 243, 178, 105, 174, 241, 76, 84, 41, 220, 36, 75, 185, 115, 175, 147, 24, 3, 43, 157, 220 }
Session ID:  {}
Cipher Suites: [TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, TLS_ECDHE_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_SHA, TLS_ECDH_ECDSA_WITH_RC4_128_SHA, TLS_ECDH_RSA_WITH_RC4_128_SHA, SSL_RSA_WITH_RC4_128_MD5, TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
Compression Methods:  { 0 }
Extension elliptic_curves, curve names: {secp256r1, sect163k1, sect163r2, secp192r1, secp224r1, sect233k1, sect233r1, sect283k1, sect283r1, secp384r1, sect409k1, sect409r1, secp521r1, sect571k1, sect571r1, secp160k1, secp160r1, secp160r2, sect163r1, secp192k1, sect193r1, sect193r2, secp224k1, sect239k1, secp256k1}
Extension ec_point_formats, formats: [uncompressed]
Extension signature_algorithms, signature_algorithms: SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA, SHA256withECDSA, SHA256withRSA, SHA224withECDSA, SHA224withRSA, SHA1withECDSA, SHA1withRSA, SHA1withDSA, MD5withRSA
***
[write] MD5 and SHA1 hashes:  len = 207
0000: 01 00 00 CB 03 03 58 74   C9 A1 45 D6 1C CC 89 CA  ......Xt..E.....
0010: 57 D9 F3 B2 69 AE F1 4C   54 29 DC 24 4B B9 73 AF  W...i..LT).$K.s.
0020: 93 18 03 2B 9D DC 00 00   46 C0 23 C0 27 00 3C C0  ...+....F.#.'.<.
0030: 25 C0 29 00 67 00 40 C0   09 C0 13 00 2F C0 04 C0  %.).g.@...../...
0040: 0E 00 33 00 32 C0 2B C0   2F 00 9C C0 2D C0 31 00  ..3.2.+./...-.1.
0050: 9E 00 A2 C0 08 C0 12 00   0A C0 03 C0 0D 00 16 00  ................
0060: 13 C0 07 C0 11 00 05 C0   02 C0 0C 00 04 00 FF 01  ................
0070: 00 00 5C 00 0A 00 34 00   32 00 17 00 01 00 03 00  ..\...4.2.......
0080: 13 00 15 00 06 00 07 00   09 00 0A 00 18 00 0B 00  ................
0090: 0C 00 19 00 0D 00 0E 00   0F 00 10 00 11 00 02 00  ................
00A0: 12 00 04 00 05 00 14 00   08 00 16 00 0B 00 02 01  ................
00B0: 00 00 0D 00 1A 00 18 06   03 06 01 05 03 05 01 04  ................
00C0: 03 04 01 03 03 03 01 02   03 02 01 02 02 01 01     ...............
main, WRITE: TLSv1.2 Handshake, length = 207
[Raw write]: length = 212
0000: 16 03 03 00 CF 01 00 00   CB 03 03 58 74 C9 A1 45  ...........Xt..E
0010: D6 1C CC 89 CA 57 D9 F3   B2 69 AE F1 4C 54 29 DC  .....W...i..LT).
0020: 24 4B B9 73 AF 93 18 03   2B 9D DC 00 00 46 C0 23  $K.s....+....F.#
0030: C0 27 00 3C C0 25 C0 29   00 67 00 40 C0 09 C0 13  .'.<.%.).g.@....
0040: 00 2F C0 04 C0 0E 00 33   00 32 C0 2B C0 2F 00 9C  ./.....3.2.+./..
0050: C0 2D C0 31 00 9E 00 A2   C0 08 C0 12 00 0A C0 03  .-.1............
0060: C0 0D 00 16 00 13 C0 07   C0 11 00 05 C0 02 C0 0C  ................
0070: 00 04 00 FF 01 00 00 5C   00 0A 00 34 00 32 00 17  .......\...4.2..
0080: 00 01 00 03 00 13 00 15   00 06 00 07 00 09 00 0A  ................
0090: 00 18 00 0B 00 0C 00 19   00 0D 00 0E 00 0F 00 10  ................
00A0: 00 11 00 02 00 12 00 04   00 05 00 14 00 08 00 16  ................
00B0: 00 0B 00 02 01 00 00 0D   00 1A 00 18 06 03 06 01  ................
00C0: 05 03 05 01 04 03 04 01   03 03 03 01 02 03 02 01  ................
00D0: 02 02 01 01                                        ....
[Raw read]: length = 5
0000: 15 03 03 00 02                                     .....
[Raw read]: length = 2
0000: 02 50                                              .P
main, READ: TLSv1.2 Alert, length = 2
main, RECV TLSv1.2 ALERT:  fatal, internal_error
main, called closeSocket()
main, handling exception: javax.net.ssl.SSLException: Received fatal alert: internal_error

EDIT 1:
I got the following dependecies in the maven project - hoefully you now the HttpClient Version now...
<dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.0.1</version>
    </dependency>
    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>jsr311-api</artifactId>
        <version>1.1.1</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-client</artifactId>
        <version>2.22.1</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.connectors</groupId>
        <artifactId>jersey-apache-connector</artifactId>
        <version>2.22.1</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.media</groupId>
        <artifactId>jersey-media-moxy</artifactId>
        <version>2.22.1</version>
    </dependency>
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.0</version>
    </dependency>

EDIT 2: Here is the whole log from AWS Lambda, if I execute the code in AWS Lambda.
*** ClientHello, TLSv1.2
Cipher Suites: [TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA]
Compression Methods: { 0 }
Extension signature_algorithms, signature_algorithms: SHA512withECDSA, SHA512withRSA, SHA384withECDSA, SHA384withRSA, SHA256withECDSA, SHA256withRSA, SHA224withECDSA, SHA224withRSA, SHA1withECDSA, SHA1withRSA, SHA1withDSA
Extension server_name, server_name: [type=host_name (0), value=owapi.net]
Extension renegotiation_info, renegotiated_connection: <empty>
***
[write] MD5 and SHA1 hashes: len = 102
0000: 01 00 00 62 03 03 58 77 87 19 2B 1A 22 5B 19 D4 ...b..Xw..+."[..
0010: E3 22 6F B6 AE E9 C5 41 73 7A 24 0C 5A 63 E6 E2 ."o....Asz$.Zc..
0020: DA C5 81 1D 17 B7 00 00 06 00 9C 00 2F 00 35 01 ............/.5.
0030: 00 00 33 00 0D 00 18 00 16 06 03 06 01 05 03 05 ..3.............
0040: 01 04 03 04 01 03 03 03 01 02 03 02 01 02 02 00 ................
0050: 00 00 0E 00 0C 00 00 09 6F 77 61 70 69 2E 6E 65 ........owapi.ne
0060: 74 FF 01 00 01 00 t.....
AsyncHttpClient-2-1, WRITE: TLSv1.2 Handshake, length = 102
[Raw write]: length = 107
0000: 16 03 03 00 66 01 00 00 62 03 03 58 77 87 19 2B ....f...b..Xw..+
0010: 1A 22 5B 19 D4 E3 22 6F B6 AE E9 C5 41 73 7A 24 ."[..."o....Asz$
0020: 0C 5A 63 E6 E2 DA C5 81 1D 17 B7 00 00 06 00 9C .Zc.............
0030: 00 2F 00 35 01 00 00 33 00 0D 00 18 00 16 06 03 ./.5...3........
0040: 06 01 05 03 05 01 04 03 04 01 03 03 03 01 02 03 ................
0050: 02 01 02 02 00 00 00 0E 00 0C 00 00 09 6F 77 61 .............owa
0060: 70 69 2E 6E 65 74 FF 01 00 01 00 pi.net.....
2017-01-12 13:39:37 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG DefaultChannelPool:231 - Closed 0 connections out of 0 in 0 ms
2017-01-12 13:39:37 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG Recycler:76 - -Dio.netty.recycler.maxCapacity.default: 32768
2017-01-12 13:39:37 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG Recycler:76 - -Dio.netty.recycler.maxSharedCapacityFactor: 2
2017-01-12 13:39:37 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG Recycler:76 - -Dio.netty.recycler.linkCapacity: 16
2017-01-12 13:39:37 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG Recycler:76 - -Dio.netty.recycler.ratio: 8
[Raw read]: length = 5
0000: 15 03 03 00 02 .....
[Raw read]: length = 2
0000: 02 28 .(
AsyncHttpClient-2-1, READ: TLSv1.2 Alert, length = 2
AsyncHttpClient-2-1, RECV TLSv1.2 ALERT: fatal, handshake_failure
AsyncHttpClient-2-1, fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Received fatal alert: handshake_failure
AsyncHttpClient-2-1, fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Received fatal alert: handshake_failure
AsyncHttpClient-2-1, called closeOutbound()
AsyncHttpClient-2-1, closeOutboundInternal()
AsyncHttpClient-2-1, SEND TLSv1.2 ALERT: warning, description = close_notify
AsyncHttpClient-2-1, WRITE: TLSv1.2 Alert, length = 2
AsyncHttpClient-2-1, called closeInbound()
AsyncHttpClient-2-1, fatal: engine already closed. Rethrowing javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack?
AsyncHttpClient-2-1, called closeOutbound()
AsyncHttpClient-2-1, closeOutboundInternal()
[Raw write]: length = 7
0000: 15 03 03 00 02 01 00 .......
2017-01-12 13:39:37 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG NettyConnectListener:148 - Trying to recover from failing to connect channel [id: 0x3351b9a8, L:0.0.0.0/0.0.0.0:32982 ! R:owapi.net/184.108.40.206:443] with a retry value of true
2017-01-12 13:39:37 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG NettyConnectListener:158 - Failed to recover from connect exception: javax.net.ssl.SSLException: Received fatal alert: handshake_failure with channel [id: 0x3351b9a8, L:0.0.0.0/0.0.0.0:32982 ! R:owapi.net/188.8.131.52:443]
2017-01-12 13:39:37 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> ERROR MasterOverwatchSpeechlet:186 - Fehler beim Lesen der Statistiken.
java.util.concurrent.ExecutionException: java.net.ConnectException: Received fatal alert: handshake_failure
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at org.asynchttpclient.netty.NettyResponseFuture.get(NettyResponseFuture.java:160)
at de.mhproductions.ask.masteroverwatchskill.MasterOverwatchSpeechlet.getMasterOverwatchResponse(MasterOverwatchSpeechlet.java:158)
at de.mhproductions.ask.masteroverwatchskill.MasterOverwatchSpeechlet.onIntent(MasterOverwatchSpeechlet.java:70)
at com.amazon.speech.speechlet.SpeechletToSpeechletV2Adapter.onIntent(SpeechletToSpeechletV2Adapter.java:51)
at com.amazon.speech.speechlet.SpeechletRequestDispatcher.dispatchSpeechletCall(SpeechletRequestDispatcher.java:218)
at com.amazon.speech.speechlet.SpeechletRequestHandler.internalHandleSpeechletCall(SpeechletRequestHandler.java:152)
at com.amazon.speech.speechlet.SpeechletRequestHandler.handleSpeechletCall(SpeechletRequestHandler.java:115)
at com.amazon.speech.speechlet.lambda.SpeechletRequestStreamHandler.handleRequest(SpeechletRequestStreamHandler.java:89)
at lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:1139)
at lambdainternal.AWSLambda.startRuntime(AWSLambda.java:285)
at lambdainternal.AWSLambda.<clinit>(AWSLambda.java:57)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:94)
Caused by: java.net.ConnectException: Received fatal alert: handshake_failure
at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:162)
at org.asynchttpclient.netty.channel.NettyConnectListener$1.onFailure(NettyConnectListener.java:133)
at org.asynchttpclient.netty.SimpleFutureListener.operationComplete(SimpleFutureListener.java:26)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:486)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:129)
at io.netty.handler.ssl.SslHandler.notifyHandshakeFailure(SslHandler.java:1238)
at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1233)
at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1208)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1063)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:902)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:367)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:353)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:346)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:367)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:353)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:652)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:575)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:489)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:451)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1666)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1634)
at sun.security.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1800)
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:1083)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:907)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1097)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:968)
... 18 more
java.util.concurrent.ExecutionException: java.net.ConnectException: Received fatal alert: handshake_failure
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
at org.asynchttpclient.netty.NettyResponseFuture.get(NettyResponseFuture.java:160)
at de.mhproductions.ask.masteroverwatchskill.MasterOverwatchSpeechlet.getMasterOverwatchResponse(MasterOverwatchSpeechlet.java:158)
at de.mhproductions.ask.masteroverwatchskill.MasterOverwatchSpeechlet.onIntent(MasterOverwatchSpeechlet.java:70)
at com.amazon.speech.speechlet.SpeechletToSpeechletV2Adapter.onIntent(SpeechletToSpeechletV2Adapter.java:51)
at com.amazon.speech.speechlet.SpeechletRequestDispatcher.dispatchSpeechletCall(SpeechletRequestDispatcher.java:218)
at com.amazon.speech.speechlet.SpeechletRequestHandler.internalHandleSpeechletCall(SpeechletRequestHandler.java:152)
at com.amazon.speech.speechlet.SpeechletRequestHandler.handleSpeechletCall(SpeechletRequestHandler.java:115)
at com.amazon.speech.speechlet.lambda.SpeechletRequestStreamHandler.handleRequest(SpeechletRequestStreamHandler.java:89)
at lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:1139)
at lambdainternal.AWSLambda.startRuntime(AWSLambda.java:285)
at lambdainternal.AWSLambda.<clinit>(AWSLambda.java:57)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:94)
Caused by: java.net.ConnectException: Received fatal alert: handshake_failure
at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:162)
at org.asynchttpclient.netty.channel.NettyConnectListener$1.onFailure(NettyConnectListener.java:133)
at org.asynchttpclient.netty.SimpleFutureListener.operationComplete(SimpleFutureListener.java:26)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:486)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:129)
at io.netty.handler.ssl.SslHandler.notifyHandshakeFailure(SslHandler.java:1238)
at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1233)
at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1208)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1063)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:902)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:367)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:353)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:346)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:367)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:353)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:652)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:575)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:489)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:451)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1666)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1634)
at sun.security.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1800)
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:1083)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:907)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1097)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:968)
... 18 more
2017-01-12 13:39:37 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG AsyncCompletionHandler:71 - Received fatal alert: handshake_failure
java.net.ConnectException: Received fatal alert: handshake_failure
at org.asynchttpclient.netty.channel.NettyConnectListener.onFailure(NettyConnectListener.java:162)
at org.asynchttpclient.netty.channel.NettyConnectListener$1.onFailure(NettyConnectListener.java:133)
at org.asynchttpclient.netty.SimpleFutureListener.operationComplete(SimpleFutureListener.java:26)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:514)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:507)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:486)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:427)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:129)
at io.netty.handler.ssl.SslHandler.notifyHandshakeFailure(SslHandler.java:1238)
at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1233)
at io.netty.handler.ssl.SslHandler.setHandshakeFailure(SslHandler.java:1208)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1063)
at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:902)
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:367)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:353)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:346)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:367)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:353)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:652)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:575)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:489)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:451)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.net.ssl.SSLException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1666)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1634)
at sun.security.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1800)
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:1083)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:907)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:781)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1097)
at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:968)
... 18 more
2017-01-12 13:39:38 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG HttpHandler:157 - Unexpected I/O exception on channel [id: 0x3351b9a8, L:0.0.0.0/0.0.0.0:32982 ! R:owapi.net/220.127.116.11:443]
javax.net.ssl.SSLException: Received fatal alert: handshake_failure
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:411)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:367)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:353)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:346)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:367)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:353)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:652)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:575)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:489)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:451)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
at java.lang.Thread.run(Thread.java:745)
2017-01-12 13:39:38 <8b2d050a-d8cc-11e6-8262-5ddb1e7af2d2> DEBUG ChannelManager:370 - Closing Channel [id: 0x3351b9a8, L:0.0.0.0/0.0.0.0:32982 ! R:owapi.net/22.214.171.124:443]
AsyncHttpClient-2-1, called closeOutbound()
AsyncHttpClient-2-1, closeOutboundInternal()

Comment: @DaveMaple See my adjustment in the question above
Answer: The issue seems to come down to the ECC cipher suite and lack of support in this version of the openjdk. I was able to get it working by adding BouncyCastle to the project:
    <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.56</version>
    </dependency>

And then adding the root, domain and SNI certs for owapi.net:
Security.addProvider(new BouncyCastleProvider());

// get cert
X509Certificate rootCert =
        (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(
                new BufferedInputStream(OwapiTestHandler.class.getResourceAsStream("/comodo-ecc-ca.crt"))
        );
X509Certificate domainCert =
        (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(
                new BufferedInputStream(OwapiTestHandler.class.getResourceAsStream("/comodo-ecc-domain-ca.crt"))
        );
X509Certificate sniCert =
        (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(
                new BufferedInputStream(OwapiTestHandler.class.getResourceAsStream("/sni235897.cloudflaressl.com.crt"))
        );

// add cert to keystore
KeyStore keystore = KeyStore.getInstance("PKCS12", BouncyCastleProvider.PROVIDER_NAME);
keystore.load(null, "".toCharArray());
keystore.setCertificateEntry("comodo-ecc-ca", rootCert);
keystore.setCertificateEntry("comodo-ecc-doman-ca", domainCert);
keystore.setCertificateEntry("cloudflair-sni", sniCert);

There's a fully working project on github here that includes all of the certs for owapi.net:
https://github.com/codeengine1/owapi-test
https://github.com/codeengine1/owapi-test/blob/master/src/main/java/com/codeengine/lambda/OwapiTestHandler.java
Comment: Hmmm...okay tried with only the AsyncHttpClient with no configuration in synchronous mode. Now I get the following exception javax.net.ssl.SSLException: Received fatal alert: handshake_failure
Comment: It is set up to "No VPC".
Comment: You can use Kampfkeks-2498
Comment: You forgot an s for stats
Comment: I tried exactly the same thing, but in AWS Lambda I get the following exception: DEBUG HttpHandler:157 - Unexpected I/O exception on channel [id: 0xa1f0a1d8, L:0.0.0.0/0.0.0.0:39996 ! R:owapi.net/22.214.171.124:443]
javax.net.ssl.SSLException: Received fatal alert: handshake_failure
Comment: Yes, i am using 2.0.24
Comment: Thank you for your extensive help ;)
Comment: Sry for my inconvenience, but did you got any result so far?
Comment: I've "found" the problem. I used a Overwatch-API with a certificate, sigend by a authority and this is working, using a custom certificate leads to the problem. How can I set the certificate in my code, to use the one from owapi.net?
Comment: @MarcelHöll: finally got it working. See updated answer.
Comment: @DaveMarple Maybe you can tell me, what exatcly did you do to obtain the certs, truststore, ...?
Answer: You most likely hit a JDK bug because you're running a version that isn't up-to-date. Upgrade to latest JDK8 (8112 atm).
Comment: Unfortunately aws would need to upgrade the openjdk for the Java lambda runtime
Comment: If you're a AWS customer, you're entitled to open an issue there and ask them to upgrade. If that's indeed a JDK issue that's been long fixed, it becomes an AWS issue then.
Comment: @StephaneLandelle Yes, AWS Lambda uses Open JDK java-1.8.0-openjdk-184.108.40.206-3.b13.24.amzn1.x86_64, if I try it locally, all works fine, If I switch to the AWS Lambda service, it crashes with the handshake failure.
Comment: AWS Lambda runs custom AWS OpenJDK builds. Only them can tell how they differ from public builds, like the one you have on your machine. Then, IMO: works on your machine + doesn't work on AWS Lambda = AWS issue, for them to investigate.
Answer: First, test things locally, use java keytool to import ssl cert to cacerts.
Then, add the cacert_new to same package of you java class:
String pathKeyStore = com.amazonaws.samples.SaveUrl.class.getResource("cacerts_new").getPath();
System.setProperty("javax.net.ssl.trustStore", pathKeyStore);

package your code and deploy to aws lambda. should work the same way as local.


Horizontal Scroll Without Holding Shift

Question: None of my searches have provided any results.
Is it possible using to create a 'horizontal scrolling' functionality that does not involve holding shift while the user scrolls?
Comment: Try this one: https://css-tricks.com/snippets/jquery/horz-scroll-with-mouse-wheel/
Comment: i actually just came across it. i'm trying to implement it right now. for whatever reason, even though the demo works, i can't seem to get it to work on my system. i'm even using the exact same jquery library that was mentioned in the demo. no console errors or nothing @jcoder
Answer: So I'm 6 years too late, but if someone else comes across this issue...
This worked for me, I was having the same issue and used the javascript found here:
https://alvarotrigo.com/blog/scroll-horizontally-with-mouse-wheel-vanilla-java/
const scrollContainer = document.getElementById("yourElement");

scrollContainer.addEventListener("wheel", (evt) => {
    evt.preventDefault();
    scrollContainer.scrollLeft += evt.deltaY;
});

I did have issues where the trackpad was scrolling the horizontal div too slowly, but I adjusted the code that worked well enough for my purposes:
const scrollContainer = document.getElementById("myElement");

scrollContainer.addEventListener("wheel", (evt) => {
    evt.preventDefault();

    if (evt.deltaY >= -15 && evt.deltaY <= 15) {
    scrollContainer.scrollLeft += (evt.deltaY * 40);}

    else {
        scrollContainer.scrollLeft += (evt.deltaY * 5);
    }
});

Comment: Thing is, you also need to account for other forms of navigation such as mobile touch or arrows. But, yes, this works for desktop with a mouse!
Comment: dang! I tested the mobile touch in firefox responsive design mode, but hopefully it will actually still be functional when I get the website online
Comment: and this code worked in firefox for touch scrolling?
Comment: as far as I can tell, yes, but I have yet to plug my phone in to the computer as an extension and try it on there
https://imgur.com/BW0Xb6L

Horizontal Scroll Without Holding Shift


A mixture of classification and regression problem

Question: This is a hypothetical problem: imagine there is a $y \sim x_1, x_2, ...x_{10}$, with 3 of them classification and 7 of them regression(for example there several clusters within 3 dim space that use different regression model.) But we know nothing about the properties before and we want to propose a model as close as possible. Can some expert think of some methodology or processedures that leads to the right/close model?
My thought will be use feature selection to select most important features(for example two features) and plot the figure $y\sim x_p, x_q$. This will help to see if the parameter is classification or regression. But it's not systematic...
Answer: It is the nature of $y$, the outcome you're trying to predict/explain, that determines whether you use a regression approach or classification approach.
If $y$ is continuous, e.g. count, cost, profit, etc., then you use a regression approach.
If $y$ is categorical, e.g. yes vs. no, then you use a classification approach.
Both approaches allow both continuous and categorical predictors $x$.
Note: this distinction generally comes up in machine learning; in statistics, both approaches fall under the term 'regression', e.g. logistic regression is for yes/no outcomes.


Roman numeral chord notation in minor scale?

Question: I need help to understand chord intervals (not single note intervals) explains what the numbers I, IV, vi, III+ usually stand for in major chord theory.
But what's it like with a minor scale? What is the convention here? Let's say we describe a song written in A minor. How would I reference the chord progression a,F,E?  Would vi,IV,III be valid? To me this feels more natural than saying "i,VI, V". If it has to be the latter, what about a mixture-song where you cannot really determine if it's major/minor? How can you be sure the other one knows what you're talking about? And what if there are multiple key changes? Does this notation then even make any sense at all?
Answer: Roman Numeral analysis requires the key of what you are analyzing to make any sense. Based on the key you can handle any basic progression.
If you are in A minor, everything you are doing is centered around A so the progression would be i VI V for the progression Am, F, E. When outside of a major key sometimes ♭ and ♯ signs are used to denote when scale degrees are altered from the major scale so the progression may sometimes be i ♭VI V, but this is much more informal and gets screwy when looking at actual chords outside the key. You'll typically pick major or minor based on if the tonic chord is major or minor and use ♭ and ♯ signs to signify when the root of the chord has an altered scale degree so if the progression above had the Am changed to A major, the progression would be I ♭VI V in A major.
As you change keys you'll write in terms of the new keys so for example if you were modulating from C to G and you had the progression  C, F, G7, C, Am, D7, G you would have this analysis:

     C   F    G7    C    Am    D7    G

C:   I   IV   V7    I    vi

                     G:  ii    V7    I
Answer: Roman numerals directly relate to the key concerned. If they didn't, they would be less than pointless. Capitals (I, IV) relate to major chords, with a major 3 in them. Lower case (ii, vi) relate to minors, with a minor third.
So, in a minor key, say A minor, the Am is called i. If that key moves to its parallel, A major, then it makes sense to call the tonic 'I', due to it now being major. As noted by others, a chord altered will need a b or # to show this. Thus, in A minor, an F#m will be shown as #vi. The sharpened 6th degree chord formed in A minor (VI), but written vi as it's minor.
Somewhat similar to NNS, which is always worth a look at.
Depending on a bit of modulation, the same key can be followed, until there is obviously a sea change of a new key - with no prospect of a return imminent, at which point, the Roman numerals ought to reflect the new key.
Answer: If a minor key IS established, it's useful to consider the tonic chord is i.  Note that I said 'useful'.  Like all 'theory', it's a set of descriptions.  Use it when it helps.  Use something else when that helps better.  There was a recent discussion about the problem of the very common chord Dm6, or Bm7b5, acting as a dominant of E7.   Absolutely tonal, and 'in-key', but beyond the scope of Roman numerals.  Which doesn't make it 'wrong'.   Theory describes, it does not command.
Roman Numeral analysis certainly 'makes sense', but it isn't useful in ALL musical situations.
There's a parallel with tonic sol-fa notation. A useful sight-singing method but a dead-end notation system.
Answer: a, F, E would be described as i VI V if you're centered around A minor the major 5th would mean you're borrowing from melodic minor. Why would  iv, IV, III seem valid? always think of the key you're centered around when speaking numerals.
Answer: There is no convention. You need to know how chords are notated. This is independent of what scale you may be operating in.
Chords have root notes, these notes are certain scale degrees on the scale. So the Tonic chord has the Tonic for a root.
Then comes details on what type of chord you have. The four main types you are going to need to know are.

Major
minor
Diminished
Augmented

Now let us go trough what these mean.

Major - It has a Major Third and a Perfect Fifth
minor - This has a minor third and a Perfect Fifth
Diminished - Minor Third and Diminished Fifth
Augmented - Major Third and Augmented Fifth

A major chord build on a certain scale degree will have it notated with a Capital Roman Numeral.
A minor chord will be notated with lower case Roman Numerals.
An augmented chord will be notated with Capital Roman Numerals and a plus sign to indicate that this chord has an augmented fifth.
A diminished chord will be notated with lower case Roman Numerals and the degree sign.
Then lastly you have the inversion. The inversion basically concerns itself with what notes is in the bass.
If the root note is on bottom it is notated with 5/3 or none.
If the third is on the bottom then it 6/3 or sometimes just 6.
And lastly if the fifth is on the bottom then 6/4
You need to be able to look at any chord regardless of key and be able to tell what type of chord it is. Many modern pieces only adhere to the key loosely so the tonic chord can be many types of chord.
It is only in standard western harmony that the type of chords follows a certain pattern.


Grab current OpenGL context with Qt

Question: I have written a Qt based dll with some OpenGL calls. If I load my DLL from my Qt application with QGLWidget used for rendering, a call to QGLContext::currentContext from the DLL returns the correct context. But if use my DLL in a non Qt based program there is no QGLContext returned. As a result I couldn't use QGLShaderProgram in non Qt based apps.
What I am doing wrong?
P.S. Direct calls to glCreateProgram and so on in my library seem to work fine, but I want to use Qt classes.
Answer:
I want to use Qt classes.

Then you should use your DLL in an application that uses Qt. By requiring the Qt classes, your DLL now requires Qt. If you want your DLL to work when Qt isn't available, then you shouldn't use Qt.
Besides, the Qt classes for shaders and programs aren't anything you couldn't whip up in 30 minutes.
Comment: This is an old discussion - in the interest of people coming here to learn, the comments made by Nicol and Bart were correct at the time, but are no longer true. Qt has nearly 100% replaced their GL interfaces, and this is now supported. See QOpenGLContext::setNativeHandle()
Comment: "By requiring the Qt classes, your DLL now requires Qt" It's not a problem. Problem is how to use QGLShader class to render on existing OpenGL context created from non Qt program.

Unfortunatly links which you a provided related Qt 5 (un stable), so I can not use them
Comment: You don't. Either use Qt or don't use it. You can perhaps jump through hoops to make it work, but why would you?
Comment: @Jeka: "It's not a problem. Problem is how to use QGLShader class to render on existing OpenGL context created from non Qt program." Then that *is* your problem. You can't *kinda* use Qt (or at least, not the OpenGL parts). Either the *application as a whole* uses Qt or it doesn't. And if your DLL is being used by a non-Qt application, then your *application* doesn't use Qt. So neither can you.

Grab current OpenGL context with Qt


Goodness-of-fit for linear, mixed effects models

Question: Can someone tell me why this is wrong:
I want to estimate the goodness-of-fit for a linear mixed effects model.  I regress the fitted values against the raw values and calculate an $R^2$.
I suppose an accepted alternative would be to run the model with just the random effect and no fixed effects and compare AIC scores, but I'm specifically interested in the scenario above.
Answer: Well $R^2$ is a measure of goodness of fit for any linear model.  It is the sum of squares due to the fitted model divided by the total sum of squares (denominator just adds the sum of squares due to the error term).  But it is usually not used to assess the quality of the model because as in your scenario since all the dat is used to fit you could be overfitting the data. $R^2$ cannot determine overfitting. Add a variable that is just noise and the $R^2$ will still increase.  Criteria like AIC and BIC are better at assessing the model because they penalize the likelihood function for having too many parameters while $R^2$ does not.  Adjusted $R^2$ tries to remedy this.  But I think it is not used because these other criteria tand to work better.
Comment: Ah, I see.  I was reporting AIC scores of the reduced model anyway but just curious why this was also not appropriate.  Thank you!
Comment: Comparing AIC scores is an accepted way to do variable subset selection> You can compare the AIC for the full model versus the reduced.  I think you should to this for the full mixed model not just the random effects.  If the max AIC is not at the reduced model then the full model is considered to be the better of the two.


Diretório dos scripts não são reconhecidos

Question: Estou montando um site wordpress no MAMP instalado no windows e os scripts .JS coloco assim no footer:
  <?php wp_footer(); ?>

Daí que não funciona e no console reconhece como "GET http://localhost:8888/protodesign/assets/js/efeitos.js net::ERR_ABORTED"
Nos outros sites q eu fiz sempre deu certo colocando o diretório somente a partir da pasta assets, mas agora não deu certo.
o que pode ser?
Answer: Supondo que a pasta assets exista dentro do seu tema, o caminho dela provavelmente é wp-content/themes/nomedotema/assets/. Como está, o PHP busca em /assets e não encontra nada.
Isso posto, você não está usando os métodos corretos para inserir scripts em um tema WordPress. Ao invés de colocar as tags no arquivo do template, use wp_enqueue_script(), assim:
No arquivo functions.php:
<?php
add_action( 'wp_enqueue_scripts', 'adiciona_scripts' );
function adiciona_scripts() {

    // jQuery já vem por padrão com o WP, então a chamada simples resolve,
    // você pode usar uma igual às outras abaixo se quiser mesmo buscar da CDN
    wp_enqueue_script( 'jquery' );

    // Scripts externos são chamados assim, veja o significado de cada atributo no link acima.
    wp_enqueue_script( 'popper', 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js', array('jquery'), false, true );
    wp_enqueue_script( 'efeitos', get_template_directory_uri() . '/assets/js/efeitos.js', array('jquery'), false, true );
}

No arquivo footer.php:
<?php wp_footer(); ?>