text:
Q: App has Stopped unexpectedly I try to run google map from this page https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2
This is my
.java page
package com.findyourtaxihere.taxi;

import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity {

     @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
        }
}

This is Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.findyourtaxihere.taxi"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="21" />
    <permission
        android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <uses-permission android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />

            </intent-filter>
        </activity>
        <meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
        <meta-data
    android:name="com.google.android.maps.v2.my api"
    android:value="my api"/>
    </application>

</manifest>

my activity main
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/map"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:name="com.google.android.gms.maps.MapFragment"/>

when run my app , it shows error like this stops unfortunately , and i'm new for android please help me !
 log
02-02 19:03:54.871: I/Process(284): Sending signal. PID: 284 SIG: 9
02-02 19:04:00.491: D/AndroidRuntime(307): Shutting down VM
02-02 19:04:00.491: W/dalvikvm(307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:04:00.511: E/AndroidRuntime(307): FATAL EXCEPTION: main
02-02 19:04:00.511: E/AndroidRuntime(307): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.os.Looper.loop(Looper.java:123)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:04:00.511: E/AndroidRuntime(307):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:04:00.511: E/AndroidRuntime(307):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:04:00.511: E/AndroidRuntime(307):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:04:00.511: E/AndroidRuntime(307): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:13)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:04:00.511: E/AndroidRuntime(307):  ... 11 more
02-02 19:04:00.511: E/AndroidRuntime(307): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-2.apk]
02-02 19:04:00.511: E/AndroidRuntime(307):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:04:00.511: E/AndroidRuntime(307):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:04:00.511: E/AndroidRuntime(307):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:04:00.511: E/AndroidRuntime(307):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:04:00.511: E/AndroidRuntime(307):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:04:00.511: E/AndroidRuntime(307):  ... 19 more
02-02 19:09:36.841: I/dalvikvm(334): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:09:36.841: W/dalvikvm(334): VFY: unable to resolve virtual method 12505: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:09:36.841: D/dalvikvm(334): VFY: replacing opcode 0x6e at 0x0009
02-02 19:09:36.852: D/dalvikvm(334): VFY: dead code 0x000c-0019 in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:09:36.922: D/AndroidRuntime(334): Shutting down VM
02-02 19:09:36.922: W/dalvikvm(334): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:09:36.942: E/AndroidRuntime(334): FATAL EXCEPTION: main
02-02 19:09:36.942: E/AndroidRuntime(334): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.os.Looper.loop(Looper.java:123)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:09:36.942: E/AndroidRuntime(334):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:09:36.942: E/AndroidRuntime(334):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:09:36.942: E/AndroidRuntime(334):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:09:36.942: E/AndroidRuntime(334): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:18)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:09:36.942: E/AndroidRuntime(334):  ... 11 more
02-02 19:09:36.942: E/AndroidRuntime(334): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:09:36.942: E/AndroidRuntime(334):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:09:36.942: E/AndroidRuntime(334):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:09:36.942: E/AndroidRuntime(334):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:09:36.942: E/AndroidRuntime(334):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:09:36.942: E/AndroidRuntime(334):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:09:36.942: E/AndroidRuntime(334):  ... 19 more
02-02 19:09:40.241: I/Process(334): Sending signal. PID: 334 SIG: 9
02-02 19:15:23.312: I/dalvikvm(370): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:15:23.312: W/dalvikvm(370): VFY: unable to resolve virtual method 12505: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:15:23.312: D/dalvikvm(370): VFY: replacing opcode 0x6e at 0x0009
02-02 19:15:23.322: D/dalvikvm(370): VFY: dead code 0x000c-0019 in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:15:23.392: D/AndroidRuntime(370): Shutting down VM
02-02 19:15:23.392: W/dalvikvm(370): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:15:23.422: E/AndroidRuntime(370): FATAL EXCEPTION: main
02-02 19:15:23.422: E/AndroidRuntime(370): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.os.Looper.loop(Looper.java:123)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:15:23.422: E/AndroidRuntime(370):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:15:23.422: E/AndroidRuntime(370):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:15:23.422: E/AndroidRuntime(370):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:15:23.422: E/AndroidRuntime(370): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:18)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:15:23.422: E/AndroidRuntime(370):  ... 11 more
02-02 19:15:23.422: E/AndroidRuntime(370): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-2.apk]
02-02 19:15:23.422: E/AndroidRuntime(370):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:15:23.422: E/AndroidRuntime(370):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:15:23.422: E/AndroidRuntime(370):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:15:23.422: E/AndroidRuntime(370):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:15:23.422: E/AndroidRuntime(370):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:15:23.422: E/AndroidRuntime(370):  ... 19 more
02-02 19:15:26.542: I/Process(370): Sending signal. PID: 370 SIG: 9
02-02 19:18:15.771: I/dalvikvm(397): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:18:15.771: W/dalvikvm(397): VFY: unable to resolve virtual method 12506: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:18:15.771: D/dalvikvm(397): VFY: replacing opcode 0x6e at 0x0009
02-02 19:18:15.782: D/dalvikvm(397): VFY: dead code 0x000c-005e in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:18:15.821: D/AndroidRuntime(397): Shutting down VM
02-02 19:18:15.821: W/dalvikvm(397): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:18:15.851: E/AndroidRuntime(397): FATAL EXCEPTION: main
02-02 19:18:15.851: E/AndroidRuntime(397): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.os.Looper.loop(Looper.java:123)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:18:15.851: E/AndroidRuntime(397):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:18:15.851: E/AndroidRuntime(397):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:18:15.851: E/AndroidRuntime(397):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:18:15.851: E/AndroidRuntime(397): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:20)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:18:15.851: E/AndroidRuntime(397):  ... 11 more
02-02 19:18:15.851: E/AndroidRuntime(397): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:18:15.851: E/AndroidRuntime(397):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:18:15.851: E/AndroidRuntime(397):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:18:15.851: E/AndroidRuntime(397):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:18:15.851: E/AndroidRuntime(397):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:18:15.851: E/AndroidRuntime(397):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:18:15.851: E/AndroidRuntime(397):  ... 19 more
02-02 19:22:23.441: D/AndroidRuntime(453): Shutting down VM
02-02 19:22:23.441: W/dalvikvm(453): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:22:23.471: E/AndroidRuntime(453): FATAL EXCEPTION: main
02-02 19:22:23.471: E/AndroidRuntime(453): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.os.Looper.loop(Looper.java:123)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:22:23.471: E/AndroidRuntime(453):  at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:22:23.471: E/AndroidRuntime(453):  at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:22:23.471: E/AndroidRuntime(453):  at dalvik.system.NativeStart.main(Native Method)
02-02 19:22:23.471: E/AndroidRuntime(453): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:16)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:22:23.471: E/AndroidRuntime(453):  ... 11 more
02-02 19:22:23.471: E/AndroidRuntime(453): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:22:23.471: E/AndroidRuntime(453):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:22:23.471: E/AndroidRuntime(453):  at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:22:23.471: E/AndroidRuntime(453):  at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:22:23.471: E/AndroidRuntime(453):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:22:23.471: E/AndroidRuntime(453):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:22:23.471: E/AndroidRuntime(453):  ... 19 more
02-02 19:27:23.551: I/Process(453): Sending signal. PID: 453 SIG: 9

A: You need to set your min SDK to 11 so the code can only be run on devices where Activity knows how to inflate fragment tags.
Or just use the v4 support library and change your activity to extend FragmentActivity.


text:
Q: How to convert AAC/MP4A to MP3 using FFMPEG in full length? Audio file gets cut off after 1 second I have recorded an audio file with MediaRecorder on iPhone.
As ffmpeg command I am using:
ffmpeg -i 18380889311644327118 -ar 44100 -ac 2 -b:a 128k -c:a libmp3lame -q:a 0 18380889311644327118.mp3

-i specifies the input file
-vn disables all video-streams from the input
-ar audio sampling frequency
-ac number of audio channels
-b:a bit rate
-c:a libmp3lame - codec of target file
-q:a quality set audio quality (codec-specific) (lower is better), see https://superuser.com/a/1515841

-sn disables all subtitle-streams from the input
-dn disables all data-streams from the input

