copyright – Storing song lyrics

I’m a guitar player and I built a web app that stores my song lyrics so I can view them on my Ipad when I play cover songs at pubs, etc. Until now, I’ve been the only user but I’d like to allow others to use it for free at first and then perhaps a small charge if people are willing. My question is, can I get in trouble if they store lyrics to cover songs that are copyrighted? A couple of things to note:

  1. Each user must paste in their own lyrics. My site does not provide any lyrics.
  2. Users must login to view their lyrics in the browser and none of the lyrics are publicly searchable.
  3. User might paste in lyrics they have written or lyrics to cover songs which are technically copyrighted.
  4. The users intention is to learn the music either for educational purposes or playing in bars and establishments where management is already paying the necessary fees to the music industry to have performers play in the first place.
  5. Each users songs are stored in a separate database record so technically 100 users may be storing the same lyrics of the same song.
  6. No public voting or viewing of the same version of a specific song.
  7. Site is clearly marked so users know not to attempt to share images of songs with copyrighted lyrics.

I’ve attached a screenshot (unbranded so as not to promote). And the lyrics shown are of a royaltie free song 🙂

Thanks in advance for any guidance.

enter image description here

Storing luggage in Paris? – Travel Stack Exchange

Left-luggage services are available in a number of Paris railway stations.

Left-luggage services are available for the public in Paris railway stations : Gare du Nord, Gare de l’Est, Gare de Lyon, Gare d’Austerlitz and Gare Montparnasse. Luggage can be left for a maximum of 72 hrs and the cost, the same in all stations, ranges from €3 to just over €7 per day, depending on the size of the locker. They are available from 6.30am to 10.45pm. Warning: this service may be closed at any time for security reasons.

  • Gare du Nord 18 rue de Dunkerque (10th)
  • Gare de l’Est Place du 11 novembre 1918(10th)
  • Gare de Lyon Place Louis Armand (12th)
  • Gare d’Austerlitz 85 quai d’Austerlitz (13th)
  • Gare Montparnasse 17 boulevard de Vaugirard (15th)

The site also provides links to several independent left-luggage services:

  • Gustave, Welcome City Lab, Tour Gamma A, 193 rue de Bercy (12th), Tel.. +33 (0) 6 89 25 13 82 support@gustaveinparis.com
  • Holibag, 10 boulevard Diderot (12th) Tel.. +33 (0) 6 22 72 72 78 hello@holibag.io

An online service, Eelway, ‘collect(s) your luggage anywhere, anytime. Get them back when you arrive at the airport, train station, rental or hotel.’

java – Best data Structure for storing a phone keypad format

I am new to java collections and learning them right now. I was trying to code the phone keypad characters with its numbers. The first idea which came to my mind is using a HashMap. After trying various options I came up with the below Code. I want to know if the data structure and methodology which I implemented is good or does it need some more improvements.

Things which I know and don’t want to implement:

  1. I do not want to hardcode the keypad. I know that there are various ways of implementing a hardcoded keypad. I visited this and this link to learn about other ways.
  2. I would really be thankful if the solution is given in java 7 syntax. I don’t have much idea about java 8 syntax, but I’ll be helpful to know the solution in that too, if possible.
public static void keypadDemo(){
        // Creating a HashMap
        int ax = 97;
        Map<Integer, ArrayList<Character>> hm = new HashMap<>();
        for(int i = 0; i < 10; i++){
            if(i == 0 || i == 1){
                hm.put(i, null);
            }else if(i == 7 || i == 9){
                hm.put(i, new ArrayList<>(Arrays.asList((char) ax, (char) ++ax, (char) ++ax, (char) ++ax)));
                ax++;
            }else{
                hm.put(i, new ArrayList<>(Arrays.asList((char) ax, (char) ++ax, (char) ++ax)));
                ax++;
            }
        }
       System.out.println(hm);
    }

Any help will be welcomed. Thanks

mysql – When to use a “middle table” instead of storing a JSON with IDs?

As nbk mentions, the middle table is known as a bridge table or linking table. JSON is best for structureless or variable structure situations, but not so good when needed to be used in predicates within the context of a relational system.

By stuffing a bunch of values in a single JSON field and then using the IN clause, you’re telling MySQL to treat the values of that JSON field as a predicate which is very similar to as if you wrote a bunch of OR clauses with each value in it. Having a large number of predicates in this form is generally sub-performant.

Furthermore, you’re still dealing with roughly the same amount of data regardless if you store it in a JSON column or in a bridge table, because your templates table will still be the same number of rows times the same number of item_ids in the one-to-many relationship they naturally share. (I know there’s some data redundancy in practice, but the optimizations of the database system under the hood with normalized data probably make that a moot point from a performance perspective.)

Joining multiple tables together is not a bad thing for performance, especially only a few tables as you mentioned and especially with small tables of only a few hundred thousand rows at most. It’s more so an issue if you over-normalize the data and always need to rejoin all the tables back together in every query. You probably wouldn’t see any issues even in that case until your data grows significantly more and/or you’re joining around 10+ tables together every query (rough estimates).

