Categories
Database Development

Explain Like I’m Five : SQL (relational) and NOSQL (non-relational) databases

If I had to explain SQL & NOSQL to a college student within 1 minute : You’re familiar with an Excel spreadsheet, right ? That is SQL: id, name, age, weight 1, Adam, 20, 150 2, Bob, 30, 160 … Now imagine if you didn’t know the column names up-front, and wanted to flexible in […]

Categories
Mastering Development

NSTableView has unwanted space above first row

I have an NSTableView whose first row is pushed down 10 pt from the top. Headers are turned off, there are no group rows, cell spacing is 0, and the enclosing scroll view’s content inset is 0. UPDATED Here’s a sample project that demonstrates the issue. Here’s a grab of the view hierarchy debugger: Here’s […]

Categories
Mastering Development

use whereIntegerInRaw In laravel5.5

I need to use whereIntegerInRaw query because when I have too large database, use whereIn is very slow. I try to extend query builder and add that method to it,but it still no working. In OptimizeBuilder public function whereIntegerInRaw($column, $values, $boolean = ‘and’, $not = false) $type = $not ? ‘NotInRaw’ : ‘InRaw’; if ($values […]

Categories
Mastering Development

How to get line and column by position in C#?

Consider the following string: var text = @" Hello How Are You doing? ""MyNameIs:"" XYY "; How to get a character in any position (>=0) with a related column and line? position means put all the characters in a row and then count them from zero like: \n \n \n H e l l o […]

Categories
Mastering Development

What is wrong with my AWS Amazon Athena query? line 2:10: extraneous input ”ticket_id” expecting {‘add’, ‘all’,..}

Here is my query: CREATE TABLE IF NOT EXISTS "cw-milenko"."calc-milenko" ( ‘ticket_id’ string, ‘sum_stake’ float, ‘amount_stake_one’ string, ) ROW FORMAT SERDE ‘org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe’ WITH SERDEPROPERTIES ( ‘serialization.format’ = ‘1’) location ‘s3://cw-milenko-tests/1507tick2.parquet/part-00000-bbab8f70-4758-4041-9f69-c17f21c916dac000.snappy.parquet’ I got this error: line 2:10: extraneous input ”ticket_id” expecting {‘add’, ‘all’, ‘some’, ‘any’, ‘at’, ‘no’, ‘like’, ‘substring’, ‘position’, ‘tinyint’, ‘smallint’, ‘integer’, ‘date’, ‘time’, ‘timestamp’, […]

Categories
Mastering Development

How to retrieve coordinates of PointDrawTool in Bokeh?

I’m trying to get xy coordinates of points drawn by the user. I want to have them as a dictionary, a list or a pandas DataFrame. I’m using Bokeh 2.0.2 in Jupyter. There’ll be a background image (which is not the focus of this post) and on top, the user will create points that I […]

Categories
Mastering Development

Getting RepositoryNotFoundError in typeorm but I’m pretty sure they are registered

I’m writing an app using Next.js + TypeORM and running in to an issue with the integration. RepositoryNotFoundError: No repository for "User" was found. Looks like this entity is not registered in current "default" connection? From what I can tell I have everything configured correctly but continue to get this error. I’ve debugged and inspected […]

Categories
CMS Mastering Development Wordpress

Doing Math with Gravity Forms List

While working on a client site utilizing Gravity Forms, I found myself wanting to use the aesthetic of the advanced list Gravity provides, but needed a bit more arithmetic firepower (read: any, arithmetic firepower; gravity doesn’t enable calculations on their advanced list field without a plugin). I found this: https://stackoverflow.com/questions/35872452/gravity-forms-find-sum-of-list-column Which got me close to […]

Categories
Mastering Development

how to define location in an entity using mongodb

I am using nest js in my sample application. I define the entity of my application .Entity means a document. But I struck at one place to define the location. using mongoose I define the schema of my document like this see link https://raw.githubusercontent.com/webmakaka/Node.js-API-Masterclass-With-Express-MongoDB/master/api/models/Bootcamp.js location: { // GeoJSON Point type: { type: String, enum: [‘Point’] […]

Categories
Mastering Development

Tail Recursive Function is not being optimised by g++

I have this simple DFS Code for the the Number of Islands problem but I even though is a tail recursive function when I use G++ -O2, I still get a Segmentation Fault. void findneighbors(int i, int j, int row, int column, vector<vector<char>>& binaryMatrix){ binaryMatrix[i][j]=’0′; if((i+1)<row && binaryMatrix[i+1][j] == ‘1’){ findneighbors(i+1,j, row,column, binaryMatrix); } if((i-1)>=0 […]