text:
Q: Unable To Remote Connect To Mongo CLI. Do different versions matter? I have three mongo instances running where one is a higher version. The reason is that mongochat02 is a newly provisioned server and the installed version came with 3.2.9.

*

*mongochat01 - v3.0.8

*mongochat02 - v3.2.9

*mongochat03 - v3.0.8

I am able to issue mongo --host between mongochat01 and mongochat03 but cannot connect to mongochat02 from either mongochat01 and mongochat03.
Below is the example attempting to connect to mongochat02 from a working instance. It says connected but it never enters the shell and just gets stuck and eventually times out.
[richlu@chat03 ~]$ mongo --host mongochat02 --verbose
MongoDB shell version: 3.2.4
connecting to: mongochat02:27017/test
2017-04-10T21:29:04.348+0000 D NETWORK  [thread1] creating new connection to:mongochat02:27017
2017-04-10T21:29:04.350+0000 D COMMAND  [ConnectBG] BackgroundJob starting: ConnectBG
2017-04-10T21:29:04.392+0000 D NETWORK  [thread1] connected to server mongochat02:27017 (10.8.129.114)
2017-04-10T21:29:04.434+0000 D NETWORK  [thread1] connected connection!

I am able to ping between the servers and nmap shows port 27017 is open for all three servers.
Firewalld shows 27017 as TCP open.
Issuing netstat -tulpn | grep 27017 gives
tcp        0      0 0.0.0.0:27017           0.0.0.0:*               LISTEN      24456/mongod
The /etc/mongod.conf files are the same, except the bindIp includes the server ip. I have tried commenting out the bindIp line and tried with 0.0.0.0.
I need help figuring out why I am unable to connect to the mongochat02 through the mongo client from the other servers. Do the versions matter much in this case? I was able to connect from my local Macbook running v3.2 to mongochat01 and mongochat03 just fine.
This connection issue is not allowing mongochat02 to become a replica set member.
Any help would be appreciated.


text:
Q: What kind of state is retained by Java's matcher.find() after an unsuccessful match with quantifiers? In the following, I expect the second find() to succeed, but it does not.  Why?

Matcher matcher =
    Pattern.compile("\\s*asdf").matcher("apple banana cookie");

// returns false as expected
matcher.find();

// resets groups (that weren't being explicitly being used anyway), but not state.
matcher.usePattern(Pattern.compile("\\s*banana"));

// returns false, expected true.
System.out.println(matcher.find());

