text:
Q: I can't get error message when run command of docker-compose up When i type command of docker-compose run web
The Error message which i exactly wanted occurs
But when i type command of docker-compose up
There is no error message, but just a message like Watching for file changes with StatReloader
Also docker-compose logs web is the same. There is no error message.
How to know about reason? How to debug this?

I have a minimal reproduction repository
https://github.com/RayKimEX/mydocker-compose
I really want to know about this reason, help me. please

Edit
When i type docker-compose run web, The error message is NameError: name 'FabricViewSet' is not defined

When docker-compose up
% docker-compose up                                                                                ✹ ✭
Creating network "zeus_v1_default" with the default driver
Pulling db (postgres:)...
latest: Pulling from library/postgres
b8f262c62ec6: Already exists
fe6da876d968: Pull complete
46b9d53972f5: Pull complete
23a11bddcc75: Pull complete
d6744ba78bdc: Pull complete
8d95423a7aa9: Pull complete
8590ba4183e5: Pull complete
ed97b9b8e039: Pull complete
7b311f33f382: Pull complete
76802d77aa81: Pull complete
d84ab156d91d: Pull complete
3e7bd63c53e6: Pull complete
66992dbe6d8f: Pull complete
cb2fe0741e74: Pull complete
Digest: sha256:1c2e0ae6fa018d8547413423200f4e518ddcb1514e8ce67701993dc7f4dd98bf
Status: Downloaded newer image for postgres:latest
Building web
Step 1/5 : FROM python:3.7
3.7: Pulling from library/python
4a56a430b2ba: Already exists
4b5cacb629f5: Already exists
14408c8d4f9a: Already exists
ea67eaa7dd42: Already exists
4d134ac3fe4b: Already exists
4c55f6f5d7f0: Already exists
6ae475e50652: Already exists
6f4152644229: Already exists
6933d3d46042: Already exists
Digest: sha256:0f0e991a97426db345ca7ec59fa911c8ed27ced27c88ae9966b452bcc6438c2f
Status: Downloaded newer image for python:3.7
 ---> 02d2bb146b3b
Step 2/5 : RUN mkdir /zeus_test
 ---> Running in 355c46808600
Removing intermediate container 355c46808600
 ---> fa61066bd003
Step 3/5 : WORKDIR /zeus_test
 ---> Running in c17c0c9ee031
Removing intermediate container c17c0c9ee031
 ---> 9b6f6d199de6
Step 4/5 : COPY . /zeus_test
 ---> d5fcf394620c
Step 5/5 : RUN pip install -r requirements/docker.txt
 ---> Running in d8d435967de1
