YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -1,5 +1,3 @@
|
|||
/*Abhishek Ghosh, Original : 20th September 2017, Corrected : 25th September 2017*/
|
||||
|
||||
#include<unistd.h>
|
||||
#include<stdio.h>
|
||||
#include<time.h>
|
||||
|
|
|
|||
|
|
@ -1 +1,5 @@
|
|||
SessionSubmit[ScheduledTask[EmitSound[SoundNote["C", 1, "TubularBells"]], "Hourly"]]
|
||||
LocalSubmit[ScheduledTask[
|
||||
EmitSound[Sound[Table[{
|
||||
SoundNote["C",750/1000,"TubularBells"],SoundNote[None,500/1000,"TubularBells"]
|
||||
},Mod[Round[Total[DateList[][[{4,5}]]{2,1/30}]],8,1]]]]
|
||||
,DateObject[{_,_,_,_,_,30|0}]]]
|
||||
|
|
|
|||
37
Task/Nautical-bell/Phix/nautical-bell.phix
Normal file
37
Task/Nautical-bell/Phix/nautical-bell.phix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
constant watches = {"First","Middle","Morning","Forenoon","Afternoon","First dog","Last dog","First"},
|
||||
watch_ends = {"00:00", "04:00", "08:00", "12:00", "16:00", "18:00", "20:00", "23:59"},
|
||||
bells = {"One","Two","Three","Four","Five","Six","Seven","Eight"},
|
||||
ding = "ding!"
|
||||
|
||||
procedure nb(integer h,m)
|
||||
integer bell = mod(floor((h*60+m)/30),8)
|
||||
if bell==0 then bell = 8 end if
|
||||
string hm = sprintf("%02d:%02d",{h,m})
|
||||
integer watch=1
|
||||
while hm>watch_ends[watch] do watch += 1 end while
|
||||
string plural = iff(bell==1?" ":"s")
|
||||
string dings = ding
|
||||
for i=2 to bell do dings &= iff(mod(i,2)?" ":"")&ding end for
|
||||
printf(1,"%s %9s watch %5s bell%s %s\n",
|
||||
{hm,watches[watch],bells[bell],plural,dings})
|
||||
end procedure
|
||||
|
||||
procedure simulate1day()
|
||||
for h=0 to 23 do
|
||||
for m=0 to 30 by 30 do
|
||||
nb(h,m)
|
||||
end for
|
||||
end for
|
||||
nb(0,0) -- (again)
|
||||
end procedure
|
||||
|
||||
simulate1day()
|
||||
|
||||
while 1 do
|
||||
sequence d = date(DT_GMT)
|
||||
integer m = d[DT_SECOND] + mod(d[DT_MINUTE],30)*60
|
||||
if m=0 then
|
||||
nb(d[DT_HOUR],d[DT_MINUTE])
|
||||
end if
|
||||
sleep(30*60-m)
|
||||
end while
|
||||
|
|
@ -1,7 +1,4 @@
|
|||
# Project : Nautical bell
|
||||
# Date : 2017/12/26
|
||||
# Author : Gal Zsolt (~ CalmoSoft ~)
|
||||
# Email : <calmosoft@gmail.com>
|
||||
|
||||
m = 0
|
||||
for n = 0 to 23
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue