Apple to Source all US iPhones from India, Pivots Away from China.
翻译:苹果将所有美国市场的iPhone转由印度生产,逐渐远离中国。
source 名词的意思是:来源,根源,原因,源头,v.(从…)获得;
比如:Television and the internet are the most useful sources of information nowadays. 电视和网络是当今最有用的信息来源。
本句子中,source是动词的属性。
Apple says that it plans to begin sourcing all US iPhones from India, pivoting away from previously sourcing them from China. According to a Financial Times report, the tech giant aims to make the shift as soon as next year.
那么,如何评估模型的推荐质量呢?除了使用标准的质量评估指标外,推荐系统还常用一些特定的评估指标,如:Recall@k(召回率)、Precision@k(准确率)、Average Recall@k(平均召回率) 和 Average Precision@k(平均准确率)。强烈建议查阅推荐系统中关于这些评估指标的详细说明。
PHP is a popular server scripting language known for creating dynamic and interactive web pages. Getting up and running with your language of choice is the first step in learning to program.
This tutorial will guide you through installing PHP 7.4 on Ubuntu and setting up a local programming environment via the command line. You will also install a dependency manager, Composer, and test your installation by running a script.
You will want to avoid relying on the default version of PHP because that default version could change depending on where you are running your code. You may also wish to install a different version to match an application you are using or to upgrade to a newer version, such as PHP 8.
Setting up PHP7.4
Run the following command to update apt-get itself, which ensures that you have access to the latest versions of anything you want to install:
sudo apt update
Next , install the software-properties-common ,which adds management for additional software sources:
ubuntu@channel:~$ php -v
PHP 7.4.3-4ubuntu2.29 (cli) (built: Mar 25 2025 18:57:03) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.3-4ubuntu2.29, Copyright (c), by Zend Technologies
You can also install more than one package at one time.Here are a few suggestions of the most common modules you will most likely want to install .example :
sudo apt install php7.4-zip
or
sudo apt install php7.4-mbstring
if you want to install swoole ,try to install php7.4-dev ,get the pecl tool:
Then you can list all php modules you have installed with command line :
sudo php7.4 -m
You will receive something similar to following:
php7.4 -m ‘s output
Manage package using composer.
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and will manage installing and updating these packages.
Although similar, Composer is not a package manager in the same sense as yum or apt. It deals with “packages” or libraries, but it manages them on a per-project basis, installing them in a directory (e.g. vendor) inside your project. By default, it does not install anything globally. Thus, it is a dependency manager. It does, however, support a global project for convenience via the global command.
This idea is not new, and Composer is strongly inspired by Node’s npm and Ruby’s bundler.
Suppose:
You have a project that depends on several libraries.
Some of those libraries depend on other libraries.
Composer:
Enables you to declare the libraries you depend on.
Finds out which versions of which packages can and need to be installed and installs them by downloading them into your project.
Enables you to update all your dependencies in one command.
Enables you to see the Basic Usage chapter for more details on declaring dependencies.
There are, in short, two ways to install Composer: locally as part of your project or globally as a system-wide executable. Either way, you will start with the local install.
To quickly install Composer in the current directory, run this script in your terminal:
Most likely, you want to put the composer.phar into a directory on your PATH, so you can simply call composer from any directory (Global install), using for example:
sudo mv composer.phar /usr/local/bin/composer
Now to run Composer , use composer instead of php composer.phar . To check for your Composer Version :
composer -V
or
composer --version
Test PHP7.4 environment.
To test that your system is configured correctly for PHP, you can create and run a basic PHP script. Call this script p.php:
vim p.php
This will open a new blank file.
Press the i key , then put the following text , which is valid PHP code,inside the file :
<?php
echo 'Hello World!';
?>
Once you’ve added the text, save and close the file. You can do this by pressing the ESC key and pressing the : key. Then input the wq .
Now you can test to make sure that PHP processes your script correctly. Type php to tell PHP to process the file, followed by the name of the file:
php7.4 p.php
If the PHP is processed properly , you will see only the characters with the quotes:
Hello World!
PHP has successfully processed the script, meaning that your PHP environment is successfully installed and you’re ready to continue your programming journey.
Illustration of a SyntaxError in Python programming.
ImportError: No module named setuptools
This error occurs when Python can’t find the setuptools module, which is a package commonly used for installing and managing Python packages. Here’s how you can fix it:
Install setuptools using pip: Run this command in your terminal or command prompt:pip install setuptools
If pip isn’t working:
Make sure you have pip installed. You can check by running:pip --version
Ensure you’re using the correct Python version where pip is installed. Try:python -m ensurepip --upgrade python -m pip install --upgrade pip setuptools
If you’re using a virtual environment, activate it first before running the commands.
Common issues:
If you get a “permission denied” error, try with sudo (Linux/Mac) or run the command prompt as administrator (Windows):sudo pip install setuptools
If you’re using Python 3, you might need:pip3 install setuptools
Just off a narrow highway in rural Malaysia, a vast cluster of buildings flanked by rows of solar panels towers above the surrounding palm plantations.
off: If something is situated off a place such as a coast, room, or road, it is near to it or next to it, but not exactly in it.离(某地)不远;在…附近;挨着
example:The boat was anchored off the northern coast of the peninsula.
这艘船停泊在离半岛北部海岸不远的地方。
2. “A vast cluster of buildings”
“Vast cluster” 指的是一大片建筑群,强调了建筑群的规模和密集度。
“Buildings flanked by rows of solar panels” 表示建筑群的两侧有一排排太阳能板,即太阳能板排列在建筑的两旁,通常目的是为了提供能源或符合绿色环保标准。
3. “Towers above the surrounding palm plantations”
By the end of 2025, global demand for computing power will have soared to 10 times the level seen in 2023, with more than 40 per cent coming from Asia-Pacific, research firm IDC predicts.
1. “By the end of 2025”
“By the end of” 表示在某个时间点之前,这里指的是2025年年底之前,暗示这是一个未来的预期时间节点。
3. “Will have soared to 10 times the level seen in 2023”
“Soared” 表示需求将急剧增加,表示这不是简单的增长,而是爆发性增长。
“10 times the level seen in 2023” 表示到2025年,计算能力的需求将是2023年水平的10倍,这一增长预示着技术发展和数字化转型的强劲势头。
4. “With more than 40 per cent coming from Asia-Pacific”
“More than 40 per cent” 表示超过40%的需求将来自亚太地区,这一地区作为全球数字经济和技术创新的重心之一,正迅速成为计算能力需求的主要来源。
5. “Research firm IDC predicts”
IDC(国际数据公司)是一家知名的市场研究公司,专注于技术、IT和数字市场的分析。这里说明这些预测来自该公司的研究报告。 International Data Corporation – 国际数据公司,是美国一间从事市场研究、分析和咨询的公司,专注于信息技术、电信和消费科技。 IDC是国际数据集团的全资子公司,其总部设于马萨诸塞州Framingham,并在全球110个国家拥有超过1100名分析师。
“Chinese companies are the primary clients of data centres in Malaysia and other Southeast Asian areas,” said Joe Gao, a board member of IBuffett Investment Management, an investment firm specialising in Chinese AI businesses targeting the Southeast Asian market.
1. “Chinese companies are the primary clients of data centres in Malaysia and other Southeast Asian areas”
### 英文原文:
Despite that, and issues surrounding Zegler and costar Gal Gadot’s views on the Israel-Gaza war, the film arrived this weekend whistling a tune that was happier than many anticipated. Although the film underperformed for a Disney movie, it still managed to pull in $43 million, making it the second-highest opening of the year so far. Like many blockbusters, the biggest problem with Snow White is that its budget was ridiculously high, meaning that only a huge box office result would see it called anything other than a failure.
原文:Despite that, and issues surrounding Zegler and costar Gal Gadot’s views on the Israel-Gaza war, the film arrived this weekend whistling a tune that was happier than many anticipated.
拆解:
Despite that(尽管如此):表示转折,直接放在句首。
and issues surrounding Zegler and costar Gal Gadot’s views on the Israel-Gaza war(以及围绕泽格勒和同台演员盖尔·加朵对以色列-加沙战争观点的争议):这是一个并列的补充信息,用“以及”连接。
the film arrived this weekend whistling a tune that was happier than many anticipated(这部电影在本周末上映时,吹响了一首比许多人预期更欢快的曲调):主句部分,包含一个比喻“whistling a tune”(吹着曲调),表示影片带来的氛围。
翻译要点:
中文不喜欢过长的主语或插入语,所以把“围绕……的争议”作为并列部分放在前面。
“whistling a tune”是个形象化表达,直译“吹着曲调”保留了比喻,同时让中文读者能理解其“轻松愉快”的含义。
“than many anticipated”翻译为“比许多人预期”,简洁明了。
第二句:
原文:Although the film underperformed for a Disney movie, it still managed to pull in $43 million, making it the second-highest opening of the year so far.
拆解:
Although the film underperformed for a Disney movie(虽然这部电影作为迪士尼影片表现不佳):让步状语从句。
it still managed to pull in $43 million(但它仍然设法赚了4300万美元):主句,表示转折后的结果。
*managed to ** 达成,设法
making it the second-highest opening of the year so far(使其成为今年迄今为止开局票房第二高的电影):结果状语,用分词形式补充说明。
翻译要点:
“underperformed for a Disney movie”翻译时要体现“迪士尼电影”的高期待值,所以用“作为迪士尼影片表现不佳”。
“pull in $43 million”是个口语化表达,意为“赚了4300万美元”,翻译时保留了具体金额。
“second-highest opening”翻译为“开局第二高的成绩”,符合电影行业的术语。
第三句:
原文:Like many blockbusters, the biggest problem with Snow White is that its budget was ridiculously high, meaning that only a huge box office result would see it called anything other than a failure.
拆解:
Like many blockbusters(像许多大片一样):比较状语,放在句首。
the biggest problem with Snow White is that its budget was ridiculously high(《白雪公主》最大的问题是其预算高得离谱):主句+表语从句。
meaning that only a huge box office result would see it called anything other than a failure(这意味着只有巨大的票房成绩才能让它不被视为失败):分词短语进一步解释。
翻译要点:
“blockbusters”翻译为“大片”,这是电影行业的常用词。
“ridiculously high”用“高得离谱”表达,既保留了夸张语气,又符合中文习惯。
“would see it called anything other than a failure”翻译时调整为“才能让它不被视为失败”,更符合中文的逻辑顺序。
全局 Command + Shift + P / F1 显示命令面板 Command + P 快速打开 Command + Shift + N 打开新窗口 Command + W 关闭窗口
基本 Command + X 剪切(未选中文本的情况下,剪切光标所在行) Command + C 复制(未选中文本的情况下,复制光标所在行) Option + Up 向上移动行 Option + Down 向下移动行 Option + Shift + Up 向上复制行 Option + Shift + Down 向下复制行 Command + Shift + K 删除行 Command + Enter 下一行插入 Command + Shift + Enter 上一行插入 Command + Shift + 跳转到匹配的括号 Command + [ 减少缩进 Command + ] 增加缩进 Home 跳转至行首 End 跳转到行尾 Command + Up 跳转至文件开头 Command + Down 跳转至文件结尾 Ctrl + PgUp 按行向上滚动 Ctrl + PgDown 按行向下滚动 Command + PgUp 按屏向上滚动 Command + PgDown 按屏向下滚动 Command + Shift + [ 折叠代码块 Command + Shift + ] 展开代码块 Command + K Command + [ 折叠全部子代码块 Command + K Command + ] 展开全部子代码块 Command + K Command + 0 折叠全部代码块 Command + K Command + J 展开全部代码块 Command + K Command + C 添加行注释 Command + K Command + U 移除行注释 Command + / 添加、移除行注释 Option + Shift + A 添加、移除块注释 Option + Z 自动换行、取消自动换行
多光标与选择 Option + 点击 插入多个光标 Command + Option + Up 向上插入光标 Command + Option + Down 向下插入光标 Command + U 撤销上一个光标操作 Option + Shift + I 在所选行的行尾插入光标 Command + I 选中当前行 Command + Shift + L 选中所有与当前选中内容相同部分 Command + F2 选中所有与当前选中单词相同的单词 Command + Ctrl + Shift + Left 折叠选中 Command + Ctrl + Shift + Right 展开选中 Alt + Shift + 拖动鼠标 选中代码块 Command + Shift + Option + Up 列选择 向上 Command + Shift + Option + Down 列选择 向下 Command + Shift + Option + Left 列选择 向左 Command + Shift + Option + Right 列选择 向右 Command + Shift + Option + PgUp 列选择 向上翻页 Command + Shift + Option + PgDown 列选择 向下翻页
查找替换 Command + F 查找 Command + Option + F 替换 Command + G 查找下一个 Command + Shift + G 查找上一个 Option + Enter 选中所有匹配项 Command + D 向下选中相同内容 Command + K Command + D 移除前一个向下选中相同内容
进阶 Ctrl + Space 打开建议 Command + Shift + Space 参数提示 Tab Emmet插件缩写补全 Option + Shift + F 格式化 Command + K Command + F 格式化选中内容 F12 跳转到声明位置 Option + F12 查看具体声明内容 Command + K F12 分屏查看具体声明内容 Command + . 快速修复 Shift + F12 显示引用 F2 重命名符号 Command + Shift + . 替换为上一个值 Command + Shift + , 替换为下一个值 Command + K Command + X 删除行尾多余空格 Command + K M 更改文件语言
导航 Command + T 显示所有符号 Ctrl + G 跳转至某行 Command + P 跳转到某个文件 Command + Shift + O 跳转到某个符号 Command + Shift + M 打开问题面板 F8 下一个错误或警告位置 Shift + F8 上一个错误或警告位置 Ctrl + Shift + Tab 编辑器历史记录 Ctrl + – 后退 Ctrl + Shift + – 前进 Ctrl + Shift + M Tab 切换焦点
编辑器管理 Command + W 关闭编辑器 Command + K F 关闭文件夹 Command + 编辑器分屏 Command + 1 切换到第一分组 Command + 2 切换到第二分组 Command + 3 切换到第三分组 Command + K Command + Left 切换到上一分组 Command + K Command + Right 切换到下一分组 Command + K Command + Shift + Left 左移编辑器 Command + K Command + Shift + Right 右移编辑器 Command + K Left 激活左侧编辑组 Command + K Right 激活右侧编辑组
文件管理 Command + N 新建文件 Command + O 打开文件 Command + S 保存文件 Command + Shift + S 另存为 Command + Option + S 全部保存 Command + W 关闭 Command + K Command + W 全部关闭 Command + Shift + T 重新打开被关闭的编辑器 Command + K Enter 保持打开 Ctrl + Tab 打开下一个 Ctrl + Shift + Tab 打开上一个 Command + K P 复制当前文件路径 Command + K R 在资源管理器中查看当前文件 Command + K O 新窗口打开当前文件
显示 Command + Ctrl + F 全屏、退出全屏 Command + Option + 1 切换编辑器分屏方式(横、竖) Command + + 放大 Command + – 缩小 Command + B 显示、隐藏侧边栏 Command + Shift + E 显示资源管理器 或 切换焦点 Command + Shift + F 显示搜索框 Ctrl + Shift + G 显示Git面板 Command + Shift + D 显示调试面板 Command + Shift + X 显示插件面板 Command + Shift + H 全局搜索替换 Command + Shift + J 显示、隐藏高级搜索 Command + Shift + C 打开新终端 Command + Shift + U 显示输出面板 Command + Shift + V Markdown预览窗口 Command + K V 分屏显示 Markdown预览窗口
A gorountine is a lightweight thread of execution .
package main
import (
"fmt"
"sync"
"time"
)
func f(from string) {
for i :=0; i <4; i++ {
fmt.Println(from, ",from:", i)
}
}
func main() {
f("direct")
gof("goroutines")
gofunc(msgstring) {
fmt.Println(time.Now().Format("2006-01-02 15:04:05"), msg)
}("going--going--going")
time.Sleep(time.Second)
fmt.Println("done...")
//waitGroup.
var wg sync.WaitGroup
wg.Add(1)
gofunc() {
defer wg.Done()
fmt.Println("I'm a GoRoutines.....")
}()
wg.Wait()
fmt.Println("main func end....")
return
}
Suppose we have a function call f(s). Here’s how we’d call that in the usual way ,running it synchronously.
To invoke this function in a goroutine, use go f(s). This new goroutine will execute concurrently with the calling one.
You can also start a goroutine for an anonymous function call .
Our two function calls are running asynchronously in separate goroutines now . Wait for them to finish (for a more robust approach , use a WaitGroup).
When we run this program , we see the output of the blocking call first , then the output of the two goroutines. The goroutings’ output may be interleaved , because goroutines are being run concurrently by the Go runtime.