text:
Q: How to rotate upper body of a first person character (unity) I'm making a first person RPG game in unity. So, I have an attack animation but it only attacks what's in front of the character. How can I make the animation based off of where the player is looking (For example, if I look up, the character should attack upward instead of forward)? I've tried attaching the first person camera to the upper part of the body so it would rotate with the camera, but it causes the character's mesh to stretch and distort, and the animation doesn't even work anyway.
By the way, the character is all rigged, has different animations for walking, running, and an attack animation using Unity's mecanim. Everything else works, I'm just having trouble with this attack animation...

A: this things are mostly done by your IK solution you may wanna use a full body solver and effectors to get a semi realistic motion for these types of animation you can use final-ik it is a premade solution or you can write your own using unity`s ik system but it takes a lot of time

A: For those of you still wondering, I changed the rotation of the upper body in the LateUpdate() function. I created a variable that kept track of the last rotation done, got the user input, and just rotated the upper body based on the user input + the last rotation in LateUpdate() and updated the last rotation done. You have to always rotate the last rotation otherwise the character will spaz out and the upper body will not keep looking at the right place.


text:
Q: Is there an equivalent of Android rotation vector in iOS? With Android, there is the notion of rotation vector sensor to get the full orientation of a device in space.
Is there an equivalent with iOS? I do not want to have the screen orientation, but the full orientation of the device.

A: On iOS CoreMotion, gives you access to all the device orientation sensors.  Magnetometer and Gyroscope readings can combined manually or automatically to give you a running picture of the device orientation.

A: There is.. infact there are a few ways to do it, all rather simple:
see android documentation:
http://developer.android.com/guide/topics/sensors/sensors_motion.html
and particularly:
http://developer.android.com/guide/topics/sensors/sensors_position.html

redpajama_set_name: RedPajamaStackExchange


text:
Q: OAuth2: Which flow to use? There appears to be four distinct flows in OAuth2, i.e. (link),

*

*Authorization Code Flow - used with server-side Applications

*Implicit - used with Mobile Apps or Web Applications (applications
that run on the user's device)

*Resource Owner Password Credentials - used with trusted applications
such as those owned by the service itself.

*Client Credentials - used with Applications API access.

If I'm developing a mobile application that will consume resources from its own API, i.e., the mobile app is developed by the same team developing the API, which of the four OAuth flows should I use and how?
Given my scenario, it sounds to me like option 3 is the way to go. If this is the case, would you adopt the following process:

*

*Release you mobile app with the ClientId and ClientSecret stored on
it (deemed okay as the application is trusted).

*Ask the user to log into their account using cookie-based
authentication (immediately deleting their username and password).

*Cache the hash of their username and password returned in the
response of the cookie-based authentication.

*Use the cached username and password, along with the ClientId and
ClientSecret, to request access and refresh tokens from the token
endpoint of the OAuth server.

Doe this seem sensible? It would be good to know if I'm on the right track with the above thought process, or if I'm going something incredibly silly and ought to be doing this some other way.

A: Resource Owner Password Credentials flow would be okay for your case.
BTW, it is difficult for a mobile application to keep its client secret confidential (RFC 6749, 2.1. Client Types, RFC 6749, 9. Native Applications). Therefore, in normal cases, a client secret should not be embedded in a mobile application. In other words, embedding a client secret is almost meaningless in terms of security.

A:
2- Implicit - used with Mobile Apps or Web Applications (applications
  that run on the user's device)

If your application runs entirely on a mobile device then you are encouraged to use this flow as your mobile app can't be trusted to keep its client credentials secret.


text:
Q: class Gui_Started is public, should be declared in a file named Gui_Started.java public class Gui_Started extends JFrame{ i try to make project with notepad and debug it with cmd and I got an error for class Gui_Started is public, should be declared in a file named Gui_Started.java public class Gui_Started extends JFrame{
import javax.swing.JFrame;

public class Gui_Started extends JFrame{
    public static void main(String[] args) {

        Gui_Started gui = new Gui_Started();
        gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        gui.setSize(500,500);
        gui.setVisible(true);
        gui.setTitle("Gui Pertama");

    }
}


text:
Q: Does Agora.io for Unity provide these features? I'm a bit lost looking through all the various Agora.io modules (and not sure what it means that only some of them have Unity-specific downloads).
I want to make a Unity app where two remote phones exchange data as follows:

*

*Streaming voice in both directions

*Streaming video in one direction (recorded from device camera)

*Streaming a small amount of continuously-changing custom data in the other direction (specifically, a position + orientation in a virtual world; probably encoded as 7 floats)

The custom data needs to have low latency but does not need reliability (it's fine if some updates get lost; app only cares about the most recent update).  Updates basically every frame.
Ideally I want to support both Android and iOS.
I started looking at Agora video (successfully built a test project) and it seems like it will cover the voice and video, but I'm struggling to find a good way to send the custom data (position + orientation).  It's probably theoretically possible to encode it as a custom video feed but that sounds complex and inefficient.  Is there some out-of-band signalling mechanism I could use to send some extra data alongside/instead of a video?
Agora real-time messaging sounds like it would probably work for this, but I can't seem to find any info about integrating it with Unity (either on Agora's web site or in a general web search).  Can I roll this in somehow?
Agora interactive gaming could maybe also be relevant?  The overview doesn't seem real clear about how it's different from regular Agora video.  I suspect it's overkill but that might be fine if there isn't a large performance cost.
Could anyone point me in the right direction?
I would also consider alternatives to Agora if there's a better plugin for implementing this feature set in Unity.

A: Agora's Video SDK for Unity supports exporting projects to Android, iOS, MacOS, and Windows (non-UWP).
Regarding your data streaming needs, Agora's RTM SDK is in the process of being ported to work within Unity. At the moment the best way to send data using the Agora SDK is to use CreateDataStream to leverage Agora's ability to open a data stream that is sent along with the frames. Data stream messages are limited to 1kb per frame and 30kb/s so I would be cautious about running it on every frame if you are using a frame-rate above 30fps.


text:
Q: Integral $ \int_0^\infty \int_0^\infty \frac{e^{-(x+y)}}{x + y}\,dx\,dy $ The integral
$$
\int_0^\infty \int_0^\infty \frac{e^{-(x+y)}}{x + y}\,dx\,dy
$$
is
(A) infinite
 (B) finite, but cannot be evaluated in closed form
 (C) $1$
 (D) $2$
I have tried with integration by parts in succession and ending up with value $1/2$. But there is no such option. The correct option is (C) $1$.
Where I am going wrong?

A: Note that $\int_0^{+\infty}\frac{\exp(-x-y)}{x+y}dx=\int_y^{+\infty}\frac{\exp(-u)}{u}du=F(y)$, for $y>0$; in addition, we have that $F^{\prime}(y)=-\frac{\exp(-y)}{y}$. Now you want $I=\int_0^{+\infty}F(y)dy$.
Integrating by parts, we have $$\int_{\varepsilon}^A F(y)dy=[yF(y)]_{\varepsilon}^A+\int_{\varepsilon}^A \exp(-y)dy$$
It is clear that $\int_{\varepsilon}^A \exp(-y)dy \to \int_0^{+\infty}\exp(-y)dy=1$ if $\varepsilon\to 0$ and $A\to +\infty$. It remains to study $yF(y)$ for $y\to +\infty$ and for $y\to 0$.
a) For $y\to +\infty$: use that $\frac{\exp(-u)}{u}\leq \frac{\exp(-u)}{y}$ for $u\geq y$.
b) For $y\to 0$:
use that
$$yF(y)=y\int_y^1\frac{\exp(-u)-1}{u}du-y\log y+y\int_1^{+\infty}\frac{\exp(-u)}{u}du$$


text:
Q: AngularJS - Disable ng-click if element has specific class I have a list of li items with functions attached to them. I also have an event listener which attaches a class of "current" to whichever li item is being clicked.
HTML

5 km

10 km

25 km

50 km

100 km

Is there a way to disable the ng-click event if that specific li item has a class of "current" or is there a better way to go about this?

A: You cannot disable a list cause its not a interactive element can use ngClass to apply a specific class when disabled to make it appear disabled:

item

You can use ng-if to remove those items completely from the list:

item

item

A: If you use button tag as trigger instead of li, you can use ng-disabled directive to permit click by a condition. For example:

<button ng-click="getRadius(5)" ng-disabled="current!=5">5 km</button>

<button ng-click="getRadius(10)" ng-disabled="current!=10">10 km</button>

<button ng-click="getRadius(25)" ng-disabled="current!=25">25 km</button>

<button ng-click="getRadius(50)" ng-disabled="current!=50">50 km</button>

<button ng-click="getRadius(100)" ng-disabled="current!=100">100 km</button>

If you want, you can customize button style and you can show it like a standart text element.
.cf button {
  border: none;
  background: none;
}

A: // template

5 km

10 km

25 km

50 km

100 km

// controller
function MyController($scope) {
    $scope.clickLi = {
        5: true
    };

    $scope.getRadius = function(li_id) {
        $scope.clickLi[li_id] = true;
        console.log(li_id);
    };
}

A demo on JSFiddle.

A: Possible workaround:
If you need a single selection you can add variable into the scope specifying which row is selected and generate your list with the ng-repeat, then you can add lazy checking on ng-click if current $index is equal to selected index, you can use the same condition to apply current class with ng-class.
For example:
app.js
$scope.selected = 0;
$scope.distances = [5, 10, 25, 50, 100];

app.html

{{distance}} km


text:
Q: Eclipse - format java class/interface declaration In Eclipse, is it possible to set an order for a class/interface declarations? I'd like to have an order similar to this

*

*Constructors

*Factory methods

*Instance methods

*Static methods

*Inner classes

*Instance variables

*Static variables

*Constants

*Static initializers

So, for example, class constructors should be placed always before methods, factory methods always before instance methods, and so on.
I'd like to have something similar to Ctrl+F, which in change place all the various part of the source code in the right order.
If it is not possible, what are the alternatives?

A: Actually Eclipse has a strong format facilities. Start from the default formatting. Select you code and press Ctrl-F.
If standard formatting is not good for you you can customize it: http://www.wikihow.com/Change-the-Default-Format-Settings-in-Eclipse

A: Ok, I found a partial solution here
How to specify the order of class members when formatting in Eclipse
and here
Eclipse feature to arrange a class file?
So, I'm actually using this format under Java -> Appearance -> Members Sort Order

and to reorder the declarations inside class I'm just using Source -> Sort members.
However, the solution is only partial because I can't distinguish factory methods and constants. I can understand that can be difficult to identify factory methods; at the same time I don't think it is so difficult to identify a final declaration and sort members by them.


text:
Q: Bad state: No method stub was called from within `when()` I am trying to test my catch in my signInAnonyymous() function.  Yet, I am constantly getting the error stated in the title.
Here is my Mocked Auth class (edited for brevity):
class MockFirebaseAuth extends Mock implements FirebaseAuth {
  final bool signedIn;
  final bool isEmployee;

  MockFirebaseAuth({this.isEmployee = false, this.signedIn = false});

  @override
  Future<UserCredential> signInAnonymously() async {
  return MockUserCredential(isAnonymous: true);
  }
}

And, this is my test:
group('Sign-In-Anonymously', () {
setUp(() {
  mockFunctions = MockFirebaseFunctions();
  mockAuth = MockFirebaseAuth();
  mockCrashltyics = MockCrashlytics();
  mockFirestore = MockFirebaseFirestore();
  authRemoteService = AuthServiceFirebase(
    crashlytics: mockCrashltyics,
    firestoreService: mockFirestore,
    functions: mockFunctions,
    service: mockAuth,
  );
  authProvider = AuthProvider(authRemoteService);
});

test(
    'Should return a null AuthUser and non-null errorMessage on exception thrown',
    () async {
  when(mockAuth.signInAnonymously())
      .thenThrow(MockFirebaseAuthException('message', 'code'));
  //act
  await authProvider.signInAnonymously();
  //assert
  expect(authProvider.authUser, isNull);
  expect(authProvider.errorMessage, isNotNull);
});
});

I have researched and tried so many different ways and still can't test my catch.  Any help would be appreciated.  Thank you in advance.

A: If you're going to use 'when', you can't override the method in the mock. You need to provide an answer from the "thenAnswer".


text:
Q: How can I make this shape in html5 and css3? How can I make this shape in html5 and css3?

A:

#big {
        position: relative;
        background: black;
        width: 600px;
        height: 600px;
    }
    #in {
        position: absolute;
        background: black;
        width: 280px;
        height: 280px;
        bottom:0;
        right: 0;
        border-top: 20px solid white;
    border-left: 20px solid white;
    }


text:
Q: Bringing in Unit testing code when existing code is quite Inflexible Here is the information about my development environment:
MongoDB 3.0.0
MongoDB C# Driver Version 1.7.0.4714
Microsoft Visual Studio Professional 2013
.NET Framework 4.0
We are about to do our first production release. We developed the application using the Domain-Driven Design approach.
Unfortunately, we did Not write any unit test cases.
We haven't really adhered to proper coding practices that would allow for flexibility int the future.  For example, in the following code we have Not used an Interface for the Database connectivity, but we have just directly instantiated the Database connectivity class:
public class BLLCs_BookStore_Catalog : ICs_BookStore_Catalog
{

    public IEnumerable<ELLCsBook> GetAParticularBook(ObjectId BookIdArg)
    {
        IMongoQuery qry = Query<ELLCsBook>.EQ(l => l.Id, BookIdArg);
        return DBConnection.database.GetCollection<ELLCsBook>(TableNameConstants.BooksTableName)
                                    .Find(qry);
    }
}

Sadly , there is a tonne of code that look like the aforementioned code.
The problem is that it would take an Enormous amount of effort, time and money to just refactor existing code to use an Interfaces.  Therefore, integrating unit testing would be a real pain.
Does anyone have any suggestions as to how we could still do Unit testing?

A: I would highly suggest you to use Typemock Isolator. It allows to deal not only with interfaces, so no need to spend money and time for the refactoring.
Furthermore, it can make unit-test suggestions based on your code, so it also can save some time.
There is a good answer/example of how you can mock calls to mongo database using Typemock here.
Hope it helps!


text:
Q: Error al consultar datos heredando metodos Saludos muchachos. Estoy elaborando un proyecto en PHP Orientado a objetos con PDO, resulta que estoy haciendo las pruebas de los métodos y se me a presentado un error en la consulta por id. Procedo a explicar mi código:
Primero tengo mi clase Conexión en el cual tengo mi constructor con la conexión y dos métodos mas:
<?php namespace Models;

class Conexion{
    private $con;

    public function __construct(){

        try{
            $this->con = new \PDO('mysql:host=localhost;dbname=poo_pdo','root','');

        }catch(PDOExcepcion $e){
            echo $e->getMessage();
            exit;
        }
    }

    //Metodo para llamar la conexion y decirle que se va a ejecutar una query
    public function consultaSimple($sql){
        $this->con->prepare($sql);
    }

    //Metodo para retornar lo que se consulte
    public function consultaRetorno($sql){
        $datos= $this->con->prepare($sql);
        return $datos;
    }
}
?>

La siguiente clase es la del Estudiante. El metodo que me esta presentando problema es el que se llama view(), resulta que me esta retornando false, he impreso con var_dump y me esta mostrando false, no esta retornando nada, esta es la clase:
<?php namespace Models;

class Estudiante{

    private $id;
    private $name;
    private $edad;
    private $promedio;
    private $imagen;
    private $fecha;
    private $id_seccion;
    private $con;

    public function __construct(){
        $this->con = new Conexion();
    }

    public function set($atributo, $contenido){
        $this->$atributo = $contenido;
    }

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

    public function listar(){
        $sql = "SELECT t1.*, t2.nombre as nombre_seccion FROM estudiantes t1 INNER JOIN secciones t2 ON t1.id_seccion = t2.id";
        $datos=$this->con->consultaRetorno($sql);
        return $datos;
    }

    public function add(){
        $sql = "INSERT INTO estudiantes(id,nombres,edad,promedio,img,fecha,id_seccion)
        VALUES(null,:name,:edad,:promedio,:imagen,:fecha,:id_seccion)";
        $this->con->consultaSimple($sql);
    }

    public function delete(){
        $sql = "DELETE FROM estudiantes WHERE id = :id";
        $this->con->consultaRetorno($sql);
    }

    public function edit(){
        $sql = "UPDATE FROM estudiantes SET nombres = :name, edad = :edad, promedio = :promedio, id_seccion = :id_seccion WHERE id = :id ";
        $this->con->consultaSimple();
    }

    public function view(){
        $sql = "SELECT nombres FROM estudiantes WHERE id = :id ";
        $datos = $this->con->consultaRetorno($sql);
        $row = $datos->fetch();
        return $row;
    }

}

Como he dicho el metodo view es el que me esta dando problemas. Mediante el metodo set() le paso parametros para hacer la consulta ya que solo estoy probando. Lo hago de esta manera:
<?php

require_once "Config/Autoload.php";
Config\Autoload::run();
$est = new Models\Estudiante(); //Instancio la clase
$est->set("id", 3); //Llamo al método set de la clase y le paso los parámetros que quiero consultar
$datos = $est->view();
print $datos['nombres'];
?>

Lo que quiero hacer es consultar el estudiante con id = 3, pero como he dicho no me muestra nada en pantalla, todo en blanco y al imprimir con var_dump veo que retorna false. Necesito ayuda por favor gracias

A: No te voy a dar una solución puntualmente porque va a depender de como quieras implementar las cosas.
Documentación de Sentencias preparadas
Estás haciendo el prepare pero te faltan los bind y el execute.
Ejemplo de Conexion:
$this->con->prepare("SELECT nombres FROM estudiantes WHERE id = :id");
$this->con->bindParam(':id', $est->get('id'));
$this->con->execute();

En tu código en ningún momento especificas el valor de :id o cualquier otro parámetro. Para eso tenés que usar -es una opción- bindParam(), leé la documentación.
Por otro lado, con prepare() solo no alcanza, tenés que hacer un execute() para correr la consulta. El fetch() que hacés está bien, pero antes tenés que hacer el execute().
Ahora, el tema es como pasás los parámetros para el bind. Se podrían armar funciones bastante avanzadas como las que tienen los ORM, pero una solución sencilla sería agregar un parámetro a consultaSimple y consultaRetorno con un array de binds.
/**
 * $binds por defecto es un array vacío,
 * así que podes no pasar ese parámetro.
 */
public function consultaRetorno($sql, $binds = []) {
    $datos = $this->con->prepare($sql);
    foreach ($binds as $key => $val) {
        $datos->bindParam($key, $val);
    }

    return $datos->execute();
}

Teniendo ese método, no se que sentido tendría seguir manteniendo consultaSimple. Tené en cuenta que ninguna de tus consultaSimple se están ejecutando porque no tienen execute(). Yo las reemplazaría por consultaRetorno(), pero insisto, como no se exactamente que tenés en mente, simplemente te tiro ejemplos.
El uso sería algo así:
public function view() {
    $sql = "SELECT nombres FROM estudiantes WHERE id = :id";
    $params = [':id' => $this->get('id')];
    $datos = $this->con->consultaRetorno($sql, $params);
    $row = $datos->fetch();

    return $row;
}

Cualquier cosa avisame y vamos corrigiendo lo que haga falta. Hace bastante que no uso PDO directamente así que pueden haber errores.


text:
Q: Array Index out of Bound exception in a program for reverse of an array Here is the code to reverse an array

import java.util.*;
class middle {
    public static void main(String args[]){
        int a[]=new int[]{2,3,65,4,7,8,9};
        int c[]=new int[a.length-1];
        int k=0;
        for(int i=a.length;i>0;i++){
            c[k]=a[i];
            k++;
        }

        System.out.println("Reverse of an array");
        for(int i=0;i<c.length;i++)
            System.out.print(c[i]+"   ");
    }
}

while running gives Array index out of bound exception:7
where the code is going wrong?

A: a.length is out of bound for a
for(int i=a.length;i>0;i++)
{
 c[k]=a[i];
 k++;
}

then,
int c[]=new int[a.length-1];

you need same length array for, not length - 1 for reverse array

A: To loop through the array backwards, you need to change all three conditions in your loop, like so:
for(int i=a.length-1;i>=0;i--)
{
 c[k]=a[i];
 k++;
}

Let's take this apart:
int i=a.length-1;

You must begin at a.length-1, as arrays use 0-based indexing and a.length is out of bounds.
i>=0;

You need to iterate until i>=0, as i>0 will miss one element of your array.
i--

You need to decrement i, as the loop will always access out of bounds indexes/never terminate otherwise.
P.S. As @Jigar mentioned, you need to initialize c as int c[]=new int[a.length];.

A: you did mistake here , you need to mention the length of array a.length not a.length-1 for c and the values in for loop conditions should have like  for(int i=a.length-1;i>=0;i--) i should be decremented. : modified code is here:
int a[]=new int[]{2,3,65,4,7,8,9};
int c[]=new int[a.length];

int k=0;
for(int i=a.length-1;i>=0;i--)
{

c[k]=a[i];
k++;

}


text:
Q: submit context in loop I'm having a problem with the following code:
<t:form t:id="locationsForm" t:zone="myZone">
    <t:loop t:source="locations" t:value="location" t:encoder="locationEncoder">
        <t:textfield t:value="location.name" />
        <t:submit t:event="RemoveLocation" t:value="remove ${location.hashCode()}" t:context="${location.hashCode()}" />
    </t:loop>
    <t:submit t:value="save" />
</t:form>

Say I end up with the following buttons:
<input type="submit" name="button" id="button" value="remove 12339020">
<input type="submit" name="button" id="button" value="remove 2504658">

Clicking on either button will only ever trigger the event onRemoveLocation with the context 2504658.
I'm guessing the second submit component is overriding the event handler registered by the first, so they both end up calling the second components event handler.
I have tried setting the clientId to something unique but that did not help.
I need the remove buttons to submit the same form since the user may update the name of one element and remove the second in the same operation.
Advice appreciated, p.
(Tapestry 5.1.0.5)

A: When using Submit inside a loop with a context, you'll also need to set defer="false" to avoid this behavior:
<t:submit t:event="RemoveLocation" t:value="remove ${location.hashCode()}"
    t:context="${location.hashCode()}" t:defer="false" />

From the docs:

defer: If true (the default), then any notification sent by the component will be deferred until the end of the form submission (this is usually desirable). In general, this can be left as the default except when the Submit component is rendering inside a Loop, in which case defer should be bound to false (otherwise, the event context will always be the final value of the Loop).


text:
Q: From Newtonian systems to Lagrange mechanics using Euler - Lagrange equations I'm asking the same question here:
https://physics.stackexchange.com/questions/206758/from-newtonian-systems-to-lagrange-mechanics-using-euler-lagrange-equations
Shoud I delete the question from physics?
I am reading some notions about Lagrangian Mechanics from Holm's book.(page 12).
There is:

Every Newtonian system,
  $$m_i \ddot{q_i}=\frac{\partial V}{\partial q_i}, \mbox{  } i=\overline{1,N},$$ is equivalent to the Euler _ Lagrange equations,
$$\frac{d}{dt}\left(\frac{\partial L}{\partial \dot q}\right)-\frac{\partial L}{\partial q}=0,$$

for the Langrangian $L$ defined by:

$$L(q, \dot{q})=\sum^{N}_{i=1}{\frac{1}{2}m_{i}\|\dot{q_{i}}\|^{2}}-V(q).$$

Proof
For $L$ defined in the theorem,
$$\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q_{i}}}\right)-\frac{\partial L}{\partial q_{i}}=\ldots$$
I don't know how to derive:
$$\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q_{i}}}\right)$$
What I've tried:
$$\frac{d}{dt}{v(q)}=0$$ so I have to compute only $$\frac{d}{dt}\left(\frac{\partial L}{\partial \dot{q_{i}}}\right)$$
First of all I must to compute:
$$\frac{\partial L}{\partial \dot q_{i}}=\frac{1}{2}m_{i}\frac{\partial}{\partial \dot{q_i}}\|\dot q_{i}\|^2$$
So I have to compute the derivative for a dot product
So:
$$\frac{\partial}{\partial}\|\dot{q_i}\|^2=\frac{\partial}{\partial \dot {q_i}}\langle\dot{q_i},\dot{q_i}\rangle=\langle 1, \dot{q_i} \rangle + \langle \dot{q_i}, 1 \rangle $$
From here I got stuck...
It is ok what I have done?
thnaks for your help


text:
Q: Remote debugging in Visual Studio: VS does not send additional sources to Linux machines I want VS let me use remote debbuging on Linux machine. I have downloaded necccessary packages and tools for this goal, so, I've denoted output and build directories. Build directory is created always successfully, but next step is Makefile that is not run, because CMakeList.txt is not sent from Windows machine.

I text in Additional Sources To Copy that this file should be copied, but I cannot know a reason of unsuccessful action. Only make command notifies me that this file does not exist. I guess this problem is in Visual Studio!

A: I have solved the problem and totally sure, that these things will exactly help you out!

*

*https://developercommunity.visualstudio.com/content/problem/447310/2019-makefile-project-doesnt-copy-source-on-build.html
Fix the file
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Application Type\Linux\1.0\Linux.Makefile.targets

243 line, add this:
<Target Name="PrepareForNMakeBuild" DependsOnTargets="SetBuildDefaultEnvironmentVariables;SetUserMacroEnvironmentVariables;_RequiresRemoteConnection;_CopySources;">

*

*Never use '~' when you denote pathes on remote machine in properties of debbuging, only like
/home/machine_name/project_name/$(SolutionName)/$(USERNAME)


text:
Q: "Null filename used" error #!/usr/bin/perl

{
my $file = shift;
print $file;
require $file;
}

run as ./arg /root/perl/arg getting:
Null filename used at /root/perl/arg line 13.
Compilation failed in require at ./arg line 6.

But the file actually exists,why ??

A: You have to call your program with one command-line argument:
./getting myfilename

Otherwise you're trying to shift into a non-existent variable!
An alternative would be to refer to the argument directly and add a check:
my $num_args = $#ARGV + 1;

if ($num_args != 1)
{
  print "Error!";
  exit;
}

my $file = $ARGV[0];

A: Here's a minimal example code to reproduce your error messages. The actual error in not on the -e line, but in nullfn.pm. You're probably trying to use empty string (undef?) in require on line 13 of the included file (/root/perl/arg). The calling file (./arg) is OK.
-bash$ cat nullfn.pm
#!/usr/bin/perl -w
require "";
1;
-bash$ perl -we 'require nullfn;'
Null filename used at nullfn.pm line 3.
Compilation failed in require at -e line 1.

A: The problem is that you're doing 2 requires. You've assumed that the "Null filename" error is coming from the first one but its actually coming from the second one.
The first require is in the code you posted at line 6. It gets the value that you passed on the command line" "/root/perl/arg". The second require is in "/root/perl/arg" on line 13. This is not getting a value for some reason. When it gets no value it dies with a "Null filename" error. Then execution goes back to the require at line 6 and perl reports that "Compilation failed".
Here is a modified version of your code that explains what's happening as it goes:
$main::runcount++;
{
  print "beginning run number $main::runcount\n";
  print "\tARGV has ", scalar @ARGV, " arguments\n";
  my $file = shift;
  print "\tabout to require file `$file`\n";
  require $file;
}
1;

And here's the output when I run it with itself as the only argument:
~$ perl arg arg
beginning run number 1
        ARGV has 1 arguments
        about to require file `arg`
beginning run number 2
        ARGV has 0 arguments
        about to require file ``
Null filename used at arg line 9.
Compilation failed in require at arg line 9.

From this its clear that the "Null filename" error is generated by the second require.
For fun I ran the script passing it's own name twice:
~$ perl arg arg arg
beginning run number 1
        ARGV has 2 arguments
        about to require file `arg`
beginning run number 2
        ARGV has 1 arguments
        about to require file `arg`

Here you can see that the second run of the script is able to get a value from @ARGV. However, since "arg" was already required we don't get a third run.

A: Another way i found it to work is to give the complete path to the package in the require statement.


text:
Q: classic asp verify the server result I am trying to check or unchecked the check-boxes depends upon the data results that comes from server. But I cannot use below code correctly where I am doing wrong?
<%
Dim AFTER_SAVE, IN_VIEW, Y
Dim SQL, Data
SQL = " SELECT code, name, value FROM mytable WHERE code = '" & User & "'"
Data = Data(SQL)
%>
    <%If IsArray(Data) Then%>
         <%If ((Data(1,0) = "AFTER_SAVE") AND (Data(2,0) = "Y")) Then %>
                document.getElementById("chkSave").checked == true;
         <%End If%>
         <% If ((Data(1,0) = "IN_VIEW") AND (Data(2,0) = "Y")) Then %>
                document.getElementById("chkVIEW").checked == true;
         <%End If%>
  <%End If%>

A: You're trying to combine server-side code with client-side code in a very strange way. Sometimes, it's necessary to do that (i.e. use server-side VBScript to write client-side Javascript), but if I'm understanding your intent correctly, it's not needed here.
Basically, if this is actually a classic ASP page, then somewhere on that page you're generating the checkboxes in question. So all you need to do is put your database call somewhere before that, and then when you generate the checkboxes, you can output a checked='checked', or not, depending.
Note that I have no clue what Data = Data(SQL) is supposed to mean. There's no way for it to be valid VBScript code - parentheses are for arrays, but a string is not a valid array index, and then to assign it to itself like that? Anyway, I'm ignoring that part.

<%
Dim AFTER_SAVE, IN_VIEW
Dim SQL, RS, Conn
Dim User
'...blah blah blah, give a value to User, set up your DB connection, etc. etc....

SQL = "SELECT code, name, [value] FROM mytable WHERE code = '" & User & "'"
'- ("value" is a reserved keyword in SQL, hence the brackets)
Set RS = Server.Createobject("ADODB.Recordset")
RS.Open SQL, Conn, 1, 2 '- this is rather handwavy and unlikely to actually
'- work as-is; use the options and connection methods that make sense for you
Do Until RS.EOF
    '- I have no idea how your data is set up; this may make no sense.
    '- The idea is, read the checkbox states from your database, and
    '- stick them in variables for later reference.
    Select Case RS("name")
        Case "AFTER_SAVE" AFTER_SAVE = RS("value")
        Case "IN_VIEW"   IN_VIEW = RS("value")
    End Select
    RS.Movenext
Loop
RS.Close
Set RS = Nothing
%>

<form method="post" action="myformhandler.asp">

<input type="checkbox" name="chkSave" id="chkSave" <%
If AFTER_SAVE = "Y" Then Response.Write "checked='checked'"
%> value="Y">After save
<input type="checkbox" name="chkView" id="chkView" <%
If IN_VIEW = "Y" Then Response.Write "checked='checked'"
%> value="Y">In view

</form>


text:
Q: How do I stream a generated file for download in Rails 4? I would like for a user to be able to click a "download" link and have a file download while it's being generated. As in, the download begins immediately, even before the file generation is completed. The following code appears to stream when I request it from curl, but waits for the entire generation to finish before initiating the download when requested through firefox or chrome:
class Streamer
  def each
    1200.times do |i|
      yield i.to_s + "\n"
      sleep 0.1
    end
    yield "END\n"
  end
end

class StaticPagesController < ApplicationController

  def stream
    headers["Content-Type"] = "text/plain"
    headers["Content-disposition"] = "attachment; filename=\"test.txt\""
    headers['X-Accel-Buffering'] = 'no'
    headers["Cache-Control"] ||= "no-cache"
    #headers["Transfer-Encoding"] = "chunked"
    headers.delete("Content-Length")
    self.response.status = 200
    self.response_body = Streamer.new
  end

end

Uncommenting the transfer encoding breaks streaming for curl. I'm running:
bundle exec unicorn_rails --config-file unicorn.config.rb

and unicorn.config.rb is:
listen 3000, tcp_nopush: false, :tcp_nodelay => true

A: I know that this is an old question, but if it is useful of someone I will leave the approach I would follow.
Maybe you can use background jobs, and create a model which will store the sreamed file as well as some functional information like a the way to find it and its current startus.
class GeneratedFile < ActiveRecord
 # fields :status, :file_name, :streamed_content, :mime_type, :generation_message
 enum status: %i[processing ready error]
 validates :status, presence: true
end

class StaticPagesController
 def stream
   generating_file = GeneratedFile.create! do |file|
     file.processing!
   end
   # Supposing that this class exist and launches a background job
   BackgroundJob.execute_later(file: generating_file)
 end
end

Then inside the execution of the background job you can modify the content of the record as well as its status.

A: The example code you've posted will work with Rack 2.1.x, but will no longer stream in Rack 2.2.x due to this change in Rack::ETag and how it identifies a streaming response.
When setting the response_body to a (ducktyped) Enumerable, you now need to add this Header (to prevent Rack::ETag from preprocessing the entire Enumerable to build a digest):
headers["Last-Modified"] = Time.current.httpdate


text:
Q: Cannot update one field on firebase - Android I cannot update one field on firebase, when i do delete all the others fields of the database
CODE
        String URL_EVENT_REFERENCE = "eventmodel";
        FirebaseDatabase database = FirebaseDatabase.getInstance();
        DatabaseReference databaseEvent = database.getReference(URL_EVENT_REFERENCE);
        String key = "KTVAt0NM1Y5v32YxSqc";
        Map<String, Object> eventValues = new HashMap<>();
        eventValues.put("name", "new name");
        Map<String, Object> childUpdates = new HashMap<>();
        childUpdates.put(key, eventValues);
        databaseEvent.updateChildren(childUpdates);

This is the JSON tree, on the eventmodel y want to update the -KTVAt0NM1Y5v32YxSqc and change the name hola to new name

{
  "eventmodel" : {
    "-KTVAt0NM1Y5v32YxSqc" : {
      "info" : "",
      "limit" : 2,
      "members" : {
        "Mn7gZ7rn5XRGU1HXujbbSQv05BH2" : true
      },
      "name" : "hola",
      "pic" : "default_publish_img",
      "place" : {
        "address" : "Barcelona, España",
        "latitude" : 41.3850639,
        "longitude" : 2.1734034999999494
      },
      "status" : true,
      "timeCurrentEnd" : "7/10/2016 21:27",
      "timeCurrentStart" : "7/10/2016 20:27",
      "uidLeader" : "Mn7gZ7rn5XRGU1HXujbbSQv05BH2"
    }
  }
}

A: You are putting new empty object with only name field..
try to update only the name instead of the whole object
databaseEvent.child(key).child("name").setValue("new name");


text:
Q: Usage of System.Numerics in VS2008 Im using an open source code from EvilDicom. Unfortunately, these codes are in VS2010 and they use the namespace System.Numerics and Microsoft.CSharp. I would like to know if there are equivalents of these namespaces in VS2008? My application is built in VS2008 and hence i'm trying to build in 2008.

A: MSDN says Microsoft.CSharp namespace is available for earlier frameworks. Make sure you have added references to System.Core.dll and System.Dynamic.dll.

Where as System.Numerics Namespace is new for .net framework 4.0. Finding an equivalent depends on what you are using in that namespace. I am not sure whether there are any equivalents for BigInteger and Complex structures...

A: System.Numerics namespace was added in .net 4.0 and there is no equivalent namespace in lower versions of .net. If you have access to source code of this program and are willing to change it you could try to modify it to use IntX library as a replacement for BigInteger if license is proper.

A: The only way the System.Numerics namespace is used is in the UIDHelper class to convert a GUID to a decimal number. It essentially writes out a 16 byte integer, created from the bytes of a GUID, as a decimal number.
I don't know how important this value is. You have two options:

*

*You can replace this code with similar code that does not use the BigInteger type but is good enough for your purposes.

*You can implement the BigInteger type yourself. There are several implementations, including in the .NET Framework itself, in the J# class libraries (See http://msdn.microsoft.com/en-us/magazine/cc163696.aspx).


text:
Q: Input text in draft.js I'm doing automation test and I need to input text in a text field, but the problem is there is no 'input' to do this.
This one won't work:
document.querySelector([class*=modal-dialog] [class*=AddCitation_] [class*='DraftEditorPlaceholder']).value='Hello World'

Does any one know how to input text in draft.js?

A: You can use document.execCommand("insertHTML", "html string here", false)
As you can see draft js uses contenteditable property of div to write text
So if you want to automate tests with draftjs insert any sample html string with command
so you have a sample text in draft editor now you can perform tests
Read this
https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand

A: Let's first understand the code you have written:
document.querySelector([class*=modal-dialog] [class*=AddCitation_] [class*='DraftEditorPlaceholder']).value='Hello World'

This code attempts to:

*

*get the first element

*which has a class containing 'DraftEditorPlaceholder' and

*which has an ancestor having a class containing AddCitation_ which

*has an ancestor having a class containing modal-dialog

So, you will first need to ensure that the element you try to edit is inside an element having a class containing modal-dialog. In your screenshot we cannot see such an ancestor element, the root having a class of modal-content. If the selector you have written does not find an element, then an error will be thrown when you try to assign a value to any of its attributes, like value in this case. You have an element having a class of styles_AddCitation__3_D5j, which is the child of the element of the class of modal-content. You have an element having a class of public-DraftEditorPlaceholder-root, which, assuming that you have a class containing the modal-dialog text being its ancestor, then the selector will find it. However, this is the sibling of the element which you seem to expect to find with your query. So, you will need to sort out where you intend to put your text into.
Now, assuming that you have sorted your selector out and there is a span in the element you are talking about, you will need to write span at the end of your selector, with a space before it. Also, in this case you will need to set innerText instead of value to your desired value. If the target element is an input, then setting a value should suffice.
Another possible problem is that your Javascript code might run before the structure is actually generated, hence not being able to set attributes of elements which do not exist yet. So you will also need to make sure that your structure is in place indeed when this Javascript code runs.

A:  const screen = document.getElementById("screen");//get span ID
screen.innerHTML += `${
      this.textContent
    }`);//add text content

CALCULATOR

I used this to insert span tags into a div tag.
I'm only a beginner so it might not be optimal
I used this while experimenting with JS on a simple calculator, because I wanted to see if it could work without using an input tag.
please let me know if this helps as it will also help me to see if my understanding is good


text:
Q: Display One Record Per Week From Mysql Database I have mysql table as follows:
|id  | subject | link | week_number
------------------------------------
| 1  | ABC     | link1 | week-1
| 2  | DEF     | link2 | week-2
| 3  | GHI     | link3 | week-3
------------------------------------

Now I want To show week-1 record to user for one week after login and from his registration date as initial date for week counting....
then in next week, week-1 and week-2 should be visible,
then in next week, week-1, week-2 and week-3 records should be visible.
I am completely blank...so didn't tried any code....
your help or guideline appreciated...

A: If you have a registration date, just make your live easier and change the column week_number to days_after_reg - and the values to 7,14,21
Then you just need to compare this number with the current offset:
SELECT * from linktable WHERE `days_after_reg` <= datediff(Now(), UserRegistrationDate)

Either insert the user date with a variable, or "join" the tables.
Note that the join has no join condition here, so don't forget to filter on user-id (or name or something).
SELECT l.subject, l.link from linktable l cross join
users u WHERE `l.days_after_reg` <= datediff(Now(), u.registrationDate)
and u.id=5


text:
Q: How do I properly unwrap this json response in Python to get the data I need into a Pandas DataFrame? So, I'm working with Cisco Prime Infrastructure's API and I'm at the end of my rope. The script I'm writing is supposed to take a report from its getReport operation, decode it (not sure if that's the right word), and put it into a Pandas DataFrame. The problem is, there's junk wrapped around it. Here's an example of the response json:
{
  "mgmtResponse" : {
    "@requestUrl" : "https://localhost/webacs/api/v4/op/reportService/getReport?reportTitle=MyReport",
    "@responseType" : "operation",
    "@rootUrl" : "https://localhost/webacs/api/v4/op",
    "reportDataDTO" : [ {
      "childReports" : {
        "childReport" : [ ]
      },
      "dataRows" : {
        "dataRow" : [ {
          "entries" : {
            "entry" : [ {
              "attributeName" : "String value",
              "dataValue" : "String value",
              "displayName" : "String value"
            }, {
              "attributeName" : "Another string value",
              "dataValue" : "Another string value",
              "displayName" : "Another string value"
            } ]
          }
        }, {
          "entries" : {
            "entry" : [ {
              "attributeName" : "String value",
              "dataValue" : "String value",
              "displayName" : "String value"
            }, {
              "attributeName" : "Another string value",
              "dataValue" : "Another string value",
              "displayName" : "Another string value"
            } ]
          }
        } ]
      },
      "descriptorName" : "String value",
      "pageCount" : 15,
      "pageIndex" : 15,
      "reportDate" : "String value",
      "reportName" : "String value",
      "reportTitle" : "String value",
      "reportUrl" : "String value"
    } ]
  }
}

I want my script to only use the information nested under "dataRows", but I can't figure out what to do. So far I have this:
response = rq.get(url, auth=(cpi_user,cpi_password), verify=False, timeout = 300)
    print(response.status_code)

    if (response.status_code == rq.codes.ok):
        responseJSON = response.json()
        rogue_ap_flatten = json_normalize(responseJSON)
        print (rogue_ap_flatten)
        rogues = pd.DataFrame(rogue_ap_flatten)
        print(rogues.head(50))
        return rogues

And all I get in return is:
                               mgmtResponse.@requestUrl  ...                         mgmtResponse.reportDataDTO
    0  https://prime/webacs/api/v4/op/reportS...  ...  [{'childReports': {'childReport': []}, 'dataRo...

[1 rows x 4 columns]

I've tried using just the .text method from requests, I've tried using another json flattening library (json_flatten) with the option to exclude certain keys, and I'm considering just using sed in python somehow. It doesn't need to work for other reports, just one, so I have some leeway to specify any specific keys or whatnot. How would y'all tackle this problem?

A: You could try something like this. It just seems you are a bit confused by the format of your json response, I tried to address the structure I see below, but just take a careful look at how everything is nested.
import requests
import pandas as pd
df = pd.DataFrame()
req_session = requests.Session()
response = req_session.get('<url>')
df.append(response.json()['mgmtResponse']['reportDataDTO'][0]['dataRows'])

A: You should be able to get to just the dataRows stuff using something like this:
import json
data = {<your data>}
print(json.dumps(result['mgmtResponse']['reportDataDTO'][0]['dataRows'], indent=4))

Output
{
    "dataRow": [
        {
            "entries": {
                "entry": [
                    {
                        "attributeName": "String value",
                        "dataValue": "String value",
                        "displayName": "String value"
                    },
                    {
                        "attributeName": "Another string value",
                        "dataValue": "Another string value",
                        "displayName": "Another string value"
                    }
                ]
            }
        },
        {
            "entries": {
                "entry": [
                    {
                        "attributeName": "String value",
                        "dataValue": "String value",
                        "displayName": "String value"
                    },
                    {
                        "attributeName": "Another string value",
                        "dataValue": "Another string value",
                        "displayName": "Another string value"
                    }
                ]
            }
        }
    ]
}

A: my assumption that is you want to build a panda DF based on the incoming values. json.loads could help because "object_hook" can be used to provide custom deserializations.
import pandas as pd
import numpy as np
import json

def filter_cols(element):
    # deal with each dataRow and build your the structure that will get into the data frame
    return {
        element['attributeName']: element['dataValue'],
    }

if __name__ == '__main__':
    # from api response
    # content = json.loads(response.text)

    # doing this because I have your data in a file
    with open("data.json", "r") as read_file:
        content = json.load(read_file)

    f = pd.DataFrame.from_dict(
        json.loads(json.dumps(content['mgmtResponse']['reportDataDTO'][0]['dataRows']), object_hook=filter_cols))

A: If response has only one format then proposed previously solution result['mgmtResponse']['reportDataDTO'][0]['dataRows'] would suffice.
But if your responses differ but you could establish some rules like e.g. response json contains useful dataRows data only in nested dict's or lists then you could write some util method to recursively search for it.
Example code:
def search_for_dataRows(data):
    if "dataRows" in data.keys():
        return data["dataRows"]
    else:
        result = None
        for value in data.values():
            if isinstance(value, dict):
                result = search_for_dataRows(value)
            elif isinstance(value, list):
                for list_item in value:
                    if isinstance(list_item, dict):
                        result = search_for_dataRows(list_item)
            if result:
                return result
        return None

response_json = response.json()
search_result = search_for_dataRows(response_json)


text:
Q: Integrating Kafka with Apache Calcite I'm trying to integrate calcite with Kafka, I refrenced CsvStreamableTable.
Each ConsumerRecord is convert to Object[] using the fowlloing code:
static class ArrayRowConverter extends RowConverter<Object[]> {
    private List<Schema.Field> fields;

    public ArrayRowConverter(List<Schema.Field> fields) {
        this.fields = fields;
    }

    @Override
    Object[] convertRow(ConsumerRecord<String, GenericRecord> consumerRecord) {
        Object[] objects = new Object[fields.size()+1];
        int i = 0 ;
        objects[i++] = consumerRecord.timestamp();
        for(Schema.Field field : this.fields) {
            Object obj = consumerRecord.value().get(field.name());
            if( obj instanceof Utf8 ){
                objects[i ++] = obj.toString();
            }else {
                objects[i ++] = obj;
            }
        }
        return objects;
    }
}

Enumerator is implemented as following,one thread is constantly polling records from kafka and put them into a queue, getRecord() method poll from that queue:
public E current() {
    return current;
}

public boolean moveNext() {
for(;;) {
    if(cancelFlag.get()) {
        return false;
    }
    ConsumerRecord<String, GenericRecord> record = getRecord();
    if(record ==  null) {
        try {
            Thread.sleep(200L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        continue;
    }
    current = rowConvert.convertRow(record);
    return true;
    }
}

I tested SELECT STREAM * FROM Kafka.clicks, it works fine.
rowtime is the first column explicitly added,and the value is record Timestamp of Kafka.
But when I tried
SELECT STREAM FLOOR(rowtime TO HOUR)
AS rowtime,ip,COUNT(*) AS c FROM KAFKA.clicks  GROUP BY FLOOR(rowtime TO HOUR), ip

It threw exception
java.sql.SQLException: Error while executing SQL "SELECT STREAM FLOOR(rowtime TO HOUR) AS rowtime,ip,COUNT(*) AS c FROM KAFKA.clicks  GROUP BY FLOOR(rowtime TO HOUR), ip": From line 1, column 85 to line 1, column 119: Streaming aggregation requires at least one monotonic expression in GROUP BY clause
    at org.apache.calcite.avatica.Helper.createException(Helper.java:56)
    at org.apache.calcite.avatica.Helper.createException(Helper.java:41)

A: You need to declare that the "ROWTIME" column is monotonic. In MockCatalogReader, note how "ROWTIME" is declared monotonic in the "ORDERS" and "SHIPMENTS" streams. That's why some queries in SqlValidatorTest.testStreamGroupBy() are valid and others are not. The key method relied up by the validator is SqlValidatorTable.getMonotonicity(String columnName).


text:
Q: Where can I find a light ball for Pikachu? I would like to use a Pikachu on my team, but without a light ball it doesn't compare very well to a Raichu. Is there anyway to get one in Pokemon X and Y?

A: Catch a caterpie and evolve it to butterfree, once you have compound eyes it should be relatively easier to find a lightball since your chances increase 50% I suggest catching the pickachu since I'm not sure if fainting it with thief will get you it's item

A: In Santalune Forest, you can find wild Pikachu.  In B/W, it is a 1% chance to catch one carrying a Light Ball, but in B/W2, it is 5%.  So in X/Y, it is probably 5% as well. If the lead of the party has the ability compound eyes, it increases the chance for the Pikachu to be holding the light ball.

A: According to Serebii.net Pikachu has a 5% chance to hold a light ball (the same as Black 2/White 2).

A: I decided to do some testing out in the field with a Vivillion (Compound Eyes) and Shuppet (Frisk, Thief):

Route 3: Encounter rate too low for workable results
Santalune Forest: 1 Light Ball / 10 Pikachu
Friend Safari: 3 Light Balls / 20 Pikachu

Accounting for slight variations, we can assume a 10% chance that a Pikachu holds a Light Ball, although this is accounting for Compound Eyes.

A: For me to get a Pikachu, I just use a pokeradar and if i find a pikachu i use butterfrees compoundeyes to increase the rarity of the light ball and then i use my eevees Covet to faint the Pikachu and walk away holding a light ball. Unfortunately, it hasn't happened yet.

A: You could always just use a pokemon as bait, so that when you find a Pikachu, if it does a lot of damage, it will probably be holding a light ball!


text:
Q: how to represent distance information from 3d camera with RGB I have got a distance matrix from a 3D-sensor, how can I represent the distance information with different colors(RGB). For example, red means short range, green means medium range and blue means long range.

A: Just copy the points into a PointXYZRGB cloud, but set the r,g,b values depending on your range value. So something like:
pcl::PointCloud<pcl::PointXYZRGB>::Ptr pointCloudXYZItoXYZRGB(const pcl::PointCloud<pcl::PointXYZI>::Ptr in)
{
    pcl::PointCloud<pcl::PointXYZRGB>::Ptr out(new pcl::PointCloud<pcl::PointXYZRGB>);
    // Fill in the cloud data
    out->width = in->width;
    out->height = in->height;
    out->is_dense = false;
    out->points.resize(in->width * in->height);

    for (size_t i = 0; i < in->points.size(); ++i)
    {
        out->points[i].x = in->at(i).x;
        out->points[i].y = in->at(i).y;
        out->points[i].z = in->at(i).z;

        if (out->points[i].y > 5)
        {
             out->points[i].r = 255;
             out->points[i].g = 0;
             out->points[i].b = 0;
        } //etc
    }

    return out;
}

A: In MATLAB use colour maps. Assuming your depth data are stored in a 16-bits single channel image, use the code below.
im=imread('pathtoyourimage')
clrd=ind2rgb(im, jet(2^13))


text:
Q: It always falls in 'else' condition. (TimePicker) Good morning guys
1) I'm trying to do compare two time pickers and it's not working so well.
It always gives the same option of - else
int firstHouer =fromTimePicker.getCurrentHour();
int firstdMinute =fromTimePicker.getCurrentMinute();
int seccoundHouer = fromTimePicker.getCurrentHour();
int seccoundMinute =fromTimePicker.getCurrentMinute();

       if (firstHouer + firstdMinute < seccoundHouer + seccoundMinute)
       {
              Toast toast = Toast.makeText(getApplicationContext(), "B" , Toast.LENGTH_LONG);
              toast.show();
       }
       else
       {
              Toast toast = Toast.makeText(getApplicationContext(), "A" , Toast.LENGTH_LONG);
              toast.show();
       }

2) And I have another problem when I put the ": " symbol, the text changes it's direction
pic of the problem

A: If you want to compare relative 24 hour times, you should convert both the hour and minute components to the same unit, and then compare.  For example, to compare both using minutes:
int firstHouer = fromTimePicker.getHour();     // getCurrentHour() is deprecated
int firstdMinute = fromTimePicker.getMinute(); // getCurrentMinute() is deprecated
int seccoundHouer = toTimePicker.getHour();    // or whatever it is called
int seccoundMinute = toTimePicker.getMinute(); // or whatever it is called

if (60*firstHouer + firstdMinute < 60*seccoundHouer + seccoundMinute) {
    Toast toast = Toast.makeText(getApplicationContext(), "B" , Toast.LENGTH_LONG);
    toast.show();
}
else {
    Toast toast = Toast.makeText(getApplicationContext(), "A" , Toast.LENGTH_LONG);
    toast.show();
}

Edit: As @Dennis just pointed out, you also have a typo in your code, and you're using the same TimePicker for both sets of times, which probably is not what you want.

A: You are determining the hours and minutes twice right after each other.
The execution is so fast (evenon slow machines) that the values will hardly ever be different, only right on the switch of a minute (or hour, but in that case the else will also be triggered, because of the problem described by Tim in his answer).
If you try your code very often, you will sooner or later hit exactly the point where the first getting of minutes is different and lower than the second getting, in the same hour. Then you will hit the then part.


text:
Q: How to fix erratic column spacing in bootstrap accordion card header? I have a bootstrap 4 accordion. Each card header is a row that contains 3 columns in it. My problems is that the spacing increases between the first and second columns when the text in the second column increases in length. This is especially noticeable on card 2B that has the text "FORMS COMPLETED" in the second column. How do I make the spacing consistent and even?

                        <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapse1" aria-expanded="false" aria-controls="collapse1">

02/04/2019

Phone Call

Followed up on smart goals

                        </button>

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                        <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapse2" aria-expanded="false" aria-controls="collapse2">

01/25/2019

Interview

Took PCL-5, GAD-7, and PIL

                        </button>

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                        <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapse2B" aria-expanded="false" aria-controls="collapse2B">

01/12/2019

Forms Complete

Parents signed consent to treat, intake complete

                        </button>

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                        <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapse3" aria-expanded="false" aria-controls="collapse3">

01/10/2019

Counseling

First visit, suspected depression

                        </button>

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                        <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapse4" aria-expanded="false" aria-controls="collapse4">

02/04/2019

Phone Call

Followed up on smart goals

                        </button>

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

A

                        <button class="btn collapsed" type="button" data-toggle="collapse" data-target="#collapse6" aria-expanded="false" aria-controls="collapse6">

01/10/2019

Counseling

First visit, suspected depression

                        </button>

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

A: Your spacing is increasing because you have
 inside button, and that button is adjusting its width according to content inside it hence that button that has more text gives its width to child row and columns and
 doesn't have same width as div with same class from some other card that has different amount of text inside button.You can try putting fixed width on button with css like this
.btn{
    width:700px !important;
}

A: @Alex helped me understand that the formatting structure for the button class was interfering with the columns. To keep everything responsive, I did not use a fixed width. I removed the button style from the accordion and changed it to a link style.

02/04/2019

Phone Call

Followed up on smart goals

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

01/25/2019

Interview

Took PCL-5, GAD-7, and PIL

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

01/12/2019

Forms Complete

Parents signed consent to treat, intake complete

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

01/10/2019

Counseling

First visit, suspected depression

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

02/04/2019

Phone Call

Followed up on smart goals

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

01/10/2019

Counseling

First visit, suspected depression

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.


text:
Q: Adding/removing duplicate options from dynamically generated dropdowns with the same class using jQuery I have a demo which can be found at http://beta.acinonyxsim.com/demo. When adding base or spot markings, you are allowed to add as many as you'd like. It is my intent and wish to disable the selected marking in all generated dropdowns but the one currently being manipulated. At this time, the code works in part, but doesn't seem fully to eliminate the possibility of having more than one of the same marking. In theory, the code should disable the marking in question in all other dropdowns and return it to enabled once it has been deselcted. My code is below (I apologize for any formatting errors, I am a blind programmer):
$('div#base_markings').on('change', 'select.base_marking', function(){
    var base_marking = $(this).val();
    $('select.base_marking').not(this).find('option[value="'+base_marking+'"]').prop('disabled', true);
    $(this).find('option[value="'+base_marking+'"]').prop('disabled', false);
    processDemo();
    showColors();
   });

Any help is greatly appreciated.
Update: The demo now works as expected, only I can't seem to get the demo to reenable options removed dynamically by clicking 'Remove Base Marking' (or 'Remove Spot Marking'). Below is my code for the remove button for base markings:
   $('div#base_markings').on('click', 'button.remove_base_marking', function(){
    $('select.base_marking').each(function(){
        $('select.base_marking option[value="'+$(this).data('index')+'"]').prop('disabled', false);
        $(this).data('index', this.value);
        $('select.base_marking option[value="'+this.value+'"]').prop('disabled', false);
        $(this).find('option[value="'+this.value+'"]').prop('disabled', false);
    });
    $(this).closest('div.base_markings_options').remove();
    processDemo();
    base_marking_count --;
   });

A: This answer is to your latest problem and follows the comments in the discussion above. This code should reenable the option in each select menu that belonged to the value that was just deleted.
$('div#base_markings').on('click', 'button.remove_base_marking', function() {

  // get value of the select menu that's being deleted
  var delValue = $(this).closest('.base_markings_options').find('select').val();

  // loop through each select
  $('select.base_marking').each(function() {

    // find the option with the deleted value and remove disabled attr
    $(this).find('option[value="' + delValue + '"]').removeProp('disabled');
  });

  $(this).closest('div.base_markings_options').remove();
  processDemo();
  base_marking_count--;
});


text:
Q: svg breaking animation on rotation the codepen link
Hi everyone
I'm having issue with my cabins rotation.
they tend to go outside the wheel
    /*svg colors */

.cls-1 {
  fill: #e8f3e2;
}

.cls-2 {
  fill: #faf4a8;
}

.cls-3 {
  fill: #cac277;
}

.cls-4 {
  fill: #f3ca76;
}

.cls-5 {
  fill: #fdf387;
}

.cls-6 {
  fill: #c2e4d8;
}

.cls-7 {
  fill: #aedccd;
}

.cls-8 {
  opacity: 0.5;
}

.cls-10,
.cls-16,
.cls-17,
.cls-22,
.cls-32,
.cls-38,
.cls-39,
.cls-48,
.cls-50,
.cls-56,
.cls-9 {
  fill: none;
}

.cls-16,
.cls-17,
.cls-9 {
  stroke: #dab6c4;
}

.cls-10,
.cls-18,
.cls-19,
.cls-32,
.cls-38,
.cls-39,
.cls-48,
.cls-50,
.cls-56,
.cls-9 {
  stroke-miterlimit: 10;
}

.cls-10 {
  stroke: #e6d0d8;
}

.cls-11 {
  fill: #e7d0d8;
}

.cls-12 {
  fill: #dab6c4;
}

.cls-13,
.cls-18 {
  fill: #b5d780;
}

.cls-14 {
  fill: #9cb17e;
}

.cls-15 {
  fill: #f16a83;
}

.cls-16,
.cls-17 {
  stroke-linejoin: bevel;
  stroke-width: 2px;
}

.cls-17 {
  stroke-dasharray: 14.92 4.97;
}

.cls-18 {
  stroke: #b5d780;
}

.cls-18,
.cls-19 {
  stroke-width: 0.25px;
}

.cls-19,
.cls-21 {
  fill: #aec58b;
}

.cls-19 {
  stroke: #aec58b;
}

.cls-20 {
  fill: #7d8a71;
}

.cls-23 {
  fill: #f69eac;
}

.cls-24 {
  fill: #c38f98;
}

.cls-25 {
  fill: #816872;
}

.cls-26 {
  fill: #6d6066;
}

.cls-27 {
  fill: #806871;
}

.cls-28 {
  fill: #dbbf53;
}

.cls-29 {
  fill: #bfcf30;
}

.cls-30 {
  fill: #b29ea7;
}

.cls-31 {
  fill: #8d6876;
}

.cls-32,
.cls-48 {
  stroke: #8d6876;
}

.cls-32 {
  opacity: 0.6;
}

.cls-33 {
  fill: #d2a849;
}

.cls-34 {
  fill: #e0b24d;
}

.cls-35 {
  fill: #bf6872;
}

.cls-36 {
  fill: #f0bf53;
}

.cls-37 {
  fill: #c6c49e;
}

.cls-38 {
  stroke: #f69eac;
}

.cls-39 {
  stroke: #c38f98;
}

.cls-40 {
  fill: #c5c072;
}

.cls-41 {
  fill: #fdf164;
}

.cls-42 {
  fill: #dbedd1;
}

.cls-43 {
  fill: #b2beaf;
}

.cls-44 {
  fill: #feeb19;
}

.cls-45 {
  fill: #9998c8;
}

.cls-46 {
  fill: #fef5b1;
}

.cls-47 {
  fill: #fac1c4;
}

.cls-49 {
  fill: #bfa264;
}

.cls-50 {
  stroke: #806871;
}

.cls-51 {
  fill: #ce9d2b;
}

.cls-52 {
  fill: #c06975;
}

.cls-53 {
  fill: #e0efd3;
}

.cls-54 {
  fill: #b9e1d2;
}

.cls-55 {
  fill: #fff;
}

.cls-56 {
  stroke: #231f20;
}

.cls-57 {
  fill: #ffefb8;
}

.cls-58 {
  fill: #dfedc9;
}

.cls-59 {
  fill: #f6d695;
}

.cls-60 {
  fill: #fcd6d9;
}

.cls-61 {
  fill: #a48691;
}

.cls-62 {
  fill: #eddee3;
}

.cls-63 {
  fill: #fcf8ca;
}

.cls-64 {
  fill: #b8b2d8;
}

.cls-65 {
  fill: #eff7ea;
}

.cls-66 {
  fill: #fef7b7;
}

.cls-67 {
  fill: #fee9a0;
}

.cls-99 {
  fill: #ddd162;
}

body {max-width: 1440px;}

#needles {
  -webkit-animation: rotate 5s linear infinite;
          animation: rotate 5s linear infinite;
  -webkit-transform-origin: center;
      -ms-transform-origin: center;
          transform-origin: center;
  transform-box: fill-box;
}

@-webkit-keyframes rotate {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg)
  }
  100% {
    -webkit-transform: rotate(-180deg);
            transform: rotate(-180deg)
  }
}

@keyframes rotate {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg)
  }
  100% {
    -webkit-transform: rotate(-180deg);
            transform: rotate(-180deg)
  }
}

#arms {
  -webkit-animation: rotate-out 5s linear infinite;
          animation: rotate-out 5s linear infinite;
  -webkit-transform-origin: center;
      -ms-transform-origin: center;
          transform-origin: center;
  transform-box: fill-box;
}

@-webkit-keyframes rotate-out {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg)
  }
  100% {
    -webkit-transform: rotate(180deg);
            transform: rotate(180deg)
  }
}

@keyframes rotate-out {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg)
  }
  100% {
    -webkit-transform: rotate(180deg);
            transform: rotate(180deg)
  }
}

#cabins {
  -webkit-animation: cabin-transit 5s linear infinite;
          animation: cabin-transit 5s linear infinite;
  -webkit-transform-origin: 648.22px 301.55px;
      -ms-transform-origin: 648.22px 301.55px;
          transform-origin: 648.22px 301.55px;

}

@-webkit-keyframes cabin-transit {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg)
  }
  100% {
    -webkit-transform: rotate(180deg);
            transform: rotate(180deg)
  }
}

@keyframes cabin-transit {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg)
  }
  100% {
    -webkit-transform: rotate(180deg);
            transform: rotate(180deg)
  }
}

.cabin {
  -webkit-animation: cabin-transform 5s linear infinite;
          animation: cabin-transform 5s linear infinite;
  -webkit-transform-origin: center;
      -ms-transform-origin: center;
          transform-origin: center;
  transform-box: fill-box;
}

@-webkit-keyframes cabin-transform {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(-180deg);
            transform: rotate(-180deg)
  }
}

@keyframes cabin-transform {
  0% {
    -webkit-transform: rotate(0deg);
            transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(-180deg);
            transform: rotate(-180deg)
  }
}

#balloon,
#bunch_of_balloons1,
#bunch_of_balloons {
  -webkit-animation: balloon-anim 5s linear infinite;
          animation: balloon-anim 5s linear infinite;
  -webkit-transform-origin: center;
      -ms-transform-origin: center;
          transform-origin: center;
  transform-box: fill-box;
}

@-webkit-keyframes balloon-anim {
  0% {
    -webkit-transform: rotate(0deg) translate(0);
            transform: rotate(0deg) translate(0)
  }
  25% {
    -webkit-transform: rotate(2deg) translateY(5px);
            transform: rotate(2deg) translateY(5px)
  }
  50% {
    -webkit-transform: rotate(-2deg) translateY(-5px);
            transform: rotate(-2deg) translateY(-5px)
  }
  75% {
    -webkit-transform: rotate(-2deg) translateY(5px);
            transform: rotate(-2deg) translateY(5px)
  }
  100% {
    -webkit-transform: rotate(0deg) translate(0);
            transform: rotate(0deg) translate(0)
  }
}

@keyframes balloon-anim {
  0% {
    -webkit-transform: rotate(0deg) translate(0);
            transform: rotate(0deg) translate(0)
  }
  25% {
    -webkit-transform: rotate(2deg) translateY(5px);
            transform: rotate(2deg) translateY(5px)
  }
  50% {
    -webkit-transform: rotate(-2deg) translateY(-5px);
            transform: rotate(-2deg) translateY(-5px)
  }
  75% {
    -webkit-transform: rotate(-2deg) translateY(5px);
            transform: rotate(-2deg) translateY(5px)
  }
  100% {
    -webkit-transform: rotate(0deg) translate(0);
            transform: rotate(0deg) translate(0)
  }
}

#clouds-front {
  -webkit-animation: cloud-transit infinite ease-in-out 5s;
          animation: cloud-transit infinite ease-in-out 5s;
}

#clouds-back {
  -webkit-animation: cloud-transit-2 infinite ease-out 5s;
          animation: cloud-transit-2 infinite ease-out 5s;
}

@-webkit-keyframes cloud-transit {
  0% {
    opacity: 0
  }
  50% {
    opacity: 1;
  }
  100% {
    -webkit-transform: translateX(-5%);
            transform: translateX(-5%);
    opacity: 0;
  }
}

@keyframes cloud-transit {
  0% {
    opacity: 0
  }
  50% {
    opacity: 1;
  }
  100% {
    -webkit-transform: translateX(-5%);
            transform: translateX(-5%);
    opacity: 0;
  }
}

@-webkit-keyframes cloud-transit-2 {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    -webkit-transform: translateX(5%);
            transform: translateX(5%);
  }
}

@keyframes cloud-transit-2 {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    -webkit-transform: translateX(5%);
            transform: translateX(5%);
  }
}

A: In the following example I'm simplifying your code letting only the main wheel and the cabins.
In fact I'm using only a cabin as a symbol. All the others cabins are use elements, a copy of the symbol. This is simplifying a lot the code.
Although in the beginning I intended to use css, I think using animateMotion  is the easiest solution. In SVG <animateMotion> provides a way to define how an element moves along a motion path - in this case the path is a circle - the wheel.
Please observe that the motion path is different for each cabin. Although all the motion paths are drawing the same circle, each path starts in a different point - the point where the cabin start it's animation.
Also every <use> element has x="-17.5" y="0" so that the point by which the cabin hangs on the wheel is now in the point {x:0,y:0}.
In order to draw the wheel and the cabins I'm using javascript. If you don't want Javascript you can copy the code from the inspector.

const SVG_NS = "http://www.w3.org/2000/svg";
const SVG_XLINK = "http://www.w3.org/1999/xlink";

let cx = 648.22;
let cy = 301.55;
let r = 158.88;

let t = 0;
let a = Math.PI / 5;
for (let i = 0; i < 2 * Math.PI; i += a) {
  t++;

  let x = cx + r * Math.cos(i);
  let _x = cx + r * Math.cos(i + Math.PI);
  let y = cy + r * Math.sin(i);
  let _y = cy + r * Math.sin(i + Math.PI);
  let use = document.createElementNS(SVG_NS, "use");
  use.setAttributeNS(SVG_XLINK, "xlink:href", "#cabin");
  use.setAttribute("x", -17.5);
  use.setAttribute("y", 0);
  use.setAttribute("width", 35);
  use.setAttribute("height", 53);

  let aM = document.createElementNS(SVG_NS, "animateMotion");

  aM.setAttribute(
    "path",
    `M${x},${y}
     A${r},${r} 0 0 1 ${_x},${_y}
     A${r},${r} 0 0 1 ${x},${y}`
  );

  aM.setAttribute("repeatCount", "indefinite");
  aM.setAttribute("dur", "10s");
  use.appendChild(aM);

  cabins.appendChild(use);
}
<svg id="sky_day" data-name="sky day" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1295.87 804.79">
      <symbol id="cabin" viewBox="779.8 357 35 53">
        <path class="cls-40" d="M801.41,357.53a24.71,24.71,0,0,0-4.14-.35V361a26.34,26.34,0,0,1,2.79.15c7.3,0.88,12.21,10.6,12.14,17.29h0c0,6.77-5.32,10.87-12.26,10.74q-1.33-.06-2.67-0.06v20.1h3.83c7.51-.25,13.64-6.44,13.56-13.56V377.94C814.64,370.9,809.6,359.08,801.41,357.53Z" />
        <path class="cls-41" d="M793.13,357.53a24.71,24.71,0,0,1,4.14-.35V361a26.34,26.34,0,0,0-2.79.15c-7.3.88-12.21,10.6-12.14,17.29h0c0,6.77,5.32,10.87,12.26,10.74q1.33-.06,2.67-0.06v20.1h-3.83c-7.51-.25-13.64-6.44-13.56-13.56V377.94C779.89,370.9,784.93,359.08,793.13,357.53Z" />
    </symbol>

    <g id="wheels">
      <circle fill="none" stroke="black" cx="648.22" cy="301.55" r="158.88" />
    </g>

    <g id="cabins">
    </g>
</svg>

Here is the code without javascript:

<svg id="sky_day" data-name="sky day" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1295.87 804.79">
      <symbol id="cabin" viewBox="779.8 357 35 53">
        <path class="cls-40" d="M801.41,357.53a24.71,24.71,0,0,0-4.14-.35V361a26.34,26.34,0,0,1,2.79.15c7.3,0.88,12.21,10.6,12.14,17.29h0c0,6.77-5.32,10.87-12.26,10.74q-1.33-.06-2.67-0.06v20.1h3.83c7.51-.25,13.64-6.44,13.56-13.56V377.94C814.64,370.9,809.6,359.08,801.41,357.53Z"></path>
        <path class="cls-41" d="M793.13,357.53a24.71,24.71,0,0,1,4.14-.35V361a26.34,26.34,0,0,0-2.79.15c-7.3.88-12.21,10.6-12.14,17.29h0c0,6.77,5.32,10.87,12.26,10.74q1.33-.06,2.67-0.06v20.1h-3.83c-7.51-.25-13.64-6.44-13.56-13.56V377.94C779.89,370.9,784.93,359.08,793.13,357.53Z"></path>
      </symbol>

  <g>
    <g id="wheels">
      <circle fill="none" stroke="black" cx="648.22" cy="301.55" r="158.88"></circle>

    </g>

    <g id="cabins">
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M807.1,301.55A158.88,158.88 0 0 1 489.34000000000003,301.55A158.88,158.88 0 0 1 807.1,301.55" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M776.7566200662917,394.93732088422814A158.88,158.88 0 0 1 519.6833799337084,208.16267911577188A158.88,158.88 0 0 1 776.7566200662917,394.93732088422814" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M697.3166200662916,452.653859308974A158.88,158.88 0 0 1 599.1233799337084,150.44614069102602A158.88,158.88 0 0 1 697.3166200662916,452.653859308974" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M599.1233799337084,452.653859308974A158.88,158.88 0 0 1 697.3166200662916,150.44614069102602A158.88,158.88 0 0 1 599.1233799337084,452.653859308974" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M519.6833799337085,394.93732088422814A158.88,158.88 0 0 1 776.7566200662916,208.16267911577185A158.88,158.88 0 0 1 519.6833799337085,394.93732088422814" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M489.34000000000003,301.55A158.88,158.88 0 0 1 807.1,301.54999999999995A158.88,158.88 0 0 1 489.34000000000003,301.55" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M519.6833799337084,208.16267911577188A158.88,158.88 0 0 1 776.7566200662917,394.9373208842281A158.88,158.88 0 0 1 519.6833799337084,208.16267911577188" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M599.1233799337084,150.44614069102602A158.88,158.88 0 0 1 697.3166200662918,452.653859308974A158.88,158.88 0 0 1 599.1233799337084,150.44614069102602" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M697.3166200662916,150.44614069102602A158.88,158.88 0 0 1 599.1233799337084,452.653859308974A158.88,158.88 0 0 1 697.3166200662916,150.44614069102602" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
      <use xlink:href="#cabin" x="-17.5" y="0" width="35" height="53">
        <animateMotion path="M776.7566200662916,208.16267911577185A158.88,158.88 0 0 1 519.6833799337085,394.93732088422814A158.88,158.88 0 0 1 776.7566200662916,208.16267911577185" repeatCount="indefinite" dur="10s"></animateMotion>
      </use>
    </g>
  </g>

</svg>


text:
Q: Impedance matching for push-pull RF amplifier I am working on the output matching network of a commercial push-pull class AB amplifier based on LDMOS BLF188. The output matching network consists of a 1:4 transformer and a Toroid with 8 turns The secondary of the transformer will be connected to a 50-ohm load/antenna. The matching network works comparatively well up to 70 MHz. I am trying to modify the network to work up to 600 MHz.As of my understanding is the core material is the restricting factor to work at the desired frequency range. I would appreciate any suggestion regarding how can I achieve good output matching up to 600 MHz. Is there an alternative way to design the output matching network with lumped elements for the push-pull configuration?
Thanks in advance.

A: Going to a transmission line transformer will help extend the bandwidth, but probably not to 600MHz!
The issue is that for a transmission line transformer (Or balun) to work well at high frequency the lines must be electrically short at that frequency, while for the thing to work well at low frequency you need the ferrite to add magnetising inductance, achieving both is hard (Above maybe 100MHz you will find that a transmission line transformer works just fine without any ferrite at all).
Further, above maybe 60MHz or so the device parasitics start to become a real pain, and narrowband matching that can tune these out becomes somewhat desirable, you can build a broadband VHF/UHF amp, but it is always going to be a compromise, and a HF/VHF/UHF amp from a single device is really stretching it.
Consider for example that the gate impedance generally falls with frequency (at least until the leadout inductance becomes dominant), at HF it is high enough that a swamped gate design works, but eventually the gate impedance becomes annoyingly low, and a narrowband match with an L network becomes the way to play (You could transformer your way down to very low Z and do a swamped gate design but gain would be very low because all the drive would be winding up in your swamping resistors without developing much voltage at the actual gate.  Similar considerations apply to the drain match.

A: You can match the output with transmission lines and/or air cored transformers, and there are plenty of circuits you can use or adapt. But your main problem is going to be matching the input to the gate. At 600MHz, you are going to need several watts into maybe just a couple of ohms, with an inductive reactance doing its best to stop you. Good luck with that.


text:
Q: NSScrollView printing inverted on OSX Mavericks I have a Mac app that has been on the app store for a few years. It's a time tracking and invoicing app that creates a PDF for the invoice. The PDF is generated from the content of a window in the app that contains the invoice information. Before OSX Mavericks the PDF printed just as it looked like on screen. Unfortunately in Mavericks, the NSScrollView that I am using for the table is printing horizontally inverted.
PDF as it should look, and how it looked on OSX Lion and Mountain Lion:

PDF as it prints out on Mavericks:

When I searched the Google for this problem I did find another person experiencing what seems to be the same problem.
The NSScrollView is nothing fancy, just an NSScrollView with an NSClipView as its contentView, and an NSTableView inside of that.

I'm really hoping that this is a problem that can be fixed, and not just a bug introduced by Mavericks when printing NSScrollViews. Thanks for any help!

A: Well, I wouldn't say I found a fix for this, but I was able to make this work normally again. I accidentally found that if I put another identical table in the same view hierarchy as the existing one and hid the new table, the first one would print correctly. Don't ask me why it works, because it feels like some serious cargo-culting, but it made the table inversion go away. I hate these kinds of "fixes".


text:
Q: How to replace arrays in file using bash? I have a file like this:
# [...]

ver=1.0
source_x86_64=("file-$ver.tar.gz" "file-$ver.tar.gz.sig")
source_i386=("file-$ver.tar.gz")
sha256sums_x86_64=("54842def55267131a12494cd6d23243df1fa3eee60dd418f0a84737f1feafc28"
                   "SKIP")
sha256sums_i386=("c453479cbada5139cc3f494f9e72f192451780c7d936d7aa15be99c48deb4237")

# [...]

I need to update the hashes each time a new version is released. I can run a program that downloads the three files and generates the sha256sum for each of them:
For instance makepkg -gA with "ver=1.1" outputs
sha256sums_x86_64=('82cfaef1f73748a0f814dd06eee3af1fd34232d6dc49421a13176255fed24845'
                   'SKIP')
sha256sums_i386=('7324bed84c99eb51aa7d639d7c087154291f27e9f494f3cc9315adabc974354c')

How I can overwrite the arrays in the original file, possibly keeping the same position, without appending the program output to the end and deleting the original arrays?
Note that the first array spans multiple lines and that arrays in the file may differ in size from the ones in the program output (e.g. if a file has been added to the source array and the hash array in the file has not been updated accordingly).


text:
Q: Pligg is built upon what framework, if any? I am trying to modify a Pligg site but the conventions sound too alien too me, So I am wondering which php framework, if any, should I known to start deciphering the Pligg templating language?

A: Pligg isn't built on any of the known php frameworks.

A: To be more exact, "Pligg uses a variation of the Smarty template engine, called Template Lite". (reference) However, I am still not sure how much different they are.


text:
Q: Open SSH tunnel during PostGIS Docker build How to open an SSH tunnel during the build process of PostGIS container build?
I need to SSH tunnel to database, so I can create dump, then restore in container.
With other docker containers, I usually create a startup.sh then run from Dockerfile.  However, to run startup scripts in PostGIS container we need to add the script to /docker-entrypoint-initdb.d folder.
The problem with this is, the script runs as user postgres with a user id of 999.  I need to run as root with userid of 0 to execute ssh commands.

 Instructions run from the Dockerfile execute under the root user, but again once the scripts are run from /docker-entrypoint-initdb.d, they are run under the postgres user.

 If I run docker exec -it postgis_container bash, I am in bash as the root user and I can execute all the commands I need.  However, I do not want to do this.  I want to just execute docker-compose up and allow the docker compose configurations, the Dockerfile and possible any startup script to do the rest.
I know I can install OpenSSH and run tunnel from Dockerfile but connecting to a server the first time brings up the known_host prompt.  I can user ssh-keyscan -H some_server >> /root/.ssh/known_hosts or even make a volume from the host machine of my ~/.ssh folder, that containers working a known_host file but the error I get is:
Dockerfile
RUN echo "Install OpenSSH \n" \
&& apt-get -y update \
&& apt-get install -y openssh-client \
&& echo "Config SSH \n" \
&& mkdir /root/.ssh && touch /root/.ssh/id_rsa-dev \
&& chmod 700 /root/.ssh/id_rsa-dev \
&& touch /root/.ssh/known_hosts \
&& touch /root/.ssh/config \
&& ssh-keyscan -H some_server.com >> /root/.ssh/known_hosts \
&& echo "Tunnel to DB \n" \
&& ssh -N -L 9001:some_other_server.com:5432 some_user@some_server.com -i /root/.ssh/id_rsa-dev & \
&& echo "Setup for dump and restore \n" \
&& cd /root/dump \
&& date_today=$(date +%F) \
&& echo "Createing dump file from dev db name = dev_db_$date_today.sql" \
&& export PGPASSWORD=${DEV_DB_PASSWORD} \
&& pg_dump -Fc -v -U dbuser -d dev_db -p 9001 -h 0.0.0.0 > ./dev_db_$date_today.sql \
&& export PGPASSWORD=$POSTGRES_PASSWORD \
&& echo "Restoring db" \
&& pg_restore -Fc -v -U dbuser -d dev_db_docker_local ./dev_db_$date_today.sql

Error from output
0.335 Warning: Permanently added the ECDSA host key for IP address '111.222.333.444' to the list of known hosts.
#0 0.418 Authorized uses only. All activity may be monitored and reported.
#0 0.418 Load key "/root/.ssh/id_rsa-dev": invalid format
#0 0.418 some_user@some_server.com: Permission denied (publickey).

However, again, if I run docker exec -it postgis_container bash, then execute the exact same commands, I am able to open the ssh tunnel, dump and restore.
startup.sh
#!/usr/bin/env bash
cho "Install OpenSSH
apt-get -y update
apt-get install -y openssh-client
echo "Config SSH
mkdir /root/.ssh && touch /root/.ssh/id_rsa-dev
chmod 700 /root/.ssh/id_rsa-dev
touch /root/.ssh/known_hosts
touch /root/.ssh/config
ssh-keyscan -H some_server.com >> /root/.ssh/known_hosts
echo "Tunnel to DB
ssh -N -L 9001:some_other_server.com:5432 some_user@some_server.com -i /root/.ssh/id_rsa-dev &
echo "Setup for dump and restore
cd /root/dump
date_today=$(date +%F)
echo "Createing dump file from dev db name = dev_db_$date_today.sql"
export PGPASSWORD=${DEV_DB_PASSWORD}
pg_dump -Fc -v -U dbuser -d dev_db -p 9001 -h 0.0.0.0 > ./dev_db_$date_today.sql
export PGPASSWORD=$POSTGRES_PASSWORD
echo "Restoring db"
pg_restore -Fc -v -U dbuser -d dev_db_docker_local ./dev_db_$date_today.sql

I would prefer to be able to run my startup.sh script from /docker-entrypoint-initdb.d folder as a root user.  But If I can not, then would like to be able to added all the steps to Dockerfile
Any help would be greatly appreciated.

Note:
I asked a question here.
I was trying to find out how to get my startup script to run as root, but realized the question did not give enough context so I created this post.  I mention this because setting user root or 0, wether in the Dockerfile or the docker-compose.yml does not solve my problem.
If I try to run startup.sh from /docker-entrypoint-initdbd:
sudo is not available.  su is available, but I do not know root password. gosu is available but when I used that it give an error along the lines of operation not permitted.
Update 1:
Seems like this is an issue.  The postgres docker github says you can not run as root from /docker-entrypoint-initdb.d.
https://github.com/docker-library/postgres/issues/973
But something seems weird about that.  I figure there has got to be a way around this.  Or maybe some best practice that address this use case.  I imagine I am not the only one who has run into an issue like this.
Update 2:
I just realized running the commands in Dockerfile will not work because postgres would not have been started yet.  And I need to run psql after I open the tunnel.  So I have to run from /docker-entrypoint-initdb.d folder or figure out some way to get startup.sh to run after postgis container finishes its default start up processes.
Appearently this was not a problem a few years ago, but I believe there was a move to stop the use of root access during the build start up process in the /docker-entrypoint-initdb.d for security reasons.  But there was no suggested work around.


text:
Q: "Call to undefined function" in WordPress I ran into problem but I couldn't resolve the issue. I read so many post and reset WordPress and using Xampp. I don't know why everything is messed up. Build system even not showing php in sublime text 4.
When I ran my local host it gives:
.
My theme folder is here. I know there are questions have been asked but they are somehow different.

<?php bloginfo('name') ?>

A: This is because you're accessing your theme files from the browser. I can see from your URL that you're accessing your theme index.php file directly. This is bypassing WordPress and the functions it makes available to you.
Ensure your custom theme is active within the WordPress admin area, and then visit your WordPress website url: http://localhost/warda/wordpress/. This will load WordPress and then WordPress will load your theme. You should no longer have the error.

For example, suppose you have an index.php file that contains:
<?php

function custom_function() {
    echo 'Hello, World!';
}

require __DIR__ . '/extra.php';

And an extra.php file that contains:
<?php

custom_function();

If you open index.php in the browser it will register a function called custom_function, then load extra.php and then execute the function. It will output Hello, World.
If you open extra.php in the browser, it will attempt to execute custom_function, but because it has not been defined yet, it will throw an "undefined function" error.
This is essentially what is happening with your WordPress theme.