小编Sha*_*hah的帖子

需要一些关于Grails Shiro Security的教程

嘿所有我需要一些很好的教程来演示grails shiro securty的所有方面,如何使用它们使用一些例子.我已经阅读了grails网站中解释的教程,但我需要一些带有示例的教程.请帮朋友......

等待一些积极的回应.

grails shiro

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

在iPhone中显示Gallery中的图像

我是iPhone的新手,现在是学习阶段的一天.实际上我想实现我读取存储在我的i​​Phone PHOTO Gallery中的图像,然后将其显示在我的应用程序上.

我在许多搜索引擎中搜索过但找不到任何东西.你们都是这里的专业人士.请指导我通过一些代码或一些教程.

非常感谢

iphone uiimageview

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

在iPhone中获取MD_5哈希文件

在我的项目中,我需要在iphone中获取该文件的MD_5哈希码.现在我已经找到以下代码来获取任何图像/任何文件的md_5.

 -(NSString *)getMD5FromString:(NSString *)source{
    const char *src = [source UTF8String];
    unsigned char result[CC_MD5_DIGEST_LENGTH];
    CC_MD5(src, strlen(src), result);
    return [[NSString
    stringWithFormat: @"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
        result[0], result[1],
        result[2], result[3],
        result[4], result[5],
        result[6], result[7],
        result[8], result[9],
        result[10], result[11],
        result[12], result[13],
        result[14], result[15]
        ]lowercaseString];
  }
Run Code Online (Sandbox Code Playgroud)

使用此代码获取图像的ByteContent,然后获取该图像字节数组字符串的md_5

 UIImage *image = [UIImage imageNamed:@"sf_small.png"];
 NSData *data = UIImagePNGRepresentation(image);
 NSString *str = [NSString stringWithFormat:@"%@",data];
 NSString *temp = [self getMD5FromString:str];
Run Code Online (Sandbox Code Playgroud)

现在我成功地获得了哈希码但是当我在网络端获得相同文件的md_5哈希码时它会给我不同的哈希码.在Web端我正在使用PHP代码

 md5_file(string $filename);
Run Code Online (Sandbox Code Playgroud)

这个PHP代码给了我不同的哈希码和iphone代码给了我相同图像的不同哈希码.请告诉我可能是什么问题..

非常感谢!

tic.png

iphone md5

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

睡眠或暂停NSThread

我正在创建一个新的Thread,它会在每一段时间后运行我的一个方法.

现在我正在做的如下:

NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(setUpTimerThread) object:nil];
 [thread start];
Run Code Online (Sandbox Code Playgroud)

上面的方法调用我的setUpTimerThraed方法,这个方法生成一个NSTimer并在每1分钟后调用一个特定的方法,即syncData.现在我想要的是我的同步数据方法是将一些文件发送到FTP文件夹.什么时候它发送一个文件到FTP我想让我的"线程"睡一会儿.

我用过

[NSThread sleepForTimeInterval:3.0];
Run Code Online (Sandbox Code Playgroud)

但是这段代码阻止了我的应用主线程.有什么方法我只能睡一段时间我的"线程"线程,以便它不会停止我的应用程序响应3秒,并没有睡觉我的主线程.希望你得到我要问的人.请帮忙?

nsthread ipad

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

Google Places iOS-无法加载搜索结果

我在我的iOS项目中使用了Google Places API的GMSAutoCompleteViewController。

今天突然,我的GMSAutoCompleteViewController继续给我错误“无法加载搜索结果”。

我已经使用新的API密钥重新生成了我的API密钥。我已经尝试了所有方法,但是仍然有些方法不起作用。

我正在使用Objective-C。有人可以帮忙吗?

GMSAutocompleteViewController *acController = [[GMSAutocompleteViewController alloc] init];
    acController.delegate = self;
[self.navigationController pushViewController:acController animated:YES];
Run Code Online (Sandbox Code Playgroud)

委托方法

