问题列表 - 第39046页

Mac - 添加CoreGraphics.framework,用于C头中的CG

需要Xcode 3.25,Mac OS X 10.6,10.5兼容性.

我有一个Mac Xcode项目,它混合了Cocoa和C/C++.某些传统模块需要仅限C的标头.

我创建了一个C头文件:myCTypes.h

我希望在该标题中使用CGPoint.

编译会生成错误:未定义CGPoint.好的,没问题,所以我只会:

#include: "<CoreGraphics/CoreGraphics.h>"
Run Code Online (Sandbox Code Playgroud)

不幸的是,我得到了这个:

error: CoreGraphics/CoreGraphics.h: No such file or directory
Run Code Online (Sandbox Code Playgroud)

嗯.好的,所以我最好添加框架.但是,如果我右键单击Xco​​de中的框架组,并尝试"添加现有框架",CoreGraphics不会显示在列表中.格儿.

所以我尝试手动添加它,导航到System/Library/Frameworks.Nup,也不在那里.

所以我查看10.5 SDK路径,再一次,那里有很多CoreXXX框架,但没有CoreGraphics.framework.

有人可以告诉我这里我做错了什么吗?在标题中我需要使用CGGraphics吗?干杯.

编辑

这解决了:

#include <Carbon/Carbon.h>
Run Code Online (Sandbox Code Playgroud)

(但如果有人想告诉我这是不是很好的做法,请随意.干杯.)

macos xcode header core-graphics

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

Chrome扩展程序oAuth请求重定向页面未加载

我正在开发与Google日历互动的Chrome扩展程序.我已经开源了,代码可以在GitHub上找到:https://github.com/joshholat/Add-to-Calendar-Chrome-Extension

它需要使用Google的oAuth进行授权才能编辑用户日历.直到最近,这工作正常.然而,有一天它出于某种原因停止了工作.当我执行以下代码时,它会从oauth打开一个新选项卡,该选项卡应该请求权限,但页面永远不会加载,而是冻结"重定向...".因此,我无法授权和测试我的代码.

想法?

var oauth = ChromeExOAuth.initBackgroundPage({
 'request_url': 'https://www.google.com/accounts/OAuthGetRequestToken',
 'authorize_url': 'https://www.google.com/accounts/OAuthAuthorizeToken',
 'access_url': 'https://www.google.com/accounts/OAuthGetAccessToken',
 'consumer_key': 'anonymous',
 'consumer_secret': 'anonymous',
 'scope': 'http://www.google.com/calendar/feeds/',
 'app_name': 'Add Events to Google Calendar'
Run Code Online (Sandbox Code Playgroud)

});

oauth.authorize(function(){alert("auth");});

google-chrome oauth google-chrome-extension

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

如何处理dwg文件

我想用代码来分析dwg文件.任何人都知道任何SDK工具开始?

autocad dwg

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

Java中的高级递归

我只是无法得到递归的悬念,尤其是复杂的例子.如果有人花些时间解释一下,我真的很感激.我确实有4张纸都跟我一起追踪这个功能,但我不知道怎么把它放在一起.

