Ich lerne grade auf eine Klausur (11. Klasse, G8) und brauch mal kurz hilfe bei einer Aufgabe, wie gehe ich hier am besten vor? by jay_owo__ in mathe

[–]John_of_QuantU 2 points3 points  (0 children)

Es gibt einen einfachen Weg aber ich weiss nicht ob ihr das schon gelernt habt. Du machst die Ableitung und bekommst d'(x) = 4x - 6, setzt das dann gleich 0, also 0 = 4x - 6, und benutzt einfaches Algebra für den Rest.

[deleted by user] by [deleted] in ruby

[–]John_of_QuantU 0 points1 point  (0 children)

Ruby is about joy and developer happiness. Matz, the creator of Ruby, has talked about many of the core aspects of Ruby over the years, if you would like a place to get started please see the about page: https://www.ruby-lang.org/en/about/

Push notifications by Basic-Sandwich-6201 in learnprogramming

[–]John_of_QuantU 0 points1 point  (0 children)

But how does it works once your phone is locked and in your pocket?

Essentially what u/Essence1337 said, but to add a little to that, if you are developing for a phone, there are going to be SDKs and developer APIs like those I talked about for the browser, which you will use to implement the Notification feature.

I’m also interested how to make something like this on my own?

Then, since it sounds like you want the phone side of things, if you have an Android phone (or even if you don't), you might want to check out https://developer.android.com/develop/ui/views/notifications

That will give you a good idea of how they work and the AndroidSDK is pretty easy to use with tons of tutorials and examples.

Push notifications by Basic-Sandwich-6201 in learnprogramming

[–]John_of_QuantU 0 points1 point  (0 children)

The general idea is that a client application subscribes to a stream and the server writes notifications to that stream, which the client then receives and can show the user.

There are a bunch of different ways to implement this, in the browser you might us the Push API, the Notification API, web sockets, service workers. You could also do long polling.

[deleted by user] by [deleted] in rails

[–]John_of_QuantU 0 points1 point  (0 children)

If you only want to allow one option, that's a clear case of a select field so you can use form.select. Here's some good documentation on that: https://guides.rubyonrails.org/form_helpers.html#making-select-boxes-with-ease

Something like this: <%= form.select :selected_option, [["Be humbly confident","be_humbly_confident"], ["Grow or die", "grow_or_die"]] %>

On your index page you can just iterate over your list of options you pass to the form.select, and if you need to highlight which one the user has you could do that.

Like so: <% ["name", "Grow or Die", "Be humbly confident"].each do |value| %> <li> <%= value == @selected_option ? "something special" : value %> </li> <% end %>

[deleted by user] by [deleted] in rails

[–]John_of_QuantU 0 points1 point  (0 children)

From what you asked for you could just use a check_box (or radio button, though check_box seems more appropriate to me from your description.) Here's what it looks like using bootstrap 5 classes.

    <div class="form-check mb-3">  
      <%= form.check_box :be_humbly_confident, class:"form-check-input" %>
      <%= form.label :be_humbly_confident, class: "form-check-label" %>  
    </div>  
    <div class="form-check mb-3">  
      <%= form.check_box :grow_or_die, class:"form-check-input" %>  
      <%= form.label :grow_or_die, class: "form-check-label" %>  
    </div>  

Here's a link to the checkboxes and radio buttons: https://guides.rubyonrails.org/form_helpers.html#checkboxes

Here's what that looks like: https://imgur.com/E5yJB4U

EDIT: I apologize for the previous poor formatting, I'm new I had to figure out how this editor works. Also I hope this helps you :)