Categories
Mastering Development

How to iterate through neighbours in 2D coordinates?

In a 2D plane, I want to check the neighbouring points until meeting a condition. For example, take a red pixel in this image (x,y). I want to iterate to find the white pixel closest to the selected red pixel. This is an updated image provided by @Pranav Hosangadi My original code is now irrelevant. […]

Categories
Game Creation Mastering Development

Need advices for speeding up map rendering [closed]

Map loader uses for loops for loading text based files then it stores them in list then for loop in rendering takes data it parses them then sends them to opengl but its slow when having maps that very large any alternatives for for loop in this method thanks Map is file that stores game […]

Categories
Database Development

T-SQL Alternative to using XML CROSS APPLY

I have the following snippet from a long piece of SQL (that works fine) declare @CONS as varchar(50) set @CONS = ” set @CONS = @CONS +”+’99’+” … … left join dbo.TableA u2 on u2.UserOID in ( SELECT case when @CONS= ’99’ then u2.UserOID else t.c.value(‘.’, ‘VARCHAR(50)’) end FROM ( SELECT x = CAST(‘<a>’ + […]

Categories
Database Development

T-SQL Alternative to using XML CROSS APPLY

I have the following snippet from a long piece of SQL (that works fine) declare @Consultant as varchar(50) set @Consultant = ” set @Consultant = @Consultant +”+’99’+” … … left join dbo.TableA u2 on u2.UserOID in ( SELECT case when @CONS= ’99’ then u2.UserOID else t.c.value(‘.’, ‘VARCHAR(50)’) end FROM ( SELECT x = CAST(‘<a>’ + […]

Categories
Mastering Development

SQLite convert single row to multiple rows

SQLite I want to convert single row value seperate by ‘,’ to multiple rows Example : Single_Row 6,7,8,9,10,11,12,13,14,15,16 Result must be : MultipleRows 6 7 8 9 10 12 13 14 15 16 I tried doing it with substr function but getting unexpected result select numbers.n, substr(CbahiHSSpecialtyUnits.units,numbers.n,1) from numbers inner join CbahiHSSpecialtyUnits on LENGTH(CbahiHSSpecialtyUnits.units) – […]

Categories
Mastering Development

ANTLR island grammars and a non-greedy rule that consumes too much

I’m having a problem with an island grammar and a non-greedy rule used to consume "everything except what I want". Desired outcome: My input file is a C header file, containing function declarations along with typedefs, structs, comments, and preprocessor definitions. My desired output is parsing and subsequent transformation of function declarations ONLY. I would […]

Categories
Database Development

Are the results of the STRING_SPLIT() function returned in a deterministic order?

I need to split a comma delimited string, manipulate it, and then concatenate it back into a single string retaining the original order of the data (if possible). For example, take a column definition list of a CREATE TABLE statement (as a string) like so ‘BrentOzarColumn INTEGER, PaulWhiteColumn DATETIME, ErikDarlingColumn VARCHAR(100)’. I’d like to split […]

Categories
Database Development

Are the results of the STRING_SPLIT() function returned in a deterministic order?

I need to split a comma delimited string, manipulate it, and then concatenate it back into a single string retaining the original order of the data (if possible). For example, take a column definition list of a CREATE TABLE statement (as a string) like so ‘BrentOzarColumn INTEGER, PaulWhiteColumn DATETIME, ErikDarlingColumn VARCHAR(100)’. I’d like to split […]

Categories
Database Development

Are the results of the STRING_SPLIT() function returned in a deterministic order?

I need to split a comma delimited string, manipulate it, and then concatenate it back into a single string retaining the original order of the data (if possible). For example, take a column definition list of a CREATE TABLE statement (as a string) like so ‘BrentOzarColumn INTEGER, PaulWhiteColumn DATETIME, ErikDarlingColumn VARCHAR(100)’. I’d like to split […]

Categories
Mastering Development

Deciding 2d vector size automatically from csv file

I have a C++ code to load 2d vector from csv file. Here, output.csv file has a data of 65 x 74496. In this code, I fixed the size of row and column to 65 and 74496. However, in the future, the number of row and column could be changed depending on data. Do you […]