text:
Q: How to execute JUnit TestSuite with some delay between each TestCase? I have two JUnit4 Test classes say MyTest1, MyTest2 each having a couple of test methods.
Actually these are Selenium JUnit TestCases.
In MyTest1.someMethodInsertingDate() i will insert some data into DB and it will take some time to process.
In MyTest2.validateProcessedData() I need to verify that the processed data inserted in the first test method is valid or not.
I know coupling between test methods/cases is not a good practice. But I am writing SeleniumTests to automate User Actions on UI, so I have to do this.
I am executing these two TestCases using MyTestSuite with @RunWith & @SuiteClasses.
Now How can I tell JUnit to execute MyTest2 TestCase with some delay,say 1 minute.

A: You can use the simple "@Before" annotation.
It should delay the execution thread each time it starts the test.
Example:
@Before
public void initialise() throws InterruptedException {
    Thread.sleep(2000);
}

A: I think you're not getting an answer (at least not one you want) to this question because it is generally considered bad practice to rely upon these mechanics in a test suite.  Your tests will become very difficult to maintain if you have these types of reliance upon each other, and can (most likely will) cause you difficulty in debugging them later.
You could possibly abstract this first test out, and this second test could perhaps extend it.  This second test will then use the common functionality in its setup (perhaps with different data).  This should allow you to run the tests concurrently since each will then be an atomic entity.

A: As we hopefully all agree that this is bad practice in general there are exceptions.
To state the obvious, we're not talking about unit tests but integration tests (JUnit might not be the right tool for the job but I haven't found anything better)
I am doing Selenium tests as well. I do integration testing against 3rd party test server which behavior is random if I run tests without sleep().
This is one of the possible solutions, please note that this was only tested by running once:
public class SleepySuite extends Suite {
    private final Logger log = LoggerFactory.getLogger(SleepySuite.class);
    private final Integer defaultSleepSec = 0;
    private final Integer sleepSec;

    public SleepySuite(Class<?> klass, RunnerBuilder builder) throws InitializationError {
        super(klass, builder);
        sleepSec = initSleep(klass);
    }

    private Integer initSleep(Class<?> klass) {
        SleepSec ts = klass.getAnnotation(SleepSec.class);
        Integer sleep = defaultSleepSec;
        if (ts != null) {
            sleep = ts.value();
            log.debug("Configured with sleep time: {}s", sleep);
        }
        return sleep;
    }

    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.TYPE)
    @Inherited
    public @interface SleepSec {
        public int value();
    }

    /**
     * @see org.junit.runners.Suite#runChild(org.junit.runner.Runner, org.junit.runner.notification.RunNotifier)
     */
    @Override
    protected void runChild(Runner runner, RunNotifier notifier) {
        super.runChild(runner, notifier);
        //Simply wrapped Thread.sleep(long)
        TestUtils.sleep(sleepSec);
    }
}

Your suite exmaple:
@RunWith(SleepySuite.class)
@Suite.SuiteClasses({
   Some.class,
   SomeOther.class
})
@SleepySuite.TimeoutSec(30)
public class YourSuite{
}

A: Sharing for posterity,
The usage of Thread#sleep in the JUnit test always be discouraged by static code analysis tool like sonarqube. Instead of using the aforementioned approach prefer some libraries like Awaitility. Though it is not an ideal solution, this is a much better approach than the usage of Thread#sleep.
Required code changes:
    testImplementation('org.awaitility:awaitility:4.0.3')

Put the below snippet in the place where you require to place some delay. In the following example, I have set the delay duration time as one second. Conceptually, this will do the same task as Thread.sleep(1000)
Awaitility.await().pollDelay(Durations.ONE_SECOND).until(() -> true);

A: You can induce some wait in Java in the first test case after your database code like this:
long end3 = System.currentTimeMillis() + 6000;
        while(System.currentTimeMillis()<end3)
        {
            // Do nothing here Just time pass.
        }

This will ensure that Java code waits for 6000 ms after the DB code and that should be enough to add the data. You can adjust time according to the size of your data.

A: You can sleep the script by adding something at the end of each test method.
In PHP:
sleep(60);


text:
Q: "java.lang.InternalError: Unexpected CryptoAPI failure generating seed" during silent installation We are installing our product via script for automated UI tests.
Sometimes the installation failes with the following error.