Collecting Django<3.0,>=2.0 (from -r requirements/docker.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/b2/79/df0ffea7bf1e02c073c2633702c90f4384645c40a1dd09a308e02ef0c817/Django-2.2.6-py3-none-any.whl (7.5MB)
Collecting psycopg2<3.0,>=2.7 (from -r requirements/docker.txt (line 2))
  Downloading https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz (377kB)
Collecting djangorestframework==3.10.3 (from -r requirements/docker.txt (line 3))
  Downloading https://files.pythonhosted.org/packages/33/8e/87a4e0025e3c4736c1dc728905b1b06a94968ce08de15304417acb40e374/djangorestframework-3.10.3-py3-none-any.whl (909kB)
Collecting sqlparse (from Django<3.0,>=2.0->-r requirements/docker.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/ef/53/900f7d2a54557c6a37886585a91336520e5539e3ae2423ff1102daf4f3a7/sqlparse-0.3.0-py2.py3-none-any.whl
Collecting pytz (from Django<3.0,>=2.0->-r requirements/docker.txt (line 1))
  Downloading https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl (509kB)
Building wheels for collected packages: psycopg2
  Building wheel for psycopg2 (setup.py): started
  Building wheel for psycopg2 (setup.py): finished with status 'done'
  Created wheel for psycopg2: filename=psycopg2-2.8.3-cp37-cp37m-linux_x86_64.whl size=465814 sha256=a764d67833ce40d10c04da79fa528d47672620caa3da43036dab1ea9f3c51bac
  Stored in directory: /root/.cache/pip/wheels/48/06/67/475967017d99b988421b87bf7ee5fad0dad789dc349561786b
Successfully built psycopg2
Installing collected packages: sqlparse, pytz, Django, psycopg2, djangorestframework
Successfully installed Django-2.2.6 djangorestframework-3.10.3 psycopg2-2.8.3 pytz-2019.3 sqlparse-0.3.0
Removing intermediate container d8d435967de1
 ---> ef23bfb143a0
Successfully built ef23bfb143a0
Successfully tagged zeus_v1_web:latest
WARNING: Image for service web was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating zeus_v1_db_1 ... done
Creating zeus_v1_web_1 ... done
Attaching to zeus_v1_db_1, zeus_v1_web_1
db_1   | The files belonging to this database system will be owned by user "postgres".
db_1   | This user must also own the server process.
db_1   |
db_1   | The database cluster will be initialized with locale "en_US.utf8".
db_1   | The default database encoding has accordingly been set to "UTF8".
db_1   | The default text search configuration will be set to "english".
db_1   |
db_1   | Data page checksums are disabled.
db_1   |
db_1   | fixing permissions on existing directory /var/lib/postgresql/data ... ok
db_1   | creating subdirectories ... ok
db_1   | selecting dynamic shared memory implementation ... posix
db_1   | selecting default max_connections ... 100
db_1   | selecting default shared_buffers ... 128MB
db_1   | selecting default time zone ... Etc/UTC
db_1   | creating configuration files ... ok
db_1   | running bootstrap script ... ok
db_1   | performing post-bootstrap initialization ... ok
db_1   | syncing data to disk ... ok
db_1   |
db_1   | initdb: warning: enabling "trust" authentication for local connections
db_1   | You can change this by editing pg_hba.conf or using the option -A, or
db_1   | --auth-local and --auth-host, the next time you run initdb.
db_1   |
db_1   | Success. You can now start the database server using:
db_1   |
db_1   |     pg_ctl -D /var/lib/postgresql/data -l logfile start
db_1   |
db_1   | ****************************************************
db_1   | WARNING: No password has been set for the database.
db_1   |          This will allow anyone with access to the
db_1   |          Postgres port to access your database. In
db_1   |          Docker's default configuration, this is
db_1   |          effectively any other container on the same
db_1   |          system.
db_1   |
db_1   |          Use "-e POSTGRES_PASSWORD=password" to set
db_1   |          it in "docker run".
db_1   | ****************************************************
db_1   | waiting for server to start....2019-10-08 06:51:29.262 UTC [44] LOG:  starting PostgreSQL 12.0 (Debian 12.0-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
db_1   | 2019-10-08 06:51:29.265 UTC [44] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2019-10-08 06:51:29.278 UTC [45] LOG:  database system was shut down at 2019-10-08 06:51:28 UTC
db_1   | 2019-10-08 06:51:29.283 UTC [44] LOG:  database system is ready to accept connections
db_1   |  done
db_1   | server started
db_1   |
db_1   | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
db_1   |
db_1   | waiting for server to shut down...2019-10-08 06:51:29.350 UTC [44] LOG:  received fast shutdown request
db_1   | .2019-10-08 06:51:29.354 UTC [44] LOG:  aborting any active transactions
db_1   | 2019-10-08 06:51:29.362 UTC [44] LOG:  background worker "logical replication launcher" (PID 51) exited with exit code 1
db_1   | 2019-10-08 06:51:29.363 UTC [46] LOG:  shutting down
db_1   | 2019-10-08 06:51:29.379 UTC [44] LOG:  database system is shut down
db_1   |  done
db_1   | server stopped
db_1   |
db_1   | PostgreSQL init process complete; ready for start up.
db_1   |
db_1   | 2019-10-08 06:51:29.475 UTC [1] LOG:  starting PostgreSQL 12.0 (Debian 12.0-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
db_1   | 2019-10-08 06:51:29.476 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_1   | 2019-10-08 06:51:29.476 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_1   | 2019-10-08 06:51:29.480 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_1   | 2019-10-08 06:51:29.500 UTC [53] LOG:  database system was shut down at 2019-10-08 06:51:29 UTC
db_1   | 2019-10-08 06:51:29.508 UTC [1] LOG:  database system is ready to accept connections
web_1  | Watching for file changes with StatReloader

A: I don't know why
But after adding tty: true in  web of services, docker-compose.yml
And when i type command of docker-compose up
It prints error logs properly for now in terminal
Does anyone can explain for this???


text:
Q: Is there a way to clear session data to ensure a clean session is initiated each time? For IE you would use capabilities like this:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);

and possibly in combination with
 driver.manage().deleteAllCookies();

How could this be achieved using Chrome and ChromeDriver?

A: While we work with Internet Explorer Driver we use the field IE_ENSURE_CLEAN_SESSION
IE_ENSURE_CLEAN_SESSION
As per the JavaDocs IE_ENSURE_CLEAN_SESSION is the Capability that defines whether to clean or not browser cache before launching Internet Explorer by IEDriverServer and is configured as follows :
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(InternetExplorerDriver.IE_ENSURE_CLEAN_SESSION, true);

Now let us have a look at GeckoDriver which follows the WebDriver Spec.
GeckoDriver / moz:profile / rust_mozprofile
If you have a closer look at the geckodriver logs closely you will observe that each time geckodriver is called a new moz:profile is scopped out and the details of rust_mozprofile occurs in the following line:
Marionette  CONFIG  Matched capabilities: {"browserName":"firefox","browserVersion":"56.0","platformName":"windows_nt","platformVersion":"6.2","pageLoadStrategy":"normal","acceptInsecureCerts":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"rotatable":false,"specificationLevel":0,"moz:processID":5848,"moz:profile":"C:\\Users\\AtechM_03\\AppData\\Local\\Temp\\rust_mozprofile.OfFuR9ogm33d","moz:accessibilityChecks":false,"moz:headless":false}

This log clearly indicates that Marionette scoops out a new "moz:profile":"C:\\Users\\AtechM_03\\AppData\\Local\\Temp\\rust_mozprofile.OfFuR9ogm33d" and this configuration is handled by the WebDriver instance i.e. the GeckoDriver.
You can find a more detailed discussion on moz:profile in Is it Firefox or Geckodriver, which creates "rust_mozprofile" directory discussion.

ChromeDriver
ChromeDriver which is following the same WebDriver Spec does abides (will be abiding) by the same suite.

Incase you are using any stored FirefoxProfile or ChromeProfile, WebDriver will pick up the existing profile where the Stored Browser Configurations are picked up for reuse.

driver.manage().deleteAllCookies();
Irespective of New/Existing FirefoxProfile or ChromeProfile if you add the line :
driver.manage().deleteAllCookies();

Only the cookies gets deleted only to be get restored back to support the Active Browser Session

redpajama_set_name: RedPajamaStackExchange


text:
Q: Add items on listbox if it doesn't exist based on checkbox I'm trying to add an item  to a listbox if the item does not exist in the list and remove that Item based on whether that checkbox is checked or unchecked.
I'm at the point of trying to add to the list if the item does not exist
Private Sub CheckBox1_Click()

If Me.CheckBox1.Value Then
    For Each doc In Me.DocsList.List
        If Me.TextBox7.Text <> doc Then
            Me.DocsList.AddItem (Me.TextBox7.Text)
        End If
    Next doc
End If
End Sub

for some reasons I'm not able to add anything. I can add without the loop though

A: List property does not return a collection able to be iterated in the way you try.
Please, test the next code:
Private Sub CheckBox1_Click()
 Dim i As Long, boolFound As Boolean

 If Me.CheckBox1.value Then
    For i = 0 To Me.docsList.ListCount - 1
        'check the string existence in the list box:
        If Me.TextBox7.Text = Me.docsList.list(i) Then
            boolFound = True: Exit For
        End If
    Next i
    If Not boolFound Then Me.docsList.AddItem Me.TextBox7.Text
 End If
End Sub

A: There's no need to loop, this code will add the value from TextBox7 to the listbox if it isn't already listed.
Private Sub CheckBox1_Click()
Dim items As Variant
Dim Res As Variant

    If Me.DocsList.ListCount = 0 Then
      Me.DocsList.List = Array(Me.TextBox7.Text)
      Exit Sub
    End If

    items = Me.DocsList.List
    Res = Application.Match(Me.TextBox7.Text, items, 0)

    If Me.CheckBox1.Value Then
        If IsError(Res) Then
            Me.DocsList.AddItem Me.TextBox7.Text
        End If
    ElseIf Not IsError(Res) Then
        Me.DocsList.RemoveItem Res - 1
    End If

End Sub


text:
Q: creating jar file can some one explain me how to crate jar file. my source folder has various sub folders and image files. you can see images explaining source folder structure  from following url
http://img63.imageshack.us/gal.php?g=capturev.png.
when jar is created using eclipse export jar function, it only include class files only , but i want to create jar file for all the content in my source folder. third image shows the window i get when jar is creating. it has no other folders and images to select.

A: See the Sun jar tutorial.
Whilst you can run jar from the command line, I'd recommend using Ant and the Ant Jar task. It will give you a lot more control over how to build the jar file and what to include in it.
e.g.
  <jar destfile="${dist}/lib/app.jar"
       basedir="${build}/classes"
       excludes="**/Test.class"
  />

will build everything in the classes directory into a .jar file, but exclude the Test classes.

A: You can do this from the command line using the jar command:
Usage: jar {ctxui}[vfm0Me] [jar-file] [manifest-file] [entry-point] [-C dir] files ...
Options:
    -c  create new archive
    -t  list table of contents for archive
    -x  extract named (or all) files from archive
    -u  update existing archive
    -v  generate verbose output on standard output
    -f  specify archive file name
    -m  include manifest information from specified manifest file
    -e  specify application entry point for stand-alone application
        bundled into an executable jar file
    -0  store only; use no ZIP compression
    -M  do not create a manifest file for the entries
    -i  generate index information for the specified jar files
    -C  change to the specified directory and include the following file
If any file is a directory then it is processed recursively.
The manifest file name, the archive file name and the entry point name are
specified in the same order as the 'm', 'f' and 'e' flags.

Example 1: to archive two class files into an archive called classes.jar:
       jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all the
           files in the foo/ directory into 'classes.jar':
       jar cvfm classes.jar mymanifest -C foo/ .

But personally, I'd use something like Ant or Maven for this purpose.

A: Building a jar using jar tool: http://java.sun.com/docs/books/tutorial/deployment/jar/build.html
Building a jar using ant: http://www.developer.com/tech/article.php/989631/Building-with-Ant-Introduction.htm


text:
Q: Query having two table from different database each without db prefix i have one table (tb1) in db1 and one tb2 in db2.
if i join two table as follow
select *from db1.tb1 join db2.tb2 on tb1.id=tb2.id
if db1 is default database then i can write it as following
select *from tb1 join db2.tb2 on tb1.id=tb2.id
now, what i want is to not use the prefix for tb2 i.e. (db2)

A: If you don't  give prefix as DB2, then SQL Server will try to find the table in connected database only and your query will fail.
You can try creating synonyms for the table.
CREATE SYNONYM tbl2 FOR db2.dbo.tb2

This way you can hide the database.


text:
Q: Como funciona o licenciamento de software no Brasil? O que é importante saber antes de licenciar um programa de computador  no Brasil?
Eu realmente preciso utilizar uma licença?
O que é e como funciona o sistema de software livre?

A:
AVISO: Este wiki da comunidade não está 100% pronto, e até por sua natureza wiki, jamais estará. Foi escrito originalmente à partir de uma extensa pesquisa realizada por um advogado (o autor da pergunta, alguém que ainda está aprendendo a programar, com a inestimável ajuda do SOpt), mas não por um especialista neste tema específico. Havendo dúvidas, sempre é interessante procurar um advogado especializado no assunto, de sua confiança, e submeter seu caso específico a uma rigorosa análise. Você é convidado a editar este texto se encontrar qualquer imprecisão (mesmo a menor correção ortográfica ou gramatical), ou a incluir qualquer conteúdo que possa acrescentar informações relevantes. Para fazer isso, basta clicar em "Editar", no final deste wiki.

Introdução
Esta pesquisa surgiu em decorrência da tentativa de responder esta pergunta de forma satisfatória, mas como a resposta foi ficando grande demais, pela necessidade de explicar uma série de conceitos sem os quais seria impossível entender o que são, e, principalmente, onde atuam as licenças de software livre, decidi então publicar um estudo mais detalhado como wiki da comunidade.
Para entender corretamente como funcionam as licenças de software livre, quais os direitos que elas realmente suavizam, e onde especificamente atuam, é necessário fixar antes quatro conceitos muito importantes (tentei utilizar o mínimo de termos jurídicos, mas em alguns casos foi impossível...):

*

*programa de computador

*patente

*direito autoral

*domínio público.

Então vamos a eles:
Programa de computador
A definição encontra-se na Lei 9.609/98:

Art. 1º Programa de computador é a expressão de um conjunto organizado de instruções em linguagem natural ou codificada, contida em suporte físico de qualquer natureza, de emprego necessário em máquinas automáticas de tratamento da informação, dispositivos, instrumentos ou equipamentos periféricos, baseados em técnica digital ou análoga, para fazê-los funcionar de modo e para fins determinados.

Analisar profundamente esta definição daria um artigo inteiro, então, simplificando: qualquer Hello Word da vida é um programa de computador para a definição legal (preciso verificar isso - e outras coisas - então quem puder colaborar, fique à vontade pra editar este wiki).
O programa de computador pode ser registrado no INPI, para atestar  a autoria.
Patente
A patente é uma concessão pública, que garante ao seu titular a exclusividade para explorar comercialmente uma inovação tecnológica.
O INPI não realiza o registro de patente de software "puro". O registro é possível apenas como forma de se resguardar em disputas judiciais frente à terceiros, mas não garante a exclusividade na exploração de uma inovação tecnológica.
Isto porque a Lei 9.279/96 (Lei da Propriedade Industrial) estabelece expressamente que:

Art. 10. Não se considera invenção nem modelo de utilidade:
V -  programas de computador em si;

Em 2012, inclusive, o INPI abriu uma consulta pública sobre patentes que envolvessem programas de computador, mas até onde sei a ideia não foi para frente após ter recebido uma série de críticas. No próprio site do INPI, na seção onde se realiza o registro de programas de computador, consta apenas a possibilidade de registro para "garantir maior segurança", e não de patente.
Isso quer dizer que se você criou uma funcionalidade diferente para um programa que tem vários concorrentes no mercado, você não terá exclusividade sobre ela. Seus concorrentes podem imediatamente inserir a mesma funcionalidade, desde que tenham a tecnologia (e a criatividade, se o caso) para isso.
O que eles não podem, como veremos adiante, é pegar o seu código (por vias legais - simplesmente abrindo o fonte numa página HTML - ou não - roubando mesmo) sem sua autorização, e colocar pra funcionar no concorrente. Mas eles podem, ao ver a funcionalidade no seu site, criar uma igual por meios próprios.
A única exceção é quando o software é associado de forma íntima a um hardware determinado, e dele dependente (também precisamos nos aprofundar sobre isso) por exemplo XXXXX). Contudo, de qualquer forma, na prática a patente que se registra é do hardware, incluindo um software específico associado àquele hardware.

Simplificando: em geral você pode copiar qualquer ideia/inovação de um software (mas aconselho que você nem veja os fontes!), e pode ser copiado.

Direito autoral
É o conjunto de direitos de um autor sobre a obra de sua criação. No Brasil, é regido pela Lei 9.610/98, a qual inclui expressamente "os programas de computador" como obra protegida (art. 7, inc. XII).
Desde que o Superior Tribunal de Justiça reconheceu a natureza jurídica de propriedade intelectual (e não industrial) para os programas de computador (REsp n.º 443.119/2003), uma sólida corrente jurisprudencial se formou neste sentido, afirmando que o programa de computador tem natureza jurídica de direito autoral, aplicando -se a ele o mesmo regime jurídico das obras literárias.
Então é justamente no âmbito do direito autoral que as licenças incidem; elas não fazem nenhuma diferença no quesito exclusividade (patente) aqui no Brasil (onde você não a terá de qualquer jeito).
Então, quando você cria um "programa de computador" (qualquer Hello word! da  vida), sua criação está protegida pelas leis 9.610/98 e 9.609/98.
E isso mesmo sem você ter realizado nenhum registro, independentemente de sua vontade:

Art. 18. A proteção aos direitos de que trata esta Lei independe de registro.

O registro no INPI pode ser importante para provar a autoria do programa, mas segundo a Lei é apenas uma opção:

Art. 19. É facultado ao autor registrar a sua obra no órgão público definido no caput e no § 1º do art. 17 da Lei nº 5.988, de 14 de dezembro de 1973.

Existem outras formas possíveis de se provar a autoria de um programa - há quem diga que basta enviar um simples e-mail para si mesmo - mas você pode registrar até em papel num cartório (provando assim a data de publicação e a autoria), ou mesmo simplesmente hospedar num servidor estabelecido e confiável (que eventualmente poderá atestar em juízo a data que os arquivos foram enviados para o servidor).
Porém, como não fica tão caro (relativamente), acredito que o mais indicado seja registrar pelo INPI, já que o Decreto Regulamentador 2256/98 estabeleceu especificamente que:

"Art. 1º Os programas de computador poderão, a critério do titular dos respectivos direitos, ser registrados no Instituto Nacional da Propriedade Industrial - INPI.".

E quais direitos estão reservados?
A lei divide os direitos de autor em morais e patrimoniais. Os direitos morais são irrenunciáveis e inalienáveis (veja todos os direitos morais do autor no art. 24 da Lei 9.610/98.)
No entanto, no caso específico dos programas de computador, a Lei 9.609/98 manteve apenas dois dos direitos morais do autor:

§ 1º Não se aplicam ao programa de computador as disposições relativas aos direitos morais, ressalvado, a qualquer tempo, o direito do autor de reivindicar a paternidade do programa de computador e o direito do autor de opor-se a alterações não-autorizadas, quando estas impliquem deformação, mutilação ou outra modificação do programa de computador, que prejudiquem a sua honra ou a sua reputação.
  (O final deste parágrafo lembra muito a licença BSD, como veremos adiante)

Dentre os direitos patrimoniais do autor (Lei 9.610/98) estão:

Art. 29. Depende de autorização prévia e expressa do autor a utilização da obra, por quaisquer modalidades, tais como: I - a
  reprodução parcial ou integral; II - a edição; [...] VI - a
  distribuição, quando não intrínseca ao contrato firmado pelo autor com
  terceiros para uso ou exploração da obra; VII - a distribuição para
  oferta de obras ou produções mediante cabo, fibra ótica, satélite,
  ondas ou qualquer outro sistema que permita ao usuário realizar a
  seleção da obra ou produção para percebê-la em um tempo e lugar
  previamente determinados por quem formula a demanda, e nos casos em
  que o acesso às obras ou produções se faça por qualquer sistema que
  importe em pagamento pelo usuário;

"Cereja no bolo" da proteção ao direito autoral do programa de computador são as implicações criminais:

Art. 12. Violar direitos de autor de programa de computador: Pena -
  Detenção de seis meses a dois anos ou multa. § 1º Se a violação
  consistir na reprodução, por qualquer meio, de programa de computador,
  no todo ou em parte, para fins de comércio, sem autorização expressa
  do autor ou de quem o represente: Pena - Reclusão de um a quatro anos
  e multa. § 2º Na mesma pena do parágrafo anterior incorre quem vende,
  expõe à venda, introduz no País, adquire, oculta ou tem em depósito,
  para fins de comércio, original ou cópia de programa de computador,
  produzido com violação de direito autoral.

Assim, e resumidamente (o tanto quanto possível) são estes os direitos que as licenças de software livre pretendem "suavizar".
Para ter estes direitos você não precisa fazer nada, não sendo necessário nenhum tipo de registro para ter os direitos resguardados (mas havendo disputa de autoria você será uma pessoa mais feliz se tiver feito o registro ;) ).
Então, neste extremo temos a licença proprietária, com todos os direitos reservados ©, previsão de guerras cataclísmicas no Tribunais para atestar a "paternidade de um software" (o que no Brasil ainda engatinha, mas que nos EUA já é uma indústria), pessoas processadas criminalmente, estagnação de tecnologia...
Mas que compra o leite das crianças. :-)
Domínio público
No outro extremo está a disponibilização por domínio público, em que absolutamente nenhum direito é reservado, nem mesmo de citação do autor original.
Há pouco leite para as crianças aqui, porém:

