text:
Q: Oracle Apex Form fields showing pre populated values I have created a form with report in oracle apex 5.1 based on an existing table. The problem is when I run the form page to add an entry some Number Fields shows pre populated values. I have no idea why this is happening. I want all my form fields to be blank. My form template is "Blank with attribute".
Could anyone help solve this problem???

A: It seems like one of two things are happening here:
1.) your form is retaining the previous value. If this is the case, ensure that when branching to the form that you are clearing the cache of the page.
2.) you have a process, likely an ARF (Automatic Row Fetch). If so, the ARF is grabbing data from your table and assigning it to each item that has a source of DB column. You may want to review the process to ensure that you're using a unique key to fetch records.


text:
Q: Obtener el dia de semana segun una fecha en javascript Tengo el siguiente codigo de una función, necesito obtener el dia de la semana a partir de un dia que se envia a la funcion, asi la tengo:

    diaSemana : function(d){
      var fecha = new Date();
      var dias = ["L", "M", "X", "J", "V", "S", "D"];

      var mes = fecha.getMonth()+1; //obteniendo mes
      var dia = d;
      var ano = fecha.getFullYear(); //obteniendo año
      if(dia<10)
          dia='0'+dia; //agrega cero si el menor de 10
      if(mes<10)
          mes='0'+mes; //agrega cero si el menor de 10
      var fec = (dia+"/"+mes+"/"+ano);

      return dias[fec.valueAsDate.getDay()];
    }

Quiero mostrar junto al numero de dia, el nombre del dia de la semana, para ello le envío a la función el día.
Soy novato en JavaScript.

A: Te faltan algunas cosas, recuerda que la semana empieza el dia Domingo.  Tambien recuerda que las fechas en ingles empiezan con el mes.  La forma correcta seria asi:

diaSemana = function(d){
      var fecha = new Date();
      var dias = ["D", "L", "M", "X", "J", "V", "S"];

      var mes = fecha.getMonth()+1; //obteniendo mes
      var dia = d;
      var ano = fecha.getFullYear(); //obteniendo año
      if(dia<10)
          dia='0'+dia; //agrega cero si el menor de 10
      if(mes<10)
          mes='0'+mes //agrega cero si el menor de 10
      var fec = mes+"/"+dia+"/"+ano;
      var day = new Date(fec).getDay();

      return dias[day];
    }

    console.log(diaSemana(25));

redpajama_set_name: RedPajamaStackExchange


text:
Q: Как создать пустое приложение в yii2 basic Есть шаблон, хочу разрабатывать под него всё свое, но так как в папках Views,Models и Controllers уже есть демо-элементы, а они мне не нужны. Если их удалить, то появляетсья куча ошибок. Выходит для создания сайта их обязательно оставлять даже не используя?
Ошибки после удаления

Controllers/SiteController.php
Views/layout/main.php
Models/User.php


text:
Q: C# How can i show Notification Popup Form to all user? I create a notification popup form on Visual Studio with c# windows form.
The code is like that:
  PopupNotifier popup = new PopupNotifier();
                    popup.Image = Properties.Resources.information;
                    popup.TitleText = "Notification!";
                    popup.ContentText = txt_message.Text;
                    popup.Popup();

When i call the function it is working but just for me. I want to show the message for all users same time. Can i do that ?


text:
Q: Node.js parser for link headers? I'm using the Github API, which uses Link Headers, as defined here, for pagination.
Currently I'm just extracting 'next' URLs using some string manipulation but I was wondering if there was a proper module for this purpose (I haven't been able to find anything in 'npm search').
Thanks!

A: There's this: https://npmjs.org/package/parse-links
It looks a bit fragile, to my mind, but it looks like it will do very basic parsing.


text:
Q: Install SmoothDraw on Ubuntu I want to install SmoothDraw in Ubuntu so that I can make a few drawings and stuff. I have installed WINE and installed SmoothDraw however, it does not start when I double click on its icon (On the desktop).
I am on Ubuntu 12.04 LTS.
Please help me run it
Terminal output
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"configSections" in state 1
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"sectionGroup" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"section" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"userSettings" in state 1
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"SmoothDraw.Properties.Settings" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"setting" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"value" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"setting" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"value" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"setting" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"value" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"setting" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"value" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"setting" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"value" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"setting" in state 3
fixme:mscoree:ConfigFileHandler_startElement Unknown element L"value" in state 3
wine: Install Mono for Windows to run .NET 2.0 applications.

A: I installed SmoothDraw 4.0.5 with PlayOnLinux on Arch Linux (I know this is exclusively an Ubuntu forum but it should work the same for the most part). I believe I installed the dotnet40 or dotnet45 library during the installation (I definitely installed one of them, if not dotnet45 then I installed it afterwards by going into Settings > Install Components). It should theoretically work with simply dotnet40 but I did not one of the required libraries to be specifically that. I also tried installing mono but noticed something in the logs of it getting removed or something, though it is still installed on my system according to pacman (the default Arch Linux package manager), so I do not believe it is needed. But something that is needed for sure is to configure Wine so that the Windows version is set to "Windows 7". It was set to Windows 3.1 by default I think.
The colors are a little messed up. Choosing a color and/or tool may be a bit cumbersome, but I'm sure that with enough clicking around you can find your way. Also it may be hard to select different colors quickly, like Sal Khan of Khan Academy does in his videos. You can see a screenshot here.

Also regarding @An SO User's question regarding a Linux alternative (in the form of a comment on @jobin's answer), I find that the Paintbrush tool in GIMP is quite similar to the Pen tool in SmoothDraw.

A: The problem is you need to install mono for .net applications of Windows to run in Ubuntu. To install mono, open a terminal using Ctrl+Alt+t and then type:
sudo apt-get install mono-complete


text:
Q: Best Practice for running site as user I have a question about best practice for running a dedicated Magento server. We have a security consultant who want to run the site as APACHE while the Magento documentation says we should run as a web user
http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html#privs-after

Dedicated Magento server only. As a user with root privileges, enter
  the following command to set ownership of the Magento installation
  directory and all its subdirectories: chown -R web-server-user-name .

I am trying reconcile the reasoning on running as the apache user compared to a different user? Is running as the apache user more secure?

A: I just add my comment as an answer here:
As you are on a dedicated server, running as apache should be the same as running as another web-user. I guess you are not running any other website/CMS on the server and only Magento? If so, running as apache user should be fine. In this case it should be enough to set file permissions only for the user (apache) and you can refrain from setting group or others rights.


text: Q: Windows 10 with Ubuntu 18.04 dual boot using grub2 - Reisntall windows without messing grub I have Windows 10 and Ubuntu 18.04 on two different ssds. Right now dual boot is working fine with grub bootloader. I need to reinstall windows 10 on the first SSD but I don't want to mess grub and definitely don't want to lose any of the data from my Ubuntu SSD. Is this possible? I am really confused by the most of the answers found on the web.


text:
Q: Mocha + ZombieJs, document is not defined I'm using zombiejs + mocha to write some tests for a library that manipulates the DOM, it uses JavaScript native functions like document.createElement(), my problem is, when I run the tests I get an exception saying that 'document is not defined'.
Is it a problem with zombiejs, or with jsDOM? and how can I fix it?
here is an example of my code:
HTML:
<!DOCTYPE html>

    <title>XS UI Tests</title>

in tests.js:
var expect  = require( 'expect.js' )
  , Zombie  = require( 'zombie'    )
  , browser = new Zombie( { debug: true } )
;

describe( 'XS UI Tests:', function() {
  before( function( done ) {
    browser.visit( 'http://localhost:8080/test/ui.html', done );
  } );

  it( 'expect ui.html to be loaded', function() {
    expect( browser.success ).to.be( true );
  } );

  describe( 'Table Tests:', function() {
    it( 'expect div#table ( table container ) to exist', function() {
      expect( browser.query( "#table" ) ).to.be.ok();
    } );
  } );
} );

Thank you for your help

A: The document object is contained within the zombie browser. If your code doesn't find document, it is likely you are not running it within the zombie sandbox context.
Are you loading your library via zombie.visit('/page/with/library') or are you requiring it directly and trying to use it within the test?
It is best to test complete webpages rather than libraries. You should create a test page that has a few buttons/links on it which test different functions of the library, and pressButton or visit those with zombie.


text:
Q: Rails gem devise_token_auth headers in web console are enoguh to access api, why? I am learning how to implement security in my rails 5 API. I'm developing an angular app to consume the API, to do this I'm implementing devise_token_auth gem, but in my test in postman I can sign up with email and password, then I receive a response with token (with expiry), data, content-type, client, uid, then I test this from angular and signup from my browser and in the web console I can see all the information that is necesary to access the api from another application.
The devise method authenticate_user need the parameters: content-type, access-token,client, expiry, uid, but everybody could access this information if they take a look at the response in web console, so then... I pick this information and paste in a Postman request and I can access my protected endpoint, so how would this gem be useful? Am I missing something?
Here I sign-in from angular, and check response in web console:

Then paste the info in a new request in postman to access protected endpoint:

And the access is successful, how do I prevent the header information from being displayed on the web console?

A:
But everybody could access to this information if they take a look at the response in web console
Am I missing something?

Yes. "Everybody" would only be able to see their own token (excluding things like sniffing http. You will be using TLS, right?). With their token, users can do what they please and there's little you can do about it.
But they can't see other users' tokens this way.

A: This is how the internet works.
You are logging in and sending information to the server.
The server then responds with a secret token that you can use the next time instead of the username and password.
With that secret token you perform subsequent request rather than with your username and password.
Regarding your concerns about 'everybody' seeing it. This is why you need SSL encryption, this ensures that someone else cannot read the username and password you sent, and also the token you received. Without SSL anyone on your network or route to the server can indeed read it.