The console output looks like this:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '18380889311644327118':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: isomiso5hlsf
    creation_time   : 2021-12-08T15:44:06.000000Z
  Duration: 00:00:01.00, start: 0.000000, bitrate: 2258 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 2234 kb/s (default)
    Metadata:
      creation_time   : 2021-12-08T15:44:06.000000Z
      handler_name    : Core Media Audio
Stream mapping:
  Stream #0:0 -> #0:0 (aac (native) -> mp3 (libmp3lame))

Output #0, mp3, to '18380889311644327118.mp3':
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: isomiso5hlsf
    TSSE            : Lavf58.29.100
    Stream #0:0(und): Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2021-12-08T15:44:06.000000Z
      handler_name    : Core Media Audio
      encoder         : Lavc58.54.100 libmp3lame
size=      17kB time=00:00:01.01 bitrate= 135.5kbits/s speed=37.2x
video:0kB audio:16kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.343701%

As you can see, the duration is 01.00 second. And this happens with all recorded files.
How to convert the entire file (which is 12 seconds long) to its full length?

Note: It seems that the recorded file does not have a length specified. Under Windows I renamed the file, adding an extension ".m4a" and opened the file properties:

The length attribute is empty.

A: As Gyan wrote, the conversion works with ffmpeg v4.4 which does not come with the recent Ubuntu update.
However, you can install it customly, see instructions here:
Safest way to install latest stable ffmpeg (>= 4.3) on Ubuntu 20.04 (ppa not working)?
Then the conversion from audio/mp4 (codec AAC) to mp3 works.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Ionic slides card horizontal I need help. When I start to slide on the left my 2nd card to nth is not showing.
<ion-content>

    <ion-slides pager slidesPerView="1.1">
        <ion-slide *ngFor="let subject of cardData">
            <ion-card class="cardList">
                <ion-card-header>
                    <ion-card-title>

 {{subject.title}}

                    </ion-card-title>
                </ion-card-header>
                <ion-card-content>

 {{subject.description}}

                </ion-card-content>
            </ion-card>
        </ion-slide>
    </ion-slides>

</ion-content>

Am I missing Something?
Screenshot Here

A: Your issue is in this prop: slidesPerView="1.1" the documentation establish:

slidesPerView | number |  Slides per view. Slides visible at the same time. Default: 1.

As you set in your slidesPerView="1.1" that is why in your image you can see like the one slide and a little more from the another one. If you want to prevent this behavior then remove that prop or change it for a int value


text:
Q: it is possible to freeze a process in linux and restart or shutdown the computer. Then continue with the process that was frozen? I would like to know if it is possible to freeze a process in Linux and then restart or shut down the computer. And when the computer goes back to work, continue with the process that was frozen.
I tried to use killall -s STOP to freeze the process, but when I reboot the computer and use the command killall -s CONT, it says no process is located.

A: Processes on Linux can (with caveats and limitations) be suspended on Linux; as of 2017 such checkpoint/restore functionality is provided by the CRIU project:
https://criu.org/
Specific limitations include the need to use the same PID, that libraries must be the exact same version before and after a restart, and so forth:
https://criu.org/What_cannot_be_checkpointed

A: No, you cannot suspend individual processes across a reboot. However, it should be possible to suspend the entire system. When you restart it later the processes that were running may well be able to continue. (Exceptions include those communicating across a network.)
There are two forms of suspend

*

*Suspend to memory - this requires continuous power (battery, etc.) but the system is essentially paused.

*Suspend to disk - this does not require power, but the system will take a little longer to restart. In the Windows world this used to be called Hibernate.


text:
Q: How to submit 2 forms with AJAX I am submitting 2 forms via AJAX:
$("#form1").on("submit", function(event){
  event.preventDefault();

  var action_url = $(this).attr("action");
  var postData = $(this).serializeArray();

  $.post(action_url,postData,function(data){
    var obj = $.parseJSON(data);
    if(obj.status == "error")
    {
    // Code
  };

  if(obj.status == "success")
  {
    // Code
  }
});

});

#form2 is submitted the same way, with precisely the same code above (switching out the selector and using different results for error and success).
Is there a simple way I can submit both forms with one button?
* EDIT *
Form HTML below:
<form id="form1" action="url1/action1" method="post">
 // code
</form>
<form id="form2" action="url2/action2" method="post">
 // code
</form>

A: $("form#form1").on("submit", function(event){

and
$("form#form2").on("submit", function(event){

A: Just combine both forms into one. There is no reason that data displayed on the screen in two places can't be one form behind the scenes.


text:
Q: Error ADMA5026E for WebSphere Application Server Network Deployment What I'm doing wrong that I get the ADMA5026E error when deployment an application with the NetworkDeployment Console?

A: Try
IBM Information Center


text:
Q: laravel codeigniter password I have a query regarding project migrate from CodeIgniter to Laravel. I want to create a web API using the laravel framework.
Existing project was made in the CodeIgniter framework.
Laravel has it's own hash way of a password. How can I manage users password from CodeIgniter? How can I allow to login with a current password?

A: I think that you have to identify first what type of encrypt is the Codeigniter using on the password field and then you have to decrypt or validate the password on Laravel. I had the reverse problem and on codeigniter I had to use a library ('encrypt') in order to validate the Hash the Laravel uses.


text:
Q: Is there a way to make my site automatically check if a user is still logged in every x minutes? I have a site where i sell streaming videos, and i'm currently using a plugin that prevents account sharing by allowing only one device logged at a time. The problem is, the user can start watching the stream and then share his account, the second person will access the stream and both of them will watch because User 1 didn't refresh the page (which will log him out).
How can i make the site automatically check every x minutes if user 1 is still logged in and if he isn't, refresh the page?

A: One way to do this would be to have the page call out to you on an interval using Javascript asynchronously. (e.g. ajax)
Depending on how the streaming works you could even terminate further streaming if you do not get the interval call after a set amount of time.

A: First of all, this is a great question !
The problem here is to periodically check if a user is logged in, tho as you understand PHP doesn't refresh on its own.
Like @Chris Haas pointed out, the following article "Check if user is logged in using JQuery" is pretty close to the behavior you're looking for, tho we need to set up, and understand a few thing.
We can pass variable from PHP to Javascript through the wp_localize_script() WordPress function...
...Tho, if we just localize the is_user_logged_in() as a variable, then the function would only be trigger once, meaning when the script is actually enqueued.
The answer to our problem is triggering back a PHP function from our Javascript through Ajax.
From our function.php: Since Ajax is already built into the core WordPress administration screens, passing it to the front end is fairly easy.
<?php

//enqueue jquery
wp_enqueue_script( 'jquery-min', 'https://code.jquery.com/jquery-3.6.1.min.js', array(), '3.6.1', true );

//add jquery integrity key
add_filter( 'script_loader_tag', function ( $tag, $handle, $src ) {

    if ( 'jquery-min' === $handle ) {

        $tag = str_replace(
            "></script>",
            " integrity='sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=' crossorigin='anonymous'></script>",
            $tag
        );

    };

    return $tag;

}, 10, 3 );

//enqueue my-script
wp_enqueue_script( 'my-script', trailingslashit( get_template_directory_uri() ) . 'assets/js/my-script.js', array( 'jquery-min' ), wp_get_theme()->version, true );

//pass ajax and a nonce to my-script
wp_localize_script( 'my-script', 'localize', array(
    '_ajax_url' => admin_url( 'admin-ajax.php' ),
    '_ajax_nonce' => wp_create_nonce( '_ajax_nonce' ),
) );

Keep in mind that Ajax is dependend on JQuery, that's why my-script.js is depended on JQuery.
From our my-script.js: Our Ajax request is wrapped in a setInterval method firing every seconds. If the answer sent from the matching PHP function is false we force reload the whole page through location.reload().
setInterval( function ( event ) {
    $.ajax( {
        type: 'POST',
        url: localize._ajax_url,
        context: this,
        data: {
            _ajax_nonce: localize._ajax_nonce,
            action: '_wpso_73857697_is_user_logged_in',
        },
        success: function ( response ) {
            let is_user_logged_in = response.data;
            switch ( is_user_logged_in ) {
                case true:
                    break;
                case false:
                    location.reload();
                    break;
                default:
                    break;
            };
        },
    } );
}, 1000 );

From our function.php: The matching PHP function will check if the user is logged-in upon receiving the request sent by our self triggering Ajax function.
It will send back a response containing the user status (true/false).
<?php

//for NON-logged-in users
add_action( 'wp_ajax_nopriv__wpso_73857697_is_user_logged_in', function () {

    $is_user_logged_in = is_user_logged_in();

    wp_send_json_success( $is_user_logged_in );

    wp_die();

} );

//for logged-in users
add_action( 'wp_ajax__wpso_73857697_is_user_logged_in', function () {

    if ( check_ajax_referer( '_ajax_nonce' ) ) {

        $is_user_logged_in = is_user_logged_in();

        wp_send_json_success( $is_user_logged_in );

    } else {

        wp_send_json_error();

    };

    wp_die();

} );


text:
Q: XMLAccess in WebSpherePortal 6.1? Hi I want to install and configure new theme and skin the WebSpherePortal server 6.1.
Any one give reference or document for this xmlaccess.

A: Before Configuring the themes and skins we have to copy our themes into file:\$server_root$\installedApps\IBM-710BB15A391\wps.ear\wps.war\themes\html
and skin into
file:\$server_root$\installedApps\IBM-710BB15A391\wps.ear\wps.war\skins\html
For Skin:
1)Register the skin
RegisterSkin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_6.1.0.xsd"
type="update" create-oids="true">
 <portal action="locate">
<skin action="update" active="true" objectid="rockskin" uniquename="rockskin"
   resourceroot="w3skin">
     <localedata locale="en">
     <title>rockskin</title>
    </localedata>
 </skin>
</portal>
</request>

->xmlaccess.bat –in RegisterSkin.xml -out  -user usrname  –pwd password   –url http://localhost:10040/wps/config
2)Register the theme
i)Register the theme with existed skin
 RegisterTheme1.xml:
 <?xml version="1.0" encoding="UTF-8"?>
 <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_6.1.0.xsd"
type="update" create-oids="true">
<portal action="locate">
  <skin action="locate" active="true" objectid="noSkin"
  uniquename="wps.skin.noSkin"/>
  <theme action="update" active="true" defaultskinref="noSkin "
   uniquename="rocktheme" resourceroot="w3theme">
    <localedata locale="en">
    <title>Rock Theme</title>
    </localedata>
   <allowed-skin skin=" noSkin" update="set"/>
 </theme>
</portal>
</request>

->xmlaccess.bat –in RegisterTheme1.xml -out  -user usrname  –pwd password   –url http://localhost:10040/wps/config
ii)Register the theme with new skin
In the above xml file we are using the existed skin name noSkin
If you want to apply new skin you have to mention as follows:
RegisterTheme2.xml:
 <?xml version="1.0" encoding="UTF-8"?>
 <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="PortalConfig_6.1.0.xsd"
