text:
Q: Program gets stuck in an infinite loop when using entering default during switch statement So I am currently writing a program in C that using a switch statement can allow a string to be entered then depending on the value you choose from the menu determine what to do with it.
Here is my code,
#include <stdio.h>

int main()
{
    int menu, end, i;
    char string[100];
    end = 0;

    do
    {
        printf("Welcome to the string operations program.\n\n");

        printf("1 - Enter a string\n");
        printf("2 - Display the message using the string\n");
        printf("3 - Count the number of characters in the string\n");
        printf("4 - Display the string backwards\n");
        printf("5 - Exit\n\n");

        printf("Option: ");
        scanf("%d", &menu);

        switch (menu)
        {
            case 1:
                printf("String: ");
                scanf("%s", string);
                break;

            case 2:
                printf("This is a message: Hello %s\n", string);
                break;

            case 3:
                printf("There are %d characters in %s\n", strlen(string), string);
                break;

            case 4:
                printf("string reversed gives: ");
                for (i = strlen(string) - 1; i >= 0; i--)
                    printf("%c", string[i]);
                printf("\n");
                break;

            case 5:
                printf("Exit");
                return 1;
                break;

            default:
                printf("Invalid input, try again.\n");
                break;

        }
    }while (end != 1);
    return 0;
}

It seems to work for everything when I run it through 1,2,3,4,5 as that is the requirement for the question. However when i enter a letter for example 't' it goes to the default section as expected. When it enters this it goes into an infinite loop.
Can anyone help me and show me how to not make this an infinite loop but just have it return to the start as the user input was not allowed?

A: there are several problems with the posted code:

*

*does not handle the scenario when the use has not entered a string

*displays the welcome message more than once

*does not properly handle menu selection 5

*does not 'compare apples to apples'

*does not empty stdin before trying input a string

*does not allow any white space in the input string

*....

The following proposed code:

*

*corrects all the above listed problems

*cleanly compiles

*properly checks for and reports errors

*contains a default string so the program does not have undefined behavior

*includes the needed header files and documents why each header file is being included

And now the proposed code:
#include <stdio.h>   // printf(), scanf(), fprintf()
#include <stdlib.h>  // exit(), EXIT_FAILURE
#include <string.h>  // strlen()

int main()
{
    int menu;
    int end;
   //int i;
    char string[100] = "no string entered";
    end = 0;

    printf("Welcome to the string operations program.\n\n");

    do
    {
        printf("1 - Enter a string\n");
        printf("2 - Display the message using the string\n");
        printf("3 - Count the number of characters in the string\n");
        printf("4 - Display the string backwards\n");
        printf("5 - Exit\n\n");

        printf("Option: ");
        if( 1 != scanf("%d", &menu) )
        {
            fprintf( stderr, "scanf for menu selection failed\n" );
            exit( EXIT_FAILURE );
        }

        // implied else, scanf successful

        switch (menu)
        {
            case 1:
                // note leading space in format string to consume leftover newline in 'stdin'
                printf("String: ");
                if( 1 != scanf(" %99[^\n]", string) )
                {
                    fprintf( stderr, "scanf for input string failed\n" );
                    exit( EXIT_FAILURE );
                }

                // implied else, scanf successful
                break;

            case 2:
                printf("This is the string entered: <%s>\n", string);
                break;

            case 3:
                // note appropriate format specifier for `size_t` from `strlen()`
                printf("There are %lu characters in <%s>\n", strlen(string), string);
                break;

            case 4:
                printf("string reversed gives: ");
                for (size_t i = strlen(string); i; i--)
                    printf("%c", string[i-1]);

                printf("\n");
                break;

            case 5:
                printf("Exit");
                end = 1;
                break;

            default:
                printf("Invalid input, try again.\n");
                break;
        }
    } while (end != 1);
    return 0;
}

A run of the program results in the following output:
Welcome to the string operations program.

1 - Enter a string
2 - Display the message using the string
3 - Count the number of characters in the string
4 - Display the string backwards
5 - Exit

Option: 2
This is the string entered: <no string entered>
1 - Enter a string
2 - Display the message using the string
3 - Count the number of characters in the string
4 - Display the string backwards
5 - Exit

Option: 1
String: this is a string with spaces
1 - Enter a string
2 - Display the message using the string
3 - Count the number of characters in the string
4 - Display the string backwards
5 - Exit

Option: 2
This is the string entered: <this is a string with spaces>
1 - Enter a string
2 - Display the message using the string
3 - Count the number of characters in the string
4 - Display the string backwards
5 - Exit

Option: 3
There are 28 characters in <this is a string with spaces>
1 - Enter a string
2 - Display the message using the string
3 - Count the number of characters in the string
4 - Display the string backwards
5 - Exit

Option: 4
string reversed gives: secaps htiw gnirts a si siht
1 - Enter a string
2 - Display the message using the string
3 - Count the number of characters in the string
4 - Display the string backwards
5 - Exit

Option: 6
Invalid input, try again.
1 - Enter a string
2 - Display the message using the string
3 - Count the number of characters in the string
4 - Display the string backwards
5 - Exit

Option: 5
Exit

A: Like Anton mentioned the problem is because of the scanf statement. You can add a getchar(); before break; in default: to solve this problem. Two more suggestions:
* You can remove the do-while loop here as it serves no special purpose and it's better to use while(1) loop.
* Also the break; statement in case 5 is not needed.


text:
Q: Problem with character vectors and linear regression in R Quick question.
I want to perform a linear regression that looks like this:
lm(y ~ x1 + x2 + x3 + x4 +x5, mydata)

This works fine if I manually write out this code.
However, the independent variables that I want to use are stored as a character, like this:
> vars
[1] "x1 + x2 + x3 + x4 +x5"

I tried typing this:
lm(y ~ vars, mydata)
Error in model.frame.default...

But it gives an error!
So then I tried this:
lm(y ~ noquote(vars), mydata)
Error in model.frame.default...

And then this
lm(y ~ print(vars, quote = FALSE), mydata)
Error in model.frame.default...

Anyone have a clue how I can get around this problem? The character string in "vars" is being provided to me by a program upstream, so I can't work around it at that level.
Thanks!

A: You can build a formula from character vectors using standard R functions and as.formula(). The trick is to note that you need to have a full formula (containing at least a ~) for R to create a formula object for you. Here is an example
## predictors
vars <- "x1 + x2 + x3 + x4 + x5"

## dummy data for example
dat <- data.frame(matrix(rnorm(120), ncol = 6))
names(dat) <- c("y", paste("x", 1:5, sep = ""))

## create a formula - here we need to paste on the response part
##  y ~
form <- as.formula(paste("y ~", vars))

## Fit the model using `form`
mod <- lm(form, data = dat)

If you print form you'll see that R has created a special object that no longer prints as a character string would:
> form
y ~ x1 + x2 + x3 + x4 + x5

redpajama_set_name: RedPajamaStackExchange


text:
Q: Pass a parameter to a ViewModel and show its data I have created an application which uses WPF and MVVM following this article from CodeProject.
I have a view, TVSeriesView, which has a TVSeriesViewModel. These two are connected using a DataTemplate which is done following the article.
<DataTemplate DataType="{x:Type Implementation:TVSeriesViewModel}">
    <TVSeriesLibrary:TVSeriesView />
</DataTemplate>

The idea is to pass my model, the TVSeries, to this ViewModel as I have a property named TVSeries in the ViewModel. When this property is set, I will populate other properties such as Title, Cover and so on. These properties are meant to be binded to controls in the view.
public class TVSeriesViewModel : ViewModelBase, ITVSeriesViewModel
{
    private TVSeries _tvSeries;
    private string _title;
    private ImageSource _cover;

    public TVSeries TVSeries
    {
        get
        {
            return this._tvSeries;
        }
        set
        {
            this._tvSeries = value;
        }
    }

    public string Title
    {
        get
        {
            return this._title;
        }
        set
        {
            this._title = value;
            OnPropertyChanged("Title");
        }
    }

    public ImageSource Cover
    {
        get
        {
            return this._cover;
        }
        set
        {
            this._cover = value;
            OnPropertyChanged("Cover");
        }
    }
}

First and foremost, does this sound like the right way to do it?
Next, does anyone know how to pass a parameter (a TVSeries object) to the ViewModel when the TVSeriesView is shown?
And lastly, does anyone know how I can directly access resources in the view? For example if I don't want to use data binding but instead want to set the image directly like this:
myImage.ImageSource = myImageSource

