Ai Generated Content Emmerge

is the internet still could be trusted ? Its bothering me in this last couple of month i am seeing or feel seeing and reading AI generated content. it could be text, images or video. and i wonder if articles or video was took a day to research and write or create, now, could take a couple of minutes? second? Content Creation Before AI Before the adoption of AI, content creation relied heavily on human. The years between 2000 and 2020 (maybe) saw a steady rise in content production, driven by the internet Boom and Social Media Growth, platforms like Facebook, Twitter, and Instagram introduced new opportunities for user-generated content. and TikTok of course. ...

19 December 2024

10 Important Prompt for Software Engineers

1. Code Refactoring Prompt: “Refactor this code to make it cleaner and more Pythonic: {code}” Prompt with Example: “Refactor this code: for i in range(len(arr)): print(arr[i])” What for: To improve code readability, performance, or adhere to best practices. Example: for item in arr: print(item) 2. Bug Fixing Prompt: “Fix the bug in this code: {code} and explain what went wrong.” Prompt with Example: “Fix the bug in this code: x = int('123a')” What for: To debug and resolve issues in the code. Example: try: x = int('123a') except ValueError: print("Invalid input, cannot convert to integer.") 3. Code Generation Prompt: “Write a function to {task} in {language}.” Prompt with Example: “Write a function to reverse a string in Python.” What for: To quickly generate functions or reusable code snippets. Example: def reverse_string(s): return s[::-1] print(reverse_string("hello")) # Output: "olleh" 4. Write Unit Tests Prompt: “Write unit tests for the following function: {code}.” Prompt with Example: “Write unit tests for this function: def add(x, y): return x + y” What for: To ensure code behaves as expected through automated tests. Example: import unittest def add(x, y): return x + y class TestAddFunction(unittest.TestCase): def test_add(self): self.assertEqual(add(2, 3), 5) self.assertEqual(add(-1, 1), 0) unittest.main() 5. SQL Query Generation Prompt: “Write an SQL query to {task}.” Prompt with Example: “Write an SQL query to find all users older than 30.” What for: To create or optimize SQL queries for databases. Example: SELECT * FROM users WHERE age > 30; 6. Explain Code Prompt: “Explain what the following code does: {code}.” Prompt with Example: “Explain this code: for i in range(3): print(i)” What for: To clarify or document code for better understanding. Example: “The loop iterates over values 0, 1, and 2, printing each value.” 7. Code Conversion Prompt: “Convert this {source_language} code to {target_language}: {code}.” Prompt with Example: “Convert this Python code to JavaScript: print('Hello')” What for: To translate code between programming languages. Example: console.log('Hello'); 8. Regex Creation Prompt: “Write a regex to {task}.” Prompt with Example: “Write a regex to validate email addresses.” What for: To validate or extract patterns from strings using regular expressions. Example: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ 9. Generate API Request Code Prompt: “Write code to send a {request_type} request to {url} using {language}.” Prompt with Example: “Write code to send a GET request to https://api.example.com/data using Python.” What for: To create API integration code. Example: import requests response = requests.get("https://api.example.com/data") print(response.json()) 10. System Design Suggestions Prompt: “Design a system for {use_case} and describe its architecture.” Prompt with Example: “Design a system for an image upload service.” What for: To outline a scalable system design or architecture. Example: “Use the following components: Storage: AWS S3 for image storage. API: Load-balanced servers to handle upload requests. Processing: Background worker to resize or process images. Delivery: Use a CDN for fast delivery of images.”* To be honnest this is created by AI, with my ‘great’ prompt 😃 . prompting is the key of learning anything now. when it used to be a google search technique. If content in Internet now somehow could easyly created by AI is the prompt is actually more important to kmow than the content it self? just wondering. ...

16 December 2024

The Important of Technical Discussion

Recently i am creating a blog that code and create RAG pipeline. Since Langchain (the library that I use) wraps all the functions behind the curtain, some users, like myself, may misunderstand its workings. I want to discuss this part of the code: def build_rag(vectorstore): retriever = vectorstore.as_retriever() llm = OllamaLLM(model="mistral") # Specify Mistral model qa_chain = RetrievalQA.from_chain_type(llm, retriever=retriever) return qa_chain In understanding this code I assume that when qa_chain = RetrievalQA.from_chain_type(llm, retriever=retriever) retreiver is vectorstore right?. i assume again that llm is actually read the vector. ...

6 December 2024

Langchain PDF Ollama RAG (Retrieval Augmented Generation)

Give PDF and talk about it using lanchain to perform RAG using Ollama embedings and FAISS vectorstore yeah maybe many tools already provide this kind of feature, But this is different, this is about knowing behind the scene. what actually they do to the pdf files? what actually we do to the text in it? and how the LLM is know what context they need?. first thing first what is RAG? RAG is Retrieval Augmented Generation ...

2 December 2024

Ollama Chat From Browser Using Nextjs

Ollama Chat From Browser Using Nextjs This writing will be so small. it should be a step by step on creating nextjs app that will communicate with local ollama. the model that i use is mistral its the fastest now running in my local. but instead starting from scrath, lets asking help to bolt.new to create interface that will communicate with our ollama server in local. there is a reason why i learn this. i want to do …. lets wait for another post 😄 ...

21 November 2024

Running Qwen in M2 Mac Air Machine using Ollama

Running qwen-2.5-coder:7B on macbook Air M2 using ollama This is part of stay hungry stay folish mindset, and my interest in AI. Search possible solution to get cheapest code assistant as possible. i was subscribe to copilot but now after found continue.dev + anthropic API, thats the current choice. Its small decrease in cost. copilot is $10 per month but now i am not that code heavy so subs to token based payment (anthropic claude 3.5 sonnet) is more cost effective. and pay base on what i use. ...

20 November 2024

Getting Pull Rate Limit and Workaround

When docker hub want you to authenticate there is a stable system using public images from docker hub. and suddently pull rate limit error is showing up. This is How we implement the Workaround Our system is running in AWS EKS and using all internal image registry (ECR) for application images. Most of application is using docker images and run’s on kubernetes. but some POC and small services is using public images from docker hub. it needs you to authenticate or login to be able to increase the limit. ...

13 December 2022

ChatGPT Open Ai, Is It Scary?

ChatGPT is it scary? it could be the end of yaml (kubernetes) engineers. there is phenomenon. in this time i write this post, i just try the viral AI in a programming world. openAI just released a product, or reasearch, or a robot called chatGPT they said We’ve trained a model called ChatGPT which interacts in a conversational way. The dialogue format makes it possible for ChatGPT to answer followup questions, admit its mistakes, challenge incorrect premises, and reject inappropriate requests. ChatGPT is a sibling model to InstructGPT, which is trained to follow an instruction in a prompt and provide a detailed response. ...

9 December 2022

Argocd Starting Up

Argo CD Starting up Recently argocd is graduated from CNCF incubating project. we already using argocd in production almost 9 months. and its working awesome. Installation getting Started to install argocd and setting this up you could easy follow this (argocd start)[https://argo-cd.readthedocs.io/en/stable/getting_started/] Lets Go I will not explain how to install or how to configure argocd but i will share my experience of using it in production in our usecase. ...

30 November 2022

Layoff Phenomenon 2022

Layoff 2022 In the end of the 2022 there is phenomenon called “massive layoff”, a lot of my friends is impacted during this time. i just wonder what is happening. First, i am not an expert in investing, bussiness. but i kind of know (correct me if i am wrong) how to count a profit. its as simple as income - expenses so why the company as big as GoTo or RuangGuru is layoff their employee. i have hypotesis by my stupid logic. ...

25 November 2022