type="update" create-oids="true">
<portal action="locate">
   <skin action="update" active="true" objectid="newSkin"
    uniquename="newSkin " resourceroot="newSkin ">
      <localedata locale="en">
      <title>rockskin</title>
      </localedata>
   </skin>
  <theme action="update" active="true" defaultskinref="newSkin " uniquename="
   w3theme " resourceroot="w3theme">
     <localedata locale="en">
     <title>Rock Theme</title>
     </localedata>
     <allowed-skin skin="newSkin " update="set"/>
  </theme>
</portal>
</request>

->xmlaccess.bat –in RegisterTheme2.xml -out  -user usrname  –pwd password   –url http://localhost:10040/wps/config
Note:resourceroot in the both skin and theme must be your copied theme and skin folder names.


text:
Q: BitBucket markdown do you know how can I generate a TOC for a readme.md file that is store in a BitBucket repository ?
I read some blogs about this, but it's not working proplery, I want links on TOC contents and navigate through document based on TOC content.
Thanks
Sorin

A: Imagine, your document structure would look like this:
# Overview
# Features
# Bug reports
# Contributing
# License

Bitbucket gives an ID to each of these headings, for example the ID for # Overview would be markdown-heading-overview, the ID for # Bug reports would be markdown-heading-bug-reports.
You can create an internal link like that: [Link text](#id), where you replace id with the given ID. Your table of contents could look like this:
* [Overview](#markdown-heading-overview)
* [Features](#markdown-heading-features)
* [Bug reports](#markdown-heading-bug-reports)
* [Contributing](#markdown-heading-contributing)
* [License](#markdown-heading-license)


text:
Q: What is the correct way to sync a database? Assume I have one large database (mongoDB for example) that is used by many users and is installed on a server. I'm building a desktop application that should be able to interact with the database and should also be able to function temporarily if the internet connection is lost.
My idea is that locally, I would have a clone of the DB on the server that I would change if no internet is available, and then when the internet is back, I would somehow sync both of these databases. However I can't help but think that this isn't the correct approach. How would this sync happen efficiently? Are there any alternatives or better approaches I could take?

A: You can use mongo-connector https://github.com/mongodb-labs/mongo-connector to sync the database between two mongo instances.
Another solution is to set up a replica between your local instance and remote instance. But you need to be aware that only primary can accept write operations which means when you go offline, your server instance can only handle write operations. Your local changes will be replicated to the server when you connect to the internet.


text:
Q: What would be different if I use "have been" instead of "be" What is the difference between these two sentences?

Suddenly kicked in the bar, Tony turned out to be so worked up.
Suddenly kicked in the bar, Tony turned out to have been so worked up.

A: Since Tony can be kicked in the shin or kicked in the groin, to say he was "kicked in the bar" creates some interference waves.  We can fix that very easily:
Suddenly kicked while in the bar...
I think you mean "became" when you say "turned out to be".
Suddenly kicked while in the bar, Tony became so angry.
Since  it takes at least a little while to get "worked up" (the "up" suggests a culmination) I've changed it to "angry", because "worked up" doesn't fit well with being kicked suddenly.
You could say:
Tony became worked up when he was kicked while in the bar and the person who kicked him did not apologize but instead started laughing.
"Turned out" like "worked up" also requires a passage of time.  It refers to the discovery of a reason which for some period of time had not presented itself, or the supplanting of one reason by another.

Why did Tony get so angry at the bar?
  -- It actually wasn't because he had been kicked suddenly, as everyone believed. It turned out to have been an overdose of steroids.  He had "roid rage".


text:
Q: MYSQL Nested Query with two select I have:
Table1 (UserID -City - Adress - Mobile)
Table2 (DeviceID - UserID - Vendor - Model).

I want to perform nested query to select the following in one row:
 select DeviceID, UserID, Model From Table2 Where Vendor=Sony
(and for this row go and select City - Address - Mobile from table 1 where table1.UserID = Table2.UserID)

How can I perfom the second select in the same query to be printed in the same row after Model.

A: Use inner JOIN
select
      t2.DeviceID
    , t2.UserID
    , t2.Model
    , t1.city
    , t1.Address
    , ti.mobile
From Table2 as t2
Where Vendor='Sony'
INNER JOIN table1 as t1 on  t1.UserID = t2.UserID


text:
Q: IPv6 Compatibility for GoDaddy VPS I have a GoDaddy VPS running Windows Server 2008, I use it to host my main website as well as the REST APIs that I use in my mobile application.
When I tried to submit to iTunes, my app got rejected due to IPv6 incompatibility. I have already added the AAAA record to my DNS, I have the domain binding in IIS on port 80 set to "All Unassigned" and the IPv6 address shows in the IIS dropdown when binding so supposedly my server has an IPv6 address.
However, the IPv6-test.com recognizes my AAAA record but the web server remains unreachable (As per the screenshot below).
Is there any specific settings on Windows Firewall or IIS that I should do? Should I add specific domain bindings for the IPv6 address?
Thank you,IPv6 Test


text:
Q: Can any one suggest me a method to implement wave animation in iphone?
Possible Duplicate:
How do I make a water effect view with openGLES on the iPhone?

I am developing a project in which wave animation is required.I have searched a lot in Google to get such animation but of not use.Can any one suggest me a logic to implement this animation and which framework should i use open gl or cocos 2D
thanks in advance

A: Read the "grass movement" part of this tutorial, might give you some ideas.


text:
Q: Jquery Tooltip mousemove event not following mouse to all Divs So in a previous question I couldn't get the Jquery Mousemove feature to work on these tooltips for these divs within a 14 column 960 grid system I have. Now they work to some degree. They will only follow my mouse to like the 7th or 8th column (width). If you scroll all the way to the right where the other divs are the tooltip stops at a certain point. Not sure what is preventing it from following it all the way....Here is the link to it on JSFiddle:
    http://jsfiddle.net/penrysh/eoL1qqf9/
Here is the jquery:
$(document).ready(function(){
$('.tooltip').mouseover(function(e){

if( $(this).attr('data-tip-type') == 'text' ){
$('#tooltip_container').html( $(this).attr('data-tip-source') );
} // this section grabs and shows the plain text tool-tip  typles

if( $(this).attr('data-tip-type') == 'html' ){
var elementToGet = '#'+ $(this).attr('data-tip-source');
var newHTML = $(elementToGet).html();

$('#tooltip_container').html(newHTML);
} // this section grabs and shows the tool-tips that are HTML and can be formatted and are in divs at bottom on index page
}).mousemove(function(e){

var toolTipWidth = $('#tooltip_container').outerWidth();
var toolTipHeight = $('#tooltip_container').outerHeight();

var pageWidth = $('body').width();
if ( e.pageX > pageWidth/2) {
$('#tooltip_container').css('left',(e,pageX-toolTipWidth+20)+'px'); // takes tooltip width and subtract from pageX position                                      so it will always be offset from the cursor based on the tooltip itself
}else{
$('#tooltip_container').css('left',(e.pageX-20)+'px'); // Determines where courser is and subtracts 20pxs from it
}

$('#tooltip_container').css('top',(e.pageY+20)+'px'); // Determines where courser is and subtracts 20pxs from it

}).mouseout(function(e){
});

}); // end ready

A: change this:
$('#tooltip_container').css('left',(e,pageX-toolTipWidth+20)+'px');

to this:
$('#tooltip_container').css('left',(e.pageX-toolTipWidth+20)+'px');


text:
Q: Make diff Use Full Terminal Width in Side-by-Side Mode Most applications are smart about using the full width of the terminal available to them. My shell does, screen, vim, etc. However, diff in side-by-side mode (-y), does not. This angers me. It uses 126 character width, which is not even half of my 270 block width terminal.
Looking through the man page does not reveal anything particular about automatically adjusting the width, only manually specifying it via -W.
Is there perhaps a "hidden feature" of diff to allow it to automatically expand to the full width of the terminal?
Or;
What is the easiest path to automatically inserting -W <terminalsize> into my diff command whenever I run it?
I am under the assumption that automatically appending -W to everything couldn't hurt anything, because it will only ever mean "use $x columns", which is always what I want, whether I'm in side-by-side mode, or otherwise.

A: $ alias diff='diff -W $(( $(tput cols) - 2 ))'

ought to do it.  You'll want to add it to ~/.bashrc as well.
The - 2 is mainly paranoia, in case something (embedded double-width Unicode?) expands enough to make the line wrap; if you want, you can just use
$ alias diff='diff -W $(tput cols)'


text:
Q: String identifies iVar to update I have a series of 5 iVars. (highscore01, highscore02, highScore03, highScore04, highScore05) I want to update a particular iVar with an integer value. The iVars are defined as ints. The iVars are in a Class called HighScores.
The particular iVar to be updated is the one with the lowest current value stored in it. I want to replace the lowest value with a new value.
I have a method that identifies the ivar with the lowest value and returns a String "theString" containing the name of the iVar to be updated.
My question: How do I use the "theString" to update the correct iVar.
Here is a sample of the code.
// If any of the highScore iVars contain 0, then they are still empty.
// Find the first empty iVar and store score there.

 if (scoreVarsFullFlag == NO) // Flag to indicate if any iVars are still zero
 {
 if (theHighScores.highScore01 == 0)
  theHighScores.highScore01 = mainScores.scoreTotal;
 else if (theHighScores.highScore02 == 0)
  theHighScores.highScore02 = mainScores.scoreTotal;
 else if (theHighScores.highScore03 == 0)
  theHighScores.highScore03 = mainScores.scoreTotal;
 else if (theHighScores.highScore04 == 0)
  theHighScores.highScore04 = mainScores.scoreTotal;
 else if (theHighScores.highScore05 == 0)
  {
   theHighScores.highScore05 = mainScores.scoreTotal;
   scoreVarsFullFlag = YES; // Last scores iVar turns nonzero - set Flag to YES, to indicate no non-zero iVars
  }
 }
 else
 {

  NSLog(@"The Lowest is at %@", [theHighScores findLowestHighScore]);
  NSString * theString;
  theString = [NSString stringWithString:[theHighScores findLowestHighScore]];
  NSLog(@"The String is: %@", theString);
            theHighScores.theString = mainScores.scoreTotal; // This fails
}

The last line is where I try to set the iVar identified in "theString" to the new score number. "theString" does contain the name of the iVar to update, i.e. "HighScore03", etc.
If I was setting this manually, it would be;
theHighScores.highScore03 = mainScores.scoreTotal;
Any insight would be much appreciated.

A: If I were you I'd just use a mutable array instead to allow sorting and easily pick off the lowest item.
///store this in your app delegate
NSMutableArray *highscores = [[NSMutableArray alloc] init];

//then when you want to add a high score
[highscores addObject:[NSNumber numberWithDouble:mainScores.scoreTotal]];

NSSortDescriptor *myDescriptor;
myDescriptor = [[NSSortDescriptor alloc] initWithKey:@"doubleValue" ascending:NO];
[highscores sortUsingDescriptors:[NSArray arrayWithObject:myDescriptor]];

///remove the last object if it's over 5
if ([highscores count]>5) {
    [highscores removeLastObject];
}

A: I think mjdth's solution is probably the best, but you could also use -setValue:forKey:, though you'd have to switch to using NSNumbers, rather than ints.
[theHighScores setValue: [NSNumber numberWithInt: mainScores.scoreTotal] forKey: [theHighScores findLowestHighScore]];

A: Sounds like you're trying to do some basic type introspection.  Specifically, using NSSelectorFromString.
int newValue = 1;
SEL methodName = NSSelectorFromString(@"setHighScore03:");
[theHighScores performSelector:methodName withObject:newValue];


text:
Q: InsertAfter in jQuery giving error 'Uncaught TypeError: Cannot set property 'innerHTML' of null'; Why? Basically, I created a modal and the button click will display the findings of the function in the modal. I'd like the button click to remove everything in that initial modal, and just display the findings.
Like I said I am getting InsertAfter in jQuery giving error 'Uncaught TypeError: Cannot set property 'innerHTML' of null';
I am perplexed because I am getting a handle of the modal container with:
modal = $('.modal')

And I am creating a output element like so:
 output = doc.createElement('p');

 output.setAttribute('id', 'output');

Which is going to be appended to the modal...
 $('#output').insertAfter(modal);

So why would I get an error of null, if I just created the container?
 doc.getElementById('output').innerHTML = out.join("\n");

HTML:

JS:
function altChecker() {
        var doc = document,
            out = [],
            getStartedBtn = doc.getElementById('getStartedBtn'),
            modal = $('.modal'),
            output = doc.createElement('p');

            output.setAttribute('id', 'output');

        EventUtility.addHandler(getStartedBtn, 'click', function() {
            var all = doc.getElementsByTagName("IMG");

            for (var i = 0, max = all.length; i < max; i++) {
                var id = all[i].id;
                if (all[i].hasAttribute('alt')) {
                    out.push('Your image element, with the id of ' + id + ', has an  alt  tag.');
                    var value = all[i].getAttribute('alt');
                    if (value != "") {
                        out.push(id + ' alt="' + value + '"');
                    } else {
                        out.push('But ' + id + '\'s alt  is empty');
                    }
                } else {
                    out.push(id + ' does not have alt');
                }
            }

            $('#output').insertAfter(modal);
            doc.getElementById('output').innerHTML = out.join("\n");

        });
    }

A:
So why would I get an error of null, if I just created the container?

Because you haven't put it in the DOM, so $("#output") won't find it, even though it has an id; so the $("#output").insertAfter(modal); line is a no-op. Later, when you do doc.getElementById('output'), it's not in the DOM, so you get back null, and it fails.
Instead, since you already have a reference to the element in output, you'd do:
$(output).insertAfter(modal);

and later where you're using getElementById, there's no need to look it up again, you already have it, so:
output.innerHTML = out.join("\n");

or
$(output).html(out.join("\n"));


text:
Q: How to import excel file into two tables with input tags at the same time? I have two table one is users and the next one is students, the students table store the data of users based on their role. and the relation between user and student is user_id in students table.
And the form includes three inputs for text and one for excel file to import. I want to import the users by file and their data by inputs.
my form is like this:
<form method='post' action="{{ route('importExcel') }}" enctype="multipart/form-data">
          @csrf

                فاکولته

                    <select name='faculty' class="form-control" id="faculty">
                            <option value=""> انتخاب فاکولته </option>
                        @foreach($faculties as $faculty)
                            <option value="{{ $faculty->id }}" >{{ $faculty->name }}</option>
                        @endforeach
                    </select>

                دیپارتمنت

                    <select class="form-control" name="department" id="department">
                        <option value="">انتخاب دیپارتمنت</option>
                        @foreach($departments as $department)
                            <option value="{{ $department->id }}">{{ $department->name }}</option>
                        @endforeach
                    </select>

                فصل

                    <select name="sesson" id="sesson" class="form-control">
                        <option value="">انتخاب فصل</option>
                        <option value="spring">بهار</option>
                        <option value="fall">خزان</option>
                    </select>

                فایل اکسل

                    <input type="file" name="file" class="form-control" id="file">

            <input type="hidden" name="role" value="user">
            <input type="hidden" name="admin" value="admin">

            <button type="submit" class="btn btn-info pull-left submit">تایید</button>

        </form>

and my import class is like this:
class UsersImport implements ToCollection
{
    public function collection(Collection $rows)
    {
        foreach ($rows as $row)
        {
            User::create([
                'name'     => str_replace(' ', '_', $row['name']),
                'email'    => $row['email'],
                'password' => bcrypt(str_replace(' ', '_', $row['name'])),
                'role'     => 'user',
            ]);

            Student::create([
                'user_id' =>  DB::table('users')->getPdo()->lastInsertId(),
                'department_id' => $row['department'],
                'faculty_id'    => $row['faculty'],
                'sesson'        => $row['sesson']
            ]);
        }
    }

}

and my controller is like this:
try{
            $this->validate($request,[
                'faculty' => 'required',
                'department'=> 'required',
                'sesson'=> 'required',
                'file'=> 'required',
            ]);

            $file = $request->file('file');
            $faculty =  $request-> faculty;
            $department = $request -> department;
            $sesson = $request -> sesson;

           Excel::import(new UsersImport,[$file, $faculty, $department, $sesson]);
           return redirect()->route('admin.students')->with('success','عملیات موفقانه انجام شد.');

        }
        catch(Exception $e){
            return redirect()->back()->with('error','عملیات انجام نشد!');
        }

but its not working, the error is like this: pathinfo() expects parameter 1 to be string, array given


text:
Q: Nested svn repositories I got a "Project A" in repository. But in that project I'm using a library, which is hosted on Google Code. There is my question: is there any way, to have that library files "hooked" to Google Code SVN, and simultaneously my project in my repo (it's parent to that library), so I can commit library files into my repository when I decide, that outer project revision is ok?
I've tried to do checkout in the library folder, files were downloaded from Google's Code repository. But I that case wasn't able to add them to my repository - they weren't visible in "Add" window.

A: You can use an External which will causes SVN to checkout the latest version of the external files, when you checkout your repository.
From the above page:

The convenience of the svn:externals property is that once it is set on a versioned directory, everyone who checks out a working copy with that directory also gets the benefit of the externals definition. In other words, once one person has made the effort to define those nested working copy checkouts, no one else has to bother—Subversion will, upon checkout of the original working copy, also checkout the external working copies.


text:
Q: Extracting GPX / KML routes from embedded Google Map I want to extract the route data that is shown below to a GPX or KML file. Being that this map is programmatically created and not a "Google My Maps" type of embedded map, is there a way to download these routes for offline use?
http://gts.groomertrackingsystems.com/map


text:
Q: Процедура, поиск по параметру Добрый день!
У меня процедура:
USE [Fstp]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE Report
    @StartDate DateTime,
    @EndDate DateTime,
    @client nvarchar(100) = ''
AS
BEGIN

        SET NOCOUNT ON;
        SELECT
        (case when oa.id is not null then
                 (case when c.CLIENTS_CLASS='cl_privs' then cp.fio
                 when c.CLIENTS_CLASS='cl_ent' then ce.jur_name   end)
               else (case when mst_c.CLIENTS_CLASS='cl_privs'  then  case when ma.role_participant_type=2 then mst_cip.name else mst_cp.fio end
                  when mst_c.CLIENTS_CLASS='cl_ent' then mst_ce.jur_name  end)  end) as 'Страхователь',
        ISNULL(convert(Varchar(10),oa.policy_date,104), convert(Varchar(10),ma.PolicyDate,104)) as policy_date
        FROM
    dbo.DOCS d
    inner JOIN ogpo_application oa ON oa.docs_id = d.DOCS_ID
    inner join docs_policy dp on dp.docs_id=d.DOCS_ID
    left join clients c on oa.insurer_id=c.CLIENTS_ID
         left join cl_privs cp on c.CLIENTS_ID=cp.CL_PRIVS_ID
         left join cl_ent ce on c.CLIENTS_ID=ce.CL_ENT_ID
    LEFT JOIN mst_application ma ON ma.docs_id = d.DOCS_ID
    left join mst_docs_policy mdp on mdp.docs_id=d.DOCS_ID
    left join clients mst_c on ma.insurer_id=mst_c.CLIENTS_ID
        left join cl_privs mst_cp on mst_c.CLIENTS_ID=mst_cp.CL_PRIVS_ID
        left join client_IPKH mst_cip on mst_cip.clients_id=mst_c.CLIENTS_ID and mst_cip.is_history=0
        left join cl_ent mst_ce on mst_c.CLIENTS_ID=mst_ce.CL_ENT_ID

Where (policy_date  between @StartDate AND @EndDate) and
('Страхователь' = '' or 'Страхователь' = @client)

Мне надо поиск по policy_date и 'Страхователь'. В данном запросе поиск не идет. 'Страхователь' = @client мне кажется так неправильно.
Как в случае условии case конструкции приравнять параметр?

A: *

*Не используйте русские имена полей.

*Если уж использовали - указывайте их не в кавычках, а в квадратных скобках: as [Страхователь], [Страхователь] = '' or [Страхователь] = @client

*Заверните кейс в outer apply и в условии ссылайтесь на него. Как-нибудь так:
SELECT insurInfo.Name, insurInfo.policy_date
    FROM
dbo.DOCS d
inner JOIN ogpo_application oa ON oa.docs_id = d.DOCS_ID
inner join docs_policy dp on dp.docs_id=d.DOCS_ID
left join clients c on oa.insurer_id=c.CLIENTS_ID
     left join cl_privs cp on c.CLIENTS_ID=cp.CL_PRIVS_ID
     left join cl_ent ce on c.CLIENTS_ID=ce.CL_ENT_ID
LEFT JOIN mst_application ma ON ma.docs_id = d.DOCS_ID
left join mst_docs_policy mdp on mdp.docs_id=d.DOCS_ID
left join clients mst_c on ma.insurer_id=mst_c.CLIENTS_ID
    left join cl_privs mst_cp on mst_c.CLIENTS_ID=mst_cp.CL_PRIVS_ID
    left join client_IPKH mst_cip on mst_cip.clients_id=mst_c.CLIENTS_ID and mst_cip.is_history=0
    left join cl_ent mst_ce on mst_c.CLIENTS_ID=mst_ce.CL_ENT_ID
    outer apply (select (case when oa.id is not null then
             (case when c.CLIENTS_CLASS='cl_privs' then cp.fio
             when c.CLIENTS_CLASS='cl_ent' then ce.jur_name   end)
           else (case when mst_c.CLIENTS_CLASS='cl_privs'  then  case when ma.role_participant_type=2 then mst_cip.name else mst_cp.fio end
              when mst_c.CLIENTS_CLASS='cl_ent' then mst_ce.jur_name  end)  end) as Name, ISNULL(convert(Varchar(10),oa.policy_date,104), convert(Varchar(10),ma.PolicyDate,104)) as policy_date) InsurInfo
Where (InsurInfo.policy_date  between @StartDate AND @EndDate) and
      (InsurInfo.Name = '' or InsurInfo.Name = @client)

A: Как написал Zuffir, лучше не использовать русский имена полей и псевдонимы.
Но в целом можно оставить, как есть, заменив только на условие
([Страхователь] = '' or [Страхователь] = @client)

Или даже на
(Страхователь = '' or Страхователь = @client)

Но в целом, рекоменудю пересмотреть немного запросы, т.к. лучше фильтровать по основным столбцам таблицы, а не по результатам вложенных запросов. Иначе будут проблемы с производительностью.
UPD
Раз это не вложенный запрос, то можно продублировать логику вычислимого поля. Получится что-то вроде:
(oa.id is not null and ((c.CLIENTS_CLASS='cl_privs' and cp.fio = @client) or
(c.CLIENTS_CLASS='cl_ent' and ce.jur_name = @client)))
or (oa.id is null and ((mst_c.CLIENTS_CLASS='cl_privs' and
((ma.role_participant_type<>2 and mst_cp.fio = @client) or
(ma.role_participant_type=2 and mst_cip.name = @client))) or
(mst_c.CLIENTS_CLASS='cl_ent' and mst_ce.jur_name = @client)))

A: WHERE парсится до SELECT, так что в нем нельзя обращаться к колонкам по алиазу. Есть два варианта:
Обернуть в еще один селект:
SELECT * FROM (ваш SELECT без WHERE) restable
WHERE (policy_date  between @StartDate AND @EndDate) and
      ([Страхователь] = '' or [Страхователь] = @client)

Использовать CTE:
;WITH restable as
    (ваш SELECT без WHERE)
SELECT * FROM restable
WHERE (policy_date  between @StartDate AND @EndDate) and
      ([Страхователь] = '' or [Страхователь] = @client)

оба варианта c точки зрения SQL Server эквивалентны подстановки всего CASE в WHERE


text:
Q: make a function work for elements dynamically added with ajax How to make a jquery function work for elements added after its first run which does not apply to dynamically added elements.
Code:
jQuery(function() {
   jQuery.support.placeholder = false;
   test = document.createElement('input');
   if('placeholder' in test) jQuery.support.placeholder = true;
});

$(function() {
   var active = document.activeElement;
   if(!$.support.placeholder) {
      $(':text').focus(function () {
         if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) {
            $(this).val('');
            if($(this).hasClass("dcphc")===true){$(this).removeClass('dcph');}
            else if($(this).hasClass("dcphmgc")===true){$(this).removeClass('dcphmg');}
            else if($(this).hasClass("dcphlgc")===true){$(this).removeClass('dcphlg');}
         }
      }).blur(function () {
         if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
            $(this).val($(this).attr('placeholder'));
            if($(this).hasClass("dcphc")===true){$(this).addClass('dcph');}
            else if($(this).hasClass("dcphmgc")===true){$(this).addClass('dcphmg');}
            else if($(this).hasClass("dcphlgc")===true){$(this).addClass('dcphlg');}
         }
      });
      }
      else{
        $(':text').blur(function () {
         if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
            $(this).val("");
         }
      });
      }
      $(':text').blur();
      $(active).focus();
});

function ref_dcph(w){
      var active = document.activeElement;
      if(!$.support.placeholder) {
      $(w).focus(function () {
         if ($(this).attr('placeholder') != '' && $(this).val() == $(this).attr('placeholder')) {
            $(this).val('');
            if($(this).hasClass("dcphc")===true){$(this).removeClass('dcph');}
            else if($(this).hasClass("dcphmgc")===true){$(this).removeClass('dcphmg');}
            else if($(this).hasClass("dcphlgc")===true){$(this).removeClass('dcphlg');}
         }
      }).blur(function () {
         if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
            $(this).val($(this).attr('placeholder'));
            if($(this).hasClass("dcphc")===true){$(this).addClass('dcph');}
            else if($(this).hasClass("dcphmgc")===true){$(this).addClass('dcphmg');}
            else if($(this).hasClass("dcphlgc")===true){$(this).addClass('dcphlg');}
         }
      });
      }
      else{
        $(w).blur(function () {
         if ($(this).attr('placeholder') != '' && ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))) {
            $(this).val("");
         }
      });
      }
      $(w).blur();
      $(active).focus();
}

