text:
Q: How to detect denial-of-service attack coming from my computer? Some websites I visit stop serving with a message

There was a large number of requests coming from your IP-address, so it was
  temporarily blocked by our system.

How can I check which requests are being sent from my computer?

A: You can use the netstat command on your machine to see all network connections from your computer to any external host.
netstat -an

Will show you the protocol, Local Address (your machine IP address), Foreign Address (the destination hosts/sites) and the State like (ESTABLISHED means there is an open/active connection to the destination address).
Example:
    C:\Users\myUser>netstat -an
    Active Connections

      Proto  Local Address          Foreign Address        State
       TCP    0.0.0.0:135            0.0.0.0:0              LISTENING
       TCP    0.0.0.0:445            0.0.0.0:0              LISTENING
       TCP    127.0.0.1:2598         127.0.0.1:61196        ESTABLISHED
       TCP    172.27.12.86:49221     10.200.1.9:8883        ESTABLISHED
       TCP    172.27.12.86:50838     172.22.1.135:443       ESTABLISHED

Check if the amount of connections to a specific Foreign IP Address is high. There are other tools available out there but this is the simplest way to start to investigate.
This Works for both Windows and Linux machines.
References:

*

*https://linuxaria.com/howto/how-to-verify-ddos-attack-with-netstat-command-on-linux-terminal

*https://en.wikipedia.org/wiki/Denial-of-service_attack


text:
Q: Looping dynamic server response in React render I'm developing some SPAs in React and I came across with this issue several times; I eventually solved it in UGLY ways like the one posted in the code below.
I feel like I'm missing something obvious but I really can't figure out a more elegant (or even right) way to accomplish the same result, can you help me?
class Leaderboard extends React.Component {
  constructor(props) {
    super(props);
    this.state={
      lb:{},
      leaderboard:""
    };
    this.leaderboardGet = this.leaderboardGet.bind(this);
    this.leaderboardSet = this.leaderboardSet.bind(this);
    this.lblooper = this.lblooper.bind(this);
    this.lbconstruct = this.lbconstruct.bind(this);
  }

  leaderboardGet(callback){ //server call which returns data
    axiosCall.get('leaderboard.php',{params:{user:this.props.user}})
    .then((response)=>{
      var arr=response.data;
      callback(arr);
    })
    .catch((error)=>{
      console.log(error);
    })
  }
  leaderboardSet(a){ //puts in lb object the results of the server call and calls lb looper
    this.setState({lb: a});
    this.lblooper();
  }
  componentWillMount(){
    this.leaderboardGet(this.leaderboardSet);
  }

  lblooper(){ //the ugliness itself: loops the data in lb object, and pushes it into an "html string" in lblconstruct function
    Object.entries(this.state.lb).forEach(
      ([key, value]) => this.lbconstruct(`

${value.pos})

${value.usrname}

${value.pts}

`)
    );
  }
  lbconstruct(s){
    this.setState({leaderboard:this.state.leaderboard+=s});
  }

  render() {
    return (

    );
  }
}

Basically, if I have server data which has to be put inside html format for N loops, i couldn't find another way, so I'm wondering where I'm wrong.

A: Output your data into react elements in your render function:
class Leaderboard extends React.Component {
  constructor(props) {
    super(props);
    this.state={
      leaderboard: {},
    };
  }

  componentWillMount(){
    axiosCall.get('leaderboard.php', { params: { user:this.props.user } })
      .then(response => this.setState({ leaderboard: response.data }))
      .catch(console.log)
  }

  render() {
    const { leaderboard } = this.state
    return (

          // .map returns a new array, which we have populated with the react elements
          { Object.keys(leaderboard).map((key) => {
            const value = leaderboard[key]
            return (
              <div key={key} class={`leaderblock ${value.active}`}>

{value.pos}

{value.usrname}

                  {value.pts}

            )
          }) }

    );
  }
}

Doing it like this is what allows react to work, it can keep track of what elements are there, and if you add one, it can see the difference and just adds the one element to the end, rather than re-render everything.
Also note that if you are only fetching data once, it may make sense to use a "container" component which fetches your data and passes it in to your "dumb" component as a prop.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Как использовать environment value? Всем привет!
Сделал scheme,в нем environment value (например, TEST)
В коде, в AppDelegate пишу:
#if TEST
//do some actions
#endif

