10 interesting stories served every morning and every evening.
Your browser does not support the audio element.
This content is generated by Google AI. Generative AI is experimental
Gemini 3 Pro represents a generational leap from simple recognition to true visual and spatial reasoning. It is our most capable multimodal model ever, delivering state-of-the-art performance across document, spatial, screen and video understanding. This model sets new highs on vision benchmarks such as MMMU Pro and Video MMMU for complex visual reasoning, as well as use-case-specific benchmarks across document, spatial, screen and long video understanding.
Real-world documents are messy, unstructured, and difficult to parse — often filled with interleaved images, illegible handwritten text, nested tables, complex mathematical notation and non-linear layouts. Gemini 3 Pro represents a major leap forward in this domain, excelling across the entire document processing pipeline — from highly accurate Optical Character Recognition (OCR) to complex visual reasoning.To truly understand a document, a model must accurately detect and recognize text, tables, math formulas, figures and charts regardless of noise or format.A fundamental capability is “derendering” — the ability to reverse-engineer a visual document back into structured code (HTML, LaTeX, Markdown) that would recreate it. As illustrated below, Gemini 3 demonstrates accurate perception across diverse modalities including converting an 18th-century merchant log into a complex table, or transforming a raw image with mathematical annotation into precise LaTeX code.
Example 2: Reconstructing equations from an image
Example 3: Reconstructing Florence Nightingale’s original Polar Area Diagram into an interactive chart (with a toggle!)
Users can rely on Gemini 3 to perform complex, multi-step reasoning across tables and charts — even in long reports. In fact, the model notably outperforms the human baseline on the CharXiv Reasoning benchmark (80.5%).To illustrate this, imagine a user analyzing the 62-page U.S. Census Bureau “Income in the United States: 2022” report with the following prompt: “Compare the 2021–2022 percent change in the Gini index for “Money Income” versus “Post-Tax Income”, and what caused the divergence in the post-tax measure, and in terms of “Money Income”, does it show the lowest quintile’s share rising or falling?”Swipe through the images below to see the model’s step-by-step reasoning.
Visual Extraction: To answer the Gini Index Comparison question, Gemini located and cross-referenced this info in Figure 3 about “Money Income decreased by 1.2 percent” and in Table B-3 about “Post-Tax Income increased by 3.2 percent”
Causal Logic: Crucially, Gemini 3 does not stop at the numbers; it correlates this gap with the text’s policy analysis, correctly identifying Lapse of ARPA Policies and the end of Stimulus Payments are the main causes.
Numerical Comparison: To compare the lowest quantile’s share rising or falling, Gemini3 looked at table A-3, and compared the number of 2.9 and 3.0, and concluded that “the share of aggregate household income held by the lowest quintile was rising.”
Gemini 3 Pro is our strongest spatial understanding model so far. Combined with its strong reasoning, this enables the model to make sense of the physical world.Pointing capability: Gemini 3 has the ability to point at specific locations in images by outputting pixel-precise coordinates. Sequences of 2D points can be strung together to perform complex tasks, such as estimating human poses or reflecting trajectories over time.Open vocabulary references: Gemini 3 identifies objects and their intent using an open vocabulary. The most direct application is robotics: the user can ask a robot to generate spatially grounded plans like, “Given this messy table, come up with a plan on how to sort the trash.” This also extends to AR/XR devices, where the user can request an AI assistant to “Point to the screw according to the user manual.”
Gemini 3.0 Pro’s spatial understanding really shines through its screen understanding of desktop and mobile OS screens. This reliability helps make computer use agents robust enough to automate repetitive tasks. UI understanding capabilities can also enable tasks like QA testing, user onboarding and UX analytics. The following computer use demo shows the model perceiving and clicking with high precision.
Gemini 3 Pro takes a massive leap forward in how AI understands video, the most complex data format we interact with. It is dense, dynamic, multimodal and rich with context.High frame rate understanding: We have optimized the model to be much stronger at understanding fast-paced actions when sampling at >1 frames-per-second. Gemini 3 Pro can capture rapid details — vital for tasks like analyzing golf swing mechanics.
By processing video at 10 FPS—10x the default speed—Gemini 3 Pro catches every swing and shift in weight, unlocking deep insights into player mechanics.
2. Video reasoning with “thinking” mode: We upgraded “thinking” mode to go beyond object recognition toward true video reasoning. The model can now better trace complex cause-and-effect relationships over time. Instead of just identifying what is happening, it understands why it is happening.3. Turning long videos into action: Gemini 3 Pro bridges the gap between video and code. It can extract knowledge from long-form content and immediately translate it into functioning apps or structured code.
Here are a few ways we think various fields will benefit from Gemini 3’s capabilities.Gemini 3.0 Pro’s enhanced vision capabilities drive significant gains in the education field, particularly for diagram-heavy questions central to math and science. It successfully tackles the full spectrum of multimodal reasoning problems found from middle school through post-secondary curriculums. This includes visual reasoning puzzles (like Math Kangaroo) and complex chemistry and physics diagrams.Gemini 3’s visual intelligence also powers the generative capabilities of Nano Banana Pro. By combining advanced reasoning with precise generation, the model, for example, can help users identify exactly where they went wrong in a homework problem.
Prompt: “Here is a photo of my homework attempt. Please check my steps and tell me where I went wrong. Instead of explaining in text, show me visually on my image.” (Note: Student work is shown in blue; model corrections are shown in red). [See prompt in Google AI Studio]
Gemini 3 Pro
stands as our most capable general model for medical and biomedical imagery understanding, achieving state-of-the-art performance across major public benchmarks in MedXpertQA-MM (a difficult expert-level medical reasoning exam), VQA-RAD (radiology imagery Q&A) and MicroVQA (multimodal reasoning benchmarks for microscopy based biological research).
Gemini 3 Pro’s enhanced document understanding helps professionals in finance and law tackle highly complex workflows. Finance platforms can seamlessly analyze dense reports filled with charts and tables, while legal platforms benefit from the model’s sophisticated document reasoning.
Gemini 3 Pro improves the way it processes visual inputs by preserving the native aspect ratio of images. This drives significant quality improvements across the board.
Additionally, developers gain granular control over performance and cost via the new media_resolution parameter. This allows you to tune visual token usage to balance fidelity against consumption:High resolution: Maximizes fidelity for tasks requiring fine detail, such as dense OCR or complex document understanding.Low resolution: Optimizes for cost and latency on simpler tasks, such as general scene recognition or long-context tasks.For specific recommendations, refer to our Gemini 3.0 Documentation Guide.We are excited to see what you build with these new capabilities. To get started, check out our developer documentation or play with the model in Google AI Studio today.
...
Read the original on blog.google »
The UniFi 5G Max lineup was created with a clear goal in mind: deliver a sleek, versatile, and exceptionally powerful 5G internet experience that works effortlessly in any environment.
The UniFi 5G Max makes deployment easy, whether installed locally or at a remote site. Plug it into any PoE port and it instantly appears as a ready to use WAN interface, no matter whether plugged directly into your UniFi gateway or into your office switch. No new cable runs needed! It sits neatly on a desk, but you can reposition it for the best possible signal using the included wall or window mount.
Automatic adoption as a UniFi WAN interface on any PoE port.
Optimize signal reception by repositioning anywhere on the network.
Ideal for home, office, or remote site use.
A compact form factor designed for fast installation and flexible placement at the core or edge.
The 5G Max delivers downlink speeds up to 2 Gbps with ultra low latency that makes it reliable as a primary connection and seamless as a backup WAN. UniFi routing policies and SLAs let you choose exactly how and when 5G is used, and for which clients and VLANs. Easily set per-SIM usage limits to avoid overage costs with just a few clicks.
High speed 5G that adapts to your network’s rules, not the other way around.
For tougher environments or deployments with poor indoor cellular coverage, the outdoor model maintains the same high performance cellular connectivity with improved antenna performance in a durable IP67 rated enclosure. It is built for rooftop installs, off site locations, and mobile deployments where reliability is critical. Just like its indoor counterpart, you can also connect it via any PoE port, anywhere on your network, greatly simplifying cabling requirements.
A weatherproof 5G device built for reliability wherever you place it.
If you want everything UniFi in one device, the DreamRouter 5G Max combines 5G connectivity with WiFi 7, local storage, and full UniFi OS application support. Deploy it anywhere 5G is available and run an entire high-performance and scalable network stack instantly.
Complete routing and management in one device
A complete UniFi system powered by the reach and speed of 5G.
Every device in the UniFi 5G lineup supports both physical SIMs and eSIM, giving you the freedom to choose your carrier and switch whenever needed with zero friction. All are equipped with dual SIM slots, with one SIM replaceable by eSIM, and are fully unlocked: any major carrier, any type of deployment, with one piece of hardware.
Carrier freedom built directly into the hardware from day 1. The UniFi 5G lineup brings sleek design, powerful performance, easy installation, and genuine WAN flexibility to every deployment.
...
Read the original on blog.ui.com »
Skip to main content
I once worked at a company which had an enormous amount of technical debt - millions of lines of code, no unit tests, based on frameworks that were well over a decade out of date. On one specific project, we had a market need to get some Windows-only modules running on Linux, and rather than cross-compiling, another team had simply copied & pasted a few hundred thousand lines of code, swapping Windows-specific components for Linux-specific. For the non-technical reader, this is an enormous problem because now two versions of the code exist. So, all features & bug fixes must be solved in two separate codebases that will grow apart over time. When I heard about this, a young & naive version of me set out to fix the situation….Tech debt projects are always a hard sell to management, because even if everything goes flawlessly, the code just does roughly what it did before. This project was no exception, and the optics weren’t great. I did as many engineers do and “ignored the politics”, put my head down, and got it done. But, the project went long, and I lost management’s trust in the process.I realized I was essentially trying to solve a people problem with a technical solution. Most of the developers at this company were happy doing the same thing today that they did yesterday…and five years ago. As Andrew Harmel-Law points out, code tends to follow the personalities of the people that wrote it. Personality types who intensely dislike change tend not to design their code with future change in mind.Most technical problems are really people problems. Think about it. Why does technical debt exist? Because requirements weren’t properly clarified before work began. Because a salesperson promised an unrealistic deadline to a customer. Because a developer chose an outdated technology because it was comfortable. Because management was too reactive and cancelled a project mid-flight. Because someone’s ego wouldn’t let them see a better way of doing things.The core issue with the project was that admitting the need for refactoring was also to admit that the way the company was building software was broken and that individual skillsets were sorely out of date. My small team was trying to fix one module of many, while other developers were writing code as they had been for decades. I had one developer openly tell me, “I don’t want to learn anything new.” I realized that you’ll never clean up tech debt faster than others create it. It is like triage in an emergency room, you must stop the bleeding first, then you can fix whatever is broken.The project also disabused me of the engineer’s ideal of a world in which engineering problems can be solved in a vacuum - staying out of “politics” and letting the work speak for itself - a world where deadlines don’t exist…and let’s be honest, neither do customers. This ideal world rarely exists. The vast majority of projects have non-technical stakeholders, and telling them “just trust me; we’re working on it” doesn’t cut it. I realized that the perception that your team is getting a lot done is just as important as getting a lot done.Non-technical people do not intuitively understand the level of effort required or the need for tech debt cleanup; it must be communicated effectively by engineering - in both initial estimates & project updates. Unless leadership has an engineering background, the value of the technical debt work likely needs to be quantified and shown as business value.Perhaps these are the lessons that prep one for more senior positions. In my opinion, anyone above senior engineer level needs to know how to collaborate cross-functionally, regardless of whether they choose a technical or management track. Schools teach Computer Science, not navigating personalities, egos, and personal blindspots. I have worked with some incredible engineers, better than myself - the type that have deep technical knowledge on just about any technology you bring up. When I was younger, I wanted to be that engineer - the “engineer’s engineer”. But I realize now, that is not my personality. I’m too ADD to be completely heads down. :)For all of their (considerable) strengths, more often than not, those engineers shy away from the interpersonal. They can be incredibly productive ICs, but may fail with bigger initiatives because they are only one person - a single processor core can only go so fast. Perhaps equally valuable is the “heads up coder” - the person who is deeply technical, but also able to pick their head up & see project risks coming (technical & otherwise) and steer the team around them.
You start out your day with a nice cup of coffee, and think, “Ah, greenfield project day…smooth sailing”. You fire up Visual Studio and create a new C# project. “First things first, I need library X.” you say. “Wait, what the?” The full error: Package ‘MyPackage 1.0.0.0’ was restored using ‘.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1’ instead of the project target framework ‘net6.0’. This package may not be fully compatible with your project. “Ok” you think, “That library is a bit older. I’ll go update the library project to .NET 6 to match my project. But, where is .NET 6? “Ok, what about my new project? Just as a test, does the warning go away if I set it to an older .NET Framework? Wait, where are the .NET Framework versions?…
Pointers are funny things. They are one of the make or break concepts for beginners, and even years later, they can cause grief to experienced developers. I am no exception. Here is one such story: I was faced with a class which I wanted to refactor. It can be simplified as follows: In the interest of breaking up the responsibilities, I added a couple of interfaces. The idea is that I can pass around smart pointers to these interfaces and begin to decouple portions of the code. For example, I can inject them into classes that need them: However, I made a mistake. I blame it on years of using boost::intrustive_ptr instead of std::shared_ptr, but enough excuses. Let’s see if you can spot it. Do you see it? If so, give yourself 5 points. If not, maybe after seeing the output: ‘second’ going out of scope… Destructor ‘first’ going out of scope… ‘root’ going out of scope… All done… Both shared pointers ( first & second…
...
Read the original on blog.joeschrag.com »
Add AP News as your preferred source to see more of our stories on Google.
Add AP News as your preferred source to see more of our stories on Google.
KISUMU, Kenya (AP) — A high court in Kenya on Thursday declared unconstitutional sections of a seed law that prevented farmers from sharing and selling indigenous seeds in what food campaigners have called a landmark win for food security.
Farmers in Kenya could face up to two years’ imprisonment and a fine of 1 million Kenya shillings ($7,700) for sharing seeds through their community seed banks, according to a seed law signed in 2012.
Justice Rhoda Rutto on Thursday said sections of the seed law that gave government officials powers to raid seed banks and seize seeds were also unconstitutional.
The law was introduced as a measure to curb growing sale of counterfeit seeds that were causing loses in the agricultural sector and gave sole seed trading rights to licensed companies.
The case had been filed by 15 smallholder farmers, who are members of community seed banks that have been in operation for years, preserving and sharing seeds among colleagues.
A farmer, Samuel Wathome, who was among the 15, said the old farming practices had been vindicated.
“My grandmother saved seeds, and today the court has said I can do the same for my grandchildren without fear of the police or of prison,” he said.
Elizabeth Atieno, a food campaigner at Greenpeace Africa, called the win a “victory for our culture, our resilience, and our future.”
“By validating indigenous seeds, the court has struck a blow against the corporate capture of our food system. We can finally say that in Kenya, feeding your community with climate-resilient, locally adapted seeds is no longer a crime,” she said.
Food campaigners have in the past encouraged governments to work with farmers to preserve indigenous seeds as a way of ensuring food security by offering farmers more plant varieties.
Indigenous seeds are believed to be drought resistant and adaptable to the climate conditions of their native areas, and hence often outperform hybrid seeds.
Kenya has a national seed bank based near the capital Nairobi where indigenous seeds are stored in cold rooms, but farmers say community seed banks are equally important for variety and proximity to the farmer.
The country has faced challenges in the seed sector where counterfeit seeds were sold to farmers, leading to losses amounting to millions of shillings in a country that relies on rain-fed agriculture.
...
Read the original on apnews.com »
The Qualcomm Snapdragon X Plus and Snapdragon X Elite have proven that ARM processors have earned a place in the laptop market, as devices like the Lenovo IdeaPad Slim 5 stand out with their long battery life and an affordable price point.
MetaComputing is now offering an alternative to Intel, AMD and the Snapdragon X series. Specifically, the company has introduced a mainboard that can be installe in the Framework Laptop 13 or in a mini PC case. This mainboard is equipped with a CIX CP8180 ARM chipset, which is also found inside the Minisforum MS-R1. This processor has a total of eight ARM Cortex-A720 performance cores, the two fastest can hit boost clock speeds of up to 2.6 GHz. Moreover, there are four Cortex-A520 efficiency cores.
...
Read the original on www.notebookcheck.net »
A quarter-century after its publication, one of the most influential research articles on the potential carcinogenicity of glyphosate has been retracted for “several critical issues that are considered to undermine the academic integrity of this article and its conclusions.” In a retraction notice dated Friday, November 28, the journal Regulatory Toxicology and Pharmacology announced that the study, published in April 2000 and concluding the herbicide was safe, has been removed from its archives. The disavowal comes 25 years after publication and eight years after thousands of internal Monsanto documents were made public during US court proceedings (the “Monsanto Papers”), revealing that the actual authors of the article were not the listed scientists — Gary M. Williams (New York Medical College), Robert Kroes (Ritox, Utrecht University, Netherlands), and Ian C. Munro (Intertek Cantox, Canada) — but rather Monsanto employees.
Known as “ghostwriting,” this practice is considered a form of scientific fraud. It involves companies paying researchers to sign their names to research articles they did not write. The motivation is clear: When a study supports the safety of a pesticide or drug, it appears far more credible if not authored by scientists employed by the company marketing the product.
You have 73.89% of this article left to read. The rest is for subscribers only.
...
Read the original on www.lemonde.fr »
The State Department is instructing its staff to reject visa applications from people who worked on fact-checking, content moderation or other activities the Trump administration considers “censorship” of Americans’ speech.
The directive, sent in an internal memo on Tuesday, is focused on applicants for H-1B visas for highly skilled workers, which are frequently used by tech companies, among other sectors. The memo was first reported by Reuters; NPR also obtained a copy.
“If you uncover evidence an applicant was responsible for, or complicit in, censorship or attempted censorship of protected expression in the United States, you should pursue a finding that the applicant is ineligible” for a visa, the memo says. It refers to a policy announced by Secretary of State Marco Rubio in May restricting visas from being issued to “foreign officials and persons who are complicit in censoring Americans.”
The Trump administration has been highly critical of tech companies’ efforts to police what people are allowed to post on their platforms and of the broader field of trust and safety, the tech industry’s term for teams that focus on preventing abuse, fraud, illegal content, and other harmful behavior online.
President Trump was banned from multiple social media platforms in the aftermath of his supporters’ attack on the Capitol on Jan. 6, 2021. While those bans have since been lifted, the president and members of his administration frequently cite that experience as evidence for their claims that tech companies unfairly target conservatives — even as many tech leaders have eased their policies in the face of that backlash.
Tuesday’s memo calls out H-1B visa applicants in particular “as many work in or have worked in the tech sector, including in social media or financial services companies involved in the suppression of protected expression.”
It directs consular officers to “thoroughly explore” the work histories of applicants, both new and returning, by reviewing their resumes, LinkedIn profiles, and appearances in media articles for activities including combatting misinformation, disinformation or false narratives, fact-checking, content moderation, compliance, and trust and safety.
“I’m alarmed that trust and safety work is being conflated with ‘censorship’,” said Alice Goguen Hunsberger, who has worked in trust and safety at tech companies including OpenAI and Grindr.
“Trust and safety is a broad practice which includes critical and life-saving work to protect children and stop CSAM [child sexual abuse material], as well as preventing fraud, scams, and sextortion. T&S workers are focused on making the internet a safer and better place, not censoring just for the sake of it,” she said. “Bad actors that target Americans come from all over the world and it’s so important to have people who understand different languages and cultures on trust and safety teams — having global workers at tech companies in [trust and safety] absolutely keeps Americans safer.”
In a statement, a State Department spokesperson who declined to give their name said the department does not comment on “allegedly leaked documents,” but added: “the Administration has made clear that it defends Americans’ freedom of expression against foreigners who wish to censor them. We do not support aliens coming to the United States to work as censors muzzling Americans.”
The statement continued: “In the past, the President himself was the victim of this kind of abuse when social media companies locked his accounts. He does not want other Americans to suffer this way. Allowing foreigners to lead this type of censorship would both insult and injure the American people.”
First Amendment experts criticized the memo’s guidance as itself a potential violation of free speech rights.
“People who study misinformation and work on content-moderation teams aren’t engaged in ‘censorship’— they’re engaged in activities that the First Amendment was designed to protect. This policy is incoherent and unconstitutional,” said Carrie DeCell, senior staff attorney and legislative advisor at the Knight First Amendment Institute at Columbia University, in a statement.
Even as the administration has targeted those it claims are engaged in censoring Americans, it has also tightened its own scrutiny of visa applicants’ online speech.
On Wednesday, the State Department announced it would require H-1B visa applicants and their dependents to set their social media profiles to “public” so they can be reviewed by U. S. officials.
...
Read the original on www.npr.org »
I was 25 years old when I started writing the blog version of Res Obscura, which ran from 2010 to 2023 (and still exists here). This was the early summer of 2010. I was a second-year PhD student in history, living with two roommates in a 1920s bungalow on the east side of Austin.
And I was very dedicated to the idea that you should aim to write a new blog post every day:
This is a concept that the 40-year-old version of me, with two young kids and zero free time, cannot even begin to fathom.
It’s also a practice of the old internet that simply doesn’t exist anymore — one of many digital behaviors that was swallowed up by social media. That whole world of blogging (exploratory, low-stakes, conversational, and assuming a readership of people who had bookmarked your URL and who read it on a desktop or laptop computer) is almost entirely gone now.
My first two years writing Res Obscura in its blog format were great fun. I began to develop an intellectual community, forming contacts with, for instance, the wonderful Public Domain Review (founded 2011 and still going strong). I linked to and was linked to by a range of other history bloggers who I saw as kindred spirits, some of whom seem to have disappeared (BibliOdyssey) others of whom have become well-known writers (Lindsey Fitzharris).
Get 20% off for 1 year
It was pretty addictive when a post went viral. In those halcyon days when written blog posts about obscure historical subjects were viable sources of viral content, you could end up getting covered in international media for, say, discovering a cat’s paw prints on a 15th century Croatian manuscript.
That spike in readership around 2018 was partially from a post about 17th century food that, unexpectedly, led to me speaking about snail water on New Zealand public radio.
But by then, I was starting to move on. I was hard at work on my first book — the book I needed to write for tenure — and was becoming a bit dispirited by the increasingly click-bait nature of blogging, not to mention the tendency of social media to elevate toxic behavior and controversy over lovely and fascinating but totally uncontroversial things like the Croatian cat paw prints.
I also (then and now) have no appetite for short-form video content, and still less for the type of history explainer videos — “here’s a two hour deep dive into why this movie is historically inaccurate” or “everything you need to know about such-and-such famous person” — that seem to do well on YouTube.
Switching over to a Substack newsletter, in the summer of 2023, revived my interest in writing online. It felt like rejoining an intellectual community — not quite the same as the golden age of blogging in the 2000s, but something equally as lively, in a way that I don’t think quite gets enough credit in the 2020s.
From Weird Medieval Guys to ’s Noted to ’s Fernando Pessoa-esque The Hinternet and the newsletters of well-known historians like David Bell (French Reflections), as well as the more general audience or politically oriented newsletters that still dig deep into historical topics (like ’s Unpopular Front and ’s newsletter), I would say that Substack is now the most interesting place online for discussions not just of history, but of humanistic topics as a whole.
Needless to say, there’s also a ton of people writing about the intersection of AI, technology and contemporary society (of which I would single out AI Log, Ethan Mollick’s One Useful Thing, , and ).
So why have I kept writing Res Obscura through all the changes of the world — and of my own life and interests — since the summer of 2010? Simple: I love sharing things I find interesting, especially things which are not available elsewhere online. Most of my posts are written because I search for information on something and don’t find it.
The niche nature of Res Obscura (from 17th century cocaine to Kinetoscopes to Henry James: the RPG) is precisely why I enjoy writing it.
I am deeply grateful that 15 years and 8,300 subscribers later, I have a place online where I can share idiosyncratic knowledge and writing with an equally idiosyncratic group of readers.
Now here’s the inevitable part where I ask if you would be willing to support my continued work. To that end, I have set up a special holiday discount valid until the end of December. Thank you for reading!
A detail of a trompe-l’œil “dome” by the Renaissance painter Andrea Mantegna, Camera degli Sposi, Ducal Palace, Mantua, Italy. Featured in a 2011 Res Obscura post called “The Art of Fooling the Eye.”
...
Read the original on resobscura.substack.com »
Whenever I see the comment // this should never happen in code, I try to find out the exact conditions under which it could happen. And in 90% of cases, I find a way to do just that. More often than not, the developer just hasn’t considered all edge cases or future code changes.
In fact, the reason why I like this comment so much is that it often marks the exact spot where strong guarantees fall apart. Often, violating implicit invariants that aren’t enforced by the compiler are the root cause.
Yes, the compiler prevents memory safety issues, and the standard library is best-in-class. But even the standard library has its warts and bugs in business logic can still happen.
All we can work with are hard-learned patterns to write more defensive Rust code, learned throughout years of shipping Rust code to production. I’m not talking about design patterns here, but rather small idioms, which are rarely documented, but make a big difference in the overall code quality.
if !matching_users.is_empty() {
let existing_user = &matching_users[0];
What if you refactor it and forget to keep the is_empty() check? The problem is that the vector indexing is decoupled from checking the length. So matching_users[0] can panic at runtime if the vector is empty.
Checking the length and indexing are two separate operations, which can be changed independently. That’s our first implicit invariant that’s not enforced by the compiler.
If we use slice pattern matching instead, we’ll only get access to the element if the correct match arm is executed.
match matching_users.as_slice() {
[] => todo!(“What to do if no users found!?“),
[existing_user] => { // Safe! Compiler guarantees exactly one element
// No need to index into the vector,
// we can directly use `existing_user` here
_ => Err(RepositoryError::DuplicateUsers)
Note how this automatically uncovered one more edge case: what if the list is empty? We hadn’t explicitly considered this case before. The compiler-enforced pattern matching requires us to think about all possible states! This is a common pattern in all robust Rust code: putting the compiler in charge of enforcing invariants.
When initializing an object with many fields, it’s tempting to use ..Default::default() to fill in the rest. In practice, this is a common source of bugs. You might forget to explicitly set a new field later when you add it to the struct (thus using the default value instead, which might not be what you want), or you might not be aware of all the fields that are being set to default values.
Instead of this:
let foo = Foo {
field1: value1,
field2: value2,
..Default::default() // Implicitly sets all other fields
let foo = Foo {
field1: value1,
field2: value2,
field3: value3, // Explicitly set all fields
field4: value4,
Yes, it’s slightly more verbose, but what you gain is that the compiler will force you to handle all fields explicitly. Now when you add a new field to Foo, the compiler will remind you to set it here as well and reflect on which value makes sense.
If you still prefer to use Default but don’t want to lose compiler checks, you can also destructure the default instance:
let Foo { field1, field2, field3, field4 } = Foo::default();
This way, you get all the default values assigned to local variables and you can still override what you need:
let foo = Foo {
field1: value1, // Override what you need
field2: value2, // Override what you need
field3, // Use default value
field4, // Use default value
This pattern gives you the best of both worlds:
You get default values without duplicating default logic
The compiler will complain when new fields are added to the struct
It’s clear which fields use defaults and which have custom values
Completely destructuring a struct into its components can also be a defensive strategy for API adherence. For example, let’s say you’re building a pizza ordering system and have an order type like this:
struct PizzaOrder {
size: PizzaSize,
toppings: Vec
For your order tracking system, you want to compare orders based on what’s actually on the pizza - the size, toppings, and crust_type. The ordered_at timestamp shouldn’t affect whether two orders are considered the same.
Here’s the problem with the obvious approach:
impl PartialEq for PizzaOrder {
fn eq(&self, other: &Self) -> bool {
self.size == other.size
&& self.toppings == other.toppings
&& self.crust_type == other.crust_type
// Oops! What happens when we add extra_cheese or delivery_address later?
Now imagine your team adds a field for customization options:
struct PizzaOrder {
size: PizzaSize,
toppings: Vec
Your PartialEq implementation still compiles, but is it correct? Should extra_cheese be part of the equality check? Probably yes - a pizza with extra cheese is a different order! But you’ll never know because the compiler won’t remind you to think about it.
impl PartialEq for PizzaOrder {
fn eq(&self, other: &Self) -> bool {
let Self {
size,
toppings,
crust_type,
ordered_at: _,
} = self;
let Self {
size: other_size,
toppings: other_toppings,
crust_type: other_crust,
ordered_at: _,
} = other;
size == other_size && toppings == other_toppings && crust_type == other_crust
Now when someone adds the extra_cheese field, this code won’t compile anymore. The compiler forces you to decide: should extra_cheese be included in the comparison or explicitly ignored with extra_cheese: _?
This pattern works for any trait implementation where you need to handle struct fields: Hash, Debug, Clone, etc. It’s especially valuable in codebases where structs evolve frequently as requirements change.
Code Smell: From Impls That Are Really TryFrom
Sometimes there’s no conversion that will work 100% of the time. That’s fine. When that’s the case, resist the temptation to offer a From implementation out of habit; use TryFrom instead.
Here’s an example of TryFrom in disguise:
impl From for DetectorStartupErrorSubject {
fn from(report: &DetectorStartupErrorReport) -> Self {
let postfix = report
.get_identifier()
.or_else(get_binary_name)
.unwrap_or_else(|| UNKNOWN_DETECTOR_SUBJECT.to_string());
Self(StreamSubject::from(
format!(“apps.errors.detectors.startup.{postfix}“).as_str(),
The unwrap_or_else is a hint that this conversion can fail in some way. We set a default value instead, but is it really the right thing to do for all callers? This should be a TryFrom implementation instead, making the fallible nature explicit. We fail fast instead of continuing with a potentially flawed business logic.
It’s tempting to use match in combination with a catch-all pattern like _ => {}, but this can haunt you later. The problem is that you might forget to handle a new case that was added later.
match self {
Self::Variant1 => { /* … */ }
Self::Variant2 => { /* … */ }
_ => { /* catch-all */ }
match self {
Self::Variant1 => { /* … */ }
Self::Variant2 => { /* … */ }
Self::Variant3 => { /* … */ }
Self::Variant4 => { /* … */ }
By spelling out all variants explicitly, the compiler will warn you when a new variant is added, forcing you to handle it. Another case of putting the compiler to work.
If the code for two variants is the same, you can group them:
match self {
Self::Variant1 => { /* … */ }
...
Read the original on corrode.dev »
Skip to product information
The independent European Do It Together (DIT) Linux phone, shaped by the people who use it.
Your 99 € is fully refundable and deducted from the full price later.
This product will only be produced if at least 2000 units are supported by January 04, 2026 23:55 (Helsinki)
By reserving a device, you directly contribute bring the new Jolla Phone into reality. The product will be made once we reach 2,000 pre-orders. This project goes ahead when we reach 2,000 pre-orders. If we don’t hit the goal, your payment is refunded.
This item is a recurring or deferred purchase. By continuing, I agree to the and authorize you to charge my payment method at the prices, frequency and dates listed on this page until my order is fulfilled or I cancel, if permitted.
View full details
12GB RAM and 256GB storage expandable up to 2TB
No tracking, no calling home, no hidden analyticsUser configurable physical Privacy Switch - turn off you microphone, bluetooth, Android apps, or whatever you wish
Available in three distinct colours inspired by Nordic nature
Defined together with the Community
Over the past months, Sailfish OS community members voted on what the next Jolla device should be. The key characteristics, specifications and features of the device. Based on community voting and real user needs, this device has only one mission:
Community Voice, Real Device: The questionnaire received overwhelming flow of input and this project captures thatNow it is time to act! Your pre-order determines whether the project becomes reality
No tracking, no calling home, no hidden analytics.
Your phone, your apps, your control
Run native Sailfish apps, Android apps with AppSupport, or go fully de-Googled whenever you wish — simply by shutting down the Android apps.
Unlike mainstream phones, Sailfish OS is designed not to harvest your data. No trackers. No profiling. No data monetisation. Your phone should work for you, not exploit you.
Sailfish OS is proven to outlive mainstream support cycles. Long-term OS support, guaranteed for minimum 5 years. Incremental updates, and no forced obsolescence.
Your Phone Shouldn’t Spy on YouMainstream phones send vast amounts of background data. A common Android phone sends megabytes of data per day to Google even if the device is not used at all. Sailfish OS stays silent unless you explicitly allow connections.
DIT: DO IT TOGETHER
You voted on the deviceYou guided its specs and definitionAnd now you help bring it to life
Our Community
Because this is a community-funded device and we need committed pre-orders to turn the designs into a full product program and commit to order the first production batch. If we reach 2,000 units we start the full product program. If not, you get a full refund.
What is the normal price of the product, do I get discount participating to the pre-order?
The final price of the product is not set yet but we estimate it to settle between 599€ - 699€ (incl. your local VAT). The final price depends on the confirmation of the final specification and the Bill-of-Materials, which happens on due course during the product program. Notably in particular memory component prices have had exceptionally high volatility during this year. By pre-ordering you confirm your special price of total 499€.
Is this phone real or just a concept?
It is real. Definition and real electro-mechanical design is underway, based on the community voting. To turn the designs into a full product program and commit to order the first batch, we need in minimum 2,000 committed pre-orders.
When will full specs be available?
Once the manufacturing pathway is confirmed at 2,000 pre-orders.
Will there be accessories, like a spare battery and protective case?
Yes, there will be. We’ll make those available on due course the project.
When will the phone ship?
Will the Jolla Phone work outside Europe, can I use it e.g. in the U. S.?
Yes, we will design the cellular band configuration to enable global travelling as much as possible, including e.g. roaming in the U.S. carrier networks.
Can I buy the Jolla Phone if I’m outside Europe, can I use it e.g. in the U.S.?
The initial sales markets are EU, UK, Switzerland and Norway. Entering other markets, such as the U.S. and Canada are to be decided due course based on potential interest from the areas. We will design the cellular band configuration to enable potential future markets, including major U.S. carrier networks.
...
Read the original on commerce.jolla.com »
To add this web app to your iOS home screen tap the share button and select "Add to the Home Screen".
10HN is also available as an iOS App
If you visit 10HN only rarely, check out the the best articles from the past week.
If you like 10HN please leave feedback and share
Visit pancik.com for more.