First function does the work, the second one ref_dcph (reference dom control place holder)
is a copy of the first one but I use it every time I add new elements that have a particular identifier other than being input or textarea so that I don't have to go through unbind on items to which the function is already attached.
I would need a twist on the first one for it to be run also on new dynamycally elements, I don't understand how to use "on".
--
Also, what would happen to elements that get removed from the dom and added again (with the same id - being the same element also) - I noticed with the click handler if you want to do a $(elem).click(function(){}); you have to go through unbind - else the click is doubled.
I wonder how to make the first twist and also check if a previous focus() or blur() was attached to the same element that is being detected as dynamically generated and if it is the case then don't attach again focus() and blur(). Cause I have elements on the page that get removed from the dom and then are added again which involve an input or a textarea with a placeholder.

A:           $("body").on("blur", ":text", function(event){});


text:
Q: C++ template typename iterator Consider the following header file:
template <typename T> struct tNode
{
    T Data;                      //the data contained within this node
    list<tNode<T>*> SubNodes;       //a list of tNodes pointers under this tNode

    tNode(const T& theData)
    //PRE:  theData is initialized
    //POST: this->data == theData and this->SubNodes have an initial capacity
    //      equal to INIT_CAPACITY, it is set to the head of SubNodes
    {
        this->Data = theData;
        SubNodes(INIT_CAPACITY);   //INIT_CAPACITY is 10
    }

};