Но это не работает. Как правильно использовать environment value?
A: Вы путаете два понятия - переменные среды и директивы препроцессора. Переменные среды определяются на каждом компе индивидуально и служат чем-то типа настроек для кучи программ сразу, например, $HOME всегда дает ссылку на директорию пользователя где бы та не находилась внутри файловой системы, до них вполне можно достучаться в момент исполнения программы. Директивы препроцессора же служат для того чтобы из одних и тех же сырцов можно было на выходе получать программы с несколько разным функционалом или данными, они существуют только до момента сборки программы, а после сборки в рантайме такого понятия уже нет - в зависимости от того что это была за директива она либо подменяется на какой-то другой набор символов(макросы), либо выкидывается вообще (#pragma mark), либо еще что-то делает (скажем, #warning генерит собственно warning).
Конкретно в вашем случае вы, по видимому, задали в схеме именно что переменную среды TEST, а в коде пытаетесь работать с директивой препроцессора TEST у которых общего только имя. Чтобы код внутри #if TEST попал в компилятор вообще нужно чтобы где-то была определена директива TEST, сделать это можно либо в коде с помощью #define TEST, либо в схеме в каком-то из свойств наподобие PREPROCESSOR_DEFINITION или PREPROCESSOR_MACROS  -  не помню как оно сейчас называется (название несколько раз меняли), но насколько помню там же в схемах Release и Debug болтаются одноименные директивы - ориентируйтесь на них. А в принципе можно даже добавить флаг непосредственно компилятору -D TEST
A: Принятый ответ в данном вопросе показывает на скриншоте, где именно необходимо указать значение, которое Вы хотите использовать. Конкретно - это раздел Preprocessor Macros, можете найти его через поиск в правом верхнем углу окошка.


text:
Q: Pass function with argument from within formatted print statement, with arguments from {} Hi r/python programmers.
I'm trying to input a function inside formatted print statatement in python 3.  The function has arguments which I want to  get from the formatted print {}. But upon doing so, it's not passed. How to achieve this?
Code #1 > Error Handler Function
# >> function :: error pop# msg = error message , shutdown = True or Falsedef pop_error(msg, shutdown):if shutdown == True:print(f"[{c_red}{msg}{c_white}] Exiting..")exit()elif shutdown == False:print(f"[{c_red}{msg}{c_white}]")

Code #2 > Calling Error Handler
# global variablesglobal engine_argglobal async_arg# check selected engineif engine_arg == 'ddg':print("Starting DDG")elif engine_arg == 'pbin':print("Starting Pastebin")else:#pop_error("Invlaid Engine {?engine_arg?}", True)print(f"{pop_error('Invalid Engine {engine_arg}', True)}")exit()

Edit: The main issue is that I'm unable to add local variable inside the double quotes for the first argument of function. That's why I used formatted string so that I can use "{variable}", but this doesn't seem possible inside  the quotes of the function despite using print(f)..
Solved: print(f"{pop_error(f'Invalid Engine {engine_arg}', True)}"
Image References: https://imgur.com/a/h7LrZ7f

A: >>> itworks = 'wow it worked'
>>> f'''{f'{itworks}'}'''
>>> 'wow it worked'

# in you case

print(f"{pop_error(f'Invalid Engine {engine_arg}', True)}"


text: Q: How to make Only Video Rotate to Landscape in SwiftUi I have a view where the video is at the top. When I rotate to landscape, I only want the video to go full screen. Can anyone help me do that. Is there a native way to make this happen in Swiftui?


text:
Q: Getting the user id from a database trigger in Cloud Functions for Firebase? In the example below, is there a way to get the uid of the user who wrote to /messages/{pushId}/original?
exports.makeUppercase = functions.database.ref('/messages/{pushId}/original')
.onWrite(event => {
  // Grab the current value of what was written to the Realtime Database.
  const original = event.data.val();
  console.log('Uppercasing', event.params.pushId, original);
  const uppercase = original.toUpperCase();
  // You must return a Promise when performing asynchronous tasks inside a Functions such as
  // writing to the Firebase Realtime Database.
  // Setting an "uppercase" sibling in the Realtime Database returns a Promise.
  return event.data.ref.parent.child('uppercase').set(uppercase);
});

A: UPDATED ANSWER (v1.0.0+):
As noted in @Bery's answer above, version 1.0.0 of the Firebase Functions SDK introduced a new context.auth object which contains the authentication state such as uid. See "New properties for user auth information" for more details.
ORIGINAL ANSWER (pre v1.0.0):
Yes, this is technically possible, although it is not currently documented. The uid is stored with the event.auth object. When a Database Cloud Function is triggered from an admin situation (for example, from the Firebase Console data viewer or from an Admin SDK), the value of event.auth is:
{
  "admin": true
}

When a Database Cloud Function is triggered from an unauthenticated reference, the value of event.data is:
{
  "admin": false
}

And finally, when a Database Cloud Function is triggered from an authed, but not admin, reference, the format of event.auth is:
{
  "admin": false,
  "variable": {
    "provider": "<PROVIDER>",
    "provider_id": "<PROVIDER>",
    "user_id": "<UID>",
    "token": {
      // Decoded auth token claims such as sub, aud, iat, exp, etc.
    },
    "uid": "<UID>"
  }
}

Given the information above, your best bet to get the uid of the user who triggered the event is to do the following:
exports.someFunction = functions.database.ref('/some/path')
  .onWrite(event => {
    var isAdmin = event.auth.admin;
    var uid = event.auth.variable ? event.auth.variable.uid : null;

    // ...
});

Just note that in the code above, uid would be null even if isAdmin is true. Your exact code depends on your use case.
WARNING: This is currently undocumented behavior, so I'll give my usual caveat of "undocumented features may be changed at any point in the future without notice and even in non-major releases."

A: Ever since Firebase functions reached version 1.0, this behavior is no longer undocumented but has sligtly changed. Be sure to read the docs.
Context has been added to cloud functions and you can use it like this
  exports.dbWrite = functions.database.ref('/path/with/{id}').onWrite((data, context) => {
  const authVar = context.auth; // Auth information for the user.
  const authType = context.authType; // Permissions level for the user.
  const pathId = context.params.id; // The ID in the Path.
  const eventId = context.eventId; // A unique event ID.
  const timestamp = context.timestamp; // The timestamp at which the event happened.
  const eventType = context.eventType; // The type of the event that triggered this function.
  const resource = context.resource; // The resource which triggered the event.
  // ...
});


text:
Q: Quais são as formas de iterar um array em PHP (sem foreach)? Antes que eu seja censurado pela pergunta, aviso de antemão que o intuito da mesma é simplesmente a nível de curiosidade. Eu sei que o foreach é o meio mais adequado para isso.
Porém gostaria de saber o seguinte:
Quais são as formas de iterar com um array em PHP, sem a utilização do foreach, de maneira que possa acessar índice e o valor (como no foreach)?
Gostaria de ver exemplos com for, while ou até mesmo funções.
Vou deixar um array para modelo da resposta:
$array = array(
    'stack' => 'Overflow',
    'linguagem' => 'Português',
    'tags' => array('PHP', 'Iteração', 'Array')
);

Preciso que a interação se dê dessa forma (exemplificando com foreach):
foreach($array as $indice => $valor)
{
   var_dump($indice, $valor);
}

Atenção: O único caso não aceito para iteração com for é o do $i++, já que é uma maneira engessada e só serve para array com índices numéricos.

A: De fato, um loop for não trabalha bem com arrays com índices não numéricos, porém é possível contornar isso se "resetar" as keys caso mas mesmas não sejam importantes, com array_values.
$array = array(
    'stack' => 'Overflow',
    'linguagem' => 'Português',
    'tags' => array('PHP', 'Iteração', 'Array')
);

$numericArray = array_values($array);

$count = count($numericArray);

for ($i = 0; $i < $count; $i++){
    var_dump($numericArray[$i]);
}

A: Ok, só de sacanagem, vai a minha resposta:
print_r( $array );

Isso itera e já mostra na tela de uma vez só, tanto chaves quanto valores.
E o melhor ainda, funciona em arrays multi-nível ;)
Ok, não tem como aproveitar os dados pra muitas coisas diferentes, mas se for só pra exibir, o print_r vem com "pacote completo".

A: Foi dito na resposta anterior que array_map desconsidera o índice.
Porém, existe ainda uma outra forma muito interessante. É utilizando array_map, com multipos parâmetros. Sendo assim, podemos passar um array com as chaves, e o outro, para valores.
Assim:
$array = array('nome' => 'wallace', 'idade' => 25);

$map = function ($value, $key)
{
   echo "$key => $value";
}

array_map($map, $array, array_keys($array));

Relacionado: Qual é a finalidade de array_map aceitar infinitos parâmetros do tipo array, depois do callback?

A: Usando do ... while:
    do
    {
        $cliente = current($dados_teste); // acessa item atual com "current"
        $tabela.= $cliente['nome'] .'-'. $cliente['idade']; // usa os dados
    }
    while(next($dados_teste)!==false); // avança o ponteiro com "next"

Código de exemplo:
<?php

    $dados_teste = array(
                            array(
                                    'nome'=>'Pedro',
                                    'idade'=>'45',
                                    'uf'=>'RJ'
                                ),

                            array(
                                    'nome'=>'Maria',
                                    'idade'=>'30',
                                    'uf'=>'RJ'
                                ),

                            array(
                                    'nome'=>'Miguel',
                                    'idade'=>'28',
                                    'uf'=>'MG'
                                ),

                            array(
                                    'nome'=>'Paulo',
                                    'idade'=>'52',
                                    'uf'=>'SP'
                                ),
                        );

    $tabela = '

Nome	Idade	UF
';

    do
    {
        $cliente = current($dados_teste);

        $tabela.= '

'.$cliente['nome'] .'	'. $cliente['idade'] .'	'.  $cliente['uf'] .'
';
    }
    while(next($dados_teste)!==false);

    $tabela.='

';

?><!DOCTYPE HTML>

    <title>Exemplo Iterando array com Do...While</title>

    <?php echo $tabela; ?>

Output:
    <!DOCTYPE HTML>

        <title>Exemplo Iterando array com Do...While</title>

Nome	Idade	UF

Pedro	45	RJ

Maria	30	RJ

Miguel	28	MG

Paulo	52	SP

A: Sendo também um novato, fiquei interessado na pergunta e encontrei um artigo interessante sobre a mesma.
Aqui vai uma solução de acordo com o artigo.
$array = array(
    'stack' => 'Overflow',
    'linguagem' => 'Português',
    'tags' => array('PHP', 'Iteração', 'Array')
);

$keys = array_keys($array);

$size = count($array);

for ($i = 0; $i < $size; $i++) {
    $key   = $keys[$i];
    $value = $array[$key];

    echo $value;

}

Veja o código funcionando no IDEONE
Ref: PHP internals: When does foreach copy?

A: Também é possível iterar um array usando as funções, array_walk() ou array_walk_recursive(), o primeiro argumento é o array que deseja iterar, o segundo é a função que deve ser aplicada em todos os elementos, essa função pode ser uma já declarada ou uma anônima(clousere)
$array = array(
    'stack' => 'Overflow',
    'linguagem' => 'Português',
    'tags' => array('PHP', 'Iteração', 'Array')
);

array_walk($array, function($v, $k) {
    var_dump($v, $k);
});

No caso do array_walk_recursive, ele iterará com os elementos do array recursivamente.
Veja:
array_walk_recursive($array, function ($value, $key) {
    var_dump($value, $key);
});

Resultado:
string(8) "Overflow"
string(5) "stack"
string(10) "Português"
string(9) "linguagem"
string(3) "PHP"
int(0)
string(10) "Iteração"
int(1)
string(5) "Array"
int(2)

Exemplo no IDEONE
Exemplo - ideone

A: Não me contive sem ter que dar a minha palinha por aqui
Uma outra boa forma de se fazer essa iteração de uma array, sem o foreach, seria com um while, iterando em cima de uma instância de ArrayIterator.
Veja:
 $it = new ArrayIterator($array);

 while ($it->valid()) {

    $indice = $it->key();

    $valor = $it->current();

    $it->next();
 }

Só lembrando que, pra fazer outra iteração, seria necessário utilizar o método rewind para retornar ao ponteiro ao início.
$it->rewind(); // Após o while

A: Ainda falando de objetos poderíamos fazer assim também:
$array = array(
    'stack' => 'Overflow',
    'linguagem' => 'Português',
    'tags' => array('PHP', 'Iteração', 'Array')
);

$arrayobject = new ArrayObject($array);

$iterator = $arrayobject->getIterator();

while($iterator->valid()) {
    echo $iterator->key() . ' => ' . $iterator->current() . "\n";

    $iterator->next();
}

Importante lembrar é que temos que utilizar o método next dentro do while para passar para o próximo elemento e, assim, evitar um loop infinito.
Que cairia na sua própria resposta referente ao  ArrayIterator()

A: Você pode utilizar o array_walk:
$array = array(
    'stack' => 'Overflow',
    'linguagem' => 'Português',
    'tags' => array('PHP', 'Iteração', 'Array')
);

array_walk($array, function ($value, $key){
    var_dump($key, $value);
});

Caso o índice seja irrelevante, array_map pode ser utilizado
$array = array(
    'stack' => 'Overflow',
    'linguagem' => 'Português',
    'tags' => array('PHP', 'Iteração', 'Array')
);

array_map(function($value)
{
    var_dump($value);
}, $array);

A: Uma outra maneira de fazer isso é utilizando a função each.
Ela pega o ponteiro atual do array e transforma em outro array, contendo o valor do índice e valor desse array. Em seguida, ele passa para o próximo elemento do array.
Exemplo;
each($array);

Resultado:
Array
(
    [1] => Portugus
    [value] => Portugus
    [0] => linguagem
    [key] => linguagem
)

Veja que ele retorna uma chave chamada value e outra como índice numérico. Isso é para que seja possível utilizar essa função com o list.
Então podemos fazer isso:
while (list($key, $value) = each($array)) {
    var_dump($key, $value);
}

Podemos ainda utilizar (estranhamente) um for para isso:
for (; list($key, $value) = each($array); ) {
      var_dump($key, $value);
}

A: Você pode construir um design patterns de interação, conforme o exemplo abaixo, que é baseado no PHP Iterator ( http://php.net/manual/pt_BR/class.iterator.php ):
 <?php

   //entrada de elementos
    $myCollection = [
        new stdClass(),
        new stdClass(),
        new stdClass(),
        new stdClass(),
    ];
     /**
     * :::: Iterator Interface
     *
     * @author ivan-ferrer
     */
    interface MyIteratorInterface
    {
        public function current();
        public function rewind();
        public function next();
        public function key();
        public function valid();
    }

    // Estruturais, Comportamentais e Criacionais
    // PHP Iterator

    class PHPIterator implements Iterator, MyIteratorInterface
    {
        private $collection = [];
        private $key        = 0;

        public function __construct(array $collection = [])
        {
            $this->collection = $collection;
        }

        public function rewind()
        {
            $this->key = 0;
        }

        public function current()
        {
            return $this->collection[$this->key];
        }

        public function key()
        {
            return $this->key;
        }

        public function next()
        {
            ++$this->key;
        }

        public function valid()
        {
            return isset($this->collection[$this->key]);
        }
    }

    $phpIterator = new PHPIterator($myCollection);

    echo "-----------------while--------------------\n";
    $phpIterator->rewind();

    while ($phpIterator->valid()) {
        var_dump($phpIterator->current());
        $phpIterator->next();
    }

    echo "-------------------for--------------------\n";

    for ($phpIterator->rewind(); $phpIterator->valid(); $phpIterator->next()) {
        var_dump($phpIterator->current());
    }

    echo "------------------foreach-----------------\n";

    foreach ($phpIterator as $key => $object) {
        var_dump($object);
    }

Há também diversas outras formas de fazer um iterator:
http://php.net/manual/pt_BR/spl.iterators.php

A: É possível tratar-lo como objeto assim:
$array = array(
    'stack' => 'Overflow',
    'linguagem' => 'Português',
    'tags' => array('PHP', 'Iteração', 'Array')
);

$A = $array;
while(!is_null(key($A))) {
  var_dump(current($A));
  next($A);
}

http://php.net/manual/pt_BR/language.oop5.iterations.php


text:
Q: Android google.navigation Intent Modes? I'm currently developing an application that will launch a navigation intent.  I know that this isn't an official API, but it works perfectly the way I want it to.
I allow the user to select driving, walking, and bus navigation to a location.  The intent to launch directly into Google Maps Navigation looks like this:
google.navigation:ll= + a latitude and longitude, then + &mode= then your mode of transportation.  For example, to navigate using walking directions to a certain area:
google.navigation:ll=blah,blah&mode=w
Driving is default, or &mode=d, and biking is &mode=b, but I can't figure out bus (public transit).
Has anyone done this before?
Thanks!
Edit: So far, I've found that mode=public gives bike directions, mode=transit gives driving, frustratingly, mode=bus also returns bike directions.
More: mode=train also gives driving...  There's GOT to be a way to do this...
Another Edit: I realized just now that I'm pretty sure that it doesn't exist, because after experimenting with terms I realized that I should instead launch a Google Maps intent with a bus search, but does anyone know how to do this?

A: After a bunch of guessing and hunting around, I have decided that it is impossible to launch directly to bus navigation, because that would involve CHOOSING a bus for the person to ride, which wouldn't make sense.
Instead, you can launch them to a Google Maps search to the destination like so, thank you to this answer to a similar question:
"http://maps.google.com/maps?daddr=lat,long&dirflg=r"
With the &dirflag specifying public transit.  (Why the "r" I have no idea...)

A: You should be able to append the travel mode as needed, with the travel modes listed below.

*

*driving (default) indicates standard driving directions using the road network.

*walking requests walking directions via pedestrian paths & sidewalks (where available).

*bicycling requests bicycling directions via bicycle paths & preferred streets (where available).

*transit requests directions via public transit routes (where available).

If you would like to launch an Intent and allow the user to select between Maps or Browser you can do it this way.
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?saddr="+ starting_point_lat+","+starting_point_long+"&daddr="+dest_point_lat+","+dest_point_long+"&mode=transit"));
startActivity(intent);

A: Public transportation is mode r, just use
google.navigation:q=Taronga+Zoo,+Sydney+Australia&mode=r

would do the trick, there is no need to launch an url first and wait for it to redirect to google map.


text:
Q: Image of open donut under $\phi=z+\frac{1}{z}$
Source: Ch1 problem 11 on Function Theory of One Complex Variable by Greene and Krantz.
Let $S=\{z\in C: \frac{1}{2}<|z|<2\}$ and $\phi(z)=z+\frac{1}{z}$. Compute $\phi(S)$.

So far I have $$z=re^{i\theta}, \frac{1}{2}<r<2, 0\leq\theta<2\pi\implies \phi(z)=\left(r+\frac{1}{r}\right)\cos(\theta)+i\left(r-\frac{1}{r}\right)\sin(\theta)=Re^{i\varphi}$$
$$R=\sqrt{r^2+\frac{1}{r^2}+2\cos(2\theta)}$$
$$\varphi=\arctan\left(\frac{r^2-1}{r^2+1}\tan(\theta)\right)$$
but it doesn't look very helpful...

A: To understand the mapping behaviour of a holomorphic function $f$, it is often helpful to see how it transforms a family of curves - the most obvious candidates for such families are the lines of constant real or imaginary part, or a family of concentric circles and the rays emanating from the centre - and the preimages of such families, that is, the level curves of $\operatorname{Re} f,\; \operatorname{Im} f$ and of $\lvert f(z) - w_0\rvert$, $\arg\bigl(f(z) - w_0\bigr)$ respectively.
Another tool that often helps greatly is symmetry. If $f$ is even or odd, that helps understanding its behaviour, also if $f$ is real in the sense $f(\overline{z}) = \overline{f(z)}$. Other simple transformations are also something to look for.
Here, we have the symmetry $\phi(z) = \phi\bigl(\frac{1}{z}\bigr)$. Thus, to understand $\phi$, we only need to look at $1 \leqslant \lvert z\rvert$, the behaviour inside the unit disk follows from the behaviour outside it.
Since the domain $S$ we're interested in is an annulus centred at $0$, it is natural to look how $\phi$ behaves on the circles $\lvert z\rvert = r$, and on the rays $\arg z = \theta$.
For $r = 1$, we have $\frac{1}{z} = \overline{z}$, and hence $\phi(z) = 2\operatorname{Re} z$ on the unit circle. Thus the unit circle is mapped to the interval $[-2,2]$. Generally, you found that
$$\phi(re^{i\theta}) = \bigl(r + \tfrac{1}{r}\bigr)\cos \theta + i\bigl(r -\tfrac{1}{r}\bigr)\sin \theta.$$
For constant $r \neq 1$, that describes an ellipse with major semiaxis $r+\frac{1}{r}$ and minor semiaxis $\bigl\lvert r-\frac{1}{r}\bigr\rvert$, which is traversed counterclockwise for $r > 1$, and clockwise for $r < 1$.
To determine the image $\phi(S)$, that is already sufficient. Using the symmetry $\phi\bigl(\frac{1}{z}\bigr) = \phi(z)$, and the open mapping theorem, it then follows that $\phi(S)$ is a region bounded by the ellipse we get for $r = 2$, and since $\phi(\pm i) = 0$, it is the interior of that curve. We can write that in the form
$$\phi(S) = \{ z \in \mathbb{C} : \lvert z-2\rvert + \lvert z+2\rvert < 5\},$$
using that the foci of the ellipse $\{\phi(2e^{i\theta}) : 0 \leqslant \theta \leqslant 2\pi\}$ are $\pm 2$.
To more completely understand the mapping behaviour of $\phi$, one would also look at the curves $\bigl\{ \phi(re^{i\theta}) : \frac{1}{2} < r < 2\bigr\}$ for fixed $\theta$, and note that - for $\theta \neq k\frac{\pi}{2}$ - these are parts of the hyperbolas with foci $\pm 2$.


text:
Q: How to view all commits by a date range in TortoiseCVS It's no problem to view all of the commits on a particular file through its CVS History.
What I need is to view all files that are committed on the same date as or near to a given file, or just a plain date range. The important thing is that I get all commits before or after or on a given date.
For example. File x has 20 revisions, the most recent is June 25, 2011
There's a bug and I need to find out what other files were checked in on that date to check for potential sources of the bug. Even something that has the equivalent effect of WHERE date > '06-06-2011 would be perfectly fine.
I've tried googling around but there doesn't seem to be any mention of it. However, I've heard that doing something like the above code example is possible..

A: I've used CVSPS to do things like this.  It assembles groups of check ins into sets that it calls a "patchset".  It has all kinds of features to search for patchsets created by specific users, between dates, patchsets that affect a certain file, etc.  It can also create diff reports of patchsets, which is extremely helpful to find what changed.
http://www.cobite.com/cvsps/

A: I have a workaround-type solution to this now. I'll share it but I'm still very much interested in knowing how to do this / if this can be done.
The workaround:
Check out two copies of the code based on certain dates
 and do a directory diff with something like Beyond Compare.

Problem:
What changes were made on or around June 25th?

Solution (Windows):
1. Create two directories C:\dirA\ and C:\dirB\
2. Right-click C:\dirA\ and click 'CVS Checkout...'
3. Select the appropriate Module
4. Click the 'Revision' tab
5. Choose to get the 'Files at a certain time' and pick June 24th.
6. Repeat steps 2 - 4 on C:\dirB\
7. Choose to get the 'Files at a certain time' and pick June 26th.
8. Do a directory diff of C:\dirA\ vs C:\dirB\
9. Any differences will have been checked in on either the 24th, 25th, or 26th.
10. View CVS History to determine the exact date and time of a particular change.

It's not the most elegant solution, to be sure, but it works. As long as the date range is not too large and the project is not crowded with developers, most changes that show up will be the ones that you are looking for.
Obviously, given the somewhat kluge-like nature of this, I'm still very much interested in a more elegant solution and I'll hold this question open for now in case someone has some input.

A: Note (5 years later, Sept. 2016)
The documentation around tools to import from CVS has been updated.
See commit 106b672, commit 72e0877, commit 1eba3e5 (22 Sep 2016) by Jeff King (peff).
(Merged by Junio C Hamano -- gitster -- in commit 3d0049e, 03 Oct 2016)
cvsps (www.cobite.com/cvsps) is now at github.com/andreyvit/cvsps.
git cvs migration now includes the following warning:

These instructions use the git-cvsimport script which ships with git, but other importers may provide better results. See git cvsimport

And gitcvsimport warns:

WARNING: git cvsimport uses cvsps version 2, which is considered
  deprecated; it does not work with cvsps version 3 and later.
  If you are performing a one-shot import of a CVS repository consider using
  cvs2git or cvs-fast-export.


text:
Q: Stacking/concatenating tensors increases memory usage In PyTorch, I found stack-ing or cat-ing multiple tensors would increase memory usage by the sum of the sizes of all these arrays. An example is as follows:
import torch as tc
import torch.autograd as tag
import sys
import psutil
import os
import resource

def get_ru_maxrss():
    """ Return max RSS usage (in kilobytes) """
    size = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
    if sys.platform == 'darwin':
        # on Mac OS X ru_maxrss is in bytes, on Linux it is in KB
        size //= 1024
    return size / 1024

def cpuStats():
        print(sys.version)
        print(psutil.cpu_percent())
        print(psutil.virtual_memory())  # physical memory usage
        pid = os.getpid()
        py = psutil.Process(pid)
        memoryUse = py.memory_info()[0] / 2. ** 30  # memory use in GB...I think
        print('memory GB:', memoryUse)

m0 = get_ru_maxrss()

x1 = tc.ones([8192, 8192], requires_grad=True)
print(x1.dtype)
print(get_ru_maxrss() - m0)
print('=======')

y = x1 * 1.1
print(y.dtype)
print(get_ru_maxrss() - m0)
print('=======')

for i in range(10):
    y = tc.cat([y, x1])
    print(y.dtype)
    print(get_ru_maxrss() - m0)
    print('=======')

loss = tc.mean(y)

print(get_ru_maxrss() - m0)
print('=======')

loss.backward()

print(get_ru_maxrss() - m0)
print('=======')

And we can see that each occurence of cat in the for loop increases memory usage by 512 MB, which is the sum of y and x1 (256 MB each). This isn't a major issue for me right now but I'm just curious about it. If I understand it correctly, the vector-Jacobian product of stack or concatenation is just to perform the reversed operation to the gradient vector, splitting it back into multiple arrays whose shapes match the original inputs to the stack or cat function. This process doesn't need the intermediate value of the stacked tensor computed in the forward pass, which is similar to a linear operation, but the latter doesn't incur additional memory usage (e.g., if I change the cat in the for loop to a linear op such as y = y * 1.1, it won't increase memory consumption). So I'm wondering if the increased memory usage is essentially just an empty space allocated to hold the ``splitted'' gradient arrays in the backward pass, which has to be contiguous, so the splitting operation doesn't have to stride in memory? It follows that a linear operation doesn't need this additional memory because the memory space of the input gradient can be directly overwritten without worrying about memory contiguity. Is that right?


text:
Q: Dynamically display welcome string in "Your logo here" What I am trying to do is to dynamically display welcome string of the company name based on url the area of "Your logo here" in MVC 4 Internet applcation.
So if I am in http://aaa.com I wanna to say welcome to aaa
What I have done is to replace

@Html.ActionLink("your logo here", "Index", "Home")

to
@Html.Partial("_Company")

and in the _Company view I do @Html.RenderAction( "Company", "Home")
and in the HomeController I use
public ActionResult HospitalInfo()
        {
           var url = GetUrlMethod();
           return PartialView("_Company ", new { name = url });
        }

Can anyone please let me know if my idea is correct or not ? or can you help me to improve the method. Currently, my code does not work at all...

A: If you're only interested in a string, you don't need to spin up a separate partial view with its own controller action.  Just create a helper function, manipulate the URL in there, and then call the function directly from your View.
.cs:
public static string GetCustomWelcomeString()
{
    string customString;

    // use System.Web.HttpContext.Current.Request.Url here to do the cool stuff

    return customString;
}

.cshtml:

@MyClass.GetCustomWelcomeString()

For a more architecturally clean solution, consider pre-calculating this title in the main controller action and returning it as a model field, so the view can consume it directly using @Model.CustomWelcomeString or something like that..

A: Try using the request object:

Host is @Request.Url.Host

You can split the URL however you want, but it doesn't need to go to the controller to get it

A: I ended up to use @ViewBag.CompanyName and created a base controller which all other controllers inherated from. And create a action method in which passing the company name string into @ViewBag.CompanyName.
So far so good.


text:
Q: GWT Import Class and net.sf.jsonJSONObject I have 2 classes both in the same package. The initial compile and build was fine without any issues. Not due to requirements I am creating an object for class B in class A like.
    Class A {
    int a;
    Sting b;
    B b;

    .. all getters and setters..
}

import net.sf.json.JSONObject;
Class B {
..do JSON activities..
}

Both classes DO NOT have a gwt.xml and are not in the presentation layer. The client side classes and gwt xml are in a separate package. They are in the same package.
Now the build works when the class B object in class A is removed. When we have the object in the class, I get the error
[ERROR] Errors in 'file:......./domain/ExecutorResponse.java'
[ERROR] Line 73: No source code is available for type net.sf.json.JSONObject; did you forget to inherit a required module?
[ERROR] Unable to find type '....ReleaseReportModule'
[ERROR] Hint: Previous compiler errors may have made this type unavailable

My POM has the dependency mapped. The build was working till now. It is failing only recently after the addition of the object. I also tried adding <inherit... > in the parent gwt xml that uses these class objects, but with no luck.
What could possibly be the issue here?
My package structure is
src/main/java
|
|--com.my.pack.helper
    |
    |--both my classes are here
|
|--com.my.pack.gwt
    |
    |--contains client side classes with UIObjects and Widgets. Helper objects used here to populate the data.

src/main/resources
|
|--com.my.pack.gwt
    |
    |--widgets
        |
        |--contains the ui.xml & gwt.xml
    |
    |--common.gwt.xml

A: The issue is that you're trying to use the net.sf.json.JSONObject class on the client side, and gwt doesn't know how to translate that to javascript.
See this list for supported classes on client side.

A: I would like to suggest to use gwt-jsonwrapper in client side. If you still willing to use net.sf.json, use only in server side of your GWT project and return values as String format via RPC.
public final String getSomething() {
   JSONObject obj = new JSONObject();
   Bean bean = .....;
   obj = JSONObject.fromObject(bean);
   return StringEscapeUtils.escapeHtml(obj.toString());
}

At your client side, parse result string as
    HTML html = new HTML(result.replace(" ", "-"));
    JSONValue value = JSONParser.parseLenient(html.getText());
    JSONWrapper json = new JSONWrapper(value);
    JSONWrapper data = json.get("key");

For using gwt-jsonwrapper , add below two line in your module.xml
<inherits name="com.google.gwt.json.JSON"/>
<inherits name='com.pathf.gwt.util.json.jsonwrapper'/>


text:
Q: Only stores last input? Tkinter I want the user to type in the amount of sold tickets for every cinema. However it is only the last input that is stored in my variable "sålda". How can I fix this?
def part_of_function():

        bio1 = []

        i = 0
        for elements in BIOGRAFVAL:
            vuxen = StringVar()
            pensionär = StringVar()
            barn = StringVar()

            Label(fönster4, text= BIOGRAFVAL[i]).pack()
            Label(fönster4, text="Skriv in antal biljetter av varje sort du vill köpa").pack()
            Label(fönster4, text="Max antal platser för " + BIOGRAFVAL[i] + " är " + str(PLATSER[i])).pack()

            personer = [('vuxen',vuxen),('pensionär', pensionär), ('barn',barn)]

            for p in personer:
                sålda = välj_biograf(fönster4, p[0] + "biljett", p[1]) #välj_biograf is called*
                sålda.pack()
            i += 1

        Button(fönster4, text="fortsätt", command=lambda: info()).pack()

        def info():
            fönster5=Tk()
            fönster5.title("Biljettförsäljning för EN biograf.")
            fönster5.geometry("350x200")

            bio1.append(sålda.get())
            print(bio1)  #here is only the last element printed

            """ *code for the function "välj_biograf" that is called
            def välj_biograf(fönster, person_typ, text_variabel):
            Label(fönster, text=person_typ).pack()
            sålda = Entry(fönster, textvariable=text_variabel)
            sålda.pack()
            return sålda """

A: bio1 is a local variable inside the part_of_function function. The value of it will be lost each time the function ends and reset back to a blank list again next time the function is called.
Create the bio1 empty list outside the function (to make it global) and then use global bio inside your function so that the global variable is modified.
Also note that you should only ever have one instance of Tk() inside your code. I suspect that in your code you have more than one. If you want a new window, use Toplevel() instead
As pointed out by CoolCloud, you need to use .get on the values of personer/p
sålda = välj_biograf(fönster4, p[0] + "biljett", p[1].get())

Element 1 of the tuple p is a StringVar so you need to use .get() to get it's value.


text:
Q: i have a problem with data binding in android studio I suddenly found that my binding. <widget name> is not working.
Then I noticed that emulator dropdown selection isn't working as well.
I am attaching the screenshots of my IDE for reference.

Gradle dependencies:
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.13'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'com.jakewharton:butterknife:10.2.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'
    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation "androidx.appcompat:appcompat:1.1.0"
    implementation "androidx.appcompat:appcompat-resources:1.1.0"
    implementation "androidx.autofill:autofill:1.0.0"
    implementation "androidx.core:core:1.1.0"
    implementation 'com.google.android.material:material:1.0.0'

    implementation 'com.google.firebase:firebase-analytics:17.2.2'
    implementation 'com.google.firebase:firebase-database:19.2.0'
    implementation 'com.google.firebase:firebase-auth:19.2.0'
}

main activity code
    package com.example.myapplication.ui.activity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.lifecycle.ViewModelProvider;

import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

import com.example.myapplication.R;
import com.example.myapplication.databinding.ActivityMainBinding;
import com.example.myapplication.pojo.IncomeModel;
import com.example.myapplication.pojo.PaymentModel;
import com.example.myapplication.ui.adapter.IncomeListAdapter;
import com.example.myapplication.ui.adapter.PaymentsListAdapter;
import com.example.myapplication.ui.viewModel.IncomeViewModel;
import com.example.myapplication.ui.viewModel.PaymentViewModel;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

    private static float totalPayment;
    private static float totalIncome;

    private static boolean paymentView = true;

    PaymentViewModel paymentViewModel;
    IncomeViewModel incomeViewModel;
    ViewDataBinding binding;
    PaymentsListAdapter adapterP;
    IncomeListAdapter adapterI;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setDataBindingAndObservers();
        setMenuItem();
        paymentRecyclerView();
        incomeRecyclerView();
        setPaymentRecycler();
        setTotalSettle();
        setFabClick();

    }

    private void setDataBindingAndObservers() {
        binding = DataBindingUtil.setContentView(this, R.layout.activity_main);

        paymentViewModel = new ViewModelProvider(this).get(PaymentViewModel.class);
        incomeViewModel = new ViewModelProvider(this).get(IncomeViewModel.class);

        paymentViewModel.paymentLiveList.observe(this,paymentModels -> onPaymentLiveListChange(paymentModels));
        incomeViewModel.incomLiveList.observe(this, incomeModels -> onIncomeLiveListChange(incomeModels));

        paymentViewModel.totalPayment.observe(this,aFloat -> onTotalPaymentChange(aFloat));
        incomeViewModel.totalIncome.observe(this, aFloat -> onTotalIncomeChange(aFloat));
    }

    private void setMenuItem() {
        setSupportActionBar(binding.toolbar);
        binding.toolbar.inflateMenu(R.menu.item_menu);
        binding.toolbar.setOnMenuItemClickListener(item -> {
            switch (item.getItemId()) {
                case R.id.item_switch :
                    switchItemClicked();
                    return true;
                default:
                    return false;
            }
        });
    }

    private void paymentRecyclerView() {
        adapterP = new PaymentsListAdapter();
        binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
    }

    private void incomeRecyclerView() {
        adapterI = new IncomeListAdapter();
              binding.recyclerView.setAdapter(adapterI);
              binding.recyclerView.setLayoutManager(new LinearLayoutManager(this));
    }

    private void switchItemClicked() {
      if(paymentView) setIncomeRecycler();
      else setPaymentRecycler();
      invalidateOptionsMenu();
    }

    private void setPaymentRecycler() {
        binding.recyclerView.setAdapter(adapterP);
        paymentView = true;
    }

    private void setIncomeRecycler() {
        binding.recyclerView.setAdapter(adapterI);
        paymentView = false;
    }

    private void setTotalSettle() {
        binding.tvTotalSettle.setText(String.format("%s", totalIncome - totalPayment));
    }

    private void setFabClick() {
        binding.floatingActionButton.setOnClickListener(v -> {
            if(paymentView)paymentViewModel.getPaymentList();
            else incomeViewModel.getIncomeList();
        });
    }

    private void onPaymentLiveListChange(ArrayList<PaymentModel> paymentModels) {
        adapterP.setPaymentList(paymentModels);
    }

    private void onIncomeLiveListChange(ArrayList<IncomeModel> incomeModels) {
        adapterI.setIncomeList(incomeModels);
    }

    private void onTotalPaymentChange(float aFloat) {
        totalPayment = aFloat;
        setTotalSettle();
    }

    private void onTotalIncomeChange(float aFloat) {
        totalIncome = aFloat;
        setTotalSettle();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.item_menu, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if(item.getItemId() == R.id.item_switch) switchItemClicked();
        return true;
    }

    @Override
    public boolean onPrepareOptionsMenu(Menu menu) {
        MenuItem item = menu.findItem(R.id.item_switch);
        if (paymentView) {
            item.setTitle(R.string.item_income);
        } else {
            item.setTitle(R.string.item_payments);
        }
        return super.onPrepareOptionsMenu(menu);
    }

}

activity_main layout

<?xml version="1.0" encoding="utf-8"?>

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>

    </data>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/floatingActionButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="12dp"
            android:clickable="true"
            android:focusable="true"
            app:srcCompat="@android:drawable/ic_menu_add" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/colorPrimaryDark"
            android:paddingBottom="8dp"
            app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
            app:layout_constraintBottom_toTopOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/colorPrimaryDark"
            android:foregroundTint="#2B2B2B">

            <com.google.android.material.appbar.CollapsingToolbarLayout
                android:id="@+id/collapsing"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:contentScrim="?attr/colorPrimary"
                app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed"
                app:layout_scrollInterpolator="@android:anim/decelerate_interpolator"
                app:toolbarId="@+id/toolbar">

                <androidx.cardview.widget.CardView
                    android:id="@+id/cardView"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center|start"
                    android:layout_margin="4dp">

                    <androidx.appcompat.widget.Toolbar
                        android:id="@+id/toolbar"
                        android:layout_width="match_parent"
                        android:layout_height="?attr/actionBarSize"
                        app:title="hi!">

                        <androidx.constraintlayout.widget.ConstraintLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent">

                            <TextView
                                android:id="@+id/tv_total_settle"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="32dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginBottom="8dp"
                                android:text="@string/tv_total_payment"
                                android:textSize="@dimen/font_dim_big"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintStart_toEndOf="@+id/tv_total"
                                app:layout_constraintTop_toTopOf="parent" />

                            <TextView
                                android:id="@+id/tv_total"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginStart="16dp"
                                android:layout_marginTop="8dp"
                                android:layout_marginBottom="8dp"
                                android:text="@string/tv_total"
                                android:textSize="@dimen/font_dim_big"
                                app:layout_constraintBottom_toBottomOf="parent"
                                app:layout_constraintStart_toStartOf="parent"
                                app:layout_constraintTop_toTopOf="parent" />
                        </androidx.constraintlayout.widget.ConstraintLayout>
                    </androidx.appcompat.widget.Toolbar>
                </androidx.cardview.widget.CardView>

            </com.google.android.material.appbar.CollapsingToolbarLayout>
        </com.google.android.material.appbar.AppBarLayout>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>

edit :
1 - i have tried removing layout and data tags  ,
     and re-adding them
2- i have tried rebuilding the project

A: solved :)
this line seemed to be edited by the ide to be like this
ViewDataBinding binding;
but it should be like this
ActivityMainBinding binding;


