A PHP Error was encountered

Severity: 8192

Message: Optional parameter $prod_file declared before required parameter $minify is implicitly treated as a required parameter

Filename: libraries/Carabiner.php

Line Number: 464

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 10
Function: __construct

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 129

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 280

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 151

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 208

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 297

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_database_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_database_driver.php

Line Number: 335

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 282

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 294

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 304

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 314

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 315

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 316

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 317

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 375

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 110

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_start(): Session cannot be started after headers have already been sent

Filename: Session/Session.php

Line Number: 143

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 63
Function: library

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: stristr(): Passing null to parameter #1 ($haystack) of type string is deprecated

Filename: controllers/Main.php

Line Number: 229

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 229
Function: stristr

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: stristr(): Passing null to parameter #1 ($haystack) of type string is deprecated

Filename: controllers/Main.php

Line Number: 251

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 251
Function: stristr

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: stristr(): Passing null to parameter #1 ($haystack) of type string is deprecated

Filename: controllers/Main.php

Line Number: 269

Backtrace:

File: /home/paste/public_html/application/controllers/Main.php
Line: 269
Function: stristr

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: filter_var(): Passing null to parameter #3 ($options) of type array|int is deprecated

Filename: core/Input.php

Line Number: 572

Backtrace:

File: /home/paste/public_html/application/models/Pastes.php
Line: 522
Function: ip_address

File: /home/paste/public_html/application/controllers/Main.php
Line: 470
Function: getPaste

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/paste/public_html/system/core/Exceptions.php:271)

Filename: view/raw.php

Line Number: 2

Backtrace:

File: /home/paste/public_html/themes/bootstrap/views/view/raw.php
Line: 2
Function: header

File: /home/paste/public_html/application/core/MY_Loader.php
Line: 147
Function: include

File: /home/paste/public_html/application/core/MY_Loader.php
Line: 33
Function: _ci_load

File: /home/paste/public_html/application/controllers/Main.php
Line: 478
Function: view

File: /home/paste/public_html/index.php
Line: 284
Function: require_once

program RangeCombo; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Math, Generics.Defaults, Generics.Collections; type Func = reference to function(): TResult; Func = reference to function(const Arg1: T): TResult; Func = reference to function(const Arg1: T1; const Arg2: T2): TResult; // various algorithms Alg = record class function Aggregate(const Input: TArray; const F: Func): TAccumulate; overload; static; class function Aggregate(const Input: TArray; const InitialValue: TAccumulate; const F: Func): TAccumulate; overload; static; class function Sort(const Input: TArray): TArray; overload; static; end; { Alg } class function Alg.Aggregate(const Input: TArray; const F: Func): TAccumulate; begin result := Aggregate(Input, Default(TAccumulate), F); end; class function Alg.Aggregate(const Input: TArray; const InitialValue: TAccumulate; const F: Func): TAccumulate; var elm: T; begin result := InitialValue; for elm in Input do begin result := F(result, elm); end; end; class function Alg.Sort(const Input: TArray): TArray; begin result := Copy(Input); TArray.Sort(result, TComparer.Default); end; type Range = record First: integer; Last: integer; class operator Implicit(const Value: integer): Range; end; function IsSingularRange(const R: Range): boolean; begin result := (R.First = R.Last); end; { Range } class operator Range.Implicit(const Value: integer): Range; begin result.First := Value; result.Last := Value; end; function CombineRanges(const Input: TArray): TArray; var sortedInput: TArray; begin sortedInput := Alg.Sort(Input); result := Alg.Aggregate>(sortedInput, function(const Accumulator: TArray; const Value: integer): TArray var r: Range; begin if (Length(Accumulator) = 0) then begin result := [Value]; exit; end; r := Accumulator[High(Accumulator)]; if (Value > (r.Last + 1)) then begin // need a new range result := Accumulator + [Value]; end else begin // extend last range result := Accumulator; result[High(result)].Last := System.Math.Max(r.Last, Value); end end ); end; function ExpandRanges(const Input: TArray): TArray; begin result := Alg.Aggregate>(Input, function(const Accumulator: TArray; const Value: Range): TArray var i: integer; begin result := Accumulator; for i := Value.First to Value.Last do begin result := result + [i]; end; end ); end; var input: TArray; ranges: TArray; r: Range; values: TArray; i: integer; begin input := [1,2,3,4,6,7,8,13,14]; try ranges := CombineRanges(input); for r in ranges do begin if (IsSingularRange(r)) then WriteLn(r.First) else WriteLn(r.First, '-', r.Last); end; WriteLn; WriteLn; values := ExpandRanges(ranges); for i in values do begin WriteLn(i); end; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; WriteLn('done'); ReadLn; end.