This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| public class EntityNode | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class StudentsController : ControllerBase | |
| { | |
| private readonly YourDbContext _context; | |
| public StudentsController(YourDbContext context) | |
| { | |
| _context = context; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Microsoft.AspNetCore.Identity; | |
| using Microsoft.AspNetCore.Mvc; | |
| using Microsoft.Extensions.Configuration; | |
| using Microsoft.IdentityModel.Tokens; | |
| using System.IdentityModel.Tokens.Jwt; | |
| using System.Security.Claims; | |
| using System.Text; | |
| namespace SeuProjeto.Controllers | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... Seção HTML/Razor Markup Omitida ... | |
| @code { | |
| // Modelo de credenciais (usado para Login/Registro) | |
| private SeuProjeto.Controllers.AuthController.CredenciaisModel model = new(); | |
| private List<SeuProjeto.Controllers.GamesController.Game> _games = new(); | |
| private string? _authMessage; // Mensagem de feedback de autenticação | |
| private bool _authSuccess; | |
| private bool _isLoading; | |
| private string? _fetchMessage; // Mensagem de feedback da API protegida |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Autenticação de Usuários com Identity | |
| builder.Services.AddDefaultIdentity<IdentityUser>( | |
| options => options.SignIn.RequireConfirmedAccount = true | |
| ) | |
| .AddEntityFrameworkStores<ApplicationDbContext>(); | |
| // API Controllers | |
| builder.Services.AddControllers(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime, timedelta | |
| from django.utils import timezone | |
| # Calculando a data de 15 dias atrás | |
| data_inicio = timezone.now() - timedelta(days=15) | |
| data_fim = timezone.now() | |
| # Filtrando e ordenando os registros | |
| pastas_modificadas = PastaAluno.objects.filter( | |
| data_modificacao__range=(data_inicio, data_fim) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Model | |
| class Funcionario(models.Model): | |
| matricula = models.CharField(max_length=7, default="0000000") | |
| nome = models.CharField(max_length=200) | |
| # ... | |
| assuncao = models.DateField(auto_now=False, auto_now_add= False, null=True, blank=True, default= None) | |
| admissao = models.DateField(auto_now=False, auto_now_add= False, null=True, blank=True, default= None) | |
| encerramento = models.DateField(auto_now=False, auto_now_add= False, null=True, blank=True, default= None) | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Funcionario(models.Model): | |
| SEXO_CHOICES = [ | |
| ("NAOINFORMADO", "Não Informado"), | |
| ("FEM", "Feminino"), | |
| ("MAS", "Masculino") | |
| ] | |
| genero = models.CharField(max_length=50, choices=SEXO_CHOICES, default = ("NAOINFORMADO", "Não Informado")) | |
| CONTRATACAO_CHOICES = [ | |
| ("ESTATUTARIO", "Servidor Estatutário"), | |
| ("CLT", "Servidor CLT"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sounddevice as sd | |
| import numpy as np | |
| # Define as configurações do microfone (ajuste conforme necessário) | |
| sample_rate = 44100 # Taxa de amostragem padrão | |
| channels = 1 # 1 para mono, 2 para estéreo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import numpy as np | |
| # Camera indices | |
| camera_indices = [0, 1] | |
| # Create capture objects |
NewerOlder