小编Iro*_*nic的帖子

当前Flutter SDK版本为0.0.0-未知

我没有使用GIT。正如我看到的一些帖子/问题,用户提到他们正在使用 GIT,因此他们收到了错误。

\n\n

昨天,我添加了 Image Cropper Plugin,然后重新启动了机器。重新启动后,它开始给出错误。

\n\n
The current Flutter SDK version is 0.0.0-unknown.\n\nBecause image_cropper 1.2.1 requires Flutter SDK version ^1.12.13 and no versions of image_cropper match >1.2.1 <2.0.0, image_cropper ^1.2.1 is forbidden.\nSo, because demoapp depends on image_cropper ^1.2.1, version solving failed.\npub get failed (1; So, because demoapp depends on image_cropper ^1.2.1, version solving failed.)\nExited (1)\n
Run Code Online (Sandbox Code Playgroud)\n\n

我运行 Flutter version 命令 -> 下面是输出。

\n\n
Flutter 1.12.13+hotfix.9 \xe2\x80\xa2 channel stable \xe2\x80\xa2 https://github.com/flutter/flutter.git\nFramework \xe2\x80\xa2 revision f139b11009 (6 weeks ago) \xe2\x80\xa2 2020-03-30 …
Run Code Online (Sandbox Code Playgroud)

flutter

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

bootstrap和bootbox:设置屏幕的对话框中心

我正在使用http://bootboxjs.com/examples.html中的 bootbox.js ,这令人印象深刻.但是在设置对话框的位置时我遇到了问题.

我想放置屏幕的对话框中心.我正在使用此代码,但对话框保持在屏幕顶部.

 bootbox.alert('Danger!!').find('.modal-content').css({
     'background-color': '#f99',
     'font-weight': 'bold',
     color: '#F00',
     'top': '50%',
     'margin-top': function() {
         return -(box.height() / 2);
     },
     'font-size': '2em',
     'font-weight': 'bold'
 });
Run Code Online (Sandbox Code Playgroud)

请告知如何设置屏幕的对话框中心.

twitter-bootstrap bootbox

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

单页多次倒计时

以下是倒计时的html代码.我正在使用jquery.countdown.min.js插件.

<ul id="example">
<li><span class="days">00</span><p class="days_text">Days</p></li>
        <li class="seperator">:</li>
        <li><span class="hours">00</span><p class="hours_text">Hours</p></li>
        <li class="seperator">:</li>
    <li><span class="minutes">00</span><p class="minutes_text">Minutes</p></li>
        <li class="seperator">:</li>
    <li><span class="seconds">00</span><p class="seconds_text">Seconds</p></li>
    </ul>

    <div id= "count" data-text="01/01/2016 05:06:59"></div>
Run Code Online (Sandbox Code Playgroud)

这是javascript代码.

<script type="text/javascript">
    var val1 = $('#count').data('text');

        $('#example').countdown({
            date: val1,
            offset: 0,
            day: 'Day',
            days: 'Days'
        }, function () {
            alert('Done!');
        });
    </script>
Run Code Online (Sandbox Code Playgroud)

它工作正常,给我所需的输出.限制是我每页只能使用一个倒数计时器.如果我想在同一页面上使用多个,那么我必须添加多个javascript代码.

以下是场景.

<ul id="example">
        <div data-countdown="01/01/2016 05:06:59"></div>
         <div data-countdown="01/01/2017"></div>
         <div data-countdown="01/01/2018"></div>
        <div data-countdown="01/01/2020"></div>   
      </ul>
Run Code Online (Sandbox Code Playgroud)

我试过下面的代码,但它不起作用.