- (void)viewController:(GMSAutocompleteViewController *)viewController
                didAutocompleteWithPlace:(GMSPlace *)place {
    // Do something with the selected place.
    NSLog(@"Place name %@", place.name);
    NSLog(@"Place address %@", place.formattedAddress);
    NSLog(@"Place attributions %@", place.attributions.string);
    NSLog(@"Latitude = %.20f",place.coordinate.latitude);
    NSLog(@"Longitude = %.20f",place.coordinate.longitude);
    NSLog(@"Type = %@",place.types);
    NSLog(@"Place ID = %@",place.placeID);
    //[self dismissViewControllerAnimated:YES completion:nil];
    [self.navigationController popViewControllerAnimated:YES];

    /* Call and API in background to get the address according to the new LAT AND LONG …
Run Code Online (Sandbox Code Playgroud)

google-maps ios google-places-api gmsautocomplete

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

在相机中添加相机的缩放控件

我正在制作一个Camera应用程序,我在其中使用Surface View进行相机和所有其他工作.我从以下链接中获取了指南.

http://www.brighthub.com/mobile/google-android/articles/43414.aspx

现在一切正常,但问题是我无法在相机中看到任何变焦控制和亮度控制.如何设定请指导我.

提前致谢

camera android

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

在加载根导航控制器 - iPhone之前显示启动画面

我是iPhone的新宠.在加载UIViewController之前,我已经使用了一些教程,一个启动画面.现在我想在我的应用程序中实现一个NavigationController,并希望在它之前显示一个Splash Screen.因为我是Iphone的新手,所以在加载根导航控制器之前我没有得到任何tutotrials或指南来制作启动画面.

我见过很多方法,他们过度编写Default.png文件等等.我不想实现那个.我想要一个sperate UIView在其中包含我的自定义图像和文本,并将UI视图显示为启动画面

任何人都可以指导我.

提前致谢

iphone

3
推荐指数
2
解决办法
3176
查看次数

android中的ksoap2在多数组数据检索中的应用

实际上我有一个搜索员工的服务..该服务给我的结果是多个数组形式,如:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
  <ns1:searchResponse xmlns:ns1="urn:abcdwsdl">
 <return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType=":[6]">
    <item xsi:type="xsd:string">success</item>
    <item xsi:type="xsd:string">Search results retrieved for *</item>
    <item xsi:type="xsd:">
       <item>
          <ad_id xsi:type="xsd:string">2</ad_id>
          <fname xsi:type="xsd:string">abcr</ad_text>
          <lname xsi:type="xsd:string">def</location>
          <phone xsi:type="xsd:float">123456</lati>
          <address xsi:type="xsd:float">America</longi>
       </item>
       <item>
          <ad_id xsi:type="xsd:string">12</ad_id>
          <fnamet xsi:type="xsd:string">test user</ad_text>
          <lname xsi:type="xsd:string">hello</location>
          <phone xsi:type="xsd:float">987654543</lati>
          <address xsi:type="xsd:float">England</longi>
       </item>
    </item>
    <item xsi:type="xsd:int">2</item>
    <item xsi:type="xsd:int">0</item>
    <item xsi:type="xsd:int">0</item>
 </return>
  </ns1:searchResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>  
Run Code Online (Sandbox Code Playgroud)

现在我添加了以下代码:

androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject result=(SoapObject) envelope.getResponse();
Run Code Online (Sandbox Code Playgroud)

但是getResponse给了我以下错误:

in catch
java.lang.ClassCastException: java.util.Vector
at org.test.search.FirstActivity.loginMethod(FirstActivity.java:74)
 at org.test.search.FirstActivity.onCreate(FirstActivity.java:26)
 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
 at …
Run Code Online (Sandbox Code Playgroud)

android web-services ksoap2

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

android中的onKeyDown方法覆盖

大家好我的应用程序有问题,请参阅下面的代码以供参考.我面临的问题是当我从我的模拟器中点击后退键按钮时,我希望我的应用程序问我你确定要退出.当我按是然后它应该退出否则它不应该退出.我做了所有的事情,但当我点击后退键按钮时,它会显示一个对话框并自动退出.什么原因

码:

@Override
public boolean onKeyDown(int keyCode, KeyEvent event)  {
    if (keyCode == KeyEvent.KEYCODE_BACK) {

    AlertDialog.Builder alert_wifi = new AlertDialog.Builder(this);
            alert_wifi.setMessage("This is a Wi-Fi Service. Your Device does not have an active Wi-Fi Connection. Do you Want to Activate Wi-Fi Connection")
            .setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                // Action for 'Yes' Button

                    dialog.dismiss();

                 ViewCamera.isStop = true;

                }
                })
            .setNegativeButton("No", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                //  Action for 'NO' Button
                dialog.cancel(); …
Run Code Online (Sandbox Code Playgroud)

android

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

隐藏/背景电子邮件在Android中发送

我如何从我的android应用程序发送电子邮件.请指导我一点点我使用的代码

 final Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
         emailIntent.setType("plain/text");
         emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, "email@abc.com");
         emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Subject");
         emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Email-Content");
    SpeedAlert.this.startActivity(Intent.createChooser(emailIntent, "Send mail..."));
Run Code Online (Sandbox Code Playgroud)

但这给了我错误:"没有应用程序可以执行此操作"

如何从我的应用程序发送电子邮件请指导.实际上我希望我的应用程序隐藏地发送电子邮件.修复身体内容和主题

谢谢等待一些积极的回应.

android

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