Linux OpenSuse42.3 - port status

Question: I am redirecting this question from another site as I have a problem, which I hope somebody can point me to the right direction.
Problem >>>
A) Our external provider (connects via VPN) needs to access "OpenSuse42.3" to specific ports, which
"nmap" or "ncat" tools shows as "filtered" or "refused".
B) No services are listening on these ports.
C) No firewall is running on this server.
D) Security team opened these ports on firewall with evidence that connection get reset by server
"OpenSuse42.3".
Test runs from "10.10.10.2" to "10.10.10.1" (problem server) from provider VPN connection (from my computer)
Example 1 : from "10.10.10.2"

nmap -sT -p1101,3050 10.10.10.1

 PORT     STATE    SERVICE
 1101/tcp filtered pt2-discover
 3050/tcp filtered gds_db

Example 2 : from "10.10.10.2"

nc -z -v 10.10.10.1 1101

  Ncat: Version 7.50 ( https://nmap.org/ncat )
  Ncat: Connection refused.

nc -z -v 10.10.10.1 3050

  Ncat: Version 7.50 ( https://nmap.org/ncat )
  Ncat: Connection refused.

Example 3: on server "10.10.10.1"

tcpdump -n -i eth0 port 1101 or port 3050 -v

tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes

13:00:28.940582 IP (tos 0x0, ttl 64, id 32383, offset 0, flags [DF], proto TCP (6), length 60)
10.10.10.2.58000 > 10.10.10.1.1101: Flags [S], cksum 0xa3fc (correct), seq 3906215335, win 29200,
options [mss 1460,sackOK,TS val 1388733400 ecr 0,nop,wscale 7], length 0

13:00:28.940662 IP (tos 0x0, ttl 64, id 40440, offset 0, flags [DF], proto TCP (6), length 40)
10.10.10.1.1101 > 10.10.10.2.58000: Flags [R.], cksum 0x347b (correct), seq 0, ack 3906215336, win 0,
length 0

13:00:31.263502 IP (tos 0x0, ttl 64, id 60627, offset 0, flags [DF], proto TCP (6), length 60)
10.10.10.2.40830 > 10.10.10.1.3050: Flags [S], cksum 0x8bc2 (correct), seq 3504308280, win 29200,
options [mss 1460,sackOK,TS val 1388735723 ecr 0,nop,wscale 7], length 0

13:00:31.263569 IP (tos 0x0, ttl 64, id 40888, offset 0, flags [DF], proto TCP (6), length 40)
10.10.10.1.3050 > 10.10.10.2.40830: Flags [R.], cksum 0x2554 (correct), seq 0, ack 3504308281, win 0,
length 0

BUT
As soon as I put something on the server like - "nc -l 1101" or "nc -l 3050" problem disappears, which  makes sense. To my knowledge "nmap" tool usually shows port status as "closed" if port is not firewalled and service is not running and "open" if service is running on this port.
Question
Are ports opened or closed ??? I think that I am correct and ports ARE OPEN. What else do I check, because provider keep insisting that ports are closed on "10.10.10.1" and he cannot continue his work. He uses test as - "telnet 10.10.10.1 1101".
Please let me know if something is unclear in this situation and I will respond.
Appreciate it !!!!
Comment: You can always see if a service is listening on a port by using netstat. For example: netstat -a -n -p -t -l(-a - all users, not just yours, requires root; -n - don't resolve IP addresses to host names; speeds things up; -p - show what process is listening; -t - show TCP connections only, change to -u if your service uses UDP; -l - show listening/open ports only). By the way, telnet will only test TCP connections, it won't work on UDP, but it does work in most cases.
Comment: Also if nc -l 1101 on 10.10.10.1 actually works, it means that whatever service is supposed to be listening on port 1101 is not running. Normally if a port is already in use, you should get something like "nc: Address already in use" from nc, even if you run it as root, although you shouldn't need to, because 1101 > 1024 (i.e. unprivileged port).
Comment: Thank you Rouben!!
Answer: The ports are obviously closed, because no service is listening on them, and they return an RST in response to a SYN. They can't be open, because no service is listening. You even demonstrated this yourself with nc -l.
You seem to be confusing open vs. closed (whether a service listens on the port) with allowed vs. denied (whether the port is firewalled). The ports are clearly not firewalled either.
If a service is supposed to be listening on that port, you need to start that service.
Comment: Thank you, Michael. Your answer is clear.

Linux OpenSuse42.3 - port status


Problema com '.data()' e seu valor dentro de um if

Question: Estou criando uns If's para não perder o costume de usá-los, porém ao tentar algo um pouco diferente do que costumo fazer, ocorre um erro, o if não funciona. Como posso corrigir ? Tentei nos seguintes modos:
if($('.carousel-indicators li.active').data('slide-to').val() = 0){
    console.log('Teste');
};
ERRO : Uncaught ReferenceError: Invalid left-hand side in assignment

e
if($('.carousel-indicators li.active').data('slide-to') = 0){
    console.log('Teste');
};
ERRO : Uncaught TypeError: $(...).data(...).val is not a function

Comment: Faltou um sinal de igual `.val() == 0` e por que está usando `.data().val()`??
Comment: Porque simplesmente o .data() não havia funcionado
Answer: Quando você compara alguma coisa precisa usar == ou === (comparação strict).
O = é para atribuir valor à alguma variável.
Comment: Porquê o `-1`?  A resposta está certa e explica o problema do AP...
Comment: Eu também acho que o problema provèm daí, não percebi o menos `-1`, a nao ser que me tenha escapado alguma coisa @Sergio
Comment: @Miguel alguem deu -1 e outra pessoa +1 pra compensar, provavelmente o Sergio
Comment: @Miguel eu tb não, por isso (e porque a resposta está certa) dei `+1`
Comment: Yap também acho
Answer: Dois problemas:

o .data() já te dá uma String, não precisas (nem deves) usar o .val()
comparação deve ser feita com == ou ===, usar só = é uma atribuição.

Solução:
if($('.carousel-indicators li.active').data('slide-to') == 0){
    console.log('Teste');
};


js match - get file extension in path

Question: How to get file extension in path using JavaScript?
alert("http://max/fi.le.rar".match(/\..*/i));

returns data since first dot
.le.rar

but I need only .rar
Answer: Try this:
"http://max/fi.le.rar".match(/\.[^.]+$/);

Comment: I should comment that the returning value is an array of string
Answer: var path = "http://max/fi.le.rar";
var extention = path.substring(path.lastIndexOf("."), path.length);

I did a test with substring and split from @wisdom.
After 500000 times:
.rar Execution time: 47ms  (sub)
 rar Execution time: 53ms (split without dot)
(after some more testing the execution times are about the same)

I have no experience with match
Answer: or You can use javascript split() function like this
var str="http://max/fi.le.rar";
var n=str.split(".");
alert(n[n.length - 1]);

js match - get file extension in path


How to inherit MutableList in Kotlin?

Question: I am trying to inherit MutableList, and add my own function to it. For example:
class CompositeJob : MutableList<Job> {
    fun cancelAllJobs() {
        for (job in this) {
            job.cancel()
        }
    }
}

But I got the following error:

Class 'CompositeJob' is not abstract and does not implement abstract member
  public abstract val size: Int defined in kotlin.collections.MutableList

How can I inherit MutableList, so I can use its original methods like add() and isEmpty(), and add my own one?
Thanks.
Comment: Point your mouse in `CompositeJob` class name and do `Alt + Enter` now those methods are partially implemented for you. BTW implementing `MutableList` is kinda hassle IMO, will you consider extending to `ArrayList` instead?
Answer: One option other answers don't mention is delegation:
class CompositeJob : MutableList<Job> by mutableListOf() {
    fun cancelAllJobs() {
        for (job in this) {
            job.cancel()
        }
    }
}

is basically equivalent to
class CompositeJob : MutableList<Job> {
    private val impl: MutableList<Job> = mutableListOf()
    override fun size() = impl.size()
    override fun add(x: Job) { impl.add(x) }
    // etc for all other MutableList methods

    fun cancelAllJobs() {
        for (job in this) {
            job.cancel()
        }
    }
}

Answer: MutableList is an interface - it doesn't implement any of its methods, just declares them. If you want to implement MutableList from scratch, you'll have to implement all 20 of its methods plus the size property, as your error already told you.
You can, however, subclass actual implementations of this interface, for example ArrayList or LinkedList:
class CompositeJob : ArrayList<Job>() {
    fun cancelAllJobs() {
        for (job in this) {
            job.cancel()
        }
    }
}

Edit: If you're just looking to group coroutine Job instances, you should use a parent Job, a SupervisorJob, and CoroutineScope at this point, instead of collecting jobs like this manually.
Comment: How do I create an empty instance of CompositeJob?
Comment: You can create an instance by calling its constructor: `val composite = CompositeJob()`
Comment: As simple as that ey. Cheers
Comment: in KMM `ArrayList` This type is final, so it cannot be inherited from
Answer: Implementation of all the members is not the only way to achieve what you need.
An easier way is  create an extension function like this:
fun MutableList<Job>.cancelAllJobs() {
    this.forEach { it.cancel() }
}

Now you can call myList.cancelAllJobs() for every MutableList<Job> object.
Answer: As I have tested you need to make CompositeJob an abstract as error also suggest. After that, you can able to override add() and isEmpty() from MutableList
So your code looks like as below:
abstract class CompositeJob : MutableList<Job> {
override fun add(element:Job): Boolean
  {

  }

override fun isEmpty(): Boolean
     {

     }
}

Answer: If you want to avoid inheritance, or if the concrete class methods are marked final, then you can use composition and redirect all method calls which are not overridden. Here's a template:
class MyMutableList<T> : MutableList<T> {
    private val list = mutableListOf<T>()
    override val size get() = list.size

    // MutableList<T>
    override fun add(element: T): Boolean = list.add(element)
    override fun add(index: Int, element: T) = list.add(index, element)
    override fun addAll(elements: Collection<T>): Boolean = list.addAll(elements)
    override fun addAll(index: Int, elements: Collection<T>): Boolean = list.addAll(index, elements)
    override fun clear() = list.clear()
    override fun remove(element: T): Boolean = list.remove(element)
    override fun removeAll(elements: Collection<T>): Boolean = list.removeAll(elements)
    override fun removeAt(index: Int): T = list.removeAt(index)
    override fun retainAll(elements: Collection<T>): Boolean = list.retainAll(elements)
    override fun set(index: Int, element: T): T = list.set(index, element)

    // List<T>
    override fun contains(element: T): Boolean = list.contains(element)
    override fun containsAll(elements: Collection<T>): Boolean = list.containsAll(elements)
    override fun get(index: Int): T = list.get(index)
    override fun indexOf(element: T): Int = list.indexOf(element)
    override fun isEmpty(): Boolean = list.isEmpty()
    override fun iterator(): MutableIterator<T> = list.iterator()
    override fun lastIndexOf(element: T): Int = list.lastIndexOf(element)
    override fun listIterator(): MutableListIterator<T> = list.listIterator()
    override fun listIterator(index: Int): MutableListIterator<T> = list.listIterator(index)
    override fun subList(fromIndex: Int, toIndex: Int): MutableList<T> =
        list.subList(fromIndex, toIndex)
}

...of course, this might add an additional layer of indirection, possibly affecting list performance with a slight overhead.

How to inherit MutableList in Kotlin?


How to rename or choose twigs file name suggestions?

Question: When I create a custom block called Lorem ipsum Dolor, I have not the possibility to choose the machine name. So when I have to make a twig template, the file suggestion is :

block—loremipsumdolor.html.twig

I mean it is without undescore. I found it hard to handle all these twig file when I work on a custom template. It is not human friendly readable.
Is there a way to choose the name of the file name or the block machine name ?
Other example :

Block name : Custom Search form

I have not this problem with node :

node--13--teaser.html.twig
Comment: You have to add your own template suggestions then. See https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21theme.api.php/function/hook_theme_suggestions_alter/8.2.x and look through https://drupal.stackexchange.com/search?q=block+template+suggestions
Answer: Given a block name of 'Custom Search form', you can add to the file name suggestions using a preprocess hook in your theme.
An example of code to add to the .theme file:
/**
 * Add an alternative to file name suggestions the Custom Search form block.
 *
 * Implements hook__suggestions_HOOK_alter().
 * @return array Suggestions.
*/
function mytheme_theme_suggestions_block_alter(array &$suggestions, array $variables) {
    if($variables['elements']['#id'] == 'customsearchform'){
        $suggestions[] = 'block__custom_search_form';
    }
}

This will result in an additional file name suggestion:

Comment: Apologies - I made a slight error. Correcting the original answer. Twig file suggestions use underscores, which are then converted to dashes for the actual file names. So the suggestion should be `block__custom_search_form`.
Comment: It seems the perfect solution. However, If I had this function to mytheme.theme, I can see in source code the new template file suggestion `block--custom-search-form.html.twig`. But if I use this template, I don't see it in front end. If I use the normal file suggestion `block--customsearchform.html.twig`, I can see my template in front-end. Is there something  should do ?


What is my error in solving the birthday problem for $k$ people?

Question: The birthday problem poses the following problem:

Calculate the probability that at least two people share a birthday out of $k$ people, assuming $365$ days in a year.

My attempt was to fix two people's birthdays to match. There are $k(k - 1)$ ways to do this. For the remaining $k - 2$ people, any birthday is fine, so there are $k(k - 1)365^{k - 2}$ ways to do dole out the birthdays where there is a match. I divided that by $365^k$, all the ways the birthdays can be distributed, and figured that would be the probability.
However, I am wrong. The answer is $1 - \frac{365(364)\cdots(365 - k + 1)}{365^k}$ from counting the complement. Where am I going wrong? Thanks.
Comment: The best way for such problems is to start with a small $k$. Let k=3. We use the complementary probability: 1-P("no common birthday"). Let say that person A has birthday at day $i$. Then the probability that person B has the not same birthday is $\frac{364}{365}$. And given that person B has not the same birthday as person A, the probability that person C has not the same birthday as person A and B is $\frac{363}{365}$.
Comment: (continued) So the probability that  at least two people share a birthday out of 2 people, assuming 365 days in a year is $1-\frac{364}{365}\cdot \frac{363}{365}=1-\frac{(365)\cdot (365-2+1)\cdot (365-3+1)}{365^3}$ This is $1 - \frac{365(364)\cdots(365 - k + 1)}{365^k}$ for $k=3$
Answer: The number of possible combinations of birthdays such that nobody shares a birthday out of $k$ individuals (assuming that $k<365$) is ${365(364)(363)…(365-k+1)}$.
The total number of possible birthdays is $365^k$.
Therefore, the probability that nobody shares a birthday will be $\frac{365(364)…(365-k+1)}{365^k}$.
We can then work out the probability that at least $2$ people share a birthday by simply computing $1-\frac{365(364)…(365-k+1)}{365^k}$ - giving us the required answer to your problem.
Now that begs the question of what is wrong with your solution. The issue is that you shouldn't multiply $k(k-1)$, you should be multiplying the number of possible positions available for an individuals birthday. For example, if we fix the first person's birthday, then there are now 364 choices for the second person's birthday to lie on (assuming that they do not share a birthday).
Answer: There are several problems in your approach:

The first problem is that your consider ordered pair instead of unordered. Really the cases $(1, 2)$ and $(2, 1)$ are the same and should be replaced by $\{\,1, 2\,\}$. The number of unordered pairs is $\frac{k(k - 1)}{2}$.

The second problem is that you allow other people to have the same birthday as the selected pair. Therefore you count the same combination several times. For example, if there are $k = 5$ people with the same birthday, you will count this option $\frac{k(k - 1)}{2} = 10$ times. However just removing for all others this one day is not enough, because there are cases when two pairs share birthday (unique for each pair). And the problem is still the same: you count the same combination several times. Therefore you should make all other birthdays to be pairwise distinct, and probability is $\frac{k(k - 1)}{2} \cdot \frac{365 \cdot 364 \cdots (365 - (k - 2))}{365^k}$.

The third problem follows from the second one, but it is the most significant. You should consider also cases when $3, 4, \ldots, k$ people have the same birthday. This is not a big deal: if exactly $\ell$ people share birthday and all others have pairwise distinct birthdays the probability is $\binom{k}{\ell} \cdot \frac{365 \cdot 364 \cdots \cdot (365 - (k - \ell))}{365^k}$. However there are more complicated cases, when there are two pairs sharing birthday (unique for each pair), when there are such pair and triple, when there are ten such pairs, six triples and three quadruples and so on. The number of cases you should consider is exponential of $k$ and there is no simple way to consider them all.


What are these mysterious core.xxx files doing in my site's root?

Question: I have never seen this before in my 2 years of building site's in Drupal. I just opened up one of my sites folder structure and found a large number of core.xxx files that I don't know what they do (and they are huge files, over 8GB worth). I found a couple of threads on this but no real answer. Any thoughts?
http://drupal.org/node/360867
http://drupal.org/node/115654
core.1688
core.2343
core.8485
core.3039
core.21233
core.23234
Answer: They are core dump files; they are files created when a program has terminated abnormally (crashed).
Answer: As kiamlaluno stated, the core.xxxx files are indeed core dump files. You can actually control those files with the ulimit clause (i.e. to turn them off, just use 'ulimit -c 0').
http://ss64.com/bash/ulimit.html
http://wiki.linuxquestions.org/wiki/Ulimit


A q-differential on a compact Riemann surface with genus $g\geq 2$ for $q\geq 1$ always has a zero

Question: While reading about Weierstrass points on a Riemann surface from 'Farkas and Kra' the Wronskian of a basis of q-differentials was introduced .
If $ \phi_1 dz^q,...,\phi_ddz^q$  (where d is the dimension of the space of holomorphic q-differentials) is a basis locally at a point by $z$ in those local coordinates, then the Wronskian is
$\Phi(z)=det \begin{bmatrix}\phi_1(z) dz^q & \phi_2(z) dz^q &...&\phi_d(z)dz^q \\
                             \phi_1'(z) dz^{q+1} & \phi_2'(z) dz^{q+1} &...&\phi_d'(z)dz^{q+1} \\
                             . &.&...&.\\
                             . &.&...&.\\
\phi_1^{(d-1)}(z) dz^{q+d-1} & \phi_2^{(d-1)}(z) dz^{q+d-1} &...&\phi_d^{(d-1)}(z)dz^{q+d-1} \\
   \end {bmatrix} $
Now, $P$ given by $z$ in the local coordinate  is a q-Weierstrass point iff $\Phi$ has a zero at $z$.
Now,on the question of existence of q-Weierstrass point on every compact Riemann surface of genus $g\geq 2$ and $q \geq1 $ Farkas and Kra state that every $m_q$ differential ($m_q$ being the order of the differential $\Phi$) has a zero. But I don't see why this must be true.
Can somebody please help me clear this doubt?
Answer: The degree of a $1$-differential $\omega$ on a Riemann surface of genus $g\geq2$ is at least $2.2-2=2$. Thus , any 1-differential has a zero.
Then The $q$-differential $\omega^q$ (whose local expression where $\omega=f(z)dz$ is given by $f(z)^qdz^q$ and for $q\geq1$ there is no ambiguity in this) has degree $(2g-2)^q\geq2^q>1$. Thus , every $m_q$ differential has zeroes (since all the $q$-differential belong to the $q$-canonical divisor class and their degrees are same).
This fact applied to the Wronskian in the question proves the existence of q-Weierstrass points on compact Riemann surfaces of genus $g$ for $g\geq2$ and $q\geq1$.(on the torus no Weierstrass points exist).


Can I publish something in my wall of facebook?

Question: I need to publish something in the user's facebook wall, when you entered the site, automatically.
This is the code that I actually use.
<code>function publish(){
    global $user;
    $attachment = array(
            'name' => 'Name app',
            'href' => url('http://....', array('absolute' => TRUE)),
            'description' => 'Use this application.',
          );

    $user_message = t('Check out the latest application on !site...', array('!site' => t('My Drupal for Facebook powered site')));

    $actions = array();

    $actions[] = array('text' => t('Read More'),
                       'href' => url('http://....', array('absolute' => TRUE)),
                      );

    fb_stream_publish_dialog(array('user_message' => $user_message,
                                  'attachment' => $attachment,
                                   'action_links' => $actions,
                            ));
}
</code>
This code work, but it publish again the text when I edit the page, or I go to a different page.
Is there a module (for publish), or another way to do this?
Answer: Set a session variable, or a cookie, when sent the first time; check that always.
Answer: If you are looking for a module to publish nodes on Facebook, there is the Drupal for Facebook module.

This set of modules and themes turns Drupal into a platform for developing Facebook Applications. This allows you to embed your content and features within facebook, or allow facebook users onto your site via Facebook Connect.
With Drupal for Facebook, you can harness all the power of Drupal in you Facebook App. If you already have content in Drupal, you can expose it on Facebook.

Read the online documentation for the Drupal for Facebook module to understand which libraries are required, and need to be installed; enable the Facebook API, and the FB Streams modules.


Tricky binomial coefficients problem

Question: Let $k$ be a positive integer and let $n = 6k - 1$. Let
$$S(n)=\sum_{j=1}^{2k-1} (-1)^{j+1} {{n}\choose{3j-1}}$$
How do you prove that $S(n)$ is never zero?
Comment: IIRW, you should be able to compute the sum in closed form by expanding $(1-j)^n$ and $(1-j^2)^n$, with $j=\exp \frac{2i\pi}{3}$. The idea is to find three linear equations between three sums involving $n \choose 3k$, $n \choose 3k+1$ and $n \choose 3k+2$, then solving (I had this one in an exam, without the $(-1)^{j+1}$, but it should be similar). The exam was 17 years ago, sigh.
Answer: The sequence $0,0,1,0,0,-1,0,0,1,0,0,-1,\ldots$ that your coefficients of $\binom nk$ got through for $k=0,1,2,\ldots$ is periodic of period $6$, so it is a linear combination of the geometric sequences with ratios the $6$-th roots of unity. Specifically if $z_l=\exp(l\pi\mathbf i/3)$ for $l=1,\ldots,5$, the general term of your sequence is
$$
  c_k=\frac13(z_4.z_1^k+(-1)^k+z_2.z_5^k)
$$
This allows you to write
$$
\sum_{j=1}^{2k-1} (-1)^{j+1} \binom n{3j-1}
=\sum_{k=0}^nc_k\binom nk
=\frac13\bigl(z_4(1+z_1)^n+(1-1)^n+z_2(1+z_5)^n\bigr),
$$
where the middle term is $0$ (since $n>0$) and the other terms are complex conjugates. To see that the result is never zero is a question of checking that the argument of $1+z_1$ is not a rational multiple of$~\pi$, so the outer terms never become purely imaginary.
Answer: By  way of  enrichment here  is  another algebraic  proof using  basic
complex variables.

Suppose we first compute
$$Q(k) = \sum_{q=1}^{2k} (-1)^{q+1} {6k-1\choose 3q-1}.$$
Introduce the integral representation
$${6k-1 \choose 6k-3q}
= \frac{1}{2\pi i}
\int_{|z|=\epsilon} \frac{(1+z)^{6k-1}}{z^{6k-3q+1}} \; dz.$$
We use this  to obtain an integral for the sum.  Note that when $q>2k$
the integral becomes zero and for $q=0$ is zero as well. Therefore
we may extend the sum from $q$ being zero to infinity to obtain
$$\frac{1}{2\pi i}
\int_{|z|=\epsilon} \frac{(1+z)^{6k-1}}{z^{6k+1}}
\sum_{q\ge 0} (-1)^{q+1} z^{3q} \; dz
\\ = - \frac{1}{2\pi i}
\int_{|z|=\epsilon}
\frac{(1+z)^{6k-1}}{z^{6k+1}} \frac{1}{1+z^3} \; dz.$$
Introduce the roots where $p=0,1,2$
$$\rho_p = \exp(\pi i/3 + 2\pi i p/3)$$
Using partial fractions by the  Cauchy Residue Theorem on simple poles
we thus obtain
$$\frac{1}{1+z^3} =
\sum_\rho \frac{1}{z-\rho}
\times \mathrm{Res}_{z=\rho} \frac{1}{1+z^3}
\\= \sum_\rho \frac{1}{z-\rho} \frac{1}{3\rho^2}
= \sum_\rho \frac{1}{z-\rho} \frac{\rho}{3\rho^3}
= -\frac{1}{3} \sum_\rho \frac{\rho}{z-\rho}.$$
Substituting this into the integral we have
$$ \frac{1}{3} \frac{1}{2\pi i}
\int_{|z|=\epsilon}
\frac{(1+z)^{6k-1}}{z^{6k+1}}
\sum_\rho \frac{\rho}{z-\rho} \; dz
\\ = - \frac{1}{3} \frac{1}{2\pi i}
\int_{|z|=\epsilon}
\frac{(1+z)^{6k-1}}{z^{6k+1}}
\sum_\rho \frac{1}{1-z/\rho}\; dz.$$
The integral is prepared for coefficient extraction which gives
(use $\rho^6 = 1$)
$$-\frac{1}{3}
\sum_\rho \sum_{q=0}^{6k-1} {6k-1\choose q} \rho^{-(6k-q)}
\\ = -\frac{1}{3}
\sum_\rho \rho^{-6k}
\sum_{q=0}^{6k-1} {6k-1\choose q} \rho^q
= -\frac{1}{3}
\sum_\rho \rho^{-6k} (1+\rho)^{6k-1}
\\ = -\frac{1}{3}
\sum_\rho (1+\rho)^{6k-1}.$$
The term for $\rho_0 = -1$ is zero and we are left with
$$-\frac{1}{3}
\left((1+\rho_1)^{6k-1} + (1+\rho_2)^{6k-1}\right).$$
Note that
$$|1+\rho_{1,2}| = \sqrt{(3/2)^2 + (\sqrt{3}/2)^2} = \sqrt{3}
\quad\text{and}\quad
\arg(1+\rho_{1,2}) = \pm\frac{\pi}{6}.$$

This finally yields the value
$$-\frac{1}{3} \sqrt{3}^{6k-1}
\left(\exp(i\pi/6\times(6k-1))
+ \exp(-i\pi/6\times(6k-1)) \right)
\\ = -\frac{1}{3} (-1)^k \frac{27^k}{\sqrt{3}}
\times 2 \cos(\pi/6)
= -\frac{1}{3} (-1)^k \times 27^k.$$

The question asked to show that
$$Q(k) - (-1)^{2k+1}{6k-1\choose 6k-1}
= -\frac{1}{3} (-1)^k \times 27^k + 1$$
is never zero. This follows by inspection at this point with the first
term having modulus at least nine and the second one being one.

Apparently this method is due to Egorychev.

Tricky binomial coefficients problem


A closed form of $\sum_{n=1}^\infty\left[ H_n^2-\left(\ln n+\gamma+\frac1{2n} \right)^2\right]$

Question: The series of squares of harmonic numbers
$$
\sum_{n=1}^\infty H_n^2 \tag1
$$ is divergent since $\displaystyle \lim_{n \to \infty} H_n^2 \ne 0$, actually from the classic result (6.3.18),
$$
H_n=\ln n+\gamma+\frac1{2n}+O\left(\frac1{n^2}\right),\qquad  \, n \to \infty,
$$ where $\gamma$ is the Euler-Mascheroni constant, one gets as $n \to \infty$,
$$
H_n^2=\left(\ln n+\gamma+\frac1{2n} \right)^2+O\left(\frac{\ln n}{n^2}\right)\tag2
$$which tends to infinity.
Then the following new series

$$
\sum_{n=1}^\infty \color{grey}{\left[\color{#151515}{\: H_n^2-\left(\ln n+\gamma+\frac1{2n} \right)^2}\: \right]} \tag3
$$

may be seen as a sort of regularization of $(1)$. The series $(3)$ is absolutely convergent as one may directly deduce from the comparison test with a Bertrand series, using $(2)$.
Question. What is a closed form of $(3)$?
My intuition is that $(3)$ admits a closed form in terms of known constants (or here).  I've used the advanced Inverse Symbolic Calculator ISC $2.0$ but it found nothing. My recent attempt, not yet fruitful, has been to convert $(3)$ into an integral representation, starting  with
$$
\begin{align}
-\int_0^1\!\left(\!\frac1{\ln x}+\frac1{1-x}-\frac12\!\right)\!x^{n-1}\:dx&=H_n-\ln n-\gamma-\frac1{2n},\quad n\ge1,
\end{align}
$$ and trying to employ similar techniques used here.
Analogous considerations are here or here, one may also explore some variations of $(3)$, like
$$
\sum_{n=1}^\infty \color{grey}{\left[\color{#151515}{\: H_n^q-\left(\ln n+\gamma+\frac1{2n} \right)^q}\: \right]}, \,\sum_{n=1}^\infty (-1)^n \!\color{grey}{\left[\color{#151515}{\: H_n^q-\left(\ln n+\gamma+\frac1{2n} \right)^q}\: \right]}.
$$
Comment: A regularization of a divergent series is *not* unique...
Comment: So the regularization of a series can simply be made by subtracting a few terms until the result converges? Seems to be a strange way to go about regularizing things.
Comment: Please, feel free to suggest an appropriate word (english is not my native language).
Comment: Of course not. I just thought it strange to call that a regularization of the divergent series.
Comment: I don't know if there is any correct term here. Personally, I'd call it a related series.
Comment: @ Olivier Oloa In another context (https://math.stackexchange.com/questions/2879699/evaluation-of-int-01-int-01-frac1-x-frac1x-y-dx-dy, and https://math.stackexchange.com/questions/2891159/asymptotic-behaviour-of-sums-involving-k-logk-and-h-k/2891453#2891453) I'm trying to calculate the asymptotic behaviour of the $\sum_{k=1}^n \log(k) H_{k}$. As this should appear also in a sum very similar to that in your OP here I wonder if the closed form of the sum $\sum_{k=1}^\infty (H_{k}-\log(k)-\gamma)^2 \simeq 0.323973$ has been calculated.
Comment: @Wolfgang Hintze I suggest you ask for a closed form of $$ \sum_{k=1}^\infty (H_{k}-\log(k)-\gamma)^2$$ in a separate question.
Answer: Just some considerations for now.
I have proved here that
$$ \sum_{n=1}^{N}H_n^2 = (N+1) H_N^2-(2N+1)H_N+2N \tag{$\color{blue}{1}$} $$
and we have:
$$ \mathcal{L}^{-1}\left(\frac{\log x+\gamma}{x}\right)(s)=-\log(s)\tag{2} $$
$$ \mathcal{L}^{-1}\left(\frac{\left(\log x+\gamma\right)^2}{x}\right)(s)=-\zeta(2)+\log^2(s)\tag{3} $$
hence the partial sums of the given series can be rearranged as follows:
$$\begin{eqnarray*}\sum_{n=1}^{N}\left[H_n^2-\left(\log n+\gamma+\frac{1}{2n}\right)^2\right]&=&(\color{blue}{1})-\frac{H_N^{(2)}}{4}-\sum_{n=1}^{N}\frac{\log n+\gamma}{n}-\sum_{n=1}^{N}n\frac{(\log n+\gamma)^2}{n}\\&=&(\color{blue}{1})-\frac{H_N^{(2)}}{4}+\int_{0}^{+\infty}\frac{\log(s)(1-e^{-Ns})}{e^s-1}\,ds\\&-&\int_{0}^{+\infty}\frac{e^{-N s} \left(e^{(1+N) s}+N-e^s (1+N)\right)\left(\zeta(2)-\log^2 s\right)}{\left(-1+e^s\right)^2}\,ds\end{eqnarray*}$$
If we find a way to distribute $(\color{blue}{1})$ over the last two integrals, in a way ensuring they are convergent integrals as $N\to +\infty$, we are done. At first sight the closed form of the LHS appears to be related with $\zeta(2)$, $\zeta'(0)=-\frac{1}{2}\log(2\pi)$ and
$$ \zeta''(0)=\frac{\gamma^2}{2}-\frac{\pi ^2}{24}-\frac{1}{2}\log^2(2\pi)+\gamma_1$$
with $\gamma_1$ being a Stieltjes constant. An alternative, brute-force way is just to compute the asymptotic expansions of
$$ \sum_{n=1}^{N}\log^2(n),\qquad \sum_{n=1}^{N}\frac{\log(n)}{n} $$
with the sufficient degree of accuracy (I guess that to stop at the $O\left(\frac{1}{N^3}\right)$ term is enough), that is just a tedious exercise about summation by parts.
Comment: You can replace $\sum_{n=1}^N (\log n)^2$ by $\sum_{n=1}^\infty (\log n)^2 n^{-s}$ or even
$\int_0^\infty x^{s-1}(\log x)^2 \frac{1}{e^x-1} dx$.
Comment: @Jack D'Aurizio  "that is just a tedious exercise about summation by parts. " Could you please explain this in more detail? Particular example: how does one calculate the asymptotic behaviour of $\sum _{n=1}^N \log ^2(n)$ for $N\to \infty$
Comment: @Dr.WolfgangHintze: I meant that the asymptotic behaviour of $\sum_{n=2}^{k}\log(k)=\log(k!)=\log\Gamma(k+1)$ is well-known, as well as the asymptotic behaviour of $\log(n+1)-\log(n)=\log\left(1+\frac{1}{n}\right)=\frac{1}{n}-\frac{1}{2n^2}+\ldots$, hence the problem boils down to plugging in such asymptotics into $$ \sum_{n=2}^{N}\log(n!)\log\left(1+\frac{1}{n}\right).$$
Comment: The same applies to the second sum, which by summation by parts boils down to $$ \sum_{n=1}^{N} H_n \log\left(1+\frac{1}{n}\right).$$
Answer: The given series admits a closed form.

Proposition.$$
\sum_{n=1}^\infty \color{grey}{\left[\color{#151515}{\: H_n^2-\left(\ln n+\gamma+\frac1{2n} \right)^2}\: \right]}=\frac12\ln^2(2\pi)-\gamma\ln (2\pi)-\frac12\gamma^2-2\gamma_1-1. \qquad (\star)
$$

where $\gamma_1$ is a Stieltjes constant.
(Sketch of a proof).
Let us consider, for $a\ge 0$,
$$
S(a):=\sum_{n=1}^\infty \color{grey}{\left[\color{#151515}{\: \left(\psi(n+a+1)+\gamma\right)^2-\left(\ln (n+a)+\gamma+\frac1{2(n+a)} \right)^2}\: \right]}, \tag1
$$
where throughout  $\displaystyle \psi :=\left(\text{Log}\: \Gamma  \right)'$ is the digamma function. From the standard identity
$$
\psi(n+1)+\gamma=H_n\qquad n=1,2,\cdots,\tag2
$$
we have
$$
S(0)=\sum_{n=1}^\infty \color{grey}{\left[\color{#151515}{\: H_n^2-\left(\ln n+\gamma+\frac1{2n} \right)^2}\: \right]}. \tag3
$$
One is allowed to differentiate $S(a)$ termwise obtaining
$$
\begin{align}
S'(a)=\sum_{n=1}^\infty &\left[2\:\psi'(n+a+1)\left(\psi(n+a+1)+\gamma\right)\color{#FFFFFF}{\frac2{(n+a)}}\right.
\\&-\left.\left(\frac2{(n+a)}-\frac1{(n+a)^2}\right)\!\left(\ln (n+a)+\gamma+\frac1{2(n+a)} \right)\right], \tag4
\end{align}
$$ then we are lead to consider the partial sum,
$$
\begin{align}
S_N'(a)=&\sum_{n=1}^N 2\:\psi'(n+a+1)\left(\psi(n+a+1)+\gamma\right)
\\-&\sum_{n=1}^N\left(\frac2{(n+a)}-\frac1{(n+a)^2}\right)\left(\ln (n+a)+\gamma+\frac1{2(n+a)} \right).\tag5
\end{align}
$$ We have proved here that $\displaystyle \sum_{n=1}^N \psi'(n)\psi(n)$ has a closed form, this result can be extended as follows.

Theorem. Let $a$ be any non-negative real number. We have
  $$
\begin{align}
&\sum_{n=1}^N \psi'(n+a+1)\psi(n+a+1)
\\&=\left((N+a+1) \psi(N+a+2)-(a+1)\psi(a+2)\right)' \psi(N+a+1)
\\\\&-\left((N+a+1) \psi(N+a+2)-(a+2)\psi(a+3)\right)'
\\\\&+\left((a+1)\psi(a+2)\right)'\left(\psi(N+a+1)-\psi(a+2)\right)
 \tag6
\\\\&+\frac12 \psi'(N+a+1)-\frac12\psi'(a+2)-\frac12 \left(\psi'(N+a+1)\right)^2+\frac12 \left(\psi'(a+2)\right)^2.
\end{align}
$$

Proof. One uses a summation by parts with
$$
f_n(a)=\psi(n+a+1),\quad g_n(a)=\psi'(n+a+1),\quad n\ge1,
$$ taking into account that
$$
\begin{align}
&\sum_{n=1}^N \psi'(n+a+1)=\left((N+a+1) \psi(N+a+2)-(a+1)\psi(a+2)\right)'. \tag7
\end{align}
$$
Then the second sum on the right hand side of $(5)$ satisfies
$$
\begin{align}
&\sum_{n=1}^N\left(\frac2{(n+a)}-\frac1{(n+a)^2}\right)\left(\ln (n+a)+\gamma+\frac1{2(n+a)}\right)
\\\\&=2\gamma_1(a+1)-2\gamma_1(N+a+1)+2\gamma \psi(N+a+1)-2\gamma\psi(a+1)
 \tag8
\\\\&+\frac14 \psi''(N+a+1)-\frac14\psi''(a+2)+\gamma_1'(a+1)-\gamma_1'(N+a+1)
\\\\&+(\gamma+1)\psi'(N+a+1)-(\gamma+1)\psi'(a+1),
\end{align}
$$
where we have used the generalized Stieltjes constant,
$$
\begin{align}
\gamma_1(a+1)=\lim_{N \to \infty}\left(\sum_{n=1}^N\frac{\ln(n+a)}{n+a}-\frac12\:\ln^2 \left(N+a\right)\right).
\end{align}
$$
We then insert $(6)$, $(7)$ and $(8)$ into $(5)$ and let $N \to \infty$ to get
$$
\begin{align}
S'(a)=&\:\left(2a-2(a+2)\psi(a+3)\right)'+\left(2\gamma a-2\gamma(a+1)\psi(a+2)\right)'
\\\\-&\:\left(\psi(a+2)-(a+1) \left(\psi(a+2)\right)^2\right)'-2\gamma_1(a+1)+2\gamma\psi(a+1)
 \tag9
\\\\+&\frac14\psi''(a+2)-\gamma_1'(a+1)+(\gamma+1)\psi'(a+1).
\end{align}
$$
Finally, integrating $(9)$ using
$$
2\int_1^{1+a}\gamma_1(t)\:dt=\zeta''(0,a+1)-\zeta''(0),
$$ where $\zeta(\cdot,\cdot)$ denotes the Hurwitz zeta function and where $\zeta''(0,a+1)=\left.\partial_s^2\zeta(s,a+1)\right|_{s=0}$, determining the  constant of integration by letting $a \to \infty$ and using $(3)$ yields $(\star)$.
Comment: @Olivier Oloa: great ! (+1) I still need to fully understand the proof, but it looks like a recipe to solve many similar problems.
Comment: @Dr.WolfgangHintze I find that $$s2=s1+\frac{ \pi ^2}{3} \log A+\frac{1}{12}\zeta (3)-\frac{\pi ^4}{12960}-\frac{\pi ^2 }{36} \log (2 \pi )$$ where $s1$ is the *original sum*.
Comment: @Olivier Oloa Congratulations ! Just a question: what is A? Based on your results I find A = 1.282427 ...
Comment: @Olivier Oloa Thank you. By the way, I just stumbled on this constant trying (unsuccessful up to now) to find the asymptotics of $\sum _{k=1}^n \log ^2(k)$ which appears in the attempt to evaluate directly the partial sum of s1 similar to Jack D'Aurizio.
Comment: Nice. Using Pari GP and having enough digits one could have guessed the exact value.
Comment: @Olivier Oloa : would your method also work for the next (2nd) order of approximating the harmonic numbers, i.e. has $s2$ a closed form where $s2=\sum _{n=1}^{\infty } \left(H_n^2-\left(-\frac{1}{12 n^2}+\frac{1}{2 n}+\left(\gamma +\log n \right)\right)^2\right)$ ? In this case the sum is positive: $s2 = 0.01424761677 ...$.
Comment: @Dr.WolfgangHintze Thanks. It's the first time I use this method to obtain the closed form of such a series, yes I think the method is applicable to a large class. Concerning your series $s2$ I'm afraid the closed form needs some work to be dug up.
Comment: @Dr.WolfgangHintze $A=1.2824271291006226368753425688697917\cdots$ is the Glaisher-Kinkelin constant, it arises when one considers the asymptotic behaviour of $1^1\cdot 2^2 \cdot 3^3 \cdots n^n$ as $n \to \infty$. One has $$\ln A= \frac{1}{12}-\zeta'(-1)$$ where $\zeta(\cdot)$ is the Riemann zeta function. See the original paper of J.L. Glaisher (1878): http://www.archive.org/stream/messengermathem01glaigoog#page/n57/mode/1up
Comment: @Olivier Oloa Another question regarding your derivation for s1: How did you calcultate the limit $a \to \infty$ of the second derivative of the Hurwitz zeta function $\zeta''(0,a+1)=\left.\partial_s^2\zeta(s,a+1)\right|_{s=0}$ and what is the result ?
Comment: One may differentiate twice a representation of the Hurwitz zeta function by the Euler–Maclaurin Formula: http://dlmf.nist.gov/25.11#E7 then one may work with it as $a \to \infty$. The result is corollary 2 p. 169 here (start from section 3): https://projecteuclid.org/download/pdf_1/euclid.pja/1195506664
Answer: An integral representation for the series
Let,
$\begin{align}
u_n:=H_n-\ln n-\gamma-\dfrac{1}{2n}\\
v_n:=H_n+\ln n+\gamma+\dfrac{1}{2n}\\
\end{align}$
Observe that,
$\begin{align}u_n+v_n\end{align}=2H_n$
Since,
$\displaystyle H_n=-n\int_0^1 x^{n-1}\ln(1-x)\ dx$
and,
$\displaystyle u_n=-\int_0^1 \left(\frac{1}{\ln x}+\frac{1}{1-x}-\frac{1}{2}\right)x^{n-1}\ dx$
then,
$\begin{align}v_n&=2H_n-u_n\\
&=-2n\int_0^1 x^{n-1}\ln(1-x)\ dx+\int_0^1 \left(\frac{1}{\ln x}+\frac{1}{1-x}-\frac{1}{2}\right)x^{n-1}\ dx
\end{align}$
therefore,
$\begin{align}\sum_{n=1}^{\infty}u_nv_n&=\sum_{n=1}^{\infty}\left(2n\int_0^1 \int_0^1\ln(1-x)\left(\frac{1}{\ln y}+\frac{1}{1-y}-\frac{1}{2}\right)\right)(xy)^{n-1}\ dx\ dy-\\
&\int_0^1\int_0^1 \left(\frac{1}{\ln x}+\frac{1}{1-x}-\frac{1}{2}\right)\left(\frac{1}{\ln y}+\frac{1}{1-y}-\frac{1}{2}\right)(xy)^{n-1}\ dx\ dy\\
&=2\int_0^1\int_0^1 \frac{\ln(1-x)}{(1-xy)^2}\left(\frac{1}{\ln y}+\frac{1}{1-y}-\frac{1}{2}\right)\ dx\ dy-\\
&\int_0^1\int_0^1\frac{1}{1-xy} \left(\frac{1}{\ln x}+\frac{1}{1-x}-\frac{1}{2}\right)\left(\frac{1}{\ln y}+\frac{1}{1-y}-\frac{1}{2}\right)\ dx\ dy\\
&=\int_0^1 \int_0^1 \left(\frac{2\ln(1-x)}{(1-xy)^2}-\frac{1}{1-xy}\left(\frac{1}{\ln x}+\frac{1}{1-x}-\frac{1}{2}\right)\right)\left(\frac{1}{\ln y}+\frac{1}{1-y}-\frac{1}{2}\right)\ dx\ dy\\
&=\boxed{2A-B}
\end{align}$
and,
$\begin{align}A&=\int_0^1 \int_0^1 \frac{\ln(1-x)}{(1-xy)^2}\left(\frac{1}{\ln y}+\frac{1}{1-y}-\frac{1}{2}\right)\ dx\ dy\\
B&=\int_0^1 \int_0^1 \frac{1}{1-xy}\left(\frac{1}{\ln x}+\frac{1}{1-x}-\frac{1}{2}\right)\left(\frac{1}{\ln y}+\frac{1}{1-y}-\frac{1}{2}\right)\ dx\ dy
\end{align}$
( Computation of A )
( Computation of B )
Addenda:
1)
$\begin{align}A=\int_0^1 \frac{\ln(1-y)}{y(1-y)}\left(\frac{1}{\ln y}+\frac{1}{1-y}-\frac{1}{2}\right)\ dy
\end{align}$
(one can simplify this integral)
$A\approx -0.1932$
( Computation of A )
$\begin{align}B&=\int_0^1 \int_0^1 \frac{1}{1-xy}\left(\frac{1}{\ln x}+\frac{1}{1-x}\right)\left(\frac{1}{\ln y}+\frac{1}{1-y}-1\right)\ dx\ dy+\frac{\pi^2}{24}
\end{align}$
2)
Since,
$\displaystyle \gamma=\int_0^1 \left(\frac{1}{\ln x}+\frac{1}{1-x}\right)\ dx$
then
$\begin{align}B&=\int_0^1 \int_0^1 \frac{xy}{1-xy}\left(\frac{1}{\ln x}+\frac{1}{1-x}\right)\left(\frac{1}{\ln y}+\frac{1}{1-y}-1\right)\ dx\ dy+\gamma^2-\gamma+\frac{\pi^2}{24}\end{align}$
$B\approx 0.00651229$
(Computation of B )
3)
$\begin{align}A&=\int_0^1\left[\left(\frac{\ln(1-x)}{x}+\frac{\ln(1-x)}{1-x}\right)\left(\frac{1}{\ln x}+\frac{1}{1-x}\right)-\frac{1}{2}\times \frac{\ln(1-x)}{1-x}\right]\ dx+\frac{\pi^2}{12}\end{align}$
( Computation of A )
Comment: a value with 30 or 40 digits would be nice to try to guess a closed form (LLL stuff)
Comment: Have you performed some LLL stuff  (lindep in GP PARI) using constants $\zeta(2),\gamma_1,\log(2\pi)$...?
Comment: I've just used ISC 2.0.
Comment: Sometimes, if you're lucky enough, lindep is better that ISC 2.0 Please provide a bunch of digits.
Comment: @FDP I'm surprised that your integrand seems not to be symmetric in x and y.
Comment: Why should they be symmetric? Maybe my computations contain errors. The series converges slowly it's difficult to get a bunch of digits.
Comment: @FDP I would greatly appreciate if you could identify your final expression which is meant to represent the sum.
Comment: Sorry, I dont have a clue how to compute these two integrals for now. The first one can be simplified a little bit. I would like to compute something like hundred digits to try to guess the value of this sum. I hope the sum can be expressed as $a\zeta(2)+b\gamma_1+c\ln(2\pi)$ (a,b,c rationals) or something like that.
Comment: @FDP Your solution cannot be correct as it gives a wrong numerical result. The value of the sum of the OP with 10^4 terms  is approximately -0.392733 whereas your result is A (the y-integral) - B with A = -0.1932 and B = 0.00651229 giving -0.199712.
Comment: Dr Wolfgang Hintze: Your values are correct but sum=2A-B (i have updated my "solution")
Comment: @FDP For your updated version I find numerically A = -0.0990267, B = 0.00602467 so that 2A - B = -0.204078 which is wrong again. You have now returned to double integrals leading to a wrong numerical value for the sum. I had from the beginning a double integral which gave the correct numerical result, nd have provided additional material. Hence I found the distribution of reputation points not fair: (-1)
Comment: Dr. Wolfgang Hintzel: your value for A is incorrect: www.wolframalpha.com/input/?i=integrate+log(1-x)%2F(1-xy)%5E2*(1%2Flog(y)%2B1%2F(1-y)-1%2F2),x%3D0,1,y%3D0,1
Comment: I have updated my "solution" with the links to compute  A,B with WA
Comment: @FDP you are right, your last definition of A (single integral) gives -0.1932. Unfortunately, your definitions changed somewhat randomly so I got confused.
Answer: We derive a representation of the sum in question $f$ as a double integral with a symmetric integrand. Transformation to polar coordinates leads to a explicitly "innocent" expression for the integrand in the domain of interest.
It is proposed to develop the integrand into a power series. The developments are under way.
Letting
$$d(n)=\frac{1}{2 n}+\log (n)+\gamma$$
the nth summand becomes
$$s(n)=H(n)^2-d(n)^2$$
and the sum is
$$f=\sum _{n=1}^{\infty } s(n)$$
We now use the integral representations
$$d(n)\to  \int_0^1 \left(x^{n-1} \left(\frac{1}{1-x}+\frac{1}{\log (x)}-\frac{1}{2}\right)+\frac{1-x^n}{1-x}\right) \, dx$$
and
$$H(n)\to \int_0^1 \frac{1-x^n}{1-x} \, dx$$
and replace the terms in the summand which then becomes a double integral (sorry for the bad Latex)
$$si(n)=\int _0^1\int _0^1\left(\frac{\left(1-x^n\right) \left(1-y^n\right)}{(1-x) (1-y)}-\left(x^{n-1} \left(\frac{1}{1-x}+\frac{1}{\log (x)}-\frac{1}{2}\right)+\frac{1-x^n}{1-x}\right) \left(y^{n-1} \left(\frac{1}{1-y}+\frac{1}{\log (y)}-\frac{1}{2}\right)+\frac{1-y^n}{1-y}\right)\right)dydx$$
The sum of $si(n)$ over $n$ can be easily done.
$$si=\sum _{n=1}^{\infty } si(n)$$
The result, called $sa1$ and is the integrand for the positive quantity $-f$ in what follows, is
$$\text{sa1}=\frac{\left(\frac{1}{1-x}+\frac{1}{\log (x)}-\frac{1}{2}\right) \left(\frac{1}{1-y}+\frac{1}{\log (y)}-\frac{1}{2}\right)+\frac{\frac{1}{1-x}+\frac{1}{\log (x)}-\frac{1}{2}}{1-x}+\frac{\frac{1}{1-y}+\frac{1}{\log (y)}-\frac{1}{2}}{1-y}}{1-x y}$$
Now we make two subsequent coordinate transformations

x-> Exp[-u], y->Exp[-v]
u->r Cos[a], v-> r Sin[a], 0<=r, 0<=a<=pi/2

This defines sa3. Instead of giving the lengthy expression we show the plot

The plot shows that sa3 is a pretty innocent function.
$-f$ is now given by the integral of $sa3$ over $r$ from $0$ to $\infty$ and over $a$ from $0$ to $\pi/2$.
A numerical check gives sufficient agreement between direct sum with 10^4 terms (|sum| = 0.392733) and this integral (int =0.392733 ) to see that the integrand is correct.
Expansion of the integrand in a series of powers of $(a-\pi/4)$
I was not able to do the integral in symbolic form (neither of the two).  The plot shows, however, that the dependence of the integrand on $a$ is weak so that it seems reasonable to expand the integrand in a series of (even) powers of $(a-\pi/4)$ the coefficients of which are integrals over $r$ which seem not impossible to be done in closed form.
The first term of this development (equal to $sa3$ for $a = \pi/4$) is
$$sa3(a=\pi/4)= \frac{\left(\sqrt{2} e^{\frac{r}{\sqrt{2}}} r+\sqrt{2} r-4 e^{\frac{r}{\sqrt{2}}}+4\right) \left(5 \sqrt{2} e^{\frac{r}{\sqrt{2}}} r+\sqrt{2} r-4 e^{\frac{r}{\sqrt{2}}}+4\right)}{8 \left(e^{\frac{r}{\sqrt{2}}}-1\right)^2 \left(e^{\sqrt{2} r}-1\right) r}$$
Mathematica refused to solve that integral.
Behaviour of the integrand close to the origin
The behaviour of the integrand close to the origin is not easily found in the x-y-representation, but it is easy in polar coordinates: $sa3$ close to the origin is found by expanding it into a series of powers of $r$ and doing the a-integral exactly. The first four terms are
$$ \frac{\tanh ^{-1}\left(\frac{1}{\sqrt{2}}\right)}{3 \sqrt{2}}  -r \frac{\pi }{48}  -r^2 \left(\frac{1}{144}-\frac{\tanh ^{-1}\left(\frac{1}{\sqrt{2}}\right)}{240 \sqrt{2}}\right)+\frac{r^3}{480}+r^4 \left(\frac{149}{181440}-\frac{\tanh ^{-1}\left(\frac{1}{\sqrt{2}}\right)}{12096 \sqrt{2}}\right)$$
Numerically,
$$0.207742 -0.0654498 r-0.00434767 r^2+0.00208333 r^3+0.000769685 r^4$$
To be continued.
Comment: Thank you @Dr Wolfgang Hintze. (+1)


Cannot deserialize Timer info object with ClassNotFoundException on JBoss

Question: I created a Timer with a TimerVO that implements Serializable as the timer's info and added to TimeService. The TimerVO simply holds the id of the object that will be processed on timeout.
timerService.createTimer(60000, 60000, new TimerVo(objectId, TIMER_NAME));

When the node is started, the timers are all created correctly, i can see the logging from the timeout method, and they are persisted in JBoss' hypersonic database in data/hypersonic/localDB.script, however when the node is restarted i get a ClassNotFoundException on startup when the timers are restored by the containers.
2010-11-25 21:40:25,171 ERROR (main) [org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin] Cannot deserialize
java.lang.ClassNotFoundException: exam.ejb.TimerVo

Why am i getting the ClassNotFoundException and is there a way to solve it?
EJB3.0, Java 1.6, JBoss 5.1.0.GA
Answer: This looks like a classloader issue. I moved the TimerVo to a separate jar that i deployed in the node03/lib directory and i didn't get the errors. I have raised a bug issue on JBoss' bug tracker.


Add 'Last modified by ...' footer to each page

Question: How do I add a footer to each page generated by Drupal (7) so to show the identity of the last user that modified that page? (together with the modification date)
Answer: I think you should be able to do this with something like this, note that this is only pseduo code and is not tested:
 // get the user that made the latest modification
 // for a node of type 'page'
 function getLatestPageUpdater() {
     $query = "SELECT n.changed, u.* FROM node n
               INNER JOIN users u ON u.uid = n.uid
               WHERE n.type = 'page'
               ORDER BY changed DESC
               LIMIT 1";
     return db_query($query)->fetch();
 }

Then in your page.tpl.php you could do like this:
 <?php $user = getLatestPageUpdater();
       if($user):
 ?>

Last edited <?php print $user->changed; ?> by <?php print $user->name; ?>

 <?php endif; ?>

Like @tostinni pointed out Drupal doesn't track the last editor of a node, so the above code would always display the original author of the node. If you're using node revisions I think you should be able to do something like this (again this is only pseudo code and is not tested):
function getLatestPageUpdater($node) {
  $query = "SELECT u.name
            FROM node_revisions nr, users u
            WHERE nr.uid = u.uid
            AND nr.nid = ".$node->nid."
            ORDER BY timestamp DESC
            LIMIT 1";
  return db_query($query)->fetch();
}

<?php if($node->type == "page"): ?>
<?php $user = getLatestPageUpdater($node);
      if($user):
?>

Last edited <?php print $node->changed; ?> by <?php print $user->name; ?>

<?php endif; ?>
<?php endif; ?>

Comment: @Umberto I know this is quite late. `page.tpl.php` already defines a `$node` variable that contains information about the currently loaded node, including exactly the information you're looking for. There is no need to perform an extra DB query in your template to fetch it.
Comment: @KristerAndersson I'm late on this one but don't forget that Drupal doesn't track the last username that changed the node, so `name; ?>` will always display the author of the node.
Comment: That is exactly what I was looking for, thank you!
Comment: @Umberto - Nice it solved your problem.
Comment: @tostinni - You're completely right. Didn't knew that Drupal wasn't tracking the user who changed a post. I guess the above code could be modified to grab the last editor if one were to use revisions.
Comment: it's "node_revision" not "node_revisions"
Answer: I've written a Last Modification Date module for drupal that does exactly that.
ATM this is still a sandbox project, but it is in approval state.
It just creates a block that spits out the last modification date of any node in the system. There is no database polling, saving of that date is done at node save time. So no overhead.


Showing that $f$ is twice differentiable

Question: Let $f : \mathbb R^2 → \mathbb R$ defined by $f(x, y) := \frac{(x−1)^3 y^3} {(x−1)^2+y^2}$ if $(x, y) \not= (1, 0)$ and $f(1, 0) = 0$.
Answer the following questions:

We take for granted that f is twice differentiable at $(1, 1)$. Compute $D^2_{(1,1)} f(1, 2) · (1, −2)$.
Show that $f$ is twice differentiable at $(1, 0)$.

My attempts:

I Calculated it and I found that it is equal to $0$.
Here, I think I have to show that lim$_{h→0}$ $\frac{||D_h f - D_{(1,0)}f - L.h||}{||h||}$ = $0$, where $L$ is a linear map, $L: \mathbb R^2 → \mathbb R$. But I don't know how to continue from there. Any help please? Thank you
Answer: $f(1+h,k)-f(1,0)=\frac{h^3 k^3} {h^2+k^2}$ so we look for a linear transformation $Df(1,0):\mathbb R^2\to \mathbb R$ such that $\frac{\left |Df(1,0)(h,k)-\frac{h^3 k^3} {h^2+k^2}\right|}{\sqrt{h^2+k^2}}\to 0$ as $(h,k)\to 0.$ If we try the easiest one, namely, $Df(1,0)(h,k)=0$ we see that it works.
For the second derivative at $(1,0),$ first look at the general case: we have the following data:
$f:\mathbb R^2\to \mathbb R;\ x\mapsto f(x);\ Df:\mathbb R^2\to L(\mathbb R^2,\mathbb R);\ x\mapsto  Df(x)$ and $Df(x)$ is the linear transformation defined as you have done.
Now then, $D^2f:\mathbb R^2\to L(\mathbb R^2,L(\mathbb R^2,\mathbb R))$ defined as follows:
If $Df$ is differentiable at $x_0\in \mathbb R$ then there must exist a map $D^2f$ that sends $x_0\in \mathbb R^2$ to a linear transformation $D^2f(x_0),$ which in turn  satisfies
$Df(x_0+h)-Df(x_0)=D^2f(x_0)(h)+r(h)$ where $r(h)/\|h\|\to 0$ as $h\to 0.$
So, basically we want to calculate $Df(x_0+h)-Df(x_0)-D^2f(x_0)(h)$ and show that it is small whenever $h$ is.
This is the same definition of derivative except now $\mathbb R$ is replaced by $L(\mathbb R^2,\mathbb R)).$ Notice, these maps are all elements of $ L(\mathbb R^2,\mathbb R)$ so to make sense of them, we have to evaluate them at an arbitrary $v\in \mathbb R^2:$
$Df(x_0+h)(v)-Df(x_0)(v)-D^2f(x_0)(h)(v)$
Now, it's easier to express the derivatives as $1\times 2$ matrices: we have $x_0=(1,0)$ so writing $h:=(h,k),$
$Df((1,0)+(h,k))=\begin{pmatrix}
f_x(1+h,k) & f_y(1+h,k))
\end{pmatrix}=\begin{pmatrix}
\frac{k^3\left(3\left(h\right)^2\left(\left(h\right)^2+k^2\right)-2\left(h\right)^4\right)}{\left(\left(h\right)^2+k^2\right)^2} & \frac{\left(3(1+h)^2k^2-6(1+h)k^2+3k^2+k^4\right)\left(h\right)^3}{\left(\left(h\right)^2+k^2\right)^2}
\end{pmatrix}$
and $Df((1,0))=0$ as we showed above.
So, as in the first part, we look for a linear transformation $D^2f(1,0)$ such that
$\frac{\|Df(1+h,k)-D^2f(1,0)(h,k)\|}{\sqrt{h^2+k^2}}\to 0$ as $(h,k)\to 0.$
If we try $D^2f(1,0)=0$ again we have
$\frac{Df(1+h,k)(v_1,v_2)}{\sqrt{h^2+k^2}}=\frac{k^3\left(3\left(h\right)^2\left(\left(h\right)^2+k^2\right)-2\left(h\right)^4\right)}{\left(\left(h\right)^2+k^2\right)^{5/2}} v_1+ \frac{\left(3(1+h)^2k^2-6(1+h)k^2+3k^2+k^4\right)\left(h\right)^3}{\left(\left(h\right)^2+k^2\right)^{5/2}}v_2.$
Suping this over $\|v\|\le 1$ and letting $(h,k)\to 0$ shows that our guess was correct.


Redirect every page no matter how deeply nested to a single page on same domain

Question: I've seen several answers to this, but none of them seem to work on subdirectories or nested URLs.
Basically, I want to redirect everything on a domain, no matter whether specified with a direct URL or a directory, no matter how deeply nested, to a "site closed" or "maintenance" page, on the same domain.
For example, all of these:
example.com
example.com/page.html
example.com/sub
example.com/sub/page.html
example.com/sub/sub2
example.com/sub/sub2/page.html

...should redirect to https://example.com/index_closed.html
I can get it to work on example.com, but not nested directories.
Also, it should NOT redirect .css files, if possible. Thanks!
Answer: RewriteBase /
RewriteRule ^$ https://example.com/index_closed.html [R=301,L]
Comment: Thanks, but it doesn't work on nested URLs. It works on example.com/page.html. It does not work on something like example.com/sub/page.html.
Answer: I found that the following works:
RewriteCond %{REQUEST_URI} !/index_closed.html$
RewriteCond %{REQUEST_URI} !.css$ [NC]
RewriteCond %{REQUEST_URI} !.jpg$ [NC]
RewriteRule $ /index_closed.html [R=302,L]


Vitest spyOn method won't work outside of test case scope

Question: I am migrating from Jest to Vitest and found out that most of my spyOn methods aren't working because they are declared outside of the test scope:
const notificationSpy = vi.spyOn(NotificationActions, 'addNotification');

describe('PostboxList', () => {
    const renderComponent = (store: Store) => {
        render(<PostboxList />, {
            store,
        });
    };

    it('the notification is visible when fetching status is HasError', async () => {
        const store = mockStore({
            postbox: {
                documents: {
                    data: [],
                    fetchingStatus: DataFetchingStatus.HasError,
                },
                messages: {
                    data: [],
                    fetchingStatus: DataFetchingStatus.HasError,
                },
            },
        });

        renderComponent(store);

        expect(notificationSpy).toHaveBeenCalledOnce({
            title: 'POSTBOX.ERROR.TITLE',
            text: 'POSTBOX.ERROR.TEXT',
        });
    });
});

Now if I move the declaration of my spyOn method to inside the test scope, the test will pass:
describe('PostboxList', () => {
    const renderComponent = (store: Store) => {
        render(<PostboxList />, {
            store,
        });
    };

    it('the notification is visible when fetching status is HasError', async () => {
        const notificationSpy = vi.spyOn(NotificationActions, 'addNotification');

        const store = mockStore({
            postbox: {
                documents: {
                    data: [],
                    fetchingStatus: DataFetchingStatus.HasError,
                },
                messages: {
                    data: [],
                    fetchingStatus: DataFetchingStatus.HasError,
                },
            },
        });

        renderComponent(store);

        expect(notificationSpy).toHaveBeenCalledOnce({
            title: 'POSTBOX.ERROR.TITLE',
            text: 'POSTBOX.ERROR.TEXT',
        });
    });
});

My test config inside Vite config:
test: {
    globals: true,
    environment: 'jsdom',
    setupFiles: './vitest.setup.ts',
    include: ['**/*.{test, spec}.{ts,tsx,js,jsx}'],
    exclude: [...configDefaults.exclude, 'plop', './vitest.setup.ts'],
    deps: {
        inline: ['vitest-canvas-mock'],
    },
    testTimeout: 10000,
    threads: false,
    alias: tsconfigPaths(),
    mockReset: true,
    restoreMocks: true,
    clearMocks: true,
    css: true,
}

I already tried resetting the mock and the spyOn on beforeEach and afterEach but had no success.
I've researched already but no answers or similar issues were found.
Answer: Removing these configs solved the issue:
threads: false,
mockReset: true,
restoreMocks: true,
clearMocks: true,


Cannot open anchor links pointing to file in Chrome

Question: In our ASP MVC 3 site, we have some hyperlinks that point towards files out on our LAN (this is an intranet site). These links have ALWAYS worked up until today.. at which point not a single one will work. Prior to today you were able to click on the link and the file (usually an .xlsx spreadsheet) would open up.
The file path is saved as a field in the database. On the Index view, if this attachment field has content then a hyperlink with a paperclip image is used in this table cell. Here is the code from the view:

        @if (!String.IsNullOrWhiteSpace(item.Attachment))
        {

        }

And here is an example of how this HTML is rendered

If I right-click and copy the link address this is what I get on my clipboard
file://Prdhilfs03/l&i-sales&mkt/WORKAREA/Agencyservices/Shared/AIC/MasterListAttachments/AF.xls

However, if I right click the link, select "Inspect Element", then right click the anchor link from the console and select "Copy Link Address" I get this:
http://localhost:2574///Prdhilfs03/l&i-sales&mkt/WORKAREA/Agencyservices/Shared/AIC/MasterListAttachments/AF.xls

Any help or suggestions would be appreciated. Thanks!
EDIT
When I click the link, I receive this error message in the Chrome console:
Not allowed to load local resource: file://Prdhilfs03/l&i-sales&mkt/WORKAREA/Agencyservices/Shared/AIC/MasterListAttachments/AF.xls

Answer: Did you try using forward slashes instead. I mean instead of

to use

Convert the urls:
var links = document.querySelectorAll("a");
for(var i=0; i<links.length; i++) {
    var link = links[i];
    var url = link.getAttribute("href");
    if(url) {
        url = url.replace(/\\/g, "/");
        link.setAttribute("href", url);
    }
}

Comment: How would I specify that? The anchor link is in a loop so the `@item.attachment` is Razor that renders the link as I posted it.
Comment: I don't gave experience with Razor, but if if you could add some javascript code you may translate the urls.
Comment: Still getting the `http:` in front of the url. Added this command `url = url.replace("http:", "");` and getting the same thing.
Answer: First of all, prefix your href with "file://" instead of "\\", and this will fix the discrepancy between the two links.
Second, I believe that your problem has to do with cross site scripting.  Your browser doesn't want to be tricked into downloading files from another server (I'm assuming that \\Prdhilfs03 is a different computer than the web server).
To verify this problem using Chrome, click on the link while your javascript console is open, and see if you get an error that says something like "Not allowed to load local resource:".
EDIT
OK, as verified by your error message, your web browser is preventing you from downloading a file from a different server to protect against cross site scripting.  There is an article here that talks about steps to fix this by changing your chrome settings, although another option would be to store the files locally on the web server.
Answer: I'll add to Karl's answer that you are running into the cross site scripting issue. An alternative you have is to have a controller that returns the file in question as a FileResult. Let's call this a FileRouter. The FileRouter will then have one action called Download, something like this:
public FileContentResult Download(string path)
{
    return this.File(/* a stream to the path */);
}

You would then pass the paths to the action on your controller. So instead of a direct link, you'll place an Html.Action link with a target of intranetserver/filerouter/download?path=path_to_file
Of course this has the drawback of the server loading the file off the network unnecessarily, but it's an alternative to consider.
Additionally, using a FilePathResult may work here as well, but I don't have any experience with it so can't make any claims on its efficacy here.
Comment: It's a small group of users, so the network usage wouldn't be a problem. We did want to try and open up the actual file, though, as opposed to downloading a copy. I've never used this technique before, do you know if it accomplishes that or would this simply download a copy of the file?
Comment: The FileContentResult will download a copy unfortunately, so not what you actually want. :( The FilePathResult though may work. It might be worth putting a quick test on a local MVC project on your box to see the effects. Sorry, I originally missed the fact that you want the file directly opened.


ativando o phpmyadmin

Question: Estou rodando o XAMPP, porém o meu phpmyadmin está desabilitado já fiz de tudo para ativar, existe alguma outra opção, segue abaixo o erro.

#2002 - Arquivo ou diretorio nao encontrado
O servidor não está respondendo (ou o soquete do servidor local não
  está configurado corretamente)
Comment: Qual o sistema operacional onde o xaampp está instalado?
Comment: ubuntu (linux).
Answer: Tente fazer o seguinte, parar todos os serviços e inicializar novamente, utilize os comandos abaixo para parar os serviços
sudo opt/lampp/lampp stop
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop

OU
sudo service apache2 stop
sudo service mysql stop

Depois de parar os serviços, inicie novamente
sudo opt/lampp/lampp start

Tente novamente abrir o phpmyadmin novamente
Traduzido de: stackoverflow EN
Comment: cara está dando o mesmo erro, o estranho é que quando dou o comando 'service mysql stop' no terminal, ele me fala que o trabalho é desconhecido???
Comment: @user3677610 Parece que o mysql não foi instalado corretamente, digite `sudo service mysql status`, a saída deve ser algo como `mysql start/running, process 835`, se ocorrer o mesmo erro tente reinstalar o programa
Comment: da na mesma, a hora que esta instalando o mysql no terminal ele trava no meio do caminho
Comment: Talvez esteja conflitando com alguma versão do mysql já instalado, tente desinstalar o mysql, `sudo apt-get remove --purge mysql-server`, veja se este link ajuda http://tipslegais10.blogspot.com/2013/01/desinstalar-mysql-no-linux-por-completo.html
Comment: bom dia nao consegui resolver o problema ainda, ja removi o mysql da minha pasta do computador, mas ele nao esta ativando, e chega a confirmar na hora qe sobe o servidor, mas no status do xampp aparece desabilitado..
Comment: consegui resolver era fato estava rodando dois apache bastou eu dar um service apache2 stop e resolvi, muito obrigado
Answer: Como tirar erros do Mysql e viver em paz! :)
1- se você acessar o mysql pelo terminal e o erro for referente a falta de existencia de um diretório, então poderá ser que você tenha que instalar o mysql-server, assim:
    sudo apt-get install mysql-server
2- se você tentar entrar no mysql pelo phpmyadmin e der o seguinte erro: phpmyadmin ERROR - #2002, ou algo do tipo, poderá ser que você tem dois mysql instalados e rodando ao mesmo tempo, o que gera conflitos. Para resolver isso basta encerrar o mysql e deixar apenas o do xampp rodando, assim:
    cd /etc/init.d
    # ./mysql stop
    # ./apache stop
-Após isso, basta startar o mysql dentro do lampp, assim:
    -dentro da pasta /opt:
        opt/lampp/lampp start , ou , sudo opt/lampp/lampp
    -ou dentro da pasta lampp, assim:
        sudo ./lampp start
3- se para você aparece um erro do tipo: Existing configuration file (config.inc.php) is not readable…, significa que você deu uma permissão de alteração do arquivo ou execução, sendo que esse arquivo é apenas para leitura, e o mysql não inicia se você não mudar a permissão, dessa forma basta digitar:
    -procure o arquivo, no meu caso ficou assim:
        cd opt/lampp/phpmyadmin/
    -dentro do diretório /phpmyadmin, possui o arquivo config.inc.php, então dentro do diretório, digite:
    sudo chmod 700 config.inc.php
-Dessa forma o arquivo poderá ser executado pelo mysql sem nenhuma interrupção.

ativando o phpmyadmin


How to set datasource in datatables.net on meteor Collection?

Question: How can I set datasource in datatables with Meteor Collection?
Answer: With Meteor its a bit different to C#/.NET. I'm not sure datatables explicitly takes a datasource from an array/an actual data variable. But it is possible to make a table from a minimongo query such as People.find()
You have your table which you're going to convert to a datatable. Make a basic table that loops with {{#each}} for each 'row/document'
<template name="data">

            Name
            Address

        {{#each person}}

              {{name}}
              {{address}}

        {{/each}}

</template>

Then you attach data to this with a template helper that connects to your database:
 Template.data.person = function() {
     return People.find()  //Return the data containing name/addresses of people
 }

Finally something to convert the plain ordinary table to a datatable
 Template.data.rendered = function() {
     $('#datatable').dataTable()
 }

Comment: Thanks for your reply. But i get this error: Exception from Deps afterFlush function: TypeError: Cannot call method 'insertBefore' of null. Thank you in advance for your reply.
Comment: A data table is actually the main focus of an example Meteor project that I use to teach the basics of Meteor. It's on Github: https://github.com/primigenus/meteor-bedenktijdje - very similar code to Akshat's answer but without needing the datatables library.
Comment: @Rahul thats quite a nice project, im not fluent in dutch so your students can ask questions in real time and it pops up on the screen? Thats really cool
Comment: nah it's just a collection-backed list of people that you can resort and vote on, with voting limited by logged in state.
Comment: @Rahul even better! It sounds very interactive


How to add tags to my sandbox module?

Question: I 'm working on a sandbox module, which is text_or_user_reference field.
To release the module, I have to create a branch of the module i.e 7.x-1.0
Since beginning of the module development I was not aware with this thing, so I was working on master branch.
Now I have to add the tags to create the branch. To create the tags I followed this guide on drupal.org
These are the commands to push and create the tags:

git tag 7.x-1.0
git push --tags
git push origin tag 7.x-1.0

I have applied all the commands, but I am not able to see whether tags are created or not.
My problems:

How to check whether tags are created or not ?
Do I have to seperately assign to tags to each file like .module file, .install file etc.
When I go to Edit of the project and select the dropdown version to work from it doesn't show the tags/version I created i.e. 7.x-1.0
Consider this command:

git branch -v

What should I expect as a result after I run it? The list of all the files of current branch?
Answer: In git, the terms "branch" and "tag" always applies to the whole repository, not to the individual files.  A branch denote is a series of commits (so you always use an "x" instead of specific version number for a branch). A tag is a label for a specific version, so you specify the version number (e.g. 1.0 for the first released version, 1.1 for the next, and so on.)
The command git branch -v will give a verbose listing of the current head.  It should, in the case of Drupal 7, start with a line * 7.x-1.x.  If it says master on the first line, you've not set things up right.
Before adding tags, you need to get your project on a 7.x-1.x branch.  In your local repository, do the following to checkout branch 7.x-1.x and delete branch master, and push those changes to the remote:
git checkout -b 7.x-1.x
git branch -d master
git branch -v
git push origin 7.x-1.x
git push origin :master

After you've made sure the branch is 7.x-1.x, you can go ahead and add a tag to your release.
You can use the commands you refer to, to tag.  To see all the tag(s) in the local repository:
git tag

After pushing to the remote, if you've done this correctly, you should be able to click on the Version control tab and find the 7.x-1-x branch in the Version to work from: pull-down menu.  If you retain the master branch, make sure that you make the 7.x-1.x branch the default.
Comment: Do i have to assign tags to each file manually? as i can find that only one file has tags added and this file is README.txt file
Comment: Shall i give the name like 7.x-1.0 or 7.x-1.X
Comment: So first i have to create a branch right ?
Comment: last question..do i have to delete the master branch? because it is better if we keep it
Comment: No - but the master branch is confusing in the context of a Drupal release, since ir may apply to any version of Drupal.

How to add tags to my sandbox module?


How to use cesium.js to make a line with flowing texture like a picture

Question:
Like this picture, I tried to use the image material and GLSL combined with Cesium to achieve, but ultimately did not succeed.
The following code is my attempt, currently only can be drawn like this, the problem is that I can not change the color, can only change the color of the line by modifying the color of the picture:

function PolylineTrailLinkMaterialProperty(color, duration) {
            this._definitionChanged = new Cesium.Event();
            this._color = undefined;
            this._colorSubscription = undefined;
            this.color = color;
            this.duration = duration;
            this._time = (new Date()).getTime();
        }
        Cesium.defineProperties(PolylineTrailLinkMaterialProperty.prototype, {
            isConstant: {
                get: function () {
                    return false;
                }
            },
            definitionChanged: {
                get: function () {
                    return this._definitionChanged;
                }
            },
            color: Cesium.createPropertyDescriptor('color')
        });
        PolylineTrailLinkMaterialProperty.prototype.getType = function (time) {
            return 'PolylineTrailLink';
        }
        PolylineTrailLinkMaterialProperty.prototype.getValue = function (time, result) {
            if (!Cesium.defined(result)) {
                result = {};
            }
            result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.WHITE, result.color);
            result.image = Cesium.Material.PolylineTrailLinkImage;
            result.time = (((new Date()).getTime() - this._time) % this.duration) / this.duration;
            return result;
        }
        PolylineTrailLinkMaterialProperty.prototype.equals = function (other) {
            return this === other ||
                (other instanceof PolylineTrailLinkMaterialProperty &&
                  Property.equals(this._color, other._color))
        }
        Cesium.PolylineTrailLinkMaterialProperty = PolylineTrailLinkMaterialProperty;
        Cesium.Material.PolylineTrailLinkType = 'PolylineTrailLink';
        Cesium.Material.PolylineTrailLinkImage = "./sampledata/images/colors1.png";
        Cesium.Material.PolylineTrailLinkSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n\
                                                      {\n\
                                                           czm_material material = czm_getDefaultMaterial(materialInput);\n\
                                                           vec2 st = materialInput.st;\n\
                                                           vec4 colorImage = texture2D(image, vec2(fract(st.s - time), st.t));\n\
                                                           material.alpha = colorImage.a * color.a;\n\
                                                           material.diffuse = (colorImage.rgb+color.rgb)/2.0;\n\
                                                           return material;\n\
                                                       }";
        Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailLinkType, {
            fabric: {
                type: Cesium.Material.PolylineTrailLinkType,
                uniforms: {
                    color: new Cesium.Color(1.0, 1.0, 0.0, 0.5),
                    image: Cesium.Material.PolylineTrailLinkImage,
                    time: 0
                },
                source: Cesium.Material.PolylineTrailLinkSource
            },
            translucent: function (material) {
                return true;
            }
        });

        function parabolaEquation(options, resultOut) {
            //y=-(4h/L^2)*x^2+h
            var h = options.height && options.height > 5000 ? options.height : 5000;
            var L = Math.abs(options.pt1.lon - options.pt2.lon) > Math.abs(options.pt1.lat - options.pt2.lat) ? Math.abs(options.pt1.lon - options.pt2.lon) : Math.abs(options.pt1.lat - options.pt2.lat);
            var num = options.num && options.num > 50 ? options.num : 50;
            var result = [];
            var dlt = L / num;
            if (Math.abs(options.pt1.lon - options.pt2.lon) > Math.abs(options.pt1.lat - options.pt2.lat)) {
                var delLat = (options.pt2.lat - options.pt1.lat) / num;
                if (options.pt1.lon - options.pt2.lon > 0) {
                    dlt = -dlt;
                }
                for (var i = 0; i < num; i++) {
                    var tempH = h - Math.pow((-0.5 * L + Math.abs(dlt) * i), 2) * 4 * h / Math.pow(L, 2);
                    var lon = options.pt1.lon + dlt * i;
                    var lat = options.pt1.lat + delLat * i;
                    result.push([lon, lat, tempH]);
                }
            } else {
                var delLon = (options.pt2.lon - options.pt1.lon) / num;
                if (options.pt1.lat - options.pt2.lat > 0) {
                    dlt = -dlt;
                }
                for (var i = 0; i < num; i++) {
                    var tempH = h - Math.pow((-0.5 * L + Math.abs(dlt) * i), 2) * 4 * h / Math.pow(L, 2);
                    var lon = options.pt1.lon + delLon * i;
                    var lat = options.pt1.lat + dlt * i;
                    result.push([lon, lat, tempH]);
                }
            }
            if (resultOut != undefined) {
                resultOut = result;
            }
            return result;
        }

        var isAdd = false;
        var material = null;
        var center = { lon: 114.302312702, lat: 30.598026044 }viewer.entities.add({
                            name: 'PolylineTrailLink' + j,
                            polyline: {
                                positions: Cesium.Cartesian3.fromDegreesArrayHeights(pointArr),
                                width: 2,
                                material: material
                            }
                        });

Comment: Hello! Welcome to Stack Overflow! Please provide your code attempts so we can better help you.
Answer: Sometimes a faded path can be emulated by placing a "stripe" material across a line, rotated so the entire line is just the transition from one stripe color to the other.
Sandcastle Demo - This is a modified version of the Interpolation Demo, with a faded yellow line.
path : {
    resolution : 1,
    // ************************************************************
    // This material uses a single stripe, turned sideways, to fade
    // the color across a length of the line.
    // ************************************************************
    material : new Cesium.StripeMaterialProperty({
        // The newest part of the line is bright yellow.
        evenColor: Cesium.Color.YELLOW,
        // The oldest part of the line is yellow with a low alpha value.
        oddColor: Cesium.Color.YELLOW.withAlpha(0.1),
        repeat: 1,
        offset: 0.25,
        orientation: Cesium.StripeOrientation.VERTICAL
    }),
    leadTime: 0,
    trailTime: 60 * 2,
    width : 10
}

Comment: Thank you very much for your answer. Maybe this is the best solution for using 'path'. I don't know if you have any other implementation methods.
Comment: I need a better-looking effect for my own projects too.  So, I've been working on a new feature for this:  https://github.com/AnalyticalGraphicsInc/cesium/pull/7626


How are access permissions prioritized when multiple modules implement them?

Question: I have the Group module setup where I only allow view permission for group content to group members, so I have closed groups. But additionally, I want groups to also make some content public to non-members (but authenticated users) or to anonymous users even.
I have setup the Permissions by Term module for this where I made an "Additional view permissions" vocabulary that has two terms "all authenticated users" and "public". Those two terms I have granted permission to the respective roles. I had hoped that this would override the group permissions, but it doesn't. If I am not logged in, group content that has the "Additional view permissions" set to "public", still is not accessible to anonymous users.
I guess my question is: how does Drupal determine the priority of multiple modules arranging permissions for the same node, and can I influence this? In my case the group permissions seem to take priority, causing view permissions to be denied. But if it would first look at the permissions by term module, it would actually allow access.
Answer: Have a look at this feature request Allow other modules to alter gnode_node_access's forbidden result, especially this part of it:

If the group node's gnode_node_access module doesn't find a reason to return neutral, or to grant access, it returns a AccessResult::forbidden(). This prevents any other module from granting access. ...

So to "determine the priority of multiple modules arranging permissions for the same node" (as in your question): if the Group module denies access, then there is no way for any other module to overrule that access.
Maybe not what you like to hear/read, but this is how access is handled via Group module.
Comment: @DolfAndringa interesting! Also the extra comments you added in the issue I mentioned in my answer. Btw merci for the accept / +1 also.
Comment: Ok, thanks for the anwser. I am keeping an eye on that feature request and will see if I can contribute anything. Is there any other option that I am overlooking to fill my use-case?
Comment: There is a patch in that link that provides a hook that allows other modules to modify the permissions from the group module. That patch, in combination with a patch I write for permissions by term, solve my problem. If the group module implements that patch, I will submit my patch to the permissions by term module.
Comment: Thanks @Pierre.Vriens. I added some more comments in the issue. I still have a problem there that I think are related to the priorities of permission modules. It seems the hook works fine in the permissions by term module adding on top of the gnode permissions, but the other way around, it looks like (but I'm not 100% sure and don't know how to debug) the permission by term module also restricts access now while the gnode access module actually allows access. So the problem reversed. Any idea? See the issue on d.o
Comment: Nevermind. I fixed it (see issue thread).


how to handle (many) false positives in training dataset for logistic regression classifier

Question: I want to train a logistic regression dataset. I have a quite big training data set ( >100 000) and have around 10 features I can train on. Half of my training data is negative training data and I know for sure that almost all these observations are true negative. But I know for sure that in my positive dataset half of maybe even more then half are false positives. I just dont know which ones.
How can I handle such a problem? Have anyone good tips of pointers to literature?
Thanks in advance
Answer: This is a problem called "label noise" in the machine learning literature.  There is a nice paper by Bootkrajang and Kaban, called "Learning Kernel Logistic Regression in the Presence of Class Label Noise" (http://www.cs.bham.ac.uk/~axk/Jo_Patrec.pdf) that is probably a good place to start.


Can these two definitions be proven equivalent without the axiom of choice?

Question: By $Map(X,Y)$, I denote the set of functions from $X$ into $Y$. Consider $Map(X,X)$, and let $f$ and $g$ be elements of $Map(X,X)$. I define a relation "$g$ is a function of $f$", iff there exists a function $h \in Map(X,X)$, such that $h$ composed with $f$ equals $g$. My original definition, however, was "if $f(x)=f(y)$ then $g(x)=g(y)$, for all $x \in X$". These two definitions can be proven equivalent with the axiom of choice. However, what happens if we don't assume choice? Can it be proven equivalent in ZF alone? And if not, is the principle equivalent to choice over ZF, or strictly weaker than choice?
Comment: Both definitions are equivalent to saying that $f$ and $g$ have the same fibres. As Eric Wofsey shows, no choice is needed to prove this.
Answer: I'm not sure how the axiom of choice would be involved here.  Just define $h(a)$ to be the common value of $g(x)$ for all $x$ such that $f(x)=a$ (there is at most one such value of $g(x)$ by hypothesis), or define $h(a)$ arbitrarily (say, $h(a)=a$) if no such $x$ exists.


Why is there white space showing between the articles

Question: I thought I was good at CSS but I just can't figure out why there is white space showing in between the posts. Do you?
http://www.casinobuzz.info/casino-games-archive/
Comment: Please [edit] your question to include a [mcve] reproducing the issue. The code that you include ***in your question*** must be ***Minimal*** (only the code necessary to reproduce the issue, nothing more), ***Complete*** (all of the code necessary to reproduce the issue, nothing less) and ***Verifiable*** (we should be able to reproduce the issue using the code ***in your question*** alone, nothing more and nothing less). Without this, your question is off-topic for Stack Overflow.
Comment: What posts do you mean?
Comment: Because that's the page I'm working on at the moment. It's not spam. I can remove the link later.
Comment: @Eduardo Look under the dracula game
Answer: Because the elements have a variable heigth, so
article {
    float: left;
}

doesn't work very well.
If you reset your float every second element (the last post in a row), the white space is removed.
Try adding:
article:nth-child(even) {
    clear: both;
}

Comment: Thanks a lot! I didn't know how else more to put it. I could have made a fiddle but that would have taken a lot more unnecessary time. CSS is more a case of either "you know it or you don't" I don't specialize in CSS. Asking the question this way, I learned something from the community and I appreciate your time very much.
Comment: The problem is that he won't ask it the right way next time because instead of teaching him how to fish, you gave him a fish. Now the question is still extremely off-topic for Stack Overflow, and does not fit within the guide lines at all. What you've actually done here is contribute to the problem instead of the solution. For those of us actively trying to keep Stack Overflow on-topic and high-quality, it is very disheartening to see other users blatantly disregarding the site rules and giving them exactly what should not be given unless the question is in turn made on-topic.
Comment: If you put it like that, I can only agree. But I learned the hard way too with my first question(s), yet I didn't feel like I shouldv'e been denied a proper answer (too) at the time. Actually, I've never thought that OP's question disregarded the site rules either when I tried to answer. I'll try to pay more attention next time.
Comment: This question is impossible to answer with the code ***in the question***. We don't want these questions to get answered until the question is edited to fit within the guidelines of this site. Otherwise, it teaches users that it is OK to post questions like these, because even if they get closed, they still get their answer. Questions need to be on-topic to get answers on Stack Overflow.
Comment: Somehow I exactly knew what he meant, **and** I solved his problem, not that impossible, right? I agree though on most you say. But how could OP know? At least he got his answer, and he can ask it the right way next time, or maybe format his question.
Comment: Think for a second about what is going to happen if the link goes dead, or the code at the link is changed? This whole Q&A will be completely useless to anyone other than the OP ever again, and that is not what we are trying to do here. The purpose of Stack Overflow is to create a repository of useful solutions to common programming problems for programmers everywhere. It is not, contrary to popular belief, a help-desk where our sole purpose is to help the OP and nothing more, which is what you have succeeded in doing here.
Comment: @emporio Next time, please read [ask] and visit the [help/on-topic] before posting a question here and make sure that you include all of the necessary information to solve the problem ***in your question*** so that the question can be useful to someone other than just you.
Comment: Yes, thanks for the feedback! Will do that next time.