问:
MQTT Android Studio and Raspberry PI Broker
I'm learning MQTT and Android Studio.
I want to make a simple application in Android Studio but I'm fighting from 4 days and I can`t cope with it.

Application Description:
1 Button ---> Push ---> Send to mqtt topic / message ( "mqtt" / "test" )
That`s all.

```<code>Mqtt Broker = rpi (IP: namerpibrok.ddns.net )
</code>```

Broker works fine and it does not need a password or username

Problem is with Aplication - that is my first work with Android Studio.

I did everything as described on the page: https://www.hivemq.com/blog/mqtt-client-library-enyclopedia-paho-android-service

Now, when I push the button .... nothing happens.

```<code>    MqttAndroidClient client;

    private static final String TAG = "LOG";

    // Used to load the 'native-lib' library on application startup.
static {
    System.loadLibrary("native-lib");
}

    private Object bytes;

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

    String clientId = MqttClient.generateClientId();
    client = new MqttAndroidClient(this.getApplicationContext(), "rpidomwroled.ddns.net:1883", clientId);

        MqttConnectOptions options = new MqttConnectOptions();

    try {
        IMqttToken token = client.connect(options);
        token.setActionCallback(new IMqttActionListener() {
            @Override
            public void onSuccess(IMqttToken asyncActionToken) {
                // We are connected
                                    Toast.makeText(MainActivity.this,"Połączono", Toast.LENGTH_LONG).show();

            }

            @Override
            public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
                // Something went wrong e.g. connection timeout or firewall problems
                Toast.makeText(MainActivity.this,"Połączono", Toast.LENGTH_LONG).show();

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

    MqttAndroidClient client;

    private static final String TAG = "LOG";

    // Used to load the 'native-lib' library on application startup.
static {
    System.loadLibrary("native-lib");
}

    private Object bytes;

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

    String clientId = MqttClient.generateClientId();
    client = new MqttAndroidClient(this.getApplicationContext(), "rpidomwroled.ddns.net:1883", clientId);

        MqttConnectOptions options = new MqttConnectOptions();

    try {
        IMqttToken token = client.connect(options);
        token.setActionCallback(new IMqttActionListener() {
            @Override
            public void onSuccess(IMqttToken asyncActionToken) {
                // We are connected
                                    Toast.makeText(MainActivity.this,"Połączono", Toast.LENGTH_LONG).show();

            }

            @Override
            public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
                // Something went wrong e.g. connection timeout or firewall problems
                Toast.makeText(MainActivity.this,"Połączono", Toast.LENGTH_LONG).show();

            }
        });
    } catch (MqttException e) {
        e.printStackTrace();
    }
}
</code>```

public void pub(View v)
{
    String topic = "mqtt";
    String payload = "mqtt";
    byte[] encodedPayload = new byte[0];
    try {
        encodedPayload = payload.getBytes("UTF-8");
        MqttMessage message = new MqttMessage(encodedPayload);
        client.publish(topic, message);
    } catch (UnsupportedEncodingException | MqttException e) {
        e.printStackTrace();
    }
    }

    }```

Can anybody tell me what I'm doing wrong?

答:
This code is worked for me

```<code>String topic = "mqtt";
MqttMessage message = new MqttMessage();
message.setPayload("Message from IoT dev".getBytes());
client.publish(topic, message);
</code>```

you can get call backs in

```<code>client.setCallback(new IoTCallbacks() {
                @Override
                public void connectionLost(Throwable cause) {

                }

                @Override
                public void messageArrived(String topic, MqttMessage message) throws Exception {

                }

                @Override
                public void deliveryComplete(IMqttDeliveryToken token) {

                }
            });
</code>```

Body:
I'm learning MQTT and Android Studio.
I want to make a simple application in Android Studio but I'm fighting from 4 days and I can`t cope with it.

Application Description:
1 Button ---> Push ---> Send to mqtt topic / message ( "mqtt" / "test" )
That`s all.

Mqtt Broker = rpi (IP: namerpibrok.ddns.net )

Broker works fine and it does not need a password or username

Problem is with Aplication - that is my first work with Android Studio.

I did everything as described on the page: https://www.hivemq.com/blog/mqtt-client-library-enyclopedia-paho-android-service

Now, when I push the button .... nothing happens.

    MqttAndroidClient client;

    private static final String TAG = "LOG";

    // Used to load the 'native-lib' library on application startup.
static {
    System.loadLibrary("native-lib");
}

    private Object bytes;

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

    String clientId = MqttClient.generateClientId();
    client = new MqttAndroidClient(this.getApplicationContext(), "rpidomwroled.ddns.net:1883", clientId);

        MqttConnectOptions options = new MqttConnectOptions();

    try {
        IMqttToken token = client.connect(options);
        token.setActionCallback(new IMqttActionListener() {
            @Override
            public void onSuccess(IMqttToken asyncActionToken) {
                // We are connected
                                    Toast.makeText(MainActivity.this,"Połączono", Toast.LENGTH_LONG).show();

            }

            @Override
            public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
                // Something went wrong e.g. connection timeout or firewall problems
                Toast.makeText(MainActivity.this,"Połączono", Toast.LENGTH_LONG).show();

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

    MqttAndroidClient client;

    private static final String TAG = "LOG";

    // Used to load the 'native-lib' library on application startup.
static {
    System.loadLibrary("native-lib");
}

    private Object bytes;

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

    String clientId = MqttClient.generateClientId();
    client = new MqttAndroidClient(this.getApplicationContext(), "rpidomwroled.ddns.net:1883", clientId);

        MqttConnectOptions options = new MqttConnectOptions();

    try {
        IMqttToken token = client.connect(options);
        token.setActionCallback(new IMqttActionListener() {
            @Override
            public void onSuccess(IMqttToken asyncActionToken) {
                // We are connected
                                    Toast.makeText(MainActivity.this,"Połączono", Toast.LENGTH_LONG).show();

            }

            @Override
            public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
                // Something went wrong e.g. connection timeout or firewall problems
                Toast.makeText(MainActivity.this,"Połączono", Toast.LENGTH_LONG).show();

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

public void pub(View v)
{
    String topic = "mqtt";
    String payload = "mqtt";
    byte[] encodedPayload = new byte[0];
    try {
        encodedPayload = payload.getBytes("UTF-8");
        MqttMessage message = new MqttMessage(encodedPayload);
        client.publish(topic, message);
    } catch (UnsupportedEncodingException | MqttException e) {
        e.printStackTrace();
    }
    }

    }

Can anybody tell me what I'm doing wrong?

Body:
This code is worked for me

String topic = "mqtt";
MqttMessage message = new MqttMessage();
message.setPayload("Message from IoT dev".getBytes());
client.publish(topic, message);

you can get call backs in

client.setCallback(new IoTCallbacks() {
                @Override
                public void connectionLost(Throwable cause) {

                }

                @Override
                public void messageArrived(String topic, MqttMessage message) throws Exception {

                }

                @Override
                public void deliveryComplete(IMqttDeliveryToken token) {

                }
            });


来源: stackexchange

问:
Php : How to get localities based on ip address
I want to get localities based on IP address in Php.
I'm using geoplugin for based on IP, I got cities by using this

```<code>$ip_address = $_SERVER['REMOTE_ADDR'];
/*Get user ip address details with geoplugin.net*/
$geopluginURL='http://www.geoplugin.net /php.gp?ip='.$ip_address;
$addrDetailsArr =     unserialize(file_get_contents($geopluginURL));
/*Get City name by return array*/
$city = $addrDetailsArr['geoplugin_city'];

/*Get Country name by return array*/

$country = $addrDetailsArr['geoplugin_countryName'];
</code>```

Then, how to get locations of the city in selected field using this

答:
Feel free to use this IP-Api.
It is free. Data returned will give you the local and other details.</p>

ContentLicense: CC BY-SA 3.0

Body:
I want to get localities based on IP address in Php.
I'm using geoplugin for based on IP, I got cities by using this

$ip_address = $_SERVER['REMOTE_ADDR'];
/*Get user ip address details with geoplugin.net*/
$geopluginURL='http://www.geoplugin.net /php.gp?ip='.$ip_address;
$addrDetailsArr =     unserialize(file_get_contents($geopluginURL));
/*Get City name by return array*/
$city = $addrDetailsArr['geoplugin_city'];

/*Get Country name by return array*/

$country = $addrDetailsArr['geoplugin_countryName'];

Then, how to get locations of the city in selected field using this


问:
Why won't my function return largest even if numbers are negative
I need to create a function that returns the largest even number in a list. I created this but it doesn't work for negative numbers and I'm not sure why.</p>

```<code>def largest_even(list_int):
large = False
print(list_int)
for i in list_int:
    if i % 2 == 0:
        i = large
for i in list_int:
    if i % 2 == 0:
        if i > large:
            large = i
return large
</code>```

答:
Just one line is wrong. It should have been large = i. Rest of the code perfectly fine</p>

```<code>def largest_even(list_int):
    large = False
    print(list_int)
    for i in list_int:
        if i % 2 == 0:
            large = i
    for i in list_int:
        if i % 2 == 0:
            if i > large:
                large = i
    return large
</code>```

Body:
I need to create a function that returns the largest even number in a list. I created this but it doesn't work for negative numbers and I'm not sure why.

def largest_even(list_int):
large = False
print(list_int)
for i in list_int:
    if i % 2 == 0:
        i = large
for i in list_int:
    if i % 2 == 0:
        if i > large:
            large = i
return large

Body:
Just one line is wrong. It should have been large = i. Rest of the code perfectly fine

def largest_even(list_int):
    large = False
    print(list_int)
    for i in list_int:
        if i % 2 == 0:
            large = i
    for i in list_int:
        if i % 2 == 0:
            if i > large:
                large = i
    return large


问:
How to get the values of few input fields in java script and write them on web?
I would like to take all values from all input fields and write them on the web.

Here is my code:

var button = document.querySelector("button");
button.addEventListener("click", function() {

  var inputs = document.querySelectorAll("input").value;
  for (i = 0; i < inputs.length; i++) {
    inputs[i];
  }

  var output = document.getElementById("output");
  output.innerHTML = "To sa: " + inputs;
});```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div>
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
</div>

<button>Check</button>
<div id="output"></div></code>```

答:
The expression document.querySelectorAll("input").value; does not give you the joined values of all selected inputs.

Instead, you could append the values to a new variable inside the for loop, through something like:

```<code>inputsAppended += inputs[i].value;
</code>```

Finally, you can output it using:

```<code>output.innerHTML = "To sa: " + inputsAppended;
</code>```

var button = document.querySelector("button");
button.addEventListener("click", function() {
  var inputsAppended = "";
  var inputs = document.querySelectorAll("input");
  for (i = 0; i < inputs.length; i++) {
    inputsAppended += inputs[i].value;
  }

  var output = document.getElementById("output");
  output.innerHTML = "To sa: " + inputsAppended;
});```
<pre class="snippet-code-html lang-html prettyprint-override"><code><div>
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
</div>

<button>Check</button>
<div id="output"></div></code>```

Body:
I would like to take all values from all input fields and write them on the web.

Here is my code:

var button = document.querySelector("button");
button.addEventListener("click", function() {

  var inputs = document.querySelectorAll("input").value;
  for (i = 0; i < inputs.length; i++) {
    inputs[i];
  }

  var output = document.getElementById("output");
  output.innerHTML = "To sa: " + inputs;
});

  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">

<button>Check</button>

Body:
The expression document.querySelectorAll("input").value; does not give you the joined values of all selected inputs.

Instead, you could append the values to a new variable inside the for loop, through something like:

inputsAppended += inputs[i].value;

Finally, you can output it using:

output.innerHTML = "To sa: " + inputsAppended;

var button = document.querySelector("button");
button.addEventListener("click", function() {
  var inputsAppended = "";
  var inputs = document.querySelectorAll("input");
  for (i = 0; i < inputs.length; i++) {
    inputsAppended += inputs[i].value;
  }

  var output = document.getElementById("output");
  output.innerHTML = "To sa: " + inputsAppended;
});

<div>
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
  <input type="number" min="1" max="49">
</div>

<button>Check</button>
<div id="output"></div>


问:
Update Zero to One and One to Zero in SQL Server
I have a table with flag 0 and 1.

Please tell me how to update Zero to One and One to  Zero

```<code>DECLARE @a INT, @b INT

SELECT @a = number
FROM zerone
WHERE number = 0

SELECT @b = number
FROM zerone
WHERE number = 1

BEGIN
    IF @a = 0
        UPDATE zerone
        SET number = 1
        WHERE @a = 0
    ELSE IF @b = 1
        UPDATE zerone
        SET number = 0
        WHERE @b = 1
END
</code>```

This query is not working for me.

答:
use the below query to update 0 to 1 and 1 to 0

```<code>update zerone set number= 1-number
</code>```

Body:
I have a table with flag 0 and 1.

Please tell me how to update Zero to One and One to  Zero

DECLARE @a INT, @b INT

SELECT @a = number
FROM zerone
WHERE number = 0

SELECT @b = number
FROM zerone
WHERE number = 1

BEGIN
    IF @a = 0
        UPDATE zerone
        SET number = 1
        WHERE @a = 0
    ELSE IF @b = 1
        UPDATE zerone
        SET number = 0
        WHERE @b = 1
END

This query is not working for me.

Body:
use the below query to update 0 to 1 and 1 to 0

update zerone set number= 1-number


答:
Just this:</p>

```<code>UPDATE zerone
SET number = CASE WHEN number = 1 THEN 0 ELSE 1 END;
</code>```

Title: Update Zero to One and One to Zero in SQL Server

Body:
Just this:

UPDATE zerone
SET number = CASE WHEN number = 1 THEN 0 ELSE 1 END;


问:
Trying to convert MEL script to Python
I currently have a random object generator script for MEL. I'm trying to convert it to Python. This is a homework assignment and I'm stuck at a particular section. I'm trying to add a random scale to each axis. I keep getting "can only concatenate list (not "str") to list #". Here's what I have so far:

```<code>#to use: my_rock_gen(1, poly_rock1)

#import python libraries
import maya.cmds as MC
import random

#define procedure with number of rocks and name

def my_rock_gen(number_of_rocks=0, rock_name="poly_rock1"):

    #loop to generate rocks
    for n in range(number_of_rocks):

        #start with creating polygon object, basic cube
        rock=MC.polyCube (name=rock_name)

        #smooth it once
        MC.polySmooth (rock, dv=2)

        #give random scales
        random_sx= random.uniform (.3, 3)
        random_sy= random.uniform (.3, 3)
        random_sz= random.uniform (.3, 3)

        #set random values to scales
        MC.setAttr ((rock + ".scaleX"), random_sx)"
</code>```

I'm stuck at the last bit. In MEL here's what I have for the last 2 parts:

```<code>//set random scale range
float $random_sx = `rand .3 3`;
float $random_sy = `rand .3 3`;
float $random_sz = `rand .3 3`;

//set random values to scales
setAttr ($rock[0] + ".sx") $random_sx;
setAttr ($rock[0] + ".sx") $random_sy;
setAttr ($rock[0] + ".sx") $random_sz;
</code>```

The $rock[0] is created with the beginning part of the script. I just can't figure out how the syntax should go for the setAttr part. Thanks for any help offered.

答:
rock is a list, try

```<code>rock = [MC.setAttr((x),random_sx) for x in rock]
</code>```

to set the attr on the elements of the list (no maya here)

Title: Trying to convert MEL script to Python

Body:
I currently have a random object generator script for MEL. I'm trying to convert it to Python. This is a homework assignment and I'm stuck at a particular section. I'm trying to add a random scale to each axis. I keep getting "can only concatenate list (not "str") to list #". Here's what I have so far:

#to use: my_rock_gen(1, poly_rock1)

#import python libraries
import maya.cmds as MC
import random

#define procedure with number of rocks and name

def my_rock_gen(number_of_rocks=0, rock_name="poly_rock1"):

    #loop to generate rocks
    for n in range(number_of_rocks):

        #start with creating polygon object, basic cube
        rock=MC.polyCube (name=rock_name)

        #smooth it once
        MC.polySmooth (rock, dv=2)

        #give random scales
        random_sx= random.uniform (.3, 3)
        random_sy= random.uniform (.3, 3)
        random_sz= random.uniform (.3, 3)

        #set random values to scales
        MC.setAttr ((rock + ".scaleX"), random_sx)"

I'm stuck at the last bit. In MEL here's what I have for the last 2 parts:

//set random scale range
float $random_sx = `rand .3 3`;
float $random_sy = `rand .3 3`;
float $random_sz = `rand .3 3`;

//set random values to scales
setAttr ($rock[0] + ".sx") $random_sx;
setAttr ($rock[0] + ".sx") $random_sy;
setAttr ($rock[0] + ".sx") $random_sz;

The $rock[0] is created with the beginning part of the script. I just can't figure out how the syntax should go for the setAttr part. Thanks for any help offered.

Body:
rock is a list, try

rock = [MC.setAttr((x),random_sx) for x in rock]

to set the attr on the elements of the list (no maya here)


问:
Not all selected images are in $_FILES
This is a strange one. I have an upload function that uploads all selected images from the client's computer to the server. This is working, however, when selecting a large number of images it cuts off after 19 images. I tried uploading 71 images and every time I check the number of images in $_FILES it only contains 19. Has anyone had this issue before? See my code below:

HTML

```<code><input type="file" webkitdirectory mozdirectory msdirectory odirectory directory multiple class="" id="image_folder" name="image_folder[]" value=""  style="display: none;"/>
</code>```

PHP

```<code>//Upload book images
            if (count($_FILES['image_folder']['name']) > 0) {
                for($file = 0; $file < count($_FILES['image_folder']['name']); $file++) {
                    //Get the temp file path
                    $tmpFilePath = $_FILES['image_folder']['tmp_name'][$file];

                    //Make sure we have a filepath
                    if ($tmpFilePath != "") {

                        //save the filename
                        $shortname = $_FILES['image_folder']['name'][$file];

                        $directoryName = "../Authors/AUT".sprintf("%09d", $AUT_ID)."/Content/";

                        //Check if the directory already exists.
                        if (!is_dir($directoryName)) {
                            mkdir($directoryName, 0755, true);
                        }

                        //save the url and the file
                        $filePath = "../Authors/AUTH".sprintf("%09d", $AUTH_ID)."/Content/".$shortname;

                        //Upload the file into the dir
                        if (move_uploaded_file($tmpFilePath, $filePath)) {
                            //TODO:: Save path to database.

                        }
                    }
                }
            }
</code>```

So like I said, my code works and 19 images are uploaded out of the total 71. I have checked my Server's max execution time as well and amended it. However, it still makes no difference. Besides, I don't think it has something to do with that as the total count of Images in $_FILES are is only 19 instead of 71.

答:
Check your php.ini file
search for your

max_file_uploads=
  set your necessary value like 100 200 etc.

Title: Not all selected images are in $_FILES

Body:
This is a strange one. I have an upload function that uploads all selected images from the client's computer to the server. This is working, however, when selecting a large number of images it cuts off after 19 images. I tried uploading 71 images and every time I check the number of images in $_FILES it only contains 19. Has anyone had this issue before? See my code below:

HTML

<input type="file" webkitdirectory mozdirectory msdirectory odirectory directory multiple class="" id="image_folder" name="image_folder[]" value=""  style="display: none;"/>

PHP

//Upload book images
            if (count($_FILES['image_folder']['name']) > 0) {
                for($file = 0; $file < count($_FILES['image_folder']['name']); $file++) {
                    //Get the temp file path
                    $tmpFilePath = $_FILES['image_folder']['tmp_name'][$file];

                    //Make sure we have a filepath
                    if ($tmpFilePath != "") {

                        //save the filename
                        $shortname = $_FILES['image_folder']['name'][$file];

                        $directoryName = "../Authors/AUT".sprintf("%09d", $AUT_ID)."/Content/";

                        //Check if the directory already exists.
                        if (!is_dir($directoryName)) {
                            mkdir($directoryName, 0755, true);
                        }

                        //save the url and the file
                        $filePath = "../Authors/AUTH".sprintf("%09d", $AUTH_ID)."/Content/".$shortname;

                        //Upload the file into the dir
                        if (move_uploaded_file($tmpFilePath, $filePath)) {
                            //TODO:: Save path to database.

                        }
                    }
                }
            }

So like I said, my code works and 19 images are uploaded out of the total 71. I have checked my Server's max execution time as well and amended it. However, it still makes no difference. Besides, I don't think it has something to do with that as the total count of Images in $_FILES are is only 19 instead of 71.


问:
ArtifactDescriptorException: Failed to read artifact descriptor
I'm trying to do a simple app with Spring. I installed the plugin spring (Spring Tool Suite (STS)) for eclipse. I added Maven dependencies in the file pom.xml.im trying to add same Spring dependencies.
i have problem with:
Spring-tx,
Spring-orm,
Spring-beans,
and Spring-core

My problem is with :
spring-tx , spring-orm , spring-beans , spring-core when adding those dependencies, problems appear.

i tryed to add theme using the view Dependencies Add -> Select Dependency but i can not found Spring-tx and Spring-orm

pom.xml

```<code>    <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.sid</groupId>
    <artifactId>ebotique</artifactId>
    <name>EBotiqueV3</name>
    <packaging>war</packaging>
    <version>1.0.0-BUILD-SNAPSHOT</version>
    <properties>
        <java-version>1.6</java-version>
        <org.springframework-version>3.2.2.RELEASE</org.springframework-version>
        <org.aspectj-version>1.6.10</org.aspectj-version>
        <org.slf4j-version>1.6.6</org.slf4j-version>
    </properties>
    <dependencies>
        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${org.springframework-version}</version>
            <exclusions>
                <!-- Exclude Commons Logging in favor of SLF4j -->
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                 </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>

        <!-- AspectJ -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>${org.aspectj-version}</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${org.slf4j-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
            </exclusions>
            <scope>runtime</scope>
        </dependency>

        <!-- @Inject -->
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>

        <!-- Servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>

            <!-- Hibernate-->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Final</version>
</dependency>
<!-- MySQL Connector-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>

<!-- Spring -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-tx</artifactId>
    <version>>${org.springframework-version}</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>>${org.springframework-version}</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
    <version>>${org.springframework-version}</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>>${org.springframework-version}</version>
</dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <additionalProjectnatures>
                        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                    </additionalBuildcommands>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <mainClass>org.test.int1.Main</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
</code>```

i'm getting followed errors:

```<code>Description Resource    Path    Location    Type
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework:spring-beans:jar:>3.2.2.RELEASE: ArtifactResolutionException: Could not transfer artifact org.springframework:spring-beans:pom:>3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): C:\Users\MarwenBta\.m2\repository\org\springframework\spring-beans\>3.2.2.RELEASE\spring-beans->3.2.2.RELEASE.pom.ahc985459e75c4648d7 (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework:spring-orm:jar:>3.2.2.RELEASE: ArtifactResolutionException: Could not transfer artifact org.springframework:spring-orm:pom:>3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): C:\Users\MarwenBta\.m2\repository\org\springframework\spring-orm\>3.2.2.RELEASE\spring-orm->3.2.2.RELEASE.pom.ahcf3ba8e697e9b4549 (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-context:jar:3.2.2.RELEASE   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework:spring-core:jar:>3.2.2.RELEASE: ArtifactResolutionException: Could not transfer artifact org.springframework:spring-core:pom:>3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): C:\Users\MarwenBta\.m2\repository\org\springframework\spring-core\>3.2.2.RELEASE\spring-core->3.2.2.RELEASE.pom.ahc23be8a1b03fa4ea4 (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework:spring-tx:jar:>3.2.2.RELEASE: ArtifactResolutionException: Could not transfer artifact org.springframework:spring-tx:pom:>3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): C:\Users\MarwenBta\.m2\repository\org\springframework\spring-tx\>3.2.2.RELEASE\spring-tx->3.2.2.RELEASE.pom.ahca3575630da624133 (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-webmvc:jar:3.2.2.RELEASE    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-expression:jar:3.2.2.RELEASE    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.aspectj:aspectjrt:jar:1.6.10   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-web:jar:3.2.2.RELEASE   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact aopalliance:aopalliance:jar:1.0    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-aop:jar:3.2.2.RELEASE   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-core:jar:3.2.2.RELEASE  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-beans:jar:3.2.2.RELEASE pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.servlet:servlet-api:jar:2.5  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.inject:javax.inject:jar:1    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.servlet:jstl:jar:1.2 pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.servlet.jsp:jsp-api:jar:2.1  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.slf4j:jcl-over-slf4j:jar:1.6.6 pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.slf4j:slf4j-api:jar:1.6.6  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact log4j:log4j:jar:1.2.15 pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.slf4j:slf4j-log4j12:jar:1.6.6  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact dom4j:dom4j:jar:1.6.1  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact commons-collections:commons-collections:jar:3.1    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.transaction:jta:jar:1.1  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate:hibernate-entitymanager:jar:3.6.0.Final  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact junit:junit:jar:4.7    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact antlr:antlr:jar:2.7.6  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate:hibernate-core:jar:3.6.0.Final   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.validation:validation-api:jar:1.0.0.GA   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate:hibernate-validator:jar:4.1.0.Final  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact mysql:mysql-connector-java:jar:5.1.6   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact asm:asm:jar:3.1    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact cglib:cglib:jar:2.2    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javassist:javassist:jar:3.12.0.GA  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
</code>```

i have also problem applicationContext.xml

class="org.springframework.jdbc.datasource.DriverManagerDataSource"

class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager"

class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"

class="org.springframework.orm.jpa.JpaTransactionManager"

the problem: Attribute : class
The fully qualified name of the bean's class, except if it serves only as a parent definition for child bean
 definitions.

```<code><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">
<bean id="datasource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql://localhost:3306/eboutique"></property>
<property name="username" value="eboutique"></property>
<property name="password" value="user"></property>
</bean>
<bean id="persistenceUnitManager"
class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
<property name="defaultDataSource" ref="datasource"></property>
<property name="persistenceXmlLocations">
<list>
<value>classpath*:META-INF/persistence.xml</value>
</list>
</property>
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitManager" ref="persistenceUnitManager"></property>
<property name="persistenceUnitName" value="UP_EBOUTIQUE"></property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"></property>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
<context:annotation-config></context:annotation-config>
</beans>
</code>```

答:
Adding repositories in Pom.xml will solve the issue.</p>

```<code><repositories>
    <repository>
        <id>spring-releases</id>
        <name>Spring Releases</name>
        <url>https://repo.spring.io/libs-release</url>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>spring-releases</id>
        <name>Spring Releases</name>
        <url>https://repo.spring.io/libs-release</url>
    </pluginRepository>
</pluginRepositories>
</code>```

Body:
I'm trying to do a simple app with Spring. I installed the plugin spring (Spring Tool Suite (STS)) for eclipse. I added Maven dependencies in the file pom.xml.im trying to add same Spring dependencies.
i have problem with:
Spring-tx,
Spring-orm,
Spring-beans,
and Spring-core

My problem is with :
spring-tx , spring-orm , spring-beans , spring-core when adding those dependencies, problems appear.

i tryed to add theme using the view Dependencies Add -> Select Dependency but i can not found Spring-tx and Spring-orm

pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.sid</groupId>
    <artifactId>ebotique</artifactId>
    <name>EBotiqueV3</name>
    <packaging>war</packaging>
    <version>1.0.0-BUILD-SNAPSHOT</version>
    <properties>
        <java-version>1.6</java-version>
        <org.springframework-version>3.2.2.RELEASE</org.springframework-version>
        <org.aspectj-version>1.6.10</org.aspectj-version>
        <org.slf4j-version>1.6.6</org.slf4j-version>
    </properties>
    <dependencies>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${org.springframework-version}</version>
            <exclusions>

                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                 </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>${org.aspectj-version}</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${org.slf4j-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
            </exclusions>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>3.6.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Final</version>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-tx</artifactId>
    <version>>${org.springframework-version}</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
    <version>>${org.springframework-version}</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
    <version>>${org.springframework-version}</version>
    </dependency>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>>${org.springframework-version}</version>
</dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <additionalProjectnatures>
                        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                    </additionalBuildcommands>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <mainClass>org.test.int1.Main</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

i'm getting followed errors:

Description Resource    Path    Location    Type
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework:spring-beans:jar:>3.2.2.RELEASE: ArtifactResolutionException: Could not transfer artifact org.springframework:spring-beans:pom:>3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): C:\Users\MarwenBta\.m2\repository\org\springframework\spring-beans\>3.2.2.RELEASE\spring-beans->3.2.2.RELEASE.pom.ahc985459e75c4648d7 (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework:spring-orm:jar:>3.2.2.RELEASE: ArtifactResolutionException: Could not transfer artifact org.springframework:spring-orm:pom:>3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): C:\Users\MarwenBta\.m2\repository\org\springframework\spring-orm\>3.2.2.RELEASE\spring-orm->3.2.2.RELEASE.pom.ahcf3ba8e697e9b4549 (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-context:jar:3.2.2.RELEASE   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework:spring-core:jar:>3.2.2.RELEASE: ArtifactResolutionException: Could not transfer artifact org.springframework:spring-core:pom:>3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): C:\Users\MarwenBta\.m2\repository\org\springframework\spring-core\>3.2.2.RELEASE\spring-core->3.2.2.RELEASE.pom.ahc23be8a1b03fa4ea4 (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
ArtifactDescriptorException: Failed to read artifact descriptor for org.springframework:spring-tx:jar:>3.2.2.RELEASE: ArtifactResolutionException: Could not transfer artifact org.springframework:spring-tx:pom:>3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): C:\Users\MarwenBta\.m2\repository\org\springframework\spring-tx\>3.2.2.RELEASE\spring-tx->3.2.2.RELEASE.pom.ahca3575630da624133 (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte)    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-webmvc:jar:3.2.2.RELEASE    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-expression:jar:3.2.2.RELEASE    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.aspectj:aspectjrt:jar:1.6.10   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-web:jar:3.2.2.RELEASE   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact aopalliance:aopalliance:jar:1.0    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-aop:jar:3.2.2.RELEASE   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-core:jar:3.2.2.RELEASE  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.springframework:spring-beans:jar:3.2.2.RELEASE pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.servlet:servlet-api:jar:2.5  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.inject:javax.inject:jar:1    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.servlet:jstl:jar:1.2 pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.servlet.jsp:jsp-api:jar:2.1  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.slf4j:jcl-over-slf4j:jar:1.6.6 pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.slf4j:slf4j-api:jar:1.6.6  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact log4j:log4j:jar:1.2.15 pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.slf4j:slf4j-log4j12:jar:1.6.6  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact dom4j:dom4j:jar:1.6.1  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact commons-collections:commons-collections:jar:3.1    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.transaction:jta:jar:1.1  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate:hibernate-commons-annotations:jar:3.2.0.Final    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate:hibernate-entitymanager:jar:3.6.0.Final  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact junit:junit:jar:4.7    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact antlr:antlr:jar:2.7.6  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate:hibernate-core:jar:3.6.0.Final   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javax.validation:validation-api:jar:1.0.0.GA   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate:hibernate-validator:jar:4.1.0.Final  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact mysql:mysql-connector-java:jar:5.1.6   pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact asm:asm:jar:3.1    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact cglib:cglib:jar:2.2    pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.0.Final  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem
Missing artifact javassist:javassist:jar:3.12.0.GA  pom.xml /EBotiqueV3 line 1  Maven Dependency Problem

i have also problem applicationContext.xml

class="org.springframework.jdbc.datasource.DriverManagerDataSource"

class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager"

class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"

class="org.springframework.orm.jpa.JpaTransactionManager"

the problem: Attribute : class
The fully qualified name of the bean's class, except if it serves only as a parent definition for child bean
 definitions.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">
<bean id="datasource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url" value="jdbc:mysql://localhost:3306/eboutique"></property>
<property name="username" value="eboutique"></property>
<property name="password" value="user"></property>
</bean>
<bean id="persistenceUnitManager"
class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
<property name="defaultDataSource" ref="datasource"></property>
<property name="persistenceXmlLocations">
<list>
<value>classpath*:META-INF/persistence.xml</value>
</list>
</property>
</bean>
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitManager" ref="persistenceUnitManager"></property>
<property name="persistenceUnitName" value="UP_EBOUTIQUE"></property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"></property>
</bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
<context:annotation-config></context:annotation-config>
</beans>

Body:
Adding repositories in Pom.xml will solve the issue.

<repositories>
    <repository>
        <id>spring-releases</id>
        <name>Spring Releases</name>
        <url>https://repo.spring.io/libs-release</url>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>spring-releases</id>
        <name>Spring Releases</name>
        <url>https://repo.spring.io/libs-release</url>
    </pluginRepository>
</pluginRepositories>


问:
Expandable Tableview with last row of every section has Add Button - Swift
I struck in tableview. I need tableview of collapse and Expand looks like Below,

]2

I need to add 2 buttons for last row of every section.
Could you guide me how to design the below design in ios swift?

答: You can create a cell with two buttons. Next you should add it to your data source and configure it properly. Then add a delegate to your custom UITableViewCell and handle taps.


问:
Didnt return a response - Duplicate django users
I have a django project. I have integrated djangos signup and login system into my application. I have a method for creating a user and logging them into the current session. I notices that when I try to create a record for a users with an existing username in the database, instead of giving a unique constraint fail or redirecting to another page, it just throws the following error:

```<code>ValueError at /signup/
The view users.views.user_signup didn't return an HttpResponse object. It returned None instead.
Request Method: POST
Request URL:    http://127.0.0.1:8000/signup/
Django Version: 1.11.5
Exception Type: ValueError
Exception Value:
The view users.views.user_signup didn't return an HttpResponse object. It returned None instead.
Exception Location: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py in _get_response, line 198
Python Executable:  /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Python Version: 3.6.2
Python Path:
['/Users/omarjandali/Desktop/split/split',
 '/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip',
 '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6',
 '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload',
 '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages']
</code>```

Now I am using printing and logging to see where this issue is occuring and there is nothing printing. I feel like the form is not going to the method it was called from... I have no idea what is going on with this. Can anyone help...

process =
if form not submitted -> display from
fill out for -> grab info from form -> grab useranem and see if there is already a account with this username or email -> if no account -> create and save user object -> login the user to session ===> if account -> redirect to the test page... Here is my code:

```<code>def user_signup(request):
    if request.method == "POST":
        form = SignupForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            username = cd['username']
            password = cd['password']
            verify = cd['verify']
            email = cd['email']
            valid_user = User.objects.filter(username = username).first()
            if valid_user == None:
                if password == verify:
                    secure_password = make_password(password)
                    user = User.objects.create(
                        username = username,
                        password = secure_password,
                        email = email,
                    )
                    login(request, user)
                    return redirect('test')
                else:
                    form = SignupForm()
                    parameters = {
                        'form':form,
                    }
                    return render(request, 'users/signup.html', parameters)
            else:
                return redirect('test')
    else:
        form = SignupForm()
        parameters = {
            'form':form
        }
        return render(request, 'users/signup.html', parameters)
</code>```

the form shows up and I can fill it out but the second i submit the form, everything goes wrong.... The form exists in my forms.py file. I have no idea why it is telling me there is no http response when there is.

I have a retruned validation error within the form and I want to grab the message from the error response.

the response is a json repsonse below:

```<code>{"username":
  [
    {
     "message": "A user with that username already exists.",
     "code": "unique"
     }
   ]
}
</code>```

I want to grab just the message. I have the following code to grab the message... it is not working...

```<code>error_json['username'][0]['message']
</code>```

the error message:

```<code>string indices must be integers
</code>```

答: You haven't processed case when form.is_valid() returns False. In such case your view returns None.

Body:
I have a django project. I have integrated djangos signup and login system into my application. I have a method for creating a user and logging them into the current session. I notices that when I try to create a record for a users with an existing username in the database, instead of giving a unique constraint fail or redirecting to another page, it just throws the following error:

ValueError at /signup/
The view users.views.user_signup didn't return an HttpResponse object. It returned None instead.
Request Method: POST
Request URL:    http://127.0.0.1:8000/signup/
Django Version: 1.11.5
Exception Type: ValueError
Exception Value:
The view users.views.user_signup didn't return an HttpResponse object. It returned None instead.
Exception Location: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/django/core/handlers/base.py in _get_response, line 198
Python Executable:  /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
Python Version: 3.6.2
Python Path:
['/Users/omarjandali/Desktop/split/split',
 '/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip',
 '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6',
 '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload',
 '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages']

Now I am using printing and logging to see where this issue is occuring and there is nothing printing. I feel like the form is not going to the method it was called from... I have no idea what is going on with this. Can anyone help...

process =
if form not submitted -> display from
fill out for -> grab info from form -> grab useranem and see if there is already a account with this username or email -> if no account -> create and save user object -> login the user to session ===> if account -> redirect to the test page... Here is my code:

def user_signup(request):
    if request.method == "POST":
        form = SignupForm(request.POST)
        if form.is_valid():
            cd = form.cleaned_data
            username = cd['username']
            password = cd['password']
            verify = cd['verify']
            email = cd['email']
            valid_user = User.objects.filter(username = username).first()
            if valid_user == None:
                if password == verify:
                    secure_password = make_password(password)
                    user = User.objects.create(
                        username = username,
                        password = secure_password,
                        email = email,
                    )
                    login(request, user)
                    return redirect('test')
                else:
                    form = SignupForm()
                    parameters = {
                        'form':form,
                    }
                    return render(request, 'users/signup.html', parameters)
            else:
                return redirect('test')
    else:
        form = SignupForm()
        parameters = {
            'form':form
        }
        return render(request, 'users/signup.html', parameters)

the form shows up and I can fill it out but the second i submit the form, everything goes wrong.... The form exists in my forms.py file. I have no idea why it is telling me there is no http response when there is.

I have a retruned validation error within the form and I want to grab the message from the error response.

the response is a json repsonse below:

{"username":
  [
    {
     "message": "A user with that username already exists.",
     "code": "unique"
     }
   ]
}

I want to grab just the message. I have the following code to grab the message... it is not working...

error_json['username'][0]['message']

the error message:

string indices must be integers


问:
notification on data waiting to be read on serial link
I try to add to my g_main_loop a new source that is a file descriptor on a serial line peripheric.

I try this code :

```<code>GError* error;
GIOChannel* channel;
channel=g_io_channel_unix_new(fd_serial_line_dev);
g_io_add_watch(channel, G_IO_IN, cb_1, NULL);
g_io_channel_set_close_on_unref(channel, TRUE);
g_io_channel_set_encoding(channel, NULL, &error);
g_io_channel_set_buffered(channel, FALSE);
</code>```

The callback is :

```<code>gboolean cb_1 (GIOChannel *source, GIOCondition condition, gpointer data)
{
  gchar** line=NULL;
  GIOStatus status;
  GError* error;

  printf("cb\n");

  status=g_io_channel_read_line(source, line, NULL, NULL, &error);

  if(G_IO_STATUS_NORMAL == status)
  {
    printf("callback : data : %s\n", *line);
    g_free(*line);
    //g_io_channel_seek_position(source, 0, G_SEEK_CUR, NULL);
  }

  return TRUE;
}
</code>```

When I send data on the serial line, I obtain an infinite loop that call cb_1 each time.

I don't see where is my mistake, I expected that a read within file descriptor of the serial line will be suffisant to stop call to the callback during the next g main loop iteration...

答:
On Linux, GLib g_io_add_watch method adds your file descriptor to poll(). poll on /dev files is not same as sockets descriptors or normal files. Check struct fops structure in your driver to know whether poll operation is supported by your driver or not. Usually they do support unless you are using some custom driver. Also cross check your code with any other /dev file.

Check whether the status returned from g_io_channel_read_line in the callback is G_IO_STATUS_AGAIN which mean resource is temporarily unavailable; so, a event happened on your file descriptor but there is no immediate data available to read from the driver buffers.

Body:
I try to add to my g_main_loop a new source that is a file descriptor on a serial line peripheric.

I try this code :

GError* error;
GIOChannel* channel;
channel=g_io_channel_unix_new(fd_serial_line_dev);
g_io_add_watch(channel, G_IO_IN, cb_1, NULL);
g_io_channel_set_close_on_unref(channel, TRUE);
g_io_channel_set_encoding(channel, NULL, &error);
g_io_channel_set_buffered(channel, FALSE);

The callback is :

gboolean cb_1 (GIOChannel *source, GIOCondition condition, gpointer data)
{
  gchar** line=NULL;
  GIOStatus status;
  GError* error;

  printf("cb\n");

  status=g_io_channel_read_line(source, line, NULL, NULL, &error);

  if(G_IO_STATUS_NORMAL == status)
  {
    printf("callback : data : %s\n", *line);
    g_free(*line);
    //g_io_channel_seek_position(source, 0, G_SEEK_CUR, NULL);
  }

  return TRUE;
}

When I send data on the serial line, I obtain an infinite loop that call cb_1 each time.

I don't see where is my mistake, I expected that a read within file descriptor of the serial line will be suffisant to stop call to the callback during the next g main loop iteration...


问:
remove characters before and after character in java
I need to delete all characters before and after a specific character using java programming
for example:

input: ab*cd output:ad

input: ab**cd output:ad

```<code>import java.util.Scanner;

public class Starstring {
    public static void main(String[] args) {
        String str1;
        String res="";
        int n,i=0;

        Scanner sc=new Scanner(System.in);
        System.out.println("Enter the string");
        str1=sc.next();
        res=str1;
        StringBuffer a = new StringBuffer(str1);
        n=str1.length()-1;
        for(i=0;i<n;i++)
        {
            if(str1.charAt(i)=='*')
            {
                res=a.delete(i-1, i+2).toString();
            }
        }
        System.out.println("The final string is"+res);
    }

}
</code>```

I am getting expected output for case 1 but case 2 wrong output with ac as output.I don't know where I am going wrong.Someone please help me.Thanks in advance:)

答: what if input is : *abc* or ab*c*de</p>

Body:
I need to delete all characters before and after a specific character using java programming
for example:

input: ab*cd output:ad

input: ab**cd output:ad

import java.util.Scanner;

public class Starstring {
    public static void main(String[] args) {
        String str1;
        String res="";
        int n,i=0;

        Scanner sc=new Scanner(System.in);
        System.out.println("Enter the string");
        str1=sc.next();
        res=str1;
        StringBuffer a = new StringBuffer(str1);
        n=str1.length()-1;
        for(i=0;i<n;i++)
        {
            if(str1.charAt(i)=='*')
            {
                res=a.delete(i-1, i+2).toString();
            }
        }
        System.out.println("The final string is"+res);
    }

}

I am getting expected output for case 1 but case 2 wrong output with ac as output.I don't know where I am going wrong.Someone please help me.Thanks in advance:)

Body: what if input is : *abc* or ab*c*de