If the quantifier is removed from the first regex (becoming simply "asdf"), the second match succeeds.  Looking at the Matcher object reveals some kind of group information is stored after the first unsuccessful find(), although I wouldn't have expected it.  Find() is supposed to start either at the beginning (if no previous match) or at the index of the last successful match.  UsePattern() is supposed to preserve the Matcher's position in the input, and discard group information (that, again, I wasn't using explicitly).
I'm missing something, but I don't know what.  I'm suspecting I have to implement this with lookingAt() and updating the region (such as this example), but I don't know why this approach isn't working.

A: Your first regex consumes the entire string (\\\\s*). When the second regex is run there is nothing left to match.
If you call matcher.reset() it works as expected.

A: Looks like the documentation is a little misleading (or actually, it just doesn't specify) what the behavior is when you call find() after failure.
I suppose that the expected usage is that find() is called repeatedly until failure, but never after failure without resetting.
Looking at the source code confirms that Matcher has an index (the field last) from which it starts searching when doing the next 'find()', and when find() fails, that index is advanced to the end and isn't reset.
reset() resets that index, usePattern() doesn't.

redpajama_set_name: RedPajamaStackExchange


text:
Q: What does a ELF64 File look like? Ok.
So i have been messing around with Assembly, and i was wondering: just HOW does a linkes ELF64 File look like, and can i directly write a linked file in plain-text? (like create a file e.G "main", write the hex-values of the system-calls, and then run it without linking or assembling.)
I have tried objdump -x main but i don't think, this is the entire ELF-File, because there is too less information, as i think.
Here the output:
main:     Dateiformat elf64-x86-64

Inhalt von Abschnitt .text:
 4000b0 b8040000 00bb0100 0000b9d0 006000ba  .............`..
 4000c0 0c000000 cd80b801 000000cd 80        .............
Inhalt von Abschnitt .data:
 6000d0 48454c4c 4f2c2057 4f524c44           HELLO, WORLD

my Assembler Code:
section .data
        msg: db "HELLO, WORLD"
        len: equ $-msg

section .text

        ;write
        mov eax, 4
        mov ebx, 1
        mov ecx, msg
        mov edx, len
        int 80h;

        ;quit
        mov eax, 1
        int 80h;

EDIT: My Compiler is finished now, I just stuck with assembler and let NASM/ld do the job

A: If you want to see the entire structure of your executable try:
objdump -D some_exe

and if you want to see your file in hex format do:
xxd some_exe

or
hexdump some_exe

can i directly write a linked file in plain-text?

Well... Theoretically you can if you know exactly the instructions of the executable and you write them in binary to a plaintext file.
For example, for any given executable exe_file you can do this:
touch temp_file plaintext_file
xxd -p exe_file > temp_file
xxd -p -r temp_file > plaintext_file
chmod u+x plaintext_file

The plaintext_file will be an executable exactly the same as your exe_file. If between steps 2 and 3 you modify the temp_file you are directly modifying the executable by hand, although it is not very likely to change something "specific", unless you have very deep understanding of elf64 format (which I don't and I'm not sure what can be achieved with this).
Note: I know step 1 is redundant, I used it for demonstrating that you are starting with 2 simple plaintext files.


text:
Q: Is parent to parent communication is possible in angular 5 using Subject or Behaviour Subject Is parent to parent communication is possible in angular 5 using Subject or Behaviour Subject. For example: ListComponent and DetailComponent. Both are different component and views. When i clicked save data of a form in ListComponent, it should routed to the DetailComponent page. Then display the data in the edit form.
I aware parent to child or child to parent is possible. But my scenario is parent to parent. Like when we call .next. It should give the data in next page also. This is like passing json object in between different components. If this is not working, the only option is setting localStorage and retrieve in the next page.
This may be a wrong question, but if any possible way will be helpful.

A: Yes it is possible. Include a shared service in both the components and subscribe in both the components


text:
Q: Dropdown issues with Twitter Bootstrap when used in Asp.Net MVC3 I was playing with MVC3 Asp.Net and trying to implement the Twitter Bootstrap into the project. I got the basic thing working but not the dropdown. I have the following html code
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html>

<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>

<link href="../../Content/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="../../Content/bootstrap-responsive.css" rel="stylesheet" type="text/css" />

      Test Project

Main Menu

            Main Menu with SubMenu

First Menu

Second Menu

Third Menu

<asp:ContentPlaceHolder runat="server" ID="MainContent" ></asp:ContentPlaceHolder>

For some reason the dropdown is not showing up, I have tried couple of things but it's not working. I am not sure if its related to the versions I use. They are
ASP.NET MVC3
jQuery 1.5.1
Bootstrap CSS - v2.1.1
Bootstrap Download JS - v2.1.1
I would appreciate any help on this

A: Twitter Bootstrap uses the jQuery on() function for delegating events, which was introduced in version 1.7.  You need to upgrade to at least that version for the jQuery plugins, like bootstrap-collapse.js, to function.

A: You are ommiting the dropdown for collapsed state:

And you are forcing that collapsed state with class collapse, delete it:


text:
Q: Redirecionamento HTML Olá estou criando um calendário para um site meu de animes e gostaria de redirecionar cada
 para um certo lugar. No caso eu fiz uma página assim:

Gostaria que cada um levasse para uma página específica.
(Dúvida já esclarecida..)

body {
  margin: 0px;
  padding: 0px;
  background-image: url(https://i.imgur.com/jSCKYV9.jpg  );
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.dia {
  margin: 0px;
  width: 100%;
  height: 50px;
  background-color: black;
  opacity: 0.7;
}

.dia h1 {
  margin: 0px;
  padding: 0px;
  text-align: center;
  color: white;
  font-size: 30px;
  font-family: "Comic Sans MS";
}

.buttons {
  padding-left: 5px;
  padding-top: 10px;
  padding-right: 5px;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-align-items: flex-start;
  -ms-flex-align: start;
  align-items: flex-start;
}

.buttons * {
  transition: all .5s ease;
}
<!DOCTYPE html>

  <title>Calendário 2018 - G1Animes</title>
  <meta charset="utf-8">

Segunda-Feira

Terça-Feira

Quarta-Feira

Quinta-Feira

Sexta-Feira

Sábado

Domingo

A: Vamos pensar inicialmente na estrutura centralizada responsiva e com links:
html:

        Segunda

        Terça

        Quarta

css:

A: Para usar links você deveria usar a tag  onde no atributo href você coloca a página destino para onde será direcionada a página ao clicar no link.
Para que tenha o mesmo formato que você fez usando div, é preciso adicionar alguns estilos ao  (cuja classe é .dia — veja comentários no CSS).
O uso do
 como fez também não é o correto. As tags <hN> (onde N vai de 1 a 6) devem ser usadas como cabeçalhos de textos, como você pode conferir nesta documentação ( me parece que você usou apenas para que o texto ficasse em negrito e para centralizá-lo).
Veja abaixo como fica usando as tags . Basta apenas substituir os respectivos valores de cada href pela página para onde cada link levará ao ser clicado:

body {
  margin: 0px;
  padding: 0px;
  background-image: url(https://i.imgur.com/jSCKYV9.jpg  );
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.dia {
   /* estilos adicionados (início) */
  display: block;
  line-height: 50px;
  text-align: center;
  color: white;
  text-decoration: none;
  font: bold 30px "Comic Sans MS";
   /* estilos adicionados (fim) */

  margin: 0px;
  width: 100%;
  height: 50px;
  background-color: black;
  opacity: 0.7;
}

/* removido
.dia h1 {
  margin: 0px;
  padding: 0px;
  text-align: center;
  color: white;
} */

.buttons {
  padding-left: 5px;
  padding-top: 10px;
  padding-right: 5px;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-align-items: flex-start;
  -ms-flex-align: start;
  align-items: flex-start;
}

.buttons * {
  transition: all .5s ease;
}
<!DOCTYPE html>

  <title>Calendário 2018 - G1Animes</title>
  <meta charset="utf-8">

    Segunda-Feira

    Terça-Feira

    Quarta-Feira

    Quinta-Feira

    Sexta-Feira

    Sábado

    Domingo

Não ficou claro o uso dessas
. Se puder
  esclarecer o seu uso talvez nem seja necessário também e podemos complementar na resposta.


text:
Q: firebase_auth/missing-client-identifier error starting to be thrown to a limited number of users recently We are using Firebase auth on a React Native app using react-native-firebase for several years now (currently at 12.9.3). A few days ago, without a new Android release or changes in the Firebase console, an Android user could login in the morning but then could not any longer in the afternoon and then after and getting this "firebase_auth/missing-client-identifier" error message.
I have searched here and at the react-native-firebase issues at GitHub but could not find any cases that this happens to only one user. Then yesterday, a second user started facing the same problem which is worrisome.
I checked the SHA-1 and SHA-256 fingerprints and everything is setup correctly and that is why thousands of other users are not facing an issue.
Any ideas of what could be causing this?
Thanks!


text:
Q: Twig generates too long URL resulting in a browser crash I've got a really weird issue.
I'm developping localy a portfolio based on Silex and Twig through a VM. At first I was accessing it like this: 192.168.56.2/pfsilex and everything was working fine.
I've created a vhost and the corresponding entry in my host file, and I still can access my website and navigate between pages, but after a few seconds on the page the browser just crash (tried with Chrome, FF and IE).
At first I thought it was some kind of script, so I disabled JavaScript. Nothing changed. After checking the error.log from Apache I had weird entries : "Request URI too long". Very weird indeed considering my URIs are really short.
The next thing to do has been to check the access.log, and yes, URIs are way too long:
192.168.56.1 - - [28/Jan/2013:22:37:40 +0100] "GET /[type:protected]%20=%3E%200%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20[lineno:protected]%20=%3E%201%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20[1]%20=%3E%20Twig_Token%20Object%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20[value:protected]%20=%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20[type:protected]%20=%3E%202%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20[lineno:protected]%20=%3E%207%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20[2]%20=%3E%20Twig_Token%20Object%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(%20%20%20%20%20%20%20%20%20%20%20%20%20%20%" 414 540 "-" "-"

In this URI we can notice twice the parameter named "Twig_Token" which let me thing that's a Twig issue, but since it's totaly working without the virtual host I'm kinda lost.
I don't pass any get parameters to my views (at least it seems so but I'm new to Silex), only arguments when returning the template.
I don't think it comes directly from twig.
Here is my vhost :
<VirtualHost *:80>
        ServerName portfolio.dev
        DocumentRoot /var/www/pfsilex/
        <Directory /var/www/pfsilex/>
                Options -Indexes
                AllowOverride All
                Order Deny,Allow
                Allow from All
        </Directory>
</VirtualHost>

My .htaccess :
<ifModule mod_rewrite.c>
    Options -MultiViews

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

And my host :
192.168.56.2    portfolio.dev

A: It had nothing to do with Twig.
In fact I had a general route intercepting everything served on "/" in order to load pages from the DB.
But it means it was also intercepting every static file, and when this file was not present the method would throw a big stacktrace.
What was happening is that I hadn't any favicon.ico but every browser tries anyway to load it.
The Chrome network console doesn't show this resource loading, I was able to debug it using Firefox which show it.


text:
Q: Is there a "using" in golang? Is there a way to use the names in a golang import without specifying the package name each time?
In C++ I can "use" a nampespace.
In Java, when I import something, the namespace is automatically used.
Sometimes I have a high level helper library, who's main purpose is using another pacakge, and providing some high level wrappers for it. It seems overly verbose to keep using the pacakge name over and over in the code.
package myhighlevellibrary
import "mypackage"

func Foo() *mypackage.SomeType{
  a:=mypackage.Somefunction();
  b:=mypackage.SomeFactoryMethod(a);
  return b
}

Can I somehow avoid writing the "mypackage" literal so many times in my code? It gets much worse as my library grows larger...

A: This is possible using the "dot" import. Use the . as the package name in the import declaration, and so you can refer to the package's exported identifiers as if they would have been declared in the package you import them.
Quoting from Spec: Import declarations:

If an explicit period (.) appears instead of a name, all the package's exported identifiers declared in that package's package block will be declared in the importing source file's file block and must be accessed without a qualifier.

This is how your example would look like:
package myhighlevellibrary

import . "mypackage"

func Foo() *SomeType {
    a := Somefunction()
    b := SomeFactoryMethod(a)
    return b
}

Here's a runnable Playground example:
package main

import (
    . "fmt"
    . "reflect"
)

func main() {
    Println(TypeOf("text")) // short for: fmt.Println(reflect.TypeOf("text"))
}

See related / possible duplicate: What's C++'s `using` equivalent in golang


text:
Q: Read a specific word properties value in java I have a properties file which contain a key and its value, in which its value is a string consist of many values:
transmit=[D-1]0.0 [D-2]0.0 [D-3]0.039236154

key=transmit

value=[D-1]0.0 [D-2]0.0 [D-3]0.039236154

It means that transmit is in [D-1] Document 1 with value 0.0, and in [D-2] Document 2 with value 0.0, and [D-3] Document 3 with value 0.039236154
My question is, how I can read the [D-3] and give its value as 0.039236154?

A: From the above value i understood that your values are separated by space.
Following snippet will help you.
String[] tokens = transmit.split(" ");
Map<String, String> valueMap = new HashMap<>();
Pattern pattern = Pattern.compile("\\[((\\w-\\d))\\]([\\d.]*)");
for (final String token : tokens) {
    Matcher matcher = pattern.matcher(token);
    if (matcher.matches()) {
        valueMap.put(matcher.group(1), matcher.group(3));
    }
}
// access values using valueMap.get("D-1")

A: To get the values for [D-1], [D-2], and so on you will first need to read the lines from the file.
If the line starts with using string.startsWith(""transmit"); then you split the string using string.split("=").  Split it by the equal sign because that is what splits the values and the word "transmit".
Splitting a string returns a String array and you will want to get index 1 (string.split("=")1) to get [D-1]0.0 [D-2]0.0 [D-3]0.039236154.  Note: Be sure that the split has a length of at least two to avoid an array out of bounds exception.
Now you have the string [D-1]0.0 [D-2]0.0 [D-3]0.039236154.  With this split it by spaces.  You can then loop through the array you got from the split and split each string by \\] to get the [D-1] and 0.0 separated. Note: You will use a double back slash before the bracket because the bracket is a reserved char in regex.
As you split the values you can put them into a hash map and have [D-x] as a key.
Here is the example code once it is read from the file:
String start = "transmit=[D-1]0.0 [D-2]0.0 [D-3]0.039236154";
start = start.split("=")[1];
String[] split = start.split(" ");
HashMap<String, Double> transmitValues = new HashMap<String, Double>();
for(String str : split){
    String[] s = str.split("\\]");
    transmitValues.put(s[0] + "]", Double.parseDouble(s[1]));
}


text:
Q: Stencil in blitz++ 0.10 I'm trying to use the stencil object from Blitz++ User Guide
#include <blitz/array.h>
using namespace blitz;

BZ_DECLARE_STENCIL4(test,P1,P2,P3,c)
    P3 = 2 * P2 + c * Laplacian3D(P2) - P1;
BZ_END_STENCIL

applyStencil(test(), P1, P2, P3, c);

But after compilation I have this error
test_blitz.cpp: In static member function 'static void test::apply(T1&, T2&, T3&, T4&, T5, T6, T7, T8, T9, T10, T11) [with T1 = blitz::FastArrayIterator<long double, 3>, T2 = blitz::FastArrayIterator<long double, 3>, T3 = blitz::FastArrayIterator<long double, 3>, T4 = blitz::FastArrayIterator<long double, 3>, T5 = blitz::dummy<double>, T6 = blitz::dummy<double>, T7 = blitz::dummy<double>, T8 = blitz::dummy<double>, T9 = blitz::dummy<double>, T10 = blitz::dummy<double>, T11 = blitz::dummy<double>]':
/usr/include/blitz/array/stencils.cc:288:13:   instantiated from 'void blitz::applyStencil_imp(const T_stencil&, blitz::Array<T_numtype1, 3>&, T_array2&, T_array3&, T_array4&, T_array5&, T_array6&, T_array7&, T_array8&, T_array9&, T_array10&, T_array11&) [with T_stencil = test, T_numtype1 = long double, T_array2 = blitz::Array<long double, 3>, T_array3 = blitz::Array<long double, 3>, T_array4 = blitz::Array<long double, 3>, T_array5 = blitz::dummyArray, T_array6 = blitz::dummyArray, T_array7 = blitz::dummyArray, T_array8 = blitz::dummyArray, T_array9 = blitz::dummyArray, T_array10 = blitz::dummyArray, T_array11 = blitz::dummyArray]'
/usr/include/blitz/array/stencils.cc:535:5:   instantiated from 'void blitz::applyStencil(const T_stencil&, blitz::Array<T_numtype1, N_rank>&, T_array2&, T_array3&, T_array4&) [with T_stencil = test, T_numtype1 = long double, int N_rank = 3, T_array2 = blitz::Array<long double, 3>, T_array3 = blitz::Array<long double, 3>, T_array4 = blitz::Array<long double, 3>]'
test_blitz.cpp:35:36:   instantiated from here
test_blitz.cpp:9:5: error: 'Laplacian3D' was not declared in this scope

Other array operations (multiplication, where and etc.) are working. Can anybody explain what am I doing wrong?
UPD
It looks like I'm missed the header blitz/array/stencil-et.h (which is in example stencil2.cpp), but there is another error
test_blitz.cpp: In static member function 'static void test::apply(T1&, T2&, T3, T4, T5, T6, T7, T8, T9, T10, T11) [with T1 = blitz::FastArrayIterator<long double, 3>, T2 = blitz::FastArrayIterator<long double, 3>, T3 = blitz::dummy<double>, T4 = blitz::dummy<double>, T5 = blitz::dummy<double>, T6 = blitz::dummy<double>, T7 = blitz::dummy<double>, T8 = blitz::dummy<double>, T9 = blitz::dummy<double>, T10 = blitz::dummy<double>, T11 = blitz::dummy<double>]':
/usr/include/blitz/array/stencils.cc:288:13:   instantiated from 'void blitz::applyStencil_imp(const T_stencil&, blitz::Array<T_numtype1, 3>&, T_array2&, T_array3&, T_array4&, T_array5&, T_array6&, T_array7&, T_array8&, T_array9&, T_array10&, T_array11&) [with T_stencil = test, T_numtype1 = long double, T_array2 = blitz::Array<long double, 3>, T_array3 = blitz::dummyArray, T_array4 = blitz::dummyArray, T_array5 = blitz::dummyArray, T_array6 = blitz::dummyArray, T_array7 = blitz::dummyArray, T_array8 = blitz::dummyArray, T_array9 = blitz::dummyArray, T_array10 = blitz::dummyArray, T_array11 = blitz::dummyArray]'
/usr/include/blitz/array/stencils.cc:515:5:   instantiated from 'void blitz::applyStencil(const T_stencil&, blitz::Array<T_numtype1, N_rank>&, T_array2&) [with T_stencil = test, T_numtype1 = long double, int N_rank = 3, T_array2 = blitz::Array<long double, 3>]'
test_blitz.cpp:38:30:   instantiated from here
test_blitz.cpp:12:5: error: no matching function for call to 'Laplacian3D(blitz::FastArrayIterator<long double, 3>&)'
test_blitz.cpp:12:5: note: candidates are:
/usr/include/blitz/array/stencil-classes.cc:15348:3: note: template<class T1> blitz::_bz_ArrayExpr<blitz::Laplacian3D_et<typename blitz::asExpr<T>::T_expr::T_range_result, typename blitz::asExpr<T>::T_expr::T_numtype> > blitz::Laplacian3D(const blitz::ETBase<T>&)
/usr/include/blitz/array/stencil-classes.cc:15356:3: note: template<class T, int N> blitz::_bz_ArrayExpr<blitz::Laplacian3D_et<typename blitz::asExpr<blitz::Array<T, N> >::T_expr::T_range_result, T> > blitz::Laplacian3D(const blitz::Array<T, N>&)
/usr/include/blitz/array/stencil-classes.cc:15361:3: note: template<class T, int N> blitz::_bz_ArrayExpr<blitz::Laplacian3D_et<typename blitz::asExpr<blitz::Array<T, N> >::T_expr::T_range_result, T> > blitz::Laplacian3D(blitz::Array<T, N>&)

Any ideas?
Link to the full example of code with error message https://gist.github.com/erthalion/8784150

A: You're missing a #include I think.  Perhaps #include <blitz/array/stencilops.h>, or grep through the blitz headers on your system to find Laplacian3D.

A: Instead of
BZ_DECLARE_STENCIL4(test,P1,P2,P3,c)
    P3 = 2 * P2 + c * Laplacian3D(P2) - P1;
BZ_END_STENCIL

Try using
BZ_DECLARE_STENCIL4(test,P1,P2,P3,c)
    P3 = 2 * P2 + c * Laplacian3D_stencilop(P2) - P1;
BZ_END_STENCIL

My understanding is that Laplacian is a stencil (like the one you are declaring), and Laplacian3D_stencilop is a stencil operator (like a difference operator) that you can use inside your own stencil object.


text:
Q: Touchpad will not track until click input This issue is very similar to this question, except it happens with the built-in trackpad.
After some time using the computer, the cursor stops tracking until I click.  Interestingly, multi-touch works, all 2+ finger gestures work, including two-finger scrolling.
To clarify: the visible representation of the cursor (the arrow) does indeed move, but no application appears to notice that it has moved until I click.  This means, for example, if I click a menu at the top and then move the cursor to another menu, the menu I'm now pointing at doesn't open.  It also means that I cannot effectively use select/combo boxes without using the keyboard, as clicking opens the box, but then the mouse stops tracking again so I can't select an item.  If I release the mouse, the select box simply closes with no change in selection.
The same issue happens with dragging desktop icons, or anything else around.  I simply can't.  Likewise, moving the cursor to the bottom of the screen will not cause the dock to appear.  I cannot select text with the touchpad.
Logging out and back in to my account does fix the problem temporarily, however I'm very much over having to do this several times per day.  Nevertheless, this at least illustrates that it's likely a software issue and not (necessarily) hardware.
This issue does not appear to affect external mice, only the touchpad.  Plugging and unplugging an external mouse does not fix the touchpad.
It's a MacBook Pro running OS X 10.11.1. I had this same issue with 10.10.


text:
Q: Has anyone tried integrating Tox and SCL on Centos6/7? I use CENTOS 6/7 for my development and I was wondering if anyone had some success integrating TOX, setuptools and SCL version of python: rh-python34,  rh-python35 and rh-python36? There isn't much info on the web regarding this topic?
Thanks

A: In your tox.ini file you should be able to do something like:
[testenv:py36]
basepython=
    /opt/rh/rh-python36/root/usr/bin/python3.6

Which sets the python to use to create the virtualenv.


text:
Q: Connection refused with Elasticsearch test container even after adding wait I'm trying to move the application to write tests using Elasticsearch container. The container does come up and checking its elasticsearchContainer.isRunning() status returns true but while making a search request Connection Refused exception is thrown. From the Spring boot, ElasticSearch and TestContainers integration tests. Connection refused I added a wait but the same issue persists.
    private static final DockerImageName ELASTICSEARCH_IMAGE =
          DockerImageName.parse("docker.elastic.co/elasticsearch/elasticsearch").withTag("7.11.2");
    elasticsearchContainer = new ElasticsearchContainer(ELASTICSEARCH_IMAGE)
                  .withEnv("foo", "bar");
            elasticsearchContainer.addExposedPorts(9200, 9300);
            //elasticsearchContainer.withStartupTimeout(Duration.of(5, ChronoUnit.MINUTES));
            elasticsearchContainer.setWaitStrategy(
                  Wait.forHttp("/")
                        .forPort(9200)
                        .forStatusCode(200)
                        .withStartupTimeout(Duration.ofSeconds(300)));
            elasticsearchContainer.start();
            assert elasticsearchContainer.isRunning() == true;
            System.out.println("ES Get mapped port" + elasticsearchContainer.getMappedPort(9200)); // outputs a random 5 digit number
            try {
                SearchResponse response = getClient(elasticsearchContainer).search(new SearchRequest(), RequestOptions.DEFAULT); // ERRORS OUT HERE
                System.out.println(response);
            } catch (IOException e) {
                System.out.println("ERROR WHILE getting data " + e.getMessage());
            }

The container starts up fine and no error in the logs either:
CONTAINER ID   IMAGE                                                  COMMAND                  CREATED          STATUS          PORTS                                              NAMES
48b1cc29fea8   docker.elastic.co/elasticsearch/elasticsearch:7.11.2   "/bin/tini -- /usr/l…"   24 seconds ago   Up 23 seconds   0.0.0.0:64492->9200/tcp, 0.0.0.0:64493->9300/tcp   vigorous_banzai
d64503cd1a71   testcontainers/ryuk:0.3.3                              "/app"                   25 seconds ago   Up 24 seconds   0.0.0.0:64490->8080/tcp                            testcontainers-ryuk-bc01909a-5fcc-424e-8346-a7560c31c989

Any suggestions on how to make the connection work?

A: Realized that I was using hardcoded ports for creating the rest client. Changed to and it worked
    private static RestHighLevelClient getRestHighLevelClient(ElasticsearchContainer container) {
        final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
        credentialsProvider.setCredentials(AuthScope.ANY,
                                           new UsernamePasswordCredentials(ELASTICSEARCH_USERNAME, ELASTICSEARCH_PASSWORD));
        RestClientBuilder restClientBuilder = RestClient.builder(HttpHost.create(container.getHttpHostAddress()))
              .setHttpClientConfigCallback(httpClientBuilder -> httpClientBuilder
                    .setDefaultCredentialsProvider(credentialsProvider)
        // Try to prevent SocketTimeoutException when fetching larger batch size
        restClientBuilder.setRequestConfigCallback(
              requestConfigBuilder -> requestConfigBuilder.setSocketTimeout(2 * 60 * 1000));

        return new RestHighLevelClient(restClientBuilder);
    }


text:
Q: Programmatically populating tables with probability data I have the following template for a journal article featuring a basic table:

The code looks something like this:
\documentclass[jou,apacite]{apa6}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\title{Title of the article}
\author{Author Name}
\affiliation{Affiliation}

\abstract{This is the abstract.}

\begin{document}

    \maketitle
    \section{This is the heading for the first section of the article.}
        Lorem ipsum.

        Results are presented in Table~\ref{tab1}.

        \begin{table}[!htb]
            \caption{Sample table.}\label{tab1}
            \begin{tabular}{ccc}
                \hline\\[-1.5ex]
                AAA & BBB & CCC \\[0.5ex]
                \hline\\[-1.5ex]
                1.0 & 2.0 & 3.0\\[0.5ex]
                1.0 & 2.0 & 3.0\\[0.5ex]
                \hline
            \end{tabular}
        \end{table}

    \section{This is the heading for the second section of the article.}
        Lorem ipsum.

\end{document}

What I want to know is:
Rather than typing in every value of a table manually, and potentially mistyping a digit or a decimal point here or there; is LaTeX capable of evaluating the math for me?
Consider the odds or probability of a coin toss winning streak, for example:

Each flip has 50:50 (1:1) odds:
  50% probability of winning
  50% probability of losing
The odds of winning two consecutive flips are 75:25 (3:1):
  25% probability of winning
  75% probability of losing
The odds of
  winning three consecutive flips are 87.5:12.5 (7:1):
  12.5% probability of winning
  87.5% probability of losing
The odds of winning four consecutive flips are 93.75/6.25 (15:1):
  6.25% probability of winning
  93.75% probability of losing

..and so on.

Probability of winning n consecutive flips is 2^(-n) * 100.
  Probability of not winning n consecutive flips is 100 - (2^(-n))
  * 100

Of course I could just calculate each value and type in every cell manually, but I might want to show ten or more flips. Anyway, is this something LaTeX can do?

A: Here's a LuaLaTeX-based solution to the problem of printing a table of run probabilities -- if the underlying experiment is tossing a "fair" coin.

% !TEX TS-program = lualatex
\documentclass[jou,apacite]{apa6}
\usepackage{amsmath,booktabs,lipsum}
\let\Pr\relax % undefine "\Pr"
\DeclareMathOperator{\Pr}{Pr}

\usepackage{unicode-math} % choose suitable math and text fonts
\setmainfont{Stix Two Text}[Ligatures={TeX,Common}]
\setmathfont{Stix Two Math}

\title{Title of the article}
\shorttitle{Title}
\author{Author Name}
\affiliation{Affiliation}
\abstract{This is the abstract.}

\usepackage{luacode}
\begin{luacode}

function run_prob ( j )
   return (0.5)^j
end
function printrows ( n )
   for i=1,n do
      runprob     = 100*run_prob(i)
      runprobcomp = 100-runprob
      tex.sprint ( i .. "&" .. runprob .. "&" .. runprobcomp .. "\\\\" )
   end
end

\end{luacode}

\begin{document}
\maketitle

\section{In the beginning}
Lorem ipsum.

Results are presented in Table~\ref{tab1}.

\begin{table}[!htb]
\caption{Fair coin tosses: Probabilities of runs of length $n$, in percent.}\label{tab1}

$\begin{array}{@{}lll@{}}
\toprule
n & \Pr(\text{Run}) & 100-\Pr(\text{Run})\\
\midrule
%% Invoke the 'printrows' Lua function:
\directlua{printrows(12)}
\bottomrule
\end{array}$
\end{table}

\lipsum[1-3]
\end{document}

A: A solution using the CAS, Sage, given below. The documentation for sagetex on CTAN is here and an example using Sage/LaTeX/sagetex is here. Sage is not part of the LaTeX distribution so it needs to be installed on your machine or open a free Cocalc account (the easiest way). Here is the code.
\documentclass[jou,apacite]{apa6}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{sagetex}
\title{Title of the article}
\author{Author Name}
\affiliation{Affiliation}
\abstract{This is the abstract.}

\begin{document}
\begin{sagesilent}
output = r"\begin{table}[!htb]"
output += r"\caption{Sample table.}\label{tab1}"
output += r"\begin{tabular}{ccc}"
output += r"\hline"
for i in range(1,13):
    output += r"%s & %s & %s \\"%(i,(100*.5^i).n(digits=7),(100-100*.5^i).n(digits=7))
output += r"\hline"
output += r"\end{tabular}"
output += r"\end{table}"
\end{sagesilent}

\maketitle
\section{This is the heading for the first section of the article.}
The probability of $6$ consecutive flips is given by $\sage{(100*(.5)^6).n(digits=7)}$\%.
The probability of $7$ consecutive flips is given by $\sage{(100*(.5)^7).n(digits=7)}$\%.

Applying this to other values we can create the Table below:
Results are presented in Table~\ref{tab1}.
\sagestr{output}
\section{This is the heading for the second section of the article.}
Lorem ipsum.
\end{document}

The output running in Cocalc is shown below:

In order to create the table with a loop, Sage has to run. When you build your file in Cocalc, LaTeX runs, then Sage, then LaTeX (where the results from the Sage run are inserted). This means in order for the first pass of LaTeX to compile, the table is not there. It gets created as a string in Sage and then inserted for the final LaTeX compilation. \sagestr{} gets string data as opposed to \sage{} for numerical data. Two nice features that you get with Sage: the ability to do calculations on the fly such as with the line The probability of $6$ consecutive flips is given by $\sage{(100*(.5)^6).n(digits=7)}$\%. where digits=7 sets the number of significant figures to use in the answer and Sage also can handle numerous probability distributions, see here. Finally, Sage allows you to use Python in your coding. With a CAS, Python, and LaTeX you can do pretty much anything.


text:
Q: Problem with \include and \chapter I am including the chapters of my thesis with the \include command. The chapters start with \chapter. This worked until last week, but suddenly TeXStudio won't compile. I get an ! extra \else error.
If I change \include to \input or if I comment \chapter, it works.
I assume the error comes from somewhere inside my header. The header is part of my faculty template, they told me to use it. Any ideas?
\input{./Header}

\begin{document}

    \input{./pagestyle}

    \tableofcontents

    \include{./chapter}

\end{document}

The chapter looks like this:
\chapter{Konzeption und Umsetzung}

\section{Antriebsstrang}

\subsection{Komponenten}
...

Pagestyle:
\automark{chapter}
        \pagestyle{useheadings}
        \renewcommand*{\chapterpagestyle}{scrheadings}
        \setlength{\headheight}{1 cm}
        \addtokomafont{pageheadfoot}{\linespread{0.5}\selectfont}
        \ohead{\headmark}

The header:
% % % % % % % % % % % % % % % % % % %
%% Definition der Dokumentenklassen %
% % % % % % % % % % % % % % % % % % %

\documentclass[
    listof=numbered,                                %   Listen nummeriert einfügen
    listof=flat,                                    %   Abstand in Verzeichnissen anpassen
    pdftex,                                         %   PDFTex verwenden
    a4paper,                                        %   A4 Papier
    oneside,                                        %   Zweiseitig
    %BCOR1cm,                                       %   Randzugabe bei Duplex
    listof=totoc,                                   %   Tabellen und Abbildungsverzeichnis nicht nummeriert
    bibliography=totoc,                             %   Literaturverzeichnis ins Inhaltsverzeichnis
    headsepline,                                    %   Linie nach Kopfzeile
    %footsepline,                                   %   Linie vor Fusszeile
    11pt,                                           %   Schriftgröße
    %smallheadings                                  %
    ngerman,                                        %   Neue deutsche Rechtschreibung
    fleqn,                                          %   Formeln linksbündig statt zentriert
    %draft,                                         %   Schnelles Renderung
]{scrreprt}                                         %   Wissenschaftlicher Report. Alternativ {scrartcl}

\usepackage{scrpage2}                               %   Seitenlayout mit KOMA-Script
\usepackage{scrhack}                                %   Gegen die Fehlermeldung "\float@addtolists detected!(scrreprt)..."

% % % % % % % % % % % % % % % % % % %
%% Formatierungs und Layoutoptionen %
% % % % % % % % % % % % % % % % % % %

%% Schriften setzen auf Serifenlos
\renewcommand{\familydefault}{\sfdefault}           %   Standardschrift: serifenlos
\usepackage{cmbright}                               %   Schriftart ersteinmal alles auf serifenlos nach cmbright inkl. Mathefonts
\usepackage{helvet}                                 %   Schriftart dann auf serifenlos nach Helevetica (Mathefonts sind nicht enthalten)

\setcounter{secnumdepth}{5}                         %   Kapitelnummerierung mit fünf Ebenen ermöglichen
\setcounter{tocdepth}{2}                            %   Eintrag ins Inhaltsverzeichnis bis Ebene 3

\setlength{\parindent}{0mm}                         %   Erstzeileneinzug bei neuem Absatz verhindern
\setlength{\parskip}{3pt}                           %   Abstand zwischen Absätzen einstellen
\setcapindent{1em}                                  %   Abstand zwischen Absätzen einstellen
%\linespread{1.15}                                  %   Zeilenabstand einstellen

\usepackage{chngcntr}                               %   Fußnoten im gesamten Text durchgehend nummerieren (sonst Neubeginn nach Kapitelwechsel)
\counterwithout*{footnote}{chapter}                 %   Fußnoten im gesamten Text durchgehend nummerieren

\newcounter{mpglobal}                               %   Um Fußnoten in Minipages fortlaufend zu nummerieren
\renewcommand{\thempfootnote}{\arabic{mpfootnote}}  %   Arabische Zahlen in Minipage Fußnoten

\clubpenalty = 10000                                %   Schliesst Schusterjungen aus
\widowpenalty = 10000                               %   Schliesst Hurenkinder aus

%% Deutsche Anpassungen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage[ngerman]{babel}                         %   Ermöglicht deutsche Silbentrennung und direkte Eingabe von Umlauten
\addto\captionsngerman{%
  \renewcommand{\figurename}{Abbildung}                 %
  \renewcommand{\tablename}{Tabelle}                %
  \renewcommand{\listfigurename}{Abbildungsverzeichnis} %
}
\usepackage[]{inputenc}                     %   Teilt LaTeX die Texcodierung mit. Bei Windowssystemen: ansinew, latin1
\usepackage[babel,german=quotes]{csquotes}          %   Gegen Fehler "'babel' detected but 'csquotes' missing." bei Verwendung von BibLaTeX
\usepackage[T1]{fontenc}                            %   Ermöglicht die Silbentrennung von Wörtern mit Umlauten
\usepackage{eurosym}                                %   Euro darstellen

%% Packages für Formeln %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{amsmath}                                %   Mathematikpaket
\usepackage{amstext}                                %   Text in Formeln: This style file implements the AMS-TEX macro \text
\usepackage{amsthm}                                 %   Verbesserte Theorem Darstellung: \newtheorem{lem}{Lemma} zur Def.; \begin{lem} Text text ... \end{lem} zum Einsatz
\usepackage{amsfonts}                               %   Schriften für AMSMath
\usepackage{dsfont}                                 %   mathds alternativ zu mathbb für richtige Darstellen Natürlicher Zahlen: \mathds{N}
\usepackage{mathrsfs}                               %   Support for using RSFS fonts in maths; Provides a \mathscr command, rather than overwriting the standard \mathcal command
\usepackage{amssymb}                                %   Advanced Mathematical Symbols
\usepackage{upgreek}                                %   Non Italic Greek Characters
%\usepackage[bbgreekl]{mathbbol}                    %   Erweiterung des mathbb für Griechisch etc.
\usepackage{nicefrac}                               %   Typeset in-line fractions in a "nice" way:  \nicefrac
\usepackage{amsxtra}                                %   Weitere Extrasymbole
%\usepackage{icomma}                                %   defining an ?intelligent? comma, which ?recognizes?, whether it is used as a decimal separator or as a punctuation character.
                                                    %   After loading of the package, the comma will be typeset as a punctuation character, if the next input character is a space; otherwise the comma is treated as a decimal separator. Thus, a decimal number is to be entered as, for instance: 1,234 whereas the mathematical expression(x,y) is to be written with a space after the comma: (x, y)

%% Packages für Einheiten %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\usepackage{siunitx}                               %   Alternative Darstellung von Einheiten
%\usepackage{fancyunits}                            %   Alternative Darstellung von Einheiten
%%\usepackage{gensymb}                              %   The gensymbpackage provides a number of ?generic? macros, which produce the same output in text and math mode: #
                                                    %   \degree \celsius \perthousand \ohm \micro
\usepackage{units}
%\usepackage{nicefrac}
%%\usepackage{gensymb}
\usepackage{unitsdef}
\newunit{\kgmm}{\kg\unitsep\squaremeter}
\newunit{\newtonmeter}{\newton\meter}
\newunit{\degreepersecond}{\per{\degree}{\second}}
\newunit{\radpersecond}{\per{\radian}{\second}}
\newunit{\radpersquaresecond}{\per{\radian}{\squaresecond}}
\newunit{\meterpersecond}{\per{\meter}{\second}}
\newunit{\kmperhour}{\per{\kilometer}{\hour}}
\newunit{\mph}{mph}
\newunit{\inch}{in}
\newunit{\squaresecond}{\second\unitsuperscript{2}}
\newunit{\meterpersquaresecond}{\per{\meter}{\squaresecond}}
\newunit{\g}{g}
\newunit{\barSI}{bar}

%% Zusatzpakete
\usepackage[space]{grffile}                         %   Grafiken mit Leerzeichen im Namen einfügen
\usepackage{blindtext}                              %   Blindtext einfügen: http://texblog.org/2011/02/26/generating-dummy-textblindtext-with-latex-for-testing/
                                                    %   \blindtext, \Blindtext for paragraph(s) of text.
                                                    %   \blinddocument, \Blinddocument for a small/large document.
                                                    %
                                                    %   In an arbitrary number of repetitions, e.g. \blindtext[5].
                                                    %
                                                    %   Furthermore, \blindlist{env}[x] creates a list with ?x? being the number of items generated. The environment can be set to itemize, enumerate or description.
                                                    %
                                                    %   A more direct way to generate lists is by using the commands: c, \blindenumerate, \blinddescription and their extended versions with capital letters are available. Similarly, the number of items is defined through the optional argument, e.g. \blindenumerate[10].
                                                    %
                                                    %   If you want math within the text, use \blindmathtrue and \blindmathfalse respectively.
                                                    %
                                                    %   It is also possible to generate text with math including formulas, using \blindmathpaper.
\usepackage{lipsum}                                 %   Lorem Ipsum Blindtext
\usepackage{setspace}                               %   Zeilenabstand setzen mit \onehalfspacing,...
\usepackage{color}                                  %   Farben ermöglichen
\usepackage{lscape}                                 %   Ermöglicht Drehen einzelner Seiten
\usepackage{rotating}                               %   Ermöglicht das drehen von bildern (sidewaysfigure) und Text in Tabellen
\usepackage[dvipsnames]{xcolor}                     %   Mehr Farben
\usepackage{threeparttable}                         %   Für Fußnoten in Tabellen
\usepackage{multicol}                               %   Mehrspaltige Listen
\usepackage[printonlyused]{acronym}                 %   Automatisches Abkürzungsverzeichnis

%% Bilder %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{graphicx}                               %   Grafiken einbinden
\usepackage{float}                                  %   Bilder WIRKLICH an der Stelle einsetzen, mit Parameter [H]
\usepackage{capt-of}                                %   Beschriftung nicht gleitender Bilder
\usepackage[%
format=hang,% Bereich unter Abbildung xx bleibt frei
indention = 0pt, % Einzug von 0 pt
justification=RaggedRight, % Beschriftung linksbündig
font={footnotesize, sf}, %Schriftart und -größe wie im Fließtext, it = kursiv, Text
labelfont={normalfont, sf}, %%Schriftart und -größe wie im Fließtext, it = kursiv, bf = fett, Bezeichner
margin=0.05\textwidth,
singlelinecheck=true,
%nooneline % Überprüfung auf Einzellinien aus
skip= 5pt, %Abstand zwischen Bild und Beschriftung
]{caption} %Zum Formatieren von Bildbeschriftungen. Caption in longtable nicht in anderer Textgröße (Bei \small vor longtable)
\usepackage[percent]{overpic}                       %   LaTeX commands can be placed on the graphic at defined positions; a grid for orientation is available.
%\usepackage[final]{pdfpages}                       %   PDF Dateien einfügen ermöglichen; Funktioniert nicht mehr zusammen mit graphicx
\usepackage{subfigure}                              %   enable pictures side-by-side

%% Tabellen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\usepackage{array,ragged2e}                     %   Erweitert Tabelleneigenschaften (Blocksatz ausschalten)
\usepackage{longtable}                              %   Für Tabellen, die eine Seite überschreiten
%\captionsetup[longtable]{justification=raggedright,position=bottom} % Caption für longtable definieren
\usepackage{multirow}                               %   Tabellen mit mehrzeiligen Zellen
\usepackage{tabularx}                               %   Widths of certain columns are calculated so that the table is is a specied width: \begin{tabularx}{hwidthi}{hpreamblei}
\usepackage{tabulary}                               %   Tabellen fügt Blocksatz in Tabellenspalten hinzu: LCRJ statt nur LCR als Ausrichtungsdefinitionen
\usepackage{tabu}
\usepackage{ltxtable}                               %   LongtableX (Mehrseitige tabellen mit X) / merged tabularx/longtable package, \LTXtable{<width>}{<file name>}
                                                    %   The \multicolumn command is suppressed in environments included in this way.
\usepackage{colortbl}                               %   Farben in Tabellen: \columncolor[ hcolor model i ]{hcolour i}[hleft overhang i ][hright overhangi]
%\captionsetup[table]{position=top,aboveskip=3pt}   %   Vertikale Abstände für TabellenÜBERschriften einrichten

%\renewcommand*{\tabularxcolumn}[1]{m{#1}}          %   Vertically centers entries of a tabularx-table

\usepackage{paralist}                               %   Zusätzliche Listenumgebungen: \begin{enumerate}[1)]\item Eins\item Zwei\item drei\end{enumerate}
                                                    %   Die jeweiligen compact Varianten unterdrücken die standardmäßigen Durchschüsse zwischen den Umgebungen und dem übrigen Text, sowie zwischen den einzelnen Aufzählungspunkten. Die aspara Varianten setzten jeden Listenpunkt als einzelnen Absatz. Die inpara Varianten setzen die Listenpunkte fortlaufend als einen Absatz. [compactenum, compactitem, compactdesc], entsprechend für aspara und inpara
\usepackage{booktabs}                               %   Setzen von qualitativ hochwertigen horizontalen Strichen (engl. rules) in Tabellen.
                                                    %   Im Wesentlichen bietet booktabs 3 Befehle an, um horizontale Rules zu setzen. Dabei ist \toprule[<breite>] der Befehl für einen die Tabelle oben abschließenden Strich und \midrule[<breite>] für einen Strich innerhalb der Tabelle. \cmidrule[<breite>](trim){a-b} ist der Befehl für einen Strich innerhalb der Tabelle von Spalte a bis b und \bottomrule ist der Befehl für einen die Tabelle abschließenden Strich.
\usepackage{hhline}                                 %   cline auch bei gefärbten Reihen. Doppelte REcieh mit = statt - ; Doku siehe: http://www.ctan.org/pkg/hhline
\usepackage[normalem]{ulem}                         %   Erlaubt \underline
\usepackage[numbered]{mcode} %framed                %   Erlaubt es, farbig richtig codierten MatLab Code einzufügen (auch mit Rahmen)#
%\usepackage{verbatim}                              %   Erweiterung zum Quellcode einbinden (Latex Code wird nciht interpretiert)
%\usepackage{listings}                              %   Direktes einbinden von Quellcode als Listings (statt mcode oder verbatim)
\usepackage{url}                                    %   Darstellung von Weblinks mit dem \url{http://www.seite.de} Parameter
\urlstyle{same}                                     %   Url in gleicher Schrifart, statt blau

%% Packages für PDF %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{hyperref}
%% PDF Dokuinfo
 \hypersetup{
    pdftitle={Semesterarbeit},
    pdfauthor={\textcopyright\ Lukas Wheldon},
    pdfsubject = {Entwicklung und Aufbau eines elektrischen Rennsportmotorrades},
    pdfcreator = {pdfLaTeX},
    pdfkeywords = {},
    plainpages=false,
    pdfstartview=Fit,
    colorlinks=true,
    linkcolor=black,
    breaklinks=true,
    citecolor=black,
    pdftoolbar=true,
    bookmarksnumbered,
    bookmarksopenlevel=2,
    bookmarksopen=true,
    pdfstartpage=1,
    % pdfpagemode=FullScreen
    % pdfpagelayout=TwoPageRight,
    pdfpagemode=UseOutlines, %UseOutlines stellt Bookmarks dar, UseNone schaltet die Anzeige dieser ab
    hypertexnames=false,
    urlcolor = black,
  }

%% durchgängiges Hoch-Tiefstellen %%%%%%%%%%%%%%%%%%%%%%%%%%

%Für das Hochstellen von Zeichen ohne Einschaltung des Mathematikmodus
%bietet LaTeX die Anweisung \textsuperscript an.
%Mit den folgenden Definitionen, die analog der Definiton von
%\textsuperscript sind, erhält man eine entsprechende Anweisung
%\textsubscript zum Tiefstellen von Zeichen ohne den Mathemodus zu verwenden
% Bsp. CO\textsubscript{2} für Darstellung von Kohlendioxid

 \makeatletter
    \DeclareRobustCommand*\textsubscript[1]{%
      \@textsubscript{\selectfont#1}}
    \def\@textsubscript#1{%
      {\m@th\ensuremath{_{\mbox{\fontsize\sf@size\z@#1}}}}}
  \usepackage{babel}
  \makeatother

% % % % % % % % % % % % % % % % % % %
%%          Neudefinitionen         %
% % % % % % % % % % % % % % % % % % %

\usepackage{array} % Erlaubt mit v{} statt p{} Blocksatz in Tabellen abzuschalten
\newcommand{\PreserveBackslash}[1]{\let\temp=\\#1\let\\=\temp}
%\usepackage[NewCommands]{ragged2e} % Better raggedleft formating
\newcolumntype{v}[1]{>{\PreserveBackslash{\raggedright}\hspace{0pt}}p{#1}}

%% Seitendefinition %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\usepackage[includeheadfoot]{geometry}             %   Normale Seitenränder
%\usepackage{a4wide}                                %   Kleinere Seitenränder = mehr Text pro Zeile.

\usepackage[left=3cm,right=2.5cm,top=1.5cm,bottom=1.5cm,includeheadfoot]{geometry}  %   Selbstdefinierte Seitenränder
%\setheadsepline{1pt}[{\color[rgb]{0.75,0.75,0.75}}]    %   Graue Trennlinie bei Kopfzeile
%\setheadsepline{1pt}[{\color[rgb]{1,1,1}}]             %   Schwarze Trennlinie bei Kopfzeile

%\usepackage{fancyhdr}                              %   Alternativ Fancy Kopf- und Fußzeilen

%% Farbedefinitionen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\definecolor{dunkelgrau}{rgb}{0.65,0.65,0.65}
\definecolor{hellgrau}{rgb}{0.9,0.9,0.9}
\definecolor{weis}{rgb}{1,1,1}
\definecolor{rot}{rgb}{1,0.9,0.9}
\definecolor{gruen}{rgb}{0.9,1,0.9}
\definecolor{Gray}{gray}{0.4}
%\definecolor{orange}{RGB}{255,127,0}                           %   Eigene Farbdefinition RGB
%\definecolor{orange}{rgb}{1,0.5,0}                             %   Eigene Farbdefinition rgb
%\colorlet{notgreen}{blue!50!yellow}                            %   Farben mischen mit xcolor

%% Zellendefinitionen für colortbl und Allgemein %%%%%%%%%%%%%%

\newcolumntype{A}{>{\color{white}\columncolor{red}[.5\tabcolsep]\raggedright}p{2cm}}
\newcolumntype{B}{>{\color{white}\columncolor{green}[0pt]\raggedright}p{2cm}}
\newcolumntype{D}{>{\columncolor[gray]{.8}[0pt]}}

%Untenstehende Neudefinition ersetzt durch tabulary-Paket
%\newcolumntype{C}[1]{>{\centering\arraybackslash}l{#1}}        % zentrierte Spalten mit Breitenangabe
%\newcolumntype{R}[1]{>{\raggedleft\arraybackslash}l{#1}}       % rechtsbündige Spalten mit Breitenangabe
%\newcolumntype{L}[1]{>{\RaggedRight\arraybackslash}X{#1}}      % zentrierte Spalten mit Breitenangabe

%% Eigene Definitionen %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcommand{\halmos}{\quad\hfill\mbox{$\Box$}}                  %   Beweisendezeichen
\def\bigdot{$\bullet$}                                          %   Dicker schwarzer Punkt
\newcommand{\vektor}[1]{\left(\begin{array}{c}#1\end{array}\right)} %   Vektoren

%Minititel
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\minitit}[1]{
\begin{onehalfspace}
\emph{\textbf{#1}}
\end{onehalfspace}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Vorgaben %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\graphicspath{{./Bilder/}}                                  %Standardpfad für Bilder/Grafiken festlegen
\DeclareGraphicsExtensions{.pdf,.jpg,.png}

%% Literaturverzeichnis %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\bibliographystyle{./din1505/alphaabbrvdin}

\usepackage[backend=bibtex8,
style=alphabetic,                               % Zitierstil [Bur12, S. 4]
firstinits=true,                                % Vornamen im Literaturverzeichnis auf einen Buchstaben abkürzen
isbn=false,                                     % keine ISBN Nummern anzeigen
maxalphanames=1]                                % nur erster Autor in eckigen Klammern
{biblatex}
\renewcommand*{\labelalphaothers}{}             % bei mehreren Autoren kein + im Zitat bsp: [Jak+13]
\renewcommand*{\labelnamepunct}{\addcolon\space}% Doppelpunkt zwischen Autoren und Titel
\renewcommand*{\multinamedelim}{\addsemicolon\space} % Strichpunkt zwischen Autoren
\DefineBibliographyStrings{ngerman}{andothers={et\ al\adddot}}  % Verwendung von et al. statt u. a. im Literaturverzeichnis
\AtBeginBibliography{                           % Autorennamen in Kapitälchen nur im Verzeichnis, nicht im Text
\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}  % Autorennamen in Kapitälchen
}
\DeclareNameAlias{default}{last-first}          % Nachnahme zuerst: Nachname, V.
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{\mkbibemph{#1\isdot}}                                                   % Titel kursiv und nicht in Anführungszeichen
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{journaltitle}{#1}
                                                % Zeitschriftentitel nicht kursiv
\DeclareBibliographyDriver{article}{%           % Definition für "article"
  \printnames{author}%
  \setunit*{\addcolon\space}
  \printfield{title}%
  \setunit*{.\space In:\space}%
  \usebibmacro{journal}%
  \setunit*{\space}
  \printfield{number}
  \setunit*{\addcomma\space S. \space}
  \printfield{pages}
  \setunit*{\addcomma\space}%
  \printfield{year}%
  \finentry}

\DeclareBibliographyDriver{online}{%            % eigene Kategorie "online" für Internetdokumente
  \printnames{author}%
  \setunit*{\addcolon\space}
  \printfield{title}%
  \setunit*{.\space}%
  \printfield{url}%
  \setunit*{,\space abgerufen am\space}%
  \printfield{note}%                            % "note" nutzen für "URL last checked"
  \finentry}

%\nocite{*}                                     % Alle im Text unzitierten Einträge zitieren
%\addbibresource{Diss.bib}
\bibliography{BAMA.bib}

\defbibheading{quelle}{\chapter*{Literaturverzeichnis}}         % Mehrere Literaturverzeichnisse: Überschriften
\defbibheading{grundlagen}{\section*{Grundlagen und Recherche}}
\defbibheading{modelle}{\section*{Modellbildung}}
\defbibheading{prototyp}{\section*{Prototypenentwicklung}}
\defbibheading{fem}{\subsection*{FEM-Analyse des \textsc{Mute}-Batteriepacks}}
\defbibheading{sicherheit}{\subsection*{Sicherheitstests der im \textsc{Mute} verwendeten Zellen}}
\defbibheading{fmea}{\subsection*{FMEA-Analyse des Gesamtsystems}}
\defbibheading{kollegen}{}
\defbibheading{mpresse}{}
\defbibheading{epresse}{\section*{Ausgewählte Presseartikel zum Thema Elektromobilität}}
\defbibheading{webseite}{\section*{Internetquellen}}
\defbibheading{eigene}{\chapter*{Verzeichnis eigener Veröffentlichungen im Kontext Elektromobilität}}
\makeindex

%Deprecated
%\usepackage[backend=bibtex8,style=numeric,firstinits=true,maxcitenames=1]{biblatex}
%\usepackage[backend=bibtex8,style=alphabetic,firstinits=true,maxcitenames=1]{biblatex} % alphabetic: Zitierstil [Bur12, S. 4]; firstinits=true: Vornamen im Literaturverzeichnis auf einen Buchstaben abkürzen, Nur Ersten Author


text:
Q: Android disable action button from other Apps' Notifications I am using NotificationListenerService and am able to dismiss/cancel shown notification by their ID.
override fun onNotificationPosted(sbn: StatusBarNotification?) {
        super.onNotificationPosted(sbn)
        cancelNotification(sbn?.key)
    }

Is there any way that I can intercept the accompanied action buttons, e.g. disable/hide it, in each notification?


text:
Q: How could I use a vector buffer on opencl c kernel or set a SVM with this vector? I am trying to allocate a vector (array of strings) to store 2 or more char(bytes) but the OpenCL kernel's compiler(clang) throw the following error kernel parameter cannot be declared as a pointer to a pointer when declaring a char** compressedBytes array
kernel:
https://gist.github.com/PontiacGTX/0f0897ac1eaf93cb04a5c1e3c205dc4b
host:
https://gist.github.com/PontiacGTX/745b4942acab0c7213dee1fede6a8e35
the kernel compiler errors are:
Failed Creating kernel 1
C:\Users\PONTIA~1\AppData\Local\Temp\OCL4936T1.cl:31:111: error: kernel parameter cannot be declared as a pointer to a pointer
__kernel void CopyBytes(__global unsigned char const* fileBytes,unsigned long length,__global unsigned char** compressedBytes, __global unsigned long* arrayCountCompressedBytes)
                                                                                ^
C:\Users\PONTIA~1\AppData\Local\Temp\OCL4936T1.cl:40:16: warning: incompatible integer to pointer conversion initializing 'const __generic char ' with an expression of type 'int'
                        const char str=fileBytes[i] + fileBytes[i+1];
                                    ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\PONTIA~1\AppData\Local\Temp\OCL4936T1.cl:41:9: warning: incompatible pointer types passing '__global unsigned char *__generic *' to parameter of type 'const __global char *__generic *'
                        Find(compressedBytes,size,str,found);
                             ^~~~~~~~~~~~~~~
C:\Users\PONTIA~1\AppData\Local\Temp\OCL4936T1.cl:10:33: note: passing argument to parameter 'begin' here
void Find(__global const char** begin,unsigned long length, const char* val,int found)
                                ^
C:\Users\PONTIA~1\AppData\Local\Temp\OCL4936T1.cl:45:23: error: assigning 'const __generic char *' to '__global unsigned char *__generic' changes address space of pointer
                                compressedBytes[i]=str;
                                                  ^~~~

A:
OpenCL doesn't support pointers to random memory inside the kernel. So
no pointers of pointers, all you have linear chunks of memory in the
form of cl_buffers – Quimby


text:
Q: Laravel 9 Error Code : 904 Error Message : ORA-00904: "EMAIL" I created a Laravel API connecting to an Oracle Database my goal is to use it for an android app .
The Error message :
Error Code : 904 Error Message : ORA-00904: "EMAIL": invalid identifier Position : 49 Statement : select * from (select * from "USERS" where upper(email) = upper(:p0)) where rownum = 1 Bindings : [test@mail.com]
I installed the yajra oci8 extension to connect to the oracle database .
I checked th config/auth.php
I am using the laravel php artisan ui bootstrap --auth for the authentication

A: This is an Oracle error, it won't have anything to do with your client environment.
It means that there is no column named EMAIL (all caps) in the "USERS" table.  Check the column list in that table (select * from all_tab_columns where table_name = 'USERS') and ensure you find a column named EMAIL. If you find one with mixed case, e.g. 'Email' that is a non-standard object name in Oracle and requires the use of double-quotes and exact case-matching. If that's the situation, you can fix it by changing your query to:
select * from (select * from "USERS" where upper("Email") = upper(:p0)) where rownum = 1


text:
Q: How work the waypoints of the divi theme on wordpress? Divi theme implements waypoints, anyone know how it works and how could use them? for example This class allows animations to at some point et-waypoint but I need know how to manipulate the event.

A: It works like this , When you assign et-waypoint class to any divi module , it will be automatically picked up by jQuery written in divi JS,
<script>
(function($) {
    var $animation_elements = $('.et-waypoint'),
        $window = $(window);

    function check_if_in_view() {
        var window_height = $window.height(),
            window_top_position = $window.scrollTop(),
            window_bottom_position = (window_top_position + window_height);

        $animation_elements.each(function() {
            var $element = $(this),
                element_height = $element.outerHeight(),
                element_top_position = $element.offset().top,
                element_bottom_position = (element_top_position + element_height);

            //check to see if this element is within viewport
            if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {
                $element.addClass('et-animated');
            } else {
                $element.removeClass('et-animated');
            }
        });
    }

    $window.on('scroll resize', check_if_in_view);
})(jQuery);
</script>

in this case , $animation_elements grabs et-waypoint and it calls check_if_in_view on window scroll.


text:
Q: How to create multiple app NodeJS cluster? I need direction on how to best setup an environment that can scale to host as many as 20-50 NodeJS applications. Each application is independent of each other for different corporate needs. Each application should be accessible via a standard URL on the internal network (port 80).
Our corporate infrastructure is very strong and I have the ability to spin up as many servers as I need (running as many cores, as much RAM and HD space that I need - zero limitations).
My understanding is that I'll need a web server of some sort to act as a reverse proxy. But for the app server(s) should I have one really decked out server? many so-so spec'd servers? Should I limit each app server to something like 5-10 apps per?
Should each app run on its own instance of NodeJS or should I have one huge clustered instance that runs many apps? If clustered, I read concerns that I can't leverage session - will that impact O365 authentication?
Thanks!

A: You can use PM2 to run you nodejs APPS in the server in fork mode or clustered mode based on the requirement.
These apps can be accessed by different PORTS, Use Nginx and create server blocks for each of your apps and add the proxy pass to the respective ports.


text:
Q: AOL contacts API Is anybody aware of any AOL API (e.g. based on OAuth) that would expose the user address book (no screen-scraping)?
I've seen a few threads about it but no answers:

*

*https://stackoverflow.com/questions/2923106/does-aol-have-a-contacts-api

*Aol Contact API

A: AOL has been promising this feature for a while: http://dev.aol.com/api/addressbook/comingsoon
There doesn't seen to have been any activity on this front for a long time. I'd also really like to know if AOL is intending to add this feature anytime soon.
Edit: AOL has changed their developer site and there is no longer a mention of the Contacts API.


text:
Q: Save jQuery callback functions in a separate file Probably I missed something, but lets say I have this:
$('a.delete').click(function(){
   resp=window.confirm("Are you sure you want to delete this?");
   if(resp)
       return true;
   else
       return false;
}

Now, I want to save that callback function into a separate js file, because I will use it in several pages. My logic told me to do this:
$('a.del').click(delete_element());

Having my js file like this:
function delete_element(){
   resp=window.confirm("Are you sure you want to delete this?");
   if(resp)
       return true;
   else
       return false;
}

This doesn't work. Everytime my page loads, it displays the confirm window, even if I haven't clicked the link.
It is clear that my logic failed this time. What am I missing?

A:
$('a.del').click(delete_element());

That is calling the function delete_element() and hoping for a function to be returned.
$('a.del').click(delete_element);

That (note the missing ()) will set the click handler to delete_element.

A: try;
$('a.delete').click(function(){
  delete_element()
}

edit
I'd be passing the reference to the element to remove to the delete_element function and removing it from there as the name of the function says delete_element not ask_to_delete_element.

A: How about
function deleteElement() {
   return window.confirm("Are you sure you want to delete this?");
}

$('a.delete').click(deleteElement);

Or if this is standard behavior for your pages:
$('a.delete').live('click', function() {
   return window.confirm("Are you sure you want to delete this?");
});


text:
Q: How can we do a Group By on Multiple fields and Select First or Max? I just concatenated two data frame together. That step is fine. Now I am trying to figure out how to do some kind of sort, group by, and select the first item.  I think the code should be something like this (but this doesn't work).
First attempt:
df_final = df_final.sort_values('location','project_type','data_date', ascending=True).drop_duplicates('location','project_type','data_date', keep='first')

Second attempt:
df_final = df_final.groupby(['location','project_type'], sort=True)['data_date','ltd_spending'].max()

I want to group by location, project_type, and data_date, and keep the row with the maximum date.  Here is a small sample of my data.

So, it would be max date and max spending, per location and project.  I think I have to fill down to impute the blanks as well.  Maybe there's some way to automatically do that in Pandas...not sure.
I want to end up with this.

Any thoughts?

A: You are missing square brackets [ and ] in
df_final = df_final.sort_values('location','project_type','data_date', ascending=True).drop_duplicates('location','project_type','data_date', keep='first')

It should be
df_final = df_final.sort_values(['location','project_type','data_date'], ascending=True).drop_duplicates(['location','project_type','data_date'], keep='first')

Use keep='first' for min value, 'last' for max since you've sorted the dataset.
It is equivalent of doing a groupby(...).min() or a groupby(...).max()

A: This should sort you out now that you want to keep latest date and  max spending.
 df.groupby(['location', 'project_type']).max()


text:
Q: Список из nil вместо данных В документации приведён пример.
var results []map[string]interface{}
db.Table("users").Find(&results)

Делаю аналогично:
  var results []map[string]interface{}
  c.db.Table("project").Find(&results)

И получаю []map[string]interface{}{nil}


text:
Q: Need help in iOS lib armv7 and 64 bit version I'm creating a project with Core-Plot lib.
I add the lib with static way.
How can I run my app in 32 + 64 bit devices?
if I run lipo libCorePlot-CocoaTouch.a -info
console response:

Architectures in the fat file: libCorePlot-CocoaTouch.a are: armv7 armv7s arm64

But this library works only with 32bit devices/simulator with 64bit simulator give me this error:
ld: warning: ignoring file PATH/libCorePlot-CocoaTouch.a, missing required architecture i386 in file PATH/libCorePlot-CocoaTouch.a (3 slices)
Undefined symbols for architecture i386:
  "_CPTDecimalFromCGFloat", referenced from:
      -[HomeViewController configureSecondPlots] in HomeViewController.o
      -[HomeViewController configureSecondAxes] in HomeViewController.o
  "_CPTDecimalFromInteger", referenced from:
      -[HomeViewController configureSecondAxes] in HomeViewController.o
  "_OBJC_CLASS_$_CPTAxisLabel", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTColor", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTFill", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTGraphHostingView", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTMutableLineStyle", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTMutableTextStyle", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTPieChart", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTPlotSymbol", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTScatterPlot", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTTextLayer", referenced from:
      objc-class-ref in HomeViewController.o
  "_OBJC_CLASS_$_CPTXYGraph", referenced from:
      objc-class-ref in HomeViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

How can I fix this problem?
Thank you

A: Combine both libraries and make a universal binary
lipo -create <simulator_lib>.a <device_lib>.a -output lib.a

A: Open the Core Plot iOS project (CorePlot-CocoaTouch.xcodeproj), update the architecture build settings to include 64-bit, and build the "Universal Library" target. This will create a folder called "Release-universal" in your build folder containing a universal library with all architectures (device and simulator) and copies of all of the header files.


text:
Q: Are security updates applied with `dnf update` or is it separate procedure in Linux? I found this vulnerability with polkit. It was found in Jan 22. How does keeping Linux updated security wise works in general?
If I run dnf update on CentOS9 - will it fix it? Or shall I look into each and every vulnerability myself and fix it manually?

A: It should fix it.
Errata are of three types: bug, security and enhancements.
with dnf update, you will get all of them.
You can filter as well; for e.g., to check only for security updates, run:
dnf check-update --security
and you can apply them with:
dnf update --security


text:
Q: Weighted averages: accounting for grid cell surface variation in proportion to the cosine of its latitude Non-geographer learning GIS here. I'm using ArcGIS Desktop v. 10.2.2.
I have a 30-arc second Terrain Ruggedness Index (TRI) raster file, and I want to measure the average ruggedness within each polygon of shapefile I have (not public). The TRI data is available here.
The authors of these data point out that "it is important to take into account that the sea-level surface that corresponds to a 30 by 30 arcsecond cell varies in proportion to the cosine of its latitude." They provide a data file measuring the surface area of each cell, in square metres, which must be used to weight the TRI when averaging across polygons.
Questions:

*

*Instead, can I re-project the raster data to an equal area projection and then calculate an unweighted average raster value? In other words, does an equal area projection account for this surface variation in proportion to the cosine of its latitude?

*If the weighted average raster value route is a must, is the appropriate method to use the Times tool with the TRI raster and cell area raster, then calculate the average raster value of each polygon with Zonal Statistics?


text:
Q: Least Squares Derivation I was reading this to review the derivation of the ordinary least squares estimator but I'm having trouble differentiating (4). Can someone please help explain why
$ \dfrac{\partial (\hat{\beta}'X'X\hat{\beta})}{\partial \hat{\beta}} = 2X'X\hat{\beta} $
I understand all the other steps.
Thanks!

A: First we need to note that $X'X$ is a symmetric matrix as $(X'X)'=X'(X')'=X'X$.
Now,Using basic matrix differentiation,we know that for symmetric matrix $A$,$\dfrac{\partial (x'Ax)}{\partial x} = 2Ax = 2x'A$ where $x$ is a vector and dimensions are proper.
hence result follows trivially.
Note:Actually we can say more,if $A$ is any $n \times n$ matrix, $x$ is $n \times 1$ vector,then,
$ \dfrac{\partial (x'Ax)}{\partial x} = x'(A'+A)$
Proof:$$ x'Ax = \sum_{j=1}^n \sum_{i=1}^n a_{ij}x_ix_j$$
Differentiating wrt to $x_k$,we get,
$$\dfrac{\partial (x'Ax)}{\partial x_k}= \sum_{j=1}^n a_{kj}x_j + \sum_{i=1}^n a_{ik}x_i\ ;  \forall k = 1,...,n$$
hence,$$\dfrac{\partial (x'Ax)}{\partial x} = x'A'+x'A$$
Hence result follows.
More details on Matrix differentiation can be found on http://en.wikipedia.org/wiki/Matrix_calculus .
Thanks.

A: Notice first that you might guess this formula because if $X$ and $\hat{\beta}$ are $1 \times 1$ then it reduces to the formula for the derivative of $x^2$ from calculus.
Let's derive a multivariable product rule that will help us here.  Suppose
$f:\mathbb{R}^n \to \mathbb{R}$ and suppose
$$f(x) = \langle g(x), h(x) \rangle$$ for some functions $g:\mathbb{R}^n \to \mathbb{R}^m$ and $h:\mathbb{R}^n \to \mathbb{R}^m$.  Then if $\Delta x \in \mathbb{R}^n$ is small (and $g$ and $h$ are differentiable at $x$), we have
$$\begin{align*}
f(x + \Delta x) &\approx \langle g(x) + g'(x) \Delta x, h(x) + h'(x) \Delta x \rangle \\
&= \langle g(x),h(x) \rangle + \langle g(x), h'(x) \Delta x \rangle
+ \langle g'(x) \Delta x, h(x) \rangle + \langle g'(x) \Delta x, h'(x) \Delta x \rangle \\
&\approx \langle g(x),h(x) \rangle + \langle g(x), h'(x) \Delta x \rangle
+\langle g'(x) \Delta x, h(x) \rangle \\
&= \langle g(x),h(x) \rangle + \langle h'(x)^T g(x), \Delta x \rangle
+ \langle g'(x)^T h(x), \Delta x \rangle \\
&= f(x) + \langle h'(x)^T g(x) + g'(x)^T h(x), \Delta x \rangle.
\end{align*}$$
Comparing this result with
$$f(x + \Delta x) \approx f(x) + \langle \nabla f(x), \Delta x \rangle$$
we discover that
$$\nabla f(x) = h'(x)^T g(x) + g'(x)^T h(x).$$
This is our product rule.  (I'm using the convention that the gradient is a column vector, which is not completely standard.)
Now let $g(x) = Ax$ for some matrix $A$.  So $g'(x) = A$.
What's the gradient of the function
$$\begin{align*}
f(x) &= \langle g(x),g(x) \rangle \\
&= \langle Ax, Ax \rangle \\
&= x^T A^T A x \quad \text{?}
\end{align*}$$
By our product rule the answer is
$$\begin{align*}
\nabla f(x) &= 2g'(x)^T g(x) \\
&= 2 A^T A x.
\end{align*}$$
This is the result that you wanted to derive.


text:
Q: Elastic search result with range operator returning wrong results Elastic search result with range operator returning wrong results

ElasticSerchQuery
{"query": {"bool": {"filter": [{"term": {"Id": {"value": "v1"}}},{"term": {"Segment": {"value": 1}}},     {"term": {"Attribute": {"value": "Test"}}},{"range": {"Value_Min": {"lte": 999999996}}},{"range": {"Value_Max": {"gte": 999999996}}}]}}, "sort": [{"Value_Min": {"order": "asc"}}], "size": 10}

First two column in the table is exact match and 3rd and 4th column in the table is range operation
The datatype used for the range operation() value min and value max is float.
I am searching for large value(999999996) when I search for small values it returns the correct value.
Did the search query dependent on the data type for range operator?
I am expecting one row in the result and which is the 2nd row of the table mentioned here.
but I am getting all the rows when searching from the elastic search head

A: This is due to floating-point precision.
You need to change your Value_Min and Value_Max fields to be of type double instead of float and your query will work out the way you expect.


text:
Q: WinForms, WPF, Silverlight, Asp .NET, MVC, ... What to choose? I've been programming for over 15 years and started with .NET 5 years ago. We built our framework for windows data-oriented apps and it is a quite stable.
At this point,  we are considering to make a new platform. But, I am a little bit confused with all these new technologies. We considered CAB and SmartClient technologies but there are also WPF, WinForms and Silverlight options in there.

A: It sounds like you just need a quick overview of the technologies you have outlined there.
WPF: Windows Presentation Foundation - a new graphical rendering system for building interfaces based on the XAML markup language.
WinForms: Windows Forms Applications - Visual Studio's classical drag-drop GUI.
Silverlight: a Web Application framework - usually used with WPF, very similar features
ASP.NET & MVC: ASP.NET is the web application framework used in conjunction with C# and VB.NET used and MVC stands for Model-View-Controller - a design pattern that has actually been around for ~30 years
Without knowing the true intricacies of your framework, what you need it to do, what limitations you have - I can't say X would be better than Y - especially seeing as WinForms and WPF is used for desktop applications, and Silverlight, ASP is used for web applications - unless you're thinking of linking these in with each other? You haven't given enough information in your question.

However, the best for investing in the following 5 years? The most recent and still in development technologies are WPF, Silverlight and the ASP.NET MVC - but nobody has a crystal ball to say whether these will still be alive, kicking, and technologically advanced in 5 years time.

A:
We built our framework for windows data-oriented apps and it is a quite stable. At this point, we are considering to make a new platform.

For your specs, all choices might be very good :)

A: I know that, but what you think is the best for investing in the following, let's say, 5+ years?

A: If you have a choice ( meaning if you are just displaying data without all the fanciful animation, movie and game like stuff), use ASP.NET MVC.
I always advocate web applications over desktop ones, because web apps are hosted in a single place, and so they won't produce upgrade nightmare.
In terms of which one has the brightest future, well, none of us have crystal ball and we don't know what Microsoft will throw at us in a few years time. But you should orient your apps around your business, not around fashion. If you really ask me out of the so many, which one will still remain standing 5 years later, I would say ASP.NET MVC, because ASP.NET is a mature technology, and MVC is a tried-and-true design pattern that has been used by open source and non-MIcrosoft companies. The fact that it is widely accepted makes it less likely to fade out of fashion.

A: If you want to continue with creating desktop applications, then your two major choices are WinForms or WPF.  WPF is the "hot" technology right now, but there are a few things to consider before choosing it.

*

*WPF requires .Net 3.5 (maybe it's 3.0, but whatever).  This is significant because many corporate customers are still using .Net 2.0, and may not authorize upgrading to 3.5 for some time (my former company still has some clients that haven't authorized moving from .Net 1.1 to 2.0 yet).  Also, the installer for .Net 2.0 is 23 MB while the installer for .Net 3.5 is close to 200 MB, and the 3.5 installer appears to be buggy, failing occasionally with a helpful "SETUP Error" message.

*Developing with WPF requires Visual Studio 2008.  If you're currently using an older version, you'll have to upgrade.

*This isn't completely true, but for the most part what WPF brings to the table is a much snazzier user interface.  In my experience, corporate customers who are paying big bucks for custom software do not care in the slightest how the application looks - they only care that it functions well and that it ultimately saves them money.

Finally, if you already have experience developing desktop applications for Windows, then you will feel right at home going the WinForms route.  Also, because of the Mono project, a WinForms app can (theoretically) work on other platforms like Mac, Linux and the iPhone, whereas this is not yet possible for WPF (I might be wrong about this, and I will happily correct myself if someone points it out).
I'm actually sort of torn about this advice, because I think WPF is very cool and powerful, and it may take off and become the only viable way of developing for Windows very soon.  It is a risk, however.

A: Thank you all for answers !
We tested all platforms and we have at least one project finished using MVC, WPF, Silverlight, WinForms...
The main problem with WPF and Silverligth is missing of native ReportVIewer controls since we have a lot of reports (RDL) created.
Personally, I think also that MVC is best structured framework.
I really have positive thinking of MONO. But, I would rather decrease the price of the project so the clients can buy WINDOWS but to handle bugs in Mono-Linux option.
We decided to follow the Microsoft way.
I'm thinking of some kind hibrid framework (Webservice - SQL SERVER- ADO .NET Entity Framework) to be on hosted on server and hibrid CAB-SMARTCLIENT to be usen on clients.
I really miss the times where only one tool and technology was available like Levi's 501 :)


text:
Q: Is there a Windows equivalent to fdopen for HANDLEs? In Unix, if you have a file descriptor (e.g. from a socket, pipe, or inherited from your parent process), you can open a buffered I/O FILE* stream on it with fdopen(3).
Is there an equivalent on Windows for HANDLEs?  If you have a HANDLE that was inherited from your parent process (different from stdin, stdout, or stderr) or a pipe from CreatePipe, is it possible to get a buffered FILE* stream from it?  MSDN does document _fdopen, but that works with integer file descriptors returned by _open, not generic HANDLEs.

A: Unfortunately, HANDLEs are completely different beasts from FILE*s and file descriptors. The CRT ultimately handles files in terms of HANDLEs and associates those HANDLEs to a file descriptor. Those file descriptors in turn backs the structure pointer by FILE*.
Fortunately, there is a section on this MSDN page that describes functions that "provide a way to change the representation of the file between a FILE structure, a file descriptor, and a Win32 file handle":

*

*_fdopen, _wfdopen: Associates a stream with a file that was
  previously opened for low-level I/O and returns a pointer to the open
  stream.

*_fileno: Gets the file descriptor associated with a stream.

*_get_osfhandle: Return operating-system file handle associated
  with existing C run-time file descriptor

*_open_osfhandle: Associates C run-time file descriptor with an
  existing operating-system file handle.

Looks like what you need is _open_osfhandle followed by _fdopen to obtain a FILE* from a HANDLE.
Here's an example involving HANDLEs obtained from CreateFile(). When I tested it, it shows the first 255 characters of the file "test.txt" and appends " --- Hello World! --- " at the end of the file:
#include <windows.h>
#include <io.h>
#include <fcntl.h>
#include <cstdio>

int main()
{
    HANDLE h = CreateFile("test.txt", GENERIC_READ | GENERIC_WRITE, 0, 0,
        OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
    if(h != INVALID_HANDLE_VALUE)
    {
        int fd = _open_osfhandle((intptr_t)h, _O_APPEND | _O_RDONLY);
        if(fd != -1)
        {
            FILE* f = _fdopen(fd, "a+");
            if(f != 0)
            {
                char rbuffer[256];
                memset(rbuffer, 0, 256);
                fread(rbuffer, 1, 255, f);
                printf("read: %s\n", rbuffer);
                fseek(f, 0, SEEK_CUR); // Switch from read to write
                const char* wbuffer = " --- Hello World! --- \n";
                fwrite(wbuffer, 1, strlen(wbuffer), f);
                fclose(f); // Also calls _close()
            }
            else
            {
                _close(fd); // Also calls CloseHandle()
            }
        }
        else
        {
            CloseHandle(h);
        }
    }
}

This should work for pipes as well.

A: Here is a more elegant way of doing this instead of CreateFile: specify "N" in fopen(). It's a Microsoft-specific extension to fopen, but since this code is platform-specific anyway, it's ok. When called with "N", fopen adds _O_NOINHERIT flag when calling _open internally.
Based on this:
Windows C Run-Time _close(fd) not closing file


text:
Q: Thread.Sleep or Task.Delay in a synchronous method with both a sync and async caller I have a synchronous method:
public void DoStuff() {
    DoThings();
    GraphClient.SetExtendedProperty(user, propertyName, value);     // this method occasionally throws an exception
    DoOtherThings();
}

Call3rdPartyMethod makes a REST API call using the Azure Ad Graph Client API which throws an exception if I try to set the value of an extended property on Active Directory and it isn't found.  This usually happens a new user is added to the directory and the Extension Properties feature hasn't extended the user schema before I want to set the values (it seems to take a few seconds).
I replaced the SetExtendedProperty call with my own wrapper containing the call in a busy-wait loop thus:
public void TrySetProperty(GraphObject user, string propertyName, string value)
{

   var exceptions = new List<Exception>();

   for (int retry = 0; retry < 5; retry++)
   {
      try
      {
          if (retry > 0)
              Thread.Sleep(1000);
              GraphClient.SetExtendedProperty(user, propertyName, value);
      }
      catch (Exception ex)
      {
          exceptions.Add(ex);
      }
   }

   throw new AggregateException(exceptions);
  }
}

The issue is that I want to be able to call TrySetProperty from both a synchronous and asynchronous method:
public void DoStuff() {
    DoThings();
    TrySetProperty(user, propertyName, value);
    DoOtherThings();
}

public Task DoOtherStuffAsync() {
    await DoAsyncThings();
    TrySetProperty(user, propertyName, value);
    await DoOtherAsyncThings();
}

I can't change SetExtendedProperty to be asynchronous, and I'm concerned I shouldn't be using Thread.Sleep if i'm calling it from an asynchronous method - rather Task.Delay().  Can anyone advise?

A: I would recommend:

*

*Making a fully-asynchronous version if possible. REST APIs are naturally asynchronous, but some client libraries are still outdated (i.e., have only synchronous methods).

*Expose only an asynchronous version if possible (since the operation is naturally asynchronous). If you must support synchronous APIs (e.g., for backwards compatibility), then use the boolean argument hack in my article on brownfield async.

*Use Polly for retry logic.

Assuming that you've got a fully-asynchronous version of GraphClient.SetExtendedProperty working, then your code could look like this:
private static readonly Policy syncPolicy = Policy.Handle<Exception>().WaitAndRetry(5, _ => TimeSpan.FromSeconds(1));
private static readonly Policy asyncPolicy = Policy.Handle<Exception>().WaitAndRetryAsync(5, _ => TimeSpan.FromSeconds(1));

private static async Task TrySetProperty(GraphObject user, string propertyName, string value, bool sync)
{
    if (sync)
        syncPolicy.Execute(() => GraphClient.SetExtendedProperty(user, propertyName, value));
    else
        await asyncPolicy.ExecuteAsync(() => GraphClient.SetExtendedPropertyAsync(user, propertyName, value));
}

public static Task TrySetPropertyAsync(GraphObject user, string propertyName, string value) =>
    TrySetProperty(user, propertyName, value, sync: false);
public static void TrySetProperty(GraphObject user, string propertyName, string value) =>
    TrySetProperty(user, propertyName, value, sync: true).GetAwaiter().GetResult();

If your TrySetProperty logic really is that simple (i.e., it literally only calls a single method on GraphClient), then you can do away with the boolean argument hack for simpler code:
private static readonly Policy syncPolicy = Policy.Handle<Exception>().WaitAndRetry(5, _ => TimeSpan.FromSeconds(1));
private static readonly Policy asyncPolicy = Policy.Handle<Exception>().WaitAndRetryAsync(5, _ => TimeSpan.FromSeconds(1));

public static async Task TrySetPropertyAsync(GraphObject user, string propertyName, string value)
{
  await asyncPolicy.ExecuteAsync(() => GraphClient.SetExtendedPropertyAsync(user, propertyName, value));
}

public static void TrySetProperty(GraphObject user, string propertyName, string value)
{
  syncPolicy.Execute(() => GraphClient.SetExtendedProperty(user, propertyName, value));
}


text:
Q: Alignment after equal sign How can I align a split equation starting with a negative term such that the minus sign in the second line (which is indeed a binary operator) is exactly below the negative sign as automatically generated by the dmath environment from the breqn package? Perhaps my manual alignment looks better after all.
\documentclass{article}
\usepackage{amsmath}
\usepackage{breqn}

\begin{document}

    \[
    \begin{split}
    a={}&  {-b}+c\\
    & -d+e
    \end{split}
    \]

    \begin{dmath*}
        a = -b+c\\-d+e
    \end{dmath*}

\end{document}

A: Like this?

Since a \medmuskip (normally 4.0mu plus 2.0mu minus 4.0mu) is inserted both before and after a binary operator (see the table on p. 170 of The TeXbook), and since you want to remove the space before the - sign, while retaining the one after it, the easiest thing of all is to compensate for the former by adding a negative space of the same magnitude:
\documentclass{article}
\usepackage{amsmath}
\usepackage{breqn}

\begin{document}

    \[
    \begin{split}
    a={}&  {-b}+c\\
    & \mspace{-\medmuskip}-d+e
    \end{split}
    \]

    \begin{dmath*}
        a = -b+c\\-d+e
    \end{dmath*}

\end{document}

Please note that this is only appropriate for equations typeset in \displaystyle and in \textstyle.  For the same trick to work in script styles too, the correct incantation would be \nonscript\mspace{-\medmuskip} (but who could ever need this in script styles?).


text:
Q: Sorting a table using macro hoping this newbie here could get some assistance with sorting using macro please.
I have a table ranging D:R to be sorted.
Firstly, the whole table needs to be sorted in ascending order according to column Q.
Then the same table get sorted in ascending order according to column P.
Lastly the whole table needs to bring yellow highlighted rows per column D to the top.
My current formula is recorded using the in-built recorder and it doesn't work.
Would anyone provide any suggestions? Many thanks in advance!
'Sorting for easier read
    'Check for filter, turn on if none exists
    If Not ActiveSheet.AutoFilterMode Then
        ActiveSheet.Range("D1:R1").AutoFilter
    End If
    'Sort in order of column Q
    ActiveWorkbook.Worksheets(4).AutoFilter.Sort.SortFields.Clear
    ActiveWorkbook.Worksheets(4).AutoFilter.Sort.SortFields.Add Key:=Range( _
        "Q1:Q10000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
        xlSortNormal
    With ActiveWorkbook.Worksheets(4).AutoFilter.Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
    End With
    'Sort in order of column P
    ActiveWorkbook.Worksheets(4).AutoFilter.Sort.SortFields.Clear
    ActiveWorkbook.Worksheets(4).AutoFilter.Sort.SortFields.Add Key:=Range( _
        "P1:P10000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
        xlSortNormal
    With ActiveWorkbook.Worksheets(4).AutoFilter.Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
    End With
    'Bring highlighted row to the top
    ActiveWorkbook.Worksheets(4).AutoFilter.Sort.SortFields.Clear
    ActiveWorkbook.Worksheets(4).AutoFilter.Sort.SortFields.Add(Range("D:D" _
        ), xlSortOnCellColor, xlAscending, , xlSortNormal).SortOnValue.Color = RGB(255 _
        , 255, 0)
    With ActiveWorkbook.Worksheets(4).AutoFilter.Sort
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
    End With

A: Here's one that I did to sort column 52 on color yellow:
Sub SortOnDuplicates()

ws.ListObjects("Table1").Range.AutoFilter _
    Field:=52, _
    Criteria1:=RGB(255, 255, 0), _
    Operator:=xlFilterCellColor

End Sub

Here's one for sorting on ascending:
ws.ListObjects("Table1").Range.AutoFilter Field:=52
With ws.ListObjects("Table1").Sort
    'Last Name
    .SortFields.Clear
    .SortFields.Add _
        Key:=Range("Table1[[#All],[Last Name]]"), _
        SortOn:=xlSortOnValues, _
        Order:=xlAscending, _
        DataOption:=xlSortNormal
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    'First Name
    .SortFields.Clear
    .SortFields.Add _
        Key:=Range("Table1[[#All],[First Name]]"), _
        SortOn:=xlSortOnValues, _
        Order:=xlAscending, _
        DataOption:=xlSortNormal
    .Header = xlYes
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
End With