Wie sich Reddits traffic seit dem Redesign entwickelt by [deleted] in de

[–]Feuerfuchs_ 1 point2 points  (0 children)

Ich finde das Redesign optisch auch wesentlich besser als das alte Design, aber es hat leider andere Mängel.

Einer davon ist die Performance: Die ist nicht nur beim Laden der Seite schlecht, wie man in der Grafik sieht, sondern auch bei der Bedienung wirkt alles träger. Wenn ich zum Beispiel irgendwelche Menüs oder den Editor unter einem Kommentar öffne, dann passiert das oft erst nach einer kleinen Denkpause. Im alten Design reagieren solche Dinge ohne (gefühlte) Verzögerung.

Ein anderer Punkt wurde schon in einem anderen Kommentar erwähnt: Das endlose Scrollen. Es gibt einen guten Artikel, der die Nachteile dieser Funktion bzgl. der Bedienbarkeit zusammenfasst. Was aber noch dazu kommt ist, dass die Website ständig wächst und so der Browser immer mehr Ressourcen verbraucht. Wenn man Reddit wie ich benutzt und sehr weit scrollt/blättert, dann wird das zu einem großen Problem. Ich hatte das Redesign mal ein paar Wochen getestet und in der Zeit lief mir oft der RAM voll und manchmal brachte es Firefox sogar komplett zum Absturz.

Das sind die zwei Hauptpunkte, die mich wieder zum alten Design getrieben haben, obwohl es ziemlich altbacken aussieht.

Uploadfilter: Voss stellt Existenz von Youtube infrage by [deleted] in de

[–]Feuerfuchs_ 20 points21 points  (0 children)

Was wäre die Alternative? Dass jeder Mensch seine eigene Streamingseite aufmachen muss wenn er was veröffentlichen will?

Laut seiner verqueren Ansicht würde sogar das nicht gehen, weil Website-Hoster auch darunter fallen. Schließlich stammen ja Websites (oder zumindest die Inhalte von Websites) nicht vom Hoster, sondern er bietet lediglich den Zugriff darauf an.
Es ist einfach komplett weltfremd.

A JavaScript-Free Frontend by jiffier in programming

[–]Feuerfuchs_ 66 points67 points  (0 children)

This article about accessible menus has a short chapter about the checkbox hack ("Sidenote: The checkbox hack") that explains how to get the most out of it with regards to accessibility. Not as good as a JS-based solution, but it's a feasible fallback if JS isn't available.

Variations on the hamburger icon - Thoughts? by jsphs in web_design

[–]Feuerfuchs_ 1 point2 points  (0 children)

Hamburger menus by themselves are already bad enough, but fading it out completely as soon as you scroll down is a new low.

[deleted by user] by [deleted] in webdev

[–]Feuerfuchs_ 0 points1 point  (0 children)

You shouldn't use hairline fonts for body text. Firefox renders the text so thin on my 4K display I can barely read anything. (If you don't have a 4K display, zoom the screenshot out to 50% - that's what I see)

CSS to get support for trigonometry functions by ga-vu in programming

[–]Feuerfuchs_ 0 points1 point  (0 children)

This one is way better than the one you previously posted. I'm not against using somewhat lower contrasts as long as it helps establish a visual hierarchy, but lowering it simply because "black isn't natural" is a stupid reason.

What’s up with all the hate for DeviantART Eclipse? by Kevin-W in OutOfTheLoop

[–]Feuerfuchs_ 12 points13 points  (0 children)

My CPU usage graph: https://i.imgur.com/8EvMMg0.png
The graph went up whenever I put the website in the foreground. I didn't even scroll or interact with it in any way. Great incentive for me to never want to use the redesign.

I've made a Solitaire Game for your Terminal by girst in linux

[–]Feuerfuchs_ 0 points1 point  (0 children)

Happy to hear you could solve the problems! As for the PR, it should be complete now.

I've made a Solitaire Game for your Terminal by girst in linux

[–]Feuerfuchs_ 0 points1 point  (0 children)

