Ortomala Lokni

1

votes
1

answer
162

views

Python sentinel in C++ extension

I'm working on a Python extension module written in C++. According to the Python documentation the module method table should be written like this: static PyMethodDef SpamMethods[] = { ... {'system', spam_system, METH_VARARGS, 'Execute a shell command.'}, ... {NULL, NULL, 0, NULL} /* Sentine...
Ortomala Lokni
1

votes
1

answer
145

views

Docker : How to run a service and a terminal in one command?

I'm running an apache server like this docker run -d -p 80:80 php:apache /usr/sbin/apache2ctl -D FOREGROUNDD Then I determine the name of the container with docker ps and execute an interactive shell on the container with docker exec -ti hungry_fermi bash It works well, but I would like to do the sa...
Ortomala Lokni
1

votes
3

answer
61

views

Continuous deployment from a test server to a production server, using git

I've a branch origin/master (from a test server) that is ahead of a branch master by N commits (on a production server) . I want to apply the commit from origin/master to master one by one, in order to observe, at each step, how the application react to these commits. I've used git cherry-pick but...
Ortomala Lokni
1

votes
1

answer
630

views

Gitlab CI/CD job's log exceeded limit

When I run my job on Gitlab CI/CD, after a while I obtain the following error message: Job's log exceeded limit of 4194304 bytes. How to change this limit?
Ortomala Lokni
4

votes
0

answer
22

views

How to automatically reuse a dependency version in Maven?

I use spring-boot-starter-activemq:2.07.RELEASE which depends on activemq-broker:5.15.8 which depends on guava:18.0. Now I would like to use guava from my main pom.xml. So I have to use: com.google.guava guava 18.0 If I use an higher version in my pom.xml this version will be also used by activemq-b...
Ortomala Lokni
6

votes
3

answer
7.4k

views

How to add an active spring profile from an environment variable?

Until now, I'm setting the following environment variable in my ~/.bash_profile : export SPRING_PROFILES_ACTIVE=local This set my active spring profile. But now, I want to add the local profile to other profiles defined in application.properties and not replace them. In the Spring Boot documentation...
Ortomala Lokni
2

votes
6

answer
313

views

Why to put a zero margin on <html> element?

In CSS stylesheet, I often see this rule: html, body { margin : 0px; padding : 0px; } Why to put a zero margin on element? Why not just on the element? Related question : Does the element have a default margin or padding in any browser, since normalize.css doesn't reset it?
Ortomala Lokni
8

votes
1

answer
916

views

How to bind IntelliJ IDEA random open ports to localhost only?

When I run IntelliJ IDEA 2018.3 (Ultimate or Community edition) on macOS, I observe that 3 random ports are open on all network interfaces (eth0, lo, ...). One random port is open by the idea process and the two other ports are open by a different java process launched by IntelliJ IDEA. I've removed...
Ortomala Lokni
2

votes
2

answer
552

views

HTML5 content model visualization

In HTML5 each element belongs to zero or more categories. Each element has a content model defined by zero or more categories. In SO there is a lot of questions like: Can I put element A inside element B. My question is: How to effectively build a visual represention of the content model? Is it pos...
Ortomala Lokni
1

votes
2

answer
95

views

How to revert a git checkout masTER?

I was on a test branch and by mistake I run git checkout masTER It renames my master branch to masTER. When I run git branch, I obtain: masTER test If I run git checkout test and then git checkout master. The master branch doesn't retrieve its original capitalization. How can I revert this mistake,...
Ortomala Lokni
4

votes
1

answer
2.4k

views

How to run two WAR files with different spring profiles on a tomcat server?

I would like to run my spring application two times, in parallel, on the same tomcat server. One time with a production profile and one time with a dev profile. I also would like to build one single WAR for the two profiles. I've successfully integrated profiles in my application with @Profile annot...
Ortomala Lokni
4

votes
1

answer
79

views

Is it possible to exit the RUNNABLE state without having executed a single instruction?

I'm reading the book Oracle Certified Professional Java SE 7 Programmer Exams 1Z0-804 and 1Z0-805. One of the question asks the output of this code class ThreadTest { public static void main(String []args) throws InterruptedException { Thread t1 = new Thread() { public void run() { System.out.print(...
Ortomala Lokni
2

votes
2

answer
1.2k

views

What is the difference between a criteria, a predicate, and a specification?

In the Spring Data JPA - Reference Documentation, a criteria is defined by: Writing a criteria you actually define the where-clause of a query for a domain class. Specifications and predicates seem to have the same role. What is the difference between a criteria, a predicate and a specification?
Ortomala Lokni
2

votes
1

answer
410

views

Why do I need a trailing slash for the root URI in Spring Data Rest?

I'm using Spring Data Rest. I can access a resource from the command line using httpie with: http :8080/myapp/books but if I try to access the root URI http :8080/myapp I obtain a 302 redirection: HTTP/1.1 302 Date: Wed, 21 Dec 2016 13:30:57 GMT Location: http://localhost:8080/myapp/ Transfer-Encod...
Ortomala Lokni
8

votes
3

answer
169

views

What change in type inference algorithm causes this behavior?

I'm reading OCP Java SE7, certification guide from Mala Gupta. On page 297, the following code snippet import java.util.HashMap; import java.util.Map; public class TestGenericTypeInference { Map salaryMap = new HashMap(); Map copySalaryMap = new HashMap(salaryMap); } is compiling with java 8 but...
Ortomala Lokni
4

votes
1

answer
1.3k

views

How to log all active properties of a spring boot application before the beans instantiation?

There is already a question asking for logging the active configuration, there is a correct answer but the problem is that the configuration is logged only if all beans are correctly instantiated. I would like to log all properties even (mainly) if the application crash at startup. My question is mo...
Ortomala Lokni
2

votes
1

answer
327

views

How to use source maps with basic authentication?

I want to use Mirador, an IIIF viewer on a site with basic authentication. The problem is that I receive the following error in the console: Source map error: request failed with status 401 Resource URL: https://example.com/mirador/mirador.js Source Map URL: openseadragon.js.map Firefox is trying to...
Ortomala Lokni
1

votes
2

answer
424

views

Spring Boot / JPA / Hibernate, How to switch database vendor according to Spring profile?

I'm using Spring Boot / JPA / Hibernate. I would like to use HSQLDB when testing on localhost and MySQL when deploying on server. In pom.xml, I have this dependency for MySQL : mysql mysql-connector-java and this dependency for HSQLDB : org.hsqldb hsqldb I probably can't put both dependencies in pom...
Ortomala Lokni