java.lang.InternalError: Unexpected CryptoAPI failure generating seed
      at java.base/sun.security.provider.NativeSeedGenerator.getSeedBytes(Unknown Source)
      at java.base/sun.security.provider.SeedGenerator.generateSeed(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.lambda$static$0(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.getEntropyInput(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.getEntropyInput(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.instantiateIfNecessary(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.engineNextBytes(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.engineNextBytes(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg$SeederHolder.lambda$static$0(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.getEntropyInput(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.getEntropyInput(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.instantiateIfNecessary(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.engineNextBytes(Unknown Source)
      at java.base/sun.security.provider.AbstractDrbg.engineNextBytes(Unknown Source)
      at java.base/sun.security.provider.DRBG.engineNextBytes(Unknown Source)
      at java.base/java.security.SecureRandom.nextBytes(Unknown Source)
      at java.base/java.security.SecureRandom.next(Unknown Source)
      at java.base/java.util.Random.nextLong(Unknown Source)
      at java.base/java.io.File$TempDirectory.generateFile(Unknown Source)
      at java.base/java.io.File.createTempFile(Unknown Source)
      at java.base/java.io.File.createTempFile(Unknown Source)
      at com.exe4j.runtime.util.WinDel.scheduleDeletion(WinDel.java:85)
      at com.exe4j.runtime.WinLauncher$3.run(WinLauncher.java:118)

Is there any known bug or fix for this?

A: I had this problem in Oracle Weblogic. Adding the following to the java options helped me
-Djava.security.egd=file:/dev/./urandom

redpajama_set_name: RedPajamaStackExchange


text:
Q: Using a combobox to populate a datagrid in another window? I have a combo box in one window and a data grid in another, I want to be able to select an item from the combo box and click a button to take me to the next window where it contains a data grid with all the information based on the selected item in the combo box. I was just wondering if this is possible to pass data between windows.

A: you're searching for a way to passe data from a form to another
there are many ways to do so here is a link to a great response for such a question : passing data between wpf forms


text:
Q: App para de responder quando executa onStartCommand Eu chamo o service no onPause() da minha activity e assim que saio do app, ele para de responder depois de um tempo. Pelo que pesquisei pode ser que os processos sejam muito pesados para serem executados em segundo plano. Eu preciso verificar o horário pra saber se está na hora de enviar  a notificação.
public int onStartCommand(Intent intent, int flags, int startId) {
        if (inicio != null) {
            ok = trataData(d2,d3);
            horaNotificacao.set(Calendar.MILLISECOND,this.intervalo);
            while (ok == true){
                try {
                    agora = new Date();
                    if(agora.equals(horaNotificacao.getTime())){
                        gerarNotificacao();
                        horaNotificacao.set(Calendar.MILLISECOND,this.intervalo);
                    }
                } catch (FileNotFoundException e) {
                    e.printStackTrace();
                } catch (ParseException e) {
                    e.printStackTrace();
                }
                ok = trataData(d2,d3);
            }
        }
        return START_STICKY;
    }

trataData:
   public boolean trataData(Date d2, Date d3) {
        boolean ok = false;
        Date d1 = new Date();
        if (d1.before(d2) && d1.after(d3)){
            ok = true;
        }
        return ok;
    }

Acho q o problema ta nesse laço do ok, mas n vejo outra forma de fazer a verificação

A: O Service não é uma Thread separada, isso significa que ele roda na sua Main Thread fazendo assim com que sua aplicação pare de responder.
Para resolver o problema você precisa executar sua rotina dentro de uma nova Thread.
Ficaria desse jeito:
public int onStartCommand(Intent intent, int flags, int startId) {
    new Thread(new Runnable() {
       @Override
       public void run() {
          // Coloque sua rotina aqui dentro
       }).start();
    return Service.START_STICKY;
}

Com isto, a sua rotina demorada será executada em uma nova Thread. Do jeito que está no seu código, ela é executada no onPause() até terminar, por isso que acontece o problema.
Não esqueça também de parar o serviço após terminar a execução da rotina.

Veja mais nos links abaixo:
Android Service Example
Antipattern: freezing the UI with a Service and an IntentService


text:
Q: Generating video frames and assembling them in Java? I need to develop an application that can perform the following functions:

*

*Read in a set of data

*Generate frames and display them on-screen (probably using Graphics2D)

I believe I can easily achieve the above.
However, if the correct command-line flag is passed in, I want to be able to, instead of rendering the frames to the screen, render to a video file. (Container/codec is unimportant)
What is a way to achieve this?
Preferably avoiding having an intermediate directory full of image files.
Perhaps there is some way to open an ffmpeg process and feed in the frames (via stdin?) and have it do the job?


text:
Q: .NET vs HTML entities : it do a second decode? Why if I wrote on a .aspx page (on .NET 3.5) :
<%="Wählen Sie bitte"%>

it prints correctly on my html page :
Wählen Sie bitte

but if I write on a .aspx.cs page somethings like :
mySelectBox.Items.Add(new ListItem("Wählen Sie bitte", ""));

(which is the same string) it prints as option on the select an uncorrectly html :
W&auml;hlen Sie bitte

It does a "decode" of my string. Why? And how can I fix it?

A: Your first syntax is meant to output the HTML you pass in literally, so that any HTML you might include gets rendered instead of encoded.
The second syntax is meant to be passed the literal text you want to be displayed, though; it does the HTML encoding for you. You have over-encoded that value.

A: ASP.NET controls already HTML encode the output so you don't need to do it once again.
Simply:
mySelectBox.Items.Add(new ListItem("Wählen Sie bitte", ""));


text:
Q: Notification not vibrating or showing the light I'm using Visual Studio 2019 16.6.0 Preview 2.1 and I'm trying to get vibrate and the light to work on the Galaxy S10 (Android 10) I'm testing my app on.  I get the notification, but the phone doesn't vibrate and the light doesn't come on.  I'd also like to have a sound as well, but nothing I've tried on here complies in Visual Studio as all examples/samples I can find are in java.  My code complies and runs without error.
        if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.O)
        {
            string NOTIFICATION_CHANNEL_ID = "com.OML.Android";
            string channelName = "Notifications Service";
            NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, Android.App.NotificationImportance.None);
            chan.EnableLights(true);
            chan.EnableVibration(true);
            chan.LightColor = Color.Red;
            //chan.SetSound() <<-- simply can't figure out how to construct a Uri to the default sound
            chan.LockscreenVisibility = Android.App.NotificationVisibility.Private;
            NotificationManager manager = (NotificationManager)GetSystemService(Context.NotificationService);
            manager.CreateNotificationChannel(chan);
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID);
            Notification notification = notificationBuilder.SetOngoing(true)
                    .SetSmallIcon(Resource.Drawable.alert_box)
                    .SetContentTitle("Alert System")
                    .SetPriority(1)
                    .SetAutoCancel(true)
                    .Build();
            StartForeground(2, notification);
        } else
        {
            Notification notify = new Notification();
            notify.Defaults = NotificationDefaults.All;
            StartForeground(Constants.SERVICE_RUNNING_NOTIFICATION_ID, notify);
        }

So what am I missing?
* UPDATE *
Per @Cherry Bu - MSFT's answer I changed my code to:
        if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.O)
        {
            string NOTIFICATION_CHANNEL_ID = "com.OML.Android";
            string channelName = "Notifications Service";
            NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, Android.App.NotificationImportance.None);
            chan.EnableLights(true);
            chan.EnableVibration(true);
            chan.LightColor = Color.Red;
            chan.SetSound(RingtoneManager.GetDefaultUri(RingtoneType.Notification), new AudioAttributes.Builder().SetUsage(AudioUsageKind.Notification).Build());
            chan.LockscreenVisibility = Android.App.NotificationVisibility.Private;
            NotificationManager manager = (NotificationManager)GetSystemService(Context.NotificationService);
            manager.CreateNotificationChannel(chan);
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID);
            Notification notification = notificationBuilder.SetOngoing(true)
                    .SetSmallIcon(Resource.Drawable.alert_box)
                    .SetContentTitle("Alert System")
                    .SetPriority(1)
                    //.SetVibrate(new long[] { 1000, 1000 })
                    //,SetLights(Color.AliceBlue, 3000, 3000)
                    .SetAutoCancel(true)
                    .Build();
            StartForeground(2, notification);
        } else
        {
            Notification notify = new Notification();
            notify.Defaults = NotificationDefaults.All;
            StartForeground(Constants.SERVICE_RUNNING_NOTIFICATION_ID, notify);
        }
        SingletonServicemanager.isMyServiceRunning = true;
        return StartCommandResult.Sticky;
    }

I also added the following permissions to the manifest:
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />

* Update *
Took a look at the github project @Cherry Bu - MSFT posted and I believe I'm doing exactly the same as he is but my code doesn't work, so in the interest of solving this I am posting the code for my foreground service.  First, the code I use to start the service which is part of my Utils code:
    public static void StartForegroundServiceComapt<SignalRSrv>(Context context, Bundle args = null) where SignalRSrv : Service
    {
        var intent = new Intent(context, typeof(SignalRSrv));

        if (args != null)
        {
            intent.PutExtra("TheBundle", args);
        }

        if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.O)
        {
            context.StartForegroundService(intent);
        }
        else
        {
            context.StartService(intent);
        }
    }

As you can see from the code above, I'm starting a SignalR service, that code is:
public class SignalRSrv : Service
{
    private bool InstanceFieldsInitialized = false;
    private string username = "";
    private string firstname = "";
    private string lastname = "";
    private string company = "";
    private string department = "";
    private string section = "";
    private int notifyid = 0;
    public SignalRSingleton mInstance;

    private void InitializeInstanceFields()
    {
        mBinder = new LocalBinder(this);
    }

    private Handler mHandler; // to display any received messages
    private IBinder mBinder; // Binder given to clients
    private Notification notification = null;

    public SignalRSrv()
    {
        if (!InstanceFieldsInitialized)
        {
            InitializeInstanceFields();
            InstanceFieldsInitialized = true;
        }

    }

    public SignalRSingleton GetInstance()
    {
        return mInstance;
    }
    public override void OnCreate()
    {
        base.OnCreate();
        mInstance = SignalRSingleton.getInstance();
        mHandler = new Handler(Looper.MainLooper);
    }

    public override void OnDestroy()
    {
       try
        {
            if (Build.VERSION.SdkInt >= BuildVersionCodes.N)
            {
                StopForeground(StopForegroundFlags.Remove);
            }
            else
            {
                StopForeground(true);
            }

            StopSelf();
        }
        catch (System.Exception e)
        {
            var m = e.Message;
        }
    }

    public override IBinder OnBind(Intent intent)
    {
        return null;
    }

    private void startSignalR(Bundle bundle)
    {

        User MyUser = bundle.GetParcelable("MyUser") as User;
        if (MyUser.Department == null || MyUser.Department == "")
        {
            MyUser.Department = "none";
        }
        if (MyUser.Section == null || MyUser.Section == "")
        {
            MyUser.Section = "none";
        }
        mInstance.setmHubConnection(MyUser.Username, MyUser.Firstname ,MyUser.Lastname,MyUser.Company ,MyUser.Department,MyUser.Section, "FOREGROUND");
        mInstance.setHubProxy();

        try
        {
            // Connect the client to the hup
            mInstance.mHubConnection.Start().Wait(-1);

            mInstance.mHubProxy.On("broadcastMessage", (string platform, string message) =>
            {
                try
                {
                    if (!isApplicationInTheBackground())
                    {
                        showMessage(message);
                    } else
                    {
                        showNotification(message, bundle, notification);
                    }

                }
                catch (System.Exception e)
                {
                   var error = e.Message;
                }
            });
        }
        catch (System.Exception e) when (e is InterruptedException || e is ExecutionException)
        {
            //opps

            //var x = 1;
            return;
        }
    }

    public async void showMessage(string message)
    {

        try
        {

            var result = await UserDialogs.Instance.ConfirmAsync(new ConfirmConfig
            {
                Message = "Alert - " + message,
                OkText = "Ok",

            });
            if (result)
            {
                // do something
                var x = message;
            }
        }
        catch (System.Exception e)
        {
            var s = e.Message;
        }
    }
    public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
    {

        User MyUser = new User("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
        Bundle bundlee = intent.GetBundleExtra("TheBundle");
        MyUser = bundlee.GetParcelable("MyUser") as User;

        username = MyUser.Username;
        firstname = MyUser.Firstname;
        lastname = MyUser.Lastname;
        company = intent.GetStringExtra("theSelectedCompany");
        department = intent.GetStringExtra("theSelectedDepartment");
        section = intent.GetStringExtra("theSelectedSection");

        startSignalR(bundlee);

        if (Android.OS.Build.VERSION.SdkInt >= BuildVersionCodes.O)
        {
            string NOTIFICATION_CHANNEL_ID = "com.OML.Android";
            string channelName = "Notifications Service";
            NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, Android.App.NotificationImportance.None);
            chan.EnableLights(true);
            chan.EnableVibration(true);
            chan.LightColor = Color.Red;
            chan.SetSound(RingtoneManager.GetDefaultUri(RingtoneType.Notification), new AudioAttributes.Builder().SetUsage(AudioUsageKind.Notification).Build());
            chan.LockscreenVisibility = Android.App.NotificationVisibility.Private;
            NotificationManager manager = (NotificationManager)GetSystemService(Context.NotificationService);
            manager.CreateNotificationChannel(chan);
            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, NOTIFICATION_CHANNEL_ID);
            Notification notification = notificationBuilder.SetOngoing(true)
                    .SetSmallIcon(Resource.Drawable.alert_box)
                    .SetContentTitle("Alert System")
                    .SetPriority(1)
                    //.SetVibrate(new long[] { 1000, 1000 })
                    //,SetLights(Color.AliceBlue, 3000, 3000)
                    .SetAutoCancel(true)
                    .Build();
            StartForeground(Constants.SERVICE_RUNNING_NOTIFICATION_ID, notification);
        } else
        {
            Notification notify = new Notification();
            notify.Defaults = NotificationDefaults.All;
            StartForeground(Constants.SERVICE_RUNNING_NOTIFICATION_ID, notify);
        }
        SingletonServicemanager.isMyServiceRunning = true;
        return StartCommandResult.Sticky;
    }

    private void cancelnotification()
    {
        NotificationManager notificationManager = (NotificationManager)Android.App.Application.Context.GetSystemService(Context.NotificationService);
        notificationManager.Cancel(notifyid);

    }

    public void showNotification( string message, Bundle bundle, Notification notification)
    {
        try
        {
            Intent intent = new Intent();
            User MyUser = new User("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
            MyUser = bundle.GetParcelable("MyUser") as User;
            if (MyUser.Usertype != "")
            {
                if (MyUser.Usertype == "COMPADMIN")
                {
                    intent = new Intent(this, typeof(Drawer)); //Activity you want to open
                } else if (MyUser.Usertype == "DEPTADMIN") {
                    intent = new Intent(this, typeof(Drawer)); //Activity you want to open
                } else
                {
                    intent = new Intent(this, typeof(regUser)); //Activity you want to open
                }
            }
            else
            {
                intent = new Intent(this, typeof(regUser)); //Activity you want to open
            }
            intent.AddFlags(ActivityFlags.ClearTop);
            intent.PutExtra("TheBundle", bundle);
            intent.PutExtra("MessageReceived", message);

            var pendingIntent = PendingIntent.GetActivity(this, RandomGenerator(), intent, PendingIntentFlags.OneShot);

            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this,"com.OML.Android")
                 .SetSmallIcon(Resource.Drawable.alert_box)
                 .SetContentTitle("Message Received")
                 .SetContentText(message)
                 .SetAutoCancel(true)
                 .SetContentIntent(pendingIntent);

            NotificationManager notificationManager = (NotificationManager)Android.App.Application.Context.GetSystemService(Context.NotificationService);
            notifyid = RandomGenerator();
            notificationManager.Notify(notifyid, notificationBuilder.Build());

        }
        catch (System.Exception e)
        {
            Utils.LogError("An error occured in SignalRSrv.cs ShowNotification, the error is: " + e.Message);
        }
    }
    private int RandomGenerator()
    {
        return new Random().Next(int.MinValue, int.MaxValue);
    }
    private bool isApplicationInTheBackground()
    {
        bool isInBackground;

        RunningAppProcessInfo myProcess = new RunningAppProcessInfo();
        ActivityManager.GetMyMemoryState(myProcess);
        isInBackground = myProcess.Importance != Android.App.Importance.Foreground;

        return isInBackground;
    }
}

public class LocalBinder : Binder
{
    private readonly SignalRSrv outerInstance;

    public LocalBinder(SignalRSrv outerInstance)
    {
        this.outerInstance = outerInstance;
    }

    public virtual SignalRSrv Service
    {
        get
        {
            // Return this instance of SignalRSrv so clients can call public methods
            return outerInstance;
        }
    }
}

It is within the SignalRSrv code where I create the channel, is that wrong?

A: According to your description, you want to add sound, light and vibrate for notifications, two permissions will allow.
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />

Please add these two permissions in Mainfeast.
Then setting sound, light and vibrate like the code below.
 var name = Resources.GetString(Resource.String.channel_name);
        var description = GetString(Resource.String.channel_description);
        var channel = new NotificationChannel(CHANNEL_ID, name, NotificationImportance.Default)
                      {
                          Description = description
                      };
        channel.EnableVibration(true);
        channel.EnableLights(true);
        channel.LightColor = Color.Red;
        channel.SetSound(RingtoneManager.GetDefaultUri(RingtoneType.Notification),new AudioAttributes.Builder().SetUsage(AudioUsageKind.Notification).Build());
        var notificationManager = (NotificationManager) GetSystemService(NotificationService);
        notificationManager.CreateNotificationChannel(channel);

Note:when you test the vibrate function,remember to lock the screen of your device firstly, then you will look light when app get notification.
If you want to set custom sound, I find one thread about this, you can take a look:
https://forums.xamarin.com/discussion/148652/how-to-make-a-wav-file-the-default-push-notification-sound-for-the-app
Note: Please don't forget to add permissions to read and write sound file.
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

A: Ok, I finally solved it with assistance from @Cherry Bu - MSFT.  I integrated the Android.Support.V4.App.TaskStackBuilder implemented in his solution into my project.  My show notification code now looks like this:
    public void showNotification( string message, Bundle bundle, Notification notification)
    {
        try
        {
            Intent intent = new Intent();
            User MyUser = new User("", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "");
            MyUser = bundle.GetParcelable("MyUser") as User;

            var stackBuilder = Android.Support.V4.App.TaskStackBuilder.Create(this);

            if (MyUser.Usertype != "")
            {
                intent = new Intent(this, typeof(Drawer)); //Activity you want to open
                stackBuilder.AddParentStack(Class.FromType(typeof(Drawer)));
            }
            else
            {
                intent = new Intent(this, typeof(regUser)); //Activity you want to open
                stackBuilder.AddParentStack(Class.FromType(typeof(regUser)));
            }

            intent.AddFlags(ActivityFlags.ClearTop);
            intent.PutExtra("TheBundle", bundle);
            intent.PutExtra("MessageReceived", message);

            stackBuilder.AddNextIntent(intent);

            // Create the PendingIntent with the back stack:
            var pendingIntent = stackBuilder.GetPendingIntent(0, (int)PendingIntentFlags.UpdateCurrent);

            NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, CHANNEL_ID)
                 .SetAutoCancel(true)
                 .SetContentIntent(pendingIntent)
                 .SetContentTitle("OML Alert Received")
                 .SetContentText("Tap Here To View")
                 .SetSmallIcon(Resource.Drawable.alert_box);

            var notificationManager = NotificationManagerCompat.From(this);
            notificationManager.Notify(Constants.NOTIFICATION_ID, notificationBuilder.Build());

        }
        catch (System.Exception e)
        {
            Utils.LogError("An error occured in SignalRSrv.cs ShowNotification, the error is: " + e.Message);
        }
    }

I'm not real clear why, or how, Android.Support.V4.App.TaskStackBuilder has any impact on the creation of notification sound or vibration (the lights STILL do not work), but it obviously does.  I have two phones I test on, one with Android 8 and the other with Android 10.  The Android 8 phone has lights, but they are never activated. The android 10 phone apparently doesn't have lights as none of the other apps that turn lights on on the Android 8 phone turn them on on the Android 10 phone.
If anyone can explain why TaskStackBuilder affects this to me, I would appreciate it.  In any event, I'll mark his answer as the answer as it was that code sample that led me too this solution so all the credit goes to him.  Thank you!


text:
Q: Why we use starting and ending tag as  ?> in php? I am using php and from the beginning i was wondering about the thing that why we use
<? ?> tag as starting and ending of the php tag.
I know its scripting used for differentiating php from other language but i want to know that why we use  and not any other tag as the starting and ending tag?

A: <% and %> are only supported on some servers. The usual PHP tags are <?php and ?> and these are the ones you should use.

A: In fact, we don't use <% and %> tags. Theses tags are used by ASP scripts, and there is a special configuration in php.ini to use asp-like tags. PHP use <?php and ?> tags (or <? ?> in shorter form). In pure PHP files the closing tag in not required.
Why using <% ? Maybe because <? is the beggining of an XML file too, so it can be confusing for parsers, but not for standard web server as PHP files never be sent to browsers.

A: correct tag for php are <?php ?>.
<% %> are opening/closing tag for ASP script (vbscript and other microsoft languages).
However, some misconfigured php installations accept those also for php, but try to avoid this usage as you may have some trouble if you want to run your script on an other server.
To be complete, the closing tag ?> is useless if you script contain only php code. It's event recommended to not using it, to avoid problem when you play with cookies ...

A: This is one of the stupidest things in the php community.  The accepted practice as stated by others is to use <?php ?> and to print a variable, <?php echo $foo ?>  I suspect this was originally out of spite to not be confused with ASP's <% %>
Which is easier to read?  RoR's <%= foo %> or <?php echo $foo; %>   I think most non-php people would opt for the shorter one.
In addition, there is an argument that <% %> breaks XML parsers, whereas <? ?> passes through them.  I think that is a silly argument, because a php file is not an XML file... You would parse the XML produced by running through php first, which would no longer have the php markers.  Why would you run php through an xml parser? Would you run a C++ file through an XML parser?


text:
Q: "in proportion" What does it mean? A: I like having a MINI Cooper. I sort of identify with it. You know? It's pretty little. I feel as if it's proportion... that we are in proportion, you know? Me and my car, we are sort of... together, facing the rest of the world. (So you understand, the speaker is little and short.)
So you understand, the speaker is little and short. What does it mean "in proportion"? Just literally, the speaker is little and the mini cooper is little and the car is the right one for the speaker?

A: The Cambridge Dictionary defines proportion as,

the correct or most attractive relationship between the size of
different parts of the same thing or between one thing and another:
His feet seem very small in proportion to his body.
My head was much nearer the camera than the rest of me so I'm all out
of proportion.

So yes, you can say, 'We are in proportion.'
'I feel as if it's proportion... ' is less idiomatic but perfectly acceptable if the speaker is groping for the right expression.


text:
Q: how to send the postno(post number ID) which was fetched from database to another component? code:

   <mat-accordion class="accordion">
      <mat-expansion-panel>
         <mat-expansion-panel-header>
            <mat-panel-title >{{post.title}}</mat-panel-title>

                <mat-panel-title >{{post.date}}</mat-panel-title>

         </mat-expansion-panel-header>
         {{post.description}}
         <app-gallery [postno]={{post.pNo}}></app-gallery>
      </mat-expansion-panel>
   </mat-accordion>

but the output is :

Parser Error: Unexpected token {, expected identifier, keyword, or
  string at column 2 in [{{post.pNo}}] in
  ng:///AppModule/ForumComponent.html@44:27 ("

A: You need to wrap the input to app-gallery into quotes:
 <app-gallery [postno]="post?.pNo"></app-gallery>

Assuming you have the post data object available in the component where it's used and it has a property pNo. If pNo is not present on post object use the property that matches the ID as required.
to enable safe interpolation, you can add ?

A: This should work provided you have pNo inside post

      <mat-accordion class="accordion">
        <mat-expansion-panel>
          <mat-expansion-panel-header>
            <mat-panel-title >{{post.title}}</mat-panel-title>

            <mat-panel-title >{{post.date}}</mat-panel-title>

          </mat-expansion-panel-header>
          {{post.description}}
          <app-gallery [postno]="post?.pNo"></app-gallery>
        </mat-expansion-panel>
      </mat-accordion>


text:
Q: How does python represents large floating values? I'm filling a dictionary with floating point number, but I have noticed that python tends to "adjust" the values. This is a bit spooky, because the same values will be used later as denominators and even these small changes may generate a division by zero. How can I be sure I'm not getting random rounding up for my numbers.
#python2.7
>>> x = {'set1': 0.59999999999999998, 'set2': 0.66666666666666663}
>>> print x
{'set_1': 0.6, 'set_2': 0.6666666666666666}
>>> print x["set1"]
0.6
>>> print x["set2"]
0.666666666667


text:
Q: connect Google App Engine and Google Compute Engine I created a VM instance in Googl Compute Engine and app in Google App Engine standard environment. I was planning to have my app in App Engine and my database server in Compute Engine. But, I can't connect between the both by internal IP. Is this possible? the app and db are in the same zone (us-east1) but the connection by IP don't work, only work with external IP. Apparently, the rules of firewall are correct.

A: For connecting through a private IP you need that the app and DB will be in the same network.
You can't achieve that with app engine standard, you need app engine flex for this (see here how to set the network of your app engine flex instances)

A:
As of April 9, 2019, you can use the serverless VPC
  connector.

This will allow your App Engine application to connect to other internal resources in your VPC network on the Google Cloud Platform, such as Compute Engine VM instances, Cloud Memorystore instances, and any other resources with an internal IP address.
To create a connector:
$ gcloud services enable vpcaccess.googleapis.com
$ gcloud beta compute networks vpc-access connectors create CONNECTOR_NAME \
--network VPC_NETWORK --region REGION --range IP_RANGE
$ gcloud beta compute networks vpc-access connectors describe CONNECTOR_NAME --region REGION

Note: You can see which IP ranges are currently reserved in the Google Cloud Platform Console. You can choose any unused CIDR /28 IP range to use for your connector, for example, 10.8.0.0/28.
$ gcloud beta compute networks vpc-access connectors create my-vpc-connector \
--region=us-central1 --range=10.8.0.0/28
Create request issued for: [my-vpc-connector]
Waiting for operation [xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx] to complete...done.
Created connector [my-vpc-connector]

To connect your connector to a service add this to your service's app.yaml file:
vpc_access_connector:
  name: "projects/PROJECT_ID/locations/REGION/connectors/CONNECTOR_NAME"

Deploy the service:
$ gcloud beta app deploy

Note: To use Serverless VPC Access, make sure you use gcloud beta to deploy your service. You can get access to beta commands by running gcloud components install beta.
After you deploy your service, it is able to send requests to Internal IP addresses or DNS Names in order to access resources in your VPC Networks. In case any trouble please allow about one hour or more to let the connectors are propagated completely in the GCP Global Networks.

A: You will have to connect using the external IP address of the service running on your Compute Engine instance. App Engine standard environment is on a different network than the Compute Engine instances and don't have private IP access to each other currently. Switching to an application (or service of an application) on the flexible environment might work for you if the costs associated make sense.


text:
Q: ALSA Error while starting Google ASR (raspi3) I'm using Sensory's Wake word detection
On detection of the wake word i'm making a call to Google ASR using the SpeechRecognition library.
I get the following error when the ASR takes control of the microphone:
`ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:4996:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dsnoop.c:556:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Expression 'parameters->channelCount <= maxChans' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1514
Expression 'ValidateParameters( inputParameters, hostApi, StreamDirection_In )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2818
Traceback (most recent call last):
  File "call1.py", line 5, in <module>
    with sr.Microphone(device_index = 2, sample_rate = 44100, chunk_size = 512) as source:
  File "/home/pi/.local/lib/python2.7/site-packages/speech_recognition/__init__.py", line 141, in __enter__
    input=True,  # stream is an input stream
  File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 750, in open
    stream = Stream(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 441, in __init__
    self._stream = pa.open(**arguments)
IOError: [Errno -9998] Invalid number of channels`

I believe it's down to PyAudio which is unable to switch mic control.
How do i solve this?


text:
Q: $\int \sqrt{4-\tan^2x} \sec^2x \, dx $ via substitution method I am trying to determine via substitution method
$$\int \sqrt{4-\tan^2x} \sec^2x \, dx$$
$$t = \tan x $$
$$dt=\sec^2x\,dx$$
$$\int \sqrt{4- t^2} \, dt$$
$$t=2\cos\theta$$
$$dt=- 2\sin\theta \, d\theta$$
$$\int 2\sin\theta (- 2\sin\theta \, d\theta)  $$
$$\int 2(-2\sin^2\theta) \, d\theta  $$
$$\int 2( \cos2\theta -1 ) \, d\theta  $$
Is there any better substitution and how to think about that ?

A: As in previous comment and answer, let $$\tan(x)=2\sin(t)\implies x=\tan ^{-1}(2 \sin (t))\implies dx=\frac{2 \cos (t)}{4 \sin ^2(t)+1}$$ All of the above makes $$I=\int \sqrt{4-\tan^2(x)} \sec^2(x) \, dx=\int 2 \sqrt{4-4 \sin ^2(t)} \cos (t)\,dt=4\int\cos^2(t)\,dt$$ Now, using $\cos^2(t)=\frac 12 (\cos(2t)+1)$, $$I=2 t+\sin (2 t)$$


text:
Q: Error Send email from contact us page When I send mail from contact us page on SUBMIT, following error was displayed.

"Unable to send mail: Unknown error".

Please find below image
I am working in localhost with Magento 2.3. When I fill the form under the contact us page (myurl/contacts/), following error display.

A: Please use any SMTP extension to send emails
Eg: Abzer SMTP


text:
Q: minimize with orthogonal constraint Let $\mathcal{L}=(L^2(\mathbb{R}^3))^N$ be the product space with the associated norm
$$
\Vert U\Vert_0=\left(\sum^N_{i=1}\Vert u_i\Vert_0^2\right)^{1/2}
$$
where $U=(u_1,u_2,...,u_N)\in\mathcal{L}$. Let
$$
\mathcal{K}=\{U\in\mathcal{L};\int_{\mathbb{R}^3}u_iu_j=\delta_{i,j},\forall 1\leq i,j\leq N\}
$$
and  for any matrix $A\in\mathbb{R}^{N\times N}$ denote
$$
AU=(...,\sum_{j=1}^N A_{ij}U_j,...,)^T
$$
For any $U_1,U_2\in\mathcal{K}$, is the following minimization problem have a unique solution
$$
\min\limits_{O\in\mathcal{O}^{N\times N}}\Vert OU_1-U_2\Vert_0
$$
where $\mathcal{O}^{N\times N}$ is the set of all unitary matrix.
Thank you very much.


text:
Q: YASM assembly calling stdout.write in jitted function I'm trying to write a just-in-time compiler and I have a piece of code that just doesn't want to work. My platform is x86-64 ubuntu.
I have the following code written in yasm:
bits 64

mov rdx, 1
mov rcx, 'A'
mov rbx, 1
mov rax, 4
int 0x80
ret

So if I understand correctly this should write A to stdout. Now I compile this code with
yasm -f bin test.yasm

This resulted in the following machine code:
0x48 0xc7 0xc2 0x01 0x00 0x00 0x00 0x48 0xc7 0xc1 0x41 0x00
0x00 0x00 0x48 0xc7 0xc3 0x01 0x00 0x00 0x00 0x48 0xc7 0xc0
0x04 0x00 0x00 0x00 0xcd 0x80 0xc3

and then I read the resulting code in C++ and call it:
void *memory = allocate_executable_memory(sizeof(code));
emit_code_into_memory(sizeof(code), code, memory);
JittedFunc func = reinterpret_cast<JittedFunc>(memory);
func();

I think that the C++ part is fine since I've already tried it with simple arithmetic operations and it worked well.
So anyway there is no segmentation fault, the code seems to be executed but nothing happens, there's nothing in stdout.
Any advice?
//EDIT: full C++ code:
#include <stdio.h>
#include <string.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <sys/mman.h>

void* allocate_executable_memory(size_t size) {
    void *ptr = mmap(
        0,
        size,
        PROT_READ | PROT_WRITE | PROT_EXEC,
        MAP_PRIVATE | MAP_ANONYMOUS,
        -1,
        0
    );
    if (ptr == (void*)(-1)) {
        perror("mmap");
        return nullptr;
    }
    return ptr;
};

void emit_code_into_memory(size_t code_length, uint8_t *code, void *memory) {
    memcpy(reinterpret_cast<uint8_t*>(memory), code, code_length);
};

typedef void (*JittedFunc)();

int main(int argc, char* argv[]) {
    /* Use like this:
    bin/jit 0xb8 0x11 0x00 0x00 0x00 0xc3
    */
    if (argc <= 1) {
        return 1;
    }

    uint8_t code[argc-1];
    for (int i = 1; i < argc; i++) {
        code[i-1] = std::stoul(argv[i], nullptr, 16);
    }

    void *memory = allocate_executable_memory(sizeof(code));
    emit_code_into_memory(sizeof(code), code, memory);
    JittedFunc func = reinterpret_cast<JittedFunc>(memory);
    func();
    return 0;
};

A: The write syscall expects a pointer to the thing to write, not an immediate. Also, 64 bit uses syscall instruction with a different calling convention. This is important for pointers which would otherwise be truncated to 32 bits. Furthermore, also the function numbers are different, so your code actually invokes the stat syscall as can be seen using strace:
stat(NULL, NULL) = -1 EFAULT (Bad address)

You should try the following code instead:
push 'A'
mov rdi, 1   ; stdout
mov rsi, rsp ; buf
mov rdx, 1   ; count
mov rax, 1   ; sys_write
syscall
pop rdi      ; cleanup
ret

This uses the stack to store the letter to print. The cleanup could use any caller-saved scratch register, or could be rewritten as add rsp, 8. The return value from the system call is in eax.
The 32 bit version could look like:
push ebx     ; callee-saved
push 'A'
mov ebx, 1   ; stdout
mov ecx, esp ; buf
mov edx, 1   ; count
mov eax, 4   ; sys_write
int 0x80
pop edi      ; cleanup buf
pop ebx      ; restore ebx
ret

Notice that ebx has to be preserved according to calling convention.


text:
Q: Snowflake: How can I get the size of an array in bytes? In Snowflake, how can I get the size of an array in bytes?  I don't see a function to do so in their documentation. The closest I have found are the LENGTH/LEN and OCTET_LENGTH functions, which only apply to strings or binary types.
I also do not think ARRAY_SIZE is the correct function here either, that returns the number of items in the array if I am not mistaken.
I specifically would like to know for the ARRAY data type

A: You could use something like this:
SELECT LEN(ARRAY_TO_STRING(array,''))
...

This turns the array into a string with a blank delimiter and then provides the length of that string.


text:
Q: Multiple lines in same excel cell using OLE I have some SAP OLE code that takes an internal table and pastes it into excel. However one field requires two lines within the same cell.
I've tried using CL_ABAP_CHAR_UTILITIES-NEWLINE and CL_ABAP_CHAR_UTILITIES-VERTICAL TAB and 'CR_LF' character as carriage return characters and these work fine when setting the value of the cell individually but using the paste method the start a new line (not a new line in the same cell). Unfortunately setting cell values manually is too performance intensive to be helpful.
I've also tried recording a macro of the alt + return key which shows me that excel reads that as ="line1" & char(10) & "line2" but I can't get this to parse properly either using OLE.
Is there any way I can make the paste method parse carriage return characters properly?
My current approach is below. Thanks for any help.
CONCATENATE line1 line2 INTO mult_lines SEPARATED BY cl_abap_char_utilities=>newline.

Then I add mult_lines to internal table and concatenate each line of the internal table into gt_data[] which is of type: LIKE Table OF gv_data(4096) TYPE c.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
  data                 = gt_data[]
CHANGING
  rc                   = gv_rc
EXCEPTIONS
  cntl_error           = 1
  error_no_gui         = 2
  not_supported_by_gui = 3
  OTHERS               = 4.

CALL METHOD OF gv_appl 'Cells' = gv_cell
EXPORTING
#1 = lv_row1
#2 = lv_col1.

CALL METHOD OF gv_appl 'Range' = gv_range
EXPORTING
#1 = gv_cell
#2 = gv_cell.

CALL METHOD OF gv_range 'Select'.
CALL METHOD OF gv_sheet 'Paste'.

A: Double quotation marks solve the problem. Just double quote all the text you wanna put into one cell, and have the cells connected with 0x09 (next column) or 0x0A (next row)
For example: (i'm using ASCII code to represent the chars)
Pasting 0x41 0x0A 0x42 into a cell, we fill two adjacent rows, one line of text in each,
A
B

while pasting 0x22 0x41 0x0A 0x42 0x22 into a cell, we fill one cell with 2 lines.
"A
B"

The example below fills to cells with 2 lines each:
CONSTANTS:
  nextC TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab,
  nextR TYPE abap_char1 VALUE cl_abap_char_utilities=>newline,
  quot TYPE abap_char1 VALUE '"'.

DATA:
  buffer TYPE string.

CONCATENATE quot 'R1C1L1' nextR 'R1C1L2' quot nextC quot 'R1C2L1' nextR 'R1C2L2' quot INTO buffer.

A: This would work only cell per cell, but you can try to use Application.SendKeys "{F2}" which will open the edit bar and then do the paste of multiple lines. This should work, not sure I recommend this though. Why would you not simply set the value through setting the value of the cell?


text:
Q: WoeUSB Installation failed! Exit Code 256. Trying to install Windows 10 on USB from a laptop running 14.04 I am trying to build a new computer and run Windows 10 on it. I've run into a snag, and can't get the ISO on a USB flash drive using my Ubuntu 14.04 laptop. When trying to download the ISO onto 16GB USB flash drive I get the following error message:
Installation failed!
Exit code: 256
Log:
WoeUSB v@@WOEUSB_VERSION@@
==============================
Mounting source filesystem...
Error: File "/media/woeusb_source_1544835295_14348/sources/install.wim" in source image has exceed the FAT32 Filesystem 4GiB Single File Size Limitation and cannot be installed.  You must specify a different --target-filesystem.
Refer: https://github.com/slacka/WoeUSB/wiki/Limitations#fat32-filesystem-4gib-single-file-size-limitation for more info.
Unmounting and removing "/media/woeusb_source_1544835295_14348"...
You may now safely detach the target device

It says the USB is formatted to FAT32 but I have installed GParted and formatted it to NTFS. I've actually formatted it several different ways trying to following other users on here, and I keep getting various error codes when using WoeUSB.

A: I had the same problem as yours.
The following link is a buttery smooth flow to fix this issue.
https://medium.com/@codechangetheworld/build-a-bootable-windows-10-usb-in-linux-501f92e346a5
With this flow, I was able to build UEFI bootable windows 10, 1803 Apr 2018 image(~4.3GB) in Ubuntu 16.xx environment.  Hope this works for you too...


text:
Q: jquery autocomplete not working on non-english alphabet i use jquery ui autocomplete widget one of my project. it works very well on latin alphabet but on russiın or Armenian alphabet is not working.
database returns valid list according to my search string. but combo list is not opening..
is there any way to fix this?


text:
Q: Vlookup on document with 1m+ rows I'm working on a project with two datasets in excel and I need to cross reference them.
Dataset 1 is around 6,000 and dataset 2 is around 3.5 million records (split over several sheets).
Vlookup obviously won't work over 65,000 rows.
Can anyone suggest a work around or any kind of scripting that may work?

A: If working in the excel spreadsheets is a must you can do a series of if statements, isna and vlookups.  Not pretty or fast but should work for this case.
=IF(NOT(ISNA(VLOOKUP(<reference>,<some sheet 1>,<column>,FALSE))),"Found",
IF(NOT(ISNA(VLOOKUP(<reference>,<some sheet 2>,<column>,FALSE))),"Found" ... ,"Not Found"))

Edit: added indication of different sheets in vlookups, added not to isna


text:
Q: Proof of the existence of Cholesky factor? This is not duplicate of this proof which is based on induction.
How can we prove Cholesky factor exists based on the following decomposition of $A$ which is a positive definite matrix?
$$
A=
\begin{bmatrix}
A_{11} & A_{12}\\
A_{21} & A_{22}
\end{bmatrix}
=
\begin{bmatrix}
I & 0 \\
A_{21}A_{11}^{-1} & I
\end{bmatrix}
\begin{bmatrix}
A_{11} & 0 \\
0 & A_{22} - A_{21}A_{11}^{-1}A_{12}
\end{bmatrix}
\begin{bmatrix}
I & A_{12}A_{11}^{-1} \\
0 & I
\end{bmatrix}\tag{1}
$$

My try:

I should show $A$ can be decomposed as
$$
A= \begin{bmatrix}
R_{11}^{\top} & 0\\
R_{12}^{\top}  & R_{22}^{\top}
\end{bmatrix}
\begin{bmatrix}
R_{11} & R_{12}\\
0  & R_{22}
\end{bmatrix}
$$
So using $(1)$ we can write
$$
A=
\begin{bmatrix}
A_{11} & A_{12}\\
A_{21} & A_{22}
\end{bmatrix}
=
\begin{bmatrix}
I & 0 \\
A_{21}A_{11}^{-1} & I
\end{bmatrix}
\begin{bmatrix}
R_{11}^{\top} & 0 \\
0 & \tilde{R}_{22}^{\top}
\end{bmatrix}
\begin{bmatrix}
R_{11} & 0 \\
0 & \tilde{R}_{22}
\end{bmatrix}
\begin{bmatrix}
I & A_{12}A_{11}^{-1} \\
0 & I
\end{bmatrix}\tag{2}
$$
where $\tilde{A}_{22} = A_{22} - A_{21}A_{11}^{-1}A_{12}$. In $(2)$ I am assuming Cholesky factors of $A_{11}$ and $\tilde{A}_{22}$ exists which violates to what I am going to proof because I want to show they exist not use them! Also, I can show $\tilde{A}_{22}$ is positive definite.


text:
Q: Telegram aiogram bot send photos to group chats Is there any way to make python aiogram telegram bot send some photos to a group chat, instead of only private messages to certain users?
Methods message.answer(), message.reply() don't work for me, because it gives back following eror:
aiogram.utils.exceptions.BadRequest: Unsupported parse_mode
But with the Bot.send_message() I can only send those only in the personal chats.
Thanks in advance if anyone can find the solution
I tried message.answer() and message.reply() to send pictures, but it seems like I can send them only with the Bot.send_message()


text:
Q: Get distance of MapControl border in degrees I have a MapControl and would like to know how many degrees are currently shown on the x and y axes.
First example:

360 degrees are shown on the x axis (longitude)
~90 degrees are shown on the y axis (latitude)
(The zoom level is 3.2 and it's max zoomed out)
Second example:

~220 degrees on the x axis (longitude)
180 degrees on the y axis (latitude)
(zoom level: 1.7; max zoomed out)
I tried calculating the current degrees on the x axis using following code:
double dist = 360 * Math.Pow(0.5, macSurrounding.ZoomLevel - 1);

but it doesn't work, because the zoom level is just strange...

A: You should use the MapControl's GetLocationFromOffset method to calculate the geographic coordinates of the south-east and north-west corner points of the current map viewport. The width and height of the viewport would be the latitude and longitude differences of these points.
Geopoint northEast;
Geopoint southWest;

map.GetLocationFromOffset(new Point(map.ActualWidth, 0), out northEast);
map.GetLocationFromOffset(new Point(0, map.ActualHeight), out southWest);

var width = northEast.Position.Longitude - southWest.Position.Longitude;
var height = northEast.Position.Latitude - southWest.Position.Latitude;

A: Got it:
Longitude:
360 * Math.Pow(0.5, mcMapControl.ZoomLevel - 1) * mcMapControl.ActualWidth / 409.5;

Latitude:
180 * Math.Pow(0.5, mcMapControl.ZoomLevel - 1) * mcMapControl.ActualHeight / 409.5;


text:
Q: Aframe Kinematic Body / Static body don't work I'm facing issues concerning the kinematic body of aframe.

I put static-body in different a-box a-torus and Obj and I can still go through them. I've attached a kinematic body composent on my camera so i don't know what's going on. (i've attached the aframe-physics-system script to it)
Do you have any clues ?
Thanks a lot

<a-scene physics="debug: true">

    <a-entity  camera look-controls wasd-controls position="0 2 0" jump-ability kinematic-body></a-entity>

     <a-box static-body scale="1 10 40" position="10 5 0" rotation="0 0 0" visible="true" material="" geometry="primitive:box"></a-box>
     <a-torus static-body scale="1.5 1.5 2" position="6.2 .75 1.16" rotation="90 0 0" visible="true" material="src:#jean; reflectivity:0.5; roughness:1"></a-torus>
<a-torus static-body scale="1.5 1.5 2" position="6.2 .75 5.36" rotation="90 0 0" visible="true" material="src:#jean3; reflectivity:0.5; roughness:1"></a-torus>
<a-torus static-body scale="1.5 1.5 2" position="6.2 .75 9.6" rotation="90 0 0" visible="true" material="src:#jean2; reflectivity:0.5; roughness:1"></a-torus>
<a-obj-model static-body src="#table-obj"  material="src:#dark_wood" scale=".03 .03 .03" position="0 1.02 15.44" rotation="0 0 0" ></a-obj-model>

A: The kinematic-body component isn't compatible with wasd-controls, which essentially lets the camera go wherever it wants. The controls need a concept of 'velocity' so that (1) collisions can be detected frame-by-frame, and (2) the kinematic-body component can modify velocity according to collisions.
To support all of that, you will need to use the universal-controls component. This component is a replacement for both wasd-controls and look-controls, so it should be used simply as:
<a-entity camera universal-controls position="0 2 0" jump-ability kinematic-body></a-entity>

Another important note: The kinematic-body component does not support roomscale VR locomotion.


text:
Q: Using fields other then primary key as id during insert/update I got this tables:
CREATE TABLE properties(
  id SERIAL,
  external_id VARCHAR
)

CREATE TABLE things(
  id SERIAL,
  external_id VARCHAR,
  property_id INTEGER,
  CONSTRAINT things_property_id_fkey FOREIGN KEY (property_id)
  REFERENCES properties(id)
)

An external software needs to insert/update records in the tables, but has no knowledge of id-fields - only of external_id. So it can't just do
UPDATE things SET property_id = 'foo123' WHERE external_id ='Boo567'

- it has to find out the primary key of the record in the table properties with external_id = "foo123" first. What is the most efficient way to do this in Postgresql? external_id is indexed&unique.
UPDATE
Looks like I wasn't clear enough. The problem with the UPDATE statement above is that there is no record in properties where id = 'foo123'. But there is a record with external_id = 'foo123', but I can't use external_id directly to reference the record.

A: I think this is what you're looking for
UPDATE
    things
SET
    property_id = (
        SELECT id
        FROM properties
        WHERE external_id = 'foo123'
    )
WHERE
    external_id ='Boo567'

It's called a subquery.


text:
Q: topologies of spaces in escher games There have been a couple of games released (or in development) in the past couple of years which do some weird topological tricks: Echochrome (video), Crush (video), and Fez (video). Do the spaces portrayed in these games correspond to known sorts of topological structures?

A: The main focus of these games is not weird topological structures so much as weird transformations of the space.
In Echochrome, the "rotation" transformation connects points (via holes) that were not connected before, and undoes some connections. At any instant, the Echochrome space can be viewed as some sort of minor topological quotient of $\mathbb{R}^2$, but derived via rules from some underlying 3D space (with a quotient?).
In Crush, the space is 3-dimensional, but the crush action is like a projection onto 2-d space. The space in Crush isn't really notable, but what is notable is that uncrush followed by crush doesn't always yield the same 2d-world. The issue is that the camera can be in the middle of the 3-d world in crush, instead of far away.
I admit I haven't played Fez, but I imagine some combination of the Crush and Echochrome comments would cover it.


text:
Q: Differences between Java 6 and Java 7 in ArrayList capacity growth I have a question about how ArrayList's capacity growth (not the size, but the capacity) is managed in Java.
When we initialize an ArrayList using the default constructor without setting a capacity, the capacity is set = 10 by default.
At this point, when we add another element to the list, the Oracle documentation says that "As elements are added to an ArrayList, its capacity grows automatically. The details of the growth policy are not specified beyond the fact that adding an element has constant amortized time cost."
If we look at Java internals the capacity growth policy has changed its function. Until Java 6 it was:
(1) int newCapacity = (oldCapacity * 3)/2 + 1;

From Java 7 (and > 7) it is:
(2) int newCapacity = oldCapacity + (oldCapacity >> 1);

but these two mathematical series are slightly different. Starting from the default value (10) we have:
(1) 10,16,25,38,58,88,133,200,301,452...
(2) 10,15,22,33,49,73,109,163,244,366...
I think that this hasn't any implication on ArrayList use, but why did they change this function? Is there any performance reason? Did they find a flaw or a bug in the old one?

A: OpenJDK's source control history shows it was changed by Martin Buchholz from Google in changeset 2350 to fix bug JDK-6933217: Huge arrays handled poorly in core libraries.
The new code is careful to avoid unnecessary integer overflow. oldCapacity * 3 can overflow even if oldCapacity * 3 / 2 doesn't. The new line oldCapacity + (oldCapacity >> 1) won't. And if it does overflow and go negative there's additional code to set the capacity to Integer.MAX_VALUE (or near to it).
/**
 * The maximum size of array to allocate.
 * Some VMs reserve some header words in an array.
 * Attempts to allocate larger arrays may result in
 * OutOfMemoryError: Requested array size exceeds VM limit
 */
private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8;

private void grow(int minCapacity) {
    // overflow-conscious code
    int oldCapacity = elementData.length;
    int newCapacity = oldCapacity + (oldCapacity >> 1);
    if (newCapacity - minCapacity < 0)
        newCapacity = minCapacity;
    if (newCapacity - MAX_ARRAY_SIZE > 0)
        newCapacity = hugeCapacity(minCapacity);
    // minCapacity is usually close to size, so this is a win:
    elementData = Arrays.copyOf(elementData, newCapacity);
}

private static int hugeCapacity(int minCapacity) {
    if (minCapacity < 0) // overflow
        throw new OutOfMemoryError();
    return (minCapacity > MAX_ARRAY_SIZE) ?
        Integer.MAX_VALUE :
        MAX_ARRAY_SIZE;
}

Full details from the bug report:

I've noticed bugs in java.util.ArrayList, java.util.Hashtable and
  java.io.ByteArrayOutputStream which arise when the capacities of the
  data structures reach a particular threshold.  More below.
When the capacity of an ArrayList reaches (2/3)*Integer.MAX_VALUE its
  size reaches its capacity and an add or an insert operation is
  invoked, the capacity is increased by only one element.  Notice that
  in the following excerpt from ArrayList.ensureCapacity the new
  capacity is set to (3/2) * oldCapacity + 1 unless this value would not
  suffice to accommodate the required capacity in which case it is set
  to the required capacity.  If the current capacity is at least
  (2/3)*Integer.MAX_VALUE, then (oldCapacity * 3)/2 + 1 overflows and
  resolves to a negative number resulting in the new capacity being set
  to the required capacity.  The major consequence of this is that each
  subsequent add/insert operation results in a full resize of the
  ArrayList causing performance to degrade significantly.
int newCapacity = (oldCapacity * 3)/2 + 1;
if (newCapacity < minCapacity)
    newCapacity = minCapacity;

...
It is interesting to note that any statements about the amortized time
  complexity of add/insert operations, such as the one in the ArrayList
  javadoc, are invalidated by the performance related bugs.  One
  solution to the above situations is to set the new capacity of the
  backing array to Integer.MAX_VALUE when the initial size calculation
  results in a negative number during a resize.


text:
Q: Unable to run application outside qt I am unable to run the even the HelloWorld.exe outside QT.
I coded it through QT creator 5.4.2. From QTcreator build and run works fine.
But when I am trying to run the generated executable out side QT, i mean directly on desktop, it keeps on giving me error like, missing library.
From net search I cam to know I need to do some static build.
Please help me in this. Please describe step 0 to N cleanly so that I or other will not face any problem.
I am using Windows and I have MSVC2010.
Help in from ground 0 step to till execution of helloworld.exe out side qtcreator.
Thanks

A: It is possible to deploy a Qt application that's dynamically linked or statically linked. When the Qt application is run from Qt Creator it finds the need libraries here C:\Qt\Tools\QtCreator\bin, but there are many more libraries then you need.
A fast way to deploy is put Qt application executable(.exe) from your build in the directory C:\Qt\Tools\QtCreator\bin and create a symbolic link to it. This works for initial testing, but is not the way to deploy the Qt applications as it does require installing Qt and environment on the deployment machine.
A better way is to use the windeployqt.exe located in the directory C:\Qt\5.4\msvc2010_opengl\bin it has documentation and is run from the Qt command line
C:\Qt\5.4\msvc2010_opengl\bin>windeplyqt --help
It's documented at http://doc.qt.io/qt-5/windows-deployment.html just over halfway down.
If you are deploying your application to many machines you will want to build an installer, which is documented here http://doc.qt.io/qtinstallerframework/index.html

A: QtCreator keeps an internal environment path for qt libraries. To run your "HelloWorld.exe" you can just copy missing dlls from qt/bin to the same folder with the executable. A better solution would be adding qt/bin to system path from environment variables.
If you are planning on distributing your application, the best solution is to link qt libraries statically instead of dynamically. You can learn more about his option from:
How to make Qt and Qtcreator link the libraries statically instead of dynamic?


text:
Q: How to show build version with schema Xcode 11 How do you show the build version with the scheme in the application?
For example, if the app build version is 1.0.2 and the build scheme is staging then I want to show 1.0.2-staging, like when the app center builds the application and then the name of the application would be shown in this way (1.0.2-staging).

A: I am not exactly sure what you mean by "build scheme", but these are 2 examples of how to get information from the Info.plist:
let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String


text:
Q: Enforce uniqueness in thinky (rethinkdb) In the thinky.io docs the following pattern is described to enforce uniqueness:
var Model = thinky.createModel("user",
    name: type.string()
}, {
    pk: "name"
});

Where the name property is assigned to the primary key.
Is this a typo? That is, should it read:
var Model = thinky.createModel("user", {
    name: type.string()
}, {
    pk: "name"
});

Also for anyone familiar with thinky who has used this pattern before, is there a similar way of assigning uniqueness as it is done in mongoose (mongodb):
const userSchema = new Schema({
    name: { type: String, unique: true }
});

Thanks.
Update:
link to the docs
https://thinky.io/documentation/faq/

A: Yes, definitely a typo as the first example is not valid.


text:
Q: OpenCV unhandled exception about cvFloodFill() function I want to label the connected component of a binary picture, but when I run to the cvFloodFill function first time, there is a unhandled exception.
There is a message box said:
And the cmd said:
Here is the code:
Mat resSlt = Mat(IMG_HEIGHT, IMG_WIDTH, CV_8UC1, slt, IMG_WIDTH * sizeof(uchar));
cvNamedWindow("resSlt");

imshow("resSlt",resSlt);
waitKey(60000);

int color = 254;
int colorsum[255] = {0};
for (int r = 0; r < resSlt.rows; r++)
{
    for (int c = 0; c < resSlt.cols; c++)
    {
        if (color > 0)
        {
           if (resSlt.at<Vec3b>(r, c)[0] == 255)
           {
               cvFloodFill(&resSlt, cvPoint(c, r), CV_RGB(color, color, color));
               --color;
           }
        }
    }
}

Can anyone tell me what happened? Thanks!

A: there's more than one thing wrong here:
// buffer overflow:
resSlt.at<Vec3b>(r, c)[0]
// it's a CV_8U image, so use
resSlt.at<uchar>(r, c)[0]

please don't mix c++ and c api calls, stick with the c++ api.
use:
cv::floodFill(resSlt, cv::Point(c, r), cv::Scalar(color, color, color));

(the adress of a cv::Mat is not an IplImage*)
also note, that you can't draw colours into a 8bit,1channel image.
last but not least, resSlt has a borrowed pointer to the pixels in slt. if you want to use resSlt after slt has gone out of scope, you'll have to use resSlt.clone(), or face a dangling pointer.


text:
Q: Simple form error notification inside the form on validation I have this form to create and update my product object, but i'm having problems to get the errors messages:
<%= simple_form_for @product do |f| %>
  <% if @product.errors.any? %>

        <% @product.errors.full_messages.each do |message| %>

<%= message %>

        <% end %>

  <% end %>
  <%= f.input :name, label: 'Product name' %>
  <%= f.input :description, label: 'Description' %>
  <%= f.association :category, label: 'Category' %>
  <%= f.input :price, label: 'Price' %>
  <%= f.input :picture %>
  <%= f.input :picture_cache, as: :hidden %>
  <%= f.button :submit %>
<% end %>

and these validations in my product model:
validates :name, :description, :category, :price, presence: true

this is my controller:
    class ProductsController < ApplicationController
  before_action :set_product, only: [:show, :edit, :update, :destroy]
  skip_before_action :authenticate_user!, only: [:index, :show]

  def index
  end

  def show
  end

  def new
    @product = Product.new
  end

  def edit
  end

  def create
    @product = current_user.products.new(product_params)
    if @product.save
      respond_to do |format|
        format.html { redirect_to products_path, notice: 'The product was successfully created.' }
      end
    else
      redirect_to new_product_path
    end
  end

  def update
    @product.update(product_params)
    respond_to do |format|
      format.html { redirect_to product_path, notice: 'The product was successfully updated.' }
    end
  end

  def destroy
    @product.destroy
    respond_to do |format|
      format.html { redirect_to products_path, notice: 'The product was successfully destroyed.' }
    end
  end

  private
    def set_product
      @product = Product.find(params[:id])
    end

    def product_params
      params.require(:product).permit(:name, :description, :category_id, :price, :picture, :picture_cache)
    end
  end

when i submit the form without any field required in the validation i don't get any error messages. Where am i doing wrong?
UPDATE: I put my controller.

A: Since you're redirecting when there's a validation error on create, @product is always going to be a new instance of Product that hasn't even had validations run.
Instead you want to render the new action view to show the form again, but without changing the page. This way @product gets passed to the view for the errors to be shown.
def create
  @product = current_user.products.new(product_params)
  if @product.save
    respond_to do |format|
      format.html { redirect_to products_path, notice: 'The product was successfully created.' }
    end
  else
    # changed the following line
    render :new
  end
end


text:
Q: DataTables jQuery plugin setting recordsTotal after initial load I've scoured the internet and SO for this but can't seem to find an answer...
I have a relatively intricate query that returns 50 records from a large database.  This query runs as a cursor so it is fast and is able to assemble the json and return to datatables in ~20ms.
However, getting the overall count of records for this query is slower (500ms).
I would like to be able to do a parallel ajax call and set the count (recordsCount) on my data table after it has already rendered so I can see data on the screen faster.  Is this possible?
As a workaround I am considering creating a cache of counts for my queries,  but this seems non-ideal if I could easily hit some client side code when I'm able to get the count.
Here is my datatables code for reference:
var table = $('#myTable').DataTable({
    "dom": '<"top"iflp<"clear">>rt<"bottom"iflp<"clear">>',
    "processing": true,
    "serverSide": true,
    "searching": false,
    "ordering": false,
    "bSort": false,
    "scrollX": false,
    "fixedHeader": true,
    "deferRender": true,
    "iDisplayStart": (startPage * pageLength),
    "ajax": {
      "url": url,
      "type": "POST",
      "data": function (d) {

      }
    },
    "pagingType": "full_numbers",
    "columnDefs": columnDefs,
    "responsive": false,
    "columns": columnDataStructure,
    "order": [[0, "desc"]],
    "lengthMenu": [10,25,50,100],
    "initComplete": function(settings, json){

    }
  })

A: It's an interesting question.
I can offer you a hacky way to do it. It should work for DataTables 1.10.x.
Attach the following event handler that will be called when DataTables makes Ajax request to your server-side script.
Call another server-side method (/echo/json/ in my example) and retrieve total number of records.
Then update DataTables using some internal undocumented function.
$('#example').on('xhr.dt', function ( e, settings, json, xhr ) {
   $.ajax({
      url: '/echo/json/',
      method: 'POST',
      data: { json: JSON.stringify({ recordsTotal: 999 }) },
      type: 'json'
   })
   .done(function(json){
      settings._iRecordsDisplay = json.recordsTotal;
      settings._iRecordsTotal = json.recordsTotal;
      $.fn.dataTable.ext.internal._fnCallbackFire( settings, 'aoDrawCallback', 'draw', [settings] );
   });
});

See this example for code and demonstration.


text:
Q: Git push to remote repository gives fatal error SSH HTTPS I am developing an ionic app,and I use Git as my version control method.My remote repository is located in GitHub.Whenever I am trying to push some content from my local repository to remote repository,Git will give this Fatal Error,
fatal: remote error:
  You can't push to git://github.com/evilmin/ionicMyApp.git
  Use https://github.com/evilmin/ionicMyApp.git

I checked the remote links using the command git remote -v and it gave me this output.
origin  git://github.com/evilmin/ionicMyApp.git (fetch)
origin  git://github.com/evilmin/ionicMyApp.git (push)

Means the error was right and the links are in SSH.
So I tried removing the origin and add it as a HTTPS link using
git remote rm origin
git remote add origin https://github.com/evilmin/ionicMyApp.git

But when I run the git remote -v to check the remotes,I get the same output that I have mentioned above,which means the links are still in SSH,and my command has not worked.
And yes I tried pushing again,but the same error occurs.
I even tried reinstalling Git,but the issue persists.
Whatever the repository is,every time I try to push from a local repo to its  remote repo,it will give me this error.
My main concern is how to enable push functionality again in Git.Any ideas would be helpful.
It would be better if there is a way to do this using HTTPS,rather than SSH.
P.S. : This happened not only when I was developing an Ionic app,but also other times,hence I believe Ionic was not the reason.

A: Why do not you git clone remote repo to https ?
First delete the local project before git clone
if you want ssh
first remove .ssh know host github url
and Re-register the public key.


text:
Q: How to use table class of codeigniter Is any trick to add edit/delete link in each row

Error in code : Cannot use object of type mysqli as array in
       C:\xampp\htdocs\CodeIgniter-3.0.6\application\views\admin.php on line 8

<?php
 $table_property = array('table_open' => '<table cellpadding="2" cellspacing="1" class="table table-hover">');
  $this->table->set_heading('#Id','Username','Password','Name','Edit','Delete');
  $this->table->set_template($table_property);
  $new=$this->db->query("select * from tbl_admin");

  foreach($new as $row) {
  $links  = anchor('admin/edit/'.$row['User_ID'] ,'Edit');
  $links .= anchor('admin/delete/'.$row['User_ID'] , 'Delete');

$this->table->add_row(
    $row->User_ID,
    $row->Username,
    $row->Password,
    $row->Full_Name,
    $links
    );
}
echo $this->table->generate();
?>

A: query() doesn't return an array with the objects of desire directly, but an mysqli_result object instead; hence you cannot use it as such.
What you probably want to do is
while ($row = $new->fetch_assoc()) {
      // ...
}


text:
Q: Why column order in chart does not match column order in resultset of query? I have some query, and I output the result of this query in a table and try to display it in a chart. The "Select Data" tab of the chart editing window looks like this:

All works right, except of the fact that order in the chart does not match column order in the resultset of query. I put arrows on the screenshot with this chart, with text that points to the corresponding row in table (for example, 0 row - the first row in table, 1 row - the second row in table, etc.):

It seems that row.__rownum values is sorted like varchar, rather than integer (for example, like ORDER BY works for varchar in mysql). How to fix it?

A: Essentially I found the answer: all that I needed was to click "Edit grouping and sorting" and change type in "Grouping" section from "Text" to "Numeric":

I hope it will be useful for somebody else.


text:
Q: How do I fake OpenGL in an Azure Virtual Machine? I'd like to run some programs in my Azure VM (Windows Server 2008), that require OpenGL 2.0.
However the VM has no video hardware :), how can I fake the programs into believing I have a good enough video card?
How am I supposed to get to the point of all development in the cloud, if I can't have virtual video cards? :)

A: You could place a Mesa softpipe (software rasterizer) build opengl32.dll beside your program's executable. Heck, on a machine without a proper graphics card it would be even acceptable to replace the system opengl32.dll (though this is not recommended).

A: Check the OpenGL section here... and make sure u r using openscad 64 bit


text:
Q: Redux, Redux-persist, cannot read property "age" of undefined I am using Redux with a React Native app, and am getting a red box error when trying to integrate Redux-Persist. As soon as I navigate to the initial screen which has a ProfileForm and has the this.props.age piece of state, I see this:
TypeError: Cannot read property "age" of undefined

I am not quite sure where I am going wrong. I have set initial value of age = 0 in the reducer. So how is it undefined? Here is code that would be relevant:
reducers/UserReducer.js
import { CALCULATE_BMI, CALCULATE_AGE } from '../actions/types';

const INITIAL_STATE = { bmi: 0, age: 0 };

export default (state = INITIAL_STATE, action) => {
  switch (action.type) {
    case CALCULATE_BMI:
      return { ...state, bmi: action.bmi };
    case CALCULATE_AGE:
      return { ...state, age: action.age };
    default:
      return state;
  }
};

reducers/index.js
import { combineReducers } from 'redux';
import { reducer as formReducer } from 'redux-form';
import userReducer from './UserReducer';

export default combineReducers({
  user: userReducer,
  form: formReducer,
});

store/index.js
import { createStore, applyMiddleware, compose } from 'redux';
import { persistStore, persistCombineReducers } from 'redux-persist';
import storage from 'redux-persist/es/storage'; // default: localStorage if web, AsyncStorage if react-native
import thunk from 'redux-thunk';
import logger from 'redux-logger';
import reducers from '../reducers';

const config = {
  key: 'root',
  storage,
};

const reducer = persistCombineReducers(config, { reducers });

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

export default () => {
  const store = createStore(reducer, {}, composeEnhancers(applyMiddleware(thunk, logger)));
  const persistor = persistStore(store);
  return { persistor, store };
};

ProfileForm.js
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { StyleSheet, Text, View, TouchableOpacity, Alert } from 'react-
native';
import { compose } from 'redux';
import { connect } from 'react-redux';
import { reduxForm, Field } from 'redux-form';
import * as actions from '../actions';
import DatePickerModal from '../components/DatePickerModal';

class ProfileForm extends Component {
  // other code here
  <Field name="birthdate" component={DatePickerModal} />
    {this.props.age === 0 ? null : (
      <Text style={styles.labelStyle}>{`Age: ${this.props.age}`}</Text>
    )}
  //other code here
}

const mapStateToProps = state => ({
  age: state.user.age,
});

export default compose(connect(mapStateToProps, actions), reduxForm({ form: 'Profile', validate }))(
  ProfileForm,
);

App.js
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { PersistGate } from 'redux-persist/es/integration/react';
import MainNavigator from './routes';
import configureStore from './store';

const { persistor, store } = configureStore();

export default class App extends Component {
  // other code here
  render() {
    return (
      <Provider store={store}>
        <PersistGate persistor={persistor}>
          <MainNavigator />
        </PersistGate>
      </Provider>
    );
  }
}

I have tried removing the empty object {} passed to createStore, setting it as undefined, and setting the initial values here instead, but nothing seems to work. Any guidance appreciated.


text:
Q: Do Facebook posts like in swift I am able to like Facebook pages using FBSDKLikeControl with that page url. Some thing like this.
let likeButton = FBSDKLikeControl()
likeButton.objectID = "https://www.facebook.com/FacebookDevelopers"
likeButton.center = self.view.center;
view.addSubview(likeButton)

However I am not able to do like on posts by giving likeButton.objectID = "1802945816386201_17414239392050"
Can we like user posts, photo using Facebook API ?


text:
Q: css transition on three floated elements with relative width i have a problem with hovering three floated elements with relative width and css3 transition set.
Hovered element has 50% width, two remaining elements have 25% each, therefore all elements combined should have 100% width.
When I am hovering between two elements, everything seems fine, but when I hover over all of them, there is a moment, when elements combined do not have 100% width.
Is there a way to fix this? With diffent transtion-duration on each element or something of the sort?
Here is fiddle: http://jsfiddle.net/tolchai/T6gPM/
HTML

CSS
ul {
    background: black;
    height: 500px;
    padding: 0;
    margin: 0;
    list-style: none;
}

ul:after {
    content:"";
    display:table;
    clear:both;
}

ul > li {
    width: 33.33%;
    height: 100%;
    float: left;
    transition: width .5s linear;
}

ul:hover > li {
    width: 25%;
}

ul:hover > li:hover {
    width: 50%;
}

.row-1 {
    background: red;
}

.row-2 {
    background: yellow;
}

.row-3 {
    background: green;
}

Thanks!

A: Although I considered this an unlikely edge-case / scenario (users just don't usually move their cursors around like that), just give the contianier the same bg color as the last floated li
JSfiddle
ul {
    background: green; /* same as last child */
    height: 500px;
    padding: 0;
    margin: 0;
    list-style: none;
}


text:
Q: After maven dependency update from spring 3.0 to 3.1.1 and hibernate 3.6 to 4.0 . Lots of error are coming After
I changes spring version from 3.0 to 3.1.1
and hibernate version from 3.6.filal to 4.1.7.Final
so I have to change
transaction manager class to org.springframework.orm.hibernate4.HibernateTransactionManager
and session manager class to
org.springframework.orm.hibernate4.LocalSessionFactoryBean

I tried various a lot but am not able to debug . . I have changed junit to 4.9 as some places I searched that this can also be a problem.
What can be the problem
    java.lang.ClassNotFoundException: org.springframework.test.context.transaction.TransactionConfiguration
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) ~[catalina.jar:6.0.32]
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) ~[catalina.jar:6.0.32]
        at org.springframework.core.type.classreading.RecursiveAnnotationAttributesVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:167) ~[org.springframework.core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.asm.ClassReader.a(Unknown Source) [org.springframework.asm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.asm.ClassReader.accept(Unknown Source) [org.springframework.asm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.asm.ClassReader.accept(Unknown Source) [org.springframework.asm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
        at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:54) [org.springframework.core-3.1.1.RELEASE.jar:3.1.1.RELEASE]
.
.
.
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_45]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_45]
    at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_45]
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) [bootstrap.jar:6.0.32]
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) [bootstrap.jar:6.0.32]

