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 'package:hive_flutter/adapters.dart'; | |
import 'package:turing_machines/models/Behaviour.dart'; | |
import 'package:turing_machines/models/Configuration.dart'; | |
import 'package:turing_machines/models/Tape.dart'; | |
import 'package:turing_machines/models/TuringMachines.dart'; | |
part "TuringMachineModel.g.dart"; | |
@HiveType(typeId: 0) | |
class TuringMachineModel { | |
@HiveField(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
package compiler_design; | |
import java.util.*; | |
public class FirstAndFollow { | |
public static void main(String[] args) | |
{ | |
System.out.println("Input number of production rules"); | |
Scanner reader=new Scanner(System.in); | |
int count=Integer.parseInt(reader.nextLine()); | |
LinkedHashMap<String,String[]> table=new LinkedHashMap<>(); | |
for(int i=0;i<count;++i) { |
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 java.util.*; | |
public class CodeGenerationForIf { | |
public static void main(String[] args) { | |
// Example input: if (x > 5) { y = x * 2; } | |
String condition = "x>8"; | |
String action = "y = y / 10;"; | |
// Generate code for the if statement | |
String generatedCode = generateIfCode(condition, action); | |
System.out.println("Generated code for if:"); |
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
// ignore: file_names | |
import 'package:flutter/material.dart'; | |
import 'package:turing_machines/exceptions/ActionParserException.dart'; | |
//Represents an Action which can be performed on the tape of a turing machine. | |
class Actions { | |
String symbol; | |
ActionType type; | |
Actions({required this.type, this.symbol = ""}); | |
//Parses a String containing actions, seperated by a ,(comma) |
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 java.util.*; | |
public class PostFix { | |
public static void main(String[] args) { | |
System.out.println("Input Postix Expression"); |
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
oh-my-posh --init --shell pwsh --config ~/AppData/Local/Programs/oh-my-posh/themes/jandedobbeleer.omp.json | Invoke-Expression | |
function personal { | |
Set-Location -Path C:\PROJECTS\personal | |
} | |
function openPersonal { | |
$directoryPath = 'C:\PROJECTS\personal' | |
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 static int[] minMax(TicTacToeMin obj) | |
{ | |
ArrayList<Integer> scores=new ArrayList<>(0); | |
ArrayList<TicTacToeMin> arrs=obj.simulate(); | |
ArrayList<Integer> moves=obj.emptySpaces(); | |
//return a list of cloned boards with current token fitted into all empty spaces. | |
if(arrs.size()==0) | |
{ | |
return new int[] {0,-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
package experiments; | |
import java.util.*; | |
class TreeNode<T>{ | |
public ArrayList<TreeNode<T>> children;//can be empty | |
//NEVER PASS NULL to this parameter. | |
T value; | |
public TreeNode(T value, ArrayList<TreeNode<T>> children) | |
{ | |
this.value=value; | |
this.children=children; |
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
#include <iostream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
int main() | |
{ | |
int n; | |
cout<<"\nEnter number of non terminals: "; | |
cin>>n; | |
cout<<"\nEnter non terminals one by one: "; |
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
//Creates the body for the login page | |
Widget constructBody() { | |
return SingleChildScrollView( | |
child: Container( | |
color: Colors.white, | |
child: Column( | |
children: [ | |
SizedBox( | |
height: MediaQuery.of(context).size.height * 0.1, | |
), |
NewerOlder