Edit: This list is now maintained in the rust-anthology repo.
This file contains hidden or 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.awt.*; | |
import java.awt.image.BufferedImage; | |
public class ConvolutionFilter { | |
public static int[][][] rgbToGray(int[][][] image) { | |
int w = image.length; | |
int h = image[0].length; |
This file contains hidden or 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 javax.imageio.ImageIO; | |
import javax.swing.*; | |
import javax.swing.event.ChangeEvent; | |
import javax.swing.event.ChangeListener; | |
import javax.swing.filechooser.FileNameExtensionFilter; | |
import java.awt.*; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.image.BufferedImage; |
This file contains hidden or 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 javax.imageio.ImageIO; | |
import javax.swing.*; | |
import javax.swing.border.EmptyBorder; | |
import javax.swing.filechooser.FileNameExtensionFilter; | |
import java.awt.*; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.image.BufferedImage; | |
import java.io.File; | |
import java.io.IOException; |
This file contains hidden or 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
cmake_minimum_required(VERSION 3.14) | |
project(cppproje) | |
find_package(OpenGL REQUIRED) | |
find_package(GLUT REQUIRED) | |
find_package(SDL2 REQUIRED) | |
include_directories(${SDL2_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ) | |
set(CMAKE_CXX_STANDARD 17) |
This file contains hidden or 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
class Prime | |
{ | |
static bool IsPrime(int num) | |
{ | |
int to = (int)Math.Round(Math.Sqrt(num)); | |
return !Enumerable.Range(2, to).Any(i => num % i == 0); | |
} | |
public static IEnumerable<int> GetPrimes(int count) | |
{ | |
int current = 2; |
This file contains hidden or 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 math | |
#verilen aralığa kadar asal sayıları bul ve liste olarak geri döndür find_primes(100) | |
find_primes = lambda j: list(filter(lambda x: not any([i for i in range(2, int(round(math.sqrt(x))) + 1) if x % i == 0]), list(range(2, j + 1)))) | |
#fibonacci jeneratörü | |
def fibonacci(to): | |
a, b = 1, 1 | |
count = 1 | |
while (count < to): |
This file contains hidden or 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 <iostream> | |
using namespace std; | |
int main() { | |
int* a; | |
int* b; | |
int c=12; | |
a=&c; |
This file contains hidden or 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
Type type = this.getClass().getGenericSuperclass(); | |
ParameterizedType pt = (ParameterizedType) type; | |
Class c = (Class)pt.getActualTypeArguments()[0]; | |
System.out.println(c.getSimpleName()); |
This file contains hidden or 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 django.contrib.auth.decorators import user_passes_test | |
from django.contrib.auth import REDIRECT_FIELD_NAME | |
from django.core.exceptions import PermissionDenied | |
def has_any_role(roles, login_url=None, raise_exception=False): | |
def check_role(user): | |
if isinstance(roles, list): | |
perms = roles |