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 DiceFaceCubit extends Cubit<int?> { | |
| DiceFaceCubit(): super(null); | |
| void rollDice() { | |
| emit(Random().nextInt(6) + 1); | |
| } | |
| } | |
| class MyApp extends StatelessWidget { | |
| const MyApp({Key? key}): super(key: key); |
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
| function GRADE(los, plos = null, prevGrade = null) { | |
| if (prevGrade && prevGrade == 'P') { | |
| return 'P'; | |
| } | |
| if (los.length > 1) { | |
| throw 'Invalid range for LOs' | |
| } | |
| los = los[0]; |
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
| function BINARIZE(dec, len) | |
| { | |
| if (isNaN(len) || len <= 0) { | |
| throw new Error("Invalid length. Should be a number > 0"); | |
| } | |
| if (dec < 0) { | |
| dec = Math.pow(2, len) - -dec; | |
| } |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Text.Json; // Install this by using NuGet package manager | |
| namespace SerialisationDemo | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |
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
| using System; | |
| using System.Diagnostics; | |
| class LinkedListDemo { | |
| static void Main(string[] args) { | |
| LinkedList myList = new LinkedList(); | |
| foreach(string arg in args){ | |
| int val = 0; | |
| bool success = Int32.TryParse(arg, out val); |
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
| interface IStack { | |
| void Push(int value); | |
| int Pop(); | |
| int Peek(); | |
| bool IsFull(); | |
| bool IsEmpty(); | |
| } |
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
| <h2>2001</h2> | |
| <p>A Space Odyssey</p> | |
| <h2>1990</h2> | |
| <p>1990-1</p> | |
| <p>1990-2</p> | |