public static String shortestPath(int x, int y, int tX, int tY,boolean blocked[][]) {

        if(x>blocked.length-1 || y>blocked[0].length-1 || x<0 || y<0 )
            return null;
        if(blocked[x][y]==true)
            return null;
        if(x==tX && y==tY)
            return "";

        String paths[]=new String[4];
        blocked[x][y]=true; //this just means this coordinate is blocked, so dont use it
        paths[0]=shortestPath(x, y+1, tX, tY, blocked);
        paths[1]=shortestPath(x, y-1, tX, tY, blocked);
        paths[2]=shortestPath(x+1, y, tX, tY, blocked);
        paths[3]=shortestPath(x-1, y, tX, tY, blocked);
        blocked[x][y] = false;
        int result=findShortestString(paths, 0, 3); 
//findShortestString just takes an array of …
Run Code Online (Sandbox Code Playgroud)

java algorithm recursion

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

在带有Vectors的Flash Player 10中,为什么还要使用Arrays呢?

如果您的目标是Flash Player 10,是否有理由坚持使用Arrays作为AS3中的默认列表数据结构?为什么不在整个程序中使用Vectors(类型化数组)作为默认值,因为它们是:

  • 快点
  • 类型检查

它是否表现不佳或导致更高的内存开销?有没有理由再使用数组了?

arrays flash types vector actionscript-3

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

在c#中写入制表符分隔的csv文件

我目前正在使用C#开发一个应用程序,我需要从它从MySQL数据库中检索的数据中编写一个制表符分隔的CSV文件.数据库检索工作正常.

我遇到的问题是写文件.在我写的每个变量之间,我正在使用\ t,我认为将标签放入csv中,因此当在excel中打开时,每个变量都将在其自己的单元格中.

但是由于某种原因,它不是这样做的,它只是将整行写为一个长字符串.下面是我编写的代码示例:

while (reader.Read())
{
    int bankID = reader.GetInt16("ban_bankID");
    int userID = reader.GetInt16("ban_userID");
    string bankUsername = reader.GetString("ban_username");
    string accountName = reader.GetString("ban_accountName");
    string accountType = reader.GetString("ban_accountType");
    decimal overdraft = reader.GetDecimal("ban_overdraft");
    char defaultAccount = reader.GetChar("ban_defaultAccount");

    string line = bankID + "\t" + userID + "\t" + bankUsername + "\t" + accountName + "\t"
              + accountType + "\t" + overdraft + "\t" + defaultAccount + "\n";

    tw.WriteLine(line);
Run Code Online (Sandbox Code Playgroud)

感谢您对此问题的帮助.

c#

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

如何调整ArrayList的大小

我来自C++背景,我希望有一个矩阵

ArrayList<arrayList<E>> javamatrix 
Run Code Online (Sandbox Code Playgroud)

在C++中我会这样做

std::vector<std::vector<T> > cppmatrix;
std::vector<T>vcol(cols);
cppmatrix.resize(rows,vcol);
Run Code Online (Sandbox Code Playgroud)

我似乎无法为此任务找到内置resize()函数ArrayLists,所以我应该使用另一个集合吗?除了使用for循环外,没办法做到这一点javamatrix.add()吗?


PS我想在构造函数中初始化它的大小,因为在编辑元素或添加或删除之前可能会查询该大小.

java arraylist matrix

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

Powershell Get-WebSite名称参数被忽略

我想使用PowerShell Get-Website cmdlet检索有关特定IIS 7网站的信息.不幸的是,无论我传入的-Name参数如何,Get-Website都会返回所有网站的信息.似乎忽略了-Name参数.

例如,如果我使用:

Import-Module WebAdministration
Get-Website -Name "Test Website"
Run Code Online (Sandbox Code Playgroud)

我将收到我机器上所有网站的信息:

Name             ID   State      Physical Path                  Bindings
----             --   -----      -------------                  --------
Default Web Site 1    Started    %SystemDrive%\inetpub\wwwroot  http *:80:
                                                                net.tcp 808:*
                                                                net.pipe *
                                                                net.msmq localhost
                                                                msmq.formatname localhost
Test Website     2    Started    C:\websites\test               http *:80:test.mydomain.com
Run Code Online (Sandbox Code Playgroud)

根据文档,Get-Website应返回-Name参数中指定的网站的信息.我必须误解文档或滥用cmdlet,或两者兼而有之.

我应该如何使用Get-Website返回特定网站的信息?

powershell iis-7 windows-7

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

在Python中,'urllib库'和'套接字库'之间有什么区别?

我正在学习网络编程基础知识,有一个问题我不知道如何在我的任务中回答.

'urllib库'与Python中的'套接字库'有什么不同?我怎么能清楚地解释清楚?

python sockets urllib

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

无法使用Javascript更改<button>的"type"

在Chromium 7.0.517.44(64615)Ubuntu 10.10上,我似乎无法更改元素的type属性<button>:

> blah = document.createElement("button")
  <button>?</button>?
> blah.type
  "submit"
> blah.type = "button"
  "button"
> blah.type
  "submit"
Run Code Online (Sandbox Code Playgroud)

救命?


在Firefox 3.6.12和Opera 10.63上,它工作正常:

>>> blah = document.createElement("button")
    <button>
>>> blah.type
    "submit"
>>> blah.type = "button"
    "button"
>>> blah.type
    "button"
Run Code Online (Sandbox Code Playgroud)

html javascript dom google-chrome

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