code Two Software Opinions Was asked to question as part of an application and I thought it would be good to publicly share and document them for future reference. What is one strong opinion you have about software development that is also strongly held, and why do you hold this opinion? NULL [https://developer.
code Microsoft SQL Server Cursors Had to do some sequential merging of records in sql data and this is one of the few occasions when a cursor is useful and it had been quite awhile since I had written a cursor and refreshed my memory with this. Need to merge records from a table that
code Ghost Upgrade 4.3 Pain Remember: Make a backup every time before upgrading Was writing a blog post and saw that a critical security feature was released for ghost this blog engine and found that my collation again is blowing up the migrations. Ghost blog people fix this shit by establishing a script to do
code Command+Option+V: So many options Did a copy/paste and accidentally stumbled onto the option enhancer that I had not remembered using before Example: Command+C Start with a simple command+c operation copy command I do all the time, but now in the paste target press Command+Option+V and you get in my
code SQL Filtered Index Came across a data situation where a previous decision to allow 1-N [https://www.relationaldbdesign.com/database-design/module6/three-relationship-types.php] matching for a parent->child table relationship [https://dba.stackexchange.com/questions/142138/best-practice-for-parent-child-relation] was now unecessary and had led to confusion on data matching because the availability to
code Setup Chrome alias macOS Tried to open a link in the command line, but was unable to because terminal did not recognize chrome [https://www.google.com/chrome/] as a registered binary to handle and open urls. Experimentation Tried to do this: chrome http://google.com Error was: zsh: command not found: chrome Ok,
code Upgrading Ghost 3.X - 4.X Upgrading to the latest version of 3.X was no problem, but then moving from 3.X to 4 everything blew up because of database schema changes with messages like this A GhostError occurred. Message: Ghost was able to start, but errored during boot with: alter table `members_status_events`
code Proposal: Open Source Initiative Open Source, it forms the basis of most personal and commercial software with no sign of a decrease in adoption or change in it's practical use. At <Company> there is no project or solution that I have heard of or examined that does not use or
code MS SQL - Extract JSON from a Text column Previously a design choice was made to store raw JSON [https://www.json.org/json-en.html] responses in a table asVARCHAR(MAX) [https://docs.microsoft.com/en-us/sql/t-sql/data-types/char-and-varchar-transact-sql?view=sql-server-ver15] field. As the person coming in afterwards to understand and debug the problem this was a pain
code MS SQL - Mimicking a busy table Sometimes you want to test a query being unable to access a table that is part of a query (suppose you are using an ORM [https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping] like Entity Framework [https://docs.microsoft.com/en-us/ef/] <- which sucks ) and a
code Proposal: Engineer Exchange Preface: Covid19 [https://www.cdc.gov/coronavirus/2019-ncov/index.html]is a unique situation that gives opportunity to embrace successful distributed work. With over eight plus months of resounding success to distributed work for the company with expectations meant and exceeding even the optimistic forecasts, I would like to propose
code What did I do in Git? Use git log [https://git-scm.com/docs/git-log] with the arguments of * after [https://git-scm.com/docs/git-log#Documentation/git-log.txt---afterltdategt] Takes iso date [https://en.wikipedia.org/wiki/ISO_8601] parameter for example: 2020-01-01 * author [https://git-scm.com/docs/git-log#Documentation/git-log.txt---authorltpatterngt] Takes string pattern most likely the
code SqlServer LEN gotcha A bug was reported where matching condition in the table join was produce erroneous matches and in this case this cause an invalid match which then caused the system to report records were not completed or available. Here is an example setup and results DECLARE @name1 NVARCHAR(200) = 'ABCDE
code Merge statement alternatives Collected merge statement alternatives as their use can consolidate the insert/update sql code necessary but come with known risks > The Case of the Blocking Merge Statement (LCK_M_RS_U locks) [https://littlekendra.com/2016/05/24/the-case-of-the-blocking-merge-statement-lck_m_rs_u-locks/] Use Caution with SQL Server’s MERGE
code WSL 2 X Display As Windows Subsystem for Linux 2 [https://docs.microsoft.com/en-us/windows/wsl/wsl2-faq] is a separated Virtual Machine on the host Windows Operating System instead of a process it is no longer able to use the same X Windows forwarding over 127.0.0.1 that I was previously
code WSL 2 Tips Windows Subsystem for Linux 2 [https://docs.microsoft.com/en-us/windows/wsl/compare-versions] which is now a fully backed kernel linked through underlying virtual machine tied into the hypervisor of the machine is a full linux kernel and environment, but it still sits inside of the Windows host which can
code Local Git Cleanup Commits Writing these down because I keep forgetting them. Situation 1 - Local commit wrong branch Made a commit to a branch I shouldn't have locally i.e. main should be in fixify-brokebrain git reset --hard HEAD^ Resets the branch to the commit specified and remove changes ( --hard [https:
code SQL Server Memory Tables as Cache Documentation Starting with SQL Server 2016 (13.x), there is no limit on the size of memory-optimized tables, though the tables do need to fit in memory. Memory tables in SQL Server are pretty close analogs to Redis [https://redis.io/topics/lru-cache] [https://redislabs.com/try-redis-cloud-essentials-for-a-free-shirt/?utm_source=google&
code C# in Powershell Trying out some things and writing and compiling a type in Powershell PS C:\Users\siliconrob\Desktop> $MyCode = @" $MyCode = @" >> public class Calc >> { >> public int Mul(int a,int b) >> { >> return a*b; >> } >> } >
code Using Group By to Rollup Data This is a helper post to understand that denormalized [https://www.geeksforgeeks.org/difference-between-normalization-and-denormalization/?ref=rp] data created with joins and in particular left joins or cross apply [https://www.mssqltips.com/sqlservertip/1958/sql-server-cross-apply-and-outer-apply/] can be rolled up with the proper use of GROUP BY [https://www.sqlservertutorial.net/
code Standup Slack Bot I completely agree with the sentiment here. The stand-up meeting is a good way to lose focus for a team especially if you are distributed and remote. If you can use Basecamp then I would suggest that, but if you are not use an automated standup bot in your slack
code Generate unique memorable ids I wanted to generate an 8 character web compatible (base64 [https://en.wikipedia.org/wiki/Base64] encoded) id that is fairly easy to type or memorize from SQL, so came up with this inspired from this Postgres [https://blog.andyet.com/2016/02/23/generating-shortids-in-postgres/] approach SELECT randomId from openjson(
code Faker.Net This project [https://github.com/oriches/faker-cs]although popular on nuget [https://www.nuget.org/packages/Faker.Net/] for downloads appeared to have been for the most unmaintained as the last update to the nuget package had not occurred in approximately in almost 2 years and before the last update
code Run script against all Databases Copied from StackOverflow [https://stackoverflow.com/questions/22948927/update-stored-procedure-on-multiple-databases] -- put the entire stored procedure code in a variable -- have it start with "PROC" so we can easily either create or alter the -- procedure based on whether it already exists or not DECLARE @sp_code NVARCHAR(
code Generate recursive N integers in SQL MS SQL Server I want to generate a table with 1,000,000 sequential ids because I am wasteful and scourge upon humanity Step 1 - Create temp table Step 2 - Use recursive Common Table Expression with UNION ALL Generate the range with the SELECT n+1 FROM t