Now consider a line of code from another file:
list<tNode<T>*>::iterator it();  //iterate through the SubNodes

The compiler is giving me this error message: Tree.h:38:17: error: need 'typename' before 'std::list<tNode<T>*>::iterator' because 'std::list<tNode<T>*>' is a dependent scope
I have no idea why the compiler is yelling at me for this.

A: In list<tNode<T>*>::iterator, you have a dependant name, that is, a name that depends on a template parameter.
As such, the compiler can't inspect list<tNode<T>*> (it doesn't have its definition at this point) and so it doesn't know whether list<tNode<T>*>::iterator is either a static field or a type.
In such a situation, the compiler assumes that it is a field, so in your case it yields a syntax error. To solve the issue, just tell the compiler that it is a type by putting a typename ahead of the declaration:
typename list<tNode<T>*>::iterator it

A: list<tNode<T>*>::iterator is a dependant name, a type that depends on a template parameter. In order to declare that variable, you need to use the typename keyword:
typename list<tNode<T>*>::iterator it = ...;

A: More backround on the answers above is provided here
A Description of the C++ typename keyword
I had a different but similar problem in that I wanted to typedef an iterator for child nodes with the :
typedef std::vector<NodeType*>::iterator ChildIterator;

which gave me the same compiler error. With the suggestions here and help of the above link, the solution to my problem is to use
typedef typename std::vector<NodeType*>::iterator ChildIterator;

