How to count how many times a word appears in the files in each folder?

I have a directory with a lot of subdirectories with text files in them. I need to know how many times “foo” appears in every single subdirectory (but only at the first level), not the total sum of the word “foo” existing in all the subdirectories . In fewer words I would solve this by simply running manually on each directory

grep -riwo 'foo' | wc -l  

Obviosly because there are a lot of them this isn’t feasible. So I tried this on the directory containing the subdirectories

ls -1 | xargs -L1 grep -riwo 'foo' | wc -l 

But this doesn’t work also because from what I got wc gets the outputs only after grep has been executed on all the folders, piping a complete list with all the results to wc that simply outputs the total sum of “foo” occurring in all the directories, making xargs unnecessary at that point

“Failed to Create cuSolverDN Instance” Appears Seemingly Randomly

I am aware that this issue has been highlighted multiple times by others(Failed to create cuSolverDN instance and Tensorflow GPU: Failed to create cuSolverDN instance); however, these were asked some time ago and were recreated under different circumstances.

I have been using Tensorflow for creating an RNN that classifies handwriting(here is my code), and it has produced entirely different results seemingly randomly. At times it will work completely fine, whereas sometimes it will create the following error:

2019-06-21 12:52:48.561331: I T:\src\github\tensorflow\tensorflow\core\kernels\cuda_solvers.cc:159] Creating CudaSolver handles for stream 000001C0904E7E70 2019-06-21 12:52:49.111234: F T:\src\github\tensorflow\tensorflow\core\kernels\cuda_solvers.cc:94] Check failed: cusolverDnCreate(&cusolver_dn_handle) == CUSOLVER_STATUS_SUCCESS Failed to create cuSolverDN instance. 


The problem arises when using CuDNNLSTM in order to make the RNN much faster. Just an hour ago, the program ran without any difficulties; now it ends in the same error regarding the cuSolverDN instance. I am running the code with a GeForce MX250 graphics card.

How to export a large WhatsApp chat with media exactly as it appears on my phone?

I want to export a huge WhatsApp conversation (346,000 messages) along with media (photos, videos and voice notes) to my computer exactly as it appears on WhatsApp.

There is a Chrome extension that does exactly what I want by downloading the conversation from WhatsApp Web as HTML. But, it crashes around 100,000 texts. Is there any other way?

I can’t export it directly through WhatsApp because it’s limited to 40,000 texts. Also, my phone is not rooted so extracting the SQLite files is not an option.

(Technical answers are highly encouraged)

Why heat map appears as a single line? Should I need to specify any parameter?

I want to plot heat map using filter weights. I used a filter of width 2 and perform 1D convolution. My data has a shape of (500,2). I am using imshow command to plot heat map which also contain negative values. But my heatmap is a single line not showing any colors. What can be reason and how to fix it?

`plt.imshow(data)` 

The “XsltListViewWebPart” Web Part appears to be causing a problem. Unable to find the specified file

I have a SharePoint Online Site Classic team site template. I also have 1 blogs site as subsite underneath it. On top level site i am using content query webpart to publish blog items from blogs subsite.

Now i am trying to assign users to add comments on the posts. To do that i went to blogs site –> Site Contents–> Comments–> Lists Settings–>Permissions for this list.

On that page i broke inheritance and assigned visitors group a contribute access.

When i did that xslt webpart on top level site bombed. It triggered following error.

The “XsltListViewWebPart” Web Part appears to be causing a problem. Unable to find the specified file.

I dont know why this is happening, I have implemented this in SharePoint 2013 onprem no problem. Why is Sp online acting the way it is.

Any way to mitigate this issue?

How to install Ubuntu if the free space appears as unusable?

I’m trying to install Ubuntu alongside Windows 7. I made a partition while preparing for the installation in windows of 50Gb. I’m trying to install it right now and after making selecting some space for the swap (i dont know what that is. I’m an absolute beginner and the guide says so) I should now make some other partitions for Ubuntu, but i cant use the remaining space. I’m afraid of deleting anything because the other partitions are from windows.

Right now I can’t event access Windows. I’m afraid it might have somehow disappeared.

This is what the screen looks like

To be honest what I’m most concerned right now is recovering Windows, but I guess that it is impossible to do so until Ubuntu has finished installing.

The menu does not work when you log in it appears blocked

can you help me? I am developing an app with the stack mean I have a problem when I start the session in the app. The menu options seem to be blocked and I must refresh the page so that they are enabled.

Any ideas?

I am using the version of Materialize 1.0.0 and jquery 3.4.1

The template is the following but I update it to the new versions of materialize and jquery I do not know if I need to modify something else:

