Show filtered data from related table

I am doing a freight platform with Laravel 6 and I have to make a filter in the view to get the drivers assigned a route, the routes I show in the select they have different id to which they were assigned to the driver since when assigning the route a new record is created in the DB. He select which I show is like this:

The query and the filter I am doing as follows

public function index(Request $request){
    $users = User::rutas($request->rutasU)
    $rutas = Ruta::where('solicitada_por',Auth::id())->get();
    return view('cliente.unidades-disponibles.index',compact('users','rutas'))->with('rutaU',$request->rutasU);

The problem I have is that when filtering with the scope I don't know how to access the routes assigned to the driver since the route in turn is related to two other tabas, origin cities and destination cities. In an earlier case in which you had to get the driver of a route through your RFC, do it as follows:

public function scopeRfc($query, $rfc){
    $query->with('solicitadaPor')->whereHas('solicitadaPor', function($query) use($rfc) {
        $query->where('rfc','LIKE','%' . $rfc . '%');

How could I get the drivers assigned to the route obtained from select yes the id Are the routes different?

program to show summary of results, Java

I have written a program for my class that takes user input in state names and returns the bird and the state flower. At the end of the program, I need to print a summary of the results, and I can't understand how to do it. I have probably been watching this for a long time.

Main Class:

import java.util.Scanner;

public class Main {

public static void main(String() args) {
    StatesDataEntry inform = new StatesDataEntry();
    String states()() = inform.getState();
    Scanner input = new Scanner(;

    while (true) {
        System.out.println("Enter a State or 'None' to exit:");

        String state = input.nextLine();

        if (state.trim().equalsIgnoreCase("None")) {
        } else {
            int index = getStateIndex(state, states);
            if (index != -1) {
                System.out.printf("Bird: %s nFlower: %s n",
                    getBird(index, states), getFlower(index, states));
            } else {
                    .println("Please try again, an invalid State was entered.");

private static int getStateIndex(String state, String()() states) {
    for (int i = 0; i < states.length; i++) {
        if (state.trim().equalsIgnoreCase(states(i)(0))) {
            return i;
    return -1;

private static String getBird(int index, String()() states) {
    return states(index)(1);

private static String getFlower(int index, String()() states) {
    return states(index)(2);

and my data entry class:

import java.util.ArrayList;

public class StatesDataEntry {

private String state ()() = {
    {"ALABAMA","Nothern Flicker","Camellia"},
    {"ALASKA","Willow Ptarmigan","Forget-me-not"},
    {"ARIZONA","Cactus Wren","Saguaro Cactus Blossom"},
    {"ARKANSAS","Mockingbird","Apple Blossom"},
    {"CALIFORNIA","California Quail","California Poppy"},
    {"COLORADO","Lark Bunting","Rocky Mountain Columbine"}, 
    {"CONNECTICUT","American Robin","Mountain Laurel"},
    {"DELAWARE","Blue Hen","Peach Blossom"},
    {"FLORIDA","Northern Mockingbird","Orange Blossom"},
    {"GEORGIA","Brown Thrasher","Azalea"},
    {"HAWAII","Hawaiian Goose","Hawaiian Hibiscus"},
    {"IDAHO","Mountain Bluebird","Mock Oragnge"},
    {"ILLINOIS","Northern Cardinal","Violet"},
    {"IOWA","Eastern Goldfinch","Iowa"},
    {"KANSAS","Western Meadowlark","Sunflower"},
    {"KENTUCKY","Northern Cardinal","Goldenrod"},
    {"LOUISIANA","Brown Pelican","Magnolia"},
    {"MAINE","Black-capped Chickadee","White Pine Cone and Tassel"},
    {"MARYLAND","Baltimore Oriole","Black-eyed Susan"},
    {"MASSACHUSETTS","Black-capped Chickadee","Mayflower"},
    {"MICHIGAN","American Robin","Apple Blossom"},
    {"MISSISSIPPI","Northern Mockingbird","Magnolia"},
    {"MISSOURI","Eastern Bluebird","Hawthorn (flower)"},
    {"MONTANA","Western Meadowlark","Bitterroot"},
    {"NEBRASKA","Western Meadowlark","Goldenrod"},
    {"NEVADA","Mountain Bluebird","Sagebrush"},
    {"NEW HAMPSHIRE","Purple Finch","Purple Lilac"},
    {"NEW JERSEY","Eastern Goldfinch","Violet"},
    {"NEW MEXICO","Roadruner","Yucca Flower"},
    {"NEW YORK","Eastern Bluebird","Rose"},
    {"NORTH CAROLINA","Northern Cardinal","Flowering Dogwood"},
    {"NORTH DAKOTA","Western Meadowlark","Wild Prairie Rose"},
    {"OHIO","Northern Cardinal","Scarlet Carnation"},
    {"OKLAHOMA","Scissor-tailed Flycatcher","Oklahoma Rose"},
    {"OREGON","Western Meadowlark","Oregon Grape"},
    {"RHODE ISLAND","Rhode Island Red","Violet"},
    {"SOUTH CAROLINA","Carolina Wren","Yellow Jessamine"},
    {"SOUTH DAKOTA","Ring-necked Pheasant","Pasque Flower"},
    {"TENNESSEE","Nothern Mockingbird","Iris"},
    {"TEXAS","Northern Mockingbird","Bluebonnet"},
    {"UTAH","California Gull","Sego Lily"},
    {"VERMONT","Hermit Thrush","Red Clover"},
    {"VIRGINIA","Northern Cardinal","American Dogwood"},
    {"WASHINGTON","Willow Goldfinch","Coast Rhodedendron"},
    {"WEST VIRGINIA","Northern Cardinal","Rhodedendrom"},
    {"WISCONSIN","American Robin","Wood Violet"},
    {"WYONMING","Western Meadolark","Indian Paintbrush"},

public StatesDataEntry(){

public String()() getState() {
    return state;

public void setState(String()() state) {
    this.state = state;

wp query: show all repeater subfield values ​​from DB

Here's the thing: I'm working on a personal project that includes multiple custom fields (created through ACF). Few of them are repeaters.

What I want to achieve is to show 3 matrices / blocks of those repeater subfield values. For a better understanding, I have this repeater field: open_workshops, and this field includes subfields: date, location, associations.

I simply want to show all the values ​​of those subfields stored in DB. Something like:

Open workshops:

  • Date: January 2017, February 2017 … December 2019, etc.

  • Location: New York, Warsaw …

  • Associations: EY, Google ..

What problems I have noticed: first, due to the type of field (repeater) it is very difficult to find those values ​​in the database. Because it is not a single field, but ACF replicates their names, so instead of looking for a single field: open_workshops_date, somehow I need to find: open_workshops_0_date, open_workshops_1_date, etc.

My initial code was:

  if( have_rows('open_workshops') ):
        while ( have_rows('open_workshops') ) : the_row();
            $sub_value_1 = get_sub_field('date');
        $sub_value_2 = get_sub_field('location');
        $sub_value_3 = get_sub_field('partnerships');

          echo '$sub_value_1';
echo '$sub_value_2';
echo '$sub_value_3';

    else :
        // no rows found

I also tried the suggestion of this publication:
Retrieving all data from repeater fields

But it shows nothing.

Show more than 5 items under recent items SharePoint 2013 Quick Start

On the SharePoint 2013 site, the quick start navigation shows 5 items by default in recent items. And we have to increase that number to 8 or 10. I can't find any immediate way to do it and even google isn't helping. Could you suggest how we could achieve this? Is there any third party tool or any custom script that we can use to do it? Thanks in advance.

graphics3d: how can I show that a sphere is rolling in a simulation?

I recently wrote a code to simulate a table tennis ball rolling on the floor.

v0 = 10; w0 = 8; R = 4; mu = 0.2; g = 9.8;
δ = (2 (v0 + w0 R))/(5 mu g);

This gives the location of the ball.

location(t_) = 
    {If(t <= δ, 
      v0 t - 1/2* mu*g*t^2 + R, (3 v0 - 2 w0 R)/5 (t - δ) + 
       v0 δ - 1/2* mu*g*δ^2 + R), 3 v0 - 2 w0 R < 0},(*<0 roll back*)
    {If(t <= δ, v0 t - 1/2* mu*g*t^2 + R, 
      v0 δ - 1/2* mu*g*δ^2 + R), 3 v0 - 2 w0 R == 0},
    {If(t <= δ, 
      v0 t - 1/2* mu*g*t^2 + R, (3 v0 - 2 w0 R)/5 (t - δ) + 
       v0 δ - 1/2* mu*g*δ^2 + R), 3 v0 - 2 w0 R > 0}
    });(*>0roll front*)

and this gives the angle of rotation

zhuanjiao(t_) = 
 If(t <= δ, w0 t - (3 mu g )/(4 R) t^2, 
  w0 δ - (3 mu g )/(4 R) δ^2 - (3 v0 - 2 w0 R)/(5 R) (t - δ));(*>0 roll front*)

This implements the simulation.

    Rotate(Sphere({location(t), R, R}, R), -zhuanjiao(t), {0, 1, 
    0}, {location(t), R, R}) , 
    Method -> {"SpherePoints" -> 10},(*lower the sample to show roll*)
  Axes -> True, AxesOrigin -> {0, 0, 0}, 
  PlotRange -> {{0, 40}, {0, 2 R}, {0, 2 R}}, AxesLabel -> {x, y, z}
  ), {t, 0, 2 (2 (v0 + w0 R))/(5 mu g) + 10})

My question is: my way of showing that the ball is rolling is to lower your sample. Which is a bit awkward and ugly. Is there a better way to do it?

It's hard to show that a sphere is spinning. If I don't do what I have done, it seems that it glides on the plane, not rolling.

What document should I submit under & # 39; documents that show where you live & # 39; for the United Kingdom visa from India, if I don't have lease agreements, deeds, etc.?

I live with my uncle and my aunt in a rented house, but the rental agreement is not in my name. Although this address is the address in my passport, I'm not sure what document I should give for the "documents that show where you live", since I don't have a mortgage or deed of ownership. Please help. Can I give a legal affidavit of residence?

How much money do you have in savings? – United Kingdom visitor visa, could you show mutual funds and stock market investment as savings?

I was asked to enter "how much money do you have in savings" while filling out my UK Visa form. I entered the amount that I currently have in my bank account.

I have also invested in Investment funds and stock ExchangeCould I add those amounts to my bank balance and include it in my savings?

If the answer to the previous question is NO then :

Can I sell shares and redeem my mutual funds and will I receive the amount in my bank account within 1-2 days? Could you show it as my savings?

I am a salaried person, so I can show proof of funds added to my account by submitting salary receipts, but how will I show proof of the amount credited to my account by selling shares or redeeming mutual funds?

Please help ! Apple Mail does not show previous emails in Smart Mailbox after upgrading to 10.15.2

There were about 500 emails in my smart mailbox before upgrading to Catalina 10.15.2. It only shows 3 since the update.

The Inbox folder shows all emails. They just don't appear in "Smart Mailbox."

Smart Mailbox Settings

enter the description of the image here

Discrepancy in emails

enter the description of the image here

The inbox shows 503, while the smart mailbox only shows 3.

How to show that a language has no context?

A practical approach that works in many examples (but not always, I know) is trying to find the nesting structure of the strings in the language. "Nested dependencies" must be generated at the same time in different parts of the chain.

We also have the basic toolbox:

  1. concatenation: $ S a S_1S_2 $ if you can divide the language into two consecutive parts, use this production

  2. union: $ S a S_1 mid S_2 $ divided into disjoint parts

  3. iteration: $ S a S_1S mid varepsilon $

Example 1

Here is an example for nesting (thanks Raphael).

$ L = {b ^ ka ^ l (bc) ^ ma ^ nb ^ o mid k, l, m, n, or in { Bbb N}, k neq o, 2l = n, m ge 2 } $

Replace $ n $ with $ 2l $. Now we can release $ n $ in conditions.

Replace $ k neq or $ with $ k> or text {o} k < o$ (confused? $o$ is 'oh' not 'zero'). Apply tools for union. We work with $k > or $ here. Also $ k> or $ iff $ k = s + or $ y $ s> 0 $ where $ s $ is a new variable. Replace $ k $ with $ s + or $.

$ L_1 = {b ^ s + o} a ^ l (bc) ^ ma 2l} b ^ o mid l, m, o, s in { Bbb N}, s> 0, m ge 2 } $

Some simple rewrites.

$ L_1 = {bb ^ sb ^ o a ^ l bcbc (bc) ^ m (aa) ^ {l} b ^ o mid l, m, o, s in { Bbb N} } $

Now we see the nesting structure and start building a grammar.

$ S_1 to TV $, $ T to bU $, $ U to bU mid varepsilon $ (see: concatenation and iteration here)

$ V to bVb mid W $ (we generate $ or $ $ b $ & # 39; s on both sides)

$ W a aWaa mid X $

$ X a YZ $, $ Y a bcbc $, $ Z a bcZ mid varepsilon $

Example 2

$ K = {a ^ kb ^ lc ^ m mid l = m + k } $

A first "obvious" rewrite.

$ K = {a ^ kb ^ m + k} c ^ m mid m, k ge 0 } = {a ^ kb ^ mb ^ kc ^ m mid m, k ge 0 } $

In linguistics, this is called "cross-series dependency": the interlaced $ k, m, k, m $ (generally) strongly indicates the absence of context. Of course, $ m + k = k + m $ and we are saved.

$ K = {a ^ kb ^ {k + m} c ^ m mid m, k ge 0 } = {a ^ kb ^ kb ^ mc ^ m mid m, k ge 0 } $

with productions $ S a XY $, $ X a aXb mid varepsilon $, $ Y a bYc mid varepsilon $

Similarly $ K & # 39; = {a ^ kb ^ lc ^ m mid m = k + l } = {a ^ kb ^ lc ^ lc ^ k mid k, l ge 0 } $

with productions $ S a aSc mid X $, $ X a bXc mid varepsilon $

Final comment: these techniques help you find a context-free grammar that, hopefully, will recognize your language. A proof of correction may still be needed to ensure that grammar really works to recognize your language (nothing more and nothing less).

How to show only my content?

I want to make a view that only shows the content made by the user. For example, I have a library and it contains all the content that I marked, but I also want to show all the content that I made (even if I have not marked it).