|
Jörgen Andersson wrote: shouldn't it be Data.Time.Calendar.Gregorian instead of Data.Time.Calendar.Julian
You're quite right - and that's my mistake, getting Gregorian/Julian mixed up! Gregorian is actually the default, baked into Data.Time.Calendar , while Julian is the add-on...
import Data.List.Split
import Data.Time.Calendar;
import Data.Time.Calendar.Compat;
import Text.Printf
printMonth :: Integer -> Int -> IO ()
printMonth year month = printWeeks entriesInMonth
where
-- printWeeks chunks the month's entries into weeks & prints each week on a new line
printWeeks days = mapM_ (putStrLn.unwords) (chunksOf 7 days)
-- entriesInMonth concatenates the empty entries at the start of the month with the days
entriesInMonth = startPadding ++ daysOfMonth
-- daysOfMonth generates a list of days of the month as strings
daysOfMonth = map (printf "%2d") [1..(gregorianMonthLength year month)]
-- startPadding generates blank strings for each empty entry before day '1'
startPadding = replicate blanksBeforeDay1 " "
-- blanksBeforeDay1 is the number of empty entries before day '1'
blanksBeforeDay1 = (fromEnum $ dayOfWeek (fromGregorian year month 1)) `mod` 7
Being able to use Data.Time.Calendar rather than Data.Time.Calendar.Julian should have been a giveaway, shouldn't it
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
modified 6-Nov-19 8:46am.
|
|
|
|
|
|
Checkin rejected, hard-coded values.
Just kidding, the knuckleheads I work with hard-code things all over the place, and management won't let us have any code reviews. Sigh.
|
|
|
|
|
I'd go with a Bash script...
cal
|
|
|
|
|
|
It's most curious that, as there only are two ways to plug in a USB, you should be right 50% of the time and yet...
- I would love to change the world, but they won’t give me the source code.
|
|
|
|
|
There are 3 sides to a USB;
1) The side you try first
2) The wrong side
3) The Right side
They call me different but the truth is they're all the same!
JaxCoder.com
|
|
|
|
|
Irrefutable proof of the existence of other dimensions I'd say.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Looks more like FireWire to me
|
|
|
|
|
To be fair, the USB logo goes on top.
Problem is, while device manufacturers generally get it right, if a connector is mounted sideways, it becomes anyone's guess again.
|
|
|
|
|
I have a few devices where the logo on top rule doesn't apply, while not many it's enough to keep me guessing!
|
|
|
|
|
But what if... it was an USB C?
|
|
|
|
|
the ultimate death sentence?
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
|
Always the same...
each time I flight to my family I get blocked by Mocosoft because they detect something unusual. So I have to get a code sent to other email before I can continue...
the point is... the unusual place was the main place at the very beginning of the account and is the same place for several weeks a year for the last 15 years.
I think it is a good idea to ask for the code, but if I have had and solved the same request for the last 25 times I was here... the "AI" could think a bit and add it to a kind of "trusted places" FFS
morons
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Yes, it is artificial but sometimes the intelligence part is faulty.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Nelek wrote: each time I flight to my family I get blocked by Mocosoft My neurons are on-strike today, translation, please
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Mocosoft = Microsoft in moron mode active
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
what is the connection between "flight to family" and Mocosoft ? are you trying to escape a cubicle, and get home, but Moco won't release the restraints ?
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Nope, but I try to open my email with my own laptop in my parents home. And they "detect something unusual with my account" and need an special code to get into it.
My point is... I am here with my own laptop a couple of weeks each year, their system should detect that is not that "unusual" anymore.
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Is the problem with unemployed people puns that none of them work?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
This is a canned response.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
|
That's OK as long as we don't get too fired up.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Good idea. I best lay off.
/ravi
|
|
|
|