text:
Q: Bind JSON data to date range picker calendar I'm using JSON to store data and using date range picker as the follows code.
$(function() {
        $("#datepicker").datepicker({
            beforeShowDay: function(date) {
                var date1 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("#input1").val());
                var date2 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("#input2").val());
                return [true, date1 && ((date.getTime() == date1.getTime()) || (date2 && date >= date1 && date <= date2)) ? "dp-highlight" : ""];
            },
            onSelect: function(dateText, inst) {
                var date1 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("#input1").val());
                var date2 = $.datepicker.parseDate($.datepicker._defaults.dateFormat, $("#input2").val());

                if (!date1 || date2) {
                    $("#input1").val(dateText);
                    $("#input2").val("");
                    $(this).datepicker("option", "minDate", dateText);
                } else {
                    $("#input2").val(dateText);
                    $(this).datepicker("option", "minDate", null);
                }

                //$("#dateoutput").html("Chosen date is " + date1 + " - " + dateText + "");
            }
        });
    });

How can i bind data according to selected date range.
enter code here

A: I'm not entirely sure what it was you wanted to do, but I've made a JSFiddle from what I understood.
To test, do this:
1) I have saved an initial date as a JSON string, so you can click on "Load JSON Date" and it will parse the JSON string and store the values in the 2 input fields.
2) You can then select another date range, and click "Store JSON Data" and it will stringify the data.
3) Change the date
4) click "Load JSON Data" and it will reset the fields back to the data you stored.
http://jsfiddle.net/1xqbgshm/4/
The code does the following:
$("#store").click(function () {
    var date1 = $("#input1").val();
    var date2 = $("#input2").val();
    var dateObject = {
        "fromDate": date1,
        "toDate": date2
    };

    jsonString = JSON.stringify(dateObject);
    alert(jsonString);
});

$("#load").click(function () {
    var javascriptObject = $.parseJSON(jsonString);
    $("#input1").val(javascriptObject.fromDate);
    $("#input2").val(javascriptObject.toDate);
});

Does this help?


text:
Q: Google Analytics Event-based Goal Funnels I have what might be a unique GA requirement.
I need to track Goal conversions in a SPA based on certain event criteria.
Here's the requirement:

*

*User initiates new order

*User fills out all required fields

*User either:

*

*Saves order for later

*Completes order

*--Goal complete--

Since this is a single page web-app, I think I need to do this via events (unless there is a better way).
The business wants to track the time it takes for the goal to be completed. Can I do this with a 'goal', or would I be better off just attaching timestamps to the individual events and deriving the duration on the back end?
Thanks!

A: You have many options here (with PROs/CONs):

*

*Look at the Behaviour->Events->Events Flow. There you can see the "funnel" of how your users/guests interacts with your website and move around the events you programmed.

*If you have Google Analytics 360, you can create a Custom Report of type "funnel" and then you can specify your events as steps of the goal. Downside: only 5 events/steps per goal.

*You can define virtual pageviews instead of events, and then your Goal will be the basic type of simple URI paths. This allow you to define up to 20 URIs (or virtual pageviews). Downside: each pageview will count towards your visits (and it is just a virtual visit). This can be triggered in Javascript with this code:
_gap.push(['_trackPageview', 'name-of-your-virtual-pageview-in-the-goal-funnel-definition'])

A: Google Analytics now offers an Events Flow Report, in which you can see how users "navigate" through the different events you have configured, but that's probably not what you are looking for.
If you want a "real" funnel report in Google Analytics, currently you can't use Events, they are only available for Destination/URL goals.
A workaround is using virtual pageviews instead of events and then configuring those virtual pages as the funnel steps. This is not ideal, because virtual pageviews impact your statistics (more pageviews, etc.) but maybe in your case this is not a great issue.
If they want to track the time to complete to final goal and they are registering orders (with a $ value), then ecommerce tracking is your best bet. It offers a lot of useful information about the orders and includes a "Time to purchase" report.

redpajama_set_name: RedPajamaStackExchange


text:
Q: ¿Como puedo mandar un objeto en un Ngmodel? Este es mi codigo:
<input type="text" placeholder="Buscar.."
  id="sku_select"
  aria-label="number"
  matInput [formControl]="myControl"
  [matAutocomplete]="auto"
  [(ngModel)]="selectedValue"
  (change)="changeClient($event.value)">
       <mat-autocomplete autoActiveFirstOption #auto="matAutocomplete">
        <mat-option *ngFor="let datos of filteredOptions | async"
          [value]="datos.campo_1">{{datos.campo_1}}
        </mat-option>

Como se pueden dar cuenta tengo un tipado llamado Formulario donde declaro campo_1, campo_2 y campo_3, lo que quiero es que mi NgModel pueda obtener el campo_2, pero sin tener que cambiar el valor de mi mat-option ya que lo deseo colocar en otro input que es el siguiente:
 <div class="form-group">
   <input type="text" class="form-control"
     [(ngModel)]="resume.socialProfile"
     name="socialProfile" placeholder="Social Profile "
     [value]="selectedValue.campo_2">
 </div>

