我想知道如何使用UIImagePickerController打开iPhone 4上的相机闪光灯.
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerCameraDeviceFront] == YES)
{
/// What code here ///
}
else
{
NoFlash = [[UIAlertView alloc] initWithTitle:@"Uh-Oh"
message:@"Your device doesn't have a flash camera"
delegate:nil
cancelButtonTitle:@"mhmm, OK"
otherButtonTitles:nil];
NoFlash.delegate = self;
[NoFlash show];
[NoFlash release];
}
Run Code Online (Sandbox Code Playgroud)
}
我已经在这里阅读了UIImagePickerController类参考网页:http://bit.ly/cdAhhB但我找不到答案.有人可以帮帮我吗?
谢谢
我正在构建一个系统,它需要能够找到是否已更新blob字节.我认为我应该计算它的校验和,存储它并稍后计算相同的校验和,以查看博客是否已更新,而不是存储整个blob(它们可以高达5MB).
目标是最小化以下(按此顺序):
我们的系统碰撞不超过1/1,000,000是可以接受的.问题不在于安全性,而在于更新/错误检测,因此罕见的冲突是可以的.(这就是为什么我把它放在最小化的东西中).
另外,我们不能自己修改文本的blob.
当然,md5
,crc
或sha1
浮现在脑海中,如果我想要一个快速的解决方案,我去了.然而,不仅仅是一个快速的解决方案,我正在寻找可以比较不同方法以及利弊的东西.
我刚刚安装了DXperienceXaf-10.1.7,但控件没有出现在VS 2010工具箱中,它们也没有显示在VS 2008工具箱中.我从"开始菜单"快捷方式运行ToolboxCreator无济于事.这是在Windows 7上.
有没有解决这个问题?如果没有,我该如何手动添加它们?好像有很多dll文件.
什么是C++等价物java.lang.Object x = new Foo()
?
假设您正在使用Chrome,当我按下Cmd + F或Ctrl + F时...我输入一个字符,它会搜索整个页面并为我突出显示该文本.它立即搜索.Chrome使用什么样的算法?为什么它可以这么快打字和搜索?有什么想法吗?谢谢.
我有一个文本文件,包含如下内容:
12,34 EUR
5,67 EUR
...
Run Code Online (Sandbox Code Playgroud)
在'EUR'之前有一个空格,我忽略0,XX EUR.
我试过了:
grep '[1-9][0-9]*,[0-9]\{2\}\sEUR' => didn't match !
grep '[1-9][0-9]*,[0-9]\{2\} EUR' => worked !
grep '[1-9][0-9]*,[0-9]\{2\}\s*EUR' => worked !
grep '[1-9][0-9]*,[0-9]\{2\}\s[E]UR' => worked !
有人可以解释我请,我为什么不能用\s
,但\s*
和\s[E]
匹配?
操作系统:Ubuntu 10.04,grep v2.5
在类构造函数中,我尝试使用:
if(theObject != null)
this = theObject;
Run Code Online (Sandbox Code Playgroud)
我搜索了数据库,如果记录存在,我使用theObject
的Hibernate查询生成.
为什么我不能使用this
?
我收到提示:连接必须是有效和打开,当我启动该程序.我搜索谷歌和只发现2人有相同的错误.有可能解决这个问题吗?谢谢
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Data.Odbc;
using System.Data.Sql;
namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
string connectionString = "Server=localhost;Uid=root;Pwd=******;Database=testing;";
MySql.Data.MySqlClient.MySqlConnection connection = new MySql.Data.MySqlClient.MySqlConnection(connectionString);
connection.Open();
string insertQuery = "ALTER TABLE `user` ADD lol INT";
MySql.Data.MySqlClient.MySqlCommand myCommand = new MySql.Data.MySqlClient.MySqlCommand(insertQuery);
myCommand.ExecuteNonQuery();
connection.Close();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Run Code Online (Sandbox Code Playgroud) 最近我和我的团队得到了一个用于版本控制的HG存储库,因为这样可以更容易,更好地开发我们的应用程序.
我们正在使用Visual Studio 2010和c#
所有项目都受版本控制..
不幸的是,当我们其中一个人提交时,通常另一个人在打开解决方案时会遇到某种错误(由于VS有各种文件)
我的问题是:应该在版本控制下放置哪些文件?(并在我的情况下删除!)
PS:我们有3个项目:(使用XNA)游戏,内容,测试
非常感谢你!!!
担
c# version-control mercurial projects-and-solutions visual-studio-2010