==============================
Updated after Solution
I have to remove
<property name="configurationClass">
 <value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>

from session factory definition

A: This will answer it
Spring 3.1, Hibernate 4, SessionFactory
http://blog.springsource.org/2012/04/06/migrating-to-spring-3-1-and-hibernate-4-1/

A: Is the spring-test module/jar available on your project classpath?


text:
Q: Corda docs have wrong instructions for installing JDK I'm posting this as a possible bug report because this page says,

Troubleshooting
Please report any issues on our StackOverflow page: https://stackoverflow.com/questions/tagged/corda

Maybe these instructions for installing Java on Ubuntu are wrong (obsolete):

https://docs.corda.net/getting-set-up.html#id4
Java

*

*Open a new terminal and add the Oracle PPA to your repositories by typing sudo add-apt-repository ppa:webupd8team/java. Press ENTER when prompted.

*Update your packages list with the command sudo apt update

*Install the Oracle JDK 8 by typing sudo apt install oracle-java8-installer.

*Press Y when prompted and agree to the licence terms.

Because what I see when I do that is as follows:
cwellsx@cwellsx-VirtualBox:~$ sudo add-apt-repository ppa:webupd8team/java
[sudo] password for cwellsx:
 The Oracle JDK License has changed for releases starting April 16, 2019.

