Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JohnLangford/vowpal_wabbit
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnLangford committed Jan 22, 2013
2 parents 40361b5 + 278be7c commit 3cc0cbe
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
3 changes: 1 addition & 2 deletions vowpalwabbit/gd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,7 @@ void print_features(vw& all, example* &ec)

void print_audit_features(vw& all, example* ec)
{
fflush(stdout);
print_result(fileno(stdout),ec->final_prediction,-1,ec->tag);
print_result(all.stdout_fileno,ec->final_prediction,-1,ec->tag);
fflush(stdout);
print_features(all, ec);
}
Expand Down
2 changes: 1 addition & 1 deletion vowpalwabbit/gd_mf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void mf_print_offset_features(vw& all, example* &ec, size_t offset)

void mf_print_audit_features(vw& all, example* ec, size_t offset)
{
print_result(fileno(stdout),ec->final_prediction,-1,ec->tag);
print_result(all.stdout_fileno,ec->final_prediction,-1,ec->tag);
mf_print_offset_features(all, ec, offset);
}

Expand Down
6 changes: 6 additions & 0 deletions vowpalwabbit/global_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ vw::vw()

options_from_file = "";

#ifdef _WIN32
stdout_fileno = _fileno(stdout);
#else
stdout_fileno = fileno(stdout);
#endif

searn = false;

nonormalize = false;
Expand Down
1 change: 1 addition & 0 deletions vowpalwabbit/global_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ struct vw {
uint32_t base_learner_nb_w; //this stores the current number of "weight vector" required by the based learner, which is used to compute offsets when composing reductions

uint32_t stride;
int stdout_fileno;

std::string per_feature_regularizer_input;
std::string per_feature_regularizer_output;
Expand Down
7 changes: 6 additions & 1 deletion vowpalwabbit/parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,12 @@ void reset_source(vw& all, size_t numbits)

void finalize_source(parser* p)
{
while (!p->input->files.empty() && p->input->files.last() == fileno(stdin))
#ifdef _WIN32
int f = _fileno(stdin);
#else
int f = fileno(stdin);
#endif
while (!p->input->files.empty() && p->input->files.last() == f)
p->input->files.pop();
p->input->close_files();

Expand Down

0 comments on commit 3cc0cbe

Please sign in to comment.