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
# -*- coding: utf-8 -*- | |
morse_alphabet = { | |
"А" : ".-", | |
"Б" : "-...", | |
"В" : ".--", | |
"Г" : "--.", | |
"Д" : "-..", | |
"Е" : ".", | |
"Ж" : "...-", |
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 MinAndIndex { | |
public static void main(String[] args) throws Exception { | |
int[] data = new int[]{1, 2, 3, 5, -2, -8, 0, 77, 5, 5}; | |
Pair<Integer, Integer> result = getMinimumAndIndex(data); | |
System.out.println("Minimum is " + result.x); | |
System.out.println("Index of minimum element is " + result.y);} | |
public static Pair<Integer, Integer> getMinimumAndIndex(int[] array) { | |
if (array == null || array.length == 0) { | |
return new Pair<Integer, Integer>(null, null);} |
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
; incboot.s | |
; Incrementally build a boot block for x86 | |
; I'm going to keep adding bits to this one step at a time from | |
; boot-and hang to hopefully loading a kernel | |
; Here we go. | |
; We're implementing a FAT12 file system for the boot disk. This file system is well | |
; documented so it shouldn't be a hard ask for a first-timer like me. | |
; There is a certain order required for the metadata appearing at the top of the | |
; boot block below the jump to start, we'll introduce each as we go. |