Вывод собственного меню в фрагменте

You need to use menu.clear() before inflating menus.

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        menu.clear();
        inflater.inflate(R.menu.menu, menu);
        super.onCreateOptionsMenu(menu, inflater);
    }

and

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setHasOptionsMenu(true);
    }

How to add Options Menu to Fragment in Android — Stack Overflow

Создания скриншотов для AppStore

Для подключения iTunes допустимы следующие разрешения:

  • iPhone 3 + 4 (3,5 дюйма)
    • 640 х 960
  • iPhone 5, iPhone 5S, iPhone 5C (4 дюйма)
    • 640 х 1136
  • iPhone 6, iPhone 6S, iPhone 7, iPhone 8 (4,7 дюйма)
    • 750 х 1334
  • iPhone 6 Plus, iPhone 6S Plus, iPhone 7 Plus, iPhone 8 Plus (5,5 дюймов)
    • 1242 x 2208
    • Вам нужен скриншот в этом разрешении, телефон масштабирует их до 1080 х 1920
  • iPhone X (5,8 дюйма)
    • 1125 x 2436
  • iPhone XR (6,1 дюйма)
    • 828 х 1792
  • iPhone XS (5,8 дюйма)
    • 1125 x 2436
Читать далее «Создания скриншотов для AppStore»

PLV8 для Postgres 12

Если пытаться установить на Ubuntu 20.04 postgresql-plv8, то будет ошибка, что пакет не найден.

Для установки данного расширения на указанную выше ОС нужно собрать этот пакет вручную.

$ wget https://github.com/plv8/plv8/archive/v3.0.0.tar.gz
$ tar -xvzf v3.0.0.tar.gz
$ cd plv8-3.0.0
$ make

Возможные проблемы:

Нужно проверить если все эти программы, если нет, то установить:

Git
g++ or clang++
Python 2 (for v8)
pkg-config (linux only for v8)
libc++-dev (linux only)
libc++abi-dev (linux only)
libglib2.0-dev (ubuntu 20.04)
libtinfo5 (ubuntu 20.04)
ninja-build (ubuntu arm64)
  • Может отсутствовать make (apt install make)
  • Не будет ссылки на python
/usr/bin/env: ‘python’: No such file or directory

Устанавливаем python второй версии:

sudo apt install python2

И настраиваем ссылку:

sudo ln -s /usr/bin/python2 /usr/bin/python
sudo apt install postgresql-server-dev-12

Официальный сайт: PLV8 Documentation

Деобфускация кода exception в Firebase Crashlytics после падения приложения

Чтобы сделать код исключений в Firebase Crashlytics более читабельным все что нужно — это добавить эти три строчки в файл proguard-rules.pro:

-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
Читать далее «Деобфускация кода exception в Firebase Crashlytics после падения приложения»

Отмена кэширования в Pentaho Report

Option1: You can navigate to \biserver-ee\tomcat\webapps\pentaho\WEB-INF\classes and change the configuration file «ehcache.xml»

<cache name="report-dataset-cache"
maxElementsInMemory="50"
eternal="false"
overflowToDisk="false"
timeToIdleSeconds="1"
timeToLiveSeconds="2"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="1"
/>

If you have done that and still no positive answer, I think you have not restarted the BA server. If the issue still exists comment below.

caching — How to clear cache in Pentaho — Stack Overflow

Option2: I have had the same problem — I get data from a report via a mondrian cube but when the data in DB changes, it is not reflected in the report unless i logout and login again. (i have also set report-cache to false and also in the cube definition cache is set to false).

Here is how i fixed it.

1) in pentaho-solutions\system\mondrian\mondrian.properties» — set «mondrian.rolap.star.disableCaching=» to true
2) in tomcat\tomcat\webapps\pentaho\WEB-INF\classes\classic-engine.properties add the line — org.pentaho.reporting.engine.classic.core.cache.DataCache=
3) in tomcat\tomcat\webapps\pentaho\WEB-INF\classes\ehcache.xml for cache name «mondrian-catalog-cache» set timeToIdleSeconds and timeToLiveSeconds to a small value, say 5

What is interesting is that if i do steps 1 and 2 it works for some reports, and for some reports just step 3 suffices. So for now i have done all three steps.

I am not sure if this will work for you since this approach is based on trial and error rather an understanding of how ehcache works in in the pentaho+mondrian setup.

So while it works for me , there is not a good feeling of comfort that this is the way to do it. Hopefully someone from the pentaho team can throw some light on this.

regards
-anish

Disabling cache for Pentaho

Java Decompiler

The “Java Decompiler project” aims to develop tools in order to decompile and analyze Java 5 “byte code” and the later versions.

JD-GUI is a standalone graphical utility that displays Java source codes of “.class” files. You can browse the reconstructed source code with the JD-GUI for instant access to methods and fields.

JD-Eclipse is a plug-in for the Eclipse platform. It allows you to display all the Java sources during your debugging process, even if you do not have them all.

JD-Core is a library that reconstructs Java source code from one or more “.class” files. JD-Core may be used to recover lost source code and explore the source of Java runtime libraries. New features of Java 5, such as annotations, generics or type “enum”, are supported. JD-GUI and JD-Eclipse include JD-Core library.

JD-Core, JD-GUI & JD-Eclipse are open source projects released under the GPLv3 License.

Java Decompiler (java-decompiler.github.io)

Очистка логов journalctl в Ubuntu

Для очистки логов по условиям: до даты или обрезать до такого-то размера (в кол-ве записей или в Мб) можно использовать встроенные команды:

journalctl --vacuum-size=128M 
journalctl --vacuum-time=1d

Записки ученика iOS программиста

 Все знания полученные здесь взяты из книги «Swift разработка приложений в среде Xcode для iPhone и iPad».

 Исходный код можно получить с сайта GitHub https://github.com/Apress/beg-iphone-dev-w-swift-3

  • для изменения иконки приложения лучше воспользоваться сервисом https://appicon.co Находим изображение размером 1024х1024 и передаем этому сервису? он сам вернет архив с нужными иконками.
  •  Создание кода при помощи которого можно форматировать текст через swift:
Читать далее «Записки ученика iOS программиста»