Reddit Programming
211 subscribers
1.22K photos
124K links
I will send you newest post from subreddit /r/programming
Download Telegram
json, protobuf, avro, SQL - why do we have 30 schema languages?
https://www.reddit.com/r/programming/comments/1kh18ej/json_protobuf_avro_sql_why_do_we_have_30_schema/

<!-- SC_OFF -->I was reading this blog about schema-driven development with Kafka which I thought detailed pretty well why Protobuf should be king (https://buf.build/blog/kafka-schema-driven-development#toc-we-think-that-schema-language-should-be-protobuf). Note the company behind it is a protobuf company, so they're obviously biased, but I think it makes sense. It seems like JSON schema is very popular today, but I believe it has more limitations (verbose, hard to read, no good defauts, type system doesn't match to languages well) It got me thinking - why hasn't the world standardized on a single interface definition language? (IDL) Similar - why haven't we standardized to a single schema definition language? It makes sense to have different ways to serialize the same schema - a serialized byte representation optimized for few-message passing through an RPC call is different than the serialized byte representation of a columnar big data Parquet file - but do we really need to all of these have their own syntax and different language support? In theory, you should be able to serialize the same schema definition in different ways. (I posted a version of this yesterday and it got off to a good discussion, but the mods erroneously banned it on the grounds of the "not a support forum" rule. I am not asking for support - I'm starting a discussion.) <!-- SC_ON --> submitted by /u/2minutestreaming (https://www.reddit.com/user/2minutestreaming)
[link] (https://buf.build/blog/kafka-schema-driven-development) [comments] (https://www.reddit.com/r/programming/comments/1kh18ej/json_protobuf_avro_sql_why_do_we_have_30_schema/)
Same Copy | IndieTools
https://www.reddit.com/r/programming/comments/1khcgrj/same_copy_indietools/

<!-- SC_OFF -->#Share daily Independent Developer Tools: Same Copy is an innovative tool that enables users to quickly replicate entire applications by simply entering a URL, including intricate UI details, animations, and backend logic #IndieHackers #WebDev #IndieTools #hackers <!-- SC_ON --> submitted by /u/Glittering_Will_555 (https://www.reddit.com/user/Glittering_Will_555)
[link] (https://www.indietools.work/product/b4d68925-e185-4c42-a2bc-a8d0154105c9?type=web-framework) [comments] (https://www.reddit.com/r/programming/comments/1khcgrj/same_copy_indietools/)
Same Copy | IndieTools
https://www.reddit.com/r/programming/comments/1khcjnk/same_copy_indietools/

<!-- SC_OFF -->Share daily Developer Tools: Same Copy is an innovative tool that enables users to quickly replicate entire applications by simply entering a URL, including intricate UI details, animations, and backend logic <!-- SC_ON --> submitted by /u/Glittering_Will_555 (https://www.reddit.com/user/Glittering_Will_555)
[link] (https://www.indietools.work/product/b4d68925-e185-4c42-a2bc-a8d0154105c9?type=web-framework) [comments] (https://www.reddit.com/r/programming/comments/1khcjnk/same_copy_indietools/)
Telegram Chat member track - issue
https://www.reddit.com/r/programming/comments/1khdfmz/telegram_chat_member_track_issue/

<!-- SC_OFF -->Hello everyone, i'm trying to track users that joins and leave my group on telegram. I've tried a lot, but while testing with my secondary account, i do not receive any data in my .db file... also i dont get any debug message in my interface... can anyone help me, please??? My code is
def init_db(): conn = sqlite3.connect( 'grupo_cripto_logs.db', detect_types=sqlite3.PARSE_DECLTYPES ) cursor = conn.cursor() cursor.execute(''' CREATE TABLE IF NOT EXISTS user_activity ( user_id INTEGER, username TEXT, first_name TEXT, last_name TEXT, action TEXT, -- "join" ou "leave" timestamp datetime ) ''') conn.commit() conn.close() async def track_members(update: ChatMemberUpdated, context: ContextTypes.DEFAULT_TYPE): try: print(f"\n🔔 Novo evento de membro: {update}") user = update.new_chat_member.user if update.new_chat_member else update.old_chat_member.user print(f"Usuário envolvido: ID={user.id}, Nome={user.full_name}") if update.new_chat_member and update.new_chat_member.status == 'member': action = "join" print("🟢 Ação: Entrada no grupo") elif update.old_chat_member and update.old_chat_member.status in ['left', 'kicked']: action = "leave" print("🔴 Ação: Saída do grupo") else: print("🟡 Outra mudança de status não tratada") return with sqlite3.connect('grupo_cripto_logs.db', detect_types=sqlite3.PARSE_DECLTYPES) as conn: cursor = conn.cursor() cursor.execute(''' INSERT INTO user_activity VALUES (?, ?, ?, ?, ?, ?) ''', ( user.id (http://user.id/), user.username, user.first_name, user.last_name, action, datetime.now() )) conn.commit() print(f" Dados salvos: {user.full_name} ({action})") except Exception as e: print(f"🚨 ERRO: {str(e)}") await context.bot.send_message( chat_id=chat_ids_alertas[0], text=f"Erro no tracking: {str(e)}" )
app.add_handler(ChatMemberHandler(track_members, ChatMemberHandler.CHAT_MEMBER)) <!-- SC_ON --> submitted by /u/Disastrous_End_588 (https://www.reddit.com/user/Disastrous_End_588)
[link] (http://telegram.com/) [comments] (https://www.reddit.com/r/programming/comments/1khdfmz/telegram_chat_member_track_issue/)
[Sharing] Essence-Based Interpretation (EBI) – A Practical Approach for Software Design
https://www.reddit.com/r/programming/comments/1khn49s/sharing_essencebased_interpretation_ebi_a/

<!-- SC_OFF -->Hello everyone, I've recently come across a compelling approach called "Essence-Based Interpretation (EBI)", which emphasizes starting with "why" (essence) rather than immediately jumping into "what" or "how" when dealing with software requirements. EBI encourages developers to deeply understand the core reason behind a requirement before making design decisions. This helps teams build systems that are not only robust and maintainable but also flexible in handling future changes. Here's a great article explaining EBI clearly and practically: https://mannercode.com/2024/05/04/ebi-en.html I'd love to hear your thoughts and experiences: Have you applied a similar approach in your projects? Any lessons learned from focusing (or not focusing) on the "why" behind requirements? Looking forward to your insights and discussion! <!-- SC_ON --> submitted by /u/TwoDull183 (https://www.reddit.com/user/TwoDull183)
[link] (https://mannercode.com/2024/05/04/ebi-en.html) [comments] (https://www.reddit.com/r/programming/comments/1khn49s/sharing_essencebased_interpretation_ebi_a/)