text:
Q: how can I create a list of objects to stream data? I need to create a list to save objects like [MyClass1,MyClass2], and then later loop and execute run to get all data from all objects, can I do this?
class MyClass1:
    def __init__(self, name):
        self.name = name

    def run(self):
     return 1

output
1
2

A: Assuming the 2 in the output is a typo (or from a hypothetical MyClass2) you can initialize a list of objects and run them inside of a list comprehension:
class MyClass1:
    def __init__(self, name):
        self.name = name

    def run(self):
        return 1

objects = [MyClass1("one"), MyClass1("two"), MyClass1("three")]

print([obj.run() for obj in objects])
# Result: [1, 1, 1]


text:
Q: Prevent download from users I have website, and all users can download any file in download page. Just users who have accounts in my website can download; visitor cannot see the download page until login or registering on my website.
I want now to do some changes; I want just download any file from a download  page for active users who have more than 10 topics, any user who is less 10 topics cannot download any files.
How can I do that?
Downloads
<?php
if(!$allcategories)
{
    echo 'There are no downloads available!';
    return;
}

foreach($allcategories as $category)
{
?>

<?php echo $category->name?>

<?php
    # This loops through every download available in the category
    $alldownloads = DownloadData::GetDownloads($category->id);

    if(!$alldownloads)
    {
        echo 'There are no downloads under this category';
        $alldownloads = array();
    }

    foreach($alldownloads as $download)
    {
?>

        <a href="<?php echo url('/downloads/dl/'.$download->id);?>">
            <?php echo $download->name?>

          <?php echo $download->description?>

          Downloaded <?php echo $download->hits?> times

<?php
    }
?>

    <?php
}
?>

That is my download code .

