Skip to content

Instantly share code, notes, and snippets.

View egek92's full-sized avatar
🔵

Ege Kuzubasioglu egek92

🔵
View GitHub Profile
##General
Find the most frequent integer in an array
Find pairs in an integer array whose sum is equal to 10 (bonus: do it in linear time)
Given 2 integer arrays, determine of the 2nd array is a rotated version of the 1st array. Ex. Original Array A={1,2,3,5,6,7,8} Rotated Array B={5,6,7,8,1,2,3}
Write fibbonaci iteratively and recursively (bonus: use dynamic programming)
Find the only element in an array that only occurs once.
Find the common elements of 2 int arrays
Implement binary search of a sorted array of integers
Implement binary search in a rotated array (ex. {5,6,7,8,1,2,3})
Use dynamic programming to find the first X prime numbers
String key = "e8ffc7e56311679f12b6fc91aa77a5eb"; // 32 bytes key
byte[] keyBytes = key.getBytes("UTF-8");
ivBytes = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; //IV
@egek92
egek92 / WrapContentHeightViewPager.java
Created April 5, 2018 10:47 — forked from egslava/WrapContentHeightViewPager.java
Wrap content height ViewPager (Android)
package org.cnii.layoutloader.ui;
import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;
/**
* Special thanks to Daniel López Lacalle for his response
* (http://stackoverflow.com/questions/8394681/android-i-am-unable-to-have-viewpager-wrap-content/20784791#20784791)
@egek92
egek92 / gist:2fb83dc704ca6baab1cfebfd64cb1432
Created April 30, 2018 21:03 — forked from in28minutes/gist:b6d9e5737bf0a3c657188e36287eb6b7
Kotlin Programming Language Cheat Sheet Part 1

Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

from selenium import webdriver
driver = webdriver.Firefox(); //Chrome()
driver.get("https://www.panparella.com/group")
goztepeOne = driver.find_element_by_link_text("Göztepe")
goztepeOne.click()
EgeApps built the More or Less app as an Ad Supported app. This SERVICE is provided by EgeApps at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at More or Less unless otherwise defined in this Privacy Policy.
EgeApps built the Power Nap app as an Ad Supported app. This SERVICE is provided by EgeApps at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at More or Less unless otherwise defined in this Privacy Policy.
Information Collection and Use
class HotelRepositoryImpl() :
HotelRepository {
val apiService = ApiService()
override fun getHotels(page: Int): Single<HotelsListResponse> {
return apiService.getHotels(page = page)
}
}
implementation "com.google.dagger:dagger:${daggerVersion}"
kapt "com.google.dagger:dagger-compiler:${daggerVersion}"
implementation "com.google.dagger:dagger-android:${daggerVersion}"
implementation "com.google.dagger:dagger-android-support:${daggerVersion}"
kapt "com.google.dagger:dagger-android-processor:${daggerVersion}"