on-internet

JAVA - Orientação em Disponibilizar o idUsuario e Session para todas as Servlets [fechada]

Quando o usuário efetuar o LOGIN o Sistema Autentica e Disponibiliza para todo o sistema, como faço para capturar o idUsuario de cada usuário logado no sistema ? Servlet - Autenticação Usuário public class AuthControlador extends HttpServlet { //Identificador único de versão em classes Java private static final long serialVersionUID = 1L; private UserDAO authDao = new UserDAO(); private final String PagLogar = "login.jsp"; private final String PagHome = "home.jsp"; protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { res

Join the discussion →

Can ast be used to parse a single line? mode='single' doesn't work on some lines [closed]

Is it possible to use ast to parse a single line so that an ast.Name node can be identified and modified? At the moment this falls over when there is white-space at the beginning of the line. Obviously I could strip this out, modify the AST and then add it back in again but is there a better, more "Pythonic" way of doing this? Example2 below shows how ast.parse(..., mode='single') doesn't appear to work correctly, or at least not as expected. Couldn't find much documentation explaining how it is supposed to work though. import ast line = " x = 1; # test comment" ast_tree = ast.parse(line) modi

Join the discussion →

Compare lists in one column to the first n elements of another column in Python Polars lazyframes, where n is dynamically determined from index

I'm trying to compare words present within sentences in one column, to the first n words in a wordlist (in another column), and return the words in the sentences that don't exist in that subset of the wordlist (to a new column). The "n" amount should be dynamically determined by the index of the sentence being currently compared. More specifically, n should be determined by the index position of the sentence divided by some scaling factor as follows: n = index/scaling_factor Rounded down to the nearest integer, so that it is a valid index position: n = math.floor(index/scaling_factor) In the e

Join the discussion →

Capitole du Libre les 14 & 15 novembre 2026 à Toulouse

Le Capitole du Libre est un week-end dédié au Logiciel Libre et à la culture libre en Occitanie. Cette année, la treizième édition se tiendra les samedi 14 et dimanche 15 novembre 2026 à l’INP-N7 en centre‐ville de Toulouse. lien nᵒ 1 : Site web du Capitole du Libre lien nᵒ 2 : Le programme du week-end lien nᵒ 3 : Inscription (gratuite) au Capitole du Libre 2026 lien nᵒ 4 : Vidéos des années précédentes lien nᵒ 5 : Article de la presse locale sur l'édition 2025 Comme chaque année, Toulouse va connaitre les 14 et 15 novembre un week-end placé sous le signe du partage communautaire, autour du nu

Join the discussion →

ISUCON2026 で優勝しました(当日編)

はじめに こんにちは! @kawasy です。普段は Typing Bears という人間1人の会社で個人開発・研究をしながら、スタートアップを中心に経営課題の解決を支援しています。活動の主なテーマは、ソフトウェアプロダクト開発企業に必要なCTO機能の提供と育成です。 ISUCON2026 にチーム Typing Bears として1人で参加し、最終スコア 625,857 点で優勝しました。ISUCON への参加は10年ぶりです。 今回は、完全自律で動作する、HOOTL(Human-out-of-the-loop)型のISUCON用の競技エージェントを用意して参加しました。土曜日は子...

Join the discussion →

Moving from legacy docker / uWSGI / Flask to new best practice

Years ago (2015-2020) I created a few hobby projects. The setup was extremely simple via: tiangolo/uwsgi-nginx-flask:latest docker image, a slim docker image with a production ready webserver simple requirements from /app/requirements.txt which were installed via pip in the Docker file a prestart.sh which did some flask database migrations if necessary It was of good performance due to having nginx. I had an ansible script which build the docker image, made a local tarbar with docke save, send it over to my VPS and ran the image at specified domain. With Traefik, I could ran dozens of projects

Join the discussion →

Découverte du langage Elixir

Beaucoup de Rust par-ci… Un peu de Go par-là… Saupoudrez de LLM selon vos goûts et vous aurez une bonne photographie des sujets qui préoccupent les développeurs sur l'Internet d'aujourd'hui. Alors, n'est-ce pas le meilleur moment pour se rafraîchir l'esprit avec des langages plus discrets ? Je vous propose ici une présentation accélérée d'Elixir. lien nᵒ 1 : Site officiel du langage Elixir Sommaire Un langage de programmation fonctionnelle Correspondance de motifs (ou Pattern matching) Module, fonctions et clauses de garde Listes et récursivité L'opérateur pipe L'exercice sympa qui utilise tou

Join the discussion →

Why can a parameterized class be instantiated?

I have this generic class: class Box[T]: def __init__(self, val: T): self.val = val In Python < 3.12, that would be written: from typing import TypeVar, Generic T = TypeVar('T') class Box(Generic[T]): def __init__(self, val: T): self.val = val According to the docs, I can instantiate it like this: box = Box[int](42) However, I don't understand why this even works. If I print the type of Box[int]: klass = Box[int] print(type(klass)) # <class 'typing._GenericAlias'> According to the docs and this Q&A, a generic alias is supposed to represent a type annotation by storing the original type and typ

Join the discussion →

AIが書く「読みづらいADR」に発狂しかけたので、ADRのガイドラインを作った

はじめに みなさん、ADR(Architecture Decision Record)は書いていますでしょうか? AIを使ったソフトウェア開発において「意思決定の記録を残す」ことの重要性は、今や多くのエンジニアに周知されているかと思います。 僕が率いるチームにおいても、プロジェクト開始初期から様々な技術的な意思決定をADRに記録し、運用してきました。最近では、ADRのドラフト作成もAIに任せるようになっています。 ところが、ADRを書くルールを整備しないままAIに書かせていると、 人間が読み返しづらいADR が次々と出てくるようになりました。「人間がじっくり目を通すべきものの代表格」...

Join the discussion →

Difference between three forms of instantiating a generic class in Python

I have this generic class in Python 3.12: class Box[T]: def __init__(self, val: T): self.val = val I can instantiate it in 3 ways: box: Box[int] = Box(42) box = Box[int](42) box = Box(42) What's the difference? Do different type checkers (pyright, pyrefly, etc) interpret them differently? How about in legacy Python (<3.12), where the example would be: from typing import TypeVar, Generic T = TypeVar('T') class Box(Generic[T]): def __init__(self, val: T): self.val = val

Join the discussion →

iPhone Duo, Device Hub: how to test when set in tent mode? [closed]

Device Hub for Xcode 27.2 includes simulator for iPhone Duo running iOS 27.2. The controls for the simulator have obvious settings to open the display showing the inner screen, or closing the display to show the outer screen. It also includes controls for rotating the device. When open and showing the inner screen a rotation will change the orientation between portrait, landscape, etc. These various combinations are known as poses. However there is an additional pose Apple tells us about called Tent mode or Stand by mode (the second of the above images). In this case the phone is half opened a

Join the discussion →

iPhone Duo, Device Hub, tent mode [closed]

Device Hub for Xcode 27.2 includes simulator for iPhone Duo running iOS 27.2. The controls for the simulator have obvious settings to open the display showing the inner screen, or closing the display to show the outer screen. It also includes controls for rotating the device. When open and showing the inner screen a rotation will change the orientation between portrait, landscape, etc. These various combinations are known as poses. However there is an additional pose Apple tells us about called "Tent mode" or "Stand by mode" (the second of the above images). In this case the phone is half open

Join the discussion →

君の髪が気になるんだ - 兼田りょう / #7 | コミックDAYS

君の髪が気になるんだ 兼田りょう 野球部を引退したばかりの鈴原は彼女から突然別れを告げられ、その現場を教室の隣の席の宮下に見られてしまう。卒業も近づく高3の夏、引退して髪を伸ばし始めた鈴原は、毎日髪型を変える宮下のことがやけに気になってしまい——君と髪と恋の物語、始まります。

Join the discussion →

Is there a way to use lazy imports in backwards-compatible code?

I'm writing some code that I want to make use of lazy imports, which were introduced in Python 3.15. However, I want the code to run fine on Python < 3.15 too, albeit without lazy imports. Just running the following code would raise a SyntaxError on previous Python versions: lazy import numpy as np I tried using a conditional: import sys if sys.version_info >= (3, 15): lazy import numpy as np else: import numpy as np But it still raises a syntax error on Python 3.10. And it would be cumbersome anyway to have to write that in every file.

Join the discussion →

MAUI FilePicker.PickMultipleAsync() taking 30 seconds just to open the dialog

I have a MAUI app running on .NET 8. The app is a Windows-only app. I have Microsoft.Maui.Essentials version 8.0.100, and it appears to be the latest version for .NET 8 at the moment. It has a button for uploading files: <ImageButton Command="{Binding GetFilesCommand}" HeightRequest="90" HorizontalOptions="Start" Source="Assets/icon-add-pink.png" /> In the ViewModel, I have this line in the constructor: GetFilesCommand = new Command(async () => await GetFilesCommandAsync()); This is the command method: private async Task GetFilesCommandAsync() { try { IEnumerable<FileResult> file = await FileP

Join the discussion →

Populate columns based on letters in each position of a string in another column

I have individuals (birds) who are identified via a 3-letter system, e.g. BBO, BOB, PPG, PGP, etc. The order in the code corresponds to the position on the individual, e.g. BOB has Blue on its head, Orange on its cheek, and Blue on its neck. I want to create a data frame that takes the individual ID code and populates "head", "cheek", and "neck" columns with the colors like below: bird <- c("BOB", "OOP", "GBG") head <- c("blue", "orange", "green") cheek <- c("orange", "orange", "blue") neck <- c("blue", "purple", "green") power <- c(1, 2, 3) data <- data.frame(ID = bird, Head = head, Cheek = c

Join the discussion →

Schengen visa entry not to issuing country

My visa was approved from Sweden embassy in India. I will enter Sweden via connecting flight from Zurich. So I will have visa control or border control check at Zurich correct? 2nd Question - Since Zurich will be transit only, main entry will be in Sweden, so I hope that fulfills entry criteria for visa issuing country. 3rd Question- In original itinerary submitted for visa , we had 8 nights in Sweden and 6 nights in Finland. Now itinerary is being changed so it would be 6 nights in Sweden and 6 nights in Finland while arrival and departure will happen from Sweden. So wanted to check if it wil

Join the discussion →

Para que servem os headers X-Forwarded-*?

Estou lendo sobre headers X-Forwarded-* e tentando entender o que são esses headers deste tipo X-Forwarded-<example> e qual a relação esses headers tem com uma requisição HTTP e qual seria a finalidade deles para minha aplicação no servidor. Entretanto, não consigo visualizar na minha mente sua finalidade. Identifiquei que existem alguns headers X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Host, X-Forwarded-Port, X-Forwarded-Prefix, X-Forwarded-Server, X-Forwarded-Ssl mas não achei um "padrão" e também não sei dizer se poderia existir um header customizado como X-Forwarded-Custom e qual ser

Join the discussion →

Emacs a 50 ans

Joyeux anniversaire Emacs ! Comme Slashdot l’a opportunément relevé, ce bel éditeur a maintenant un demi-siècle, ce qui semble complètement dingue. J’avais déjà clamé mon admiration ici il y a quelques années, alors c’est l’occasion de revenir sur ce beau morceau de logiciel, qui ne fait pas son âge (comme moi, donc), et sur ce qu’on peut encore faire avec aujourd’hui. Il a eu une vie un poil mouvementée, né à partir de TECO, réécrit complètement par Richard Stallman pour devenir GNU Emacs, forké vers XEmacs… On pourra bien entendu rappeler les innombrables flame wars avec Vim, les aphorismes

Join the discussion →

Heel Nederland Leest Het Diner van Herman Koch | Campaign to promote reading in the Netherlands starts today

submitted by thymos to books 14 points | 0 comments https://www.hebban.nl/heelnederlandleest Vanaf vandaag is het boek Het diner van Herman Koch gratis verkrijgbaar in alle openbare bibliotheken in Nederland als onderdeel van de campagne Heel Nederland Leest. Today, the CPNB (Collective Promotion for the Dutch Book) has started their annual campaign to promote reading called Heel Nederland Leest, or One Book, One Country. Every year they publish one book that they distribute freely in public libraries, and this year it’s The Dinner by Herman Koch.

Join the discussion →

Python 2 vs. Python 3: what does "not backward compatible" mean exactly?

According to Wikipedia: Python 3.0 was released on 3 December 2008, and was a major revision and not completely backward-compatible with earlier versions, with some new semantics and changed syntax. What does that actually mean? Was it just the syntax which has changed, for example: print vs. print(), so that you can get an old Python 2 script running with some modifications? Or was there something deeper? Because of the usage of Unicode, etc.

Join the discussion →

How to stop a bacteriophage naturally evolving

Within my setting (suppose near-ish future), antibiotic resistant bacteria have become the new norm, with almost all currently available antibiotics being ineffective at dispatching infections. Due to this, bacteriophages are used to treat bacterial infections instead. I am curious if there is any way to prevent the bacteriophages from undergoing natural selection, or just naturally occurring mutations in general as to avoid them perhaps beginning to hunt the bacterial strains humans need to live. How could this be achieved, disregarding any technological constraints?

Join the discussion →

2026 Book Bingo midpoint!

submitted by misericordiae to books 35 points | 20 comments Hey everyone, we’re now halfway through our third annual community book bingo challenge! What is book bingo, you ask? Basically, read something for each of five squares in a line on this year’s card, and you’re done! (That’s five works total, or more if you want to.) You don’t even have read books: any type or length of literary work, including comics, audiobooks, poems, short-form nonfiction, etc., will do. There’s still plenty of time (six whole months, in fact). Plus, anything you’ve read since May is eligible, so if you haven’t jo

Join the discussion →

How to cache neighbouring variables in a 2D array?

I'm making a grid based game in c++ with SDL3. My rooms are a 2D array of Tile objects stored in an array in DungeonCrawler (think of dungeoncrawler as my game settings .cpp and .h). I have a GetNeighbour() function that returns a pointer to a tile's neigbour depending on its direction (an enum of north, south, east and west, or null if it's at the edge of the room). Instead of calling GetNeighbour() every time I need a tile to know its neighbour, I want to loop over all the tiles once and cache their neighbours so an individual tile can later easily access its neighbour. I've started the cach

Join the discussion →
Older stories