Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
ai
Commits
df8c8dda
Commit
df8c8dda
authored
Apr 10, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pu
parent
4ee3c788
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
test_json.js
test_json.js
+2
-6
uniq.js
uniq.js
+14
-0
No files found.
test_json.js
View file @
df8c8dda
var
oldJSON
=
JSON
;
JSON
=
undefined
;
require
(
'
./json2
'
);
JSON
.
stringify
=
oldJSON
.
stringify
;
let
t
=
'
dynamic param:48.0 base:200 target:1 targetPercentage:true fft 1
'
let
arr
=
[{
hi
:
1
}]
console
.
log
(
JSON
.
stringify
(
arr
,
null
,
2
))
\ No newline at end of file
console
.
log
(
t
.
split
(
'
targetPercentage:true
'
))
\ No newline at end of file
uniq.js
View file @
df8c8dda
...
...
@@ -9,6 +9,7 @@ async function run() {
let
arr
=
[]
let
arrDate
=
[]
let
levels
=
[]
let
types
=
[]
for
(
let
i
=
0
;
i
<
configs
.
length
;
i
++
)
{
...
...
@@ -20,6 +21,7 @@ async function run() {
for
(
let
j
=
0
;
j
<
config
.
length
;
j
++
)
{
levels
.
push
(
config
[
j
].
maxLevel
)
types
.
push
(
configs
[
j
].
type
.
split
(
'
targetPercentage:true
'
)[
1
])
let
dateString
=
config
[
j
].
dateString
.
split
(
'
_
'
)
for
(
let
z
=
0
;
z
<
dateString
.
length
-
1
;
z
++
)
...
...
@@ -35,8 +37,10 @@ async function run() {
arr
=
_
.
uniqBy
(
arr
,
'
platform
'
);
arrDate
=
_
.
uniq
(
arrDate
);
let
uniqLevels
=
_
.
uniq
(
levels
);
let
uniqType
=
_
.
uniq
(
types
);
arrDate
=
_
.
orderBy
(
arrDate
)
let
levelSort
=
[]
let
typeSort
=
[]
for
(
let
i
=
0
;
i
<
uniqLevels
.
length
;
i
++
)
{
let
counter
=
0
...
...
@@ -46,11 +50,21 @@ async function run() {
levelSort
.
push
({
level
:
uniqLevels
[
i
],
count
:
counter
})
}
for
(
let
i
=
0
;
i
<
uniqType
.
length
;
i
++
)
{
let
counter
=
0
for
(
let
j
=
0
;
j
<
types
.
length
;
j
++
)
if
(
uniqType
[
i
]
===
types
[
j
])
counter
++
typeSort
.
push
({
type
:
uniqType
[
i
],
count
:
counter
})
}
console
.
log
(
'
All Uniq Platform:
'
+
arr
.
length
)
console
.
log
(
'
All Uniq Date:
'
+
arrDate
.
length
)
console
.
log
(
arrDate
)
console
.
log
(
levelSort
)
console
.
log
(
typeSort
)
let
maxDiff
=
0
for
(
let
i
=
0
;
i
<
arrDate
.
length
-
1
;
i
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment