Skip to content

Instantly share code, notes, and snippets.

Avatar

Evangelos Drikos drikosev

View GitHub Profile
View direct_SQL_statement.txt
<sql-implementation> ::=
<direct SQL statement>
<direct SQL statement> ::=
[ <separator> ] <directly executable statement> <semicolon>
<separator> ::=
{ <comment> | <white spaces> } ...
<comment> ::=
View icep.f
! CHECK THE COMMANDS WHICH SHOULD HAVE EQUAL SIGN
! 10 - no equal sign required
! 11 - equal sign required
integer :: icep = 302 !ie
integer :: nn
character(2) :: ch
character(1050) :: go
parameter(go = &
!01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 & ! cells col
@drikosev
drikosev / m_sys.f90
Last active Mar 1, 2021
Hardcode or find at Runtime OS Name and File Separator in Fortran (by m_sys.java).
View m_sys.f90
module m_sys
implicit none
public get_os_name
public get_user_home
public get_arg_prefix
public get_file_sep
character(len=20), save :: os_name = ' '
character(len=255), save :: homedir = ' '
@drikosev
drikosev / realloc_class_0.f90
Last active Jan 19, 2021
Deallocations on Intrinsic Assignment
View realloc_class_0.f90
! { dg-do run }
! { dg-shouldfail "Fortran runtime error: Assignment with unallocated RHS 'w'" }
! { dg-output "Fortran runtime error: Assignment with unallocated RHS 'w'" }
! Catch a Runtime error on intrinsic assignment of
! a class LHS with an unallocated RHS.
module testmode
implicit none
View compare_star.f90
module m_type0
type :: Type0
contains
procedure :: eq => eq0
end type Type0
contains
logical function eq0(this,b)
View boz_extensions.f90
! { dg-do run }
! { dg-options "-fopenmp" }
! By default: -fallow-invalid-boz
! By default: Warn only few known non portable uses
! whereas -Wno-invalid-boz disables all related warnings,
! and -Winvalid-boz enables all related warnings.
program boz_extensions
integer, parameter :: p0 = Z'1234'
real,parameter :: rc = real(z'50CB9F09')
View findloc_driver.f90
! Profiled: 23ms (total time varies per optimization level)
! start libdyld.dylib: 12ms (52.1%)
! main program run: 11ms (47.8%)
! findloc: 9.1% of 11ms
! [The above representative percentages vary per run]
! Compiler: GNU Fortran 4.8.5 (github.com/drikosev/pc)
! Profiler: Instruments 9.3
! OS: macOS 10.13
! Computer: MBPR 2013 - 2,4 GHz Intel Core i7
View Types.Readme.txt
Sep 16, 2019
Ev. Drikos
The program in this gist demonstrates how one can achieve
default initialization on Fortran derived types, since the
language does not inherently support such a functionality.
In Specific, Fortran allows the instantiation of an object
@drikosev
drikosev / Dictionary.txt
Last active Feb 11, 2022
BOZ Literal Constants in function "ulen"
View Dictionary.txt
This Fortran/C interoperability example implements a static dictionary
containing <numeric key, unicode text> pairs, which are defined in file
"dictionary.c" and a Fortran program ie can print them in a terminal.
To build the project in a Linux, MacOS, or Cygwin terminal you can use
the Makefile. If you have GNU Fortran installed, then just type "make".
In Windows 8.1 ie run dictionary.exe in a blue PowerShell Console.
View bounds.c
#include <stdio.h>
#include <stdlib.h>
struct dim {
int lower;
int upper;
};
struct array {