mysql – Problems with the SELECT

I have problems with the SELECT.
I have to list all the information (code, name) of the department (DEPT) that has a manager (position). My code looks like this:

create database bd_emp;
use bd_emp;

create table DEPT(
dcodigo int unsigned primary key not null
dnome varchar(36) not null

create table EMPR(
matr int unsigned key not null 
nome varchar(12) not null,
sobrenome varchar(15) not null,
dept int unsigned,
fone varchar(14),
dinadim date,
cargo varchar(10),
niveled decimal,
sexo char(1),
datanas date,
salario decimal(9.2),
bonus decimal(9.2),
comis decimal(9.2),
foreign key(dept) references DEPT(dcodigo)

create table PROJETOS(
pcodigo int unsigned not null primary key,
pnome varchar(24) not null,
dcodigo int unsigned not null,
resp int unsigned not null,
equipe int unsigned,
dataini date,
datafim date,
psuper varchar(6),
foreign key(dcodigo) references DEPT(dcodigo),
foreign key(resp) references EMPR(matr)

insert into DEPT values 
(null, 'informatica'),
(null, 'limpeza'),
(null, 'administracao'),
(null, 'alimentacao'),
(null, 'seguranca');

insert into EMPR values
(null, 'Rogério', 'Gás', 1, 995827541, '2017-02-14', 'técnico', 8, 'M', '1999-05-12', 32000, 2500, 500),
(null, 'Claudio', 'Roberto', 2, 994827541, '2018-05-11', 'faxineiro', 5, 'M', '1990-12-25', 14400, 200, 100),
(null, 'Rodrigo', 'Henrique', 3, 995827641, '2018-09-29', 'gerente', 12, 'M', '1999-12-04', 50000, 1000, 600),
(null, 'Maria', 'Fernanda', 4, 995487541, '2017-05-20', 'cozinheira', 6, 'F', '1989-12-06', 14400, 2500, 500),
(null, 'Cleiton', 'Xesque', 5, 995647541, '2019-07-12', 'guardinha', 7, 'M', '1986-12-09', 14400, 2500, 500);

In my case, only the administrative department has a manager. Thanks in advance

PHP – Problems with PHPMailer and Form

Tengo esta función que implemento en un formulario que registre usuarios, hasta el momento funcional el registro en la BDD sin problema pero ocupo la librería para enviar un link de activación de cuenta pero dicho correo nunca se manda y no me cambia de pantalla.

The method I use is the following (use $ mail-> SMTPDebug = 2 to figure out the problem and provide the capture with what triggers me)


Function sendEmail ($ email, $ name, $ subject, $ body) {


    $mail = new PHPMailer();
    $mail->SMTPAuth = true;
    $mail->SMTPSecure = 'tls';
    $mail->SMTPDebug = 2;
    $mail->Host = '';
    $mail->Port = '587';

    $mail->Username = '';
    $mail->Password = 'micontraseña';

    $mail->setFrom('', 'NOM-035 Core Group');
    $mail->addAddress($email, $nombre);

    $mail->Subject = $asunto;
    $mail->Body    = $cuerpo;

    return true;
    return false;

Problems Starting the Global Entry & TSA Precheck Application Simultaneously?

I know that there is another question that is similar to my question, but mine asks if two applications should start at the same time.

I started my application for worldwide entry this week, as there are some domestic trips and some international travel at the end of the year. Due to the fact that CBP officials have been sent to the southern border, global entry requests have been postponed and there is a great deal of delay in processing and planning an interview.

I am planning to apply for a TSA pre-check as it will be available within a few weeks. There are also many matriculation centers. I think since there are two separate programs, there will be no conflict, but I would like to hear from someone who has experience with it. Many thanks.

Backpacking Problems – Algorithms for Placing N Weighted Balls in M ​​Even Containers While Striving for a Balanced Weight?

Suppose there is $ N $ weighted balls and $ M $ Balanced containers are guaranteed to have at least one placement where all balls can be placed in containers.

What is the right algorithm to achieve a balanced placement where each container has almost the same weight of balls?

I know if the containers have different weights, the problem is NP-heavy. Not sure if a simplified question can be solved in linear time.

I'd look forward to references where I could find some articles discussing the complexity and associated solutions. Thanks a lot!

Javascript – Problems running ng-click angularjs

Help, I can not run ng-click in the AngularJS dashboard template


I do not know much about web programming




August 2019


angular.module('app')..controller('trafficDemoCtrl', trafficDemoCtrl)
trafficDemoCtrl.$inject = ('$scope', '$window');
function trafficDemoCtrl($scope,$window){

  function random(min,max) {
    return Math.floor(Math.random()*(max-min+1)+min);

  var elements = 12;
  var data1 = ();
  var data2 = ();
  var data3 = ();
  var data4 = ();

   for (var i = 0; i <= elements; i++) {

  $scope.alert=function () {
    $window.alert('Hello Guys');

$scope.labels = ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', 'Monday', 'Thursday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
  $scope.series = ('Current', 'Previous', 'Low', 'High');
  $ = ( data1, data2, data3, data4);
  $scope.colors = ({
    backgroundColor: convertHex(brandInfo,10),
    borderColor: brandInfo,
    pointHoverBackgroundColor: '#fff'

  }, {
    backgroundColor: 'transparent',
    borderColor: brandSuccess,
    pointHoverBackgroundColor: '#fff'
    backgroundColor: 'transparent',
    borderColor: brandDanger,
    pointHoverBackgroundColor: '#fff',
    borderWidth: 1,
    borderDash: (8, 5)
    backgroundColor: 'transparent',
    borderColor: brandDanger,
    pointHoverBackgroundColor: '#fff',
    borderWidth: 1,
    borderDash: (8, 5)
  $scope.options = {
    responsive: true,
    maintainAspectRatio: false,
    scales: {
      xAxes: ({
        gridLines: {
          drawOnChartArea: false,
        ticks: {
          callback: function(value) {
            //return value.charAt(0);
            return value;
      yAxes: ({
        ticks: {
          beginAtZero: true,
          maxTicksLimit: 5,
          //stepSize: Math.ceil(250 / 5),
          stepSize: Math.ceil(150),
          //max: 250
    elements: {
      point: {
        radius: 0,
        hitRadius: 10,
        hoverRadius: 4,
        hoverBorderWidth: 3,

Networking – Iptables -m state problems

Good evening,

I'm having trouble with the following iptables rule on Ubuntu 17.10:

iptables -A OUTPUT -p tcp –sport 22 -m state –state ESTABLISHED -j ACCEPT

I get the error "No chain / target / match" with this input and continue to receive this error unless I remove "-m state –state ESTABLISHED".

Do you have suggestions for places where you can look for potential problems and / or potential issues with my submissions?

android – Problems with the context menu in the list view with the spinner

I have a problem opening a context menu in a list view with a spin button.
I registered my list with onCreate:


I created the menu and added its listener:

public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    MenuItem remover = menu.add("Remover");
    remover.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
        public boolean onMenuItemClick(MenuItem item) {
            return false;

However, my list is an adapter that I created, and there is a spin box in each row.
If I press and hold somewhere else in the list, the menu will not be displayed at all. But if I press and hold the knob, the menu will appear. But I do not want a menu for the spinner, but for the list entry.

I took a look at it and recommended putting a setFocusable (false) in the spinner. Still, I still have the problem. Does anyone know how to fix this?

Canon – Tamron 24-70mm F / 2.8 Battery consumption problems

Ok, that's a bit strange. Please bear it with me.

The camera is a Canon 6D and the lens is a Tamron 24-70mm 1: 2.8V (first generation, not the G2). If I have this lens with my camera and use a 100% full battery and the camera does not use for two days, the battery is completely empty.

I looked around a bit and apparently several people reported it. Some say that this is only the case with low serial numbers, but others report the same problem with newer ones. Some people said that disabling VC fixed the problem for them, and now it's weird.

Turning off VC initially seemed to fix the problem, but after the battery was full for 2 days (the camera was not used at all!), It suddenly dropped to 40% on the third day.

Always taking the battery out is not ideal anyway. What could cause this, and is there a way to fix it? I would be happy if only turning off VC would solve the problem, but that also seems to be a hit and miss.

I understand that many electronic devices are not completely turned off when they are "off", but I do not see what can lead to this significant decrease. Sometimes up to 4% per hour is "turned off".

Can I do anything other than send it to Tamron for repair or replacement?

Problems Creating Jenkins for Angle Components for Property & # 39; auto & # 39; css

In the square component template file, I use the CSS property & # 39; auto & # 39; with ngStyle like this:

'height' : (some_condition) ? '16px' : auto

The component works as expected.

But in Jenkins build, I get the following error:

The property "auto" does not exist for the type "MyComponent".

What is the reason for this mistake and how can you eliminate it?

Algorithms – Are all problems in EXP karp reduced to EXP-Complete?

According to Wikipedia and other sources, there is a complete language $ L in EXP $ so for all languages $ L & # 39; $ in the $ EXP $ there is a polynomial reduction $ f $ the converted instance of $ L & # 39; $ in $ L $ in the polynomial period. I think that definition is fine, but I have some observations that confuse me. I construct a language $ L & # 39; & # 39; $ in the $ EXP $ so that $ L & # 39; & # 39; $ can not be converted into $ L $ with polynomial time cuts and $ L & # 39; & # 39; $ is in $ EXP $ with an algorithm M in this way:

1) $ input (i, x) $

2) run $ f_i (i, x) $ at the most on time $ 2 ^ n $ if the calculation time is greater than $ n ^ { log n} $ then accept.

3) otherwise accept $ (i, x) $ iff $ f_i (i, x) not in L $,

Obviously $ Language (M) in EXP $ So there is a polynomial time reduction of $ Language (M) $ to $ L $ However, this is a contradiction, since M prevents the reduction of less than $ n ^ { log n} $ time to $ L $,

My question is: where is my mistake?