Sailing7

joined 2 years ago
[–] Sailing7@lemmy.ml 1 points 2 months ago (1 children)

Well, some people like the taste of this drink.

The other hand of the spectrum mostly thinks it tastes like what you would imagine a ashtray would taste like.

I'm part of the second kind. Had seen lots of people in the office drink it. Wanting to try it out gave it a shot. Absolutely regret that.

[–] Sailing7@lemmy.ml 13 points 2 months ago

Woop woop. Niicee. Schade, dass wir hier zumindest für die playstore nutzer auf googles gnaden angewiesen sind, aber trotzdem gut dass sie jetzt doch endlich zurückrudern!

[–] Sailing7@lemmy.ml 2 points 2 months ago (3 children)

This one does not spark joy.

shudders

[–] Sailing7@lemmy.ml 8 points 2 months ago

Weil er auf deutsch halt so garnicht funzt.

Ich hab das erst gecheckt, als ich die englische variante gelesen hab.

:D

[–] Sailing7@lemmy.ml 2 points 2 months ago

Wie? Einfach nur wiiieeee?

[–] Sailing7@lemmy.ml 4 points 2 months ago

The mentioned php file:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Charging Time Calculator (PHP)</title>
  <style>
    body { font-family: Arial, sans-serif; background: #f4f4f4; color: #333; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
    .box { background: #fff; padding: 20px 30px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); width: 100%; max-width: 400px; }
    h1 { margin-top: 0; text-align: center; }
    .field { margin-bottom: 15px; }
    label { display: block; margin-bottom: 5px; font-weight: bold; }
    input[type="number"] { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
    button { width: 100%; padding: 10px; background: #28a745; color: white; border: none; border-radius: 4px; cursor: pointer; }
    button:hover { background: #218838; }
    .result { margin-top: 20px; background: #e9ecef; padding: 15px; border-radius: 4px; }
  </style>
</head>
<body>
  <div class="box">
    <h1>Charging Time Calculator</h1>

    <?php
    // Default values at the top
    $default_capacity      = 52.0;   // kWh
    $default_current_pct   = 55.0;   // %
    $default_target_pct    = 80.0;   // %
    $default_power_kw      = 1.8;    // kW
    $default_loss_pct      = 15.2;   // Charging loss in %

    // I have extended the PHP script with the new field for charging loss (default 15.2%). 
    // The loss is applied immediately after calculating the net energy requirement, 
    // so the charging time is determined based on the inclusive energy requirement (net + loss). 
    // Additionally, the result view now shows the following values:
    // - Net energy required
    // - Configured charging loss
    // - Energy requirement including loss

    // Take from POST or use defaults
    $capacity = isset($_POST['capacity']) ? floatval($_POST['capacity']) : $default_capacity;
    $current  = isset($_POST['current'])  ? floatval($_POST['current'])  : $default_current_pct;
    $target   = isset($_POST['target'])   ? floatval($_POST['target'])   : $default_target_pct;
    $power    = isset($_POST['power'])    ? floatval($_POST['power'])    : $default_power_kw;
    $loss     = isset($_POST['loss'])     ? floatval($_POST['loss'])     : $default_loss_pct;

    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
      // Calculation
      $percent_to_charge = max(0, $target - $current);
      // Net energy requirement
      $energy_needed_raw = ($percent_to_charge / 100) * $capacity;      // in kWh
      // Energy requirement including charging loss
      $energy_needed = $energy_needed_raw * (1 + $loss / 100);
      // Charging time based on the increased energy requirement
      $time_hours        = $power > 0 ? $energy_needed / $power : 0;    // in hours
      $hours             = floor($time_hours);
      $minutes           = round(($time_hours - $hours) * 60);
    ?>
      <div class="result">
        <p><strong>Remaining Charging Time:</strong> <?= $hours ?> h <?= $minutes ?> min</p>
        <p><strong>Percent to Charge:</strong> <?= number_format($percent_to_charge, 1) ?> %</p>
        <p><strong>Energy to Charge (net):</strong> <?= number_format($energy_needed_raw, 2) ?> kWh</p>
        <p><strong>Charging Loss:</strong> <?= number_format($loss, 1) ?> %</p>
        <p><strong>Energy to Charge (incl. loss):</strong> <?= number_format($energy_needed, 2) ?> kWh</p>
      </div>
    <?php } ?>

    <form method="post">
      <div class="field">
        <label for="capacity">Battery Capacity (kWh)</label>
        <input type="number" step="0.1" name="capacity" id="capacity" value="<?= htmlspecialchars($capacity) ?>" required>
      </div>
      <div class="field">
        <label for="current">Current Charge Level (%)</label>
        <input type="number" step="1" min="0" max="100" name="current" id="current" value="<?= htmlspecialchars($current) ?>" required>
      </div>
      <div class="field">
        <label for="target">Desired Charge Level (%)</label>
        <input type="number" step="1" min="0" max="100" name="target" id="target" value="<?= htmlspecialchars($target) ?>" required>
      </div>
      <div class="field">
        <label for="power">Charging Power (kW)</label>
        <input type="number" step="0.1" min="0.1" name="power" id="power" value="<?= htmlspecialchars($power) ?>" required>
      </div>
      <div class="field">
        <label for="loss">Charging Loss (%)</label>
        <input type="number" step="0.1" min="0" max="100" name="loss" id="loss" value="<?= htmlspecialchars($loss) ?>" required>
      </div>
      <button type="submit">Calculate</button>
    </form>
  </div>
</body>
</html>

[–] Sailing7@lemmy.ml 6 points 2 months ago

Woooo another comiiic! :D

[–] Sailing7@lemmy.ml 3 points 2 months ago (1 children)

Dein bot spammt ein wenig meister

[–] Sailing7@lemmy.ml 1 points 2 months ago (1 children)

Those lyrics are fire! ^^

[–] Sailing7@lemmy.ml 2 points 2 months ago

Joa wischen behaupten sie ja fast alle, dass sie es könnten. Die meisten sind darin aber eher kacke.

Und ja, zum datensendeverhalten haben sie sich die Zeit genommen und analyse betrieben.

[–] Sailing7@lemmy.ml 3 points 2 months ago (2 children)

Gibt nen test von stiftung warentest. Ist die 5 ökken wert. Gibt dir ne menge details darüber, was sie können und was nur marketingbullshit ist

[–] Sailing7@lemmy.ml 10 points 2 months ago* (last edited 2 months ago)

[...] and have been using various Linux distros as my main os for almost 20 years.

Matey. Get into any company that has linux junior positions. You already have more experiance in linux than 90% of the average (windows) Sysadmin.

For realzies now. Most will look weird at you if you ask them to edit a file in the shell or using a server VM that runs without graphical interface.

Get into a linux junior position and get started.

Learn lots and lots. After a few years moneywise you might be back your old job as experienced chemist.

view more: ‹ prev next ›