text:
Q: How does an event differentiate between two event handlers with the same name? How does an event know which method to call when it is assigned to event handlers with the same name?
Consider the following:
    public static void ImplementExitOnEscape(Window window)
    {
        window.KeyDown += Window_KeyDown;
    }

    private static void Window_KeyDown(object sender, KeyEventArgs e)
    {
        var window = sender as Window;
        // Close window when pressing the escape key.
        if (e.Key == Key.Escape) if (window != null) window.Close();
    }

If I call ImplementExitOnEscape(this) on a window but also:
KeyDown += Window_KeyDown;

        void Window_KeyDown(object sender, KeyEventArgs e)
        {
            MessageBox.Show("Key Down");
        }

then both methods will be executed, even if they have the same name. I already know that you can assign the same event handler multiple times to an event and that the method will be called as many times as it was assigned, but how does it make the difference between two different event handlers with the same name?

A: The method names are human readable and friendly names but they have a different underlying identifier used by the .Net runtime, even if they have the same name in different classes or the same name in the same class but different arguments (i.e. overloaded).


text:
Q: edit.php didnt work and no notification / error show I have a problem with the editing data on uploaded to MySQL. I am trying to edit the name file and the descryption,but there is no data shown on the form,
here my edit.php

<title>Form Edit Data</title>