So at the end of the day you’d be at best ending up with the same performance on average by leveraging a JSON column, and potentially worse off when querying it as a predicate, by sidestepping one of the key things a relational database is meant to do – join tables. 🙂

Regarding the purpose of a JSON column, it’s better used for data points that are variable in nature and structure, that generally need to be returned as part of the SELECT list (i.e. are commonly returned as part of your queries’ data lookups) as opposed to as being part of the JOIN, WHERE, or HAVING clause predicates.

Efficiently storing a chunk of realtime data?

Let’s say I’m programming a realtime stock chart and I want my program to run indefinitely without running out of memory. What might be a good way to keep the current data in memory up to a certain period, and then store the rest?

Is a ring buffer worth implementing or is it just a case of checking timestamps and doing housekeeping?
What if I were to try and implement a system in a functional style?

cookies – Does storing session id for remembering session requires user consent under GDPR?

My application provides public landing pages to visitors. Whenever the user visits the page or refreshes the page, we record analytics containing the IP address and browser information and generates a unique session ID.

The session ID is then stored in the local storage.

The landing page contains a lead form or RSVP form to be submitted by the visitor. We use the session ID stored in the storage to link the form submission with the session created.

  • Does this requires Cookies content to be displayed to the user?
  • Without the session-id, the user won’t be able to perform any activity on the page like lead submit or RSVP submit. Will it be the best practice to enforce the user to allow the cookies before the actual data is displayed and if declined, do not serve the data?
  • What if we do not use cookies or localStorage and store the session ID in a variable of SPA and use it to carry on lead submission or RSVP, will it still require user consent as per the GDPR?

dnd 5e – Can you Counterspell a spell cast using a Ring of Spell Storing?

Is a spell cast using a Ring of Spell Storing observable, in the sense that you could Counterspell it? Or is it essentially same as if you cast a spell using something like a Sorcerer’s Subtle Spell metamagic, or some other means of hiding or not needing the components of the spell? Does it maybe even depend on the type of spell, ie. if the spell effect is observable, it could be counterspelled, but not if there is no visible effect?

Relevant snippet from the ring description:

While wearing this ring, you can cast any spell stored in it. The spell uses the slot level, spell save DC, spell attack bonus, and spellcasting ability of the original caster, but is otherwise treated as if you cast the spell.

hash – Why does firebase encrypt with password hashes instead of storing the hashes?

I am trying to migrate off of firebase, as in doing so, you can export the hashes of user passwords. Looking at their algorithm, they do not store password hashes, but rather, they use the first 32-characters of a password hash to encrypt a secret key, and store that instead.

I was mostly wondering, why would they be doing this? Standard practice seems to be to hash with salts, store the result, but they also do this encryption step. Is there any benefit here?

For reference, here is some python code roughly showing the algorithm:

intermediary = hashlib.scrypt(password, salt=salt + salt_seperator, n=2**14, r=8, p=1)
signing_key = base64.b64decode(PASSWORD_V2_SIGNING_KEY) # provided by firebase
# encrypt signing_key with the password hash
cipher = AES.new(intermediary(:32), AES.MODE_CTR, initial_value=b'x00' * 16, nonce=b'')
result = cipher.encrypt(signing_key)
hash_to_store = base64.b64decode(result)

Storing bitcoins without a wallet using only a seed phrase

Presently I have some BTC in a custodial wallet which I want to transfer out. I don’t want a use a wallet at all. Neither hardware nor software.

If I install Electrum on a live Ubuntu session, create a wallet, transfer BTC to it, note down the seed phrase and terminate the live session, will I still be able to recover my wallet with coins several years from now?

What are the downsides of this method over a cold storage wallet?

amazon web services – Most cost efficient way to storing TB of row data per year with infrequent reads

I have data ETL jobs that generate a ton of row data (O(10TB) per year).

Currently they are writing to a Postgres instance. The data is not needed immediately, so I am fine with writing all this data to some cold storage but still have the option later to “re-constitute” this data in the future.

Having just a Postgres instance attached to a large volume SSD seems very pricey, so the one idea I have with the current setup is to:

  1. Write to the postgres instance with a small volume attached
  2. Every week or so, pg_dump to S3 (perhaps S3 glacier)
  3. Hot swap to a new postgres instance with a fresh volume
  4. Detach and discard the volume from (1)

Steps 2-4 seem like a hacky solution, since the ETL jobs will need to hot swap the Postgres address they are writing to (and data may be lost momentarily). I would also have to merge all the dumps at some point to consolidate the snapshots.

One other idea I have is to just write out the data into flat files (parquet maybe, or CSV?), and copy them over to S3 Glacier every so often. This doesn’t seem ideal since I would need to merge these flat files at some point.

Ideally all of this could be automated so I wouldn’t have to do the hot swaps manually.