Se que lo que estoy haciendo esta completamente erroneo, puesto que mi Ngmodel almacena unicamente el valor de mi mat-option, pero hay alguna manera en la que pueda guardar el campo_2? por ejemplo, en mi mat-option tengo el campo_1 = 78 (el cual se muestra al momento de seleccionar, pero tambien esta el campo_2, ese campo_2 es el que quiero establecer en el input "Social Profile" Espero y me haya explicado bien, muchas gracias a todos por leerme.

A: Logre solucionar el problema, mi solución fue la siguiente:
En mi component.ts tengo una funcion que se encarga de filtrar los datos de un select, (mat-autocomplete) como esta funcion se encarga de filtrar los datos del select guiandose por el campo_1, cuando se tienen los resultados esta funcion retorna los 2 campos que hicieron match, para extraer el campo_2 inicio un bucle for, el valor lo asigno a una variable publica y esa la tengo vinculada con el input "Social Profile", este es el codigo de la funcion, espero que les sirva y no se rompan tanto la cabeza como lo hice yo, saludos a toda la comunidad stack Overflow!
  private _filter(value: string): Formulario[] {
const filterValue = value.toLowerCase();
const datos_ = this.formularioDatos.filter(formularioDatos => formularioDatos.campo_1.toLowerCase().includes(filterValue));
console.log(datos_);
for(let elemento of datos_){
  const campo_2 = elemento.campo_2;
 this.campo_2_ = campo_2;
  console.log(elemento);
  //console.log(this.selectedValue);
}


text:
Q: php mysqli WHERE IN (?,?,? ...) According to http://us2.php.net/manual/en/mysqli-stmt.bind-param.php,
the different types are:
i   corresponding variable has type integer
d   corresponding variable has type double
s   corresponding variable has type string
b   corresponding variable is a blob and will be sent in packets

However, how can you handle this:
->prepare("SELECT blabla FROM foo WHERE id IN (?)")

Where ? would be a list of ids. There could be one or more items:
$ids = "3,4,78";
->bind_param('s',$ids);

Is that possible?
I'd like to use prepared statements because it will be executed in a loop.

A: The proper syntax would be
->prepare("SELECT blabla FROM foo WHERE id IN (?, ?, ?)")

for 3 items in that array, for example. You would then have to bind each of those items individually using bind_param().
If you don't have a size guarantee on the array, you'll have to write a couple helper functions to generate your SQL with the proper number of "?"'s and bind statements.

A: If you have a list of variables that differs in size every call that you wanto to bind to an IN-statement, the most simple way would be to generate the SQL string programatically and use a loop to bind the variables:
/**
 * @param  array  $values
 * @param  mysqli $db
 * @return mysqli_stmt
 */
function bindInValues(array $values, mysqli $db)
{
    $sql = sprintf('SELECT blabla FROM foo WHERE id IN (%s)',
        implode(', ', array_fill(0, count($values), '?'))
    );
    $stmt = $db->prepare($sql);
    foreach ($values as $value) {
        $stmt->bind_param('s', $value);
    }
    return $stmt;
}

If you like call_user_func_array you can use dynamic method invocation and go along without a loop.
/**
 * @param  array  $values
 * @param  mysqli $db
 * @return mysqli_stmt
 */
function bindInValues(array $values, mysqli $db)
{
    $sql = sprintf('SELECT blabla FROM foo WHERE id IN (%s)',
        implode(', ', array_fill(0, count($values), '?'))
    );
    $stmt = $db->prepare($sql);
    array_unshift($values, implode('', array_fill(0, count($values), 's')));
    call_user_func_array(array($stmt, 'bind_param'), $values);
    return $stmt;
}

A: I think I found the answer to my question:
->prepare("SELECT stuff FROM table_name WHERE id IN (?)");

$itemList = implode(',',$items);
$children->bind_param('s',$itemList);

Seems to be working fine when using a string with coma-separated values.
I'm still checking if the results are really accurate ...

A: What about doing this:
$sql = sprintf("SELECT blabla FROM foo WHERE id IN(%s) ", $ids);
$stmt = $mysqli->prepare($sql);
if (!$stmt) {
    $this->throwException();
}

if (!$stmt->execute()) {
    $this->throwException();
}

If it is not good, please tell me why so I can learn from my errors. Thanks!


text:
Q: timer_create(), expiry events during sleep I need some clarification in the usage of timer_create(). I understand how to use this function, set delay and assign the handler function etc.
I would like to know how to create timers using this fn which can generate expiry events even when the device (Android phone) is in low power state (sleep mode). I couldn't find this info from the man pages, perhaps someone can guide me in the right direction. My clock base is CLOCK_REALTIME and the required delay is in the order of msec.
Timers based on CLOCK_REALTIME will be able to wake-up the processor even if it is in sleep state?

A: try IOCTL RTC timer
http://www.informit.com/articles/article.aspx?p=414983&seqNum=4
with RTC_WKALM_SET


text:
Q: Installing Issue in the Debian-Linux Server I am trying to install Kyoto Cabinet in the Debian-Linux Server by using this commands. However, when I execute

./configure

Command, it gives error

-bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory

Can anybody help me why is this happening and how to solve this issue ? Or any idea why this error can happen ?

A: Because of the ^M character, the configure file is probably using Windows-style line endings.
Try to convert it to use UNIX-style:
dos2unix configure

or in vi type:
:set fileformat=unix

than save the script and try again.

A: kyotocabinet is now packaged in debian sid
apt-get install libkyotocabinet-dev --install-suggests
you may need to add this to /etc/apt/sources.list
deb http://cdn.debian.net/debian sid main

A: For me, an initial installation of Kyoto Cabinet (K.C.) was unsuccessful because C++ and zlib were missing from minimal Centos 6. Eventually, these omissions were discovered and K.C. installed (initial instructions from http://skipperkongen.dk/2013/02/14/giving-kyotocabinet-a-go/):
yum -y install gcc-c++
yum -y install zlib-devel
wget http://fallabs.com/kyotocabinet/pkg/kyotocabinet-1.2.76.tar.gz
tar xzvf kyotocabinet-1.2.76.tar.gz
cd kyotocabinet-1.2.76
./configure && make && make install # takes some time!
Test Kyoto Cabinet with:
kcprototest wicked 5

A: To install the Kyoto Cabinet API for Python (initial instructions from others):
Test Kyoto Cabinet with:
kcprototest wicked 5
As root, of course:
cd $HOME
yum -y install python-devel
wget http://fallabs.com/kyotocabinet/pythonlegacypkg/kyotocabinet-python-legacy-1.18.tar.gz
tar xzvf kyotocabinet-python-legacy-1.18.tar.gz
cd kyotocabinet-python-legacy-1.18
python setup.py install # may take some time!
Create and run a test program, e.g., testkc.py, from the Kyoto Cabint web site.
It should run OK.
You probably want to make K.C. available outside root. Create a new file:
vi /etc/ld.so.conf.d/usrlocal.conf
and add the line:
/usr/local/lib
Then run
ldconfig -v
Move the testkc.py to a user account and run it there; it should be OK


text:
Q: Get specific results from this table I've got a table like this: (translations_tb)
NID LANGUAGE (translations_tb)
 1     fr
 1     en
 2     fr
 2     en
 3     fr
 3     en
 4     en
 5     en

I need a query that will get the results like this:

*

*All the NID's with FR language

*All the NID's with EN language that are != FR NID's

*SORT BY : FR language first and EN last ( Could be DE, RU, RO, etc. languages)

This is how it should work for the example above.
NID   LANGUAGE
1       fr
2       fr
3       fr
4       en
5       en

What I tried:
SELECT nid, CASE WHEN language = 'fr' THEN 0 ELSE 1 END as new_language
FROM translations_tb
WHERE language in ('fr', 'en')
ORDER BY new_language ASC

This gets it sorted by my dynamic language first, but I know I should not use IN ('fr', 'en') but can't figure out what should I do in order to exclude the duplicate NID's that are from EN language.

A: First have condition with language =  'fr' and then add a condition for 'en' using a subquery to exclude those  with language 'fr'
select nid, language
from translations_tb
where language = 'fr'
   or (language = 'en' and nid not in (select nid
                                       from translations_tb
                                       where language = 'fr'))

A: You could GROUP BY nid and fetch max(language), which will return 'fr', if both languages are present for that nid, because 'fr' > 'en'. For the same reason you can order by the language descending to have 'fr' first in the result.
SELECT nid,
       max(language) language
       FROM translations_tb
       WHERE language IN ('fr',
                          'en')
       GROUP BY nid
       ORDER BY 2 DESC;


text:
Q: Save projects from all collections from Team Foundation Server on disk I have to delete an old Team Foundation server (virtual machine), because the hardware monitor is telling us that disks are about to die. And our team already started using a newer server a long time ago. Therefore all recent projects have been migrated to the new environment, that is for sure. But i also think that  someone has missed some old project and i know for sure that at some point in time mr. Murphy is going to call and asks a question about some very old project :) (which only existed in that very old TFS database.)
So, i was thinking, the best thing to do here, is to get all projects, from all collections, and store them on some archive disk on a NAS. But, what i'm missing is a command or something to do this big 'get everything' task with just a few commands or clicks. Does anyone know how to accomplish this in an easy way?

A: You should detach all collections and back them up. Once detached you can move them to the new TFS server and "attach" them as additional collections. This will make the contents available for everyone. Set permission to readonly and you can make sure you never miss anything.


text:
Q: Requesting API Content on Localhost while using Tor + Privoxy I'm using Tor, Privoxy, and Python to anonymously crawl sources on the web.  Tor is configured with ControlPort 9051, while Privoxy is configured with forward-socks5 / localhost:9050 .
My scripts are working flawlessly, except when I request an API resource that I have running on 8000 on the same machine. If I hit the API via urllib2 setup with the proxy, I get an empty string response. If I hit the API using a new, non-proxy instance of urllib2, I get a HTTP Error 503: Forwarding failure.
I'm sure that if I open 8000 to the world I'll be able to access the port through the proxy. However, there must be a better way to access the resource on localhost. Curious how people deal with this.

A: I was able to switch off proxy and hit internal API by using the following to opener:
        ctx = ssl.create_default_context()
        ctx.check_hostname = False
        ctx.verify_mode = ssl.CERT_NONE
        opener = urllib2.build_opener(urllib2.HTTPSHandler(context=ctx))
        urllib2.install_opener(opener)

I'm not sure if there is a better way, but it worked.


text:
Q: Basic question on cohomology ring To show

(1) $S^2\vee S^1\vee S^1$ is not homotopy equivalent to $S^1\times S^1$
(2) $S^1\vee S^2\vee S^3$ is not homotopy equivalent to $S^1\times S^2$

I use the same method:
For (1) the product of the two generators of $H^1(S^2\vee S^1\vee S^1)$ is $0$ while the product of the two generators of $H^1(S^1\times S^1)$ is the generator of $H^2(S^1\times S^1)$.
For (2) the product of the generator of $H^1(S^1\vee S^2\vee S^3)$ and the generator of $H^2(S^1\vee S^2\vee S^3)$ is $0$ while the product of the generator of $H^1(S^1\times S^2)$ and the generator of $H^2(S^1\times S^2)$ is the generator of $H^3(S^1\times S^2)$.
Is this correct?

A: What you've said is correct, though of course it requires proof.


text:
Q: Bad Credentials when authenticating with active directory LDAP with Spring Security I am trying to use Spring Security to perform authentication and authorization in front of my REST controller, which is also secured with SSL. The code I have is mostly derived from the example at https://spring.io/guides/gs/authenticating-ldap/
The application works correctly using the embedded LDAP server as shown in the link. I connect to my home page https://localhost:9000/training/trackerHome and log in with the user "ben" and password "benspassword" (as specified in the link). Everything is fine.
But when I update my properties and try to connect to a real LDAP server, I just keep getting errors that say "Bad Credentials" on the login page. The error log looks like:
training-server_1    | 2020-11-10 17:07:23.728 DEBUG 1 --- [nio-8443-exec-2] o.s.security.web.FilterChainProxy        : /login at position 1 of 14 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
training-server_1    | 2020-11-10 17:07:23.728 DEBUG 1 --- [nio-8443-exec-2] o.s.security.web.FilterChainProxy        : /login at position 2 of 14 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
training-server_1    | 2020-11-10 17:07:23.729 DEBUG 1 --- [nio-8443-exec-2] w.c.HttpSessionSecurityContextRepository : HttpSession returned null object for SPRING_SECURITY_CONTEXT
training-server_1    | 2020-11-10 17:07:23.729 DEBUG 1 --- [nio-8443-exec-2] w.c.HttpSessionSecurityContextRepository : No SecurityContext was available from the HttpSession: org.apache.catalina.session.StandardSessionFacade@1b6d157. A new one will be created.
training-server_1    | 2020-11-10 17:07:23.730 DEBUG 1 --- [nio-8443-exec-2] o.s.security.web.FilterChainProxy        : /login at position 3 of 14 in additional filter chain; firing Filter: 'HeaderWriterFilter'
training-server_1    | 2020-11-10 17:07:23.730 DEBUG 1 --- [nio-8443-exec-2] o.s.security.web.FilterChainProxy        : /login at position 4 of 14 in additional filter chain; firing Filter: 'CsrfFilter'
training-server_1    | 2020-11-10 17:07:23.740 DEBUG 1 --- [nio-8443-exec-2] o.s.security.web.FilterChainProxy        : /login at position 5 of 14 in additional filter chain; firing Filter: 'LogoutFilter'
training-server_1    | 2020-11-10 17:07:23.740 DEBUG 1 --- [nio-8443-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/login'; against '/logout'
training-server_1    | 2020-11-10 17:07:23.741 DEBUG 1 --- [nio-8443-exec-2] o.s.security.web.FilterChainProxy        : /login at position 6 of 14 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'
training-server_1    | 2020-11-10 17:07:23.741 DEBUG 1 --- [nio-8443-exec-2] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/login'; against '/login'
training-server_1    | 2020-11-10 17:07:23.742 DEBUG 1 --- [nio-8443-exec-2] w.a.UsernamePasswordAuthenticationFilter : Request is to process authentication
training-server_1    | 2020-11-10 17:07:23.743 DEBUG 1 --- [nio-8443-exec-2] o.s.s.authentication.ProviderManager     : Authentication attempt using org.springframework.security.ldap.authentication.LdapAuthenticationProvider
training-server_1    | 2020-11-10 17:07:23.744 DEBUG 1 --- [nio-8443-exec-2] o.s.s.l.a.LdapAuthenticationProvider     : **Processing authentication request for user: john.doe**
training-server_1    | 2020-11-10 17:07:23.784 DEBUG 1 --- [nio-8443-exec-2] w.a.UsernamePasswordAuthenticationFilter : Authentication request failed: org.springframework.security.authentication.**BadCredentialsException: Bad credentials**
training-server_1    |
training-server_1    | org.springframework.security.authentication.BadCredentialsException: Bad credentials
training-server_1    |  at org.springframework.security.ldap.authentication.LdapAuthenticationProvider.doAuthentication(LdapAuthenticationProvider.java:197) ~[spring-security-ldap-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider.authenticate(AbstractLdapAuthenticationProvider.java:85) ~[spring-security-ldap-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:174) ~[spring-security-core-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:199) ~[spring-security-core-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:94) ~[spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212) ~[spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:124) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) [spring-security-web-5.1.1.RELEASE.jar!/:5.1.1.RELEASE]
training-server_1    |  at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212]
training-server_1    |  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212]
training-server_1    |  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.12.jar!/:9.0.12]
training-server_1    |  at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212]
training-server_1    |
training-server_1    | 2020-11-10 17:07:23.785 DEBUG 1 --- [nio-8443-exec-2] w.a.UsernamePasswordAuthenticationFilter : Updated SecurityContextHolder to contain null Authentication
training-server_1    | 2020-11-10 17:07:23.786 DEBUG 1 --- [nio-8443-exec-2] w.a.UsernamePasswordAuthenticationFilter : Delegating to authentication failure handler org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler@63d9b403
training-server_1    | 2020-11-10 17:07:23.786 DEBUG 1 --- [nio-8443-exec-2] .a.SimpleUrlAuthenticationFailureHandler : Redirecting to /login?error
training-server_1    | 2020-11-10 17:07:23.786 DEBUG 1 --- [nio-8443-exec-2] o.s.s.web.DefaultRedirectStrategy        : Redirecting to '/login?error'
training-server_1    | 2020-11-10 17:07:23.787 DEBUG 1 --- [nio-8443-exec-2] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
training-server_1    | 2020-11-10 17:07:23.787 DEBUG 1 --- [nio-8443-exec-2] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed

Part of my confusion is the handling of the password. I'm not sure what to specify, if anything, for the password encoder? I fear I may be encoding an already encoded password. I have tried all of the possible types of password encoder, and also not using a password encoder at all. Still get the Bad Credentials error.
application.properties when using embedded LDAP server:
ldap.server.url=ldap://localhost:8389/dc=springframework,dc=org
spring.ldap.username=
spring.ldap.password=
ldap.password.encoder=bcrypt
ldap.user.dn.pattern="uid={0},ou=people"
ldap.group.search.base="ou=groups"

# Configuration of Spring's embedded LDAP server (used for development and testing)
spring.ldap.embedded.ldif=classpath:test-server.ldif
spring.ldap.embedded.port=8389
spring.ldap.embedded.base-dn=dc=springframework,dc=org

test-server.ldif excerpt showing definition of user "ben"
dn: uid=ben,ou=people,dc=springframework,dc=org
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
cn: Ben Alex
sn: Alex
uid: ben
userPassword: $2a$10$c6bSeWPhg06xB1lvmaWNNe4NROmZiSpYhlocU/98HNr2MhIOiSt36

application.properties when using actual LDAP server:
ldap.server.url=ldap://125.126.127.128:389/DC=MY-LAB,DC=MY-COMPANY,dc=local
spring.ldap.username=MY-Lab\manager.doe
spring.ldap.password=validpassword
ldap.password.encoder=none
ldap.user.dn.pattern="uid={0},ou=MY-LAB"
ldap.group.search.base="ou=MY-LAB"

Actual LDAP Server structure:
DC=MY-LAB,DC=MY-COMPANY,DC=local[125.126.127.128]
    OU=Domain Controllers
    OU=MY-LAB
        OU=Users
            OU=Outside Users
                CN=Manager Doe
                      (User principal name = manager.doe)
                CN=John Doe
                      (User principal name = john.doe)

@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

  private static final Logger log = LoggerFactory.getLogger(WebSecurityConfig.class);

  @Value("${ldap.server.url}")
  private String ldapServerUrl;

  @Value("${spring.ldap.username}")
  private String ldapManagerDn;

  @Value("${spring.ldap.password}")
  private String ldapManagerPassword;

  @Value("${ldap.password.encoder}")
  private String ldapPasswordEncoder;

  @Value("${ldap.user.dn.pattern}")
  private String ldapUserDnPattern;

  @Value("${ldap.group.search.base}")
  private String ldapGroupSearchBase;

  @Override
  protected void configure(HttpSecurity http) throws Exception {
    http.authorizeRequests().anyRequest().fullyAuthenticated().and().formLogin();
  }

  @Override
  @SuppressWarnings("deprecation")
  public void configure(AuthenticationManagerBuilder auth) throws Exception {

    PasswordEncoder passwordEncoder;
    switch(ldapPasswordEncoder) {
      case "none":
        passwordEncoder = null;
        break;
      case "bcrypt":
        passwordEncoder = new BCryptPasswordEncoder();
        break;
      case "ldap":
        passwordEncoder = new LdapShaPasswordEncoder();
        break;
      case "MD4":
        passwordEncoder = new Md4PasswordEncoder();
        break;
      case "MD5":
        passwordEncoder = new MessageDigestPasswordEncoder("MD5");
        break;
      case "pbkdf2":
        passwordEncoder = new Pbkdf2PasswordEncoder();
        break;
      case "scrypt":
        passwordEncoder = new SCryptPasswordEncoder();
        break;
      case "SHA-1":
        passwordEncoder = new MessageDigestPasswordEncoder("SHA-1");
        break;
      case "SHA-256":
        passwordEncoder = new MessageDigestPasswordEncoder("SHA-256");
        break;
      case "sha256":
        passwordEncoder = new StandardPasswordEncoder();
        break;
      default:
        log.warn("password encoder property not specified. Using default value.");
        passwordEncoder = new BCryptPasswordEncoder();
    }

    if(passwordEncoder != null) {
      auth.ldapAuthentication().userDnPatterns(ldapUserDnPattern).groupSearchBase(ldapGroupSearchBase).contextSource().url(
          ldapServerUrl).managerDn(ldapManagerDn).managerPassword(ldapManagerPassword).and().passwordCompare().passwordEncoder(
              passwordEncoder).passwordAttribute("userPassword");
    } else {

auth.ldapAuthentication().userDnPatterns(ldapUserDnPattern).groupSearchBase(ldapGroupSearchBase).contextSource().url(
          ldapServerUrl).managerDn(ldapManagerDn).managerPassword(ldapManagerPassword).and().passwordCompare().passwordAttribute(
              "userPassword");
    }
  }
}

