Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djrandom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ale
djrandom
Commits
5798faab
Commit
5798faab
authored
10 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
remove some old useless code
parent
4d52c146
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
util/mapreduce/mapreduce.go
+0
-26
0 additions, 26 deletions
util/mapreduce/mapreduce.go
util/tempfile.go
+0
-33
0 additions, 33 deletions
util/tempfile.go
with
0 additions
and
59 deletions
util/mapreduce/mapreduce.go
deleted
100644 → 0
+
0
−
26
View file @
4d52c146
package
mapreduce
func
MapReduce
(
mapper
func
(
interface
{},
chan
interface
{}),
reducer
func
(
chan
interface
{},
chan
interface
{}),
input
chan
interface
{},
pool_size
int
)
interface
{}
{
reduce_input
:=
make
(
chan
interface
{})
reduce_output
:=
make
(
chan
interface
{})
worker_output
:=
make
(
chan
chan
interface
{},
pool_size
)
go
reducer
(
reduce_input
,
reduce_output
)
go
func
()
{
for
worker_chan
:=
range
worker_output
{
reduce_input
<-
<-
worker_chan
}
close
(
reduce_input
)
}()
go
func
()
{
for
item
:=
range
input
{
my_chan
:=
make
(
chan
interface
{})
go
mapper
(
item
,
my_chan
)
worker_output
<-
my_chan
}
close
(
worker_output
)
}()
return
<-
reduce_output
}
This diff is collapsed.
Click to expand it.
util/tempfile.go
deleted
100644 → 0
+
0
−
33
View file @
4d52c146
package
util
import
(
"crypto/rand"
"encoding/hex"
"fmt"
"os"
"path/filepath"
"time"
)
var
(
tmpdir
=
os
.
TempDir
()
)
func
TempName
(
prefix
,
suffix
string
)
string
{
buf
:=
make
([]
byte
,
4
)
rand
.
Read
(
buf
)
return
filepath
.
Join
(
tmpdir
,
fmt
.
Sprintf
(
"%s%d.%d.%s%s"
,
prefix
,
os
.
Getpid
(),
time
.
Now
()
.
Unix
(),
hex
.
EncodeToString
(
buf
),
suffix
))
}
func
TempFile
(
prefix
,
suffix
string
)
(
*
os
.
File
,
error
)
{
return
os
.
Create
(
TempName
(
prefix
,
suffix
))
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment