This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%module demo | |
%{ | |
#include "test.hpp" | |
%} | |
%include "test.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.LocalDate; | |
import java.util.function.Consumer; | |
public interface Status { | |
static class Running implements Status { | |
private Running() { | |
} | |
public boolean isRunning() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.List; | |
interface Resource { | |
String info(); | |
} | |
class Room implements Resource { | |
private String id; | |
private int capacity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct { | |
char* id; | |
int capacity; | |
} Room; | |
typedef struct { | |
char* fullname; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Cons { | |
value: i32, | |
} | |
struct AddExpr<T> { | |
lhs: Box<dyn Accept<T>>, | |
rhs: Box<dyn Accept<T>> | |
} | |
trait Accept<T> { | |
fn accept(&self, v: &dyn Visitor<Result = T>) -> T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Foo{ value: u32 } | |
struct Bar{ value: u32 } | |
trait Base<T> { | |
fn accept(&self, v: &dyn Visitor<Result = T>) -> T ; | |
} | |
impl <T>Base<T> for Foo { | |
fn accept(&self, v: &dyn Visitor<Result = T>) -> T { | |
v.visit_foo(&self) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Testable[T,R] { | |
def test(t: T, s: String): R | |
} | |
object Testable { | |
def apply[T,R](implicit testable: Testable[T,R]): Testable[T,R] = testable | |
implicit class Ops[T,R](t: T)(implicit testable: Testable[T,R]) { | |
def test(s: String): R = Testable[T,R].test(t, s) | |
} | |
implicit val stringCan: Testable[String,String] = (s1,s2) => s1 + s2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.*; | |
public class App { | |
// JDBC driver name and database URL | |
static final String driver = "com.mysql.cj.jdbc.Driver"; | |
static final String dbUrl = "jdbc:mysql://ip_address:3306/databasename"; | |
// Database credentials | |
static final String user = "user"; | |
static final String pass = "pass"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
Options Indexes FollowSymLinks | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.html$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.html [L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.1.2-apache | |
RUN docker-php-ext-install mysqli |
NewerOlder