{"QuestionId": 25833537, "AnswerCount": 0, "Tags": "", "CreationDate": "2014-09-14T13:02:26.837", "AcceptedAnswerId": null, "Title": "Edit Composed key in AspNetUserRoles Table", "Body": "

I am using MCV5 with ASP Identity and made some modification in table AspNetUserRole:

\n\n
public class AspNetUserRole : IdentityUserRole\n{\n    [key]\n    public string Id { get; set; }\n}\n
\n\n

because I need to add Id key column and integrate it to composite key (UserId and RoleId) to become like that (UserId,RoleId and Id)

\n\n

Code for onModelCreating:

\n\n
protected override void OnModelCreating(System.Data.Entity.DbModelBuilder modelBuilder)\n{\n    modelBuilder.Entity<AspNetUserRole>().HasKey(r => new { r.Id , r.RoleId, r.UserId});\n         base.OnModelCreating(modelBuilder);\n}\n
\n\n

but I have Id as a normal string column in database without any primary key constrains

\n", "Lable": "No"} {"QuestionId": 25919847, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-09-18T18:28:28.663", "AcceptedAnswerId": "25919956", "Title": "Why does image constructed by createObjectURL have 0 width?", "Body": "

This is my code which is supposed to load an image from a form file input and resize it if it is too large. The problem is that when I create a new image object and set its src, its width equals to zero. However when I put the image into html it display correctly.

\n\n
var image = document.createElement('img');\nvar image_url = window.URL.createObjectURL(image_data);\nimage.src = image_url;\nconsole.log('Width: ' + image.width);\n
\n\n

-> Width: 0

\n", "Lable": "No"} {"QuestionId": 25995600, "AnswerCount": 0, "Tags": "", "CreationDate": "2014-09-23T12:51:48.690", "AcceptedAnswerId": null, "Title": "priorize visible content php html", "Body": "

I have a site called www.anetoi.com and I want to prioritize visible content. PageSpeed Insights says:

\n\n
\n

Your page requires additional network round trips to render the above-the-fold content. For best performance, reduce the amount of HTML needed to render above-the-fold content.\n The entire HTML response was not sufficient to render the above-the-fold content. This usually indicates that additional resources, loaded after HTML parsing, were required to render above-the-fold content. Prioritize visible content that is needed for rendering above-the-fold by including it directly in the HTML response.\n Only about 66% of the final above-the-fold content could be rendered with the full HTML response.

\n
\n\n

In my home page I am adding all the HTML in a single variable and I echo this variable in order to print all my HTML at once. I also have slide bars that I added at the end of each HTML in order to show the visible content.

\n\n

The problem is still there and I can't find what's wrong. I am really stuck with this.

\n\n

Please help, thanks in advance.

\n", "Lable": "No"} {"QuestionId": 26110931, "AnswerCount": 2, "Tags": "", "CreationDate": "2014-09-30T00:30:58.523", "AcceptedAnswerId": "26111054", "Title": "JOptionPane in if statements", "Body": "

For my assignment I am using JOptionPane to ask the user to enter 3 sides of a triangle. The program is then suppose to use JOptionPane to tell them the type of triangle (equilateral, right, acute, obtuse, and isosceles but isosceles triangles are also either right, obtuse or acute) it is and to calculate the area.

\n\n

When it is equilateral it comes back telling me that it is equilateral but it also tells me it is isosceles 3 times. Even though I only have the isosceles JOptionPane with the other types of triangles.

\n\n

My other problem is that when it is right, acute, or obtuse it skips the JOptionPane telling me what type it is and just tells me it is isosceles.

\n\n
package assignment.ii;\nimport javax.swing.JOptionPane;\nimport java.lang.*;\npublic class AssignmentII\n\n    {\n\npublic static void main(String[] args) {\n\n    int a = Integer.parseInt(JOptionPane.showInputDialog(null, \"Please enter a side of the triangle \"));\n    int b = Integer.parseInt(JOptionPane.showInputDialog(null, \"Please enter a side of the triangle \"));\n    int c = Integer.parseInt(JOptionPane.showInputDialog(null, \"Please enter a side of the triangle \"));\n    double s = (.5*(a+b+c));\n\n    if(a==b){\n            if (b==c)\n                JOptionPane.showMessageDialog(null, \"The triangle is a equilateral triangle\");\n\n    }else if (((a*a)+(b*b)) == (c*c)) { \n                JOptionPane.showMessageDialog(null, \"The triangle is a right triangle\");\n                if (a==b)\n                JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");    \n                if (b==c)\n                JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");    \n                if (a==c)\n                JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");\n\n    }else if (((a*a)+(b*b))<(c*c)){    \n                JOptionPane.showMessageDialog(null, \"The triangle is an obtuse triangle\");\n                if (a==b)\n                JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");    \n                if (b==c)\n                JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");    \n                if (a==c)\n                JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");\n\n    }else if (((a*a)+(b*b))>(c*c))             \n                JOptionPane.showMessageDialog(null, \"The triangle is an acute triangle\");\n                if (a==b)\n                JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");    \n                if (b==c)\n                JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");    \n                if (a==c)\n                JOptionPane.showMessageDialog(null, \"The triangle is a Isosceles triangle\");\n    double d;\n    d = ((s)*(s - a)*(s - b)*(s - c));\n\n    JOptionPane.showMessageDialog(null, \"The area of the triangle is: \" + Math.sqrt(d));\n\n\n     } \n     }\n
\n", "Lable": "No"} {"QuestionId": 26260848, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-10-08T15:34:28.363", "AcceptedAnswerId": null, "Title": "Numpy fast check for complete array equality, like Matlabs isequal", "Body": "

In Matlab, the builtin isequal does a check if two arrays are equal. If they are not equal, this might be very fast, as the implementation presumably stops checking as soon as there is a difference:

\n\n
>> A = zeros(1e9, 1, 'single');    \n>> B = A(:);                     \n>> B(1) = 1;\n>> tic; isequal(A, B); toc;\nElapsed time is 0.000043 seconds.\n
\n\n

Is there any equavalent in Python/numpy? all(A==B) or all(equal(A, B)) is far slower, because it compares all elements, even if the initial one differs:

\n\n
In [13]: A = zeros(1e9, dtype='float32')                                                                                                                                                           \n\nIn [14]: B = A.copy()\n\nIn [15]: B[0] = 1\n\nIn [16]: %timeit all(A==B)\n1 loops, best of 3: 612 ms per loop\n
\n\n

Is there any numpy equivalent? It should be very easy to implement in C, but slow to implement in Python because this is a case where we do not want to broadcast, so it would require an explicit loop.

\n\n

Edit:

\n\n

It appears array_equal does what I want. However, it is not faster than all(A==B), because it's not a built-in, but just a short Python function doing A==B. So it does not meet my need for a fast check.

\n\n
In [12]: %timeit array_equal(A, B)\n1 loops, best of 3: 623 ms per loop\n
\n", "Lable": "No"} {"QuestionId": 26352325, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-10-14T03:47:47.470", "AcceptedAnswerId": "26352579", "Title": "why doesn't TextNode have update value(set) method?", "Body": "

I want to modify the value of a TextNode using jackson.
\nBut there is no such method in the API.
\nThen I try to use reflection to overcome the limitation:

\n\n
public class TestModify {\n\n    public static void main(final String[] args) throws JsonProcessingException, IOException,\n            NoSuchFieldException, SecurityException, IllegalArgumentException,\n            IllegalAccessException {\n        final String json = \"[{},\\\"123123\\\",\\\"12456\\\"]\";\n        final ObjectMapper mapper = new ObjectMapper();\n        final JsonNode node = mapper.readTree(json);\n        final Iterator<JsonNode> nodes = node.elements();\n        while (nodes.hasNext()) {\n            final JsonNode n = nodes.next();\n            if (n instanceof TextNode) {\n                final Field f = TextNode.class.getDeclaredField(\"_value\");\n                f.setAccessible(true);\n                f.set(n, \"updated\");\n            }\n            System.out.println(n.getClass());\n        }\n        System.out.println(node);\n    }\n}  \n
\n\n

The code seems to work fine and println shows:

\n\n
class com.fasterxml.jackson.databind.node.ObjectNode\nclass com.fasterxml.jackson.databind.node.TextNode\nclass com.fasterxml.jackson.databind.node.TextNode\n[{},\"updated\",\"updated\"]   \n
\n\n

So why is there no update method in the original API?

\n", "Lable": "No"} {"QuestionId": 26380505, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-10-15T10:40:45.863", "AcceptedAnswerId": null, "Title": "How can I quickly detect 504 Gateway Timeout error with libcurl?", "Body": "

We have some running AWS EC2 servers, our clients use libcurl to send HTTP request (POST) to those server with their public DNS, the servers might be shutdown without notifying clients, then our clients need almost 50 seconds to finish a request and then get 504 error, does anybody know if there is a way to reduce this time to a few seconds?

\n", "Lable": "No"} {"QuestionId": 26399364, "AnswerCount": 2, "Tags": "", "CreationDate": "2014-10-16T08:14:24.597", "AcceptedAnswerId": "26399439", "Title": "html email not showing as in browser", "Body": "

I am trying to create an html email, it shows fine in the browser (uses base64 images as well) but in outlook, it changes the layout as it completely omits certain blocks of text and the images display as grey? And then in gmail it shows as basic un-styled html?

\n\n

Browser:

\n\n

\"browser\"

\n\n

Outlook:

\n\n

\"outlook\"

\n\n

Gmail:

\n\n

\"gmail\"

\n\n

Any ideas on how I can fix this?

\n", "Lable": "No"} {"QuestionId": 26427623, "AnswerCount": 2, "Tags": "", "CreationDate": "2014-10-17T14:49:23.673", "AcceptedAnswerId": "26428076", "Title": "Using MATLAB with OS X 10", "Body": "

I just upgraded to OS X 10 Yosemite but cannot launch MATLAB.

\n\n

I've tried opening it through terminal with:

\n\n
/Applications/MATLAB_R2014a.app/bin/matlab\n
\n\n

However this doesn't work either. Any ideas?

\n\n

EDIT: I have found an answer to my question!

\n", "Lable": "No"} {"QuestionId": 26492239, "AnswerCount": 0, "Tags": "", "CreationDate": "2014-10-21T17:02:27.880", "AcceptedAnswerId": null, "Title": "AbstractMethodError from slf4j in Spring Project", "Body": "

I have a Spring application with Hibernate as persistency layer. For logging I'am using slf4j with log4j as binding.

\n\n

My pom.xml looks like this.

\n\n
<properties>\n    <spring.version>3.2.0.RELEASE</spring.version>\n    <hibernate.version>4.1.0.Final</hibernate.version>\n</properties>\n\n<dependencies>\n    <dependency>\n        <groupId>org.springframework</groupId>\n        <artifactId>spring-core</artifactId>\n        <version>${spring.version}</version>\n    </dependency>\n\n    <dependency>\n        <groupId>org.springframework</groupId>\n        <artifactId>spring-web</artifactId>\n        <version>${spring.version}</version>\n    </dependency>\n\n    <dependency>\n        <groupId>javax.servlet</groupId>\n        <artifactId>servlet-api</artifactId>\n        <version>2.5</version>\n        <scope>provided</scope>\n    </dependency>\n\n    <dependency>\n        <groupId>javax.servlet.jsp</groupId>\n        <artifactId>jsp-api</artifactId>\n        <version>2.1</version>\n        <scope>provided</scope>\n    </dependency>\n\n    <dependency>\n        <groupId>org.springframework</groupId>\n        <artifactId>spring-webmvc</artifactId>\n        <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n        <groupId>org.springframework</groupId>\n        <artifactId>spring-test</artifactId>\n        <version>${spring.version}</version>\n        <scope>test</scope>\n    </dependency>\n\n    <!--DEPENDENCYS FOR HIBERNATE-->\n    <dependency>\n        <groupId>org.springframework</groupId>\n        <artifactId>spring-orm</artifactId>\n        <version>${spring.version}</version>\n    </dependency>\n    <dependency>\n        <groupId>org.hibernate</groupId>\n        <artifactId>hibernate-core</artifactId>\n        <version>${hibernate.version}</version>\n    </dependency>\n    <dependency>\n        <groupId>org.hibernate</groupId>\n        <artifactId>hibernate-c3p0</artifactId>\n        <version>${hibernate.version}</version>\n    </dependency>\n    <!--DEPENDENCY FOR BEANVALIDATION-->\n    <dependency>\n        <groupId>org.hibernate</groupId>\n        <artifactId>hibernate-validator</artifactId>\n        <version>${hibernate.version}</version>\n        <exclusions>\n            <exclusion>\n                <groupId>org.slf4j</groupId>\n                <artifactId>slf4j-api</artifactId>\n            </exclusion>\n        </exclusions>\n    </dependency>\n\n    <!--DRIVER FOR MYSQL-->\n    <dependency>\n        <groupId>mysql</groupId>\n        <artifactId>mysql-connector-java</artifactId>\n        <version>5.1.18</version>\n    </dependency>\n\n    <dependency>\n        <groupId>junit</groupId>\n        <artifactId>junit</artifactId>\n        <version>4.8.2</version>\n        <scope>test</scope>\n    </dependency>\n\n    <dependency>\n        <groupId>jstl</groupId>\n        <artifactId>jstl</artifactId>\n        <version>1.2</version>\n    </dependency>\n\n    <dependency>\n        <groupId>org.apache.tiles</groupId>\n        <artifactId>tiles-extras</artifactId>\n        <version>2.2.2</version>\n        <exclusions>\n            <exclusion>\n                <groupId>org.slf4j</groupId>\n                <artifactId>jcl-over-slf4j</artifactId>\n            </exclusion>\n        </exclusions>\n    </dependency>\n\n    <!--REQUIRED FOR FILEUPLOAD-->\n    <dependency>\n        <groupId>commons-fileupload</groupId>\n        <artifactId>commons-fileupload</artifactId>\n        <version>1.2.1</version>\n    </dependency>\n    <dependency>\n        <groupId>commons-io</groupId>\n        <artifactId>commons-io</artifactId>\n        <version>1.3</version>\n    </dependency>\n\n    <!--LIB FOR JSON CONVERTING-->\n    <dependency>\n        <groupId>org.codehaus.jackson</groupId>\n        <artifactId>jackson-mapper-asl</artifactId>\n        <version>1.9.12</version>\n    </dependency>\n\n    <!-- Solr -->\n    <dependency>\n        <groupId>org.springframework.data</groupId>\n        <artifactId>spring-data-solr</artifactId>\n        <version>1.0.0.RELEASE</version>\n        <exclusions>\n            <exclusion>\n                <groupId>org.slf4j</groupId>\n                <artifactId>jcl-over-slf4j</artifactId>\n            </exclusion>\n            <exclusion>\n                <groupId>org.slf4j</groupId>\n                <artifactId>slf4j-api</artifactId>\n            </exclusion>\n        </exclusions>\n    </dependency>\n    <dependency>\n        <groupId>org.apache.solr</groupId>\n        <artifactId>solr-core</artifactId>\n        <version>4.4.0</version>\n        <exclusions>\n            <exclusion>\n                <artifactId>slf4j-jdk14</artifactId>\n                <groupId>org.slf4j</groupId>\n            </exclusion>\n            <exclusion>\n                <groupId>org.slf4j</groupId>\n                <artifactId>slf4j-api</artifactId>\n            </exclusion>\n            <exclusion>\n                <groupId>org.slf4j</groupId>\n                <artifactId>slf4j-log4j12</artifactId>\n            </exclusion>\n            <exclusion>\n                <groupId>log4j</groupId>\n                <artifactId>log4j</artifactId>\n            </exclusion>\n        </exclusions>\n    </dependency>\n\n    <!--Logging-->\n    <dependency>\n        <groupId>org.slf4j</groupId>\n        <artifactId>slf4j-log4j12</artifactId>\n        <version>1.7.7</version>\n    </dependency>\n
\n\n

So, when I deploy this application on a tomcat7 on Ubuntu with Java 1.8 everything works fine (My laptop). But when I'm trying to deploy it on the production system (Win 8, Java 7, Tomcat7 and Tomcat8 tried) I get the following error:

\n\n
21-Oct-2014 17:57:50.016 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath\n21-Oct-2014 17:57:50.079 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext\n21-Oct-2014 17:57:50.079 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener\n java.lang.AbstractMethodError: org.slf4j.impl.JDK14LoggerAdapter.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V\n    at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)\n    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:272)\n    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)\n    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)\n    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221)\n    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)\n    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)\n    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)\n    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)\n    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:919)\n    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1703)\n    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)\n    at java.util.concurrent.FutureTask.run(Unknown Source)\n    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\n    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\n    at java.lang.Thread.run(Unknown Source)\n
\n\n

The standard error says \"startup failed due to previous errors\"...

\n\n

Any Ideas what could be the reason?

\n\n
\n\n

EDIT\nThe dependency tree from 'mvn dependency:tree' looks like this:

\n\n
[INFO] +- org.springframework:spring-core:jar:3.2.0.RELEASE:compile\n[INFO] |  \\- commons-logging:commons-logging:jar:1.1.1:compile\n[INFO] +- org.springframework:spring-web:jar:3.2.0.RELEASE:compile\n[INFO] |  +- org.springframework:spring-context:jar:3.2.0.RELEASE:compile\n[INFO] |  +- org.springframework:spring-aop:jar:3.2.0.RELEASE:compile\n[INFO] |  +- aopalliance:aopalliance:jar:1.0:compile\n[INFO] |  \\- org.springframework:spring-beans:jar:3.2.0.RELEASE:compile\n[INFO] +- javax.servlet:servlet-api:jar:2.5:provided\n[INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided (scope not updated to compile)\n[INFO] +- org.springframework:spring-webmvc:jar:3.2.0.RELEASE:compile\n[INFO] |  \\- org.springframework:spring-expression:jar:3.2.0.RELEASE:compile\n[INFO] +- org.springframework:spring-test:jar:3.2.0.RELEASE:test\n[INFO] +- org.springframework:spring-orm:jar:3.2.0.RELEASE:compile\n[INFO] |  +- org.springframework:spring-jdbc:jar:3.2.0.RELEASE:compile\n[INFO] |  \\- org.springframework:spring-tx:jar:3.2.0.RELEASE:compile\n[INFO] +- org.hibernate:hibernate-core:jar:4.1.0.Final:compile\n[INFO] |  +- commons-collections:commons-collections:jar:3.2.1:compile\n[INFO] |  +- antlr:antlr:jar:2.7.7:compile\n[INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile\n[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile\n[INFO] |  |  \\- xml-apis:xml-apis:jar:1.0.b2:compile\n[INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile\n[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.1.0.CR2:compile\n[INFO] |  +- org.javassist:javassist:jar:3.15.0-GA:compile\n[INFO] |  \\- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile\n[INFO] +- org.hibernate:hibernate-c3p0:jar:4.1.0.Final:compile\n[INFO] |  \\- c3p0:c3p0:jar:0.9.1:compile\n[INFO] +- org.hibernate:hibernate-validator:jar:4.1.0.Final:compile\n[INFO] |  \\- javax.validation:validation-api:jar:1.0.0.GA:compile\n[INFO] +- mysql:mysql-connector-java:jar:5.1.18:compile\n[INFO] +- junit:junit:jar:4.8.2:test\n[INFO] +- jstl:jstl:jar:1.2:compile\n[INFO] +- org.apache.tiles:tiles-extras:jar:2.2.2:compile\n[INFO] |  +- org.apache.tiles:tiles-core:jar:2.2.2:compile\n[INFO] |  |  +- org.apache.tiles:tiles-api:jar:2.2.2:compile\n[INFO] |  |  \\- commons-digester:commons-digester:jar:2.0:compile\n[INFO] |  |     \\- commons-beanutils:commons-beanutils:jar:1.8.0:compile\n[INFO] |  +- org.apache.tiles:tiles-servlet-wildcard:jar:2.2.2:compile\n[INFO] |  |  \\- org.apache.tiles:tiles-servlet:jar:2.2.2:compile\n[INFO] |  +- org.apache.tiles:tiles-jsp:jar:2.2.2:compile\n[INFO] |  |  \\- org.apache.tiles:tiles-template:jar:2.2.2:compile\n[INFO] |  +- org.apache.tiles:tiles-freemarker:jar:2.2.2:compile\n[INFO] |  |  \\- org.freemarker:freemarker:jar:2.3.15:compile\n[INFO] |  +- org.apache.tiles:tiles-velocity:jar:2.2.2:compile\n[INFO] |  |  \\- org.apache.velocity:velocity-tools:jar:2.0:compile\n[INFO] |  |     +- oro:oro:jar:2.0.8:compile\n[INFO] |  |     \\- org.apache.velocity:velocity:jar:1.6.2:compile\n[INFO] |  +- org.apache.tiles:tiles-el:jar:2.2.2:compile\n[INFO] |  +- org.apache.tiles:tiles-mvel:jar:2.2.2:compile\n[INFO] |  |  \\- org.mvel:mvel2:jar:2.0.11:compile\n[INFO] |  +- org.apache.tiles:tiles-ognl:jar:2.2.2:compile\n[INFO] |  |  \\- ognl:ognl:jar:2.7.3:compile\n[INFO] |  |     \\- jboss:javassist:jar:3.7.ga:compile\n[INFO] |  \\- org.apache.tiles:tiles-compat:jar:2.2.2:compile\n[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.1:compile\n[INFO] +- commons-io:commons-io:jar:1.3:compile\n[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.12:compile\n[INFO] |  \\- org.codehaus.jackson:jackson-core-asl:jar:1.9.12:compile\n[INFO] +- org.springframework.data:spring-data-solr:jar:1.0.0.RELEASE:compile\n[INFO] |  +- org.springframework.data:spring-data-commons:jar:1.6.1.RELEASE:compile\n[INFO] |  +- org.apache.commons:commons-lang3:jar:3.1:compile\n[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.2.2:compile\n[INFO] |  |  \\- org.apache.httpcomponents:httpcore:jar:4.2.2:compile\n[INFO] |  +- org.apache.httpcomponents:httpmime:jar:4.2.2:compile\n[INFO] |  +- org.apache.httpcomponents:httpclient-cache:jar:4.2.2:compile\n[INFO] |  \\- org.apache.solr:solr-solrj:jar:4.3.1:compile\n[INFO] |     +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile\n[INFO] |     \\- org.noggit:noggit:jar:0.5:compile\n[INFO] +- org.apache.solr:solr-core:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-core:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-codecs:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-analyzers-common:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-analyzers-kuromoji:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-analyzers-phonetic:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-highlighter:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-memory:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-misc:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-queryparser:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-spatial:jar:4.4.0:compile\n[INFO] |  |  \\- com.spatial4j:spatial4j:jar:0.3:compile\n[INFO] |  +- org.apache.lucene:lucene-suggest:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-grouping:jar:4.4.0:compile\n[INFO] |  +- org.apache.lucene:lucene-queries:jar:4.4.0:compile\n[INFO] |  +- com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:jar:1.2:compile\n[INFO] |  +- commons-codec:commons-codec:jar:1.7:compile\n[INFO] |  +- commons-cli:commons-cli:jar:1.2:compile\n[INFO] |  +- joda-time:joda-time:jar:2.2:compile\n[INFO] |  +- org.apache.hadoop:hadoop-annotations:jar:2.0.5-alpha:compile\n[INFO] |  |  \\- jdk.tools:jdk.tools:jar:1.6:system\n[INFO] |  +- org.apache.hadoop:hadoop-auth:jar:2.0.5-alpha:compile\n[INFO] |  +- org.apache.hadoop:hadoop-common:jar:2.0.5-alpha:compile\n[INFO] |  |  +- org.mortbay.jetty:jetty:jar:6.1.26:compile\n[INFO] |  |  +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile\n[INFO] |  |  +- commons-configuration:commons-configuration:jar:1.6:compile\n[INFO] |  |  \\- com.google.protobuf:protobuf-java:jar:2.4.0a:compile\n[INFO] |  +- org.apache.hadoop:hadoop-hdfs:jar:2.0.5-alpha:compile\n[INFO] |  +- org.restlet.jee:org.restlet:jar:2.1.1:compile\n[INFO] |  +- org.restlet.jee:org.restlet.ext.servlet:jar:2.1.1:compile\n[INFO] |  +- commons-lang:commons-lang:jar:2.6:compile\n[INFO] |  +- com.google.guava:guava:jar:14.0.1:compile\n[INFO] |  \\- org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime\n[INFO] \\- org.slf4j:slf4j-log4j12:jar:1.7.7:compile\n[INFO]    +- org.slf4j:slf4j-api:jar:1.7.7:compile\n[INFO]    \\- log4j:log4j:jar:1.2.17:compile\n
\n\n
\n\n

EDIT 2\nso... Now I tried to exclude the commons-logging things from my projects pom.xml. But it was also not very effective. The error message stays exactly the same... But I recognised something very interesting...

\n\n

When I open the output war (I generate it with mvn clean install) with an archive manager and navigate to the WEB-INF/lib folder i can see all the jar-files, which were in my pom.xml during the past. So, there are the jars of 3 different versions of slf4j, multiple log4j versions and many other libs, which could be in conflict.\nThe strange thing is, that all these jar-files does not appear in the mvn dependency:tree.

\n\n

Any idea, how I can get rid of those files?

\n", "Lable": "No"} {"QuestionId": 26513839, "AnswerCount": 0, "Tags": "", "CreationDate": "2014-10-22T17:49:41.763", "AcceptedAnswerId": null, "Title": "Theano import error: cannot import name Shape", "Body": "

I am trying to import theano as

\n\n
import theano\nimport theano.tensor as T\n
\n\n

But its giving the following error:

\n\n
---------------------------------------------------------------------------\nImportError                               Traceback (most recent call last)\n<ipython-input-13-ee4df930a2f4> in <module>()\n----> 1 import theano\n      2 import theano.tensor as T\n\n/Users/pksaha/anaconda/lib/python2.7/site-packages/theano/__init__.py in <module>()\n     53     object2, utils\n     54 \n---> 55 from theano.compile import \\\n     56     SymbolicInput, In, \\\n     57     SymbolicOutput, Out, \\\n\n/Users/pksaha/anaconda/lib/python2.7/site-packages/theano/compile/__init__.py in <module>()\n----> 1 from theano.compile.ops import (\n      2         DeepCopyOp, deep_copy_op, register_deep_copy_op_c_code,\n      3         Shape, shape, register_shape_c_code,\n      4         Shape_i, register_shape_i_c_code,\n      5         ViewOp, view_op, register_view_op_c_code, FromFunctionOp,\n\nImportError: cannot import name Shape\n
\n\n

I am currently on the bleeding edge version of theano using the following command:

\n\n
pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git\n
\n", "Lable": "D"} {"QuestionId": 26573426, "AnswerCount": 3, "Tags": "", "CreationDate": "2014-10-26T13:20:17.667", "AcceptedAnswerId": null, "Title": "CRUD on XML using Java", "Body": "

I am developing a java application and i am using XML to store the settings and other data in the application.I have read about Java preferences manager API but i felt storing in XML is more convenient in my application.I started usng JAXB first but then i dint find any tutorials to modify the XML once it is created.My application involves storing the Email account details of the users.As the user adds his accounts dynamically , i need to add them to XML as well.So i dint find JAXB convenient(or rather i dint find any tutorials to update or modify the XML ).The only other option i found was DOM parser here http://docs.oracle.com/javase/tutorial/jaxp/dom/readingXML.html .But i feel it is too complicated for such a simple application.speed , memory etc doesnt matter to me.Are there any other alternatives to do this?

\n", "Lable": "No"} {"QuestionId": 26583013, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-10-27T07:46:24.030", "AcceptedAnswerId": null, "Title": "TYPO3 progress bar while uploading", "Body": "

is there any known solution to show a progress bar while uploading big files (5-15 MB) in TYPO3?\nThe plupload-Extension is not working in Version 6.2

\n\n

Somehow it should be possible in e.g. jQuery but I don't find a realistic way for that.

\n\n

Greatings, stefan

\n", "Lable": "No"} {"QuestionId": 26599615, "AnswerCount": 1, "Tags": "", "CreationDate": "2014-10-28T01:41:27.477", "AcceptedAnswerId": null, "Title": "flipclock count up from a particular date", "Body": "

For instance, the given start time is 10/28/2014 08:00:00AM (server time). It will count up and show the hours minutes secs lapsed from the given start time? Is this possible with flipclock?

\n", "Lable": "No"}