Skip to content

Instantly share code, notes, and snippets.

View lucas404x's full-sized avatar
🎯
Focusing

José Lucas lucas404x

🎯
Focusing
View GitHub Profile
@lucas404x
lucas404x / BACKEND.md
Created September 23, 2024 12:43 — forked from akitaonrails/BACKEND.md
Codeminer 42 - BACKEND Test

TRZ (The Resident Zombie) - Backend

Problem Description

The world, as we know it, has fallen into an apocalyptic scenario. The "Influenzer T-Virus" (a.k.a. Twiter Virus) is transforming human beings into stupid beasts (a.k.a. Zombies), hungry to cancel humans and eat their limbs.

You, the last survivor who knows how to code, will help the resistance by deploying a system to connect the remaining humans. This system will be essential to detect new infections and share resources between the members.

Requirements

class QuantityInputFormatter extends TextInputFormatter {
@override
TextEditingValue formatEditUpdate(TextEditingValue oldValue, TextEditingValue newValue) {
if (newValue.text.isEmpty) {
return const TextEditingValue(
text: '0',
selection: TextSelection.collapsed(offset: 1),
);
}
@lucas404x
lucas404x / post.md
Created May 5, 2022 13:06 — forked from vinicius73/post.md
["LÓGICA DE PROGRAMAÇÃO" É BOBAGEM, e explicarei porquê.]

#["LÓGICA DE PROGRAMAÇÃO" É BOBAGEM, e explicarei porquê.]

Se preparem que o texto é longo.

Várias vezes chegam novatos aqui perguntando como começar, e a galera diz "estuda lógica primeiro, depois vai pra linguagem X". Vivo dizendo que é bobagem. Ontem, em particular, falei isso, e vieram várias pessoas por inbox me perguntar porquê (e uma pra me xingar, achando que falei por arrogância).

Pra facilitar, eu vou escrever uma boa explicação de porquê "lógica de programação" é furada, doa a quem doer, e postar na APDA e no fórum da EnergyLabs (para futuras referências, porque esse assunto vai voltar, ctz).

import 'package:flutter/material.dart';
import '../home/home_page.dart';
import 'widgets/bottom_navigator.dart';
class RootPage extends StatefulWidget {
const RootPage({Key? key}) : super(key: key);
@override
State<RootPage> createState() => _RootPageState();
import { Component, NgZone, OnDestroy, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { Store } from '@ngrx/store';
import { Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
import { DocumentModel } from 'src/app/core/models/document.model';
import { LifeProofModel } from 'src/app/core/models/life-proof.model';
import { uploadFaceCompare } from '../../../core/store/actions/face-compare.action';
import { DocumentsState } from '../../../core/store/states/documents.state';
import { FaceCompareState } from '../../../core/store/states/face-compare.state';
import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:transparent_image/transparent_image.dart';
import '../shared/const/image_api.dart';
import '../shared/repositories/get_image.dart';
import '../widgets/search_bar/search_bar.dart';
import 'home_controller.dart';
// Todo código foi feito por josé lucas da silva.
#include <iostream>
#include <cmath>
struct point2D
{
double x;
double y;
};
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:flutter_modular/flutter_modular.dart';
import '../../shared/widgets/profile_button/profile_button.dart';
import '../../shared/widgets/repository_card/repository_card.dart';
import 'home_controller.dart';
class HomePage extends StatefulWidget {
@override
import os
def trocar(arquivo):
if ' ' in arquivo:
new_file = arquivo.replace(' ', '-')
os.rename(arquivo, new_file)
return new_file
return arquivo
@lucas404x
lucas404x / perceptron.py
Last active December 29, 2019 15:31
Perceptron de uma camada implementado em Python 3
import random
class Perceptron:
def __init__(self, limiar, parada, taxa_aprendizado = 0.1):
self.pesos = []
self.limiar = limiar
self.parada = parada
self.taxa_aprendizado = taxa_aprendizado