小编oki*_*pol的帖子

Linux上的C blueZ蓝牙配对

我找不到任何关于如何在Linux上使用BlueZ蓝牙库在用C编写的程序中配对蓝牙设备的参考.我已经设法进行HCI级别查询以获取设备及其RSSI级别(在设备发现期间),但目前我仍然坚持这一点.我看到了使用DBUS api for blueZ-simple-agent的建议 - 但是有什么方法可以避免这种情况并且只使用BlueZ的一些C级方法吗?

c linux bluetooth bluez

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

GoogleMaps基本的iOS演示应用程序崩溃 - 无法识别的选择器发送到实例

我试图运行基本的iOS演示SDK代码.我已经创建了API密钥并且加载正常.虽然我已经将viewDidLoad中的代码转移到了loadView,但效果仍然存在.请参阅以下代码

-(void)loadView{
    // Create a GMSCameraPosition that tells the map to display the
    // coordinate -33.86,151.20 at zoom level 6.
    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
                                                        longitude:151.20
                                                             zoom:6];
    _mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];

    _mapView.myLocationEnabled = YES;
    self.view = _mapView;

    // Creates a marker in the center of the map.
    GMSMarker *marker = [[GMSMarker alloc] init];
    marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
    marker.title = @"Sydney";
    marker.snippet = @"Australia";
    marker.map = _mapView;
}
Run Code Online (Sandbox Code Playgroud)

相机已创建,但执行此行时

_mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
Run Code Online (Sandbox Code Playgroud)

使用描述抛出NSException - > - [GMSMapView animateToCameraPosition:]:发送到实例的无法识别的选择器. …

google-maps ios google-maps-sdk-ios

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

Wix安装路径注册表值赋值 - 有什么问题?

我有一个WIX安装程序.我尝试添加一个注册表项,具体取决于安装路径(VS Installer easy),在这种情况下认为这将是一块蛋糕......这是我的WIX XML:

<Feature Id="ProductFeature" Title="ChessBarInfoSetup" Level="1">
        <!--<ComponentGroupRef Id="ProductComponents" />-->
  <ComponentRef Id='InstallRegistryComponent' />
  <ComponentRef Id='ProductComponent' />
    </Feature>
</Product>

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
    <Directory Id="ManufacturerFolder" Name="$(var.manufacturer)">
      <Directory Id="INSTALLFOLDER" Name="$(var.productName)">

        <!--<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">-->
          <Component Id="InstallRegistryComponent" Guid="*">
            <RegistryKey Id='ChessInfoBarInstallDir' Root='HKLM' Key='Software\[Manufacturer]\[ProductName]' Action='createAndRemoveOnUninstall'>
              <RegistryValue Type='string' Name='InstallDir' Value="[INSTALLDIR]" Action="write" KeyPath="yes" />
              <!--<RegistryValue Type='integer' Name='Flag' Value='0'/>-->
            </RegistryKey>
          </Component>
          <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
          <Component Id="ProductComponent" Guid="*"> …
Run Code Online (Sandbox Code Playgroud)

xml windows-installer wix

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

AVPlayerLayer在进入后台时处于隐藏控制器并进入前景并显示后为空白

我有一个App,其中我使用AVPlayerLayer(在UIView的子类中使用,就像Apples AV Foundation Programming Guide一样).我在视图控制器中保存了几个视图控制器,它们对于菜单是可靠的(使用JASidePanels).问题如下:

一切正常,直到AVPlayers的视图控制器不被隐藏(呈现其他一些视图)并且应用程序进入后台,再次返回并返回视图.这会导致AVPlayerLayer显示空白/透明.该项目已加载,我可以尝试播放它确实播放但没有看到视频.

这种行为的解决方案是什么(以及它的原因是什么)?Thx提前.

calayer ios avplayer avplayerlayer

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

Youtube下载链接来自http://www.youtube-mp3.org/

我一直在使用http://www.youtube-mp3.org/来获取"互联网广播"项目(下载文件流并输出)的mp3歌曲的下载链接.最近http://www.youtube-mp3.org/似乎改变了它的工作流程.直到现在我能够获得正确的网址格式:

http://www.youtube-mp3.org/get?ab=128&video_id=KMU0tzLwhbE&h=5671e7d33d4eccb5b89ea8f54d9911d4&r=1387110278658.1527580295

而r =时间戳我把自己的时间戳作为时代.这没有.1527580295后缀,效果很好.不幸的是,这似乎是必需的,因为没有后缀的链接会重定向回转换站点.

到目前为止,算法如上所述:

Youtube mp3 org linq获得解释

http://www.youtube-mp3.org/api/itemInfo/?video_id=#{video_id}&ac=www&r=#{Time.now.to_i}

有没有人知道如何获得后缀部分?

//嘿,我不是一个网络编程人员...但这是我肯定忽略的.谢谢!

将其添加到我的小型C#API中.

  <!-- language: c# -->
    const int AM = 65521;
    int GetCCSufix(string a)
    {            
        int c = 1, b = 0, d, e;
        var chars = a.ToCharArray();
        for(e =0; e< chars.Length; e ++)
        {
            d = chars[e];
            c = (c + d) % AM;
            b = (b + c) % AM;
        }
        return b << 16 | c;
    }
Run Code Online (Sandbox Code Playgroud)

效果很好;)

youtube api mp3 download

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