Explore all Airlines related open source software, libraries, packages, source code, cloud functions and APIs.

Airlines provide air transport services for traveling passengers and freight. Airlines utilize aircraft to supply these services and may form partnerships or alliances with other airlines for codeshare agreements, in which they both offer and operate the same flight. Airlines may be scheduled or charter operators.

These software components cover functions across Air Traffic Control, Airport, Reservation Systems, Customs, GDS, Tourism areas.

Popular New Releases in Airlines

respa

0.12.1

spatial_access

v1.0.2

MSFS2020-Real-Time-Weather

Version 0.2

swot_simulator

Unsmoothed products

hotel-booking

SQL procedures and C# functions are ready!

Popular Libraries in Airlines

openflights

by jpatokal doticonphpdoticon

star image 1108 doticon

Website for storing flight information, rendering paths on a zoomable world map and calculating statistics, with plenty of free airline, airport and route data.

Real-Time-Taxi-Dispatch-Simulator

by carsonluuu doticonjavadoticon

star image 46 doticonMIT

Taxi Dispatch Simulator ✅

respa

by City-of-Helsinki doticonpythondoticon

star image 42 doticonMIT

Resource reservation and management app and API

CarbonFootprintAGU

by milankl doticonpythondoticon

star image 34 doticonGPL-3.0

Travel carbon footprint of AGU Fall Meeting 2019 in San Francisco, USA

Flight-Booking-System-JavaServlets_App

by harismuneer doticonjavadoticon

star image 33 doticonMIT

✈️ An enterprise level Flight Booking System for Turkish Airlines (web-application) based on the Model View Controller (MVC) Architecture made using Java Servlets, Java Server Pages (JSPs). Moreover authentication and authorization for users is implemented. The web-application is also secured against SQL Injection and Cross-Site Scripting attacks.

trip-optimizer

by khanhnamle1994 doticonpythondoticon

star image 31 doticon

Travel Time Optimization via Ant Colony and Genetic Evolution

VistArrow

by thegenuinegourav doticonjavadoticon

star image 31 doticonMIT

An Android App that will unleash Vistara Airport Experience.

spatial_access

by GeoDaCenter doticonpythondoticon

star image 28 doticon

xplane_airports

by X-Plane doticonpythondoticon

star image 24 doticonMIT

Python tools for manipulating X-Plane's apt.dat files & interfacing with the X-Plane Scenery Gateway API

Trending New libraries in Airlines

descent-app

by epranka doticonjavascriptdoticon

star image 22 doticon

Top of descent path calculator. Let's calculate your descent!

MSFS2020-Real-Time-Weather

by svp318 doticonpythondoticon

star image 15 doticonGPL-3.0

A work in progress to update a custom Microsoft Flight Simulator 2020 weather preset with the current conditions of a given airport.

Reservation-System

by ghulamghousdev doticoncsharpdoticon

star image 11 doticon

Airline Reservation System is an online Airline Ticket Reservation Application built using Windows Forms, C#, MS SQL Server.

Udacity-Capstone-Travel_App

by Candidemile doticonjavascriptdoticon

star image 10 doticon

Capstone Project: Travel App. HTML - CSS - Javascript - API - Node.js(Express) - Webpack and plugins - Babel - ESLint - Jest

amadeus-airport-city-search-mern

by amadeus4dev doticonjavascriptdoticon

star image 7 doticonMIT

Demo app which implementes Airport & City Search API autocompletion using a MERN stack

Ultimate-Booking-System

by BlondelSeumo doticonjavascriptdoticon

star image 7 doticon

Booking Core is a Booking System based on Laravel, designed for a travel website, Marketplace, Travel Agency, Tour Operator, Room Bnb, Villa Rental, Resort Rental, Make Travel website.

TicketBookingSystem

by krishkamani doticonjavadoticon

star image 6 doticon

This is a Ticket booking system application in android studio.

hotel-booking

by mezidia doticoncsharpdoticon

star image 6 doticonMIT

Our project with databases

mobileforce-afrivac

by hngi doticonjavadoticon

star image 5 doticon

Top Authors in Airlines

1

milankl

2 Libraries

star icon47

2

thegenuinegourav

2 Libraries

star icon38

3

WebMaestroFr

1 Libraries

star icon6

4

macsux

1 Libraries

star icon5

5

devendrachaplot

1 Libraries

star icon13

6

gnikolopoulos

1 Libraries

star icon5

7

cizif

1 Libraries

star icon19

8

CarlottaTagliaro

1 Libraries

star icon5

9

airsim

1 Libraries

star icon6

10

amadeus4dev

1 Libraries

star icon7

1

2 Libraries

star icon47

2

2 Libraries

star icon38

3

1 Libraries

star icon6

4

1 Libraries

star icon5

5

1 Libraries

star icon13

6

1 Libraries

star icon5

7

1 Libraries

star icon19

8

1 Libraries

star icon5

9

1 Libraries

star icon6

10

1 Libraries

star icon7

Trending Kits in Airlines

No Trending Kits are available at this moment for Airlines

Trending Discussions on Airlines

Clickhouse query with dictionary

I couldn't pass an img using ajax?

Traversing Relationships a Variable Number of Times in Cypher

Laravel using WHERE orWHERE

In Foundry Contour, How do I filter by multiple terms?

Question about my computation (Using R with dplyr and nyflights13 to figure out number of seat miles by carrier)

How do you find max/min of a non-numeric vector?

Problems with changing the size of the two upper boxes ( text/image)

Apache Spark Data Generator Function on Databricks Not working

EnhancedSeatMap Seat Without Price

QUESTION

Clickhouse query with dictionary

Asked 2022-Apr-15 at 03:13

I imported the database of ontime airlines from here https://clickhouse.com/docs/en/getting-started/example-datasets/ontime/

Then I created a dictionary mapping the 2 digit airplane codes to company names like this:

1id,code,company
21,UA,United Airlines
32,HA,Hawaiian Airlines
43,OO,SkyWest
54,B6,Jetblue Airway
65,QX,Horizon Air
76,YX,Republic Airway
87,G4,Allegiant Air 
9...
10..
11

I used this query to generate it and it seems to be working:

1id,code,company
21,UA,United Airlines
32,HA,Hawaiian Airlines
43,OO,SkyWest
54,B6,Jetblue Airway
65,QX,Horizon Air
76,YX,Republic Airway
87,G4,Allegiant Air 
9...
10..
11CREATE DICTIONARY airlinecompany
12(
13    id UInt64, 
14    code String,
15    company String
16
17)
18PRIMARY KEY id 
19SOURCE(FILE(path '/var/lib/clickhouse/user_files/airlinenames.csv' format 'CSVWithNames'))
20LAYOUT(FLAT())
21LIFETIME(3600)
22

In the main database (ontime) Looks like this:

1id,code,company
21,UA,United Airlines
32,HA,Hawaiian Airlines
43,OO,SkyWest
54,B6,Jetblue Airway
65,QX,Horizon Air
76,YX,Republic Airway
87,G4,Allegiant Air 
9...
10..
11CREATE DICTIONARY airlinecompany
12(
13    id UInt64, 
14    code String,
15    company String
16
17)
18PRIMARY KEY id 
19SOURCE(FILE(path '/var/lib/clickhouse/user_files/airlinenames.csv' format 'CSVWithNames'))
20LAYOUT(FLAT())
21LIFETIME(3600)
22SELECT Reporting_Airline AS R_air
23FROM ontime
24GROUP BY R_air
25LIMIT 4
26
27
28┌─R_air─┐
29│ UA    │
30│ HA    │
31│ OO    │
32│ B6    │
33└───────┘
34

What I want to do is have a table that uses R_air's 2 code value and then checks it against the airlinecompany dict to create a mapping ie

1id,code,company
21,UA,United Airlines
32,HA,Hawaiian Airlines
43,OO,SkyWest
54,B6,Jetblue Airway
65,QX,Horizon Air
76,YX,Republic Airway
87,G4,Allegiant Air 
9...
10..
11CREATE DICTIONARY airlinecompany
12(
13    id UInt64, 
14    code String,
15    company String
16
17)
18PRIMARY KEY id 
19SOURCE(FILE(path '/var/lib/clickhouse/user_files/airlinenames.csv' format 'CSVWithNames'))
20LAYOUT(FLAT())
21LIFETIME(3600)
22SELECT Reporting_Airline AS R_air
23FROM ontime
24GROUP BY R_air
25LIMIT 4
26
27
28┌─R_air─┐
29│ UA    │
30│ HA    │
31│ OO    │
32│ B6    │
33└───────┘
34R_Air Company
35UA | United Airlines
36HA | Hawaiian Airlines
3700 | SkyWest
38...
39..
40

But I cant seem to form this query correctly:

1id,code,company
21,UA,United Airlines
32,HA,Hawaiian Airlines
43,OO,SkyWest
54,B6,Jetblue Airway
65,QX,Horizon Air
76,YX,Republic Airway
87,G4,Allegiant Air 
9...
10..
11CREATE DICTIONARY airlinecompany
12(
13    id UInt64, 
14    code String,
15    company String
16
17)
18PRIMARY KEY id 
19SOURCE(FILE(path '/var/lib/clickhouse/user_files/airlinenames.csv' format 'CSVWithNames'))
20LAYOUT(FLAT())
21LIFETIME(3600)
22SELECT Reporting_Airline AS R_air
23FROM ontime
24GROUP BY R_air
25LIMIT 4
26
27
28┌─R_air─┐
29│ UA    │
30│ HA    │
31│ OO    │
32│ B6    │
33└───────┘
34R_Air Company
35UA | United Airlines
36HA | Hawaiian Airlines
3700 | SkyWest
38...
39..
40SELECT
41    Reporting_Airline AS R_Air,
42    dictGetString('airlinecompany', 'company', R_Air) AS company
43FROM ontime
44GROUP BY R_Air
45    
46
47Received exception from server (version 22.3.3):
48Code: 6. DB::Exception: Received from localhost:9000. DB::Exception: Cannot parse string 'UA' as UInt64: syntax error at begin of string. Note: there are toUInt64OrZero and toUInt64OrNull functions, which returns zero/NULL instead of throwing exception.: while executing 'FUNCTION dictGetString('airlinecompany' :: 1, 'company' :: 2, Reporting_Airline :: 0) -> dictGetString('airlinecompany', 'company', Reporting_Airline) String : 4'. (CANNOT_PARSE_TEXT)
49

What am I missing? I dont know why it thinks UA is a UInt64

ANSWER

Answered 2022-Apr-15 at 03:13

LAYOUT = COMPLEX_KEY_HASHED

1id,code,company
21,UA,United Airlines
32,HA,Hawaiian Airlines
43,OO,SkyWest
54,B6,Jetblue Airway
65,QX,Horizon Air
76,YX,Republic Airway
87,G4,Allegiant Air 
9...
10..
11CREATE DICTIONARY airlinecompany
12(
13    id UInt64, 
14    code String,
15    company String
16
17)
18PRIMARY KEY id 
19SOURCE(FILE(path '/var/lib/clickhouse/user_files/airlinenames.csv' format 'CSVWithNames'))
20LAYOUT(FLAT())
21LIFETIME(3600)
22SELECT Reporting_Airline AS R_air
23FROM ontime
24GROUP BY R_air
25LIMIT 4
26
27
28┌─R_air─┐
29│ UA    │
30│ HA    │
31│ OO    │
32│ B6    │
33└───────┘
34R_Air Company
35UA | United Airlines
36HA | Hawaiian Airlines
3700 | SkyWest
38...
39..
40SELECT
41    Reporting_Airline AS R_Air,
42    dictGetString('airlinecompany', 'company', R_Air) AS company
43FROM ontime
44GROUP BY R_Air
45    
46
47Received exception from server (version 22.3.3):
48Code: 6. DB::Exception: Received from localhost:9000. DB::Exception: Cannot parse string 'UA' as UInt64: syntax error at begin of string. Note: there are toUInt64OrZero and toUInt64OrNull functions, which returns zero/NULL instead of throwing exception.: while executing 'FUNCTION dictGetString('airlinecompany' :: 1, 'company' :: 2, Reporting_Airline :: 0) -> dictGetString('airlinecompany', 'company', Reporting_Airline) String : 4'. (CANNOT_PARSE_TEXT)
49CREATE DICTIONARY airlinecompany
50(
51    id UInt64, 
52    code String,
53    company String
54
55)
56PRIMARY KEY code 
57SOURCE(FILE(path '/var/lib/clickhouse/user_files/airlinenames.csv' format 'CSVWithNames'))
58LAYOUT(COMPLEX_KEY_HASHED())
59LIFETIME(3600)
60
61
62SELECT dictGet('airlinecompany', 'company', tuple('UA'))
63┌─dictGet('airlinecompany', 'company', tuple('UA'))─┐
64│ United Airlines                                   │
65└───────────────────────────────────────────────────┘
66
67
68SELECT Reporting_Airline AS R_air,
69       dictGetString('airlinecompany', 'company', tuple(R_Air)) AS company
70FROM ontime
71LIMIT 4;
72
73┌─R_Air─┬─company───────────┐
74│ B6    │ Jetblue Airway    │
75│ G4    │ Allegiant Air     │
76│ HA    │ Hawaiian Airlines │
77│ OO    │ SkyWest           │
78└───────┴───────────────────┘
79
80