Kembali

    Edit Data

      <?php
      include "dbconfig.php";

      error_reporting(E_ALL);

      $id = (int)$_GET['id'];
      $mysql = "SELECT * FROM tbl_uploads WHERE id=$id";
      $result = mysql_query($mysql);
      $row = mysql_fetch_array($result);
      echo mysql_error();
      ?>
      <form method="post" action="update.php?">
      <input type="hidden" name="id" value="<?php  echo "$row[id]"?>">

          Nama File

            <input type="text" name="file"
        size="40" value="<?php echo "$row[file]"?>">

          Deskripsi

            <textarea input type="text" name="dekripsi"
            value="<?php echo "$row[dekripsi]"?>"> </textarea>

            <input type="submit"
          name="submit" value="Update">

      </form>

i cant get the data from what i choose, its blank form, but when i try to change the query to :
$mysql = "SELECT * FROM tbl_uploads WHERE id";

it get the data in the form, but not from what i choose, from the first id on the table (i choose the 3 id from the table) this should be fill with the data from what i choose.

A: You forgot to have a href that getting the ID:
Here is a sample code:
<a href="edit.php?id=<?php echo $row['id']; ?>" >

for your dekripsi ,  is this the name of the column in your table?


text:
Q: Setting custom directory for server files for Next.js Rather than in the root directory, I want to keep all my backend related files inside a folder named 'server'. The problem is now the frontend won't load properly as it can't find the 'pages' directory. I remember there was a way to set the directory somehow when initializing the app but I don't remember the specifics. Can someone please help me with this?
server/index.js:
const express = require('express')
const next = require('next')
const dev = process.env.NODE_ENV !== 'production'
const app = next({
  dev,
  // some config property that I don't remember
})
app.prepare().then(() => {
    const server = express()
    server.listen(3000, () => console.log('> Ready on http://localhost:3000'))
})

