10 de set. de 2021

Overwatch keeps minimizing (2021)

 After much suffering with the game minimizing without a cause. I had a glimpse of what could be. After installing the ZoneAlarm firewall, using restrictive mode, it asks for all actions that any program takes inside the computer or outside the internet. I noticed that the window below is called precisely and summative when I'm playing. I don't know what driver (dxgkrnl.sys) this is, or why Chrome would be calling it. But using Zonealarm in game mode, the game is no longer minimized, nor is this window displayed.


15 de ago. de 2019

No CORS headers sent in case of error 500 (Cakephp example)

Chrome is preflighting the request to look for CORS headers. If the request is acceptable, it will then send the real request. If you're doing this cross-domain, you will simply have to deal with it or else find a way to make the request non-cross-domain.



if($this->request->is('options')) { // @link: https://stackoverflow.com/a/21783145/5504312 return $this->response ->withHeader('Access-Control-Allow-Origin', '*') ->withHeader('Access-Control-Allow-Headers', '*') ->withHeader('Access-Control-Allow-Credentials', 'true') ->withHeader('Access-Control-Allow-Methods','OPTIONS, GET, POST'); } 

?>

11 de jan. de 2017

Dicas para usar campos XML no campo banco de dados PostgreSQL

Primeiro vamos criar uma tabela de testes:
CREATE TEMP TABLE fragmentos (
 id integer PRIMARY KEY,
 html xml
);
 
Agora inserir alguns dados:
INSERT INTO fragmentos (1, 'Apenas uma parágrafo');
INSERT INTO fragmentos (2, 'Uma XML com links para: <ul>
<li><a href="http://www.google.com/">Google.com</a></li>
<li><a href="http://www.yahoo.com/">Yahoo.com</a></li>
<li><a href="">Link vazio</a></li>
<li><a href="#top">Link archor</a></li>
</ul>
');

Para obter todos atributos HREF de todas as tags A de todos os registros da tabela

SELECT
  id,
  unnest(array_remove(xpath('//a/@href', xmlelement(name banana, html))::text[],'')) AS href
FROM fragmentos
GROUP BY 1,2
ORDER BY 2

21 de nov. de 2015

Dell KB522 Multimedia Keyboard - Play/Pause, Forward and Backward Keys don't work

Se você possui um teclado multimídia da DELL (no meu caso o KB522), espera que os botões reproduzir, pausar, próxima e anterior funcionem (no mínimo) nos programas Windows Media Player e Winamp. Mas eles não funcionam quando instalação básica de drivers do Microsoft Windows (no meu caso Windows 7).

Não existe um drive específico para este hardware, porém descobri que o programa Central de Mouse Teclado da Microsoft resolve o problema! Procure no Google o melhor link para instalá-lo.