我正在尝试运行我的JSQL解析器类,但我得到了Error: java: invalid source release 1.9.
我试着按照这个答案.我更改了文件>构建,执行,部署> Java编译器>项目字节码版本:1.8.但是,我无法将模块语言级别和项目语言级别更改为1.8,因为没有选项.我仍然在下面得到同样的错误.
码
package cs4321.project2;
import java.io.FileReader;
import net.sf.jsqlparser.parser.CCJSqlParser;
import net.sf.jsqlparser.statement.Statement;
import net.sf.jsqlparser.statement.select.Select;
public class Parser {
private static final String queriesFile = "resources/input/queries.sql";
public static void main(String[] args) {
try {
CCJSqlParser parser = new CCJSqlParser(new FileReader(queriesFile));
Statement statement;
while ((statement = parser.Statement()) != null) {
System.out.println("Read statement: " + statement);
Select select = (Select) statement;
System.out.println("Select body is " + select.getSelectBody());
}
} catch (Exception e) { …Run Code Online (Sandbox Code Playgroud) 我试图将右栏按钮项的字体颜色更改为紫色,但它仍然显示为白色.我已经咨询了这个问题和这个问题.我该如何解决?
码
let sortButton = UIButton(frame: CGRect(x: 0, y: 0, width: 34, height: 15))
sortButton.setTitle("SORT", for: .normal)
sortButton.titleLabel?.tintColor = UIColor.myMusicPurple
sortButton.tintColor = UIColor.myMusicPurple
navigationItem.rightBarButtonItem = UIBarButtonItem(customView: sortButton)
navigationItem.rightBarButtonItem?.tintColor = UIColor.myMusicPurple
Run Code Online (Sandbox Code Playgroud) 我从采访位上得到了这个问题
问题
int j = 0;
for(i = 0; i < n; ++i) {
while(j < n && arr[i] < arr[j]) {
j++;
}
}
Run Code Online (Sandbox Code Playgroud)
题
while循环执行的比较总数约为n(取决于,可能小于或等于n arr)。循环运行n次。时间复杂度不应该是O(n ^ 2)吗?
我想要搜索图标下方的搜索文本。搜索图标+文本组应位于屏幕中央。
我想要什么:____________屏幕实际是什么样子:
注意:我使用线性布局,因为我需要直接在下面的列表视图。它将用于搜索栏。对于那些建议使用 TextView 的人android:drawableTop,我尝试过,但图像太小(即使我将图像设置为 500px),而在图像视图中将图像设置为“100dpx100dp”时也是如此。
代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center_horizontal"
app:srcCompat="@drawable/ic_search_gray_500px" />
<TextView
android:id="@+id/searchTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/search_hint"
android:layout_gravity="center_horizontal"
tools:layout_editor_absoluteX="130dp"
tools:text="@string/search_hint" />
</android.support.constraint.ConstraintLayout>
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
android textview imageview android-layout android-linearlayout