Template in Fortran?

Fortran does not have templates, but you can put the code common to the functions handling different types in an include file as a kludge to simulate templates, as shown in this code: ! file “cumul.inc” ! function cumul(xx) result(yy) ! return in yy(:) the cumulative sum of xx(:) ! type, intent(in) :: xx(:) ! … Read more

List of class’s properties in swift

Using Mirror Here’s a pure Swift solution with some limitations: protocol PropertyNames { func propertyNames() -> [String] } extension PropertyNames { func propertyNames() -> [String] { return Mirror(reflecting: self).children.flatMap { $0.label } } } class Person : PropertyNames { var name = “Sansa Stark” var awesome = true } Person().propertyNames() // [“name”, “awesome”] Limitations: Returns … Read more

Types and classes of variables

In R every “object” has a mode and a class. The former represents how an object is stored in memory (numeric, character, list and function) while the later represents its abstract type. For example: d <- data.frame(V1=c(1,2)) class(d) # [1] “data.frame” mode(d) # [1] “list” typeof(d) # list As you can see data frames are … Read more

What are public, private and protected in object oriented programming?

They are access modifiers and help us implement Encapsulation (or information hiding). They tell the compiler which other classes should have access to the field or method being defined. private – Only the current class will have access to the field or method. protected – Only the current class and subclasses (and sometimes also same-package … Read more

CKEditor automatically strips classes from div

Disabling content filtering The easiest solution is going to the config.js and setting: config.allowedContent = true; (Remember to clear browser’s cache). Then CKEditor stops filtering the inputted content at all. However, this will totally disable content filtering which is one of the most important CKEditor features. Configuring content filtering You can also configure CKEditor’s content … Read more

‘POCO’ definition

“Plain Old C# Object” Just a normal class, no attributes describing infrastructure concerns or other responsibilities that your domain objects shouldn’t have. EDIT – as other answers have stated, it is technically “Plain Old CLR Object” but I, like David Arno comments, prefer “Plain Old Class Object” to avoid ties to specific languages or technologies. … Read more