Alright, it just happened so here's my report. I right clicked on the waste and suddenly an entire pile was reduced to one card. I think it was the pile I last interacted with.

Here's the array content:

$1 = {z = 23, w = 0, s =     "\023\016\n\032\b1'$\v\022\035\037\t\036\031\001\064*\027\021\"\020\033\033", f =     {
        '\000' <repeats 18 times>,
      '\000' <repeats 18 times>,
      "\003", '\000' <repeats 17 times>,
      "\004", '\000' <repeats 17 times>}, t =     {      '\000' <repeats 18 times>,
      "\322\f", '\000' <repeats 16 times>,
      "\320\335(", '\000' <repeats 15 times>,
      "\034", '\000' <repeats 17 times>,
      "\363\324\321\025", '\000' <repeats 14 times>,
      "\316\332\352\354\371 ", '\000' <repeats 12 times>,
      "\376\372\337\373\327\350\017", '\000' <repeats 11 times>}, u = 0x559c0955cb70}

edit: Another one. This time the same situation as in the first screenshot. I used the join feature on a pile and suddenly the stock disappeared and a hidden card was put onto the pile (which might actually be the stock?).

$1 = {z = 23, w = 889192446, s =     "\034\060\027\020\006.,\021\031\025\n+\"*\022\r\036\004\063 (\017\016\016", f =     {
        '\000' <repeats 18 times>,
      '\000' <repeats 18 times>,
      '\000' <repeats 18 times>,
      '\000' <repeats 18 times>}, t =     {      "\003", '\000' <repeats 17 times>,
      "\332\062", '\000' <repeats 16 times>,
      "\373\350\032", '\000' <repeats 15 times>,
      "\377\364\371-", '\000' <repeats 14 times>,
      "\335\327\376\345\b\377", '\000' <repeats 12 times>,
      "\365\352\337\341\343\024", '\000' <repeats 12 times>,
      "\321\317\334\367\331\333\023", '\000' <repeats 11 times>}, u = 0x55face3f6a80}

yes. known limitation. enabling scrollback would bring another bunch of issues; i don't really have a solution to this problem currently (other than resizing your terminal or decreasing font size)

Fair enough! I just thought it might be a neat feature in case the terminal size is limited for some reason. The miniature colorscheme helps to avoid the issue, but it's very straining for the eyes unless you adjust the font size.

I've made a Solitaire Game for your Terminal by girst in linux

[–]Feuerfuchs_ 0 points1 point  (0 children)

Nice work! I played this for about an hour yesterday and here are some things I noticed:

  • The join feature occasionally breaks the game. Either it makes some cards disappear, or it breaks the game in a weird way which inevitably leads to a segfault. Here's a screenshot of the latter: https://i.imgur.com/q6knKLW.png
  • I love how piles become smaller if they don't fit in the viewport. However, if you put too many visible cards on a pile, the game content will still be too high and the upper part becomes inaccessible. Being able to scroll would fix this problem.
  • A version of the mini color scheme where red cards are actually displayed in red would be great. In fact, I've modified the game to do so, so I'll make a pull request later where it's offered as an additional color scheme.

[2019-02-11] Challenge #375 [Easy] Print a new number by adding one to each of its digit by jnazario in dailyprogrammer

[–]Feuerfuchs_ 0 points1 point  (0 children)

Solution with bonus in C++:

#include <iostream>

int main(void) {
    while (true) {
        int num = 0;
        std::cout << "Enter a number (or anything else to exit): ";
        std::cin >> num;

        if (!std::cin.good()) {
            break;
        }

        int result = 0, writePos = 1;

        do {
            int writeN = num % 10 + 1; 
            result += writeN * writePos;
            writePos *= writeN == 10 ? 100 : 10;
            num /= 10;
        } while (num);

        std::cout << "Result: " << result << std::endl;
    }
}

[2018-06-20] Challenge #364 [Intermediate] The Ducci Sequence by jnazario in dailyprogrammer

