Since most of the time you can fix broken file systems with an fsck, try..
$ sudo fsck /dev/mmcblk0p2
...if this fails continue here
10 Linux Fsck Command Examples to Check and Repair Filesystem
If you need to merge two arrays you can use the Array.concat() function:
var array1 = [1,2,3];
var array2 = [4,5,6];
console.log(array1.concat(array2)); // [1,2,3,4,5,6];
However, this function is not the most suitable to merge large arrays because it will consume a lot of memory by creating a new array. In this case, you can use Array.push.apply(arr1, arr2) which instead will not create a new array – it will merge the second array in the first one reducing the memory usage:
var array1 = [1,2,3];
var array2 = [4,5,6];
console.log(array1.push.apply(array1, array2)); // [1,2,3,4,5,6];
Cut and paste:
v to select characters (or uppercase V to select whole lines, or Ctrl-v to select rectangular blocks).d to cut (or y to copy).P to paste before the cursor, or p to paste after.Copy and paste is performed with the same steps except for step 4 where you would press y instead of d:
d stands for delete in Vim, which in other editors is usually called cut
y stands for yank in Vim, which in other editors is usually called copy
var data = [1,2,3,4,5,6,7,1,2,3,4,5,67,8,9,4,2,3,4,5,6];
/**
* Remove Duplicates from Array
*/
function uniqArr(arr) {
var seen = {}, arr2 = [], i;
for (i = 0, len = arr.length; i < len; i++) {
if (!(arr[i] in seen)) {
arr2.push(arr[i]);
seen[arr[i]] = true;
}
}
return arr2;
}
console.log(uniqArr(data));
You may try to use MySQL Events for that:
CREATE EVENT IF NOT EXISTS `dbName`.`eventName`
ON SCHEDULE
EVERY 1 DAY // or 1 HOUR
COMMENT 'Description'
DO
BEGIN
DELETE FROM `dbName`.`TableName` WHERE `DateCol` < NOW();
END
NOTE that MySQL Event Scheduler need to be enabled on your server: