text:
Q: Nonlinear transformation applied on decorations along path with a custom pic I am having a problem to apply a single nonlinear transformation to a path decorated with custom pics. A minimal example follows:
\documentclass[margin=5pt]{standalone}

    \usepackage{tikz}
        \usetikzlibrary{decorations.markings}
        \usetikzlibrary{shapes}
        \usepgflibrary{curvilinear}
        \usepgfmodule{nonlineartransformations}

\begin{document}

    \tikzset{
        cell/.pic={
            % Shading for the endothelial cells
            \pgfdeclareradialshading{centred}{\pgfqpoint{0bp}{0bp}}{%
                color(0bp)=(white);
                color(10bp)=(red!10!white);
                color(20bp)=(red!20!white);
                color(30bp)=(red!30!white);
                color(100bp)=(red)
            }

            \node[%
                draw,
                rounded rectangle,
                inner xsep=0.24cm,
                inner ysep=0.075cm,
                shade,
                shading=centred,
                ultra thin
            ]   at (0,0) {};

        }
    }

    \begin{tikzpicture}

        \def\wallSideStartX{0}
        \def\wallSideLength{15cm}

        \coordinate (origin) at (\wallSideStartX,0);

        \def\thickness{1.50cm}

        % Start nonlinear transformation
        \pgfsetcurvilinearbeziercurve
        {\pgfpointxy{0}{0}}{\pgfpointxy{10}{0}}
        {\pgfpointxy{20}{5}}{\pgfpointxy{20}{15}}
        \pgftransformnonlinear{\pgfgetlastxy\x\y%
        \pgfpointcurvilinearbezierorthogonal{\x}{\y}}%

        \draw[%
            fill=red
        ]   (origin)
            rectangle
            ++(\wallSideLength,\thickness);

        \path[%
            postaction=decorate,
            decoration={%
                markings,
                mark=between positions 0 and 1 step 5mm with{%
                    \pic[%
                        %scale=0.7,
                        sloped,
                        transform shape
                    ]   {cell};
                }
            }
        ]   (\wallSideStartX,0.5*\thickness)
            --
            ++(\wallSideLength,0);

    \end{tikzpicture}
\end{document}

This code compiles to the following image:

The same transformation is affecting somehow differently the decorations and the actual path underlining it. Ideally, I want that the decoration to follow the rectangle too.
I am not very experienced with nonlinear transformations in TikZ, so I suppose it could be some interaction of it with pics and decorated paths that I am not aware of and, so far, I could not find anything that could solve it. Could someone help me with a solution for it? Thanks a lot!

A: I propose the following solution to your problem: I have positioned the image of the endothelial cell along a path. Play with the positions if the chain is not placed correctly.
\documentclass[margin=5pt]{standalone}

    \usepackage{tikz}
        \usetikzlibrary{shapes}
        \usepgflibrary{curvilinear}
        \usepgfmodule{nonlineartransformations}

\begin{document}

    \tikzset{
        cell/.pic={
            % Shading for the endothelial cells
            \pgfdeclareradialshading{centred}{\pgfqpoint{0bp}{0bp}}{%
                color(0bp)=(white);
                color(10bp)=(red!10!white);
                color(20bp)=(red!20!white);
                color(30bp)=(red!30!white);
                color(100bp)=(red)
            }

            \node[%
                draw,
                rounded rectangle,
                inner xsep=0.24cm,
                inner ysep=0.075cm,
                shade,
                shading=centred,
                ultra thin
            ]   at (0,0) {};

        }
    }

    \begin{tikzpicture}

        \def\wallSideStartX{0}
        \def\wallSideLength{15}

        \coordinate (origin) at (\wallSideStartX,0);

        \def\thickness{1.5}

        % Start nonlinear transformation
        \pgfsetcurvilinearbeziercurve
        {\pgfpointxy{0}{0}}{\pgfpointxy{10}{0}}
        {\pgfpointxy{20}{5}}{\pgfpointxy{20}{15}}
        \pgftransformnonlinear{\pgfgetlastxy\x\y%
        \pgfpointcurvilinearbezierorthogonal{\x}{\y}}%

        \draw[%
            fill=red
        ]   (origin)
            rectangle
            ++(\wallSideLength,\thickness);

        % added: chain of endothelial cells
        % space at the beginning: .033
        \foreach \i in {.02,.053,...,.683} {
            \path (\wallSideStartX,.5*\thickness)
                -- pic[pos=\i] {cell}
                ++(\wallSideLength,0);
        }
        % space at the end: .03
        \foreach \i in {.71,.74,...,1} {
            \path (\wallSideStartX,.5*\thickness)
                -- pic[pos=\i] {cell}
                ++(\wallSideLength,0);
        }
    \end{tikzpicture}
\end{document}

Edit: I have tried to slope the cells along the way. Does this fit your needs or is the shape of the endothelial cells not correct but (very) important for you? As before, play with the individual parameters.
\documentclass[margin=5pt,tikz]{standalone}

\usepgflibrary{curvilinear}
\usepgfmodule{nonlineartransformations}

\begin{document}
    \begin{tikzpicture}[
        cellRectangle/.pic={
            % The option 'rounded corners' does not work, because the geometric figure is too small!
            \draw[%
                outer color=red!30!white,
                inner color=white,
                ultra thin] (0,0)
                            rectangle
                            (.5,.15);
        }
    ]
        \newcommand\wallSideStartX{0}
        \newcommand\wallSideLength{15}
        \newcommand\thickness{1.5}

        \coordinate (origin) at (\wallSideStartX,0);

        % Start nonlinear transformation
        \pgfsetcurvilinearbeziercurve
        {\pgfpointxy{0}{0}}{\pgfpointxy{10}{0}}
        {\pgfpointxy{20}{5}}{\pgfpointxy{20}{15}}
        \pgftransformnonlinear{\pgfgetlastxy\x\y%
        \pgfpointcurvilinearbezierorthogonal{\x}{\y}}%

        \draw[%
            left color=red!70,
            right color=red!80,
        ]   (origin)
            rectangle
            ++(\wallSideLength,\thickness);

        % endothelial cells
        \foreach \i in {0.01,.046,...,.97} {
            \path (\wallSideStartX,.425*\thickness)
                -- pic[pos=\i] {cellRectangle}
                ++(\wallSideLength,0);
        }
    \end{tikzpicture}
    \begin{tikzpicture}[
        cellEllipse/.pic={
            \draw[%
                outer color=red!30!white,
                inner color=white,
                ultra thin] (0,0)
                            ellipse
                            (.25cm and .14cm);
        }
    ]
        \newcommand\wallSideStartX{0}
        \newcommand\wallSideLength{15}
        \newcommand\thickness{1.5}

        \coordinate (origin) at (\wallSideStartX,0);

        % Start nonlinear transformation
        \pgfsetcurvilinearbeziercurve
        {\pgfpointxy{0}{0}}{\pgfpointxy{10}{0}}
        {\pgfpointxy{20}{5}}{\pgfpointxy{20}{15}}
        \pgftransformnonlinear{\pgfgetlastxy\x\y%
        \pgfpointcurvilinearbezierorthogonal{\x}{\y}}%

        \draw[%
            left color=red!70,
            right color=red!80,
        ]   (origin)
            rectangle
            ++(\wallSideLength,\thickness);

        % endothelial cells
        \foreach \i in {.025,.06,...,.99} {
            \path (\wallSideStartX,.5*\thickness)
                -- pic[pos=\i] {cellEllipse}
                ++(\wallSideLength,0);
        }
    \end{tikzpicture}
\end{document}


text:
Q: Hide changesets from merge dialogs in TFS 2008 (2010)? When merging from one branch to another, we can see which changesets are present in one branch, and yet not merged over to the other.
Some of these changesets aren't supposed to be merged. Is it possible to hide these?
Or do we just have to edit the changeset comments to include a prefix, like "NOMERGE:", to visually filter them out?
The reason I ask is that from time to time a developer forgets to merge changes that were supposed to be merged, and it's a bit hard to find these in a forest of other changesets.

A: This is a strange question, why are some changesets not supposed to be merged and how do you determine those. If you are doing selective merges to me it looks like the branches are not created properly. I don't think you can hide changesets using Visual Studio. Using TF.exe command line application however you can find out what changesets are candidates in a merge and then merge individual changesets selectively see http://msdn.microsoft.com/en-us/library/bd6dxhfy.aspx

A: You can use the TF MERGE /DISCARD option
http://blogs.msdn.com/b/mohamedg/archive/2009/03/09/how-to-use-tf-merge-discard.aspx

redpajama_set_name: RedPajamaStackExchange


text:
Q: Vue standalone component getting Unknown custom element on custom tags I have a template in a standalone Vue component that is inserted into a liquid file. In order to avoid styling conflicts I've decided to create custom tags, as in my case an iFrame does not work.
These tags ARE NOT components, they are simply replacements for div span and other standard HTML tags that carry unique styling that I am trying to avoid. Also I've tried all: unset and similar CSS hacks to no effect. I need these tags.
However, I'm now getting the following warning:
Unknown custom element: <freshie-div> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
As these are not components, I'm not real sure how to get rid of this warning. The warning is important to be removed because customers will see the warning and lose their minds.
Here is some of the condensed code:
  template:
`
<freshie-div :style="divStyle">
  <freshie-div :style="buttonContainer" v-if="displayLauncherButton">
    <freshie-button
      :style="buttonStyle"
      @click="openCreditPanel()"
    >\${ returnLauncherText }</freshie-button>
  </freshie-div>
 `