A: This is a broad question with no information with the framework or db you are using.
I'll assume you are using MySQL.
I'll also assume you have a table called users with id | name | email | etc
I'll also assume you have another table called topics with:
id | userid | title | desc | etc
Ok, I'll also assume that when a user logs in to your site, you are setting a session called $_SESSION["userid"];
Now on the download page, run a query at the beginning (make sure you are connected to db before the following):
$userid = $_SESSION["userid"];
$result = mysql_query("SELECT count(*) from `topics` where `userid` = '$userid') or die(mysql_error());
$topicCount = mysql_result($result,0);
if($topicCount < 10){
echo "You have $topicCount topics so far. You need a minimum of 10 to get access to downloads.";
}

You can change that message to anything you want so the users know why they don't have access to downloads.
Good Luck

redpajama_set_name: RedPajamaStackExchange


text:
Q: Write a typesafe 'pick' function in typescript lodash has the pick function which is used as follows:
var object = { 'a': 1, 'b': '2', 'c': 3 };

_.pick(object, ['a', 'c']);
// => { 'a': 1, 'c': 3 }

I would like to write a type-safe version of this in typescript.
Usage of this function should be
pick(object, o => o.a, o.b)

The goal is not to specify the same keys twice, and at the same time conserve type safety.
Is this possible to achieve?

A: Sounds like you might be looking for the Pick type. Would something like this work for you?
function pick<T, K extends keyof T>(obj: T, ...keys: K[]): Pick<T, K> {
  const ret: any = {};
  keys.forEach(key => {
    ret[key] = obj[key];
  })
  return ret;
}

const o = {a: 1, b: '2', c: 3}
const picked = pick(o, 'b', 'c');

picked.a; // not allowed
picked.b  // string
picked.c  // number

A: With Object.fromEntries (es2019):
function pick<T extends object, K extends keyof T> (base: T, ...keys: K[]): Pick<T, K> {
  const entries = keys.map(key => ([key, base[key]]));
  return Object.fromEntries(entries);
}

A: here's mine, using Object.assign()
function pick<T, K extends keyof T>(object: T, keys: K[]): Pick<T, K> {
  return Object.assign(
    {},
    ...keys.map(key => {
      if (object && Object.prototype.hasOwnProperty.call(object, key)) {
        return { [key]: object[key] };
      }
    })
  );
};

A: The lodash type definitions use Pick to propagate the props, so you don't have to define it manually. Just install them with npm i --save-dev @types/lodash or yarn add -D @types/lodash.

A: Here mine, extending @Bayu Karnia answer:
function pick<T extends Record<string | number | symbol, T>, K extends keyof T>(
  object: T,
  keys: K[]
): Pick<T, K> {
  return Object.assign(
    {},
    ...keys.map((key: K) => {
      return { [key]: object[key] };
    })
  );
}


text:
Q: question on vector calculus notation I just have a question about the vector calculus notation:
$$(u \cdot \nabla)u$$ Is that the same as $( \nabla \cdot u)u$?

A: No, these are not the same. The vector $(u\cdot\nabla)u$ is the directional derivative of $u$ in the direction of $u$. It may not be (and probably isn't) parallel to $u$ at each point. The vector $(\nabla \cdot u)u$ is $u$ multiplied by its divergence. It is always parallel to $u$ at each point.


text:
Q: Not getting exact Text box Bounds using PSD.rb gem I'm trying to parse the PSD file using PSD.rb gem.
When I'm trying to get the text box bounds, it is giving minimal bounding box for the text, not the actual text rectangle dimensions in the psd file.
Similar issue was posted here: https://github.com/layervault/psd.rb/issues/78
But, there is no proper solution for it. So, can anybody help me in finding the exact text box Bounds from PSD?
Thanks in advance!

A: Getting Height & Width information from the bounds object:
bounds = layer.adjustments[:type].data[:text]["bounds"]
layer_tree = layer.to_hash
transform = layer_tree[:text][:transform]

top = transform[:ty] + bounds["Top "][:value]
left = transform[:tx]
width = bounds["Rght"][:value]
height = bounds["Btom"][:value] - bounds["Top "][:value]

Thanks.


text:
Q: AVR Microcontrollers memory game I am making a game where you need to repeat the sequence of LEDs that light up. This sequence is set by two LEDs. To repeat the sequence, I use the joystick.
I had an idea to make two bool arrays where True will indicate the left LED, and False will indicate the right LED. The first array must contain a random sequence(True/False) that needs to be repeated. When I push to one or the other side of the joystick, I want to write to the second array, respectively, True / False and all this time compare them.
This is what I have at the moment. (AT90USB647)
#define F_CPU 2000000UL
#include <avr/io.h>
#include <stdbool.h>

int main(void) {
    MCUCR |= 0x80;
    MCUCR |= 0x80;
    DDRA = 0xFF;
    PORTF = 0x20;

    bool seq2[100];

    while(1)
    {
        uint8_t x = PINF;
        if(!(x & 0x20)) {
            PORTA = 0x80;
        }
        else if(!(x & 0x08)) {
            PORTA = 0x01;
        }
        else {
            PORTA = 0x00;
        }
    }
}

The main question is how do I write True or False to an array when I push the joystick?

A: A basic approach could be:

#define F_CPU 2000000UL

#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>

volatile unsigned int counter;

static unsigned char pattern_position;
static unsigned char array_position;

static unsigned char pattern[] = {
    0b01010101,
    0b11010101,
    0b10010101
};

ISR(TIMER0_COMPA_vect)
{
    counter++;
}

int main(void)
{
    MCUCR |= 0x80;

    DDRA = 0xFF;
    PORTF = 0x20;

    // Timer initialization
    // Mode: CTC
    // Prescaler: 1024
    TCCR0A = (1<<WGM01);
    TCCR0B = (1<<CS02) | (1<<CS00);

    // Calculate a correct time
    //
    // we want 1 ms -> f_TIMER0 = 1/T = 1/(1 * 10^-3)s = 1 kHz
    //
    //                f_CPU                  f_CPU                20 MHz
    // f_TIMER0 = ------------- -> OCR0A = ---------------- = ------------- = ~ 20 (It is not exactly 1ms but it is ok)
    //             k_H * OCR0A              k_H * f_TIMER0     256 * 1 kHz
    //
    OCR0A = 20;
    TIMSK0 = (1<<OCF0A);  // Enable Timer0 Overflow Compare Match interrupt

    // Show the sequence that the user should input
    for (unsigned char i=0; i < sizeof(pattern)/sizeof(&pattern[0]); i++)
    {
        for (unsigned char j=0; j < 8; j +=2)
        {
            // There is possible a signal missing to show the user that the next pattern occurs!

            PORTA = ((pattern[i]>>(j+1))<<PINA7) | ((pattern[i]>>j)<<PINA0);
            // That the user can see the patterns a delay is necessary!
            _delay_ms(1000);
        }
    }

    // Signalize that the game starts
    for (unsigned char i=0; i <8; i++)
    {
        PORTA ^= 0x81;
        _delay_ms(1000);
    }

    TCNT0 = 0x00;
    sei();

    while(1)
    {
        // There is possible a signal missing to trigger next pattern input to the user!!!

        if(!(PINF & (1<<PINF5)))
        {
            PORTA |= 0x80;
        }

        if(!(PINF & (1<<PINF3)))
        {
            PORTA |= 0x01;
        }

        // Time is 4 seconds to match the correct pattern
        if(counter >= 4000)
        {
            if(!((pattern[pattern_position] & (1<<array_position)) == (0x01 & PORTA)))
            {
                // Wrong input end of game
            }
            array_position++;

            if(!((pattern[pattern_position] & (1<<array_position)) == (0x01 & (PORTA>>8))))
            {
                // Wrong input end of game
            }
            array_position++;

            if(array_position >= 8)
            {
                array_position = 0;
                pattern_position++;
            }

            if(pattern_position >= (sizeof(pattern)/sizeof(&pattern[0])))
            {
                // End of game reached winning!
            }

            counter = 0x00;
            PORTA = 0x00;
            TCNT0 = 0x00;
        }
    }
}

I´m not sure if you are exactly trying this to do and i also can not test the code on your target platform but maybe this is a rudimental approach to solve your problem...


text:
Q: rkhunter sends no email rkhunter sends no email
I installed rkhunter on a Ubuntu 12.04.3 server
sudo apt-get install rkhunter

it installed the 1.3.8 version of rkhunter
sudo apt-show-versions rkhunter
rkhunter/precise uptodate 1.3.8-10

rkhunter gives back some messages
sudo rkhunter -c --rwo

but I do not get any daily email

A: 1- check cron.daily did run

less /var/log/syslog

it did run in my case
2- run the main command contained in the cron routine

sudo less /etc/cron.daily/rkhunter
sudo /usr/bin/nice -n 0 /usr/bin/rkhunter --cronjob --report-warnings-only --appendlog > rkhunter20131127

if it does not work, add echos to /etc/cron.daily/rkhunter to display the parameters

sudo vim /etc/cron.daily/rkhunter
echo "cron_daily_run".$CRON_DAILY_RUN;

I found out the value for CRON_DAILY_RUN was empty
3- therefore

sudo vim /etc/default/rkhunter

changed

CRON_DAILY_RUN=""
CRON_DB_UPDATE=""

to

CRON_DAILY_RUN="true"
CRON_DB_UPDATE="true"


text:
Q: mongodb using mongoose: E11000 duplicate key error on .save with nested collection I'm trying to create a Project entry, it has a languages array which I want to describe as
languages can (will) be initially empty [], and each object within it must have a field called key which must be unique.
e.g:
{
  languages: [],
  ....
}

or:
{
  languages: [ { key: 'en-US } ],
  ...
}

The mongoose Schema looks like:
{
  languages: [{
    key: {
      type: String,
      unique: true,
    },
  }],
  ...
}

The first creation works:
const project = new Project({
  name,
  owner: user,
});

await project.save();

However thereafter I get this error about already having a language with key: null, even though the languages array is empty...
{ MongoError: E11000 duplicate key error collection: yebu.projects index: tags.name_1 dup key: { : null }
    at Function.MongoError.create (<redacted>/node_modules/mongodb-core/lib/error.js:31:11)
...

I tried sparse: true in the key field but to no avail.

A: As this answer mentions: Mongodb unique sparse index
The answer was to combine unique: true with sparse: true. I wasn't noticing that it was working as my next collection in the schema was failing until I added it there too.

A: Try this - combine unique: true, sparse: true with default: null
{
  languages: [{
    key: {
      type: String,
      default: null
      unique: true,
    },
  }],
  ...
}


text:
Q: Strange errors While validation and uploading iOS application I am trying to upload an application to the App Store.
During validation, it shows the following error:

iTunes Store operation failed.

During uploading, it shows:

Web service content-type is not application/json
  Could not connect to Apple's web service.

A: It might be your network connection issue, also try uploading via Application Loader.


text:
Q: Optimizing and caching frequently accessed but rarely updated Tables My app has some tables that will be rarely updated, probably just once in the beginning and at the system setup. Despite that, they will be frequently accessed. Almost every operation depends on querying them, but as I said they will not be changed.
I'm looking for advices for optimizing this web app.
I have defined indexes on most frequently searched columns. What else can I do? How should I cache this tables?
It's written in ASP.NET MVC and Entity Framework.

A: Disclaimer: I am more familiar with standard LAMP  stack or equivalent frameworks.
If you have exhausted all the optimizations you can do at the db level (including  enabling query caches etc..), you could cache the results using memcache or equivalent in the windows world.
As you have infrequent updates, it seems like a good candidate to use a cluster of memcache servers (to distribute the load) - it is a simple key-value store and memcached servers listen on tcp (or udp) sockets, and it is very easy to setup, debug etc..:
http://memcached.org/


text:
Q: Rounding to nearest multiple of pixel resolution using ArcPy ArcPy can return the pixel resolution:
arcpy.GetRasterProperties_management(rasterfile, "CELLSIZEX", "").getOutput(0))

Let's say this returns "3.2808"
I wish to be able to take a given input, say "10" for example, and return the nearest multiple of the pixel resolution
n = 3.2808
MagicRoundingFunction(n, 10)
>>> 9.8424

Is there a built in function to accomplish this or must a custom function be developed?
If one exists, I would rather save time using something built in.

A: I haven't seen any function that accomplish that implemented within arcpy. However, it is a rather simple function and it could look something like:
import math

def magic_rounding_function(res, n):
    """
    :param res: pixel resolution
    :param n:   arbitrary number
    :return:    nearest multiple of the pixel resolution to n
    """
    return math.floor(n / res) * res

You can omit the import math statement and just do a floor division (i.e. n // res) as well.
Calling the function with your values:
res = 3.2808
n = 10
magic_rounding_function(res, n)  # 9.842400000000001


text:
Q: How a tail a file that is given as the output of a find function? I'm brand new in Unix environment.
I would like to monitor the output of a calculation on a cluster with a function.
I have tried this function I have put inside my .bashrc file under the alias section:
function tj(){
    tail -100f $(find . -type f -name "*.o$1")
}

and then
tj 1234

to see what is in file dm.o1234 but I'm not getting anything I want, actually nothing (only >).
Have you any ideas where the mistake(s) is (are)?

A: It don't know what is the exact source of your problem, but your code is in unspecified territory here.

*

*function tj() is not standard function definition syntax, it's neither Bourne/POSIX syntax (which uses tj()) not Korn syntax (which uses function tj without ()). Some shells (bash, zsh, pdksh) do support it mostly by accident.

*tail -100f is unspecified by POSIX. The POSIX syntax is tail -f -n 100

*POSIX tail takes at most one argument, the behaviour is unspecified if you pass more than one argument. Some implementations like GNU tail are able to watch more than one file in parallel, but many others don't. You could try installing tail-like commands designed for that like multitail

*$(find...) invokes the split+glob operator, so with the default value of $IFS, that would not work properly if any of the file paths contain space, tab, newline or wildcard characters. If find returns no file, it would also end-up tailing stdin.

Here you could use zsh and define the command as
tj() multitail ./**/*.o$1(.)

It would report an error if there was no matching file (as opposed to tailing stdin). Also note that contrary to find, it gives you a sorted list of files and skips hidden files or files in hidden directories (add the D glob qualifier if you want them).

Now, if, as per your edit, you see > when you run tj, when > is the default secondary prompt ($PS2), it looks more likely that  you have an alias also defined for tj (that alias probably defined after the definition of the tj function or otherwise that would have caused an error in the definition of the tj function).
For instance, it's the kind of thing you'd see if you had run:
alias tj='for sure'

(an unterminated for loop), or any code that is not self contained and for which the shell would issue a secondary prompt for you to finish it.
You can undefine that alias with unalias tj (and remove its definition from your ~/.bashrc if it's there so it doesn't come back the next time you run bash).
Of course, there's also always the possibility that the only *.o1234 file found contains just >.


text:
Q: How are functions executed in a class This may be a simples question but i couldn't find the answer..
If i have a class and declare the value of a variable within a function being called from a while statement and then use that variable later in another function when does that variable get changed to the next value in the array?
ie.. I know that php  executes code form top to bottom, but is that true with classes and functions being called from with in another function. Does php wait to go to the next item in the while statement until all functions and sub functions have been called or does it call a function then move to the next item in the list??
class myClass{
     public $cust;

     function __construct(){
        $sql = mysql_query("SOME QUERY");
        while($row = mysql_fetch_array($sql)){
            myClass::sendEmail();
        }
     }

     function sendEmail(){
    $this->cust = new selectDatabase();
    $this->cust->table = "customer_main";
    $this->cust->where = " WHERE customerID = '".$customerID."' ";
    $this->cust->getItems();

    $this->cust->name = $name;
    $this->cust->email = $email;

            $sql = mysql_query("SELECT EmailTo, EmailFrom, EmailSubject, EmailBody
                                FROM system_email");
            $row = mysql_fetch_assc($sql);

            $to = myClass::dbReplace($row['EmailTo']);
            $From = myClass::dbReplace($row['EmailFrom']);
            $subject = myClass::dbReplace($row['EmailSubject']);
            $body = myClass::dbReplace($row['EmailBody']);

    $headers = "From: ".$from." \r\n";
    $headers .= "Content-type: text/html\r\n";
    $headers .= "Bcc: stoneops@cornell.edu\r\n";
    $headers .= "X-Mailer: PHP/" . phpversion();

    mail( $to, $subject, $body, $headers);

     }
private function dbReplace($thisStr){
    $x = substr_count($thisStr,"DB[");
    $z = 0;
        $holdArry = array();
        while($z < $x){
            $rplStr = genEmail::findSubStr($thisStr);
            $t = substr_count($thisStr, "DB[".$rplStr."]");
            $rplStr2 = split(':', $rplStr);
            $thisStr = str_replace("DB[".$rplStr."]", $this->{$rplStr2[0]}->{$rplStr2[1]}, $thisStr);
            $z = $z +$t;
        }
    return $thisStr;
}

private function findSubStr($str){
    $pos = strpos($str, 'DB['); // outputs ER@EXAMPLE.com
    $pt1 = substr($str, ($pos + 3) );
    $pos = strpos($pt1, ']');
    $pt2 = substr($pt1, -1 * strlen(substr($pt1, $pos)));
    $pt2 = str_replace($pt2, "", $pt1);
    return $pt2;
}
}

A: *

*Normally, it will execute from top to bottom, one-by-one through a sequence of code.

*If there are functions and methods, the PHP interpreter will mark them, but they won't be executed unless they are called from else where.

*A function or a method once is called, will be executed from top to the return statement. When it finishes returning or doing some jobs, the next item will be reached and executed.

A: Execution is done from in the order they are called, so it's a sequential order. It is synchronous, so yes, PHP will wait until a function and it's sub functions have returned before it moves to the next one. This is referred to as the call stack.
If that wasn't the case, you'd have a lot of race conditions on your hand, which would make programming near impossible.

A: Sequential execution. So it will execute each function/statement in order from top to bottom, waiting for each function/statement to finish before calling the next one, then it will hit the end of the loop and start again at the beginning.


text:
Q: Почему JS работает только на одной странице Всем хорошего дня!
Подскажите, кто в курсе...
Есть сайт на WordPress и туда вставил HTML контейнер и подключил внутри скрипт JS. Но беда в том, что этот скрипт работает только на одной странице (на той, где он был первый раз вписан), на других не работает. Так как сам не кодер в JS, подскажите плиз, может кто в курсе?
Пробовал менять переменные, но без результатов.
Ниже прилагаю код:
HTML:

Number of persons:

<select id="weather">
  <option value=""></option>
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  <option value="9">9</option>
  <option value="10">10</option>
</select>

JS:

var select = document.querySelector('select');
var para = document.querySelector('p');

select.addEventListener('change', setWeather);

function setWeather() {
  var choice = select.value;

  if (choice === '1') {
    para.textContent = 'Total: 190$';
  } else if (choice === '2') {
    para.textContent = 'Total: 120$';
  } else if (choice === '3') {
    para.textContent = 'Total: 90$';
  } else if (choice === '4') {
    para.textContent = 'Total: 85$';
  } else if (choice === '5') {
    para.textContent = 'Total: 85$';
  } else if (choice === '6') {
    para.textContent = 'Total: 82$';
  } else if (choice === '7') {
    para.textContent = 'Total: 76$';
  } else if (choice === '8') {
    para.textContent = 'Total: 74$';
  } else if (choice === '9') {
    para.textContent = 'Total: 72$';
  } else if (choice === '10') {
    para.textContent = 'Total: 66$';
  } else {
    para.textContent = '';
  }
}

A: Используйте правильное подключение JS и CSS файлов с помощью wp_enqueue_script()
Или подключите ваш скрипт в footer.php

A: Для начала нужно определить подключен скрипт или нет. Попробуйте где то в скрипте сделать console.log('Hello'), если в консоли Вы увидите Hello, но скрипт не работает, тогда нужно искать проблему в самом скрипте.
Возможно проблема из за слишком широкого диапазона выборки
var select = document.querySelector('select');
var para = document.querySelector('p');

Этот кусок кода слишком неконкретный. Он находит первый селект и первый параграф на странице и пытается что то с ними сделать, соответственно если на странице не один селект и параграф, то скрипт может работать не так, как было задумано.


text:
Q: How should i structure a multi component Java project using Maven and Intelij? my java se project/system consists of multiple components like below where there can be many shared libs and many applications/ running processes. Example the 3 components below make up 'System 1'.
System 1:
1. Common lib - for our shared code
2. App 1 - a app/process with it's own code referencing the common lib.
3. App 2 - a app/process with it's own code referencing the common lib.
My questions how do i setup Maven/Intelij to support this structure ... and is it a good structure to follow?
At present I have the groupId as 'com.MyCompany.System1' and the Mavan modules for the components with artifactIds as 'com-MyCompany-System1-common' etc.
Is this the correct way to go or how should i arrange Maven to support this structure?
Thanks in advance.

A: It sounds like a typical Maven multi-module setup should serve your needs. As for IntelliJ, just set it up in Maven and then import the maven pom into IntelliJ. It'll just work. You can just open the pom file as a project, and IntelliJ will set everything up for you correctly.
Advice:

*

*Even if it feels like more work up front, the more you can break up your project into cleanly-defined modules, the happier you'll be in the end.

*I wouldn't repeat the groupId in the artifactId. The artifactId should definitely be distinct, but not that distinct.

*Consider using Gradle instead if it's an option. It's the next logical step in build tools after Maven, and it'll vastly reduce your effort as the number of modules increases. Gradle/IntelliJ interaction is almost as good as Maven/IntelliJ. It's slightly more work, but the tradeoff is worth it.

Source: I have a mix of >100 Maven and Gradle modules spread across >30 source code repos which I've been building and working in with IntelliJ for 3 years.


text:
Q: socket.error: [Errno 10061] No connection could be made because the target machi ne actively refused it I have a server-client application where server is online at a random time but client needs to send broadcast messages periodically in order to register to server when it's online. So i want my application to ignore the above error and keep on what it's doing till it gets a specific control trigger from the server.
Example code:
import socket,sys
cs = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
cs.connect((HOST, CPORT))
cs.send("REGS " + hostname)
cs.close()

Any ideas ?

A: Socket raises socket.error exception: http://docs.python.org/library/socket.html
Now read up on how to use try-except for exception handling: http://docs.python.org/tutorial/errors.html


text:
Q: Does the covariant derivative commute with the contraction? Let $T_{ij}$ be a tensor on a Riemannian manifold. Is it true that
$$
\nabla_l g^{ij}T_{ij} = g^{ij} \nabla_l T_{ij}
$$
?
I guess that this is true if I show that
$$
\nabla_l g^{ij} = 0.
$$
I started  computing and I have:
$$
\nabla_l g^{ij} = \partial_l (g^{ij} ) + \Gamma^{i}_{lk} g^{kj} + \Gamma^j_{lk} g^{ki}
$$
but I don't know how to carry on the computation...
Any hint or suggestion will be very appreciated!

A: It is a requirement and is  equivalent to the  analog of the leibniz rule.
For instance, consider
\begin{equation}
d g(v,u) = \nabla g(u, v)+ g(\nabla u, v)+ g(u, \nabla v) \hspace{1cm}
\end{equation}
$g$  is a $(0,2)$-tensor   and $u,v$ are two vector fields.  In index notation this is gien by
\begin{equation}
{(g_{ij} v^i u^j)}_ {,\   k}= g_{ij, k}
v^i u^j +   g_{ij} v^i_{\   ,k} u^j +
 g_{ij,k}  v^i u^j_{\   ,k}
\end{equation}
The left hand side here is saying first contract and then differentiate, the right hand side is you first differentiate using the Leibniz rule for the product  and then contract.


text:
Q: Adding Activity to Android in Adobe Air Extension I'm receiving the following error when try to start an activity within the native code of my Android application for Adobe Air:

android.content.ActivityNotFoundException: Unable to find explicit
  activity class
  {air.InAppPurchases/com.industrycorp.AndroidInAppPurchaseLib.AsyncActivity};
  have you declared this activity in your AndroidManifest.xml?

I've been looking at many tutorials and guides and am unable to solve this problem.
My native AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.industrycorp.AndroidInAppPurchaseLib"
          android:versionCode="1"
          android:versionName="1.0">
    <uses-permission android:name="com.android.vending.BILLING" />
    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
        <activity android:name="ACTIVITY_ENTRY_NAME"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity android:name=".IAPView.IAPListActivity"/>
        <activity android:name=".AsyncActivity" android:label="async_activity"/>
    </application>
</manifest>

My AndroidManifest.xml on the Air side:
<?xml version="1.0" encoding="utf-8" ?>

<!-- Adobe AIR Application Descriptor File Template.
     Specifies parameters for identifying, installing, and launching AIR applications.

     xmlns - The Adobe AIR namespace: http://ns.adobe.com/air/application/3.7.
     The last segment of the namespace specifies the version of the AIR runtime required for this application to run.

     minimumPatchLevel - The minimum patch level of the AIR runtime required to run the application. Optional. -->

<application xmlns="http://ns.adobe.com/air/application/3.7">

    <!-- A universally unique application identifier. Must be unique across all AIR applications.
         Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
    <id>InAppPurchases</id>

    <!-- Used as the filename for the application. Required. -->
    <filename>InAppPurchases</filename>

    <!-- The name that is displayed in the AIR application installer. May have multiple values for each language. See samples or xsd schema file. Optional. -->
    <name>InAppPurchases</name>

    <!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
         Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
         An updated version of application must have a versionNumber value higher than the previous version. Required for namespace >= 2.5. -->
    <versionNumber>1.0.1</versionNumber>

    <!-- A string value (such as "v1", "2.5", or "Alpha 1") that represents the version of the application, as it should be shown to users. Optional. -->
    <!--<versionLabel></versionLabel>-->

    <!-- An application version designator (such as "v1", "2.5", or "Alpha 1"). Required for namespace < 2.5. -->
    <!--<version>0.0.0</version>-->

    <!-- Description, displayed in the AIR application installer. May have multiple values for each language. See samples or xsd schema file. Optional. -->
    <!--<description></description>-->

    <!-- Copyright information. Optional -->
    <!--<copyright></copyright>-->

    <!-- Publisher ID. Used if you're updating an application created prior to 1.5.3 -->
    <!--<publisherID></publisherID>-->

    <!-- Identifies the ActionScript extensions used by an application. -->
    <extensions>
        <extensionID>com.industrycorp.extensions</extensionID>
    </extensions>

    <!-- Settings for the application's initial window. Required. -->
    <initialWindow>
        <!-- The main SWF or HTML file of the application. Required. -->
        <content>InAppPurchases.swf</content>

        <!-- The title of the main window. Optional. -->
        <!--<title></title>-->

        <!-- The type of system chrome to use (either "standard" or "none"). Optional. Default standard. -->
        <!--<systemChrome></systemChrome>-->

        <!-- Whether the window is transparent. Only applicable when systemChrome is none. Optional. Default false. -->
        <!--<transparent></transparent>-->

        <!-- Whether the window is initially visible. Optional. Default false. -->
        <visible>true</visible>

        <!-- Whether the user can minimize the window. Optional. Default true. -->
        <!--<minimizable></minimizable>-->

        <!-- Whether the user can maximize the window. Optional. Default true. -->
        <!--<maximizable></maximizable>-->

        <!-- Whether the user can resize the window. Optional. Default true. -->
        <!--<resizable></resizable>-->

        <!-- The window's initial width in pixels. Optional. -->
        <!--<width></width>-->

        <!-- The window's initial height in pixels. Optional. -->
        <!--<height></height>-->

        <!-- The window's initial x position. Optional. -->
        <!--<x></x>-->

        <!-- The window's initial y position. Optional. -->
        <!--<y></y>-->

        <!-- The window's minimum size, specified as a width/height pair in pixels, such as "400 200". Optional. -->
        <!--<minSize></minSize>-->

        <!-- The window's initial maximum size, specified as a width/height pair in pixels, such as "1600 1200". Optional. -->
        <!--<maxSize></maxSize>-->

        <!-- The aspect ratio of the app ("portrait" or "landscape" or "any"). Optional. Mobile only. Default is the natural orientation of the device -->
        <!--<aspectRatio></aspectRatio>-->

        <!-- Whether the app will begin auto-orienting on launch. Optional. Mobile only. Default false -->
        <autoOrients>true</autoOrients>

        <!-- Whether the app launches in full screen. Optional. Mobile only. Default false -->
        <fullScreen>true</fullScreen>

        <!-- The render mode for the app (either auto, cpu, gpu, or direct). Optional. Default auto -->
        <!--<renderMode></renderMode>-->

        <!-- Whether the default direct mode rendering context allocates storage for depth and stencil buffers.  Optional.  Default false. -->
        <!--<depthAndStencil></depthAndStencil>-->

        <!-- Whether or not to pan when a soft keyboard is raised or lowered (either "pan" or "none").  Optional.  Defaults "pan." -->
        <!--<softKeyboardBehavior></softKeyboardBehavior>-->

        <!-- Display Resolution for the app (either "standard" or "high"). Optional, OSX-only. Default "standard" -->
        <!-- <requestedDisplayResolution></requestedDisplayResolution> -->
    </initialWindow>

    <!-- We recommend omitting the supportedProfiles element, which in turn permits your application to be deployed to all devices supported by AIR.
         If you wish to restrict deployment (i.e., to only mobile devices) then add this element and list only the profiles which your application does support. -->
    <!--<supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice</supportedProfiles>-->

    <!-- Languages supported by application. Only these languages can be specified -->
    <!--<supportedLanguages>en de cs es fr it ja ko nl pl pt ru sv tr zh</supportedLanguages>-->

    <!-- The subpath of the standard default installation location to use. Optional. -->
    <!--<installFolder></installFolder>-->

    <!-- The subpath of the Programs menu to use. (Ignored on operating systems without a Programs menu.) Optional. -->
    <!--<programMenuFolder></programMenuFolder>-->

    <!-- The icon the system uses for the application. For at least one resolution, specify the path to a PNG file included in the AIR package. Optional. -->
    <!--<icon>
        <image16x16></image16x16>
        <image29x29></image29x29>
        <image32x32></image32x32>
        <image36x36></image36x36>
        <image48x48></image48x48>
        <image50x50></image50x50>
        <image57x57></image57x57>
        <image58x58></image58x58>
        <image72x72></image72x72>
        <image96x96></image96x96>
        <image100x100></image100x100>
        <image114x114></image114x114>
        <image128x128></image128x128>
        <image144x144></image144x144>
        <image512x512></image512x512>
        <image732x412></image732x412>
        <image1024x1024></image1024x1024>
    </icon>-->

    <!-- Whether the application handles the update when a user double-clicks an update version of the AIR file (true),
         or the default AIR application installer handles the update (false). Optional. Default false. -->
    <!--<customUpdateUI></customUpdateUI>-->

    <!-- Whether the application can be launched when the user clicks a link in a web browser. Optional. Default false. -->
    <!--<allowBrowserInvocation></allowBrowserInvocation>-->

    <!-- Listing of file types for which the application can register. Optional. -->
    <!--<fileTypes>-->
    <!-- Defines one file type. Optional. -->
    <!--<fileType>-->
    <!-- The name that the system displays for the registered file type. Required. -->
    <!--<name></name>-->
    <!-- The extension to register. Required. -->
    <!--<extension></extension>-->
    <!-- The description of the file type. Optional. -->
    <!--<description></description>-->
    <!-- The MIME content type. -->
    <!--<contentType></contentType>-->
    <!-- The icon to display for the file type. Optional. -->
    <!--<icon>
        <image16x16></image16x16>
        <image32x32></image32x32>
        <image48x48></image48x48>
        <image128x128></image128x128>
    </icon>-->
    <!--</fileType>-->
    <!--</fileTypes>-->

    <!-- iOS specific capabilities -->
    <!--<iPhone>-->
        <!-- A list of plist key/value pairs to be added to the application Info.plist -->
        <!--<InfoAdditions>-->
            <!--<![CDATA[-->
            <!--<key>UIDeviceFamily</key>-->
            <!--<array>-->
                <!-- iPhone and iPod touch devices -->
                <!--<string>1</string>-->
                <!-- iPad devices -->
                <!--<string>2</string>-->
            <!--</array>-->
            <!--<key>UIStatusBarStyle</key>-->
            <!--<string>UIStatusBarStyleBlackOpaque</string>-->
            <!--<key>UIRequiresPersistentWiFi</key>-->
            <!--<string>YES</string>-->
            <!--]]>-->
        <!--</InfoAdditions>-->

        <!-- A list of plist key/value pairs to be added to the application Entitlements.plist -->
        <!--<Entitlements>
            <![CDATA[
            <key>keychain-access-groups</key>
            <array>
                <string></string>
                <string></string>
            </array>
            ]]>
        </Entitlements>-->

        <!-- Display Resolution for the app (either "standard" or "high"). Optional. Default "standard" -->
        <!--<requestedDisplayResolution>high</requestedDisplayResolution>-->
        <!-- Forcing Render Mode CPU for the devices mentioned. Optional  -->
        <!--<forceCPURenderModeForDevices></forceCPURenderModeForDevices> -->
        <!-- File containing line separated list of external swf paths. These swfs won't be packaged inside the application
        and corresponding stripped swfs will be output in externalStrippedSwfs folder. -->
        <!--<externalSwfs></externalSwfs> -->
    <!--</iPhone>-->

    <!-- Android specific tags that get passed to AndroidManifest.xml file. -->
    <android>

        <manifestAdditions>

            <![CDATA[
            <manifest android:installLocation="auto">
                <uses-permission android:name="android.permission.INTERNET"/>
                <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
                <!--<uses-permission android:name="android.permission.READ_PHONE_STATE"/>-->
                <!--<uses-permission android:name="android.permission.VIBRATE"/>-->
                <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>-->
                <!--<uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>-->
                <!--<uses-permission android:name="android.permission.WAKE_LOCK"/>-->
                <!--<uses-permission android:name="android.permission.CAMERA"/>-->
                <!--<uses-permission android:name="android.permission.RECORD_AUDIO"/>-->
                <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>-->
                <!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>-->
                <uses-permission android:name="com.android.vending.BILLING"/>

                <!--<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>-->
                <application android:enabled="true">

                    <activity android:excludeFromRecents="false">
                        <intent-filter>
                            <action android:name="android.intent.action.MAIN"/>
                            <category android:name="android.intent.category.LAUNCHER"/>
                        </intent-filter>
                    </activity>
                    <activity android:name=".AsyncActivity" android:label="async_activity"/>
                </application>
            </manifest>
            ]]>
            </manifestAdditions>

        <!-- Color depth for the app (either "32bit" or "16bit"). Optional. Default 16bit before namespace 3.0, 32bit after -->
        <!--<colorDepth></colorDepth>-->
        <!-- Indicates if the app contains video or not. Necessary for ordering of video planes with graphics plane, especially in Jellybean - if you app does video this must be set to true - valid values are true or false -->
        <!-- <containsVideo></containsVideo> -->
    </android>

</application>

My Activity Class:
public class AsyncActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        IAPManager.getInstance().getContext().dispatchStatusEventAsync("message", "This shit b cray cray");
        IAPManager.getInstance().makePurchase(this);
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        // Pass on the activity result to the helper for handling
        Log.d("IAPManager", "Shit is about to hit the fan");
        if (!IAPManager.getInstance().getHelper().handleActivityResult(requestCode, resultCode, data)) {
            // not handled, so handle it ourselves (here's where you'd
            // perform any handling of activity results not related to in-app
            // billing...
            super.onActivityResult(requestCode, resultCode, data);
        }
    }

    @Override
    public void onDestroy() {
        IAPManager.getInstance().endPurchase(this);
        super.onDestroy();
    }
}

Initializing my Activity in Java Code:
Intent intent = new Intent(context.getActivity(), AsyncActivity.class);
context.getActivity().startActivity(intent);

A: I had the same exception. I have found a solution by having the same fully qualified name than stated in previous answer (in AIR's manifestAdditions):
include the fully qualified name of my class as it's seen in Java
And by starting the activity differently:

Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClassName("com.industrycorp.AndroidInAppPurchaseLib", "com.industrycorp.AndroidInAppPurchaseLib.AsyncActivity");
context.getActivity().startActivity(intent);

A: So I found out that the native AndroidManifest.xml is not used at all in the extension, only the one used in AIR.
The answer to my problem was just to include the fully qualified name of my class as it's seen in Java:
Incorrect:
<activity android:name=".AsyncActivity"/>

Correct:
<activity android:name="com.industrycorp.AndroidInAppPurchaseLib.AsyncActivity"/>


text:
Q: Angular form error component trigger validation on form submit I'm using Angular 8.
I have the following reactive form group.
this.form = this.fb.group({
  query: ['', [
    Validators.required
  ]]
});

And in the HTML
<form [formGroup]="form" (submit)="onSubmit">
    <textarea formControlName="query" placeholder="SELECT ..."></textarea>
    <form-errors [control]="f.query"></form-errors>

    <button type="submit">Submit</button>
</form>

The form-errors is a custom template which displays error message which has following method to trigger validation check on the control.
shouldShowErrors(): boolean {
    return this.control &&
           this.control.errors &&
           (this.control.dirty || this.control.touched);
}

Thus validation is triggered when control is touched or changed.
How can I trigger validation check on submit of the form? How can I access the form inside the form-errors component by the passed control?

A: You can mark all controls as touched on submit button click like create a method for that and call it
 public markFormGroupTouched(formGroup: FormGroup) {
    Object.values(formGroup.controls).forEach(control => {
      control.markAsTouched();

      if (control.controls) {
          control.controls.forEach(c => this.markFormGroupTouched(c));
      }
    });
  }
  this.markFormGroupTouched(this.form);

demo


text:
Q: Mozilla firefox add-on to redirect url from one domain name to another domain without changing the complete url I want to know is there any add-on to redirect url in mozilla firefox. In Google Chrome there is an add-on Switcheroo. I need the url switcher like this in mozilla firefox. I have already tried with redirect url add-on of mozilla. But its not redirecting correctly.
Requirements:
I need to test the localhost portal pages. But in few places the dev environment url is hard coded. I want to redirect those urls to localhost to test the changes which I made in local.
Eg redirection:
protocol://dev_hostname:dev_portnubmer/wps/portal/abcd/xyz/u!/abcd
should be redirected to
protocol://localhost:localhostPortnumber/wps/portal/abcd/xyz/u!/abcd
For this redirection in google chrome switcheroo add-on I have configured like this:-http://dev_hostname:dev_portnubmer ---> http://localhost:localhostPortnumber. The add-on changing the protocol, domain name, port number. It's not changing the rest of the url part. Its working well as I expected. But in Mozilla I need an add-on like this.

A: You can use the Requestly extension which is available for both Chrome and Firefox. It has a feature to replace parts of URL which matches a given text or pattern instead of redirecting to a different URL altogether, basically what Switcheroo does. It has other features as well.
For your particular use case, you can follow these steps -

*

*Install Requestly

*Click on r icon in address bar

*Click on (+) Green Icon to create a new Rule

*Select Replace Rule

*Replace dev_hostname:dev_portnubmer with localhost:localhostPortnumber

*Save

Test your app now.

A: There is a add-on available for mozilla to redirect url which is Redirector.
I have read the help provided by the Redirector add-on, there they have explained the usage of it clearly.


text:
Q: Cannot resolve template using Jersey I'm creating a simple webservice using Jersey. I want to return a JSP names home.jsp but always get the following error when using the http://localhost:{port}/home endpoint:

The template name, /WebRoot/views/home.jsp, could not be resolved to a
  fully qualified template name

What am I doing wrong?

Project layout:
-src/main/java
   -resource
       -jsp
         -HomeResource.java
       -rest
         -HomeRestResource.java (Note rest endpoints are working fine)
-WebRoot
   -views
      -home.jsp
   -WEB-INF
      -web.xml

HomeResource.java
@Path("/home")
public class HomeResource{

    private final static String RESOURCE_PATH = "/WebRoot/views/home.jsp";

    @GET
    public Viewable getView() {
        return new Viewable(RESOURCE_PATH);
    }
}

home.jsp

Test Service

web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <filter>
        <filter-name>jersey</filter-name>
        <filter-class>com.sun.jersey.spi.container.servlet.ServletContainer
        </filter-class>
        <init-param>
            <param-name>com.sun.jersey.config.property.packages</param-name>
            <param-value>resource</param-value>
        </init-param>

        <init-param>
            <param-name>com.sun.jersey.config.property.JSPTemplatesBasePath
            </param-name>
            <param-value>/WebRoot/views</param-value>
        </init-param>

        <init-param>
            <param-name>com.sun.jersey.config.property.WebPageContentRegex
            </param-name>
            <param-value>/(images|js|styles|(WebRoot/views))/.*</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>jersey</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
</web-app>

Other Notes
I'm using a Jetty server to run this web app

A: <init-param>
    <param-name>com.sun.jersey.config.property.JSPTemplatesBasePath
    </param-name>
    <param-value>/WebRoot/views</param-value>
</init-param>

Here you're telling Jersey to prepend /WebRoot/views to your JSP path.
private final static String RESOURCE_PATH = "/WebRoot/views/home.jsp";

Here you're saying that the JSP path is /WebRoot/views/home.jsp.
So Jersey is probably looking for /WebRoot/views/WebRoot/views/home.jsp and not finding it.
I suggest removing that init-param or at least setting the value to / instead of /WebRoot/views.


text:
Q: Double buffering with Panel Double buffering the whole form can be done by setting the value of the "AllPaintingInWmPaint", "UserPaint" and "DoubleBuffer" ControlStyles to "true" (this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true)).
But this can't happen with a System.Windows.Forms.Panel because the class doesn't allow me to do so. I have found one solution: http://bytes.com/topic/c-sharp/answers/267635-double-buffering-panel-control . I have also tried this: Winforms Double Buffering . It's laggy, even when it's used on a small drawing, I have some custom resources that I'm using in the form and other things because of which I won't turn the whole form into one drawing. And the second one seems to cause problems. Are there other ways to do that?
I'm asking this because I don't want the drawing on the panel to flash all the time when the form is being resized. If there is a way to get rid of the flashing without double buffering, I'll be happy to know.

A: I should have posted my solution a long time ago...
Well, here is my solution:
Bitmap buffer = new Bitmap(screenWidth, screenHeight);//set the size of the image
System.Drawing.Graphics gfx = Graphics.FromImage(buffer);//set the graphics to draw on the image
drawStuffWithGraphicsObject(gfx);//draw
pictureBox1.Image = buffer;//set the PictureBox's image to be the buffer

Makes me feel like a complete idiot for finding this solution years after asking this question.
I have tried this with a Panel, but it has proven to be slower when applying the new image. Somewhere I had read, that it is better to use Panel instead of PictureBox. I don't know if I have to add something to the code to speed things up for the Panel, though.

A: Use a PictureBox if you don't need scrolling support, it is double-buffered by default.  Getting a double-buffered scrollable panel is easy enough:
using System;
using System.Windows.Forms;

class MyPanel : Panel {
    public MyPanel() {
        this.DoubleBuffered = true;
        this.ResizeRedraw = true;
    }
}

The ResizeRedraw assignment suppresses a painting optimization for container controls.  You'll need this if you do any painting in the panel.  Without it, the painting smears when you resize the panel.
Double-buffering actually makes painting slower.  Which can have an effect on controls that are drawn later.  The hole they leave before being filled may be visible for a while, also perceived as flicker.  You'll find counter-measures against the effect in this answer.

A: If acceptable you can stop refreshing the panel while resizing and enable it again after, this way you get rid of the ugly flickering.


text:
Q: AWS SSM port forwarding not working - using newest SSM agent Created new EC2 instance and SSM agent is installed on it.
I can connect with SSM to EC2 instance using:
aws ssm start-session --target i-0xyz

But Port Forwarding does not work - tried:
aws ssm start-session --target i-0xyz... --document-name AWS-StartPortForwardingSession --parameters '{"portNumber":["3306"],"localPortNumber":["3306"]}'

Got results:
Starting session with SessionId: xyz-0xyz
Port 3306 opened for sessionId xyz-0xyz.

Then used MySql Workbench on my computer and tried connecting - in terminal it came:
Connection accepted for session xyz-03abc...

But MySql Workbench never connected - it keeps 'spinning' and never actually connect. Tried several times with different EC2s as well..
This is a version of SSM on my computer:
ssm session-manager-plugin --version
1.1.61.0

Tried reinstalling SSM agent both on my computer and on EC2 with Newest version - did not work.
What can I try next?

A: This seems to me that your MySQL is rejecting the remote access from your localhost or anywhere that you are trying to connect from.
You need to grant the access for that MySQL user.
GRANT SELECT ON *.* TO 'user123'@'%';


text:
Q: Trouble configuring Jenkins to email build results (using gmail) I have recently installed Jenkins on my development machine to help me learn how continuous integration/delivery works.
I have a basic Android task setup that will build my app and then report lint, PMD, Checkstyle, Findbugs, and JUnit (business logic) test results.
I would like Jenkins to send me an email with the build status (let's start simple and not require any additional information other than "hey the build is over, here's what happened: build failed/build succeeded" etc.).
I do not have my own email server/smtp server/etc so I would like to use Gmail if possible.
I've looked over a lot of documentation and other stackoverflow posts and I see that the following is the suggested approach in the E-mail Notification section:
SMTP server: smtp.gmail.com
Default user e-mail suffix: @gmail.com
Use SMTP Authentication: YES
User name: gmail address
Password: gmail address password
Use SSL: YES
SMTP Port: 465
Reply-To-Address: <empty>
Charset: UTF-8

Additionally, on my gmail account I've enabled less secure apps to connect to it or whatnot, that is enabled and I do not have two factor auth/etc. on.
When I test this configuration I get the following error though:
Failed to send out e-mail
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

    at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)

    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)

    at java.security.cert.CertPathBuilder.build(Unknown Source)

Caused: sun.security.validator.ValidatorException: PKIX path building failed

    at sun.security.validator.PKIXValidator.doBuild(Unknown Source)

    at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)

    at sun.security.validator.Validator.validate(Unknown Source)

    at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)

    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)

    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)

