Skip to content

Instantly share code, notes, and snippets.

Avatar

Tuğberk Çelik tcelik

View GitHub Profile
@tcelik
tcelik / App.java
Created Apr 17, 2019
Mülakat Soruları İçin Template
View App.java
class App {
public static void main(String[] args)
{
}
}
class ProblemX {
@tcelik
tcelik / App.java
Created Apr 17, 2019
Argela Mülakatı Deneyimi
View App.java
package com.argela.sampleapp.app;
/*
Program: Write all occurences, how many each character in given string?
Sample Case
---
Input : "Araba"
Output: A:1
View gist:4f7ba7e02904e6b701e61e35f5db7789
javac -classpath libs/json-20180813.jar App.java
javac -cp libs/json-20180813.jar App.java
@tcelik
tcelik / App.java
Created Apr 16, 2019
Lambda İle String Operation - Java8 ile derle, çalıştır. Paketi yok doğrudan javac App.java, java App
View App.java
public class App {
public static void main(String[] args)
{
Utils.run(new java.util.HashMap<Character, Integer>());
}
}
class Utils {
public static java.util.HashMap<Character, Integer> run(java.util.HashMap<Character, Integer> hm)
{
@tcelik
tcelik / CharacterOccurences.java
Last active Apr 15, 2019
Mülakat sorusu olarak soruldu. Geleneksel Yöntem, Collection Yöntem, Lambda Yöntemi.
View CharacterOccurences.java
class StringUtil {
// "baba" a:2, b:2 tane var gibi mesela.
public static HashMap<Character, Integer> countOccurencesWithHashMapWay(String str)
{
char [] strArray = str.toCharArray();
HashMap<Character, Integer> hm = new HashMap<>();
for (char ch : strArray)
if (hm.containsKey(ch))
@tcelik
tcelik / mongodriver.java
Created Apr 12, 2019
MongoDB ATLAS Connection
View mongodriver.java
MongoClientURI uri = new MongoClientURI(
"mongodb+srv://tugberk:<pass>@couples-list-chvsn.mongodb.net/test?retryWrites=true");
MongoClient mongoClient = new MongoClient(uri);
MongoDatabase database = mongoClient.getDatabase("wishdb");
for (var document : database.getCollection("wishs").find())
System.out.println(document.get("todo"));
View Terminal.java
package org.csystem.cmdpromptapp.app;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.function.Consumer;
public class Terminal {
public static void main(String[] args)
{
@tcelik
tcelik / örnek.java
Created Feb 8, 2019
Builder Design Pattern Sample
View örnek.java
package org.csystem.builderapp.app;
import java.util.Iterator;
public class App {
public static void main(String[] args)
{
System.out.println("hello");
@tcelik
tcelik / App.java
Last active Feb 8, 2019
İdesiz Java Kullanımı
View App.java
package app;
import org.json.JSONObject;
public class App {
public static void main(String[] args)
{
System.out.println("hello");