小编Mas*_*ard的帖子

命令行C程序到Swift

我有一个命令行的源代码C game,等待用户stdin和输出stdout.我想从文本字段输入main到此C代码的输入,并在文本区域字段中输出例如.

int mainer(int argc, char **argv) {
    int i;
    int hitme;
    char ch;
    prelim();

    if (argc > 1) { // look for -f option
        if (strcmp(argv[1], "-f")== 0) {
            coordfixed = 1;
            argc--;
            argv++;
        }
    }


    if (argc > 1) {
        fromcommandline = 1;
        line[0] = '\0';
        while (--argc > 0) {
            strcat(line, *(++argv));
            strcat(line, " ");
        }
    }
    else fromcommandline = 0;
 // some other code

}
Run Code Online (Sandbox Code Playgroud)

从 …

c command-line-interface ios swift

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

从模态视图到标签栏视图控制器,不会丢失标签栏

你好我试图从一个模态到标签栏视图控制器,而不会丢失标签栏?我知道问题很简短,但这就是我要问的问题.

场景:我有一个Tab Bar视图控制器,A和B. B模态到C视图控制器.然后我想返回View Controller A.

斯威夫特请:D

uistoryboard segue swift

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

暹罗网络输出

我正在尝试在caffe中实现一个暹罗网络,它由两个不共享权重的图像网组成.所以我基本上要做的就是给每个网络一个图像,最后试着找出它们之间的相似距离,下面是我的原型.所以我的主要问题是我应该如何设置"num_output"呢?我的训练只有2个课程,0个不同,他们不相同,1个是相似的.

name: "Siamese_ImageNet"
layers {
  name: "data"
  type: IMAGE_DATA
  top: "data"
  top: "label"
  image_data_param {
    source: "train1.txt"
    batch_size: 32
    new_height: 256
    new_width: 256
  }
  include: { phase: TRAIN }
}
layers {
  name: "data"
  type: IMAGE_DATA
  top: "data"
  top: "label"
  image_data_param {
    source: "test1.txt"
    batch_size: 32
    new_height: 256
    new_width: 256
  }
  include: { phase: TEST }
}

layers {
  name: "data_p"
  type: IMAGE_DATA
  top: "data_p"
  top: "label_p"
  image_data_param {
    source: "train2.txt"
    batch_size: 32
    new_height: 256
    new_width: 256
  }
  include: { …
Run Code Online (Sandbox Code Playgroud)

machine-learning computer-vision neural-network deep-learning caffe

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

保护KML文件免于下载或访问

我试图保护我的KML文件,免于下载或轻松提取其数据.我想要的只是在google maps或google earth中查看的文件,但不允许任何人下载它或"轻松"提取数据(kml文件不会公开发布).我的kml文件是深度和独家分析的结果,这是我想要隐藏竞争对手的签名.

还有任何替代方法可以将kml转换为无法从中轻松获取数据的格式.我的KML文件包含3D多边形.

我理解可以看到的所有内容的概念都可以以某种方式下载或提取,

security google-maps data-protection kml google-earth

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

numpy python上的反向对角线

让我说我有这个:( numpy数组)

a=
[0  1  2  3],
[4  5  6  7],
[8  9 10  11]
Run Code Online (Sandbox Code Playgroud)

得到[1,1]即5,其对角线为零; 根据numpy , a.diagonal(0)= [0,5,10]. 如何获得[1,1]的反向或右对角线[2,5,8]?这可能吗?我原来的问题是8乘8(0:7)..我希望有所帮助

python numpy

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

如何从AFNETWORKING POST获取参数

如何从Swift获取参数值,文件上传已经有效,我已经尝试了$ _GET ["familyId"],但它没有用?

迅速:

    let manager = AFHTTPRequestOperationManager()
    let url = "http://localhost/test/upload.php"
    var fileURL = NSURL.fileURLWithPath(NSBundle.mainBundle().pathForResource("test_1", ofType: "mov")!)
    var params = [
        "familyId":locationd,
        "contentBody" : "Some body content for the test application",
        "name" : "the name/title",
        "typeOfContent":"photo"
    ]

    manager.POST( url, parameters: params,
        constructingBodyWithBlock: { (data: AFMultipartFormData!) in
            println("")
            var res = data.appendPartWithFileURL(fileURL, name: "fileToUpload", error: nil)
            println("was file added properly to the body? \(res)")
        },
        success: { (operation: AFHTTPRequestOperation!, responseObject: AnyObject!) in
            println("Yes thies was a success")
        },
        failure: { …
Run Code Online (Sandbox Code Playgroud)

php afnetworking swift

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

使用AFNetworking从AVCapture上传文件

我有一个用AVCapture捕获的视频,我正在尝试使用Swift上传AFNetworking.

码:

let manager = AFHTTPRequestOperationManager()
let url = "http://localhost/test/upload.php"
var fileURL = NSURL.fileURLWithPath(string: ViewControllerVideoPath)
var params = [
    "familyId":locationd,
    "contentBody" : "Some body content for the test application",
    "name" : "the name/title",
    "typeOfContent":"photo"
]

manager.POST( url, parameters: params,
    constructingBodyWithBlock: { (data: AFMultipartFormData!) in
        println("")
        var res = data.appendPartWithFileURL(fileURL, name: "fileToUpload", error: nil)
        println("was file added properly to the body? \(res)")
    },
    success: { (operation: AFHTTPRequestOperation!, responseObject: AnyObject!) in
        println("Yes thies was a success")
    },
    failure: { (operation: AFHTTPRequestOperation!, error: …
Run Code Online (Sandbox Code Playgroud)

ios avcam afnetworking swift

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

从数据生成器返回3个图像

我试图使用我的数据生成器传递给我的三重网络3图像.我正在加载不同的对并将它们堆叠成批.我不知道如何将它作为3个不同的数组返回.我尝试附加到列表中,但这也没有用.如何使用数据生成器将其返回?

class DataGenerator(keras.utils.Sequence):
    'Generates data for Keras'
    def __init__(self, list_IDs, batch_size=16, dim=(244,244,3), n_channels=3, shuffle=True):
        'Initialization'
        self.dim = dim
        self.batch_size = batch_size
        self.list_IDs = list_IDs
        self.n_channels = n_channels
        self.shuffle = shuffle
        self.on_epoch_end()

    def __len__(self):
        'Denotes the number of batches per epoch'
        return int(np.floor(len(self.list_IDs) / self.batch_size))

    def __getitem__(self, index):
        'Generate one batch of data'
        # Generate indexes of the batch
        indexes = self.indexes[index*self.batch_size:(index+1)*self.batch_size]

        # Find list of IDs
        list_IDs_temp = [self.list_IDs[k] for k in indexes]

        # Generate data
        X,Z, y = self.__data_generation(list_IDs_temp) …
Run Code Online (Sandbox Code Playgroud)

python keras tensorflow

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

特定输入的多个指标

无论是自定义的还是从 keras 导入的,我都有多个损失和指标。有没有办法指定哪些模型输出可以输入到哪个指标而不是全部打印或计算?

python keras tensorflow

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

我是否需要将Python交叉编译为ARM?

我的Python代码适用于运行Ubuntu的32位intel机器,我需要在Raspberry Pi上运行此代码.我需要某种交叉编译吗?我有python中包含的32位.so文件.

python ctype cross-compiling raspberry-pi

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