instead.

A: Firstly, as other answers already noted, type names nested into dependent types need to be prepended with the typename keyword.
That keyword is not needed when the template is fully specialized, meaning that list<tnode<int>*>::iterator does not need typename, but when the outer class still depends on template parameter T, typename must be present.
template <typename T> void foo() {
  list<tnode<int>*>::iterator it1; // OK without typename
  typename list<tnode<T>*>::iterator it2; // typename necessary
}

Secondly, even with typename the
typename list<tNode<T>*>::iterator it();

declaration will declare a function, not an iterator. Remove the ().

A: iterator can be a nested class and a class attribute
The ambiguity the typename keyword resolves is, that T::iterator (or in your case list<tNode<T>*>::iterator) can refer either to a nested type (case 1) or a static class attribute (case 2).
The compiler interprets a construction like this as case 2 by default. The typename keyword enforces case 1.
The following example, demonstrates an implementation each for case 1 and case 2. In both cases the line T::iterator * iter; appears. In case 1 it is only valid with the typename argument prepended. In case 2 it represent just a double (without any operation). The asteric * is just added, as it is in case 1 an indicator for a pointer and in case 2 the multiplication operator.
minimal reproducible example
#include <iostream>

template <class T>
void foo1() {
    typename T::iterator * iter;
    std::cout << "foo1: iter points to: " << iter << std::endl;
}

