twentysixteen child theme – responsive menu – ham icon button not working – Cannot read property ‘classList’ of null

I am trying to convert this site http://buildandtest.atspace.cc/ into twentysixteen child theme. It appears that /js/menu.js in my child theme is not working as nothing happens when the ham icon button is clicked (pls.see my site link above to check correct behavior). On inspecting via Google Chrome Inspect I am getting the following errors:

Uncaught TypeError: Cannot read property ‘classList’ of null at mediaqueryresponse (menu.js?ver=5.3.2:19) at menu.js?ver=5.3.2:10 at menu.js?ver=5.3.2:31 mediaqueryresponse @ menu.js?ver=5.3.2:19 (anonymous) @ menu.js?ver=5.3.2:10 (anonymous) @ menu.js?ver=5.3.2:31

Any advice is appreciated

header.php in child theme

<header class="header" id='myTopnav'>  <?php  wp_nav_menu(              array(                   'theme_location'=> 'topnav',                   'container' => 'nav',                   'menu_class' => 'topnav',                   'menu_id'    => 'myTopnav',                   )  );?>  <button class="ham-icon"><span class="fa fa-bars fa-2x"></span></button>  </header> 

/js/menu.js in child theme

(function () {   var mql = window.matchMedia("screen and (max-width: 960px)");   //detect media query    var navTop = document.querySelector(".header");   //return first element within the document that matches .header    var toggle = document.querySelector(".ham-icon");    mediaqueryresponse(mql);   //ensures that addListener function is executed when the page loads, by default addListener only fires when state of the window changes   mql.addListener(mediaqueryresponse);    function mediaqueryresponse(mql) {     if (mql.matches) {       toggle.addEventListener("click", clickMenu);       //if media query matches, execute click or clickMenu event     } else {       navTop.classList.remove("responsive");       //otherwise remove .responsive       toggle.removeEventListener("click", clickMenu);       //and remove EventListener     }    }    function clickMenu() {     navTop.classList.toggle("responsive");   }  })(); 

load local data on fixed width file inserting all columns with NULL values

Last month I had occasion to load about 50 GB of data from fixed-width dat files. There were 7 files so I created 7 tables. I created 7 LOAD DATA LOCAL INFILE scripts to load the data and it all worked fine resulting in over 70 million rows. The data is available with updates on the 10th of the month so I downloaded the files and ran my scripts on them and only 1 worked and the rest loaded the number of rows but with all of the columns NULL. I’ve compared the previous files with the new ones and cannot find any difference that would cause this. I’ve put a small amount of data that’s failing in a test.dat file and am getting the same results, but have not been able to determine why this is happening or why one works and the rest don’t? I don’t see any difference between the files or the sql that loads them? I’ve tried changing the encoding, line endings, permissions, ownership, and various other things without success. There are no errors thrown, it just loads NULL values. Has anyone ran across this before?

Here is an example table with the load sql

DROP TABLE IF EXISTS exp_gpoper; CREATE TABLE `exp_gpoper` (   `_id` int(11) NOT NULL AUTO_INCREMENT,   `date_updated` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),   `pun_county_num` varchar(100) DEFAULT '',   `pun_lease_num` varchar(100) DEFAULT '',   `pun_sub_num` varchar(100) DEFAULT '',   `pun_merge_num` varchar(100) DEFAULT '',   `company_number` varchar(100) DEFAULT '',   `company_name` varchar(300) DEFAULT '',   PRIMARY KEY (`_id`),   KEY `date_updated` (`date_updated`),   KEY `pun_county_num` (`pun_county_num`),   KEY `pun_lease_num` (`pun_lease_num`),   KEY `pun_merge_num` (`pun_merge_num`),   KEY `pun_sub_num` (`pun_sub_num`),   KEY `company_number` (`company_number`),   KEY `company_name` (`company_name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;  LOAD DATA LOCAL INFILE 'test.dat'  INTO TABLE exp_gpoper  (@_row)  SET `pun_county_num` = TRIM(SUBSTR(@row,1,3)),  `pun_lease_num` = TRIM(SUBSTR(@row,4,6)),  `pun_sub_num` = TRIM(SUBSTR(@row,10,1)),  `pun_merge_num` = TRIM(SUBSTR(@row,11,4)),  `company_number` = TRIM(SUBSTR(@row,15,7)),  `company_name` = TRIM(SUBSTR(@row,22,255)); 

Here is the content of the test.dat file:

001000000000000077777OTC USE                                                                                                                                                                                                                                                         003000000000000077777OTC USE                                                                                                                                                                                                                                                         003000567000000020011M & D PUMPING SERVICE INC                                                                                                                                                                                                                                       003000587000000022576SCOGGINS PRODUCTION LLC                                                                                                                                                                                                                                         003000588000000022576SCOGGINS PRODUCTION LLC                                                                                                                                                                                                                                         003000639000000017441CHESAPEAKE OPERATING LLC                                                                                                                                                                                                                                        003000963000000019694BVD INC                                                                                                                                                                                                                                                         003000964000000018119BLAKE PRODUCTION CO INC                                                                                                                                                                                                                                         003002207124830022281SANDRIDGE EXPLORATION AND PRODUCTION LLC                                                                                                                                                                                                                        003002394000000020891SUPERIOR OIL & GAS LLC                                                                                                                                                                                                                                           

This works fine:

DROP TABLE IF EXISTS `exp_gpexempt`; CREATE TABLE `exp_gpexempt` (   `_id` int(11) NOT NULL AUTO_INCREMENT,   `date_updated` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),   `pun_county_num` varchar(100) DEFAULT '',   `pun_lease_num` varchar(100) DEFAULT '',   `pun_sub_num` varchar(100) DEFAULT '',   `pun_merge_num` varchar(100) DEFAULT '',   `exemption_type` varchar(100) DEFAULT '',   `code` varchar(100) DEFAULT '',   `exemption_percentage` varchar(100) DEFAULT '',   PRIMARY KEY (`_id`),   KEY `date_updated` (`date_updated`),   KEY `pun_county_num` (`pun_county_num`),   KEY `pun_lease_num` (`pun_lease_num`),   KEY `pun_merge_num` (`pun_merge_num`),   KEY `exemption_type` (`exemption_type`),   KEY `code` (`code`),   KEY `exemption_percentage` (`exemption_percentage`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;  LOAD DATA LOCAL INFILE 'test2.dat'  INTO TABLE exp_gpexempt (@_row) SET `pun_county_num` = TRIM(SUBSTR(@_row,1,3)), `pun_lease_num` = TRIM(SUBSTR(@_row,4,6)), `pun_sub_num` = TRIM(SUBSTR(@_row,10,1)), `pun_merge_num` = TRIM(SUBSTR(@_row,11,4)), `exemption_type` = TRIM(SUBSTR(@_row,15,50)), `code` = TRIM(SUBSTR(@_row,65,5)), `exemption_percentage` = TRIM(SUBSTR(@_row,70,24)); 

Here is the content of the test2.dat file:

00300063900000School District                                   05   00000000000.000293000000 00300365500000State School Land Commission                      01   00000000000.125000000000 00301843300000State School Land Commission                      01   00000000000.125000000000 00302942700633State School Land Commission                      01   00000000000.125000000000 00302942800633State School Land Commission                      01   00000000000.125000000000 00303004100000Federal                                           02   00000000000.067632900000 00303004200000Federal                                           02   00000000000.125000000000 00303004600000Federal                                           02   00000000000.125000000000 00303004700000Federal                                           02   00000000000.125000000000 00303004800000Federal                                           02   00000000000.125000000000  

NULL as a @variable within WHERE clasue

I would like to SET ‘IS NULL’ as a variable and use it in a WHERE clause. I will be unioning many tables together that carry the same WHERE clause and would like flexibility to use a variable for my yearCompleted column – see example below-

DECLARE @YEARCOMPLETED SET @YEARCOMPLETED = NULL  SELECT * FROM TABLE1 WHERE yearCompleted = @YEARCOMPLETED UNION ALL SELECT * FROM TABLE2 WHERE yearCompleted = @YEARCOMPLETED 

In this instance is it possible to find rows where yearCompleted IS NULL using a variable?

delete node from linked list (lang w/GC) -should deleted item ‘next’ be set to null

Regarding: delete a node from a linked list algorithm,in procedural languages with garbage-collection. Should there be a step in the algorithm, of setting the removed-node-next-pointer to null ?

(Several high-school-CS-teachers in my area teach YES, while others teach NO)

What is the right approach?

/thanks ran

Search Analytics ViewsRecent & ViewsLifeTime is null

I’m trying to see the most viewed blog posts in a SharePoint farm. So I just query for:

https://sharepoint/_api/search/query?querytext='ContentTypeId:0x0110*' 

To get the ViewsLifeTime I have to include it as a sorting parameter. When I don’t add a ViewsLifeTime sort, ViewsLifeTime is null. Is that the correct behavior?

https://sharepoint/_api/search/query?querytext='ContentTypeId:0x0110*'&sortlist='ViewsLifeTime:Descending' 

Now this works for blog posts in one Web Application, but blog posts on the MySite WA never have ViewsLifeTime or ViewsRecent populated – they are always null. I do know that the blog posts are above the TailTrimming limit.

  1. When are these View-Events generated? Like what is the flow? User opens blog post > Usage event > Seach crawl > I can see the view event? Is search the only thing that needs to run or is there some timer job?
  2. Why do I get usage events in one web application, but not the other? Do I need to change timer jobs? Service associations? Web Application Features? Site Collection Features?
  3. How to reliably get ViewsLifeTime and ViewsRecent for everything? Is it correct that I always need to include to SortList parameter otherwise the views properties are null?

Error xhr.send( ( options.hasContent && options.data ) || null ); al enviar datos POST en Php

Salduos a todos.

Primero que todo, comento, que casi no sé nada de JavaScript y Ajax, por favor paciencia.

Tengo el siguiente código para insertar datos por Post en php:

function editar_aparatos(id) {             var parametros = {                 "action": "ajax",                 "id": id             };             $  .ajax({                 url: '../modal/editar/editar_aparatos.php',                 data: parametros,                 beforeSend: function(objeto) {                     $  ("#loader3").html("<img src='../../img/ajax-loader.gif'> Cargando...");                 },                 success: function(data) {                     $  (".outer_div3").html(data).fadeIn('slow');                     $  ("#loader3").html("");                 }             })         } 

Y al analizar el envío me presenta el siguiente error: xhr.send( ( options.hasContent && options.data ) || null );

Solo para llegar al error fue una odisea. No tengo ni idea de qué hacer.

Tengo otro código solo cambia la ruta y el objeto y funciona perfecto. (Lo coloco solo para fines de referencia):

function editar(id) {             var parametros = {                 "action": "ajax",                 "id": id             };             $  .ajax({                 url: '../modal/editar/consulta.php',                 data: parametros,                 beforeSend: function(objeto) {                     $  ("#loader2").html("<img src='../../img/ajax-loader.gif'> Cargando...");                 },                 success: function(data) {                     $  (".outer_div2").html(data).fadeIn('slow');                     $  ("#loader2").html("");                 }             })         } 

Gracias de antemano por la ayuda brindada.

How to parse JSON to return null as default if complex object empty/null/undefined?

Using HTTP Request to get SP item, having trouble parsing JSON to return anything for null object.

Can return null for an empty string column as shown below, how to do so for a more complex object like a lookup if no value selected?

{ "type": "object", "properties": {     "Area": {         "type": "object",         "properties": {             "Id": {                 "type": "integer"             }         }     },     "Package": {         "type": ["string","null"]     } } 

If object doesn’t exist in JSON output, can’t run logic against it (if null do this, else do that)

null inesperado en system.out.println

Pidiendo nombre, apellido y año de nacimiento al usuario se genera una clave provisoria, primero se separan las consonantes y las vocales de cada cadena por separado (nameC consonante, lastnC consonante, nameV vocales, lastnV vocales) luego se estima una edad restando el año ingresado a 2019.

La clave que genera esta compuesta por las consonantes de la cadena mas larga en mayúscula (nombre o apellido), las vocales en orden inversa de la cadena mas corta, también en mayúsculas y a lo ultimo la edad estimada.

Si ingreso para name = “Luis” lastname = “Espinoza” yearbirth = 1995 la clave debería ser: SPNZIU24 Sin embargo, la salida muestra: NULLSPNZIUNULL24 ¿Porque aparecen esos NULL?

import java.util.Scanner;  public class Key{  private Scanner sc = new Scanner(System.in); private String name; private String lastName; private String nameC; private String nameV; private String lastnC; private String lastnV; private String key; private int years; private int yearbirth = 0;  private void registration(){      System.out.println("Bienvenido a codigoJava, para ingresar necesitaremos unos pocos datos...");     System.out.println("Porfavor ingresa tu nombre");     name = sc.nextLine();     System.out.println("Porfavor ingresa tu apellido");     lastName = sc.nextLine();     System.out.println("Y para terminar año de nacimiento");     while(yearbirth<1900 || yearbirth>2019){         yearbirth = sc.nextInt();     } }  public int years(int yearbirth){     years = 2019 - yearbirth;     return years; }  private void keyBuilder(){      for(int i = 0; i < name.length(); i++){         if(name.charAt(i) == 'a' || name.charAt(i) == 'e' || name.charAt(i) == 'i' || name.charAt(i) == 'o' || name.charAt(i) == 'u' ){             nameV = name.charAt(i) + nameV;         }else{             nameC = nameC + name.charAt(i);         }     }     for(int o = 0; o < lastName.length() ; o++){         if(lastName.charAt(o) == 'a' || lastName.charAt(o) == 'e' || lastName.charAt(o) == 'i' || lastName.charAt(o) == 'o' || lastName.charAt(o) == 'u' ){             lastnV = lastName.charAt(o) + lastnV;         }else{             lastnC = lastnC + lastName.charAt(o);         }     }      if(lastnC.length() > nameC.length()){         key = lastnC.toUpperCase() + nameV.toUpperCase() + years(yearbirth);         System.out.println(key);     }else{         key = nameC.toUpperCase() + lastnV.toUpperCase() + years(yearbirth);         System.out.println(key);     } }    public static void main(String[]args){      Key newUser = new Key();     newUser.registration();     newUser.keyBuilder();  } 

}

Filter icon for “include null”

I’m designing an e-commerce site that allows for filtering on items based on attributes such as weight, size, price, etc. The problem is for certain attributes, like “weight”, some items have data, and others do not.

A user filtering by “weight” may want to be strict (only include items whose weight is known and in the desired range), or they may want to be lenient (include items whose weight is in the desired range, or unknown).

I could provide a checkbox that says “Include items with unknown weight”, but would much rather have this be a tooltip on some sort of icon button. The problem is, I’m unsure of what icon to use.

I’ve looked through Google’s Material Icons and cannot find anything that fits, nor can I even conceptualize what a good icon would look like. I’m hesitant to even mention the word “null” anywhere.

I’m stuck with three options:

  1. Make an button that says “n/a”, which is either pressed down, or not. The tooltip will will say “Including items with unknown weight”

    • Pros: Provides the user with the option.
    • Cons: Not simple. Another thing for the user to think about.

  1. Avoid this choice altogether and have no option. But what would the expected behavior be if the user is filtering by weight — hide items with unknown weights, or show items with unknown weights?

    • Pros: Simple.
    • Cons: May not meet user’s expectations. If hiding null values, may hide items the user cares about. If showing null values, may show too many null-weight items and give the appearance the filter is not working.

  1. Avoid the choice and have no options — if they are filtering by weight, then show items with unknown weights, but also include some sort of warning symbol on the item indicating the weight is unknown.

    • Pros: Simple.
    • Cons: Results may contain too many items with no weights and cause the user to scan too much.