A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/application/controllers/Main.php
Line: 693
Function: getPaste

File: /home/httpd/vhosts/scratchbook.ch/geopaste.scratchbook.ch/index.php
Line: 315
Function: require_once

Untitled - Stikked
From Bistre Tapir, 5 Years ago, written in Python.
Embed
  1. def my_det(X):
  2.     '''
  3.    Parameters
  4.    ----------
  5.    X : array_like
  6.    
  7.    Returns
  8.    -------
  9.    det : float
  10.        Determinant of `a`.
  11.    '''
  12.     if X.shape[0] != X.shape[1]:
  13.         raise(AttributeError("Wrong matrix size"))
  14.     A = np.copy(X)
  15.     ind = 0
  16.     for i in range(A.shape[0]):
  17.         str_ind = -1
  18.         for j in range(i, A.shape[0]):
  19.             if A[j][i] != 0:
  20.                 str_ind = j
  21.                 break
  22.         if str_ind == -1:
  23.             return 0
  24.         for j in range(i, A.shape[0]):
  25.             if A[j][i] != 0:
  26.                 if j == str_ind:
  27.                     continue
  28.                 A[j] -= A[str_ind] / A[str_ind][i] * A[j][i]
  29.                
  30.         A[str_ind], A[i] = A[i], A[str_ind]
  31.        
  32.     det = np.prod(A.diagonal())
  33.     return det