android font not showing

I recently changed my app from using android.support.v4.app.Fragment to android.app.Fragment hosted in android.app.Activity and now the font is not showing properly.
i’ve included abel.ttf in font/ using google’s add font to project option

build.gradle
apply plugin: 'com.android.application'

android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.baros.barosserver"
    minSdkVersion 19
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.journeyapps:zxing-android-embedded:3.5.0'

}

using the font in my project.
android:fontFamily=”@font/abel”

Why retrofit Authenticator is not called?

I want to change response from server to 423 -> 401, and then call refreshToken by using Authenticator.

The method is called if response code is 401

But why the method Authenticator.authenticate(Route route, Response response) is not called in my case?

OkHttpClient

OkHttpClient httpClient = new OkHttpClient.Builder()
            .connectTimeout(10, TimeUnit.SECONDS)
            .writeTimeout(60, TimeUnit.SECONDS)
            .readTimeout(60, TimeUnit.SECONDS)
            .addInterceptor(new Interceptor() {
                @Override
                public Response intercept(Chain chain) throws IOException {
                    //Adding token to request
                    Request request = chain.request();
                    Request.Builder builder = request.newBuilder();
                    builder.header("Authorization", "access_token");
                    return chain.proceed(builder.build());
                }
            })
            .addInterceptor(new Interceptor() {
                @Override
                public Response intercept(Chain chain) throws IOException {
                    //changing response code from server 423 -> 401
                    Request request = chain.request();
                    Response response = chain.proceed(request);
                    if (response.code() == 423)
                        return response.newBuilder().code(401).build();
                    return response;
                }
            })
            .authenticator(new Authenticator() {
                //THE METHOD IS NOT CALLED, WHY?
                @Override
                public Request authenticate(Route route, Response response) throws IOException {
                    // Refresh access_token using a synchronous api request
                    String newAccessToken = refreshToken();
                    saveNewToken(newAccessToken)
                    // Add new header to rejected request and retry it
                    return response.request().newBuilder()
                            .header("Authorization", newAccessToken)
                            .build();
                }
            })
            .build();

Retrofit interface:

 ApiService mApiService = new Retrofit.Builder()
                        .baseUrl(serverHostUrl)
                        .client(httpClient)
                        .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                        .addConverterFactory(GsonConverterFactory.create(gson))
                        .build()
                        .create(ApiService.class);

error with hibernate update property

I am very new to hibernate and java

I am working on an assignment and everything was working fine but then the teacher asked me to change

<property name="hibernate.hbm2ddl.auto">create</property>

to

<property name="hibernate.hbm2ddl.auto">update</property>

and now I am receiving the following error after the first attempt to write on the Database,

org.hibernate.hql.internal.QueryTranslatorFactoryInitiator initiateService

INFO: HHH000397: Using ASTQueryTranslatorFactory

I am really not sure what is the problem and how to fix it, I know that create is used to create the tables if they are not already created before and that update only update the already exists tables. But i am not sure why I am getting this problem.

I am using hibernate with mysql on Mac

cannot find activator-launcher during ci pipeline

i’m currently using play 2.3.X and i’m trying to implement continues integration in my project with gitlab.

I installed oracle java on my red hat server, as well as activator (offline – my server is not connected to the internet).
when i’m copying the project to the server and executing “activator clean” everything works fine, but through the ci pipeline i get the following message:

 Getting com.typesafe.activator activator-launcher 1.2.12 ...

:: problems summary ::
:::: WARNINGS
        module not found: com.typesafe.activator#activator-launcher;1.2.12

    ==== local: tried

      /opt/activator/repository/com.typesafe.activator/activator-launcher/1.2.12/ivys/ivy.xml

      -- artifact com.typesafe.activator#activator-launcher;1.2.12!activator-launcher.jar:

      /opt/activator/repository/com.typesafe.activator/activator-launcher/1.2.12/jars/activator-launcher.jar

    ==== activator-launcher-local: tried

      file:/opt/activator-1.2.12-minimal/repository/com.typesafe.activator/activator-launcher/1.2.12/ivys/ivy.xml

    ==== Maven Central: tried

      https://repo1.maven.org/maven2/com/typesafe/activator/activator-launcher/1.2.12/activator-launcher-1.2.12.pom

      -- artifact com.typesafe.activator#activator-launcher;1.2.12!activator-launcher.jar:

      https://repo1.maven.org/maven2/com/typesafe/activator/activator-launcher/1.2.12/activator-launcher-1.2.12.jar

    ==== typesafe-releases: tried

      https://repo.typesafe.com/typesafe/releases/com/typesafe/activator/activator-launcher/1.2.12/activator-launcher-1.2.12.pom

      -- artifact com.typesafe.activator#activator-launcher;1.2.12!activator-launcher.jar:

      https://repo.typesafe.com/typesafe/releases/com/typesafe/activator/activator-launcher/1.2.12/activator-launcher-1.2.12.jar

    ==== typesafe-ivy-releasez: tried

      https://repo.typesafe.com/typesafe/ivy-releases/com.typesafe.activator/activator-launcher/1.2.12/ivys/ivy.xml

        ::::::::::::::::::::::::::::::::::::::::::::::

        ::          UNRESOLVED DEPENDENCIES         ::

        ::::::::::::::::::::::::::::::::::::::::::::::

        :: com.typesafe.activator#activator-launcher;1.2.12: not found

        ::::::::::::::::::::::::::::::::::::::::::::::


