小编Isu*_*uru的帖子

此视图不受约束

我收到以下错误,我使用Android工作室2.2预览3.我搜索谷歌但找不到任何资源.

Error: This view is not constrained, it only has design time positions, so it will jump to (0,0) unless you add constraints
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

<TextView
        android:layout_width="384dp"
        android:layout_height="207dp"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="@string/calc_default_display"
        android:id="@+id/textView"
        android:background="#ffffff"
        android:layout_margin="0dp"
        android:gravity="bottom|end"
        android:textSize="70sp"
        android:nestedScrollingEnabled="false"
        android:maxLines="2"
        android:maxLength="17"
        tools:layout_editor_absoluteX="0dp"
        tools:layout_editor_absoluteY="0dp" />
Run Code Online (Sandbox Code Playgroud)

java layout android

84
推荐指数
9
解决办法
16万
查看次数

查看Java中的更改目录

我想看一个文件更改目录.我在java.nio中使用了WatchService.我可以成功监听文件创建的事件.但我不能听文件修改事件.我查了官方的java教程,但还在苦苦挣扎.

这是源代码.

import static java.nio.file.LinkOption.NOFOLLOW_LINKS;
import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE;
import static java.nio.file.StandardWatchEventKinds.OVERFLOW;
import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE;
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY;

import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.WatchEvent;
import java.nio.file.WatchEvent.Kind;
import java.nio.file.WatchKey;
import java.nio.file.WatchService;

public class MainWatch {

