TYPO3 Errors in setup file - typo3

I'm creating a small website after working with the extension builder. I had to create a page based on categories. So while checking my php files I have errors in my TypoScript file. I have attached the files and errors.
I'm finding some problem in TYPO3 getting several errors in setup.ts file.
My TypoScript
plugin.tx_oldglodapplication_information {
view {
templateRootPaths.0 = EXT:oldglod_application/Resources/Private/Templates/
templateRootPaths.1 = {$plugin.tx_oldglodapplication_information.view.templateRootPath}
partialRootPaths.0 = EXT:oldglod_application/Resources/Private/Partials/
partialRootPaths.1 = {$plugin.tx_oldglodapplication_information.view.partialRootPath}
layoutRootPaths.0 = EXT:oldglod_application/Resources/Private/Layouts/
layoutRootPaths.1 = {$plugin.tx_oldglodapplication_information.view.layoutRootPath}
}
persistence {
storagePid = {$plugin.tx_oldglodapplication_information.persistence.storagePid}
}
features {
# if set to 1, the enable fields are ignored in BE context
ignoreAllEnableFieldsInBe = 0
# Should be on by default, but can be disabled if all action in the plugin are uncached
requireCHashArgumentForActionArguments = 1
}
}
 
plugin.tx_oldglodapplication_management {
view {
templateRootPaths.0 = EXT:oldglod_application/Resources/Private/Templates/
templateRootPaths.1 = {$plugin.tx_oldglodapplication_management.view.templateRootPath}
partialRootPaths.0 = EXT:oldglod_application/Resources/Private/Partials/
partialRootPaths.1 = {$plugin.tx_oldglodapplication_management.view.partialRootPath}
layoutRootPaths.0 = EXT:oldglod_application/Resources/Private/Layouts/
layoutRootPaths.1 = {$plugin.tx_oldglodapplication_management.view.layoutRootPath}
}
persistence {
storagePid = {$plugin.tx_oldglodapplication_management.persistence.storagePid}
}
features {
# if set to 1, the enable fields are ignored in BE context
ignoreAllEnableFieldsInBe = 0
# Should be on by default, but can be disabled if all action in the plugin are uncached
requireCHashArgumentForActionArguments = 1
}
}
 
