小编aut*_*ate的帖子

在iOS 9.0中不推荐使用'kABPersonAddressStreetKey':使用CNPostalAddress.street

我有一个早期版本的Swift编写的以下类.在斯威夫特2编译器警告

iOS 9.0中不推荐使用' kABPersonAddressStreetKey ' :使用CNPostalAddress.street

并给出一个错误

'找不到类型'MKPlacemark'的初始值设定项,它接受类型'(坐标:CLLocationCoordinate2D,addressDictionary:[String:String?])'的参数列表

我意识到需要选项才能解决错误,但无论我尝试什么似乎都无法解决问题.这是因为我是一个快速的新手,任何帮助将不胜感激.

import Foundation
import MapKit
import AddressBook

class Artwork: NSObject, MKAnnotation {
let title: String?
let locationName: String
let discipline: String
let coordinate: CLLocationCoordinate2D

init(title: String, locationName: String, discipline: String, coordinate: CLLocationCoordinate2D) {
    self.title = title
    self.locationName = locationName
    self.discipline = discipline
    self.coordinate = coordinate

    super.init()
}

var subtitle: String? {
    return locationName
}

// annotation callout info button opens this mapItem in Maps app
func mapItem() …
Run Code Online (Sandbox Code Playgroud)

ios swift2

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

php/SQL - 在许多条件下每4个名字之间打印4次

我之前在这个主题中已经问过这个问题请仔细阅读sql-print-many-word-between-every-columns-with-many-conditions

但是这个问题和之前的问题之间的差异,我想在许多俱乐部名称中建立一个集体球员或一组球员,例如:

El Ahly俱乐部的名字有一个12球员,我想将它拆分成3 teams每个team都有4球员什么,我想看看有多少team每个俱乐部的名字里面,然后把它们不变的数字里面(组)4 8 16 32 64 128 256基础上的数量teams打印**ANY WORD**它们之间以后类似的东西与过滤数据select full_name,club_name from players where y_of_birth=2000的期望的输出应该是这样的:

更新 :

+----+------+---------------------+
|   full_name  |  club_name       |
+--------------+------------------+
| Ahmed Sayed  |   El Ahly        |
+--------------+------------------+
| Kareem Gaber |   El Ahly        |
+--------------+------------------+
| Maher Zein   |   El Ahly        |
+--------------+------------------+
| Mohab Saeed  |   El Ahly        |
+----+------+--+------------------+
| ahmed …
Run Code Online (Sandbox Code Playgroud)

php mysql

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

将图像传递给另一个视图控制器(Swift)

我正在尝试将用户上传的图像从一个UIImageView移动到另一个View Controller上的另一个UIImageView.我可以让用户上传图像并将其保存在第一个UIImageView中,但在按下"发布"按钮后,下一个视图控制器上的UIImageView仍为空白.

注意:browsingImage是第二个视图控制器上的UIImageView的名称(目标UIImageView)

任何帮助将不胜感激!

@IBAction func cameraButton(sender: AnyObject) {

    addNewPicture()

}


func addNewPicture() {

    let picker = UIImagePickerController()
    picker.allowsEditing = true
    picker.delegate = self

    presentViewController(picker, animated: true, completion: nil)
}

func imagePickerController(picker: UIImagePickerController, didFinishPickingImage image: UIImage!, editingInfo: [NSObject : AnyObject]!) {

    postingImage.image = image
    self.dismissViewControllerAnimated(true, completion: nil)

}

@IBAction func postButton(sender: AnyObject) {

    performSegueWithIdentifier("toBrowsePage", sender: nil)


}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