A: The View and ViewModel together are one of the possible representations of the Model.
You can pass a repository handle which would be eventually responsible for data access or
Concrete/abstract object of Model through Dependency Injection via Constructor or
Dependency Injection, via property/method or
In more crude way you can write a DB access code in your VM (obviously it's not suggested.)
I would prefer as the order given here. Your code is doing the third option.


text:
Q: Uniformly distributed rationals Is there any algorithm, function or formula $f(n)$, which is a bijection between the positive integers and the rationals in $(0,1)$, with the condition, that for all real numbers $a,b,x$ with $0<a<b<1<x$, if we let $i(x)$ be the number of distinct integers $0<n_j<x$ which satisfy $a<f(n_j)<b$, then we have $\lim_{x\rightarrow\infty}i(x)/x=b-a$?

A: van der Corput is a bit of overkill. It gives a sequence with an especially low discrepancy, but that's more than what's needed for uniform distribution.
There is a theorem of von Neumann that says that any countable set of reals dense in $(0,1)$ can be ordered in such a way as to become a uniformly distributed sequence. One way to do this is to enumerate the set any old way, say, $s_1,s_2,\dots$, and also write down a list of intervals $I_1,I_2,\dots$, where the first two intervals partition $(0,1)$ into two equal pieces, the next three partition $(0,1)$ into three equal pieces, etc. Then for each $j$, $j=1,2,\dots$, let $u_j$ be the first unused $s_j$ in $I_j$. Then $u_1,u_2,\dots$ can be proved to be a uniformly distributed ordering of your dense set.

A: You are looking for an equidistributed sequence of rationals that uses every rational exactly once.  The Van der Corput sequence mentioned by GEdgar comes close, except that it misses some of the rationals.  But you can just throw in the missing numbers, as long as you spread them out.
For instance, the binary Van der Corput sequence uses all the dyadic rationals.  If you enumerate the non-dyadic rationals and insert the $k$th one into the sequence at position $2^k$, say, you can check that the new sequence is still equidistributed.  The key is that of the first $N$ values in the sequence, only $o(N)$ have been changed.

A: Positive dyadics rationals less than 1 are:
$$\large \frac{n+1/2}{2^{ \lfloor log_2 n \rfloor }} -1$$
Using this form:
(x+1/2)/(2^floor(log(abs(x))/log(2)))-1

I graph this:

*graph shows a range of 0..2, but the formula is actually ranged 0..1.
a progression of odd numerators over increasing power of two denominators at positive integer intervals.
from math import log2,floor
from fractions import Fraction
def dyadics(n=Fraction(1,1)):
    while 1:
        yield (2*n+1)/2**floor(log2(n)+1)-1
        n += 1
in_sequence = dyadics()
for n in range(2**4):
    print(next(in_sequence))

1/2,
1/4,
3/4,
1/8,
3/8,
5/8,
7/8,
1/16,
3/16,
5/16,
7/16,
9/16,
11/16,
13/16,
15/16,
1/32

A: (I may have misinterpreted this question. I came across this question while wondering if it is possible to construct a "uniform" random variable that generates rationals. I think it's impossible.)
Consider a random variable $X$ over the rationals in (0,1). One way to define a "uniform" distribution is the following rule:
$$ \mathrm{P}(a < X < a+\epsilon) = \epsilon $$
for any $0 < a < a+\epsilon <1$. This says that the probability that a number drawn from $X$ is in the interval $(a,a+\epsilon)$ equals $\epsilon$ and, in particular, the probability is independent of $a$.
The probability that $X$ equals any particular rational, $r$, must be zero. A proof by contradiction: If there existed an $r$ such that
$$ \mathrm{P}(X = r) = p_r > 0 $$
then one could construct an interval around $r$ which is narrower than $p_r$, such as $(r-\frac13 p_r, r+\frac13 p_r)$. By our earlier rule, it should be the case that
$$ \mathrm{P}(r-\frac13 p_r < X < r+\frac13 p_r) = \frac23 p_r $$
but this contradicts the assumption that there already exists a single element in that interval which has probability $p_r$. There is not enough probability mass in the arbitrarily-small interval to allow the individual rationals to have non-zero probabilities.
Therefore, the probability mass associated with any rational must be zero. (Or perhaps hyperreal.)
Now, it is trivial to construct a (possibly non-uniform) distribution over the rationals, which I'll call $Y$. Draw the denominator, $d$, from a suitable integer distribution (such as Geometric) and draw the numerator, $n$, uniformly from the range $0<n<d$. For each rational $r$, there will be a non-zero probability of it being generated from that simple scheme:
$$ \mathrm{P}(Y=r) > 0 $$
and of course, these must sum to 1 to be a proper probability distribution:
$$ \sum_{r \in \mathcal{Q}} \mathrm{P}(Y=r) = 1 $$
Finally (and I'm not sure I've got this right...), the probabilities for every element in X (zero) are smaller than for every element in Y (non-zero).
$$ \forall r \qquad \mathrm{P}(Y=r) > \mathrm{P}(X=r) $$
and therefore the sum for X, $ \sum_{r \in \mathcal{Q}} \mathrm{P}(X=r) $, can't possibly sum to 1. Every term in the sum for X is smaller than the corresponding term for Y. So such a distribution over the rationals cannot exist.
(This answer probably isn't novel, I'm not a specialist. But I am interested in this question. Any feedback appreciated.)


text:
Q: How to linearize this constraint: a summation of a product of a integer with a binary I have to linearize the following constraint,
$$ \sum_{i \in V_C} \sum_{j \in V} \sum_{k \in K} y_{ik} \cdot x_{ijk\ell} \leq I_\ell \qquad  \forall \ell \in V_D $$
where $y$ is a integer variable smaller than $v_i$ and $x$ is a binary variable. I have found some other question about this but there they do not have the combination of a integer value with a binary and no summation. Does anyone know how to linearize this constraint?

A: The following assumes that $y_{ik} \geq 0$.
First, let's introduce a new set of variables $z_{ijk\ell}$:
\begin{gathered}
\sum_{i,j,k} z_{ijkl} \leq I_\ell \qquad \forall \ell \\
y_{ik} \cdot x_{ijk\ell} = z_{ijk\ell} \qquad \forall  i,j,k,\ell
\end{gathered}
I hope you don't mind that for brevity I've dropped the index sets. This is equivalent (in $x$ and $y$) to
\begin{gathered}
\sum_{i,j,k} z_{ijkl} \leq I_\ell \qquad \forall \ell \\
y_{ik} \cdot x_{ijk\ell} \leq z_{ijk\ell} \qquad \forall  i,j,k,\ell
\end{gathered}
This works because when the original inequality is feasible, we can always choose to have equality hold: but if there is slack in that inequality, we could distribute that slack across the values of $z_{ijk\ell}$ without changing equivalence.
Now that we've done that, we can use this equivalence:
$$y_{ik} \geq 0, ~~ y_{ik} \cdot x_{ijk\ell} \leq z_{ijk\ell} \quad\Longleftrightarrow\quad
0 \leq z_{ijk\ell}, ~~ y_{ik} - v_i ( 1 - x_{ijk\ell} ) \leq z_{ijk\ell}$$
If $x_{ijk\ell}=0$, then $z_{ijk\ell}\geq 0$ will be active. If $x_{ijk\ell}=1$, then the second constraint will be active, and it will be equivalent to $y_{ik} \leq z_{ijk\ell}$.
So the final conversion is
\begin{gathered}
\sum_{i,j,k} z_{ijkl} \leq I_\ell \qquad \forall \ell \\
y_{ik} - v_i  (1- x_{ijk\ell}) \leq z_{ijk\ell} \qquad \forall  i,j,k,\ell \\
0 \leq z_{ijk\ell} \qquad \forall  i,j,k,\ell
\end{gathered}


text:
Q: Window hosting on GoDaddy to redirect index.html to root If I have a Windows server, is there any possibility I can redirect my index.html to root:
www.example.com/index.html    -> www.example.com
http://example.com/index.html -> http://example.com

The hosting which I am currently using is not Apache, I am using a Windows server.

A: Yet another edit:
Meta Refresh Tag
<meta http-equiv="refresh " content="0; url=www.example.com">

There are two other options we can try if the meta refresh tag just isn't working.
Set the default document. (Simpler)
Web.Config Settings:
<system.webServer>
<defaultDocument enabled="true">
    <files>
        <clear />
        <add value="index.html" />
    </files>
</defaultDocument>
</system.webServer>

Details on setting up via web.config: Setting Default WebPage in IIS 7.5
OR set up via IIS UI (steps 1 through 8 in the HOW TO section): https://www.iis.net/configreference/system.webserver/defaultdocument
Create rewrite rules in IIS. (More difficult)
If we were using Apache, we would create/update the .htaccess file rules:
RewriteEngine On
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]

In IIS, we have to add these rewrite rules in a different way in the web.config. See the following links.
Steps for creating rewrite rules in web.config: IIS URL Rewrite and Web.config
Details on translating .htaccess content to IIS web.config: http://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/translate-htaccess-content-to-iis-webconfig
OR create Rewrite Rules in IIS UI: http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module


text:
Q: Проблемы с historyAPI Добрый день! Возникла проблема с historyAPI, а точнее с перехватчиком событий. Суть проблемы: если нажимать на область контента ссылки - событие перехватывается, а если нажать на padding ссылки - событие не перехватывается, и вместо подгрузки содержимого ajax-ом, я получаю переход по ссылке (с перезагрузкой страницы).
Код перехватчика:
$(document).ready(function(){
 var pattern          = new RegExp("^(https:\/\/"+location.host+"\/|http:\/\/"+location.host+"\/|\/\/"+location.host+"\/|"+location.host+"\/|\/(?!\/))"), // "^\/(?!\/)" - "начинается с /, но дальше - не /"
     pattern_protocol = new RegExp("^(http:\/\/|https:\/\/|\/\/)"), // да, "просто двойной слеш" тоже здесь
     pattern_lochost  = new RegExp("^("+location.host+")");
 $('a[href]').click(function(e){
  if(!$(this).attr('href')){console.log('no href'); return false;}
  var url = $(this).attr('href'),
      isLocal = (pattern.test(url)) ? true : false;
  if(isLocal){
   console.log('Local link: '+url);
   if(pattern_protocol.test(url)){url = url.replace(pattern_protocol, '');}
   if(pattern_lochost.test(url)){url = url.replace(pattern_lochost, '');}
   //На выходе получаем ссылку без протокола, двойного слеша и домена. Т.е., например, "https://domain.com/page" -> "/page".
   //Это нужо делать, ибо если у нас сылка вида domain.com/page, то она честно отдаёт isLocal,
   //но открывается через жопу - domain.com/domain.com/page
   $.ajax({
    url: url,
    data: 'ajax=true',
    success: function(data){reload_page($.parseJSON(data));}
   });
   window.history.pushState(null, null, url);
   return false;
  }else{
   console.log('External link: '+url);
   //Если нет протокола или хотя бы двойного слеша, то нужно обязательно добавить, иначе откроется в новом окне, но как location.href/url (например, radio.loc/google.com)
   //Добавляем http://. В проследствие вторая сторона, если имеет https:// - сама перенаправит.
   url = (pattern_protocol.test(url)) ? url : 'http://'+url;
   window.open(url, '_blank');
  }
 });
 $(window).bind('popstate', function(){
  $.ajax({
   url: location.pathname+location.search,
   data: 'ajax=true',
   success: function(data){reload_page(data)}
  });
 });
});

Грубо говоря, стили ссылок, которые я отлавливаю, выглядят так:
a{
 text-decoration: none;
 font-family: Tahoma;
 display: inline-block;
 height: 18px;
 padding: 10px;
 /*Итого, 18px (высота контента ссылки) + по 10px паддинга по сторонам =
 = 38px - высота ссылки, из которой рабочая высота - 18px*/
}

Есть идея сделать так:

Контент ссылки

Но получится костыльно. Что делать?
Спасибо заранее!
P.S.: Переход по сайту без обновления страницы - принципиально важно.
На всякий случай, reload_page():
/**
 * Обновляет содержимое страницы (без перезагрузки)
 * @param  obj data:
 *        bool data.isErrorPage  - нужно для смены бекграунда
 *       mixed data.show_sidebar - true|false - показать/спрятать, "inherit" - не делать ничего
 *      string data.title
 *      string data.url
 */
function reload_page(data){
 var url = (data) ? data.url : location.pathname+location.search;
 console.log('url: '+url);
 if(data){
  console.log('returned data:');
  console.log(data);
  var current_bg = $('body').css('background-image');
  current_bg = current_bg.split('/');
  current_bg = current_bg[current_bg.length - 1];
  if(data.isErrorPage){
   if(current_bg==='background.png'){$('body').css('background-image', 'background-grayscale.png');}
  }else{
   if(current_bg!=='background.png'){$('body').css('background-image', 'background.png');}
  }
  $('title').html(data.title);
 }
 $('#menu .fr').load(url+' .notifications-menu, .user-menu');
 $('#content').load(url+' [trgt]');
 switch(data.show_sidebar){
  case  true: sidebar_show(); break;
  case false: sidebar_hide(); break;
  default: /*case "inherit": do nothing;*/ break;
 }
 console.log('done!');
}

A: Проблема оказалась в том, что обработчик событий срабатывал только на те ссылки, которые были на странице сразу после её загрузки. А на те, что добавлены подгрузкой - нет.
Решилось изменением одной строчки:
$('a[href]').click(function(e){
//на
$(document).on('click', 'a[href]', function(e){


text:
Q: NetworkManger doesn't open Ubuntu 16.04 running sudo NetworkManager from the terminal outputs no errors, but also doesn't open a window or anything to use.
I am running BSPWM
I've also tried running it from Rofi, and the same thing occurs, no window actually opens.
running sudo gnome-control-center network in terminal outputs the following errors:
** (gnome-control-center:16538): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-3AhNpWuGp2: Connection refused

** (gnome-control-center:16538): WARNING **: Ignoring launcher gufw (missing desktop file)

** (gnome-control-center:16538): WARNING **: Ignoring launcher landscape-client-settings (missing desktop file)

** (gnome-control-center:16538): WARNING **: Ignoring launcher ubuntuone-installer (missing desktop file)

** (gnome-control-center:16538): WARNING **: Could not find settings panel "network"

A: NetworkManager is not an application in Ubuntu and you cannot open it like that. It's a daemon/service that manages network connections.
It's started during boot, but if you want to restart it, you can type e.g.:
sudo service network-manager restart


text:
Q: Connect Multiple L293D Motor Controllers to Arduino I would like to connect 3 L293D Motor controllers to an Arduino Uno with the hopes of powering 6 different dc motors. I was just wondering how to wire this being that one motor controller (which allows for 2 dc motors to be controlled) already takes up most of the pins on the arduino, thanks.
Below is the wiring diagram for how I am hooking up 1 L293D motor controllers to the arduino.

A: How about a PWM expander like the TLC59711. The link calls it an LED driver but it's just a breakout board for the SPI-PWM expander chip.


text:
Q: SQL Query too many rows I have  two tables Table a and Table B
Table A = 75 rows
Column1 , column 2
Table b = 1200 rows
Column 3, Column 4
I want all the rows in table A to be returned so that I ONLY have 75 rows returned and that's all from table A.  The resulting set should have 75 rows and 4 columns
Result:
Column 1, column 2, column 3, column 4
But no matter what join I use in SQL  I get more than 75 rows returned because table B has some records that do not match, or it has multiple records related to Table A.
How can I ONLY return 75 rows from Table a and not more than 75?
SELECT dbo.[00-AA].ImageTag AS [Column 1],
       dbo.[00-AA].DateIndexed AS [Column 2],
       dbo.[00-AW].UserId AS [Column 3],
       dbo.[00-AW].Status AS [Column 4]
FROM dbo.[00-AA]
     LEFT OUTER JOIN dbo.[00-AW] ON dbo.[00-AA].ImageTag = dbo.[00-AW].Barcode

A: The problem that you have is that the second table has many records for every record on the first table, so you still need to tell the query which of those many records use.
This sample returns the first random record on [00-AW] with the same Barcode as the ImageTag on [00-AA].
with CTE as (
  select Barcode, UserId, Status,
         row_number() over (partition by Barcode order by (select null)) as NUM
  from dbo.[00-AW]
)
SELECT dbo.[00-AA].ImageTag AS [Column 1],
       dbo.[00-AA].DateIndexed AS [Column 2],
       CTE.UserId AS [Column 3],
       CTE.Status AS [Column 4]
FROM dbo.[00-AA]
     LEFT OUTER JOIN CTE ON CTE.Barcode = dbo.[00-AA].ImageTag AND CTE.NUM = 1

If you want to chose a certain record on [00-AW] instead of the first random record with that Barcode, you just have to replace the (select null) by the fields to order that selection, so the first record is the one that it will be returned.


text:
Q: How can I change what's displayed at a login shell? I'm getting more familiar with tweaking the way things look in a shell via the prompt (.bashrc), but I'm now trying to change the initial stuff displayed when I first log in. On my EC2 instance, this is what I see when I log in:
         __|  __|_  )  Fedora 8
         _|  (     /    32-bit
        ___|\___|___|

  Welcome to:

    Wowza Media Server 2 for Amazon EC2

      Version: 2.0.0.08

On my home Mint computer, here's what I see when I log in:
Welcome to Linux Mint 11 Katya (GNU/Linux 2.6.38-8-generic x86_64)

Welcome to Linux Mint
* Documentation:  http://www.linuxmint.com

Last login: Tue Jun 21 17:44:05 2011

Where is this defined? How can I tweak it for some mad ASCII art ACTION?

A: The file /etc/issue and /etc/issue.net are the files displayed by the login program. You can put special expansion characters in it, as noted on the other answer. But you may also want to try the linux_logo program. It can generate really nice ASCII art issue files for you.

A: The text displayed before the login prompt is stored in /etc/issue (there's a related file, /etc/motd, that's displayed after the user logs in, before their shell is started). It's just a normal text file, but it accepts a bunch of escape sequences:

*

*\b -- Baudrate of the current line.

*\d -- Current date.

*\s -- System name, the name of the operating system.

*\l -- Name of the current tty line.

*\m -- Architecture identifier of the machine, eg. i486

*\n -- Nodename of the machine, also known as the hostname.

*\o -- Domainname of the machine.

*\r -- Release number of the OS, eg. 1.1.9.

*\t -- Current time.

*\u -- Number of current users logged in.

*\U -- The string "1 user" or " users" where is the number of current users logged in.

*\v -- Version of the OS, eg. the build-date etc.

On my machine I have:

This is \n (\s \m \r) \t \l

Which is rendered as:

This is etudes-1 (Linux x86_64 2.6.39-gentoo) 17:43:10 tty1

A: From Ask Ubuntu:

Check the Ask Ubuntu link above for comments and possibly new answers from other users.
now bash script
The heavy lifting is the splash component that shows this:
$ now

Weather report: Edmonton               March 2018            ┌────────────────────────────┐
                                  Su Mo Tu We Th Fr Sa       │   ┏━┓╺┓  ┏━┓┏━┓   ┏━┓┏┳┓   │
     \   /     Sunny                           1  2  3       │   ┃┃┃ ┃ ╹┏━┛┗━┫   ┣━┛┃┃┃   │
      .-.      -23--14 °C          4  5  6  7  8  9 10       │   ┗━┛╺┻╸╹┗━╸┗━┛   ╹  ╹ ╹   │
   ― (   ) ―   ↘ 22 km/h          11 12 13 14 15 16 17       └────────────────────────────┘
      `-'      14 km              18 19 20 21 22 23 24
     /   \     0.9 mm             25 26 27 28 29 30 31

Yes it really is -14 in Edmonton and feels like -23. A good time to spend the long-weekend inside playing the newly arrived Tomb Raider 2013! Maybe brush up on that Resume to move to Vancouver or Montreal...
Here is the code:
#!/bin/bash

# NAME: now
# PATH: $HOME/bin
# DESC: Display current weather, calendar and time
# CALL: Called from terminal or ~/.bashrc
# DATE: Apr 6, 2017. Modified: Mar 30, 2018.

# NOTE: To display all available toilet fonts use this one-liner:
#       for i in ${TOILET_FONT_PATH:=/usr/share/figlet}/*.{t,f}lf; do j=${i##*/}; toilet -d "${i%/*}" -f "$j" "${j%.*}"; done

# Setup for 92 character wide terminal
DateColumn=34 # Default is 27 for 80 character line, 34 for 92 character line
TimeColumn=61 # Default is 49 for   "   "   "   "    61 "   "   "   "

#--------- WEATHER ----------------------------------------------------------

# Current weather, already in color so no need to override
echo " "
# Replace Edmonton with your city name, GPS, etc. See: curl wttr.in/:help
curl wttr.in/Edmonton?0 --silent --max-time 3
# Timeout #. Increase for slow connection---^

echo " "
echo " "                # Pad with blank lines for calendar & time to fit

#--------- DATE -------------------------------------------------------------

# calendar current month with today highlighted.
# colors 00=bright white, 31=red, 32=green, 33=yellow, 34=blue, 35=purple,
#        36=cyan, 37=white

tput sc                 # Save cursor position.
# Move up 9 lines
while [ $((++i)) -lt 10 ]; do tput cuu1; done

# Depending on length of your city name and country name you will:
#   1. Comment out next three lines of code. Uncomment fourth code line.
#   2. Change subtraction value and set number of print spaces to match
#      subtraction value. Then place comment on fourth code line.

Column=$(($DateColumn - 10))
tput cuf $Column        # Move x column number
printf "          "     # Blank out ", country" with x spaces
#tput cuf $DateColumn    # Position to column 27 for date display

# -h needed to turn off formating: https://askubuntu.com/questions/1013954/bash-substring-stringoffsetlength-error/1013960#1013960
cal -h > /tmp/terminal

CalLineCnt=1
Today=$(date +"%d")
# Prefix with space when length < 2
if [[ ${#Today} < 2 ]] ; then
    Today=" "$Today
fi
printf "\033[32m"   # color green -- see list above.

while IFS= read -r Cal; do
    printf "$Cal"
    if [[ $CalLineCnt > 2 ]] ; then
        # See if today is on current line & invert background
        tput cub 22
        for (( j=0 ; j <= 18 ; j += 3 )) ; do
            Test=${Cal:$j:2}            # Current day on calendar line
            if [[ "$Test" == "$Today" ]] ; then
                printf "\033[7m"        # Reverse: [ 7 m
                printf "$Today"
                printf "\033[0m"        # Normal: [ 0 m
                printf "\033[32m"       # color green -- see list above.
                tput cuf 1
            else
                tput cuf 3
            fi
        done
    fi

    tput cud1               # Down one line
    tput cuf $DateColumn    # Move 27 columns right
    CalLineCnt=$((++CalLineCnt))
done < /tmp/terminal

printf "\033[00m"           # color -- bright white (default)
echo ""

tput rc                     # Restore saved cursor position.

#-------- TIME --------------------------------------------------------------

tput sc                 # Save cursor position.
# Move up 9 lines
i=0
while [ $((++i)) -lt 10 ]; do tput cuu1; done
tput cuf $TimeColumn    # Move 49 columns right

# Do we have the toilet package?
if hash toilet 2>/dev/null; then
    echo " "$(date +"%I:%M %P")" " | \
        toilet -f future --filter border > /tmp/terminal
# Do we have the figlet package?
elif hash figlet 2>/dev/null; then
    echo $(date +"%I:%M %P") | figlet > /tmp/terminal
# else use standard font
else
    echo $(date +"%I:%M %P") > /tmp/terminal
fi

while IFS= read -r Time; do
    printf "\033[01;36m"    # color cyan
    printf "$Time"
    tput cud1               # Up one line
    tput cuf $TimeColumn    # Move 49 columns right
done < /tmp/terminal

tput rc                     # Restore saved cursor position.

exit 0

Prerequisites
For the fancy time display you need to install toilet:
sudo apt install toilet

For another fancy time display (but not quite as fancy) install figlet:
sudo apt install figlet

Otherwise the time will be displayed in "normal" font.
Weather
Weather is provided by the curl wttr.in/cityname?0 command. In your terminal use: curl wttr.in/:help for additional details.
Weather: Change city name
You'll want to modify this section of code and change Edmonton to your city name:
# Replace Edmonton with your city name, GPS, etc. See: curl wttr.in/:help
curl wttr.in/Edmonton?0 --silent --max-time 3
# Timeout #. Increase for slow connection---^

Unicode is supported for city names like /Москва (Moscow). Airport letters are supported such as YEG for Edmonton.
Weather: Remove country name
When terminal is set for 92 characters wide, the weather displays as "Edmonton, Canada." which is too long for my liking:

Worse yet when terminal is set for default 80 characters wide:

To circumvent the problem, ", Countryname" is blanked out on the screen with this code:
# Depending on length of your city name and country name you will:
#   1. Comment out next three lines of code. Uncomment fourth code line.
#   2. Change subtraction value and set number of print spaces to match
#      subtraction value. Then place comment on fourth code line.
Column=$(($DateColumn - 10))
tput cuf $Column        # Move x column number
printf "          "     # Blank out ", country" with x spaces
#tput cuf $DateColumn    # Position to column 27 for date display

If you need help with this part of the script please post comment below for assistance.
Terminal screen width adjustments
Adjust the spacing to your terminal screen width by changing:
# Setup for 92 character wide terminal
DateColumn=34 # Default is 27 for 80 character line, 34 for 92 character line
TimeColumn=61 # Default is 49 for   "   "   "   "    61 "   "   "   "

Tying it all together in ~/.bashrc
Edit your ~/.bashrc file and add these lines to the bottom:
# Splash Calendar and time
now

# ASCII Linux distribution display
screenfetch

Save the `~/.bashrc" file changes.
To display the Ubuntu information you need screenfetch:
sudo apt install screenfetch

There are similar display packages to screenfetch so shop around!
If you want the same command prompt with "─────────" dividing line between commands, change these lines:
if [ "$color_prompt" = yes ]; then
    PS1='───────────────────────────────────────────────────────────────────────────────────────────
${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='───────────────────────────────────────────────────────────────────────────────────────────
${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

Note the length of the separator line coincides with width of screenfetch output. In this case it is 92 characters wide and gnome-terminal preferences are set accordingly.

A: The OP clearly is asking about messages displayed AFTER log in, all "/etc/issue" are displayed BEFORE login+password is entered so are off-topic.
The 'login shell' steps are:

*

*show messages contained in /etc/issue

*ask for user and password

*show Message Of The Day from:
/etc/motd
/etc/update-motd.d

*start /etc/profile and ~/.bash_profile
NB .bashrc is executed for NON-login shell
@Naftuli Kay add your ASCII art to /etc/motd you can also put a script in /etc/update-motd.d; for user independent prints the script can go in /etc/profile. ~/.bash_profile for single user prints

A: You can also configure the ssh daemon to display a message during login. Specify the file to display with the Banner directive in the sshd_config file:
Banner /etc/ssh/ssh_banner

The filename can be any file, but for sanity I keep it in /etc/ssh along with the sshd_config file.

A: One little script to generate the /etc/issue with network address in /etc/rc.local of debian host.
/bin/echo "This is \n(\s \m \r) \t \l">/etc/issue
/bin/sleep 10 # This is optional, sometimes OS need more time to get ip address while DHCP, otherwise maybe you will get nothing :(
/sbin/ip a| /bin/grep inet| /bin/grep -v -E "inet6|127.0.0.1"| /bin/sed "s/\s*//"|/bin/sed "s/\/24.*//" >>/etc/issue

update:
sounds it's enough with "ip -4 -br a"
thanks @Mathieu CAROFF !

A: IMPORTANT for use this ssh Banner:
Day Highlighting only works with "ncal -bh > /tmp/terminal" instead of cal -h.
cal -h doesnt work/exist anymore (Ubuntu 18.04)


text:
Q: I am using ExistsAsync to check whether the CloudBlockBlob is exists but it is taking too much time foreach(var lst in list)
{
    CloudBlobDirectory dira = container.GetDirectoryReference(folderName + "/" + prefix);
    bool isExists = dira.GetBlockBlobReference(filename + ".png").ExistsAsync().Result;

    if(isExists)
    {
        // create sas url using cloud block url
    }
}

I am using this code to check if blob exists for each path But ExistsAsync() is taking too much time.
I have also tried GetBlobClient in loop but it was also taking time.
Is there any other way to check if blockblob is exists
I am using the latest version(12) of Azure.Storage.Blobs

A: It´s not entierly clear what OP wants to do. One naive way to try and make Blob queries faster is to execute multiple in parallel.
Note that this example actually uses Azure.Storage.Blobs, while op seems to be using Windows.Azure.Storage despite stating otherwise.
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Specialized;

var blobClient = new BlobServiceClient("<connection string>");
var container = blobClient.GetBlobContainerClient("<container name>");

// However your list looks like, Im assuming it´s partial or full paths in blob
var potentialBlobs = new List<string>() { "<some>/<blob>/<path>" };

// Amount to execute in parallel at a time, depends on your system which value will yield better results.
// Could be calculated based on Environment.ProcessorCount too (note that this can return 0 or negative values sometimes, so you have to check)
const int chunkSize = 4;
var existingBlobs = new List<string>();

foreach (var chunk in potentialBlobs.Chunk(chunkSize))
{
    // Create multiple tasks
    var tasks = chunk.Select(async path => // potentialBlobs list item
    {
        var exists = await container
            .GetBlockBlobClient(path) // adjust path however needed, I don´t understand what OP wants here
            .ExistsAsync();
        return exists ? path : null;
    });

    // Wait for tasks to finish
    var results = await Task.WhenAll(tasks);

    // Append to result list
    foreach (var cur in results)
    {
        if (cur is not null)
            existingBlobs.Add(cur);
    }
}

There does not seem to be an Exists method available in the BatchClient of Azure.Storage.Blobs.Batch. As far as Im aware of it´s only mostly for adding, updating or deleting blobs not to check for their existence. So I think it is not viable for this scenario, but I might have missed something.

If you cannot get acceptable performance this way you´ll have to store blob paths in something like table storage or cosmosdb that is faster to query against. Depending on what you need you might also be able to cache the result or store the result somewhere and continuously update it as new blobs get added.


text:
Q: vb.net to c# help Hi
  I have a working very small vb.net project however it uses a proprietary com object which is wired in the VB project to handle events from it!
I have changed the name of the com object but syntactical the the following code is correct:
Public Class Form1
Private WithEvents PM As comObj.PManager
Delegate Sub SetTextCallback([text] As String)

Private Function PreTransmit(ByVal s As String) As String Handles PM.PreTransmit
    Me.SetText(s)
    Return s
End Function

Private Function PreResponse(ByVal s As String) As String Handles PM.PreResponse
    Return s
End Function
Private Sub SetText(ByVal [text] As String)

    If Me.textBox1.InvokeRequired Then
        Dim d As New SetTextCallback(AddressOf SetText)
        Me.Invoke(d, New Object() {[text]})
    Else
        Me.textBox1.Text = [text]
    End If
End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    PM = CreateObject("ObjName.PManager")
End Sub
End Class

The above code creates the object when the button is clicked and whenever the object gets data it raises an event passing data into either pretransmit or prereceive.
I just cant seem to work out how to do this c#
vb
Private WithEvents PM As comObj.PManager

c#
private comObj.PManager PM;

but what about the WithEvents?
vb
Private Function PreResponse(ByVal s As String) As String Handles PM.PreResponse
        Return s
End Function

c#
private string PreResponse(string s)
{
    return s;
}

but what about the Handles PM.PreResponse?
vb
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        PM = CreateObject("ObjName.PManager")
End Sub

c#
private void Button1_Click(System.Object sender, System.EventArgs e)
{
    PM = Interaction.CreateObject("ObjName.PManager");
}

not sure were i'm going wrong!?
Could I write a vb.net class and use it in c#?

A: VB.NET's WithEvents keyword does not have an analog in C#. IIRC, VB.NET turns all WithEvents variables into properties, then in the setter it attaches/detaches the event handlers explicitly like you'd see in C#.
Since C# does not have this feature, you'll have to keep track of this yourself. Since you're creating the object explicitly, this shouldn't be difficult to do. All you'll have to do for each event that you want to handle is:
PM.EventName += new EventHandlerType(EventHandlerMethodName);

In most cases, EventHandlerType can be inferred by the compiler, so you don't need to include it. This means your code can turn into:
PM.PreResponse += this.PreResponse

A: C# does not have the handles syntax.
You can hook up your events in code (in FormLoaded):
 PM.PreResponse += this.PreResponse;

A: WithEvents is a given in C#. It is not necessary as a special consideration as it is in VB.Net. To add the handles for the PreResponse, in your load or init event (depending on if you're using asp.net or winforms), you need to add the event handler
PM.Response += PreResponse;

EDIT: To appease @Adam Robinson's semantic needs (rightly so since we live in a semantic world).
WithEvents gives the developer access to the Handles keyword. This structure in fact does not exist in C# because event handling is only handled one way and that is with the explicit definition of the delegate (which is also available in VB.Net without the WithEvents keyword).

A: but what about the Handles PM.PreResponse?
PM.PreResponse += PreResponse;

private void Button1_Click ...
PM = CreateObject("ObjName.PManager")

is the same as
PM = new comObj.PManager();


text:
Q: Error with ODBC Driver I've been using this for quite a while, and I recently changed hostings. when I used the script, it says

ERROR [42000] [MySQL][ODBC 3.51 Driver][mysqld-5.1.68-community]  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 '' at line
  1

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [42000]
  [MySQL][ODBC 3.51 Driver][mysqld-5.1.68-community]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 '' at line 1
Source Error:
Line 16:         connectme.Open() Line 17:         Dim ODBCdataadapter
  As OdbcDataAdapter = New OdbcDataAdapter(sqlquery, connectme) Line 18:
  ODBCdataadapter.Fill(ODBCdataset, "table") Line 19:
  connectme.Close()

What went wrong?
Comment code
Dim connectionstring As String = ConfigurationManager.ConnectionStrings("DBstring").ConnectionString
Dim connectme As OdbcConnection = New OdbcConnection(connectionstring)
Dim ODBCdataset As DataSet = New DataSet()
Dim sqlquery As String = "SELECT * FROM table WHERE fno = " & Request.QueryString("id")
connectme.Open()
Dim ODBCdataadapter As OdbcDataAdapter = New OdbcDataAdapter(sqlquery, connectme)
ODBCdataadapter.Fill(ODBCdataset, "tkhstock") connectme.Close()

A: Assuming that your fno is varchar you should be using as below
 Dim sqlquery As String = "SELECT * FROM table WHERE fno = '" &
                           Request.QueryString("id") & "'"

Parametrize Command Example

*

*How do I create a parameterized SQL query? Why Should I?

*http://aspsnippets.com/Articles/Using-Parameterized-queries-to-prevent-SQL-Injection-Attacks-in-SQL-Server.aspx


text:
Q: Sequelize select fields are all null after null as a alias A simple example, I have a select sql:
select
    t.id,
    t.name,
    null as grade
    t.class,
    t.no
from table t
and I execute this sql by sequelize.query(), the result of it returned is wrong:
all the field after grade like class is null.
But I move these fields above the grade, I can get the real value of these fields by sequelize.query()

A: Check your relation definition ex:
Model.hasOne(db.RelatedModel, {
  as: 'namedAlias',
  foreignKey: 'id' // <- Make sure you add the relation id as the foreign key
})


text:
Q: Err: A component is changing the uncontrolled value state of Autocomplete to be controlled I have this autocomplete field which functions as an employee search.  When I load a pre existing document, I cannot display an employee name in the field.  I get the error message A component is changing the uncontrolled value state of Autocomplete to be controlled. How can this be fixed?
const { onChange, badge, taxonomyid, label, id, style } = props;
const [employees, setemployees] = useState([]);
const onNameChange = async (e) => {
    e.preventDefault();
    var value = e.target.value;
    var url = `/api/employeesearch?taxonomyid=${taxonomyid}`;
    if (value) {
        url = url + `&search=${value}`;
        const resp = await fetch(url);
        const emp = await resp.json();
        if (resp.ok) {
            setemployees(emp);
        } else {
            return [];
        }
        console.log(value);
    }
};

const onBadgeChange = (e, value) => {
    e.preventDefault();
    onChange(e, value);
};
...
<Autocomplete
    value={employees.employees.Name}
    inputValue={employees.employees.Name}
    onChange={(e, value) => onBadgeChange(e, value)}
    onInputChange={(e) => onNameChange(e)}
    options={employees.employees}
    getOptionLabel={(option, i) => option.Name}
    filterOptions={(x) => x}
    id={id || "Person"}
    renderInput={(params) => <TextField {...params} id={id || "Person"} label={label} variant="outlined" />}
/>


text:
Q: Consulta Firebase. Android Tengo una duda respecto a Firebase con Android
Realizo la consulta obteniendo un string con el siguiente resultado:
String S= "{Centro 1={Wifi=458pohh875, Freedns=centrouno.mooo.com, Webkey=h64792390hyd}, Centro 2={Wifi=2910393, Freedns=centrodos.mooo.com, Webkey=jugi8jk9jk}}"

Cual seria la manera mas sencilla de pasar esos datos a una listview con un adaptador personalizado? he visto varias pero se me hacen un poco complicadas de aplicar ya que apenas empiezo con la programación..
como podría convertir esos datos a formato JSON?

A: La manera mas sencilla de usar firebase con un ListView es usando una libreria que se llama FirebaseUI
Te dejo un breve ejemplo extraido del sitio de la libreria.
ListView messagesView = (ListView) findViewById(R.id.messages_list);
DatabaseReference ref = FirebaseDatabase.getInstance().getReference();
mAdapter = new FirebaseListAdapter<Chat>(this, Chat.class, android.R.layout.two_line_list_item, ref) {
    @Override
    protected void populateView(View view, Chat chatMessage, int position) {
        ((TextView) view.findViewById(android.R.id.text1)).setText(chatMessage.getName());
        ((TextView) view.findViewById(android.R.id.text2)).setText(chatMessage.getText());

    }
};
messagesView.setAdapter(mAdapter);

Esa librería la mantiene la misma gente de Firebase y la podes usar tanto para ListView como para RecycleView.

A: Yo recomendaría el uso de algún ORM, para evitar tener que deserializar, y así tendrías todo en objetos Java, te recomiendo sugar ORM, es fácil entenderlo e implementarlo, y tu codigo estará mucho mejor organizado.
http://satyan.github.io/sugar/
Una vez teniendo la información de las tablas en Objetos Java, ya solo los utilizas en el componente android de tu agrado.
Saludos


text:
Q: Converting a large SQL Server database to MySQL. Database corruption? Can't access data after transferring I have gigabytes of tabular data stored in a SQL Server database. I've been trying to migrate it to MySQL using the Migration Toolkit from Oracle. I didn't have any mapping errors and fixed all the syntax mismatches, so now the rows are being transferred. But when I go to PHPMyAdmin and try to browse, it keeps saying MySQL returned an empty result set (i.e. zero rows). ( Query took 17.0116 sec ) although it says there are 44,546,089 rows in that table, and I can see the hard drive space filling up too. I just can't access any of the data.
I researched a bit and increased the buffer size from 16M to 160M in my.conf. But I can't fix this problem.

Some things I noticed (red marked in the status page):
Innodb_buffer_pool_pages_dirty: 376
Innodb_buffer_pool_reads = 92 k
Handler_read_rnd = 41
Handler_read_rnd_next = 59 k

Any advice? This database will be read-only. Also the server specs:  dedicated, 8GB RAM, Debian 6, 500GB HDD, ~2.8GHz Quadcore Intel

A: As you have a dedicated server, there is no reason not to use native MySQL command to issue queries directly. Avoiding phpMyAdmin means avoiding one more layer between you and database while trying to figure out what went wrong.
My first thought is - are you actually trying "select * from table" on a 45 million row table? That could cause all kinds of problems.
1) Try "select count(*) from table" first. See if you get 0 or 45M.
2) See if partition with your data is large enough. Yes, this kind of omission happens.
3) Try using MyISAM instead of InnoDB to reveal possible server misconfiguration issue.
Perhaps it makes sense to use our battle-proven commercial database migration tool Full Convert Enterprise for your data conversion? It runs on Windows only, though. Quickest path


text:
Q: how to append a  to a form element selected in JQuery? Some introduction:
I'm creating a form in Django.
In my template I'm trying to select the final element of that form and attach a
 html element to help clean up the visual clutter.
I've tried selecting the Forms ID and inserting adjacenthtml as well as appending raw html. I have also tried passing raw html into bootstrap in my form but this has also failed to render.
tldr; I am trying to append a
 element to something I am targeting in Jquery
function addHoriztonalRule() {
            document.getElementById("form").insertAdjacentHTML(
                "
");
        }

A: With jquery you can use this:

function addHoriztonalRule() {
    $('#form').after("
");
}

addHoriztonalRule();

<form id="form">
  <input type="text" value="hi" >
</form>

However, it is better to share the structure of the page to learn more from DOM and how to call the function to better guide

A: You failed to add the position of where you wish to place the HTML in relation to the element.
MDN: A DOMString representing the position relative to the element; must be one of the following strings:

*

*'beforebegin': Before the element itself.

*'afterbegin': Just inside the element, before its first child.

*'beforeend': Just inside the element, after its last child.

*'afterend': After the element itself.

function addHoriztonalRule() {
  document.getElementById("form").insertAdjacentHTML('afterend', '
');
}
addHoriztonalRule()
<form id="form" method="post">
  <input type="button" value="button">
</form>


text:
Q: Error starting SpringBoot Application in Intellij IDEA I found the similar questions on stackoverflow and tried to sovle the problem using this way (LINK),but it didn't work on my project.Could anybody give me some suggestions?
/usr/lib/jvm/java-8-oracle/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:44549,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dfile.encoding=UTF-8 -classpath /usr/lib/jvm/java-8-oracle/jre/lib/charsets.jar:/usr/lib/jvm/java-8-oracle/jre/lib/deploy.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/dnsns.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jaccess.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/jfxrt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/nashorn.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunec.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/sunpkcs11.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-8-oracle/jre/lib/javaws.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfxswt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar:/usr/lib/jvm/java-8-oracle/jre/lib/management-agent.jar:/usr/lib/jvm/java-8-oracle/jre/lib/plugin.jar:/usr/lib/jvm/java-8-oracle/jre/lib/resources.jar:/usr/lib/jvm/java-8-oracle/jre/lib/rt.jar:/home/hand/IdeaProjects/spring-boot/spring-boot-dynamic-scheduled-task/target/classes:/home/hand/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.4.1.RELEASE/spring-boot-starter-web-1.4.1.RELEASE.jar:/home/hand/.m2/repository/org/springframework/boot/spring-boot-starter/1.4.1.RELEASE/spring-boot-starter-1.4.1.RELEASE.jar:/home/hand/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.4.1.RELEASE/spring-boot-starter-logging-1.4.1.RELEASE.jar:/home/hand/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar:/home/hand/.m2/repository/ch/qos/logback/logback-core/1.1.7/logback-core-1.1.7.jar:/home/hand/.m2/repository/org/slf4j/jul-to-slf4j/1.7.21/jul-to-slf4j-1.7.21.jar:/home/hand/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.21/log4j-over-slf4j-1.7.21.jar:/home/hand/.m2/repository/org/yaml/snakeyaml/1.17/snakeyaml-1.17.jar:/home/hand/.m2/repository/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar:/home/hand/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar:/home/hand/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar:/home/hand/.m2/repository/com/fasterxml/classmate/1.3.1/classmate-1.3.1.jar:/home/hand/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.3/jackson-databind-2.8.3.jar:/home/hand/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.3/jackson-annotations-2.8.3.jar:/home/hand/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.3/jackson-core-2.8.3.jar:/home/hand/.m2/repository/org/springframework/spring-web/4.3.3.RELEASE/spring-web-4.3.3.RELEASE.jar:/home/hand/.m2/repository/org/springframework/spring-aop/4.3.3.RELEASE/spring-aop-4.3.3.RELEASE.jar:/home/hand/.m2/repository/org/springframework/spring-beans/4.3.3.RELEASE/spring-beans-4.3.3.RELEASE.jar:/home/hand/.m2/repository/org/springframework/spring-context/4.3.3.RELEASE/spring-context-4.3.3.RELEASE.jar:/home/hand/.m2/repository/org/springframework/spring-webmvc/4.3.3.RELEASE/spring-webmvc-4.3.3.RELEASE.jar:/home/hand/.m2/repository/org/springframework/spring-expression/4.3.3.RELEASE/spring-expression-4.3.3.RELEASE.jar:/home/hand/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/1.4.1.RELEASE/spring-boot-starter-data-jpa-1.4.1.RELEASE.jar:/home/hand/.m2/repository/org/springframework/boot/spring-boot-starter-aop/1.4.1.RELEASE/spring-boot-starter-aop-1.4.1.RELEASE.jar:/home/hand/.m2/repository/org/aspectj/aspectjweaver/1.8.9/aspectjweaver-1.8.9.jar:/home/hand/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/1.4.1.RELEASE/spring-boot-starter-jdbc-1.4.1.RELEASE.jar:/home/hand/.m2/repository/org/apache/tomcat/tomcat-jdbc/8.5.5/tomcat-jdbc-8.5.5.jar:/home/hand/.m2/repository/org/apache/tomcat/tomcat-juli/8.5.5/tomcat-juli-8.5.5.jar:/home/hand/.m2/repository/org/springframework/spring-jdbc/4.3.3.RELEASE/spring-jdbc-4.3.3.RELEASE.jar:/home/hand/.m2/repository/org/hibernate/hibernate-core/5.0.11.Final/hibernate-core-5.0.11.Final.jar:/home/hand/.m2/repository/org/hibernate/javax/persistence/hibernate-jpa-2.1-api/1.0.0.Final/hibernate-jpa-2.1-api-1.0.0.Final.jar:/home/hand/.m2/repository/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.jar:/home/hand/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar:/home/hand/.m2/repository/org/jboss/jandex/2.0.0.Final/jandex-2.0.0.Final.jar:/home/hand/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar:/home/hand/.m2/repository/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar:/home/hand/.m2/repository/org/hibernate/common/hibernate-commons-annotations/5.0.1.Final/hibernate-commons-annotations-5.0.1.Final.jar:/home/hand/.m2/repository/org/hibernate/hibernate-entitymanager/5.0.11.Final/hibernate-entitymanager-5.0.11.Final.jar:/home/hand/.m2/repository/javax/transaction/javax.transaction-api/1.2/javax.transaction-api-1.2.jar:/home/hand/.m2/repository/org/springframework/data/spring-data-jpa/1.10.3.RELEASE/spring-data-jpa-1.10.3.RELEASE.jar:/home/hand/.m2/repository/org/springframework/data/spring-data-commons/1.12.3.RELEASE/spring-data-commons-1.12.3.RELEASE.jar:/home/hand/.m2/repository/org/springframework/spring-orm/4.3.3.RELEASE/spring-orm-4.3.3.RELEASE.jar:/home/hand/.m2/repository/org/springframework/spring-tx/4.3.3.RELEASE/spring-tx-4.3.3.RELEASE.jar:/home/hand/.m2/repository/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar:/home/hand/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.21/jcl-over-slf4j-1.7.21.jar:/home/hand/.m2/repository/org/springframework/spring-aspects/4.3.3.RELEASE/spring-aspects-4.3.3.RELEASE.jar:/home/hand/.m2/repository/com/h2database/h2/1.4.192/h2-1.4.192.jar:/home/hand/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.5.5/tomcat-embed-core-8.5.5.jar:/home/hand/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.5.5/tomcat-embed-el-8.5.5.jar:/home/hand/.m2/repository/org/apache/tomcat/embed/tomcat-embed-jasper/8.5.5/tomcat-embed-jasper-8.5.5.jar:/home/hand/.m2/repository/org/eclipse/jdt/core/compiler/ecj/4.5.1/ecj-4.5.1.jar:/home/hand/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar:/home/hand/.m2/repository/javax/servlet/jstl/1.2/jstl-1.2.jar:/home/hand/.m2/repository/org/springframework/boot/spring-boot-devtools/1.4.1.RELEASE/spring-boot-devtools-1.4.1.RELEASE.jar:/home/hand/.m2/repository/org/springframework/boot/spring-boot/1.4.1.RELEASE/spring-boot-1.4.1.RELEASE.jar:/home/hand/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.4.1.RELEASE/spring-boot-autoconfigure-1.4.1.RELEASE.jar:/home/hand/.m2/repository/org/springframework/spring-core/4.3.3.RELEASE/spring-core-4.3.3.RELEASE.jar:/home/hand/下载/idea-IU-171.4424.56/lib/idea_rt.jar com.jege.spring.boot.Application
Connected to the target VM, address: '127.0.0.1:44549', transport: 'socket'

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v1.4.1.RELEASE)

2017-05-21 23:03:43.754  INFO 20877 --- [  restartedMain] com.jege.spring.boot.Application         : Starting Application on hand-VirtualBox with PID 20877 (/home/hand/IdeaProjects/spring-boot/spring-boot-dynamic-scheduled-task/target/classes started by hand in /home/hand/IdeaProjects/spring-boot)
2017-05-21 23:03:43.779  INFO 20877 --- [  restartedMain] com.jege.spring.boot.Application         : No active profile set, falling back to default profiles: default
2017-05-21 23:03:44.100  INFO 20877 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@295b2c2e: startup date [Sun May 21 23:03:44 CST 2017]; root of context hierarchy
2017-05-21 23:03:48.822  INFO 20877 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [class org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$f84fc15b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2017-05-21 23:03:50.745  INFO 20877 --- [  restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 8080 (http)
2017-05-21 23:03:50.794  INFO 20877 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service Tomcat
2017-05-21 23:03:50.801  INFO 20877 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.5
2017-05-21 23:03:51.512  INFO 20877 --- [ost-startStop-1] org.apache.jasper.servlet.TldScanner     : At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
2017-05-21 23:03:51.527  INFO 20877 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2017-05-21 23:03:51.528  INFO 20877 --- [ost-startStop-1] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 7448 ms
2017-05-21 23:03:52.077  INFO 20877 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'dispatcherServlet' to [/]
2017-05-21 23:03:52.080  INFO 20877 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean  : Mapping servlet: 'webServlet' to [/h2-console/*]
2017-05-21 23:03:52.085  INFO 20877 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2017-05-21 23:03:52.086  INFO 20877 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2017-05-21 23:03:52.087  INFO 20877 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2017-05-21 23:03:52.088  INFO 20877 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2017-05-21 23:03:52.671  INFO 20877 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2017-05-21 23:03:52.719  INFO 20877 --- [  restartedMain] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [
    name: default
    ...]
2017-05-21 23:03:52.900  INFO 20877 --- [  restartedMain] org.hibernate.Version                    : HHH000412: Hibernate Core {5.0.11.Final}
2017-05-21 23:03:52.905  INFO 20877 --- [  restartedMain] org.hibernate.cfg.Environment            : HHH000206: hibernate.properties not found
2017-05-21 23:03:52.911  INFO 20877 --- [  restartedMain] org.hibernate.cfg.Environment            : HHH000021: Bytecode provider name : javassist
2017-05-21 23:03:53.042  INFO 20877 --- [  restartedMain] o.hibernate.annotations.common.Version   : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2017-05-21 23:03:53.728  INFO 20877 --- [  restartedMain] org.hibernate.dialect.Dialect            : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2017-05-21 23:03:55.213  INFO 20877 --- [  restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000227: Running hbm2ddl schema export
Hibernate: drop table t_user if exists
Hibernate: create table t_user (id bigint generated by default as identity, age integer, name varchar(255), primary key (id))
2017-05-21 23:03:55.243  INFO 20877 --- [  restartedMain] org.hibernate.tool.hbm2ddl.SchemaExport  : HHH000230: Schema export complete
2017-05-21 23:03:55.306  INFO 20877 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2017-05-21 23:03:56.822  INFO 20877 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerAdapter : Looking for @ControllerAdvice: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@295b2c2e: startup date [Sun May 21 23:03:44 CST 2017]; root of context hierarchy
2017-05-21 23:03:56.954  INFO 20877 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/user/json]}" onto public java.util.Map<java.lang.String, java.lang.Object> com.jege.spring.boot.controller.UserController.json(int,int,java.lang.String)
2017-05-21 23:03:56.956  INFO 20877 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/user/updateDynamicScheduledTask]}" onto public com.jege.spring.boot.json.AjaxResult com.jege.spring.boot.controller.UserController.updateDynamicScheduledTask()
2017-05-21 23:03:56.957  INFO 20877 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/user/delete]}" onto public com.jege.spring.boot.json.AjaxResult com.jege.spring.boot.controller.UserController.delete(java.lang.Long)
2017-05-21 23:03:56.957  INFO 20877 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/user/list]}" onto public java.lang.String com.jege.spring.boot.controller.UserController.list()
2017-05-21 23:03:56.957  INFO 20877 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/user/save]}" onto public com.jege.spring.boot.json.AjaxResult com.jege.spring.boot.controller.UserController.save(com.jege.spring.boot.data.jpa.entity.User)
2017-05-21 23:03:56.961  INFO 20877 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
2017-05-21 23:03:56.962  INFO 20877 --- [  restartedMain] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2017-05-21 23:03:57.053  INFO 20877 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/webjars/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-05-21 23:03:57.064  INFO 20877 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-05-21 23:03:57.181  INFO 20877 --- [  restartedMain] .m.m.a.ExceptionHandlerExceptionResolver : Detected @ExceptionHandler methods in commonExceptionAdvice
2017-05-21 23:03:57.238  INFO 20877 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/**/favicon.ico] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
2017-05-21 23:03:57.960  WARN 20877 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'classPathFileSystemWatcher' defined in class path resource [org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration$RestartConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher]: Factory method 'classPathFileSystemWatcher' threw exception; nested exception is java.lang.IllegalArgumentException: Folder '/home/hand/IdeaProjects/spring-boot/src/main/java' must exist and must be a directory
2017-05-21 23:03:57.961  INFO 20877 --- [  restartedMain] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown
2017-05-21 23:03:57.964  INFO 20877 --- [  restartedMain] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2017-05-21 23:03:58.008  INFO 20877 --- [  restartedMain] o.apache.catalina.core.StandardService   : Stopping service Tomcat
2017-05-21 23:03:58.052  INFO 20877 --- [  restartedMain] utoConfigurationReportLoggingInitializer :

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-05-21 23:03:58.082 ERROR 20877 --- [  restartedMain] o.s.boot.SpringApplication               : Application startup failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'classPathFileSystemWatcher' defined in class path resource [org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfiguration$RestartConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher]: Factory method 'classPathFileSystemWatcher' threw exception; nested exception is java.lang.IllegalArgumentException: Folder '/home/hand/IdeaProjects/spring-boot/src/main/java' must exist and must be a directory
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1128) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1023) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:751) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:861) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541) ~[spring-context-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:761) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:371) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175) [spring-boot-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at com.jege.spring.boot.Application.main(Application.java:18) [classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [spring-boot-devtools-1.4.1.RELEASE.jar:1.4.1.RELEASE]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher]: Factory method 'classPathFileSystemWatcher' threw exception; nested exception is java.lang.IllegalArgumentException: Folder '/home/hand/IdeaProjects/spring-boot/src/main/java' must exist and must be a directory
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    ... 23 common frames omitted
Caused by: java.lang.IllegalArgumentException: Folder '/home/hand/IdeaProjects/spring-boot/src/main/java' must exist and must be a directory
    at org.springframework.util.Assert.isTrue(Assert.java:68) ~[spring-core-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    at org.springframework.boot.devtools.filewatch.FileSystemWatcher.addSourceFolder(FileSystemWatcher.java:124) ~[spring-boot-devtools-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.devtools.autoconfigure.LocalDevToolsAutoConfiguration$RestartConfiguration.newFileSystemWatcher(LocalDevToolsAutoConfiguration.java:159) ~[spring-boot-devtools-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.devtools.autoconfigure.LocalDevToolsAutoConfiguration$RestartConfiguration.access$000(LocalDevToolsAutoConfiguration.java:101) ~[spring-boot-devtools-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.devtools.autoconfigure.LocalDevToolsAutoConfiguration$RestartConfiguration$1.getFileSystemWatcher(LocalDevToolsAutoConfiguration.java:142) ~[spring-boot-devtools-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher.<init>(ClassPathFileSystemWatcher.java:61) ~[spring-boot-devtools-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at org.springframework.boot.devtools.autoconfigure.LocalDevToolsAutoConfiguration$RestartConfiguration.classPathFileSystemWatcher(LocalDevToolsAutoConfiguration.java:119) ~[spring-boot-devtools-1.4.1.RELEASE.jar:1.4.1.RELEASE]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.3.RELEASE.jar:4.3.3.RELEASE]
    ... 24 common frames omitted

Disconnected from the target VM, address: '127.0.0.1:44549', transport: 'socket'

Process finished with exit code 0

pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.jege.spring.boot</groupId>
    <artifactId>spring-boot-dynamic-scheduled-task</artifactId>
    <version>1.0.0.RELEASE</version>
    <packaging>jar</packaging>

    <name>spring-boot-dynamic-scheduled-task</name>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.1.RELEASE</version>
        <relativePath />
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.8</java.version>
    </properties>

    <dependencies>

        <!-- web -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <!--<scope>provided</scope>-->
        </dependency>

        <!-- servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <!--<scope>provided</scope>-->
        </dependency>
        <!-- jstl -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <finalName>spring-boot-dynamic-scheduled-task</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

application.properties
## JPA Settings
spring.jpa.generate-ddl: true
spring.jpa.show-sql: true
spring.jpa.hibernate.ddl-auto: create
spring.jpa.properties.hibernate.format_sql: false

#spring.datasource.url=jdbc:mysql:///test
#spring.datasource.username=root
#spring.datasource.password=root
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver

spring.mvc.view.prefix=/WEB-INF/page/
spring.mvc.view.suffix=.jsp

#restart
spring.devtools.restart.additional-paths=src/main/java
#no need restart
#spring.devtools.restart.exclude=static/**,public/**

A: It was caused by you configured the devtools to auto restart the application spring.devtools.restart.additional-paths=src/main/java.
if use the button to start application, you need to config the "Working directory" point to the correct project directory.


text:
Q: Watch expression in dartium 36 cannot traverse List I cannot see a list of values in class List of dart code in Watch Expression panel of dartium 36 dev tools. Shown
[[class]]: List
==: bool operator ...
etc.
Is there any way to traverse list? I can write list[0], list1 etc., but it is terrible solution.
There is javascript Array view at the top of image and dartium List view behind.


text:
Q: AngularJS+Bootstrap-UI: Enable tooltip on button when button is disabled Please see my jsfiddle code here
http://jsfiddle.net/695qtssv/2/
How can I get the button to display the tooltip while its disabled?
html

              <button ng-disabled="isDisabled(item.name)" class="btn btn-primary" ng-click="select(item)">{{item.name}}</button>

JS:
var myApp = angular.module('myApp', ['ui.bootstrap']);

function MyCtrl($scope) {
    $scope.myModel = "Tooltip only works when input is enabled.";
    $scope.isDisabled = false;

}

I have tried using the tooltip on a div that wraps the button but still had no luck as shown in the example.
This tooltip works with  but I cannot use that in the app that I am working on.
Any help would be greatly appreciated.

A: I think disabled elements does not not fire mouse events.
See Event on a disabled input
Based on above link I offer this kind of solution:

    <button ng-disabled="isDisabled(item.name)" class="btn btn-primary" ng-click="select(item)">{{item.name}}</button>

Fiddle: http://jsfiddle.net/695qtssv/3/

A: Basically it is not possible to directly set the tooltip of the input element and show it when it is disabled. This is because there are no events fired from the browser on disabled input. This is discribed in this issue.
However you are on the right way. You have to wrap the input element. I have this solution from the issue above.

var myApp = angular.module('myApp', ['ui.bootstrap']);

function MyCtrl($scope) {
    $scope.myModel = "Tooltip only works when input is enabled.";
    $scope.isDisabled = false;

}
.layer-mask {
     position: relative;
}
.layer {
    position: absolute;
    top: 0;
    left:0;
    right:0;
    bottom:0;
}
.layer-mask button[disabled] {
    position: relative;
    z-index: -1;
}

<link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" />

                <button class="input-xxlarge" ng-disabled="isDisabled" ng-model="myModel">
                    My disabled button
                </button>

        Disable/Enable <input type="checkbox" ng-model="isDisabled"/>


text:
Q: unable to locate elements in chrome page using selenium python this is the HTML code:

this is my code:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
timeout = 20
driver = webdriver.Chrome()
driver.get('http://polarionprod1.delphiauto.net/polarion/#/project/10032024_MY21_FORD_PODS_SDPS_P702/wiki/10_Testing/SysTs_ATR')
wait = WebDriverWait(driver, 10)
men_menu=0
while(men_menu==0):
    try:
        men_menu=WebDriverWait(driver,
        timeout).until(EC.element_to_be_clickable((By.CSS_SELECTOR,'#polarion_type_icon')))
        print(men_menu)
    except TimeoutException:
        if(men_menu==0):
            print(men_menu)
            continue
        else:
            men_menu.click()
            break

i have used try and except in loop since the web page I am dealing with takes a lot of time to load.When i run the code the code seems to be always in try block where I am printing the value men_menu to see if the element is located. But it always prints 0. So that's how i confirmed the element is not getting located


text:
Q: WPF draggable and clickable button I have a borderless, transparent Window with only one Button.
My fancy button looks like this
The expected behaviour is:

*

*When I click and drag the Button, the Button must follow the cursor.

*When I only click on the Button, the MouseDown, PreviewMouseDown events or Command binding should raise.

At first I tried to call the DragMove() on PreviewMouseDown event, but that blocks the click events. Now my idea is: I set a 100ms delay after mouse down. If the time passed, than the button wil be dragging, otherwise it was just a click.
Code
private bool _dragging;
private Point startpos;
CancellationTokenSource cancellation;

private void Button_PreviewMouseMove(object sender, MouseEventArgs e)
{
    if (_dragging && e.LeftButton == MouseButtonState.Pressed)
    {
        var currentpos = e.GetPosition(this);
        Left += currentpos.X - startpos.X;
        Top += currentpos.Y - startpos.Y;
    }
}

private async void Button_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
    if (e.ChangedButton != MouseButton.Left)
        return;

    _dragging = false;
    startpos = e.GetPosition(this);

    cancellation?.Cancel();
    cancellation = new CancellationTokenSource();

    await Task.Delay(100, cancellation.Token).ContinueWith(task =>
    {
        _dragging = !task.IsCanceled;
    });
}

private void Button_PreviewMouseUp(object sender, MouseButtonEventArgs e)
{
    if (_dragging)
    {
        _dragging = false;
        e.Handled = true;
    }

    cancellation?.Cancel();
}

Basically it works, but has some bugs:

*

*When I hold down the mouse button for longer time and release, then the click won't work, because after 100ms the dragging will be active.

*After I dragged the button, and click anywhere outside the Button and Window control, the PreviewMouseDown and PreviewMouseUp events are raised. I don't know why??

Does somebody have any better solution?

A: For your first problem:
You must handle the case when your button is pushed down but not moved. I think a better way to do this (instead of the 100ms delay) would be to specify a minimum threshold of movement above which the dragging will start.
You could do it like this:
private const double _dragThreshold = 1.0;
private bool _dragging;
private Point startpos;
CancellationTokenSource cancellation;

private void Button_PreviewMouseMove(object sender, MouseEventArgs e)
{
    var currentpos = e.GetPosition(this);
    var delta = currentpos - startpos;
    if ((delta.Length > _dragThreshold || _dragging) && e.LeftButton == MouseButtonState.Pressed)
    {
        _dragging = true;
        Left += currentpos.X - startpos.X;
        Top += currentpos.Y - startpos.Y;
    }
}

private async void Button_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
    if (e.ChangedButton != MouseButton.Left)
        return;

    _dragging = false;
    startpos = e.GetPosition(this);

    cancellation?.Cancel();
    cancellation = new CancellationTokenSource();
}

For your second problem: the button will capture the mouse on the mouse down event.
You need to release the captured mouse with the ReleaseMouseCapture method when you are done with your drag.
private void Button_PreviewMouseUp(object sender, MouseButtonEventArgs e)
{
    if (_dragging)
    {
        _dragging = false;
        e.Handled = true;
        var button = sender as Button;
        button.ReleaseMouseCapture();
    }

    cancellation?.Cancel();
}


text:
Q: How do I get GNU parallel to work on git bash in Windows 7? I was able to install GNU Parallel globally in git-bash by following this answer.
However, on running an example command as mentioned in the parallel-tutorial,
parallel -k echo ::: A B C > abc-file

I keep getting this error
sh: -c: option requires an argument
sh: -c: option requires an argument
sh: -c: option requires an argument
.
.
.

What am I doing wrong here?

A: So the root cause is that CygWin (contrary to GNU/Linux) does not respect redirection of STDERR if the command line is too long.
GNU Parallel figures out how long the longest possible command line is by doing a binary search for the length. This is awfully slow on CygWin because forking a 12 MB command line is horribly slow (and 12 MB seems to be the limit in my version of CygWin).
Luckily it only has do be done once. After this GNU Parallel caches the line length in ~/.parallel/tmp/HOSTNAME/linelen, and this is the reason why you experience the problem when ~/.parallel/tmp is removed.
This is also the reason why it seemed that using a different version worked: You simply had a single run that finished, and thus cached the length. It was not the change of version that did this.
Until I manage to get CygWin to ignore the sh: -c: option requires an argument all you need to do is to ignore it and be patient. I should probably also put in a small warning, to let CygWin users know that they have to be patient the first time.
Run:
parallel echo ::: 1

It will spit out the sh: -c: option requires an argument around 25 times, but that is fine. It will take around 30 seconds to complete.
After this everything should be fast(er) and you should not see the error.
It should be fixed in the newest version in GIT: https://savannah.gnu.org/git/?group=parallel

A: You are not the first to have this problem, and currently we do not know what causes it. I have access to a Windows-10 machine and I do not see that behaviour. A workaround seems to be using an older version of GNU Parallel. You can help by figuring out which versions work. When you have a single version (look here: https://ftpmirror.gnu.org/parallel), that works, run this:
testone() {
  v="$1"
  wget -c https://ftpmirror.gnu.org/parallel/parallel-$v.tar.bz2
  tar xvf parallel-$v.tar.bz2
  cd parallel-$v
  src/parallel true ::: 1
}
export -f testone
parallel -k --joblog my.log testone {1}{2}22 ::: {2012..2020} ::: {01..12}
grep -E '\s0\s0\stest' my.log

This will give all versions that do work.
Post the output from parallel -Dall echo ::: foo for both the newest working version, the following version, and the newest version (20200322).


text:
Q: Как сделать конструктор в С++, число аргументов которого зависит от параметра шаблона Я пишу класс вектор
template <typename T, unsigned char size>
class Vector
{
public:

    Vector()
    {

    }

private:
    T vector[size];
};

Я хочу сделать свои конструкторы для разных размеров вектора, которые будут принимать разное количество аргументов. Я уже пробовал наследовать вектора основных размеров (2, 3, 4) и делать для них свои конструкторы, но это приводило к ненужным проблемам связанным с различиями типов.

A: template<typename... x_Args>
Vector(x_Args &&... args): vector{::std::forward<x_Args>(args)...}
{
    static_assert(sizeof...(x_Args) == size);
}


text:
Q: Recyclerview Height cutoff This is the structure of my layout:
<ScrollView
-height - match>
<CoordinatorLayout
-height - wrap>
<AppbarLayout
-height - wrap>
<CollapsingToolbarLayout
-height - wrap>
<ConstraintLayout>
//min height is set dynamically.
</ConstraintLayout>
</CollapsingToolbarLayout>
</AppbarLayout>
<RecyclerView
->scroll behaviour
->height-wrap/>
<CoordinatorLayout>
</ScrollView>

because the scroll view is present I cannot apply the min-height in collapsing toolbar layout. is there any way we can adjust the height(here my recycler view gets cutoff)

A: Add this property to recylerview app:layout_constrainedHeight="true".
See the following for more details
Last Item in recyclerview is cut off


text:
Q: Closest alternative to MAC OSX time machine restore I wonder if there is a solution (or how to tweak such a thing using for example freebsd or something) to have "screen shot back ups" like in MAC's time machine feature to restore all my ubuntu account settings/avatars/home files etc with as little hassle as possible (and also take a record of the state of my computer frequently without me bothering manually doing so)
I dot mind laboring to set it up so I am open for ideas I just want the end result to work seamlessly and as effortlessly as possible.
If you dont know what mac time machine is then please google or watch a video on youtube to get the idea because thats what I am shooting for.
Thanks in advance.


text:
Q: "Object Expected" error while capturing the page load event The following code inside the  tags gives error: "Object Expected".
    <!-- JQuery/AJAX-->
    <script type="text/javascript">
        try {
            $(document).ready(function(){
                $("p").load(function(){
                    MakeRequest('divElectionCategory','ulElectionCategory','SELECT * FROM electioncategorymaster', 'UnOrderedList');
                });
            });
        }
        catch(e)
        {
            alert(e.message);
        }
    </script>

The MakeRequest function resides in a separate .js file and I have included that file before the above given code.
Which object it is referring to?
Edited:
The MakeRequest function
function MakeRequest(DivName, ControlName, SqlQuery, ControlType)
{
  var xmlHttp = getXMLHttp();
  var strUrl = "";

  if (ControlType = 'DropDown')
      strUrl = "../phplibraries/filldropdown.php?DivName=" + DivName + "&DropDownControlName=" + ControlName + "&SqlQuery=" + SqlQuery;
  else
      strUrl = "../phplibraries/createelectioncategorymenu.php?DivName=" + DivName + "&ulName=" + ControlName + "&SqlQuery=" + SqlQuery;

  alert(strUrl);
  try
  {
    xmlHttp.onreadystatechange = function()
    {
        if (xmlHttp.readyState == 4)
        {
            HandleResponse(xmlHttp.responseText, DivName);
        }
    }
            xmlHttp.open("GET", strUrl, true);
            xmlHttp.send(null);
    }
    catch(err)
    {
        alert(err);
    }
}

I know there is a big security issue above but please ignore it at this point of time.

A: You cannot call load() that way.
The first parameter of load takes a URL not a function. Perhaps you meant this:
$("p").load( MakeRequest('divElectionCategory','ulElectionCategory','SELECT * FROM electioncategorymaster', 'UnOrderedList') );

That assumes that MakeRequest returns a formatted URL.
EDIT
.load() when used against a DOM element and the first parameter is a function, jQuery assumes you are attaching an event handler. However, p does not have a load event. If you want to wait for everything to load, try this (It doesn't have to be in DOM ready):
$(window).load( function(){
   MakeRequest('divElectionCategory','ulElectionCategory','SELECT * FROM electioncategorymaster', 'UnOrderedList')
});

MakeRequest rewrite
function MakeRequest(DivName, ControlName, SqlQuery, ControlType)
{
  var strUrl = "", params = {};

  if (ControlType = 'DropDown'){
    strUrl = "../phplibraries/filldropdown.php";
    params = {
      DivName: DivName,
      DropDownControlName: ControlName,
      SqlQuery: SqlQuery
    }
  } else {
    strUrl = "../phplibraries/createelectioncategorymenu.php";
    params = {
      DivName: DivName,
      ulName: ControlName,
      SqlQuery: SqlQuery
    }
  }

  alert(strUrl);
  $.get(strUrl, params, function(data){
    HandleResponse(data, DivName);
  });
}


text:
Q: How can I distinguish a detail or list REST method in tastypie How can I find out if a GET method is requesting a detailed resource (example.com/api/v1/entry/1/) or a listing (example.com/api/v1/entry/)
What I am trying to do is to record how many times a detail GET method is called.
An option is to inspect the request object and get the PATH and see if a resource id was provided. However, I want to know if there's a better way to do this using tastypie's methods.

A: Override method get_detail.
def get_detail(self, request, **kwargs):
    # Your custom code for incrementing GET counter
    return super(YourResource, self).get_detail(request, **kwargs)

That method is called every time the get details method is requested.