Because the title says, I’m not certain tips on how to correctly construct an inverted ScrollView the place I can safely insert gadgets above my information (“prepend”) with out all the pieces leaping round.
My present code is actually this:
@State non-public var scrollPosition = ScrollPosition(idType: Message.ID.self)
non-public func onMessageDidScrollIntoView(_ id: Message.ID) {
let indexOfVisibleMessage = /* ... */
if indexOfVisibleMessage < 10 {
fetchOlderMessages()
// ^ this updates my ViewModel `messages`
}
}
var physique: some View {
ScrollView {
LazyVStack {
ForEach(messages) { message in
MessageCell(message)
}
}.scrollTargetLayout()
}
.defaultScrollAnchor(.backside)
.scrollPosition($scrollPosition)
.onChange(of: scrollPosition) { oldValue, newValue in
guard let visibleMessageId = scrollPosition.viewID(sort: Message.ID.self) else { return }
onMessageDidScrollIntoView(visibleMessageId)
}
}
..so if the consumer scrolls as much as the oldest 10 messages, I begin loading extra and insert them on the high.
The issue with that is that the ScrollView now jumps when new messages are inserted. It’s because the ScrollView maintains it is Y place, however the content material dimension adjustments since we’re including new gadgets “above”.
I attempted to mess around with just a few strategies I discovered on StackOverflow, particularly;
Inverting the ScrollView (.scaleEffect(y: -1) on the ScrollView after which once more on the MessageCell to counter it): This by some means jumped the x place of the ScrollView and utterly breaks .contextMenu.
Taking part in round with .onScrollGeometryChange to replace scrollPosition.scrollTo(y:) when it is contentSize adjustments: This simply did not work and stopped the consumer scroll gesture/interplay.
Setting scrollPosition to the Message.ID I need to preserve secure earlier than doing an replace: This did not do something.
However nothing really labored for the explanations described above.
How do you really construct these UIs in SwiftUI? I believe an inverted ScrollView is sort of a standard UI, and clearly information must be loaded lazily.
I’m making an attempt to study extra about laptop networks by establishing issues in my homelab, which features a pfSense router and a spare laptop computer which has Debian put in on it. I’ve arrange a KVM visitor on the Debian machine. My purpose is to configure issues in order that I can attain the KVM visitor from my LAN, simply as I can attain some other system on the LAN. To attain this, I’m following this information to arrange a bridge on the Debian machine: https://jamielinux.com/docs/libvirt-networking-handbook/bridged-network.html
I’m on the level the place I must put the next config into /and so on/community/interfaces:
# If not sure what 'netmask' or 'gateway' must be, ask your internet hosting supplier.
iface eth0 inet guide
auto br0
iface br0 inet static
# Use the MAC handle recognized above.
hwaddress ether f1:c2:7e:46:c8:9a
handle 192.168.3.246
netmask ?????????????????????????????????????????????
gateway 192.168.3.1
bridge_ports eth0
# If you wish to activate Spanning Tree Protocol, ask your internet hosting
# supplier first as it might battle with their community.
bridge_stp off
# If STP is off, set to 0. If STP is on, set to 2 (or higher).
bridge_fd 0
# Irrelevant, since I haven't got IPv6 configured
#iface br0 inet6 static
# handle 2001:db8::1
# netmask 64
# gateway fe80::1
# autoconf 0
My LAN seems like this:
My concept was to provide the Debian server the static IP 192.168.3.246, as a result of I perceive it needs to be outdoors the handle pool vary, however contained in the LAN (so the values I might select from are 246-254)?.
My query is: what do I put because the netmask? Ought to or not it’s 255.255.255.0 (or alternatively, 24), as a result of that’s the subnet masks of the LAN?
I’ve been making an attempt to know this by studying the manpages for interfaces, however I do not perceive how netmask is used when I’ve a static IP.
By Alastair Collier, Chief R&D Officer with local weather expertise agency A More healthy Earth
Surging greenhouse gasoline emissions brought on by the unreal intelligence (AI) revolution might derail Europe’s local weather ambitions, based on a new report. By 2030, the continent’s rising variety of datacentres might pressure its energy provide and improve its greenhouse gasoline emissions eightfold.
This creates an actual rigidity for hyperscalers, who’re driving the digital and AI growth, to match their development and innovation with local weather ambitions. To maintain decarbonisation on observe, the trade should come collectively to take motion on this shared and pressing problem – decoupling AI development from its emissions.
A holistic method To speed up options on the velocity and scale required, the trade must be working in partnership. This implies hyperscalers collaborating each with their information centre suppliers, and one another.
To drive progress and make the largest influence, such an method needs to be holistic, contemplating three principal priorities for mitigation and adaption: lowering emissions created by digital infrastructure, eradicating laborious to abate emissions from the ambiance, and adapting bodily infrastructure to make sure it may well stand up to the impacts of local weather change.
Scale back
The tech trade, and humanity extra broadly, should reply to rising emissions by drastically slashing the quantity of carbon dioxide our actions launch into the ambiance.
High precedence for should due to this fact be to cut back the general carbon emissions produced by information centres and digital infrastructure, for instance by growing information centre effectivity, and selecting and investing in cleaner, renewable power sources. As hyperscalers embark on this journey, sharing learnings and improvements will assist them not solely tackle their very own provide chains, however stage up the broader trade, which frequently depends on shared infrastructure.
Take away
Current analysis from the College of Oxford discovered that round 7 to 9 billion tonnes of CO2 per 12 months will should be faraway from the ambiance by mid-century, if we’ve to have any likelihood of reaching our local weather objectives.
For emissions heavy industries like tech, that is notably important. Even with important reductions in emissions, the one technique to obtain net-zero is coupling discount with the elimination of carbon dioxide from the ambiance. Hyperscalers are already recognising this want and are driving the carbon dioxide elimination (CDR) market. In actual fact, Microsoft was answerable for a staggering 91% of CDR transactions within the second quarter of 2024.
The provision and implementation of largescale carbon elimination methods is consequently pressing, however traditionally the market has been underregulated and lacked credibility. Within the face of rising AI emissions, hyperscalers should channel their CDR funding into high-integrity, confirmed options that are able to scale now. Promisingly, within the face of this new problem, Microsoft has already shifted focus to make sure it’s investing in “long-term, higher-impact” carbon elimination tasks.
That’s the reason at A More healthy Earth we are actually constructing the UK’s largest biochar manufacturing facility, in Wiltshire, which is able to flip waste biomass into biochar – a charcoal like substance which captures and sequesters carbon. Crucially, it should create high-quality, carbon credit that relate to tangible, real-world carbon elimination at the moment.
Adapt
Local weather change is already right here. With floods, excessive climate occasions and droughts growing in frequency and depth, now we have no alternative however to begin adapting. Digital infrastructure faces a specific problem, most continuously being inbuilt city environments, the place there’s much less nature to behave as pure defences to stave off the worst results of local weather change.
For instance, we’re at present researching how biochar can be utilized in asphalt, for constructing new information centres. Early outcomes recommend that not solely can it scale back the general carbon footprint of buildings, it may well additionally assist higher water drainage. As a porous substance, biochar in asphalt has the potential to facilitate higher water motion and scale back waterlogging, making buildings extra resilient within the face of flooding.
The way in which ahead As AI turns into ubiquitous in all our lives, the expansion in new information centres is driving up each power necessities and greenhouse gasoline emissions. To make sure this doesn’t compromise essential local weather targets – just like the European Union’s ambition to cut back emissions by 55% by 2030 in contrast with 1990 ranges – tech corporations should now work as a collective utilizing this three-pronged method. AI has monumental potential to enhance our trendy lives – however the trade should step as much as the problem and guarantee its development is accountable.
VANCOUVER — The continued tariff drama created by President Donald Trump has turned financial diversification right into a nationwide crucial for America’s northern neighbour.
Luckily, Canada has commerce agreements with 60% of the worldwide economic system, making it effectively positioned to reduce its reliance on U.S. markets. However as Canadian governments and firms look to make strategic and long-term funding choices with these buying and selling companions in thoughts, Canada should precisely assess the place their economies are headed.
Accordingly, a new Clear Power Canada evaluation finds that amongst Canada’s 10 largest non-U.S. commerce companions, all of them have net-zero commitments and carbon pricing methods, and roughly half apply carbon border changes on imports and have home EV necessities reshaping their automotive markets.
Taken collectively, these measures ship a transparent, unmistakable sign. Carbon border changes, for instance, levy a cost based mostly on the carbon depth of a great’s manufacturing and due to this fact incentivize low-carbon merchandise from importing nations like Canada.
In the meantime, the existence of a carbon worth and a requirement for extra EVs signifies that a market is weaning itself off fossil fuels, and thus demand for oil and fuel will see a decline, whereas curiosity in clear vitality imports and low-carbon merchandise will improve.
Various suppose tanks and enterprise teams have analyzed and recognized alternatives in Canada’s clear economic system, together with however not restricted to scrub electrical energy technology and transmission, important minerals, EVs and batteries, low-carbon heavy business, and value-added agricultural and forest merchandise, all of that are explored within the report.
To understand Canada’s potential, federal and provincial governments ought to take quite a lot of necessary steps, together with:
accelerating regulatory and allowing processes for clear development initiatives,
recognizing inexperienced collar employee credentials throughout provinces,
accelerating the build-out of important commerce, vitality, and transportation infrastructure,
prioritizing interprovincial electrical energy grid interties in strategic areas,
supporting demand for clear items that profit Canadian suppliers,
and selling Canadian companies overseas and Canada as a vacation spot for funding below the banner of a “Clear Canada” model.
As The World Subsequent Doorconcludes, seizing the clear financial alternative will not be about beginning over, however about leveraging pre-existing industries and benefits in a means that units Canada up for a sustainable future.
Final Up to date on: sixteenth April 2025, 02:02 am
Together with Waymo’s enlargement into Tokyo, Japan, the corporate is continuous its robotaxi rollout in main US cities. It not too long ago introduced it was coming to Washington, DC, and extra not too long ago (this week), Waymo and Uber began letting residents be a part of an “curiosity listing” to make use of the robotaxi service in Atlanta, Georgia. By the summer time, folks will be capable of begin hailing Waymo robotaxis.
Waymo in Hotlanta
As in Austin, Uber is performing as an unique associate for Waymo in Atlanta. If you’d like a Waymo, you must get on by means of Uber in Hotlanta. I’ve to confess that I discover the partnership a bit of odd. After all, it makes loads of sense that Waymo can discover many extra riders proper now by means of the Uber connection, and Uber will get all the purchasers thinking about using in a robotaxi. Nonetheless, they’ve to separate the money, and in the long run, why would Waymo give away a part of its income to a different firm — particularly on condition that it already has a effectively functioning app it makes use of in different cities? I’ve to suppose that Waymo’s long-term plan is to ditch Uber (or purchase it) and that is only a solution to rapidly achieve market share and acceptance, however inform me if I’m lacking one thing.
Okay, I get it that Uber handles the charging, upkeep, and cleansing, and that Uber’s app is presumably extra subtle than Waymo’s with regard to pricing, however nonetheless….
“In Austin, we’re already seeing optimistic alerts with the overwhelming majority of Uber riders selecting to trip with a Waymo autonomous car when given the chance, and most riders have been score their journey as 5-stars,” Uber wrote alongside this announcement. “With 14 AV companions up to now — and tens of 1000’s of autonomous journeys occurring each month — we’re excited to develop our years-long partnership with Waymo, not too long ago bringing autonomous rides to Austin, and shortly Atlanta, completely by means of the Uber app.”
Initially, Waymo will cowl 65 sq. miles of ATL. Nonetheless, because it has accomplished in different cities, the protection space will develop over time. Charges would be the similar as riders get utilizing UberX, Uber Inexperienced, Uber Consolation, or Uber Consolation Electrical.
Whereas Waymo already operates in San Francisco, Los Angeles, Phoenix, and Austin, it plans to check robotaxi companies in 10 extra US markets this yr.
The Waymo autos on provide in Atlanta will reportedly be all-electric Jaguar I-PACE SUVs. Maybe new Zeekr or Hyundai EVs shall be on the way in which in Hollywood of the South within the subsequent yr or so too, however there’s no phrase on that.
Together with its continued enlargement within the US, Waymo partnered with WeRide in Abu Dhabi, UAE, to begin providing robotaxi rides there in December, and, as famous on the prime, the corporate is inching nearer to a launch in Tokyo, Japan, partnering in that case with the biggest taxi firm within the metropolis.
2025 Waymo Open Dataset Challenges
Together with all the above announcement, Waymo additionally not too long ago launched its 2025 Waymo Open Dataset Challenges. Right here’s extra from the corporate on what that is all about:
“For years, the Waymo Open Dataset and related Challenges have superior analysis in autonomous driving, robotics, laptop imaginative and prescient, and machine studying. […]
“Autonomous autos characterize probably the most mature software of AI within the bodily world. Because the launch of the Waymo Open Dataset in 2019, it has grow to be a key useful resource for over 53,000 researchers in machine studying and robotics world wide. Up to now, greater than 4,000 tutorial papers have been printed both citing the dataset or utilizing it as a benchmark.
“At the moment, we’re excited to kick off the 2025 Waymo Open Dataset Challenges, which can run from March 31 to Could 22, 2025. The 2025 Challenges will concentrate on 4 key areas of analysis:
Imaginative and prescient-based Finish-to-Finish Driving: Use digital camera inputs to foretell optimum driving habits in difficult conditions.
State of affairs Technology: Develop generative fashions so as to add brokers to a scene with a purpose to create life like visitors situations.
Sim Brokers: Generate life like future behaviors for all brokers in a scene utilizing historic trajectory information, with the choice of leveraging our Waymax simulator.
“This yr, we’re notably excited to host the Imaginative and prescient-based Finish-to-Finish Driving Problem for the primary time, providing a novel alternative for members to discover progressive AI methods on this quickly evolving analysis space. It’s vital to notice that, whereas this analysis Problem focuses on a singular sensor modality, Waymo stays dedicated to using a various sensor suite as we firmly imagine it’s important for autonomous driving in real-world circumstances.
“Alongside the Imaginative and prescient-based Finish-to-Finish Driving Problem, we’re increasing the dataset with 5,000 new segments. This digital camera dataset extension is targeted on fostering analysis round long-tail driving situations – a number of the most difficult or uncommon driving conditions that drivers encounter in several environments, comparable to development zones throughout marathons, pedestrians falling off scooters, and sudden obstacles on freeways.
“The remaining Challenges characteristic up to date metrics primarily based on our learnings from previous Challenges. We’re excited to see how the analysis group pushes the boundaries of what’s attainable this yr.”
Thrilling certainly!
Waymo is awarding $72,000 in these challenges. For those who get 1st place in a Problem, you’ll win $10,000. For those who get 2nd place, you’ll win $5,000. And in case you get third place, you’ll win $3,000. True — this isn’t life-changing cash, however it’s higher than $0! You may also be given the chance to current on the Workshop on Autonomous Driving at CVPR in June 2025.
“The Challenges will shut at 11:59 PM Pacific on Could 22, 2025, however leaderboards will stay open for continued analysis contributions. Full competitors guidelines and eligibility standards can be found right here,” Waymo provides. “Good luck to all members, and as all the time, we welcome your suggestions!”
It’s nice to see Waymo not solely increasing its electrical robotaxi companies, but additionally increasing useful use of AI within the bodily world.