asterisk's recent activity

  1. Comment on Day 4: Secure Container in ~comp.advent_of_code

    asterisk
    Link Parent
    Rewrited function findBi() <?php function findBi($input) { if (isSameAdjent(substr($input, 0, 2)) && !isSameAdjent(substr($input, 1, 2)) || !isSameAdjent(substr($input, strlen($input)-3, 2)) &&...
    Rewrited function findBi()
    <?php function findBi($input)
    {
        if (isSameAdjent(substr($input, 0, 2)) && !isSameAdjent(substr($input, 1, 2))
        || !isSameAdjent(substr($input, strlen($input)-3, 2)) && isSameAdjent(substr($input, strlen($input)-2, 2))) {
            return true;
        }
    
        for ($i = 1; $i < strlen($input) - 1; $i++) {
            if (!isSameAdjent(substr($input, $i-1, 2)) && isSameAdjent(substr($input, $i, 2)) && !isSameAdjent(substr($input, $i+1, 2))) {
                return true;
            }
        }
        return false;
    }
    
    1 vote
  2. Comment on Day 4: Secure Container in ~comp.advent_of_code

    asterisk
    Link
    PHP functions.php <?php function isSixtLength($input) { return strlen((string) $input) == 6; } function isSameAdjent($input) { for ($i = 0; $i < strlen($input); $i++) { if ($i && $input[$i] ==...
    PHP

    functions.php

    <?php
    
    function isSixtLength($input)
    {
        return strlen((string) $input) == 6;
    }
    
    function isSameAdjent($input)
    {
        for ($i = 0; $i < strlen($input); $i++) {
            if ($i && $input[$i] == $input[$i - 1]) {
                return true;
            }
        }
        return false;
    }
    
    function isDecrease($input)
    {
        for ($i = 0; $i < strlen($input); $i++) {
            if ($i && $input[$i] < $input[$i - 1]) {
                return true;
            }
        }
        return false;
    }
    
    function findBi($input)
    {
        for ($i = 0; $i < strlen($input); $i++) {
            switch ($i) {
                case 0:
                    if ($input[$i] == $input[$i + 1] && $input[$i] != $input[$i + 2]) {
                        return true;
                    }
                    break;
                case 1:
                    if (
                        $input[$i] == $input[$i + 1] && $input[$i] != $input[$i + 2] && $input[$i] != $input[$i - 1]
                        || $input[$i] == $input[$i - 1] && $input[$i] != $input[$i + 1]
                    ) {
                        return true;
                    }
                    break;
                case strlen($input) - 2:
                    if (
                        $input[$i] == $input[$i + 1] && $input[$i] != $input[$i - 1]
                        || $input[$i] == $input[$i - 1] && $input[$i] != $input[$i - 2] && $input[$i] != $input[$i + 1]
                    ) {
                        return true;
                    }
                    break;
                case strlen($input) - 1:
                    if ($input[$i] == $input[$i - 1] && $input[$i] != $input[$i - 2]) {
                        return true;
                    }
                    break;
                default:
                    if (
                        $input[$i] == $input[$i + 1] && $input[$i] != $input[$i + 2] && $input[$i] != $input[$i - 1]
                        || $input[$i] == $input[$i - 1] && $input[$i] != $input[$i - 2] && $input[$i] != $input[$i + 1]
                    ) {
                        return true;
                    }
            }
        }
        return false;
    }
    

    part-1.php

    <?php include('functions.php');
    
    $count = 0;
    foreach (range(197487, 673251) as $number) {
        if (isSixtLength($number) && isSameAdjent((string) $number) && !isDecrease((string) $number)) {
            $count++;
        }
    }
    
    echo $count; 
    

    part-2.php

    <?php include('functions.php');
    
    $count = 0;
    foreach (range(197487, 673251) as $number) {
        if (isSixtLength($number) && findBi((string) $number) && !isDecrease((string) $number)) {
            $count++;
        }
    }
    
    echo $count;
    
    2 votes
  3. Comment on Advent of Code 2019 in ~comp.advent_of_code

    asterisk
    Link
    It is really fun and interesting. For example I liked to read about 1202 Program Alarm. My git where I am coding in [bad] PHP.

    It is really fun and interesting. For example I liked to read about 1202 Program Alarm.

    My git where I am coding in [bad] PHP.

    3 votes
  4. Comment on What have you been watching / reading this week? (Anime/Manga) in ~anime

    asterisk
    Link
    I also started to watch Houkago Saikoro Club — mosty about girls, tabletop gaming and sometimes making. By the way, what I am watching else: if Rick & Morty is not Japanese-style anyway then RWBY...

    I also started to watch Houkago Saikoro Club — mosty about girls, tabletop gaming and sometimes making. By the way, what I am watching else: if Rick & Morty is not Japanese-style anyway then RWBY has some styles.

    I finished to read mangas:

    • Yagate Kimi ni Naru — nice story about love beetwen girls. Not so long time ago was anime.
    • Yesterday wo Utatte — old story about love.
  5. Comment on What have you been watching / reading this week? (Anime/Manga) in ~anime

    asterisk
    Link
    Itʼs my new seasonʼs comment about animes, yeah. Fallʼs animes Babylon — detective, triller and mystic. Beastars — good story and animation, the best openning. Chuubyou Gekihatsu Boy — five odd...

    Itʼs my new seasonʼs comment about animes, yeah.

    Fallʼs animes

    • Babylon — detective, triller and mystic.
    • Beastars — good story and animation, the best openning.
    • Chuubyou Gekihatsu Boy — five odd guys and one girl.
    • Hoshiai no Sora — sport with drama about families.
    • Mugen no Juunin: Immortal — samurais, revenge and older Dororo.
    • Watashi, Nouryoku wa Heikinchi dette Itta yo ne! — cute girls in slice-of-lifeʼs isekai. Itʼs a good thing after Babylon.

    From previous season and new part

    • Chihayafuru 3
    • Dr. Stone
    • Vinland Saga

    Out-category

    • Aggressive Retsuko — two seasons are mostly about what we hate.
    • Black Fox — revenge and fathers, so-so for me.
    • Gabriel Dropout — fine simple comedy.
    • Gankutsuou — Japanese Monte Cristo with good-strange style
    • Penguin Highway — similar to next anime and have some similar themes: weather with affects, love and against-older; and for me this anime was better.
    • Tenki no Ko
    2 votes
  6. Comment on Must-have browser extensions? in ~tech

  7. Comment on Russia paid radio broadcaster $1.4 million to air Kremlin propaganda in Washington, D.C. in ~news

    asterisk
    Link
    Not so along time ago in Ukraine, partner of Putinʼs comparde bought neutral or pro-Ukrainian TV-chanel ZIK 🇺🇦. He already has 2 another popular enough channels: NewsOne 🇺🇦 & 112 Ukraine. Here is...

    Not so along time ago in Ukraine, partner of Putinʼs comparde bought neutral or pro-Ukrainian TV-chanel ZIK 🇺🇦. He already has 2 another popular enough channels: NewsOne 🇺🇦 & 112 Ukraine. Here is web-propaganda a year ago in Baltic.

    Kremlin has no doubts in money for informational influence.

    2 votes
  8. Comment on I just ran across Planetes and I love it, any similar recommendations? in ~anime

    asterisk
    Link
    …and maybe a couple others. I dunno, but just for certain: Akira, Area 88.

    …and maybe a couple others.

    I dunno, but just for certain: Akira, Area 88.

    1 vote
  9. Comment on What have you been watching/reading this week? (Anime/Manga) in ~anime

    asterisk
    Link
    I did not write a long time about new season. So, I am watching: Carole & Tuesday — good music and around music, not idol, anime on Mars in future. Fairy Gone — kinda JoJo, but with kinda politic...

    I did not write a long time about new season.

    So, I am watching:

    • Carole & Tuesday — good music and around music, not idol, anime on Mars in future.
    • Fairy Gone — kinda JoJo, but with kinda politic and not so good CG; here is also hard-names of towns which I do not remember. Very middle anime, but I somewhy watch. maybe because I like main heroine — she is pretty girl.
    • Kenja no Mago — kinda isekai but I define as almost general slice-life but with politic and magic. It is not harem but here is enough of dithyrambs for main hero.
    • Kimetsu no Yaiba — shounen anime about oldtime world with demons, with good animation and some brutal and cute.
    • Mix: Meisei Story — to be honest, I did not watch any Touch but Cross Game. Simple spokon where slice-life is main subject.
    • Sarazanmai — good anime of drama, kappas and absurdic.
    • Sewayaki Kitsune no Senko-san — perfect iyashikei.

    shorts & sprecial

    • Joshi Kausei — 4 min: three girls, slice-life with sometime light ecchis.
    • Miru Tights — 4 min: tights, girls and ecchi.
    • Chou Kadou Girl ⅙ — 15 min: otaku-culture about figures which are alive.
    • Watashi ni Tenshi ga Maiorita! - special: lolis, kinda iyashikei.

    from previous season

    • Dororo — same as Kimetsu no Yaiba above, but I somewhy do not feel it as shounen. And by the way only some, I guess two, episodes have a really bad animation. First OP is catchy.
    • JoJo no Kimyou na Bouken: Ougon no Kaze

    I rarely read manga but I was a glad to read a short [but name is not, bhh] completed manga with three volumes — Jumyou wo Kaitotte Moratta. Ichinen ni Tsuki, Ichimanen de.

    1 vote
  10. Comment on What anime should everyone watch? in ~anime

    asterisk
    Link
    Perfect Blue.

    Perfect Blue.

    1 vote
  11. Comment on What have you been watching/reading this week? in ~anime

    asterisk
    (edited )
    Link
    I guess, better to create week-topisc when week starts/ends, so, yeah, better to do this anywhen between Friday — Monday. About watching. I just watching what mentioned here, but Shoujo☆Kageki...

    I guess, better to create week-topisc when week starts/ends, so, yeah, better to do this anywhen between Friday — Monday.

    About watching. I just watching what mentioned here, but Shoujo☆Kageki Revue Starlight instead Muhyo to Roji no Mahouritsu Soudan Jimusho.

    Nothing especial on this week but only one. I start watch Lupin only from the ongoing series. So, last outed episode (20th) was about (post-)Soviet location, it suprised me (I am from Ukraine), because it is very rarely to see good enough (post-)Soviet: backgrоunds, uniforms, buildings, cars etc.

    I am currently reading last outed book Game of Thrones, so I do not have so much time for mangas.

  12. Comment on What is your favorite anime, and why? in ~anime

    asterisk
    Link
    Well, it’s hard to write about favorite anime, cause I cann’t choose. But I would like to mention Sayonara Zetsubou Sensei: Good absurd comedy on many [mostly japonic] thematics. Very, hm… special...

    Well, it’s hard to write about favorite anime, cause I cann’t choose. But I would like to mention Sayonara Zetsubou Sensei:

    • Good absurd comedy on many [mostly japonic] thematics.
    • Very, hm… special OPs, example: evolution of one.
    1 vote
  13. Comment on Summer 2018 Anime: What have you picked up? in ~anime

    asterisk
    (edited )
    Link
    Summer is good on and for comedies: Asobi Asobase Chio-chan no Tsuugakuro Grand Blue So, I am watching Banana Fish Hataraku Saibou Tsukumogami Kashimasu — slice of life with tsukumogami during...

    Summer is good on and for comedies:

    • Asobi Asobase
    • Chio-chan no Tsuugakuro
    • Grand Blue

    So, I am watching

    • Banana Fish
    • Hataraku Saibou
    • Tsukumogami Kashimasu — slice of life with tsukumogami during Tokugawa period; it started late, 3rd episode was outed yesterday; I like that rhythmic OP.
    • Muhyo to Roji no Mahouritsu Soudan Jimusho — but this started very late — 1st episode was last week, so I dunno, looks a little like Mob Psycho 100.

    From previous season

    • Lupin Sansei: Part 5
    1 vote
  14. Comment on How are you keeping track of anime? in ~anime

    asterisk
    Link
    I started from MAL. Later I used Shikimori — it’s Muskovian alternative. But from a long time ago I am using AniDB. I didn’t have any big problem with changing, cause all mentioned sites have...

    I started from MAL. Later I used Shikimori — it’s Muskovian alternative. But from a long time ago I am using AniDB. I didn’t have any big problem with changing, cause all mentioned sites have im/export.

  15. Comment on Markdown in ~tildes

    asterisk
    Link Parent
    As I see, http://~ is redirecting to https://~, so here is always https, and my browser will take me to https://example. But, yeah, youʼre right, and thanks for explanation, I checked: if a...

    As I see, http://~ is redirecting to https://~, so here is always https, and my browser will take me to https://example. But, yeah, youʼre right, and thanks for explanation, I checked: if a web-site doesnʼt have own redirect or doesnʼt support then Iʼll get an error.

    1 vote
  16. Comment on Markdown in ~tildes

    asterisk
    Link
    I like Markdown+HTML cause it isnʼt hard. I preffer kinda markdown from StackExchange because : you can use paragraph with indantation part of htpps: or htpp: isnʼt necessary...

    I like Markdown+HTML cause it isnʼt hard. I preffer kinda markdown from StackExchange because :

    • you can use paragraph with indantation
    • part of htpps: or htpp: isnʼt necessary [link](//tildes.net/~tildes/1zo); wait, you can even for siteself [link](/~tildes/1zo)

    As I know, Tildesʼ canʼt that. I would like to have preview for markdown, I guess it would be easier to understand how markdown works and a good thing for find mistakes with mardown.

    1 vote
  17. Comment on Name a cool, mostly unknown feature of your OS of choice in ~tech

    asterisk
    (edited )
    Link
    Windows: you can put a link of image in a field of ”Choose file” dialog box, and it will upload on sile as local image file (which is true, as I know, this image will be as caсhe or sorta this).

    Windows: you can put a link of image in a field of ”Choose file” dialog box, and it will upload on sile as local image file (which is true, as I know, this image will be as caсhe or sorta this).

  18. Comment on Favorite linux distro? in ~tech

    asterisk
    Link
    I donʼt know Linux well: about 1—2 year/s. So, itʼs obviously that I like/d Ubuntu, Mint with DE like MATE or Cinnamon. Later I found Arch where Pacman & AUR is fine for me. I know about tiling DE...

    I donʼt know Linux well: about 1—2 year/s. So, itʼs obviously that I like/d Ubuntu, Mint with DE like MATE or Cinnamon. Later I found Arch where Pacman & AUR is fine for me. I know about tiling DE like i3 or awesome but I still canʼt get used to them.

    1 vote
  19. Comment on Internet censorship around the world in ~tech

    asterisk
    Link
    In Russia who controls censorship of the internet is Roskomnadzor. Their web-site has English version, so it can a little help to you.

    In Russia who controls censorship of the internet is Roskomnadzor. Their web-site has English version, so it can a little help to you.

    1 vote
  20. Comment on Where are you from? in ~talk

    asterisk
    Link
    Well, seems, Iʼm first from Ukraine (Kyiv) here.

    Well, seems, Iʼm first from Ukraine (Kyiv) here.

    2 votes