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
def is_palindrome(number): | |
temp = number | |
reverse = 0 | |
while temp > 0: | |
rem = temp % 10 | |
reverse = (reverse * 10) + rem | |
temp = temp // 10 | |
return number == reverse |
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 random | |
def main(): | |
# tentukan angka misteri | |
misteri = random.randint(1, 100) | |
tebakan = 0 | |
counter = 0 | |
while misteri != tebakan: | |
counter += 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
def terbilang_ratusan(uang): | |
uang_terbilang = { | |
1: 'satu', | |
2: 'dua', | |
3: 'tiga', | |
4: 'empat', | |
5: 'lima', | |
6: 'enam', | |
7: 'tujuh', | |
8: 'delapan', |
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 time | |
import logging | |
from daemonize import Daemonize | |
pid = "/tmp/test.pid" | |
logger = logging.getLogger(__name__) | |
logger.setLevel(logging.DEBUG) | |
logger.propagate = False | |
fh = logging.FileHandler("/tmp/test.log", "w") | |
fh.setLevel(logging.DEBUG) |
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
<?php | |
namespace app\components; | |
class ActiveRecord extends \yii\db\ActiveRecord { | |
public function saveRelatedModel($modelClass, $data, $relatedPk, $removable=TRUE) { | |
$pk = static::primaryKey()[0]; | |
$modelPk = call_user_func([$modelClass, 'primaryKey'])[0]; |
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 os | |
import cv2 | |
import numpy as np | |
class FaceRecognition(object): | |
pca = None | |
u = None | |
weight = None | |
training_image_filenames = [] |
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
display: box; or inline-box; | |
-moz-box-align | |
-moz-box-direction | |
-moz-box-ordinal-group | |
-moz-box-orient | |
-moz-box-pack | |
-moz-box-sizing |
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
<div class="v-center"> | |
<div class="inner"> | |
Centered Horizontally and Vertically | |
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=120%C3%9770&w=120&h=70"> | |
</div> | |
</div> |
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
<div class="wrapper"> | |
<div class="v-center"> | |
<div class="inner"> | |
Centered Horizontally and Vertically Sayang opo kowe krungu jerite atiku mengharap kau kembali sayang nganti memutih rambutku ra bakal luntur tresnaku<br> | |
<img src="https://placeholdit.imgix.net/~text?txtsize=33&txt=120%C3%9770&w=120&h=70"> | |
</div> | |
</div> | |
</div> |
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
.flex_display { | |
display: -webkit-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
// When Twitter Bootstrap's hidden is applied to the same element, make sure | |
// display is set to none. | |
&.hidden { | |
display: none; |
NewerOlder