Source https://stackoverflow.com/questions/71879019

QUESTION

I couldn't pass an img using ajax?

Asked 2022-Mar-26 at 06:29

I'm trying to include a logo when adding a new airline, but I don't know how can I pass input with file type to the controller with ajax. I tried to use FormData(). I did not get any error, but the file was not passed to the controller I have looked at some questions similar to my problem, but I can't find a solution.

1<form action="javascript:void(0)" id="addEditBookForm" name="addEditBookForm" class="form-horizontal" method="POST" enctype="multipart/form-data">
2              <input type="hidden" name="id" id="id">
3              <div class="form-group">
4                <label for="name" class="col-sm-2 control-label">Name</label>
5                <div class="col-sm-12">
6                  <input type="text" class="form-control" id="name" name="name" placeholder="Enter Airline Name" value="" maxlength="50" required="">
7                </div>
8              </div>  
9              <div class="form-group">
10                <label for="name" class="col-sm-2 control-label">country</label>
11                <div class="col-sm-12">
12                  <input type="text" class="form-control" id="country" name="country" placeholder="Enter Airline country" value="" maxlength="50" required="">
13                </div>
14              </div>
15              <div class="form-group">
16                <label class="col-sm-2 control-label">Logo</label>
17                <div class="col-sm-12">
18                  <input type="file" class="form-control" id="logo" name="logo" placeholder="Enter Airline Code" value="" required="">
19                </div>
20              </div>
21              <div class="col-sm-offset-2 col-sm-10">
22                <button type="submit" class="btn btn-primary" id="btn-save" value="addNewBook">Save changes
23                </button>
24              </div>
25            </form>
26

ajax:

1<form action="javascript:void(0)" id="addEditBookForm" name="addEditBookForm" class="form-horizontal" method="POST" enctype="multipart/form-data">
2              <input type="hidden" name="id" id="id">
3              <div class="form-group">
4                <label for="name" class="col-sm-2 control-label">Name</label>
5                <div class="col-sm-12">
6                  <input type="text" class="form-control" id="name" name="name" placeholder="Enter Airline Name" value="" maxlength="50" required="">
7                </div>
8              </div>  
9              <div class="form-group">
10                <label for="name" class="col-sm-2 control-label">country</label>
11                <div class="col-sm-12">
12                  <input type="text" class="form-control" id="country" name="country" placeholder="Enter Airline country" value="" maxlength="50" required="">
13                </div>
14              </div>
15              <div class="form-group">
16                <label class="col-sm-2 control-label">Logo</label>
17                <div class="col-sm-12">
18                  <input type="file" class="form-control" id="logo" name="logo" placeholder="Enter Airline Code" value="" required="">
19                </div>
20              </div>
21              <div class="col-sm-offset-2 col-sm-10">
22                <button type="submit" class="btn btn-primary" id="btn-save" value="addNewBook">Save changes
23                </button>
24              </div>
25            </form>
26  $('body').on('click', '#btn-save', function (event) {
27      event.preventDefault()
28          var id = $("#id").val();
29          var name = $("#name").val();
30          var country = $("#country").val();
31          let logo = new FormData(document.getElementById("addEditBookForm"));
32          $("#btn-save").html('Please Wait...');
33          $("#btn-save"). attr("disabled", true);
34         
35        // ajax
36       
37        $.ajax({
38            type:"POST",
39            url: "{{ url('admin/add-update-Airlines') }}",
40            data: {
41              id:id,
42              name:name,
43              country:country,
44              logo:logo,
45            },
46            contentType: false,
47            processData:false,
48            cache: false,
49            dataType: 'json',
50            success: function(res){
51             window.location.reload();
52            $("#btn-save").html('Submit');
53            $("#btn-save"). attr("disabled", false);
54            Swal.fire(
55            'Good job!',
56            'You clicked the button!',
57            'success'
58            )
59           }
60        
61        });
62      
63    });
64

Controller:

1<form action="javascript:void(0)" id="addEditBookForm" name="addEditBookForm" class="form-horizontal" method="POST" enctype="multipart/form-data">
2              <input type="hidden" name="id" id="id">
3              <div class="form-group">
4                <label for="name" class="col-sm-2 control-label">Name</label>
5                <div class="col-sm-12">
6                  <input type="text" class="form-control" id="name" name="name" placeholder="Enter Airline Name" value="" maxlength="50" required="">
7                </div>
8              </div>  
9              <div class="form-group">
10                <label for="name" class="col-sm-2 control-label">country</label>
11                <div class="col-sm-12">
12                  <input type="text" class="form-control" id="country" name="country" placeholder="Enter Airline country" value="" maxlength="50" required="">
13                </div>
14              </div>
15              <div class="form-group">
16                <label class="col-sm-2 control-label">Logo</label>
17                <div class="col-sm-12">
18                  <input type="file" class="form-control" id="logo" name="logo" placeholder="Enter Airline Code" value="" required="">
19                </div>
20              </div>
21              <div class="col-sm-offset-2 col-sm-10">
22                <button type="submit" class="btn btn-primary" id="btn-save" value="addNewBook">Save changes
23                </button>
24              </div>
25            </form>
26  $('body').on('click', '#btn-save', function (event) {
27      event.preventDefault()
28          var id = $("#id").val();
29          var name = $("#name").val();
30          var country = $("#country").val();
31          let logo = new FormData(document.getElementById("addEditBookForm"));
32          $("#btn-save").html('Please Wait...');
33          $("#btn-save"). attr("disabled", true);
34         
35        // ajax
36       
37        $.ajax({
38            type:"POST",
39            url: "{{ url('admin/add-update-Airlines') }}",
40            data: {
41              id:id,
42              name:name,
43              country:country,
44              logo:logo,
45            },
46            contentType: false,
47            processData:false,
48            cache: false,
49            dataType: 'json',
50            success: function(res){
51             window.location.reload();
52            $("#btn-save").html('Submit');
53            $("#btn-save"). attr("disabled", false);
54            Swal.fire(
55            'Good job!',
56            'You clicked the button!',
57            'success'
58            )
59           }
60        
61        });
62      
63    });
64 public function store(Request $request)
65    {
66        
67
68        $newImgName = time() . '-' . $request->name . '.' .$request->logo->extension();
69        $request->logo->move(public_path('img'),$newImgName);
70        $Airline   =   Airline::updateOrCreate(
71                    [
72                        'id' => $request->id
73                    ],
74                    $request->validate([
75                        'name' => ['required', 'string', 'max:255'],
76                        'country' => ['required', 'string', 'max:255'],
77                        'logo' => ['required|mimes:ipg,png,jpeg|max:5048'],            
78                    ]),
79                   
80                    [
81                        'name' => $request->name, 
82                        'country' => $request->country,
83                        'logo' => $newImgName,
84                    ]);
85    
86                 return response()->json(['success' => true]);
87    }
88

ANSWER

Answered 2022-Mar-26 at 05:57

First thing is csrf token not passing to ajax so change form as below.Also updated

1<form action="javascript:void(0)" id="addEditBookForm" name="addEditBookForm" class="form-horizontal" method="POST" enctype="multipart/form-data">
2              <input type="hidden" name="id" id="id">
3              <div class="form-group">
4                <label for="name" class="col-sm-2 control-label">Name</label>
5                <div class="col-sm-12">
6                  <input type="text" class="form-control" id="name" name="name" placeholder="Enter Airline Name" value="" maxlength="50" required="">
7                </div>
8              </div>  
9              <div class="form-group">
10                <label for="name" class="col-sm-2 control-label">country</label>
11                <div class="col-sm-12">
12                  <input type="text" class="form-control" id="country" name="country" placeholder="Enter Airline country" value="" maxlength="50" required="">
13                </div>
14              </div>
15              <div class="form-group">
16                <label class="col-sm-2 control-label">Logo</label>
17                <div class="col-sm-12">
18                  <input type="file" class="form-control" id="logo" name="logo" placeholder="Enter Airline Code" value="" required="">
19                </div>
20              </div>
21              <div class="col-sm-offset-2 col-sm-10">
22                <button type="submit" class="btn btn-primary" id="btn-save" value="addNewBook">Save changes
23                </button>
24              </div>
25            </form>
26  $('body').on('click', '#btn-save', function (event) {
27      event.preventDefault()
28          var id = $("#id").val();
29          var name = $("#name").val();
30          var country = $("#country").val();
31          let logo = new FormData(document.getElementById("addEditBookForm"));
32          $("#btn-save").html('Please Wait...');
33          $("#btn-save"). attr("disabled", true);
34         
35        // ajax
36       
37        $.ajax({
38            type:"POST",
39            url: "{{ url('admin/add-update-Airlines') }}",
40            data: {
41              id:id,
42              name:name,
43              country:country,
44              logo:logo,
45            },
46            contentType: false,
47            processData:false,
48            cache: false,
49            dataType: 'json',
50            success: function(res){
51             window.location.reload();
52            $("#btn-save").html('Submit');
53            $("#btn-save"). attr("disabled", false);
54            Swal.fire(
55            'Good job!',
56            'You clicked the button!',
57            'success'
58            )
59           }
60        
61        });
62      
63    });
64 public function store(Request $request)
65    {
66        
67
68        $newImgName = time() . '-' . $request->name . '.' .$request->logo->extension();
69        $request->logo->move(public_path('img'),$newImgName);
70        $Airline   =   Airline::updateOrCreate(
71                    [
72                        'id' => $request->id
73                    ],
74                    $request->validate([
75                        'name' => ['required', 'string', 'max:255'],
76                        'country' => ['required', 'string', 'max:255'],
77                        'logo' => ['required|mimes:ipg,png,jpeg|max:5048'],            
78                    ]),
79                   
80                    [
81                        'name' => $request->name, 
82                        'country' => $request->country,
83                        'logo' => $newImgName,
84                    ]);
85    
86                 return response()->json(['success' => true]);
87    }
88<form action="{{ url('admin/add-update-Airlines') }}" id="addEditBookForm" name="addEditBookForm" class="form-horizontal" method="POST" enctype="multipart/form-data">
89         @csrf
90            <input type="hidden" name="id" id="id">
91            <div class="form-group">
92                <label for="name" class="col-sm-2 control-label">Name</label>
93                <div class="col-sm-12">
94                    <input type="text" class="form-control" id="name" name="name" placeholder="Enter Airline Name" value="" maxlength="50" required="">
95                </div>
96            </div>
97            <div class="form-group">
98                <label for="name" class="col-sm-2 control-label">country</label>
99                <div class="col-sm-12">
100                    <input type="text" class="form-control" id="country" name="country" placeholder="Enter Airline country" value="" maxlength="50" required="">
101                </div>
102            </div>
103            <div class="form-group">
104                <label class="col-sm-2 control-label">Logo</label>
105                <div class="col-sm-12">
106                    <input type="file" class="form-control" id="logo" name="logo" placeholder="Enter Airline Code" value="" required="">
107                </div>
108            </div>
109            <div class="col-sm-offset-2 col-sm-10">
110                <button type="submit" class="btn btn-primary" id="btn-save" value="addNewBook">Save changes
111                </button>
112            </div>
113        </form>
114

Then in ajax I have simplified for testing so you can modify according to your need