The new Oracle Technology Network License Agreement for Oracle Java SE is substantially different from prior Oracle JDK licenses. The new license permits certain uses, such as personal use and development use, at no cost -- but other uses authorized under prior Oracle JDK licenses may no longer be available. Please review the terms carefully before downloading and using this product. An FAQ is available here: https://www.oracle.com/technetwork/java/javase/overview/oracle-jdk-faqs.html

Oracle Java downloads now require logging in to an Oracle account to download Java updates, like the latest Oracle Java 8u211 / Java SE 8u212. Because of this I cannot update the PPA with the latest Java (and the old links were broken by Oracle).

For this reason, THIS PPA IS DISCONTINUED (unless I find some way around this limitation).

Oracle Java (JDK) Installer (automatically downloads and installs Oracle JDK8). There are no actual Java files in this PPA.

Important -> Why Oracle Java 7 And 6 Installers No Longer Work: http://www.webupd8.org/2017/06/why-oracle-java-7-and-6-installers-no.html

Update: Oracle Java 9 has reached end of life: http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html

The PPA supports Ubuntu 18.10, 18.04, 16.04, 14.04 and 12.04.

More info (and Ubuntu installation instructions):
- http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html

Debian installation instructions:
- Oracle Java 8: http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html

For Oracle Java 11, see a different PPA -> https://www.linuxuprising.com/2019/06/new-oracle-java-11-installer-for-ubuntu.html
 More info: https://launchpad.net/~webupd8team/+archive/ubuntu/java