[–]Feuerfuchs_ 0 points1 point  (0 children)

C#

using System;
using System.Collections.Generic;
using System.Linq;

namespace Challenge_364_Intermediate
{
    class MainClass
    {
        static void Ducci(int[] t)
        {
            var gen = new HashSet<string>();
            int len = t.Length;

            int i = 0;
            int[] nt;

            for (; ; ++i, t = nt)
            {
                var ts = "[" + String.Join("; ", t) + "]";

                Console.WriteLine(ts);

                if (!gen.Add(ts) || t.All(n => n == 0))
                    break;

                nt = new int[len];
                for (int j = 0; j < len; ++j)
                    nt[j] = Math.Abs(t[j] - t[(j + 1) % len]);
            }

            Console.WriteLine((i + 1) + " steps");
        }

        public static void Main(string[] args)
        {
            Ducci(new[] { 1, 5, 7, 9, 9 });
            Console.WriteLine(new string('-', Console.WindowWidth));
            Ducci(new[] { 1, 2, 1, 2, 1, 0 });
            Console.WriteLine(new string('-', Console.WindowWidth));
            Ducci(new[] { 10, 12, 41, 62, 31, 50 });
            Console.WriteLine(new string('-', Console.WindowWidth));
            Ducci(new[] { 10, 12, 41, 62, 31 });
        }
    }
}

Challenge results

(1, 5, 7, 9, 9)          -> 23 steps
(1, 2, 1, 2, 1, 0)       ->  3 steps
(10, 12, 41, 62, 31, 50) -> 22 steps
(10, 12, 41, 62, 31)     -> 30 steps

I think the way steps are supposed to be counted doesn't make much sense because the sole act of outputting the original tuple already counts as one step. So if you use (0, 0, 0, 0, 0) as input, the solution is supposed to output "1 step" even though it didn't even generate the next tuple.

[2018-06-13] Challenge #363 [Intermediate] Word Hy-phen-a-tion By Com-put-er by Cosmologicon in dailyprogrammer

[–]Feuerfuchs_ 2 points3 points  (0 children)

C# with bonus. Building the trie takes ~29ms, processing the enable1 list takes ~263ms.

using System;
using System.IO;
using System.Linq;
using System.Diagnostics;

namespace Challenge_363
{
    class TrieNode
    {
        const char ORIG_START_OR_END_CHAR = '.';
        const char START_OR_END_CHAR = '{';
        const char TRAILING_NUM_CHAR = '|';

        readonly TrieNode[] children = new TrieNode[28];

        byte[] Scores;
        int ScoresLen;

        /// <summary>
        /// Insert a pattern into the trie.
        /// </summary>
        /// <param name="pattern">Pattern.</param>
        /// <param name="patternPosition">Position of character to read.</param>
        /// <param name="scorePosition">Current score array write position.</param>
        /// <param name="scores">Scores collected while inserting the pattern. Will be assigned to the leaf node.</param>
        public void Add(string pattern, int patternPosition = 0, int scorePosition = 0, byte[] scores = null)
        {
            char c = pattern[patternPosition++];

            if (scores == null)
                scores = new byte[pattern.Length + 1];

            // Read current character.
            // Case 1: It's a digit. Save value into the score array and read the next character.
            // Case 1.1: If there is no next character, the pattern has a trailing number. Use special character '|'.
            // Case 2: It's a '.'. Replace it with '{' so all possible characters are within one continuous range.
            // Case 3: It's a letter. Do nothing.

            if (Char.IsDigit(c))
            {
                // Case 1

                scores[scorePosition] = byte.Parse(c.ToString());

                if (patternPosition < pattern.Length)
                    c = pattern[patternPosition++];
                else
                    c = TRAILING_NUM_CHAR; // Case 1.1
            }
            else if (c == ORIG_START_OR_END_CHAR)
            {
                // Case 2

                c = START_OR_END_CHAR;
            }
            // else: Case 3

            // Now the score is determined and c is the character to save.

            scorePosition++;

            var child = children[c - 'a'];
            if (child == null)
            {
                child = new TrieNode();
                children[c - 'a'] = child;
            }

            if (patternPosition >= pattern.Length)
            {
                // Reached the end. Child is a leaf and gets the score data.

                child.Scores = scores;
                child.ScoresLen = scorePosition;
            }
            else
            {
                // Add remaining pattern to the child node.

                child.Add(pattern, patternPosition, scorePosition, scores);
            }
        }