1<form action="javascript:void(0)" id="addEditBookForm" name="addEditBookForm" class="form-horizontal" method="POST" enctype="multipart/form-data">
2              <input type="hidden" name="id" id="id">
3              <div class="form-group">
4                <label for="name" class="col-sm-2 control-label">Name</label>
5                <div class="col-sm-12">
6                  <input type="text" class="form-control" id="name" name="name" placeholder="Enter Airline Name" value="" maxlength="50" required="">
7                </div>
8              </div>  
9              <div class="form-group">
10                <label for="name" class="col-sm-2 control-label">country</label>
11                <div class="col-sm-12">
12                  <input type="text" class="form-control" id="country" name="country" placeholder="Enter Airline country" value="" maxlength="50" required="">
13                </div>
14              </div>
15              <div class="form-group">
16                <label class="col-sm-2 control-label">Logo</label>
17                <div class="col-sm-12">
18                  <input type="file" class="form-control" id="logo" name="logo" placeholder="Enter Airline Code" value="" required="">
19                </div>
20              </div>
21              <div class="col-sm-offset-2 col-sm-10">
22                <button type="submit" class="btn btn-primary" id="btn-save" value="addNewBook">Save changes
23                </button>
24              </div>
25            </form>
26  $('body').on('click', '#btn-save', function (event) {
27      event.preventDefault()
28          var id = $("#id").val();
29          var name = $("#name").val();
30          var country = $("#country").val();
31          let logo = new FormData(document.getElementById("addEditBookForm"));
32          $("#btn-save").html('Please Wait...');
33          $("#btn-save"). attr("disabled", true);
34         
35        // ajax
36       
37        $.ajax({
38            type:"POST",
39            url: "{{ url('admin/add-update-Airlines') }}",
40            data: {
41              id:id,
42              name:name,
43              country:country,
44              logo:logo,
45            },
46            contentType: false,
47            processData:false,
48            cache: false,
49            dataType: 'json',
50            success: function(res){
51             window.location.reload();
52            $("#btn-save").html('Submit');
53            $("#btn-save"). attr("disabled", false);
54            Swal.fire(
55            'Good job!',
56            'You clicked the button!',
57            'success'
58            )
59           }
60        
61        });
62      
63    });
64 public function store(Request $request)
65    {
66        
67
68        $newImgName = time() . '-' . $request->name . '.' .$request->logo->extension();
69        $request->logo->move(public_path('img'),$newImgName);
70        $Airline   =   Airline::updateOrCreate(
71                    [
72                        'id' => $request->id
73                    ],
74                    $request->validate([
75                        'name' => ['required', 'string', 'max:255'],
76                        'country' => ['required', 'string', 'max:255'],
77                        'logo' => ['required|mimes:ipg,png,jpeg|max:5048'],            
78                    ]),
79                   
80                    [
81                        'name' => $request->name, 
82                        'country' => $request->country,
83                        'logo' => $newImgName,
84                    ]);
85    
86                 return response()->json(['success' => true]);
87    }
88<form action="{{ url('admin/add-update-Airlines') }}" id="addEditBookForm" name="addEditBookForm" class="form-horizontal" method="POST" enctype="multipart/form-data">
89         @csrf
90            <input type="hidden" name="id" id="id">
91            <div class="form-group">
92                <label for="name" class="col-sm-2 control-label">Name</label>
93                <div class="col-sm-12">
94                    <input type="text" class="form-control" id="name" name="name" placeholder="Enter Airline Name" value="" maxlength="50" required="">
95                </div>
96            </div>
97            <div class="form-group">
98                <label for="name" class="col-sm-2 control-label">country</label>
99                <div class="col-sm-12">
100                    <input type="text" class="form-control" id="country" name="country" placeholder="Enter Airline country" value="" maxlength="50" required="">
101                </div>
102            </div>
103            <div class="form-group">
104                <label class="col-sm-2 control-label">Logo</label>
105                <div class="col-sm-12">
106                    <input type="file" class="form-control" id="logo" name="logo" placeholder="Enter Airline Code" value="" required="">
107                </div>
108            </div>
109            <div class="col-sm-offset-2 col-sm-10">
110                <button type="submit" class="btn btn-primary" id="btn-save" value="addNewBook">Save changes
111                </button>
112            </div>
113        </form>
114$(document).on('click', '#btn-save', function(e) {
115            e.preventDefault()
116            var url = $("#applicationForm").attr('action');
117            let myForm = document.getElementById('addEditBookForm');
118            let formData = new FormData(myForm);
119            $.ajax({
120                type:"POST",
121                url:url,
122                data: formData,
123                contentType: false,
124                processData:false,
125                cache: false,
126                dataType: 'json',
127                success: function(res){
128
129                }
130
131            });
132
133        });
134

Validation

1<form action="javascript:void(0)" id="addEditBookForm" name="addEditBookForm" class="form-horizontal" method="POST" enctype="multipart/form-data">
2              <input type="hidden" name="id" id="id">
3              <div class="form-group">
4                <label for="name" class="col-sm-2 control-label">Name</label>
5                <div class="col-sm-12">
6                  <input type="text" class="form-control" id="name" name="name" placeholder="Enter Airline Name" value="" maxlength="50" required="">
7                </div>
8              </div>  
9              <div class="form-group">
10                <label for="name" class="col-sm-2 control-label">country</label>
11                <div class="col-sm-12">
12                  <input type="text" class="form-control" id="country" name="country" placeholder="Enter Airline country" value="" maxlength="50" required="">
13                </div>
14              </div>
15              <div class="form-group">
16                <label class="col-sm-2 control-label">Logo</label>
17                <div class="col-sm-12">
18                  <input type="file" class="form-control" id="logo" name="logo" placeholder="Enter Airline Code" value="" required="">
19                </div>
20              </div>
21              <div class="col-sm-offset-2 col-sm-10">
22                <button type="submit" class="btn btn-primary" id="btn-save" value="addNewBook">Save changes
23                </button>
24              </div>
25            </form>
26  $('body').on('click', '#btn-save', function (event) {
27      event.preventDefault()
28          var id = $("#id").val();
29          var name = $("#name").val();
30          var country = $("#country").val();
31          let logo = new FormData(document.getElementById("addEditBookForm"));
32          $("#btn-save").html('Please Wait...');
33          $("#btn-save"). attr("disabled", true);
34         
35        // ajax
36       
37        $.ajax({
38            type:"POST",
39            url: "{{ url('admin/add-update-Airlines') }}",
40            data: {
41              id:id,
42              name:name,
43              country:country,
44              logo:logo,
45            },
46            contentType: false,
47            processData:false,
48            cache: false,
49            dataType: 'json',
50            success: function(res){
51             window.location.reload();
52            $("#btn-save").html('Submit');
53            $("#btn-save"). attr("disabled", false);
54            Swal.fire(
55            'Good job!',
56            'You clicked the button!',
57            'success'
58            )
59           }
60        
61        });
62      
63    });
64 public function store(Request $request)
65    {
66        
67
68        $newImgName = time() . '-' . $request->name . '.' .$request->logo->extension();
69        $request->logo->move(public_path('img'),$newImgName);
70        $Airline   =   Airline::updateOrCreate(
71                    [
72                        'id' => $request->id
73                    ],
74                    $request->validate([
75                        'name' => ['required', 'string', 'max:255'],
76                        'country' => ['required', 'string', 'max:255'],
77                        'logo' => ['required|mimes:ipg,png,jpeg|max:5048'],            
78                    ]),
79                   
80                    [
81                        'name' => $request->name, 
82                        'country' => $request->country,
83                        'logo' => $newImgName,
84                    ]);
85    
86                 return response()->json(['success' => true]);
87    }
88<form action="{{ url('admin/add-update-Airlines') }}" id="addEditBookForm" name="addEditBookForm" class="form-horizontal" method="POST" enctype="multipart/form-data">
89         @csrf
90            <input type="hidden" name="id" id="id">
91            <div class="form-group">
92                <label for="name" class="col-sm-2 control-label">Name</label>
93                <div class="col-sm-12">
94                    <input type="text" class="form-control" id="name" name="name" placeholder="Enter Airline Name" value="" maxlength="50" required="">
95                </div>
96            </div>
97            <div class="form-group">
98                <label for="name" class="col-sm-2 control-label">country</label>
99                <div class="col-sm-12">
100                    <input type="text" class="form-control" id="country" name="country" placeholder="Enter Airline country" value="" maxlength="50" required="">
101                </div>
102            </div>
103            <div class="form-group">
104                <label class="col-sm-2 control-label">Logo</label>
105                <div class="col-sm-12">
106                    <input type="file" class="form-control" id="logo" name="logo" placeholder="Enter Airline Code" value="" required="">
107                </div>
108            </div>
109            <div class="col-sm-offset-2 col-sm-10">
110                <button type="submit" class="btn btn-primary" id="btn-save" value="addNewBook">Save changes
111                </button>
112            </div>
113        </form>
114$(document).on('click', '#btn-save', function(e) {
115            e.preventDefault()
116            var url = $("#applicationForm").attr('action');
117            let myForm = document.getElementById('addEditBookForm');
118            let formData = new FormData(myForm);
119            $.ajax({
120                type:"POST",
121                url:url,
122                data: formData,
123                contentType: false,
124                processData:false,
125                cache: false,
126                dataType: 'json',
127                success: function(res){
128
129                }
130
131            });
132
133        });
134public function store(Request $request)
135{
136        
137   $request->validate([
138            'name' => ['required', 'string', 'max:255'],
139            'country' => ['required', 'string', 'max:255'],
140            'logo' => ['required','mimes:ipg,png,jpeg','max:5048'],
141        ]);
142}
143

Source https://stackoverflow.com/questions/71625511

QUESTION

Traversing Relationships a Variable Number of Times in Cypher

Asked 2022-Mar-01 at 03:52

I have a graph of Airports, Routes between them and Airlines that carry it. I created routes as separate nodes, rather than just a relationship, so that I can connect each with an Airline, and other nodes.

Each Route node has an IS_FROM relationship with the origin airport and an IS_TO relationship with the destination. It also has an IS_BY relationship with its airline: enter image description here

I am trying to traverse this tree, n times, for routes between two airports. For example, if n = 3, I want to get all the routes, that will lead from LAX to LHR, with 3 or fewer connections.

So basically, my result would be a union of the following: No Connecting Airports:

1MATCH (a1:Airport {iata : 'LAX'})<-[:IS_FROM]-(r:Route)-[:IS_TO]->(a2:Airport {iata : 'LHR'}), (r)-[:IS_BY]->(ai:Airline) return a1 , r , a2 , ai;
2

1 Connecting airports:

1MATCH (a1:Airport {iata : 'LAX'})<-[:IS_FROM]-(r:Route)-[:IS_TO]->(a2:Airport {iata : 'LHR'}), (r)-[:IS_BY]->(ai:Airline) return a1 , r , a2 , ai;
2MATCH (a1:Airport {iata : 'LAX'})<-[:IS_FROM]-(r:Route)-[:IS_TO]->(a2:Airport)<-[IS_FROM]-(r2:Route)-[:IS_TO]->(a3:Airport {iata: 'LHR'}), (r2)-[:IS_BY]->(ai:Airline) return a1 , r , a2 , a3 , r2 , ai;
3

and so on.

