• 2 Posts
  • 50 Comments
Joined 1 year ago
cake
Cake day: June 12th, 2023

help-circle


  • Display and layout rules aren’t difficult at all. Maybe I’m just not experienced enough. I’ve been a web dev for nearly a decade now and I feel like I’ve got the hang of it. That being said, I don’t work on projects that have to work on everything from a Nokia to an ultra wide monitor. We shoot for a few common sizes and hope it clears between edge cases nicely. What is an example of something that wraps randomly?


  • Genuinely, though, CSS is fairly clear cut about the rules of positioning and space. Relative positioning is one of the most important concepts to master since it allows things to flow via the HTML structure and not extra CSS. Fixed positioning is as if you had no relative container other than the window itself. Absolute positioning is a little weird, but it’s just like fixed positioning except within the nearest parent with relative positioning.

    Everything else is incredibly straight forward. Padding adds space within a container. Margins add space outside a container. Color changes text color. Background-color changes the background color of an element.

    Top, left, right, and bottom dictate where the element should be positioned after the default rules are applied. So if you have a relative div inside a parent which is half way down the page, top/right/left/bottom would move the element relative to it’s position within the parent. If you made the div fixed, it would be moved relative to the window.

    Lastly, if you’re designing a webpage just think in boxes or rows and columns. HTML can define 75% of the webpage structure. Then with just a bit of CSS you can organize the content into rows/columns. That’s pretty much it. Most web pages boil down to simple boxes within boxes. It just requires reading and understanding but most people don’t want to do that to use CSS since it feels like it should just “know”.

    As someone who has built QT, Swing, and JavaFx applications, I way prefer the separation of concerns that is afforded us via HTML JS and CSS.




  • I was talking about meat replacements but I put tofu in that category as well because I don’t have a lot of experience with tofu outside of “we have this instead of meat”.

    Vegan food is cheaper in America, for sure. Beans, veg (some) and rice are cheap. However fruit is expensive.

    But the alternatives to meat are not cheap: tofu is like $5/lb compared to chicken which can be as low as $2.99/lb. Steak is expensive in America, but it can be close to the cost of tofu. It’s definitely cheaper than the steak-alternatives like beyond meat.

    While you might find meat replacements to be unnecessary, most Americans (myself included) struggle. 90% of the meals I used to eat were some variation of: protein (meat/chicken/fish), plus a veggie, plus a carb (rice/bread). That was the basic dinner. It has a nice ratio of protein to carb. It was tasty (to me at least) and the cost wasn’t too bad.

    I’m guessing I’m not alone, culturally. It’s not like you can fry up two slabs of tofu and just call it a day. Tofu is just different. It doesn’t cook the same and it doesn’t taste the same. I cook tofu at least once a week, but I treat it very differently.

    It’s just not easy for Americans to justify going vegan. It’s culturally very different and - if you want to stay within the culture - it’s expensive.

    But that’s why I always advocate for meat reduction, not replacement. Eat more vegetables. Try other dinners. Etc. But most Americans are remiss to be told what to do.


  • There in lies the rub, though. Most vegans are vegan for a moral reason that they believe applies to you:

    • Animals deserve life / don’t deserve livestock conditions
    • “Growing” meat is speeding up global warming compared to growing crop

    There are more fringe reasons for veganism such as: diet, health, etc. But those aren’t relevant to the point I’m making.

    “Live and let live” doesn’t apply to situations where we’re talking about global warming or the abuse of animals. Most vegans are trying to educate others and - yeah - they probably vote for things that would result in more expensive meat or less meat being available in your local markets. I believe most vegans are hoping their efforts will slow global warming and provide better living conditions for livestock.

    I’m not trying to sit on a moral podium here and judge. I eat meat too. I’m not vegan. Though I’ve tried to reduce how much meat I eat in yet another small, feckless, civilian effort to slow global warming. All I’m saying is: I sympathize with people who want to improve the world and I understand why they spend time and effort talking about being vegan.

    But meat in america is cheaper than the vegan stuff and definitely tastier. So it’s hard for us to meaningfully change.




  • Captain Janeway@lemmy.worldtoProgrammer Humor@lemmy.mlCSS Humor
    link
    fedilink
    arrow-up
    26
    arrow-down
    1
    ·
    edit-2
    6 months ago
    #moustache {
      position: absolute;
      bottom: 10px;
      margin: 0 auto;
    }
    

    If that doesn’t work:

    #moustache {
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
    }
    

    Relative positioning is preferred but not always available if the parent face is positioned absolutely.

    Edit: adjusted bottom from 0 -> 10px since 0 would be at the bottom of the chin but there is obviously some padding to bring it nearer the lip



  • Yeah my plan (dream) has always been like this:

    • Use the internet while I have it (assuming people just all disappear suddenly) to download survival guides, solar panel repair/installation PDFs, maps, etc. Anything I can think of, I’ll download
    • Gas only lasts so long. I can use chemicals that extend it, but it’s definitely limited. I’d start with a gas powered truck and eventually move into electric vehicles. Batteries aren’t forever either… But I’d try.
    • I’d move to a warm, temperate climate
    • I’d find a building that claims it is powered by solar panels most of the year. I’d use that as my home
    • I’d immediately begin trying to farm. I have a black thumb so this would take me some years to get done correctly. But I’d hopefully have some potatoes and grain growing by the end of a year
    • In the meantime, I might find things to occupy my time such as: finding videogames to play, raising chickens, fishing, collecting guns/ammo, collecting books to preserve, storing solar panels, backup equipment, etc.

    My end goal would be to survive as long as I’m happy. I’m pretty introverted so that would last a while. I’d use animals to keep me company. I believe nature would take us over pretty quickly. It would be hard to maintain the house, solar, etc. forever. But if I could, I would.

    My wife and I already do a lot of foraging in our area and we have several guides for edible food. We also do some canning and prepping for disasters.

    I don’t think a disaster would be a picnic. People are the problem. But if they disappeared suddenly, I think it would be pretty livable.





  • That theorem basically says any problem can be solved computationally in a reasonable amount of time.

    The P versus NP problem is a major unsolved problem in theoretical computer science. In informal terms, it asks whether every problem whose solution can be quickly verified can also be quickly solved.

    The informal term quickly, used above, means the existence of an algorithm solving the task that runs in polynomial time, such that the time to complete the task varies as a polynomial function on the size of the input to the algorithm (as opposed to, say, exponential time).

    If you prove P is not equal to NP, then we can probably assume the simulation isn’t being run.

    But that assumes a lot. Who is to say how a universe outside our universe might behave? Maybe they aren’t constrained in the same ways we are for some unfathomable reason.



  • Yeah but in your example, you wouldn’t need to look anything up either. You’re presumably very familiar with the offset of your time to their time? You’d also become familiar with their “universal time” versus your time. You’d just know what hours they’d be awake and asleep because you will have done the translation a few times.

    In addition, I - personally - would find it easier to memorize times in a single system: e.g. remembering that people in China are awake from 9pm to 8am is easier for me to remember. I typically already do this in my own head. I’ll convert times to my own local time and then memorize that. Do other people not do that? I find it much easier to look at my own clock and know if I can reach out to someone internationally.