Any ideas what I've done wrong to make the authentication with the real LDAP server always return "Bad Credentials"?

A: What password encoder in your actual LDAP? You sure that ldap.password.encoder is equal to it. for example, if it is sha1, the value of ldap.password.encoder will be SHA-1. And if you want not to encode your password. please fix it as below. Hope it useful to you.
import org.springframework.security.crypto.password.NoOpPasswordEncoder;

    switch(ldapPasswordEncoder) {
      case "none":
        passwordEncoder = NoOpPasswordEncoder.getInstance();
        break;
     ....
   }


text:
Q: Libpcap compilation fail using MS Visual Studio 2012 I've been trying to create a program to analyze ethernet frames captured in pcap files using MS Visual Studio 2012 in C++. I have downloaded latest WinPcap (4.1.3) and Libpcap (1.7.2).
I've managed to include all the sub-folders in the extracted libpcap folder into my project (if I added only the root folder, the includes didn't work). And yet I have an error saying that there is no definition of type "Adapter". So I searched all the files in the Libpcap and haven't found the definition. I've also tried to search if it is maybe defined in some sort of standard library, again with no luck.
Am I missing something? Do I need to include the libpcap in some special way? (currently I'm just including #include <pcap.h>)
I've also tried to play a bit and commented the errorous line in pcap.h:
Adapter *pcap_get_adapter(pcap_t *p);

And I got a different error:

Error 2   error LNK2019: unresolved external symbol
  _pcap_open_offline_with_tstamp_precision

So after some reaserch I've found that I may be missing some preprocessor definitions (WIN32;WPCAP;HAVE_REMOTE). That triggered yet another problem, that header file Win32-Extensions.h couldn't be found. And after that I just gave up.
Thanks for any suggestions.

A: In order to use a class you need two things:

*

*A declaration. This one is in .h file and you have it;

*A definition. This one is inside the library (dynamic or static) the class is defined in. It seems, you miss this one. Have you linked to the library correctly? Please, check that, there is good chance that bad linking (or no linking) is the reason.

A:
I have downloaded latest WinPcap (4.1.3) ... unresolved external symbol _pcap_open_offline_with_tstamp_precision

The latest WinPcap is not based on the latest libpcap, or even on a relatively recent version of libpcap, so it doesn't have pcap_open_offline_with_tstamp_precision(), it only has pcap_open_offline().
The latest version of WinPcap also can't read pcap-ng files, or "pcap with nanosecond resolution" files, so it can't give you nanosecond-precision time stamps in any case.
If you want to be able to read files with nanosecond-precision time stamps and get nanosecond-resolution time stamp values from them, you'll have to run on a UN*X and use a newer version of libpcap; that's what you've done on Linux.
If you want to be able to run your program on Windows with WinPcap - or on versions of UN*Xes with older versions of libpcap - you'll have to use pcap_open_offline() to open capture files, and live with microsecond-resolution time stamps.

I have downloaded latest WinPcap (4.1.3) and Libpcap (1.7.2).

You can't just throw them together and hope that it works.  If you want to download the WinPcap and libpcap source, and try to merge them into an updated version of WinPcap, that will be a rather complicated project, and you'll probably need to study the source to both of them.
You may just want to install WinPcap, and the WinPcap developer's pack (yes, it says 4.1.2, but the 4.1.2 developer's pack works with 4.1.3, as the note says) and use that, and leave libpcap to the UN*X boxes.

A: *

*You should download and install WinPcap 4.1.3

*You should download WinPcap 4.1.2 SDK

*See "Examples-pcap\readfile\readfile.c" sample in the WinPcap 4.1.2 SDK archive. It will help to start.

If you have pcap-ng files or files with nanosecond precision, update your WinPcap library with WinPcap 4.1.3-libpcap 1.7.3 port


text:
Q: XSLT sorting on multiple attributes/element I am trying to sort on multiple attributes/elements. Sorting on @status and cci:ArtifactLocation works fine, however the same technique does not sort on cci:ArtifactLocation/@line attribute. I used XMLSpy 2014 and saxon9he.jar for testing with the same result. Do you know what may be wrong?

*

*input XML is the following:
    <?xml version="1.0" encoding="UTF-8"?>
<ValidatorResult xmlns="http://www.oracle.com/soa/fp/governance/auditor">
<Header>
  <SourceDirectory>file:/ade/ranchand_dte8052/oracle/work/CodeComplianceInspectorLrg/testData/AIADemo/</SourceDirectory>
  <SourceDirectoryMask>${inputDir}</SourceDirectoryMask>
  <DisplayLabel>AIADemo</DisplayLabel>
  <AssertionCatalog>AssertionCatalog-WS-I_12.1.3.0.0.xml</AssertionCatalog>
  <PoliciesFile>Policies-WS-I_12.1.3.0.0.xml</PoliciesFile>
  <Policy>Reusability Standards</Policy>
  <DateTime>AIA DEMO DATE OF EXECUTION</DateTime>
  <Version>AIA Build</Version>
</Header>
<PolicyResult name="Reusability Standards" total="1" failed="1" success="0" notExecuted="0">
  <AssertionResult priority="2" name="NoLocalSchemasInBPELCheck" category="Reusability Standards" failed="32" total="119" success="87">
    <Message>BPEL Process folder should not contain any schema files. All Utility schema should be accessed from a web server.</Message>
    <Result>Fail</Result>
    <ExecutionDetails>
        <Composite name="SamplesSyncCustomerPartyListEBF" version="1.0" success="2" failed="1">
  <Execution status="1">
            <ArtifactLocation>${inputDir}3.xTestData/EBFTargetNameSpacesCheck/SamplesSyncCustomerPartyListEBF/</ArtifactLocation>
          </Execution>
          <Execution status="0">
            <ArtifactLocation>${inputDir}3.xTestData/AIAServiceConfigFileForEBFExistsCheck/SamplesSyncCustomerPartyListEBF/</ArtifactLocation>
          </Execution>
          <Execution status="1">
            <ArtifactLocation>${inputDir}3.xTestData/wsdlRuntimeLocationExistForPlinkInEBFCheck/SamplesSyncCustomerPartyListEBF/</ArtifactLocation>
          </Execution>
        </Composite>
        <Composite name="AIADemoCreateShipmentRequestBatchProvABCSImpl" version="1.0" success="1" failed="0">
          <Execution status="1">
            <ArtifactLocation>${inputDir}samples/AIADemo/ProviderABCS/AIADemoCreateShipmentRequestBatchProvABCSImpl/</ArtifactLocation>
          </Execution>
        </Composite>
        <Composite name="MatchAccountSiebelReqABCSImpl" version="1.0" success="1" failed="0">
          <Execution status="1">
            <ArtifactLocation>${inputDir}Siebel/RequesterABCS/MatchAccountSiebelReqABCSImpl/</ArtifactLocation>
          </Execution>
        </Composite>
        <Composite name="CheckATPSalesOrderSiebelFusionDOOABF" version="1.0" success="9" failed="2">
          <Execution status="1">
            <ArtifactLocation line="400" col="46">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
  <Execution status="1">
    <ArtifactLocation line="131" col="46">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
          <Execution status="1">
            <ArtifactLocation line="159" col="54">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
          <Execution status="1">
            <ArtifactLocation line="186" col="45">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
          <Execution status="1">
            <ArtifactLocation line="221" col="33">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
          <Execution status="0">
            <ArtifactLocation line="238" col="82">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
          <Execution status="1">
            <ArtifactLocation line="249" col="43">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
          <Execution status="1">
            <ArtifactLocation line="264" col="56">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
          <Execution status="0">
            <ArtifactLocation line="345" col="50">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
          <Execution status="1">
            <ArtifactLocation line="376" col="39">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
          <Execution status="1">
            <ArtifactLocation line="104" col="99">${inputDir}ApplicationBusinessFlow/CheckATPSalesOrderSiebelFusionDOOABF/CheckATPSalesOrderSiebelFusionDOOABF.bpel</ArtifactLocation>
          </Execution>
        </Composite>
    </ExecutionDetails>
  </AssertionResult>
</PolicyResult>