plugin.tx_oldglodapplication_administration {
view {
templateRootPaths.0 = EXT:oldglod_application/Resources/Private/Templates/
templateRootPaths.1 = {$plugin.tx_oldglodapplication_administration.view.templateRootPath}
partialRootPaths.0 = EXT:oldglod_application/Resources/Private/Partials/
partialRootPaths.1 = {$plugin.tx_oldglodapplication_administration.view.partialRootPath}
layoutRootPaths.0 = EXT:oldglod_application/Resources/Private/Layouts/
layoutRootPaths.1 = {$plugin.tx_oldglodapplication_administration.view.layoutRootPath}
}
persistence {
storagePid = {$plugin.tx_oldglodapplication_administration.persistence.storagePid}
}
features {
# if set to 1, the enable fields are ignored in BE context
ignoreAllEnableFieldsInBe = 0
# Should be on by default, but can be disabled if all action in the plugin are uncached
requireCHashArgumentForActionArguments = 1
}
}
These are the errors and as I feel everything is fine.
Error:(1, 42) TS1005:';' expected.
Error:(2, 10) TS1005:';' expected.
Error:(3, 26) TS1005:';' expected.
Error:(3, 34) TS1005:';' expected.
Error:(4, 26) TS1005:';' expected.
Error:(4, 39) TS1005:':' expected.
Error:(5, 25) TS1005:';' expected.
Error:(5, 33) TS1005:';' expected.
Error:(6, 25) TS1005:';' expected.
Error:(6, 38) TS1005:':' expected.
Error:(7, 24) TS1005:';' expected.
Error:(7, 32) TS1005:';' expected.
Error:(8, 24) TS1005:';' expected.
Error:(8, 37) TS1005:':' expected.
Error:(10, 17) TS1005:';' expected.
Error:(11, 30) TS1005:':' expected.
Error:(12, 5) TS1127:Invalid character.
Error:(14, 14) TS1005:';' expected.
Error:(15, 5) TS1127:Invalid character.
Error:(16, 9) TS1127:Invalid character.
Error:(16, 14) TS1005:'(' expected.
Error:(16, 18) TS1005:')' expected.
Error:(16, 21) TS1005:';' expected.
Error:(16, 28) TS1005:';' expected.
Error:(16, 35) TS1005:';' expected.
Error:(16, 42) TS1005:';' expected.
Error:(16, 46) TS1005:';' expected.
Error:(16, 60) TS1005:';' expected.
Error:(18, 9) TS1127:Invalid character.
Error:(18, 18) TS1005:';' expected.
Error:(18, 21) TS1005:';' expected.
Error:(18, 24) TS1005:';' expected.
Error:(18, 27) TS1005:';' expected.
Error:(18, 34) TS1128:Declaration or statement expected.
Error:(18, 40) TS1005:';' expected.
Error:(18, 44) TS1005:';' expected.
Error:(18, 47) TS1005:';' expected.
Error:(18, 56) TS1005:';' expected.
Error:(18, 59) TS1005:'(' expected.
Error:(18, 63) TS1005:')' expected.
Error:(18, 77) TS1005:';' expected.
Error:(18, 84) TS1005:';' expected.
Error:(18, 88) TS1005:';' expected.
Error:(21, 9) TS1005:';' expected.
Error:(22, 5) TS1127:Invalid character.
Error:(26, 41) TS1005:';' expected.
Error:(27, 10) TS1005:';' expected.
Error:(28, 26) TS1005:';' expected.
Error:(28, 34) TS1005:';' expected.
Error:(29, 26) TS1005:';' expected.
Error:(29, 39) TS1005:':' expected.
Error:(30, 25) TS1005:';' expected.
Error:(30, 33) TS1005:';' expected.
Error:(31, 25) TS1005:';' expected.
Error:(31, 38) TS1005:':' expected.
Error:(32, 24) TS1005:';' expected.
Error:(32, 32) TS1005:';' expected.
Error:(33, 24) TS1005:';' expected.
Error:(33, 37) TS1005:':' expected.
Error:(35, 17) TS1005:';' expected.
Error:(36, 30) TS1005:':' expected.
Error:(37, 5) TS1127:Invalid character.
Error:(39, 14) TS1005:';' expected.
Error:(40, 5) TS1127:Invalid character.
Error:(41, 9) TS1127:Invalid character.
Error:(41, 14) TS1005:'(' expected.
Error:(41, 18) TS1005:')' expected.
Error:(41, 21) TS1005:';' expected.
Error:(41, 28) TS1005:';' expected.
Error:(41, 35) TS1005:';' expected.
Error:(41, 42) TS1005:';' expected.
Error:(41, 46) TS1005:';' expected.
Error:(41, 60) TS1005:';' expected.
Error:(43, 9) TS1127:Invalid character.
Error:(43, 18) TS1005:';' expected.
Error:(43, 21) TS1005:';' expected.
Error:(43, 24) TS1005:';' expected.
Error:(43, 27) TS1005:';' expected.
Error:(43, 34) TS1128:Declaration or statement expected.
Error:(43, 40) TS1005:';' expected.
Error:(43, 44) TS1005:';' expected.
Error:(43, 47) TS1005:';' expected.
Error:(43, 56) TS1005:';' expected.
Error:(43, 59) TS1005:'(' expected.
Error:(43, 63) TS1005:')' expected.
Error:(43, 77) TS1005:';' expected.
Error:(43, 84) TS1005:';' expected.
Error:(43, 88) TS1005:';' expected.
Error:(46, 9) TS1005:';' expected.
Error:(47, 5) TS1127:Invalid character.
Error:(51, 45) TS1005:';' expected.
Error:(52, 10) TS1005:';' expected.
Error:(53, 26) TS1005:';' expected.
Error:(53, 34) TS1005:';' expected.
Error:(54, 26) TS1005:';' expected.
Error:(54, 39) TS1005:':' expected.
Error:(55, 25) TS1005:';' expected.
Error:(55, 33) TS1005:';' expected.
Error:(56, 25) TS1005:';' expected.
Error:(56, 38) TS1005:':' expected.
Error:(57, 24) TS1005:';' expected.
Error:(57, 32) TS1005:';' expected.
Error:(58, 24) TS1005:';' expected.
Error:(58, 37) TS1005:':' expected.
Error:(60, 17) TS1005:';' expected.
Error:(61, 30) TS1005:':' expected.
Error:(62, 5) TS1127:Invalid character.
Error:(64, 14) TS1005:';' expected.
Error:(65, 5) TS1127:Invalid character.
Error:(66, 9) TS1127:Invalid character.
Error:(66, 14) TS1005:'(' expected.
Error:(66, 18) TS1005:')' expected.
Error:(66, 21) TS1005:';' expected.
Error:(66, 28) TS1005:';' expected.
Error:(66, 35) TS1005:';' expected.
Error:(66, 42) TS1005:';' expected.
Error:(66, 46) TS1005:';' expected.
Error:(66, 60) TS1005:';' expected.
Error:(68, 9) TS1127:Invalid character.
Error:(68, 18) TS1005:';' expected.
Error:(68, 21) TS1005:';' expected.
Error:(68, 24) TS1005:';' expected.
Error:(68, 27) TS1005:';' expected.
Error:(68, 34) TS1128:Declaration or statement expected.
Error:(68, 40) TS1005:';' expected.
Error:(68, 44) TS1005:';' expected.
Error:(68, 47) TS1005:';' expected.
Error:(68, 56) TS1005:';' expected.
Error:(68, 59) TS1005:'(' expected.
Error:(68, 63) TS1005:')' expected.
Error:(68, 77) TS1005:';' expected.
Error:(68, 84) TS1005:';' expected.
Error:(68, 88) TS1005:';' expected.
Error:(71, 9) TS1005:';' expected.
Error:(72, 5) TS1127:Invalid character.
Error:(76, 1) TS1127:Invalid character.
Error:(76, 9) TS1005:';' expected.
Error:(76, 17) TS1005:';' expected.
Error:(76, 21) TS1005:';' expected.
Error:(76, 26) TS1005:';' expected.
Error:(76, 49) TS1005:';' expected.
Error:(78, 28) TS1005:',' expected.
Error:(79, 15) TS1005:':' expected.
Error:(79, 21) TS1005:',' expected.
Error:(79, 22) TS1127:Invalid character.
Error:(79, 29) TS1005:':' expected.
Error:(80, 14) TS1005:',' expected.
Error:(80, 17) TS1127:Invalid character.
Error:(80, 25) TS1005:':' expected.
Error:(80, 30) TS1005:',' expected.
Error:(83, 1) TS1005:',' expected.
Error:(83, 21) TS1005:',' expected.
Error:(84, 15) TS1005:':' expected.
Error:(84, 21) TS1005:',' expected.
Error:(84, 22) TS1127:Invalid character.
Error:(84, 29) TS1005:':' expected.
Error:(85, 14) TS1005:',' expected.
Error:(85, 17) TS1127:Invalid character.
Error:(85, 25) TS1005:':' expected.
Error:(85, 30) TS1005:',' expected.
Error:(88, 25) TS1005:',' expected.
Error:(88, 31) TS1005:',' expected.
Error:(89, 11) TS1005:':' expected.
Error:(89, 20) TS1005:',' expected.
Error:(89, 29) TS1005:':' expected.
Error:(90, 11) TS1005:':' expected.
Error:(90, 19) TS1005:',' expected.
Error:(90, 22) TS1005:':' expected.
Error:(90, 24) TS1005:',' expected.
Error:(93, 25) TS1005:',' expected.
Error:(93, 31) TS1005:',' expected.
Error:(93, 34) TS1005:',' expected.
Error:(94, 9) TS1005:':' expected.
Error:(94, 16) TS1005:',' expected.
Error:(94, 21) TS1005:':' expected.
Error:(97, 25) TS1005:',' expected.
Error:(97, 31) TS1005:',' expected.
Error:(97, 34) TS1005:',' expected.
Error:(98, 13) TS1005:':' expected.
Error:(98, 19) TS1005:',' expected.
Error:(98, 23) TS1005:':' expected.
Error:(101, 32) TS1005:',' expected.
Error:(102, 14) TS1005:',' expected.
Error:(105, 29) TS1005:',' expected.
Error:(106, 16) TS1005:',' expected.
Error:(1, 1) TS2552:Cannot find name 'plugin'. Did you mean 'Plugin'?
Error:(2, 5) TS2304:Cannot find name 'view'.
Error:(3, 9) TS2304:Cannot find name 'templateRootPaths'.
Error:(3, 26) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(3, 31) TS2552:Cannot find name 'EXT'. Did you mean 'Text'?
Error:(3, 35) TS2304:Cannot find name 'oldglod_application'.
Error:(3, 55) TS2304:Cannot find name 'Resources'.
Error:(3, 65) TS2304:Cannot find name 'Private'.
Error:(3, 73) TS2304:Cannot find name 'Templates'.
Error:(4, 9) TS2304:Cannot find name 'templateRootPaths'.
Error:(4, 26) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(5, 9) TS2304:Cannot find name 'partialRootPaths'.
Error:(5, 25) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(5, 30) TS2304:Cannot find name 'EXT'.
Error:(5, 34) TS2304:Cannot find name 'oldglod_application'.
Error:(5, 54) TS2304:Cannot find name 'Resources'.
Error:(5, 64) TS2304:Cannot find name 'Private'.
Error:(5, 72) TS2304:Cannot find name 'Partials'.
Error:(6, 9) TS2304:Cannot find name 'partialRootPaths'.
Error:(6, 25) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(7, 9) TS2304:Cannot find name 'layoutRootPaths'.
Error:(7, 24) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(7, 29) TS2304:Cannot find name 'EXT'.
Error:(7, 33) TS2304:Cannot find name 'oldglod_application'.
Error:(7, 53) TS2304:Cannot find name 'Resources'.
Error:(7, 63) TS2304:Cannot find name 'Private'.
Error:(7, 71) TS2304:Cannot find name 'Layouts'.
Error:(8, 9) TS2304:Cannot find name 'layoutRootPaths'.
Error:(8, 24) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(10, 5) TS2304:Cannot find name 'persistence'.
Error:(11, 9) TS2304:Cannot find name 'storagePid'.
Error:(12, 6) TS2304:Cannot find name 'recursive'.
Error:(14, 5) TS2304:Cannot find name 'features'.
Error:(15, 6) TS2304:Cannot find name 'skipDefaultArguments'.
Error:(16, 14) TS2304:Cannot find name 'set'.
Error:(16, 18) TS2304:Cannot find name 'to'.
Error:(16, 21) TS2695:Left side of comma operator is unused and has no side effects.
Error:(16, 24) TS2304:Cannot find name 'the'.
Error:(16, 28) TS2304:Cannot find name 'enable'.
Error:(16, 35) TS2304:Cannot find name 'fields'.
Error:(16, 42) TS2304:Cannot find name 'are'.
Error:(16, 46) TS2304:Cannot find name 'ignored'.
Error:(16, 57) TS2304:Cannot find name 'BE'.
Error:(16, 60) TS2304:Cannot find name 'context'.
Error:(17, 9) TS2304:Cannot find name 'ignoreAllEnableFieldsInBe'.
Error:(18, 11) TS2304:Cannot find name 'Should'.
Error:(18, 18) TS2304:Cannot find name 'be'.
Error:(18, 21) TS2304:Cannot find name 'on'.
Error:(18, 24) TS2304:Cannot find name 'by'.
Error:(18, 36) TS2304:Cannot find name 'but'.
Error:(18, 40) TS2304:Cannot find name 'can'.
Error:(18, 44) TS2304:Cannot find name 'be'.
Error:(18, 47) TS2304:Cannot find name 'disabled'.
Error:(18, 59) TS2304:Cannot find name 'all'.
Error:(18, 63) TS2304:Cannot find name 'action'.
Error:(18, 73) TS2304:Cannot find name 'the'.
Error:(18, 77) TS2304:Cannot find name 'plugin'.
Error:(18, 84) TS2304:Cannot find name 'are'.
Error:(18, 88) TS2304:Cannot find name 'uncached'.
Error:(19, 9) TS2304:Cannot find name 'requireCHashArgumentForActionArguments'.
Error:(21, 5) TS2304:Cannot find name 'mvc'.
Error:(22, 6) TS2304:Cannot find name 'callDefaultActionIfActionCantBeResolved'.
Error:(26, 1) TS2304:Cannot find name 'plugin'.
Error:(27, 5) TS2304:Cannot find name 'view'.
Error:(28, 9) TS2304:Cannot find name 'templateRootPaths'.
Error:(28, 26) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(28, 31) TS2304:Cannot find name 'EXT'.
Error:(28, 35) TS2304:Cannot find name 'oldglod_application'.
Error:(28, 55) TS2304:Cannot find name 'Resources'.
Error:(28, 65) TS2304:Cannot find name 'Private'.
Error:(28, 73) TS2304:Cannot find name 'Templates'.
Error:(29, 9) TS2304:Cannot find name 'templateRootPaths'.
Error:(29, 26) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(30, 9) TS2304:Cannot find name 'partialRootPaths'.
Error:(30, 25) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(30, 30) TS2304:Cannot find name 'EXT'.
Error:(30, 34) TS2304:Cannot find name 'oldglod_application'.
Error:(30, 54) TS2304:Cannot find name 'Resources'.
Error:(30, 64) TS2304:Cannot find name 'Private'.
Error:(30, 72) TS2304:Cannot find name 'Partials'.
Error:(31, 9) TS2304:Cannot find name 'partialRootPaths'.
Error:(31, 25) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(32, 9) TS2304:Cannot find name 'layoutRootPaths'.
Error:(32, 24) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(32, 29) TS2304:Cannot find name 'EXT'.
Error:(32, 33) TS2304:Cannot find name 'oldglod_application'.
Error:(32, 53) TS2304:Cannot find name 'Resources'.
Error:(32, 63) TS2304:Cannot find name 'Private'.
Error:(32, 71) TS2304:Cannot find name 'Layouts'.
Error:(33, 9) TS2304:Cannot find name 'layoutRootPaths'.
Error:(33, 24) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(35, 5) TS2304:Cannot find name 'persistence'.
Error:(36, 9) TS2304:Cannot find name 'storagePid'.
Error:(37, 6) TS2304:Cannot find name 'recursive'.
Error:(39, 5) TS2304:Cannot find name 'features'.
Error:(40, 6) TS2304:Cannot find name 'skipDefaultArguments'.
Error:(41, 14) TS2304:Cannot find name 'set'.
Error:(41, 18) TS2304:Cannot find name 'to'.
Error:(41, 21) TS2695:Left side of comma operator is unused and has no side effects.
Error:(41, 24) TS2304:Cannot find name 'the'.
Error:(41, 28) TS2304:Cannot find name 'enable'.
Error:(41, 35) TS2304:Cannot find name 'fields'.
Error:(41, 42) TS2304:Cannot find name 'are'.
Error:(41, 46) TS2304:Cannot find name 'ignored'.
Error:(41, 57) TS2304:Cannot find name 'BE'.
Error:(41, 60) TS2304:Cannot find name 'context'.
Error:(42, 9) TS2304:Cannot find name 'ignoreAllEnableFieldsInBe'.
Error:(43, 11) TS2304:Cannot find name 'Should'.
Error:(43, 18) TS2304:Cannot find name 'be'.
Error:(43, 21) TS2304:Cannot find name 'on'.
Error:(43, 24) TS2304:Cannot find name 'by'.
Error:(43, 36) TS2304:Cannot find name 'but'.
Error:(43, 40) TS2304:Cannot find name 'can'.
Error:(43, 44) TS2304:Cannot find name 'be'.
Error:(43, 47) TS2304:Cannot find name 'disabled'.
Error:(43, 59) TS2304:Cannot find name 'all'.
Error:(43, 63) TS2304:Cannot find name 'action'.
Error:(43, 73) TS2304:Cannot find name 'the'.
Error:(43, 77) TS2304:Cannot find name 'plugin'.
Error:(43, 84) TS2304:Cannot find name 'are'.
Error:(43, 88) TS2304:Cannot find name 'uncached'.
Error:(44, 9) TS2304:Cannot find name 'requireCHashArgumentForActionArguments'.
Error:(46, 5) TS2304:Cannot find name 'mvc'.
Error:(47, 6) TS2304:Cannot find name 'callDefaultActionIfActionCantBeResolved'.
Error:(51, 1) TS2304:Cannot find name 'plugin'.
Error:(52, 5) TS2304:Cannot find name 'view'.
Error:(53, 9) TS2304:Cannot find name 'templateRootPaths'.
Error:(53, 26) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(53, 31) TS2304:Cannot find name 'EXT'.
Error:(53, 35) TS2304:Cannot find name 'oldglod_application'.
Error:(53, 55) TS2304:Cannot find name 'Resources'.
Error:(53, 65) TS2304:Cannot find name 'Private'.
Error:(53, 73) TS2304:Cannot find name 'Templates'.
Error:(54, 9) TS2304:Cannot find name 'templateRootPaths'.
Error:(54, 26) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(55, 9) TS2304:Cannot find name 'partialRootPaths'.
Error:(55, 25) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(55, 30) TS2304:Cannot find name 'EXT'.
Error:(55, 34) TS2304:Cannot find name 'oldglod_application'.
Error:(55, 54) TS2304:Cannot find name 'Resources'.
Error:(55, 64) TS2304:Cannot find name 'Private'.
Error:(55, 72) TS2304:Cannot find name 'Partials'.
Error:(56, 9) TS2304:Cannot find name 'partialRootPaths'.
Error:(56, 25) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(57, 9) TS2304:Cannot find name 'layoutRootPaths'.
Error:(57, 24) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(57, 29) TS2304:Cannot find name 'EXT'.
Error:(57, 33) TS2304:Cannot find name 'oldglod_application'.
Error:(57, 53) TS2304:Cannot find name 'Resources'.
Error:(57, 63) TS2304:Cannot find name 'Private'.
Error:(57, 71) TS2304:Cannot find name 'Layouts'.
Error:(58, 9) TS2304:Cannot find name 'layoutRootPaths'.
Error:(58, 24) TS2364:The left-hand side of an assignment expression must be a variable or a property access.
Error:(60, 5) TS2304:Cannot find name 'persistence'.
Error:(61, 9) TS2304:Cannot find name 'storagePid'.
Error:(62, 6) TS2304:Cannot find name 'recursive'.
Error:(64, 5) TS2304:Cannot find name 'features'.
Error:(65, 6) TS2304:Cannot find name 'skipDefaultArguments'.
Error:(66, 14) TS2304:Cannot find name 'set'.
Error:(66, 18) TS2304:Cannot find name 'to'.
Error:(66, 21) TS2695:Left side of comma operator is unused and has no side effects.
Error:(66, 24) TS2304:Cannot find name 'the'.
Error:(66, 28) TS2304:Cannot find name 'enable'.
Error:(66, 35) TS2304:Cannot find name 'fields'.
Error:(66, 42) TS2304:Cannot find name 'are'.
Error:(66, 46) TS2304:Cannot find name 'ignored'.
Error:(66, 57) TS2304:Cannot find name 'BE'.
Error:(66, 60) TS2304:Cannot find name 'context'.
Error:(67, 9) TS2304:Cannot find name 'ignoreAllEnableFieldsInBe'.
Error:(68, 11) TS2304:Cannot find name 'Should'.
Error:(68, 18) TS2304:Cannot find name 'be'.
Error:(68, 21) TS2304:Cannot find name 'on'.
Error:(68, 24) TS2304:Cannot find name 'by'.
Error:(68, 36) TS2304:Cannot find name 'but'.
Error:(68, 40) TS2304:Cannot find name 'can'.
Error:(68, 44) TS2304:Cannot find name 'be'.
Error:(68, 47) TS2304:Cannot find name 'disabled'.
Error:(68, 59) TS2304:Cannot find name 'all'.
Error:(68, 63) TS2304:Cannot find name 'action'.
Error:(68, 73) TS2304:Cannot find name 'the'.
Error:(68, 77) TS2304:Cannot find name 'plugin'.
Error:(68, 84) TS2304:Cannot find name 'are'.
Error:(68, 88) TS2304:Cannot find name 'uncached'.
Error:(69, 9) TS2304:Cannot find name 'requireCHashArgumentForActionArguments'.
Error:(71, 5) TS2304:Cannot find name 'mvc'.
Error:(72, 6) TS2304:Cannot find name 'callDefaultActionIfActionCantBeResolved'.
Error:(76, 3) TS2304:Cannot find name 'these'.
Error:(76, 9) TS2304:Cannot find name 'classes'.
Error:(76, 17) TS2304:Cannot find name 'are'.
Error:(76, 21) TS2304:Cannot find name 'only'.
Error:(76, 26) TS2304:Cannot find name 'used'.
Error:(76, 34) TS2304:Cannot find name 'auto'.
Error:(76, 34) TS2361:The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter.
Error:(76, 39) TS2304:Cannot find name 'generated'.
Error:(76, 49) TS2304:Cannot find name 'templates'.
Error:(77, 1) TS2304:Cannot find name 'plugin'.
Error:(78, 5) TS2304:Cannot find name 'textarea'.
Error:(78, 17) TS2304:Cannot find name 'form'.
Error:(78, 22) TS2304:Cannot find name 'error'.
Error:(79, 16) TS2304:Cannot find name 'color'.
Error:(80, 25) TS2304:Cannot find name 'solid'.
Error:(83, 1) TS2304:Cannot find name 'input'.
Error:(83, 10) TS2304:Cannot find name 'form'.
Error:(83, 15) TS2304:Cannot find name 'error'.
Error:(84, 16) TS2304:Cannot find name 'color'.
Error:(85, 25) TS2304:Cannot find name 'solid'.
Error:(88, 2) TS2339:Property 'tx' does not exist on type '{ background: number; FF9F9F: any; border: number; px: any; FF0000: any; }'.
Error:(88, 5) TS2304:Cannot find name 'oldglod'.
Error:(88, 13) TS2304:Cannot find name 'application'.
Error:(88, 25) TS2304:Cannot find name 'table'.
Error:(89, 12) TS2304:Cannot find name 'collapse'.
Error:(90, 12) TS2304:Cannot find name 'spacing'.
Error:(90, 22) TS2304:Cannot find name 'px'.
Error:(93, 2) TS2339:Property 'tx' does not exist on type '{ border: number; separate: any; 10: any; }'.
Error:(93, 5) TS2304:Cannot find name 'oldglod'.
Error:(93, 13) TS2304:Cannot find name 'application'.
Error:(93, 25) TS2304:Cannot find name 'table'.
Error:(93, 31) TS2304:Cannot find name 'th'.
Error:(94, 10) TS2304:Cannot find name 'weight'.
Error:(97, 2) TS2339:Property 'tx' does not exist on type '{ font: number; bold: any; }'.
Error:(97, 5) TS2304:Cannot find name 'oldglod'.
Error:(97, 13) TS2304:Cannot find name 'application'.
Error:(97, 25) TS2304:Cannot find name 'table'.
Error:(97, 31) TS2304:Cannot find name 'td'.
Error:(98, 14) TS2304:Cannot find name 'align'.
Error:(101, 2) TS2339:Property 'typo3' does not exist on type '{ vertical: number; top: any; }'.
Error:(101, 8) TS2304:Cannot find name 'messages'.
Error:(101, 26) TS2304:Cannot find name 'error'.
Error:(102, 11) TS2304:Cannot find name 'red'.
Error:(105, 2) TS2339:Property 'typo3' does not exist on type '{ color: any; }'.
Error:(105, 8) TS2304:Cannot find name 'messages'.
Error:(105, 26) TS2304:Cannot find name 'ok'.
Error:(106, 11) TS2304:Cannot find name 'green'.
Warning:Cannot find parent tsconfig.json