:::: ERRORS
    Server Access Error: Connection timed out

:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: com.typesafe.activator#activator-launcher;1.2.12: not found
Error during sbt execution: Error retrieving required libraries
  (see /home/j3d/.sbt/boot/update.log for complete log)
Error: Could not retrieve activator-launcher 1.2.12

anybody knows what it the problem?

thanks in advance,
omer

Using TimeZone.getDefault(), what does your device return?

What will be the value of getDisplayName(false, TimeZone.SHORT)?

I reckon the value is GMToffset, for example in Singapore it will be GMT+08:00.

However, on one device (Google Pixel 2 XL) I am getting SGT.

Why the difference? Could it be Android Oreo or perhaps the SIM card supplying a network-provided time zone? I also thought that such abbreviations or 3/4 letter ids are deprecated already.

Skipping @Param as List in @Query if is null in Spring Data JPA : antlr.NoViableAltException: unexpected AST node

@Query(value = "select count(distinct d.documentId) " +
        "from TrainingDocument d " +
        "where d.language = :language " +
        "and (:docTypes is null or d.documentTypeName in :docTypes )" +
        "and d.documentId in (" +
        "select documentId from TrainingExampleTag " +
        "where (:extract is null or value = :extract) " +
        "group by documentId)")
Long countDocumentByLangTypeExtract(
        @Param("language") String language,
        @Param("docTypes") List<String> docTypes,
        @Param("extract") String value);

I have a query above, where I check parameters whether there are null or not. With String it works fine, but when I add skipping @Param("docTypes") List<String> docTypes if it is null I got:

org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: {vector} [select count(distinct d.documentId) from de.leverton.inceptor.storage.model.TrainingDocument d where d.language = :language and (:docTypes_0_, :docTypes_1_ is null or d.documentTypeName in (:docTypes_0_, :docTypes_1_) )and d.documentId in (select documentId from de.leverton.inceptor.storage.model.TrainingExampleTag where (:extract is null or value = :extract) group by documentId)]
    at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:91) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:268) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:142) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:115) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.engine.query.spi.HQLQueryPlan.(HQLQueryPlan.java:76) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:150) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:302) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1316) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]
    at org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:529) ~[hibernate-entitymanager-5.0.12.Final.jar:5.0.12.Final]

As soon as I change and (:docTypes is null or d.documentTypeName in :docTypes ) to and d.documentTypeName in :docTypes it works fine.

I already found this solution How to skip @Param in @Query if is null or empty in Spring Data JPA
It describes my case but doesn’t work for me.
I’m using spring-boot 1.5.9.RELEASE

Transfer java variable to php post request

<?php
include 'connectDatabase.php';

    //Retrive Data
    $g = $_POST["g1"];

    //Insert data into database
    mysql_query("INSERT INTO g1 (g1) VALUES ('$g')") or die(mysql_error());

?>

Anyone know how to write a java code such that the java variable can be posted to the database using the php code shown above?

Why do I get a HelpSetException – NoClassDefFoundError when trying to run a Swing desktop application?

The application and the help system runs ok from the netbeans IDE but when deployed the exception is returned on the help set. I have checked that the three help jars jh.har, jhall.jar and jhbasic.jar are in the project > Properties > Libraries > Compiling. I have checked the contents of the distribution created from the NetBeans and verified that the three help files are in the lib folder. I have checked and verified that the Windows 8.1 CLASSPATH includes:

    CLASSPATH=C:Program FilesJavajdk1.8.0_72bin; 
    D:jh2.0javahelplib; 
    D:jh2.0javahelpbin     

This is the dump from the run:

    C:Program Files (x86)NewDawn4>java -jar Newdawn.jar
    Error: A JNI error has occurred, please check your installation and try again
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/help/HelpSetException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.privateGetMethodRecursive(Unknown Source)
    at java.lang.Class.getMethod0(Unknown Source)
    at java.lang.Class.getMethod(Unknown Source)
    at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
    at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: javax.help.HelpSetException
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 7 more 

Having researched this problem in depth and followed the recommendations of others, I am still without a solution and unable to see what I am doing wrong.