Cryptocurrency Ethereum Mastering Development

Require(…) condition location in wrapped functions

If I’m wrapping functions, like below, does it make a difference whether I check the input argument in the private function or the external one? Will it save me gas cost to do it in the external one because it will revert the function the earliest? contract Example { function wrapperForFunction(uint256 exampleArg) external { //require(…) […]


Can I access the total number of groups in a data.table in j?

data.table has a very convenient group index called .GRP that can be accessed in j like so: # Load data table package library(data.table) # Create dummy data dt <- data.table(alpha = 1:10) # Function that takes the group number # as an argument foo <- function(a){ paste0(“Group #: “, a) } # Group by “alpha” […]

Accessing SQL Server System Functions using 3 part naming

Like below, am trying to access System Function CAST() using Database name as prefix but isn’t working. SELECT Master.Dbo.CAST(GETDATE() AS DATETIME2),UserDB.dbo.CAST(GETDATE() AS DATETIME2) Error : Incorrect syntax near the keyword ‘AS’. Replacing ‘dbo’ with ‘sys’ or ‘..’ didn’t work and it appears that CAST works stand-alone only without any prefix. Those 2 Databases has different […]