So the query should dynamically traverse the (:Airport)<-[:IS_FROM]-(:Route)-[:IS_TO]->(:Airport) pattern n times, and return the nodes (I am more interested in returning the Airlines that connect to those routes.

ANSWER

Answered 2022-Feb-28 at 10:13

I don't know if i got your question right. To me your problem could be solved this way:

1MATCH (a1:Airport {iata : 'LAX'})&lt;-[:IS_FROM]-(r:Route)-[:IS_TO]-&gt;(a2:Airport {iata : 'LHR'}), (r)-[:IS_BY]-&gt;(ai:Airline) return a1 , r , a2 , ai;
2MATCH (a1:Airport {iata : 'LAX'})&lt;-[:IS_FROM]-(r:Route)-[:IS_TO]-&gt;(a2:Airport)&lt;-[IS_FROM]-(r2:Route)-[:IS_TO]-&gt;(a3:Airport {iata: 'LHR'}), (r2)-[:IS_BY]-&gt;(ai:Airline) return a1 , r , a2 , a3 , r2 , ai;
3MATCH (a1:Airport {iata : 'LAX'})&lt;-[r1:IS_FROM]-(r:Route)-[r2:IS_TO]-&gt;(a2:Airport{iata : 'LHR'})
4OPTIONAL MATCH (r)-[r3:IS_BY]-&gt;(ai:Airline)
5RETURN a1,r1,r,r2,a2,r3,ai
6

Source https://stackoverflow.com/questions/71288479

QUESTION

Laravel using WHERE orWHERE

Asked 2022-Feb-18 at 11:50

I have a query as below. When i search using the query below, it fetches the products but it shows other products from other airlines even tho i have specified the airline id. When i take out the orWhere("code","LIKE","%{$request->search}%"), it works perfectly fine and it doesn't show the products of other airlines.

I know where the issue is but then i still need the search parameter to be either name or code. How do i fix this ?

1 Product::with('airline')
2            -&gt;where('airline_id', $request-&gt;airline_id)
3            -&gt;select('id','name','code')
4            -&gt;where(&quot;name&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
5            -&gt;orWhere(&quot;code&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
6            -&gt;limit(5)
7            -&gt;get();
8

ANSWER

Answered 2022-Feb-18 at 11:49

Your current query will generate:

1 Product::with('airline')
2            -&gt;where('airline_id', $request-&gt;airline_id)
3            -&gt;select('id','name','code')
4            -&gt;where(&quot;name&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
5            -&gt;orWhere(&quot;code&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
6            -&gt;limit(5)
7            -&gt;get();
8WHERE airline_id = ? AND name LIKE ? OR code LIKE ?
9

The OR will discount any other conditions unless you group them properly. You need to use logical grouping to solve that:

1 Product::with('airline')
2            -&gt;where('airline_id', $request-&gt;airline_id)
3            -&gt;select('id','name','code')
4            -&gt;where(&quot;name&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
5            -&gt;orWhere(&quot;code&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
6            -&gt;limit(5)
7            -&gt;get();
8WHERE airline_id = ? AND name LIKE ? OR code LIKE ?
9-&gt;select('id','name','code')
10-&gt;where('airline_id', $request-&gt;airline_id)
11-&gt;where(function ($query) use ($request) {
12    $query-&gt;where(&quot;name&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
13          -&gt;orWhere(&quot;code&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;);
14})
15

This will generate:

1 Product::with('airline')
2            -&gt;where('airline_id', $request-&gt;airline_id)
3            -&gt;select('id','name','code')
4            -&gt;where(&quot;name&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
5            -&gt;orWhere(&quot;code&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
6            -&gt;limit(5)
7            -&gt;get();
8WHERE airline_id = ? AND name LIKE ? OR code LIKE ?
9-&gt;select('id','name','code')
10-&gt;where('airline_id', $request-&gt;airline_id)
11-&gt;where(function ($query) use ($request) {
12    $query-&gt;where(&quot;name&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;)
13          -&gt;orWhere(&quot;code&quot;,&quot;LIKE&quot;,&quot;%{$request-&gt;search}%&quot;);
14})
15WHERE airline_id = ? AND (name LIKE ? OR code LIKE ?)
16

Source https://stackoverflow.com/questions/71172894

QUESTION

In Foundry Contour, How do I filter by multiple terms?

Asked 2022-Feb-02 at 14:55
Background

I'm working on one of the tutorial exercises "Bootcamp, Day 1"


The Problem

Specifically, the problem says

Filter this Flights path to only: Flights between Delta Airlines hubs (ATL, JFK, LGA, BOS, DTW, MSP, SLC, SEA, LAX)

I know in SQL I would do something like:

1SELECT * FROM flights 
2WHERE origin IN ATL, JFK, LGA, BOS, DTW, MSP, SLC, SEA, LAX
3AND dest IN ATL, JFK, LGA, BOS, DTW, MSP, SLC, SEA, LAX
4

But I'm not sure how to accomplish this in Contour. I know I shouldn't have to put a new filter in for each airport and origin/dest, right?


Question

How do I filter by multiple terms in one line?


What I'm Looking for

I'd like to do something like

origin is in ATL, JFK, LGA, BOS, DTW, MSP, SLC, SEA, LAX

AND

dest is in ATL, JFK, LGA, BOS, DTW, MSP, SLC, SEA, LAX

But there is only is


What I've Tried

origin is ATL, JFK, LGA, BOS, DTW, MSP, SLC, SEA, LAX

origin matches (x) 'ATL','JFK','LGA','BOS','DTW','MSP','SLC','SEA','LAX'

I get no data in the resulting table for either attempt.

ANSWER

Answered 2022-Feb-02 at 14:55

I think you may be hitting some issue, like adding all fields as a single string, containing commas i.e.: "ATL, JFK, ..." instead of "ATL" "JFK"

I've tried it with the Foundry Training Resources and it works fine, check the screenshot bellow:

enter image description here

Source https://stackoverflow.com/questions/70956151

QUESTION

Question about my computation (Using R with dplyr and nyflights13 to figure out number of seat miles by carrier)

Asked 2022-Jan-25 at 16:25

I understand the problem and showed all my work. I'm working through the modern dive data science book (https://moderndive.com/3-wrangling.html#joins book), and got stuck on (LC3.20) at the end of chapter 3.Using the nycflights13 package on R and dplyr, I'm supposed to generate a tibble that has only two columns, airline name and seat miles. Seat miles is just seats * miles. I understand the problem and I thought my code was going to output the correct result, however my seat miles are different for each airline carrier than in the solution. Can someone please help me to figure out why my code went wrong. Additionally, I do understand the books solution, I just don't know why my solution is wrong. I posted all my work.

1   #seat miles = miles*seats
2
3View(flights) #distance and identifiers year and tail num and carrier
4View(airlines) # names and indentifiers carrier
5View(planes) #seats and identifiers year and tail num
6
7
8#join names to flights 
9
10named_flights &lt;- flights %&gt;%
11  inner_join(airlines, by = 'carrier')
12
13named_flights #same number of rows, all good
14flights
15
16#join seats to named_flights
17
18named_seat_flights &lt;- named_flights %&gt;%
19  inner_join(planes, by = c('tailnum'))
20named_seat_flights #noticed 52,596 rows are missing
21#when joining tailnum to named_flights
22
23table(is.na(select(named_flights, 'tailnum')))
24#2512 rows that has NA values for tailnum in named_flights
25
26table(is.na(select(planes, 'tailnum')))
27#no tailnum data is missing from planes dataset
28#and since a given plane (with a given tailnum)
29#can take off multiple times per year
30#we can conclude that the 52,596 missing rows
31#are a result of the missing tailnum data in flights (also named_flights)
32
33
34named_seat_miles_by_airline_name &lt;- named_seat_flights %&gt;%
35  group_by(name) %&gt;%
36  summarise(seat_miles = sum(seats, na.rm =  T)*sum(distance,na.rm = T)) %&gt;%
37  rename(airline_name = name) %&gt;%
38  arrange(desc(seat_miles))
39named_seat_miles_by_airline_name #not correct
40
41View(named_seat_miles_by_airline_name)  
42
43
44
45flights %&gt;%                                # book solution
46  inner_join(planes, by = &quot;tailnum&quot;) %&gt;%
47  select(carrier, seats, distance) %&gt;%
48  mutate(ASM = seats * distance) %&gt;%
49  group_by(carrier) %&gt;%
50  summarize(ASM = sum(ASM, na.rm = TRUE)) %&gt;%
51  arrange(desc(ASM))**strong text**
52

The output of my code is

1   #seat miles = miles*seats
2
3View(flights) #distance and identifiers year and tail num and carrier
4View(airlines) # names and indentifiers carrier
5View(planes) #seats and identifiers year and tail num
6
7
8#join names to flights 
9
10named_flights &lt;- flights %&gt;%
11  inner_join(airlines, by = 'carrier')
12
13named_flights #same number of rows, all good
14flights
15
16#join seats to named_flights
17
18named_seat_flights &lt;- named_flights %&gt;%
19  inner_join(planes, by = c('tailnum'))
20named_seat_flights #noticed 52,596 rows are missing
21#when joining tailnum to named_flights
22
23table(is.na(select(named_flights, 'tailnum')))
24#2512 rows that has NA values for tailnum in named_flights
25
26table(is.na(select(planes, 'tailnum')))
27#no tailnum data is missing from planes dataset
28#and since a given plane (with a given tailnum)
29#can take off multiple times per year
30#we can conclude that the 52,596 missing rows
31#are a result of the missing tailnum data in flights (also named_flights)
32
33
34named_seat_miles_by_airline_name &lt;- named_seat_flights %&gt;%
35  group_by(name) %&gt;%
36  summarise(seat_miles = sum(seats, na.rm =  T)*sum(distance,na.rm = T)) %&gt;%
37  rename(airline_name = name) %&gt;%
38  arrange(desc(seat_miles))
39named_seat_miles_by_airline_name #not correct
40
41View(named_seat_miles_by_airline_name)  
42
43
44
45flights %&gt;%                                # book solution
46  inner_join(planes, by = &quot;tailnum&quot;) %&gt;%
47  select(carrier, seats, distance) %&gt;%
48  mutate(ASM = seats * distance) %&gt;%
49  group_by(carrier) %&gt;%
50  summarize(ASM = sum(ASM, na.rm = TRUE)) %&gt;%
51  arrange(desc(ASM))**strong text**
52    # A tibble: 16 x 2
53   airline_name           seat_miles
54   &lt;chr&gt;                       &lt;dbl&gt;
55 1 United Air Lines Inc.     8.73e14
56 2 Delta Air Lines Inc.      4.82e14
57 3 JetBlue Airways           4.13e14
58 4 ExpressJet Airlines I~    9.82e13
59 5 US Airways Inc.           3.83e13
60 6 American Airlines Inc.    3.38e13
61 7 Southwest Airlines Co.    2.10e13
62 8 Endeavor Air Inc.         1.28e13
63 9 Virgin America            1.19e13
6410 AirTran Airways Corpo~    6.68e11
6511 Alaska Airlines Inc.      2.24e11
6612 Hawaiian Airlines Inc.    2.20e11
6713 Frontier Airlines Inc.    1.17e11
6814 Mesa Airlines Inc.        1.17e10
6915 Envoy Air                 7.10e 9
7016 SkyWest Airlines Inc.     4.08e 7
71

The output of books code is

1   #seat miles = miles*seats
2
3View(flights) #distance and identifiers year and tail num and carrier
4View(airlines) # names and indentifiers carrier
5View(planes) #seats and identifiers year and tail num
6
7
8#join names to flights 
9
10named_flights &lt;- flights %&gt;%
11  inner_join(airlines, by = 'carrier')
12
13named_flights #same number of rows, all good
14flights
15
16#join seats to named_flights
17
18named_seat_flights &lt;- named_flights %&gt;%
19  inner_join(planes, by = c('tailnum'))
20named_seat_flights #noticed 52,596 rows are missing
21#when joining tailnum to named_flights
22
23table(is.na(select(named_flights, 'tailnum')))
24#2512 rows that has NA values for tailnum in named_flights
25
26table(is.na(select(planes, 'tailnum')))
27#no tailnum data is missing from planes dataset
28#and since a given plane (with a given tailnum)
29#can take off multiple times per year
30#we can conclude that the 52,596 missing rows
31#are a result of the missing tailnum data in flights (also named_flights)
32
33
34named_seat_miles_by_airline_name &lt;- named_seat_flights %&gt;%
35  group_by(name) %&gt;%
36  summarise(seat_miles = sum(seats, na.rm =  T)*sum(distance,na.rm = T)) %&gt;%
37  rename(airline_name = name) %&gt;%
38  arrange(desc(seat_miles))
39named_seat_miles_by_airline_name #not correct
40
41View(named_seat_miles_by_airline_name)  
42
43
44
45flights %&gt;%                                # book solution
46  inner_join(planes, by = &quot;tailnum&quot;) %&gt;%
47  select(carrier, seats, distance) %&gt;%
48  mutate(ASM = seats * distance) %&gt;%
49  group_by(carrier) %&gt;%
50  summarize(ASM = sum(ASM, na.rm = TRUE)) %&gt;%
51  arrange(desc(ASM))**strong text**
52    # A tibble: 16 x 2
53   airline_name           seat_miles
54   &lt;chr&gt;                       &lt;dbl&gt;
55 1 United Air Lines Inc.     8.73e14
56 2 Delta Air Lines Inc.      4.82e14
57 3 JetBlue Airways           4.13e14
58 4 ExpressJet Airlines I~    9.82e13
59 5 US Airways Inc.           3.83e13
60 6 American Airlines Inc.    3.38e13
61 7 Southwest Airlines Co.    2.10e13
62 8 Endeavor Air Inc.         1.28e13
63 9 Virgin America            1.19e13
6410 AirTran Airways Corpo~    6.68e11
6511 Alaska Airlines Inc.      2.24e11
6612 Hawaiian Airlines Inc.    2.20e11
6713 Frontier Airlines Inc.    1.17e11
6814 Mesa Airlines Inc.        1.17e10
6915 Envoy Air                 7.10e 9
7016 SkyWest Airlines Inc.     4.08e 7
71# A tibble: 16 x 2
72   carrier         ASM
73   &lt;chr&gt;         &lt;dbl&gt;
74 1 UA      15516377526
75 2 DL      10532885801
76 3 B6       9618222135
77 4 AA       3677292231
78 5 US       2533505829
79 6 VX       2296680778
80 7 EV       1817236275
81 8 WN       1718116857
82 9 9E        776970310
8310 HA        642478122
8411 AS        314104736
8512 FL        219628520
8613 F9        184832280
8714 YV         20163632
8815 MQ          7162420
8916 OO          1299835
90
91

Also, I know I have airline names instead of carrier, but thats actually what was asked.

ANSWER

Answered 2022-Jan-25 at 16:25

The code replaces the sum of the products with the product of the sums.

Compare these:

1   #seat miles = miles*seats
2
3View(flights) #distance and identifiers year and tail num and carrier
4View(airlines) # names and indentifiers carrier
5View(planes) #seats and identifiers year and tail num
6
7
8#join names to flights 
9
10named_flights &lt;- flights %&gt;%
11  inner_join(airlines, by = 'carrier')
12
13named_flights #same number of rows, all good
14flights
15
16#join seats to named_flights
17
18named_seat_flights &lt;- named_flights %&gt;%
19  inner_join(planes, by = c('tailnum'))
20named_seat_flights #noticed 52,596 rows are missing
21#when joining tailnum to named_flights
22
23table(is.na(select(named_flights, 'tailnum')))
24#2512 rows that has NA values for tailnum in named_flights
25
26table(is.na(select(planes, 'tailnum')))
27#no tailnum data is missing from planes dataset
28#and since a given plane (with a given tailnum)
29#can take off multiple times per year
30#we can conclude that the 52,596 missing rows
31#are a result of the missing tailnum data in flights (also named_flights)
32
33
34named_seat_miles_by_airline_name &lt;- named_seat_flights %&gt;%
35  group_by(name) %&gt;%
36  summarise(seat_miles = sum(seats, na.rm =  T)*sum(distance,na.rm = T)) %&gt;%
37  rename(airline_name = name) %&gt;%
38  arrange(desc(seat_miles))
39named_seat_miles_by_airline_name #not correct
40
41View(named_seat_miles_by_airline_name)  
42
43
44
45flights %&gt;%                                # book solution
46  inner_join(planes, by = &quot;tailnum&quot;) %&gt;%
47  select(carrier, seats, distance) %&gt;%
48  mutate(ASM = seats * distance) %&gt;%
49  group_by(carrier) %&gt;%
50  summarize(ASM = sum(ASM, na.rm = TRUE)) %&gt;%
51  arrange(desc(ASM))**strong text**
52    # A tibble: 16 x 2
53   airline_name           seat_miles
54   &lt;chr&gt;                       &lt;dbl&gt;
55 1 United Air Lines Inc.     8.73e14
56 2 Delta Air Lines Inc.      4.82e14
57 3 JetBlue Airways           4.13e14
58 4 ExpressJet Airlines I~    9.82e13
59 5 US Airways Inc.           3.83e13
60 6 American Airlines Inc.    3.38e13
61 7 Southwest Airlines Co.    2.10e13
62 8 Endeavor Air Inc.         1.28e13
63 9 Virgin America            1.19e13
6410 AirTran Airways Corpo~    6.68e11
6511 Alaska Airlines Inc.      2.24e11
6612 Hawaiian Airlines Inc.    2.20e11
6713 Frontier Airlines Inc.    1.17e11
6814 Mesa Airlines Inc.        1.17e10
6915 Envoy Air                 7.10e 9
7016 SkyWest Airlines Inc.     4.08e 7
71# A tibble: 16 x 2
72   carrier         ASM
73   &lt;chr&gt;         &lt;dbl&gt;
74 1 UA      15516377526
75 2 DL      10532885801
76 3 B6       9618222135
77 4 AA       3677292231
78 5 US       2533505829
79 6 VX       2296680778
80 7 EV       1817236275
81 8 WN       1718116857
82 9 9E        776970310
8310 HA        642478122
8411 AS        314104736
8512 FL        219628520
8613 F9        184832280
8714 YV         20163632
8815 MQ          7162420
8916 OO          1299835
90
91...
92filter(!is.na(seats)) %&gt;%
93summarise(seat_miles_sums = sum(seats, na.rm =  T)*sum(distance,na.rm = T),
94          seat_miles = sum(seats*distance))
95... 
96

Graphically, the question is asking for something like the areas below left, but your code calculates the area below right.

1   #seat miles = miles*seats
2
3View(flights) #distance and identifiers year and tail num and carrier
4View(airlines) # names and indentifiers carrier
5View(planes) #seats and identifiers year and tail num
6
7
8#join names to flights 
9
10named_flights &lt;- flights %&gt;%
11  inner_join(airlines, by = 'carrier')
12
13named_flights #same number of rows, all good
14flights
15
16#join seats to named_flights
17
18named_seat_flights &lt;- named_flights %&gt;%
19  inner_join(planes, by = c('tailnum'))
20named_seat_flights #noticed 52,596 rows are missing
21#when joining tailnum to named_flights
22
23table(is.na(select(named_flights, 'tailnum')))
24#2512 rows that has NA values for tailnum in named_flights
25
26table(is.na(select(planes, 'tailnum')))
27#no tailnum data is missing from planes dataset
28#and since a given plane (with a given tailnum)
29#can take off multiple times per year
30#we can conclude that the 52,596 missing rows
31#are a result of the missing tailnum data in flights (also named_flights)
32
33
34named_seat_miles_by_airline_name &lt;- named_seat_flights %&gt;%
35  group_by(name) %&gt;%
36  summarise(seat_miles = sum(seats, na.rm =  T)*sum(distance,na.rm = T)) %&gt;%
37  rename(airline_name = name) %&gt;%
38  arrange(desc(seat_miles))
39named_seat_miles_by_airline_name #not correct
40
41View(named_seat_miles_by_airline_name)  
42
43
44
45flights %&gt;%                                # book solution
46  inner_join(planes, by = &quot;tailnum&quot;) %&gt;%
47  select(carrier, seats, distance) %&gt;%
48  mutate(ASM = seats * distance) %&gt;%
49  group_by(carrier) %&gt;%
50  summarize(ASM = sum(ASM, na.rm = TRUE)) %&gt;%
51  arrange(desc(ASM))**strong text**
52    # A tibble: 16 x 2
53   airline_name           seat_miles
54   &lt;chr&gt;                       &lt;dbl&gt;
55 1 United Air Lines Inc.     8.73e14
56 2 Delta Air Lines Inc.      4.82e14
57 3 JetBlue Airways           4.13e14
58 4 ExpressJet Airlines I~    9.82e13
59 5 US Airways Inc.           3.83e13
60 6 American Airlines Inc.    3.38e13
61 7 Southwest Airlines Co.    2.10e13
62 8 Endeavor Air Inc.         1.28e13
63 9 Virgin America            1.19e13
6410 AirTran Airways Corpo~    6.68e11
6511 Alaska Airlines Inc.      2.24e11
6612 Hawaiian Airlines Inc.    2.20e11
6713 Frontier Airlines Inc.    1.17e11
6814 Mesa Airlines Inc.        1.17e10
6915 Envoy Air                 7.10e 9
7016 SkyWest Airlines Inc.     4.08e 7
71# A tibble: 16 x 2
72   carrier         ASM
73   &lt;chr&gt;         &lt;dbl&gt;
74 1 UA      15516377526
75 2 DL      10532885801
76 3 B6       9618222135
77 4 AA       3677292231
78 5 US       2533505829
79 6 VX       2296680778
80 7 EV       1817236275
81 8 WN       1718116857
82 9 9E        776970310
8310 HA        642478122
8411 AS        314104736
8512 FL        219628520
8613 F9        184832280
8714 YV         20163632
8815 MQ          7162420
8916 OO          1299835
90
91...
92filter(!is.na(seats)) %&gt;%
93summarise(seat_miles_sums = sum(seats, na.rm =  T)*sum(distance,na.rm = T),
94          seat_miles = sum(seats*distance))
95... 
96XXX      YY            XXXYY
97XXX   +  YY      &lt;     XXXYY
98         YY            XXXYY
99

Source https://stackoverflow.com/questions/70845019

QUESTION

How do you find max/min of a non-numeric vector?

Asked 2022-Jan-23 at 07:36

I'm trying to answer a homework problem, and I'm not very good at R Studio. The problem involves the nycflights13 dataset. The question is, "Using the flights data, identify which airline carrier had the most flights in 2013? Which had the fewest number of flights? Do this using max() and min()."

So far I've used this:

table(nycflights13::flights$carrier)

It's helped me retrieve a frequency table of the carriers. I know United Airlines has the most and Skywest has the least. But how do I prove this using max() and min()? It has only returned the highest and lowest alphabetical values of the carriers. Thank you!

ANSWER

Answered 2022-Jan-23 at 04:07

Just identify which values in your table are minimums and maximums (there may be only one of each):

1tbl &lt;- table(nycflights13::flights$carrier)
2minval &lt;- min(tbl)
3maxval &lt;- max(tbl)
4tbl[which(tbl == minval)]
5tbl[which(tbl == maxval)]
6

Source https://stackoverflow.com/questions/70819016

QUESTION

Problems with changing the size of the two upper boxes ( text/image)

Asked 2022-Jan-18 at 17:17

I'm trying to make my website responsive and for mobile and iPad it seems to work pretty well but for desktop I have a problem. I'm trying to figure out how to expand the two upper boxes (image and text). My website looks like this right now:

My website

But the result should look like the picture to the left: Responsive design

Here is my HTML for the two upper boxes:

1@import url('https://fonts.googleapis.com/css2?family=Amatic+SC&amp;family=Montserrat:wght@100&amp;family=Open+Sans+Condensed:wght@300;700&amp;display=swap');
2body {
3  margin: 0%;
4  font-family: 'Montserrat', sans-serif;
5  background-color: #f2f2f0;
6}
7
8
9/* Header  */
10
11header {
12  height: 100px;
13  display: flex;
14  align-items: center;
15  justify-content: space-between;
16  padding: 16px;
17  color: #d0c8b6;
18}
19
20a {
21  text-decoration: none;
22}
23
24.headertext {
25  font-family: 'Amatic SC', cursive;
26  font-size: 50px;
27  margin-right: 40px;
28}
29
30.title {
31  display: flex;
32  font-family: 'Amatic SC', cursive;
33}
34
35.logo {
36  width: 80px;
37  border-radius: 50%;
38  margin-left: 40px;
39}
40
41
42/*  The bigger news   */
43
44nav {
45  display: none;
46  font-size: 14px;
47}
48
49nav div {
50  width: 30%;
51  display: flex;
52  justify-content: space-between;
53}
54
55.header-box {
56  display: flex;
57  margin: 0%;
58  justify-content: center;
59}
60
61
62/* The other news   */
63
64.flex-parent1 {
65  display: flex;
66  flex-wrap: wrap;
67  justify-content: center;
68}
69
70.flex-parent2 {
71  display: flex;
72  height: 100px;
73  flex-direction: row;
74  flex-wrap: wrap;
75  justify-content: center;
76}
77
78.child1 {
79  margin-bottom: 20px;
80}
81
82.image {
83  height: auto;
84  width: auto;
85  display: inline;
86}
87
88.text {
89  margin-left: 10px;
90  margin-right: 10px;
91  margin-top: 0px;
92  width: 350px;
93  text-align: justify;
94}
95
96.footer-text {
97  color: black;
98  font-size: 14px;
99  margin-top: 5px;
100  margin-bottom: 8px;
101  text-transform: uppercase;
102  text-align: center;
103}
104
105.date {
106  text-align: center;
107  margin-top: 5px;
108  font-size: 10px;
109}
110
111.image {
112  width: 350px;
113  display: flex;
114  align-items: center;
115  flex-direction: column;
116  margin-left: 10px;
117  margin-right: 10px;
118}
119
120.image1 {
121  width: 350px;
122  display: flex;
123  align-items: center;
124  flex-direction: column;
125  margin-left: 10px;
126  margin-right: 10px;
127}
128
129
130/* Mobile */
131
132@media (min-width: 668px) {
133  header {
134    justify-content: center;
135  }
136  nav {
137    width: 80%;
138    display: flex;
139    justify-content: space-between;
140  }
141  .headertext {
142    display: none;
143  }
144  .title {
145    display: none;
146  }
147  .menu {
148    display: none;
149  }
150  .logo {
151    position: absolute;
152  }
153}
154
155
156/* Desktop */
157
158@media (min-width: 1025px) {
159  header {
160    justify-content: space-between;
161  }
162  nav {
163    width: 60%;
164    justify-content: space-evenly;
165  }
166  .logo {
167    position: static;
168  }
169  .headertext {
170    display: block;
171  }
172}
1@import url('https://fonts.googleapis.com/css2?family=Amatic+SC&amp;family=Montserrat:wght@100&amp;family=Open+Sans+Condensed:wght@300;700&amp;display=swap');
2body {
3  margin: 0%;
4  font-family: 'Montserrat', sans-serif;
5  background-color: #f2f2f0;
6}
7
8
9/* Header  */
10
11header {
12  height: 100px;
13  display: flex;
14  align-items: center;
15  justify-content: space-between;
16  padding: 16px;
17  color: #d0c8b6;
18}
19
20a {
21  text-decoration: none;
22}
23
24.headertext {
25  font-family: 'Amatic SC', cursive;
26  font-size: 50px;
27  margin-right: 40px;
28}
29
30.title {
31  display: flex;
32  font-family: 'Amatic SC', cursive;
33}
34
35.logo {
36  width: 80px;
37  border-radius: 50%;
38  margin-left: 40px;
39}
40
41
42/*  The bigger news   */
43
44nav {
45  display: none;
46  font-size: 14px;
47}
48
49nav div {
50  width: 30%;
51  display: flex;
52  justify-content: space-between;
53}
54
55.header-box {
56  display: flex;
57  margin: 0%;
58  justify-content: center;
59}
60
61
62/* The other news   */
63
64.flex-parent1 {
65  display: flex;
66  flex-wrap: wrap;
67  justify-content: center;
68}
69
70.flex-parent2 {
71  display: flex;
72  height: 100px;
73  flex-direction: row;
74  flex-wrap: wrap;
75  justify-content: center;
76}
77
78.child1 {
79  margin-bottom: 20px;
80}
81
82.image {
83  height: auto;
84  width: auto;
85  display: inline;
86}
87
88.text {
89  margin-left: 10px;
90  margin-right: 10px;
91  margin-top: 0px;
92  width: 350px;
93  text-align: justify;
94}
95
96.footer-text {
97  color: black;
98  font-size: 14px;
99  margin-top: 5px;
100  margin-bottom: 8px;
101  text-transform: uppercase;
102  text-align: center;
103}
104
105.date {
106  text-align: center;
107  margin-top: 5px;
108  font-size: 10px;
109}
110
111.image {
112  width: 350px;
113  display: flex;
114  align-items: center;
115  flex-direction: column;
116  margin-left: 10px;
117  margin-right: 10px;
118}
119
120.image1 {
121  width: 350px;
122  display: flex;
123  align-items: center;
124  flex-direction: column;
125  margin-left: 10px;
126  margin-right: 10px;
127}
128
129
130/* Mobile */
131
132@media (min-width: 668px) {
133  header {
134    justify-content: center;
135  }
136  nav {
137    width: 80%;
138    display: flex;
139    justify-content: space-between;
140  }
141  .headertext {
142    display: none;
143  }
144  .title {
145    display: none;
146  }
147  .menu {
148    display: none;
149  }
150  .logo {
151    position: absolute;
152  }
153}
154
155
156/* Desktop */
157
158@media (min-width: 1025px) {
159  header {
160    justify-content: space-between;
161  }
162  nav {
163    width: 60%;
164    justify-content: space-evenly;
165  }
166  .logo {
167    position: static;
168  }
169  .headertext {
170    display: block;
171  }
172}&lt;div class="flex-parent1"&gt;
173
174  &lt;div class="child1"&gt;
175    &lt;img class="image" src="https://images.pexels.com/photos/5581939/pexels-photo-5581939.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=2&amp;h=750&amp;w=1260" alt="image1" /&gt;
176  &lt;/div&gt;
177
178  &lt;div class="child2"&gt;
179    &lt;p class="text"&gt;Tourism is travelling for pleasure or to enjoy yourself away from the place you live. People do this for many different reasons – to have fun, visit other countries and learn about other cultures or just relax from stressful working life. Tourists
180      go to various destinations, countries with great landmarks, places with lovely beaches or simply areas of wilderness and untouched nature. In the last few decades tourism has grown very much, mostly because people’s lifestyles have changed. They
181      don’t want to stay at home any more. They spend more money on travelling than previous generations did. Travelling has also become cheaper and more affordable. The rise of budget airlines has made it possible to afford trips to faraway countries.
182      Tourism is travelling for pleasure or to enjoy yourself away from the place you live. People do this for many different reasons – to have fun, visit other countries and learn about other cultures or just relax from stressful working life. he rise
183      of budget airlines has made it possible to afford trips to faraway countries. about other cultures or just relax from stressful working life. he rise of budget airlines has made it possible to.&lt;/p&gt;
184  &lt;/div&gt;
185
186&lt;/div&gt;

ANSWER

Answered 2022-Jan-18 at 17:11

If by "expand" you mean put them in a row for larger screens, just set the flex direction to row by default, and you already have it overridden for mobile.

View this demo in fullscreen mode and resize.

1@import url('https://fonts.googleapis.com/css2?family=Amatic+SC&amp;family=Montserrat:wght@100&amp;family=Open+Sans+Condensed:wght@300;700&amp;display=swap');
2body {
3  margin: 0%;
4  font-family: 'Montserrat', sans-serif;
5  background-color: #f2f2f0;
6}
7
8
9/* Header  */
10
11header {
12  height: 100px;
13  display: flex;
14  align-items: center;
15  justify-content: space-between;
16  padding: 16px;
17  color: #d0c8b6;
18}
19
20a {
21  text-decoration: none;
22}
23
24.headertext {
25  font-family: 'Amatic SC', cursive;
26  font-size: 50px;
27  margin-right: 40px;
28}
29
30.title {
31  display: flex;
32  font-family: 'Amatic SC', cursive;
33}
34
35.logo {
36  width: 80px;
37  border-radius: 50%;
38  margin-left: 40px;
39}
40
41
42/*  The bigger news   */
43
44nav {
45  display: none;
46  font-size: 14px;
47}
48
49nav div {
50  width: 30%;
51  display: flex;
52  justify-content: space-between;
53}
54
55.header-box {
56  display: flex;
57  margin: 0%;
58  justify-content: center;
59}
60
61
62/* The other news   */
63
64.flex-parent1 {
65  display: flex;
66  flex-wrap: wrap;
67  justify-content: center;
68}
69
70.flex-parent2 {
71  display: flex;
72  height: 100px;
73  flex-direction: row;
74  flex-wrap: wrap;
75  justify-content: center;
76}
77
78.child1 {
79  margin-bottom: 20px;
80}
81
82.image {
83  height: auto;
84  width: auto;
85  display: inline;
86}
87
88.text {
89  margin-left: 10px;
90  margin-right: 10px;
91  margin-top: 0px;
92  width: 350px;
93  text-align: justify;
94}
95
96.footer-text {
97  color: black;
98  font-size: 14px;
99  margin-top: 5px;
100  margin-bottom: 8px;
101  text-transform: uppercase;
102  text-align: center;
103}
104
105.date {
106  text-align: center;
107  margin-top: 5px;
108  font-size: 10px;
109}
110
111.image {
112  width: 350px;
113  display: flex;
114  align-items: center;
115  flex-direction: column;
116  margin-left: 10px;
117  margin-right: 10px;
118}
119
120.image1 {
121  width: 350px;
122  display: flex;
123  align-items: center;
124  flex-direction: column;
125  margin-left: 10px;
126  margin-right: 10px;
127}
128
129
130/* Mobile */
131
132@media (min-width: 668px) {
133  header {
134    justify-content: center;
135  }
136  nav {
137    width: 80%;
138    display: flex;
139    justify-content: space-between;
140  }
141  .headertext {
142    display: none;
143  }
144  .title {
145    display: none;
146  }
147  .menu {
148    display: none;
149  }
150  .logo {
151    position: absolute;
152  }
153}
154
155
156/* Desktop */
157
158@media (min-width: 1025px) {
159  header {
160    justify-content: space-between;
161  }
162  nav {
163    width: 60%;
164    justify-content: space-evenly;
165  }
166  .logo {
167    position: static;
168  }
169  .headertext {
170    display: block;
171  }
172}&lt;div class="flex-parent1"&gt;
173
174  &lt;div class="child1"&gt;
175    &lt;img class="image" src="https://images.pexels.com/photos/5581939/pexels-photo-5581939.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=2&amp;h=750&amp;w=1260" alt="image1" /&gt;
176  &lt;/div&gt;
177
178  &lt;div class="child2"&gt;
179    &lt;p class="text"&gt;Tourism is travelling for pleasure or to enjoy yourself away from the place you live. People do this for many different reasons – to have fun, visit other countries and learn about other cultures or just relax from stressful working life. Tourists
180      go to various destinations, countries with great landmarks, places with lovely beaches or simply areas of wilderness and untouched nature. In the last few decades tourism has grown very much, mostly because people’s lifestyles have changed. They
181      don’t want to stay at home any more. They spend more money on travelling than previous generations did. Travelling has also become cheaper and more affordable. The rise of budget airlines has made it possible to afford trips to faraway countries.
182      Tourism is travelling for pleasure or to enjoy yourself away from the place you live. People do this for many different reasons – to have fun, visit other countries and learn about other cultures or just relax from stressful working life. he rise
183      of budget airlines has made it possible to afford trips to faraway countries. about other cultures or just relax from stressful working life. he rise of budget airlines has made it possible to.&lt;/p&gt;
184  &lt;/div&gt;
185
186&lt;/div&gt;@import url('https://fonts.googleapis.com/css2?family=Amatic+SC&amp;family=Montserrat:wght@100&amp;family=Open+Sans+Condensed:wght@300;700&amp;display=swap');
187body {
188  margin: 0%;
189  font-family: 'Montserrat', sans-serif;
190  background-color: #f2f2f0;
191}
192
193
194/* Header  */
195
196header {
197  height: 100px;
198  display: flex;
199  align-items: center;
200  justify-content: space-between;
201  padding: 16px;
202  color: #d0c8b6;
203}
204
205a {
206  text-decoration: none;
207}
208
209.headertext {
210  font-family: 'Amatic SC', cursive;
211  font-size: 50px;
212  margin-right: 40px;
213}
214
215.title {
216  display: flex;
217  font-family: 'Amatic SC', cursive;
218}
219
220.logo {
221  width: 80px;
222  border-radius: 50%;
223  margin-left: 40px;
224}
225
226
227/*  The bigger news   */
228
229nav {
230  display: none;
231  font-size: 14px;
232}
233
234nav div {
235  width: 30%;
236  display: flex;
237  justify-content: space-between;
238}
239
240.header-box {
241  display: flex;
242  margin: 0%;
243  justify-content: center;
244}
245
246
247/* The other news   */
248
249.flex-parent1 {
250  display: flex;
251  flex-direction: row;
252  flex-wrap: wrap;
253  justify-content: center;
254}
255
256.flex-parent2 {
257  display: flex;
258  height: 100px;
259  flex-direction: row;
260  flex-wrap: wrap;
261  justify-content: center;
262}
263
264.child1 {
265  margin-bottom: 20px;
266}
267
268.image {
269  height: auto;
270  width: auto;
271  display: inline;
272}
273
274.text {
275  margin-left: 10px;
276  margin-right: 10px;
277  margin-top: 0px;
278  width: 350px;
279  text-align: justify;
280}
281
282.footer-text {
283  color: black;
284  font-size: 14px;
285  margin-top: 5px;
286  margin-bottom: 8px;
287  text-transform: uppercase;
288  text-align: center;
289}
290
291.date {
292  text-align: center;
293  margin-top: 5px;
294  font-size: 10px;
295}
296
297.image {
298  width: 350px;
299  display: flex;
300  align-items: center;
301  flex-direction: column;
302  margin-left: 10px;
303  margin-right: 10px;
304}
305
306.image1 {
307  width: 350px;
308  display: flex;
309  align-items: center;
310  flex-direction: column;
311  margin-left: 10px;
312  margin-right: 10px;
313}
314
315
316/* Mobile */
317
318@media (min-width: 668px) {
319  header {
320    justify-content: center;
321  }
322  nav {
323    width: 80%;
324    display: flex;
325    justify-content: space-between;
326  }
327  .headertext {
328    display: none;
329  }
330  .title {
331    display: none;
332  }
333  .menu {
334    display: none;
335  }
336  .logo {
337    position: absolute;
338  }
339}
340
341
342/* Desktop */
343
344@media (min-width: 1025px) {
345  header {
346    justify-content: space-between;
347  }
348  nav {
349    width: 60%;
350    justify-content: space-evenly;
351  }
352  .logo {
353    position: static;
354  }
355  .headertext {
356    display: block;
357  }
358}
1@import url('https://fonts.googleapis.com/css2?family=Amatic+SC&amp;family=Montserrat:wght@100&amp;family=Open+Sans+Condensed:wght@300;700&amp;display=swap');
2body {
3  margin: 0%;
4  font-family: 'Montserrat', sans-serif;
5  background-color: #f2f2f0;
6}
7
8
9/* Header  */
10
11header {
12  height: 100px;
13  display: flex;
14  align-items: center;
15  justify-content: space-between;
16  padding: 16px;
17  color: #d0c8b6;
18}
19
20a {
21  text-decoration: none;
22}
23
24.headertext {
25  font-family: 'Amatic SC', cursive;
26  font-size: 50px;
27  margin-right: 40px;
28}
29
30.title {
31  display: flex;
32  font-family: 'Amatic SC', cursive;
33}
34
35.logo {
36  width: 80px;
37  border-radius: 50%;
38  margin-left: 40px;
39}
40
41
42/*  The bigger news   */
43
44nav {
45  display: none;
46  font-size: 14px;
47}
48
49nav div {
50  width: 30%;
51  display: flex;
52  justify-content: space-between;
53}
54
55.header-box {
56  display: flex;
57  margin: 0%;
58  justify-content: center;
59}
60
61
62/* The other news   */
63
64.flex-parent1 {
65  display: flex;
66  flex-wrap: wrap;
67  justify-content: center;
68}
69
70.flex-parent2 {
71  display: flex;
72  height: 100px;
73  flex-direction: row;
74  flex-wrap: wrap;
75  justify-content: center;
76}
77
78.child1 {
79  margin-bottom: 20px;
80}
81
82.image {
83  height: auto;
84  width: auto;
85  display: inline;
86}
87
88.text {
89  margin-left: 10px;
90  margin-right: 10px;
91  margin-top: 0px;
92  width: 350px;
93  text-align: justify;
94}
95
96.footer-text {
97  color: black;
98  font-size: 14px;
99  margin-top: 5px;
100  margin-bottom: 8px;
101  text-transform: uppercase;
102  text-align: center;
103}
104
105.date {
106  text-align: center;
107  margin-top: 5px;
108  font-size: 10px;
109}
110
111.image {
112  width: 350px;
113  display: flex;
114  align-items: center;
115  flex-direction: column;
116  margin-left: 10px;
117  margin-right: 10px;
118}
119
120.image1 {
121  width: 350px;
122  display: flex;
123  align-items: center;
124  flex-direction: column;
125  margin-left: 10px;
126  margin-right: 10px;
127}
128
129
130/* Mobile */
131
132@media (min-width: 668px) {
133  header {
134    justify-content: center;
135  }
136  nav {
137    width: 80%;
138    display: flex;
139    justify-content: space-between;
140  }
141  .headertext {
142    display: none;
143  }
144  .title {
145    display: none;
146  }
147  .menu {
148    display: none;
149  }
150  .logo {
151    position: absolute;
152  }
153}
154
155
156/* Desktop */
157
158@media (min-width: 1025px) {
159  header {
160    justify-content: space-between;
161  }
162  nav {
163    width: 60%;
164    justify-content: space-evenly;
165  }
166  .logo {
167    position: static;
168  }
169  .headertext {
170    display: block;
171  }
172}&lt;div class="flex-parent1"&gt;
173
174  &lt;div class="child1"&gt;
175    &lt;img class="image" src="https://images.pexels.com/photos/5581939/pexels-photo-5581939.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=2&amp;h=750&amp;w=1260" alt="image1" /&gt;
176  &lt;/div&gt;
177
178  &lt;div class="child2"&gt;
179    &lt;p class="text"&gt;Tourism is travelling for pleasure or to enjoy yourself away from the place you live. People do this for many different reasons – to have fun, visit other countries and learn about other cultures or just relax from stressful working life. Tourists
180      go to various destinations, countries with great landmarks, places with lovely beaches or simply areas of wilderness and untouched nature. In the last few decades tourism has grown very much, mostly because people’s lifestyles have changed. They
181      don’t want to stay at home any more. They spend more money on travelling than previous generations did. Travelling has also become cheaper and more affordable. The rise of budget airlines has made it possible to afford trips to faraway countries.
182      Tourism is travelling for pleasure or to enjoy yourself away from the place you live. People do this for many different reasons – to have fun, visit other countries and learn about other cultures or just relax from stressful working life. he rise
183      of budget airlines has made it possible to afford trips to faraway countries. about other cultures or just relax from stressful working life. he rise of budget airlines has made it possible to.&lt;/p&gt;
184  &lt;/div&gt;
185
186&lt;/div&gt;@import url('https://fonts.googleapis.com/css2?family=Amatic+SC&amp;family=Montserrat:wght@100&amp;family=Open+Sans+Condensed:wght@300;700&amp;display=swap');
187body {
188  margin: 0%;
189  font-family: 'Montserrat', sans-serif;
190  background-color: #f2f2f0;
191}
192
193
194/* Header  */
195
196header {
197  height: 100px;
198  display: flex;
199  align-items: center;
200  justify-content: space-between;
201  padding: 16px;
202  color: #d0c8b6;
203}
204
205a {
206  text-decoration: none;
207}
208
209.headertext {
210  font-family: 'Amatic SC', cursive;
211  font-size: 50px;
212  margin-right: 40px;
213}
214
215.title {
216  display: flex;
217  font-family: 'Amatic SC', cursive;
218}
219
220.logo {
221  width: 80px;
222  border-radius: 50%;
223  margin-left: 40px;
224}
225
226
227/*  The bigger news   */
228
229nav {
230  display: none;
231  font-size: 14px;
232}
233
234nav div {
235  width: 30%;
236  display: flex;
237  justify-content: space-between;
238}
239
240.header-box {
241  display: flex;
242  margin: 0%;
243  justify-content: center;
244}
245
246
247/* The other news   */
248
249.flex-parent1 {
250  display: flex;
251  flex-direction: row;
252  flex-wrap: wrap;
253  justify-content: center;
254}
255
256.flex-parent2 {
257  display: flex;
258  height: 100px;
259  flex-direction: row;
260  flex-wrap: wrap;
261  justify-content: center;
262}
263
264.child1 {
265  margin-bottom: 20px;
266}
267
268.image {
269  height: auto;
270  width: auto;
271  display: inline;
272}
273
274.text {
275  margin-left: 10px;
276  margin-right: 10px;
277  margin-top: 0px;
278  width: 350px;
279  text-align: justify;
280}
281
282.footer-text {
283  color: black;
284  font-size: 14px;
285  margin-top: 5px;
286  margin-bottom: 8px;
287  text-transform: uppercase;
288  text-align: center;
289}
290
291.date {
292  text-align: center;
293  margin-top: 5px;
294  font-size: 10px;
295}
296
297.image {
298  width: 350px;
299  display: flex;
300  align-items: center;
301  flex-direction: column;
302  margin-left: 10px;
303  margin-right: 10px;
304}
305
306.image1 {
307  width: 350px;
308  display: flex;
309  align-items: center;
310  flex-direction: column;
311  margin-left: 10px;
312  margin-right: 10px;
313}
314
315
316/* Mobile */
317
318@media (min-width: 668px) {
319  header {
320    justify-content: center;
321  }
322  nav {
323    width: 80%;
324    display: flex;
325    justify-content: space-between;
326  }
327  .headertext {
328    display: none;
329  }
330  .title {
331    display: none;
332  }
333  .menu {
334    display: none;
335  }
336  .logo {
337    position: absolute;
338  }
339}
340
341
342/* Desktop */
343
344@media (min-width: 1025px) {
345  header {
346    justify-content: space-between;
347  }
348  nav {
349    width: 60%;
350    justify-content: space-evenly;
351  }
352  .logo {
353    position: static;
354  }
355  .headertext {
356    display: block;
357  }
358}&lt;div class="flex-parent1"&gt;
359  &lt;div class="child1"&gt;
360    &lt;img class="image" src="https://images.pexels.com/photos/5581939/pexels-photo-5581939.jpeg?auto=compress&amp;cs=tinysrgb&amp;dpr=2&amp;h=750&amp;w=1260" alt="image1" /&gt;
361  &lt;/div&gt;
362
363  &lt;div class="child2"&gt;
364    &lt;p class="text"&gt;Tourism is travelling for pleasure or to enjoy yourself away from the place you live. People do this for many different reasons – to have fun, visit other countries and learn about other cultures or just relax from stressful working life. Tourists
365      go to various destinations, countries with great landmarks, places with lovely beaches or simply areas of wilderness and untouched nature. In the last few decades tourism has grown very much, mostly because people’s lifestyles have changed. They
366      don’t want to stay at home any more. They spend more money on travelling than previous generations did. Travelling has also become cheaper and more affordable. The rise of budget airlines has made it possible to afford trips to faraway countries.
367      Tourism is travelling for pleasure or to enjoy yourself away from the place you live. People do this for many different reasons – to have fun, visit other countries and learn about other cultures or just relax from stressful working life. he rise
368      of budget airlines has made it possible to afford trips to faraway countries. about other cultures or just relax from stressful working life. he rise of budget airlines has made it possible to.&lt;/p&gt;
369  &lt;/div&gt;
370&lt;/div&gt;

Source https://stackoverflow.com/questions/70759525

QUESTION

Apache Spark Data Generator Function on Databricks Not working

Asked 2022-Jan-16 at 23:52

I am trying to execute the Data Generator function provided my Microsoft to test streaming data to Event Hubs.

Unfortunately, I keep on getting the error

1Processing failure: No such file or directory
2

When I try and execute the function:

1Processing failure: No such file or directory
2%scala
3DummyDataGenerator.start(15)
4

Can someone take a look at the code and help decipher why I'm getting the error:

1Processing failure: No such file or directory
2%scala
3DummyDataGenerator.start(15)
4class DummyDataGenerator:
5  streamDirectory = &quot;/FileStore/tables/flight&quot;
6None # suppress output
7

I'm not sure how the above cell gets called into the function DummyDataGenerator

1Processing failure: No such file or directory
2%scala
3DummyDataGenerator.start(15)
4class DummyDataGenerator:
5  streamDirectory = &quot;/FileStore/tables/flight&quot;
6None # suppress output
7%scala
8
9import scala.util.Random
10import java.io._
11import java.time._
12
13// Notebook #2 has to set this to 8, we are setting
14// it to 200 to &quot;restore&quot; the default behavior.
15spark.conf.set(&quot;spark.sql.shuffle.partitions&quot;, 200)
16
17// Make the username available to all other languages.
18// &quot;WARNING: use of the &quot;current&quot; username is unpredictable
19// when multiple users are collaborating and should be replaced
20// with the notebook ID instead.
21val username = com.databricks.logging.AttributionContext.current.tags(com.databricks.logging.BaseTagDefinitions.TAG_USER);
22spark.conf.set(&quot;com.databricks.training.username&quot;, username)
23
24object DummyDataGenerator extends Runnable {
25  var runner : Thread = null;
26  val className = getClass().getName()
27  val streamDirectory = s&quot;dbfs:/tmp/$username/new-flights&quot;
28  val airlines = Array( (&quot;American&quot;, 0.17), (&quot;Delta&quot;, 0.12), (&quot;Frontier&quot;, 0.14), (&quot;Hawaiian&quot;, 0.13), (&quot;JetBlue&quot;, 0.15), (&quot;United&quot;, 0.11), (&quot;Southwest&quot;, 0.18) )
29  val reasons = Array(&quot;Air Carrier&quot;, &quot;Extreme Weather&quot;, &quot;National Aviation System&quot;, &quot;Security&quot;, &quot;Late Aircraft&quot;)
30
31  val rand = new Random(System.currentTimeMillis())
32  var maxDuration = 3 * 60 * 1000 // default to three minutes
33
34  def clean() {
35    System.out.println(&quot;Removing old files for dummy data generator.&quot;)
36    dbutils.fs.rm(streamDirectory, true)
37    if (dbutils.fs.mkdirs(streamDirectory) == false) {
38      throw new RuntimeException(&quot;Unable to create temp directory.&quot;)
39    }
40  }
41
42  def run() {
43    val date = LocalDate.now()
44    val start = System.currentTimeMillis()
45
46    while (System.currentTimeMillis() - start &lt; maxDuration) {
47      try {
48        val dir = s&quot;/dbfs/tmp/$username/new-flights&quot;
49        val tempFile = File.createTempFile(&quot;flights-&quot;, &quot;&quot;, new File(dir)).getAbsolutePath()+&quot;.csv&quot;
50        val writer = new PrintWriter(tempFile)
51
52        for (airline &lt;- airlines) {
53          val flightNumber = rand.nextInt(1000)+1000
54          val deptTime = rand.nextInt(10)+10
55          val departureTime = LocalDateTime.now().plusHours(-deptTime)
56          val (name, odds) = airline
57          val reason = Random.shuffle(reasons.toList).head
58          val test = rand.nextDouble()
59
60          val delay = if (test &lt; odds)
61            rand.nextInt(60)+(30*odds)
62            else rand.nextInt(10)-5
63
64          println(s&quot;- Flight #$flightNumber by $name at $departureTime delayed $delay minutes due to $reason&quot;)
65          writer.println(s&quot;&quot;&quot; &quot;$flightNumber&quot;,&quot;$departureTime&quot;,&quot;$delay&quot;,&quot;$reason&quot;,&quot;$name&quot; &quot;&quot;&quot;.trim)
66        }
67        writer.close()
68
69        // wait a couple of seconds
70        //Thread.sleep(rand.nextInt(5000))
71
72      } catch {
73        case e: Exception =&gt; {
74          printf(&quot;* Processing failure: %s%n&quot;, e.getMessage())
75          return;
76        }
77      }
78    }
79    println(&quot;No more flights!&quot;)
80  }
81
82  def start(minutes:Int = 5) {
83    maxDuration = minutes * 60 * 1000
84
85    if (runner != null) {
86      println(&quot;Stopping dummy data generator.&quot;)
87      runner.interrupt();
88      runner.join();
89    }
90    println(s&quot;Running dummy data generator for $minutes minutes.&quot;)
91    runner = new Thread(this);
92    runner.run();
93  }
94
95  def stop() {
96    start(0)
97  }
98}
99
100DummyDataGenerator.clean()
101
102displayHTML(&quot;Imported streaming logic...&quot;) // suppress output
103

ANSWER

Answered 2022-Jan-08 at 13:16

This code will not work on the community edition because of this line:

1Processing failure: No such file or directory
2%scala
3DummyDataGenerator.start(15)
4class DummyDataGenerator:
5  streamDirectory = &quot;/FileStore/tables/flight&quot;
6None # suppress output
7%scala
8
9import scala.util.Random
10import java.io._
11import java.time._
12
13// Notebook #2 has to set this to 8, we are setting
14// it to 200 to &quot;restore&quot; the default behavior.
15spark.conf.set(&quot;spark.sql.shuffle.partitions&quot;, 200)
16
17// Make the username available to all other languages.
18// &quot;WARNING: use of the &quot;current&quot; username is unpredictable
19// when multiple users are collaborating and should be replaced
20// with the notebook ID instead.
21val username = com.databricks.logging.AttributionContext.current.tags(com.databricks.logging.BaseTagDefinitions.TAG_USER);
22spark.conf.set(&quot;com.databricks.training.username&quot;, username)
23
24object DummyDataGenerator extends Runnable {
25  var runner : Thread = null;
26  val className = getClass().getName()
27  val streamDirectory = s&quot;dbfs:/tmp/$username/new-flights&quot;
28  val airlines = Array( (&quot;American&quot;, 0.17), (&quot;Delta&quot;, 0.12), (&quot;Frontier&quot;, 0.14), (&quot;Hawaiian&quot;, 0.13), (&quot;JetBlue&quot;, 0.15), (&quot;United&quot;, 0.11), (&quot;Southwest&quot;, 0.18) )
29  val reasons = Array(&quot;Air Carrier&quot;, &quot;Extreme Weather&quot;, &quot;National Aviation System&quot;, &quot;Security&quot;, &quot;Late Aircraft&quot;)
30
31  val rand = new Random(System.currentTimeMillis())
32  var maxDuration = 3 * 60 * 1000 // default to three minutes
33
34  def clean() {
35    System.out.println(&quot;Removing old files for dummy data generator.&quot;)
36    dbutils.fs.rm(streamDirectory, true)
37    if (dbutils.fs.mkdirs(streamDirectory) == false) {
38      throw new RuntimeException(&quot;Unable to create temp directory.&quot;)
39    }
40  }
41
42  def run() {
43    val date = LocalDate.now()
44    val start = System.currentTimeMillis()
45
46    while (System.currentTimeMillis() - start &lt; maxDuration) {
47      try {
48        val dir = s&quot;/dbfs/tmp/$username/new-flights&quot;
49        val tempFile = File.createTempFile(&quot;flights-&quot;, &quot;&quot;, new File(dir)).getAbsolutePath()+&quot;.csv&quot;
50        val writer = new PrintWriter(tempFile)
51
52        for (airline &lt;- airlines) {
53          val flightNumber = rand.nextInt(1000)+1000
54          val deptTime = rand.nextInt(10)+10
55          val departureTime = LocalDateTime.now().plusHours(-deptTime)
56          val (name, odds) = airline
57          val reason = Random.shuffle(reasons.toList).head
58          val test = rand.nextDouble()
59
60          val delay = if (test &lt; odds)
61            rand.nextInt(60)+(30*odds)
62            else rand.nextInt(10)-5
63
64          println(s&quot;- Flight #$flightNumber by $name at $departureTime delayed $delay minutes due to $reason&quot;)
65          writer.println(s&quot;&quot;&quot; &quot;$flightNumber&quot;,&quot;$departureTime&quot;,&quot;$delay&quot;,&quot;$reason&quot;,&quot;$name&quot; &quot;&quot;&quot;.trim)
66        }
67        writer.close()
68
69        // wait a couple of seconds
70        //Thread.sleep(rand.nextInt(5000))
71
72      } catch {
73        case e: Exception =&gt; {
74          printf(&quot;* Processing failure: %s%n&quot;, e.getMessage())
75          return;
76        }
77      }
78    }
79    println(&quot;No more flights!&quot;)
80  }
81
82  def start(minutes:Int = 5) {
83    maxDuration = minutes * 60 * 1000
84
85    if (runner != null) {
86      println(&quot;Stopping dummy data generator.&quot;)
87      runner.interrupt();
88      runner.join();
89    }
90    println(s&quot;Running dummy data generator for $minutes minutes.&quot;)
91    runner = new Thread(this);
92    runner.run();
93  }
94
95  def stop() {
96    start(0)
97  }
98}
99
100DummyDataGenerator.clean()
101
102displayHTML(&quot;Imported streaming logic...&quot;) // suppress output
103val dir = s&quot;/dbfs/tmp/$username/new-flights&quot;
104

as there is no DBFS fuse on Databricks community edition (it's supported only on full Databricks). It's potentially possible to make it working by:

  1. Changing that directory to local directory, like, /tmp or something like
  2. adding a code (after writer.close()) to list flights-* files in that local directory, and using dbutils.fs.mv to move them into streamDirectory

Source https://stackoverflow.com/questions/70626328

QUESTION

EnhancedSeatMap Seat Without Price

Asked 2021-Dec-02 at 19:50

I am having some trouble with EnhancedSeatMapRQ, as the seats for certain airlines (e.g. AC, AA, etc.) do not return any BasePrice or Price node. When checked with Sabre software, some of these seats do have a cost charged upon booking.

My understanding is in these situations, the CommercialName value is supposed to help lookup the price. With that said, there is no reference in the response that indicates any price, for anything.

Here is one with a price node:

1&lt;Offer entitledInd=&quot;false&quot;&gt;
2    &lt;CommercialName&gt;SEAT ASSIGNMENT&lt;/CommercialName&gt;
3    &lt;BasePrice&gt;
4      &lt;TotalAmount currencyCode=&quot;CAD&quot;&gt;27.12&lt;/TotalAmount&gt;
5      &lt;Taxes&gt;
6        &lt;Tax currencyCode=&quot;CAD&quot;&gt;3.12&lt;/Tax&gt;
7        &lt;TaxTypeRef&gt;taxTypeDetail_1&lt;/TaxTypeRef&gt;
8      &lt;/Taxes&gt;
9    &lt;/BasePrice&gt;
10&lt;/Offer&gt;
11

And one without it:

1&lt;Offer entitledInd=&quot;false&quot;&gt;
2    &lt;CommercialName&gt;SEAT ASSIGNMENT&lt;/CommercialName&gt;
3    &lt;BasePrice&gt;
4      &lt;TotalAmount currencyCode=&quot;CAD&quot;&gt;27.12&lt;/TotalAmount&gt;
5      &lt;Taxes&gt;
6        &lt;Tax currencyCode=&quot;CAD&quot;&gt;3.12&lt;/Tax&gt;
7        &lt;TaxTypeRef&gt;taxTypeDetail_1&lt;/TaxTypeRef&gt;
8      &lt;/Taxes&gt;
9    &lt;/BasePrice&gt;
10&lt;/Offer&gt;
11 &lt;Offer entitledInd=&quot;true&quot;&gt;
12  &lt;CommercialName&gt;ADVANCE SEAT SELECTION&lt;/CommercialName&gt;
13  &lt;OfferItemId&gt;offerItem_1&lt;/OfferItemId&gt;
14  &lt;TravellerID&gt;1&lt;/TravellerID&gt;
15&lt;/Offer&gt;
16
17

Specifies the commercial name associated with matched price. is all that the docs say about the CommercialName node.

Please guide me through the process of pricing these seats, as it's crucial to a proper seat selection process.

UPDATE: We have noticed that all the Offer nodes without a Price or BasePrice, are inside seats with chargeableInd set to false. With that said, this happens with a significant number of the Airlines, and if unresolved, will render our seat selection counter-productive.

ANSWER

Answered 2021-Dec-02 at 19:50

So Sabre team got back to me, and clarified the issue. When sending a SeatMapQueryEnhanced, the /CabinDefinition/RBD is supposed to have the @ProgramSystemCode, received from BFM.

Example:

1&lt;Offer entitledInd=&quot;false&quot;&gt;
2    &lt;CommercialName&gt;SEAT ASSIGNMENT&lt;/CommercialName&gt;
3    &lt;BasePrice&gt;
4      &lt;TotalAmount currencyCode=&quot;CAD&quot;&gt;27.12&lt;/TotalAmount&gt;
5      &lt;Taxes&gt;
6        &lt;Tax currencyCode=&quot;CAD&quot;&gt;3.12&lt;/Tax&gt;
7        &lt;TaxTypeRef&gt;taxTypeDetail_1&lt;/TaxTypeRef&gt;
8      &lt;/Taxes&gt;
9    &lt;/BasePrice&gt;
10&lt;/Offer&gt;
11 &lt;Offer entitledInd=&quot;true&quot;&gt;
12  &lt;CommercialName&gt;ADVANCE SEAT SELECTION&lt;/CommercialName&gt;
13  &lt;OfferItemId&gt;offerItem_1&lt;/OfferItemId&gt;
14  &lt;TravellerID&gt;1&lt;/TravellerID&gt;
15&lt;/Offer&gt;
16
17 &lt;Flight origin=&quot;YVR&quot; destination=&quot;DFW&quot;&gt;
18     &lt;DepartureDate&gt;2022-07-13&lt;/DepartureDate&gt;
19         &lt;Operating carrier=&quot;AA&quot;&gt;392&lt;/Operating&gt;
20             &lt;Marketing carrier=&quot;AA&quot;&gt;392&lt;/Marketing&gt;
21         &lt;ArrivalDate&gt;2022-07-13&lt;/ArrivalDate&gt;
22 &lt;/Flight&gt;
23 &lt;CabinDefinition&gt;
24     &lt;RBD&gt;N&lt;/RBD&gt;
25 &lt;/CabinDefinition&gt;
26

Where N is extracted form the ProgramSystemCode attribute of that Segment node.

Source https://stackoverflow.com/questions/69680922

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Airlines

Tutorials and Learning Resources are not available at this moment for Airlines

Share this Page

share link

Get latest updates on Airlines