    public static void watchDirectoryPath(Path path) {
        // Sanity check - Check if path is a folder
        try {
            Boolean isFolder = (Boolean) Files.getAttribute(path,
                    "basic:isDirectory", NOFOLLOW_LINKS);
            if (!isFolder) {
                throw new IllegalArgumentException("Path: " + path
                        + " is not a …
Run Code Online (Sandbox Code Playgroud)

java file java.nio.file

37
推荐指数
2
解决办法
5万
查看次数

在此页面上检测到Vue.js. Devtools检查不可用,因为它处于生产模式或由作者明确禁用

在此输入图像描述

我正在尝试在Google Chrome中启用vue-devtools.但我无法启用它.我在Laravel应用程序中使用vue.js.

在此输入图像描述

我的服务器使用php artisan serve命令运行.

google-chrome google-chrome-extension vue.js laravel-5

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

Laravel 5.4内部错误:无法检索默认值

我有一个表单,它将数据提交给数据库.它将数据提交给数据库.但是当Laravel尝试将其重定向到同一控制器中的另一个方法时会产生错误.

ReflectionException in RouteDependencyResolverTrait.php line 57:
Internal error: Failed to retrieve the default value
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

这是我使用的控制器.请检查public function store(Request $request)方法.

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Inbox;

class ContactUsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        return view('pages.contactus');
    }

    /**
     * Store a newly created resource …
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-5 laravel-5.4

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

线程"main"java.util.ConcurrentModificationException中的异常

当我运行以下代码时,我得到一个例外.我搜索但找不到任何解决方案.

Exception in thread "main" java.util.ConcurrentModificationException
     at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
     at java.util.HashMap$KeyIterator.next(Unknown Source)
     at com.aybits.software.linkgrabber.Grabber.main(Grabber.java:45)
Run Code Online (Sandbox Code Playgroud)

第45行用于(String linkFromCollection:linksList){

public class Grabber {

static String url;
Document doc;
static Set<String> linksList = new HashSet<String>();
String matchingString ="java2s.com/Code";
static boolean isCrawling = true;
static int STOP_WATCH = 0;

public Grabber(String url){
    Grabber.url = url;
}

public void grabLinks(String urlToCrawl) throws IOException{
    doc = Jsoup.connect(urlToCrawl).timeout(20 * 1000).get();
    Elements links = doc.select("a[href]");

    for (Element link : links) {
        //print(" * a: <%s>  (%s)", link.attr("abs:href"), trim(link.text(), …
Run Code Online (Sandbox Code Playgroud)

java arrays iterator hashset

8
推荐指数
2
解决办法
2万
查看次数

屏幕右下角的位置

我需要在屏幕上放置JFrame.但我无法让它们出现在屏幕底部的右侧.

请有人解释我如何定位它们,如果你能描述如何做,那就太好了.

这是迄今为止的代码.

    //Gets the screen size and positions the frame left bottom of the screen
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice defaultScreen = ge.getDefaultScreenDevice();
    Rectangle rect = defaultScreen.getDefaultConfiguration().getBounds();
    int x = (int)rect.getMinX();
    int y = (int)rect.getMaxY()- frame.getHeight();
    frame.setLocation(x ,y - 45);
Run Code Online (Sandbox Code Playgroud)

java swing point jframe layout-manager

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

如何从android firebase通知中获取自定义数据?

我正在尝试实现firebase通知.但是我无法找到有关如何从firebase通知中检索自定义数据的任何文档.

Firebase控制台

但在代码中如何获取自定义键.

在此输入图像描述

我正在使用FirebaseMessagingService.onMessageReceived获取消息数据.

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
    // TODO(developer): Handle FCM messages here.
    // If the application is in the foreground handle both data and notification messages here.
    // Also if you intend on generating your own notifications as a result of a received FCM
    // message, here is where that should be initiated. See sendNotification method below.
    Log.d(TAG, "From: " + remoteMessage.getFrom());
    Log.d(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());
}
Run Code Online (Sandbox Code Playgroud)

android firebase firebase-notifications

6
推荐指数
2
解决办法
2万
查看次数

无法更改laravel应用程序名称

我正在使用php artisan app:name L&K Biomedics设置应用程序的名称.但我得到一个错误说,

'L' is not recognized as an internal or external command,
operable program or batch file.
Run Code Online (Sandbox Code Playgroud)

我是Laravel的新手.我在这里做错了什么.

在此输入图像描述

有没有办法撤消这个命令?我的意思是,如果将名称更改为L,我该如何更改它?

php laravel laravel-5

6
推荐指数
3
解决办法
8325
查看次数

使用 Input 组件的 Angular Pass 数据

我正在尝试使用scotch.io网站上的免费视频教程来学习 Angular 2 。我按照大多数部分没有任何问题。但是我无法将数据从一个组件传递到另一个组件。

app.component.html 中列出了用户配置文件。当用户单击用户链接时,它应该显示文本输入,用户可以在其中更改名称。

这是app.component.html

<header>
  <nav class="navbar navbar-inverse">
    <div class="navbar-header">
      <a href="/" class="navbar-brand">My Angular 2 App</a>
    </div>
  </nav>
<main>

  <div class="row">
    <div class="col-sm-4">
      <div *ngIf="user_list">
        <ul class="list-group users-list" >
          <li class="list-group-item" *ngFor="let user of user_list"
          (click)="selectUser(user)"
          [class.active] = "user == active_user">{{user.name}}</li>
        </ul>
      </div>
    </div>
    <div class="col-sm-8">

      <user-profile [user] = "active_user"></user-profile>

      <div class="jumbotron gocrazy" *ngIf="!active_user">
        <span class="glyphicon glyphicon-hand-left"></span>
        <h2>Choose a user from the left menu </h2>
      </div>
    </div>
  </div>


</main>

<footer class="text-center">
  Copyright &copy; 2016 …
Run Code Online (Sandbox Code Playgroud)

javascript typescript angular

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

Firebase会在应用启动时检索所有数据

我无法使用firebase文档找到任何信息,谷歌如何检索应用程序启动时的所有数据.

我们假设,我希望在没有任何事件的情况下获取应用程序启动时的所有以下数据.并存储在ArrayList中.让我们说ArrayList<Quote>和引用有三个字段(int id,String text,String author).

[{
    "id" : 1,
    "text": "There are 1,411 tigers left in India.",
    "author": "NULL"
}, {
    "id" : 2,
    "text": "The Greek for \"left-handed\" also means \"better\".",
    "author": "NULL"
}]
Run Code Online (Sandbox Code Playgroud)

根据文档,有一个名为onDataChange()的方法,但app不会更改任何数据.如何获取ArrayList<Quote>我可以传递给自定义适配器的所有数据和存储.

java android firebase firebase-realtime-database

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