Nothing especially crazy, other than the custom tags.
EDIT:
I am creating my component with Vue.component('freshie', { instead of Vue.createApp({
And it seems like because of that this isn't working:
  components: {
    'freshie-div': 'div',
    'freshie-span': 'span',
    'freshie-button': 'button'
  },

I'm getting the following error: Invalid Component definition: button

A: Vue 3
You could register those components as aliases to the native elements:
const app = Vue.createApp({
  template: `<freshie/>`
})

app.component('freshie', {
  components: {
    'freshie-div': 'div',
    'freshie-h1': 'h1',
    'freshie-button': 'button'
  },
  template: `<freshie-div>
    <freshie-h1>Hi there</freshie-h1>
    <freshie-button @click="onClick">Click</freshie-button>
  </freshie-div>`,
  methods: {
    onClick() {
      alert('hello world')
    }
  }
})

app.mount('#app')

demo 1
Vue 2
In Vue 2, the alias must be done with a template option:
Vue.component('freshie', {
  components: {
    'freshie-div': { template: `<div v-on="$listeners" v-bind="$attrs"><slot/></div>` },
    'freshie-h1': { template: `<h1 v-on="$listeners" v-bind="$attrs"><slot/></h1>` },
    'freshie-button': { template: `<button v-on="$listeners" v-bind="$attrs"><slot/></button>` },
  },
  template: `<freshie-div>
    <freshie-h1>Hi there</freshie-h1>
    <freshie-button @click="onClick">Click</freshie-button>
  </freshie-div>`,
  methods: {
    onClick() {
      alert('hello world')
    }
  }
})

new Vue({
  template: `<freshie/>`
}).$mount('#app')

demo 2

A: You can try to add the v-pre directive to the custom tags as pointed out here: Vue ignore custom component tag
But be aware that this prevents rendering of all vue elements in the custom tags: https://vuejs.org/api/built-in-directives.html#v-pre
Unfortunately I see no way to get rid of the warning without using regular tags or real vue components.


text:
Q: Compile fails in snapshot view I am trying to compile under a ClearCase snapshot view but my compile fails because all the makefiles point the root used by dynamic views.
Is there a way to go around this?

A: Basically what you need is to make sure your makefiles are only using path relatives to the root directory of your view, and aren't using the full path.
The other option, if you absolutely need a full path, would be to link the root directory of your snapshot or dynamic view to a specific unique (and common across all users) driver letter.


text:
Q: Create proper pdf file for printing with wkhtmltopdf In docs of wkhtmltopdf I cannot find any hint about how to change the print border. I've marked it with a green line in the image below.
I have
body {
    margin:0px;
    padding:0px;
}

and all tables are 100% in width. The wrapper around the tables is 26cm in width.
Any ideas how to reduces the white spaces around the content?

A: This is a very complicated issue with wkhtmltopdf. Getting absolutely 100% wide content is afaik impossible, you always wind up with (less than 1mm) borders on the right and the bottom currently. I would suggest playing around with the settings to see which way you could get it to work for you. I would Love to see how you progress with this issue (Also to see if there are other print issues like CMYK battles).
What is your wkhtmltopdf command used to conver the file; have you specified margins there? Try a command like wkhtmltopdf.exe -B 0 -R 0 -L 0 -T 0 content.html 3.pdf. You might also want --disable-smart-shrinking.
With content like

MAGICAL PONIES

bla

You get output like

Good luck, have fun :)


text:
Q: Por que o código dessa atividade não consegue iniciar a ativivdade seguinte? A atividade mostra o botão, mas quando clico nada acontece
package com.example.conjuradortormenta;

import android.app.ActionBar;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

public class ListadePersonagens extends AppCompatActivity implements View.OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_listade_personagens);

        LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(LinearLayout.VERTICAL);

        // Através de shared preferences, pegamos as informações dos personagens que já foram criados
        SharedPreferences informaçõesdepersonagem = getSharedPreferences("com.example.conjuradortormenta_informaçoes_de_personagem", MODE_PRIVATE);
        int num = informaçõesdepersonagem.getInt("numero_de_personagens", 0);
        String nome, resumo;

        Button botao[]= new Button[num+1];

        if(num!=0)
        {
            for(int i=1; i<=num; i++)// cria os botões de cada personagem
            {
                nome = informaçõesdepersonagem.getString("nome_personagem"+(i+1), "Nenhum");
                resumo = informaçõesdepersonagem.getString("raça_personagem"+(i+1), "Nenhum")+ " " + informaçõesdepersonagem.getString("classe_personagem"+(i+1), "Nenhum") + " " + Integer.toString(informaçõesdepersonagem.getInt("nivel_personagem"+(i+1), 0));

                botao[i]=new Button(this);
                botao[i].setText(nome+" "+resumo);
                botao[i].setId(i);

                botao[i].setOnClickListener(this);
                layout.addView(botao[i]);
            }
        }

        botao[0]=new Button(this);
        botao[0].setText("Criar Novo");
        botao[0].setId(1);

        botao[0].setOnClickListener(this);

        layout.addView(botao[0]);
    }

    @Override
    public void onClick(View view)
    {
        int id=view.getId(), num;
        SharedPreferences shared=getSharedPreferences("com.example.conjuradortormenta_informaçoes_de_personagem", MODE_PRIVATE);
        num=shared.getInt("numero_de_personagens", -1);
        if(id>0 && id<num)
        {
            Intent nova= new Intent(this, teste.class);
            startActivity(nova);
        }
        else if(id==1)
        {
            Intent nova = new Intent (this, CriadordePersonagem.class);
            startActivity(nova);
        }
    }

}

A: O problema era o layout não estar sendo adicionado à hierarquia. Deveria ter chamado setContentView(layout).


text:
Q: C++ Using unsigned char instead of typedef unsigned __int8 I am using a class that I like very much:
#pragma once
#include "StdAfx.h"
#include "xorcipher.h"
#include <vector>

using namespace std;

typedef unsigned __int8 BYTE;

    vector<BYTE>m_Key;

    CXORcipher::CXORcipher()
    {
        m_Key.push_back(0x55);
        m_Key.push_back(0xae);
        m_Key.push_back(0x8c);
        m_Key.push_back(0x14);
    }
    CXORcipher::~CXORcipher()
    {
    }

    vector<BYTE> xor_encryptdecrypt(const vector<BYTE>&uInput)
    {
        vector<BYTE> ret;
        ret.reserve(uInput.size());

        vector<BYTE>::const_iterator keyIterator = m_Key.begin();

        for(vector<BYTE>::const_iterator inputIterator = uInput.begin(); inputIterator != uInput.end(); ++ inputIterator)
        {
            ret.push_back(*inputIterator ^ *keyIterator);

            // advance the key iterator, wrapping to begin.
            if(++ keyIterator == m_Key.end())
            {
                keyIterator = m_Key.begin();
            }
        }
        return ret;
    }

However, I would like to feed a vector of unsigned char instead of the typedef.
I am not really firm with C++ yet, and I am afraid to mess something up.
Could somebody tell me what I can do that?
Thank you!

A: You could #include  and use uint8_t, which is an 8-bit unsigned integer, commonly referred to as unsigned char.
Example:
#include <cstdint>
typedef uint8_t BYTE;

A: __int8 seems to be a Microsoft-specific keyword. (It's not a typedef; if it were unsigned __int8 would be a syntax error.)
A reasonable way to define a byte or BYTE type is as a typedef for unsigned char. Or you can just use unsigned char directly without a typedef; any C or C++ programmer will recognize it as an unsigned type with a size of exactly 1 byte.
You can use uint8_t, defined in <cstdint>, if you're willing to assume CHAR_BIT == 8, which is very common but not universal. (A "byte" in C and C++ is the size of a char, which is at least 8 bits but can be more.)
I don't know whether unsigned char and unsigned __int8 are the same type, but I suspect they are. In any case, using __int8 makes your code non-portable. (That's not necessarily a fatal flaw if you have no need to port it to non-Microsoft platforms, but more people will be able to help you with standard C++ than with Microsoft-specific C++.)
In a comment on Matthias247's answer, you wrote:

Unfortunately, a simple replacement does not work for me. The
  problematic line is this one: for(vector<unsigned
  char>::const_iterator inputIterator = uInput.begin(); inputIterator !=
  uInput.end(); ++ inputIterator) I don't have any iterator for
  unsigned char.

