## File uploaded to SharePoint library using JQuery and SharePointPlus js lib only from second click

I’m using createFile() method of SharepointPlus 5.2 js library to upload a file to a SharePoint 2013 library. It works perfect on most of the SP libraries. But on newly created SP libraries it throws an error (the file content is required) on first click, and then makes a proper upload on the second click. How to solve this issue?

<script type="text/javascript" src="/_layouts/15/MicrosoftAjax.js"></script> <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script> <script type="text/javascript" src="/_layouts/15/sp.js"></script> <script type="text/javascript" src="/_layouts/15/init.js"></script> <script type="text/javascript" src="/_layouts/15/core.js"></script> <script type="text/javascript" src="/_layouts/15/1049/strings.js"></script> <script type="text/javascript" src="/_layouts/15/sp.ui.dialog.js"></script> <script type="text/javascript" src="/SiteAssets/_js/jquery-3.3.1.min.js"></script> <script type="text/javascript" src="/SiteAssets/_js/bootstrap.min.js"></script> <script type="text/javascript" src="/SiteAssets/_js/sharepointplus-5.2.min.js"></script> 

The HTML body:

<div data-role="form" class="container form">      <div data-field="Title">             <label class="form_label required">Title:</label><br>             <input class="form_field required" value=""></input>         </div>          <div id="fileUploadControl" >          <label class="form_label required">Document selection:</label><br/>          <input id="fileUploadInput" class="form_field" type="file"/>          </div>      <hr>      <div class="btn_panel">         <input type="button" class="btn" id="save_btn" name="Save" value="Save" onclick="_uploadFile();">          <input type="button" class="btn" id="cancel_btn" name="Cancel" value="Cancel">     </div>  </div> 

The JS function:

