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 django.http import HttpResponseRedirect | |
from django.core.exceptions import PermissionDenied | |
from django.urls import reverse | |
from django.shortcuts import render | |
from django.shortcuts import redirect | |
def role_required(allowed_roles=[]): | |
def decorator(view_func): | |
def wrap(request, *args, **kwargs): |
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.Scanner; | |
public class JavaConsoleLogin { | |
public static void main(String[] args){ | |
Scanner input = new Scanner(System.in); | |
System.out.print("Kullanıcı Adı: "); | |
String username= input.nextLine(); | |
System.out.print("Şifre: "); | |
String password= input.nextLine(); | |
System.out.println("Kullanıcı adı: " + username); |
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
public class DoWhileExample { | |
public static void main(String[] args) { | |
int toplam=0; | |
int i=0; | |
do{ | |
if(i%2==0){ | |
toplam+=i; | |
} | |
i++; | |
}while(i<=10); |
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.Scanner; | |
public class WhileExample { | |
public static void main(String[] args) { | |
int toplam=0; | |
System.out.println("Lütfen 5 sayi giriniz: "); | |
Scanner s=new Scanner(System.in); | |
int i=1; | |
while (i<6) { | |
System.out.println(i+". sayiyi giriniz: "); | |
int sayi=s.nextInt(); |
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
public class ForExample { | |
public static void main(String[] args) { | |
for (int i = 0; i < 10; i++) { | |
for (int j = 0; j < 10; j++) { | |
System.out.println(i + "*" + j + " = " + i * j); | |
} | |
System.out.println(); | |
} | |
} | |
} |
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.Scanner; | |
public class ScannerExample_1 { | |
public static void main(String args []){ | |
Scanner input= new Scanner(System.in); | |
System.out.print("Lütfen mesaj giriniz: "); | |
String mesaj = input.nextLine(); | |
System.out.println("Girilen mesaj: " + mesaj); | |
} | |
} |
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
public class SwitchCaseExample_1 { | |
public static void main(String[] args) { | |
//Secilen ay degeri | |
int ayDegeri = 7; | |
//Yazdirilacak ay degeri | |
String ayDegeriStr = null; | |
//switch - case ile hanig ayın hangi sayıya denk geldiginin belirtildigi bolum | |
switch (ayDegeri) { | |
case 1: | |
ayDegeriStr = "Ocak"; |
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
public class uygulama7 { | |
public static void main(String[] args){ | |
String yazi= "Merhaba canokay"; | |
String [] yazilar = yazi.split(" "); | |
System.out.println(yazilar[0]); | |
System.out.println(yazilar[1]); | |
} | |
} |
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
public class EqualsExample { | |
public static void main(String[] args){ | |
String yazi = "Merhaba Can Okay"; | |
Boolean durum1= yazi.equals("Merhaba Can Okay"); // true | |
System.out.println(durum1); | |
Boolean durum2 = yazi.equals("merhaba can okay"); //false | |
System.out.println(durum2); | |
Boolean durum3 = yazi.equalsIgnoreCase("merhaba can okay");//true | |
System.out.println(durum3); | |
} |
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
public class ReplaceExample { | |
public static void main(String[] args){ | |
String yazi= "merhaba dünya"; | |
System.out.println(yazi.replace("r","s")); | |
System.out.println(yazi.replace("merhaba","hello")); | |
} | |
} |