小编dfe*_*enc的帖子

Swift 4 + Alamofire可解码Json URL格式

我有一个JSON格式,我不能用Alamofire解码.

这是我的json:

"data":[  
{  
    "id":37,
    "status":"A\u00e7\u0131k",
    "department":"Muhasebe",
    "title":"Y\u00f6netim Panelinden Deneme 4 - Mail Kontrol",
    "message":"<p>Y\u00f6netim Panelinden Deneme 4 - Mail Kontrol<br><\/p>",
    "file":null,
    "created_at":{  
        "date":"2018-01-13 01:59:49.000000",
        "timezone_type":3,
        "timezone":"UTC"
    },
    "replies":[  
        {  
            "id":6,
            "ticket_id":37,
            "admin_id":null,
            "user_id":8593,
            "message":"<p>test<\/p>",
            "file":"uploads\/tickets\/8593-P87wd8\/GFV6H5M94y5Pt27YAxZxHNRcVyFjD554i80og3xk.png",
            "created_at":"2018-01-18 11:16:55",
            "updated_at":"2018-01-18 11:16:55"
        }
    ]
},
Run Code Online (Sandbox Code Playgroud)

这是我的JSON模型:

struct TeknikDestek : Decodable {
    var id: Int?
    var status: String?
    var title: String?
    var department: String?
    var message: String?

    var replies: [Replies]?
}

struct Replies: Decodable {
    var replyid: Int?
    var ticket_id: Int?
    var admin_id: …
Run Code Online (Sandbox Code Playgroud)

swift alamofire swift4 decodable

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

使用phpspreadsheet库将数据从数组写入表单

如何使用phpspreadsheet库从数组创建Excel工作表列标题?

下面是我正在尝试的代码,但它不起作用:

    // $header is an array containing column headers
    $header = array("Customer Number", "Customer Name", "Address", "City", "State", "Zip");
    $spreadsheet = new Spreadsheet();
    $sheet = $spreadsheet->getActiveSheet();
    $sheet->fromArray($header, NULL, 'A1');     

    // redirect output to client browser
    header('Content-Type: application/vnd.ms-excel');
    header('Content-Disposition: attachment;filename="myfile.xlsx"');
    header('Cache-Control: max-age=0');

    $writer = new Xlsx($spreadsheet);
    $writer->save('php://output');
Run Code Online (Sandbox Code Playgroud)

php excel phpspreadsheet

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

ImageMagick 裁剪保持高度

我正在尝试使用此命令行按高度裁剪图像:

convert 1053257.png -gravity South -crop 2910x3312+0+0 -background black +repage image-cropped-top.png
Run Code Online (Sandbox Code Playgroud)

生成的图像未正确裁剪,因为运行命令后的尺寸为2791 x 3312。宽度也被裁剪了!

有人能帮忙吗?

imagemagick

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

Bootstrap 4:Carousel Fade Transition不工作

以下代码使用Bootstrap版本3完全正常.但是,由于升级到Bootstrap 4 Beta2,淡入淡出过渡不起作用.它只是跳转到下一个图像而不是平滑过渡:

HTML

<div id="carousel1" class="carousel fade" data-ride="carousel">
    <ol class="carousel-indicators">
      <li data-target="#carousel1" data-slide-to="0" class="active"></li>
      <li data-target="#carousel1" data-slide-to="1"></li>
      <li data-target="#carousel1" data-slide-to="2"></li>
    </ol>

    <div class="carousel-inner" role="listbox">
      <div class="item active"><img src="images/a.jpg" alt="First slide image" class="center-block">
        <div class="carousel-caption">
          <h3>First slide Heading</h3>
          <p>First slide Caption</p>
        </div>
      </div>
      <div class="item"><img src="images/b.jpg" alt="Second slide image" class="center-block">
        <div class="carousel-caption">
          <h3>Second slide Heading</h3>
          <p>Second slide Caption</p>
        </div>
      </div>
      <div class="item"><img src="images/c.jpg" alt="Third slide image" class="center-block">
        <div class="carousel-caption">
          <h3>Third slide Heading</h3>
          <p>Third slide Caption</p>
        </div>
      </div>
    </div>

    <a class="left …
Run Code Online (Sandbox Code Playgroud)

html carousel twitter-bootstrap twitter-bootstrap-4

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

如何在 Bootstrap 4 轮播中堆叠多个图像

我不知道如何使用 Bootstrap 4,以及如何在一张幻灯片中显示多个小图像 \xe2\x80\x93(如缩略图\xe2\x80\x93),而不是让图像填充轮播的宽度。我已经使用下面的代码尝试了一些操作,但仍然无法堆叠许多图像。

\n\n
<div class="container">\n    <h2 class="text-center">- Carousel -</h2><br>\n\n    <div id="carouselExampleControls" class="carousel slide" data-ride="carousel">\n        <div class="carousel-inner">\n            <div class="carousel-item active">\n                <img src="http://via.placeholder.com/250x250" alt="First slide">\n            </div>\n            <div class="carousel-item">\n                <img src="http://via.placeholder.com/250x250" alt="Second slide">\n            </div>\n            <div class="carousel-item">\n                <img src="http://via.placeholder.com/250x250" alt="Third slide">\n            </div>\n            <div class="carousel-item">\n                <img src="http://via.placeholder.com/250x250" alt="Fourth slide">\n            </div>\n            <div class="carousel-item">\n                <img src="http://via.placeholder.com/250x250" alt="Fifth slide">\n            </div>\n            <div class="carousel-item">\n                <img src="http://via.placeholder.com/250x250" alt="Sixth slide">\n            </div>\n        </div>\n\n        <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">\n            <span class="carousel-control-prev-icon" aria-hidden="true"></span>\n            <span class="sr-only">Previous</span>\n        </a>\n        <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">\n            <span class="carousel-control-next-icon" …
Run Code Online (Sandbox Code Playgroud)

css jquery twitter-bootstrap twitter-bootstrap-4 bootstrap-4

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

来自c#的Kusto查询

我想从c#app从Kusto DB中检索数据,任何人都可以帮助我.我有关于编写Kusto查询的知识,但我需要一些帮助来从Azure托管的Azure Kusto数据库中提取数据.

我尝试了以下代码,但它不起作用:

var client = Kusto.Data.Net.Client.KustoClientFactory.CreateCslQueryProvider("https://help.kusto.windows.net/Samples;Fed=true");
var reader = client.ExecuteQuery("MyTable | count");
// Read the first row from reader -- it's 0'th column is the count of records in MyTable
// Don't forget to dispose of reader when done.
Run Code Online (Sandbox Code Playgroud)

azure kusto azure-data-explorer

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

如何为 Firestore 数据库调用 onwrite 事件侦听器函数?

functions.firestore
    .document('users/00QAGyS0NqFdDSS78E6r')
    .onWrite(event => {

        const commentId = event.params.commentId;
        const postId = event.params.postId;

        // ref to the parent document
        const docRef = admin.firestore().collection('posts').doc();

        // get all comments and aggregate
        return docRef.collection('comments').orderBy('createdAt', 'desc')
            .get()
            .then(querySnapshot => {

                // get the total comment count
                const commentCount = querySnapshot.size

                const recentComments = []

                // add data from the 5 most recent comments to the array
                querySnapshot.forEach(doc => {
                    recentComments.push( doc.data() )
                });

                recentComments.splice(5)

                // record last comment timestamp
                const lastActivity = recentComments[0].createdAt

                // …
Run Code Online (Sandbox Code Playgroud)

firebase google-cloud-firestore

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

Illuminate\Database\QueryException SQLSTATE[42000]

我正在使用 Laravel,当我尝试运行php artisan make:migrate它时显示此错误:

Illuminate\Database\QueryException : SQLSTATE[42000]: 语法错误或访问冲突:1071 指定的键太长;最大密钥长度为 767 字节(SQL:alter table usersadd unique users_email_unique( email))

在 /Users/soksan/Desktop/TestLaravel/multiUsers/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664

  660|    // If an exception occurs when attempting to run a query, we'll format the error
  661|    // message to include the bindings with SQL, which will make this exception a
  662|    // lot more helpful to the developer instead of just the database's errors.
  663|    catch (Exception $e) {
> 664|        throw new QueryException(
  665|            $query, …
Run Code Online (Sandbox Code Playgroud)

php mysql laravel

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

Cpanel Apache mod_userdir在PHP文件执行中显示不支持的错误

我从http://xx.xx.xx.xx/~cpaneluser之类的IP地址访问网络。这样我就可以访问html文件,但是当我尝试打开.php文件时,显示Not Supported Error。请帮我解决这个问题。

听到我有cPanel/WHM两个接入和其托管的Amazon AWS EC2

php amazon-ec2 cpanel whm amazon-web-services

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