Please update your question, adding code that exhibits the problem and the exact error message. (Don't delete the existing code, since you already have answers that refer to it.)

A: I think it would right away when you pass a vector, because BYTE is through the typedef defined as __int8, which in my opionion is the same as an unsigned char.
What you otherwise can do:

*

*Replace all occurences of BYTE to unsigned char (this is safe for your code)

*Create a templatized version of the CXORcipher class, which works with different data types.


text:
Q: How to open urllink.acsm file with Adobe Digital Editions when it's running with PlayOnLinux? So to download ebooks from ebooks.com it requires Adobe Digital Editions, im using Ubuntu 20.04.2 and have successfully installed ADE. But because it's running with PlayOnLinux/WIne I can't directly open this file with ADE.
I have read i'm supposed to right click the downloaded ACSM file and open it with ADE, but this is installed on a virtual drive with PLayOnLinux so ADE isn't selectable from the desktop when I right click.
When I click 'add file to library' in ADE, it only looks for pdfs and epub files and not an acsm file...  Linux has been great except for trying to read a few books.
I'm new and just trying to learn. Any help is appreciated. Thanks.

A: You have to set file association inside PlayOnLinux:

*

*Open PlayOnLinux

*Go to Settings → File Associations

*Click New

*Enter acsm in the opened window, click OK in it

*Select acsm line in the table and set Assigned program to ADE executable

*Click Apply

*Restart PlayOnLinux

*Try to open acsm file from file-manager by simple Open

Note: ACSM seems to be DRM format, so it will not work with native Calibre application. So your rights are limited here.


text:
Q: Ignoring an required field of an entity I got the following variable into my entity:
[DataType(DataType.Currency)]
[DisplayName("Value U$:")]
[Required(ErrorMessage = "Currency Required.")]
public decimal? CurrecyValue { get; set; }

Actually Im  using this entity and I dont need this field. As soon as I post any information the ModelState becomes invalid because its required.
I know that I can use ModelState.Clear(); but, doing this I'll ignore all the other validations that I need.
Is there any way to just ignore this specific field without clearing my whole ModelState ?
Thanks !

A: Ugly and totally not recommended workaround:
ModelState.Remove("CurrecyValue");

Recommended solution:
Use view models. But real view models. Not some hybrids which you call view models and into into which you stick your domain entities and which you wonder how to get rid of simply because they are not adapted to the requirements of the given view. You should define a specific view model for each of your views. If you don't follow this very simple rule you will struggle a lot with ASP.NET MVC.


text:
Q: Comparing two column, insert shift cell down until it find another match I have two rows of large data two compare that look like this Step1.
What i'm trying to do is, it will insert blank cells until it find another match that look like this Step2.
Sorry for my bad English, any help would be appreciated.

A: Maybe you can achieve this using a loop statement. If cell1 is not equal to cell2, it will insert blank, else it will insert the cell2 value.
Or set a if else statement on your Cell2:
IIF(Cell1 <> Cell2, return true, return false)


text:
Q: Unzip multiple files in a folder using ssis I am currently using SSIS task to unzip a file .. but the file conatins multiple (subfolders)zip folders
i did this till now :

on successful execution the only parent file will get unzip not subfolders:(
say like these are my files(zip)
A.zip
having(B.zip,C.zip,D.zip)
and B.zip contains(a,b,c,d)... C.zip(a1,b1,c1,d1),...D.zip(a2,b2,c2,d2)

A: As an alternative approach, you might want to try Joost's solution, but tick the "Traverse Sub Folder" option in step 3


text:
Q: Multi parameter search via user input - ruby on rails & mongodb I have a web page where a user can search through documents in a mongoDB collection.
I get the user's input through @q = params[:search].to_s
I then run a mongoid query:
@story = Story.any_of( { :Tags => /#{@q}/i}, {:Name => /#{@q}/i}, {:Genre => {/#{@q}/i}} )
This works fine if the user looks for something like 'humor' 'romantic comedy' or 'mystery'. But if looking for 'romance fiction', nothing comes up.  Basically I'd like to add 'and' 'or' functionality to my search so that it will find documents in the database that are related to all strings that a user types into the input field.
How can this be done while still maintaining the substring search capabilties I currently have?Thanks in advance for help!
UPDATE:
Per Eugene's comment below...
I tried converting to case insensitive with  @q.map! { |x| x="/#{x}/i"}. It does save it properly as ["/romantic/i","/comedy/i"]. But the query Story.any_of({:Tags.in => @q}, {:Story.in => @q})finds nothing.
When I change the array to be ["Romantic","Comedy"]. Then it does.
How can I properly make it case insensitive?
Final:
Removing the quotes worked.
However there is now no way to use an .and() search to find a book that has both words in all these fields.

A: to create an OR statement, you can convert the string into an array of strings, and then convert the array of strings into an array of regex and then use the '$in' option.  So first, pick a delimeter - perhaps commas or space or you can set up a custom like ||.  Let's say you do comma seperated.  When user enters:
romantic, comedy
you split that into ['romantic', 'comedy'], then convert that to [/romantic/i, /comedy/i] then do
@story = Story.any_of( { :Tags.in => [/romantic/i, /comedy/i]}....
To create an AND query, it can get a little more complicated.  There is an elemMatch function you could use.
I don't think you could do {:Tags => /romantic/i, :Tags => /comedy/i }
So my best thought would be to do sequential queries, even though there would be a performance hit, but if your DB isn't that big, it shouldn't be a big issue.  So if you want Romantic AND Comedy you can do
query 1: find all collections that match /romantic/i
query 2: take results of query 1, find all collections that match /comedy/i
And so on by iterating through your array of selectors.


text:
Q: Подключение Json и вложенный массив Доброго времени суток. Впервые работаю с .json. Раньше обходился БД, но сейчас нужен именно он.
Вопроса 2 и состоят в следующем:
1. Как подключить локальный data.json файл к действующему коду.
2. Как обращаться к вложенным массивам( и так и так пробовал, не получается)
<style>
*{
    font-size: 60px;
}
</style>
<?
$cityFrom = $_GET['cityFrom'];
$cityTo = $_GET['cityTo'];
trim($cityFrom);
trim($cityTo);
$errorState = 0; //All is good;

if($cityFrom == $cityTo)
{
    $errorState = 1; //Same citeis;
    echo "<script language = \"javascript\"> alert(\"Entered same cities / Введены одинаковые города\"); window.location.href = \"order.html\"; </script>";
}
if($cityFrom != "Kazan" && $cityTo != "Kazan")
{
    $errorState = 2; //Not exist way;
}

?>

<script language = "javascript" >
    //Вызов json из "data.json"
</script>

Json файл заполнен для 1 города и выглядит следующим образом:
(Как мне изъять оттуда city.Kazan.Ufa[0]; что-то типа того)
{
"city": [
    {
        "Kazan": [
            {
                "Ufa": ["8:00", "10:00", "11:00", "13:00", "16:00", "21:00", "22:00", "23:00"],
                "Izhevsk": [],
                "Chelny": [],
                "Elabuga": [],
                "Nizhnekamsk": [],
                "Almet": [],
                "Ulyanovsk": [],
                "Samara": [],
                "Tolyati": [],
                "Moscow": [],
                "SP": [],
                "Yoshkarola": [],
                "Kirov": [],
                "Novgorod": []
            }
        ],
        "Ufa" : [
            {
                "Kazan": ["6:00", "8:00", "10:00", "14:00", "18:00", "21:00", "22:00", "00:00"]
            }
        ],
        "Izhevsk": [
            {
                "Kazan": []
            }
        ],
        "Chelny": [
            {
                "Kazan": []
            }
        ],
        "Elabuga": [
            {
                "Kazan": []
            }
        ],
        "Nizhnekamsk": [
            {
                "Kazan": []
            }
        ],
        "Almet": [
            {
                "Kazan": []
            }
        ],
        "Ulyanovsk": [
            {
                "Kazan": []
            }
        ],
        "Samara": [
            {
                "Kazan": []
            }
        ],
        "Tolyati": [
            {
                "Kazan": []
            }
        ],
        "Moscow": [
            {
                "Kazan": []
            }
        ],
        "SP": [
            {
                "Kazan": []
            }
        ],
        "Yoshkorola": [
            {
                "Kazan": []
            }
        ],
        "Kirov": [
            {
                "Kazan": []
            }
        ],
        "Novgorod": [
            {
                "Kazan": []
            }
                ]
            }
        ]
    }

A: Например вот так:
//Вместо data.json укажите свой путь
$data = file_get_contents('data.json');

$json = json_decode($data);

print_r($json->city[0]->Kazan[0]->Ufa[0]);


text:
Q: How to hide python program from windows task manager I have this website blocker I use for my little brothers. The program needs to always run, and I've disabled functions for closing it. The problem is that they could still close the program by opening the task manager. Are there any ways to hide it from the task manager but still runs in the background

A: Assuming you cannot solve the problem by parental control (which some browsers support), you can either

*

*Create a service. It will still be in task manager, but not under processes

*Create two processes that would constantly check if the other one is present and rerun it when it disappears

I don't think it is possible to have a program not displayed by task manager.


text:
Q: creating an inputbox with different buttons I have a vbs code and i would like to change the way an InputBox is shown.
I want to create an InputBox that instead of "OK" and "Cancel" buttons will show different button labels
Is it possible in vbs?
thank you

A: What you want is not possible with the built-in InputBox function. You need to create a custom dialog for that:
Set ie = CreateObject("InternetExplorer.Application")

ie.Navigate "about:blank"
ie.Document.title = "Title"
ie.ToolBar        = False
ie.Resizable      = False
ie.StatusBar      = False
ie.Width          = 320
ie.Height         = 180

While ie.ReadyState <> 4 : WScript.Sleep 100 : Wend

ie.Document.body.innerHTML = _
  "
<input type='text' size='20' id='UserInput'>
" & vbNewLine & _
  "
<input type='hidden' id='OK' name='OK' value='0'>" & _
  "<input type='submit' value='Foo' onClick='VBScript:OK.value=1'>
"
ie.Document.body.style.overflow = "auto"

ie.Visible = True
ie.Document.all.UserInput.focus

On Error Resume Next
Do While ie.Document.all.OK.value = 0
  WScript.Sleep 100
Loop
On Error Goto 0

Use stylesheets for customizing the appearance of the dialog:
Set style = ie.Document.CreateStyleSheet
style.AddRule "*", "margin:0; padding:0; border:0;"
style.AddRule "body", "font-family:serif; font-size:12px; text-align:center;"
style.AddRule ".button", "border:2px outset; width:70px;"
...


text:
Q: Ember Data not properly serializing property names of objects in an array I have a simple (made up for this question) model with an attribute called electricGuitars that has a few defaults predefined.
 export default class guitarCollectionModel extends Model {
  @attr('string') firstName;
  @attr('string') lastName;
  @attr({
    defaultValue() {
      return [
        {
          serialNumber: "sdfdsfadf",
          colorCode: "dsfsadfdfa"
        },
        {
          serialNumber: "234234234",
          colorCode: "234234234323"
        },
        {
          serialNumber: "oorprpprprpororprp",
          colorCode: "rproproroprporp"
        }
      ];
    }
  }) electricGuitars;
}

When I save the model (this.model.save()) Ember Data POSTs to my API and almost everything is serialized correctly by default (no custom serializer or adpaters). API expects all property names to be dasherized.
{
  "data": {
    "attributes": {
      "first-name": null,
      "last-name": null,
      "electric-guitars": [
        {
          "serialNumber": "sdfdsfadf",
          "colorCode": "dsfsadfdfa"
        },
        {
          "serialNumber": "234234234",
          "colorCode": "234234234323"
        },
        {
          "serialNumber": "oorprpprprpororprp",
          "colorCode": "rproproroprporp"
        }
      ]
    },
    "type": "guitar-collection"
  }
}

The problem is that the serialNumber and colorCode properties inside of the electricGuitars property/array have not been dasherized.
Is there an easy way to achieve this?

A: While JSON:API supports any valid JSON as an attribute value, Ember Data serialisers don't apply to nested complex objects. You may find Ember Data Model Fragments of use for this, or embedded records.

A: One option would be to write a custom transform. In the serialize function you could dasherize:
serialize(deserialized) {
  return Object.fromEntries(Object.entries(deserialized)
    .map(([key, val]) => [dasherize(key), val])
  )
}

then specify the custom transform:
@attr('my-custom-transform', {


text:
Q: titanium:image upload to server issue Hello friends,
I am developing app in Titanium and also develop a functionality to upload image to server using POST method and I am select a photo from photo gallery and send to the server but I am can't got successfully response from server and also I want to send image name as a parameter like 45645.png and media parameters etc but I can't send image name so please give me idea how can i solve my issue.
Refer upload image to server: http://mobile.tutsplus.com/tutorials/appcelerator/titanium-mobile-build-an-image-uploader/
//photo gallery for  select photo
function getPhotGallery ()
{
  Titanium.Media.openPhotoGallery({

    success:function(event)
    {
        //var cropRect = event.cropRect;
        var image = event.media;

        // set image view
        Ti.API.debug('Our type was: '+event.mediaType);
        if(event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO)
        {
            uploadPhotoImageView.image = image;

            UploadPhotoToServer(uploadPhotoImageView.image);
        }
        else
        {

        }
        //Titanium.API.info('PHOTO GALLERY SUCCESS cropRect.x ' + cropRect.x + ' cropRect.y ' + cropRect.y  + ' cropRect.height ' + cropRect.height + ' cropRect.width ' + cropRect.width);
    },
    cancel:function()
    {

    },
    error:function(error)
    {
    },
    allowEditing:true,
    //popoverView:popoverView,
    //arrowDirection:arrowDirection,
    mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO]
    });

}

//upload photo to server uisng POST method
function UploadPhotoToServer(media)
{
        //var filename = mobileNumber.value + '.png';
        var filename = '123456.png';

    if (Titanium.Network.online == true)
    {
       var imgUploadLoader = Titanium.Network.createHTTPClient();

            //open the client
          imgUploadLoader.open('POST', 'http://projects.spinxweb.net/ContactsTracking/iphone-file-upload.aspx');

         // send the data
         imgUploadLoader.send(
         {
             media: media,
             "name": filename
         });

       imgUploadLoader.onerror = function(e)
       {
            Ti.API.info('IN ERROR ' + e.error);
            alert('Sorry, we could not upload your photo! Please try again.');
       };

       imgUploadLoader.onload = function()
       {
            Ti.API.info('IN ONLOAD ' + this.status + ' readyState ' + this.readyState);
            if(this.responseText != 'false')
            {
                var url = this.responseText; //set our url variable to the response
                Ti.API.log('Upload image url:'+url);
                //alert('Upload photo successfully');

                //getLoginData();
            }
            else
            {
                alert('Whoops, something failed in your upload script.');
            }
       };

      imgUploadLoader.onsendstream = function(e)
      {
          Ti.API.info('ONSENDSTREAM - PROGRESS: ' + e.progress);
          if(Ti.Platform.osname == 'android')
          {

          }
          else
          {

          }
      };

  }
  else
  {
    alert('You must have a valid Internet connection in order to upload this photo.');
  }
}

A: Not sure if this is exactly what you're looking for, but I've had success with this code:
eventSuccess : function ( e )
{
  var xhr = Ti.Network.createHTTPClient ( );
  xhr.open ( "POST", 'yourserver.com/webservice.php' );

  xhr.setTimeout ( 20000 );

  xhr.send (
  {
    "CommandType"    : "image",
    "file"           : e.media,
    "name"           : filename
  });

  xhr.onload = function ( e )
  {
    Ti.API.info ("image sent to server");
  }
}

This is running when a success event is coming back from the camera.  The image is then sent to the server.
You'll then need something on the server side, like this:
move_uploaded_file ($_FILES["file"]["tmp_name"], "incoming/images/" . $_FILES["file"]["name"]);


text:
Q: ContentNegotiation: How to serve other than the highest ranking type from accept header I have this Spring Java Configuration with several custom HttpMessageConverters:
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
    configurer.favorParameter(true).
            ignoreAcceptHeader(false).
            useJaf(true).
            defaultContentType(MediaType.TEXT_HTML).
            mediaType("html", MediaType.TEXT__HTML).
            mediaType("rdf", MediaTypes.RDFXML);
}

If I query this setup with Jena I get an error:

The resource identified by this request is only capable of generating
  responses with characteristics not acceptable according to the request
  "accept" headers

Jena sends a request with this Accept header:

Accept:
  text/turtle,application/n-triples;q=0.9,application/rdf+xml;q=0.8,application/xml;q=0.7,/;q=0.5

To my understanding, application/rdf+xml, should be returned by the config above. This works perfectly as long as the type with the highest value is configured. Why doesn't Spring fall back to the 0.8-valued application/rdf+xml, because text/turtle and application/n-triples are not available?
Is there an option to activate that?

A: ContentNegotiationConfigurer.mediaType(String,MediaType) applies to the request parsing and defines a mapping from the extension to the media type - if the request does not define explicit media type in the form of the Accept header but the request path ends with the specified extension that the specified media type is assumed.
Basically, ContentNegotiationConfigurer enriches (or modifies) the request data, but does not select the actual response type.
What you need is a controller that can produce either multiple media types or a multiple controllers (or multiple methods in the same controller) that produce different media types, application/rdf+xml being one of them. Spring will select that controller automatically if the application/rdf+xml is the highest common media type between the (possible enriched or modified) Accept header in the request and what your controller can actually produce.

A: I achieve this either through defining different MVC handlers, or by reflecting on the content-type and then deciding what to return.
Defining Different Handlers
If you specify a @RequestMapping that produces some value, then that will be the type on your Content-Type header regardless of the automatic negotiation that lead your request there. You can 'force' requests to those handlers by being the only ones available to answer. I use this to return a more-specific type, but I suspect that you can also use it in order to return a more generic one as well.
@RequestMapping(value="/sparql/service", produces={"application/rdf+xml;charset=utf-8", MediaType.ALL_VALUE})
public @ResponseBody String serviceDescriptionAsRdfXml()
{
    return null; // something here
}

@RequestMapping( value="/sparql/service", produces={"text/turtle;charset=utf-8"} )
public @ResponseBody String serviceDescriptionAsTurtle( final HttpServletRequest request )
{
    return null; // something here
}

Reflecting on the Content-Type
To reflect on the type coming in, and produce something more generic, then you can actually retrieve a list of MediaType objects as part of your request, then use a ResponseEntity to define what the Content-Type will be for your result. This requires a little more thought.
@RequestMapping(value="/sparql/query", method=RequestMethod.GET)
public ResponseEntity<String> queryViaGet(@RequestHeader(value="Accept") final List<MediaType> contentTypes)
{
    MediaType.sortBySpecificityAndQuality(contentTypes);

    // Do some stuff to select your content type and generate your response
    final String results = null;
    final MediaType desiredType = null;

    // Create your REST response
    final HttpHeaders responseHeaders = new HttpHeaders();
    responseHeaders.setContentType(desiredType);
    return new ResponseEntity<String>(results, responseHeaders, HttpStatus.OK);
}


text:
Q: How can to combine odds ratios and the confidence intervals I am trying to combine the ORs and confidence interval in one column so as to achieve the following results 1.10(0.52,2.29)
library(gtsummary)

trial %>%
  select(response, grade) %>%
  tbl_uvregression(
    method = glm,
    y = response,
    method.args = list(family = binomial),
    exponentiate = TRUE
  )

A: You can use the modify_table_styling() function to merge two or more columns.  Example below!
library(gtsummary)
packageVersion("gtsummary")
#> [1] '1.4.0'

tbl <-
  trial %>%
  select(response, grade) %>%
  tbl_uvregression(
    method = glm,
    y = response,
    method.args = list(family = binomial),
    exponentiate = TRUE
  ) %>%
  modify_table_styling(
    columns = estimate,
    rows = !is.na(ci),
    cols_merge_pattern = "{estimate} ({ci})"
  ) %>%
  modify_header(estimate ~ "**OR (95% CI)**") %>%
  modify_footnote(estimate ~ "OR = Odds Ratio, CI = Confidence Interval",
                  abbreviation = TRUE)

Created on 2021-05-03 by the reprex package (v2.0.0)


text:
Q: Cannot install sty file I have spent quite a few hours researching how to do this, but still cannot understand how to add a missing .sty file on my linux mint machine.
I have installed texlive by:
sudo apt install texlive-latex-base

I then tried to compile my .tex document:
pdflatex filename.tex

I got the error message that the endfloat.sty is missing.
So I tried to install it, by first trying to find where my sty files are:
whereis texlive

which returns /usr/share/texlive
, then after a bit of searching I found the other .sty files are in their own directories within /usr/share/texlive/texmf-dist/tex/latex.
I tried to make a path then to put my missing .sty file in using the sudo command:
sudo mkdir endfloat

which made the directory
/usr/share/texlive/texmf-dist/tex/latex/endfloat

I changed into that directory, and then did
sudo wget https://mirror.hmc.edu/ctan/obsolete/macros/latex209/contrib/misc/endfloat.sty

But when I reran:
pdflatex filename.tex

Still it did not compile because it says the .sty file is missing.

A: Run:
$ apt-cache search endfloat
texlive-latex-extra - TeX Live: LaTeX additional packages

Then install texlive-latex-extra:
$ sudo apt-get install texlive-latex-extra

Installation should go without any problem. Then verify:
kpsewhich endfloat.sty

The above should show where the style file has been installed.
And in future occasions, please remember that while manually copying style files may be interesting, this is challenging as well, you should know what you are doing.


text:
Q: Outlook Express ( Exchange server compatible ) alternative for Debian/Linux? I could set it up on my Virtualbox XP partition, but is there any decent application not named Evolution ( it's just a very odd, weird buggy and unstable application IMO ).

A: Mozilla Thunderbird is exchange compatible.


text:
Q: AWS Toolkit for Eclipse Installation fails on Eclipse Luna I downloaded the latest Eclipse IDE for Java EE Developers Luna 4.4 and tried to install the AWS Toolkit for Eclipse but got an error message:
Failed to prepare partial IU: [R]com.amazonaws.eclipse.datatools.enablement.simpledb.driver
1.0.0.v201405191642.

I tried installing

*

*using the installation instructions

*installing from the Eclipse Marketplace

*on OS X with JDK 1.8

*on OS X with JDK 1.7

*on OS X with JDK 1.6

*on Windows using JDK 1.6

In the Eclipse log I get the following:
!ENTRY org.eclipse.equinox.p2.publisher.eclipse 4 0 2014-06-28 14:14:23.076

!MESSAGE Unable to acquire PluginConverter service during generation for: /Users/bernhard/Documents/EclipseDevelopment/eclipse/plugins/com.amazonaws.eclipse.datatools.enablement.simpledb.driver_1.0.0.v201405191642. !ENTRY org.eclipse.equinox.p2.touchpoint.eclipse 4 0 2014-06-28 14:14:23.077

!MESSAGE The bundle manifest could not be read: /Users/bernhard/Documents/EclipseDevelopment/eclipse/plugins/com.amazonaws.eclipse.datatools.enablement.simpledb.driver_1.0.0.v201405191642

!ENTRY org.eclipse.equinox.p2.engine 4 4 2014-06-28 14:14:23.093

!MESSAGE An error occurred while installing the items !SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2014-06-28 14:14:23.093

!MESSAGE session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null --> [R]com.amazonaws.eclipse.datatools.enablement.simpledb.driver
1.0.0.v201405191642, action=). !SUBENTRY 1 org.eclipse.equinox.p2.touchpoint.eclipse 4 0 2014-06-28 14:14:23.093

!MESSAGE Failed to prepare partial IU: [R]com.amazonaws.eclipse.datatools.enablement.simpledb.driver
1.0.0.v201405191642.

So there are three error messages, all for com.amazonaws.eclipse.datatools.enablement.simpledb.driver_1.0.0.v201405191642

*

*Unable to acquire PluginConverter service during generation for

*The bundle manifest could not be read

*Failed to prepare partial IU
I found the following Eclipse bugs that might be helpful for finding the right solution for the Unable to acquire PluginConverter service error:

*

*https://bugs.eclipse.org/bugs/show_bug.cgi?id=437466

*https://bugs.eclipse.org/bugs/show_bug.cgi?id=436372#c35

A: Are you selecting the optional components for data tools?


text:
Q: Adding 2 or more objects to JFrame I want to display 2 objects on JFrame. I tried by adding objects to JPanel and then add JPanel to JFrame but it also did not work.  I also tried to add ball and ball1 objects directly to JFrame but it shows the last added object only. I want to show both objects on JFrame at a time.  The below given code only shows ball1 object.
    JFrame f = new JFrame("Moving");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    //making 2 objects
    Ballbewegung2 ball = new Ballbewegung2();
    Ballbewegung3 ball1 = new Ballbewegung3();
    JPanel contentPane = new JPanel(new BorderLayout());
    JPanel contentPane1 = new JPanel(new BorderLayout());

    //adding objects to JPanel
    contentPane.add(ball, BorderLayout.CENTER);
    contentPane1.add(ball1, BorderLayout.CENTER);

    //Adding JPanel to JFrmae
    f.getContentPane().add(contentPane);
    f.getContentPane().add(contentPane1);
    f.setSize(500, 500);
    f.setVisible(true);

A: I suggest you to use a JPanel to hold both your JPanels as children, and add a single JPanel to the JFrame content pane.
The second call to JFrame.add() method will replace the first added JPanel, if you don't specify explicetly a different layout location.
A simple example using BoxLayout:
JPanel mainPanel= new JPanel();
mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));

mainPanel.add(contentPane);
mainPanel.add(contentPane1);
contentPane.add(mainPanel);

A: The content pane of JFrame has BorderLayout layout manager by default. That means if you add a component to it, it will be put in the CENTER. If you add another component to it, it will again put in the CENTER and it will replace the previously added component.
An example how to add multiple components:
JFrame f = new JFrame();

JPanel p = new JPanel();

p.add( new JButton( "One" ) );
p.add( new JButton( "Two" ) );

f.getContentPane().add( p, BorderLayout.CENTER );

Or when adding a component to the content pane, specify where to put it (and specify different locations):
JFrame f = new JFrame();

f.getContentPane().add( new JButton( "One" ), BorderLayout.NORTH );
f.getContentPane().add( new JButton( "Two" ), BorderLayout.CENTER );

A: Here is an example to achieve UI something like this

The Java components used are as following

Code:
// Call this function from the main
private static void createAndShowGUI() {
    // Create and set up the content pane.
    MainPanel panel = new MainPanel();
    panel.setOpaque(true); // content panes must be opaque

    // Display the window.
    JFrame frmConsole = new JFrame("ITSME");
    frmConsole.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frmConsole.setPreferredSize(new Dimension(640, 480));
    frmConsole.add(panel);
    frmConsole.pack();
    frmConsole.setLocationRelativeTo(null);
    frmConsole.setVisible(true);
}

Class MainPanel
public class MainPanel extends JPanel implements ActionListener {
    private static final long serialVersionUID = 1L;
    private int m_nX, m_nY;
    private int m_nHeight = 30, m_nWidthLabel = 500, m_nPadding = 2;

    private JLabel m_lblFilename, m_lblFileGen;

    public MainPanel() {
        // TODO Auto-generated constructor stub
        super(new BorderLayout());
        try {
            this.setLayout(null);
            this.setBorder(new TitledBorder(new EtchedBorder(),
                "Dynamic Time Warping"));

            m_nX = this.getX() + 12;
            m_nY = this.getY() + 24;

            // Add the Filename Label
            m_lblFilename = new JLabel("Label1");
            m_lblFilename.setBorder(new LineBorder(Color.BLUE, 2));
            m_lblFilename.setBounds(nX, nY, m_nWidthLabel, m_nHeight);
            this.add(m_lblFilename);

            // Adding a Label
            nY += m_lblFilename.getHeight() + m_nPadding;
            m_lblFileGen = new JLabel("Label1");
            m_lblFileGen.setBorder(new LineBorder(Color.RED, 2));
            m_lblFileGen.setBounds(nX, nY, m_nWidthLabel, 3 * m_nHeight);
            m_lblFileGen.setForeground(Color.BLUE);
            this.add(m_lblFileGen);
        } catch (Exception e) {
        e.printStackTrace();
    }
}


text:
Q: magento media manager full url I'am using a built in Magento Filebrowser on my extension to magento.
I have this problem. If i open a magento File browser, then select file and then click button "Insert File"
Then Filebrowser gives me a url what looks like this _directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvc2VhcmNoLnBuZyJ9fQ,,/key/dc3e70661f817703710378d51351495b/">http://www.infira.ee/magento/index.php/admin/cms_wysiwyg/directive/_directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvc2VhcmNoLnBuZyJ9fQ,,/key/dc3e70661f817703710378d51351495b/
how do i convert this url to normal full image url some thing like this http://www.infira.ee/magento/dir/dir/dir/someImage.png.
I need it cause this full url gos to the css file.

A: Login to Admin.
Go to System > Configuration > Content Management (Under General) > WYSIWYG Options
'Use Static URLs for Media Content in WYSIWYG for Catalog' - Select "Yes"


text:
Q: Any tips on pinpointing Windows 7 instability? Ever since I removed malware my Windows 7 computer has been unstable. The mouse and keyboard randomly stop working for a few seconds and sometimes the system freezes all together. The behaviour is very random but I often have a 10 minutes of good use after the computer is first started. The behaviour started happening after I removed some malware, but also around the same time I updated the graphics card driver and updated to the latest version of Firefox. Part of the malware removal process included updating plugins etc. and I'm wondering if one plugin broke something. Is there anyway I can pinpoint it? I ran chckdsk and it said it repaired something's. I also ran sfc /scannow and have its log.
It's almost as if I need to keep a log of all programs I ran since booting the computer and trying to find a common one each time Windows freezes up.

A: The best way to pinpoint defects is to do only one change at a time and then test it.
In this case you could try;

*

*removing firefox

*re-installing the old graphics driver

Test after each action to see if it solves the problem.
Sometimes it can be very difficult to eradicate a piece of malware. So it is often safer to wipe the disk and restore a previsouly made backup (you have those, right?)
If you don't have backups, the best way is to make a backup of all your data, wipe the disk and re-install windows, your data and all applications. When that is done and doesn't exhibit a problem, make sure to get a backup! Restoring a backup is generally faster and less effort than installing the OS and all apps again.
Edit:
If you suspect firefox, remove all of it including plug-ins and add-ons (that means also removing adobe's flash player) and reboot the computer. If the problem hasn't returned after an hour or so of normal use, firefox or one of its plugins/add-ons was the problem.
The next step is to re-install the latest version of firefox without any plug-ins or add-ons. If that exhibits the problem within an hour or so, submit a bug report to mozilla.
If mozilla itself is OK, install your favorite add-ons and plug-ins one at a time and see if the problem returns.


text:
Q: Isomorphisms of Graph Embeddings I am having trouble understanding isomorphisms of graph embeddings. How does one distinguish between two graph embeddings on the same surface, and how does one, for example, distinguish between two embeddings $G\to S$ and $G'\to S'$? When do we consider these embeddings "the same"?

A: It depends. It depends on what you're doing, and which embeddings you want to consider the same.
The most natural thing I can think of would be to say two graph embeddings $f \colon G \to S$ and $g\colon G' \to S$ are "the same" if there exists a graph isomorphism $\phi\colon G \to G'$ and an automorphism $\alpha$ of your surface $S$ such that $g\phi = \alpha f$. But you could very well weaken the conditions on $\phi$ and $\alpha$.


text:
Q: Forcing ALSA to use another codec ALSA detects my sound card to be a Realtek ALC1200 , but it is a Realtek ALC888S. This causes the sound to be lesser that that in my Windows XP Installation.
So, is it possible to make ALSA use the Realtek ALC888S codec instead of the Realtek ALC1200 codec?

A: Here is a solution I found on http://ubuntuforums.org/showthread.php?t=1426424

gksudo gedit Then open /etc/modprobe.d/alsa-base.conf
At the end of the file add a new line options snd-hda-intel
model=generic


text:
Q: How to set the CPU priority (niceness) of a Docker container? One of my containers is always busy, and is taking CPU away from other containers (webservers) that need to be responsive and are only active from time to time.
I would like to lower the CPU priority of the CPU-consuming container, so that whenever the other containers need the CPU, it is not clogged.
How do I do this? I have been searching the web for a while now, but I can't find the answer.
I have tried running the container with --entrypoint='nice 10 mybinary', but it turns out --entrypoint can only run binaries, not shell commands.

A: --cpu-shares looks like a good answer, although it's not clear to me how to verify it's working.  I'm also curious what the max value is?  Document doesn't say.
But, as an alternative for trusted containers, that same document also shows --cap-add=sys_nice that will allow changing process priorities within a container.  i.e., if the nice or renice command is available within the container, it should work when you add the sys_nice capability.  You'll only want to allow this capability for trusted containers because you don't want untrusted programs changing their own priorities willy nilly.
You can verify by inspecting the NI column for the process in question using top or ps -efl on the host.

A: You can limit CPU resources on the container level. I recommend to use --cpu-shares 512 for your case.
https://docs.docker.com/config/containers/resource_constraints/:

Set this flag to a value greater or less than the default of 1024 to increase or reduce the container's weight, and give it access to a greater or lesser proportion of the host machine's CPU cycles. This is only enforced when CPU cycles are constrained. When plenty of CPU cycles are available, all containers use as much CPU as they need. In that way, this is a soft limit. --cpu-shares does not prevent containers from being scheduled in swarm mode. It prioritizes container CPU resources for the available CPU cycles. It does not guarantee or reserve any specific CPU access.

A: Setting the CPU shares is the most direct answer to your request, and typically preferred over adding capabilities to the container could be used by a malicious actor inside of the container to impact the host. The only reason I can think of to add the SYS_NICE capability to the container is if you have multiple processes inside the container and want to give different priorities to them, or need to change the priority while the container is running.
The more traditional solution to noisy neighbors is to configure each container with a limit on how much CPU and memory it is allowed to use. This is an upper bound, so realize there may be idle CPU resources if you set this low and do not have any other tasks available for the CPU to run.
The easiest way to set the limit on containers from the docker run command line is with --cpus which allows you to configure a fractional number of cores to be available to the container. Passing an option like --cpus 2.5 allows the container to use as many as 2.5 cores before the kernel scheduler throttles the process. If you had a 4 core host, that would ensure that at least 1.5 cores are always available to other processes.
Related to these limits, with Swarm Mode you can also configure a reservation for CPU (and memory). The reservation is a lower limit that Docker ensures has not been reserved for any other containers. This is used to select nodes to schedule containers, and may prevent some containers from being scheduled when there are not enough resources available, rather than scheduling so many jobs on a single node that it fails.


text:
Q: Bash, match string and then replace everything after character in next line What I am looking to do is find a match and then replace everything after character in the next line.
Example file contents:
  super_service:
    app_version: 1.02
  duper_service:
    app_version: 4.0.1
  happy_service:
    app_version: 2.03
  turbo_service:
    app_version: 1.28.0

Expected outcome: What I am looking to do is match duper_service for example, and then replace everything after its' "app_version: " with a new version I define, 4.0.2 for example. I am able to do this with awk but need to write the change to the file.

A: sed seems a good candidate for this:
sed -i '/^[[:space:]]*duper_service:/ { N; s/[^:]*$/ 4.0.2/ }' file.txt

Explanation: when the "duper_service:" line is encountered, next line is appended and whatever ends that line, after the colon, ([^:]*$) is replaced with "4.0.2".
The -i option changes the file in-place. It's a GNU sed extension.

A: Looks like this works:
sed -i '/duper_service/!b;n;c\ \ \ \ app_version: 4.0.2' file.txt


text:
Q: "Reveal" vs. "revelation" as nouns  I just posed this question on sci-fi.stackexchange and had my wording corrected from reveal to revelation.

I realise that to have said that too early in the film would have ruined the big reveal. Is there some in-universe reason for Palpatine to refer to Luke's father as Anakin? Some kind of psychological game that Palpatine is playing with Vader, perhaps?

I thought reveal was the correct word but I wanted to check the difference with experts.

A: Reveal is used as a noun to mean a final revelation previously kept from the characters or viewers in a film or television show.

A: Not only is it fine: it's in Oxford Dictionaries.

(In a film or television programme) A final revelation of information that has previously been kept from the characters or viewers:
The big reveal at the end of the movie answers all questions

A: According to the OED this use of reveal as a noun was common until the 18th century, after that it was considered obsolete. But it came into use again with the predecessors of reality TV in the 1950s (think Candid Camera). I suspect it has gained in usage as an alternative to "revelation" because of the religious or connotations of the latter.

A: Reveal is fine; in this context it is synonymous with revelation. Reveal is more commonly a verb than a noun, so this is probably a case of overcorrection; it's probably more common than alternatives like divulgence, for example.


text:
Q: GridLayout to GridBagLayout Questions So I used to be a great GUI programmer but it seems I have lost quite a bit of my GridBagLayout knowledge.
What I am trying to do is make a customized box with JPanels inside of it. I first used GridLayout, however from what I have researched there is really no way to customize the "% width/height" for each box, it simply evens them all out.
So my fist attempt resulted in this.
(GridLayout)

I continued looking around and I believe I need to use GridBagLayout. So I spent a good hour looking at examples and I feel like I am simply just "not getting it" for a lack of better words. I have tried implementing a variety of test codes for GridBagLaout but I can never get anything to fully work for what I need.
My question is, may someone please give me a skeleton setup of what I am looking for? I do not want the entire code, just the basic skeleton so that I can take a shot at figuring it out myself (that way I actually "get it").
So by skeleton, what I mean is make just one of the boxes for me and then please dumb down each step of what does what so that I can try to follow that same process for the rest of the boxes.
What I am looking to end up with is...
(My desired GridBagLayout)

As far as actually percents, I am looking at doing:
Width: 80% for green/red side, and 20% for blue side.
Height: 80% for red, and 20% for green/white.
I am currently finishing up a project today, but I hope that I can start working on this sometime this evening.
Thank you very much for all the future help!
-Austin

A: Try this:
import java.awt.*;
import javax.swing.*;

public class GridBagDemo implements Runnable
{
  public static void main(String[] args)
  {
    SwingUtilities.invokeLater(new GridBagDemo());
  }

  public void run()
  {
    JComponent redComp = new JPanel();
    redComp.setBackground(Color.RED);

    JComponent greenComp = new JPanel();
    greenComp.setBackground(Color.GREEN);

    JComponent blueComp = new JPanel();
    blueComp.setBackground(Color.BLUE);

    JComponent whiteComp = new JPanel();
    whiteComp.setBackground(Color.WHITE);

    GridBagConstraints gbc = new GridBagConstraints();
    // we'll use this anchor/fill for all components
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.fill = GridBagConstraints.BOTH;

    JPanel panel = new JPanel(new GridBagLayout());

    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 2;
    gbc.gridheight = 1;
    gbc.weightx = 0.8;  // use 80% of the overall width
    gbc.weighty = 0.8;  // use 80% of the overall height
    panel.add(redComp, gbc);

    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 2;
    gbc.weightx = 0.2;  // use 20% of the overall width
    gbc.weighty = 1.0;  // use 100% of the overall height
    panel.add(blueComp, gbc);

    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    gbc.weightx = 0.8;  // use 80% of the width used by green/white comps
    gbc.weighty = 0.2;  // use 20% of the overall height
    panel.add(greenComp, gbc);

    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    gbc.weightx = 0.2;  // use 20% of the width used by green/white comps
    gbc.weighty = 0.2;  // use 20% of the overall height
    panel.add(whiteComp, gbc);

    JFrame frame = new JFrame("GrigBag Demo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(panel);
    frame.setSize(400, 300);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
  }
}


text:
Q: Appending dynamically created elements is making a network request I am using jQuery to make an AJAX call, then create some new DOM elements using the response data, and append them to an existing DIV on the page.
Everything works fine, however, the jQuery append function is causing a network request to a URL (http://example.com/current-page/false).
The console points to this code in the jQuery library, specifically the line target.appendChild( elem );:
    append: function() {
        return domManip( this, arguments, function( elem ) {
            if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
                var target = manipulationTarget( this, elem );
                target.appendChild( elem );
            }
        } );
    },

Does anyone know why it is doing this?


text:
Q: SceneExporter output bug? In Three.js SceneExporter, when i export the whole scene, in the output json data i realized that textures are not exported correct. It produces Texture lines as
"Texture_3": { "url" : "undefined", ....

But there IS a texture. So i checked SceneExporters code there is
var output = [
    '\t' + LabelString( getTextureName( t ) ) + ': {',
'   "url"    : "' + t.sourceFile + '",',
'   "repeat" : ' + Vector2String( t.repeat ) + ',',
'   "offset" : ' + Vector2String( t.offset ) + ',',
'   "magFilter" : ' + NumConstantString( t.magFilter ) + ',',
'   "minFilter" : ' + NumConstantString( t.minFilter ) + ',',
'   "anisotropy" : ' + t.anisotropy,
'}'
];

The t parameter is map property of material which is THREE.Texture. But there is no "sourceFile" property or field in THREE.Texture. So what should it be? Is it a bug?

A: My own answer is below, changing SceneExporters Code corrected the output. I am not sure this is the official solution but i worked for me.
var output = [
    '\t' + LabelString( getTextureName( t ) ) + ': {',
'   "url"    : "' + t.image.src + '",',
'   "repeat" : ' + Vector2String( t.repeat ) + ',',
'   "offset" : ' + Vector2String( t.offset ) + ',',
'   "magFilter" : ' + NumConstantString( t.magFilter ) + ',',
'   "minFilter" : ' + NumConstantString( t.minFilter ) + ',',
'   "anisotropy" : ' + t.anisotropy,
'}'
];


text:
Q: Layout problem: Listview pushes View outside screen I have two textviews, a listview (this is a listactivity, by the way) and a datepicker. All is supposed to be displayed in this order, vertically.
The problem is that the ListView is pushing the datepicker below the screen, to the depths of the unseen world. I want the datepicker to have its own space, fixed at the bottom, while the listview grows as needed, but still allowing datepicker to have its own space.
+/- like this:
~~~~~~~~~~~~~~~ screen top

TextView 1

TextView 2

|

|

|

| ListView [*]

|

|

|

DatePicker (stays here no matter how much List grows or shrinks

~~~~~~~~~~~~~~~ screen bottom

[*] -> This listview will scroll a lot, but won't hide datepicker!
I know it's very lazy to ask for ready code, but could you guys share a light? This is driving me crazy. I've tried millions of combinations I believe.
Thank you a lot. This is all I need to finish my first app! :-(

A: Use RelativeLayout:
<RelativeLayout>
  <!-- other stuff goes here -->
  <DatePicker
    android:id="@+id/some_id"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"/>
  <ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_above="@id/some_id"/>
</RelativeLayout>

By the way, I just gave you the basic and important part... you will need to complete the code (for instance, you have to give a width and height to the RelativeLayout tag, put your TextViews, etc.)


text:
Q: Acess Denied on deleting a table in trino hive connector I'm using trino, I have an hive connector where i created a schema over it.
Im trying to delete tables inside the schema i created and i've got the error:
Access Denied: Cannot drop table
Ive tried to add 'allow-drop-table=true' but its only grant me access to delete tables on the default schema.


text:
Q: gsap animation plays only once when I put it inside angular ngOnInit function I have an angular 7 project and imported Gsap library. I want an animation to be played every time I navigate to a page so I've implemented the gsap animation inside ngOnInit, but the animation plays only for the first time I visit the page and in the next visits there is no animation. I've created a callback to log a message when the animation completes and every time I navigate to the page I can see the complete message is logged in the console but there is no animation.
here is my ts code:
import { Component, OnInit } from "@angular/core";
import { TweenMax } from "gsap";
@Component({
  selector: "app-list",
  templateUrl: "list.page.html",
  styleUrls: ["list.page.scss"]
})
export class ListPage implements OnInit {
  ngOnInit() {
    TweenMax.to("#myTarget", 1, {
      y: -50,
      onComplete: function() {
        console.log("animation completed");
      }
    });
  }
}

thanks for help!

A: actually, my code was working correctly!
the problem source was having two identical ids #myTarget in the homePage and listPage and when navigating between these two pages the gsap was confused with 2 unique ids. so I changed the id to class and problem solved


text:
Q: Powershell/Batch Files: Verify that a file contains at least one entry from a list of strings Here is my current issue: I have a list of 1800 customer numbers (ie 123456789). I need to determine which of these numbers show up in another, much larger (4 gb) file. The larger file is a fixed-width file of all customer information. I know how I would do this in SQL, but like I said it's a flat file.
When searching for individual numbers, I was using a command I found elsewhere on this site which worked very well:
get-content CUSTOMERINFO.txt -ReadCount 1000 | foreach { $_ -match "123456789" }

However, I do not have the expertise to translate this into another command, or a batch file, which would load list.txt and search all lines in customerinfo.txt for the requisite strings.
Time is not a major constraint, as this is running on a test server and will be a once-off project.
Thank you very much for any help you can provide.

A: So I appreciate everyone's help. Everybody gave me helpful info that let me get to my final solution, so I appreciate it. Especially to the guy who asked if this was a codewriting request, because it made me realize I needed to just write some code.
For anyone else who runs into the same problem, here is the code I ended up using:
$matches = Get-Content .\list.txt
foreach ($entry in $matches)
{ $results = get-content FiletoSearch -ReadCount 1000 | foreach { $_ -match $entry }
    if ($results -eq $null) {
    $entry }
    else {
    "found"}
    }

This gives a 'found' entry for everything that was found (which is information I don't need), and gives back the value searched for when it's not found (which is information I do need).

A: The match comparator can work over multiple values, you can separate them with a bar | character.
e.g.
get-content CUSTOMERINFO.txt -ReadCount 1000 | foreach { $_ -match "DEF|YZ" }
You can also read the contents of a file and replace newlines with a character of your choice.  So if list.txt is a list of values to search, such as
DEF
 XY

Then you can read it and convert it to a bar-separated list using the join operator:
(Get-Content list.txt) -join "|"
Put them together and you should have your solution:
$listSearch = (Get-Content list.txt) -join "|";
get-content CUSTOMERINFO.txt -ReadCount 1000 | foreach { $_ -match $listSearch}


text:
Q: Creating a report table in Python with nested lists I need to create a table which would represent marks of students in various modules. I was thinking of doing the following representation:
Students, a list of strings that are student names. For each i such that
0 <=i <= len(Students) - 1, we refer to Students[i] as the i-th student.

Modules, a list of strings that are modules names. For each i such that
0 <=i <=len(Modules) - 1, we refer to Modules[i] as the i-th module.

Marks a table whose rows correspond to the students and columns     correspond to the modules. Marks[i][j] is an integer number defined as follows.
{ If Marks[i][j] = -1 this means that the i-th student is not registered
for the j-th module.
{ If Marks[i][j] =>0 then this is the mark of the i-th student for the
j-th module. We can assume that the marks are in range 0-100,
there is no need to check the validity of the data.

For example, I have:
students=['Artur', 'Igor', 'David', 'Andy']
modules=['DM', 'ISD', 'INS', 'IS']
marks=marks[i][j]=int
for i in range(0, len(students)-1) #i ranges over all row numbers
    for i in range(0, len(students)-1) #j ranges over all indices
      print(a[i][j])

I am a little bit confused how to properly build a table so I could later count the average of rows, columns, marks and print student report. Is there a way to modify the algorithm so it would build a normal table?

A: A "table" might not be the best tool for the job, but to get you started, let's make a list for the marks, and append to it where needed, making sure we start a new list for each student. Let's just initialise everything to -1 for now.
students=['Artur', 'Igor', 'David', 'Andy', 'Fran']
modules=['DM', 'ISD', 'INS', 'IS']
marks = []
for i in range(len(students)):
    marks.append([])
    for j in range(len(modules)):
      marks[i].append(-1)

>>> marks
[[-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1]]

We now have a list of lists.
Notice a few things

*

*I have added and extra student to show we have five lists of four
modules.

*The range does not include the last number so you don't need
-1

*marks=marks[i][j]=int didn't mean anything. I have just made
a list and appended to it.

You can now change the scores of moduels, and find an average easily.
>>> marks[0][1] = 50
>>> marks
[[-1, 50, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1, -1, -1], [-1, -1
, -1, -1]]
>>> for scores in marks:
...   print sum(scores)/len(scores)
...
11
-1
-1
-1
-1

Now, there are alternatives such as a dictionary, which would allow you to look up students by name. Or even a defaultdict.


text:
Q: where para deletar registros que foram inseridos há um determinado tempo Queia ajuda para criar um delete com where caso o registro tenha sido inserido a mais de 5 minutos.
Tenho a tabela de marcação de ponto com as colunas:

*

*cd_cadastro - inteiro

*cd_empresa - inteiro

*cd_matricula - inteiro

*dt_ponto - varchar (porque estou enviando da aplicação Java como String a data)

A ideia é:
delete from ponto where "registro foi inserido há mais de cinco minutos"
ou
delete from ponto where hora_atual - dt_ponto > cincoMinutos
Ou se há outra alternativa para esta solução.
Preciso disso pois é uma regra da empresa que uma pessoa só possa inserir registro de ponto a cada 5 minutos. Então, essa é uma tabela que serve como referência do tempo de marcação de ponto. Na aplicação java, eu faço uma verificação, se houver registro de matricula nessa tabela é porque o usuário registrou ponto a menos de cinco minutos e não pode inserir outro registro.

A: Use a função DATE_SUB() para calcular a diferença de 5 minutos data, assim:
WHERE dt_ponto <= DATE_SUB(NOW(), INTERVAL 5 MINUTE);

O INTERVAL pode ser HOUR, MINUTE, etc, e como é DATE_SUB, vai subtrair 5 minutos, se fosse DATE_ADD, somaria.
Veja aqui um exemplo funcionando: https://www.db-fiddle.com/f/mrJ1axymtQmoHLhKJb2bXc/0


text:
Q: What does the scope_id parameter in g_scanner_scope_add_symbol represent? When using the Lexical Scanner GScanner I want to add my own symbols to scan for.  When looking for information I find only the API documentation and in other peoples source code like Gimp.  No where is there any explanation as to what scope does, unless I've missed something obvious.
I could use g_scanner_add_symbol and ignore the problem, but g_scanner_add_symbol is deprecated and the only one left to use is g_scanner_scope_add_symbol.  I understand how to add symbols to my custom scanner using this function, but I still have no idea what the parameter scope_id is used for.  I could just set it to zero every-time and not worry about it.  The problem is I don't like mysteries, and feel that scope_id could be very useful.  I want to know how useful.
What does scope_id in GScanner represent and how can I take advantage of it?

A: I guess you can use scopes to have different sets of symbols. Something like this:
...
g_scanner_set_scope (scanner, first_scope);
g_scanner_scope_add_symbol (scanner, first_scope, "ONE", GINT_TO_POINTER(1));
...
g_scanner_set_scope (scanner, second_scope);
g_scanner_scope_add_symbol (scanner, second_scope, "TWO", GINT_TO_POINTER(2));
// The scanner wont find the symbol "ONE" now

I'm not entirely sure about that, but that is what I thought scopes were for. You could easily test it, though.


text:
Q: How do i post a form data in angular js ? as the input is also being pre populated by a get request? How can i post a form data in angular js ?
I have a div which fills up the input filed from a GET request.
now i want to send this data in POST, How can i send the data ?
this is a form div :

        {{myMessage}}
        <form name="userForm" ng-submit="submitForm()">

                Make
                <input type="text" class="form-control" id="makeid"  ng-model="myMessage.make">

                    Vin
                    <input type="text" class="form-control" id="vinid" ng-model="myMessage.vin">

                        Modal
                        <input type="text" class="form-control" id="modalid" ng-model="myMessage.model">

                            Parts
                            <input type="text" class="form-control" id="partsid" ng-model="part.name">
                                <input type="text" class="form-control" id="partsid" ng-model="part.desc">

                                <button type="submit" class="btn btn-primary" onclick="sendData()">Submit</button>
                            </form>

i was trying to post this data at a url :

But i cant Find a way to post it through.
what are the ways can i send the data ?

A: If I get it right you want something like this:
                $http({
                    url: 'http://192.16.1.1:8080/restproj/v1/dealer/car',
                    method: "POST",
                    data: { 'message' : $scope.myMessage}
                })

A: You do not need the onSubmit on the button. In your controller, you need to specify a submitForm().
        app.controller('myCtrl', function ($scope, $http)
        {

            $scope.submitForm= function () {
                var message = $scope.myMessage
                $http.post('http://192.16.1.1:8080/restproj/v1/dealer/car',message).then(function (response) {

 },
    function (error) {
                    console.log(error);
                                    });
            }
        });

A: In AngularJS, don't use onclick. Instead us the ng-submit or ng-click directives.

    {{myMessage}}
    <form name="userForm" ng-submit="submitForm()">
        Make
        <input type="text" id="makeid" ng-model="myMessage.make">
        Vin
        <input type="text" id="vinid" ng-model="myMessage.vin">
        Modal
        <input type="text" id="modalid" ng-model="myMessage.model">

            Parts
            <input type="text" ng-model="part.name">
            <input type="text" ng-model="part.desc">

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

In the controller:
$scope.submitForm = function submitForm() {
    $http({
        url: 'http://192.16.1.1:8080/restproj/v1/dealer/car',
        method: "POST",
        //REMOVE
        //data: { 'message' : message }
        //INSTEAD
        data: $scope.myMessage
    })
    .then(function(response) {
            // success
    },
    function(response) { // optional
            // failed
    });
}

For more information, see AngularJS Developer Guide -- Forms


text:
Q: How to show that a if $v > c$ there is a frame which breaks causality in special relativity? I'm reading about special relativity and looking at the Lorentz transformations.
I'm reading that:

If $v > c$, we can find a frame in which $t_2' < t_1'$, i.e. a signal arrived before being sent.

I am trying to satisfy myself that that is true. I am beginning with the invariant spacetime interval:
$c\Delta t^{2} - \Delta x^{2} = c\Delta t'^{2} - \Delta x'^{2}$
I assume that I'm trying to show that $\Delta t' < 0$, but I'm not seeing how to do that.

A: What you want to do is draw a light cone (LC) based at the first event $t_1$ and draw the invariant sets of the Lorentz transformations, which are hyperboloids (H) - "outside" the light cone - and paraboloids (P) - "inside" the light cone.
If $v<c$ the second event is "inside" the light cone (say $t_2 > t_1$, i.e. the future light cone) and Lorentz transforming you'll be moving it along a paraboloid, it stays "inside" the light cone and we always have $t_2 > t_1$.
If $v>c$ the second event is "outside" the light cone and a Lorentz transform is moving it along a hyperboloid, meaning you can use a Lorentz transform to cross the $x$-axis/the $t_1$ mark and thereby reverse the order of the two events in the transformed system.

A: I presume that $v$ is the speed of some message that's FTL, so let's assign some spacetime coordinates to the events where the message is sent and received. For simplicity let's assume $c=1$ and that all coordinate frames are centered at the event where the message is sent, i.e. $(t_1, x_1) = (0,0)$ are the coordinates of event S (message sent) in all relevant frames. Event R (message is received) has in the Earth frame coordinates $(t_2, v t_2)$ (the message travelled for time $t_2$ at speed $v$ in the positive $x$ direction).
Now let's consider this in a reference frame boosted by $u$ relative to Earth, where $-1 < u < 1$ so we can use an ordinary Lorentz transformation, and with the origin arbitrarily stipulated to also be the event S (to simplify the math). Then the coordinates of event R in the new frame are found with a straightforward Lorentz transformation using $u$:
$(t_2', x_2') = \gamma (t_2 - ux_2, x_2 - u t_2) = \gamma (t_2 - uvt_2, vt_2 - ut_2)$, where $\gamma = \frac{1}{\sqrt{1 - u^2}}$.
We wish to solve for $t_2' < 0$, i.e. $\gamma(t_2 - uvt_2) < 0$. We know $\gamma > 0$ so we can ignore that factor, and just require that $t_2 < uvt_2$, i.e. $1 < uv$. But $v > 1$, so this is satisfied whenever $u > \frac{1}{v}$. So for example if the original FTL message was sent at $10c$ in the Earth frame, it will be traveling backwards in time in the frame of an STL spaceship moving at greater than 0.1c relative to the Earth and in the same direction as the FTL message.


text:
Q: how to change nsdate in nsdictionary I am trying to increment my NSDate. I have an NSDictionary, I am trying to increment my NSDate content in it. Say my NSDate is 2011-07-11, I want to increment the NSDate content in it.
got
{
    ConditionDatenew = "2011-07-21 13:31:46 +0000";
    Yesterday = "2011-07-20 13:31:46 +0000";
    city = #;
    condition = "Isolated Thunderstorms";
    country = #;

    "day_of_week" = Sun;
    high = 86;
    icon = "chance_of_storm.gif";
    low = 68;

    state = #;
}

I just want to get the date as 2011-07-22 in my ConditionDatenew in the next dictionary loop. How can I get it?

A: Create a new date object, and replace the old value in the dictionary. Dates are immutable.
NSDate *newDate = [NSDate date];
[dictionary setObject:newDate forKey:@"ConditionDatenew"];

[NSDate date] will set this to "now."
The easiest way to add a day is to add 24 hours. This works as long as DST is never an issue, and by "increment a day" you mean "increment by 24 hours." If you work exclusively in UTC, then that's fine.
NSDate *newDate = [oldDate dateByAddingTimeInterval:24*60*60];

If DST is an issue (and it usually is), and by "increment a day" you mean "increment by a Gregorian calendar day" then you need to use date components to make sure you add 23, 24 or 25 hours as appropriate.
  NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  NSDateComponents *dateComponents = [[NSDateComponents alloc] init];
  [dateComponents setYear:2011];
  [dateComponents setMonth:11];
  [dateComponents setDay:6];
  [dateComponents setTimeZone:[NSTimeZone timeZoneWithName:@"America/New_York"]];
  NSDate *date = [calendar dateFromComponents:dateComponents];

  NSDateComponents *addComponents = [[NSDateComponents alloc] init];
  [addComponents setDay:1];
  [addComponents setTimeZone:[NSTimeZone localTimeZone]];
  NSDate *newDate = [calendar dateByAddingComponents:addComponents toDate:date options:0];

  NSLog(@"oldDate=%@", [date descriptionWithLocale:[NSLocale currentLocale]]);
  NSLog(@"+24=%@", [[date dateByAddingTimeInterval:24*60*60] descriptionWithLocale:[NSLocale currentLocale]]);
  NSLog(@"newDate=%@", [newDate descriptionWithLocale:[NSLocale currentLocale]]);
  [calendar release];
  [dateComponents release];
  [addComponents release];

Output:
oldDate=Sunday, November 6, 2011 12:00:00 AM Eastern Daylight Time
+24=Sunday, November 6, 2011 11:00:00 PM Eastern Standard Time
newDate=Monday, November 7, 2011 12:00:00 AM Eastern Standard Time

If you don't care about the time, and have control over what you set it to, one trick is to set the time to noon. That way adding 24 hours will always fall on the correct day. I don't generally recommend this because it fails badly if you ever forget and create a date with a time of midnight. It's easier to put all of your day-incrementing code in one place and fix the DST problem one time than to make sure all of your date creation code is always right. So I recommend getting used to date components.

A: Try this:
NSDate *newDate = [NSDate date];
[dictionary setValue:newDate forKey:@"ConditionDatenew"];


text:
Q: Increase of threshold current by temperature in a laser diode I read somewhere that if we increase the temperature of the material in a laser diode the threshold current for lasing also increases. Can someone explain to me why is this happening? What is the mechanism inside the diode behind this increase?

A: "The increase in operating temperature increases the threshold current of the device — more drive current is needed to turn on the LASER diode.  This phenomenon is attributed to the fact that as temperature increases, the nonradiative processes in the device would increase and compete with the system for photons.  Thus, the threshold current increases with temperature." (http://www.askkia.com/articles/what-is-a-diode.html )


text:
Q: What is a good way to add percentage to my java program? I have to write a Java class to implement Benford's Law.
I can't figure out how to do the last part: "for each digit, output the percentage it appears as the first digit"
Could I get some help with this please?
import java.io.FileNotFoundException;

import java.util.Scanner;

import java.io.File;

public class BenfordLaw {
public static void main(String[] args) {

    String[] arrayOfData = new String[125];//Array creation
    // Read inn from the text file
    Scanner input = null;

    try {
        input = new Scanner(new File("worldPopulations.csv"));//instantiation

    }
    catch (FileNotFoundException e) {
        System.out.println("File was not found");
        e.printStackTrace();
        System.exit(0);

    }//end try catch block
    input.nextLine(); //so we can skip it

    int index = 0;
    while(input.hasNextLine()) {
        String line = input.nextLine();
        //System.out.println(Line);
        arrayOfData[index] = line;
        index++;

    }
    input.close();

    int[] count = new int[9];//setting limit for array

    //Now process our data
    for(int i = 0; i < arrayOfData.length; i++) {
        System.out.println(arrayOfData[i]);//tests to see that we filled the array correctly
        //find the first char in our string
        char firstChar = arrayOfData[i].charAt(0);
        int firstDigit = firstChar - '0';
        System.out.println(firstDigit);
        count[firstDigit - 1]++;

    }//end arrayOfData.length

    //look at the count of each digit
    for (int i = 0; i < count.length; i++) {
        System.out.println("Number of digit" + (i+1) + "'s is " + count[i] );
    }

}//end main

}//end class

A: You're pretty close to a solution. You have the counts array that holds how many times in your data set each digit (1-9) appears as the first digit. If you sum those counts (use a loop), then you can use that total as the denominator when calculating the percentage (count / total * 100) for each digit.
Make sure you cast the count to a floating point number before doing the division, or you'll get truncated results from integer division.


text:
Q: Angular js ng messages show error on init In my project I have angularjs 1.5.10 and ng-messages 1.5.10. I use it in simple form:
<form class="form-horizontal" ng-submit="createBooking()" role="form" name="createBookingForm" novalidate>

                            Last name

                                <input type="text"
                                       id="payment_details_last_name"
                                       name="payment_details_last_name"
                                       class="form-control"
                                       ng-model="payment_details.last_name"
                                       ng-required="true"
                                       ng-maxlength="30" />

This field is required

Your field is too long

</form>

In controller:
$scope.members = [{
      'first_name': '',
      'last_name': '',
      'email': '',
      'phone_number': '',
      'date_of_birth': '',
    }];

And on initial I always see error This field is required. I tried to create empty object in controller:
$scope.createBookingForm = {};

I also show form after initialized

Nothing is working. Project using angular-seed skeleton
I saw dirty hacks like if $touched else, but I want to understand what is wrong...

A: Nothing is wrong about it, check out the sample in the official guide. They have required error shown by default. It seems wrong for the first glance, but this is the only correct way to handle such a case.
So basically, ng-messages does exactly what docs says:

ngMessages is a directive that is designed to show and hide messages
  based on the state of a key/value object that it listens on.

the directive works in a real time and shows errors for current input state, that makes sense.
So if you want no messages to be shown by default, you should use some of approaches, discussed hundred of times
How to make ngMessage for required fields only show when dirty or submitting a form?
Angular : ng-message validation on submit click
AngularJS: Hiding ng-message until hitting the form-submit button
AngularJS 1.5.6 reset form & ng-messages
If you need some other improved behavior - there is no quick solution at the moment, you have to come up with your own validation engine that fit your needs.


text:
Q: Installshield 11 showing bad system call(core dumped) error while installing on solaris 11 x64 I am getting bad system call(core dumped) error while installing installshield on Solaris 11 x64. How should I troubleshoot this or any breakthroughs for getting more info on this inside Solaris.

A: You should examine what  "file" on the installshield executable returns, as well as ldd says.
If the binary is (partially) statically linked, it may not work as only
the interfaces defined in the dynamically linked libc are public.
If a binary is statically linked with libc, it may fail later in newer release.
In Solaris 11, we removed a number of the old system calls.


text:
Q: Using log4j with JBoss 7.1 How can I use log4j with JBoss 7.1?
I have a log4j-1.2.16.jar in my WebContent/WEB-INF/lib folder. When I output the result of Logger.getRootLogger().getClass().toString() I get class org.jboss.logmanager.log4j.BridgeLogger which is wrong.
If I add Dependencies: org.apache.commons.logging to my MANIFEST.MF file I get the same result.
This results into the problem that my log4j.properties file (which I created unter WEB-INF/classes) is ignored.

A: There will soon be a way that will just work for you, but currently you have to exclude the log4j dependency from your deployment. You will also have to manually invoke the PropertyConfigurator.configure() to load the properties file.
The following file (jboss-deployment-structure.xml) needs to contain the following:
<jboss-deployment-structure>
    <deployment>
        <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
        <exclusions>
            <module name="org.apache.log4j" />
        </exclusions>
    </deployment>
</jboss-deployment-structure>

Then adding including your own version of log4j in the WEB-INF/lib directory should work as you expect it to.


text:
Q: Request a specific expert on a subject to answer your question
Possible Duplicates:
Routing a Question to a Particular SO Member or Members
How to ask a question to a particular user of stackoverflow.com

There come times where you have an advanced question about a platform (not a problem/error). Typical developers watching that tag won't be able to answer it, or the few expert developers might miss it.
Example: C# expert Jon Skeet, VSTO expert Otaku, Symbian expert QuickRecipesOnSymbianOS
Some experts like Jon Skeet / Marc Gravell watch their respective tags, but that's no guarantee that your tough question will be seen by them.
So a way to request a specific user to answer a question will be useful. An implementation:

*

*Every question has "inform" link below it

*Clicking "inform" asks you for a specific user ID, eg. "23354" for Marc

*Marc then sees an alert on his Recent Activity page.

*Marc answers the tough question, and helps devs when they need him most

A: If this were possible, everyone would ping him with their question.  Given that, do you really think that feature would be useful to you?  Because either way you still won't stand out from the crowd or Jon has to just stop looking at any of the notices.  Either way, it doesn't help you at all.  And then put yourself in Jon's shoes for a minute.  Would you want to get a notice anytime anyone asks a question even remotely related to C#?  It'd get real annoying real quick.
I could maybe see this working if there were a stiff reputation penalty to use it - say spend 50 points or so every time you want to send a request and require the question be community wiki.  That should keep the volume to something reasonable.  But I think I'd still find it more annoying than flattering to be the target of such requests.

A: As a "high-rep" user (not necessarily an expert, but easily findable on the first page), I occasionally get random people commenting on answers I've given, requesting that I look at their newly posted question. This happened just the other day, and as it happens that new question didn't have anything to do with anything I was interested in, so I did what I normally do - flag the question for moderator attention and indicate the user is spamming.
That's also what I would consider such an "inform" feature to be. I answer questions on Stack Overflow on my own schedule and on my own whim. I would definitely not like to receive directed requests from random users about their latest question.

A:
Some experts like Jon Skeet / Marc Gravell watch their respective tags, but that's no guarantee that your tough question will be seen by them.

The very idea that anything is guaranteed, to anyone, is corrosive to community.
If you make your question good enough, it will attract the right audience. And if you don't .. well, fix your question!
Beyond that, of course:
Getting attention for unanswered questions?


text:
Q: Problem with raw latex output in R Markdown from python function I want to use R Markdown in combination with python and LaTeX.
I've found the module to_latex to convert a Pandas DataFrame to raw LaTeX code.
This works really fine in Python.
When I try this in Markdown I get some error messages like Undefined control sequence. l.146 \textbackslash. When I look into my tex-file there is some strange code, indeed. The table from the first five rows and columns of mtcars looks like the following:
`\textbackslash begin\{tabular\}\{llrrrr\}\n\textbackslash toprule\n{}
\& model \& mpg \& cyl \& disp \& hp
\textbackslash\textbackslash{}\n\textbackslash midrule\n0 \& Mazda RX4
\& 21.0 \& 6 \& 160.0 \& 110 \textbackslash\textbackslash{}\n1 \& Mazda
RX4 Wag \& 21.0 \& 6 \& 160.0 \& 110 \textbackslash\textbackslash{}\n2
\& Datsun 710 \& 22.8 \& 4 \& 108.0 \& 93
\textbackslash\textbackslash{}\n3 \& Hornet 4 Drive \& 21.4 \& 6 \&
258.0 \& 110 \textbackslash\textbackslash{}\n4 \& Hornet Sportabout \&
18.7 \& 8 \& 360.0 \& 175
\textbackslash\textbackslash{}\n\textbackslash bottomrule\n\textbackslash end\{tabular\}\n'

So there are these '\textbackslashs' that should not be there, there should be normal backslashs, LaTeX trys to escape them, I guess. Can I prevent this anyhow? My whole rmd script looks like this:
---
title: "Test"
author: "TobiSonne"
date: "5/17/2021"
output:
  pdf_document:
    number_sections: true
lang: de
fontsize: 12pt
header-includes:
  - \usepackage{float}
  - \pagenumbering{gobble}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  fig.height = 4,
  fig.width = 7,
  echo = TRUE,
  fig.align  = "center",
  fig.pos = "H",
  out.extra = "",
  warning = FALSE,
  message = FALSE)
library(reticulate)
```

```{python}
import pandas as pd
```

```{python}
Data = pd.read_csv("mtcars.csv").iloc[0:5, 0:5]
```

```{python, results = "asis"}
Data.to_latex()
```

A: OK, I have a solution:
In the YAML one has to add \usepackage{booktabs} and the last chunk must be:
```{python, results = "asis"}
print(Data.to_latex(escape = False))
```


text:
Q: The magic and the mundane, man of two worlds I remember a book leant to me, middle-part of a series (?) in the early-mid 1990's, written in English.
The protagonist possessed the ability to move between the mundane world of his not-especially-exciting life into a magical world. In the real-world, he was no-one in particular, a dull job, single-life, small flat.
In the magical world, he was a wizard/sorcerer of great power, battling forces of chaos/evil. To enact the magics, he'd speak a spell - nothing special, just words which stated what needed to happen, but the condition was that they only worked once, a unique form of incantation per spell. Repeating an old spell's words didn't work.
On one cliff-hanger chapter-ending, in the real-world he received a gunshot, this wouldn't normally be a problem, as he would move to the magical world and transform the bullet/cure the wound - but on this occasion, an enemy from the magical world had made the bullet from a poisonous creature (chimera ?) such that if he moved to the magical world, the creature's touch would instantly kill.
The protagonist came-up with a neat solution which I forget.

A: That is definitely one of the books from Piers Anthony's Apprentice Adept series — the "bullet" plot line clinches it. Let me go look exactly which book it is — < Jeopardy theme music plays > — it's the second book in the series, Blue Adept.