Related

Add type hints to function that accepts any iterable and returns zipped values

I have the following working code to solve Advent of Code 2021 day 1 (requires Python 3.10 due to itertools.pairwise), but I am stuck on how to correctly add type hints.
from itertools import pairwise, tee
from typing import Iterator, TypeVar, Tuple, Generator
_T_co = TypeVar("_T_co", covariant=True)
def tripletwise(iterable: Iterator[_T_co]) -> zip[Tuple[_T_co, _T_co, _T_co]]:
"""tripletwise('ABCDEFG') --> ABC BCD CDE DEF EFG"""
a, b, c = tee(iterable, 3)
next(b, None)
next(c, None)
next(c, None)
return zip(a, b, c)
def sonar_sweep(sea_floor_depths: Generator[int, None, None], part: int = 1) -> int:
if part == 1:
return sum(b > a for a, b in pairwise(sea_floor_depths))
return sonar_sweep((a + b + c for a, b, c in tripletwise(sea_floor_depths)), part=1)
def sea_floor_depths(report: str) -> Generator[int, None, None]:
return map(int, report.splitlines())
def main(part: int = 1) -> int:
with open("2021/data/day01.txt") as f:
report = f.read()
return sonar_sweep(sea_floor_depths(report), part)
if __name__ == "__main__":
report = """199
200
208
210
200
207
240
269
260
263"""
assert sonar_sweep(sea_floor_depths(report), part=1) == 7
assert sonar_sweep(sea_floor_depths(report), part=2) == 5
assert list(tripletwise("ABCDEFG")) == [
("A", "B", "C"),
("B", "C", "D"),
("C", "D", "E"),
("D", "E", "F"),
("E", "F", "G"),
]
assert list(tripletwise(sea_floor_depths(report))) == [
(199, 200, 208),
(200, 208, 210),
(208, 210, 200),
(210, 200, 207),
(200, 207, 240),
(207, 240, 269),
(240, 269, 260),
(269, 260, 263),
]
print(main())
print(main(part=2))
Currently, when I run mypy on this, I get:
2021/day01.py:22: error: Incompatible return value type (got "map[int]", expected "Generator[int, None, None]")
2021/day01.py:44: error: Argument 1 to "tripletwise" has incompatible type "str"; expected "Iterator[<nothing>]"
I want to indicate with the type hints that tripletwise() can accept any iterable (for example both the string "ABCDEFG" or the output of sea_floor_depths(report)). I'm also unsure about the correct return type of sea_floor_depths().
As for the first error, the map builtin is only documented to return an iterator, so the most specific type hint that you can use is Iterator[int]. Generator is a subtype of Iterator that only arises when using generator expressions or generator functions, which your function does not.
For the second error, the issue is that strs are not themselves iterators, but rather only iterables, so the appropriate type hint would be Iterable[_T_co].

