Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

ordinal mix counting #705

Merged
merged 3 commits into from Mar 13, 2014

Conversation

Projects
None yet
3 participants
Owner

kumagi commented Mar 4, 2014

This PR is correspond to #552
The counting of mix number as 1th, 2th, 3th was not cool.

Now, by this patch.

I0304 20:32:16.847240 18560 linear_mixer.cpp:367] starting mix:
I0304 20:32:16.852007 18560 linear_mixer.cpp:445] success to get_diff from [x.x.x.x:9199]
I0304 20:32:16.853821 18562 linear_mixer.cpp:591] put_diff with 14 bytes finished my model is still up to date. versions[21st, 21st]
I0304 20:32:16.854606 18560 linear_mixer.cpp:494] success to put_diff to [x.x.x.x:9199]
I0304 20:32:16.854652 18560 linear_mixer.cpp:506] mixed with 1 servers in 0.007368 secs, 14 bytes (serialized data) has been put.
I0304 20:32:16.855080 18560 linear_mixer.cpp:375] .... mix done. versions [21st, 21st]
I0304 20:32:17.858530 18560 linear_mixer.cpp:367] starting mix:
I0304 20:32:17.863034 18560 linear_mixer.cpp:445] success to get_diff from [x.x.x.x:9199]
I0304 20:32:17.864718 18561 linear_mixer.cpp:591] put_diff with 14 bytes finished my model is still up to date. versions[22nd, 22nd]
I0304 20:32:17.865403 18560 linear_mixer.cpp:494] success to put_diff to [x.x.x.x:9199]
I0304 20:32:17.865439 18560 linear_mixer.cpp:506] mixed with 1 servers in 0.006866 secs, 14 bytes (serialized data) has been put.
I0304 20:32:17.865814 18560 linear_mixer.cpp:375] .... mix done. versions [22nd, 22nd]

These mix log seems to be cool, isn't it?

@unnonouno unnonouno commented on the diff Mar 6, 2014

jubatus/core/common/version.cpp
@@ -25,7 +25,17 @@
: version_number_(0LLU) {}
std::ostream& operator<<(std::ostream& os, const version& v) {
- os << "(version)" << v.version_number_;
+ os << v.version_number_;
+ // cardinal number output
+ if ((v.version_number_ % 10) == 1 && (v.version_number_ != 11)) {
+ os << "st";
+ } else if ((v.version_number_ % 10) == 2 && (v.version_number_ != 12)) {
+ os << "nd";
+ } else if ((v.version_number_ % 10) == 3 && (v.version_number_ != 13)) {
+ os << "rd";
+ } else {
+ os << "th";
+ }
return os;
@unnonouno

unnonouno Mar 6, 2014

Owner

Is it work for 212?

@kumagi

kumagi Mar 6, 2014

Owner

oh, 212 will be 212th. I'll fix it to be 212nd

@kmaehashi kmaehashi added this to the 0.5.3 milestone Mar 10, 2014

Owner

unnonouno commented Mar 10, 2014

Great work! Please write a unit test.

Owner

kumagi commented Mar 13, 2014

I wrote unit test. Is it enough?

unnonouno added a commit that referenced this pull request Mar 13, 2014

@unnonouno unnonouno merged commit 4c491a1 into develop Mar 13, 2014

1 check passed

default The Travis CI build passed
Details
Owner

unnonouno commented Mar 13, 2014

LGTM

@kumagi kumagi deleted the feature/ordinal_mix_counting branch Mar 13, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment