Need help with a work around

I need to take the ‘Office’ display of the ‘Created By’ column and display the first 5 digits of it so that my flows can run a conditional check on it. The reason is that Microsoft flows has all the ‘Created By’ dynamic contents besides ‘Office’.

I figured simple enough I’ll just do a calculated column on the SharePoint list. Then I find out that ‘Created By’ cannot be used in calculated columns.

So I figured I’ll have my PowerApp write the Users ‘Office’ as a default to a field when submitting a form and calculate it off that column. Unfortunately PowerApps only has User().FullName, Email, and Image.

I have pretty much exhausted the options for a workaround that my knowledge will allow. Hopefully someone might have some ideas.

Send mail in list event receiver work only for site owners

I have simple event receiver start after save item, do something and send mail, there is part of code:

SPSecurity.RunWithElevatedPrivileges(delegate () { MailMessage mailMessage = new MailMessage(); mailMessage.IsBodyHtml = true; mailMessage.From = new MailAddress(settings.MailSender, settings.MailSenderTitle); mailMessage.Subject = subject; mailMessage.Body = stringBuilder.ToString(); mailMessage.To.Add(to); SmtpClient smptClient = new SmtpClient(settings.MailSMTP); smptClient.Credentials = CredentialCache.DefaultNetworkCredentials; smptClient.Send(mailMessage); }); 

It’s work only if the user has full control permissions. I try change smptClient.Credentials to new NetworkCredential(ReadAppSettings.SP_SuperUser, ReadAppSettings.SP_SuperUserPassword, “domain”); but the same issue. But if the user that not have full control created for them self for example alter on list a do some change, server will send to him mail. So i thinking that my problem is in code, so how force code to sending mail if user don’t have permission.

Can I work with Sharepoint framework without access to Github?

According to “set up your sharepoint framework development environment”, I need to install node.js and then use its command to download further package (yo and gulp) from github. I installed node success with the msi installer. But yo and gulp have been installed with some warning.

However my dev server cannot direct access Internet and Github. I fail on almost every step. (e.g. cannot find module ‘@microsoft/sp-build-web’)

Is there any article talk about offline environment or any official source saying github is essential?

Why many proprams on Kubuntu can not work with NTFS secondary hdd drive?

I have Linux Kubuntu 18.04.2 on ssd with ext4, and I have secondary hdd drive with NTFS shared with Windows 10.

I can read and write on NTFS disk with Dolpfin and some programs, for example kate.

But many programs can not work with NTFS drive, like Telegram, Skype, Xnviewmp.

If I tried to send foto from NTFS with Skype or TElegram it fails. Failed on viewing foto with Xnviewmp. But works fine with default Kubuntu image viewer (gneview).

How to fix this?

Nginx Clean URLs don’t work

I tried this: How do I enable clean URLs with Nginx?

And I tried this:

So, I tried these:

 location / {     index index.php;     # This is cool because no php is touched for static content     try_files $  uri $  uri/ @rewrite;     expires max;   }    location @rewrite {     # Some modules enforce no slash (/) at the end of the URL     # Else this rewrite block wouldn't be needed (GlobalRedirect)     rewrite ^/(.*)$   /index.php?q=$  1;   }    location ~ \.php$   {     include fastcgi_params;     fastcgi_param SCRIPT_FILENAME /srv/www/$  fastcgi_script_name;     fastcgi_intercept_errors on;     fastcgi_pass unix:/var/run/php-fpm.sock; # fastcgi_pass unix:/tmp/php5-fpm.sock;  } 

And I tried these:

server {      listen       80;      server_name;       location / {          root   /path/to/drupal;          index  index.php;          error_page 404 = @drupal;      }       location @drupal {          rewrite ^(.*)$   /index.php?q=$  1 last;      }  } 

And clean URL’s don’t work. The site runs at ip address in a subdir

It has its own config at /etc/nginx/sites-available/dev and symlinked to /etc/nginx/sites-enabled/dev

This is my current sites-available/default config:

 root /var/www;   # Add index.php to the list if you are using PHP  index index.html index.htm index.php;   server_name _;   location / {  # First attempt to serve request as file, then  # as directory, then fall back to displaying a 404.  # try_files $  uri $  uri/ =404;  try_files $  uri $  uri/ @rewrite;  expires max;  }   location @rewrite {    # Some modules enforce no slash (/) at the end of the URL    # Else this rewrite block wouldn't be needed (GlobalRedirect)    rewrite ^/(.*)$   /index.php?q=$  1;  }   # pass the PHP scripts to FastCGI server listening on  #  location ~ \.php$   {  include snippets/fastcgi-php.conf;   # With php7.0-cgi alone:  # fastcgi_pass;  # With php7.0-fpm:   fastcgi_pass unix:/run/php/php7.0-fpm.sock;   }   # deny access to .htaccess files, if Apache's document root  # concurs with nginx's one  #  location ~ /\.ht {   deny all;  } } 

This is my current sites-available/dev config:

server {          server_name dev;         root /var/www/dev; ## <-- Your only path reference.          # Enable compression, this will help if you have for instance advagg module         # by serving Gzip versions of the files.         gzip_static on;          location = /favicon.ico {                 log_not_found off;                 access_log off;         }          location = /robots.txt {                 allow all;                 log_not_found off;                 access_log off;         }          # This matters if you use drush prior to 5.x         # After 5.x backups are stored outside the Drupal install.         #location = /backup {         #        deny all;         #}          # Very rarely should these ever be accessed outside of your lan         location ~* \.(txt|log)$   {                 allow;                 deny all;         }          location ~ \..*/.*\.php$   {                 return 403;         }          # No no for private         location ~ ^/sites/.*/private/ {                 return 403;         }          # Block access to "hidden" files and directories whose names begin with a         # period. This includes directories used by version control systems such         # as Subversion or Git to store control files.         location ~ (^|/)\. {                 return 403;         }    location / {     index index.php;     # This is cool because no php is touched for static content     try_files $  uri $  uri/ @rewrite;     expires max;   }    location @rewrite {     # Some modules enforce no slash (/) at the end of the URL     # Else this rewrite block wouldn&#39;t be needed (GlobalRedirect)     rewrite ^/(.*)$   /index.php?q=$  1;   }    location ~ \.php$   {     include fastcgi_params;     fastcgi_split_path_info ^(.+\.php)(/.+)$  ;     fastcgi_param SCRIPT_FILENAME $  request_filename;     fastcgi_intercept_errors on;     fastcgi_pass unix:/run/php/php7.0-fpm.sock;  }          # Fighting with Styles? This little gem is amazing.         # This is for D6         #location ~ ^/sites/.*/files/imagecache/ {         # This is for D7 and D8         location ~ ^/sites/.*/files/styles/ {                 try_files $  uri @rewrite;         }          location ~* \.(js|css|png|jpg|jpeg|gif|ico)$   {                 expires max;                 log_not_found off;         }  } 

I restart nginx server by running sudo service nginx restart

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:


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') () {     $  ('#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'     })   } }); 

How does the MAD (Multiply, Add, Divide) Hashing function work?

I have been assigned as a university project the task to create data structures (such as minheap, hashtable etc.) from scratch. However the Hashtable or more specifically the Hash maps – functions have given me quite some trouble. I have come across the MAD (Multiply, Add, Divide) function which basically is: h(x) = [(a*x + b) % p] % N, where a,b : random integers, p : large prime number and N : number of elements in hashtable.

My question is how (and why) exactly does this function distribute evenly the values in the hashtable.