Prettier way in scala to foldLeft a column?

I have an SQL which I am trying to code in spark scala using dataframes
SELECT country,
Substr(substring_col, 1, 3) AS Code,
CASE
WHEN Substr(substring_col, 1, 9) = '238208700' THEN
'columnName1'
WHEN Substr(substring_col, 1, 9) = '240018000' THEN 'columnName2'
WHEN Substr(substring_col, 1, 9) = '240017531' THEN 'columnName3'
WHEN Substr(substring_col, 1, 9) = '240017001'
OR Substr(substring_col, 1, 9) = '240017301'
OR Substr(substring_col, 1, 9) = '240017302' THEN 'columnName4'
WHEN Substr(substring_col, 1, 9) = '240017211' THEN 'columnName5'
WHEN Substr(substring_col, 1, 9) = '248010160'
OR Substr(substring_col, 1, 9) = '248010241'
OR Substr(substring_col, 1, 9) = '248010420' THEN 'columnName6'
ELSE 'not_defined'
END AS custom_column_name
FROM t_filtered
Below is code which I am trying to make it look pretty but unable to achieve the desired result
val substring_col = substring(col("col_name"),1,9)
val mapper = Map("columnName1" -> List("238208700"),
"columnName2" -> List("240017301", "240017001")
)
myDf.withColumn("custom_column_name" ,mapper.foldLeft(lit(""))((accu, mapperMap) => {
when(substring_col isin mapperMap._2, mapperMap._1)
}))
I get the below error
Unsupported literal type class scala.collection.immutable.$colon$colon List(238208700)
java.lang.RuntimeException: Unsupported literal type class scala.collection.immutable.$colon$colon List(238208700)

