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
| def trans(m): | |
| numRows = len(m) | |
| numCols = len(m[0]) | |
| tMatrix = [[0 for x in range(numRows)] for y in range(numCols)] | |
| for i in range(0,numCols): | |
| for j in range(0,numRows): | |
| tMatrix[i][j] = m[j][i] | |
| return tMatrix | |
| print(trans([[1,3,5],[2,4,6]])) |
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
| . - Any Character Except New Line | |
| \d - Digit (0-9) | |
| \D - Not a Digit (0-9) | |
| \w - Word Character (a-z, A-Z, 0-9, _) | |
| \W - Not a Word Character | |
| \s - Whitespace (space, tab, newline) | |
| \S - Not Whitespace (space, tab, newline) | |
| \b - Word Boundary |
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
| <androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| android:id="@+id/bottom_sheet" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:orientation="vertical" | |
| app:behavior_hideable="true" | |
| app:behavior_peekHeight="0dp" | |
| app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior" |
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
| <!--In style.xml --> | |
| <style name="CustomDialog" parent="Theme.AppCompat.Light.Dialog.Alert"> | |
| <item name="colorAccent">@color/accent_color</item> | |
| <item name="android:windowMinWidthMajor">@dimen/dialog_min_width_major</item> | |
| <item name="android:windowMinWidthMinor">@dimen/dialog_min_width_minor</item> | |
| <item name="android:windowBackground">@color/transparent</item> | |
| </style> | |
| <!--In dimesn.xml --> |
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
| class Single private constructor(){ | |
| companion object{ | |
| @Volatile private var instance: Single? = null | |
| fun getInstance() = instance?: synchronized(lock=this){ | |
| instance?: Single().also{ | |
| instance = it | |
| } | |
| } | |
| } |
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
| if(Date().after(date)){ | |
| TODO("Has to complted before : $date") | |
| } |
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
| fun SAFE_TODO(reason:String){ | |
| if (BuildConfig.DEBUG) { | |
| TODO(reason) | |
| }else{ | |
| Toast.makeText(context,"NOT_IMPLEMENYTED:$reason",Toast.LENGTH_SHORT).show() | |
| } | |
| } |
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
| onClick(view:view) = when(view.id){ | |
| R.id.button_action1->actionOneClicked() | |
| R.id.button_action2->actionTwoClicked() | |
| R.id.button_action3->TODO("action 3 is work in progress!") | |
| } |
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
| { "compilerOptions": { | |
| /* Basic Options */ | |
| "target": "es2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ | |
| "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ | |
| // "lib": [], /* Specify library files to be included in the compilation. */ | |
| // "allowJs": true, /* Allow javascript files to be compiled. */ | |
| // "checkJs": true, /* Report errors in .js files. */ | |
| // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ | |
| // "declaration": true, /* Generates corresponding '.d.ts' file. */ | |
| // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ |
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
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1", | |
| "start": "ts-node src/config/server.ts", | |
| "dev": "nodemon -x ts-node src/config/server.ts" | |
| }, |
OlderNewer