How to show tables in PostgreSQL?
What's the equivalent to show tables (from MySQL) in PostgreSQL?
我们盯着 Product Hunt、GitHub、Hacker News 等一线信源,把每天值得一看的产品、项目和讨论挑出来,摊在这一页。挑你感兴趣的展开细读。
共 60 条 · 最近更新 2026-06-01
What's the equivalent to show tables (from MySQL) in PostgreSQL?
I'm making a Python script to use OpenAI via its API. However, I'm getting this error: openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details My script is the following: #!/usr/bin/env python3.8 # -*- coding: utf-8 -*- import openai openai.api_key = "<My PAI Key>" completion = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": "Tell the world about the ChatGPT API in the style of a pirate."} ] ) print(completion.choices[0].message.content) I'm declaring the shebang python3.8 , because I'm using pyenv . I think it should work, since I did 0 API requests, so I'm assuming there's an error in my code.
I'm currently working on developing a chatbot powered by a Large Language Model (LLM), and I want it to provide responses based on my own documents. I understand that using a fine-tuned model on my documents might not yield direct responses, so I'm exploring the concept of Retrieval-Augmented Generation (RAG) to enhance its performance. In my research, I've come across two tools, Langchain and LlamaIndex, that seem to facilitate RAG. However, I'm struggling to understand the main differences between them. I've noticed that some tutorials and resources use both tools simultaneously, and I'm curious about why one might choose to use one over the other or when it makes sense to use them together. Could someone please provide insights into the key distinctions between Langchain and LlamaIndex for RAG, and when it is beneficial to use one tool over the other or combine them in chatbot development?
How to efficiently using AIs like claud and chatGPT to improve your programming abilities without losing critical thinking because i feel like we are so hyped up with the AI's ability to give a good response in a way that we are carried away with not able to actually think critically.
I have a table containing a lot of typed/named items and I want to create a (materialized?) view to group them together so that a UI can later make it easier for users to select. Description The goal is: If there are N elements of the same type, make sqrt(N) groups each of size sqrt(N). Instead of having e.g. 10k elements to scroll through, the UI would show 100 lines (the groups), each of which can be expanded into 100 lines (the items inside each group). 1 more click to make but a lot less scrolling. The UI will display group names as the range containing the named elements inside it. For instance, if a group contains all the items whose names start with A and B (but not C and beyond), then the group should be named A-B . If a group contains all the elements starting with C until e.g. EG, but elements starting with EH are the the next group, the group should be name C-EG . The idea is: Instead of comparing the texts and deciding where the lists should be split into groups, I am using a function to score the items. Why I do that will make sense in a minute. Anyway, a heuristics turns that whole mess into a relatively usual problem to solve, that is searching for the local minimums of a function. Here is the twist (that explains why I am building a function): I could make it so that each group has exactly the same size (ignoring the rounding of sqrt(N) to the nearest integer) but instead, I want to find a compromise between group size and length of the group name. As groups are named with the pattern <start of group> - <end of group> , I ideally want <start of group> and <end of group> to be of length 3 at most. Since I am fine with counts being "reasonably" different from sqrt(N), I am also fine with them being slightly out of date. My idea therefore is to feed the result of this query into a materialized view that is refreshed e.g. every night. The function works that way: For each item, count how many first letters it has in common with the item immediately before it. Take a SIN squared function, with parameters so that it oscillate sqrt(N) times in the range [1-N]. Insert parametrization into the 2 steps above (add constants, multiply by constant, raise to some power ... whatever seems to give good results once I figure the problem out). Multiply the 2 together to get a "score" Look for a minimum score, it will act as the end of the group. If that helps, here is what it looks like for 100 items (names generated randomly with the below queries), with SIN in blue and the score in black. If I want, e.g. shorter group names at the cost of consistent group sizes, I can tweak the score so that the SIN is not just squared anymore but instead raised to a higher power: that will flatten the troughs of the sin-wave / sharpen the crests. By doing so, more items will be place inside the troughs, therefore I will get more chances that a shorter but off boundary will be preferred over a longer boundary that lands on sqrt(N). Here is a zoomed in version of the 2 charts: Here, the heuristics determins the list should be split around rtetx . The group right before this split will be named [...] - RC and the group after this split will be named RT - [...] . Raising the SIN function to a higher power (note: the software I used to draw the chart interpolates the points into a smooth curve. The curve is only correct on the points, not between them) increases the tolerance, like I said. Now, the group can equally be split around rcEYu or slkkE . Now, the group names will be either: [...] - Q and R - [...] Or [...] - R and S - [...] Now, 1 letter is required for the common boundary of both groups whereas 2 letters were required before. Queries I tried the following query Building the data sample with random data CREATE TABLE Test ( ItemType INTEGER, ItemName VARCHAR ); WITH Chars(chars) AS ( SELECT ARRAY[ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ] ) INSERT INTO Test SELECT t, string_agg(chars[random(0, 165)], '') FROM chars CROSS JOIN generate_series(1, 3) t CROSS JOIN generate_series(1, 5) l CROSS JOIN generate_series(1, 400) i GROUP BY t, i; Finding the text to use in group names (query takes < 5sec, suggests it needs a materialized view). WITH Items(ItemType, ItemName) AS ( SELECT ItemType, TRIM(BOTH FROM upper(ItemName)) FROM Test ), stats1(ItemType, NameStarts) AS ( SELECT DISTINCT Items.ItemType, TRIM(BOTH FROM upper(left(ItemName, generate_series(1, 3)))) AS btrim FROM Items ), stats2(ItemType, NameStarts, NameCount) AS ( SELECT s1.ItemType, s1.NameStarts, count(*) FILTER (WHERE left(i.ItemName, length(s1.NameStarts)) <= s1.NameStarts) AS count FROM stats1 s1 JOIN items i ON s1.ItemType = i.ItemType GROUP BY s1.ItemType, s1.NameStarts ), stats3(ItemType, NameStarts, NameCount, totalnamecount) AS ( SELECT stats2.ItemType, min(stats2.NameStarts) AS min, stats2.NameCount, max(stats2.NameCount) OVER (PARTITION BY stats2.ItemType) AS max FROM stats2 GROUP BY stats2.ItemType, stats2.NameCount ), stats4(ItemType, NameStarts, NameCount, score, groupnumber) AS ( SELECT stats3.ItemType, stats3.NameStarts, stats3.NameCount, length(stats3.NameStarts) * (.05 + .95 * power(sin(pi() * stats3.NameCount / sqrt(stats3.totalnamecount)::integer), 2)), ((stats3.NameCount - sqrt(stats3.totalnamecount) / 2) / sqrt(stats3.totalnamecount))::integer AS int4 FROM stats3 WHERE stats3.NameCount > 4 AND (stats3.totalnamecount - stats3.NameCount) > 4 AND stats3.totalnamecount > 50 ) SELECT s1.ItemType, s1.NameStarts, s1.NameCount FROM stats4 s1 JOIN ( SELECT stats4.ItemType, min(stats4.score) AS bestscore, stats4.groupnumber FROM stats4 GROUP BY stats4.ItemType, stats4.groupnumber ) s2 ON s1.ItemType = s2.ItemType AND s1.groupnumber = s2.groupnumber WHERE s1.score = s2.bestscore Problem In the above query, I have added the NameCount column to track how many items belong to 1 group. As the sample data consists in 3 groups of 400 items each, I expect 3 types, each of 20 groups, each group having around 20 items (thus this 3rd columns should show 0, 20, 40, 60, ...). However, while I get the correct rows, I also get additional groups with 1-2 items in it. For instance, I will see: For the first group: NameCount = 20 For the second group: NameCount = 39 For the third group: NameCount = 41 When this happens, that means the function calculates 2 group boundaries with equal value; one of them needs to go. I can't seem to find an easy way to remove those extra records. Has anyone got an idea? Edit: To clarify what I am after (some of which will be a repetition, bear with me): An application displays the result of the query in its UI. It can (and probably will) process the output of the query. Ultimately, my goal is to decrease the amount of scrolling required to view any item in the list by grouping them into a 2-level hierarchy. for N items, groups should have sqrt(N) groups, each with around sqrt(N) items. The number of item in each group depends on the heuristic being strict (aims at sqrt(N)) or tolerant (aims at a compromise between sqrt(N) and the length of the group name). sqrt(N) is not guaranteed to be an integer. For 10000, I expect exactly 100 groups of 100 items. For 10001, I can accept having 100 or 101 groups. If you choose to create 101 groups, I do not mind items being spread onto all those groups. The approach in my query (at least in 1 version before I try to fix its issues) was to ignore the issue completely: 100 items per group in the first 100 group, 1 item in the final group (it is only fair the final group is smaller as it appears last and requires more scrolling to reach than any of the other groups). There are 3 reasons why I currently save data in a materialized view: It is faster for the application. New data is not inserted often enough in the table for it to matter (think about 10 records inserted in a 10k table, that will often not change the group). Users visiting the same list several times in a day will be guaranteed to get the same grouping. It is only after they go to sleep that the grouping will be different in the UI. Because of the delay between data insertion and grouping update, the query does not need to (and probably should not) return both the lower and upper bound of each group. For example, if 2 consecutive groups are A-B and E-F , the application will show contiguous segments, such as A-D and E-F . If it did not, then items starting with C would not be findable.
I have a PostgreSQL table partitioned by a datetime field called journeyTime . If I have a query where the selection criteria is... WHERE date_trunc('day', journeyTime) = '01-May-2025' I would expect the explain plan to show that the query optimiser has immediately zoomed in on the single partition that all the records for that date are in. It doesn't. Instead it does a full table scan on all partitions in the table. Why?
I have a node js code that authenticates with cookies and sessions: import express from "express"; import session from "express-session"; import postgreSession from "connect-pg-simple"; import { Pool } from "pg"; const app = express(); const PostgreSession = postgreSession(session); const pool = new Pool({ connectionString: process.env.DATABASE_URL }); app.use( session({ store: new PostgreSession({ pool: pool, createTableIfMissing: true }), secret: process.env.SESSION_SECRET, resave: false, saveUninitialized: false, cookie: { httpOnly: true, secure: false, maxAge: 60 * 60 * 1000 }, }), ); and prisma schema. Do I really have to create new model Sessions to keep in sync database and schema? Is there a better approach, something where the prisma(or maybe some other frameworks) handle everything related to keeping in sync sessions in database and schema themselves? Some say to manually create model in prisma: model Session { sid String @id sess Json expire DateTime @@map("session") } I don't know why, it just looks a bit ugly.
Using the Hugging Face transformer library, I want to feed logits (i.e., a vector such that if the softmax is taken would have the probability of each token) as the input to a model. Currently, I convert the logits to an embedding with the following code: token_probabilities = F.softmax(logits,dim=-1) embeddings = token_probabilities @ model.embed_tokens.weight out = model(inputs_embed = embeddings, attention_mask=attention_mask, labels=labels) However, I am concerned that this throws away the positional encoding that the model needs. Does inputs_embed bypass the part of the model where positional data is attached? (for example, when the RoPE is added). Ideally, this would be answered with the general interface that Hugging Face models use, but I specifically care about LlamaForCausalLM if there is no general answer.
I’m building an AI-driven workflow platform using TypeScript, Next.js, Node.js, and GitHub-integrated deployment pipelines. The system coordinates multiple autonomous agents that handle orchestration, API actions, validation layers, and async task execution. Current architecture includes: Next.js frontend Node.js backend services GitHub-connected CI/CD Webhook/event-driven workflows AI agent task routing API validation + retry logic Fintech-oriented security requirements I’m trying to determine best practices for: Preventing cascading failures between autonomous agents Structuring agent-to-agent communication Managing retries/idempotency for webhook events Logging and observability across distributed workflows Safely deploying iterative AI workflow updates to production For developers who have worked on production AI orchestration systems: What architectural patterns worked best? Did you use queues/event buses/service meshes? How did you handle state management and rollback strategies? Would appreciate examples, frameworks, or lessons learned from scaling similar systems.
As an academic in the field of computer science with advanced specialization in artificial intelligence and prompt engineering, I am currently exploring the most effective open-source generative AI frameworks suitable for constructing a comprehensive full-stack large language model (LLM) application. The intended system must be capable of accepting both textual and visual inputs and autonomously generating coherent video outputs. Moreover, this architecture should seamlessly integrate with the Hugging Face ecosystem to ensure streamlined model deployment, inference, and dataset management. An area of particular interest is the development of a continuous optimization workflow that dynamically identifies, retrieves, and deploys the most current and performant model iterations based on specified input parameters. This would effectively ensure uninterrupted system operation and adaptive scalability. Additionally, I aim to investigate the integration of supplementary digital hardware interfaces to enhance computational efficiency, enabling the system to support more complex generative tasks in real time.
What's the equivalent to show tables (from MySQL) in PostgreSQL?
I'm making a Python script to use OpenAI via its API. However, I'm getting this error: openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details My script is the following: #!/usr/bin/env python3.8 # -*- coding: utf-8 -*- import openai openai.api_key = "<My PAI Key>" completion = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": "Tell the world about the ChatGPT API in the style of a pirate."} ] ) print(completion.choices[0].message.content) I'm declaring the shebang python3.8 , because I'm using pyenv . I think it should work, since I did 0 API requests, so I'm assuming there's an error in my code.
I'm currently working on developing a chatbot powered by a Large Language Model (LLM), and I want it to provide responses based on my own documents. I understand that using a fine-tuned model on my documents might not yield direct responses, so I'm exploring the concept of Retrieval-Augmented Generation (RAG) to enhance its performance. In my research, I've come across two tools, Langchain and LlamaIndex, that seem to facilitate RAG. However, I'm struggling to understand the main differences between them. I've noticed that some tutorials and resources use both tools simultaneously, and I'm curious about why one might choose to use one over the other or when it makes sense to use them together. Could someone please provide insights into the key distinctions between Langchain and LlamaIndex for RAG, and when it is beneficial to use one tool over the other or combine them in chatbot development?
Introduction I've been developing software very successfully for many years. The reason I have chosen this profession is multifold: I'm a creative person and I need to create things I have an insatiable drive to think Financial compensation one may expect for doing this I can do my thing without constantly socializing with superficial small-talk The drive to solve real-world problems and to be a force for the better To work from home It has been a great ride to do this and I achieved quite a lot of things. Yet, the industry gradually deteriorated. I do know that sometimes libraries and APIs are needed, but I witnessed too many times the drive to use some library only to solve some problem we could have otherwise easily solved, which to me meant that the specific decision was "going with the vibes" rather than a rational choice. Sure thing, there are libraries that can save us weeks or months of work and easy to integrate while being well-written and I do not argue against the use of such libraries, as the realities of software developer forces us to take the shorter route many times in order to save costs and efforts. And then came in managers, scrum masters, standups and all kinds of things extroverted people forced down our throats, believing those are helpful. Sure, I do recognize the value of periodically reporting what progress we had and what blockers we face, but, to be quite honest, we have: issue trackers we also need to maintain which provide the information of what the progress was ability to comment on tickets when we are stuck, tagging those whose attention we are seeking ability to PM people if there is a blocker So a good compromise is to have a daily written short summary of what is being done and what the problems are, whilst daily standups are causing interruption of the work and then having to rethink what the plan was once the meeting is over. I do not tend to face blockers, but if it happens, I will invest a finite amount of time trying to solve it and do research if it is still unsolved again for a finite amount of time and finally messaging the person who may know the answer if solving the problem took more time and intended. So in the rare case when I enountered a blocker I did not have the means of waiting for a whole day for a standup to mention the issue and then later wait for help, so I reached out to whom it concerned in such cases. Hence, at standups my "blocker" section was empty usually because there were no blockers, occasionally because I removed the blocker much earlier than the standup. My listing of what I solved was oftentimes uninteresting for those whom did not actively work on it and vice-versa, lots of people were mentioning what they were doing and what blockers they faced and many times those comments were completely uninteresting for me as I lacked the context of what they were doing exactly and what the goal was. The latest vibe is to use LLMs. The merits of LLMs Since LLMs have been trained on data publicly available on the internet and hence can provide summaries and even generate code very quickly, some may find it useful. Its summaries are a click of a button away for things that previously took a while to search for. It also generates code and it is a quick process, so some argue that it's increasing productivity. Problems with using LLMs As a software developer I have serious problems with the usage of LLMs. I will outline what my problems are, dissected into categories. I do not expect others to agree with me, since we are supposed to be thinkers and if someone thinks or feels differently, that's fine by me. A. It is thinking instead of me This is very very subjective, I know, but we do need to be honest. As mentioned in the introduction, I have chosen this profession because I want to think and I want to create. If the LLM does the thinking for me in some areas and I am to prompt it and wait for its answers, then I am no longer a programmer, but a quality inspector. Sure, I'm doing that while reviewing PRs already, but not being allowed to write my own code is crossing a line. B. Cognitive debt While doing software development, doing the research needed to implement or fix a feature I am getting context, valuable information that helps me grow with the code and to reuse that context later at other problems that partially or entirely share context with the initial problem. Not getting that context in the order of getting more productive (which may or may not be true) does not allow me to grow as a developer. C. Atrophy Atrophy is a real problem. If we don't use our abilities to think, then it gradually degrades, so we will become more dependent on LLMs and less able to do the craft we master at each iteration. Having like 15 agents run and all one needs to do is to review what they produced significantly reduces or even removes exposure to very important aspects of software development which is being lost over time. Instead of growing as developers, we grow our cognitive debt and shrink our abilities. D. Superficiality Any deep thinker knows that your thinking depth is different if you solve a problem yourself in comparison to handing it over to someone or something else. So if we are to use agents to do stuff for us, then we automatically lose depth and reducing ourselves to be reviewers of a large volume of code we have not written but are responsible of. I am a deep thinker and having to submit to superficiality is detrimental to my motivation. I have also seen quite a lot of code authored by colleagues whom are smart people, but whom did not notice they were duplicating the same id in HTML, duplicating the same functions in different React components, leaked critical API information, written extremely low-performing solutions ran a query for each member of a set rather than running one that finds all and it's been frustrating to see these sometimes long PRs and comment on every fault left in there, it was also frustrating to read PRs which seemed correct with the limited context I had about the ticket, but when actually testing it I realized it was completely wrong. Yet, now I'm being asked (to use a euphemism) to do it myself too. E. Backdoor Any context I am giving to the LLM is as safe as shouting all the info from a rooftop of a house in a crowded street. So if I am to use it, I would always need to be very vigilant on what context it is given, to create an OS user for the LLM and to always keep an eye of what info I might be leaking instead of concentrating on the work. It's seriously disturbing particularly in the occasional case when some urgency clouds one's judgement. F. Security issues it may fall into If I'm writing code, then I keep a keen eye on any potential security issues I may need to address. Since reviewing work is more superficial, by definition I cannot think of a code not written by me in the same depth as if it was my code. If a colleague has written the code then I'm sure he/she was doing his/her best to keep it secure and my second pair of eyes are useful to try and discover what he/she may have missed. Yet, code generated by an LLM has no original author. So particularly when someone works on payment modules using LLMs I am extremely worried for multiple reasons: that LLM will process that code on remote servers sensitive information like API keys/secrets, passwords need to be kept out of its context, a worry we did not have while the only person having access to our dev env was ourselves if the LLM touches very complex, interrelated stuff and misses a detail that may have large security impact may be completely missed by the reviewers of that LLM code, or else the reviewer would have to take a very long time to reread code last read years ago (because context was not being refreshed, see point B.) which defeats the purpose of LLMs some solution it may have downloaded from the internet and "inspired" from it (plagiarism is the right word here from unattributed sources) may have been completely secure on its own context, but not in ours for reasons that we would only detect in case of deep thinking which is seriously limited (see points A., C. and D.) trusting some code I did not touch at all but which was completely rewritten without my knowledge in a way that makes the code I'm writing insecure for relying on a previously made robust solution that was vibed to something else in the meantime G. Unpredictability The same set of prompts may very well result in different solutions. Earlier if I found some golden road to a solution, that idea used to be reusable, because I mentally abstracted the pattern I used to solve the concrete problem and that abstraction was reusable either as it was or with slight modifications for later similar problems. Now, if I'm authoring prompts and getting thousands of lines in response, assuming, perhaps overtly optimistically that the solution would be very good, in order to reuse the same pattern I will need to very carefully study the solution, burning more time than I would have had if I had to code it myself, the alternative being to conclude it's correct without careful study or learning. And this is the best-case scenario. In other scenarios I would prompt all day in the hope of getting something tangible for something that used to be an easy task. H. Accountability I'm extremely uncomfortable to be accountable for a code I did not write nor was I given enough time to study it. Let me elaborate on this. Writing code has never been a culprit for me. It's the thinking that takes the effort, so if I need to reduce effort in order to get more productive, that means I need to think less and prompt more. Which generates more lines than the amount I would have written, based on a style that I'm unfamiliar with, so studying this longer code would take me way more time than writing my shorter, more robust code which I understand already before even writing a letter. So if I am indeed getting more "productive" by using LLM, then by definition I will let parts of "my code" slip my scrutiny with me superficially scanning it over (if at all, depending on how much burden I need to lift in what amount of time) and therefore I will take responsibility for something I do not fully understand nor trust it wholeheartedly. I. Code bloating We always need to aim writing less code to solve the same problem, not to embrace bloated code generated. Back in the day I used to pick up the spaghetti code of low quality devs and reduce it as much as possible, differentiating database code from structure from style from backend code from frontend code and apparently I'm being expected to generate the spaghetti code myself. J. Potential brain frying Of course "increase of productivity" is euphemism to "solve" more problems in the same amount of time for the same money. So if my productivity increases by 10% (a very optimistic estimation as it may very well decrease due to use of LLMs) but I'm "rewarded" by a 60% increase in expectations and the obligation of rapid context-switching between many agents, that's not good for mental health. K. Reliance on something that might not be there Prices might be increasing, servers may get down. If I heavily rely on LLMs, then once they stop being available, for whatever reasons, I'm left in the dark, with less abilities, no context accumulated for a while and a lot of bloated code I do not understand. L. Detrimental results on the environment The data centers waste a lot of energy and water, they are very bad for life around them and I do not want to be part of the problem by using them and contributing to their financing. M. Epistemic collapse I very much care about the general intelligence of the members of society around me. Since many are increasingly using LLMs to do work they used to be able to do themselves, we already are at a stage when people start to forget how to write an email, how to pronounce their own thoughts, how to focus and think on something deeply, how to read a book, how to properly reason (and the bar was not very high on that one in the first place), I do see a quick degradation of cognitive abilities at large, a zombification of society. N. LLMs potentially eating themselves As more and more LLM-generated content floods the internet, the amount of useful, genuinely intelligent information to collect decreases in ratio over time, so LLMs will increasingly learn from content authored by them or content created by people using LLMs to create the content and the models will possibly degenerate as a result. O. Autonomy As a software developer I am coding for money and therefore I need to fulfill tasks I receive. My position is that as long as: my performance is equal than or better than of peers my work quality is acceptable I am reliable I'm helping others I'm finishing things by deadline company secrets are safe with me I should have the autonomy to decide how I work. If I'm told how I should work, moreover, if that way of working is something I find unethical, then a very important principle was breached and created a precedent. If my autonomy as a software developer was breached now, what's the guarantee they won't introduce unilaterally more problematic rules? P. I am an introvert I do not want to socialize too much, I'm more comfortable alone than with others. Sure, I can help whenever help is needed and I can reach out for help when I need to, but normally I would like to be left alone to do my thing. Having to constantly chat is something I hate doing and if the thing I'm chatting with is not even a person, then it's all the more worse. Q. Contributing to the problem instead of solving problems If I'm using LLMs then I support the incredible waste of resources, environmental damage and obscure or even malicious plans of LLM owners. Palantir has a really troubling manifesto and I really do not want to contribute to all this. The situation I have a proven track record of excellent results. I have a lot of contextual knowledge. I help and helped others many times. I am not slower than others whom use LLMs. Yet, I'm being demanded to use LLMs and they keep a leaderboard on who is using up how many tokens, which I find very troubling at personal, professional, philosophical and ethical levels alike. I really like to develop software but only if it is me who develops it. I find it hard to understand why would it be useful for the company if I wasted their money to prompt for solutions I can do. I would find this kind of work uncomfortable. The advice I'm seeking I do think that in 6month - 1 year this vibe will fizzle away and some companies will need developers to fix their vibe codes. If I'm right, by that time those whom used their brain all along and did not give in to the pressure will thrive. If I knew for a fact that this will happen, then I would take a 6 month-period off work, developing only hobby projects and letting the industry learn a hard lesson without having to face it myself. However, if I'm wrong, then this would be a waiting for a result that never comes, wasted up resources and seeking for work with a 6 month gap that would be not so simple to be explained. I'm seriously considering quitting my current cooperation, even though it has been very good for both sides. This latest move of the other side is hard to accept or tolerate, yet, I have a responsibility to earn money with honest work and while using LLMs is not what I am looking for, it would be good to know when this enshittification of the workplace ends, if it ends at all. In the meantime, I do see the symptoms of a global economic crisis when even with my past it may be hard to find work, especially without using LLMs. Because it is not worth it to leave a workplace because of forcing me to use LLMs and joining another one that does the same. So, is there a way to efficiently find work that does not require the use of LLMs ? P.S. Thanks for reading this long post and please excuse me if you find it less technical than my posts in general. However, I think this is a valid developer question that affects everyone here, even those whom are more open to use LLMs than me. Because, at the end of the day, such a use of force to use LLMs may have the hidden goal of replacing devs, so even if you are enthusiastic about LLMs, you might find yourself looking for non-LLM work at some point.
How to efficiently using AIs like claud and chatGPT to improve your programming abilities without losing critical thinking because i feel like we are so hyped up with the AI's ability to give a good response in a way that we are carried away with not able to actually think critically.
in my data model, as the type of id, I want to generate a default value that will start with the user. so the id will bed something like this user..rear33422qeqr type User { myId: String! @default (`user${2+2}`) name: String! email: String! @unique } is it possible to call a javascript function or using string interpolation ( user${2+2} )
I have a PostgreSQL table partitioned by a datetime field called journeyTime . If I have a query where the selection criteria is... WHERE date_trunc('day', journeyTime) = '01-May-2025' I would expect the explain plan to show that the query optimiser has immediately zoomed in on the single partition that all the records for that date are in. It doesn't. Instead it does a full table scan on all partitions in the table. Why?
I am building an online code execution platform similar to LeetCode. Current Architecture Fastify Backend Receives requests from users. Sends code execution requests to a separate Judge service. Judge Service (Dedicated VM) Receives code, language, and input. Spins up a Docker container for each execution request. Runs the code inside the container. Returns the output. Removes the container after execution. Current Problem This architecture works reasonably well for small-scale usage (~100 users), but under higher load I start seeing issues: Some Docker containers are created but never removed. Container cleanup becomes unreliable. Execution failures increase as concurrency grows. Resource usage on the Judge VM becomes unpredictable. Submission Flow I currently have two execution paths: Run Code API Used when users click "Run". Direct HTTP request to the Judge service. No queue is used because users expect an immediate response. Submit Code API Used when users submit a solution. Request is pushed to a Redis queue. BullMQ workers consume jobs and run test cases asynchronously. Scaling Goal I want to scale this system to approximately: 20,000 total users ~1,000 concurrent users Fast response times for the "Run Code" feature Cost-efficient infrastructure Reliable sandboxing and container cleanup Questions What architecture do large platforms (e.g., LeetCode, HackerRank, Codeforces) typically use for code execution at scale? Is spinning up a Docker container per request still a good approach at this scale? Should the "Run Code" API also use a queue, or is there a better pattern for low-latency execution? Would Kubernetes be the recommended solution, or are there better alternatives? How should sandbox lifecycle management and cleanup be handled to prevent orphaned containers? What would be a cost-optimized architecture capable of handling ~1,000 concurrent executions? Are there any open-source judge systems or execution architectures worth studying? Any architecture diagrams, production experience, or recommendations would be greatly appreciated.
I’m building an AI-driven workflow platform using TypeScript, Next.js, Node.js, and GitHub-integrated deployment pipelines. The system coordinates multiple autonomous agents that handle orchestration, API actions, validation layers, and async task execution. Current architecture includes: Next.js frontend Node.js backend services GitHub-connected CI/CD Webhook/event-driven workflows AI agent task routing API validation + retry logic Fintech-oriented security requirements I’m trying to determine best practices for: Preventing cascading failures between autonomous agents Structuring agent-to-agent communication Managing retries/idempotency for webhook events Logging and observability across distributed workflows Safely deploying iterative AI workflow updates to production For developers who have worked on production AI orchestration systems: What architectural patterns worked best? Did you use queues/event buses/service meshes? How did you handle state management and rollback strategies? Would appreciate examples, frameworks, or lessons learned from scaling similar systems.
As an academic in the field of computer science with advanced specialization in artificial intelligence and prompt engineering, I am currently exploring the most effective open-source generative AI frameworks suitable for constructing a comprehensive full-stack large language model (LLM) application. The intended system must be capable of accepting both textual and visual inputs and autonomously generating coherent video outputs. Moreover, this architecture should seamlessly integrate with the Hugging Face ecosystem to ensure streamlined model deployment, inference, and dataset management. An area of particular interest is the development of a continuous optimization workflow that dynamically identifies, retrieves, and deploys the most current and performant model iterations based on specified input parameters. This would effectively ensure uninterrupted system operation and adaptive scalability. Additionally, I aim to investigate the integration of supplementary digital hardware interfaces to enhance computational efficiency, enabling the system to support more complex generative tasks in real time.
What's the equivalent to show tables (from MySQL) in PostgreSQL?
I'm making a Python script to use OpenAI via its API. However, I'm getting this error: openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details My script is the following: #!/usr/bin/env python3.8 # -*- coding: utf-8 -*- import openai openai.api_key = "<My PAI Key>" completion = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": "Tell the world about the ChatGPT API in the style of a pirate."} ] ) print(completion.choices[0].message.content) I'm declaring the shebang python3.8 , because I'm using pyenv . I think it should work, since I did 0 API requests, so I'm assuming there's an error in my code.
I'm currently working on developing a chatbot powered by a Large Language Model (LLM), and I want it to provide responses based on my own documents. I understand that using a fine-tuned model on my documents might not yield direct responses, so I'm exploring the concept of Retrieval-Augmented Generation (RAG) to enhance its performance. In my research, I've come across two tools, Langchain and LlamaIndex, that seem to facilitate RAG. However, I'm struggling to understand the main differences between them. I've noticed that some tutorials and resources use both tools simultaneously, and I'm curious about why one might choose to use one over the other or when it makes sense to use them together. Could someone please provide insights into the key distinctions between Langchain and LlamaIndex for RAG, and when it is beneficial to use one tool over the other or combine them in chatbot development?
How to efficiently using AIs like claud and chatGPT to improve your programming abilities without losing critical thinking because i feel like we are so hyped up with the AI's ability to give a good response in a way that we are carried away with not able to actually think critically.
in my data model, as the type of id, I want to generate a default value that will start with the user. so the id will bed something like this user..rear33422qeqr type User { myId: String! @default (`user${2+2}`) name: String! email: String! @unique } is it possible to call a javascript function or using string interpolation ( user${2+2} )
I have a PostgreSQL table partitioned by a datetime field called journeyTime . If I have a query where the selection criteria is... WHERE date_trunc('day', journeyTime) = '01-May-2025' I would expect the explain plan to show that the query optimiser has immediately zoomed in on the single partition that all the records for that date are in. It doesn't. Instead it does a full table scan on all partitions in the table. Why?
Using the Hugging Face transformer library, I want to feed logits (i.e., a vector such that if the softmax is taken would have the probability of each token) as the input to a model. Currently, I convert the logits to an embedding with the following code: token_probabilities = F.softmax(logits,dim=-1) embeddings = token_probabilities @ model.embed_tokens.weight out = model(inputs_embed = embeddings, attention_mask=attention_mask, labels=labels) However, I am concerned that this throws away the positional encoding that the model needs. Does inputs_embed bypass the part of the model where positional data is attached? (for example, when the RoPE is added). Ideally, this would be answered with the general interface that Hugging Face models use, but I specifically care about LlamaForCausalLM if there is no general answer.
I’m building an AI-driven workflow platform using TypeScript, Next.js, Node.js, and GitHub-integrated deployment pipelines. The system coordinates multiple autonomous agents that handle orchestration, API actions, validation layers, and async task execution. Current architecture includes: Next.js frontend Node.js backend services GitHub-connected CI/CD Webhook/event-driven workflows AI agent task routing API validation + retry logic Fintech-oriented security requirements I’m trying to determine best practices for: Preventing cascading failures between autonomous agents Structuring agent-to-agent communication Managing retries/idempotency for webhook events Logging and observability across distributed workflows Safely deploying iterative AI workflow updates to production For developers who have worked on production AI orchestration systems: What architectural patterns worked best? Did you use queues/event buses/service meshes? How did you handle state management and rollback strategies? Would appreciate examples, frameworks, or lessons learned from scaling similar systems.
Introduction I've been developing software very successfully for many years. The reason I have chosen this profession is multifold: I'm a creative person and I need to create things I have an insatiable drive to think Financial compensation one may expect for doing this I can do my thing without constantly socializing with superficial small-talk The drive to solve real-world problems and to be a force for the better To work from home It has been a great ride to do this and I achieved quite a lot of things. Yet, the industry gradually deteriorated. I do know that sometimes libraries and APIs are needed, but I witnessed too many times the drive to use some library only to solve some problem we could have otherwise easily solved, which to me meant that the specific decision was "going with the vibes" rather than a rational choice. Sure thing, there are libraries that can save us weeks or months of work and easy to integrate while being well-written and I do not argue against the use of such libraries, as the realities of software developer forces us to take the shorter route many times in order to save costs and efforts. And then came in managers, scrum masters, standups and all kinds of things extroverted people forced down our throats, believing those are helpful. Sure, I do recognize the value of periodically reporting what progress we had and what blockers we face, but, to be quite honest, we have: issue trackers we also need to maintain which provide the information of what the progress was ability to comment on tickets when we are stuck, tagging those whose attention we are seeking ability to PM people if there is a blocker So a good compromise is to have a daily written short summary of what is being done and what the problems are, whilst daily standups are causing interruption of the work and then having to rethink what the plan was once the meeting is over. I do not tend to face blockers, but if it happens, I will invest a finite amount of time trying to solve it and do research if it is still unsolved again for a finite amount of time and finally messaging the person who may know the answer if solving the problem took more time and intended. So in the rare case when I enountered a blocker I did not have the means of waiting for a whole day for a standup to mention the issue and then later wait for help, so I reached out to whom it concerned in such cases. Hence, at standups my "blocker" section was empty usually because there were no blockers, occasionally because I removed the blocker much earlier than the standup. My listing of what I solved was oftentimes uninteresting for those whom did not actively work on it and vice-versa, lots of people were mentioning what they were doing and what blockers they faced and many times those comments were completely uninteresting for me as I lacked the context of what they were doing exactly and what the goal was. The latest vibe is to use LLMs. The merits of LLMs Since LLMs have been trained on data publicly available on the internet and hence can provide summaries and even generate code very quickly, some may find it useful. Its summaries are a click of a button away for things that previously took a while to search for. It also generates code and it is a quick process, so some argue that it's increasing productivity. Problems with using LLMs As a software developer I have serious problems with the usage of LLMs. I will outline what my problems are, dissected into categories. I do not expect others to agree with me, since we are supposed to be thinkers and if someone thinks or feels differently, that's fine by me. A. It is thinking instead of me This is very very subjective, I know, but we do need to be honest. As mentioned in the introduction, I have chosen this profession because I want to think and I want to create. If the LLM does the thinking for me in some areas and I am to prompt it and wait for its answers, then I am no longer a programmer, but a quality inspector. Sure, I'm doing that while reviewing PRs already, but not being allowed to write my own code is crossing a line. B. Cognitive debt While doing software development, doing the research needed to implement or fix a feature I am getting context, valuable information that helps me grow with the code and to reuse that context later at other problems that partially or entirely share context with the initial problem. Not getting that context in the order of getting more productive (which may or may not be true) does not allow me to grow as a developer. C. Atrophy Atrophy is a real problem. If we don't use our abilities to think, then it gradually degrades, so we will become more dependent on LLMs and less able to do the craft we master at each iteration. Having like 15 agents run and all one needs to do is to review what they produced significantly reduces or even removes exposure to very important aspects of software development which is being lost over time. Instead of growing as developers, we grow our cognitive debt and shrink our abilities. D. Superficiality Any deep thinker knows that your thinking depth is different if you solve a problem yourself in comparison to handing it over to someone or something else. So if we are to use agents to do stuff for us, then we automatically lose depth and reducing ourselves to be reviewers of a large volume of code we have not written but are responsible of. I am a deep thinker and having to submit to superficiality is detrimental to my motivation. I have also seen quite a lot of code authored by colleagues whom are smart people, but whom did not notice they were duplicating the same id in HTML, duplicating the same functions in different React components, leaked critical API information, written extremely low-performing solutions ran a query for each member of a set rather than running one that finds all and it's been frustrating to see these sometimes long PRs and comment on every fault left in there, it was also frustrating to read PRs which seemed correct with the limited context I had about the ticket, but when actually testing it I realized it was completely wrong. Yet, now I'm being asked (to use a euphemism) to do it myself too. E. Backdoor Any context I am giving to the LLM is as safe as shouting all the info from a rooftop of a house in a crowded street. So if I am to use it, I would always need to be very vigilant on what context it is given, to create an OS user for the LLM and to always keep an eye of what info I might be leaking instead of concentrating on the work. It's seriously disturbing particularly in the occasional case when some urgency clouds one's judgement. F. Security issues it may fall into If I'm writing code, then I keep a keen eye on any potential security issues I may need to address. Since reviewing work is more superficial, by definition I cannot think of a code not written by me in the same depth as if it was my code. If a colleague has written the code then I'm sure he/she was doing his/her best to keep it secure and my second pair of eyes are useful to try and discover what he/she may have missed. Yet, code generated by an LLM has no original author. So particularly when someone works on payment modules using LLMs I am extremely worried for multiple reasons: that LLM will process that code on remote servers sensitive information like API keys/secrets, passwords need to be kept out of its context, a worry we did not have while the only person having access to our dev env was ourselves if the LLM touches very complex, interrelated stuff and misses a detail that may have large security impact may be completely missed by the reviewers of that LLM code, or else the reviewer would have to take a very long time to reread code last read years ago (because context was not being refreshed, see point B.) which defeats the purpose of LLMs some solution it may have downloaded from the internet and "inspired" from it (plagiarism is the right word here from unattributed sources) may have been completely secure on its own context, but not in ours for reasons that we would only detect in case of deep thinking which is seriously limited (see points A., C. and D.) trusting some code I did not touch at all but which was completely rewritten without my knowledge in a way that makes the code I'm writing insecure for relying on a previously made robust solution that was vibed to something else in the meantime G. Unpredictability The same set of prompts may very well result in different solutions. Earlier if I found some golden road to a solution, that idea used to be reusable, because I mentally abstracted the pattern I used to solve the concrete problem and that abstraction was reusable either as it was or with slight modifications for later similar problems. Now, if I'm authoring prompts and getting thousands of lines in response, assuming, perhaps overtly optimistically that the solution would be very good, in order to reuse the same pattern I will need to very carefully study the solution, burning more time than I would have had if I had to code it myself, the alternative being to conclude it's correct without careful study or learning. And this is the best-case scenario. In other scenarios I would prompt all day in the hope of getting something tangible for something that used to be an easy task. H. Accountability I'm extremely uncomfortable to be accountable for a code I did not write nor was I given enough time to study it. Let me elaborate on this. Writing code has never been a culprit for me. It's the thinking that takes the effort, so if I need to reduce effort in order to get more productive, that means I need to think less and prompt more. Which generates more lines than the amount I would have written, based on a style that I'm unfamiliar with, so studying this longer code would take me way more time than writing my shorter, more robust code which I understand already before even writing a letter. So if I am indeed getting more "productive" by using LLM, then by definition I will let parts of "my code" slip my scrutiny with me superficially scanning it over (if at all, depending on how much burden I need to lift in what amount of time) and therefore I will take responsibility for something I do not fully understand nor trust it wholeheartedly. I. Code bloating We always need to aim writing less code to solve the same problem, not to embrace bloated code generated. Back in the day I used to pick up the spaghetti code of low quality devs and reduce it as much as possible, differentiating database code from structure from style from backend code from frontend code and apparently I'm being expected to generate the spaghetti code myself. J. Potential brain frying Of course "increase of productivity" is euphemism to "solve" more problems in the same amount of time for the same money. So if my productivity increases by 10% (a very optimistic estimation as it may very well decrease due to use of LLMs) but I'm "rewarded" by a 60% increase in expectations and the obligation of rapid context-switching between many agents, that's not good for mental health. K. Reliance on something that might not be there Prices might be increasing, servers may get down. If I heavily rely on LLMs, then once they stop being available, for whatever reasons, I'm left in the dark, with less abilities, no context accumulated for a while and a lot of bloated code I do not understand. L. Detrimental results on the environment The data centers waste a lot of energy and water, they are very bad for life around them and I do not want to be part of the problem by using them and contributing to their financing. M. Epistemic collapse I very much care about the general intelligence of the members of society around me. Since many are increasingly using LLMs to do work they used to be able to do themselves, we already are at a stage when people start to forget how to write an email, how to pronounce their own thoughts, how to focus and think on something deeply, how to read a book, how to properly reason (and the bar was not very high on that one in the first place), I do see a quick degradation of cognitive abilities at large, a zombification of society. N. LLMs potentially eating themselves As more and more LLM-generated content floods the internet, the amount of useful, genuinely intelligent information to collect decreases in ratio over time, so LLMs will increasingly learn from content authored by them or content created by people using LLMs to create the content and the models will possibly degenerate as a result. O. Autonomy As a software developer I am coding for money and therefore I need to fulfill tasks I receive. My position is that as long as: my performance is equal than or better than of peers my work quality is acceptable I am reliable I'm helping others I'm finishing things by deadline company secrets are safe with me I should have the autonomy to decide how I work. If I'm told how I should work, moreover, if that way of working is something I find unethical, then a very important principle was breached and created a precedent. If my autonomy as a software developer was breached now, what's the guarantee they won't introduce unilaterally more problematic rules? P. I am an introvert I do not want to socialize too much, I'm more comfortable alone than with others. Sure, I can help whenever help is needed and I can reach out for help when I need to, but normally I would like to be left alone to do my thing. Having to constantly chat is something I hate doing and if the thing I'm chatting with is not even a person, then it's all the more worse. Q. Contributing to the problem instead of solving problems If I'm using LLMs then I support the incredible waste of resources, environmental damage and obscure or even malicious plans of LLM owners. Palantir has a really troubling manifesto and I really do not want to contribute to all this. The situation I have a proven track record of excellent results. I have a lot of contextual knowledge. I help and helped others many times. I am not slower than others whom use LLMs. Yet, I'm being demanded to use LLMs and they keep a leaderboard on who is using up how many tokens, which I find very troubling at personal, professional, philosophical and ethical levels alike. I really like to develop software but only if it is me who develops it. I find it hard to understand why would it be useful for the company if I wasted their money to prompt for solutions I can do. I would find this kind of work uncomfortable. The advice I'm seeking I do think that in 6month - 1 year this vibe will fizzle away and some companies will need developers to fix their vibe codes. If I'm right, by that time those whom used their brain all along and did not give in to the pressure will thrive. If I knew for a fact that this will happen, then I would take a 6 month-period off work, developing only hobby projects and letting the industry learn a hard lesson without having to face it myself. However, if I'm wrong, then this would be a waiting for a result that never comes, wasted up resources and seeking for work with a 6 month gap that would be not so simple to be explained. I'm seriously considering quitting my current cooperation, even though it has been very good for both sides. This latest move of the other side is hard to accept or tolerate, yet, I have a responsibility to earn money with honest work and while using LLMs is not what I am looking for, it would be good to know when this enshittification of the workplace ends, if it ends at all. In the meantime, I do see the symptoms of a global economic crisis when even with my past it may be hard to find work, especially without using LLMs. Because it is not worth it to leave a workplace because of forcing me to use LLMs and joining another one that does the same. So, is there a way to efficiently find work that does not require the use of LLMs ? P.S. Thanks for reading this long post and please excuse me if you find it less technical than my posts in general. However, I think this is a valid developer question that affects everyone here, even those whom are more open to use LLMs than me. Because, at the end of the day, such a use of force to use LLMs may have the hidden goal of replacing devs, so even if you are enthusiastic about LLMs, you might find yourself looking for non-LLM work at some point.
I am building an online code execution platform similar to LeetCode. Current Architecture Fastify Backend Receives requests from users. Sends code execution requests to a separate Judge service. Judge Service (Dedicated VM) Receives code, language, and input. Spins up a Docker container for each execution request. Runs the code inside the container. Returns the output. Removes the container after execution. Current Problem This architecture works reasonably well for small-scale usage (~100 users), but under higher load I start seeing issues: Some Docker containers are created but never removed. Container cleanup becomes unreliable. Execution failures increase as concurrency grows. Resource usage on the Judge VM becomes unpredictable. Submission Flow I currently have two execution paths: Run Code API Used when users click "Run". Direct HTTP request to the Judge service. No queue is used because users expect an immediate response. Submit Code API Used when users submit a solution. Request is pushed to a Redis queue. BullMQ workers consume jobs and run test cases asynchronously. Scaling Goal I want to scale this system to approximately: 20,000 total users ~1,000 concurrent users Fast response times for the "Run Code" feature Cost-efficient infrastructure Reliable sandboxing and container cleanup Questions What architecture do large platforms (e.g., LeetCode, HackerRank, Codeforces) typically use for code execution at scale? Is spinning up a Docker container per request still a good approach at this scale? Should the "Run Code" API also use a queue, or is there a better pattern for low-latency execution? Would Kubernetes be the recommended solution, or are there better alternatives? How should sandbox lifecycle management and cleanup be handled to prevent orphaned containers? What would be a cost-optimized architecture capable of handling ~1,000 concurrent executions? Are there any open-source judge systems or execution architectures worth studying? Any architecture diagrams, production experience, or recommendations would be greatly appreciated.
What's the equivalent to show tables (from MySQL) in PostgreSQL?
I'm making a Python script to use OpenAI via its API. However, I'm getting this error: openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details My script is the following: #!/usr/bin/env python3.8 # -*- coding: utf-8 -*- import openai openai.api_key = "<My PAI Key>" completion = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": "Tell the world about the ChatGPT API in the style of a pirate."} ] ) print(completion.choices[0].message.content) I'm declaring the shebang python3.8 , because I'm using pyenv . I think it should work, since I did 0 API requests, so I'm assuming there's an error in my code.
I'm currently working on developing a chatbot powered by a Large Language Model (LLM), and I want it to provide responses based on my own documents. I understand that using a fine-tuned model on my documents might not yield direct responses, so I'm exploring the concept of Retrieval-Augmented Generation (RAG) to enhance its performance. In my research, I've come across two tools, Langchain and LlamaIndex, that seem to facilitate RAG. However, I'm struggling to understand the main differences between them. I've noticed that some tutorials and resources use both tools simultaneously, and I'm curious about why one might choose to use one over the other or when it makes sense to use them together. Could someone please provide insights into the key distinctions between Langchain and LlamaIndex for RAG, and when it is beneficial to use one tool over the other or combine them in chatbot development?
How to efficiently using AIs like claud and chatGPT to improve your programming abilities without losing critical thinking because i feel like we are so hyped up with the AI's ability to give a good response in a way that we are carried away with not able to actually think critically.
in my data model, as the type of id, I want to generate a default value that will start with the user. so the id will bed something like this user..rear33422qeqr type User { myId: String! @default (`user${2+2}`) name: String! email: String! @unique } is it possible to call a javascript function or using string interpolation ( user${2+2} )
I am working on a project where I need to represent a tree structure (categories and subcategories) in PostgreSQL. I know the basic "Adjacency List" approach, where each row has a parent_id pointing to its parent node. However, I am concerned about performance when I need to query all descendants of a node at deep levels. Is it better to use recursive queries ( WITH RECURSIVE ) with the parent_id approach, or should I consider PostgreSQL extensions like ltree to handle trees more efficiently? Thanks for the help!
I created a tool called Privacy Policy Analyzer, which uses LLMs to evaluate real-world privacy policies. It scores policies from platforms like GitHub, TikTok, and Facebook based on criteria such as data retention, cross-border data transfer, transparency, and user rights. The analyzer provides a strengths and risks breakdown along with an overall score for each policy. You can check out the repository here: https://github.com/myz21/privacy-policy-analyzer And see an example of the analysis results here: https://github.com/myz21/privacy-policy-analyzer/blob/main/RESULTS.md The main issue: While the results are detailed, the analysis process is pretty slow. Each policy takes around 25 to 37 seconds to process. This feels way too long for batch jobs, and I am trying to figure out if the primary bottleneck is LLM token generation latency, the policy fetching and parsing step, or my own code architecture. Has anyone tackled similar performance issues in LLM-powered document analyzers? Any tips for speeding things up, optimizing the pipeline, or best practices for handling long-form text analysis efficiently? All suggestions and critiques are appreciated!
I’m building an AI-driven workflow platform using TypeScript, Next.js, Node.js, and GitHub-integrated deployment pipelines. The system coordinates multiple autonomous agents that handle orchestration, API actions, validation layers, and async task execution. Current architecture includes: Next.js frontend Node.js backend services GitHub-connected CI/CD Webhook/event-driven workflows AI agent task routing API validation + retry logic Fintech-oriented security requirements I’m trying to determine best practices for: Preventing cascading failures between autonomous agents Structuring agent-to-agent communication Managing retries/idempotency for webhook events Logging and observability across distributed workflows Safely deploying iterative AI workflow updates to production For developers who have worked on production AI orchestration systems: What architectural patterns worked best? Did you use queues/event buses/service meshes? How did you handle state management and rollback strategies? Would appreciate examples, frameworks, or lessons learned from scaling similar systems.
I am working on a Spring Boot university project where the application can use either MongoDB or PostgreSQL depending on the selected storage mode. Right now I have two repository implementations that use @ConditionalOnProperty . MongoDB repository: @Repository @ConditionalOnProperty(name = "app.storage", havingValue = "mongo") public class MongoTreeRepository implements TreeRepository { } PostgreSQL repository: @Repository @ConditionalOnProperty(name = "app.storage", havingValue = "postgres") public class PostgresTreeRepository implements TreeRepository { } In my application.properties file I use either: app.storage=mongo or: app.storage=postgres This works correctly during application startup. The injected repository changes depending on the property value before Spring Boot initializes the application context. My service currently looks like this: @Service public class TreeService { private final TreeRepository repository; public TreeService(TreeRepository repository) { this.repository = repository; } } The problem started when I tried to understand if Spring Boot can re-evaluate those conditional beans while the application is already running. For example, I wanted to test a scenario like this: Start the application using MongoDB Change the storage mode dynamically Switch to PostgreSQL without restarting the backend I am not trying to reload configuration files automatically. My question is specifically about bean behavior and dependency injection after the Spring context has already been initialized. I already tried: changing the property value at runtime creating both repositories as beans selecting implementations manually using if conditions testing different service configurations However, the injected repository does not change unless I restart the application. I understand that Spring creates beans during application startup, but I am trying to understand whether conditional beans can be refreshed or re-evaluated later without rebuilding the application context. I reviewed similar questions about switching repositories and Spring profiles, but most examples focus on startup configuration instead of bean behavior after the context has already been initialized. My questions are: Is @ConditionalOnProperty evaluated only during Spring Boot startup? Are conditional beans re-created automatically if the property changes later? Would another approach or design pattern be more appropriate for runtime switching between repositories?
Using the Hugging Face transformer library, I want to feed logits (i.e., a vector such that if the softmax is taken would have the probability of each token) as the input to a model. Currently, I convert the logits to an embedding with the following code: token_probabilities = F.softmax(logits,dim=-1) embeddings = token_probabilities @ model.embed_tokens.weight out = model(inputs_embed = embeddings, attention_mask=attention_mask, labels=labels) However, I am concerned that this throws away the positional encoding that the model needs. Does inputs_embed bypass the part of the model where positional data is attached? (for example, when the RoPE is added). Ideally, this would be answered with the general interface that Hugging Face models use, but I specifically care about LlamaForCausalLM if there is no general answer.
What's the equivalent to show tables (from MySQL) in PostgreSQL?
I'm making a Python script to use OpenAI via its API. However, I'm getting this error: openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details My script is the following: #!/usr/bin/env python3.8 # -*- coding: utf-8 -*- import openai openai.api_key = "<My PAI Key>" completion = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": "Tell the world about the ChatGPT API in the style of a pirate."} ] ) print(completion.choices[0].message.content) I'm declaring the shebang python3.8 , because I'm using pyenv . I think it should work, since I did 0 API requests, so I'm assuming there's an error in my code.
I'm currently working on developing a chatbot powered by a Large Language Model (LLM), and I want it to provide responses based on my own documents. I understand that using a fine-tuned model on my documents might not yield direct responses, so I'm exploring the concept of Retrieval-Augmented Generation (RAG) to enhance its performance. In my research, I've come across two tools, Langchain and LlamaIndex, that seem to facilitate RAG. However, I'm struggling to understand the main differences between them. I've noticed that some tutorials and resources use both tools simultaneously, and I'm curious about why one might choose to use one over the other or when it makes sense to use them together. Could someone please provide insights into the key distinctions between Langchain and LlamaIndex for RAG, and when it is beneficial to use one tool over the other or combine them in chatbot development?
How to efficiently using AIs like claud and chatGPT to improve your programming abilities without losing critical thinking because i feel like we are so hyped up with the AI's ability to give a good response in a way that we are carried away with not able to actually think critically.
My entire database occasionally has entries which are wrong, but instead of altering the data directly I'd like the ability to keep a revision of changes. These changes occur very rarely. Ideally something like this: - (original table fields) | revision_version | origin | user | timestamp So say I had a table called posts with the following schema: - title | description | timestamp | author An additional table called posts_revisions would be created thusly: - title | description | timestamp | author | revision_version | origin | user | timestamp origin being the source of the change, be it a bot, user generated or what have you. As you can imagine this is a rather large change to the existing database, my current concern is the performance hit of checking the _revisions tables for every query. Is this best practice for this sort of thing?
I created a tool called Privacy Policy Analyzer, which uses LLMs to evaluate real-world privacy policies. It scores policies from platforms like GitHub, TikTok, and Facebook based on criteria such as data retention, cross-border data transfer, transparency, and user rights. The analyzer provides a strengths and risks breakdown along with an overall score for each policy. You can check out the repository here: https://github.com/myz21/privacy-policy-analyzer And see an example of the analysis results here: https://github.com/myz21/privacy-policy-analyzer/blob/main/RESULTS.md The main issue: While the results are detailed, the analysis process is pretty slow. Each policy takes around 25 to 37 seconds to process. This feels way too long for batch jobs, and I am trying to figure out if the primary bottleneck is LLM token generation latency, the policy fetching and parsing step, or my own code architecture. Has anyone tackled similar performance issues in LLM-powered document analyzers? Any tips for speeding things up, optimizing the pipeline, or best practices for handling long-form text analysis efficiently? All suggestions and critiques are appreciated!
I would like to execute a case insensitive match on a column looking for any match for a given array of strings. Example: If a row contained values id, comment 1, 'This is my comment' And I was trying to match any term in the array ('statement','term','comment') I would love a query something like this SELECT * FROM table_name WHERE ( string_to_array(comment, ' ') ANY ('{term}') ); Now I understand the ANY function is meant to be applied to array columns but this is effectively what I would like to achieve. What I am trying to avoid is having to iterate through all of the terms and execute an individual query for each and then have to remove duplicates etc etc. EDIT: So I was able to find a solution which seems to work. Although I would still love more feedback to determine if this is a reasonable approach. SELECT * FROM table_name WHERE string_to_array(LOWER(column_name), ' ')::varchar[] && '{term1,term2,term3}'::varchar[];
I’m building an AI-driven workflow platform using TypeScript, Next.js, Node.js, and GitHub-integrated deployment pipelines. The system coordinates multiple autonomous agents that handle orchestration, API actions, validation layers, and async task execution. Current architecture includes: Next.js frontend Node.js backend services GitHub-connected CI/CD Webhook/event-driven workflows AI agent task routing API validation + retry logic Fintech-oriented security requirements I’m trying to determine best practices for: Preventing cascading failures between autonomous agents Structuring agent-to-agent communication Managing retries/idempotency for webhook events Logging and observability across distributed workflows Safely deploying iterative AI workflow updates to production For developers who have worked on production AI orchestration systems: What architectural patterns worked best? Did you use queues/event buses/service meshes? How did you handle state management and rollback strategies? Would appreciate examples, frameworks, or lessons learned from scaling similar systems.
I am working on a NEXT.js project that uses Prisma and Supabase Postgres.My project structure is: Directory structure: └── lunartech-x-dark-phoenix/ ├── ai-podcast-clipper-backend/ │ ├── requirements.txt │ ├── ytdownload.py │ └── asd/ │ └── model/ │ └── faceDetector/ │ ├── README.md │ └── __init__.py └── ai-podcast-clipper-frontend/ ├── add-credits.js ├── components.json ├── next.config.js ├── postcss.config.js ├── prettier.config.js ├── tsconfig.json └── src/ ├── app/ │ ├── layout.tsx │ ├── api/ │ │ ├── auth/ │ │ │ └── [...nextauth]/ │ │ │ └── route.ts │ │ └── inngest/ │ │ └── route.ts │ ├── dashboard/ │ │ ├── layout.tsx │ │ └── loading.tsx │ ├── login/ │ │ └── page.tsx │ └── signup/ │ └── page.tsx ├── components/ │ └── ui/ │ ├── input.tsx │ ├── label.tsx │ └── sonner.tsx ├── inngest/ │ └── client.ts ├── lib/ │ ├── auth.ts │ └── utils.ts ├── schemas/ │ └── auth.ts └── server/ ├── db.ts └── auth/ └── index.ts The root .env file is supposed to be the single source of environment variables for the whole project. In .env , I have: DATABASE_URL="postgresql://postgres.PROJECT_REF:MY_PASSWORD@aws-1-ap-southeast-2.pooler.supabase.com:5432/postgres" My prisma schema has: datasource db { provider = "postgresql" url = env("DATABASE_URL") } When I run this command from the frontend folder: cd ai-podcast-clipper-frontend npm run db:push The script runs: prisma db push But I get this error: PS E:\LunarTechTakeHomeAssignment(DarkPhoenix)\DARK-PHOENIX\ai-podcast-clipper-frontend> npm run db:push > ai-podcast-clipper-frontend@0.1.0 db:push > prisma db push Prisma schema loaded from prisma\schema.prisma Error: Prisma schema validation - (get-config wasm) Error code: P1012 error: Environment variable not found: DATABASE_URL. --> prisma\schema.prisma:14 | 13 | // https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string 14 | url = env("DATABASE_URL") | Validation Error Count: 1 [Context: getConfig] Prisma CLI Version : 6.7.0 The Next.js config loads the parent .env using loadEnvConfig("..") , but it seems Prisma CLI does not load the parent .env when I run prisma db push. Should I duplicate DATABASE_URL inside ai-podcast-clipper-frontend/.env , or should I use something like dotenv-cli ? What is the cleanest way to make prisma db push read ../.env ? For a Supabase connection string, should [YOUR-PASSWORD] include the square brackets, or should I replace the whole placeholder? I am using: Prisma CLI: 6.7.0 Node.js: 20+ Windows PowerShell Supabase Postgres Next.js frontend I want to keep the root .env as the single source of truth if possible. If there is any issue with my Supabase connection, I tried using both Direct Connection and Session Pooler connection. The associated repository link is : https://github.com/LUNARTECH-X/DARK-PHOENIX
Using the Hugging Face transformer library, I want to feed logits (i.e., a vector such that if the softmax is taken would have the probability of each token) as the input to a model. Currently, I convert the logits to an embedding with the following code: token_probabilities = F.softmax(logits,dim=-1) embeddings = token_probabilities @ model.embed_tokens.weight out = model(inputs_embed = embeddings, attention_mask=attention_mask, labels=labels) However, I am concerned that this throws away the positional encoding that the model needs. Does inputs_embed bypass the part of the model where positional data is attached? (for example, when the RoPE is added). Ideally, this would be answered with the general interface that Hugging Face models use, but I specifically care about LlamaForCausalLM if there is no general answer.
What's the equivalent to show tables (from MySQL) in PostgreSQL?
I'm making a Python script to use OpenAI via its API. However, I'm getting this error: openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details My script is the following: #!/usr/bin/env python3.8 # -*- coding: utf-8 -*- import openai openai.api_key = "<My PAI Key>" completion = openai.ChatCompletion.create( model="gpt-3.5-turbo", messages=[ {"role": "user", "content": "Tell the world about the ChatGPT API in the style of a pirate."} ] ) print(completion.choices[0].message.content) I'm declaring the shebang python3.8 , because I'm using pyenv . I think it should work, since I did 0 API requests, so I'm assuming there's an error in my code.
I'm currently working on developing a chatbot powered by a Large Language Model (LLM), and I want it to provide responses based on my own documents. I understand that using a fine-tuned model on my documents might not yield direct responses, so I'm exploring the concept of Retrieval-Augmented Generation (RAG) to enhance its performance. In my research, I've come across two tools, Langchain and LlamaIndex, that seem to facilitate RAG. However, I'm struggling to understand the main differences between them. I've noticed that some tutorials and resources use both tools simultaneously, and I'm curious about why one might choose to use one over the other or when it makes sense to use them together. Could someone please provide insights into the key distinctions between Langchain and LlamaIndex for RAG, and when it is beneficial to use one tool over the other or combine them in chatbot development?
How to efficiently using AIs like claud and chatGPT to improve your programming abilities without losing critical thinking because i feel like we are so hyped up with the AI's ability to give a good response in a way that we are carried away with not able to actually think critically.
I created a tool called Privacy Policy Analyzer, which uses LLMs to evaluate real-world privacy policies. It scores policies from platforms like GitHub, TikTok, and Facebook based on criteria such as data retention, cross-border data transfer, transparency, and user rights. The analyzer provides a strengths and risks breakdown along with an overall score for each policy. You can check out the repository here: https://github.com/myz21/privacy-policy-analyzer And see an example of the analysis results here: https://github.com/myz21/privacy-policy-analyzer/blob/main/RESULTS.md The main issue: While the results are detailed, the analysis process is pretty slow. Each policy takes around 25 to 37 seconds to process. This feels way too long for batch jobs, and I am trying to figure out if the primary bottleneck is LLM token generation latency, the policy fetching and parsing step, or my own code architecture. Has anyone tackled similar performance issues in LLM-powered document analyzers? Any tips for speeding things up, optimizing the pipeline, or best practices for handling long-form text analysis efficiently? All suggestions and critiques are appreciated!
I have 4 tables: domains: :has many => channels :has_many => sales :has_many => visits I'm trying to get all my domains, channels count, sales count and visits count for each domain in this query: SELECT kd.id, kd.domain, COUNT(distinct kc.id) AS channels_count, COUNT(distinct kv.id) AS visits_count, COUNT(distinct kv.ip_address) AS visitors_count, COUNT(distinct ks.id) AS sales_count FROM domains AS kd LEFT JOIN channels AS kc ON(kc.domain_id=kd.id) LEFT JOIN sales AS ks ON(ks.channel_id=kc.id) LEFT JOIN visits AS kv ON(kv.channel_id=kc.id) GROUP BY kd.id I have a few thousand records in sales and visits table, nothing big but my query takes forever. It never comes back. Any idea why?
I’m building an AI-driven workflow platform using TypeScript, Next.js, Node.js, and GitHub-integrated deployment pipelines. The system coordinates multiple autonomous agents that handle orchestration, API actions, validation layers, and async task execution. Current architecture includes: Next.js frontend Node.js backend services GitHub-connected CI/CD Webhook/event-driven workflows AI agent task routing API validation + retry logic Fintech-oriented security requirements I’m trying to determine best practices for: Preventing cascading failures between autonomous agents Structuring agent-to-agent communication Managing retries/idempotency for webhook events Logging and observability across distributed workflows Safely deploying iterative AI workflow updates to production For developers who have worked on production AI orchestration systems: What architectural patterns worked best? Did you use queues/event buses/service meshes? How did you handle state management and rollback strategies? Would appreciate examples, frameworks, or lessons learned from scaling similar systems.
I am working on a Spring Boot project using PostgreSQL. My goal is to create the tables and insert initial data automatically when the application starts. I have this configuration in my `application.properties` file: spring.datasource.url=jdbc:postgresql://localhost:5432/progra3db spring.datasource.username=progra3 spring.datasource.password=progra3 spring.datasource.driver-class-name=org.postgresql.Driver spring.sql.init.mode=always spring.jpa.hibernate.ddl-auto=none spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true My `schema.sql` file has a table like this: CREATE TABLE IF NOT EXISTS nodes ( id BIGINT PRIMARY KEY, code VARCHAR(50), name VARCHAR(100), type VARCHAR(50), description TEXT, parent_id BIGINT ); My `data.sql` file has test data like this: INSERT INTO nodes (id, code, name, type, description, parent_id) VALUES (1, '1', 'Assets', 'GROUP', 'Company assets', NULL), (2, '1.1', 'Current Assets', 'GROUP', 'Short-term assets', 1), (3, '1.1.1', 'Cash', 'ACCOUNT', 'Cash available', 2); When I start the application, the project runs, but sometimes the data is not inserted or the table does not appear as expected. I tried changing `spring.jpa.hibernate.ddl-auto` between `none`, `update`, and `create`, but I am still confused about the correct configuration when using `schema.sql` and `data.sql`. What is the correct way to configure Spring Boot so that PostgreSQL initializes the schema and data from SQL files when the application starts?
I am working on a NEXT.js project that uses Prisma and Supabase Postgres.My project structure is: Directory structure: └── lunartech-x-dark-phoenix/ ├── ai-podcast-clipper-backend/ │ ├── requirements.txt │ ├── ytdownload.py │ └── asd/ │ └── model/ │ └── faceDetector/ │ ├── README.md │ └── __init__.py └── ai-podcast-clipper-frontend/ ├── add-credits.js ├── components.json ├── next.config.js ├── postcss.config.js ├── prettier.config.js ├── tsconfig.json └── src/ ├── app/ │ ├── layout.tsx │ ├── api/ │ │ ├── auth/ │ │ │ └── [...nextauth]/ │ │ │ └── route.ts │ │ └── inngest/ │ │ └── route.ts │ ├── dashboard/ │ │ ├── layout.tsx │ │ └── loading.tsx │ ├── login/ │ │ └── page.tsx │ └── signup/ │ └── page.tsx ├── components/ │ └── ui/ │ ├── input.tsx │ ├── label.tsx │ └── sonner.tsx ├── inngest/ │ └── client.ts ├── lib/ │ ├── auth.ts │ └── utils.ts ├── schemas/ │ └── auth.ts └── server/ ├── db.ts └── auth/ └── index.ts The root .env file is supposed to be the single source of environment variables for the whole project. In .env , I have: DATABASE_URL="postgresql://postgres.PROJECT_REF:MY_PASSWORD@aws-1-ap-southeast-2.pooler.supabase.com:5432/postgres" My prisma schema has: datasource db { provider = "postgresql" url = env("DATABASE_URL") } When I run this command from the frontend folder: cd ai-podcast-clipper-frontend npm run db:push The script runs: prisma db push But I get this error: PS E:\LunarTechTakeHomeAssignment(DarkPhoenix)\DARK-PHOENIX\ai-podcast-clipper-frontend> npm run db:push > ai-podcast-clipper-frontend@0.1.0 db:push > prisma db push Prisma schema loaded from prisma\schema.prisma Error: Prisma schema validation - (get-config wasm) Error code: P1012 error: Environment variable not found: DATABASE_URL. --> prisma\schema.prisma:14 | 13 | // https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string 14 | url = env("DATABASE_URL") | Validation Error Count: 1 [Context: getConfig] Prisma CLI Version : 6.7.0 The Next.js config loads the parent .env using loadEnvConfig("..") , but it seems Prisma CLI does not load the parent .env when I run prisma db push. Should I duplicate DATABASE_URL inside ai-podcast-clipper-frontend/.env , or should I use something like dotenv-cli ? What is the cleanest way to make prisma db push read ../.env ? For a Supabase connection string, should [YOUR-PASSWORD] include the square brackets, or should I replace the whole placeholder? I am using: Prisma CLI: 6.7.0 Node.js: 20+ Windows PowerShell Supabase Postgres Next.js frontend I want to keep the root .env as the single source of truth if possible. If there is any issue with my Supabase connection, I tried using both Direct Connection and Session Pooler connection. The associated repository link is : https://github.com/LUNARTECH-X/DARK-PHOENIX
Using the Hugging Face transformer library, I want to feed logits (i.e., a vector such that if the softmax is taken would have the probability of each token) as the input to a model. Currently, I convert the logits to an embedding with the following code: token_probabilities = F.softmax(logits,dim=-1) embeddings = token_probabilities @ model.embed_tokens.weight out = model(inputs_embed = embeddings, attention_mask=attention_mask, labels=labels) However, I am concerned that this throws away the positional encoding that the model needs. Does inputs_embed bypass the part of the model where positional data is attached? (for example, when the RoPE is added). Ideally, this would be answered with the general interface that Hugging Face models use, but I specifically care about LlamaForCausalLM if there is no general answer.
已显示全部 60 条