Blog

  • The Hormuz War Will End

    The Hormuz War Will End

    Whatever the outcome of the war with Iran, it has already delivered a lesson the world cannot afford to ignore. A single regime has decided to exert control over a 21-mile passage, and as a result, we are living through the worst energy crisis the world has ever seen.

    The near-closure of the Strait of Hormuz has removed 9 million to 10 million barrels of crude oil from global markets each day, but that is only the beginning of the economic damage. The present crisis is worse than the Arab oil embargo of 1973, and broader than the Russian gas cutoff that followed the 2022 invasion of Ukraine. Roughly 20 percent of the world’s daily supply of liquefied natural gas is gone. Five million barrels a day of refined products—the diesel that moves goods, the jet fuel that keeps aircraft flying—are missing. So are the fertilizers on which farmers rely to feed billions, the helium used to manufacture semiconductors and run hospital MRI machines, and the petrochemical feedstocks that underpin modern manufacturing.

  • Did Trump Just Threaten to Use Nuclear Weapons in Iran?

    Did Trump Just Threaten to Use Nuclear Weapons in Iran?

    The president of the United States is losing his head, and that means the rest of us must keep ours. At 8:06 a.m. eastern daylight time, Donald Trump posted this on his Truth Social site:

    A whole civilization will die tonight, never to be brought back again. I don’t want that to happen, but it probably will. However, now that we have Complete and Total Regime Change, where different, smarter, and less radicalized minds prevail, maybe something revolutionarily wonderful can happen, WHO KNOWS? We will find out tonight, one of the most important moments in the long and complex history of the World. 47 years of extortion, corruption, and death, will finally end. God Bless the Great People of Iran!

    The world, unfortunately, has gotten used to Trump’s overheated rhetoric, and to dismissing the commander in chief as something of a crank who (as the French president recently advised) should perhaps keep more of his thoughts

    The president of the United States is losing his head, and that means the rest of us must keep ours. At 8:06 a.m. eastern daylight time, Donald Trump posted this on his Truth Social site:

    A whole civilization will die tonight, never to be brought back again. I don’t want that to happen, but it probably will. However, now that we have Complete and Total Regime Change, where different, smarter, and less radicalized minds prevail, maybe something revolutionarily wonderful can happen, WHO KNOWS? We will find out tonight, one of the most important moments in the long and complex history of the World. 47 years of extortion, corruption, and death, will finally end. God Bless the Great People of Iran!

    The world, unfortunately, has gotten used to Trump’s overheated rhetoric, and to dismissing the commander in chief as something of a crank who (as the French president recently advised) should perhaps keep more of his thoughts

    The president of the United States is losing his head, and that means the rest of us must keep ours. At 8:06 a.m. eastern daylight time, Donald Trump posted this on his Truth Social site:

    A whole civilization will die tonight, never to be brought back again. I don’t want that to happen, but it probably will. However, now that we have Complete and Total Regime Change, where different, smarter, and less radicalized minds prevail, maybe something revolutionarily wonderful can happen, WHO KNOWS? We will find out tonight, one of the most important moments in the long and complex history of the World. 47 years of extortion, corruption, and death, will finally end. God Bless the Great People of Iran!

    The world, unfortunately, has gotten used to Trump’s overheated rhetoric, and to dismissing the commander in chief as something of a crank who (as the French president recently advised) should perhaps keep more of his thoughts

  • Modernizing the Web Playback UI

    Modernizing the Web Playback UI

    built-in React performance tools were used to profile component render timing. We took several steps to improve render times:

    • React Best Practices: We ensured that the UI components were implementing best practices when using React, i.e. using the shouldComponentUpdate lifecycle where necessary.
    • Less HOCs: Where possible, we migrated away from using higher order components, by transitioning to using utility functions, or moving logic into a parent component
    • No Prop Spreads, and Collapsing Props: Spreading props causes time to be spent iterating through objects. Collapsing multiple props into a single object where possible helps reduce comparison time in the shouldComponentUpdate lifecycle.
    • Observability: Taking a page out of our custom framework’s playbook, we introduced observability of video player state into components that need to be re-rendered most often. This helped reduce render cycles at our root component.

    With the visual design and performance changes made, a new AB test was launched. After patiently waiting, the results were in, another drumroll please… members streamed the same amount with the React playback UI compared to the custom framework! In the Summer of 2017, we rolled out using React in playback for all members .

    Under the Hood: Simplifying Playback Logic

    In addition to using React to make the UI component layer more accessible and easier to develop across multiple teams, we wanted to do the same for the player-related business logic. We have multiple teams working on different kinds of playback logic at the same time, such as: interactive titles (where the user makes choices to participate in the story), movie and episode playback, video previews in the browse experience, and unique content during Post Play

    We chose to use Redux in order to single-source and encapsulate the complex playback business logic. Redux is a well-known library/pattern in web UI engineering, and it facilitates separation of concerns in ways that met our goals. By combining Redux with data normalization, we enabled parallel development across teams in addition to providing standardized, predictable ways of expressing complex business logic.

    Separating Video Lifecycle From UI Lifecycle

    Allowing the UI component tree to control the logic concerning the lifecycle of the actual video can result in a slow user experience. UI component trees usually have their lifecycle represented in a standardized set of methods, such as React’s componentDidMountcomponentDidUpdate, etc. When the logic for creating a new video playback is hidden in a UI lifecycle method that is deep inside of a component tree, the user must wait until that specific component is called before the playback can even be initiated. After being initiated, the user must wait until the playback is sufficiently loaded in order to begin viewing the video.

    When the UI is rendered on the server, the initial DOM is shipped to the client. This DOM doesn’t include a loaded video or any buffered data needed to start playback. In the case of React, the client UI needs to rebuild itself on top of this initial DOM, and then go through a lifecycle sequence to begin loading the video.

    However, if the logic for managing the video playback exists outside of the UI component tree, it can be executed from anywhere inside of the application, such as before the UI tree is rendered during the initial application loading sequence. By kicking off the creation of a video in parallel with rendering the UI, it gives the application more time to create, initialize, and buffer video playback so that when the UI has finished rendering, the user can start playing the video sooner.

    Standardizing the Data Representation of a Video Playback

    Since video playback is composed of a series of dynamic events, it can pose a problem when there are different parts of an application that care about the state of a video playback. For example, one part of an application may be responsible for creating a video, another part responsible for configuring it based on user preferences, and yet another responsible for managing the real time control of playing, pausing, and seeking.

    In order to encapsulate knowledge of a video playback, we created a standardized data structure to represent it. We were then able to create a single, central location to store the data structure for each video playback so that both the business logic and the UI could access them. This enabled intelligent rules governing video playbacks, multiple UIs that operate on a single set of data, and easier testing.

    The standardized playback data structure can be created from any source of video: a custom video library, or a standard HTML video element. Using the normalized data frees the UI from having to know about the specific video implementation.

    Adding Support for Multiple Video Playbacks

    When we have the playback data for every existing video single-sourced in the application independent of the UI, it allows the application to define business logic rules that coordinate single, or multiple video playbacks. If each video was hidden inside a particular instance of a UI component, and the components existed across completely different areas of the UI, it would be difficult to coordinate and would force the UI components to have knowledge of each other when they probably shouldn’t.

    Some areas of logic that become easier with the UI-independent playback data and multiple players are:

    • Volume & mute control.
    • Play & pause control.
    • Playback precedence for autoplay.
    • Constraints on the number of players allowed to coexist.

    An Implementation of Application State

    In order to provide a well-structured location for the UI-independent state, we decided to leverage Redux again. However, we also knew that we would need to allow multiple teams to work in the codebase as they added and removed logic that would be independent and not required by all use cases. As a result, we created an extremely thin layer on top of core Redux that allowed us to package up files related to specific domains of logic, and then compose Redux applications out of those domains.

    A domain in our system is simply a static object that contains the following things:

    • State data structure.
    • State reducer.
    • Actions.
    • Middleware.
    • Custom API to query state.

    An application can choose to compose itself out of domains, or not use them at all. When a domain is used to create an application, the individual parts of the domain are automatically bound to its own domain state; it won’t have access to any other part of the application state outside of what it defined. The good thing is that the final external API of the application is the same whether it uses domains or not, thanks to the power of composition.

    We empower two use cases: a single-level standard Redux application where each part knows about the entire state, or an application where each domain is enforced to only manage its own piece of the application’s substate. The benefit of identifying areas of logic that can be encapsulated into a logical domain is that the domain can easily be added, removed, or ported to any other application without breaking anything else.

    Enabling Plug & Play Logic

    By leveraging our concept of domains, we were able to continue working on core playback UI features while other teams implemented custom logical domains to plug into our player application, such as logic for interactive titles. Interactive titles have custom playback logic, as well as custom UIs to enable the user to make story choices during playback. Now that we had both well-encapsulated UI (via React) and state with associated logic (via Redux and our domains), we had a system to manage complexity on multiple fronts. Since we continuously AB test a lot of features, the consistent encapsulation of logic makes it much easier to add and remove logic based on AB test data or feature flags. Having an enforced and consistent structure by thinking in terms of logic domains also helped us identify and formalize areas of our application that were previously inconsistent. By adding structure and predictability and giving up the absolute freedom to do anything in any way, it actually freed us and other teams to add more features, perform more testing, and create higher-quality code.

    A New Coat of Paint with A Better Engine

    With new and improved state management and development patterns for fellow engineers to use, our final step in the modernization journey was to update the visual design of the UI.

    From our previous learning about change isolation, the plan was to create an AB test that only focused on updating the UI in the video playback experience, and not modifying any other canvases of playback, or the architecture.

    By utilizing our implementation of Redux and extending existing React components, it was easier than ever to turn our design prototypes into production code for the AB test. We rolled out the test in the Summer of 2018. We got back the results in the Fall, and found that members preferred the modern visual design along with new video player controls that allowed them to seek back and forth, or pause the video by simply clicking on the screen.

    This final AB test in the modernization journey was easy to implement and analyze. By making mistakes and learning from them, we built intuition and best practices around ensuring you are not trying to do too many things at once.

  • he Abu Dhabi campus of New York University has closed 

    he Abu Dhabi campus of New York University has closed 

    President Trump on Monday renewed his threat to begin “completely obliterating” Iranian power plants and oil production facilities if the country’s leaders did not agree to reopen the Strait of Hormuz “immediately.”

    Mr. Trump has sought to pressure Iran to yield to his demands and end its chokehold over the strait, a vital shipping route for oil and natural gas, by alternating threats of destruction with unverified claims of diplomatic breakthroughs. Iran has denied holding substantive talks with the United States and has rejected the Trump administration’s conditions as unreasonable.

    The mixed messages led to another nervous day for energy and stock markets: The price of Brent crude, the global benchmark for oil, briefly rose to $116 a barrel on Monday before falling back to around $114 a barrel, and the S&P 500 closed down about 0.4 percent.

    Here’s what else happened in the war:

    Iran: The foreign ministry spokesman, Esmail Baghaei, said that Iran had received proposals for talks with the United States through intermediaries, including Pakistan, but maintained that Iran had held no negotiations — and would not do so while the military campaign continues. The war has fractured the Iranian government, complicating its ability to make decisions, according to officials familiar with U.S. and Western intelligence assessments. Still, a parliamentary committee backed a proposal to impose tolls on ships crossing the Strait of Hormuz, which is treated under maritime law as an international waterway where ships are guaranteed passage.

    Lebanon: The Israeli military said it had destroyed more than 100 high-rise buildings in the area of the capital, Beirut, used by the Iran-backed Lebanese militant group Hezbollah. Two U.N. peacekeepers were killed when their convoy was “struck by an explosion of undetermined origin” in southern Lebanon. An Israeli strike on a Lebanese army checkpoint in the country’s south killed one soldier and injured several others, the Lebanese military said in a statement. More than 1,200 people in Lebanon have been killed in the nearly monthlong conflict, and more than a million others have been displaced, according to Lebanese authorities.

    Persian Gulf: The Abu Dhabi campus of New York University has closed until further notice after Iran warned on Saturday that American universities with outposts in the Gulf were “legitimate targets” in retaliation for strikes on Iranian universities during the war.

    Israel: An oil refinery in the northern city of Haifa was struck during an Iranian missile attack on Monday morning, according to Israel’s fire and rescue service, and falling shrapnel hit a large fuel container fuel, igniting a fire. There were no reports of casualties.

    Turkey: NATO air defenses shot down a ballistic missile fired from Iran that had entered Turkish airspace, Turkey’s defense ministry said in a social media post. It was the fourth time that the military alliance, of which Turkey is a member, has reported intercepting an Iranian missile in or near Turkey’s skies since the start of the war in Iran.

    United States: Karoline Leavitt, the White House press secretary, said the president “would be quite interested in calling” on Arab countries to help pay for the costs associated with the Iran war. “Certainly it’s an idea that I know that he has and something that I think you’ll hear more from him on,” she said.

  • The Dubai authorities responded to an episode involving

    The Dubai authorities responded to an episode involving

    A Kuwaiti crude carrier was “directly attacked” by Iranian forces while anchored at the Dubai port in the United Arab Emirates, Kuwait’s state news agency said Tuesday morning, citing the Kuwait Petroleum Corporation.

    The Dubai authorities responded to an episode involving a drone and a Kuwaiti oil tanker that caught fire in Emirati waters, the government’s media office said. No injuries were reported among the tanker’s 24 crew members, whose safety had been secured, the media office said. Maritime firefighting teams had been working to bring the fire under control and later said it had been extinguished.

    The Kuwaiti Petroleum Corporation said in a statement that the tanker, called Al-Salmi, was fully laden when struck in what it said had been an Iranian attack. The vessel’s hull sustained damage, the company said, adding that the fire and damage had the potential to cause an oil spill in surrounding waters. Measures were being taken to put out the fire and mitigate any potential environmental damage, it said.

    The maritime intelligence company Tanker Trackers said that, according to its tracking information, two million barrels of crude were on board the vessel — about 1.2 million from Saudi Arabia and about 800,000 from Kuwait. The tanker “was done loading a month ago,” the tanker tracking company said of the vessel on social media.

    The Al-Salmi is a massive vessel that is nearly 1,100 feet long and was built in 2011 by Daewoo Shipbuilding and Marine Engineering in South Korea.

    Iran did not immediately respond to reports of the attack.

    The Kuwaiti military said it was dealing with hostile missile and drone attacks even as news of the tanker attack in Emirati waters was emerging.

    On Friday, an Iranian strike injured 12 U.S. troops in Saudi Arabia, two of them seriously, in an attack on Prince ​Sultan Air Base in Saudi ​Arabia. And on Saturday, multiple drones struck the Kuwait International Airport, causing significant damage to its radar system, the country’s aviation authorities said. There were no reported casualties. Those strikes were part of a series of attacks recently against Israel and Gulf countries in the past several days that showed Iran retains enough missiles and drones to destabilize the region and inflict a punishing cost on its foes.

    The attack on the Kuwaiti tanker comes as traffic in and around the Strait of Hormuz has come to a practical standstill amid Iranian retaliatory attacks on commercial vessels in regional waters. In March so far, fewer than 150 tankers have traversed the strait amid the attacks, according to data from S&P Market Intelligence. Normally, about 140 ships travel through the vital waterway every day, according to the United Kingdom Maritime Trade Operations, which tracks security at sea.

    Before Tuesday’s attack, the U.K.M.T.O. said in a report on Monday that it had received 24 reports of suspicious incidents affecting vessels operating in and around the Persian Gulf, the Strait of Hormuz and the Gulf of Oman since Feb. 28 when the United States and Israel began attacking Iran.

  • Anthropic Is at War With Itself

    Anthropic Is at War With Itself

    These are not the words you want to hear when it comes to human extinction, but I was hearing them: “Things are moving uncomfortably fast.” I was sitting in a conference room with Sam Bowman, a safety researcher at Anthropic. Worth $183 billion at the latest estimate, the AI firm has every incentive to speed things up, ship more products, and develop more advanced chatbots to stay competitive with the likes of OpenAI, Google, and the industry’s other giants. But Anthropic is at odds with itself—thinking deeply, even anxiously, about seemingly every decision.

  • Hello world!

    Welcome to WordPress. This is your first post. Edit or delete it, then start writing!