Maven does not download files (any files!) i see lastupdated files in repo, deleting which doesn’t –

i can browse internet through browser within eclipse (tried both oxygen and mars) so it should not be proxy issue?. What am i missing. Please help.
Also, hardcoded the repo path (even though last updated files were being created in the repo , so again probably this anyway wasn’t an issue)

thanks a bunch!
downloaded eclipse plugin jars and poms manually hoping it would let it download the rest but- i give up now. need to fix this

also if it makes a difference this is a new machine(at work)

Is there a way to create a Surround sound by using C#

Is there a way to create a Surround Sound by a MP4 file.
So i have a MP3 file and i want to send the different Channels (Surround Channels for example left,right or angles like 40° 90°) to different Audio Outputs.
I already tried to googled it but i found nothing i want or i didn’t understood it.

Best would be in C# or Java.
Can someone help me or show me a helpful tutorial ? 🙂

Surround Sound Example

How do I remove image promotion scaling in Android Studio

I want my image to increase in height and width when the constraints expand, but I don’t want them to do so proportionally. If only the height constraint expand, then only the image height should change (I’m trying to do a graphic background that expand with text size).

I have looked at the different xml options, eg. android:scaleType=”centerInside”, etc, but none seem to work the way I want. Any ideas?

Converting date and time strings to date variable

I am working on an Android app.

I get a date String and a time string from a JSON file.

fecha_reporte = "2017-12-17" 

hora_reporte = "23:51:00"

I need to convert both strings into a date variable, then later I will need to make some calculations with it.

This is what I have so far:

String fecha = fecha_reporte + " " + hora_reporte;

SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd H:m:s");
String dateInString = fecha;

try {

    Date date2 = formatter.parse(dateInString);
    Log.d("DURACION","DURACION REPORTE: calculado: "+date2);

} catch (ParseException e) {

The output is a date, but with this format:

Sun Dec 17 23:51:00 GMT-07:00 2017

I need it with following format: 2017-12-17 23:51:00

Is String a class or data type or both?

When we use String X=”apple”;
Now is X variable or object?
As we can use X.Method hence it should be object only but to define an object we should use:
String X= new String ();
But we did like String X = “apple”;
So how come X is an object or even if it is variable then how can we use variable.method?

game obstacle collision, non-rectangular

I’m working on a small android project; it’s a small obstacle evasion game where a rocket has to evade the obstacles which keep falling down from the start of the screen, and I’m facing a bit of trouble with the obstacle collision.. I wrote a basic code which detects whether the rectangle of my rocket image intersects the rectangle of my obstacle object… and the code is here… where in the code myplayer is my rocket object and obstacle is the obstacle object

 boolean isGameOver2() {
    //for obstacle 2
    //Log.e("first condition met", "2");
    if (obstacle2.obstacleL.getVisibility() == View.VISIBLE) {
        if ((((obstacle2.obstacleL.getY()) + (obstacle2.obstacleL.getHeight())) >= myPlayer.getPlayerY())) {
            //Log.e("Player: y " + (int) myPlayer.getPlayerY(), "Obstacle: y" + ((obstacle1.obstacleL.getY()) + (obstacle1.obstacleL.getHeight())));

            if (((myPlayer.getPlayerY() + (0.86 * myPlayer.getPlayer().getHeight()) < obstacle2.obstacleL.getY()))) {
                return true;

            if ((myPlayer.getPlayerX() + (myPlayer.getPlayer().getWidth() / 2))
                    <= (obstacle2.obstacleL.getX() + obstacle2.obstacleL.getWidth())) {
                return false;
            } else if ((myPlayer.getPlayerX() + (myPlayer.getPlayer().getWidth() / 2))
                    >= (obstacle2.obstacleR.getX())) {
                return false;

    return true;

but the thing is my rocket isn’t rectangular, this is an image of it

and this is an image of my obstacle

I’m comparing x coordinates of the rocket to those of the obstacle… however, since the image is rectangular I don’t know how to compare the actual coordinates of the rocket rather than the black empty space which is part of the rocket image but not really part of the rocket….

any insights would be very helpful

How to simplify this binary-to-java-type code?

I get two java bytes as input that together symbolizes a 16-bit signed integer. I need to convert it to one single java integer (signed, of course). I have come up with a “ugly” solution, that includes converting to an int, then to a short and then back to an int. Is there a shorter and more elegant way?
My code is as following:

public int convert(byte b1, byte b2){
    int i1 = (int) (((b2 << 8) + (b1 & 0xFF)) & 0x0000FFFF);
    short s1 = (short) i1;
    int i2 = (int) s1;
    return i2;

save the changes from JSP table into the database

I have a table which displays the content of a database.
I want to save the changes edited in the table to my database.
The problem is no matter what row I edit, each time when I try to save, it takes as parameters the values from the first row.


<FORM NAME="form1" METHOD="POST" action="update.jsp">
<% ResultSet rs=statement.executeQuery(query);
<td style="display:none;"><input type="text" name="id" value="
<%=rs.getInt("ID") %>"></td>
<td><input type="text" name="val1" value="<%=rs.getString("Value1") %>"></td>
<td><input type="text" name="val2" value="<%=rs.getString("Value2") %>"></td>
<td><input type="submit" name="Submit" value="Save"></td>
<% } %>


<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import="java.sql.*,*,java.util.*,dbcon.SQLConnection" %>
<%String idRez=request.getParameter("id");
String v1=request.getParameter("val1");
String v2=request.getParameter("val2");
SQLConnection.updateDatabase(idRez,Double.parseDouble(v1), Double.parseDouble(v2));

How to stop properly FusedLocationProviderClient?

I use FusedLocationProviderClient within a Service.
I would like to “stop” it in a right way.

Is it good to use following code?

    public void onDestroy() {
        // Stop Looper of FusedLocationProviderClient  
        if (locationClient != null) {
            locationClient = null;

And the rest code

FusedLocationProviderClient locationClient;

protected void startLocationUpdates() {

        // Create the location request to start receiving updates
        mLocationRequest = new LocationRequest();

        // Create LocationSettingsRequest object using location request
        LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();
        LocationSettingsRequest locationSettingsRequest =;

        // Check whether location settings are satisfied
        SettingsClient settingsClient = LocationServices.getSettingsClient(this);

        // new Google API SDK v11 uses getFusedLocationProviderClient(this)
        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {


        locationClient = getFusedLocationProviderClient(this);getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {
                    public void onLocationResult(LocationResult locationResult) {
                        // do work here
                }, Looper.myLooper());