7-Segment PCB
This is a simulation of a 7-segment counter using digital logic gates (and, or, not). Three pulsed sources are required at A,B,C and should count out the binary 000-111. This is manufacturable and has a PCB design for it!... show more3 Comments
7 Stars
Frantic Plum Pip boy
como puedo corregir este codigo para que funcione en flux.io import time import random import matplotlib.pyplot as plt import io import base64 from fluxio import Flow flow = Flow() @flow.task def linear_search(arr, target): for i in range(len(arr)): if arr[i] == target: return i return -1 @flow.task def binary_search(arr, target): low = 0 high = len(arr) - 1 while low <= high: mid = (low + high) // 2 if arr[mid] == target: return mid elif arr[mid] < target: low = mid + 1 else: high = mid - 1 return -1 @flow.task def measure_time(func, arr, target): start_time = time.time() func(arr, target) end_time = time.time() return end_time - start_time @flow.task def generate_data_and_measure(): sizes = [100, 1000, 5000, 10000, 50000, 100000] linear_times = [] binary_times = [] for size in sizes: arr = random.sample(range(size * 2), size) target = random.choice(arr) sorted_arr = sorted(arr) linear_time = measure_time(linear_search, arr, target) binary_time = measure_time(binary_search, sorted_arr, target) linear_times.append(linear_time) binary_times.append(binary_time) return sizes, linear_times, binary_times @flow.task def plot_results(sizes, linear_times, binary_times): plt.plot(sizes, linear_times, label='Búsqueda Lineal') plt.plot(sizes, binary_times, label='Búsqueda Binaria') plt.xlabel('Tamaño del Array') plt.ylabel('Tiempo de Ejecución (segundos)') plt.title('Análisis de Complejidad Temporal') plt.legend() plt.grid(True) buf = io.BytesIO() plt.savefig(buf, format='png') buf.seek(0) img_str = base64.b64encode(buf.read()).decode('utf-8') plt.close() return img_str @flow.task def main(): sizes, linear_times, binary_times = generate_data_and_measure() img_str = plot_results(sizes, linear_times, binary_times) return img_str if __name__ == "__main__": flow.run(main)... show more1 Comment
1 Star
Binary Clock
A binary LED clock. Uses the 12 hour system and displays using on/off of LEDS to represent 1/0 of binary. The clock does not automatically set itself and requires the use of three button at the top to set it. Its powered by a 5v power supply.... show more17 Comments
7-Segment PCB
This is a simulation of a 7-segment counter using digital logic gates (and, or, not). Three pulsed sources are required at A,B,C and should count out the binary 000-111. This is manufacturable and has a PCB design for it!... show more3 Comments