小编Fac*_*les的帖子

LruCache不工作

    final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
    final int cacheSize = maxMemory / 8;
    mMemoryCache = new LruCache<String, Bitmap>(cacheSize) {
            @Override
            protected int sizeOf(String key, Bitmap bitmap) {
                // The cache size will be measured in kilobytes rather than
                // number of items.
                return bitmap.getByteCount() / 1024;
            }
        };
    URL url = new URL("http://s2.goodfon.ru/image/260463-1920x1200.jpg");
    Bitmap bitmap = BitmapFactory.decodeStream((InputStream) url.getContent(), null, options);
    if(bitmap != null)
        Log.i("Success", "BITMAP IS NOT NULL");

    String key = "myKey";
    Log.i("Get is null", "putting myKey");
    mMemoryCache.put(key, …
Run Code Online (Sandbox Code Playgroud)

android android-lru-cache

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

Yii findAllByAttributes LIMIT

你好,我有代码

$allLogins = IpAddressLogin::model()->findAllByAttributes(
    array(
        'user_id' => Yii::app()->user->id,
        'type' => 'user'
    ),
    array(
        'order' => 'date desc',
        'limit' => '15, 10',
    ));
Run Code Online (Sandbox Code Playgroud)

我想从15号记录中获得10条记录.但它只给了我最后15条记录.
它仅解析'limit'中的第一个数字(15).如何在findAllByAttributes中设置LIMIT 15,10?

yii

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

PayPal IPN安全验证

有PayPal IPN PHP示例代码https://www.x.com/developers/PayPal/documentation-tools/code-sample/216623

有人可以告诉我它是如何安全的,因为我没有得到它?

示例:我有一家网店.我没有https.

  1. 在我们的http://my-magazine.com/process_pp.php上从PayPal接收数据 此数据未加密,因为我的网站位于http.我对吗?所以(如果它没有加密)一些黑客可以改变它.
  2. 我们发送https请求以验证我们在paypal上的付款.
  3. PayPal使用http(而不是https)回答INVALID,因此黑客可以在VERIFIED上再次更改它.黑客获利.

请告诉我,我的错误在哪里.我很困惑,因为其他支付系统使用SecretKey,然后你应该验证他们发送的哈希.

php payment https paypal paypal-ipn

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

标签 统计

android ×1

android-lru-cache ×1

https ×1

payment ×1

paypal ×1

paypal-ipn ×1

php ×1

yii ×1