TAAFT
Free mode
100% free
Freemium
Free Trial
Create tool

Free Coding Apps

31 tools
13 subscribers
  • CodePal
    Generate code from natural language
    Open
    8,417
    74
    Released 2y ago
    Free + from $20/mo
    CodePal website
  • Marvin
    Build AI-powered software with ease
    Open
    1,622
    23
    Released 2y ago
    100% Free
    Marvin website
  • Biggles
    The coding assistant you can talk to.
    Open
    735
    6
    Released 1y ago
    100% Free
    Biggles website
  • CensysGPT
    Simplify Censys queries for efficient internet reconnaissance.
    Open
    2,477
    28
    Released 2y ago
    100% Free
    CensysGPT website
  • Twinny
    Local AI code completion for VS Code.
    Open
    1,362
    11
    Released 1y ago
    100% Free
    Twinny website
  • Refactory
    AI-powered code improvement assistant
    Open
    1,983
    33
    Released 1y ago
    100% Free
    Refactory website
  • CopilotChat
    Generate code with AI-powered test-driven development
    Open
    609
    15
    Released 1y ago
    100% Free
    CopilotChat website
  • Command-G
    AI copilot for Xcode developers
    Open
    667
    19
    Released 1y ago
    100% Free
    Command-G website
  • agi and ani coder
    Advanced AI coding companion for AGI and ANI solutions.
    Open
    266
    20
    43
    Released 11mo ago
    100% Free
    ```jsx import React, { useState } from 'react'; const styles = { container: { maxWidth: '600px', margin: '0 auto', padding: '20px', }, form: { display: 'flex', flexDirection: 'column', marginBottom: '20px', }, input: { margin: '5px 0', padding: '5px', }, button: { margin: '5px 0', padding: '5px 10px', backgroundColor: '#4CAF50', color: 'white', border: 'none', cursor: 'pointer', }, task: { display: 'flex', alignItems: 'center', marginBottom: '10px', }, completed: { textDecoration: 'line-through', color: 'red', }, }; function TodoList() { const [tasks, setTasks] = useState([]); const [newTask, setNewTask] = useState({ description: '', category: '' }); const [editingTask, setEditingTask] = useState(null); const handleInputChange = (e) => { setNewTask({ ...newTask, [e.target.name]: e.target.value }); }; const handleSubmit = (e) => { e.preventDefault(); if (editingTask) { setTasks(tasks.map(task => task.id === editingTask.id ? { ...task, ...newTask } : task)); setEditingTask(null); } else { setTasks([...tasks, { id: Date.now(), ...newTask, completed: false }]); } setNewTask({ description: '', category: '' }); }; const toggleComplete = (id) => { setTasks(tasks.map(task => task.id === id ? { ...task, completed: !task.completed } : task)); }; const deleteTask = (id) => { setTasks(tasks.filter(task => task.id !== id)); }; const editTask = (task) => { setEditingTask(task); setNewTask({ description: task.description, category: task.category }); }; return ( <div style={styles.container}> <h1>Todo List</h1> <form onSubmit={handleSubmit} style={styles.form}> <input type="text" name="description" value={newTask.description} onChange={handleInputChange} placeholder="Task description" style={styles.input} /> <input type="text" name="category" value={newTask.category} onChange={handleInputChange} placeholder="Category" style={styles.input} /> <button type="submit" style={styles.button}> {editingTask ? 'Update Task' : 'Add Task'} </button> </form> <div> {tasks.map(task => ( <div key={task.id} style={styles.task}> <input type="checkbox" checked={task.completed} onChange={() => toggleComplete(task.id)} /> <span style={task.completed ? styles.completed : null}> {task.description} ({task.category}) </span> <button onClick={() => editTask(task)} style={styles.button}>Edit</button> <button onClick={() => deleteTask(task.id)} style={styles.button}>Delete</button> </div> ))} </div> <p>Total Completed Tasks: {tasks.filter(task => task.completed).length}</p> </div> ); } export default TodoList; ``` This React component implements a Todo List with the following features: - Adding new tasks with description and category - Editing existing tasks - Marking tasks as complete/incomplete - Deleting tasks - Displaying completed tasks with strikethrough text in red - Showing the total number of completed tasks To use this component, you would typically render it in your main App component or another parent component. Make sure to have React installed in your project before using this code.
  • DevPrompt
    Boost coding productivity with AI-powered prompts.
    Open
    1,292
    16
    1.0
    Released 1y ago
    100% Free
    DevPrompt website
  • Elementor Json Generator
    Craft perfect JSON code for Elementor layouts.
    Open
    571
    87
    3.0
    166
    Released 9mo ago
    100% Free
    ```json { "version": "1.0.0", "elements": [ { "id": "section-1", "elType": "section", "settings": { "section_type": "inner", "background_background": "classic", "background_color": "#4567b7", "padding": { "unit": "px", "top": 50, "right": 50, "bottom": 50, "left": 50, "isLinked": true }, "margin": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0, "isLinked": true }, "width": "full", "custom_width": { "unit": "%", "size": 100 }, "content_width": "full", "theme_style": "", "gap": { "unit": "px", "size": 10 }, "column_gap": { "unit": "px", "size": 10 }, "isCoral": "", "border": { "size": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0 }, "border_color": "#ffffff", "border_style": "solid" }, "responsive": { "tablet": { "padding": { "top": 30, "right": 30, "bottom": 30, "left": 30 } }, "mobile": { "padding": { "top": 20, "right": 20, "bottom": 20, "left": 20 } } } }, "elements": [ { "id": "column-1", "elType": "column", "settings": { "width": "50", "offset": "", "custom_offset": "", "toggle_indicator": "", "background_background": "classic", "background_color": "", "padding": { "unit": "px", "top": 20, "right": 20, "bottom": 20, "left": 20, "isLinked": true }, "margin": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0, "isLinked": true }, "border": { "size": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0 }, "border_color": "#ffffff", "border_style": "solid" }, "responsive": { "tablet": {}, "mobile": {} } }, "elements": [ { "id": "image-1", "elType": "image", "settings": { "image": { "url": "https://via.placeholder.com/200x150", "id": 123, "alt": "Broker Image", "source": "library" }, "link_to": "none", "link": { "url": "", "is_external": "", "nofollow": "" }, "width": { "unit": "%", "size": 100 }, "align": "center" } } ] }, { "id": "column-2", "elType": "column", "settings": { "width": "50", "offset": "", "custom_offset": "", "toggle_indicator": "", "background_background": "classic", "background_color": "", "padding": { "unit": "px", "top": 20, "right": 20, "bottom": 20, "left": 20, "isLinked": true }, "margin": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0, "isLinked": true }, "border": { "size": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0 }, "border_color": "#ffffff", "border_style": "solid" }, "responsive": { "tablet": {}, "mobile": {} } }, "elements": [ { "id": "text-1", "elType": "text-editor", "settings": { "editor": "<p>Welcome to Best Brokers Online, your premier destination for comparing top brokers and making informed investment decisions.</p>", "drop_cap": "", "text_color": "#ffffff", "font_size": { "unit": "px", "size": 18 }, "font_family": "Arial", "line_height": { "unit": "px", "size": 24 }, "text_align": "left" } } ] } ] }, { "id": "section-2", "elType": "section", "settings": { "section_type": "inner", "background_background": "classic", "background_color": "#6495ed", "padding": { "unit": "px", "top": 50, "right": 50, "bottom": 50, "left": 50, "isLinked": true }, "margin": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0, "isLinked": true }, "width": "full", "custom_width": { "unit": "%", "size": 100 }, "content_width": "full", "theme_style": "", "gap": { "unit": "px", "size": 10 }, "column_gap": { "unit": "px", "size": 10 }, "isCoral": "", "border": { "size": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0 }, "border_color": "#ffffff", "border_style": "solid" }, "responsive": { "tablet": { "padding": { "top": 30, "right": 30, "bottom": 30, "left": 30 } }, "mobile": { "padding": { "top": 20, "right": 20, "bottom": 20, "left": 20 } } } }, "elements": [ { "id": "column-3", "elType": "column", "settings": { "width": "100", "offset": "", "custom_offset": "", "toggle_indicator": "", "background_background": "classic", "background_color": "", "padding": { "unit": "px", "top": 20, "right": 20, "bottom": 20, "left": 20, "isLinked": true }, "margin": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0, "isLinked": true }, "border": { "size": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0 }, "border_color": "#ffffff", "border_style": "solid" }, "responsive": { "tablet": {}, "mobile": {} } }, "elements": [ { "id": "image-2", "elType": "image", "settings": { "image": { "url": "https://via.placeholder.com/400x200", "id": 456, "alt": "Investment Image", "source": "library" }, "link_to": "none", "link": { "url": "", "is_external": "", "nofollow": "" }, "width": { "unit": "%", "size": 100 }, "align": "center" } } ] } ] }, { "id": "section-3", "elType": "section", "settings": { "section_type": "inner", "background_background": "classic", "background_color": "#87ceeb", "padding": { "unit": "px", "top": 50, "right": 50, "bottom": 50, "left": 50, "isLinked": true }, "margin": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0, "isLinked": true }, "width": "full", "custom_width": { "unit": "%", "size": 100 }, "content_width": "full", "theme_style": "", "gap": { "unit": "px", "size": 10 }, "column_gap": { "unit": "px", "size": 10 }, "isCoral": "", "border": { "size": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0 }, "border_color": "#ffffff", "border_style": "solid" }, "responsive": { "tablet": { "padding": { "top": 30, "right": 30, "bottom": 30, "left": 30 } }, "mobile": { "padding": { "top": 20, "right": 20, "bottom": 20, "left": 20 } } } }, "elements": [ { "id": "column-4", "elType": "column", "settings": { "width": "100", "offset": "", "custom_offset": "", "toggle_indicator": "", "background_background": "classic", "background_color": "", "padding": { "unit": "px", "top": 20, "right": 20, "bottom": 20, "left": 20, "isLinked": true }, "margin": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0, "isLinked": true }, "border": { "size": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0 }, "border_color": "#ffffff", "border_style": "solid" }, "responsive": { "tablet": {}, "mobile": {} } }, "elements": [ { "id": "text-2", "elType": "text-editor", "settings": { "editor": "<p>At Best Brokers Online, we provide you with the tools and insights to navigate the complex world of investments with confidence.</p>", "drop_cap": "", "text_color": "#ffffff", "font_size": { "unit": "px", "size": 16 }, "font_family": "Arial", "line_height": { "unit": "px", "size": 22 }, "text_align": "left" } } ] } ] }, { "id": "section-4", "elType": "section", "settings": { "section_type": "footer", "background_background": "classic", "background_color": "#4567b7", "padding": { "unit": "px", "top": 20, "right": 20, "bottom": 20, "left": 20, "isLinked": true }, "margin": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0, "isLinked": true }, "width": "full", "custom_width": { "unit": "%", "size": 100 }, "content_width": "full", "theme_style": "", "gap": { "unit": "px", "size": 10 }, "column_gap": { "unit": "px", "size": 10 }, "isCoral": "", "border": { "size": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0 }, "border_color": "#ffffff", "border_style": "solid" }, "responsive": { "tablet": {}, "mobile": {} } }, "elements": [ { "id": "column-5", "elType": "column", "settings": { "width": "100", "offset": "", "custom_offset": "", "toggle_indicator": "", "background_background": "classic", "background_color": "", "padding": { "unit": "px", "top": 10, "right": 10, "bottom": 10, "left": 10, "isLinked": true }, "margin": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0, "isLinked": true }, "border": { "size": { "unit": "px", "top": 0, "right": 0, "bottom": 0, "left": 0 }, "border_color": "#ffffff", "border_style": "solid" }, "responsive": { "tablet": {}, "mobile": {} } }, "elements": [ { "id": "text-3", "elType": "text-editor", "settings": { "editor": "<p>Best4D Investor, LLC<br>2023-001303230<br>5830 E2nd St Ste6300<br>Casper, WY82609<br>USA<br>+1 036 000 2589<br>[email protected]</p>", "drop_cap": "", "text_color": "#ffffff", "font_size": { "unit": "px", "size": 12 }, "font_family": "Arial", "line_height": { "unit": "px", "size": 16 }, "text_align": "left" } } ] } ] } ] } ```
  • Design2code
    Convert any design to code instantly.
    Open
    8,265
    115
    1.6
    Released 1y ago
    100% Free
    Design2code website
  • AIT-CodeX
    Accelerate your tech career with AI-guided talent matching.
    Open
    5,011
    59
    2.6
    Released 2y ago
    100% Free
    AIT-CodeX website
  • React GPT Designer
    Design React components with AI assistance
    Open
    5,080
    134
    3.2
    Released 2y ago
    100% Free
    React GPT Designer website
    Seems to be working for me. I suggest giving it a shot again!
  • JACoB
    AI-powered coding agent for smarter development
    Open
    1,231
    48
    3.3
    Released 1y ago
    100% Free
    JACoB website
    this is hilarious
  • Jit Codes
    Transform text into code with AI
    Open
    11,407
    184
    3.7
    Released 2y ago
    Free + from $19/mo
    Jit Codes website
    Its a really great code generator, it helped me with lots of codes for lots of programming languages, it gives short answers, explain the code and gives you versions of the code if asked
  • Gitwit
    Create code from natural language prompts.
    Open
    3,307
    80
    4.0
    Released 2y ago
    100% Free
    Gitwit website
  • MarsCode
    AI-powered IDE to code and innovate faster.
    Open
    1,117
    40
    4.0
    Released 1y ago
    100% Free
    MarsCode website
  • Arko
    Your multilingual coding companion.
    Open
    256
    38
    4.0
    47
    Released 9mo ago
    100% Free
    **Hello World in Python** ``` print("Hello, World!") ``` This code will output `Hello, World!` when run. **Explanation:** * `print()` is a built-in function in Python that prints its argument to the console. * The string `"Hello, World!"` is the argument passed to `print()`, which is then printed to the console. Save this code in a file with a `.py` extension (e.g., `hello.py`) and run it using Python (e.g., `python hello.py`) to see the output.
  • Maester code creator
    AI-powered code generation for any language or framework.
    Open
    5,272
    91
    4.0
    Released 2y ago
    100% Free
    Maester code creator website
  • Code Assist
    AI-powered coding assistant for effortless development
    Open
    465
    46
    4.0
    78
    Released 1y ago
    100% Free
    ## Creating a Harry Potter-based Game on Roblox with Wands and Spells To create a Harry Potter-based game on Roblox, you'll need to create a wand and implement spells that can be cast using the left mouse click. Here's a step-by-step guide to help you achieve this: ### Creating the Wand 1. Create a new `Part` in the `Workspace` and rename it to "Wand". This will serve as the player's wand. 2. Add a `.LocalScript` to the Wand and name it "WandScript". 3. In the WandScript, add the following code to initialize the wand: ```lua local player = game.Players.LocalPlayer local wand = script.Parent -- Set the wand's properties wand.Handle = wand:WaitForChild("Handle") -- Assuming the handle is a child of the wand wand.Tip = wand:WaitForChild("Tip") -- Assuming the tip is a child of the wand ``` ### Implementing Spells with Left Click To implement spells with left click, you'll need to detect when the player clicks the left mouse button and then cast the corresponding spell. 1. Add a `UserInputService` to the WandScript to detect mouse clicks: ```lua local userInputService = game:GetService("UserInputService") -- Function to cast a spell when the left mouse button is clicked local function castSpell() -- Get the spell from the player's inventory or a preset spell local spell = getSpellFromInventory() -- Implement this function to get the spell from the player's inventory -- Cast the spell (more on this later) castSpellEffect(spell) end -- Connect the left mouse button click event to the castSpell function userInputService.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then castSpell() end end) ``` ### Casting Spells To cast a spell, you'll need to create a function that will handle the spell's effects. Here's a basic implementation: ```lua local function castSpellEffect(spell) -- Get the spell's properties (e.g., spell name, damage, range, etc.) local spellName = spell.Name local damage = spell.Damage local range = spell.Range -- Create a spell effect (e.g., a fireball, a blast of air, etc.) local spellEffect = Instance.new("Explosion") spellEffect.Position = wand.Tip.Position spellEffect.Parent = workspace -- Apply the spell's effects (e.g., damage to enemies, environment, etc.) -- Implement this logic based on the spell's properties -- For example: local enemies = getEnemiesInRadius(wand.Tip.Position, range) for _, enemy in ipairs(enemies) do enemy:TakeDamage(damage) end -- Remove the spell effect after a short duration wait(1) spellEffect:Destroy() end ``` ### Adding Spells to the Player's Inventory To allow players to switch spells, you'll need to implement a system to store and retrieve spells from their inventory. You can do this using a `Folder` in the player's `StarterPack` or `Backpack`. 1. Create a `Folder` in the player's `StarterPack` or `Backpack` and name it "Spells". 2. Create new `Folder`s within the Spells folder to represent individual spells (e.g., "Fireball", "HealingBlast", etc.). 3. Add the spell's properties (e.g., damage, range, etc.) to the spell's folder as `IntValue`s or `StringValue`s. 4. Modify the `getSpellFromInventory` function to retrieve the currently selected spell from the player's inventory. Here's a basic implementation: ```lua local function getSpellFromInventory() local spellsFolder = game.Players.LocalPlayer.StarterPack.Spells local selectedSpell = spellsFolder:FindFirstChild("SelectedSpell") if selectedSpell then return selectedSpell end end ``` This is a basic outline to get you started. You can expand on this by adding more features, such as spell cooldowns, spell levels, and more. Remember to adjust the code to fit your specific game requirements and implement the necessary logic for handling spell effects, enemy AI, and other game mechanics. Good luck with your Harry Potter-based game on Roblox!
  • Code Humanizer
    Transform AI code into human-like programming
    Open
    2,321
    745
    3.4
    1,264
    Released 3mo ago
    100% Free
    /* Creative Calculator */ body { margin: 0; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #f0f4f8, #a3c9ff); font-family: "Segoe UI", sans-serif; } .calculator { background: #ffffff; padding: 25px; border-radius: 25px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); width: 300px; } .display { background: #eef6ff; color: #333; padding: 20px; border-radius: 15px; text-align: right; font-size: 1.7rem; margin-bottom: 20px; min-height: 50px; box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.1); overflow-x: auto; } .buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; } button { border: none; padding: 15px; border-radius: 15px; font-size: 1.2rem; cursor: pointer; background: #dbe9ff; transition: all 0.2s ease-in-out; } button:hover { background: #6fa8ff; color: white; transform: scale(1.05); } .equal { grid-column: span 2; background: #4c7ee8; color: white; font-weight: bold; } .clear { background: #ff6767; color: white; } .special { background: #ffd966; } </style> <div class="calculator"> <div id="display" class="display"></div> <div class="buttons"> <button class="special">Ans</button> <button>C</button> <button>7</button> <button>8</button> <button>9</button> <button>/</button> <button>4</button> <button>5</button> <button>6</button> <button>*</button> <button>1</button> <button>2</button> <button>3</button> <button>-</button> <button>0</button> <button>.</button> <button>+</button> <button class="equal">=</button> </div> </div> <script> // Get the display element and all buttons const displayElement = document.getElementById('display'); const buttons = document.querySelectorAll('button'); // Store the current calculation and previous answer let currentCalculation = ''; let previousAnswer = ''; // Add event listeners to all buttons buttons.forEach(button => { button.addEventListener('click', handleButtonClick); }); // Handle button clicks function handleButtonClick(event) { const button = event.target; const buttonText = button.textContent; // Handle equals button if (buttonText === '=') { try { // Evaluate the current calculation const result = eval(currentCalculation); displayElement.textContent = result; previousAnswer = result; currentCalculation = result.toString(); } catch (error) { displayElement.textContent = 'Error!'; currentCalculation = ''; } } // Handle clear button else if (buttonText === 'C') { displayElement.textContent = ''; currentCalculation = ''; } // Handle answer button else if (buttonText === 'Ans') { currentCalculation += previousAnswer; displayElement.textContent = currentCalculation; } // Handle digit or operator button else { currentCalculation += buttonText; displayElement.textContent = currentCalculation; } } </script>
  • CodeBrain
    AI coding companion: Explains, writes, and optimizes code.
    Open
    636
    171
    4.3
    170
    Released 8mo ago
    100% Free
    ```python import hashlib import json import time from typing import List, Dict import threading import socket import sqlite3 from cryptography.hazmat.primitives import hashes from cryptography.hazmat.primitives.asymmetric import padding, rsa class Block: def __init__(self, index, transactions, timestamp, previous_hash): self.index = index self.transactions = transactions self.timestamp = timestamp self.previous_hash = previous_hash self.nonce = 0 self.hash = self.calculate_hash() def calculate_hash(self): block_string = json.dumps(self.__dict__, sort_keys=True) return hashlib.sha256(block_string.encode()).hexdigest() class Blockchain: def __init__(self): self.chain = [self.create_genesis_block()] self.difficulty = 4 self.pending_transactions = [] self.mining_reward = 10 self.nodes = set() self.lock = threading.Lock() def create_genesis_block(self): return Block(0, [], int(time.time()), "0") def get_latest_block(self): return self.chain[-1] def mine_pending_transactions(self, miner_address): with self.lock: block = Block(len(self.chain), self.pending_transactions, int(time.time()), self.get_latest_block().hash) block.mine_block(self.difficulty) self.chain.append(block) self.pending_transactions = [ {"from": "network", "to": miner_address, "amount": self.mining_reward} ] def add_transaction(self, transaction): if not all(k in transaction for k in ("from", "to", "amount", "signature")): raise ValueError("Invalid transaction") public_key = rsa.PublicKey.load_pkcs1(transaction['from'].encode()) message = f"{transaction['from']}{transaction['to']}{transaction['amount']}".encode() try: public_key.verify( transaction['signature'], message, padding.PSS( mgf=padding.MGF1(hashes.SHA256()), salt_length=padding.PSS.MAX_LENGTH ), hashes.SHA256() ) except: raise ValueError("Invalid transaction signature") self.pending_transactions.append(transaction) def is_chain_valid(self): for i in range(1, len(self.chain)): current_block = self.chain[i] previous_block = self.chain[i-1] if current_block.hash != current_block.calculate_hash(): return False if current_block.previous_hash != previous_block.hash: return False return True def add_node(self, address): parsed_url = urlparse(address) self.nodes.add(parsed_url.netloc) def replace_chain(self): network = self.nodes longest_chain = None max_length = len(self.chain) for node in network: response = requests.get(f'http://{node}/chain') if response.status_code == 200: length = response.json()['length'] chain = response.json()['chain'] if length > max_length and self.is_chain_valid(chain): max_length = length longest_chain = chain if longest_chain: self.chain = longest_chain return True return False def save_blockchain(blockchain, filename): with open(filename, 'w') as f: json.dump([vars(block) for block in blockchain.chain], f) def load_blockchain(filename): with open(filename, 'r') as f: chain_data = json.load(f) blockchain = Blockchain() blockchain.chain = [Block(**block_data) for block_data in chain_data] return blockchain # Network functionality def start_node(blockchain, port): node = socket.socket(socket.AF_INET, socket.SOCK_STREAM) node.bind(('', port)) node.listen(5) print(f"Node listening on port {port}") while True: client, addr = node.accept() threading.Thread(target=handle_client, args=(client, blockchain)).start() def handle_client(client, blockchain): request = client.recv(1024).decode() if request == "GET_CHAIN": client.send(json.dumps([vars(block) for block in blockchain.chain]).encode()) client.close() # Database functionality def init_db(): conn = sqlite3.connect('blockchain.db') c = conn.cursor() c.execute('''CREATE TABLE IF NOT EXISTS blocks (index INTEGER PRIMARY KEY, transactions TEXT, timestamp INTEGER, previous_hash TEXT, nonce INTEGER, hash TEXT)''') conn.commit() conn.close() def save_block_to_db(block): conn = sqlite3.connect('blockchain.db') c = conn.cursor() c.execute("INSERT INTO blocks VALUES (?, ?, ?, ?, ?, ?)", (block.index, json.dumps(block.transactions), block.timestamp, block.previous_hash, block.nonce, block.hash)) conn.commit() conn.close() def load_blockchain_from_db(): conn = sqlite3.connect('blockchain.db') c = conn.cursor() c.execute("SELECT * FROM blocks ORDER BY index") blocks = c.fetchall() conn.close() blockchain = Blockchain() blockchain.chain = [Block(b[0], json.loads(b[1]), b[2], b[3]) for b in blocks] for block in blockchain.chain: block.nonce = block.nonce block.hash = block.hash return blockchain # Usage example blockchain = Blockchain() init_db() # Generate RSA key pair for signing transactions private_key = rsa.generate_private_key( public_exponent=65537, key_size=2048 ) public_key = private_key.public_key() # Example transaction transaction = { "from": public_key.public_bytes( encoding=serialization.Encoding.PEM, format=serialization.PublicFormat.PKCS1 ).decode(), "to": "recipient_address", "amount": 5 } # Sign the transaction signature = private_key.sign( f"{transaction['from']}{transaction['to']}{transaction['amount']}".encode(), padding.PSS( mgf=padding.MGF1(hashes.SHA256()), salt_length=padding.PSS.MAX_LENGTH ), hashes.SHA256() ) transaction['signature'] = signature blockchain.add_transaction(transaction) blockchain.mine_pending_transactions("miner_address") # Save the blockchain to file and database save_blockchain(blockchain, 'blockchain.json') for block in blockchain.chain: save_block_to_db(block) # Start the node threading.Thread(target=start_node, args=(blockchain, 5000)).start() # In a real-world scenario, you would implement more comprehensive error handling, # logging, and security measures. This example provides a basic framework that can # be extended and improved upon. ``` This implementation includes: 1. A basic blockchain structure with blocks and transactions 2. Proof-of-Work consensus mechanism 3. Transaction signing and verification using RSA 4. Network functionality for distributed nodes 5. Persistent storage using both file-based and SQLite database storage 6. A simple node server to handle basic network requests To make this production-ready, you would need to add more robust error handling, implement a more advanced consensus mechanism, add more comprehensive testing, and optimize for performance. Additionally, you'd want to implement a proper API, add more security features, and create a user interface for interacting with the blockchain.
  • Flexpilot
    Open-source Copilot alternative for VS Code
    Open
    3,104
    100
    4.3
    Released 10mo ago
    100% Free
    Flexpilot website
    FlexPilot offers an impressive and user-friendly AI-driven experience. Very useful tool!
  • AI Smart Coder
    Enhance coding with AI-powered tests, reviews, docs, and fixes.
    Open
    2,671
    79
    4.5
    Released 1y ago
    100% Free
    AI Smart Coder website
    A backend web on safety management of coal mines
  • Aider Chat
    AI pair programming in your terminal
    Open
    1,924
    18
    5.0
    Released 2y ago
    100% Free
    Aider Chat website
    It's a great AI assistant that have made my coding life so much easier.
  • Codelab
    Code smarter with AI-powered web development.
    Open
    934
    13
    3.0
    Released 2y ago
    100% Free
    Codelab website
  • StructurizeMe
    Transform unstructured text into organized JSON tables.
    Open
    1,247
    30
    3.0
    Released 1y ago
    100% Free
    StructurizeMe website
  • ASSIS writer
    AI code generator for HTML, PHP, and Python.
    Open
    162
    24
    5.0
    29
    Released 1y ago
    100% Free
    ### Overview of the AI-Powered Mock Interview Platform The platform utilizes artificial intelligence to simulate real interview experiences. It is designed to help users prepare for job interviews by providing a dynamic and adaptive questioning process. #### Key Features: * **Targeted Interview Preparation**: Users can select a target company and role, allowing the system to tailor the interview questions to the specific position. * **Adaptive Questioning**: The AI analyzes the user's spoken answers and selects follow-up questions based on their responses, mimicking the behavior of a skilled interviewer. * **Real-time Feedback**: Users receive immediate, actionable feedback on their communication skills, thought process, and presentation style. * **Data Protection**: The platform ensures strong privacy controls to safeguard user data. #### Business Model: * **B2B Partnerships**: The platform focuses on partnerships with universities and bootcamps to enhance placement success rates and build trust among users. * **User Base Growth**: As the platform grows its user base, the AI engine learns from a larger dataset of real answers, improving its adaptability and human-like interaction. #### Unique Selling Proposition (USP): * **Real-time Adaptive Feedback Loop**: The platform's ability to provide personalized, real-time feedback and adapt to the user's responses sets it apart from static question banks and larger, less adaptable platforms.
  • Zzzcode
    AI-powered coding assistant for multiple languages.
    Open
    11,132
    68
    5.0
    Released 2y ago
    100% Free
    Zzzcode website
    best coding site!! best thing: it's free and it's INFINITE!
0 AIs selected
Clear selection
#
Name
Task