(https://stackoverflow.com/questions/2218999/remove-duplicates-from-an-array-of-objects-in-javascript)
var arr=[
{"JANQTY":"49","STD_ITM_NM":"연결송수구명판" ,"EBGTAMT":"1" },
{"JANQTY":"38","STD_ITM_NM":"하론소화기" , "EBGTAMT":"0"},
{"JANQTY":"49","STD_ITM_NM":"연결송수구명판" ,"EBGTAMT":"0" },
{"JANQTY":"15","STD_ITM_NM":"압력스위치" ,"EBGTAMT":"0" },
{"JANQTY":"49","STD_ITM_NM":"연결송수구명판" ,"EBGTAMT":"1" }
];
console.log('BEFORE @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ :', arr);
console.log('BEFORE @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ :', JSON.stringify(arr));
arr = [...new Map(arr.map(obj => [JSON.stringify(obj), obj])).values()];
console.log('AFTER @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ :', arr);
console.log('AFTER @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ :', JSON.stringify(arr));
/*
Details:-
- Doing .map() on the data list and converting each individual object into a [key, value] pair array(length =2), the first element(key) would be the stringified version of the object and second(value) would be an object itself.
- Adding above created array list to new Map() would have the key as stringified object and any same key addition would result in overriding the already existing key.
- Using .values() would give MapIterator with all values in a Map (obj in our case)
- Finally, spread ... operator to give new Array with values from the above step.
*/
https://stackoverflow.com/questions/1344908/how-do-i-stage-all-files-at-once-in-git-gui
- Click 'Tools'>Add...
- Name it whatever you want (I chose 'add all')
- In the 'Command' field, type git add *
- Optionally check the boxes to remove a dialog window, output window, and global configuration.
- Click the Add button in the bottom right.
NOW=`date "+%Y%m%d%H%M"`
TGT=$1-$NOW.tar
cd /cygdrive/c
if [ -z "$2" ]
then
echo "Second arguments not exists"
else
echo 'tabs are replaced into spaces'
find project_home/WorkSpace -iname "${1}*" | grep -v -E ".svn|class|bak|old" | xargs sed -i 's/\t/ /g'
fi
find project_home/WorkSpace -iname "${1}*" | grep -v -E ".svn|class|bak|old" | xargs tar -cvf /tmp/$TGT
echo $TGT 'is maden'
mv /tmp/$TGT /cygdrive/d/src-bak
echo $TGT 'is moved d drive'
tar -xvf /cygdrive/d/src-bak/$TGT -C /cygdrive/d/src-bak/src-for-git/project_home
echo $TGT 'is copied to git directory'
tar -tvf /cygdrive/d/src-bak/$TGT
echo $TGT
$ cat input.sql
SELECT ID, NAME
FROM USERS
WHERE ID = :USERID
$ cat replace.sh
file1=input.sql
file2=$file1.bak
cp $file1 $file2
echo $file2
perl -pi -e "s/:/#{/g;" $file2
perl -pi -e "s/#\{\w*\b\K/}/g;" $file2
#sed -i 's/^/ /g' $file2
cp $file2 out
$cat out
SELECT ID, NAME
FROM USERS
WHERE ID = #{USERID}