O domínio público é a base da nossa auto-compreensão, expressa pelo nosso conhecimento e cultura compartilhados. É a matéria-prima da qual são derivados os novos conhecimentos e criadas as novas obras culturais. O domínio público atua como um mecanismo de proteção para garantir que essa matéria-prima esteja disponível ao custo de sua reprodução – próximo de zero – e que todos os membros da sociedade possam construir com base neste conteúdo. (O Manifesto do Domínio Público)

O domínio público é inevitável após certo tempo da morte do autor (aqui no Brasil 70 anos desde a morte, e no caso de programas de computador, de 50 anos desde o primeiro dia do ano seguinte à publicação, ou da criação, se não for publicado).
O programa de computador, inclusive, não é definido como bem público ou particular; observa ele uma natureza mista, que envolve temporalidade, e "pode ser posto como bem de privilégio temporário" (fls. 04).
Mas é possível que você disponibilize sua obra sob domínio público se quiser, bastando criar (e de preferência registrar junto com o programa no INPI) uma licença pela qual você renuncia a quaisquer direitos disponíveis de autor (no Brasil não tenho conhecimento de nenhum, mas um exemplo estrangeiro de software disponibilizado por domínio público é o sqlite).
As licenças de software livre
Transitando entre estes dois extremos (licença proprietária X domínio público) está o movimento do software livre, que tem na Free Software Foundation sua origem e expressão máxima.
A filosofia do software livre se baseia sob quatro liberdades fundamentais:

*

*Liberdade 0: A liberdade de executar o programa, para qualquer propósito.

*Liberdade 1: A liberdade de estudar como o programa funciona e adaptá-lo para as suas necessidades.

*Liberdade 2: A liberdade de redistribuir cópias.

*Liberdade 3: A liberdade de aperfeiçoar o programa, e liberar os seus aperfeiçoamentos.
As licenças de software livre se dividem em três grandes grupos: as permissivas, as recíprocas parcais, e as recíprocas totais.
No fundo, todas estas licenças são apenas textos que procuram padronizar a utilização de licenças de software mais permissivas do que a proprietária, e menos do que a de domínio público.
Você pode perfeitamente criar sua própria licença, utilizando ou não trechos de outras. Você pode, por exemplo, criar uma licença que seja em parte MIT, em parte Creative Commons, e ainda incluir quaisquer condições (desde que sejam válidas pelo ordenamento jurídico) que quiser.
Ou criar uma licença proprietária, e permitir apenas uma ou outra liberdade específica de utilização.
O único problema que você pode ter é se estiver utilizando outro programa base, que já tenha uma licença associada e exija que seu programa siga as mesmas regras (aqui também precisamos nos aprofundar mais).
Vejamos então, um resumo das principais licenças de cada grupo, mas ao invés de comentar cada uma, vou apenas incluir um excelente quadro criado no site Escolha uma Licença, o qual, à propósito, é licenciado sob a Creative Commons Atribuição 3.0 Brasil, o que nos dá o direito de fazer isso desde que informemos se houve modificação (NÃO), que informemos o crédito (checked) e um link para a licença.
Permissivas
São as licenças com as menores restrições, permitindo, inclusive, que trabalhos derivados sejam distribuídos por uma licença fechada. Estão entre elas:
• BSD License 9

• MIT License

• Apache License V2.0

Recíprocas totais
São as licenças livres com as maiores restrições. Em geral, requerem que a distribuição aconteça com a mesma licença que original.
Estão entre elas:
. GPL 2.0

 Recíprocas parciais
A diferença desta para a anterior é que "se as modificações foram utilizadas como componente de outro projeto de software, este projeto não precisa, necessariamente, ser disponibilizado sob a mesma licença." (Wikipedia)
. GNU Library or Lesser General Public License (LGPL)

. Mozilla Public License 1.1 (MPL 1.1)

. Eclipse

CREATIVE COMMONS
As licenças Creative Commons são bastante amplas, e podem ir desde a permissão total (na modalidade by-sa que é semelhante a uma licença MIT), até a quase uma licença fechada (na modalidade by-nc-nd), permitindo apenas a distribuição, sem possibilitar nenhuma modificação ou uso comercial (também chamada de "propaganda grátis").
Veja aqui os tipos de licença Creative Commons, ou responda algumas perguntas básicas e gere uma automaticamente aqui.
Como escolher uma licença de software livre
Isto pode ser realmente muito complexo e tortuoso, principalmente se você estiver utilizando diversos códigos de base, com diversas licenças diferentes atribuídas a eles.
No entanto, o melhor estudo sobre este tema que encontrei até agora, contém um excelente fluxograma (também publicado na wikipedia), e que pode ajudar bastante na escolha:

Também é digna de nota esta tabela (mesma fonte), muito útil pra analisar as diferenças e as compatibilidades entre as licenças:

Este wiki não esgota o tema, e pretendo trabalhar mais nele futuramente, e convido a todos os interessados que puderem colaborar a que o façam sem pensar duas vezes. Lembrem-se que qualquer edição pode ser revertida, então não se acanhem em editar o que considerarem impreciso/incorreto.
Fontes:
Imagens:

*

*http://upload.wikimedia.org/wikipedia/commons/d/d4/Mecanismo_de_seleção_3.png

*http://pt.wikipedia.org/wiki/Licença_de_software_livre
Artigos:

*

*http://forum.openstreetmap.org/viewtopic.php?id=30131

*http://pt.wikipedia.org/wiki/Licença_de_software_livre

*http://pt.wikipedia.org/wiki/Domínio_público

*http://www.infowester.com/freexopen.php

*http://sejalivre.org/voce-conhece-as-licencas-de-software-livre-ja-esta-na-hora-de-saber-ne/
Para saber mais sobre direito autoral, veja este artigo no site do ECAD:

*

*http://www.ambito-juridico.com.br/site/?n_link=revista_artigos_leitura&artigo_id=10902&revista_caderno=17
Trabalhos acadêmicos:

*

*http://ccsl.ime.usp.br/files/relatorio-licencas.pdf

*http://direitorio.fgv.br/sites/direitorio.fgv.br/files/Manifesto%20do%20Dominio%20Publico%20-%20Portuguese%20Version_0.pdf

*http://www.teses.usp.br/teses/disponiveis/45/45134/tde-14032012-003454/publico/MestradoVanessaSabino.pdf (tese citada nos comentários da pergunta)

*http://www.eduvaleavare.com.br/wp-content/uploads/2014/07/software.pdf

*http://jus.com.br/artigos/10312/a-protecao-juridica-do-software-com-enfase-em-patente


