Oakromulo Posted March 13, 2013 Report Share Posted March 13, 2013 I know the LV timestamp engine could easily be used to determine the day of the weak for a specific date. However, for those interested in a "behind the scenes" solution... the Zeller algorithm is really nice and possibly more optimized for certain applications. zeller.vi Quote Link to comment
JackDunaway Posted March 13, 2013 Report Share Posted March 13, 2013 Neat! I see a prime candidate for Coerce to Type in there; this, and removing the decrement by pulling the ENUM output before the increment could tidy up that last bit of syntax. Quote Link to comment
ShaunR Posted March 13, 2013 Report Share Posted March 13, 2013 ...... and here's the Sakamoto method. 2 Quote Link to comment
Oakromulo Posted March 13, 2013 Author Report Share Posted March 13, 2013 Neat! I see a prime candidate for Coerce to Type in there; this, and removing the decrement by pulling the ENUM output before the increment could tidy up that last bit of syntax. +1 -1 that's so funny... after I read your reply, I still needed some seconds to find this lame operation! +1 Kudo for the Coerce to Type operator. This situation seems to appear almost every state-machine-like VI! ...... and here's the Sakamoto method. dOW.png A little bit afraid to say... but... the c code looks so much more readable in your example! I mean it makes me afraid because this kind of comment lends itself very easily into love-hate posts... Quote Link to comment
Oakromulo Posted March 13, 2013 Author Report Share Posted March 13, 2013 Fixed! Now with smaller datatypes as well... zeller2.vi Quote Link to comment
ShaunR Posted March 14, 2013 Report Share Posted March 14, 2013 the c code looks so much more readable in your example! Sure. Sometimes.Although unless you have programed in C you might think y -= m < 3 is rather obtuse. I'd defy anyone to say that string formatting in C is "more readable" though. Quote Link to comment
mahgust Posted May 11, 2018 Report Share Posted May 11, 2018 Hi! zeller2.vi and zeller.vi has different results. zeller.vi has correct one. Check today date 11may18 it is friday. Thanks! Quote Link to comment
Yair Posted May 16, 2018 Report Share Posted May 16, 2018 On 5/11/2018 at 2:56 PM, mahgust said: Hi! zeller2.vi and zeller.vi has different results. zeller.vi has correct one. Check today date 11may18 it is friday. Thanks! The difference is in the second Q&R function, where version 2 converts the remainder to U16 instead of the quotient. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.