XSLT transformation is the following:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cci="http://www.oracle.com/soa/fp/governance/auditor" exclude-result-prefixes="cci">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="cci:ExecutionDetails">
        <xsl:copy>
            <xsl:apply-templates select="cci:Composite">
                <xsl:sort select="@name" lang="en" data-type="text" order="ascending"/>
            </xsl:apply-templates>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="cci:Composite">
        <xsl:copy>
            <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
            <xsl:attribute name="version"><xsl:value-of select="@version"/></xsl:attribute>
            <xsl:attribute name="success"><xsl:value-of select="@success"/></xsl:attribute>
            <xsl:attribute name="failed"><xsl:value-of select="@failed"/></xsl:attribute>
            <xsl:choose>
                <xsl:when test="not(cci:Composite/cci:ArtifactLocation/@line)">
                    <xsl:apply-templates select="cci:Execution">
                        <xsl:sort select="@status" data-type="number"/>
                        <xsl:sort select="cci:ArtifactLocation" lang="en" case-order="lower-first" order="ascending"/>
                    </xsl:apply-templates>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:apply-templates select="cci:Execution">
                        <xsl:sort select="@status" data-type="number"/>
                        <xsl:sort select="cci:ArtifactLocation" lang="en" case-order="lower-first" order="ascending"/>
                        <xsl:sort select="cci:ArtifactLocation/@line" data-type="number" order="ascending"/>
                    </xsl:apply-templates>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="cci:Execution">
        <xsl:copy>
            <xsl:attribute name="status"><xsl:value-of select="@status"/></xsl:attribute>
            <xsl:apply-templates select="cci:ArtifactLocation"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="cci:ArtifactLocation">
        <xsl:copy-of select="."/>
    </xsl:template>
</xsl:stylesheet>

For the benefit of the public, here's the answer to this question:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cci="http://www.oracle.com/soa/fp/governance/auditor" exclude-result-prefixes="cci">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="cci:ExecutionDetails">
        <xsl:copy>
            <xsl:apply-templates select="cci:Composite">
                <xsl:sort select="@name" lang="en" data-type="text" order="ascending"/>
            </xsl:apply-templates>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="cci:Composite">
        <xsl:copy>
            <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
            <xsl:attribute name="version"><xsl:value-of select="@version"/></xsl:attribute>
            <xsl:attribute name="success"><xsl:value-of select="@success"/></xsl:attribute>
            <xsl:attribute name="failed"><xsl:value-of select="@failed"/></xsl:attribute>
            <xsl:apply-templates select="cci:Execution">
                <xsl:sort select="@status" data-type="number"/>
                <xsl:sort select="cci:ArtifactLocation" lang="en" case-order="lower-first" order="ascending"/>
                <xsl:sort select="cci:ArtifactLocation/@line" data-type="number" order="ascending"/>
            </xsl:apply-templates>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="cci:Execution">
        <xsl:copy>
            <xsl:attribute name="status"><xsl:value-of select="@status"/></xsl:attribute>
            <xsl:apply-templates select="cci:ArtifactLocation"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="cci:ArtifactLocation">
        <xsl:copy-of select="."/>
    </xsl:template>
</xsl:stylesheet>

A: AFAICT, the test  in:
<xsl:when test="not(cci:Composite/cci:ArtifactLocation/@line)">

will always return true, because this is done from the context of cci:Composite, therefore the (relative) path cci:Composite/cci:ArtifactLocation/@line selects nothing. So you are not really sorting by cci:ArtifactLocation/@line after all.


text:
Q: Cannot Insert Image In To Static Block I need to change the front banner of my site, but the button to "Insert Image" in to the static block does nothing when you click it. None of the buttons do.
I also wanted to make a coupon code and when I tried to click to make the rule that button now also does nothing.
I notice at the bottom of my browser this comes up - javascript:void(0) when trying to do the coupons, but not when trying to change the image.
Our web designer has recently been making changes to the site to speed things up a bit but these buttons seem not to be working ever since he's been doing so.
So my question I suppose is - has he messed up somewhere? Or is there an issue in Magento that I've missed that will fix this?
It's Black Friday tomorrow so getting the site updated is quite important!
Many Thanks.


text:
Q: XML to POJO Mapping I have a service that does the following:

*

*receives different XML requests

*turns them into JIBX-generated Java objects

*maps the JIBX-generated Java objects into POJOs

*sends the POJOs to another service

*gets a POJO response back

*maps POJO back into JIBX-generated Java objects

*turns JIBX-generated Java objects back into XML

*returns XML to client.

I'd like to make this process more efficient. Can anyone suggest how? Can JIBX map directly into my POJOs?

A: Yes Jibx can map directly to your POJOs using Jibx mapping files. I think the below link will be very helpful to understand Jibx binding.
Jibx Introduction

A: In this you needed library which is available in the url(4shared.com) commented in comments.
 package com.xml.Sample.MainP;

    import java.io.File;
    import java.util.List;

    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;

    import org.w3c.dom.Document;

    import com.xml.Sample.Actions.XMLAction;
    import com.xml.Sample.Model.States;

    public class Retrieve {
        public static String XMLModelName = "com.xml.Sample.Model.States";
        private static String cities = "E:\\Webeclipseworkspace\\Samples\\src\\Srates.xml";

        public static void main(String[] args) {
            try {
                DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
                DocumentBuilder db = dbf.newDocumentBuilder();
                File f = new File(cities);
                Document doc = db.parse(f);
                doc.getDocumentElement().normalize();
                XMLAction xmla = new XMLAction();
                List<States> listXML = xmla.readData(XMLModelName, doc);
                // System.out.println(listXML);
                String xmlData = xmla.writtingData(listXML);
                System.out.println(xmlData);

            } catch (Exception e) {
                // TODO: handle exception
                System.out.println(e);
            }
        }

    }

    package com.xml.Sample.Model;

    import com.xml.Sample.XMLAnn.XMLColumn;
    import com.xml.Sample.XMLAnn.XMLReport;

    @XMLReport(reportName = "row")
    public class Directory {

        private String city_id;
        private String city_name;
        private String state_id;

        @XMLColumn(label = "city_id")
        public String getCity_id() {
            return city_id;
        }

        public void setCity_id(String city_id) {
            this.city_id = city_id;
        }

        @XMLColumn(label = "city_name")
        public String getCity_name() {
            return city_name;
        }

        public void setCity_name(String city_name) {
            this.city_name = city_name;
        }

        @XMLColumn(label = "state_id")
        public String getState_id() {
            return state_id;
        }

        public void setState_id(String state_id) {
            this.state_id = state_id;
        }

    }

Here I Created Own Library For Converting Pojo classes to xml and xml to pojo classes.
Use Below Link(4Shared.com) at Comments to download Library to add for The Above Code.

A: String(XML in String) to List
1. FolderItem.java

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@XmlAccessorType(XmlAccessType.FIELD)
public class FolderItem {
    long itemId ;
       String itemName;
       String itemType;
       String description;
       String[] tags;
       String path;
/* setters and getters
   Annotations not required*/
}

2. FolderItems.java

import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class FolderItems {
    @XmlElement
    private List<FolderItem> folderItem;
/* setter and getter */
}

3. Testing--main method

class Test{
public static void main(String[] args) throws Exception {
   FolderItems f = (FolderItems)strToVo(content, FolderItems.class);
   System.out.println(f);
}
static Object strToVo(String content, Class c) throws JAXBException {
        JAXBContext jc = JAXBContext.newInstance(c);
        Unmarshaller unmarshaller = jc.createUnmarshaller();
        return unmarshaller.unmarshal(new InputSource(new StringReader(content)));
    }
}

4. XML in String

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<FolderItems>
    <folderItem>
        <description>Lapse notice invoice for additional interests/additional insureds</description>
        <itemId>480004439</itemId>
        <itemName>Lapse_Invoice_AI</itemName>
        <itemType>application/x-thunderhead-ddv</itemType>
        <path>/Templates/Billing Center/Lapse_Invoice_AI</path>
        <tags></tags>
    </folderItem>
</FolderItems>


text:
Q: Determining if an app has quit using XCTest UI tests A certain function in my iOS Swift app will quit the app if the build is deemed to be invalid (out of date etc.).
How do I use XCTest to determine if the app has successfully quit and has returned the simulator to the homescreen?
I've tried the obvious ways like
XCTAssertFalse(XCUIApplication().exists, "app should have quit")

and
XCTAssertFalse(XCUIApplication().enabled, "app should have quit")

if I try and do any operations on XCUIApplication it hangs.

A: You can register an observer in the NSNotificationCenter for UIApplicationDidEnterBackgroundNotification and in your tests, if the build is found to be out of date, make a test exception:
let expectation = expectationWithDescription("myDescription")

waitForExpectationsWithTimeout(10) { error in
}

