From 8f25b678fdaa88c5f956cb623f80f9eafc5e7337 Mon Sep 17 00:00:00 2001 From: David Polakovic Date: Sat, 1 Mar 2025 10:29:14 +0100 Subject: [PATCH] added Mars clock page plus minor updates --- Styles/styles.css | 40 +++++++------- blog.php | 26 ++++++---- dir.php | 130 +++++++++++++++++++++++++--------------------- index.php | 47 +++++++++-------- mars-clock.php | 126 ++++++++++++++++++++++++++++++++++++++++++++ php/time.php | 116 +++++++++++++++++++++++++++++++++++++++++ rss.xml | 40 +++++++++++++- test.php | 52 ++++++++++++++----- 8 files changed, 451 insertions(+), 126 deletions(-) create mode 100755 mars-clock.php create mode 100755 php/time.php mode change 100644 => 100755 rss.xml diff --git a/Styles/styles.css b/Styles/styles.css index cedbf4b..c1e1477 100755 --- a/Styles/styles.css +++ b/Styles/styles.css @@ -10,26 +10,15 @@ users with different text colors in browser settings. */ -@font-face{ - font-family: "noto-serif"; - src: url('noto-serif.regular.ttf'); -} -@font-face{ - font-family: "noto-serif"; - src: url('noto-serif.bold.ttf'); - font-weight: bold; -} -@font-face{ - font-family: "noto-serif"; - src: url('noto-serif.italic.ttf'); - font-weight: 100; -} +/* I love this font. */ +@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:wght@450;700&display=swap'); body { background-color: #e8cba9; color: #000000; - font-family: noto-serif; + font-family: 'Noto Serif', serif; /* Set font to Noto Serif */ + font-size: 18px; } table { @@ -156,6 +145,15 @@ nav { width: 100%; margin: 0 auto; text-align: justify; + line-height: 1.25; +} + +.less { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + margin: 0; } .content img { @@ -163,7 +161,7 @@ nav { } .content img.bee-gifs { - max-width: 95px; + max-width: 105px; } .hide-link { @@ -200,6 +198,7 @@ nav { /* this is class for anybrowser button to appear far right */ .gif-buttons { float: right; + line-height: 1; } .dir { @@ -275,7 +274,6 @@ nav { .code-block { background: #efdac3; border: 1px solid #ddd; - /*border-left: 3px solid #f36d33; */ border-left: 3px solid #b38265; color: #666; page-break-inside: avoid; @@ -284,12 +282,14 @@ nav { line-height: 1.6; margin-bottom: 1.6em; max-width: 100%; - overflow: auto; + overflow-x: auto; /* Enable horizontal scrolling */ + white-space: nowrap; /* Prevent text wrapping */ padding: 1em 1.5em; display: block; word-wrap: break-word; } + .terminal-block { background: #000; border: 1px solid #000; @@ -305,10 +305,12 @@ nav { line-height: 1.6; margin-bottom: 1.6em; max-width: 100%; - overflow: auto; + overflow-x: auto; /* Enable horizontal scrolling */ + white-space: nowrap; /* Prevent text wrapping */ padding: 1em 1.5em; display: block; word-wrap: break-word; + white-space: pre-wrap; } .what-is-this { diff --git a/blog.php b/blog.php index cce666b..60ab8ab 100755 --- a/blog.php +++ b/blog.php @@ -2,8 +2,7 @@ - - + dpolakovic.space @@ -28,6 +27,7 @@
  • About
  • Blog
  • Web directory
  • +
  • Mars clock
  • @@ -37,11 +37,17 @@

    Blog

    Some obscure thoughts caught on the Web. -

    + After eating and breathing, expressing opinions on the internet is the + most important human need. Here are some of mine that occupied my mind + for more than few seconds. Also, if you want to stay up to date with this + blog, you can subscribe to its RSS feed +

    +

    + @@ -50,14 +56,14 @@

    diff --git a/dir.php b/dir.php index d5622ae..d5a13f4 100755 --- a/dir.php +++ b/dir.php @@ -2,8 +2,7 @@ - - + dpolakovic.space @@ -30,6 +29,7 @@
  • About
  • Blog
  • Web directory
  • +
  • Mars clock
  • @@ -41,60 +41,70 @@ Let's explore the Web.

    - Since the online space is vast and still expanding, it is good practice for - surfers to share links between each other in web directories like this one. - So here are links I thought you might find useful. + The online space is vast and still expanding. Sadly, not thanks to + the users but rather spam bots and focus black holes - the social networks. + Therefore it's good practice for surfers to share links between each other + in "web directories" like this one. So here are links I thought you might + find useful.

    -

    -

    - Free software directory - - a collaborative catalog of free software
    - Cidr.xyz - - when you're setting up network and you don't want to die over subnet - tables [3]
    - Lack rack - - nice hack that I use for my servers
    - Installing Wine on Linux - - this is tricky task for many distros, so I use this nice tutorial
    - CloudTube - - one of many free (software) instances for youtube.com
    - Floppydisk.com - - new and refurbished floppies for okay prices [3]
    - Which JDK? - - neat website when you want to install alternative Java Dev Kits
    - JAR Download - - Java libraries packed in .jars so you can manage them by hand
    - Perl monks - - best place to seek help and wisdom in Perl
    - Web buttons - - here is list of 4000+ web buttons from Cyber Vanguards website
    - More Web buttons - - another set of 4000 web buttons, this time from Deadnet
    - Web 3 is going great! - - website that monitors all failures of this stupid bubble [3]
    - WinWorld - - online museum/library of vintage software
    - UESP Wiki - - everything I ever needed for TES III Morrowind I found here [2]
    -
    -

    -

    - And here are some good readings I found on the Web. I am not necessarily - a fan of authors, but I consider these specefic blog posts to be - worth your time. -

    -
    - A brief history of Hackerdom - by Eric S. Raymond
    - The Parable of Alien Chess - by Luke Smith
    - Modelling time travel in fiction - by qntm
    - AI crap - by Drew DeVault
    - Web of Documents - by Daniel Janus
    -
    +

    + software
    + Free software directory + - a collaborative catalog of free software
    + WinWorld + - online museum/library of vintage operating systems
    + Infocom catalog + - every Infocom text adventure ever
    + KolibriOS + - operating system on 1,44MB floppy
    + AtariAge + - hub for enthusiasts of Atari PCs and consoles
    +

    +

    + programming
    + Which JDK? + - neat website for navigating alternative Java Dev Kits
    + SDKman + - must have tool for every JVM based project
    + MVN repository + - Java libraries packed in .jars
    + Perl monks + - best place to seek help and wisdom in Perl
    + Rosetta Code + - solutions for many tasks in many languages [2]
    + Git cheat sheet + - feel free to laugh, but I use this a lot [PDF] +

    +

    + tools & tutorials
    + Cidr.xyz + - when you don't want to die over subnet tables [3]
    + Broken link checker + - it does, exactly what it says [3]
    + Installing Wine on Linux + - this is tricky task for many distros
    +

    +

    + other
    + Linux Kernel Mailing List + - this is my preferred instance
    + Lack rack + - nice hack that I use for my servers
    + Floppydisk.com + - new and refurbished floppies for okay prices [3]
    + Webring list + - pick a community and meet fellow netizens
    + Project Gutenberg + - my go to place to get books online
    + Av8ns thermodynamics + - thermodynamics reference page
    + Space weather prediction center + - check before you plan your trip to Mars
    + UESP wiki + - everything I ever needed for Morrowind [1, 3] +

    +
    +

    Some of these websites contains "allergens"
    [1] - advertisements, @@ -106,14 +116,14 @@



    diff --git a/index.php b/index.php index ae3e086..2437dbc 100755 --- a/index.php +++ b/index.php @@ -2,8 +2,7 @@ - - + dpolakovic.space @@ -33,6 +32,7 @@
  • About
  • Blog
  • Web directory
  • +
  • Mars clock
  • @@ -47,14 +47,14 @@ My name is David and - This is my personal Web space which I don't really need, but it is - nice to have one. + This is my personal web space, which I don't use very often, but + when I do, it usually takes up too much of my free time. You can check out some of my blogs, browse my mostly abandoned git server - or you can stay here and watch this alien dance.
    + or you can stay here and watch this alien dance.

    - cool dancing alien + if you don't see any alien here, you might have blocked steam.com domain
    -

    +

    I no longer use social media, so if you want to contact me, you are likely to reach me via email. I read my mailbox quite often @@ -63,22 +63,25 @@

    - email at dpolakovic dot space + email@dpolakovic.space +   + fetch my GPG key   - (my public GPG) + (how to use GPG keys?)
    -

    +

    +

    - - GIF button: support for FSFE + + the glider - - GIF button: PGP set up guide +

    + + + +
    + GIF button: html and php only - - GIF button: any browser campign - -

    @@ -86,13 +89,13 @@
    diff --git a/mars-clock.php b/mars-clock.php new file mode 100755 index 0000000..f33ca72 --- /dev/null +++ b/mars-clock.php @@ -0,0 +1,126 @@ + + + + + + dpolakovic.space + + + + + + + + + + + + + + + + + + +
    +

    +

    Mars clock

    + Ack Ack Ack Ack Ack! +
    +
    + It was my friend Peter who got me into timekeeping "nerding". He is a devoted fan + of Mars colonization and author of few articles about timekeeping on other + celestial bodies. He inspired me to make a simple app to help me (and you!) + to see what time it is on other places in our Solar system. +

    +

    +

    + +------------------------------------------------------ +Earth | Time | Date | +------------------------------------------------------ +Silicon Valley | | | +Boston | | | +London* | | | +Tokyo | | | + +------------------------------------------------------ +Mars | Time | Date | +------------------------------------------------------ +Jezero Crater | | | +Gale Crater | | | +Olympus Mons* | | | +Tharsis Tholus | | | +Conv. Prime Meridian | | | + + + +------------------------------------------------------ +* 0 offset time zone +
    + +

    +

    + The idea was to create the most humanly readable modification of the + Darian calendar + On contrary to the original, the epoch starts on UTC 00:00 11th April, + 1609 (invention / first use of telescope) with year 1, not year 0. Aditionaly, the time zone with zero offset was chosen not + conventionally (the first landing spot / prime meridian) but rather by matching the + converted time with actual daylight on the Red Planet. +

    +

    + As you can see, the Mars clock is not autoupdating itself like traditional clock, + because I didn't want to DDOS myself nor invade your client with + any scripting. It is also not very usefull extraterrestrially, + so I made a portable version which you can fit on your Raspberry + Pi or any device running Java. It runs in GUI mode and terminal as well. +

    +

    +

    + Download + (12.7kb) / + Source code +
    +

    +
    +
    +
    +

    + + Mars clock is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE like aerospace engineering, tax payments and/or time travel. + +

    +
    +
    + + +
    + Copyright David Polakovic - + Content of this web is licensed under + CC BY-NC-ND 3.0. +
    + This site is javascript and cookie free. The source code is available + here + under + GPLv3 license. +
    +

    + + + diff --git a/php/time.php b/php/time.php new file mode 100755 index 0000000..dfcc234 --- /dev/null +++ b/php/time.php @@ -0,0 +1,116 @@ +"; + //echo "Data valid to time: ". $current_time . "
    "; +} + + function timeEarth($offset) { + + $dateTime = new DateTime("now", new DateTimeZone("UTC")); + + // Modify the timezone using the provided offset + $timezoneName = sprintf("Etc/GMT%+d", -$offset); + $dateTime->setTimezone(new DateTimeZone($timezoneName)); + + // Print the formatted time + echo $dateTime->format("H:i"); + +} + + function dateEarth(int $offset) { + // Create a DateTime object for the current date + $dateTime = new DateTime("now", new DateTimeZone("UTC")); + + // Modify the timezone using the provided offset + $timezoneName = sprintf("Etc/GMT%+d", -$offset); + $dateTime->setTimezone(new DateTimeZone($timezoneName)); + + // Print the formatted date + echo $dateTime->format("d-m(M)-Y"); +} + +function get_time_m(){ + $time_t = time(); // Get the current Unix timestamp + $darian_zero = strtotime("1609-04-11 00:00:00"); + $time_m = ($time_t - $darian_zero) / 1.02749125; + + return $time_m; +} + +function timeMars($offset) { + + $time_m = get_time_m(); + $time_m = $time_m - ($offset * 3600); + + $hrs = floor(($time_m % 86400) / 3600); + $min = floor(($time_m % 3600) / 60); + + echo sprintf("%02d:%02d", $hrs, $min); +} + +function dateMars($offset) { + + $time_m = get_time_m(); + $time_m = $time_m - ($offset * 3600); + + $time_m_days = $time_m / 86400; + $year = 1; + + while ($time_m_days >= 668) { + if (($year % 2 == 1) || ($year % 10 == 0)){ + $time_m_days = $time_m_days - 669; + } else { + $time_m_days = $time_m_days - 668; + } + $year++; + } + + $month_name = ["Sag", "Dha", "Cap", + "Mak", "Aqu", "Kum", + "Pis", "Min", "Ari", + "Mes", "Tau", "Ris", + "Gem", "Mit", "Can", + "Kar", "Leo", "Sim", + "Vir", "Kan", "Lib", + "Tul", "Sco", "Vri"]; + + $month_lengths = array_fill(0, 24, 28); // Default: 28 days per month + $month_lengths[5] = $month_lengths[11] = $month_lengths[17] = $month_lengths[23] = 27; // Adjust for special months + + // Check for leap year condition (every odd year and every 10th year) + $is_leap_year = ($year % 2 != 0 || $year % 10 == 0); + if ($is_leap_year) { + $month_lengths[23] = 28; // 24th month has 28 days in leap years + } + + // Find the month and day + $mth = 1; + $remaining_days = $time_m_days; // Work with a copy of $time_m_days + while ($remaining_days >= $month_lengths[$mth - 1]) { + $remaining_days -= $month_lengths[$mth - 1]; + $mth++; + } + + $mth_abv = $month_name[$mth - 1]; + + // The remaining days are the day of the month + $sol = $remaining_days + 1; + + + echo sprintf("%02d-%02d(%s)-%s", $sol, $mth, $mth_abv, $year); + +} + + + + + + + + +function test() { $test = strtotime("1609-04-11 00:00:00"); echo $test; } +?> diff --git a/rss.xml b/rss.xml old mode 100644 new mode 100755 index 77e5cee..ee7bf6d --- a/rss.xml +++ b/rss.xml @@ -5,10 +5,46 @@ https://www.dpolakovic.space Some obscure thoughts caught on the Web. en-us - Mon, 8 Jan 2024 16:00:00 GMT - Mon, 8 Jan 2024 16:00:00 GMT + Sun, 18 Aug 2024 17:00:00 GMT + Sun, 18 Aug 2024 17:00:00 GMT 60 + + Daily life of Stormtrooper + https://dpolakovic.space/blogs/star-wars-galaxies + "You seen that new BT-16?" + Mon, 10 Feb 2025 17:00:00 GMT + https://dpolakovic.space/blogs/pics/sw5.jpg + 100% 0 + + + + The Phantom Menace is good + https://dpolakovic.space/blogs/phantom-menace + An inevitable STAR WARS rant. + Sun, 18 Aug 2024 17:00:00 GMT + https://dpolakovic.space/blogs/pics/starwars26.jpg + 100% 1 + + + + Y292B bug + https://dpolakovic.space/blogs/y292b + We're doomed! Again... + Wed, 26 Jun 2024 17:00:00 GMT + https://dpolakovic.space/blogs/pics/bug.jpg + 100% 0 + + + + Reproducing the printer hack of Windows 95 + https://dpolakovic.space/blogs/windows-95-printer-hack + Start me up! + Fri, 12 Apr 2024 16:00:00 GMT + https://dpolakovic.space/blogs/pics/deskjet710c.jpg + 100% 5 + + Let's play Zork https://dpolakovic.space/blogs/zork diff --git a/test.php b/test.php index ef85ced..6fbf846 100755 --- a/test.php +++ b/test.php @@ -6,11 +6,12 @@ ??? - + + - + @@ -19,7 +20,6 @@

    simple website - banner

    @@ -47,7 +47,7 @@

    + ?> +

    +

    + my @long_string = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +
    + +

    +

    + cool dancing alien +

    +

    +

    + + + +
    +

    +

    +

    + +
    +

    + + + DOWNLOAD NOW - -

    -