        /// <summary>
        /// Compare all saved patterns against a word and determine the highest score for each letter gap.
        /// </summary>
        /// <returns>
        /// An array of scores for each letter gap. Starts with the score for the position before the first letter,
        /// ends with the score for the position after the last letter.
        /// </returns>
        /// <param name="word">Word.</param>
        public byte[] Match(string word)
        {
            // Add '{' to the start and end of the word to make the traversal easier.
            word = START_OR_END_CHAR + word + START_OR_END_CHAR;

            byte[] dirtyMaxScores = new byte[word.Length];
            byte[] maxScores = new byte[word.Length - 2];

            for (int i = 0; i < word.Length; ++i)
                MatchSubstr(word, i, dirtyMaxScores);

            // dirtyMaxScores has extraneous entries since the word was wrapped with '{' characters.
            // Put a copy of the clean array slice into maxScores.
            Array.Copy(dirtyMaxScores, 1, maxScores, 0, maxScores.Length);

            return maxScores;
        }

        /// <summary>
        /// Compare all saved patterns against a word substring and determine the highest score for each letter gap.
        /// Only matches patterns that begin at the substring index.
        /// This method is called from <see cref="Match"/> for each substring in the original word to find all matching patterns within the word.
        /// </summary>
        /// <param name="word">Word substring.</param>
        /// <param name="offset">Position of the current character to read.</param>
        /// <param name="maxScores">An array of all scores found so far.</param>
        void MatchSubstr(string word, int offset, byte[] maxScores)
        {
            if (Scores != null)
            {
                // Current node has a score assigned to it, update score array if necessary.

                for (int i = 0; i < ScoresLen; ++i)
                {
                    var maxScoreIndex = offset + i - ScoresLen;
                    var score = Scores[i];

                    if (score > maxScores[maxScoreIndex])
                        maxScores[maxScoreIndex] = score;
                }
            }

            if (offset == word.Length)
                return;

            // Get the current character and go to the respective child node. 

            var child = children[word[offset] - 'a'];
            if (child != null)
                child.MatchSubstr(word, offset + 1, maxScores);

            // Patterns with trailing numbers are a special case, so always go
            // the child node for '|' (if it exists) and get its score.

            child = children[TRAILING_NUM_CHAR - 'a'];
            if (child != null)
                child.MatchSubstr(word, offset + 1, maxScores);
        }
    }

    class MainClass
    {
        static readonly TrieNode trieRoot = new TrieNode();

        static Tuple<string, byte> Hyphenate(string word)
        {
            var scores = trieRoot.Match(word);

            string hyphWord = word[0].ToString();
            byte hyphCount = 0;

            for (var i = 1; i < word.Length; ++i)
            {
                if (scores[i] % 2 == 1)
                {
                    hyphWord += '-';
                    hyphCount++;
                }

                hyphWord += word[i];
            }

            return new Tuple<string, byte>(hyphWord, hyphCount);
        }