and in your notification handler:
func someHandler() {
    expectation.fulfill()
    //unregister the observer
}

That way if the notification is posted, the expectation will be fulfilled, otherwise the test will fail. Be sure to only set up this case if the build is outdated, otherwise it will always fail if the notification isn't posted.


text:
Q: Too many connections to db error, after adding an ajax auto save I have PHP site with MySql data base
I just added automatic save for a text area
and one of the users received the following error:
Too many connections in ...Unable to connect to database
maybe I have to change my ajax auto save:
bkLib.onDomLoaded(function(){
  var myEditor = new nicEditor({iconsPath : 'include/nicEdit/nicEditorIcons.gif'}).panelInstance('area1');

  auto_save_func(myEditor);

});

function auto_save_func(myEditor)
{

        draft_content=myEditor.instanceById('area1').getContent();

        int_id='<?=$_GET[interview_id]?>';

        $.post("ajax_for_auto_save_interview.php", { interview_id: int_id,content:draft_content},
    function(data){ });

    setTimeout( function() { auto_sav_func(myEditor); }, 100);

}

in the page "ajax_for_auto_save_interview.php" I`m including the connection to the DB.

A: *

*First thing is you should close your mysql connection every time you open it after your usage.

*You can have a javascript variable to check whether an AJAX call is already issued and is it finished or not. Only if it is finished, you can re-issue new call

Like this:
var isAjaxStarted = 0;
bkLib.onDomLoaded(function(){
  var myEditor = new nicEditor({iconsPath : 'include/nicEdit/nicEditorIcons.gif'}).panelInstance('area1');

  if(isAjaxStarted == 0)
      auto_save_func(myEditor);

});

function auto_save_func(myEditor)
{
        isAjaxStarted = 1;
        draft_content=myEditor.instanceById('area1').getContent();

        int_id='<?=$_GET[interview_id]?>';

        $.post("ajax_for_auto_save_interview.php", { interview_id: int_id,content:draft_content},
    function(data){ isAjaxStarted = 0; });

    setTimeout( function() { auto_sav_func(myEditor); }, 100);

}

A: maybe I am writing late you help in place it? thank you very much
<script type="text/javascript">
 bkLib.onDomLoaded(function() {
      var myNicEditor = new nicEditor({buttonList : ['bold','italic','underline','strikethrough','left','center','right','justify',/*'ol','ul',*/'forecolor',/*'fontSize','fontFamily',*//*'fontFormat',*//*'indent','outdent',*/'image','upload','link','unlink'/*,'bgcolor'*/,'hr','removeformat', 'youTube'/*,'subscript','superscript'*/],/*fullPanel : true,*/
      iconsPath : '<? echo "".$IndirizzoPagina."".$IndirizzoCartella."";?>default/image/EditorDiTesto/nicEditorIcons.gif'});
      myNicEditor.setPanel('myNicPanel'); //PANNELLO DI CONTROLLO
      myNicEditor.addInstance('titolo'); //TITOLO
      myNicEditor.addInstance('contenuto'); //CONTENUTO
 });

<textarea name='contenuto' id='contenuto' class='box2'>".$ContenutoNotizia."</textarea>"

i used this code http://nicedit.com/


text:
Q: How to connect Child Row in Expandable List View to a specific row in an SQL Database Table I am trying to make some kind of a catalog type android application. The catalog is about some materials. My idea is using an Expandable List View which consists Child Rows. The Child Rows are filled with clickable texts, which are material names, and will show the material's data in an Alert Dialog (Marking, Quantity, Profile, Length, Weight, Total Weight). The material's database was made in DB Browser and kept in the assets folder in Android Studio.
Here is the database table (sample):

Here is the Expandable List View activity:

Here is the code:
DatabaseHelper.java
package com.example.sutetpedia;

import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.util.Log;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class DatabaseHelper extends SQLiteOpenHelper {

    String DB_PATH = null;
    private static String DB_NAME = "marking";
    public static final String TABLE_NAME = "MARKING_DATA";
    private SQLiteDatabase myDataBase;
    private final Context myContext;

    public DatabaseHelper(Context context) {
        super(context, DB_NAME, null, 10);
        this.myContext = context;
        this.DB_PATH = "/data/data/" + context.getPackageName() + "/" + "databases/";
        Log.e("Path 1", DB_PATH);
    }

    private boolean checkDataBase() {
        SQLiteDatabase checkDB = null;
        try {
            String myPath = DB_PATH + DB_NAME;
            checkDB = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);
        } catch (SQLiteException e) {
        }
        if (checkDB != null) {
            checkDB.close();
        }
        return checkDB != null ? true : false;
    }

    public void openDataBase() throws SQLException {
        String myPath = DB_PATH + DB_NAME;
        myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READONLY);

    }

    @Override
    public synchronized void close() {
        if (myDataBase != null)
            myDataBase.close();
        super.close();
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }

    public Cursor getRow(String key){
        SQLiteDatabase db = this.getWritableDatabase();
        Cursor res = db.rawQuery("select * from " + TABLE_NAME + "where marking = "+key,null);

        return res;
    }

}

MyExpandableListAdapter.java
package com.example.sutetpedia;

import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.TextView;
import com.example.sutetpedia.DatabaseHelper;
import android.widget.Toast;

import com.example.sutetpedia.ChildRow;
import com.example.sutetpedia.ParentRow;
import com.example.sutetpedia.R;

import java.util.ArrayList;

public class MyExpandableListAdapter extends BaseExpandableListAdapter {

    DatabaseHelper myDb;
    String key;

    private Context context;
    private ArrayList<ParentRow> parentRowList;

    private ArrayList<ParentRow> originalList;

    public MyExpandableListAdapter(Context context
            , ArrayList<ParentRow> originalList) {
        this.context = context;
        this.parentRowList = new ArrayList<>();
        this.parentRowList.addAll(originalList);

        this.originalList = new ArrayList<>();
        this.originalList.addAll(originalList);
    }

    @Override
    public int getGroupCount() {
        return parentRowList.size();
    }

    @Override
    public int getChildrenCount(int groupPosition) {
        return parentRowList.get(groupPosition).getChildList().size();
    }

    @Override
    public Object getGroup(int groupPosition) {
        return parentRowList.get(groupPosition);
    }

    @Override
    public Object getChild(int groupPosition, int childPosition) {
        return parentRowList.get(groupPosition).getChildList().get(childPosition);
    }

    @Override
    public long getGroupId(int groupPosition) {
        return groupPosition;
    }

    @Override
    public long getChildId(int groupPosition, int childPosition) {
        return childPosition;
    }

    @Override
    public boolean hasStableIds() {
        return true;
    }

    @Override
    public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
        ParentRow parentRow = (ParentRow) getGroup(groupPosition);

        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater)
                    context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            convertView = layoutInflater.inflate(R.layout.parent_row, null);

        }

        TextView heading = (TextView) convertView.findViewById(R.id.parent_text);

        heading.setText(parentRow.getName().trim());
        return convertView;
    }

    @Override
    public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView, ViewGroup parent) {
        ChildRow childRow = (ChildRow) getChild(groupPosition, childPosition);
        if (convertView == null) {
            LayoutInflater layoutInflater = (LayoutInflater)
                    context.getSystemService(context.LAYOUT_INFLATER_SERVICE);
            convertView = layoutInflater.inflate(R.layout.child_row, null);
        }

        final TextView childText = (TextView) convertView.findViewById(R.id.child_text);
        childText.setText(childRow.getText().trim());
        final View finalConvertView = convertView;
        childText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Cursor res = myDb.getRow(key);
                if(res.getCount() == 0) {
                    // show message
                    showMessage("Error","Nothing found");
                    return;
                }
                StringBuffer buffer = new StringBuffer();
                while (res.moveToNext()) {
                    buffer.append("Marking :"+ res.getString(0)+"\n");
                    buffer.append("Quantity :"+ res.getString(1)+"\n");
                    buffer.append("Profile :"+ res.getString(2)+"\n");
                    buffer.append("Length :"+ res.getString(3)+"\n\n");
                    buffer.append("Weight :"+ res.getString(4)+"\n\n");
                    buffer.append("Total Weight :"+ res.getString(5)+"\n\n");
                }

                // Show all data
                showMessage("Data",buffer.toString());

            }
        });

        return convertView;
    }

    public void showMessage(String title,String Message){
        AlertDialog.Builder builder = new AlertDialog.Builder(context);
        builder.setCancelable(true);
        builder.setTitle(title);
        builder.setMessage(Message);
        builder.show();
    }

    @Override
    public boolean isChildSelectable(int groupPosition, int childPosition) {
        return true;
    }

    public void filterData(String query) {
        query = query.toLowerCase();
        parentRowList.clear();

        if (query.isEmpty()) {
            parentRowList.addAll(originalList);
        }
        else {
            for (ParentRow parentRow : originalList) {
                ArrayList<ChildRow> childList = parentRow.getChildList();
                ArrayList<ChildRow> newList = new ArrayList<ChildRow>();

                for (ChildRow childRow: childList) {
                    if (childRow.getText().toLowerCase().contains(query)) {
                        newList.add(childRow);
                    }
                } // end for (com.example.user.searchviewexpandablelistview.ChildRow childRow: childList)
                if (newList.size() > 0) {
                    ParentRow nParentRow = new ParentRow(parentRow.getName(), newList);
                    parentRowList.add(nParentRow);
                }
            } // end or (com.example.user.searchviewexpandablelistview.ParentRow parentRow : originalList)
        } // end else

        notifyDataSetChanged();
    }
}

I run the code into my device and it successfully compiled. But when I clicked one of the Child Rows, the application stops after a few seconds.
Please tell me if there is anything I should change in my code. Thanks before!


text:
Q: Spring Cloud Config in Docker container is not accessible I have a relatively simple setup. A Spring Could Config server, and a Spring Cloud Eureka server. (I refer Eureka server as Discover everywhere in my config...) The config server uses a Git repository for finding the appropriate config.
Everything is in Docker containers. I use docker-compose to build my services. The Gateway server should wait for config server to come up. I'll provide the source of the file further down.
So, when I build and start the containers, the discovery (Eureka) server doesn't want to come up. It exits with an exception. It is really long, so I just add the most important part here:
019-01-27 23:52:17,494 [INFO  ] o.s.c.c.c.ConfigServicePropertySourceLocator.getRemoteEnvironment [main] – Fetching config from server at : http://tao-elszamolas-config:9001
2019-01-27 23:52:17,898 [INFO  ] o.s.c.c.c.ConfigServicePropertySourceLocator.getRemoteEnvironment [main] – Connect Timeout Exception on Url - http://tao-elszamolas-config:9001. Will be trying the next url if available
2019-01-27 23:52:17,902 [ERROR ] o.s.b.SpringApplication.reportFailure [main] – Application run failed
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
... Something...Something
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://tao-elszamolas-config:9001/discovery-server/prod": Connection refused (Connection refused); nested exception is java.net.ConnectException: Connection refused (Connection refused)
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:743) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:669) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:578) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:218) ~[spring-cloud-config-client-2.1.0.RC3.jar!/:2.1.0.RC3]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:96) ~[spring-cloud-config-client-2.1.0.RC3.jar!/:2.1.0.RC3]
    ... 15 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[?:?]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[?:?]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[?:?]
    at java.net.Socket.connect(Socket.java:591) ~[?:?]
    at java.net.Socket.connect(Socket.java:540) ~[?:?]
    at sun.net.NetworkClient.doConnect(NetworkClient.java:182) ~[?:?]
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:474) ~[?:?]
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:569) ~[?:?]
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:242) ~[?:?]
    at sun.net.www.http.HttpClient.New(HttpClient.java:341) ~[?:?]
    at sun.net.www.http.HttpClient.New(HttpClient.java:362) ~[?:?]
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1242) ~[?:?]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181) ~[?:?]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1075) ~[?:?]
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1009) ~[?:?]
    at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:76) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:734) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:669) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:578) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:218) ~[spring-cloud-config-client-2.1.0.RC3.jar!/:2.1.0.RC3]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:96) ~[spring-cloud-config-client-2.1.0.RC3.jar!/:2.1.0.RC3]
    ... 15 more

The only exception what I found in the Config server log is the one complaining about the connection to Discovery (Eureka) server. Yes, I try to register my config service inEureka for looking it up at startup of further microservices.
The connection is refused which means, the config server is not running at the time when Eureka server is trying to get its config or it is not listening on the given port, 9001.
How is it possible? I used the depends_on in my compose file, so it should wait for that.
Or why it finishes working? If I do the same thing on local without docker then it keeps trying to connect to Config, until the config server starts up. I'd like achieve the same behaviour using Docker.
Any advice would be appreciated!
And finally here are my config files:
docker-compose.yml:
 version: "3"
   services:
     tao-elszamolas-config:
       build: ./tao-elszamolas-config
       container_name: tao-elszamolas-config
       ports:
         - "9001:9001"
       volumes:
         - "/tao-elszamolas/logs:/var/log/tao-elszamolas"
       networks:
         - taonetwork

       tao-elszamolas-discovery:
         build: ./tao-elszamolas-discovery
         container_name: tao-elszamolas-discovery
         depends_on:
           - tao-elszamolas-config
         ports:
           - "9002:9002"
         volumes:
           - "/tao-elszamolas/logs:/var/log/tao-elszamolas"
         networks:
           - taonetwork

   networks:
     taonetwork:
       driver: bridge

Dockerfile of Config Server:
 FROM openjdk:11-jdk-slim
 MAINTAINER BeszterceKK
 COPY ./tao-elszamolas-config.jar /usr/src/taoelszamolas/tao-elszamolas-config.jar
 WORKDIR /var/log/tao-elszamolas
 WORKDIR /usr/src/taoelszamolas
 ENV SPRING_PROFILES_ACTIVE prod
 EXPOSE 9001
 ENTRYPOINT ["java", "-DlogFileLocation=/var/log/tao-elszamolas", "-jar", "tao-elszamolas-config.jar"]

application.yml for Config server:
server:
  port: 9001

spring:
  application:
    name: config-server
  cloud:
    config:
      server:
        git:
          uri: https://github.com/something/something
          username: something
          password: something
          skip-ssl-validation: true
  security:
    user:
      name: something
      password: something

eureka:
  client:
    serviceUrl:
      defaultZone: http://something:something@tao-elszamolas-discovery:9002/eureka/

info:
  artifact: tao-elszamolas-config
  name: TAO Elszamolas Config Application
  description: Tao elszamolas microservice elosztott szolgaltatas konfiguracio
  version: 1.0.0

Dockerfile of Discovery (Eureka) Server:
FROM openjdk:11-jdk-slim
MAINTAINER BeszterceKK
COPY ./tao-elszamolas-discovery.jar /usr/src/taoelszamolas/tao-elszamolas-discovery.jar
WORKDIR /var/log/tao-elszamolas
WORKDIR /usr/src/taoelszamolas
ENV SPRING_PROFILES_ACTIVE prod
EXPOSE 9002
ENTRYPOINT ["java", "-DlogFileLocation=/var/log/tao-elszamolas", "-jar", "tao-elszamolas-discovery.jar"]

bootstrap.yml for Discovery (Eureka) server:
spring:
  application:
    name: discovery-server
  cloud:
    config:
      fail-fast: true
      name: discovery-server
      uri: http://tao-elszamolas-config:9001
      username: something
      password: something

application.yml for Discovery (Eureka) server:
server:
  port: 9002

eureka:
  instance:
    hostname: tao-elszamolas-discovery
  client:
    registerWithEureka: false
    fetchRegistry: false
    serviceUrl:
      defaultZone: http://tao-elszamolas-discovery:9002/eureka

info:
  artifact: tao-elszamolas-discovery
  name: TAO Elszamolas Eureka Szolgaltatas monitor
  description: Tao elszamolas automatikus szolgaltatas regisztracio
  version: 1.0.0

And finally, this is how I start my containers. It is simply:
docker-compose up -d

The whole application stack works on local without Docker. So I guess the problem is with my Docker configuration.
One more thing to mention, generally, I don't want to publish the ports to host, only expose them on my custom network between the containers. This is why I tried to replace the PORTS with EXPOSE, but it didn't really help.

A:
for startup Compose does not wait until a container is "ready" (whatever that means for your particular application) - only until it's running

So, you should refer : https://docs.docker.com/compose/startup-order/
for wait until for config server container is ready first (already listened on port 9001), then starting Eureka server container.

A: You registry service try to start before configuration service is up. You have to force him to wait.
You can do it with condition: service_started, like below. But I think it is not working with version 3
version: '2.1'

# ...

tao-elszamolas-discovery:
    build: ./tao-elszamolas-discovery
    container_name: tao-elszamolas-discovery
    depends_on:
        - tao-elszamolas-config:
            condition: service_started
    ports:
        - "9002:9002"
    volumes:
        - "/tao-elszamolas/logs:/var/log/tao-elszamolas"
    networks:
        - taonetwork

A solution for version 3 is to use healthcheck and restart: on-failure
Take a look at this post
Another solution is to use entrypoint section to launch a batch file at start which is pinging configuration service container while it is not responding.


text:
Q: Combining multiple AC/DC adapters Many of us have lots of devices that uses AC mains (110V/220V) to DC (typically 12VDC) adapters. There's my LED table lamp, my Wi-Fi router, my Gigabit switch, my powered USB hub,.....
Such AC/DC adapters are dirt cheap from China, so I highly doubt efficiency is built into them.
So here's my idea. Can I somehow combine all these into a single device; do the AC/DC conversion once and have everyone tap the DC line, instead of each doing the conversion themselves?

A: Yes, devices of the same voltage can be run from the same supply.
For this you would need a (preferably decent quality regulated) 12V supply that is capable of sourcing more than the total (max) current draw of all your devices combined. If you have other devices at e.g. 9V you would need a supply with a 9V and 12V output.
The required info re current draw is usually written on the device somewhere, or in it's manual. You can also use the rating info on the adapter it came with as a guide.
For instance (for 12V devices) if device 1 draws 100mA max, device 2 200mA max and device 3 500mA max, you need a supply capable of supplying at least 800mA @ 12V.
For high current draws, a SMPS will be preferable to a simple linear supply. These will be much smaller/lighter in comparison.

A: Largely "connect away".
 As long as the voltage is as required and the current supply is at last capable of meeting the maximum load current then it should work.
BUT
Be aware that some devices that appear to be just voltage sources may be more complex. This is unusual but not unknown.
eg If the output voltage measures a steady 4.1 to 4.2V open circuit and does not change much when loaded with eg a 20 ohm resistor then it is quite likely that it is a Lithium Ion charger. Using a simple higher current capable 4.2V source in its place would probably be utterly disastrous. I once needed to charge a LiIon battery when I did not have the correct charger while in China. I took the first available no-name power pack and measured its voltage, intending to make my own lashup charger. Eureka! 4.2V :-). As long as current max at 4.2V <= 1C for battery concerned it will probably charge OK.
Some few pieces of equipment need several voltages simultaneously and may care about applied and removed order or voltage ramp up rates etc. This is rare but happens. Examples may be printers which may have a 20 to 30 V supply (inkjet printhead?) and a 5V supply.
Some supplies have a complex current / voltage / time map that enables communication between supply and powered device re supply capability and device needs. An example is older Ericsson cell phones which accept 5V to 9V in but make decisions about subsequent charging which depend on how the charger responds to initial loading. Use of a much higher current supply than needed would probably be OK. Probably.
Some manufacturers make it hard in some or all cases to connect supplies other than their own. Unrecognized supplies will usually just not work rather than producing magic smoke. But caveat experimentator.
Apple is well known for this, Dell in some cases, Motorola in some cases, others perhaps.

A:
Such AC/DC adapters are dirt cheap from China, so I highly doubt efficiency is built into them.

au contraire -- almost all of them are switching converters nowadays (the high frequency magnetics + controllers are smaller and cheaper than a 60Hz transformer)

So here's my idea. Can I somehow combine all these into a single device; do the AC/DC conversion once and have everyone tap the DC line, instead of each doing the conversion themselves?

Yes, just make a box with a bunch of cables + connectors that match the devices you want to plug into.


text:
Q: Any one help me to solve this i try my best but did not solve this? ItemName    Price   CreatedDateTime
New Card    50.00   2014-05-26 19:17:09.987
Recharge    110.00  2014-05-26 19:17:12.427
Promo       90.00   2014-05-27 16:17:12.427
Membership  70.00   2014-05-27 16:17:12.427
New Card    50.00   2014-05-26 19:20:09.987

Out Put : Need a query which Sum the sale of Current hour and
sale of item which have maximum sale in that hour in breakdownofSale
Column.
Hour    SaleAmount  BreakDownOfSale
19      210         Recharge
16      160         Promo

A: This should do it
create table #t
(
    ItemName varchar(50),
    Price decimal(18,2),
    CreatedDateTime datetime
);

set dateformat ymd;

insert into #t values('New Card', 50.00, '2014-05-26 19:17:09.987');
insert into #t values('Recharge', 110.00, '2014-05-26 19:17:12.427');
insert into #t values('Promo', 90.00, '2014-05-27 16:17:12.427');
insert into #t values('Membership', 70.00, '2014-05-27 16:17:12.427');
insert into #t values('New Card', 50.00, '2014-05-26 19:20:09.987');

with cte as
(
    select datepart(hh, CreatedDateTime) as [Hour],
        ItemName,
        Price,
        sum(Price) over (partition by datepart(hh, CreatedDateTime)) SaleAmount,
        ROW_NUMBER() over (partition by datepart(hh, CreatedDateTime) order by Price desc) rn
    from #t
)
select Hour,
    SaleAmount,
    ItemName
from cte
where rn = 1

A: Though i am not clear with the question, based on your desired output, you may use the query as below.
SELECT DATEPART(HOUR,CreatedDateTime) AS Hour, sum(Price) AS Price, ItemName AS BreakDownOfSale  from TableName WHERE  BY ItemName,DATEPART(HOUR,CreatedDateTime)

Replace table name and column name with the actual one.
Hope this helps!

A: Here is the sample query.
You can use SQL Server Windows functions to get the result you need.
DECLARE @Table TABLE
(
    ItemName NVARCHAR(40),
    Price DECIMAL(10,2),
    CreatedDatetime DATETIME
)

-- Fill table.
INSERT INTO @Table
    ( ItemName, Price, CreatedDatetime )
VALUES
    ( N'New Card'  ,  50.00 ,  '2014-05-26 19:17:09.987'   ),
    ( N'Recharge'  ,  110.00 , '2014-05-26 19:17:12.427' )  ,
    ( N'Promo'     ,  90.00 ,  '2014-05-27 16:17:12.427' ) ,
    ( N'Membership' , 70.00  , '2014-05-27 16:17:12.427' ) ,
    ( N'New Card'  ,  50.00 ,  '2014-05-26 19:20:09.987' )

-- Check record(s).
SELECT * FROM @Table

-- Get record(s) in required way.
;WITH T1 AS
(
    SELECT
        DATEPART(HOUR, T.CreatedDatetime) AS Hour,
        CONVERT(DATE, T.CreatedDatetime) AS Date,
        T.ItemName AS BreakDownOfSales,
        -- Date and hour both will give unique record(s)
        SUM(Price) OVER (PARTITION BY CONVERT(DATE, T.CreatedDatetime), DATEPART(HOUR, CreatedDateTime)) AS SaleAmount,
        ROW_NUMBER() OVER(PARTITION BY CONVERT(DATE, T.CreatedDatetime), DATEPART(HOUR, T.CreatedDatetime) ORDER BY T.Price DESC) AS RN
    FROM
        @Table T
)
SELECT
    T1.Date ,
    T1.Hour ,
    T1.SaleAmount,
    T1.BreakDownOfSales
FROM
    T1
WHERE T1. RN = 1
ORDER BY
    T1.Hour

A:
Check this simple solution, Please convert it to SQL Server Query.

This will give you perfect result even if you have multiple date data.

SELECT HOUR(CreatedDateTime), SUM(Price),
    (SELECT itemname FROM t it WHERE HOUR(ot.CreatedDateTime) = HOUR(it.CreatedDateTime) AND
        DATE(ot.CreatedDateTime) = DATE(it.CreatedDateTime)
        GROUP BY itemname
        ORDER BY price DESC
        LIMIT 1
    ) g
FROM t ot
GROUP BY HOUR(CreatedDateTime);


text:
Q: munin-node installation on 10.7 OSX host We've got a pretty good setup in house for using nagios + munin-node to monitor the various boxes.
having some trouble getting munin-node going on our first OSX server (10.7 mac mini server model)
the only guide i was able to find is http://munin-monitoring.org/wiki/DarwinInstallation - but it leaves much to be desired.
anyone have any experience, or guides for getting munin-node going on an OSX box?


text:
Q: Built-in webcam not working I have a Lenovo G550 (model 20023) laptop with a built in webcam running on Windows 7. The camera recently just stopped working and it isn't shown under imaging devices. I've uninstalled and reinstalled, updated drivers, tried everything. How can I know if its broken or not? Keep in mind I got this laptop from 2010.
Thanks in advance

A: The fact that it's not detecting as an anything at all is pretty telling, especially in an 8-year-old laptop.  If you were to disassemble it, chances are the only thing connecting that laptop to its camera is a thin wire that is soldered on one end to the motherboard, or a ribbon cable that is usually not insulated.  In both cases, solder can crack and ribbons can degrade.
The best thing you can do is boot it with a Linux CD and have Linux drivers on hand to load for your camera.   If the camera still isn't detected, you know it's done for.  If it is, something may be preventing it from being loaded in Windows, which is a security concern.   Chances are, it's just dead.