小编Tom*_*ito的帖子

简单的CSS z-index示例不起作用

我正在尝试在z-index上制作一个简单的html,其中2个图像高于其他图像:

<html>
    <head>
        <title>test</title>
        <style type="text/css">
            back {
                position: absolute;
                left: 0px;
                top:0px;
                z-index:0;
            }

            front {
                position: absolute;
                left: 0px;
                top:0px;
                z-index:1;
            }
        </style>
    </head>
    <body>
        <img id="front" src="loading.gif">
        <img id="back" src="plasma.jpg">
    </body>
<html>
Run Code Online (Sandbox Code Playgroud)

但为什么z-index不起作用?

html css

1
推荐指数
1
解决办法
279
查看次数

使用JSON表示法,如何在javascript中创建公共方法?

在这个例子中:

var circle = {
  radius : 9,
  getArea : function()
  {
    return (this.radius * this.radius) * Math.PI;
  }
};
Run Code Online (Sandbox Code Playgroud)

这个页面的Encapsulation主题来看,getArea是私有的,怎么会公开?

javascript oop json

1
推荐指数
1
解决办法
1892
查看次数

这个 Python 文件读取测试有什么问题?

这个 Python 文件读取测试有什么问题?

import os
import sys

fileList = os.listdir(sys.argv[1])
count = 0
for file in fileList:
    try:
        count += 1
        print os.path.isfile(file)
        if os.path.isfile(file)
            print "File >> " + file
        else
            print "Dir >> " + file
    except err:
        print "ERROR: " + err
        print ">> in file: " + file
Run Code Online (Sandbox Code Playgroud)

给出:

文件“test.py”,第 10 行 if os.path.isfile(file) ^ SyntaxError: 无效语法

为什么?

python file-io file

1
推荐指数
1
解决办法
2981
查看次数

如何检测文本中只有空格的行?

鉴于"空行"是一个空格:

我试图逐行读取文本文件.我想忽略空白行.或者以更正确的方式,我想检测空行.

空行可以包含空格,换行符等.它仍然被视为空行.如果你在记事本中打开它,在一个空行中你不应该看到任何东西.

在Python中有一种快速的方法吗?顺便说一句,我是python的新手.

python string

1
推荐指数
1
解决办法
3792
查看次数

对于不能在 Eclipse 上运行的模块,“需要传递”?

我开始研究模块,我想尝试“需要传递”。所以我为界面创建了一个模块:

module interfacesModule {
    
    exports com.my.interfaces;
    
}
Run Code Online (Sandbox Code Playgroud)

有 1 个接口:

package com.my.interfaces;

public interface MyInterface {

    void go();

}
Run Code Online (Sandbox Code Playgroud)

一个实现模块:

module javaModuleA {
    
    requires interfacesModule;
    
    exports com.my.moduleA;
    
}
Run Code Online (Sandbox Code Playgroud)

班级:

package com.my.moduleA;

import com.my.interfaces.MyInterface;

public class ClassA implements MyInterface {
    
    public void go() {
        System.out.println("in class A");
    }

}
Run Code Online (Sandbox Code Playgroud)

和主模块:

module mainModule {
    
    requires transitive javaModuleA;
    requires interfacesModule; // this line I want to comment, to use from requires transitive

}
Run Code Online (Sandbox Code Playgroud)

班级:

package com.my;

import com.my.interfaces.MyInterface;
import com.my.moduleA.ClassA;

public class Main …
Run Code Online (Sandbox Code Playgroud)

java java-module

1
推荐指数
1
解决办法
442
查看次数

ActionScript初学者,了解每个人

为什么这个:

    for each (var dieListener:Object in dieListeners)
    {
        var f:Function = (dieListener as Function);
        f();
    }
Run Code Online (Sandbox Code Playgroud)

..如果不行,如果这样:

    for (var i:int=0; i<dieListeners.length; i++)
    {
        var f:Function = (dieListeners.getItemAt(i) as Function);
        f();
    }
Run Code Online (Sandbox Code Playgroud)

..作品!?

(第一个根本不进入for循环,但第二个进入!)

flash actionscript-3

0
推荐指数
1
解决办法
969
查看次数

如何从xml中转义javascript代码?

我不记得发现了,但我知道有一种方法可以使用类似的东西<[CODE在xml中编写代码而不会出现xml保留符号的问题.有谁知道?

xml

0
推荐指数
1
解决办法
552
查看次数

为什么这个文字没有显示?

页面中,右侧有一个带有选项卡的框,而博客选项卡未显示文本,为什么?

html javascript jquery

0
推荐指数
1
解决办法
82
查看次数

如何更改给定行和索引处单元格的背景颜色?

我不敢相信谷歌搜索时找不到.我编程的每个JTable都自动填充了来自数据库的数据,任何编辑都是通过监听器完成的,但现在出于测试目的,我只有一个简单的3x3表,我不知道如何在代码中手动选择一个单元格(为了改变bg)用于测试目的的颜色),类似table.cellAt(1,1).setBGcolor ...

编辑:由于标题不是一个问题,我如何在我的代码中手动选择一个单元格?

java swing jtable

0
推荐指数
1
解决办法
1676
查看次数

测试 OpenAI API 的正确 URL 是什么?

我正在尝试在 Windows CMD 中使用curl 通过请求测试 GPT-3 API:

curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer MY_KEY" -d "{\"text\": \"is this working\"}" https://api.openai.com/v1/conversations/text-davinci-003/messages
Run Code Online (Sandbox Code Playgroud)

鉴于我确实更改了我的密钥“MY_KEY”。

但我得到了:

{
  "error": {
    "message": "Invalid URL (POST /v1/conversations/text-davinci-003/messages)",
    "type": "invalid_request_error",
    "param": null,
    "code": null
  }
}
Run Code Online (Sandbox Code Playgroud)

我还尝试将模型名称命名为text-davinci-002text-davinci-001,但得到相同的无效 URL 错误。这里正确的网址是什么?我在文档(或 chatGPT 本身)中找不到它。

curl openai-api gpt-3

0
推荐指数
1
解决办法
1万
查看次数

这个HTML有什么问题?

我的HTML开头是:

<html>
  <head>
    <script type="text/javascript" language="JavaScript1.3" src="js/euDock.2.0.js"></script>
    <script type="text/javascript" language="JavaScript1.3" src="js/euDock.Image.js"></script>
  </head>
...
Run Code Online (Sandbox Code Playgroud)

Netbeans在线说<head>:

The tag content is unresolved, expecting one of <ISINDEX>, <BASE>, 
<TITLE>, <OBJECT>, <SCRIPT>, <META>, <LINK>, <STYLE>.
Run Code Online (Sandbox Code Playgroud)

为什么?

html netbeans

-4
推荐指数
1
解决办法
318
查看次数