class class1 {
    public:
        class iterator // subclass
        {
        };
};

template <class T>
void foo2() {
    double iter = 2.;
    T::iterator * iter;
    std::cout << "foo2: \"T::iterator * iter\" is a simple double: " << T::iterator * iter << std::endl;
}

class class2 {
    public:
        constexpr static double iterator = 11.;
};

int main()
{
    foo1<class1>();
    foo2<class2>();
    // foo1<class2>(); // does not compile
    // foo2<class1>(); // does not compile
    return 0;
}

output
foo1: iter points to: 0x4010b0
foo2: "T::iterator * iter" is a simple double: 22

Credits to trueter for pointing out the article A Description of the C++ typename keyword. This answer is basically a short wrap up.


text:
Q: How to identify a custom UIWebView like in FlipBoard or MobileRss How can I identify if an application is using a custom UIWebView?
For instance in this case:

Can someone suggest me how this can be done?

A: If by "custom", you mean sub-classing UIWebView, nothing you described in your requirements calls for doing that.  Instead, a combination of HTML/CSS/Javascript executed within the UIWebView, plus any necessary UIKit controls positioned around the UIWebView, should give you everything you need.


text:
Q: Select value field out of possible similar key names I have a pom.json with a bug in it:
{
        "Components": [
                {
                        "ARTIFACTID": "good artifact",
                        "BuildJobDate": "2020-01-20T16:39:50"
                },
                {
                        "ARTIFACT_ID": "bad artifact",
                        "BuildJobDate": "'2021-11-29T17:23:39'"
                },
                {
                        "ARTIFACTID": "another good artifact",
                        "BuildJobDate": "2022-01-26T21:18:20"
                }
        ]
}

in my install script I collect all ARTIFACTID:
local -ra artifacts=( $(jq -r '.Components | .[].ARTIFACTID' "$manifest") )

tried to fix it by .[] | {ARTIFACTID, ARTIFACT_ID} but can't understand how to leave only the valid values
my question is: is there is a way to select field out of possible fields in jq ?

A: Use a select expression with a boolean condition
.Components | map(select(.ARTIFACTID or .ARTIFACT_ID))

Doing {ARTIFACTID, ARTIFACT_ID} requires either of the keys to be present in the resultant object. So if either of the keys are not present they are updated with null. Using select clause evaluates the expression and produces the result into the object only if it evaluates to true
jqplay - demo


text:
Q: Angular2 rxjs multiple result First, I'm sorry I do not have enough English.
Hi, I make something with angular2.
This is part of my code.
  public computePredictedGameRate( targetGame: Game, targetUser: User, compareUsers: User[]):number {
    var observableCompareUsers = Observable.from(compareUsers);
    var result = -123;

    Observable.forkJoin(
      this.gameRateService.getGameRatesById( targetUser.id ),
      observableCompareUsers.flatMap( compareUser => this.gameRateService.getGameRatesById( compareUser.id ) ),
      observableCompareUsers.flatMap( compareUser => this.gameRateService.getGameRateByTitleAndId( targetGame.title, compareUser.id ) )
    ).subscribe(
      res => {
        //something for result;
      }
    );
    return result;
  }

I want to get values of them.
this.gameRateService.getGameRatesById( compareUser.id )
this.gameRateService.getGameRateByTitleAndId( targetGame.title, compareUser.id )

compareUsers have 5 users.
So, The functions return value[5][?]
but, I can't get their whole value.
they return just last one. like value[?] <= this value is fifth user own.
i think they emit value one by one and overwrite themselves.
please help me. I have sleep just 3 hours for 2 days.

A: Observable.forkJoin works like this:
Observable.forkJoin(
   obs1,
   obs2,
   obs3
).subscribe(result => {
   const resultOfObs1 = result[0];
   const resultOfObs2 = result[1];
   const resultOfObs3 = result[2];
});

You can map the forked-result and return a new Observable..
public computePredictedGameRate(
   targetGame: Game,
   targetUser: User,
   compareUsers: User[]
): Observable<number> { // <<-- return's an Observable instead a number .. !

    var observableCompareUsers = Observable.from(compareUsers);

    return Observable.forkJoin(
       this.gameRateService.getGameRatesById( targetUser.id ),
       observableCompareUsers.flatMap( compareUser => this.gameRateService.getGameRatesById( compareUser.id ) ),
       observableCompareUsers.flatMap( compareUser => this.gameRateService.getGameRateByTitleAndId( targetGame.title, compareUser.id ) )
    ).map(res => {
       const gameRatesById1 = res[0];
       const gameRatesById2 = res[1];
       const gameRatesByTitle = res[2];

       // do something with the results..
       // ..

       return -123; // your numeric return value here !
   });
}

And then call it like this:
computePredictedGameRate(game, user, users).subscribe(gameRate => {
   console.log(gameRate);
});


text:
Q: Defer Parsing of "createjs.min.js" not working I made an animation using  Adobe Animate and embedded it in a html-widget on the website, while test.html and createjs.min.js are stored locally.
html in the widget looks like this:
<iframe sandbox="allow-scripts" src="https://example.com/test.html" width="678" height="678"></iframe>