<script type="text/javascript">
     $('[data-countdown]').each(function() {
   var $this = $(this),finalDate = $(this).data('countdown');
        $this.countdown({
            date: finalDate,
            offset: 0, …
Run Code Online (Sandbox Code Playgroud)

javascript jquery

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

Powershell:如何获取防病毒产品详细信息

我们有超过 1500 台服务器。Windows 2003、2008 和 2012。我必须在这些服务器上收集防病毒软件(产品名称和版本)的详细信息。可能有多种防病毒产品。我不确定 powershell 脚本是否可以在 2003 服务器上运行。

所以,到目前为止,我尝试了下面的脚本,但没有得到有用的信息。

$av = get-wmiobject -class "Win32_Product" -namespace "root\cimv2" `
              -computername "." -filter "Name like '%antivirus%'"
Run Code Online (Sandbox Code Playgroud)

下面的脚本在客户端操作系统上运行良好。

$wmiQuery = "SELECT * FROM AntiVirusProduct"
$AntivirusProduct = Get-WmiObject -Namespace "root\SecurityCenter2" -Query $wmiQuery  @psboundparameters # -ErrorVariable myError -ErrorAction 'SilentlyContinue'             
            Write-host $AntivirusProduct.displayName
Run Code Online (Sandbox Code Playgroud)

有人可以就此给我建议吗?我正在尝试获取防病毒(产品和版本)的详细信息,我需要为 win server 2003 做什么?

powershell

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

从SQL Server查询结果中删除列标题

我想从SQL Server查询输出中删除列标题.我做了搜索,但没有找到任何解决方案.我有一个查询,例如.

select cc.DepartmentID , cc.Name  from HumanResources.Department cc
Run Code Online (Sandbox Code Playgroud)

当我运行此查询时,我得到这样的输出.

ID  Name
12  Document Control
1   Engineering
16  Executive
14  Facilities and Maintenance
10  Finance
9   Human Resources
Run Code Online (Sandbox Code Playgroud)

我想从SQL Server的输出中删除ID和名称(列标题).

我将通过脚本运行此查询以生成csv文件.

编辑:

当我通过脚本运行查询时,我将csv文件作为输出,它看起来像这样.

#TYPE System.Data.DataRow           
ID  Name    
Run Code Online (Sandbox Code Playgroud)

更新:

我正在使用PowerShell脚本.

$Database = "temp"
$Server = "localhost"

$AttachmentPath = "output.csv"


# Connect to SQL and query data, extract data to SQL Adapter

$SqlQuery = "select cc.DepartmentID , cc.Name  from HumanResources.Department cc"
$SqlConnection = New-Object System.Data.SqlClient.SqlConnection
$SqlConnection.ConnectionString = "Data Source=$Server;Initial Catalog=$Database;Integrated Security = …
Run Code Online (Sandbox Code Playgroud)

sql-server powershell sqlcmd sql-server-2008

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

在php mysql和jquery中加载更多

我正在尝试为我的学校项目提供在php网页中加载更多帖子的选项。

这是一些php代码。

    <?php
        $prj= mysql_query("select * from campaign where uid=$uid order by Closing_Date DESC Limit 0,1");
            $record = array();
            while($row = mysql_fetch_assoc($prj)){
            $record[] = $row;
            }
     foreach($record as $rec){

                <div class="col-sm-1 col-md-4" id="<?php echo $rec['cid'];?>">
                    <div class="well">
                        <div class="media services-wrap55 wow fadeInDown">

                                <h4 class="media-heading"><?php echo $rec['Project_Name'];?></h4></a>
                                <p> by <i><?php echo $rec['user_name'];?></i></p>
                                            <p> <?php echo $rec['short_dis'];?></p>
                        </div>
                    </div>
                </div>

    ?>

<?php } ?>

<div class="col-sm-1 col-md-12">
    <div class="media services-wrap55 wow fadeInDown"> 
        <center><h3 class="media-heading"><div class="more" id="more">Load More Post</div></h3></center>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

这是JavaScript代码。

$(document).ready(function(){ …
Run Code Online (Sandbox Code Playgroud)

html javascript php jquery

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

错误:无法索引到Powershell中的类型对象

下面是powershell脚本.

$Requests = Get-WmiObject -Class SMS_UserApplicationRequest -Namespace root/SMS/site_$($SiteCode) -ComputerName $SiteServer  |  Select-Object User,Application,CurrentState,Comments | Sort-Object User
    $Count = @($Requests).Count
        for ($i=0; $i -lt $count; $i++) {
            if ($Requests[$i].CurrentState -eq '1') {
                $Requests[$i].CurrentState = "Pending"
                $checkbox1.Enabled = $true
            }
Run Code Online (Sandbox Code Playgroud)

当我执行脚本时,我收到以下错误.

 Unable to index into an object of type System.Management.Automation.PSObject.
if ($Requests[ <<<< $i].CurrentState -eq '1') {
    + CategoryInfo          : InvalidOperation: (0:Int32) [], RuntimeException
    + FullyQualifiedErrorId : CannotIndex
Run Code Online (Sandbox Code Playgroud)

我想做的是我将值(1)替换为待定.

powershell

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

cordova:从 url 下载到 android 下载文件夹

在开始之前,我尝试了以下来自堆栈溢出的答案。

使用phonegap将文件下载到ios/android下载文件夹

FileTransfer Cordova下载路径

使用 Cordova FileTransfer 将文件下载到设备的下载文件夹

http://www.phonegaptutorial.com/downloading-an-image-from-the-internet-with-phonegap/

但一点运气都没有。

我正在尝试从互联网下载文件。我的目标是下载 Android 手机上下载文件夹中的文件。

我尝试了上述所有答案,而且我还使用了科尔多瓦网站上的科尔多瓦示例。

https://cordova.apache.org/docs/en/2.0.0/cordova/file/filetransfer/filetransfer.html

function downloadCL(){

var url = "http://www.phonegaptutorial.com/wp-content/uploads/examples/phonegap-logo.png";

// we need to access LocalFileSystem
window.requestFileSystem(window.LocalFileSystem.PERSISTENT, 0, function(fs)
{
     // create the download directory is doesn't exist
    fs.root.getDirectory('downloads', { create: true });

    // we will save file in .. downloads/phonegap-logo.png
    var filePath = fs.root.fullPath + '/downloads/' + url.split('/').pop();
    var fileTransfer = new window.FileTransfer();
    var uri = encodeURI(decodeURIComponent(url));

    fileTransfer.download(uri, filePath, function(entry)
    {
        alert("Successfully downloaded file, full path is " …
Run Code Online (Sandbox Code Playgroud)

android phonegap-plugins cordova

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

过滤/删除在多维数组中多次找到列值的行

我需要从输入数组中删除特定列中出现重复值的行。

样本数组:

$array = [
    ['user_id' => 82, 'ac_type' => 1],
    ['user_id' => 80, 'ac_type' => 5],
    ['user_id' => 76, 'ac_type' => 1],
    ['user_id' => 82, 'ac_type' => 1],
    ['user_id' => 80, 'ac_type' => 5]
];
Run Code Online (Sandbox Code Playgroud)

我想进行过滤以user_id确保唯一性并实现此结果:

所以,我的输出将是这样的:

[
    ['user_id' => 82, 'ac_type' => 1],
    ['user_id' => 80, 'ac_type' => 5],
    ['user_id' => 76, 'ac_type' => 1]
]
Run Code Online (Sandbox Code Playgroud)

我已经找到了此页面,但没有一个答案适合我的情况:

$result = array_unique($array, SORT_REGULAR);
Run Code Online (Sandbox Code Playgroud)

$result = array_map("unserialize", array_unique(array_map("serialize", $array)));
Run Code Online (Sandbox Code Playgroud)

$result = array();
foreach ($array as …
Run Code Online (Sandbox Code Playgroud)

php filtering unique duplicates multidimensional-array

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

Flutter:未为该类型定义 getter

我被困在页面路由上。

这是 main.dart 中的代码

import 'package: test/routes/router.gr.dart';
import 'package:flutter/material.dart';
import 'package:test/splash_screen.dart';
import 'package:test/home_screen.dart';

void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          theme: ThemeData(
            primarySwatch: Colors.blue,
          ),
          debugShowCheckedModeBanner: false,
          initialRoute: Router.homeScreenRoute,
          onGenerateRoute: Router.onGenerateRoute,
          navigatorKey: Router.navigatorKey,

        );
      }
    }
Run Code Online (Sandbox Code Playgroud)

这是从自动路由器生成的 router.gr.dart 文件。

import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:auto_route/auto_route.dart';
import 'package:test/home_screen.dart';
import 'package:test/viewownprofile.dart';
import 'package:test/view_other_profile.dart';

abstract class Routes {
  static const homeScreenRoute = '/';
  static const viewownProfile = '/viewown-profile';
  static const viewotherProfile = '/viewother-profile';
  static …
Run Code Online (Sandbox Code Playgroud)

dart flutter

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