    if segue.identifier == "toBrowsePage" {


        var itemToAdd = segue.destinationViewController as! …
Run Code Online (Sandbox Code Playgroud)

uibutton uiviewcontroller uiimageview ios swift

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

SQL - 在具有许多条件的每个列之间打印许多单词

好的,首先我有不可变的值:

4   8   16   32   64   128   256
Run Code Online (Sandbox Code Playgroud)

我有一张这样的表:

+----+------+---------------------+-------------+
| id |   full_name  |  club_name  |  y_of_birth |
+----+------+---------------------+-------------+
| 1  | Ahmed Sayed  |   El Ahly   |    2000     |
+----+------+---------------------+-------------+
| 2  | Kareem Gaber |   El Ahly   |    2000     |
+----+------+---------------------+-------------+
| 3  | Maher Zein   |   El Ahly   |    2003     |
+----+------+---------------------+-------------+
| 4  | Mohab Saeed  |   El Ahly   |    2003     |
+----+------+---------------------+-------------+
| 5  | Kamal saber  |   wadi dgla |    2000     |
+----+------+---------------------+-------------+ …
Run Code Online (Sandbox Code Playgroud)

mysql

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

Powershell试用/捕获测试连接

我正在尝试将离线计算机记录在文本文件中,以便我可以在以后再次运行它们.似乎没有记录或陷入捕获.

function Get-ComputerNameChange {

    [CmdletBinding()]
    Param(
    [Parameter(Mandatory=$True,ValueFromPipeline=$True,ValueFromPipelinebyPropertyName=$True)]
    [string[]]$computername,
    [string]$logfile = 'C:\PowerShell\offline.txt'
    )




    PROCESS {

        Foreach($computer in $computername) {
        $continue = $true
        try { Test-Connection -computername $computer -Quiet -Count 1 -ErrorAction stop
        } catch [System.Net.NetworkInformation.PingException]
        {
            $continue = $false

            $computer | Out-File $logfile
        }
        }

        if($continue){
        Get-EventLog -LogName System -ComputerName $computer | Where-Object {$_.EventID -eq 6011} | 
        select machinename, Time, EventID, Message }}}
Run Code Online (Sandbox Code Playgroud)

powershell try-catch get-eventlog

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

使用命令"from polyglot.detect import Detector"时出错

我是python的初学者,正在玩多语言功能,将文本从一种语言转换为另一种语言,如西班牙语到英语.

我按照说明安装了Polyglot和所需的模块.

但是在运行命令"from polyglot.detect import Detector"时,我收到任何错误

回溯(最近一次调用最后一次):文件"",第1行,来自polyglot.detect导入检测器文件"C:\ Python34\lib\site-packages\polyglot-15.5.2-py3.4.egg\polyglot\detect__init__ .py",第1行,来自.base import Detector,语言文件"C:\ Python34\lib\site-packages\polyglot-15.5.2-py3.4.egg\polyglot\detect\base.py",line 11,来自icu import Locale ImportError:没有名为'icu'的模块

不知道我需要做什么.

有人可以帮忙吗?

python polyglot

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

在WatchKit错误中填充TableView

这就是我目前在WatchKit中填充表视图的方式:

    - (void)awakeWithContext:(id)context {
    [super awakeWithContext:context];

    // Configure interface objects here.

    menuItems = [[NSMutableArray alloc] initWithObjects:@"Pizza", @"Chicken", @"Bread", nil];

    for (NSString *item in menuItems)
    {
        MenuRowController *menuRow = [myTableView rowControllerAtIndex:[menuItems indexOfObject:item]];
        [menuRow.menuItemLabel setText:item];
    }
}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

Extension[980:19597] Error - attempt to ask for row 0. Valid range is 0..0
Printing description of item:
Pizza
2015-07-05 01:58:07.284 ScanBarWatch WatchKit Extension[980:19597]    Error - attempt to ask for row 1. Valid range is 0..0
2015-07-05 01:58:14.780 ScanBarWatch WatchKit Extension[980:19597] Error - attempt to …
Run Code Online (Sandbox Code Playgroud)

objective-c ios watchkit

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

StrongLoop ACL表不存在

我成功地从数据库中生成了所有模型。然后,我通过执行“ node”来运行api。我可以看到我所有的Web服务,但是当我尝试试用一项服务时,出现500错误,提示我没有ACL表。因此,我打开了model-config.json,发现之前没有创建过4个模型(用户,AccessToken,ACL,RoleMapping和Role)。我想知道数据库中是否必须存在所有这些模型。而且您知道我必须在每个表中放置哪些属性吗?预先谢谢你。

Error:
{
  "error": {
    "name": "Error",
    "status": 500,
    "message": "ER_NO_SUCH_TABLE: Table 'sed.ACL' doesn't exist",
    "code": "ER_NO_SUCH_TABLE",
    "errno": 1146,
    "sqlState": "42S02",
    "index": 0,
    "stack": "Error: ER_NO_SUCH_TABLE: Table 'sed.ACL' doesn't exist\n [...]"
  }
}
Run Code Online (Sandbox Code Playgroud)

acl node.js strongloop

4
推荐指数
2
解决办法
4347
查看次数

带节点的jsdoc生成空的index.html

我使用以下命令从javascript文件生成html.

$> jsdoc --debug jquery.js 
$> open out/index.html
Run Code Online (Sandbox Code Playgroud)

输出命令

DEBUG: JSDoc 3.3.2 (Sat, 13 Jun 2015 22:20:28 GMT)
DEBUG: Environment info: {"env":{"conf":{"tags":{"allowUnknownTags":true,"dictionaries":["jsdoc","closure"]},"templates":{"monospaceLinks":false,"cleverLinks":true},"source":{"includePattern":".+\\.js(doc)?$","excludePattern":"(^|\\/|\\\\)_"},"plugins":[]},"opts":{"_":["jquery.js"],"configure":"conf.json","debug":true,"destination":"./out/","encoding":"utf8"}}}
DEBUG: Parsing source files: ["/Users/darpandagha/jquery.js"]
Parsing /Users/darpandagha/jquery.js ...complete.
DEBUG: Finished parsing source files.
DEBUG: Indexing doclets...
DEBUG: Adding inherited symbols, mixins, and interface implementations...
DEBUG: Adding borrowed doclets...
DEBUG: Post-processing complete.
Generating output files...complete.
Finished running in 2.76 seconds.
Run Code Online (Sandbox Code Playgroud)

jsdoc jsdoc3

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

如何从Android中的TextView中删除最后一个字符?

我正在为一个类创建一个计算器应用程序,除了"BackSpace"按钮之外我还能正常工作.我在操作TextView时可以找到的唯一信息是使用SetText方法将TextView重置为null或只是一个空字符串.我需要做的是删除输入到计算器ex中的最后一个数字:如果输入数字12并按下退格按钮,它将删除2但是保留1.我决定只包括我的"onClick"方法作为与此问题相关的唯一方法,所有计算都是在另一种方法中完成的.谢谢!

 public void onClick(View v) {

        // display is assumed to be the TextView used for the Calculator display
        String currDisplayValue = display.getText().toString();

        Button b = (Button)v;  // We assume only buttons have onClickListeners for this App
        String label = b.getText().toString();  // read the label on the button clicked

        switch (v.getId())
        {
            case R.id.clear:
                calc.clear();
               display.setText("");
                //v.clear();
                break;
            case R.id.plus:
            case R.id.minus:
            case R.id.mult:
            case R.id.div:
                String operator = label;
                display.setText("");
                calc.update(operator, currDisplayValue);

                break;
            case R.id.equals:
              display.setText(calc.equalsCalculation(currDisplayValue));
                break;

            case R.id.backSpace: …
Run Code Online (Sandbox Code Playgroud)

java android textview

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

使用 perl 将 pdf 转换为文本

我有一个 pdf 文件,我想将其转换为文本文件。我在 Linux 命令行上尝试了 perl perl getpdftotext.exe fileName.pdf 但没有任何反应。我尝试过CPAN CAM::PDF但没有运气。

我收到错误 Use of uninitialized value in string eq at

C:/Strawberry/perl/site/lib/CAM/PDF.pm line 2362

并且输出文件为空。

我能够读取 pdf 文件中的页数。 my $num=$pdfone->numPages();返回正确的页数。我使用的是 Adob​​e Reader X 版本 10.1.4。我还尝试了一个渲染器,试图获取一页...第二个片段我也得到了错误未初始化值。我尝试过不同的pdf文件。我正在使用草莓 perl。

enter code here

use CAM::PDF;
use CAM::PDF::PageText;
use PDF::API2;
    my $pdfone = CAM::PDF->new('WFServlet.pdf');
    my $outfile = "pdfWFServeltRESULT.txt"; 
    my @lines;
    open (OUTF, ">$outfile") || die "Can not open $outfile";

    for my $page (1 .. $pdfone->numPages()) {
       my $text = $pdfone->getPageText($page);
       @lines = split …
Run Code Online (Sandbox Code Playgroud)

pdf perl text

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

Knockout.js AJAX Get

我是使用Knockout.js的新手,也是JavaScript的新手.我浏览了他们的教程,并尝试修改示例以从服务器加载数据,如下所示.任何人都可以指出我的代码有什么问题

JavaScript的:

jQuery(document).ready(function () {

    MyViewModel = function()
    {
        var self =this;
        self.name = ko.observable("");

        self.getJson = function()
        {
            jQuery.ajax({
                //Do all the work
                success: function(data)
                {
                    self.name = data.name;
                }              

            });
        }
    }

    myViewModelObj = new MyViewModel();
    ko.applyBindings(myViewModelObj);
    myViewModelObj.getJson();

});
Run Code Online (Sandbox Code Playgroud)

视图:

 <h1 data-bind="text: name "></h1>
Run Code Online (Sandbox Code Playgroud)

ajax knockout.js

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

Node-RED 在电子邮件节点中出现“登录失败”错误

我正在使用电子邮件节点连接到 gmail。我在节点上收到“错误 - 无效登录”。

在电子邮件节点中,我设置了以下参数:

To: email-i-want-to-email-to@anymail.com
Server: smtp.gmail.com
Port: 465 (which I believe is an SSL port as per the link below)
UserID: gmail-account  (or should this be gmail-account@gmail.com - I've tried both)
Password: the password on the "gmail-account"
Name: email out
Run Code Online (Sandbox Code Playgroud)

这符合我在以下论坛中找到的内容,但我收到了 https://productforums.google.com/forum/#!topic/gmail/IWiwVluINfs 关于为什么我会收到错误的建议?

email login runtime-error node-red ibm-cloud

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