This file contains hidden or 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
| data class Category( | |
| val id: Int, | |
| val items: List<Item>, | |
| val name: String | |
| ) | |
| @Entity | |
| data class Item( | |
| val icon: String, | |
| @PrimaryKey |
This file contains hidden or 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
| @SuppressLint("UnusedMaterial3ScaffoldPaddingParameter") | |
| @Composable | |
| fun NotesScreen( | |
| navController: NavController, | |
| context: Context, | |
| ) { | |
| Scaffold( | |
| floatingActionButton = { FloatingButtonScaffold(navController = navController) }, | |
| content = { | |
| ContentPartScaffold(navController = navController, context = context) |
This file contains hidden or 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
| @Composable | |
| fun DeleteConfirmationDialog( | |
| onDeleteConfirm: () -> Unit, | |
| onDeleteCancel: () -> Unit, | |
| modifier: Modifier = Modifier, | |
| viewModel: DetailsScreenViewModel = hiltViewModel() | |
| ) { | |
| val uiState by viewModel.uiState.collectAsState() | |
| AlertDialog( |
This file contains hidden or 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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| void findAnagrams(string &str, vector<string>&ans, vector<string>&dictionary){ | |
| string key = str; | |
| sort(key.begin(),key.end()); | |
| for(auto word : dictionary){ | |
| string current = word; | |
| sort(current.begin(),current.end()); |
This file contains hidden or 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
| #include <bits/stdc++.h> | |
| using namespace std; | |
| void permute(string& str, int currentIndex, int len, vector<string>&anagrams, unordered_map<string,int>&dictionary) | |
| { | |
| if (currentIndex == len) | |
| { | |
| if(dictionary[str] == 1) | |
| { | |
| anagrams.push_back(str); |
This file contains hidden or 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
| abstract class Person(name: String) { | |
| init { | |
| println("My name is $name.") | |
| } | |
| fun displayAge(age: Int) { | |
| println("My Age is $age.") | |
| } |
This file contains hidden or 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
| @Composable | |
| fun QuadLineChart( | |
| data: List<Pair<Int, Double>>, | |
| ) { | |
| val spacing = 100f | |
| val columnTextColor = MaterialTheme.colorScheme.onSurface.toArgb() | |
| val upperValue = remember(key1 = data) { | |
| (data.maxOfOrNull { it.second }?.plus(1))?.roundToInt() ?: 0 | |
| } | |
| val lowerValue = remember(key1 = data) { (data.minOfOrNull { it.second }?.toInt() ?: 0) } |