text:
Q: UItableViewCell issue I am using UItableViewController and I add label to the cell programatically , the label reads data from json array , on scrolling the cell reuse and the label data change ,
there is any way to prevent this issue ?

A: Your question is not clear.!! but according to your problem you might not set proper value(array count) for
    -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView

and find the exact index in array using "indexPath.row"
    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

if you provide your code what you've written may help us to re correct it

A: use following way :
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

NSString *CellId = [NSString stringWithFormat:@"CellId%d%d",indexPath.row,indexPath.section];

if (!cell)
{
    cell = [[[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellId] autorelease];
}

return cell;
}

A: Dont use this like of code.It is used to reload the data.
cell = [[CustomCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellId];


text:
Q: How can I extract a file from a tar archive without creating the subdirectories? I have a compressed tar archive and I want to extract one file from deep in the archive to the current working directory.
Is there something better than tar, or a way to extract it without the directory components?
I'm doing something like this right now:
tar xfvz $file -C $destination $folder"/"$file
cd $destination"/"$folder
mv $file ../$file
rm -r $folder

But I sometimes delete the wrong $folder.
For example, my archive is : mytar.tar.gz.
Inside it I have myfolder/mysecondfolder/hello.txt.
I want to extract myfolder/mysecondfolder/hello.txt as hello.txt in the current directory.

A: If GNU tar is available, you could use the --strip-components parameter:
#!/bin/bash
file_to_extract=myfolder/mysecondfolder/hello.txt
depth=$(awk -F/ '{print NF-1}' <<< "$file_to_extract")
tar zxvf mytar.tar.gz --strip-components="$depth" "$file_to_extract"

From man tar:

--strip-components=NUMBER
      strip NUMBER leading components from file names on extraction

Source: https://www.linuxquestions.org/questions/linux-newbie-8/extracting-tar-gz-files-in-current-directory-689243/#postmenu_3368879

A shorter solution would be to use the --transform option, as suggested by Toby Speight:
tar zxvf mytar.tar.gz --transform='s,.*/,,' myfolder/mysecondfolder/hello.txt

A: Just give the full stored path of the file after the tarball name.
Example: suppose you want file test.tar.gz from 2.pdf:
tar -zxvf test.tar.gz 2.pdf


text:
Q: How to get the length of Row in FlinkSQL? sql: CREATE TABLE tab1 ( data Row<id BIGINT,name VARCHAR>) WITH ...;
I want to know the length of Row , such as :
     select length(data) as size from tab1...
the output length is 2.
How can I do it?

A: The Row type has a getArity() method that you could use, either directly in the Table API, or by wrapping it in a user-defined function for use in SQL.

A: Assuming FlinkSQL uses normal SQL , you could try doing
SELECT COUNT(*) as size FROM tab1;


text:
Q: store value obtained from dataframe current_loc['percen_52week']=""
for i in current_loc.index:
         dff=week_high.loc[week_high['security_code']==current_loc['security_code'][i]]
            dff['week_high']=dff['week_high'].astype(float)
            percen_52week=((1-current_loc['last'][i])/dff['week_high'])
            current_loc.loc[i,'percen_52week']=percen_52week

where current_loc and week_high are dataframes.
error:
 raise ValueError("Incompatible indexer with Series")
ValueError: Incompatible indexer with Series

A: I do not know which pandas you are using but maybe this is the problem
current_loc.loc[[i,'percen_52week']]=percen_52week

I guess it should be
current_loc.loc[i,'percen_52week']=percen_52week

A: i finally solved it , the issue was related to datatype ,here percen_52week was returning series datatype which cannot be allocated in current_loc
issue was solved when percen_52week was converted to float


text:
Q: Pipelining API calls using Azure APIM Policies I'm somewhat new to Azure APIM and am trying to figure out solution to a scenario which I've be tasked to solve using APIM Policies. Here's how the workflow is supposed to work:

*

*System A makes a REST call to the APIM gateway.

*This triggers APIM to call REST API endpoint B to a get value x.

*Finally, APIM needs to relay the original call received from system A to system C such that the header information from the System A's call and value x from endpoint B's call are included.

Thus, is there a way to accomplish this using only a combination of Azure APIM policies?
Thanks,

A: 1 & 2. You can connect System A to System B via Azure APIM gateway. You can connect APIM with system B as steps suggested in answer :  Azure Api management for connecting to application
After connection, the REST API URL will be ready which you can call from system A and setup connection.
3.All the parameters (headers/payload) sent to API by calling service (System A) will be passed to System B as it is unless you make changes.


text:
Q: HTML divs popup to select columns I have a web application(ASP.NET2.0 C#) and in it, I have a gridview that gets its data from a datasource.
I wanted to add the following feature: the user can click a button "select columns", and a box pops up with a list of all the columns(a checkboxlist in a div, possibly) and that way, the user can choose the columns they want to see, and click another button "show" and the list of columns goes away, and the table shows the columns that the user selected.
I have already implemented the column choosing part, but it is the popup part that I need help with. How can I make the div popup and then disappear?
The solution might require javascript, and I might not have figured it out since I don't really know javascript that well.
Thank you.

A: HI,
Its better to make the display of div to be none rather than setting visibility to hidden. If visibility is set to hidden even if the div doesn't show up but it will take the rendering space which in some situation might not be that good.
You can dynamically create a div using createNode and then by absolute positioning and setting the top and left according to your convenience you can align the div to any portion in the page. Its better if you could disable the background when the div pops out.

A: Create the div and set visible=false. When you want to pop it up write the javascript to set it visible=true.
here's a good pointer http://lists.evolt.org/archive/Week-of-Mon-20020624/116151.html


text:
Q: How to get the part of HashMap object? For example I have:
aaa 1
ccc 1
bbb 1
ddd 3

I need to assign a value to new HashMap object first three rows only, without the last row. How to do this?
Input HashMap object represented as >String, Integer<
Output HashMap object must be:
aaa 1
ccc 1
bbb 1

A: HashMap is unordered by definition.  LinkedHashMap is ordered, but based strictly on insert order.
You need to find a better data structure if you want to be able to replace by index, or you'll have to come up with, say, an array list that holds a copy of the keys which you can then use to handle the order.  Or if you don't really rely on the keys for anything, just use the array list directly.

A: It's not clear what you are trying to do.  I'm going to assume that you start with a HashMap that looks like the first example and want to get a second hashmap that looks like the second example.  If this isn't what you want, please edit your question to be more clear.
HashMap<String, Integer> secondHashMap = firstHashMap.clone();
secondHashMap.remove("ddd");


text:
Q: How to make http response in multiple times I have a PHP-based REST API, is that possible to get multiple HTTP responses after I sent the request only once? or is there a way to achieve this goal?
for example, I send an HTTP request for updating a bunch of data, and I need the API response with the status after each process so I can show the % on the page, very similar to the loading bar.
currently, my php response header as below
http_response_code(200);
echo json_encode(
  array(
    "result" => "Request finished.",
    "success" => true,
    "progress" => $progress,
    )
);

it only shows 100% once all actions are done, and I learned the once code 200 been sent to the client, the HTTP connection has been closed. I also tried return code 100, but not failed.


text:
Q: Views Carousel module in Drupal I have uploaded the view carousel module in my project. I have created a Content Type (named image). I have added one field  (imagefield) to this Content Type. After this I created the view, but there is only one image showing in the slider.
If some one has any information regarding this, please help me.
(all images are showing in preview, not just one)

A: I haven't used the module, but here's my two cents:
The Views Carousel module is deprecated in favor of the jCarousel module. Use the newer module instead. jCarousel will have better support (it already has a Drupal 7 release) whereas Views Carousel is a dead-end.


text:
Q: Image not display and error: PANIC in `/home/anaconda2/envs/iraf27/iraf/noao/bin.linux/x_apextract.e': Write to IPC with no reader I am trying to run the

NTT pessto pipeline

that uses PyRAF. I have everything installed but when I try to test if it works I have two issues, first, the image enviroment opens but the image is never displayed. Then when I try to Edit apertures for the file I am analyzing I get the error:

PANIC in
  /home/anaconda2/envs/iraf27/iraf/noao/bin.linux/x_apextract.e':Write
  to IPC with no reader

I am currently using Python 2.7.15 :: Anaconda, Inc. and I also have IRAF installed. I am using a astroconda environment that I installed following the legacy software directions from:

https://astroconda.readthedocs.io/en/latest/installation.html#legacy-software-stack-with-iraf

I use setuptools so I don't think is an issue of PYTHONPATH
If anyone could help me I would really apreciate it.
Cheers.

A: I tried this with IRAF/PyRAF that comes with Ubuntu 18.04:
PyRAF 2.1.14 Copyright (c) 2002 AURA
Python 3.6.5rc1 Copyright (c) 2001-2018 Python Software Foundation.
Python/CL command line wrapper
  .help describes executive commands
--> noao
--> twodspec
twodspec/:
 apextract/     longslit/
--> apextract
apextract/:
 apall          apedit          apflatten       apnormalize     apscatter
 apdefault@     apfind          apmask          aprecenter      apsum
 apdemos/       apfit           apnoise         apresize        aptrace
--> apedit dev$pix
Edit apertures for dev$pix? ('yes'):

and then a window openes for editing, without the error message. So, I guess this is a bug in your IRAF distribution. You probably should check with the astroconda people.

A: Solved. The problem was the matplotlib version.


text:
Q: Spring - @PostConstruct method called two times Here is my Spring Controller class
@Controller
public class SchedularController{

  @Autowired
  ProjectRepository projectRepository;

  @Autowired
  UtilityRepository utilityRepository;

  @PostConstruct
  public void postconstruct(){
      System.out.println("Starting schedular...");
   }
}

Problem is when I start server postconstruct method runs two times.
I have checked another posts on this which mostly says - "That can happen if you have multiple frameworks managing the same bean class. E.g. JSF and CDI, or JSF and Spring, or CDI and Spring, etc."
But I am not using JSF or CDI and still having this problem.(and my @PostConstruct method is in controller class)
How to resolve this?
Edit -
Here is my pom file
<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>WBPPM</groupId>
 <artifactId>WBPPM</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <packaging>war</packaging>
 <url>http://maven.apache.org</url>

<properties>
    <spring.version>4.0.3.RELEASE</spring.version>
    <spring.security.version>3.0.5.RELEASE</spring.security.version>
    <mongo-java-driver.version>3.0.2</mongo-java-driver.version>
    <spring-data-commons.version>1.7.2.RELEASE</spring-data-commons.version>
    <spring-data-mongodb.version>1.4.2.RELEASE</spring-data-mongodb.version>
    <org.aspectj-version>1.7.4</org.aspectj-version>
    <jackson.databind-version>2.2.3</jackson.databind-version>
    <log4j.version>1.2.17</log4j.version>
    <slf4j.version>1.7.6</slf4j.version>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>

    <!-- Spring Security -->

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>${spring.security.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>${spring.security.version}</version>
    </dependency>

    <!-- Spring -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId>
        <version>${spring.version}</version> </dependency> -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>1.5.10</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jettison</groupId>
        <artifactId>jettison</artifactId>
        <version>1.1</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.castor</groupId>
        <artifactId>castor</artifactId>
        <version>1.2</version>
    </dependency>
    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.8.1</version>
    </dependency>
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.0</version>
    </dependency>
    <!-- Xstream and Json provider -->
    <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.3.1</version>
        <type>jar</type>
    </dependency>
    <!-- Jackson -->
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.databind-version}</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${jackson.databind-version}</version>
    </dependency>

    <!-- Spring / MongoDB -->
    <dependency>
        <groupId>org.mongodb</groupId>
        <artifactId>mongo-java-driver</artifactId>
        <version>${mongo-java-driver.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-mongodb</artifactId>
        <version>${spring-data-mongodb.version}</version>
    </dependency>

    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.2.2</version>
    </dependency>
    <!-- Tiles plugins -->
    <dependency>
        <groupId>org.apache.tiles</groupId>
        <artifactId>tiles-jsp</artifactId>
        <version>3.0.3</version>
    </dependency>
    <!-- <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId>
        <version>1.5.11</version> </dependency> -->
    <!-- JSTL plugins -->
    <!-- Log4j -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${log4j.version}</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
    <!-- java mail -->
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.4</version>
    </dependency>
    <!-- AspectJ -->
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>${org.aspectj-version}</version>
    </dependency>
    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>${org.aspectj-version}</version>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
    </dependency>

    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.2.2</version>
    </dependency>

    <!-- Recaptcha check Api -->
    <dependency>
     <groupId>org.glassfish</groupId>
     <artifactId>javax.json</artifactId>
     <version>1.0.2</version>
    </dependency>

    <!-- Apache Commons Upload -->
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
    </dependency>

    <!-- Jasper Report -->
    <!-- <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>5.6.0</version>
    </dependency> -->

    <!-- Freemarker Template -->
    <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>2.3.20</version>
    </dependency>

    <!-- <dependency>
        <groupId>com.jolbox</groupId>
        <artifactId>bonecp</artifactId>
        <version>0.8.0.RELEASE</version>
    </dependency> -->

    <!-- Excel File Read/write -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.11</version>
    </dependency>

    <!-- amazonaws -->
    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-s3</artifactId>
        <version>1.10.4</version>
    </dependency>

    <!-- Push Notification -->
    <dependency>
        <groupId>com.ganyo</groupId>
        <artifactId>gcm-server</artifactId>
        <version>1.0.2</version>
    </dependency>
    <dependency>
        <groupId>es.arcadiaconsulting.javapns</groupId>
        <artifactId>javapns</artifactId>
        <version>2.2-json</version>
    </dependency>

    <!-- http://mvnrepository.com/artifact/it.sauronsoftware.cron4j/cron4j -->
    <dependency>
        <groupId>it.sauronsoftware.cron4j</groupId>
        <artifactId>cron4j</artifactId>
        <version>2.2.5</version>
    </dependency>

</dependencies>

<build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.3</version>
            <configuration>
                <warSourceDirectory>WebContent</warSourceDirectory>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
    </plugins>
</build>
</project>

Here is my spring context file -
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xmlns:cxf="http://cxf.apache.org/core" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:oxm="http://www.springframework.org/schema/oxm"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mongo="http://www.springframework.org/schema/data/mongo"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/oxm http://www.springframework.org/schema/oxm/spring-oxm-1.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/data/mongo
http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd">

<context:component-scan base-package="com.wb.ppm" />
<context:annotation-config />
<mvc:annotation-driven />
<aop:aspectj-autoproxy />
<mvc:interceptors>
    <mvc:interceptor>
        <mvc:mapping path="/**/*" />
        <bean id="webContentInterceptor"
            class="org.springframework.web.servlet.mvc.WebContentInterceptor">
            <property name="cacheSeconds" value="0" />
            <property name="useExpiresHeader" value="true" />
            <property name="useCacheControlHeader" value="true" />
            <property name="useCacheControlNoStore" value="true" />
        </bean>
    </mvc:interceptor>
    <mvc:interceptor>
        <mvc:mapping path="/*" />
        <bean class="com.wb.ppm.util.interceptor.WBInterceptor">
        </bean>
    </mvc:interceptor>
</mvc:interceptors>

<bean id="loggingAspect" class="com.wb.ppm.util.logging.LoggingAspect" />
<bean id="applicationContext" class="com.wb.ppm.security.SpringApplicationContext"
    factory-method="getInstance" />

<bean
    class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
</bean>
<bean id="localeResolver"
    class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
    <property name="defaultLocale" value="en" />
</bean>

<bean id="localeChangeInterceptor"
    class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
    <property name="paramName" value="language" />
</bean>

<bean
    class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping">
    <property name="interceptors">
        <list>
            <ref bean="localeChangeInterceptor" />
        </list>
    </property>
</bean>
<!-- Register the welcome.properties -->
<bean id="messageSource"
    class="org.springframework.context.support.ResourceBundleMessageSource">
    <property name="basename" value="ApplicationResources" />
</bean>

<!-- Factory bean that creates the Mongo instance -->
<context:property-placeholder location="classpath:mongodb.properties"
    order="1" />

<bean id="mongo" class="org.springframework.data.mongodb.core.MongoFactoryBean">
    <property name="host" value="${mongo.host.name}" />
    <property name="port" value="${mongo.host.port}" />
</bean>

<bean id="mongoDbFactory" class="org.springframework.data.mongodb.core.SimpleMongoDbFactory">
    <constructor-arg name="mongo" ref="mongo" />
    <constructor-arg name="databaseName" value="${mongo.db.name}" />
</bean>

<mongo:mapping-converter id="converter" />
<bean name="gridFsTemplate"
    class="org.springframework.data.mongodb.gridfs.GridFsTemplate">
    <constructor-arg ref="mongoDbFactory" />
    <constructor-arg ref="converter" />
</bean>

<bean id="userCredentials" class="org.springframework.data.authentication.UserCredentials">
    <constructor-arg name="username" value="${mongo.db.username}" />
    <constructor-arg name="password" value="${mongo.db.password}" />
</bean>

<!-- MongoConverter for converting the dot in map key to \+ in mongodb  -->
<bean id="mongoMoxydomainConverter" class="org.springframework.data.mongodb.core.convert.MappingMongoConverter">
    <constructor-arg index="0" ref="mongoDbFactory" />
    <constructor-arg index="1">
        <bean class="org.springframework.data.mongodb.core.mapping.MongoMappingContext" />
    </constructor-arg>
    <property name="mapKeyDotReplacement" value="\\+"/>
</bean>

<!-- MongoTemplate for connecting and querying the documents in the database -->
<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
    <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
    <constructor-arg name="mongoConverter" ref="mongoMoxydomainConverter"/>
    <!-- <constructor-arg name="userCredentials" ref="userCredentials" /> -->
</bean>

<!-- Use this post processor to translate any MongoExceptions thrown in
    @Repository annotated classes -->
<bean
    class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />

<!-- Register the welcome.properties -->
<bean id="tilesConfigurer"
    class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
    <property name="definitions">
        <list>
            <value>/WEB-INF/tiles.xml</value>
        </list>
    </property>
</bean>

<bean id="tilesviewResolver"
    class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <property name="viewClass"
        value="org.springframework.web.servlet.view.tiles3.TilesView" />
    <property name="order" value="2"></property>
</bean>

<bean id="jstlviewResolver"
    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="viewClass"
        value="org.springframework.web.servlet.view.JstlView" />
    <property name="prefix" value="/pages/" />
    <property name="suffix" value=".jsp" />
    <property name="order" value="3"></property>
</bean>

<!-- Configure to plugin JSON as request and response in method handler -->
<bean
    class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
    <property name="messageConverters">
        <list>
            <ref bean="jsonMessageConverter" />
            <ref bean="xmlMessageConverter" />
        </list>
    </property>
</bean>

<bean
    class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
</bean>

<!-- Configure bean to convert JSON to POJO and vice versa -->
<bean id="jsonMessageConverter"
    class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
    <property name="supportedMediaTypes" value="application/json" />
</bean>
<bean id="multipartResolver"
    class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <property name="maxUploadSize" value="150000000"/>
    <property name="maxInMemorySize" value="150000000"/>
</bean>

<bean id="xmlMessageConverter"
    class="org.springframework.http.converter.xml.MarshallingHttpMessageConverter">
    <property name="marshaller" ref="castorMarshaller" />
    <property name="unmarshaller" ref="castorMarshaller" />
    <property name="supportedMediaTypes" value="application/xml" />
</bean>
<bean id="castorMarshaller" class="org.springframework.oxm.castor.CastorMarshaller">
</bean>
<bean id="simpleMappingExceptionResolver"
    class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
    <property name="exceptionMappings">
        <map>
            <entry key="NotAuthorizedException" value="redirect:/login" />
        </map>
    </property>
    <property name="defaultErrorView" value="redirect:/pages/error/globalError.jsp" />
</bean>

Here is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
<display-name>WorldBankPPM</display-name>
<!-- Spring Listeners -->
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:worldbank-context.xml
        classpath:security-applicationContext.xml
    </param-value>
</context-param>
<context-param>
    <param-name>log4j-config-location</param-name>
    <param-value>src/log4j.properties</param-value>
</context-param>
<listener>
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>

<filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<servlet>
    <servlet-name>appServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/classes/worldbank-context.xml</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>appServlet</servlet-name>
    <url-pattern>/</url-pattern>
    <url-pattern>/login</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>360</session-timeout>
</session-config>
<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>/assets/*</url-pattern>
    <url-pattern>/vendor/*</url-pattern>
</servlet-mapping>
<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>fork</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>xpoweredBy</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>mappedfile</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
</servlet>
<error-page>
    <error-code>404</error-code>
    <location>/pages/error/error404.jsp</location>
</error-page>
<error-page>
    <error-code>500</error-code>
    <location>/pages/error/globalError.jsp</location>
</error-page>
<!-- <security-constraint>
    <web-resource-collection>
        <web-resource-name>securedapp</web-resource-name>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint> -->

A: I was also facing the same problem few days back and I have successfully solve this issue.
In my case I have created application using Spring starter.
When you import project in Eclipse or any IDE you saw there is two classes in main package:

*

*ServletInitializer.java which extends SpringBootServletInitializer and overrides configure(), it gets called when we create war file and run under tomcat server

*YourApplication.java contains main() which is entry point to our application if run/debug application on local server.
I have referred to this to create war file and do necessary change.
Problem was I forgot to remove ServletInitializer.java which also contains the same method, this was the main cause of getting initialising twice.
Once you remove the extra code from that file, Spring Boot will only initialise your context once and will able to execute your code once.


text:
Q: Aws Athena: How to get RequestID from failed Start-Query-Execution I am getting empty response from failed start-query-execution.
I need to get the requestId of the failed query from start-query-execution.

A: By "failed query" I assume you mean a query that was started but ended up in a failed state. The way you discover that a query ends up in a failed state is to call Client#get_query_execution, which takes the query execution ID.
The query execution ID is the only property of the response object from the start query execution call:
response = athena.start_query_execution(…)
puts response.query_execution_id

If the call throws an error that means that the query never started.


text:
Q: Frequent CPU spikes on fresh install I just reinstalled my Server (Windows Server 2008 R2) and after installing MySQL 5.6, the CPU spikes every few seconds:
http://s15.postimg.org/dno7ztfjf/cpuspikes.png
Even worse than the higher CPU load compared to my old setup is that the spikes are accompanied by an audible sound from my hard drive (which is fine, I just checked), so I definitely want to get rid of this issue.
It's a fresh install only accessible from my local LAN, so unsurprisingly SHOW FULL PROCESSLIST returns just 2 rows (the Query itself and Sleep).
I tried Google but couldn't find anything, so I would really appreciate some help on this!


text:
Q: Can't open file 'demo.py': [Errno 2] No such file or directory when running through a bash script I have a folder named test-folder with two files.
# file name: demo.py
print('hello world')

# file name: script.sh
python3.7 demo.py

The test-folder is present inside /home/username/Documents/
I have exported the above path to the .bashrc.
Now when I try to execute the script.sh using the following command,
bash script.sh

I get the following error
python3.7: can't open file 'demo.py': [Errno 2] No such file or directory

How can I solve this? I'm on Ubuntu 18.04

A: It works for me. Is there anything about your setup that is different than mine?
$ cat demo.py
print("Hello World")

$ cat script.sh
python3.7 demo.py

$ tree
.
└── test-folder
    ├── demo.py
    └── script.sh

1 directory, 2 files

$ cd test-folder/
$ bash script.sh
Hello World

Edit: Try the following.
$ cat script.sh
python3.7 "`dirname "$0"`/demo.py"

A: Move to the folder containing the file :
$ cd /home/username/Documents/test-folder
after making sure you are in the folder ccontaining the file try:
$ python file_name.py
if it doesn't work try the full path to python and the full path to the file like this:
$ /usr/lib/python3.7  /home/username/Documents/test-folder/file_name.py

A: If you want to use script.sh from anywhere, your approach won't work.
When executing $ bash script.sh, the file script.sh is expected to be located in the working directory.
You can use absolute paths to solve this:
# filename: script.sh

python3.7  /home/username/Documents/test-folder/demo.py

Try executing this with bash /home/username/Documents/test-folder/script.py.
You can achieve your goal in an arguably simpler way by adding /home/username/Documents/test-folder to your PATH, adding a shebang to demo.py and making demo.sh executable.
$ export PATH=/home/username/Documents/test-folder:$PATH
$ chmod +x /home/username/Documents/test-folder/demo.py

demo.sh will look like this with a shebang:
#!/usr/lib/python3.7

print('hello world')

and can be executed from anywhere with $ demo.sh.

A: If your script.sh file is only there to run the Python script, it's not needed. Instead make the Python script itself executable.
(1) add this as the first line in your Python file — this tells Unix which interpreter to use when running this file:
#!/usr/bin/env python37

(2) make your Python file executable so it can be run directly:
chmod +x demo.py

(3) put that file on the path, e.g. a path you set via a Bash config file, or one that's already on the path like /usr/local/bin.
Now any time you give the command demo.py your script will run. Note the .py extension isn't required — you can name the file anything you like.


text:
Q: Start a Lync IM conversation for windows phone I want to launch Skype for business on chat dialog page but I always launch an app on Contacts tab.
I've tried:
"lync:<im:" + email + ">"

and
"im:<sip:" + email + ">"

but above urls don't work as well

A: This is the Skype URI Documentation and according to this, your call should be
skype:skype.test.user.1?chat


text:
Q: How to modify object before passing it to Parquet writer Is there any way to modify the output of Parquet model before writing to file
 Class ModelA {

      byte[] output

 }

 final String schemaString = ReflectData.get().getSchema(ModelA.class).toString();

 final ParquetBuilder<ModelA> builder =
                    (out) -> {
                        ParquetWriter<ModelA> parquetWriter = createAvroParquetWriter(schemaString, ReflectData.get(), out);
                        return parquetWriter;
                    };

  private static <T> ParquetWriter<T> createAvroParquetWriter(
            String schemaString, GenericData dataModel, OutputFile out) throws IOException {

        final Schema schema = new Schema.Parser().parse(schemaString);

        return AvroParquetWriter.<T>builder(out)
                .withSchema(schema)
                .withConf(configuration)
                .withDataModel(dataModel)
                .build();
    }

Due to some challenges, I cannot change the data type of output field in ModelA and also cannot change the model for ParquetWriter. Currently it is dumping output in byte format to output file.
This output field is actually containing the byte array form of JsonString. I want the final output should be written as JsonString not bytes


text:
Q: CSS3 column layout divide one element into two parts Here is my jsfiddle problem demo: https://jsfiddle.net/icewind/w3ugftup/

.col-wrapper {
    background-color: #efefef;
    color: #444;
    padding: 20px;
    border-radius: 5px;
    -webkit-column-width: 220px;
}
.remark{
    background-color: yellow;
    position: relative;
}
.remark:after{
    content: '.';
    position: absolute;
    bottom: -17px;
    left: 50%;
    width: 20px;
    height: 20px;
    display: inline-block;
    background-color: red;
}

In our urban and suburban houses what should we do without cats? In our sitting or bedrooms, our libraries, in our kitchens and storerooms, our farms, barns, and rickyards, in our docks, our granaries, our ships, and our wharves, in our corn markets, meat markets, and other places too numerous to mention, how useful they are! In our ships, however, the rats oft set them at defiance; still they are of great service.

How wonderfully patient is the cat when watching for rats or mice, awaiting their egress from their place of refuge or that which is their home! How well Shakespeare in Pericles, Act iii., describes this keen attention of the cat to its natural pursuit!

A slight rustle, and the fugitive comes forth; a quick, sharp, resolute motion, and the cat has proved its usefulness. Let any one have a plague of rats and mice, as I once had, and let them be delivered therefrom by cats, as I was, and they will have a lasting and kind regard for them.

A friend not long since informed me that a cat at Stone's Distillery was seen to catch two rats at one time, a fore foot on each. All the cats kept at this establishment, and there are several, are of the red tabby colour, and therefore most likely all males.

When I use css3 column layout like the demo,and I add a bookmark to a word which happened to be at the bottom of a column, sometimes the bookmark icon get divided into two parts by the columb layout.
I tried to use 'break-inside: avoid;' and 'break-before: avoid;' css rules but it seems not work.
Is there any solution about my problem?

A:
Unfortunately word 'once' is not on the same line but this is the only way I know. rally is not easy just take a look.

*

*Well, in Html &nbsp like so once&nbsp

*For Css in .col-wrapper you add -webkit-column-width: 220px; -moz-column-width: 150px; column-width: 150px; for browsers compatibility and change padding to padding:15px 27px 15px 27px;.

*In remark:after{} change and add this codes {
bottom: -7px; left: 1%; width: 33px; height: 10px;
background: url("http://www.stat.ncsu.edu/dept-icons/camera-icon.gif") no-repeat center bottom;}

*Add .col-wrapper > p {line-height: 19.5px;}
.remark { background-color: yellow;  position: relative; bottom: 4px;}

.col-wrapper {

  background-color: #efefef;

  color: #444;

  border-radius: 5px;

  -webkit-column-width: 220px;

  -moz-column-width: 150px;

  column-width: 150px;

  padding: 15px 27px 15px 27px;

}

.remark:after {

  content: '.';

  bottom: -7px;

  left: 1%;

  width: 33px;

  height: 10px;

  position: absolute;

  background: url('http://www.stat.ncsu.edu/dept-icons/camera-icon.gif') no-repeat center bottom;

}

.col-wrapper > p {

  line-height: 19.5px;

}

.remark {

  background-color: yellow;

  position: relative;

  bottom: 4px;

}

In our urban and suburban houses what should we do without cats? In our sitting or bedrooms, our libraries, in our kitchens and storerooms, our farms, barns, and rickyards, in our docks, our granaries, our ships, and our wharves, in our corn markets,
    meat markets, and other places too numerous to mention, how useful they are! In our ships, however, the rats oft set them at defiance; still they are of great service.

How wonderfully patient is the cat when watching for rats or mice, awaiting their egress from their place of refuge or that which is their home! How well Shakespeare in Pericles, Act iii., describes this keen attention of the cat to its natural pursuit!

A slight rustle, and the fugitive comes forth; a quick, sharp, resolute motion, and the cat has proved its usefulness. Let any one have a plague of rats and mice, as I once&nbsphad, and let them be delivered therefrom by cats,
    as I was, and they will have a lasting and kind regard for them.

A friend not long since informed me that a cat at Stone's Distillery was seen to catch two rats at one time, a fore foot on each. All the cats kept at this establishment, and there are several, are of the red tabby colour, and therefore most likely
    all males.

You might need to change some pixels according to your small icon. If you have any question let me know.

A: this is really interesting CSS issue. Im working on the solution meanwhile I suggest you a workaround solution for time being. Instead of showing the bookmark on the bottom, I moved to the top.
.remark:after{
    content: '.';
    position: absolute;
    top: -17px;
    left: 20%;
    width: 20px;
    height: 20px;
    display: block;
    background-color: red;
    opacity:.5;
}


text:
Q: react-native-google-mobile-ads dont work with mediation, Meta, AdColony And Unity Ads I'm facing several issues when trying to mediate with Meta Audience Network, Adcolony and Unity Ads.
On Faebook with bidding it gives the error of 'No Ad Config'
In Unity Ads and Adcolony with waterfall gives the error:
Adcolony SDK requires an Activity context to initialize Ads
Unity Ads require an Activity context to load Ads
I'm using the latest version of google mobile ads:
"react-native-google-mobile-ads": "^8.2.2",

I put everything right in app/build.gradle
implementation 'com.google.android.gms:play-services-ads:21.3.0'
implementation 'com.google.ads.mediation:facebook:6.12.0.0'
implementation 'com.google.ads.mediation:adcolony:4.8.0.0'
implementation 'com.unity3d.ads:unity-ads:4.5.0'
implementation 'com.google.ads.mediation:unity:4.5.0.0'

Even the ad inspection shows that everything is correct
I've tried to do several things and several tests but without success!
Note: All ads I'm trying to load are in test mode, I've already configured the device on Meta, Unity and AdColony platforms if activated in placement


text:
Q: SNPRelate: how to give specific color to a population in PCA plot I am using SNPRelate for PCA analysis. Its using default color for different populations but I want to color them according to me. Plotting commands are like this:

plot(tab$EV2, tab$EV1, col=as.integer(tab$pop),cex=1.2,pch=20,
  + xlab="eigenvector 2", ylab="eigenvector 1")
  legend("topleft", legend=levels(tab$pop), cex=1,pch=20, col=1:nlevels(tab$pop))

Head of the input file is like this:
sample.id   pop         EV1         EV2
1        A1 POP_I -0.10172849  0.03619405
2        A2 POP_I -0.15951814  0.08234857
3        A3 POP_I -0.15632495  0.08180843
4        A4 POP_I -0.09679447  0.07981108
5        A5 POP_I  0.11362360 -0.03186038
6        A6 POP_I  0.05594095 -0.05498351

A: Define a list of colors:

col.list <- c("gray", "blue", "green", "red", "blue", "yellow", ...)
plot(tab$EV2, tab$EV1, col=col.list[as.integer(tab$pop)], cex=1.2, pch=20, xlab="eigenvector 2", ylab="eigenvector 1")
legend("topleft", legend=levels(tab$pop), cex=1,pch=20, col=1:nlevels(tab$pop))


text:
Q: How to get resources working in runnable jar? I have a Image Icon in my Jframe.I am using a Image in it.When i export into a Runnable Jar.The Image is Not displayed.
String iPath = "res/images/Mobile.png";
JLayeredPane layeredPane = new JLayeredPane();
 layeredPane.setBounds(0, 0, 315, 610);
 InputStream stream = (InputStream) getClass().getResourceAsStream(iPath);
 JLabel mobileImageLabel;
 mobileImageLabel = new JLabel(new ImageIcon(iPath));

          //mobileImageLabel = new JLabel(new ImageIcon(ImageIO.read(stream)));
       // mobileImageLabel = new JLabel(new ImageIcon(AppFrame.class.getResource(iPath)));

                    mobileImageLabel.setBounds(0, 0, 315, 610);
                    mobileImageLabel.setVisible(true);
                    layeredPane.add(mobileImageLabel, Integer.valueOf(0));

I googled & found the getResourceAsStream method.But it seems to throw NullPointerException.
So Help me in the Right Direction :)
Thanks for your Help ...
Note
The Method i Tried has been Commented

A: To set a image in a button I did this:
JButton yourButton = new JButton("text button");
        try {
            yourButton.setIcon(new ImageIcon(ImageIO.read(getClass().getResourceAsStream("/images/icon-for-your-button.png"))));
        } catch (IOException e3) {
            // TODO Auto-generated catch block
            e3.printStackTrace();
        }

You must have the images inside your project like this:

In your case, the answer I think is to do this:
new ImageIcon(ImageIO.read(getClass().getResourceAsStream("/images/icon-for-your-button.png")))

A: Try to replace
String iPath = "res/images/Mobile.png";

By
String iPath = "C:/..../res/images/Mobile.png";

Whenever you are working with images try to put the complete path for the image. So when you will generate your .jar file and try to run it from different place(may be possible that you want the jar should be run from desktop) you will get all the images.


text:
Q: Ambient Isotopic subsets but not their embeddings I am trying to find two embeddings $f$ and $g$ of the circle $S^{1}$ into a space $X$ such that the subsets $f(S^{1})$ and $g(S^{1})$ are ambient isotopic within $X$, but $f$
and $g$ are not ambient isotopic within $X$.
This is problem 10 in "An Illustrated Introduction to Topology and Homotopy", by Sasho Kalajdzievski - page 226. It is before the material on homotopy and the fundamental group. Hence, I assume none of that is needed to provide the answer.

A: In order to remove the question from the unanswered list I try providing a solution using the Intermediate Value Theorem, as suggested by Moishe Kohan in the comments above. I would appreciate criticism if I my reasoning is incorrect.
Consider the inclusion $i:S^{1}\rightarrow S^{1}$ and $g:S^{1}\rightarrow S^{1}$ defined by $g(x,y)=(x,-y)$.
Suppose $H:S^{1}\times I\rightarrow S^{1}$ is a continuous mapping such that the mappings $H_{t}:S^{1}\rightarrow S^{1}$, defined by $H_{1}(x)=H(x,t)$ for $t\in I$ satisfy $H_{0}=\mathrm{id}_{S^{1}}$ and $H_{1}=g$.
Now, for a point $p\in S^{1}$ different from $(1,0)$ and $(-1,0)$ consider the "vertical line" $X=\{x\}\times I$ and the map $h:I\rightarrow\mathbb{R}$ defined by $h(t)$ as the magnitude in radians of the central angle from $H_{t}(p)$ to $H_{t}(1,0)$ (this magnitude is positive if the central angle is clockwise and negative if it is anticlockwise).
Note that this magnitude depends continuously on $H$, which is continuous. Therefore, $h$ is continuous. Moreover, $h(0)$ is positive (res. negative) if and only if $h(1)$ is negative (resp. postive). Therefore, $h$ changes sign on $I$ and by the Intermediate Value Theorem there is some $c\in I$ for which $h(c)=0$. But then, $H_{c}(p)=H_{c}(1,0)$ implying that $H_{c}$ is not injective. Therefore, $H$ cannot be an ambient isotopy between $i$ and $g$ within $S^{1}$.
On the other hand, $i(S^{1})$ and$f(S^{1})$ are clearly isotopic subsets since they are both equal to $S^{1}$.


text:
Q: continuous stream on IIS server - will it crash and how can i best execute this code? I am currently developing a twitter streaming web app as part of a College proj. I have written code that uses curl to stream from twitter and writes the data to a sql server 2008 express database.
    ProcessStartInfo curl = new ProcessStartInfo();
    Process process = new Process();

    protected void Page_Load(object sender, EventArgs e)
    {
        curl.FileName = @"c:\program files\Curl\curl.exe";
        curl.Arguments = "http://stream.twitter.com/1/statuses/sample.json -u username:password";
        curl.UseShellExecute = false;
        curl.RedirectStandardOutput = true;

        process = Process.Start(curl);
        Twitter_Stream(sender, e);
    }
    protected void Twitter_Stream(object sender, EventArgs e)
    {
        SqlConnection conn = new SqlConnection();

        // Start curl process
        using (process)
        {
            using (StreamReader reader = process.StandardOutput)
            {
                try
                {
                    // create connection and open connection
                    conn = new SqlConnection(ConfigurationManager.AppSettings["strConnectionString"].ToString());
                    conn.Open();
                    // Post the output from curl to the queue.
                    // One line = one tweet in json format.
                    while (!reader.EndOfStream)
                    {
                        // create a SqlCommand object for this connection
                        SqlCommand command = conn.CreateCommand();
                        command.CommandText = "save_stream";

                        string result = reader.ReadLine();
                        Message message = new Message(result);

                        JObject obj = JObject.Parse(message.Body.ToString());

                        /* I parse the obj here and exec query to save data
                        command.CommandType = CommandType.StoredProcedure;
                        command.ExecuteNonQuery();
                    }
                }
                catch (Exception ex)
                { /*DO some error logging here.*/}

                finally
                {
                    // close the connection
                    conn.Close();
                    Thread.Sleep(1000);
                    Twitter_Stream(sender, e);
                }
            }
        }
    }`

My question is, As i have put a while loop that will or should never end in my code, will this cause an issue on the server load. Will a continuous loop crash the server? Also what should I use instead?
Any help at all would be much appreciated.

A: No, this will not crash the server because IIS is already watching for this case.  If a page's execution time is greater than the currrent threshold, IIS will kill the thread.
Instead of making this a webpage, you should make this a console application.  You can use infinite loops as much as you want in those.


text:
Q: I have a code in java that check date and time , similarly to oystercard
*

*I have create this code to check the date and the time similar as Oyster card. If it is less than one hour, no deduction of the price. If is over one hour, deduct 1.5, but cannot exceed 4.5 because is a dailyCharge.

*Could I have any suggestions of how I could implement my code to check the date and the time for the last journey?

    public boolean touch(int date,int time){
        pvTime = 12;
        double price = 1.5;
        if(balance < 1.5)
            return false;
        if( time == pvTime || pvTime < 60 ) {
            return true;
        }else if(pvTime > 60 ){
            balance-=price;
            dailyCharge = price;
            if(dailyCharge > 4.5) {
                balance= dailyCharge;
            }
        }
        return true;
    }

A: Use appropriate classes for such data.
Java provides the java.time classes for date-time work.
Use Instant to record a moment in time as seen from UTC (an offset of zero hours-minutes-seconds).
Instant instant = Instant.now() ;  // Capture the current moment.

Calculate elapsed time with Duration class.
Duration duration = Duration.between( instant , Instant.now() ) ;

Test if an hour elapsed.
long hours = duration.toHours() ;
if( hours > 0 )
{
    // At least one hour elapsed.
}
else
{
    // Under an hour.
}


text:
Q: Dereference NULL pointer in C++ So I'm trying to get familiar with c++. And here is the task that is supposed to exercise usage of pointers. Here is how it goes:

Write a function that prompts the user to enter his or her first name
  and last name, as two separate values. This function should return
  both values to the caller via additional pointer. It should prompt for
  the last name only if the caller passes in a NULL pointer for the last
  name.

I've tried a few versions. The one I'm stuck with now is:
#include <iostream>
#include <string>

using namespace std;

void getFullName(string *p_first, string *p_last) {
    cout << "First name:";
    getline(cin, *p_first);
    if (!p_last) {
        cout << "Last name:";
        getline(cin, *p_last);
    }
}

int main() {

    string first;
    string *p_first = &first;
    string *p_last = NULL;

    getFullName(p_first, p_last);

    cout << *p_first << endl << *p_last << endl;
    return 0;
}

Well, it crashes. And I've tried to pass a reference to the 'last' and then pointing to it.
But after exiting the function the pointer is NULL again.

A: I think there is an error in the text of the exercise and it should read:

Write a function that prompts the user to enter his or her first name and last name, as two separate values. This function should return both values to the caller via additional pointer. It should prompt for the last name only if the caller passes in a non-NULL pointer for the last name.

As it stands, your code causes undefined behaviour by dereferencing a null pointer
void getFullName(string *p_first, string *p_last) {
    cout << "First name:";
    getline(cin, *p_first);
    if (!p_last) {    /* <-- This test should be inverted */
        cout << "Last name:";
        /* Now, you get here only when p_last == NULL. On the next line,
         * you dereference that null-pointer and try to read a string into
         * non-existing memory: recipe for disaster.
         * With the condition inverted, you would only get here if you have
         * a string to store the text in. */
        getline(cin, *p_last);
    }
}

A: Don't use pointers, you don't need pointers for this. Just pass the parameters by reference:
void getFullName(string& p_first, string& p_last)

However, the problem is you're dereferencing p_last which is NULL -> undefined behavior:
if (!p_last) {  //this evaluates to true, because p_last==NULL
    cout << "Last name:";
    getline(cin, *p_last);
}

A: Given that your question states you use an additional, I would write it as:
string getFullName()
{
    string first, last;
    cout << "First name:";
    getline(cin, first);
    cout << "Last name:";
    getline(cin, last);
    return first + last;  // note use of additional
}

A: The reason it is not working is because the call to getline takes a string reference (basic_string<>&) as the second argument, you're dereferencing a null pointer and passing it through. This is pretty much always going to give an error. You would need to new a fresh string to pass through to it, but this is a bad idea because it's pretty much guaranteed to lead to a memory leak since you've given yourself no way to pass it back.
Where you're passing a pointer expecting the value it points to to be altered and thus act as a return value you need to provide a valid pointer.

A: First of all, the assignment is faulty (if that is the complete assignment), or your interpretation of the assignemnt is faulty. Here's a version which will read last name, if p_last points to a string where it should be stored:
void getFullName(string *p_first, string *p_last) {
    cout << "First name:";
    getline(cin, *p_first);
    if (p_last) {
        cout << "Last name:";
        getline(cin, *p_last);
    }
}

Here's a version which use p_last as last name if it's not NULL, otherwise reads last name from user, and in both cases returns full name in p_first:
void getFullName(string *p_first, string *p_last) {
    cout << "First name:";
    getline(cin, *p_first);
    string lastname;
    if (!p_last) {
        cout << "Last name:";
        getline(cin, lastname);
    } else {
        lastname = *p_last;
    }
    *p_first += lastname;
}

Here's a version, which uses reference to pointer to alter p_last if it is NULL
void getFullName(string *p_first, string *&p_last) {
    cout << "First name:";
    getline(cin, *p_first);
    if (!p_last) {
        p_last = new string;
        cout << "Last name:";
        getline(cin, *p_last);
    }
}

None of these match your assignment though.


text:
Q: Does swapping x1/x2 change the rectangle? I have a small function used to ensure that x1 <= x2, and y1 <= y2. Here it is, you should be able to see what it does without programming knowledge:
if(searchArea.x1 > searchArea.x2){
        int temp = searchArea.x1;
        searchArea.x1 = searchArea.x2;
        searchArea.x2 = temp;
    }
    if(searchArea.y1 > searchArea.y2){
        int temp = searchArea.y1;
        searchArea.y1 = searchArea.y2;
        searchArea.y2 = temp;
    }

My question is: will my rectangle always remain the same for all values of x and y > 0 using the above method? I've tried a few small samples, but I don't know if I've tried every case.
Thank you!

A: Your rectangle has points $(x_1,y_1)$ and $(x_2,y_2)$, with its sides parallel to the $x$ and $y$ axes. Then its other corners are $(x_1,y_2)$ and $(x_2,y_1)$. Clearly, $(\min(x_1,x_2), \min(y_1,y_2))$ and $(\max(x_1,x_2), \max(y_1,y_2))$ both belong to this set of four corners. Thus the rectangle between them is the same.


text:
Q: Setting the local translation of an Spatial wont work Im working with jMonkeySDK on a 3D java game.
When I shoot a model/spatial with a ray it returns that spatial. So I can access things like
.getName() or .setUserData().

The Spatial as physics on it. So when the game starts it falls down from the sky.
So for the beginning I want to implement a pickUp method that sets the local translation of that spatial to a certain point.
.getParent().setLocalTranslation(0, 50, 0);

(parent is "Blender Exports/woodlog/woodlog-scene_node (Node)" <- my Spatial)
(0, 50, 0) Is up in the air again. So it should fall down again.
But this won't work! I can print out the translation afterwards and I get these coordinates.
But the spatial does not move. So I got the parent of this parent
.getParent().getParent().setLocalTranslation(0, 50, 0);

That set the translation somehow, but the spatial moves wierd around than. First it goes to the correct point (0, 50, 0) But then it goes left, right, left, right. Then it stops and stays in the air.
Ho do I get this fixed? Why happens these wierd "animation"? And why does the mass dissappear. Well, I dont know if it disappears but the spatial should fall down again right?

A: Once something has been put into the physics system you need to let the physics system handle moving it. You cannot just move the object in JME3 directly without (as you have seen) breaking the physics.
You need to move objects inside the physics space by applying forces to them, or remove them from the physics space. For example something that you have picked up should just be on the attachment node for your hand, with no physics at all as it will move with the person carrying it.

A: The issue is that you've moved the visible part of the object (its Spatial) away from the physical part of the object (its physics Control or collision shape, the thing you added to a physicsSpace).
To teleport it directly to the fixed location you'll want to use .setPhysicsLocation(0,50f,0)  or its shortcut .warp(0,50,0) for characters.
Unfortunately I don't know precisely how to get to there from your spatial - working on issues in the dynamic object adding section myself.
Physics does have the advantage of doing actual pickups, by the force application system.


text:
Q: Random "User does not have sufficient permissions for this profile." error from Google Analytics API v3 I am receiving this error randomly when I am trying to send a request to Google Analytics API v3:

"User does not have sufficient permissions for this profile."

From every 8-10 times that I try a same request (same parameters, authentication, etc.), I receive this error only once and the other times I receive the correct response in the other times. The other strange part is that we are handling many clients and I only have seen this error for only handful of our clients.
For more background, we are using googleapis NPM package to send our Google Analytics API requests.
This is parameters that I am sending to the API:
{
  params: {
    auth: OAuth2Client {
      _events: [Object: null prototype] {},
      _eventsCount: 0,
      _maxListeners: undefined,
      transporter: DefaultTransporter {},
      credentials: [Object],
      eagerRefreshThresholdMillis: 300000,
      forceRefreshOnFailure: false,
      certificateCache: {},
      certificateExpiry: null,
      certificateCacheFormat: 'PEM',
      refreshTokenPromises: Map {},
      _clientId: 'XXXXX,
      _clientSecret: 'XXXX',
      redirectUri: 'postmessage'
    },
    ids: 'ga:XXXX',
    metrics: 'ga:sessions,ga:bounces,ga:transactions,ga:transactionRevenue,ga:goalCompletionsAll',
    dimensions: 'ga:date',
    'start-date': '2021-10-01',
    'end-date': '2021-10-20',
    samplingLevel: 'HIGHER_PRECISION',
    quotaUser: 'XXX'
  }
}

new Promise((resolve, reject) => {
        return google
            .analytics({ version: "v3"})
            .data.ga.get(params, (error, { data: response } = {}) => {
                if (error) {
                    return reject(new Error(`Google API sent the following error: ${error}`));
                }
                return resolve(response);
            });
    })

Authentication:
const OAuth2 = google.auth.OAuth2;
const oauth2Client = new OAuth2(process.env.GOOGLE_CLIENT_ID, process.env.GOOGLE_CLIENT_SECRET, "postmessage");

oauth2Client.setCredentials(tokens);

await oauth2Client.getRequestHeaders().catch((error) => {
            throw error;
});

And then passing oauth2Client in the params as auth.

A: I resolved the issue. In my case I was using the same object of oauth2Client for multiple API requests but was calling these lines before each request:
oauth2Client.setCredentials(tokens);
await oauth2Client.getRequestHeaders();

This could potentially change the token that I was passing in the request parameters, params,  before it was being sent.
So in other words if you are sending multiple requests to the API at the same time, it is better to generate the token once and use the same token for all those requests.


text:
Q: Upload multiple images in multiple numbers from multiple fileuploader I have searched a lot but fail to get a appropriate Answer. So, I am again posting this question. Please below picture, where I have 3 file uploader. Each Uploader can upload multiple files. After clicking on the Upload file button all the files should be uploaded into a folder in the application root directory but with a naming convention like ("FileUpload1"-"count") (e.g. FileUpload11) in .Net Framework 3.5

Also need to store the file names into the DB Table.
Please help in this regard.

A: For the above question, I spend a quality time and can manage it working flawlessly.
How?
See, in ASP.Net 3.5 has file upload control where multiple file uploading is not possible. But in my case it was like multiple files to be uploaded from each file upload control out of those three.
I haven't used jQuery but followed a different way. I have taken List control, Add Button and Remove Button for each file upload control, now for each time whenever choosing new files, file names is added to the list accordingly for our reference but physical files has been uploaded to a temp folder.
What is the use of this temp folder? - it will check duplicate files, can add files, can remove files if file name is chosen from list and clicked on Remove button.
Now when form Submission or Submit button clicked, all the files from the temp folder will be moved to target folder and temp folder will be emptied.
This is how I have followed.
Will post a article on the same for others to use the procedure or can have different ideas on the same.
Thanks !!