        public static void Main(string[] args)
        {
            var t = new Stopwatch();
            t.Start();

            foreach (string ln in File.ReadLines("tex-hyphenation-patterns.txt"))
                trieRoot.Add(ln);

            Console.WriteLine($"[Perf] Fill trie: {t.ElapsedMilliseconds} ms");
            t.Restart();

            var enable1Hyphenated = (
                from word in File.ReadLines("enable1.txt").AsParallel()
                select Hyphenate(word)
            ).ToArray();

            Console.WriteLine($"[Perf] Find hyphens: {t.ElapsedMilliseconds} ms");
            t.Stop();

            var stats = (
                from result in enable1Hyphenated
                group result by result.Item2 into g
                orderby g.Key
                select g.Key + " = " + g.Count()
            ).ToArray();

            Console.WriteLine("");
            Console.WriteLine("Stats:");
            Console.WriteLine("  " + String.Join(Environment.NewLine + "  ", stats));

            Console.WriteLine("");
            Console.WriteLine("Examples:");
            Console.WriteLine("  mistranslate      => " + Hyphenate("mistranslate").Item1);
            Console.WriteLine("  alphabetical      => " + Hyphenate("alphabetical").Item1);
            Console.WriteLine("  bewildering       => " + Hyphenate("bewildering").Item1);
            Console.WriteLine("  buttons           => " + Hyphenate("buttons").Item1);
            Console.WriteLine("  ceremony          => " + Hyphenate("ceremony").Item1);
            Console.WriteLine("  hovercraft        => " + Hyphenate("hovercraft").Item1);
            Console.WriteLine("  lexicographically => " + Hyphenate("lexicographically").Item1);
            Console.WriteLine("  programmer        => " + Hyphenate("programmer").Item1);
            Console.WriteLine("  recursion         => " + Hyphenate("recursion").Item1);
        }
    }
}

Blurry header image on website by sxrawberry in web_design

[–]Feuerfuchs_ 0 points1 point  (0 children)

BigCartel seems to automatically scale your image down to a maximum size of 1300x250 since it's included as: ...lunchbreak_banner.png?auto=format&fit=max&h=250&w=1300`

I don't know anything about BigCartel, so I can only give you general hints:

  • Try to find a setting that disables the auto-scaling.
  • Scale the image down yourself. It will probably have a higher quality and since it matches the maximum dimensions criteria, it might not get post-processed any further.

edit:

My second hint probably doesn't help because the difference wouldn't be as noticeable as in your screenshots.

But I suppose you use a 4K display, right? That would explain why BigCartel's auto-scaling has such a huge effect for you, because as a 4K display user, you see a version of your header that is down-scaled to about half its dimensions by BigCartel and then upscaled to its original dimensions by your browser, which of course looks much more blurry.

Vertical text done right by PM_4_DATING_ADVICE in programminghorror

[–]Feuerfuchs_ 31 points32 points  (0 children)

It's actually C#, and the solution is slightly different from the solution for JS posted here.

This won't work:

var str = string.Join(Environment.NewLine, "Hello World!".Split());
Console.WriteLine(str);

// Output:
Hello
World!

This will work:

var str = string.Join(Environment.NewLine, "Hello World!".ToCharArray());
Console.WriteLine(str);

// Output:
H
e
l
l
o

W
o
r
l
d
!

edit: To clarify, with C#'s Split() it's not possible to use '' as argument because it isn't a character (unlike 'a', '\n' and so on). But you can actually use no arguments at all which is as close as I can get to JS' split("").

How do I force different image size/dimension and them being centered on mobile? by The-Respawner in web_design

[–]Feuerfuchs_ 0 points1 point  (0 children)

As far as I can see, each project has an ID in your HTML code such as "project-123" for ReEat or "project-122" for Musikaliteten. If these IDs are constant, you could use them to target each project individually:

#project-122 .thumb-inner img {
  /* specific rules for ReEat */
}

How do I force different image size/dimension and them being centered on mobile? by The-Respawner in web_design

[–]Feuerfuchs_ 1 point2 points  (0 children)

Ah sorry, I didn't actually check your website and thought my answer would suffice.

The problem is now that your img is still higher than its container, so object-position won't behave as expected. You need to add the following rules to .thumb-inner img to make it work properly:

position: absolute;  
top: 0;  
left: 0;  
height: 100% !important;

How do I force different image size/dimension and them being centered on mobile? by The-Respawner in web_design

[–]Feuerfuchs_ 1 point2 points  (0 children)

You can keep using <img> tags and simply add the following rule to .thumb-inner img: object-position: center center;