function _uploadFile() {    var Title = $('div[data-field="Title"] input').val(); var files = document.querySelector('#fileUploadInput').files; files = Array.prototype.slice.call(files); // read the files Promise.all(files.map(function(file) { return new Promise(function(prom_res, prom_rej) { // use fileReader var fileReader = new FileReader(); fileReader.onloadend = function(e) { file.content = e.target.result; prom_res(file); } fileReader.onerror = function(e) { prom_rej(e.target.error); } fileReader.readAsArrayBuffer(file); }); })).then(function(files) { // upload files return Promise.all(files.map(function(file) { return$  SP().list("8D5132D2-A458-4961-BCD6-FFD9CE964C0F").createFile({ //Doc lib UID         content:file.content,         filename:file.name,         fields:{             "Title":Title           }       });     }))   }).then(function(file) {         alert(file[0].Name+" has been uploaded");         console.log("Document " + file[0].Name+" has been uploaded to the Outgoing documents library");     }, function(error) {         console.log("Error: ",error);     }); } 

The error in Firefox console is

uncaught exception: [SharepointPlus ‘createFile’]: the file content is required.

Debugging the file object contents shows that it exists (the size in bytes is shown). Error handler doesn’t return an error text message. On the second click on the same form (without page refresh) uploads the file and gives success message. I’m stuck, if it is a SharePoint, JQuery or SharepointPlus issue, or some conflict. Normally, the file upload from the first click is expected as the same code works on other existing libraries.

## File uploaded to SharePoint library using JQuery and SharePointPlus js lib only from second click

I’m using createFile() method of SharepointPlus 5.2 js library to upload a file to a SharePoint 2013 library. It works perfect on most of the SP libraries. But on newly created SP libraries it throws an error (the file content is required) on first click, and then makes a proper upload on the second click. How to solve this issue?

<script type="text/javascript" src="/_layouts/15/MicrosoftAjax.js"></script> <script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script> <script type="text/javascript" src="/_layouts/15/sp.js"></script> <script type="text/javascript" src="/_layouts/15/init.js"></script> <script type="text/javascript" src="/_layouts/15/core.js"></script> <script type="text/javascript" src="/_layouts/15/1049/strings.js"></script> <script type="text/javascript" src="/_layouts/15/sp.ui.dialog.js"></script> <script type="text/javascript" src="/SiteAssets/_js/jquery-3.3.1.min.js"></script> <script type="text/javascript" src="/SiteAssets/_js/bootstrap.min.js"></script> <script type="text/javascript" src="/SiteAssets/_js/sharepointplus-5.2.min.js"></script> 

The HTML body:

<div data-role="form" class="container form">      <div data-field="Title">             <label class="form_label required">Title:</label><br>             <input class="form_field required" value=""></input>         </div>          <div id="fileUploadControl" >          <label class="form_label required">Document selection:</label><br/>          <input id="fileUploadInput" class="form_field" type="file"/>          </div>      <hr>      <div class="btn_panel">         <input type="button" class="btn" id="save_btn" name="Save" value="Save" onclick="_uploadFile();">          <input type="button" class="btn" id="cancel_btn" name="Cancel" value="Cancel">     </div>  </div> 

The JS function:

function _uploadFile() {    var Title = $('div[data-field="Title"] input').val(); var files = document.querySelector('#fileUploadInput').files; files = Array.prototype.slice.call(files); // read the files Promise.all(files.map(function(file) { return new Promise(function(prom_res, prom_rej) { // use fileReader var fileReader = new FileReader(); fileReader.onloadend = function(e) { file.content = e.target.result; prom_res(file); } fileReader.onerror = function(e) { prom_rej(e.target.error); } fileReader.readAsArrayBuffer(file); }); })).then(function(files) { // upload files return Promise.all(files.map(function(file) { return$  SP().list("8D5132D2-A458-4961-BCD6-FFD9CE964C0F").createFile({ //Doc lib UID         content:file.content,         filename:file.name,         fields:{             "Title":Title           }       });     }))   }).then(function(file) {         alert(file[0].Name+" has been uploaded");         console.log("Document " + file[0].Name+" has been uploaded to the Outgoing documents library");     }, function(error) {         console.log("Error: ",error);     }); } 

The error in Firefox console is

uncaught exception: [SharepointPlus ‘createFile’]: the file content is required.

Debugging the file object contents shows that it exists (the size in bytes is shown). Error handler doesn’t return an error text message. On the second click on the same form (without page refresh) uploads the file and gives success message. I’m stuck, if it is a SharePoint, JQuery or SharepointPlus issue, or some conflict. Normally, the file upload from the first click is expected as the same code works on other existing libraries.

## System of delay differential equations: using first interpolation as second initial condition

I am trying to solve numerically the following system of two coupled delay differential equations:

$$\dot x(t)=-\gamma x(t)-\frac{\gamma}{4}e^{i\omega_0\tau_1}y(t-\tau_1)\theta(t-\tau_1)+\frac{\gamma}{4}e^{i\omega_0\tau_2}y(t-\tau_2)\theta(t-\tau_2)+\frac{\gamma}{2}e^{i\omega_0\tau_3}x(t-\tau_3)\theta(t-\tau_3),$$ $$\dot y(t)= -\frac{\gamma}{2}y(t)-\frac{\gamma}{4}e^{i\omega_0\tau_1}x(t-\tau_1)\theta(t-\tau_1)+\frac{\gamma}{4}e^{i\omega_0\tau_2}x(t-\tau_2)\theta(t-\tau_2).$$ where $$\tau_1<\tau_2<\tau_3$$. The parameters $$\gamma, \omega_0$$ are constants, and $$\theta(t)$$ is the Heaviside step function. The history of the system is known for $$0\leq t\leq\tau_1$$: $$x(t)=e^{-\gamma t}, y(t)=e^{-\gamma t/2}.$$ Here what I tried:

I first solved the system for $$0\leq t\leq\tau_2$$ using the aforementioned initial history using NDSolve:

\[Gamma] = 1.0; \[Omega]0 = 2 Pi; \[Tau]1 = 1.0; \[Tau]2 = 2.0; \[Tau]3 = 3.0;  sol1 = NDSolve[{x'[   t] == - \[Gamma] x[t] - (\[Gamma]/4) E^(I \[Tau]1 \[Omega]0)     y[t - \[Tau]1],  y'[t] == - 0.5 \[Gamma] y[t] - (\[Gamma]/4) E^(    I \[Tau]1 \[Omega]0) x[t - \[Tau]1],  x[t /; t <= \[Tau]1] == (1.0/Sqrt[2.0]) Exp[-\[Gamma] t],  y[t /; t <= \[Tau]1] == (1.0/Sqrt[2.0]) Exp[-0.5 \[Gamma] t]}, {x,  y}, {t, 0, \[Tau]2}]; 

I get the following solution for $$|x(t)|^2$$ and $$|y(t)|^2$$:

The problem arises when I use this first interpolated solution as the initial history to solve for the next interval of time:

sol2 = NDSolve[{x'[   t] == - \[Gamma] x[t] - (\[Gamma]/4) E^(I \[Tau]1 \[Omega]0)     y[t - \[Tau]1] + (\[Gamma]/4) E^(I \[Tau]2 \[Omega]0)     y[t - \[Tau]2],  y'[t] == - 0.5 \[Gamma] y[t] - (\[Gamma]/4) E^(    I \[Tau]1 \[Omega]0) x[t - \[Tau]1] + (\[Gamma]/4) E^(    I \[Tau]2 \[Omega]0) x[t - \[Tau]2],  x[t /; t <= \[Tau]2] == Evaluate[x[t] /. sol1],  y[t /; t <= \[Tau]2] == Evaluate[y[t] /. sol1]}, {x, y}, {t,  0, \[Tau]3}];  

This time I get the following messages:

It seems that the second NDSolve (sol2) does not allow the interpolation of the first result as initial history. Any suggestion? Thank you in advance.

## Are there any Chosen left in Faerûn following the Second Sundering?

Throughout Toril’s history, its various deities have engaged in a practice of vesting mortals with power and purpose. Those mortals are sometimes called Chosen. The Sword Coast Adventurer’s Guide contains a number of references to Chosen — including their involvement in tumultuous events during the Second Sundering. See, e.g., p. 17 (“Throughout this period, tales began to spread of individuals who had been touched by the gods and granted strange powers. Some of these so-called Chosen were at the root of the conflicts that grip the land.”)

A couple of SCAG‘s references might be read to suggest that, after the Second Sundering, Chosen might have become a thing of the past. To wit:

• p. 9, a description of an uprising in Calimshan led by a Chosen of Ilmater notes that the Chosen disappeared and that “[m]any pray for the return of the Chosen and the completion of his work.”
• p. 12, a discussion of Mulhorand says “the Chosen of the gods began to appear in the last few years,” and then a few sentences later mentions that “the upheaval ended and the Chosen began to disappear . . . .”
• p. 18, detailing the year 1489 D.R., notes that by then “the deities ceased interfering with the world through their Chosen. The gods were no longer silent but quiet, and in many places new priesthoods arose to interpret the gods’ now subtle signs.”
• p. 45, a story about the grisly revelation “[j]ust a few years ago” that

None of these references mention any Chosen currently active in Faerûn. Several of them strongly imply that certain Chosen disappeared and have not reappeared.

Is there any evidence in first-party published materials that the Chosen are still a phenomenon in the post-Second Sundering world?

## Getting the URL of second last visited page in SharePoint

I am able to get the previous page URL, but also I need to get the URL of the second last visited page.

I have used the below code..

<script> _spBodyOnLoadFunctionNames.push("GetUrl");    function GetUrl() {    var referrer =  document.referrer; alert(referrer);  //var x=history.go(-2); //alert(x); } </script> 

but history.go(-2) will directly redirect to the second last visited page, how to get that url?

## How to mount a second hard drive which is showing the problem

I want to recover the data from my old drive…but when I am trying to mount it showing the problem..I am using ubuntu 14.0. it showing wrong fs type, bad option, bad super block…

## second HDD keep turning on and off

A PC of mine has 2 hard drive, 1 SSD and 1 HDD. Ubuntu 18.04 was installed on SSD and the HDD was kept as a storage data. the problem has occurred when I try to access the HDD it just some what disconnected itself and I can’t find it from the list even checking with gpart, no show HDD on it. Is there anyway I could check what was the problem with my PC

Thanks

## Just installed LVM Raid 1 on a new server with 2x 10Tb hard drives and the Disk I/O is killing everything else every second

I copied a bit of data on my LVM based RAID1 (not hardware RAID) with 2× 10Tb hard drives:

/dev/mapper/users-users  9.1T  1.9G  8.6T   1% /home 

and now it’s killing my I/O to the point where my mouse, keyboard, video are blocked/unblocked/blocked/unblocked…

I’m thinking that maybe something is wrong at the hardware level but wondering what that could be. Wondering what to test first to try to make a better diagnostic.

I have another 2 drives in the same drive array but they are not setup in RAID mode.

Looking at the output of iotop it tells me that there is about 2Mb/s written to disk, a pretty much permanent write… When I look at the Disk LED, I can see them come up and out over and over again and can hear the seeking heads too.

Trying to watch a video, it fails really bad. Choppy would not even be the word here. It’s like one image every other second if even that much. So a really big I/O killer for the entire computer.

Wondering whether someone would have encountered such a problem before and what can be done to fix it if possible (I certainly hope it is possible!)

My motherboard is a Supermicro X11DPH-T and I also got a case from Supermicro the 745BAC-R1K28B2 4U Full Tower Chassis. I’m running Ubuntu 18.04 LTS. The server is new and so is the install (i.e. not an upgrade from 16.04 or who knows what…)

Would there be a way to know whether a specific hard drive or some other hardware device is causing the trouble?

## install a second hard drive with ubuntu alongside windows 10

I currently use a computer with one hard drive where windows 10 is installed. I would like to put a second hard drive into my computer with ubuntu installed on it, and choose in which OS I would like to boot when starting my computer. Ubuntu is already installed on the second hard drive but is not in the computer yet.

My question is : Do I have to configure anything, or can I just put the second hard drive in my computer, and when I will turn it on again my screen will ask me automatically in which drive I want to boot ?

Thanks

## How to setup site with second specialised domain name with same content

I got a website: company-name-counselling.co.uk

I have setup all 4 versions of the domain to redirect to the https://www.company-name-counselelling.co.uk

I have also bought nearby-town-counselling.co.uk and other-town-counselling.co.uk

I want this site to appear in google when people search for counselling in nearby town.

I will update the title of the home page to include nearby-town when accessed on this domain but the content will mostly stay the same.

Will I benefit from having a specific domain for nearby-town or will the duplicate content penalise me?