Convert Set[Range] to Set[Int] in scala

I am trying to get set difference between two sets as follows:
val set1 = Set(1, 2, 3, 4, 5)
// gives: scala.collection.immutable.Set[Int]
val set2 = Set(0 until 10)
// gives: scala.collection.immutable.Set[scala.collection.immutable.Range]
However, the following gives error:
scala> set2.diff(set1)
<console>:14: error: type mismatch;
found : scala.collection.immutable.Set[Int]
required: scala.collection.GenSet[scala.collection.immutable.Range]
set2.diff(set1)
^
How to convert Set[Range] to Set[Int] in easiest way ?
You could do this:
(0 to 10).toSet
or to stick with your initial idea (but less clean):
Set(0 until 10).flatten
which returns:
scala.collection.immutable.Set[Int] = Set(0, 5, 1, 6, 9, 2, 7, 3, 8, 4)
If you worked with a list you could do this (it doesn't seem to work for a Set):
List.range(0, 10)
Similarly to the answer suggested above
(0 until 10).toSet
also works and returns the same.

Calling from/until/range twice on a mutable TreeSet results in empty sequence

While using a mutable scala TreeSet, I came across some weird behavior when invoking range/from/until methods multiple times on the same set. The following code block distills the issue down:
object MapTest extends App{
override def main(args: Array[String]) {
val mutableSet = scala.collection.mutable.TreeSet(3, 2, 5)
println(mutableSet)
println(mutableSet.from(2).from(3))
println(mutableSet.until(5).until(3))
println(mutableSet.range(2, 4).range(2, 4))
println(mutableSet.from(2).until(4))
val immutableSet = scala.collection.immutable.TreeSet(3, 2, 5)
println(immutableSet)
println(immutableSet.from(2).from(3))
println(immutableSet.until(5).until(3))
println(immutableSet.range(2, 4).range(2, 4))
println(immutableSet.from(2).until(4))
}
}
which produces the following output
TreeSet(2, 3, 5)
TreeSet()
TreeSet()
TreeSet()
TreeSet()
TreeSet(2, 3, 5)
TreeSet(3, 5)
TreeSet(2)
TreeSet(2, 3)
TreeSet(2, 3)
As you can see, the immutable set behaves as expected, allowing multiple invocations of from, until, and range. However on a mutable map, any invocation beyond the first results in an empty list. (I did also verify that a single invocation of from, to, or range on a mutable map did the right thing).
If it matters, I'm using scala 2.10.3
When trying the code on my computer, I get the following output :
TreeSet(2, 3, 5)
TreeSet(3, 5)
TreeSet(2)
TreeSet(2, 3)
TreeSet(2, 3)
TreeSet(2, 3, 5)
TreeSet(3, 5)
TreeSet(2)
TreeSet(2, 3)
TreeSet(2, 3)
So I guess it's a bug. I am running it under 2.11.6

How does containTheSameElementsAs work in specs2

This code does not match. Is this correct?
List(1, List(2, 3, List(4)), 5) must containTheSameElementsAs(List(5, List(List(4), 2, 3), 1))
Error message is following:
[error] x be available for elements in a sequence
[error] List(1, List(2, 3, List(4)), 5)
[error] is missing: List(List(4), 2, 3)
[error] must not contain: List(2, 3, List(4)) (specs2test.scala:98)
The containsTheSameElementsAs matcher only goes one level deep, so the match fails on your nested list as List(2, 3, List(4)) != List(List(4), 2, 3). It might be better to simply flatten your nested object before using this matcher.