Skip to content

Instantly share code, notes, and snippets.

View ferbncode's full-sized avatar
👋

Suyash Garg ferbncode

👋
View GitHub Profile
@ferbncode
ferbncode / Teams
Last active January 31, 2017 06:33
# Compulsory for CSEC Members
Utkarsh Raj (CSEC)
Ashish Kaushal (CSEC)
Aditi Soni (CSEC)
Tarun Mahawar (CSEC)
Suyash:
Bimalkant Lauhny
Himanshi
nickiana> help
6:26 PM im working on a project to extract data from music brainz, and we want the process to be completely automated.
6:27 PM
<yvanz> nickiana: just ask your question
6:27 PM
<ruaok> hi nickiana. what do you need help with then?
6:28 PM
<nickiana> our current environment is AWS RDS MYSQL, and we are trying to figure out the best option for us
6:29 PM i see that they are 2 options, i.e. virtual image or the data dump
6:29 PM im not sure what the pros and cons are of each option

Personal Information:

Project Overview:

Presently, CritiqueBrainz uses python-musicbrainzngs to show search results and fetch info of selected entities. python-musicbrainzngs then uses the XML Web Service which returns the requested results. This is not very slow but some pages on CritiqueBrainz require a lot of MusicBrainz data, which takes very long time to retrieve. For example, as suggested in CB-162, if the cache is empty and each user requests separate pages of the review browsing section, then there are 330 X 27 requests to the web service. Directly accessing the MusicBrainz database would mean one query(directly to the database) per page(by getting multiple entities' data in a batch using raw SQL statements) only if the cache is completely empty. Thus, d

https://bugzilla.gnome.org/show_bug.cgi?id=773769
https://bugzilla.gnome.org/show_bug.cgi?id=773478
https://bugzilla.gnome.org/show_bug.cgi?id=773133
@ferbncode
ferbncode / __init__.py
Last active March 14, 2017 16:16
Example functions
from sqlalchemy import create_engine
from sqlalchemy.pool import NullPool
SCHEMA_VERSION = 1
mb_engine = None
def init_db_engine(connect_str):
global mb_engine
mb_engine = create_engine(connect_str, poolclass=NullPool)
from critiquebrainz import mb_db
# from mb_db import db_exceptions
import sys
import sqlalchemy
from brainzutils import cache
def get_tags(id, entity_type, relation, colname):
## Example function for get_tags. Many entities may
## require tags.
from critiquebrainz import mb_db
import sys
import sqlalchemy
from brainzutils import cache
from critiquebrainz.mb_db import db_helpers
# example function to get tags, release_group, artists, url_rels
def get_release_group_by_id(id, relations=[]):
"""(Example function)Get release group with the MusicBrainz ID."""
Heuristics #5 takes place tomorrow at 9 PM. It will be a 2 hour contest consisting of 5 problems of varying difficulties. Problems have been set by Param Singh, Lokesh Sharma and Suyash Garg. Register at https://www.hackerearth.com/csec-heuristics-5. Have fun coding!
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
int tests;
scanf("%d", &tests);
for(int t=0;t<tests;t++)
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
scanf("%d", &t);
while(t--) {
int n;
scanf("%d", &n);