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 Software

Does using a destructured object as function arguments make sense?

Once upon a time we did this /** * Function that does lots of things * @param {boolean} state * @param {number} max * @param {string} set * @param {number} timeout * @param {boolean} bail * @param {string} name * @param {function} cb */ function doLotsOfThings(state, max, set, timeout, bail, name, cb){ } Then we […]

Categories
Mastering Development Software

How would I use a microphone to run commands from a known list?

I don’t need/want full speech recognition where my words get set to the cloud and it figures out what sentence I likely said. I have a list of words (some may be song titles). I want my program to crawl the set of allowed words for the first word (open, play, set, change, etc) then […]

Categories
Mastering Development

How a object values change after instantiate in java

import java.util.List; import java.util.Set; public class B { private final List<String> name; private final Set<String> set; private final String type; public B(List<String> name, Set<String> set, String type) { this.name = name; this.type = type; this.set = set; } public List<String> getName() { return name; } public String getType() { return type; } } Then I […]

Categories
Mastering Development

Removing edge from adjacency list

I am implementing a directed graph and I wrote a method for removing an edge. I want to remove a value(edge) from a key(node). I don’t understand why we have to create a new AbstractMap(edge) to remove an existing AbstractMap(edge). public class DirectedGraph { private final Map<String, Set<Map.Entry<String, String>>> adj; public Graph() { adj = […]

Categories
Mastering Development Software

Design a database with multiple relations and tables

I’m struggling to find how to correctly design a database in order to store and retrieve data for my software. Basically, I’m designing an application for a gym (C++, MySQL with PhpMyAdmin): each user (unique ID, name, surname) can have one or more training routines a training routine is divided in training schedules (from A […]

Categories
Mastering Development

Do i need to remove brackets for tokenization? RegexpTokenizer

First attempt at tokenization using nltk’s RegexpTokenizer for an assignment (necessary). Not sure if I should remove brackets? You are required to extract the token and append them into the list ‘token’ …not sure if I even did this right. import re import nltk from nltk.tokenize import RegexpTokenizer from nltk.probability import * from itertools import […]

Categories
Mastering Development Software

Testing unexpected inputs for unit tests and loops?

I’m working on an enterprise that has some Angular/Typescript projects and to avoid repeating code (basically copying and pasting) between them, we decided to go for Monorepo and start write an util library, with unit tests, docs and everything on. At the moment we’re implementing an util function: export const normalizeNames = (value: string): string […]

Categories
Mastering Development

deploying ruby-rails + react-js on heroku error

I am having trouble deploying an app I made with ruby on rails and react.js on heroku. Has anyone ran into these errors while deploying? I am completely stuck and hopeless 😩 remote: Usage: npm <command> remote: remote: where <command> is one of: remote: access, adduser, audit, bin, bugs, c, cache, ci, cit, remote: clean-install, […]

Categories
Mastering Development

vector of pair of set with lambda comparator

I’m trying to make a vector of pairs of set: vector<pair<set<int>, set<int>>> but I want to use different lambda comparators for the two sets. I tried doing: #include <bits/stdc++.h> using namespace std; int main() { auto cmp = [&] (int a, int b) -> bool { return a > b; }; auto hi = [&] […]