[https://github.com/rahmato/free-materialize-material-design-admin-template][1]

This is the menu code:

<header id="header" class="page-topbar" *ngIf="auth.isLoggedIn()">       <!-- start header nav-->       <div class="navbar-fixed">         <nav class="navbar-color gradient-45deg-light-blue-cyan">           <div class="nav-wrapper">             <ul class="left">               <li>                 <h1 class="logo-wrapper">                   <a href="index.html" class="brand-logo darken-1">                     <img src="../../../assets/images/logo/materialize-logo.png" alt="materialize logo">                     <span class="logo-text hide-on-med-and-down">Materialize</span>                   </a>                 </h1>               </li>             </ul>             <ul class="right hide-on-med-and-down">               <li>                 <a href="javascript:void(0);" class="waves-effect waves-block waves-light translation-button" data-target="translation-dropdown">                   <span class="flag-icon flag-icon-gb"></span>                 </a>               </li>               <li>                 <a href="javascript:void(0);" class="waves-effect waves-block waves-light toggle-fullscreen">                   <i class="material-icons">settings_overscan</i>                 </a>               </li>               <li>                 <a href="javascript:void(0);" class="waves-effect  notification-button" data-target="notifications-dropdown">                   <i class="material-icons">notifications_none                     <small class="notification-badge pink accent-2">5</small>                   </i>                 </a>               </li>               <li>                 <a href="#" class="waves-effect waves-block waves-light profile-button" data-target="profile-dropdown">                   <span class="avatar-status avatar-online">                     <img src="../../../assets/images/avatar/avatar-7.png" alt="avatar">                     <i></i>                   </span>                 </a>               </li>               <li>                 <a href="#" data-target="chat-out" class="waves-effect waves-block waves-light chat-collapse">                   <i class="material-icons">format_indent_increase</i>                 </a>               </li>             </ul>             <!-- translation-button -->             <ul id="translation-dropdown" class="dropdown-content">               <li>                 <a href="#!" class="grey-text text-darken-1">                   <i class="flag-icon flag-icon-gb"></i> English</a>               </li>               <li>                 <a href="#!" class="grey-text text-darken-1">                   <i class="flag-icon flag-icon-fr"></i> French</a>               </li>               <li>                 <a href="#!" class="grey-text text-darken-1">                   <i class="flag-icon flag-icon-cn"></i> Chinese</a>               </li>               <li>                 <a href="#!" class="grey-text text-darken-1">                   <i class="flag-icon flag-icon-de"></i> German</a>               </li>             </ul>             <!-- notifications-dropdown -->             <ul id="notifications-dropdown" class="dropdown-content">               <li>                 <h6>NOTIFICATIONS                   <span class="new badge">5</span>                 </h6>               </li>               <li class="divider"></li>               <li>                 <a href="#!" class="grey-text text-darken-2">                   <span class="material-icons icon-bg-circle cyan small">add_shopping_cart</span> A new order has been placed!</a>                 <time class="media-meta" datetime="2015-06-12T20:50:48+08:00">2 hours ago</time>               </li>               <li>                 <a href="#!" class="grey-text text-darken-2">                   <span class="material-icons icon-bg-circle red small">stars</span> Completed the task</a>                 <time class="media-meta" datetime="2015-06-12T20:50:48+08:00">3 days ago</time>               </li>               <li>                 <a href="#!" class="grey-text text-darken-2">                   <span class="material-icons icon-bg-circle teal small">settings</span> Settings updated</a>                 <time class="media-meta" datetime="2015-06-12T20:50:48+08:00">4 days ago</time>               </li>               <li>                 <a href="#!" class="grey-text text-darken-2">                   <span class="material-icons icon-bg-circle deep-orange small">today</span> Director meeting started</a>                 <time class="media-meta" datetime="2015-06-12T20:50:48+08:00">6 days ago</time>               </li>               <li>                 <a href="#!" class="grey-text text-darken-2">                   <span class="material-icons icon-bg-circle amber small">trending_up</span> Generate monthly report</a>                 <time class="media-meta" datetime="2015-06-12T20:50:48+08:00">1 week ago</time>               </li>             </ul>             <!-- profile-dropdown -->             <ul id="profile-dropdown" class="dropdown-content">               <li>                 <a href="#" class="grey-text text-darken-1">                   <i class="material-icons">face</i> Profile</a>               </li>               <li>                 <a href="#" class="grey-text text-darken-1">                   <i class="material-icons">settings</i> Settings</a>               </li>               <li>                 <a href="#" class="grey-text text-darken-1">                   <i class="material-icons">live_help</i> Help</a>               </li>               <li class="divider"></li>               <li>                 <a href="#" class="grey-text text-darken-1">                   <i class="material-icons">lock_outline</i> Lock</a>               </li>               <li>                 <a class="grey-text text-darken-1" (click)="auth.logout()">                   <i class="material-icons">keyboard_tab</i> Logout</a>               </li>             </ul>           </div>         </nav>       </div>       <!-- end header nav-->     </header> 

and This is the script:

/*Preloader*/ $  (window).on('load', function () {   setTimeout(function () {     $  ('body').addClass('loaded');   }, 200); });  $  (function () {    "use strict";    var window_width = $  (window).width();     // Search class for focus   $  ('.header-search-input').focus(     function () {       $  (this).parent('div').addClass('header-search-wrapper-focus');     }).blur(       function () {         $  (this).parent('div').removeClass('header-search-wrapper-focus');       });    // Check first if any of the task is checked   $  ('#task-card input:checkbox').each(function () {     checkbox_check(this);   });    // Task check box   $  ('#task-card input:checkbox').change(function () {     checkbox_check(this);   });    // Check Uncheck function   function checkbox_check(el) {     if (!$  (el).is(':checked')) {       $  (el).next().css('text-decoration', 'none'); // or addClass     } else {       $  (el).next().css('text-decoration', 'line-through'); //or addClass     }   }   // Plugin initialization    $  ('select').formSelect();   // Set checkbox on forms.html to indeterminate   var indeterminateCheckbox = document.getElementById('indeterminate-checkbox');   if (indeterminateCheckbox !== null)     indeterminateCheckbox.indeterminate = true;    $  ('.profile-btn').dropdown({     inDuration: 300,     outDuration: 225,     constrainWidth: false,     gutter: 0,     coverTrigger: false,     alignment: 'right',     stopPropagation: false   });    // Commom, Translation & Horizontal Dropdow    $  ('.dropdown-trigger, .translation-button, .dropdown-menu').dropdown({     inDuration: 300,     outDuration: 225,     constrainWidth: false,     hover: true,     gutter: 0,     coverTrigger: false,     alignment: 'left',     stopPropagation: false   });   // Notification, Profile & Settings Dropdown   $  ('.notification-button, .profile-button, .dropdown-settings').dropdown({     inDuration: 300,     outDuration: 225,     constrainWidth: false,     hover: true,     gutter: 0,     coverTrigger: false,     alignment: 'right',     stopPropagation: false   });    // Materialize scrollSpy   $  ('.scrollspy').scrollSpy();    // Materialize tooltip   $  ('.tooltipped').tooltip({     delay: 50   });    //Main Left Sidebar Menu   $  ('.sidenav').sidenav({     edge: 'left', // Choose the horizontal origin     preventScrolling: false   });    // Overlay Menu (Full screen menu)   $  ('.menu-sidebar-collapse').sidenav({     menuWidth: 240,     edge: 'left', // Choose the horizontal origin     //sidenav-close:true, // Set if default menu open is true     //menuOut: false // Set if default menu open is true   });    //Main Left Sidebar Chat   $  ('.chat-collapse').sidenav({     menuWidth: 300,     edge: 'right',   });    // Pikadate datepicker   $  ('.datepicker').datepicker({     selectMonths: true, // Creates a dropdown to control month     selectYears: 15 // Creates a dropdown of 15 years to control year   });    // Perfect Scrollbar   $  ('select').not('.disabled').formSelect();   var leftnav = $  (".page-topbar").height();   var leftnavHeight = window.innerHeight - leftnav;   if (!$  ('#slide-out.leftside-navigation').hasClass('native-scroll')) {     $  ('.leftside-navigation').perfectScrollbar({       suppressScrollX: true     });   }   var righttnav = $  ("#chat-out").height();   $  ('.rightside-navigation').perfectScrollbar({     suppressScrollX: true   });    // Fullscreen   function toggleFullScreen() {     if ((document.fullScreenElement && document.fullScreenElement !== null) ||       (!document.mozFullScreen && !document.webkitIsFullScreen)) {       if (document.documentElement.requestFullScreen) {         document.documentElement.requestFullScreen();       } else if (document.documentElement.mozRequestFullScreen) {         document.documentElement.mozRequestFullScreen();       } else if (document.documentElement.webkitRequestFullScreen) {         document.documentElement.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT);       }     } else {       if (document.cancelFullScreen) {         document.cancelFullScreen();       } else if (document.mozCancelFullScreen) {         document.mozCancelFullScreen();       } else if (document.webkitCancelFullScreen) {         document.webkitCancelFullScreen();       }     }   }    $  ('.toggle-fullscreen').click(function () {     toggleFullScreen();   });    // Toggle Flow Text   var toggleFlowTextButton = $  ('#flow-toggle')   toggleFlowTextButton.click(function () {     $  ('#flow-text-demo').children('p').each(function () {       $  (this).toggleClass('flow-text');     })   });    // Detect touch screen and enable scrollbar if necessary   function is_touch_device() {     try {       document.createEvent("TouchEvent");       return true;     } catch (e) {       return false;     }   }   if (is_touch_device()) {     $  ('#nav-mobile').css({       overflow: 'auto'     })   } });