the "test.html" starts
<!-- write your code here -->
<script src="createjs.min.js"></script>
<script>
var createjs,AdobeAn;!function(t,e){var n,i={},o={},s={};i.webFontTxtInst={};var a=0,r=0,l=[],c=......

now I realize, that this is not loaded defer. although all other iframes are loaded defer. If I add defer to the "test.html" like this...
<!-- write your code here -->
<script defer src="createjs.min.js"></script>
<script>
var createjs,AdobeAn;!function(t,e){var n,i={},o={},s={};i.webFontTxtInst={};var a=0,r=0,l=[],c=......

the animation is not loading anymore (only the background color can be seen).
Any clues how to solve this?
This is how it looks if the animation runs ;-)


text:
Q: Validate multiple TextFormField forms inside a ListView.builder on parent I'm trying to achieve the following Widget in Flutter:

Where every Stateful object is composed as follows:

Every single TextFormField validates itself and changes color when it's invalid (and this actually works).
My requirement is to have validation on page-level for every single Stateful Widget.
So, if any of the TextFormFields child of Stateful 1 is invalid, it turns red, and disables the blue button on parent level.
My problem is that when one of TextFormField is invalid, it becomes red, but after throwing the validation error to the parent and trying to disable the Blue button via setState(), it throws the error:
setState() or markNeedsBuild() called during build.

This MyPage widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.
The widget on which setState() or markNeedsBuild() was called was: MyPage

Here is the code of my Stateful Widget:
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class MyStatefulWidget extends StatefulWidget {
  SomeUserData userData;
  int index;
  Function(String) onDeleted;
  bool isEnabled;

  MyStatefulWidget(
      {required this.userData,
        required this.index,
        required this.onDeleted,
        this.isEnabled = false,
        Key? key})
      : super(key: key);

  @override
  State<MyStatefulWidget> createState() => MyStatefulWidgetState();
}

class MyStatefulWidgetState extends State<MyStatefulWidget> {
  final TextEditingController _controller = TextEditingController();
  final TextEditingController _controller1 = TextEditingController();
  final TextEditingController _controller2 = TextEditingController();

  bool isFormValid = true;

  @override
  Widget build(BuildContext context) {

    return Column(children: [
      Text('abc'),
      Padding(
        padding: const EdgeInsets.only(top: 30.0),
        child: TextFormField(
          controller: _controller,
          hint: 'test',
        ),
      ),
      MyTextFormField(
        controller: _controller1,
        hint: 'test2',
      ),

      MyTextFormField(
          controller: _controller2,
          hint: 'test2',
          onValidityChanged: (isValid) {
            MyStatefulWidgetValidationChanged(isValid, widget.userData)
                .dispatch(context);
          }),
      MyTextFormField(
        controller: _controller2,
        hint: 'test2',),
    ]);
  }
}

And here is the code of my MyPage Widget:
final Map<UserData, bool> _myStatefulWidgetsValidity =
    Map<UserData, bool>.identity();

bool _areFieldsValid() =>
    _field1.isEmpty &&
    _field2.isEmpty &&
    _fieldN.isEmpty &&
    !(_myStatefulWidgetsValidity.values.any((element) => element == false));

Widget build(BuildContext context) {
  return Scaffold(
    hasBackArrow: true,
    title: 'abc',
    body: SingleChildScrollView(
      child: FutureBuilder(
          future: _getData(),
          builder: (context, snapshot) {
            if (snapshot.hasData) {
              return NotificationListener<MyStatefulWidgetValidationChanged>(
                onNotification: (n) {
                  if (_myStatefulWidgetsValidity
                      .containsKey(n.userData)) {
                    setState(() {
                      _myStatefulWidgetsValidity[n.userData] =
                          n.isValid;
                    });
                  }

                  return true;
                },
                child: Column(
                  children: [
                    Center(
                        child: Text('some text'),
                    Padding(
                      padding: const EdgeInsets.only(top: 40.0),
                      child: MyTextFormField(
                        controller: _someController,
                      ),
                    ),
                    Padding(
                      padding: const EdgeInsets.only(top: 15.0),
                      child: MyTextFormField(
                        controller: _someController,
                      ),
                    ),
                    ListView.builder(
                        shrinkWrap: true,
                        physics: const NeverScrollableScrollPhysics(),
                        itemCount: someUserData.length,
                        itemBuilder: (c, i) {
                          GlobalKey<MyStatefulWidgetState> _myStatefulWidgetState =
                              GlobalKey<MyStatefulWidgetState>();

                          _myStatefulWidgetsValidity
                              .addAll({userData[i]: true});

                          var userDataBox = MyStatefulWidget(
                              userData: userData[i],
                              index: i,
                              onDeleted: _blabla,
                              key: _myStatefulWidgetState,
                              isEnabled: _isEnabled);
                          myStatefulWidgets.add(_myStatefulWidgetState);

                          return userDataBox;
                        }),
                    Button(
                        onPressed:
                            _areFieldsValid() ? _updateUserData : null,

                        text: 'Save'),
            )]);
            } else {
              return const Container();
            }
          }),
    ),
  );
}

Obviously I tried to anonimize the code as much as I could.


text:
Q: How to implement Burp suite's custom SSL Certificate? In Burp Suite, from Project Options -> SSL we can import PKCS#12 files with password for specific hostnames.
I tried manually using commands below to export block and key files and then pass them to my http client in golang using tls.LoadX509KeyPair(). But upon sending any requests, I receive remote error: tls: handshake failure.
These are the commands I used:
openssl pkcs12 -in cert.p12 -clcerts -nokeys -out usercert.pem
openssl pkcs12 -in cert.p12 -nocerts -out userkey.pem -nodes

What am I missing?

A: If using a self-signed certificate specify InsecureSkipVerify: true in your tls configuration. Pulled from the documentation:

   // InsecureSkipVerify controls whether a client verifies the
   // server's certificate chain and host name.
   // If InsecureSkipVerify is true, TLS accepts any certificate
   // presented by the server and any host name in that certificate.
   // In this mode, TLS is susceptible to man-in-the-middle attacks.
   // This should be used only for testing.```

Otherwise, add your certificate to the Certificates list in your tls configuration.


text:
Q: Why are my charFormat styles only working on selections, and only those made in a specific direction? I've been trying to be more explicit in my assignment of character formats for a text editor so that I can understand what I might be able to customize with my current skill range. While the basic copy-paste versions of my format methods worked pretty well, the version below keeps working and then not working in frustrating ways and need help figuring out what might be causing it.
The editor was originally intended to be a WYSIWYG editor styled via tags for documentation. Qt's confusing use of Html hasn't made that easy.

My basic flow is to extract a copy of the current format, check its current state, invert it, and reapply the format to the position or selection it was extracted from.
# textEdit is a QTextEdit with a loaded document.

# This function is one of several related pairs called by a switchboard.
# It's intent is to invert the italic state of the current position/selection.

def toggle_italic_text(textEdit):
    # Get the cursor, and the format's state at its current selection/position.
    cursor = textEdit.textCursor()
    charFormat = cursor.charFormat()
    currentState = charFormat.fontItalic()

    # Invert the state within the format.
    print(currentState)
    charFormat.setFontItalic(not currentState)
    print(charFormat.fontItalic())

    # Reapply the format to the cursor's current selection/position.
    cursor.mergeCharFormat(charFormat)

When I first implemented it, this worked find. Now, it only works on selections, and even then it seems to identify the wrong state depending which direction I make a selection. After experimenting with it, it appears that if I make a selection to the right, it inverts correctly. If I make a selection to the left, it doesn't.
When trying to assign it to a position without a selection, the printed state changes from False to True, which is desired, yet the effect doesn't apply as I type. If I run it repeatedly in place, it continues to change from False to True, meaning the change is being lost.
The function is being called consistently and running through completely. The stored state of the charFormat copy does change.
Why has this pattern stopped working? Am I using charFormats wrong? Why does the direction of selection change the results?
As far as what changed on my end, I had been getting lost in my styling efforts after needing to apply styles through QFonts, QCharFormats, QPalette, and CSS stylesheets (and doc.defaultStylesheet) targeting both widgets and html tags. I desperately wanted my styles to be controlled through one approach, but couldn't figure out the hierarchy or find an approach that applied widely enough. In the end, I stripped out everything except for the stylesheet assigned to the window.
If there's no issue with the code itself, I'm really hoping for hints at what might be disrupting things. It took me awhile to get used to the idea that cursors and formats are copies meant to be changed and reapplied, while the document and its blocks are the real structure.

A: The important thing that must be considered about QTextCursor.charFormat() is this:

Returns the format of the character immediately before the cursor position().

So, not only this doesn't work very well with selections that include multiple character formats, but you also have to consider the cursor position, which might change in a selection: it could be at the beginning (so it would return the format of the character before the selection), or at the end (returning the format of the last character in the selection).
If you want to invert the state based on the current cursor position (if at the beginning, use the first character, if at the end, use the last), then you can use the following:
    def toggle_italic_text(self):
        cursor = self.textEdit.textCursor()
        if not cursor.hasSelection():
            charFormat = cursor.charFormat()
            charFormat.setFontItalic(not charFormat.fontItalic())
            cursor.setCharFormat(charFormat)
            # in this case, the cursor has to be applied to the textEdit to ensure
            # that the following typed characters use the new format
            self.textEdit.setTextCursor(cursor)
            return

        start = cursor.selectionStart()
        end = cursor.selectionEnd()
        newCursor = QtGui.QTextCursor(self.textEdit.document())
        newCursor.setPosition(start)

        if cursor.position() == start:
            cursor.setPosition(start + 1)
        charFormat = cursor.charFormat()
        charFormat.setFontItalic(not charFormat.fontItalic())
        newCursor.setPosition(end, cursor.KeepAnchor)
        newCursor.mergeCharFormat(charFormat)

If you want to invert all states in the selection, you need to cycle through all characters.
While you could just change the char format for each character, that wouldn't be a very good thing for very large selections, so the solution is to apply the italic only when the char format actually changes from the previous state, and when at the end of the selection.
    def toggle_italic_text(self):
        # ...
        start = cursor.selectionStart()
        end = cursor.selectionEnd()
        newCursor = QtGui.QTextCursor(self.textEdit.document())
        newCursor.setPosition(start)

        cursor.setPosition(start)
        prevState = cursor.charFormat().fontItalic()
        while cursor.position() < end:
            cursor.movePosition(cursor.Right)
            charFormat = cursor.charFormat()
            if charFormat.fontItalic() != prevState or cursor.position() >= end:
                newPos = cursor.position()
                if cursor.position() < end:
                    newPos -= 1
                newCursor.setPosition(newPos, cursor.KeepAnchor)
                charFormat.setFontItalic(not prevState)
                newCursor.mergeCharFormat(charFormat)
                prevState = not prevState
                newCursor.setPosition(cursor.position() - 1)