Caused: javax.net.ssl.SSLHandshakeException

    at sun.security.ssl.Alerts.getSSLException(Unknown Source)

    at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)

    at sun.security.ssl.Handshaker.fatalSE(Unknown Source)

    at sun.security.ssl.Handshaker.fatalSE(Unknown Source)

    at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)

    at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)

    at sun.security.ssl.Handshaker.processLoop(Unknown Source)

    at sun.security.ssl.Handshaker.process_record(Unknown Source)

    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)

    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)

    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)

    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)

    at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:507)

    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238)

    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1900)

Caused: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
  nested exception is:
    javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1934)

    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:638)

    at javax.mail.Service.connect(Service.java:317)

    at javax.mail.Service.connect(Service.java:176)

    at javax.mail.Service.connect(Service.java:125)

    at javax.mail.Transport.send0(Transport.java:194)

    at javax.mail.Transport.send(Transport.java:124)

    at hudson.tasks.Mailer$DescriptorImpl.doSendTestMail(Mailer.java:581)

    at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)

    at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)

    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)

    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)

    at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:129)

    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)

    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)

    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)

    at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:248)

    at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)

    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)

    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)

    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)

    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)

    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)

    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:138)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:80)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)

    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)

    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

    at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)

    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)

    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)

    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)

    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

    at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:92)

    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)

    at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)

    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)

    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)

    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)

    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)

    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)

    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)

    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)

    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)

    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)

    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)

    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)

    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)

    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)

    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)

    at org.eclipse.jetty.server.Server.handle(Server.java:499)

    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)

    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)

    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)

    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)

    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

    at java.lang.Thread.run(Unknown Source)