text:
Q: Input is not detecting that it is empty if removing text with "ctrl + a + backspace" I am doing some easy div filtering with jQuery and input field. It is working, however it is not detecting that it is empty if I remove input using " Ctrl + a + backspace ", in other words if I select all text and remove it. What causes this?
It is not reordering divs back to default if using the keyboard commands but is going back to normal if you backspace every character.
This is how I do it:
$('#brandSearch').keyup(function() {
    var valThis = $(this).val().toLowerCase();
    if (valThis.length == 0) {
        $('.card').show();
    } else {
        $('.card').each(function() {
            var text = $(this).text().toLowerCase();
            (text.indexOf(valThis) >= 0) ? $(this).parent().show(): $(this).parent().hide();
        });
    };
});

A: It seems to be working just fine:

$('#brandSearch').keyup(function() {
    var valThis = $(this).val().toLowerCase();
    if (valThis.length == 0) {
        $('.card').show();
      console.log("input is empty");
    } else {
      console.log("input is not empty");
        $('.card').each(function() {
            var text = $(this).text().toLowerCase();
            (text.indexOf(valThis) >= 0) ? $(this).parent().show(): $(this).parent().hide();
        });
    };
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id="brandSearch">

A: Your if block that handles the empty string is not showing the same elements that the else block hides. The else block calls .parent() but the if block does not.
So the else case shows or hides the parent of each .card element, but the if case shows the .card elements themselves—without unhiding their parents. See my comments added to the code (I also reformatted the conditional expression in the else for clarity):
$('#brandSearch').keyup(function() {
    var valThis = $(this).val().toLowerCase();
    if (valThis.length == 0) {
        // Show all of the .card elements
        $('.card').show();
    } else {
        $('.card').each(function() {
            var text = $(this).text().toLowerCase();
            // Show or hide the *parent* of this .card element
            text.indexOf(valThis) >= 0 ?
                $(this).parent().show() :
                $(this).parent().hide();
        });
    };
});

Since it sounds like the non-empty-string case is working correctly, it should just be a matter of adding .parent() in the if block so it matches the others:
$('#brandSearch').keyup(function() {
    var valThis = $(this).val().toLowerCase();
    if (valThis.length == 0) {
        // Show the parent of each .card element
        $('.card').parent().show();
    } else {
        // Show or hide the parent of each .card element
        $('.card').each(function() {
            var text = $(this).text().toLowerCase();
            text.indexOf(valThis) >= 0 ?
                $(this).parent().show() :
                $(this).parent().hide();
        });
    };
});

This is the kind of situation where familiarity with your browser's debugging tools would pay off big time. The .show() or .hide() methods manipulate the DOM, and by using the DOM inspector you could easily see which elements are being hidden and shown.
In fact, as a learning exercise I recommend un-fixing the bug temporarily by going back to your original code, and then open the DOM inspector and see how it reveals the problem. While you're there, also try out the JavaScript debugger and other tools.
If you use Chrome, here's an introduction to the Chrome Developer Tools. Other browsers have similar tools and documentation for them.


text:
Q: PHP and cURL in Amazon EC2 in www folder PHP and cURL work fine in a non-webfacing directory in my amazon EC2 micro install, 12.04.2 LTS (GNU/Linux 3.2.0-40-virtual x86_64).
I'm able to run some scripts on the command line using cURL:
    #!/usr/bin/php
    $command = '/absolute/path/to/running/process';
    $url = 'http://example.com';
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 400);
    curl_setopt($ch, CURLOPT_TIMEOUT, 400);

    $resp = json_decode(curl_exec($ch), 1);
    $data1 = round($resp["data1"], 6);
    $data2 = round ($resp["data2"], 2);

    curl_close($ch);

    $c = array(
            'var1' => trim(shell_exec($command)),
            'var2' => trim(shell_exec($command)),
            'var3' => trim(shell_exec($command)),
            'var4' => number_format($data1, 6, '.', ''),
            'var5' => number_format($data2, 0, '.', ',')
    );
    var_dump($c);

This works fine.
However, as soon as I put this same script in the web facing directory (I remove #!/usr/bin/php obviously), the page loads (I can type echo 'Hello World!' at the very top and see the text on a browser from a remote machine), but the page is entirely blank and adding echo statements after curl results in nothing. If I comment out the curl function calls and try to simply execute the command, it seems to not work (The entire array of values is populated with NULL or 0.).

*

*What's going on with PHP? Why won't cURL run in the /var/www/ folder but runs fine everywhere else? I'm storing information to a database using cURL to get some JSON from public APIs.

*Why can't I use shell_exec to run a script as I normally could using PHP on the command line?

*Errors aren't showing up in PHP even though error_reporting(E_ALL) is set. I can't find a log of errors by using locate to find error_log or php.err, which I thought were the default names for the php error log.

I feel like these two issues may be related, but I can't figure out why, maybe permissions? Something I noticed was that I cannot create or modify files in this directory without using the sudo command, which isn't usual.
Another note: phpinfo() says nothing about cURL, but it works on the command line. I'm not sure why.

A: Ubuntu has separate php.ini files for command line PHP and Apache2 PHP. Your config in those files most likely has different extensions loaded (or different security settings), which makes Apache not have the same functionality as the CLI.
$ ls -l /etc/php5/cli/php.ini
-rw-r--r-- 1 root root 65485 Jan 27 09:20 /etc/php5/cli/php.ini

$ ls -l /etc/php5/apache2/php.ini
-rw-r--r-- 1 root root 65839 Oct 31  2012 /etc/php5/apache2/php.ini

A: Just an observation, there are extra <'> single quotes in these lines:
        'var1' => trim(shell_exec($command')),
        'var2' => trim(shell_exec($command')),
        'var3' => trim(shell_exec($command')),

other than that, I agree with Joachim's suggestion.


text:
Q: How to download large file from google drive from terminal? (gdown doesn't work) This is the extension to this question. All the solution on that post I tired doesn't work for now, unfortunately, since I don't have enough reputation to comment on that post, I can only make a new post about it.
The question is how to download large file using only terminal. An example large file is this
I think the most recent solution is using gdown. Since the id for the file above is 1Vq_UO-T9345uYs8a7zloukGfhDXSDd2A, I tried:
gdown --id 1Vq_UO-T9345uYs8a7zloukGfhDXSDd2A
and I received error message:
        Too many users have viewed or downloaded this file recently. Please
        try accessing the file again later. If the file you are trying to
        access is particularly large or is shared with many people, it may
        take up to 24 hours to be able to view or download the file. If you
        still can't access a file after 24 hours, contact your domain
        administrator.

The most recent solution suggested on this github discussion page also suggest the same error is received when downloading a huge file, >50gb

A: You can try generating an OAuth token

*

*Go to OAuth 2.0 Playground https://developers.google.com/oauthplayground/

*In the Select the Scope box, paste https://www.googleapis.com/auth/drive.readonly

*Click Authorize APIs and then Exchange authorization code for tokens

*Copy the Access token

*Run in terminal

curl -H "Authorization: Bearer ACCESS_TOKEN" https://www.googleapis.com/drive/v3/files/FILE_ID?alt=media -o FILE_NAME


text:
Q: "Class 'Auth' not found" in file of public folder I have 2 files in public folder. The first generates json via php and second java script to fill the php file in the views.
The proble is that i need to pass the logged user name to the json php file.
The error is this:
Fatal error: Uncaught Error: Class 'Auth' not found in C:\WEB\vhosts\blog\public\datatableeditor\data.php:168 Stack trace: #0 {main} thrown in C:\WEB\vhosts\blog\public\datatableeditor\data.php on line 168

after this  i add
use Illuminate\Support\Facades\Auth;

and the next error is:
Fatal error: Uncaught Error: Class 'Illuminate\Support\Facades\Auth' not found in C:\WEB\vhosts\blog\public\datatableeditor\data.php:169 Stack trace: #0 {main} thrown in C:\WEB\vhosts\blog\public\datatableeditor\data.php on line 169

How to navigate to the class?

A: To put it short, Auth class is autoloaded by composer. Therefore you need to require it's autoload.php file. Based on directory structure you've provided it should look something like this in your data.php:
require __DIR__ . '/../../vendor/autoload.php';

That being said, it won't help you, because facades need Laravel's service container to be initialized first to work. Check official documentation on Laravel's directory structure. You should never expose your PHP files in public folder - that is plain wrong and can lead to severe security problems. If you want to use Laravel's services then you need to organize your project properly.
If you want some PHP logic to be accessible by URL you create route and link it up with specific controller's action and then put your PHP logic inside that controller.
This way Laravel's index.php can process your request, boot all framework parts properly and handle it.

A: Laravel is an MVC framework. The proper way to handle this is to use routes and controllers, you should never be creating php files in the public directory if you want them to be a part of the application.
Even if you autoloaded the vendor files and bootstrapped laravel, you'd be missing the middlewares that authenticate users.  I recommend you read through all of the docs and read up on MVC before using Laravel.


text:
Q: Unable to subscribe to multiple topics in mqtt I run a simple mqtt publisher c code that subscribe "Hello World".
mqtt subscriber1:
mosquitto_sub -h xx.xx.xx.xx -t "mq_test"

Consecutively i run the same mqtt publisher code in another location and subscribe with different topic to same host.
mqtt subscriber2:
mosquitto_sub -h xx.xx.xx.xx -t "mq_t"

When i starts the second publisher program, first mqtt subscription stops.
Why this issue occurs, i think it is possible to subscribe to multiple topics.
mqtt publisher c code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <MQTTClient.h>
#define ADDRESS     "tcp://xx.xx.xx.xx:abcd"
#define CLIENTID    "ExampleClientPub"
#define TOPIC       "mq_test" //"mq_t"
#define PAYLOAD     "Hello World!"
#define QOS         1
#define TIMEOUT     10000L
int main(int argc, char* argv[])
{
    MQTTClient client;
    MQTTClient_connectOptions conn_opts = MQTTClient_connectOptions_initializer;
    int rc = 0;
    MQTTClient_create(&client, ADDRESS, CLIENTID,
        MQTTCLIENT_PERSISTENCE_NONE, NULL);
    conn_opts.keepAliveInterval = 5;
    conn_opts.cleansession = 1;
    if ((rc = MQTTClient_connect(client, &conn_opts)) != MQTTCLIENT_SUCCESS)
    {
        printf("Failed to connect, return code %d\n", rc);
        exit(EXIT_FAILURE);
    }
    MQTTClient_message pubmsg = MQTTClient_message_initializer;
    MQTTClient_deliveryToken token;
    while(1){
        rc = 0;
         pubmsg.payload = PAYLOAD;
        pubmsg.payloadlen = strlen(PAYLOAD);
        pubmsg.qos = QOS;
        pubmsg.retained = 0;
        MQTTClient_publishMessage(client, TOPIC, &pubmsg, &token);
        printf("Waiting for up to %d seconds for publication of %s\n"
            "on topic %s for client with ClientID: %s\n",
            (int)(TIMEOUT/1000), PAYLOAD, TOPIC, CLIENTID);
         rc = MQTTClient_waitForCompletion(client, token, TIMEOUT);
         printf("Message with delivery token %d[%d] delivered\n", token,rc);
    }
    MQTTClient_disconnect(client, 10000);
    MQTTClient_destroy(&client);
    return rc;
}

A: You are using same code for multiple mqtt publisher only by changing topic and client id in both publisher remain same.please try out the scenario by giving different client id for the publishers.

A: #define CLIENTID    "ExampleClientPub"

Each application/program that connects to an MQTT Broker needs their own unique clientId.
i.e. "MyClnt001", "MyClnt002", "MyClnt003", etc.

A: You can subscribe to multiple topics from mosquitto_sub client with multiple -t options as below:
mosquitto_sub -t topic1 -t topic2 -t topic3

Programmatically, you can achieve this by connecting once (with one clienId) and subscribing multiple times in a loop with different topics if your client library supports subscribing on the existing connection.


text:
Q: Javascript not working in apache-served html I set up an apache server on gentoo, I want to be able to run javascript code in my html files served by apache.
If I manually open up the html file that lives on the apache server in Chrome, the javascript works fine. If I browse to the html file using the server address via apache, it does not execute. This is my test html, it's very simple:

js test

I haven't ever seen this behavior before. Any ideas?
EDIT:
What I mean by opening manually and using the server address is this:
file:///mnt/server/path/to/file.html (opening manually)
http://server/path/to/file.html (browsing to apache server)

EDIT 2:
No errors in apache's error_log. At first I was using jquery to try to do some ajax stuff, but I tried to simplify everything to the max for this question.

A: As pointed out by @Blender, the HTML is missing the typical head.../head and body.../body sections.  Maybe this matters in the HTML loading properly and the browser triggering the script portions.
Also, pop ups like alert() can be blocked by pop up blockers in the browser that can differentiate a site vs a file url.


text:
Q: Vector drawable distorted I have many imageviews that use a vector drawable as it's source. For most of them it's material icons but when I imported a more complicated vector it shows up distorted on Lollipop devices but just fine on Jellybean devices. This is supposed to say SYSTEMS but clearly has problems.

Layout:
<ImageView
android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/splash_logo"
        app:srcCompat="@drawable/logo_small"
        tools:ignore="MissingPrefix"
        android:layout_centerVertical="true"
        android:layout_marginRight="20dp"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

Gradle build file:
defaultConfig {
    applicationId "com.android.example"
    minSdkVersion 16
    targetSdkVersion 23
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    generatedDensities = []
}

aaptOptions {
    additionalParameters "--no-version-vectors"
}

Vector drawable:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="160dp"
    android:height="40dp"
    android:viewportWidth="432.0"
    android:viewportHeight="108.0">
<path
    android:pathData="M247.77,92.34a4.5,4.5 0,0 0,4 2.09c2.26,0 3.64,-1.3 3.64,-2.91 0,-3.68 -8,-2.1 -8,-6.81 0,-2.22 2.14,-3.79 5.52,-3.79a6.67,6.67 0,0 1,3.76 0.94,5.37 5.37,0 0,0 -0.69,1.68h-0.3a3.1,3.1 0,0 0,-3 -1.88c-1.91,0 -3.28,1 -3.28,2.48 0,3.75 8,2.18 8,6.61 0,2.45 -2.31,4.51 -6.23,4.51a7.26,7.26 0,0 1,-4.2 -1.14,4.84 4.84,0 0,0 0.48,-1.78h0.31Z"
    android:fillColor="#fff"/>
<path
    android:pathData="M266.2,81.18a9.57,9.57 0,0 0,2.79 0c1.48,2.28 3.08,4.55 4.83,6.93a65,65 0,0 0,4.81 -6.93,4.85 4.85,0 0,0 2,0 99.26,99.26 0,0 0,-6.15 7.91c0,2 0.08,4.67 0.2,5.91a7.92,7.92 0,0 0,-2.49 0,46.6 46.6,0 0,0 0.2,-5.69C271.36,87.93 267.27,82.44 266.2,81.18Z"
    android:fillColor="#fff"/>
<path
    android:pathData="M290.21,92.34a4.5,4.5 0,0 0,4 2.09c2.26,0 3.64,-1.3 3.64,-2.91 0,-3.68 -8,-2.1 -8,-6.81 0,-2.22 2.13,-3.79 5.52,-3.79a6.69,6.69 0,0 1,3.77 0.94,5.28 5.28,0 0,0 -0.69,1.68h-0.31a3.1,3.1 0,0 0,-3 -1.88c-1.91,0 -3.28,1 -3.28,2.48 0,3.75 8,2.18 8,6.61 0,2.45 -2.32,4.51 -6.23,4.51a7.24,7.24 0,0 1,-4.19 -1.14,4.92 4.92,0 0,0 0.48,-1.78h0.3Z"
    android:fillColor="#fff"/>
<path
    android:pathData="M314.11,86.37q0,-2.07 -0.08,-4.15c-1.75,0 -4,0.08 -5.44,0.22a1.8,1.8 0,0 0,0.13 -0.64,1.91 1.91,0 0,0 -0.13,-0.62c2.19,0.06 4.37,0.1 6.56,0.1s4.38,0 6.56,-0.1a2,2 0,0 0,-0.13 0.64,1.85 1.85,0 0,0 0.13,0.62c-1.42,-0.14 -3.69,-0.22 -5.44,-0.22q-0.08,2.07 -0.08,4.15v3.45c0,1.72 0.1,3.47 0.2,5.19a9.29,9.29 0,0 0,-1.25 -0.1,9.19 9.19,0 0,0 -1.25,0.1c0.1,-1.72 0.2,-3.46 0.2,-5.19V86.37Z"
    android:fillColor="#fff"/>
<path
    android:pathData="M331.8,86.35c0,-1.72 -0.1,-3.47 -0.2,-5.17 1.52,0.06 3,0.1 4.55,0.1s3,0 4.53,-0.1a2.39,2.39 0,0 0,0 1.2c-2.13,-0.12 -3.38,-0.26 -6.69,-0.26 0,0.86 -0.1,1.56 -0.1,2.54s0,2.14 0,2.65c3,0 4.68,-0.1 6.18,-0.2a2.66,2.66 0,0 0,-0.08 0.62,2.5 2.5,0 0,0 0.08,0.6c-1.76,-0.14 -5,-0.18 -6.18,-0.18 0,0.48 0,1 0,2.91 0,1.52 0,2.5 0,3a58.72,58.72 0,0 0,6.87 -0.26,2.54 2.54,0 0,0 -0.08,0.62 2.22,2.22 0,0 0,0.08 0.58c-1.5,-0.06 -3,-0.1 -4.58,-0.1s-3.07,0 -4.62,0.1c0.1,-1.74 0.2,-3.49 0.2,-5.21V86.35Z"
    android:fillColor="#fff"/>
<path
    android:pathData="M353.24,80.92c2.31,3.77 4.7,7.29 7.3,11 1,-1.56 5.06,-7.33 7.55,-11h0.33c0.76,5.13 1.27,9.5 2.08,14.08a7.29,7.29 0,0 0,-2.39 0c-0.36,-3.59 -0.71,-6.91 -1.24,-10.34h-0.05c-2.31,3.35 -4.65,6.63 -6.66,10.24h-0.23c-2,-3.32 -4.32,-6.77 -6.53,-10.24h-0.05c-0.48,3.31 -1.19,8.08 -1.22,10.34a4.06,4.06 0,0 0,-1.78 0c0.89,-4.43 1.91,-9.84 2.47,-14.08h0.43Z"
    android:fillColor="#fff"/>
<path
    android:pathData="M380.75,92.34a4.51,4.51 0,0 0,4 2.09c2.26,0 3.63,-1.3 3.63,-2.91 0,-3.68 -8,-2.1 -8,-6.81 0,-2.22 2.14,-3.79 5.52,-3.79a6.66,6.66 0,0 1,3.76 0.94,5.44 5.44,0 0,0 -0.69,1.68h-0.3a3.11,3.11 0,0 0,-3 -1.88c-1.91,0 -3.28,1 -3.28,2.48 0,3.75 8,2.18 8,6.61 0,2.45 -2.31,4.51 -6.23,4.51A7.24,7.24 0,0 1,380 94.13a4.91,4.91 0,0 0,0.48 -1.78h0.3Z"
    android:fillColor="#fff"/>
</vector>

A: This seems to have been fixed with the latest version of Android Studio (2.0) and Build Tools (23.0.3). I also removed generatedDensities = [] and aaptOptions { additionalParameters "--no-version-vectors" } as well as support and appcompat libraries, relying soley on the design library. I have tested on both Jellybean and Lollipop devices and while the vector preview still looks distorted in Android Studio, it shows up just fine on all physical devices. Seems like this issue was a bug on Google's end.


text:
Q: No signature of method: build_71bf6xmmzud4xwqeove690faz.publishing() is applicable for argument types: I have receive this error when I try to build the project
it's existing project and I just upgrade the gradle version to it's latest version I have also update the all dependencies recently
this is my build.gradle file where the error
apply plugin: 'kotlin-android'
apply plugin: 'maven-publish'

buildscript {
  // Simple helper that allows the root project to override versions declared by this library.
  ext.safeExtGet = { prop, fallback ->
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
  }

  repositories {
    mavenCentral()
  }

  dependencies {
    classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.4.21')}")
  }
}

group = 'host.exp.exponent'
version = '2.2.0'

// Upload android library to maven with javadoc and android sources
configurations {
  deployerJars
}

// Creating sources with comments
task androidSourcesJar(type: Jar) {
  classifier = 'sources'
  from android.sourceSets.main.java.srcDirs
}

// Put the androidSources and javadoc to the artifacts
artifacts {
  archives androidSourcesJar
}

publishing {
  repositories {
    mavenDeployer {
      url = uri("${rootproject.projectDir}/maven-repo")
      configuration = configurations.deployerJars
      repository(url: mavenLocal().url)
    }
  }
}

android {
  compileSdkVersion safeExtGet("compileSdkVersion", 30)

  compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
  }

  defaultConfig {
    minSdkVersion safeExtGet("minSdkVersion", 21)
    targetSdkVersion safeExtGet("targetSdkVersion", 30)
    versionCode 8
    versionName "2.2.0"
  }
  lintOptions {
    abortOnError false
  }
}

repositories {
  mavenCentral()
}

if (new File(rootProject.projectDir.parentFile, 'package.json').exists()) {
  apply from: project(":unimodules-core").file("../unimodules-core.gradle")
} else {
  throw new GradleException(
      '\'unimodules-core.gradle\' was not found in the usual React Native dependency location. ' +
          'This package can only be used in such projects. Are you sure you\'ve installed the dependencies properly?')
}

dependencies {
  unimodule 'unimodules-core'
  unimodule 'expo-modules-core'

  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${safeExtGet('kotlinVersion', '1.4.21')}"
  api 'com.github.bumptech.glide:glide:4.9.0'
  api 'com.facebook.fresco:fresco:2.0.0'
}

I have lot of search on this topic but not found any result that will work for me


text:
Q: Creating UIViewController with delegate I have a ViewController that calls a custom class PopOverModal and passes in itself and a child ViewController.
class ViewController: UIViewController {
   ...
    @IBAction func testPopOver(_ sender: Any) {
       var childVC = // initialize child view controller with view from storyboard
       var myPopOverModal = PopOverModal(parent: self, child: childVC);
    }
   ...
}

I need the childVC to delegate some tasks to the PopOverModal.
class ChildViewController: UIViewController {
    ...
    weak var delegate: PopOverModal?
    ...
}

class PopOverModal {
    init(parent: UIViewController, child: UIViewController) {
        child.delegate = self
        child.dismiss(animated: true, completion: nil)
    }
}

The initializer for the PopOverModal gives an error because UIViewController has no property delegate.
So then I did the following:
protocol PopOverViewController: class {
    weak var delegate: PopOverModal? {get set}
}

class ChildViewController: UIViewController, PopOverViewController {
    ...
    weak var delegate: PopOverModal?
    ...
}

class PopOverModal {
    init(parent: UIViewController, child: PopOverViewController) {
        child.delegate = self
        child.dismiss(animated: true, completion: nil)
    }
}

However, now I get the error that dismiss is not a function of PopOverViewController.
What can I do to be able to access both the functions and properties of UIViewController and PopOverViewController while making sure that ChildViewController inherits from UIViewController?
I know I can create a Hybrid class that inherits from UIViewController and conforms to PopOverViewController and have my ChildViewController inherit that, but is there another way?

A: If it is guaranteed that child will be an instance of ChildViewController class then you can modify your initializer signature so that it accepts corresponding object:
init(parent: UIViewController, child: ChildViewController) {
  child.delegate = self
  child.dismiss(animated: true, completion: nil)
}

If it could be an arbitrary UIViewController but delegate is actual only for instances of ChildViewController then you can use type casting with either optional chaining or optional binding:
// Option #1 - optional chaining
init(parent: UIViewController, child: UIViewController) {
  (child as? ChildViewController)?.delegate = self
  child.dismiss(animated: true, completion: nil)
}

// Option #2 - optional binding
init(parent: UIViewController, child: UIViewController) {
  if let child = child as? ChildViewController {
     child.delegate = self
  }
  child.dismiss(animated: true, completion: nil)
}

By the way, it is considered as a best practice to use protocol-based delegation. Here's an example of how it could be done:
protocol PopOverDelegate: class {
  // add any methods and properties that the delegate should implement
  func didPressButton()
}

class ChildViewController: UIViewController {
  ...
  weak var delegate: PopOverDelegate?
  ...
  // call delegate methods where you need them
  func onButtonPress() {
    self.delegate?.didPressButton()
  }
}

class PopOverModal: PopOverDelegate {
  init(parent: UIViewController, child: UIViewController) {
    (child as? ChildViewController)?.delegate = self
    child.dismiss(animated: true, completion: nil)
  }

  // MARK: - delegate methods
  func didPressButton() {
    print(#function)
  }
}


text:
Q: One page per sheet property in JasperReports I have a requirement where I have to design a report in JasperReports. The report has 4 sheets. The first sheet has 5 pages and similarly other sheets has one or two pages.The problem that I am facing is if I use the net.sf.jasperreports.export.xls.one.page.per.sheet property and set it to true, then all the pages comes in different sheets. I need to design the report in such a manner that some  pages will come in a same sheet and some pages in a different sheet.
Is it possible to do this?

A: Assuming you Have 4 separate reports that you are batch exporting, then in each report you need to set Ignore Pagination to true (it is an attribute in the jasperReport tag at the beggining of the jrxml file, the attribute looks like isIgnorePagination="true").
To actually export it should look similar to this:
List<JasperPrint> jasperPrintList = new ArrayList<JasperPrint>();
jasperPrintList.add(JasperFillManager.fillReport("report1.jasper", params1));
jasperPrintList.add(JasperFillManager.fillReport("report2.jasper", params2));
jasperPrintList.add(JasperFillManager.fillReport("report3.jasper", params3));
jasperPrintList.add(JasperFillManager.fillReport("report4.jasper", params4));

JRXlsExporter exporter = new JRXlsExporter();

exporter.setParameter(JRExporterParameter.JASPER_PRINT_LIST, jasperPrintList);
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, "BatchExportReport.xls");
exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);

exporter.exportReport();

To set the sheet names, take a look at Dynamic Sheet Names example they have at JasperForge.

According to your comment you are wanting to use the same report templates to export to multiple formats. With excel being the only one that needs to ignore pagination. What you can do is set via a parameter at runtime instead of hardcoded in the report. So add the following to the params1,params2,params3,and params4:

if(exportFormat == EXCEL) {
   params1.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
   params2.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
   params3.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
   params4.put(JRParameter.IS_IGNORE_PAGINATION, Boolean.TRUE);
}


text:
Q: How can I properly show this code snippet in HTML? This is a very basic HTML snippet I have:

        import java.util.List;

        public class Foo {
            public void foo(List<List<Integer>> bar) {
            }
        }

Where I expect to see the following when opening in a browser:
import java.util.List;

public class Foo {
    public void foo(List<List<Integer>> bar) {
    }
}

However something breaks in the parameter list of the method and what gets rendered is:
import java.util.List;

public class Foo {
    public void foo(List> bar) {
    }
}

What am I missing? Isn't it enough to be in code tag to hint the browser not to interpret anything inside as HTML? Or is this a different problem?

A: If you put angle brackets (even in a  tag) they're still interpreted as HTML elements. You can get around this by escaping the < symbol using <. Working example below:

import java.util.List;

public class Foo {
    public void foo(List<List<Integer>> bar) {
    }
}


text:
Q: Python - split entries into an array I have a JSON response that has a 2 sections I want to run numerical comparisons on. I can get at the values but I am struggling to remove the [] and split the entries with ,. My string looks like this:
r = """{
    "eth_btc":{
        "asks":[
            [103.426,0.01],
            [103.5,15],
            [103.504,0.425],
            [103.505,0.1]
        ],
        "bids":[
            [103.2,2.48502251],
            [103.082,0.46540304],
            [102.91,0.99007913],
            [102.83,0.07832332]
        ]
    }
}"""

The values are "cost, volume". I need both values, and I want to do numerical comparisons between ASKS and BIDS.
I need to get rid of the [] which is easy, and I would also like to separate the values with SPLIT, but I am having trouble putting them into a LIST. Since the data is already in a dictionary, perhaps I don't need to do all of this but I am unsure how to proceed.
j = json.loads(r)
mylist = list()
for item in j['eth_btc']['asks']:
    tempString = str(item).strip('[]')
    mylist.append(tempString.split(','))

print (mylist)

The values then need to be turned from strings into numbers.
I appreciate any help getting going on this.

A: In fact, you don't have to do anything here, json does it for you.
import json

j = json.loads(r)
mylist = list()
print j['eth_btc']['asks']

Output:
[[103.426, 0.01], [103.5, 15], [103.504, 0.425], [103.505, 0.1]]

json already parse integers and floats in expected type (int and float). You don't have to re-parse it by hand.

If you need to got pairs and do maths on it, do somehting like:
for pair in j['eth_btc']['asks']:
    print pair
    print pair[0] * pair[1]
    print '-' * 20

Output:
[103.426, 0.01]
1.03426
--------------------
[103.5, 15]
1552.5
--------------------
[103.504, 0.425]
43.9892
--------------------
[103.505, 0.1]
10.3505
--------------------


text:
Q: Starting phrase for giving advice I want to give some advice casually. Consider this sentence,

Just a reminder: If you think you can make someone's day please do it,
cause the world need more love.

Here, I love the way the phrase "Just a reminder" has been put in at the beginning.
Similarly, I am looking for an introductory phrase to casually give advice. For example,

Settling the issues with anger is easy, you must have the courage to
actually explain to your child the actual thing.

I thought some phrases might be,

*

*Just an advice

*Just some casual thoughts
But you see, they are not really appropriate for my case. Can someone suggest better phrases?

A: You could say

If you want my advice

or again

If you ask me

Words like Frankly or If I were you/in your shoes, could also introduce advice.

A: "Here's a tip" is a well-known introductory expression (pragmatic marker: focusing: giving advice).
Rick Steves even uses it punningly in an article in Smarter Travel:
- Here's a Tip: Don't Stress Over Tipping


text:
Q: Apply condition on a series What is the best way to apply condition on each element in a series, and store the result on a new [0, 1]^n series?
For example:
Apply condition : >= 10  on series : [4, 10, 100, 5]
will return:
[0, 1, 1, 0]

A: let series = dynamic([4, 10, 100, 5]);
let 10ths = repeat(10, array_length(series));
print array_iff(series_greater_equals(series, 10ths), 1, 0)

print_0

[0,1,1,0]

Fiddle

A: More generic approach :-)
print series = dynamic([4, 10, 100, 5])
| mv-apply series to typeof(int) on (summarize make_list(iff(series >= 10, 1, 0)))

list_

[0,1,1,0]

Fiddle


text:
Q: Find values in a matrix and put them into a vector It must be simple, but surprisingly I couldn't find an answer to this problem here or by trial-and-error.
I want to get values out of a matrix (according to some condition) and place the values into a vector.  I also need the subscript indices of the matching values.  There is a lot of data so for loops are out.
This is a correct (but iterative) answer:
[I,J] = find(A > 5);
values = zeros(numel(I),1);
for i=1:numel(I)
    values(i) = A(I(i),J(i));
end

I tried values = A(I,J) but this is n-by-n instead of n-by-1.

A: You can implicitly treat the matrix like a vector (linear indexing):
I = find(A > 5);
values = A(I);

Note that you can do this more efficiently with logical indexing:
values = A(A > 5);


text:
Q: What will happen if I (accidentally) pour a bucket of water inside my pc? Is it dangerous? What will happen to me and the PC?
Edit:
It's a serious question.  The other day I almost spilled a bottle of cola inside my PC (the case was open).

A: You are likely to create many new circuits on your motherboard, mostly of the short-to-ground variety.  If you are extremely fortunate, the power supply will blow before you discover the incandescent CPU, or find a ground outside the computer case.  It is possible nothing will be fried (my wife once put her powered-up phone in a glass of water and it survived), but I would expect several somethings would be destroyed.  At least one something that is destroyed will not be easy to replace.  YMMV.  Don't try this at home, let Mythbusters do the test.

A: It is possible for some electronics to survive being exposed to water briefly if they are

*

*powered off already

*very very quickly powered off

... and allowed to dry thoroughly before being powered on again.
I feel I should point out, however, that the more conductive the liquid, the worse the result.
 Even with distilled (pure) water the results will be .. unpleasant.

A: With a high probability first of all it will shut down, in a very fast way and maybe with some special effects (sound, sparks) and it might also take all your flat's lights with it - depends on your fuses.
If you try to restart it directly after its shower, same effect.
After waiting for it to dry (with opened case, maybe take out cards and hard drives) you have a little chance that it will work fine, a very little chance. It's more likely you will have to replace some components, broken from an electric overload or just by the water.


text:
Q: Will a thread sleep if told to sleep for zero seconds? My question is simple. If I use std::this_thread::sleep_for(0ms), will the thread sleep at all?
I know this seems like a silly question, but when I tell a thread to sleep for a very small amount (such as 10 microseconds), it often sleeps for at least 5-10 milliseconds. I know this is related to how operating systems schedule their processes. I just want to know how all of the corner cases work, as I have some code that may be slowing down due to sleeping for small, zero, or negative amounts of time.
EDIT 1: I have simplified the question to just be about sleeping for zero seconds.
EDIT 2: Many comments so far has been about how I shouldn't try to do this, but I both have a reason and I'm curious. In my code, I am not literally calling std::this_thread::sleep_for(0ms), but instead, I am sleeping for a variable amount of time based on external conditions. When I compute the amount of time I need to sleep, the result can be positive, negative, or zero. I want to know if I am still sleeping for results less than or equal to zero.

A: The most common behavior that I've observed on typical platforms is that it acts like a voluntary yield operation. That is, it will do nothing unless there is another ready-to-run thread that is not currently scheduled, in which case it will yield to that thread.
There are no specific requirements on how the platform handles this case. Treating as a no-op would be perfectly reasonable. Treating it as the shortest sleep the platform could support would also be perfectly reasonable.


text:
Q: Sinatra pass anonymous block I am new to Sinatra and am trying to implement the following:
REST service with get method whose action block can be provided. Something like:
class C1
  get '/something' do
     <some action to be provided later>
  end

  post '/something' do
     <some action to be provided later>
  end
end

C1.new
C1.get_block = { "Hello from get" }
C1.post_block = { "Hello from post" }

Is it possible to do something like above? I am designing an intercepting service which can be used to perform different actions depending on conditions

A: The following should do the trick. I've added arrays so you can register multiple blocks that should be executed upon a GET/POST requests.
class C1
  @@get_blocks = []
  @@post_blocks = []

  def register_get(block)
    @@get_blocks << block
  end

  def register_post(block)
    @@post_blocks << block
  end

  get '/something' do
     @@get_blocks.each do |block|
       block.call(params)
     end
  end

  post '/something' do
     @@post_blocks.each do |block|
       block.call(params)
     end
  end
end

C1.new
C1.register_get { |params| "Hello from get" }
C1.register_post { |params| "Hello from post" }

A: I think @MartinKonecny answered the question using a very nice dynamic and effective approach...
...But please allow me to suggest a different approach, assuming that the code itself is static and that it is activated according to a set of conditions.
I know that using the Plezi framework you could alternate controllers for the same route, so that if one controller doesn't answer the request, the next one is tested.
I believe that Sinatra could be used in the same way, so that when the first route fails, the second route is attempted.
A short demonstration of the concept (not an actual app code), using the Plezi framework would look something like this:
require 'plezi'

listen

class C1
  def index
     "Controller 1 answers"
  end
  def hello
     false
  end
end

class C2
  def show
     "Controller 2 shows your request for: #{params[:id]}"
  end
  def hello
     'Hello World!'
  end
end

route '/(:id)', C1
route '/(:id)', C2

exit # exit the terminal to test this code.

This way, for the path localhost:3000/, the C1 class answers. But, the route for C1 fails the restful request for the path localhost:3000/1, so the route for C2 answers that request, attempting to show object with id==1.
This is easy to see when accessing the localhost:3000/hello route - the first route fails, and the second one is then attempted.
If you don't need to define the blocks dynamically, perhaps this approach - which I assume to be available also in Sinatra - will be more easy to code and maintain.
If this isn't available using Sinatra, you could probably imitate this approach using a "routing" class as a controller on your Sinatra app.
Another approach would be to specify the conditions in a case statement, calling different methods according to each situation.
class C1
  get '/something' do
     case
     when true # condition
        # do something
     when true # condition
        # do something
     when true # condition
        # do something
     when true # condition
        # do something
     else
       # do something
     end
  end
end


text:
Q: Outbound SSO in Salesforce with telephony system Can somebody tell me how to do single sign on in salesforce and third party telephony service?
i want to login in my salesforce with my username and password but to sign in telephony i need username and extension number of agent...
i am getting confused whether is it possible with SSO or not?

A: This not valid use case for SSO, this is the definition provided by SF for SSO in their SSO implementation guide. Single sign-on (SSO) lets users access authorized network resources with one login. You validate
usernames and passwords against your corporate user database or other client apps rather than
Salesforce managing separate passwords for each resource. It seems to me this use case for integration, but need more information to confirm 100%.


text:
Q: Firebase Firestore onSnapshot PayloadTooLargeError: request entity too large on Expo / React Native project I have Expo / React Native project that subscribes to listen Firestore collection updates. I updated Expo SDK from 39 to 40 and  onSnapshot callback function started to throw 'PayloadTooLargeError: request entity too large' when it gets called.  I have not updated documents in collection nor I have changed code.  Firebase version is, "firebase": "7.9.0" and I didn't update it when upgrading Expo SDK.
Does anyone know what causes this and how to fix?
I subscribe to collection updates like this
  componentDidMount = () => {

//Subscribe for collection changes
const unSubscribeUpdates = this.unsubscribe = db.collection("test_collection")
.onSnapshot({includeMetadataChanges: false}, this.onTestCollectionChanged).bind(this);

//Subscribe for favourite changes
const unSubscribeFavouriteUpdates = this.unsubscribe = db.collection("favourites")
.doc(Firebase.auth().currentUser.uid)
.onSnapshot({includeMetadataChanges: false},this.onFavouritesChanged).bind(this);

this.setState({ collection_items: items, favourites:favourites, unSubscribeUpdates: unSubscribeUpdates, unSubscribeFavouriteUpdates:unSubscribeFavouriteUpdates });

and listeners are like this
  onFavouritesListChanged = (doc) => {
    console.log("onFavouritesListChanged for user :" + Firebase.auth().currentUser.uid);
.....

  onVideoListChanged = (snapshot) => {
    console.log("onVideoListChanged");
    console.log("videos length " + this.state.videos.length);

This is the error

onVideoListChanged
PayloadTooLargeError: request entity too large
at readStream (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/@expo/dev-server/node_modules/raw-body/index.js:155:17)
at getRawBody (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/@expo/dev-server/node_modules/raw-body/index.js:108:12)
at read (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/@expo/dev-server/node_modules/body-parser/lib/read.js:77:3)
at jsonParser (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/@expo/dev-server/node_modules/body-parser/lib/types/json.js:135:5)
at call (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/connect/index.js:239:7)
at next (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/connect/index.js:183:5)
at serveStatic (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/serve-static/index.js:75:16)
at call (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/connect/index.js:239:7)
at next (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/connect/index.js:183:5)
at call (/Users/nnn/.nvm/versions/node/v14.15.4/lib/node_modules/expo-cli/node_modules/connect/index.js:248:3)

A: It turned out that this was not issue in Expo but instead in NodeJs 14 when printing too long string into console.log output.

A: It is the warning of the cnosole.log output


text:
Q: Identify multiple images present on page with userscript? var image = new Image();
image.src = ("https://website.com/images/a.jpg")

if (image.width == 0) {
  alert("image not present");
} else {
    alert("image is present");
}

This is working just for image a.jpg
I want userscript to alert when any of these images found on the page a.jpg or b.jpg or c.jpg
I tired jquary OR operator like this but not working
image.src = ("https://website.com/images/a.jpg" ||  https://website.com/images/b.jpg")
Looking for a way to achieve this.
Thanks

A: Well you could add your image urls to an array and iterate through that array
const prefix = "https://website.com/images/";
const imagesFiles = ["a.jpg", "b.jpg","c.jpg"];

imageFiles.forEach(fileName => {
   const image = new Image();
   image.src = prefix + fileName;
   if(image.width == 0){
      alert("image not present");
    } else {
      alert("image is present");
    }
});

But I am not sure if this solves your problem, because I am not sure if Image() will throw an error on 404. And I think you will need to add an event handler to image, because loading an image is an asynchronous task.
Further reading:
https://www.w3schools.com/jsref/met_element_addeventlistener.asp


text:
Q: How to update all columns when using BigQuery DML I have a Bigquery table that I want to periodically update with new data.
I was thinking of using another table and a UPDATE query, but it seems I have to specify all the columns I want to update.
UPDATE
  dataset.t t
SET
  my_column = u.my_column
 ...
FROM
  dataset.u u
WHERE
  t.my_key = u.my_key

Is there a way to write a query that will update all fields from the destination table? I have a lot of them.


text:
Q: Superconductivity What is the correct explanation of why superconductivity occurs in metals when they are cooled to a temperature below $T_c$?
My textbook has the following explanation:

Superconductivity is the phenomenon exhibited by certain metals (type 1 superconductors only) where they will have no resistance to the flow of electricity when their temperature is cooled below the critical temperature.
  In superconductors above the critical temperature (Tc) of normal conductors, the thermal vibrations of the lattice structure lead to collisions between electrons and the lattice, which impede electron movement and contribute to the resistance of these materials.
  BCS theory (Bardeen, Cooper and Schrieffer) describes the occurrence of electron pairs and phonons in superconductors below their critical temperature, allowing the movement of electrons without collisions or resistance.
  Below the critical temperature, lattice vibrations in a superconductor become negligible, so the predominant interaction between electrons and the lattice structure is electrostatic attraction.
  An electron moving through the lattice will attract positive ions towards itself to create a 'trough' of concentrated positive charge density, which attracts a 2nd trailing electron, creating a Cooper pair with the 1st electron.
  The distortion of the crystal lattice by the leading electron creates/emits a packet of vibrational energy (a phonon) which is absorbed by the trailing electron (phonons hold electrons together).
  This transfer of energy allows the electrostatic repulsion existing between negative electrons to be overcome in the formation of Cooper pairs.
  Cooper pairs are continually formed, broken and reformed between different electrons, allowing them to move through the lattice coherently, without collision and thus, without resistance.

But this is the simplified explanation, right? Could you please give me the proper explanation or just give me a link where I can read a good explanation? I did a Google search and most of the explanations aren't satisfactory. My teacher said a proper explanation would have to involve Bose Einstein condensates and quantum physics but I can't find any explanations on the internet that mention this.


text:
Q: http2 request not working in cloudfront connected by route53 on aws i provide some service with aws.
in my case
S3 react bundle file => cloudfront => route 53
http2 request success in cloudfront
for example, when i access to cloudfront Domain Name, i can receive all chunk file and css file with http2. like below picture

but, when i access to Alternate Domain Names (CNAMEs) in cloud front
all request converted to http1.1

My route 53 option like that
RecordType : A - Routes traffic to an IPv4 address and some AWS resources
Routing Policy : Simple routing
i dont know what is problem.
thankyou!

A: ... this problem was our company..
our company pass http2 request using whitelist.
sorry for confuse.


text:
Q: How to import a code block on sass with @use and @forward? I am starting to use sass and am having trouble importing a code block located in multiple files.
I can't use "@import", instead the documentation says to use "@use" or "@forward";but it doesn't work with my grid.
_links.scss *(it works)
/* unvisited link */
a {
  color: red;
  text-decoration: none;
}

/* visited link */
a:visited {
  color: red;
}

/* mouse over link */
a:hover {
  color: red;
}

/* selected link */
a:active {
  color: red;
}

_grid.scss *(this does not work)
.grid {
  max-width: 1920px;
  margin: 0 auto;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, auto);
  grid-template-areas:
    "h h h"
    "c c c"
    "f f f";
  header {
    grid-area: h;
  }
  main {
    grid-area: c;
  }
  footer {
    grid-area: f;
  }
}

main.scss *main
@use "./base/links"; // it works!.
@use "./base/grid"; // it does not work
@forward "./base/grid"; // it does not work

why does it matter grid block?

A: It should work.
Check if your header / main / footer are inside of an element with the class name grid.
@use should work the same as import in your case.
How is your DOM structured?


text:
Q: Access 2016 DoCmd.RunSQL & CurrentDb.Execute are not working for update queries I have a SQLQuery string that I pass to DoCmd.RunSQL or CurrentDb.Execute and both commands return no warnings and don't do anything...
UPDATE [tblEngrDetails] SET [Colour] = 'Tangerine' WHERE [Reference Number] = '2018-202' AND ([Colour] IS NULL OR [Colour] <> 'Tangerine');
UPDATE [tblEngrDetails] SET [Colour] = 'Tangerine' WHERE [Reference Number] = '2019-525' AND ([Colour] IS NULL OR [Colour] <> 'Tangerine');
UPDATE [tblEngrDetails] SET [Colour] = 'Tangerine' WHERE [Reference Number] = '2019-103' AND ([Colour] IS NULL OR [Colour] <> 'Tangerine');
UPDATE [tblEngrDetails] SET [Colour] = 'Tangerine' WHERE [Reference Number] = '2018-605' AND ([Colour] IS NULL OR [Colour] <> 'Tangerine');
UPDATE [tblEngrDetails] SET [Colour] = 'Tangerine' WHERE [Reference Number] = '2018-520' AND ([Colour] IS NULL OR [Colour] <> 'Tangerine');
UPDATE [tblEngrDetails] SET [Colour] = 'Tangerine' WHERE [Reference Number] = '2018-512' AND ([Colour] IS NULL OR [Colour] <> 'Tangerine');
UPDATE [tblEngrDetails] SET [Colour] = 'Tangerine' WHERE [Reference Number] = '2018-402' AND ([Colour] IS NULL OR [Colour] <> 'Tangerine');
UPDATE [tblEngrDetails] SET [Colour] = 'Tangerine' WHERE [Reference Number] = '2018-203' AND ([Colour] IS NULL OR [Colour] <> 'Tangerine');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2017-609' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2016-616' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2016-528' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2016-524' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2016-405' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2015-206' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2015-204' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2013-530' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2013-509' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2013-208' AND ([Colour] IS NULL OR [Colour] <> 'Orange');
UPDATE [tblEngrDetails] SET [Colour] = 'Orange' WHERE [Reference Number] = '2012-604' AND ([Colour] IS NULL OR [Colour] <> 'Orange');

The query works fine when ran in SQL Server Studio, so I don't know what's wrong.

A: Are you passing it as a single string to be executed all at once? That will not work. You have to execute each UPDATE query separately.
Also (this is not the case here, but FYI) MS SQL Server SQL is not the same as MS Access SQL. Just because code works on one it does not mean it will work on the other.


text:
Q: How to Get web data based on link in excel cell? I'd like to create an Excel sheet, where in one column there is a link to a website
like this:

Link in column A where there is a MAC add in that url that changes from line to line rest of link is geraric. and it takes the info in the 2 lines marked with arrows and put into another cell.
This should be possible for multiple links in different rows from websites with the same structure.
How can I make the web query to be based on the link in the adjacent cell?

A: You can use Power Query to read the contents of a cell.
Then in Power Query, you can return the web contents of the URL like this:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Get Web Contents" = Xml.Tables(Web.Contents(Table.FirstValue(Source))),

in
    #"Get Web Contents"

You will need to be mindful of the data your query returns, i.e. is it a single value, table, or otherwise?
Here is documentation on how to to load the results from Power Query back to your excel worksheet: https://support.microsoft.com/en-us/office/create-load-or-edit-a-query-in-excel-power-query-ca69e0f0-3db1-4493-900c-6279bef08df4

A: I sort of found out. just made a simple WEBSERVICE(A2) to the URL and it returns a string with all the data, now i just need to extract only the data i need.


text:
Q: Transitioning from Main layout via button seems to break Radio Buttons in second Layout Full discloser
 I have changed the title of the question to reflect the real issue at hand
It appears I am dumb somehow... so what I am doing wrong is related to how I transition between screens. When I made the code already shown to be the Main activity, everything seemed to run fine. So it has something to do with this.
        buttonArea.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v){
            v.setVisibility(View.GONE);
            setContentView(R.layout.activity_area);

        }
    });

OLD QUESTION INFORMATION about why radio buttons were not working in general.
I have done some Android in the past and I have NO idea why what I am doing isn't working. This should be criminally simple...but for some reason its not working.
I should say there are no errors showing so everything is imported. I am using Android Studio.
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_area);

    final RadioButton rb1 =(RadioButton)findViewById(R.id.radFeet);
    final RadioButton rb2 =(RadioButton)findViewById(R.id.radMeters);
    final EditText txt = (EditText)findViewById(R.id.txtAreaIn);
    final RadioGroup rg = (RadioGroup)findViewById(R.id.radGroupArea);

    rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup radioGroup, int i) {
            double distance= Double.parseDouble(txt.getText().toString());
            if(rb1.isChecked()){
                txt.setText(String.valueOf(distance/con));
            }
            else if(rb2.isChecked()){
                txt.setText(String.valueOf(distance*con));
            }
        }

    });

}

Here is the XML of the activity
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="edu.gatech.seclass.converter.Area"
android:id="@+id/actArea">

<TextView android:text="@string/title_activity_area" android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/lblArea"
    android:textSize="45dp"
    android:layout_alignParentEnd="true"
    android:layout_alignParentStart="true" />

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="numberDecimal"
    android:ems="10"
    android:id="@+id/txtAreaIn"
    android:layout_below="@+id/lblArea"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="72dp" />

<RadioGroup
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignEnd="@+id/lblArea"
    android:layout_below="@+id/txtAreaIn"
    android:minHeight="55dp"
    android:minWidth="55dp"
    android:id="@+id/radGroupArea">

    <RadioButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Conv_to_feet"
        android:id="@+id/radFeet"
        android:checked="false"
        android:layout_below="@+id/txtAreaIn"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="60dp"
        />

    <RadioButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Conv_to_meters"
        android:id="@+id/radMeters"
        android:layout_below="@+id/radFeet"
        android:layout_centerHorizontal="true"
        android:checked="false"
        />
</RadioGroup>

Yet when I click either of the Radio buttons... nothing ever happens. Am I missing something simple here?

A: It is possibly the android:checked="false" that is causing the problem. Can you try remove it and see how it goes?

A: So I found out that instead of switching Activities the way I was, I need to do it like this.
startActivity(new Intent(MainActivity.this, Area.class));

Although slow, it does the job for this simple thing. still would be curious as to why the previous code will navigate to the correct layout but do nothing......Actually now that I think about it its probably because the class didn't change.


text:
Q: Ubuntu Terminal - gcc: error: unrecognized command line option '--showme:link' I am not trying to install anything. But the error message
gcc: error: unrecognized command line option '--showme:link'

pops up as the first line in my terminal whenever I launch it.
The problem existed in 14.04 and still exists after upgrading to 16.04.
Any idea why this happens and possible solutions?
The output of cat ~/.bashrc reads
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi
source /opt/openfoam30/etc/bashrc

The output of cat /opt/openfoam30/etc/bashrc is
#----------------------------------*-sh-*--------------------------------------
# =========                 |
# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
#  \\    /   O peration     |
#   \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
#    \\/     M anipulation  |
#------------------------------------------------------------------------------
# License
#     This file is part of OpenFOAM.
#
#     OpenFOAM is free software: you can redistribute it and/or modify it
#     under the terms of the GNU General Public License as published by
#     the Free Software Foundation, either version 3 of the License, or
#     (at your option) any later version.
#
#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
#     for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
#
# File
#     etc/bashrc
#
# Description
#     Startup file for OpenFOAM
#     Sourced from ~/.profile or ~/.bashrc
#     Should be usable by any POSIX-compliant shell (eg, ksh)
#
#------------------------------------------------------------------------------

export WM_PROJECT=OpenFOAM
export WM_PROJECT_VERSION=3.0.1

################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
#
# either set $FOAM_INST_DIR before sourcing this file or set
# 'foamInstall' below to where OpenFOAM is installed
#
# Location of the OpenFOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamInstall=/opt
# foamInstall=~$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
#
# END OF (NORMAL) USER EDITABLE PART
################################################################################

#
# These are the defaults for this version which should generally be
# overridden from the prefs.sh file or from command-line specification
#
#- note the location for later use (eg, in job scripts)
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR

#- Compiler location:
#    foamCompiler= system | ThirdParty (OpenFOAM)
foamCompiler=system

#- Compiler:
#    WM_COMPILER = Gcc | Gcc45 | Gcc46 | Gcc47 | Gcc48 | Gcc49| Clang | Icc
export WM_COMPILER=Gcc
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH

#- Memory addressing:
#    On a 64bit OS this can be 32bit or 64bit
#    On a 32bit OS addressing is 32bit and this option is not used
#    WM_ARCH_OPTION = 32 | 64
export WM_ARCH_OPTION=64

#- Precision:
#    WM_PRECISION_OPTION = DP | SP
export WM_PRECISION_OPTION=DP

#- Label size:
#    WM_LABEL_SIZE = 32 | 64
export WM_LABEL_SIZE=32

#- Optimised, debug, profiling:
#    WM_COMPILE_OPTION = Opt | Debug | Prof
export WM_COMPILE_OPTION=Opt

#- MPI implementation:
#    WM_MPLIB = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPICH | MPICH-GM | HPMPI
#               | MPI | QSMPI | SGIMPI
export WM_MPLIB=SYSTEMOPENMPI

#- Operating System:
#    WM_OSTYPE = POSIX | ???
export WM_OSTYPE=POSIX

#- Floating-point signal handling:
#    set or unset
export FOAM_SIGFPE=

#- memory initialisation:
#    set or unset
#export FOAM_SETNAN=

################################################################################

# The old dirs to be cleaned from the various environment variables
# - remove anything under top-level directory.
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
foamOldDirs="$FOAM_INST_DIR $WM_PROJECT_SITE $HOME/$WM_PROJECT/$USER"
if [ "$WM_PROJECT_INST_DIR" != "$FOAM_INST_DIR" ]
then
    foamOldDirs="$WM_PROJECT_INST_DIR $foamOldDirs"
fi

# Location of installation
# ~~~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_INST_DIR=$FOAM_INST_DIR
export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/openfoam30

# Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION

# Location of site-specific templates etc
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# unset is equivalent to $WM_PROJECT_INST_DIR/site
if [ -d "$WM_PROJECT_SITE" ]
then
    export WM_PROJECT_SITE
else
    unset WM_PROJECT_SITE
fi

# Location of user files
# ~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION

# Source files, possibly with some verbosity
_foamSource()
{
    while [ $# -ge 1 ]
    do
        [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "Sourcing: $1" 1>&2
        . $1
       shift
    done
}

# Evaluate command-line parameters
_foamEval()
{
    while [ $# -gt 0 ]
    do
        case "$1" in
        -*)
            # stray option (not meant for us here) -> get out
            break
            ;;
        *=)
            # name=       -> unset name
            [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "unset ${1%=}" 1>&2
            eval "unset ${1%=}"
            ;;
        *=*)
            # name=value  -> export name=value
            [ "$FOAM_VERBOSE" -a "$PS1" ] && echo "export $1" 1>&2
            eval "export $1"
            ;;
        *)
            # filename: source it
            if [ -f "$1" ]
            then
                _foamSource "$1"
            else
                _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile -silent "$1"`
            fi
            ;;
        esac
        shift
    done
}

# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`

# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify alternative pref files
export FOAM_SETTINGS="$@"
_foamEval $@

# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath

#- Clean PATH
cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"

#- Clean LD_LIBRARY_PATH
cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"` \
    && LD_LIBRARY_PATH="$cleaned"

#- Clean MANPATH
cleaned=`$foamClean "$MANPATH" "$foamOldDirs"` && MANPATH="$cleaned"

export PATH LD_LIBRARY_PATH MANPATH

# Source project setup files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource $WM_PROJECT_DIR/etc/config/settings.sh
_foamSource $WM_PROJECT_DIR/etc/config/aliases.sh

# Source user setup files for optional packages
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/gperftools.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/CGAL.sh`

# Clean environment paths again. Only remove duplicates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#- Clean PATH
cleaned=`$foamClean "$PATH"` && PATH="$cleaned"

#- Clean LD_LIBRARY_PATH
cleaned=`$foamClean "$LD_LIBRARY_PATH"` && LD_LIBRARY_PATH="$cleaned"

#- Clean MANPATH (trailing ':' to find system pages)
cleaned=`$foamClean "$MANPATH"`: && MANPATH="$cleaned"

export PATH LD_LIBRARY_PATH MANPATH

#- Clean LD_PRELOAD
if [ -n "$LD_PRELOAD" ]
then
    cleaned=`$foamClean "$LD_PRELOAD"` && LD_PRELOAD="$cleaned"
    export LD_PRELOAD
fi

# cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset cleaned foamClean foamInstall foamOldDirs
unset _foamSource _foamEval

# ----------------------------------------------------------------- end-of-file

A: Your ~/.bashrc has the following line at the end:
source /opt/openfoam30/etc/bashrc

i.e. bash will source /opt/openfoam30/etc/bashrc while starting an interactive session.
And in that file you have the potential problem as other portions seem fairly normal. But the interesting thing is that file does not directly call gcc but it sources so many other files, it really hard to get to the specific file/line that is causing this issue.
Instead, as an trial and error method (and also being confident that this should be the problematic one), you can comment out the line from ~/.bashrc:
# source /opt/openfoam30/etc/bashrc

And as per your comment, it worked !! The error message is gone.

For future, the first step to debug these sort of bash session starting related issue, check if the relevant files have anything:
For Login Interactive session of bash:
grep -Hn 'gcc' ~/.bashrc /etc/bash.bashrc ~/.profile /etc/profile

For Non-login Interactive session of bash:
grep -Hn 'gcc' ~/.bashrc /etc/bash.bashrc

If not, read the relevant files, you should get a hint to debug further.


text:
Q: Cannot fetch data from mongo db react native I am brand new to React Native and have just figured out setting up a local server and db for my native app. I am using express and mongodb. I have my server and mongo running on my backend and am trying to make an axios call to get the data from my database but the array is coming back empty and the response from the data is undefined. I have tested the endpoints on postman and the endpoints are fine. Here is an example of my api axios request and the component I am trying to get the data back in.
Thank you in advanced for your help! Also if you would like to see any other code let me know and I will post it.
// api.js

import axios from "axios";

    export const getAllTweets = async () => {
      await axios
        .get("http://(my ip address):(port number)/api/tweet")
        .then(response => {
          console.log("response: ", response);
          return response.data;
        })
        .catch(error => {
          console.log("There are no tweets to get!", error);
        });
    };

//HomeScreen.js

import React from 'react';
import {
  Image,
  Platform,
  ScrollView,
  StyleSheet,
  Text,
  TouchableOpacity,
  View,
} from 'react-native';
import { WebBrowser } from 'expo';

import { getAllTweets } from '../constants/api';

import { MonoText } from '../components/StyledText';

export default class HomeScreen extends React.Component {
  static navigationOptions = {
    header: null,
  };
  static defaultProps = {
    getAllTweets
  };
  state = {
    tweets: [],
    isLoading: false
  }

  async componentDidMount() {
    this.setState({ isLoading: true });
    let data = await this.props.getAllTweets();
    console.log('data: ', data);
    try {
      this.setState({ isLoading: false, tweets: data });
    } catch (error) {
      console.log(error, "Cannot get tweets in cdm");
    }
  }

  render() {
    console.log("this.state.tweets", this.state.tweets); <--- this is empty
    return (
      <View style={styles.container}>

      </View>
    );
  }

  _maybeRenderDevelopmentModeWarning() {
    if (__DEV__) {
      const learnMoreButton = (
        <Text onPress={this._handleLearnMorePress} style={styles.helpLinkText}>
          Learn more
        </Text>
      );

      return (
        <Text style={styles.developmentModeText}>
          Development mode is enabled, your app will be slower but you can use useful development
          tools. {learnMoreButton}
        </Text>
      );
    } else {
      return (
        <Text style={styles.developmentModeText}>
          You are not in development mode, your app will run at full speed.
        </Text>
      );
    }
  }

A: I found my answer. The request was not coming through with the standard ip address. By going into system preferences => network => TCP/IP (tab) and using the IPv4 ip address it corrected the issue. It also works by providing it the ip address of the virtual router 10.0.2.2 that the emulator runs on.


text:
Q: How to execute U-SQL Stored Procedure In ADLA from Azure Data Factory V2 How can I execute a U-SQL stored procedure in ADLA  from Azure Data Factory?
As of now, I could see that U-SQL activity looks for U-SQL script and it's location.
Likewise 'Stored Procedure' activity wherein any RDBMS stored procedures can be executed, I just need to invoke U-SQL stored procedure, without any wrapper scripts.
Am I missing anything here ?

A: U-SQL Stored Procedures can only be executed from a U-SQL script, so you would still need to wrap the call in a U-SQL script and reference the wrapper script in your ADF activity.


text:
Q: Getting error @wdio/cli:launcher with missing capabilities in Visual Studio Code WebdriverIO When I am running debugger in Visual Studio Code, I get the following:
ERROR @wdio/cli:launcher missing capabilities, exiting with failure


text:
Q: Why the pom for jsf-impl does not contain a dependency to jsf-api I'm new to maven and there are something with dependencies that I'm not able to understand.
JSF implementation depends on JSF API, even though in the POM for the jsf impelmentation (ie: https://maven.java.net/index.html#nexus-search;quick~jsf-impl) I can't find any dependencies to the JSF api.
What am I missing here ?
Thank you.


text:
Q: problem with "sudo dpkg --configure -a" Some Info:

*

*Spanish Languange

*Kubuntu 17.04

*KDE Plasma: 5.9.4

*Kernel version:4.10.0.19-generic

*OS: 64 Bits

*Hardware: Intel Core i7-4700HQ --- CPU 2.40 Ghz

Problem:
I try to update with sudo apt-get update and everything is fine, but when i try to upgrade I get the following problem:
$ sudo apt-get upgrade
E: No se pudo bloquear /var/lib/dpkg/lock - open (11: Recurso no disponible temporalmente)
E: No se pudo bloquear el directorio de administración (/var/lib/dpkg/), ¿quizás haya algún otro proceso utilizándolo?

I tried sudo apt-get install -f which is prescribed for other similar problems on the web. I also tried sudo apt-get dist-upgrade. Searching my error messages led me to this link.
I started following the steps there, but sudo dpkg --configure -a hangs:
$ sudo  dpkg --purge --force-remove-reinstreq dpkg-dev
dpkg: error: base de datos de estado de dpkg está bloqueada por otro proceso
$ sudo apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Obj:2 http://dl.google.com/linux/chrome/deb stable Release
Obj:3 http://repository.spotify.com stable InRelease
Obj:5 https://repo.skype.com/deb stable InRelease
Des:6 http://security.ubuntu.com/ubuntu zesty-security InRelease [89,2 kB]
Obj:7 http://de.archive.ubuntu.com/ubuntu zesty InRelease
Obj:8 http://de.archive.ubuntu.com/ubuntu zesty-updates InRelease
Obj:9 http://de.archive.ubuntu.com/ubuntu zesty-backports InRelease
Obj:10 http://archive.canonical.com/ubuntu zesty InRelease
Descargados 89,2 kB en 18s (4.827 B/s)
Leyendo lista de paquetes... Hecho
xoktz@xoktz-ntb:~$ sudo apt-get upgrade
E: No se pudo bloquear /var/lib/dpkg/lock - open (11: Recurso no disponible temporalmente)
E: No se pudo bloquear el directorio de administración (/var/lib/dpkg/), ¿quizás haya algún otro proceso utilizándolo?
xoktz@xoktz-ntb:~$ sudo apt-get install -f
E: No se pudo bloquear /var/lib/dpkg/lock - open (11: Recurso no disponible temporalmente)
E: No se pudo bloquear el directorio de administración (/var/lib/dpkg/), ¿quizás haya algún otro proceso utilizándolo?
xoktz@xoktz-ntb:~$ sudo apt-get dist-upgrade
E: No se pudo bloquear /var/lib/dpkg/lock - open (11: Recurso no disponible temporalmente)
E: No se pudo bloquear el directorio de administración (/var/lib/dpkg/), ¿quizás haya algún otro proceso utilizándolo?
xoktz@xoktz-ntb:~$ sudo fuser -vki  /var/lib/dpkg/lock
                     USUARIO        ORDEN DE ACCESO PID
/var/lib/dpkg/lock:  root       3375 F.... dpkg
¿Finalizar el proceso 3375 ? (y/N) y
xoktz@xoktz-ntb:~$ sudo rm -f /var/lib/dpkg/lock
xoktz@xoktz-ntb:~$ sudo apt-get install -f
E: se interrumpió la ejecución de dpkg, debe ejecutar manualmente «sudo dpkg --configure -a» para corregir el problema
xoktz@xoktz-ntb:~$ sudo dpkg --configure -a
Configurando linux-headers-4.10.0-20-generic (4.10.0-20.22) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
^CFailed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-4.10.0-20-generic.postinst line 110.
dpkg: error al procesar el paquete linux-headers-4.10.0-20-generic (--configure):
 el subproceso instalado el script post-installation devolvió el código de salida de error 2
Configurando iucode-tool (2.1.1-1) ...
Procesando disparadores para man-db (2.7.6.1-2) ...
Configurando linux-image-4.10.0-20-generic (4.10.0-20.22) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.10.0-20-generic
vmlinuz(/boot/vmlinuz-4.10.0-20-generic
) points to /boot/vmlinuz-4.10.0-20-generic
 (/boot/vmlinuz-4.10.0-20-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.10.0-20-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-20-generic /boot/vmlinuz-4.10.0-20-generic

The command ps axjf displays this.
How should I proceed to get sudo apt-get upgrade working?


text:
Q: Android 3.2 AVD graphical issues on Retina MacBook Pro running 10.8 I'm running OSX 10.8 on a recent Retina MBP. I installed the Android emulator, but I can't get my Android 3.2 emulator to work properly.
The emulator boots up and I can unlock it, but I can't get the apps to open. It starts pulling down the apps screen, but hangs before I can even see any of the icons. The emulator still functions, but the app screen is never actually shown. I can even click the status bar and get the date or pull it down to reveal the notifications.

I had similar graphical issues with my 4.3 emulator, and I was able to fix them by turning on the host GPU. If I try that on the 3.2 emulator, I never see anything on the display. The display is entirely white. When I tried to take a screenshot of it, the screenshot region selection box wiped away the white to reveal the lock screen. Here's a full-screen shot I took to show what it looks like before being wiped:

Here are my settings for the AVD:

My ultimate goal is to be able to test web sites on this platform, but it's proving quite a challenge. I don't have an Android device and don't really have a way to get my hands on one at the moment. The emulator seems like the perfect solution if it would only cooperate.