A: You can read from the documentation:
The next API is as follows:

next(opts: object)
Supported options:

dev (bool) whether to launch Next.js in dev mode - default false
dir (string) where the Next project is located - default '.'
quiet (bool) Hide error messages containing server information - default false
conf (object) the same object you would use in next.config.js - default {}

Then, change your start script to NODE_ENV=production node server.js.

It is dir option.


text:
Q: How to make regular expression in javascript Can anyone advise me on how to check the number is in the following format using regular expression in java script
12-1234567-123

Thanks

A: Try the following:
/^[\d]{2}-[\d]{7}-[\d]{3}$/

This roughly equates to
^ = start of string
[/d] = any number (0-9)
{n} = exactly n times
$ = end of string

Which is useable like so:
var string = '12-1234567-123';
var regex = /^[\d]{2}-[\d]{7}-[\d]{3}$/;
if (regex.test(string)) {
    //...
}

A: one possible regex for that:
var format = /^\d{2}-\d{7}-\d{3}$/

and to test:
if( format.test( number ) ){

A: you can use
/^[0-9]{2}-[0-9]{7}-[0-9]{3}$/

A: Assuming your pattern is dd-ddddddd-ddd (i.e., the actual numbers in your example aren't part of the pattern):
var num = "12-1234567-123";

if (/^\d{2}-\d{7}-\d{3}$/.test(num)) {
    alert("Number is valid");
}

A: \d{2}-\d{7}-\d{3} to match your case exactly as you quoted.
If you need to specify the numerals (ie max value of 7) replace \d{2} with [0-7]{2} etc.
A great regexp tester : RegExp example

A: hyphens should be escaped into the regexp so try this
/\d{2}\-\d{7}\-\d{3}/

A: This is a very loose RegEx.:
/\d{2}-\d{7}-\d{3}/.test("12-1234567-123")

You should give more details about edge cases.

A: use this regex string:
\d{2}-\d{7}-\d{3}

and the way to use regex match in javascript:
var isValid = /\d{2}-\d{7}-\d{3}/.test(input)


text:
Q: Connecting 2 controllers and have access to the first controllers propertie in the second controller i have a problem with angular dart. 1 html file to trigger scopes and 2 controller classes
index.html

    ...

        {{subCtrl.user.name}}

    ...
first controller
@Controller(
  selector: '[mainController]',
  publishAs: 'mainCtrl'
)
class MainController{
  User user = new User('testuser');
  MainController();
}

second controller
@Controller(
  selector: '[subController]',
  publishAs: 'subCtrl'
)
class SubController{

  @NgOneWay('user')
  User user;

  // constructor
  SubController(){
    getData();
  }

  void getData(){
    if(user != null){
      // following code is not exececutet, because user is null
      httpRequst(...);
    }
  }
}

when is the time user is set over @NgOneWay? seems like not before the constructor is finished. where do i have to call my method?
now i have the problem i have to make a asynch request in the getData function in the SubController class. this http request needs i.e the user.name propertie to build the domain, but user is not active when i start it in the constructor. i cant set the authentification to the second controller. there must be another option to get this working.
i tried several things with dart's future, but did not get i working for a propertie.

A: This used to be the AttachAware interface.
class SubController implements AttachAware {
  attach() {
    getData();
    // or new Future(() => getData()); // if the line above still doesn't work - to give Angular one additional cycle to finish
  }
}


text:
Q: Как открыть в браузере локалхост 3000 проект который делаю в React? Как открыть в браузере локалхост 3000 проект который делаю в React?
Я начала проект вчера и открыла при помощи команды npm start.
Сегодня уже не открывается.
когда я задала npx create-react-app nameProject >
то выбрала имя проекта "flowerbook"
теперь путь к package.json'npm изменился из \React_LarisaGrigoras\package.json'npm
в: React_LarisaGrigoras\flowerbook\package.json'npm
Как поменять путь и запустить проект в браузере?
Как открыть заново?
Вот что пишет в консоли
npm ERR! syscall open
npm ERR! path F:\8-AcademyRapido\7_React\React_LarisaGrigoras\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'F:\8-AcademyRapido\7_React\React_LarisaGrigoras\package.json'npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

A: убрала папку по середине и все разрешилось

A: Тоже столкнулась с такой ситуацией. Решение заключалась в вводе этих команд:

*

*cd my-app

*npm start

Оставлю ответ тут на всякий)


text:
Q: Stupid Android Layout Tricks Android Layouts have changed a bit since I've been away from the topic and I never had to get this deep into it before, so forgive what I hope is a relatively simple question.
Say you are developing a card game with a human player and 3 computer or remote opponents (not quite accurate, but close enough for my purposes). My plan is that there will be four children Layouts representing each of the player's "hands". The ones on the left and right will display their images in top down order. The ones on the top and bottom will display their images in left-to right order.
It's reasonable to assume Left and Right Layouts will have identical (gravity, right?) behavior (if different start and end pixels). Same goes for Top and Bottom. If it matters, usage will be restricted to Landscape mode.
What is the correct method of getting said childLayouts into their correct locations? What's the correct top level layout(s) to use for this? What should the player's children layouts be? (I have assumed GridLayouts, but it seemsa host of others might work too -- they will do nothing but hold a number of dynamically generated ImageViews)
Once I've got layouts in the right location, I'm good...I think.
Tx in advance

A: The answer apparently is to use the layout_width and layout_height params for a gridLayout specifying where they need to be inside of a relativeLayout (in this case I know I am using a 1200 x 600 device, but I'm sure there is a better way to go about this.
<GridLayout
        android:layout_width="500px"
        android:layout_height="100px"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:id="@+id/NORTH">
</GridLayout>

<GridLayout
        android:layout_width="500px"
        android:layout_height="100px"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:id="@+id/SOUTH">
</GridLayout>

<GridLayout
        android:layout_width="100px"
        android:layout_height="500px"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:id="@+id/WEST">
</GridLayout>

<GridLayout
        android:layout_width="100px"
        android:layout_height="500px"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:id="@+id/EAST">


text:
Q: How do I check if a facebook page exists? How do I check if a facebook page, group, or person exists using php?
Robert

A: Try with Facebook API (https://developers.facebook.com/docs/reference/php/)
$facebook->api('PAGEID or USERID here');

If not exists, facebook return false.
See https://developers.facebook.com/docs/reference/api/ for a list of sample URLs

A: Currently, if you access a not existing facebook page, you get this message:

The page you requested was not found.
  You may have clicked an expired link or mistyped the address. Some web addresses are case sensitive.

So basically you can do a:
$page = file_get_contents( 'http://www.facebook.com/no_real_page' );
$pos = strrpos( $page, 'The page you requested was not found' );
if ( $pos === true ) {
  // non existing page!
}

But be vary, the message might change and then you will get no result on that script. So better put it in a constant somewhere that you can easily change later:
# config.php
define ( FACEBOOK_ERROR, 'The page you requested was not found' );

# script.php
$page = file_get_contents( 'http://www.facebook.com/no_real_page' );
$pos = strrpos( $page, FACEBOOK_ERROR );
if ( $pos === true ) {
  // non existing page!
}

A: Facebook not supports file_get_contents Or cUrl as Dainis Abols said.
The code is useful for other websites to check anything existed or not.  But Facebook is quite differ from other websites.

<?php
$page = file_get_contents('http://www.facebook.com/pages/Studentmug/349363763205');
$pos = strrpos( $page, 'The page you requested was not found' );
echo "$page";
if ( $pos === true ) {
  // non existing page!
}
?>

A: Ok thanks to Gabriel Santos and Jeff, this is what I ended up with:
// A function to check if a facebook page exists
// and if its a personal or published page
function CheckFB($fbexist) { // $fbexist is the pageID or userID
    require_once("include/facebook.php"); // Facebook php-sdk

                // Install and Initialize
    $config = array();
    $config['appId'] = 'APP_ID/KEY';
    $config['secret'] = 'APP_SECRET';

          // Create Facebook object
    $facebook = new Facebook($config);

    try {
        $facebook->api($fbexist);
        if (!$facebook->api($fbexist)) {  // if this returns false
            $personal = "No";       // it's not a personal page
        } else {                          // or group
            $personal = "Yes";
        }

    } catch(FacebookApiException $e) {           // If there is an exception
        $checked = array(false, $personal);// the page doesn't exist
        return $checked;
    }
          $checked = array(true, $personal);
    return $checked;
}

Thanks again for your help guys :)

A: You would need the facebook_id or url of the user/group.
Then using curl, you could look for the status code returned.
404 means, it does not exist.
http://php.net/manual/en/book.curl.php


text:
Q: Как настроить маршрутизацию для двух сетевых карт с внешними ip? Имеется сервер с двумя сетевыми картами. В обе карты заходят два внешних IP (разные подсети и маски).
Как сделать, чтобы извне их можно было пинговать одновременно?
Прописываю маршрут route add -net 0.0.0.0 netmask 0.0.0.0 gw x.x.x.x dev p1p1, пинг на первую сетевую идет, на вторую — нет, и наоборот.

A: первое, что я бы порекомендовал — удалить пакет network-manager: он облегчает настройку сети в тривиальных ситуациях и лишь мешает в нетривиальных.
настройка маршриутизации для разных нетривиальных случае хорошо описана в документе, известном под названием lartc. есть и переводы на русский, например на opennet. в частности, про настройку маршрутизации для двух провайдеров написано в разделе 4.2.
есть неплохая (на вид) пошаговая инструкция по настройке балансировки между двумя провайдерами (тремя несколько разными способами).


text:
Q: Where to place templates for nested routes in Ember.js apps using pods? Where should the template files be placed for nested routes when using the pod structure in ember-cli?
Here is what I have at the moment.

*

*Visiting /foo works

*

*Expected and actual result: app/foo/template.hbs gets rendered.

*Visiting /foo/bar does not work, I get "Error: Assertion Failed: The URL '/foo/aa' did not match any routes in your application"

*

*Expected result: app/foo/bar/template.hbs gets rendered.

*Actual result: "Error: Assertion Failed: The URL '/foo/bar' did not match any routes in your application"

Router:
Router.map(function() {
    this.resource('foo', function() {
        this.resource('foo.bar', function() {
        });
    ));
    /* ... */
});

Folder Structure:
/app/pods
    /foo
        controller.js
        route.js
        template.hbs
        /bar
            controller.js
            route.js
            template.hbs

Should I be defining my routes differently or naming my files differently?

A: In the documentation page, it says "app/templates/  Your Handlebars templates. These are compiled to templates.js. The templates are named the same as their filename, minus the extension (i.e. templates/foo/bar.hbs -> foo/bar)."
Actual result: "Error: Assertion Failed: The URL '/foo/aa' did not match any routes in your application"
It is searching for /foo/bar/bar.hbs , however your case is /foo/bar/template.hbs
Naming convention is the key role of ember.js.
Route
Router.map(function() {
    this.resource('foo', function() {
        this.resource('bar', function() { // 'bar' route nested in 'foo' route

        });
    });
});

Getting Started


text:
Q: Coding Social Influence Logistic Regression I am fairly new to regression modeling and was hoping to get some help.  Forgive me if this is has been asked before, but I couldn't find anything (maybe I was using the wrong keywords)
I have a dataset where I am attempting to answer the question: How much do a Person A's friends behaviors influence Person A's willingness to do action X?  The data from the friends (predictors) looks like:
Does best friend do X? Yes/No
Does second best friend do X?  Yes/No
Does third best friend do X?  Yes/No
The outcome is Person A performing the action (Yes/No)
I was hoping to fit a logistic regression model, but  I am having trouble coming up with a way to code the predictors, however.
If I treat the predictors as separate variables, I get strange results (i.e. second friend is highly significant but not first.)  I think this is probably because there is high correlation between them?  Further, there is a fair number of observations that don't list 3 friends (~25%) which can't be used in such an analysis.
If I collapse them into one proportion (What proportion of the friends do action X?) the results are pretty clean, but I lose information about the ranking.
Does anybody have a suggestion of a way of coding that will preserve more information?  I am hoping for something that will preserve the ranking of the friends.  Thanks for the help!

A:
If I treat the predictors as separate variables, I get strange results (i.e. second friend is highly significant but not first.) I think this is probably because there is high correlation between them? Further, there is a fair number of observations that don't list 3 friends (~25%) which can't be used in such an analysis.

Looks like you're having a hard time finding the right representation. If you tried a linear combination of features, you could also try a quadratic other combinations of features (e.g friends).
Or, what if I told you that you can do this automagically?
You could train a neural network with one hidden layer. These are universal function approximators: https://en.wikipedia.org/wiki/Multilayer_perceptron
There are many implementations.

If I collapse them into one proportion (What proportion of the friends do action X?) the results are pretty clean, but I lose information about the
  ranking.

If you need to rank the features, then compute the derivative of the outputs, according to the inputs. See for example: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.54.4570&rep=rep1&type=pdf


text:
Q: Django file upload with "application/octet-stream" content-type I have a 3rd side service which making a POST request with file to my Django application.To success upload to Django application request must have 'multipart/form-data' content type but content type is 'octet-stream' in my case and Request.FILES is always empty. How can i receive file with 'octet-stream' content type in django?
request.content_type # is octet-stream
form = UploadFileForm(request.POST, files=request.FILES)
file = form.cleaned_data[file_name]

A: If anybody stuck too I found a some solution. You can just read data as bytes and then save it to file
with open(file_name, 'wb') as output:
    output.write(request.read())


text:
Q: C/C++ Configuration Problem and Execution failed for task ':runtime:buildCMakeDebug' I'm using android studio 2020.3.1, gradle 7.2. I added ninja.exe location to my path and added CMake as well to path. I'm using CMake 3.21.2
when I open the project I get one error:
C/C++ Configuration Problem
   appname.runtime | debug | x86
   Compiler exited with error code 1: C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe -xc --target=i686-none-linux-android19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -ID:/For\ Android\ Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/x86/_deps/sdl2_content-build/include -ID:/For\ Android\ Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/x86/_deps/sdl2_content-src/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -D_FORTIFY_SOURCE=2 -Wformat -idirafter D:/For Android Portierung/ags-mas... (show balloon)

and when I try to build APKs I get this error:
Execution failed for task ':runtime:buildCMakeDebug'.
> Build command failed.
Error while executing process ninja.exe with arguments {-C D:\For Android Portierung\ags-master\Android\library\runtime\.cxx\Debug\1r4n6yv3\armeabi-v7a SDL2 ags engine hidapi pe}
ninja: Entering directory `D:\For Android Portierung\ags-master\Android\library\runtime\.cxx\Debug\1r4n6yv3\armeabi-v7a'
[1/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_RLEaccel.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_RLEaccel.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_RLEaccel.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\video\SDL_RLEaccel.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_RLEaccel.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/SDL_RLEaccel.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[2/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/timer/SDL_timer.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/timer/SDL_timer.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/timer/SDL_timer.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\timer\SDL_timer.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/timer/SDL_timer.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/timer/SDL_timer.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[3/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/thread/SDL_thread.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/thread/SDL_thread.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/thread/SDL_thread.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\thread\SDL_thread.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/thread/SDL_thread.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/thread/SDL_thread.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[4/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\video\SDL_blit.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/SDL_blit.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[5/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_0.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_0.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_0.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\video\SDL_blit_0.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_0.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/SDL_blit_0.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
[6/641] Building C object _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_1.c.o
FAILED: _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_1.c.o
C:\Users\AmigoUfo\AppData\Local\Android\Sdk\ndk\21.3.6528147\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/AmigoUfo/AppData/Local/Android/Sdk/ndk/21.3.6528147/toolchains/llvm/prebuilt/windows-x86_64/sysroot -DGL_GLEXT_PROTOTYPES -DSDL2_EXPORTS -DUSING_GENERATED_CONFIG_H -D_DEBUG -D_FILE_OFFSET_BITS=64 -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-build/include" -I"D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/include" -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security  -idirafter D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos  -ID:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi  -O0 -fno-limit-debug-info  -fPIC -fsigned-char -fno-strict-aliasing -fwrapv -Wall -Wextra -Wendif-labels -Wfloat-equal -Wformat -Wformat-security -Winit-self -Winline -Wmissing-noreturn -Wpointer-arith -Wshadow -Wundef -Wwrite-strings -Wunused-result -Wno-unknown-pragmas -Wno-deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-cast-align -Wno-cast-qual -Wno-missing-declarations -Wno-switch-enum -Wno-redundant-decls -Werror=write-strings -Wbad-function-cast -Wdeclaration-after-statement -Wno-missing-prototypes -Wold-style-definition -Wstrict-prototypes -MD -MT _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_1.c.o -MF _deps\sdl2_content-build\CMakeFiles\SDL2.dir\src\video\SDL_blit_1.c.o.d -o _deps/sdl2_content-build/CMakeFiles/SDL2.dir/src/video/SDL_blit_1.c.o -c "D:/For Android Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/SDL_blit_1.c"
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/video/khronos'
clang: error: no such file or directory: 'Android'
clang: error: no such file or directory: 'Portierung/ags-master/Android/library/runtime/.cxx/Debug/1r4n6yv3/armeabi-v7a/_deps/sdl2_content-src/src/hidapi/hidapi'
ninja: build stopped: subcommand failed.

* Try:
Run with --stacktrace option to get the stack trace.  Run with --scan to get full insights.

I tried refresh linked C++ projects but it didn't help. Does anybody have some solution?


text:
Q: Media query on SearchIcon not working. Material-UI, React I've been trying to make the media query for the searchIcon in const search to work but it doesn't the other media queries are fine but this one.
I tried implementing it on const styles rather than const search and tried it in my index.css. But still, no result. I want to know what is the problem?
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import TextField from '@material-ui/core/TextField';
import SearchIcon from '@material-ui/icons/Search';
import IconButton from '@material-ui/core/IconButton';

const styles = theme => ({
  container: {
    display: 'flex',

  },

  root: {
    display: 'flex',

  },

  cssLabel: {
top:12,

    '&$cssFocused': {
      color: "#0D9DCE",
top:0,
left:0
    },
  },
  cssFocused: {},
  InputProps:{
   color: "red",

  },

  cssOutlinedInput: {
    borderRadius: 65,
    '&$cssFocused $notchedOutline': {
      borderColor: "#0D9DCE",

    },
  },

  notchedOutline: {
    borderRadius: 15,
  },
  '@media screen and (min-width: 600px) and (max-width: 950px)':{
    notchedOutline: {
      height:50,

    },
    cssLabel: {
      top:7,
          '&$cssFocused': {
            color: "#0D9DCE",
      top:0,

          }}

  },

  '@media (width: 599px)':{
    notchedOutline: {
     width:250

    },
    cssOutlinedInput: {
      width:250
    }

  },

  '@media (max-width: 599px)': {
  notchedOutline: {
height:40,
borderColor: 'white !important'
  },
  cssLabel: {
    fontSize: 12,
    top:5,

    color:"white",
    '&$cssFocused': {

    },

  },
  cssFocused: {
    color:"white",

},
  cssOutlinedInput: {
    background:"black",

    '&$cssFocused $notchedOutline': {
      borderColor: "#0D9DCE !important",

    },

  },
  },

});

const search ={
style:{
  position:"relative",
  left:0,
  top:100,
display:"flex"
},

'@media screen and (width: 599px)':{
  style:{
    left:10,
  top:100
  }
},

}

class OutlinedTextFields extends React.Component {

  handleChange = name => event => {
    this.setState({
      [name]: event.target.value,
    });
  };

  render() {
    const { classes } = this.props;

    return (

      <form className= "conT" noValidate autoComplete="off">

        <TextField
        autoFocus={true}
         fullWidth
          className={`${classes.textField} without-padding`}
        InputLabelProps={{
          classes: {
            root: classes.cssLabel,
            focused: classes.cssFocused,

          },
        }}
        InputProps={{

          classes: {
            root: classes.cssOutlinedInput,
            focused: classes.cssFocused,
            notchedOutline: classes.notchedOutline,
            MuiOutlinedInput: classes.MuiOutlinedInput
          },
        }}
        label="Search"
        variant="outlined"
        id="custom-css-outlined-input"

        >

</TextField>
<IconButton   >
        <SearchIcon style={search.style}/>
        </IconButton>
      </form>

    );
  }
}

export default withStyles(styles)(OutlinedTextFields);

A: You should two things:

*

*Use the whole each media query inside each class

*Put media query declaration inside a brace pair

const styles = {
  someClassName: {
    width: 200,
    ['@media screen and (min-width: 600px) and (max-width: 950px)']: {
      width: 100,
    },
  },
};


text:
Q: angular-ui-router: States without URL but with working back navigation In angular-ui-router, the states don't need to have an URL. See this answer.
This works fine when clicking through the UI, however, it seems that back navigation is broken that way:
http://plnkr.co/edit/kr7hyjc1q8i15vcSG9RR?p=preview
app.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
  $locationProvider.html5Mode({
    enabled: true,
    requireBase: false,
  }).hashPrefix('!');

  $stateProvider.state({
    name: 'home',
    controller: function($scope) { },
    template: '
home state loaded
 ' +
                 '

'
  });

  $stateProvider.state({
    name: 'home.foo',
    controller: function() { },
    template: '
foo state loaded
 ' +
              '

'
  });
});

Do some state transitions, then right-click in the window and choose "back" in the context menu. Instead of going back one state, the frame becomes blank.
Is there a way to have states without associated URLs, but with working pushState / history?