Any thoughts?

A: The error of your logfile shows a wrong certification path. You have to import the certificate from gmail into the TrustStore of the Jenkins. See this article, how to import it.
I am running Jenkins under a Linuxdistribution, so i am not sure, what exactly was your problem. I think you didn't use the right JAVA Path to import it in the first way. There is a file "jenkins.xml" in your installation folder, where everything is configured. Maybe there was something going wrong at the installation of the windows service or you change the used JVM to another one.
When you try to set the TrustStore to a absolute path, like in your comment  "-Djavax.net.ssl.trustStore="C:\Program Files\java\jre1.8.0_141\lib\security\cacerts", you are going to be sure, that you use a store where the certificate is stored.
If you navigate to this page on the jenkins you get more informations, which Java version or java arguments you are using. http://localhost:8080/systemInfo


text:
Q: Batch file for running programs (they don't wait for me) My VBA macro has writtin this cmd file
cd/d H:\QUB\2dcfd
"C:\ANSYS Inc\v130\icemcfd\win64_amd\bin\icemcfd.bat" -batch -script test0deg.rpl
"C:\ANSYS Inc\v130\fluent\ntbin\win64\fluent.exe" 2d -i test0deg.jou

goto directory, execute one program, execute the next program.
If I run it as it is, the first program executes and works fine and the cmd window closes
I'm having problems getting the second on to wait until the first one is finished.
start /wait doesn't work. When I use it it pops a new command window, does the first program (in the new window) then the new command window hangs there. when I manually close this new window it says continue batch file? and i type y and hit return and the second program starts.
Please help. I just want the first one to run and then the second to run after it.
p.s. the second program needs files that the first program makes. That's why I need it in such a way
Thanks in advance
Oliver

A: Use call to call a batch file:
call "C:\ANSYS Inc\v130\icemcfd\win64_amd\bin\icemcfd.bat" ...

A: I fixed it using the following:
cd/d H:\QUB\2dcfd
cmd /c "C:\ANSYS Inc\v130\icemcfd\win64_amd\bin\icemcfd.bat" -batch -script test0deg.rpl
"C:\ANSYS Inc\v130\fluent\ntbin\win64\fluent.exe" 2d -i test0deg.jou

The first one runs, then when it closes, the second one runs.


text:
Q: Anyone have any problems installing OpenSSH via Cygwin on Vista 64 Bit? I was able to install the sshd service (after A LOT of problems), and was able to ssh on the machine that I installed it on by saying ssh hao@192.168.1.3 AND ssh localhost. However, all other machines on my local area network could not ssh to it. I checked and port 22 was indeed open, and SSH was listening on that port.
Anyone gone through an install like this?
Thanks in advance!

A: Chances are the Vista firewall is active. Open control panel, search for firewall, and turn it off entirely and see if external connections work. If they do, then you gotta figure out how to open port 22 inbound, which should be pretty easy but without a Vista machine handy I can't tell you exactly.


text:
Q: How to use React with Yup Validation (Without Formik) Any idea how can I do a React input validation using Yup (without Formik)?
I couldn't find online any good example. Thanks

A: You can use cast() if u want to use yup without formik, see example :
let yup = require('yup');

let schema = yup.object().shape({
  name: yup.string().required(),
  age: yup
    .number()
    .required()
    .positive()
    .integer(),
  email: yup.string().email(),
  website: yup.string().url(),
  createdOn: yup.date().default(function() {
    return new Date();
  }),
});

// check validity
schema
  .isValid({
    name: 'jimmy',
    age: 24,
  })
  .then(function(valid) {
    valid; // => true
  });

// you can try and type cast objects to the defined schema
schema.cast({
  name: 'jimmy',
  age: '24',
  createdOn: '2014-09-23T19:25:25Z',
});
// => { name: 'jimmy', age: 24, createdOn: Date }

A: Formik handles forms in react, binding the input tags to a model, that model can contain validators which can be Yum or any other form of validation.
If you don't want to use Formik then you can use another Form handling library for react such as FormState.
If you don't want to use a form handling library at all then you have to do it all by hand.


text:
Q: Laravel\WordPress - building an array with menu and submenu items from WP database I am setting up navigation menu in WordPress, and since I am making a service layer in Laravel for the data from WordPress, I am trying to create an array with menu and submenu items with the help of the corcel package:
    foreach ($menu->nav_items as $item) {
        $parent_id = $item->meta->_menu_item_menu_item_parent;
        $res[$parent_id][] = $item;
    }

    foreach ($res[0] as $item) {
        if (isset($res[$item->ID])) {
            foreach($res[$item->ID] as $subItem) {
                $res[$item->ID]['subitem'] = $subItem;
            }
        }
    }

So, out of this I would like to get json data that would like something like this:
'menu': [ '0' : {
             menuobject,
             subitems: [
               {subitemObject},
               {subitemObject}
             ]
           },
           '1': {
             menuobject,
             subitems: [
               {subitemObject},
               {subitemObject}
             ]
           }
           ...and so on

But, with the suggested way of doing it in the package I get big chunk of data where it is not easy to see which menu has which submenu and other data.
How can I build the array with menu and submenu items from the data I get from the WordPress database with the corcel package?


text:
Q: Is there another abstraction level on top of SQLAlchemy ORM that only exposes "real" models? Not sure if this is a reasonable idea, but here goes. SQLAlchemy has an Object-relational mapping, which means classes are directly mapped to database tables. However, I feel this still doesn't properly abstract the database away because it still relies on its structural features - e.g. when I need an n-to-m relationship, I need an extra table that I need to define with a class that, in the context of the program, doesn't actually model anything that should be considered an object in OOP. I also need to manually set a foreign key something_id and then a backref=something to the other class. What I would like is something like this:
class Publisher:
    id = Column(Integer,primary_key=True,autoincrement=True)
    name = Column(String)

class Author:
    id = Column(Integer,primary_key=True,autoincrement=True)
    name = Column(String)

class Book:
    id = Column(Integer,primary_key=True,autoincrement=True)
    title = Column(String)
    publisher = Column(Publisher,reverse_reference="books")
    # this converts into a foreign key and adds the "books" attribute to the Publisher object

    authors = Multiple(Author,reverse_reference="books")
    # this creates a new table and adds the "books" attribute to the Author object

I tried implementing this manually with a wrapper class, but it gets extremely inelegant and clunky very quickly, so I thought I'd ask first if there is already something that does this or some better way I should be doing this.


text:
Q: C Compiler cannot create executables on SUA/Interix Whenever I try to build an application with Interix's GCC on Windows, this is what happens:
/tmp/grep-2.5.4-src/build$ ../configure --build=x86_64-pc-interix6
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ../install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-pc-interix6
checking host system type... x86_64-pc-interix6
checking for gawk... (cached) gawk
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.

To me it looks like the problem isn't with the compiler, but rather with the configure file.
How can I fix it so that it works with SUA?
config.log:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by GNU grep configure 2.5.4, which was
generated by GNU Autoconf 2.61.  Invocation command line was

  $ ../configure --build=x86_64-pc-interix6

## --------- ##
## Platform. ##
## --------- ##

hostname = MehrdadVAIO
uname -m = genuineintel
uname -r = 6.1
uname -s = Interix
uname -v = 10.0.7063.0

/usr/bin/uname -p = Intel64_Family_6_Model_37_Stepping_2
/bin/uname -X     =
System = Interix
Node = <<< my computer name >>>
Release = 6.1
Version = 10.0.7063.0
Machine = genuineintel
Processor = Intel64_Family_6_Model_37_Stepping_2
HostSystem = Windows
HostRelease = 6.1
HostVersion = SP1

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/X11/bin
PATH: /usr/local/vtcl
PATH: /usr/local/Trolltech/Qt-4.1.2/bin
PATH: /opt/gcc64/bin
PATH: /bin
PATH: /opt/gcc.3.3/bin
PATH: /usr/contrib/bin
PATH: /usr/X11R6/bin
PATH: /usr/local/bin
PATH: /usr/contrib/win32/bin
PATH: /dev/fs/C/Windows/System32
PATH: /dev/fs/C/Windows/SUA/common
PATH: /usr/games
PATH: /usr/openwin/bin

## ----------- ##
## Core tests. ##
## ----------- ##

configure:1833: checking for a BSD-compatible install
configure:1889: result: /bin/install -c
configure:1900: checking whether build environment is sane
configure:1943: result: yes
configure:1972: checking for a thread-safe mkdir -p
configure:2011: result: ../install-sh -c -d
configure:2024: checking for gawk
configure:2040: found /usr/contrib/bin/gawk
configure:2051: result: gawk
configure:2062: checking whether make sets $(MAKE)
configure:2083: result: yes
configure:2297: checking build system type
configure:2315: result: x86_64-pc-interix6
configure:2337: checking host system type
configure:2352: result: x86_64-pc-interix6
configure:2378: checking for gawk
configure:2405: result: gawk
configure:2464: checking for gcc
configure:2480: found /opt/gcc64/bin/gcc
configure:2491: result: gcc
configure:2729: checking for C compiler version
configure:2736: gcc --version >&5
gcc (GCC) 4.6.0 20110122 (experimental)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2739: $? = 0
configure:2746: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
Target: x86_64-pc-interix6
Configured with: ../../gcc/gcc/configure --build=x86_64-unkown-linux-gnu --host=x86_64-pc-interix6 --target=x86_64-pc-interix6 --prefix=/opt/gcc64 --with-local-prefix=/opt/gcc64/local --with-gnu-as --enable-threads=posix --disable-shared --disable-nls --disable-multilib --disable-libssp --disable-decimal-float --disable-fixed-point --enable-checking=release --enable-languages=c --with-gmp-include=/interix/gcc/gnuxx/x86_64-pc-interix6/include --with-gmp-lib=/interix/gcc/gnuxx/x86_64-pc-interix6/lib --with-mpfr-include=/interix/gcc/gnuxx/x86_64-pc-interix6/include --with-mpfr-lib=/interix/gcc/gnuxx/x86_64-pc-interix6/lib --with-mpc-include=/interix/gcc/gnuxx/x86_64-pc-interix6/include --with-mpc-lib=/interix/gcc/gnuxx/x86_64-pc-interix6/lib
Thread model: posix
gcc version 4.6.0 20110122 (experimental) (GCC)
configure:2749: $? = 0
configure:2756: gcc -V >&5
gcc: error: unrecognized option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2759: $? = 1
configure:2782: checking for C compiler default output file name
configure:2809: gcc -D_ALL_SOURCE -D_ALL_SOURCE -I/usr/local/include  -I/usr/local/ssl/include -I/usr/local/include/php  -lbind -L/usr/local/lib -L/usr/local/ssl/lib conftest.c  >&5
gcc: error trying to exec 'cc1': execvp: No such file or directory
configure:2812: $? = 1
configure:2850: result:
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "GNU grep"
| #define PACKAGE_TARNAME "grep"
| #define PACKAGE_VERSION "2.5.4"
| #define PACKAGE_STRING "GNU grep 2.5.4"
| #define PACKAGE_BUGREPORT "bug-grep@gnu.org"
| #define GREP 1
| #define PACKAGE "grep"
| #define VERSION "2.5.4"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:2856: error: C compiler cannot create executables
See `config.log' for more details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-interix6
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=-D_ALL_SOURCE
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='-D_ALL_SOURCE -I/usr/local/include  -I/usr/local/ssl/include -I/usr/local/include/php'
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=' -lbind -L/usr/local/lib -L/usr/local/ssl/lib'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=x86_64-pc-interix6
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-pc-interix6
ac_cv_path_install='/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /tmp/grep-2.5.4-src/missing --run aclocal-1.10'
ALLOCA=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /tmp/grep-2.5.4-src/missing --run tar'
ANSI2KNR=''
AUTOCONF='${SHELL} /tmp/grep-2.5.4-src/missing --run autoconf'
AUTOHEADER='${SHELL} /tmp/grep-2.5.4-src/missing --run autoheader'
AUTOMAKE='${SHELL} /tmp/grep-2.5.4-src/missing --run automake-1.10'
AWK='gawk'
BUILD_INCLUDED_LIBINTL=''
CATALOGS=''
CATOBJEXT=''
CC='gcc'
CCDEPMODE=''
CFLAGS='-D_ALL_SOURCE'
CPP=''
CPPFLAGS='-D_ALL_SOURCE -I/usr/local/include  -I/usr/local/ssl/include -I/usr/local/include/php'
CYGPATH_W='echo'
DATADIRNAME=''
DEFS=''
DEPDIR=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GENCAT=''
GETCONF=''
GLIBC21=''
GMOFILES=''
GMSGFMT=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
INSTOBJEXT=''
INTLBISON=''
INTLLIBS=''
INTLOBJS=''
INTL_LIBTOOL_SUFFIX_PREFIX=''
LDFLAGS=' -lbind -L/usr/local/lib -L/usr/local/ssl/lib'
LIBICONV=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /tmp/grep-2.5.4-src/missing --run makeinfo'
MKINSTALLDIRS=''
MSGFMT=''
OBJEXT=''
PACKAGE='grep'
PACKAGE_BUGREPORT='bug-grep@gnu.org'
PACKAGE_NAME='GNU grep'
PACKAGE_STRING='GNU grep 2.5.4'
PACKAGE_TARNAME='grep'
PACKAGE_VERSION='2.5.4'
PATH_SEPARATOR=':'
POFILES=''
POSUB=''
RANLIB=''
SEP=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
U=''
USE_INCLUDED_LIBINTL=''
USE_NLS=''
VERSION='2.5.4'
XGETTEXT=''
ac_ct_CC='gcc'
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__isrc=' -I$(srcdir)'
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build='x86_64-pc-interix6'
build_alias='x86_64-pc-interix6'
build_cpu='x86_64'
build_os='interix6'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-pc-interix6'
host_alias=''
host_cpu='x86_64'
host_os='interix6'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='$(SHELL) /tmp/grep-2.5.4-src/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/../install-sh -c -d'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_NAME "GNU grep"
#define PACKAGE_TARNAME "grep"
#define PACKAGE_VERSION "2.5.4"
#define PACKAGE_STRING "GNU grep 2.5.4"
#define PACKAGE_BUGREPORT "bug-grep@gnu.org"
#define GREP 1
#define PACKAGE "grep"
#define VERSION "2.5.4"

configure: exit 77

A: It's looking for cc1 as a compiler and can't find it, which is why it's failing.
gcc: error trying to exec 'cc1': execvp: No such file or directory.

So it's not that the compiler can't create executables, but that it can't find it. gcc invokes cc1. Check your system for it, or perhaps your PATH.


text:
Q: Low Energy Bluetooth in Android using GATT I've done a lot of reading about LE Bluetooth and GATT but I'm still struggling to fully understand what GATT is. To make it simple I'd like to express how I'd like my app to work, and simply be told if it's possible or not? The basic premise is it will be used as a location tracker and beacons (maybe iBeacons specifically) will be placed around the building and whenever you enter the range of the beacon a message will be sent to the server from the phone. The idea is that it doesn't need to scan, the phone just simply listens and whenever a beacon advertises, the phones in range will hear this and raise an event.
Scenario:

*

*Client downloads the app and enters the building for the first time.

*The building has a beacon in every room, advertising every 5 seconds for example.

*When the client walks into a room and is in range of a beacon, the phone will get an unfriendlier version of the message "Beacon 2 has an RSSI of -87".

*When they leave the room they will no longer hear the message and so will do nothing until it hears another message from a beacon.

NOTE: This scenario doesn't involve any scanning, looping or pairing. The phone will just know it has to listen for LE Bluetooth messages.
So, is this possible? From what I've seen it seems like you need to scan and connect with each beacon using GATT before you can receive data from them.
Any infomation of this matter is greatly appreciated, thankyou!

A: Yes, this is possible.
Some high level scenario for a merchant store with beacon.
1) app client needs to have uuid or major id of beacons to be stored locally.
2) merchant store with same uuid or major id will broadcast messages.
3) phone OS keeps listening those messages when entered into geofence, OS will pass on these messages to the apps who are registered for beacons listening.
4) your app will match the uuid embed in the message and identify if its meant for it.
5) if message uuid does not match with uuid on client then app will not consume this message.
6) if message uuid matches then client will consume the message and display it on device, even your app is not running at that point of time.


text:
Q: .Net core Async Await method works as synchronously I have a question regarding async await pattern. I have following code
internal async Task<int> ConsumedBytesAsync(byte[] buffer)
{
    while(condition)
    {
        //build message

        if (message != null)
        {
            if (_previousRegisterMessageTask != null)
            {
                await _previousRegisterMessageTask;
            }

            _previousRegisterMessageTask = _controllers.RegisterMessageAsync(message, chunk.MessageHeader.MessageStreamId);
        }
    }

    return totalConsumed;
}

And the code in other class.
internal async Task RegisterMessageAsync(IMessage message, uint messageid)
{
    // some stuff about retrieve resposible controller

    if (controller != null)
    {
        await controller.HandleMessage(message, action);
    }
}

I would like to increase performance by run RegisterMessage asynchronously and in the same time start build next message. When next message is built procecss should await for finish registration of previous message. In ideal world it should works fine but actually _controllers.RegisterMessageAsync method execute synchronously.
I've checked that by Stopwatch start and stop around that method (I assumed that elapsed time should be around 0 - 5 becuase of only operation which should be done is return and save Task but was 800-900 what is average execution time of this method) and Control.WriteLine within _controllers.RegisterMessageAsync after await  and after save Task to _previousRegisterMessageTask (Control.WriteLine from _controllers.RegisterMessageAsync appear firstly.)
So please let me know why that operation works synchronously instead of asynchronously and what can i do to achieve logic I descriebe above. Maybe I did wrong tests and it is works asynchronously ?
Thanks in advance.

A: The await operator suspends evaluation of the enclosing async method until the asynchronous operation represented by its operand completes. If you need parallel evaluation of two of more methods do not use await until you need the results of method evaluation. You could try next pattern (if you need process messages sequentially)
internal async Task<int> ConsumedBytesAsync(byte[] buffer)
{
    Message message = await BuildMessageAsync();
    int totalConsumed = 0;
    while (condition)
    {
        Task<Message> buildNextMessage = BuildMessageAsync();
        Task registerMessage = RegisterMessageAsync(message);
        message = buildNextMessage.IsCompleted ? buildNextMessage.Result : await buildNextMessage;
        if (!registerMessage.IsCompleted)
        {
            await registerMessage;
        }
        totalConsumed++;
    }
    return totalConsumed;
}

internal async Task<Message> BuildMessageAsync()
{
    // long running message build operation
    await Task.Delay(1000);
    return new Message { Text = DateTime.Now.ToString() };
}

internal async Task RegisterMessageAsync(Message message)
{
    // long running message processing
    Console.WriteLine(message.Text);
    await Task.Delay(1000);
}

about await operator

A: You need to create a list of tasks then get a task that encompasses all of these tasks:
List<Task> tasks = new List<Task>();

while (whatever) {
    task = controller.HandleMessage(message, action);
    tasks.Add(task);
}

await Task.WhenAll(tasks);


text:
Q: Appending a 0 in front of a variable in Python I have a variable called fab, and a Django queryset. As follows,
fab = self.request.GET.get('fab')

and my queryset,
queryset_df = Table1.objects.filter(Q(fab=int(fab)) | Q(fab=int(0+fab))).values_list('masks').distinct()

As seen I want to append a zero in front of the fab in my Q, because sometimes the fab comes as a integer value and sometimes with a 0 infront. When I tried to add by +, it returned me an error like, unsupported operand type(s) for +: 'int' and 'unicode'. Any idea why? Thanks in advance.

A: You should cast the 0 to unicode or string before concatenating.
fab = "0" + fab

You can not concatenate a unicode variable with an integer, you can also not concatenate strings with integers or floats, so you need to convert one to the correct type.

A: It sounds like your logic is wrong somewhere,
You are either trying to force an integer into a CharField or you are trying to force a string into an IntegerField. If its the former you're always going to struggle with having to cast values to get the correct results and if its the latter the leading 0 is pointless.
You should try to use the correct field type, it will even help with your model's validation.


text:
Q: Deleting rows with duplicate info in columns I'm writing a code that copies data  from one sheet into another and I've got that function working fine. Now, I'm trying to code it to delete any rows that contain duplicate information based off that information's ID number in column F. Part of our process is to manually enter in column E when each row has been worked.
So my end goal is for the code to delete rows where column E is blank and column F is a duplicate. My code runs, but doesn't delete anything. I'm really hoping I'm just missing something ridiculously obvious.
For i = 1 To Range("f" & Rows.Count).End(xlUp).Row
    If Cells(i, 5).Value = "" Then 'if column E is blank on row i
        x = Cells(i, 6).Value
        If Not IsError(Application.Match(x, "F:F", 0)) Then '& if that row is a duplicate
            ActiveSheet.Range(x).EntireRow.Delete 'delete new duplicate row
        End If
    End If
Next i

A: Try it with,
For i = Range("f" & Rows.Count).End(xlUp).Row to 1 Step -1
    If Cells(i, 5).Value = "" Then 'if column E is blank on row i
        x = Cells(i, 6).Value
        If Application.Countif(Columns(6), x) > 1 Then '& if that row is a duplicate
            Rows(i).EntireRow.Delete 'delete new duplicate row
        End If
    End If
Next i

You were trying to delete the row number x, not i. Additionally, everything was going to be matched once.

A: So there are a couple of errors that need to be addressed in your code. First, if you are looping over a range and deleting rows, it's best to start from the bottom and work your way up. This prevents issues where your iterator is on a row, that row gets deleted, and the loop essentially skips the next row.
Next, you are looking for a Match in column F of x, which contains a value from Column F. So, it will always return a value (itself, at the very minimum). Maybe try using a COUNTIF and seeing if it's greater than 1 may be a better option?
Next, you populated the variable x with the value in Cells(i, 6), but then you try to use it as a range when deleting. Change your code to the following and see if it works:
For i = Range("f" & Rows.Count).End(xlUp).Row To 1 Step -1
If Cells(i, 5).Value = "" Then 'if column E is blank on row i
x = Cells(i, 6).Value
    If Application.Countif(Columns(6), x) > 1 Then '& if that row is a duplicate
    ActiveSheet.Rows(i).Delete 'delete new duplicate row
    End If
End If
Next i

A: Why not use the .RemoveDuplicates method? It's faster than looping around. Here's a rough outline on its use:
With Range
    .RemoveDuplicates Columns:=Array(6), Header:=xlYes
End With

Here's the msdn doc for the method, and another page with a more detailed implementation.  They should clear up any questions you might have.


text:
Q: Azure AD "Description" field missing when sync'd using Azure AD Connect We're using Azure AD Connect to sync our on-premises Active Directory to Azure AD. We have the free version that comes with the Office 365 business plans.
Azure AD Connect shows the Description field as being synchronized to Azure AD, yet, the field does not appear anywhere.
We're using a third-party service to read data from our user profiles to generate email signatures, but the service cannot read the data as it doesn't "exist" in Azure.
I even tried going into our Azure AD Connect configuration, enabled Directory extension attribute sync and added the Description field for user accounts...but it created a new "description" field with a weird name instead.
Is there something I'm missing ? Do we perhaps need to have Azure AD Premium ?
Thanks for your help people!

A: Based on the official documentation, the attribute for Description has been synced to Azure AD. You can verify it by open Synchronization Service Manager, and check the properties for the specific user by Metaverse Search.
However, if you need to retrieve the attribute values for specific user, you must use Azure AD Graph API. For your scenario, the third-party service may leverage  Azure AD Graph API for retrieving user properties.
Then, if you check the Graph API reference, you can find that Description is not included in the list, which means you can't retrieve the Description attribute from Azure AD.
As a workaround, you can use Directory extension, but the attributes are prefixed with extension_{AppClientId}_. The AppClientId has the same value for all attributes in your Azure AD tenant.
Also, you can submit your requirements to the following website, which collects feedbacks for Azure AD from users.
https://feedback.azure.com/forums/169401-azure-active-directory?query=attribute


text:
Q: Formatting Mailing List archive I have archived a mailing list, with multiple writers/speakers, asking and answering questions on a variety of subjects.
I've been looking around for solutions, but none come close to what I'm looking for.
The archive is organized along subject lines. So let's say the first subject is "Sugar". What follows is then either a question or a statement on sugar, to which other people (all identified) then reply or question or complete. Sometimes, the original question is expended upon, before people move on.
Then, a second subject is raised, say, "Meat" ... and the same pattern of Q&A resumes and dialogue on that particular subjects starts again.
Any LaTex solution out there to format this whole mess into something visually clean, where each writer/speaker would be relatively identifiable, along their replies and questions?


text:
Q: Problema: Divs se deslocam ao clicar Tenho um conjunto de 4 divs com titulo próprio, e ao clicar em cada um eles, é mostrada a informação correspondente, quando a página carrega os divs estão alinhados com margem entre cada um deles, porém, ao clicar num dos divs os restantes movem-se para a direita, sendo que o conteúdo selecionado é mostrado em baixo desse menu, como era suposto.
Já tentei várias formas e nenhumas delas resulta, tentei pelo atributo: position: fixed / static , por * display:block* e simplesmente não consigo fazer com que os elementos não selecionados permaneçam na sua posição inicial, quando se seleciona um outro elemento.

$('.top').on('click', function() {
  $parent_box = $(this).closest('.box');
  $parent_box.siblings().find('.bottom').hide();
  $parent_box.find('.bottom').toggle();
});
.box {
     display:block;
     float:left;
    }

    .box a{
     display:block
     margin-top: 175px;
     font-family: 'Open Sans Condensed';
     color: #1B3E90 ;
     text-decoration: none;
     font-size: 25px
    }

    .bottom{
     margin-top: 35px;
     overflow:auto;
    }

    top:hover {
     color:#F89326;
     transform: scale(1.2);
     display:block
    }

    .top:target {
     display:block
 }

         OP1

Add a description of the image here

Add a description of the image here

     Bibs & Batas

 OP2

     Confeções Variadas

 OP3

     Equipamento Desportivo

 OP4

Como posso fazer isto ? Estou á dois dias de volta deste problema...

A: Veja se é isso:

$('.top').on('click', function() {
  $parent_box = $(this).closest('.box');
  $parent_box.siblings().find('.bottom').hide();
  $parent_box.find('.bottom').toggle();
});
.box {
  display: block;
  float: left;
  position: relative;
}
.box a {
  display: block margin-top: 175px;
  font-family: 'Open Sans Condensed';
  color: #1B3E90;
  text-decoration: none;
  font-size: 25px
}
.bottom {
  margin-top: 35px;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}
.responsive1 {
  width: 500px;
}
top:hover {
  color: #F89326;
  transform: scale(1.2);
  display: block
}
.top:target {
  display: block
}

   OP1

Add a description of the image here

Add a description of the image here

   Bibs & Batas

 OP2

   Confeções Variadas

 OP3

   Equipamento Desportivo

 OP4

Modificações:
Criada a classe responsive1 no CSS.
.responsive1 {
  width: 500px;
}

Na classe .box adicionar position: relative;
Na classe .bottom:
.bottom {
  margin-top: 35px;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
}


text:
Q: Why can't we say "informations"? Why can't we use the word information in the plural form?
"Give me all the informations you've got", even if it's wrong, sounds more beautiful to my non-native ear than "give me all the information you've got", and I don't know why.
Edit: This is not a duplicate question since I know that information is a mass noun; what I am asking is, why can't it be in plural like some other mass nouns can? Why is it like that when it seems more correct with s at the end?

A: Because we don't. I'm sorry, but that is the whole of the answer. Languages are as they are, not as anybody (native or foreign) wants them to be.

A: Because information is a mass noun, i.e. uncountable.  In the same way you would say give me all the water in your bucket, rather than give me all the waters...
For discrete items of information, you could use facts.


text:
Q: Server is Trying to Convert Repeater Control Inside HTML Table to HtmlTableRow I have used the following code successfully in two other pages:

            ID
            Name
            Length
            # in Album
            Album
            Band

        <asp:Repeater ID="REP_Tracks" runat="server">
            <ItemTemplate>

                        <asp:Label ID="LBL_TrackID" runat="server" Text='<%#Eval("TrackID") %>' />

                        <asp:Label ID="TrackName" runat="server" Text='<%#Eval("TrackName") %>' CssClass="text-primary font-weight-bold" />

                        <asp:Label ID="LBL_TrackLength" runat="server" Text='<%#Eval("TrackLength") %>' />

                        <asp:Label ID="LBL_TrackNumber" runat="server" Text='<%#Eval("TrackNumber") %>' />

                        <asp:Label ID="LBL_AlbumName" runat="server" Text='<%#Eval("Album.AlbumName") %>' />

                        <asp:Label ID="LBL_BandName" runat="server" Text='<%#Eval("Album.Band.BandName") %>' />

                        <asp:Button ID="BTN_Details" runat="server" CssClass="btn btn-block btn-lg btn-info" Text="Details" CommandName="Details" UseSubmitBehavior="false" />

                        <asp:Button ID="BTN_Edit" runat="server" CssClass="btn btn-block btn-lg btn-warning" Text="Edit" data-toggle="modal" data-target="#EditTrack" CommandName="Edit" UseSubmitBehavior="false" />

                        <asp:Button ID="BTN_Delete" runat="server" CssClass="btn btn-block btn-lg btn-danger" Text="Delete" CommandName="Delete" UseSubmitBehavior="false" />

            </ItemTemplate>
        </asp:Repeater>

But instead of getting a nice sortable, filterable, and paged table using FooTable.js, I get this error:
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30311: Value of type 'System.Web.UI.WebControls.Repeater' cannot be converted to 'System.Web.UI.HtmlControls.HtmlTableRow'.

I also know this code works because I tried using an inline code block, but my Delete, Details, and Edit buttons needed a NamingContainer to function properly. You can read the Q&A here. I have used date formatting, numbers, and strings easily in the previous pages; the only thing different about this one is it uses a TimeSpan for the track length - Public Property TrackLength As TimeSpan. I honestly don't think the problem is with the repeater control; I think the page is very, very confused some other way, and that has confused me. :D

A: As it turns out, it's a bad idea to add runat="server" to tables if you want to use a Repeater inside them. Once I took that off, everything worked great!