我正在尝试xdebug在 Ubuntu上安装:
sudo apt-get install php-xdebug
Run Code Online (Sandbox Code Playgroud)
并收到以下错误:
需要获得 806 kB 的档案。此操作后,将使用 4.423 kB 的额外磁盘空间。Err:1 http://ppa.launchpad.net/ondrej/php/ubuntu artful/main amd64 php-xdebug amd64 2.5.5-3+ubuntu17.10.1+deb.sury.org+1 404 Not Found E: Failed to获取 http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/x/xdebug/php-xdebug_2.5.5-3+ubuntu17.10.1+deb.sury.org+1_amd64.deb 404 未找到 E : 无法获取一些档案,也许运行 apt-get update 或尝试使用 --fix-missing?
我怎么解决这个问题 ?
该程序的目标是掷两个骰子,直到它们都等于 6。当我在 while 语句中使用 && 时,它在一个骰子等于 6 后停止。这是为什么呢?不应该&& 测试第一个条件,然后测试第二个条件是否正确?
while ((diceOne != 6) || (diceTwo != 6)) {
diceOne = numberGeneration.Next(1, 7);
diceTwo = numberGeneration.Next(1, 7);
attempt = ++attempt;
Console.WriteLine("Your first dice is: " + diceOne + " your second dice is: " + diceTwo);
Console.WriteLine("Press any button to continue");
Console.ReadKey();
}
Console.WriteLine("It took you " + attempt);
Console.WriteLine("Press any key to continue");
Console.ReadKey();
Run Code Online (Sandbox Code Playgroud) 我安装nodejs了:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Run Code Online (Sandbox Code Playgroud)
安装完成,当我尝试安装npm时
sudo apt-get install npm
Run Code Online (Sandbox Code Playgroud)
我收到这个输出:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the …Run Code Online (Sandbox Code Playgroud) 我正在使用 TransferManager 将文件上传到我的s3 存储桶。虽然文档说尽可能重用一个实例,但它也说一旦传输完成就应该调用关闭。
文档的相关部分:
TransferManager 负责管理连接、线程等资源;尽可能共享 TransferManager 的单个实例。TransferManager 与适用于 Java 的 AWS 开发工具包中的所有客户端类一样,是线程安全的。传输完成后调用 TransferManager.shutdownNow() 释放资源。
这是从字面上理解的,还是我们可以重用对象并在应用程序关闭时调用关闭?
一点背景知识:我们之前使用相同的 s3 客户端为每次上传创建一个 TransactionManager,但我们开始AbortedException在某些上传时遇到问题。
在 ubuntu 20.04 上成功 安装 python2 后: sudo apt install python2
我从https://bootstrap.pypa.io/get-pip.py sha256下载了get-pip.py:ffb67da2e976f48dd29714fc64812d1ac419eb7d48079737166dd95640d1debd
跑步:
sudo python2 get-pip.py
Run Code Online (Sandbox Code Playgroud)
回溯(最近一次调用):
文件“get-pip.py”,第 24226 行,在
main()
文件“get-pip.py”,第 199 行,在主
引导程序(tmpdir=tmpdir)
文件“ get-pip.py” py”,第 82 行,
从 pip._internal.cli.main引导导入 main as pip_entry_point
文件“/tmp/tmp6DHWFv/pip.zip/pip/_internal/cli/main.py”,第 60 行
sys.stderr.write( f"ERROR: {exc}")
^
SyntaxError: 无效语法
我正在为我的 PHP 网站创建路由器并遇到了这样的方法:
public function getURI() {
if (!empty($_SERVER["REQUEST_URI"])) {
// do some stuff and return the result
}
}
Run Code Online (Sandbox Code Playgroud)
我发现即使我请求'example.com'-$_SERVER["REQUEST_URI"]不是空的(它是'/')
问题是:
为什么我需要检查是否$_SERVER["REQUEST_URI"]为空?
什么时候REQUEST_URI可以空?
我有一个自定义列表视图,我想从整个列表视图制作pdf。我引用了许多文章,并在下面的代码中实现了将我的listview转换为pdf的代码。但是问题是它不包含整个listview项目。pdf中仅提供前几项。
我将listview转换为pdf的功能是
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String state = Environment.getExternalStorageState();
if (!Environment.MEDIA_MOUNTED.equals(state)) {
}
File pdfDir = new File(Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_DOCUMENTS), "MyProject");
if (!pdfDir.exists()){
pdfDir.mkdir();
}
Bitmap screen = getWholeListViewItemsToBitmap();
File pdfFile = new File(pdfDir, "myPdfFile_new.pdf");
try {
Document document = new Document();
PdfWriter.getInstance(document, new FileOutputStream(pdfFile));
document.open();
ByteArrayOutputStream stream = new ByteArrayOutputStream();
screen.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
addImage(document,byteArray);
document.close();
}
catch (Exception e){
e.printStackTrace();
}
} …Run Code Online (Sandbox Code Playgroud) 我想从SQL翻译
select * from table where table.field in('A','B')
Run Code Online (Sandbox Code Playgroud)
到Acumatica BQL.
请帮助我获取此信息.
我有在Kotlin Advertiser扩展的课程SugarRecord:
class Advertiser : SugarRecord<Advertiser> {
var number: String? = null
var name: String? = null
constructor() {}
constructor(number: String, name: String) {
this.number = number
this.name = name
}
}
Run Code Online (Sandbox Code Playgroud)
当我尝试通过Java查找记录时,它运行良好:
Advertiser advertiser = Advertiser.find(Advertiser.class, "number = ?", "123123").get(0);
Run Code Online (Sandbox Code Playgroud)
但是当我将此代码转换为Kotlin时,我遇到了问题:
如何在Kotlin中进行查找?
我有以下代码:
decimal? Price = 36;
decimal? ExchangeRate = 4.4m;
decimal result = Price ?? 0 / ((ExchangeRate == 0) ? 1 : (ExchangeRate ?? 1));
Console.WriteLine(result);
//result = 36
decimal cleanExchangeRate = ((ExchangeRate == 0) ? 1 : (ExchangeRate ?? 1));
decimal cleanPrice = Price ?? 0;
decimal result2 = cleanPrice / cleanExchangeRate;
Console.WriteLine(result2);
//result2 = 8.18
Run Code Online (Sandbox Code Playgroud)
第一次和第二次计算有什么区别?如果我把它作为单线来做,它不知何故不会划分价格。
我有一个这个JavaScript函数:
function notificationDivPressed(element,userId,numberOfUsers) {
$.ajax({
url: '/Notification/ChangeReadStatus',
type: "POST", cache: false,
data: { arg: userId },
success: function (data) {
//some code
}
});
Run Code Online (Sandbox Code Playgroud)
这是来自Controller的ChangeReadStatus()函数:
[HttpPost]
public void ChangeReadStatus(string id)
{
//some code
}
Run Code Online (Sandbox Code Playgroud)
为什么ChangeReadStatus中的'id'值等于'null'?
我有一张图片"felix.png"(280x280).
我正在将此图像转换为数字矩阵:
from PIL import Image
from numpy import array
img = Image.open('felix.png')
arr = array(img)
Run Code Online (Sandbox Code Playgroud)
这个数组的形状是(280,280,3),我想知道为什么每个像素用3维数组表示?
例如arr[0][0]是[255,255,255]......
python ×3
android ×2
c# ×2
php ×2
acumatica ×1
ajax ×1
arrays ×1
asp.net-mvc ×1
aws-java-sdk ×1
bar-chart ×1
data-science ×1
itext ×1
java ×1
javascript ×1
kotlin ×1
listview ×1
loops ×1
node.js ×1
npm ×1
numpy ×1
pdf ×1
pip ×1
random ×1
razor ×1
seaborn ×1
sugarorm ×1
ubuntu ×1
while-loop ×1
xdebug ×1