This is the final report of the work which was done as part of development of the Fossbot Platform @ GSOC24.
Name: Giorgos Iliopoulos
Mentor: Christos Chronis
This is the final report of the work which was done as part of development of the Fossbot Platform @ GSOC24.
Name: Giorgos Iliopoulos
Mentor: Christos Chronis
<?php | |
// Define the custom shortcode function | |
function get_vendor_info_shortcode($atts) | |
{ | |
// Extract the attributes from the shortcode | |
$atts = shortcode_atts( | |
array( | |
'id' => 0, // Default ID if not provided | |
), | |
$atts, |
const Loading: React.FC = () => { | |
return ( | |
<> | |
<div className="min-h-screen bg-gray-200 flex items-center justify-center" role="status"> | |
<svg | |
aria-hidden="true" | |
className="w-29 h-20 mr-2 text-gray-200 animate-spin dark:text-gray-600 fill-black" | |
viewBox="0 0 100 101" | |
fill="none" | |
xmlns="http://www.w3.org/2000/svg" |
import React, { useState, useEffect } from "react"; | |
const DigitalClock: React.FC = () => { | |
const [time, setTime] = useState(new Date()); | |
useEffect(() => { | |
const interval = setInterval(() => { | |
setTime(new Date()); | |
}, 1000); |
import React, { useState, useEffect } from 'react'; | |
const Weather = () => { | |
const [weatherData, setWeatherData] = useState(null); | |
useEffect(() => { | |
const fetchWeatherData = async () => { | |
const apiKey = 'API_KEY'; | |
const place = 'Your Place'; | |
const apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${place}&units=metric&appid=${apiKey}`; |
export function removeAccents(str) { | |
const upperCaseSeriousString = str.toUpperCase(); | |
const greekLetters = { | |
Ά: "Α", | |
Έ: "Ε", | |
Ή: "Η", | |
Ί: "Ι", | |
Ϊ: "Ι", | |
Ό: "Ο", | |
Ύ: "Υ", |
function calculateSeats(percentages) { | |
const totalSeats = 300; // Total number of seats | |
const threshold = 3; // Percentage threshold for proportional allocation | |
const totalVotes = percentages.reduce((sum, percentage) => sum + percentage, 0); | |
const allocatedSeats = []; | |
// Calculate seats for proportional allocation | |
const proportionalSeats = totalSeats - 50; // Remaining seats after allocating 50 for the first party | |
for (let i = 0; i < percentages.length; i++) { |
function distributeSeats(percentages, totalSeats, threshold) { | |
const validParties = percentages.filter((percentage) => percentage >= threshold); | |
const totalValidPercentages = validParties.reduce((a, b) => a + b, 0); | |
const seatDistribution = []; | |
validParties.forEach((percentage) => { | |
const seats = Math.floor((percentage / totalValidPercentages) * totalSeats); | |
seatDistribution.push(seats); | |
}); |
// If our server has a timezone out of Greece as an example , we can use this function to get the time of that timezone | |
// Supported timezones https://www.php.net/manual/en/timezones.php | |
// Supported time & date formats https://www.php.net/manual/en/datetime.format.php | |
function GetCityTimeDate($format,$timezone) | |
{ | |
$tz = $timezone; | |
$timestamp = time(); | |
$dt = new DateTime("now", new DateTimeZone($tz)); //first argument "must" be a string | |
$dt->setTimestamp($timestamp); //adjust the object to correct timestamp |