Press [ENTER] to continue or Ctrl-c to cancel adding it.

Hit:1 http://fr.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease [15,4 kB]
Get:3 http://fr.archive.ubuntu.com/ubuntu bionic-updates InRelease [88,7 kB]
Get:4 http://fr.archive.ubuntu.com/ubuntu bionic-backports InRelease [74,6 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88,7 kB]
Get:6 http://fr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [713 kB]
Get:7 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [22,6 kB]
Get:8 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 48x48 Icons [10,4 kB]
Get:9 http://security.ubuntu.com/ubuntu bionic-security/main DEP-11 64x64 Icons [31,7 kB]
Get:10 http://fr.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages [574 kB]
Get:11 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [42,1 kB]
Get:12 http://fr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [285 kB]
Get:13 http://fr.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [70,9 kB]
Get:14 http://fr.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [140 kB]
Get:15 http://fr.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [978 kB]
Get:16 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 48x48 Icons [16,4 kB]
Get:17 http://security.ubuntu.com/ubuntu bionic-security/universe DEP-11 64x64 Icons [116 kB]
Get:18 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 DEP-11 Metadata [2 464 B]
Get:19 http://fr.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1 000 kB]
Get:20 http://fr.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [253 kB]
Get:21 http://fr.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [193 kB]
Get:22 http://fr.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [453 kB]
Get:23 http://fr.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2 468 B]
Get:24 http://fr.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [7 920 B]
Fetched 5 179 kB in 6s (924 kB/s)
Reading package lists... Done
cwellsx@cwellsx-VirtualBox:~$ sudo apt update
Hit:1 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease
Hit:2 http://fr.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 http://fr.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:5 http://fr.archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
cwellsx@cwellsx-VirtualBox:~$ sudo apt install oracle-java8-installer
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package oracle-java8-installer is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'oracle-java8-installer' has no installation candidate
cwellsx@cwellsx-VirtualBox:~$

Maybe (correct me if I'm wrong) the way to do that now is:

*

*Download the *.tar.gz from https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

*Unzip:
cwellsx@cwellsx-VirtualBox:~$ sudo mkdir /opt/java
cwellsx@cwellsx-VirtualBox:~$ sudo tar -zxf Downloads/jdk-8u221-linux-x64.tar.gz -C /opt/java

*Add the following to /etc/profile
# after `sudo tar -zxf Downloads/jdk-8u221-linux-x64.tar.gz -C /opt/java`
export JAVA_HOME=/opt/java/jdk1.8.0_221
export PATH=$PATH:$JAVA_HOME/bin

*Restart Ubuntu

*Verify
cwellsx@cwellsx-VirtualBox:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/java/jdk1.8.0_221/bin
cwellsx@cwellsx-VirtualBox:~$ java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

... which is like the installation instructions for Windows.

A: Thanks for your notes and contribution!
I will pass the notes to the docs team and make changes accordingly.


text:
Q: Question about degree of a irreducible polynomial and field extensions Let $F$ be a field and $p \in F[x] $ an irreducible polynomial. Let $K$ be a finite extension of $F$. How can I prove that if the degree of $p$ doesn't divide $[K:F] $, then $p$ doesn't have any roots in $K$?

A: Let $\alpha$ be a root of this irreducible $p \in F[x]$.  What is the degree of the extension $F(\alpha) / F$ ?
If $\alpha \in K$, we necessarily have a tower of fields $F \subset F(\alpha) \subset K$.  Think about the multiplicativity formula for degrees.


text:
Q: String literal implicitly converted to basic_string I'm hoping someone might be able to explain why it seems like a string literal is being implicitly converted to basic_string:
void myFunc(const char* myArg)
{

}

myFunc("MyStringLiteral")

results in the following compilation error:
cannot convert 'const string {aka const std::basic_string<char>}' to 'const char*' for
argument '1' to 'void myFunc(const char*)'

Any thoughts??
P.S. I am using the arm-none-eabi-g++ compiler


text:
Q: Search different columns by a separation of a comma I have a table that contains information such as names, email-addresses, numbers etc.

Let's pretend that I have 30 contacts by the same name but they all live in different cities . How do I split the comma and replace it with  and ....
Example
SELECT * WHERE name %$searchString% OR city %$searchString%...
Now if $searchString contains comma
SELECT * WHERE name %$searchString% OR city %$searchString%... AND SELECT * WHERE name %$searchString2% OR city %$searchString2%...
The $searchString2 contains information that's separated with comma.
Update
I want to search each row over and over again as many times as commas exist.
I'm sorry that I can't explain myself

A: This depends on whether you want to return rows where name or city match the search values exactly (=), or rows where any part of name or city match the search values (LIKE).
Regardless of which one you need, you can start out by converting your search string into an array of strings like this:
$strings = array_map('trim', explode(',', $searchString));

The array_map('trim'... ensures that you don't try to match any spaces before or after the commas in your comma-separated search string.
Here are examples for how to execute your query using prepared statements in PDO. First, full matches using IN:
$phs = rtrim(str_repeat('?,', count($strings)),',');
$stmt = $pdo->prepare("SELECT * FROM your_table WHERE name IN ($phs) OR city IN ($phs)");
// double the string values to us in both INs
$values = array_merge($strings, $strings);
$stmt->execute($values);

and partial matches using LIKE:
$sql = '';
foreach ($strings as $string) {
    $sql .= ' name LIKE ? OR city LIKE ? OR';
    $values[] = $string;
    $values[] = $string;
}
$stmt = $pdo->prepare('SELECT * FROM your_table WHERE' . rtrim($sql, ' OR'));
$stmt->execute($values);

A: You need to use WHERE IN in SQL statement.
SELECT * WHERE name LIKE '%$searchString%' AND city IN ('city1', 'city2', 'city3'...)

Here is the good discussion on how to do it in PHP: Passing an array to a query using a WHERE clause

A: Something like this?
You will need to escape/clean the value of searchString.
<?php

// $searchString = "Cardiff,London,New York";

$SQL = 'SELECT * FROM table WHERE ';

$searchStrings = explode(',',$searchString);

$SQLArray = array();

foreach($searchStrings as $searchString) {
    $SQLArray[] = "name LIKE '%$searchString%'";
    $SQLArray[] = "city LIKE '%$searchString%'";
}

$SQL .= implode(' OR ',$SQLArray);

// print $SQL;

?>