text:
Q: Losing Button.Click events after first partial postback in UpdatePanel I have a Page that has a single instance of a UserControl that itself has a single UpdatePanel.  Inside the UpdatePanel are several Button controls.  The Click event for these controls are wired up in the code-behind, in the Init event of the UserControl.
I get the Click event for the first button I push, every time, no problem.  After that, I only get Click events for one button (SearchButton) - the rest are ignored.  I have included the code for the control below - for sake of brevity, I have excluded the click event handler methods, but they are all of the standard "void Button_Click(object sender, EventArgs e)" variety.  Any ideas?
<asp:UpdatePanel ID="PickerUpdatePanel" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:Panel ID="Container" runat="server">

                <asp:TextBox ID="PickerResults" runat="server" style="margin-right: 3px;" SkinID="Plain" />
                <asp:Image
                    ID="LaunchPopup" runat="server" ImageUrl="~/images/icons/user_manage.png"
                    ImageAlign="Top" BorderColor="#294254" BorderStyle="Dotted" BorderWidth="1px"
                    Height="20px" Width="20px" style="cursor: pointer;" />

            <asp:Panel ID="PickerPanel" runat="server" DefaultButton="OKButton" CssClass="popupDialog" style="height: 227px; width: 400px; padding: 5px; display: none;">
                <asp:Panel runat="server" id="ContactPickerSearchParams" style="margin-bottom: 3px;" DefaultButton="SearchButton">
                    Search: <asp:TextBox ID="SearchTerms" runat="server" style="margin-right: 3px;" Width="266px" SkinID="Plain" />
                    <asp:Button ID="SearchButton" runat="server" Text="Go" Width="60px" SkinID="Plain" />
                </asp:Panel>
                <asp:ListBox ID="SearchResults" runat="server" Height="150px" Width="100%" SelectionMode="Multiple" style="margin-bottom: 3px;" />
                <asp:Button ID="AddButton" runat="server" Text="Add >>" style="margin-right: 3px;" Width="60px" SkinID="Plain" />
                <asp:TextBox ID="ChosenPeople" runat="server" Width="325px" SkinID="Plain" />

                    <asp:Button ID="AddNewContact" runat="server" SkinID="Plain" Width="150px" Text="New Contact" />

                    <asp:Button ID="OKButton" runat="server" Text="Ok" SkinID="Plain" Width="100px" />

                <input id="SelectedContacts" runat="server" visible="false" />
            </asp:Panel>
            <ajax:PopupControlExtender ID="PickerPopEx" runat="server" PopupControlID="PickerPanel" TargetControlID="LaunchPopup" Position="Bottom" />
        </asp:Panel>
   </ContentTemplate>
   <Triggers>
        <asp:AsyncPostBackTrigger ControlID="AddButton" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="SearchButton" EventName="Click" />
        <asp:AsyncPostBackTrigger ControlID="AddNewContact" EventName="Click" />
    </Triggers>
</asp:UpdatePanel>

public partial class ContactPicker : System.Web.UI.UserControl
{
    protected void Page_Init(object sender, EventArgs e)
    {
        SearchButton.Click += new EventHandler(SearchButton_Click);
        AddButton.Click += new EventHandler(AddButton_Click);
        OKButton.Click += new EventHandler(OKButton_Click);
    }

    // Other code left out
}

A: It seems that adding UseSubmitBehavior="false" to the button definitions has solved my problem.  Still don't know why that first button click worked at all.

A: The most likely reason for this would be the client IDs that .Net generates for its controls changing. These are dynamically assigned and could change between postbacks / partial postbacks.
If controls are being added to the panel dynamically, the ID of your button could be different between postbacks causing .Net to be unable to tie the click event to the correct event handler in your code.

A: In my case, i had a LinkButton within a dgPatients_ItemDataBound event handler that used the PostBackUrl property.
The moment i changed the LinkButton to a HyperLink, the problem went away.


text:
Q: Will layout folders fix the tablet compatibility? I read a few things about how to make your app compatible with tablets. Some say about using your code and some say about the layout folders or some about the sw600dp and sw720dp folders. I am really confused and am not 100% sure which is the most simplest way to just make it play on a tablet.
What i did is i made 3 more layout folders (large, xlarge and small, I already had the drawable classes in all sizes but i didnt change the size of the images, its in all drawables the same size) and in these 3 extra folders i copied the same files i had in the plain layout folder. So i have 4 layouts with all the xmls the same.
Will this make it compatible with tablet and fix my issue?

A: for Xlarge use this folder drawable-xlarge-hdpi
for large use this folder drawable-large-xhdpi
layout-large (7 inch)
layout-xlarge(10 inch) folder are used for layouts

A: The Simplest way to make your app adopt to different hardware configurations is using folders. The framework will do all the work for you. (tutorial)

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to create new json object from a dict in python? What is the best way to create a dict, with some attributes, from another dict, in Python?
For example, suppose I have the following dict:
dict1 = { "name": "Juan", "lastname": "Gonzalez", "swimming": "yes", "soccer": "no"}

I would like to obtain:
dict2 = { "name": "Juan", "lastname": "Gonzalez", "hobbies": {"swimming": "yes", "soccer": "no"}}

Which I only need to add the "hobbies"

A: The easy answer:
dict2 = {"name": dict1["name"], "lastname": dict1["lastname"], hobbies: {"swimming": dict1["swimming"], "soccer": dict1["socccer"]}}

A more flexible answer:
toplevel_keys = ['name', 'lastname']
hobbies_keys = ['swimming', 'soccer']
dict2 = {key: dict1[key] for key in toplevel_keys}
dict2['hobbies'] = {key: dict1[key] for key in hobbies_keys}


text:
Q: Splitting by comma doesn't work as expected I Read some data from a text file, I am trying to iterate line by line and split by comma, and I ignore lines that starts with #, here is the text file content:

#this is the simulation file for your exercise, please read it carefully.
#every line that begins with a pound sign [now known as "the" hashtag (#)] is a comment line. you can automatically skip it.
#here are a few examples.
#there will be 5 categories : Comedy, Adventure, Educational, SciFi, Fantasy.
  #it is recommended that when you save in the main program, that you follow this convetion.
  #the input syntax :
  #id,book name,author,pages,yearofpublishing,category
  CNV301,Treasure Island,Robert Louis Stevenson,304,1882,Adventure
  8T88FF,Heir to The Empire,Timothy Zahn,416,1992,SciFi
  911MAR10,Plumbing for Dummies,Gene Hamilton,242,1999,Educational
  6U754E,Berserk,Kenturo Miura,224,1989,Fantasy
  7R011,The Troll Cookbook : Human Delights,Underchief Trogdor,7,-35,Educational
  M140,Funny Cats,Jean-Claude Suarès,78,1995,Comedy
  V269W7,Linus the Vegetarian T. rex,Robert Neubecker,40,2013,Adventure
  UFF404,Algebra 3,Nebi Rogen,300,0,Educational
  424242,The Hitchhiker's Guide to the Galaxy,Douglas Adams,224,1979,Comedy
#add your own.  you can use sites like : http://www.generatedata.com/  to create quick lists.

Here my code:
  FILE* file = fopen(filepath, "r");
    char line[256] = "";
    while (fgets(line, sizeof(line), file) != NULL) {
    if (!starts_with(line, "#") && !starts_with(line, " "))
    {
            if (line[0] == '#' || line[0] == '\n')
                continue;  // skip the rest of the loop and continue
            printf("%s", line);

            char* p;
            p = strtok(line, ",");
            while (p != NULL)
            {
                //printf("%s\n", p);  //<-- line*******
                p = strtok(NULL, ",");
            }
     }
    }
        fclose(file);

where:
int starts_with(const char* line, const char* c)
{
    size_t lenpre = strlen(c),
        lenstr = strlen(line);
    return lenstr < lenpre ? 0 : strncmp(c, line, lenpre) == 0;
}

*

*When I run the code and I prints the first line with some weird characters like: #this is the simulation file for your exercise, please read it carefully.

*if I enables the commented line: //<-- line*******
   I get error: "Access violation reading location", I only want to see the splitted values


text:
Q: How can I use kickstart or something else at the command line to view ARD settings? I know I can use kickstart to configure Apple Remote Desktop from the command line, but, I can't find anything on the Internet or in kickstart's help message indicating how I can view the current settings from the command line. Does anyone know where I can get these settings?

A: Just check the manual:
man /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart

which reads:
sub Usage1 {
    qq{ kickstart -- Quickly uninstall, install, activate, configure, and/or restart
             components of Apple Remote Desktop without a reboot.

kickstart -uninstall -files -settings -prefs

      -install -package <path>

      -deactivate
      -activate

      -configure -users <user1,user2...>
        -access -on  -off
        -privs  -all -none
                -DeleteFiles
                -ControlObserve
                -TextMessages
                -ShowObserve
                -OpenQuitApps
                -GenerateReports
                -RestartShutDown
                -SendFiles
                -ChangeSettings
                -ObserveOnly
                -mask <mask>

        -allowAccessFor
                -allUsers [-privs <priv options>]
                -specifiedUsers

        -computerinfo -set1 -1 <text>
                      -set2 -2 <text>
                      -set3 -3 <text>
                      -set4 -4 <text>

        -clientopts
          -setmenuextra -menuextra  yes


text:
Q: How to use OpenJPA 2.2 on WebSphere 7.0? I'm starting a project where I need to use OpenJPA 2.2 and run on WAS 7.0.
How do I make WAS 7.0 pick up the OpenJPA 2.2 jar instead of using its own?

A: You may configure OpenJPA 2.2 as outlined in WAS7 infocenter at Using third-party persistence providers article.
It is stated in this article that in addition to using JPA providers from other vendors, "Applications can also specify an Apache OpenJPA provider that is other than the version that is included with the application server."


text:
Q: jackson serializer: get serialized object I have a problem with Serializer, here is my problem :
I have a bean class like that :
@JsonSerialize(using = MyObjectSerializer.class)
public class MyObject {
    public int a;
    public boolean b;
}

When Serializing through Jackson, without the @ JsonSerialize annotation, I obviously get :
{ "a": 42, "b": true}

But I need to add a property so it gives :
{ "a": 42, "b": true, "version": "0.1-beta" }

(This is an example, in the real world, the property I add depends on several properties of the object)
So I need to write a custom serializer.
However, in my real code, the class contains much more properties than just 2. So I don't want to manually create those properties to the json object...
If I use this :
public static class MyObjectSerializer extends JsonSerializer<MyObject> {
    @Override public void serialize(MyObject obj, JsonGenerator json, SerializerProvider provider) throws IOException, JsonProcessingException {
        json.writeObject(obj);
    }
}

I obviously get a StackOverflowError.
So the question can be :

*

*How, from inside a JsonSerializer can I serialize the object without re-calling the serializer itself ?
or

*

*How can I dynamically add properties to an object beeing serialized.
I used to do that all the time with GSon but Jackson provides loads of feature that I would love to use ;)

A: I'm pretty sure a getter, in your example getVersion(), without a backing property would suffice, in which you'd generate 0.1-beta. (or generate the value based on the values of a couple of properties as you describe).
So no need for a custom serializer just for this purpose


text:
Q: $E=F(\alpha_1, \cdots, \alpha_n)$ where $\alpha_1, \cdots, \alpha_n$ are distinct and separable over $F$ Let $E/F$ be a finite extension. TFAE:
(1) $E/F$ is separable.
(2) $E=F(\alpha_1, \cdots, \alpha_n)$ where $\alpha_1, \cdots, \alpha_n$ are distinct and separable over $F$
To show (2) $\Rightarrow$ (1), WLOG assume $ch(F)=p$ for some prime $p$.
We can inductively define $F=E_0, E_i=F(\alpha_1, \cdots, \alpha_i), E_n=E$. A given hint is to show $E_{i+1}=E_i(E_{i+1}^p)$. From the hint I conclude that
$E_{i+1}=E_i(E_{i+1}^p)= \cdots=F(E_1^p)(E_2^p)\cdots(E_{i+1}^p)=F((E_1E_2\cdots E_{i+1})^p)=F(E_{i+1}^p)=F(F(\alpha_1, \cdots, a_{i+1})^p)=F(\alpha_1^p, \cdots, \alpha_{i+1}^p)$
I guess $E_{i+1}^p=E_{i+1}$ so that $E_{i+1}$ is perfect, but I couldn't really show this so far.
I would appreiciate any help but I prefer not to use field embedding for proof cause it wasn't discussed in my class.
Thank you.


text:
Q: how to set a form in secondary screen I have written a program (C#) which loads a form.  On the primary screen it displays different text when I click OK.  But the problem is... I am working with dual monitor, so when I load a form on the primary screen and drag it to secondary screen and click OK, it automatically moves back to the primary screen.
I have written a method which determines which screen the form is currently loaded on, which is working fine. However, when I tried to relocate it to the secondary screen, it no longer works (it's still moving back to the primary screen).  I'm not sure what I'm doing wrong.
Here is my code:
if(Currentscreen == "primary")
{
    forma.showDialog(this);//this is ok showing form on main screen
}
else
{
    int showOnMonitor = 1;
    Screen[] scr;
    scr = Screen.AllScreens;
    forma.StartPosition = FormStartPosition.CenterParent;
    forma.Location = new Point(sc[showOnMonitor].Bounds.Left, sc[showOnMonitor].Bounds.Top);  //this line should relocate it on secondary screen
    forma.showDialog(this);  //but its again loading on Primary monitor
}


text:
Q: C# -export datagridview to excel with leading zero in c# While exporting the datagridview to Excel in C#.net ,leading zeros are missing.
For example : Data in the cell is "001693"
After exporting to excel it is displaying me like this "1693".
Please help me out of this.
this is my code;
            Microsoft.Office.Interop.Excel._Application app = new Microsoft.Office.Interop.Excel.Application();
            Microsoft.Office.Interop.Excel._Workbook workbook = app.Workbooks.Add(Type.Missing);
            Microsoft.Office.Interop.Excel._Worksheet worksheet = null;

            worksheet = workbook.Sheets["Sheet1"];
            worksheet = workbook.ActiveSheet;
            worksheet.Name = "Exported from gridview";
            for (int i = 1; i < dataGridView1.Columns.Count + 1; i++)
            {
                worksheet.Cells[1, i] = dataGridView1.Columns[i - 1].HeaderText;
            }

            for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
            {
                for (int j = 0; j < dataGridView1.Columns.Count; j++)
                {
                    worksheet.Cells[i + 2, j + 1] = dataGridView1.Rows[i].Cells[j].Value.ToString();
                }
            }
            var saveFileDialoge = new SaveFileDialog();
            saveFileDialoge.FileName = "output";
            saveFileDialoge.DefaultExt = ".xlsx";
            if (saveFileDialoge.ShowDialog() == DialogResult.OK)
            {
                workbook.SaveAs(saveFileDialoge.FileName, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
                app.Visible = true;

A: You need to set text format to cell where you want to save number with leading zeroes.
In this sample I add code which set text format for entire row to speed up processing.
for (int i = 0; i < dataGridView1.Rows.Count - 1; i++)
{
    (worksheet.Rows[i+2 + ":" + i+2, System.Reflection.Missing.Value] as Excel.Range).NumberFormat = "@";
    for (int j = 0; j < dataGridView1.Columns.Count; j++)
    {
        worksheet.Cells[i + 2, j + 1] = dataGridView1.Rows[i].Cells[j].Value.ToString();
    }
}


text:
Q: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'doogmas3.timelineables' doesn't exist Vaya por delante que quizás lo he planteado mal, llevo poco tiempo en esto.
Estoy creando una pequeña red social, donde los usuarios pueden dar like a los posts, crear comentarios, etc.
Cada una de las funcionalidades se genera correctamente a traves de sus modelos y controladores.
Pero me gustaria poder tener una especie de timeline para poder mostrar de forma cronologica la actividad de cada usuario, por ejemplo: si ha dado like, si ha comentado en xx post, etc.
Para este proposito he creado una tabla polimorfica donde guardo el id y el modelo de la acitividad y cada vez que un usuario hace una funcion, a parte de guardarla en su tabla correspondiente guardo también el registro en la tabla polimorfica.
Esta es la migración:
Schema::create('timelines', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id');
            $table->unsignedBigInteger('timelineable_id');
            $table->string('timelineable_type');
            $table->enum('type', [Timeline::COMMENT, Timeline::SHAREPOST, Timeline::SHARESOCIAL, Timeline::CREATESOCIAL]);
            $table->text('text')->nullable();
            $table->timestamps();

            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        });

Ahora lo que necesito es poder crear las relaciones necesarias en el modelo timelines para sacar el registro de cada actividad con su correspondiente tabla, por ejemplo para poder hacer algo asi:
$timelines->comment
$timelines->sharepost
$timelines->sharesocial

El modelo timelines lo tengo asi:
class Timeline extends Model
{
    use HasFactory;
    protected $guarded = ['id'];
    const SURVEY = 1;
    const COMMENT = 2;
    const SHAREPOST = 3;
    const SHARESOCIAL = 4;
    const CREATESOCIAL = 5;

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

    public function comments()
    {
        return $this->morphedByMany(Comment::class, 'timelineable');
    }
}

Cuando intento acceder a la relacion:
{{$timeline->comments}}

Me da este error:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'doogmas3.timelineables' doesn't exist (SQL: select `comments`.*, `timelineables`.`timeline_id` as `pivot_timeline_id`, `timelineables`.`timelineable_id` as `pivot_timelineable_id`, `timelineables`.`timelineable_type` as `pivot_timelineable_type` from `comments` inner join `timelineables` on `comments`.`id` = `timelineables`.`timelineable_id` where `timelineables`.`timeline_id` = 45 and `timelineables`.`timelineable_type` = App\Models\Comment) (View: C:\laragon\www\doogmas\resources\views\livewire\front-end\social\share-content.blade.php)

El controlador trae todo el timeline asi:
$timelines = Timeline::orderBy('id', 'DESC')->whereIn('user_id', $followings)->get();

Esto me devuelve el registro de actividad de todos los usuarios que sigo.
y mi idea es hacer un foeach e ir mostrando todas las actividades que estan registradas.
Por ejemplo:

*

*El usuario x ha comentado en yy posts

*el usuario y ha dado like a este post

*el usuario z ha creado este post

Evaluo en cada iteración y depende el type de la table timeline pues muestro una relacion u otra
@if($timeline->type==Comments) {
   $timeline->comments
}

y así con todo los type

A: Si timeline es tu tabla polimórfica, entonces en el modelo Timeline tienes el primer error al declarar ahi mismo el método comments el cual de hecho deberás mover a la clase del modelo que va a estar vinculado con el anterior mencionado.
Entonces tu clase Timeline deberías tener algo como lo siguiente:
class Timeline extends Model
{
    use HasFactory;
    protected $guarded = ['id'];
    const SURVEY = 1;
    const COMMENT = 2;
    const SHAREPOST = 3;
    const SHARESOCIAL = 4;
    const CREATESOCIAL = 5;

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

Ahora es en el otro modelo donde debes indicar la relación por medio del método comments
pero aqui esta el segundo error, estas pasando como primer argumento una clase llamada Comment cuando de hecho la que deberías indicar es: TimeLine pues es esta la polimórfica, de la siguiente manera:
class OtroModelo extends Model
{
    public function comments()
    {
        return $this->morphMany(Timeline::class, 'timelineable');
    }
}

Ahora si podrás escribir la consulta de este modo:
OtroModelo::with('comments')->get();

De hecho si me permites la observación, si la clase se llama TimeLine entonces el método no debería ser comments si no entodo caso timelines digo para tratar de llevar orden en el código que escribimos y lo que se supone que esta destinado a hacer.
Sugiero revises de nuevo la doc. al respecto


text:
Q: How can I create over 10,000 records with information from Visualforce? I have an inventory input page that I am working on and I am running into an issue where I need to create more than 10k records. The problem here is that all the information needed is not stored in an object but captured on the web page. Inventory numbers are entered and difference calculations are done to determine how many records to create. A record is created for each number in between 2 numbers the user inputs. The case I just tried and hit the limitation on attempted to create 27,500 records.
I assumed that I could use Batch processing but I can only find information related to querying for records and the Start method needs to return a Database.QueryLocator object.
Another option I am considering is breaking the lists into chunks less than 10k per list and calling a series of future methods - this would allow me to insert 100k records. The information could be passed in as a JSON string and broken down on the otherside.
Is anyone aware of something else that I can use to insert this many records with information collected during one execution context?

A: You don't need to use a QueryLocator. For example, you could write it like this:
public class MakeRecords implements Database.Batchable<SObject> {
    SObject[] queue;
    public MakeRecords(SObject[] records) {
        queue = records;
    }
    public static SObject[] start(Database.BatchableContext context) {
        return queue;
    }
    public static void execute(Database.BatchableContext context, SObject[] records) {
        insert records;
    }
    public void finish(Database.BatchableContext context) {
    }
}

You could also have some wrapper class and iterate through those items, if that's easier to code. You could even have an array of JSON strings, and deserialize the strings in the execute method.
The only requirement is that your start method must finish in 10 minutes. Normally, this isn't a problem, but do keep in mind that non-QueryLocator implementations will be rather severely limited (5 million or so values instead of 50,000,000 records).
You could even perform the "calculations" you mentioned in the start method, and return the results from start.
Your Visualforce page can periodically poll the AsyncApexJob table by job ID to show the user a progress bar.


text:
Q: How do I check my version of GNOME-Shell? There's got to be some simple way I'm missing, but for the life of me I can't find it. How do I check my version of GNOME-Shell?

A: Just type
gnome-shell --version

into a terminal.

A: The gnome-shell man page doesn't show --version as an option. Assuming you have installed it from the ubuntu repositories then you can look up the version in the repository. To just show the version:
apt-cache show gnome-shell | grep Version

On Ubuntu Maverick (10.10) I get
Version: 2.31.5-2ubuntu2

Note that this works whether or not the package is installed. You can also look up all packaged versions of gnome-shell on all ubuntu versions on http://packages.ubuntu.com/


text:
Q: Turkey Continues on Daylight Saving Time From 2016 - Impact on Postgresql what is impact on Postgresql databases? Jobs ,date columns datas will be affected?

A: postgresql uses the zoneinfo database for time zone computations. The database's 2016g version which was released 2 weeks ago, includes an update to handle the situation for Turkey correctly. For now, you'll have to wait for the postgresql developers to pull the latest version of zoneinfo into postgresql and then release a new version. You can check what postgres thinks for Turkey's timezone as follows:
$ SET TIME ZONE 'Asia/Istanbul';
$ SELECT extract(timezone FROM '2016-06-01'::timestamptz), extract(timezone FROM '2016-12-01'::timestamptz);
 date_part | date_part
-----------+-----------
     10800 |      7200
(1 row)

As you can see, on my system (postgresql 9.5.4), it still thinks that Turkey will switch to +2 offset in the winter.

A: As soon as this change hits the IANA timezone library, it will be included in PostgreSQL with the next minor release. This has happened with commit a03339aef2, so the change will be in 9.6.1, 9.5.5, 9.4.10, 9.3.15, 9.2.19 and 9.1.24.
Data of type timestamp with time zone will not be affected, as they are stored in UTC internally. If your client time zone is set to Turkey or equivalent, the data will be displayed with the (new) correct time zone offset.
Data of type timestamp without time zone will stay the same, so they will not be automatically shifted to the new time zone offset upon display. But it's almost always a mistake to use that data type anyway.


text:
Q: Xetex Hebrew PDF output problem in Lyx I am trying to compile a document that contains both English and Hebrew. The problem is, that although I have selected Documents | Settings | Use non-tex fonts via XeTeX |LuaTeX, there is no option to export the file to PDF via Xetex (LuaTex always gives me all sorts of errors about not recognizing fonts). I then tried to see if XeTeX is installed, by entering the following into a terminal:
sudo apt-get install texlive-xetex

In case it helps/matters: I'm running Lyx 2.0 on a Linux Mint machine. An extensive search, unfortunately, yielded no answers that worked.
So, my question is: How can I export the document to PDF via XeTeX (I only have the LuaTeX option)?
(P.S. If this question has been previously answered, I'd greatly appreciate a link to the page!)

A: You need to select the font. For an example, do the following. After
sudo apt-get install culmus culmus-fancy

in LyX go to File > Open, click on the examples button, click on he and open splash.lyx. Then go to Document Settings > Fonts, check Use non-TeX fonts and for all of the fonts, choose Frank Ruehl CLM (this was installed by the culmus package, along with several others). Finally, change Article (Hebrew) to article and compile.
The last change is necessary because (although I'm not sure why), XeTeX does not seem to like the following (which is added by Article (Hebrew):
\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

Following the above steps leads to the following pdf

produced by the following code:
%% LyX 2.1.0dev created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english,hebrew]{article}
\usepackage{amssymb}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{Frank Ruehl CLM}
\setsansfont[Mapping=tex-text]{Frank Ruehl CLM}
\setmonofont{Frank Ruehl CLM}
\usepackage{url}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\providecommand{\LyX}{L\kern-.1667em\lower.25em\hbox{Y}\kern-.125emX\@}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\frenchspacing

\makeatother

\usepackage{xunicode}
\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}

\title{ברוכים הבאים ל- \textenglish{\LyX{}}}

\maketitle

\section*{כמה נקודות שחשוב לדעת על שימוש ב- \textenglish{\protect\LyX{}}}
\begin{enumerate}
\item \textenglish{\LyX{}} מגיע עם מסמכי תיעוד ועזרה מצויינים \textenglish{—}
מומלץ להשתמש בהם. כדאי להתחיל בקריאת הקובץ \textsf{עזרה$\vartriangleleft$מבוא},
המהווה הקדמה קצרה לתיעוד. לאחר מכן, ניתן להמשיך בקריאת \textsf{עזרה$\vartriangleleft$השיעור~המודרך}
על מנת ללמוד איך להשתמש ב- \textenglish{\LyX{}}.
\item אנחנו מתייחסים אל \textenglish{\LyX{}} כאל \char`\"{}מעבד מסמכים\char`\"{}.
הוא מתוכנן להיות שונה ממעבד תמלילים רגיל כך שמלאכת כתיבת המסמכים תהיה
קלה יותר. מסמכי העזרה והתיעוד יבהירו לך סוגיה זו%
\footnote{האם כבר הזכרנו כמה חשוב לקרוא אותם?%
}.
\item הפלט שיוצא מ- \textenglish{\LyX{}} נראה פשוט נהדר \textenglish{—}
לחץ על \textsf{תצוגה}$\vartriangleleft$\textenglish{\textsf{Dvi}}
וראה בעצמך.
\item \textenglish{\LyX{}} מסוגל לחקות (כמעט) את כל האפשרויות של \textenglish{\LaTeX{}},
והוא מסוגל לייבא קבצי \textenglish{\LaTeX{}}. משתמשי \textenglish{\LaTeX{}}
מנוסים יכולים לפיכך לקרוא את \char`\"{}השיעור המודרך\char`\"{} ברפרוף
ולהעמיק בחלק ''\textenglish{\LyX{}} למשתמשי \textenglish{\LaTeX{}}\char`\"{}
(כל השאר אל תדאגו! לא צריך לדעת \textenglish{\LaTeX{}} בשביל להשתמש
ב- \textenglish{\LyX{}}).
\item \textenglish{\LyX{}} מכיל מגוון של אפשרויות המיועדות עבור משתמשים
הכותבים או קוראים שפות נוספות חוץ מאנגלית. בנוסף לכך, ניתן להתאים
אישית מקשי קיצור, סרגלי כלים ותכונות נוספות רבות. ראה \textsf{עזרה}
\textsf{$\vartriangleleft$התאמה~אישית.}
\item דף הבית של \textenglish{\LyX{}} הוא: \url{http://www.lyx.org}. באתר
זה תוכלו לקבל מידע נוסף על התוכנה, להרשם לרשימות הדיוור וללמוד מהסיור
המודרך של \textenglish{\LyX{}}.\end{enumerate}

\end{document}


text:
Q: Importing a source dependency with Gradle (Kotlin DSL) I want to import version 1.0.0 of this project https://github.com/whichdigital/ksv
as a source dependency in a Kotlin project using Gradle 6.3 with Kotlin DSL.
As the page tells me I added this into the settings.gradle.kts of my project
sourceControl {
    gitRepository(java.net.URI.create("https://github.com/whichdigital/ksv.git")) {
        producesModule("uk.co.whichdigital:ksv")
    }
}

and using this dependency in my build.gradle.kts file:
implementation("uk.co.whichdigital:ksv:1.0.0")

trying to import tagged version/release 1.0.0 of the KSV repo. But building my project (importing the KSV repo) fails with following expection:
TaskDependencyResolveException: Could not determine the dependencies of task ':bootJar'.
...
Caused by: DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all task dependencies for configuration ':runtimeClasspath'.
....
Caused by: ModuleVersionResolveException: Git repository at https://github.com/whichdigital/ksv.git did not contain a project publishing the specified dependency.
Required by:
    project :

I'm actually also the person who wrote/published the KSV-repository, so if there's some configuration that I missed, I can add it in the imported or importing project.

A:
"uk.co.whichdigital:ksv:1.0.0" group id is wrong.

Can you please try
sourceControl {
   gitRepository(java.net.URI.create("https://github.com/whichdigital/ksv.git")) {
     producesModule("uk.co.whichdigital.ksv:ksv")
   }
}

implementation("uk.co.whichdigital.ksv:ksv:1.0.0")


text:
Q: Error while compiling/linking OpenCV Matlab source files After successfully compiling 95% of OpenCV, I get the error
(...)
[ 95%] Built target opencv_videostab
[ 95%] Generating Matlab source files
[ 95%] Built target opencv_matlab_sources
[ 95%] Compiling Matlab source files. This could take a while...
CMake Error at compile.cmake:47 (message):
  Failed to compile logPolar: /usr/bin/ld: cannot find -lopencv_core

  /usr/bin/ld: cannot find -lopencv_imgproc

  /usr/bin/ld: cannot find -lopencv_ml

  /usr/bin/ld: cannot find -lopencv_highgui

  /usr/bin/ld: cannot find -lopencv_objdetect

  /usr/bin/ld: cannot find -lopencv_flann

  /usr/bin/ld: cannot find -lopencv_features2d

  /usr/bin/ld: cannot find -lopencv_photo

  /usr/bin/ld: cannot find -lopencv_video

  /usr/bin/ld: cannot find -lopencv_videostab

  /usr/bin/ld: cannot find -lopencv_calib3d

  /usr/bin/ld: cannot find -lopencv_stitching

  /usr/bin/ld: cannot find -lopencv_superres

  /usr/bin/ld: cannot find -lopencv_nonfree

  collect2: ld returned 1 exit status

      mex: link of ' "logPolar.mexa64"' failed.

make[2]: *** [modules/matlab/compile.proxy] Error 1
make[1]: *** [modules/matlab/CMakeFiles/opencv_matlab.dir/all] Error 2
make: *** [all] Error 2

This confuses me, because as far as I understand all these should have been compiled earlier in the build process. The cmake command used was
cmake -D MATLAB_ROOT_DIR=/usr/lib/matlab2012a/ -D CMAKE_INSTALL_PREFIX=/home/user ..

A: I had the same problem, I guess there's a reason why it's not yet included in the official distribution. My solution was the following:

*

*Compile OpenCV without the Matlab module, for me this ẃas simply not specifying where Matlab was located since it wasn't in a standard location, but it should be possible by setting a variable in cmake or modifying the CMake configuration files.

*Install OpenCV (make install), this will install the necessary libraries.

*Run cmake again, this time including the Matlab option, run make.

*At this point, a bunch of errors occur while compiling some of the generated Mex source files. I simply removed the files that would not compile. These are the files I had to remove:

createAlignMTB.cpp
createCalibrateDebevec.cpp
createCalibrateRobertson.cpp
createLineSegmentDetector.cpp
createMergeDebevec.cpp
createMergeMertens.cpp
createMergeRobertson.cpp
createTonemap.cpp
createTonemapDrago.cpp
createTonemapDurand.cpp
createTonemapMantiuk.cpp
createTonemapReinhard.cpp
findCirclesGrid.cpp

I did not need any of them, hopefully the same is true for you, if you do you'll need to resolve the errors. (the source files don't seem to be regenerated once generated so may be safely modified)

*

*make install!

*???

*Profit!

A: When encountering an error with building something with cmake, it's always a good idea to rerun it with VERBOSE=1 option.

I had a similar issue with '/usr/bin/ld: cannot find ....' and make VERBOSE=1 revealed that the the linker path to opencv libraries is incorrectly set to L${ROOT_TO_OPENCV_BUILD}/lib/RelWithDebInfo whereas it should be L${ROOT_TO_OPENCV_BUILD}/lib.
So the problem is somewhere in the CMake config files.
A super dirty workaround is to simply create a fake link like this
    cd ${ROOT_TO_OPENCV_BUILD}/lib; ln -s . RelWithDebInfo
This will make the compilation continue.fails for me later on createTonemapReinhard.cpp
 error: 'Ptr_TonemapReinhard' was not declared in this scope
Clearly the matlab mex module is not yet ready.


text:
Q: Как считывать недостаток прав при использовании команды? disnake.py Создаю бота в дискорд на disnake.py, пытаюсь сделать обратное сообщение при нехватке прав для использования команды
Код:
@add_video.error
async def add_video_error(ctx: disnake.CommandInteraction, error):
    author = ctx.author
    if isinstance(error, commands.MissingPermissions):
        await ctx.edit_original_response('У вас недостаточно прав')

Ранее использовал этот код для обычных команд, а на slash-команды не работает
Ошибка:
Traceback (most recent call last):
  File "C:\Kirill\Python\lib\site-packages\disnake\ext\commands\base_core.py", line 70, in wrapped
    ret = await coro(*args, **kwargs)
  File "directory", line 171, in add_video_error
    await ctx.edit_original_response('У вас недостаточно прав')
  File "C:\Kirill\Python\lib\site-packages\disnake\interactions\base.py", line 506, in edit_original_response
    raise InteractionNotResponded(self) from e
disnake.errors.InteractionNotResponded: This interaction hasn't been responded to yet

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Kirill\Python\lib\site-packages\disnake\client.py", line 700, in _run_event
    await coro(*args, **kwargs)
  File "C:\Kirill\Python\lib\site-packages\disnake\ext\commands\interaction_bot_base.py", line 1361, in on_application_command
    await self.process_application_commands(interaction)
  File "C:\Kirill\Python\lib\site-packages\disnake\ext\commands\interaction_bot_base.py", line 1358, in process_application_commands
    await app_command.dispatch_error(interaction, exc)
  File "C:\Kirill\Python\lib\site-packages\disnake\ext\commands\base_core.py", line 465, in dispatch_error
    if not await self._call_local_error_handler(inter, error):
  File "C:\Kirill\Python\lib\site-packages\disnake\ext\commands\base_core.py", line 454, in _call_local_error_handler
    return await injected(inter, error)
  File "C:\Kirill\Python\lib\site-packages\disnake\ext\commands\base_core.py", line 76, in wrapped
    raise CommandInvokeError(exc) from exc
disnake.ext.commands.errors.CommandInvokeError: Command raised an exception: InteractionNotResponded: This interaction hasn't been responded to yet

Как проверять на наличие прав использования команды?


text:
Q: Semantic UI React Menu pointing won't change active state on Route change I've build small SPA in React using Semantic UI React. Menu is working as it should and when I click on any of the menu items, it takes me where its supposed to.
The problem is that, if I go to a page/Route and from there change my page/Route to another one, active field in pointing Menu stays pointing at the previous page.
Everything is imported the way it should. I just want to find the way for my menu to always point at the appropriate Route that is currently shown.
Here is my code:
render() {

const { activeItem } = this.state

return (

      <BrowserRouter>

          <Menu pointing>
            <Menu.Item name='Home' as={Link} to='/home' active={activeItem === 'Home'} onClick={this.handleItemClick} />
            <Menu.Item name='Regions' as={Link} to='/regions' active={activeItem === 'Regions'} onClick={this.handleItemClick} />
            <Menu.Item name='Countries' as={Link} to='/countries' active={activeItem === 'Countries'} onClick={this.handleItemClick} />
            <Menu.Item name='AllCountries' as={Link} to='/allcountries' active={activeItem === 'AllCountries'} onClick={this.handleItemClick} />
            <Menu.Menu position='left'>
              <Menu.Item>
                <Form.Group onSubmit={this.submit}>
                  <Input placeholder='Search...' value={this.state.searchTerm} onChange={this.takeTerm} onKeyPress={this.showData}/>
                  <Link to="/countrydata"><Button type="submit" circular icon="search" /></Link>
                </Form.Group>
              </Menu.Item>
            </Menu.Menu>
            <Button.Group>
              <Button>English</Button>
              <Button.Or text="or"/>
              <Button>Francais</Button>
              <Button.Or text="or"/>
              <Button>Italiano</Button>
            </Button.Group>
          </Menu>
          <Segment>
          <Switch>
            <Route path="/regions" component={Regions}/>
            <Route path="/countries" component={Countries}/>
            <Route path="/allcountries" component={AllCountries}/>
            <Route path="/countrydata" component={Country} />
            <Route path="/" component={Home} />
          </Switch>
          </Segment>
          {this.state.notFound ? (
Searched country does not exist
) :

}

      </BrowserRouter>

)

}
}

A: I had the same problem today or, at least, a similar one. So I resolved my problem by replacing Link with NavLink and by removing Semantic's "handleItemClick". We don't need Semantic to handle active Menu.Item since react-router can do this with NavLink.
<Menu.Item name='Countries' as={NavLink} to='/countries' />

A: We use a component:
const MenuLink = ({ to, exact, ...rest }) => (
  <Route path={to} exact={exact} children={({ match }) => (
    <Link to={to}><Menu.Item active={!!match}{...rest} /></Link>
  )} />
);


text:
Q: How to add Navlinks (or article path) in Mediawiki? I have installed mediawiki 1.21. I am wondering how you can add navlinks (meaning the path to the page. Not sure if I am using the right work to describe it) at the top similar to the way it is in wikihow website? Below is an image so you know what I am referring to.. I find this to be very useful so users can understand where they are when reading an article.
I have created a custom skin and I have a Navlink DIV at the top where I would to show the path to that page there like: wiki -> xyz Category -> Article Name. I have semantic extension installed. Can this be achieved with that? Or is there another way to do it? How can I add the code directly in my skin.php file so this navlink is generated and listed depending on what page the user is on?

A: Terminology
This kind of feature is called a breadcrumb.
Has MediaWiki already this kind of feature?
Yes, for subpages.
A subpage is a page intitulated Quux/Foo/Bar in a namespace with the subpage feature enabled. By default, this is the User namespace for example, but not the main one (For example, on Wikipedia projects, we want to be able to use titles like AC/DC).
In this situation, a breadcrumb Quux > Foo will be printed.
This doesn't solve your issue, as you want to use categories, but it allows you if you write your custom code to know there already is some code somewhere doing that :)
Breadcrumbs extensions
Some extensions have been developed to solve this particular issue:

*

*BreadCrumbs2

*CategoryBreadcrumb
The first is more exhaustive and gives you more flexibility, the second simpler and so a good starting point to write a custom stuff.


text:
Q: AWS SSL configuration using Gandi.net SSL certificate sudo mkdir /etc/nginx/ssl

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt

after the successful creation of ngnix.key and ngnix.crt
server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;

        listen 443 ssl;

        root /usr/share/nginx/html;
        index index.html index.htm;

        server_name your_domain.com;
        ssl_certificate /etc/nginx/ssl/nginx.crt;
        ssl_certificate_key /etc/nginx/ssl/nginx.key;

        location / {
                try_files $uri $uri/ =404;
        }
}

sudo service nginx restart

I have generated .crt file and .key file but after above process the certificate is invalid on domain please help to configure stepwise in aws ec2 instance.

A: Nginx uses 'Host' header for server_name matching. default_server looks to be missing from your snippet.
server {
 server_name _yourdomain.com;
 listen 80 default_server ipv6only=on;
 listen 443 ssl default_server;
 ssl_certificate /etc/nginx/ssl/nginx.crt;
 ssl_certificate_key /etc/nginx/ssl/nginx.key;
 return 404; # or whatever
 }

A: First we have to generate the .key and .crt files and then the SSL certificate key and .crt file concat in single file and give that file path to nginx configuration file.
https://nicolas.perriault.net/code/2012/gandi-standard-ssl-certificate-nginx/


text:
Q: Can I create an image using a WYSIWYG tool and put it in a LaTeX file with good results? Computer people:
I am typesetting a math paper using LaTeX.  I need to create come fairly complicated diagrams including circular arcs, triangles, and small text boxes, to include in the document.  I might like to have line segments or arcs of different widths, and maybe shade in some triangles, and include brief text snippets inside and outside the shaded regions.  I would like to create the image using a WYSIWYG tool.  I will probably need to convert it to .eps or .pdf format, since I think these are the only image formats LaTeX people use (please correct me if I am wrong).  I have access to Adobe Photoshop, which I have never used before but which my family members can help me with.
Before I set about doing this, can anyone tell me if this is a good plan?  For example, if I create an image in Photoshop, can I convert it to a decent-looking .eps or .pdf image?  In an earlier paper, I created a geometric image using PSTricks.  The result looked excellent, but it took hours and hours of painstaking work.  I'd rather use a WYSIWYG tool if possible.

A: Latex can handle .jpg or other image files as well. You just have to declare it in the preamble.
\DeclareGraphicsExtensions{.jpg}

I would say the higher the quality of your input diagram the better it looks later on in your final document. This means if you create your original diagramm with a low resolution you will get a result with a low resolution. Another thing I experienced is that you should avoid to increase the size of your diagramm in latex with scaleor stuff like this. Hopefully this helps a bit.


text:
Q: Node.js server app using cors, express and google api not working after azure deployment I have a node.js server api app that is not working after being deployed to azure.
It initially relies on google.api to get the data and after that stores the data in an array and sends it to client by responding to express get calls.
Initially I used:
const express = require('express');
const app = express();
const cors = require("cors");
const _ = require("lodash");
const port = 30000;

app.use(cors());

which worked well enough on localhost.
For deployment, after following a tutorial I changed that to:
const express = require('express');
const app = express();
const cors = require("cors");
const _ = require("lodash");
const port = process.env.PORT || 80;
var http = require('http');

app.use(cors());

var server = http.createServer(app);
server.listen(port, function () {
});

which did not work and finally:
const express = require('express');
const app = express();
const _ = require("lodash");
const port = process.env.PORT || 80;

var login = require('./routes/login');
...
app.use('/login', login);
...
module.exports = app;

and created a new folder for the get commands, as is done here https://github.com/Azure-Samples/app-service-web-nodejs-get-started/blob/master/app.js.
Nothing seems to work and I continue to get the error:

GET http://nameofsite/login 404 (Not Found)
XMLHttpRequest cannot load nameofsite/login. No
  'Access-Control-Allow-Origin' header is present on the requested
  resource. Origin 'nameofclient' is therefore not allowed access. The
  response had HTTP status code 404.

I have tried including the cors header as well as adding the client site to cors allowed origins in the azure portal but it makes no difference. Can anyone help with this issue or provide info on how to correctly format a node.js server using info from a google sheets document?

A: This might be a silly question but when you moved the VM to Azure did you setup your ip address, update your external DNS and configure the virtual network to allow the correct traffic that Node and your code needs?


text:
Q: Why after yield all([someGenerator]), another function is not called I try to call another function after yield all([])
When I replace call() effect with fork(), it works. I know that fork() is no-blocking effect. But assuming that all the effects are resolved (using call()), next line should be also called.
After all() effect I try to call another generator with WebSockets. Maybe it is not the best place, but I don't know why it doesn't work anyway.
export function* someGenerator () {
    try {
    return true
    } catch (e) {}
}

export function* watchSomeAction() {
    yield takeEvery('someAction', someGenerator )
}

export default function* rootSaga () {
    yield all([call(watchSomeAction)])

    yield call(anotherGenerator) \\ never called even when all the effects are
 resolved
}```


text:
Q: Tkinter text widget is wider than any other widget with grid From tutorials, I have kind of been under the impression that grid just "kind of figures it out" for width, but it's clearly not the case when it comes to Text (I suppose when combined with list).
With the following code, listbox has is tiny and Text is absolutely massive (Width wise). I can make the listbox equal to the size of the Text by changing sticky="ew", but that's not what I want - I want a reasonable, equivalently styled "grid".
If I hardcode the size of the width, it's even more frustrating, because listbox width seems to equate to approximately 2/3 of Text width.
I've read up on rowconfigure and columnconfiugre, but this seems to actually do nothing with the below code (note - rowconfigure and columnconfigure are not in the below code, but I have tried them, perhaps I'm using them wrong).
Anyways, with the below code - can anyone explain to me how to make these more reasonably sized width wise, and also the same? Should I hardcode a width to Text and then set listbox to sticky="ew"? Seems counter intuitive to the grid layout concept.
class MainApplication(tk.Frame):
    def __init__(self, parent, *args, **kwargs):
        self.frame = tk.Frame.__init__(self, parent, *args, **kwargs)
        self.parent = parent
        self.initialize()

    def initialize(self):

        self.lst_bx = tk.Listbox(self.parent, height = 15)
        self.lst_bx.grid(row=0, column=0, columnspan=2, padx=(10,10), sticky="w")

        self.exe_field = tk.Text(self.parent, height=15)
        self.exe_field.grid(row=1, column=0, columnspan=2, padx=(10,10), sticky="w")

        self.pick_exe_btn = tk.Button(
            self.parent, text="Choose Location", width=15
        )
        self.pick_exe_btn.grid(row=0, column=2)

if __name__ == "__main__":
    root = tk.Tk()
    #window_config(root)
    MainApplication(root).grid(stick="nesw")
    root.resizable(False, False)
    root.mainloop()

I'm sorry for being such a noob, I swear I have searched this a lot before posting here - I just cannot find a straight answer on why ListBox is a completely different width from Text (and even moreso when I specify a width).

A: The how tkinter calculates the dimensions tkinter.ListBox() and tkinter.Text() widgets is a little bit different from most of other widgets where it uses pixels. For these 2 specific widgets, the width is calculated in terms of characters whereas the height is assessed in terms of lines.

*

*You did not set the width of self.lst_bx, so tkinter sets it by default to 20 characters.

*You did not specify the width of self.exe_field either. So tkinter calculates this width based on the current default font size.
From 1) and 2) we can conclude that it is quite normal we can not expect from self.exe_field to have the same width as self.lst_bx. This means, you have no option other than hard coding them and visually check the GUI.
With minor changes of your code (mainly provided in the comments below your question) this is how I solved your issue:
import tkinter as tk

class MainApplication(tk.Frame):
    def __init__(self, parent, *args, **kwargs):
        tk.Frame.__init__(self, parent, *args, **kwargs)
        self.parent = parent
        self.initialize()

    def initialize(self):
        self.lst_bx = tk.Listbox(self, height = 15, width=70)
        self.lst_bx.grid(row=0, column=0, padx=(10,10), sticky="w")

        self.exe_field = tk.Text(self, height=15, width=80)
        self.exe_field.grid(row=1, column=0, padx=(10,10), sticky="w")

        self.pick_exe_btn = tk.Button(self, text="Choose Location", width=15)
        self.pick_exe_btn.grid(row=0, column=2, columnspan=2)

if __name__ == "__main__":
    root = tk.Tk()
    #window_config(root)
    MainApplication(root).grid(stick="nesw")
    root.resizable(False, False)
    root.mainloop()

Note where I moved the columnspace option (it quite does not make a sens in the two places where you have set it previously). Note also that tkinter calculate the character somehow differently between the listbox and text widgets. Depending your operating system (and maybe machine also), you may have to change the 2 width dimensions I set to the widgets in questions.
Here is what I got on my machine:


text:
Q: jquery Drop-down menu I'm trying to find/make a good jquery drop-down menu with animation (fadein/fadeout or slidedown) that activates on hover, not click.
What do you recommend?

A: One of the original plugins out there... Superfish.


text:
Q: Android Geofencing dosen't trigger IntentService I'm building a mobile application with which I'll be able to test working of geofencing on Android phones. I have an application that uses GoogleApiClient for FusedLocationApi.requestLocationUpdates. I'm getting all the updates which I show on the map in my MapFragment. I then try to add the geofences with GeofencingClient.
private void addGeofenceList() {
    mGeofencingClient.addGeofences(getGeofencingRequest(), getGeofencePendingIntent())
            .addOnSuccessListener(this, new OnSuccessListener<Void>() {
                @Override
                public void onSuccess(Void aVoid) {
                    Log.wtf(TAG, "addGeofences() - succesfully added");
                }
            })
            .addOnFailureListener(this, new OnFailureListener() {
                @Override
                public void onFailure(@NonNull Exception e) {
                    Log.wtf(TAG, "addGeofences() - failed to add");
                }
            });
}

This code is executed and I get back that they were succesfully added. But when I'm on the location where the geofence should trigger it dosen't call the IntentService. I also add the IntentService:
private PendingIntent getGeofencePendingIntent() {
    if (mGeofencePendingIntent != null) {
        return mGeofencePendingIntent;
    }
    Intent intent = new Intent(this, GeofenceService.class);
    return PendingIntent.getService(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
}

I also create a GeofencingRequest where I set the initial trigger when entered.
private GeofencingRequest getGeofencingRequest() {
    GeofencingRequest.Builder builder = new GeofencingRequest.Builder()
            .setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER)
            .addGeofences(mGeofenceList);
    return builder.build();
}

And this is where I create the ArrayList<Geofence> mGeofenceList in which I add all the geofences:
public void createGeofenceList() {
    GeofenceList geofences = new GeofenceList();
    ArrayList<GeofenceModel> geofenceList = (ArrayList) geofences.returnGeofences();
    for (GeofenceModel geofence : geofenceList) {
        mGeofenceList.add(new Geofence.Builder()
                .setRequestId(geofence.getREQ_ID())
                .setCircularRegion(
                        geofence.getLocation().latitude,
                        geofence.getLocation().longitude,
                        geofence.getRadius()
                )
                .setExpirationDuration(geofence.getExpire())
                .setTransitionTypes(geofence.getTransition())
                .build());
    }
    addGeofenceList();
}

My whole projects is on GitHub. All the help will be appreciated!

A: In your manifest replace your service declaration which is
<service android:name="services.GeofenceService" />
to this
<service android:name="services.GeofenceService"
          android:exported="true"/>
Basically you should mark your service as exported so Android OS can invoke your IntentService


text:
Q: Pivot Not Appearing Hi I have the following code that performs so manipulation on a sheets and creates a pivot table from this. My issue is that the pivot will not appear, the blank sheet "NoMilestonesPT" appears but it is blank with no table. I have purposefully left out column and row values, and it doesn't help if I add them.
Can anyone see what may be wrong?
Thanks
    Sub projectsWithoutMilestone()

    'Insert a New Blank Worksheet
    On Error Resume Next
    Application.DisplayAlerts = False
    Worksheets("NoMilestones").Delete
    Worksheets("SOWMilestoneList").Delete
    Sheets.Add Before:=ActiveSheet
    ActiveSheet.Name = "NoMilestones"
    Sheets.Add Before:=ActiveSheet
    ActiveSheet.Name = "SOWMilestoneList"
    Application.DisplayAlerts = True
    'Switch off error masking
    On Error GoTo 0

     Sheets("DemandTable").Select
    Range("Table_Demand458910[#All]").Select
    Selection.Copy
    Sheets("NoMilestones").Select
    Range("A1").Select
    ActiveSheet.Paste

    ActiveSheet.ListObjects(1).Unlist

    Dim LastRow As Long
    Dim pasteRowIndex As Long

    With Sheets("NoMilestones")

     Dim SOW As String

 Dim SowRow As Long

 SowRow = 1

    .Columns(3).Insert Shift:=xlToRight
    .Columns(4).Insert Shift:=xlToRight
    .Cells(1, "C").Value = "SOW contains Milestones"
    .Cells(1, "D").Value = "Record has Milestone"

 Application.ActiveSheet.UsedRange
    LastRow = Worksheets("NoMilestones").UsedRange.Rows.Count

    For r = 1 To LastRow

        If LCase(.Cells(r, "N").Value) Like LCase("Milestone*") Then
       .Cells(r, "D").Value = "Has Milestones"

       SOW = .Cells(r, "B").Value
       ActiveWorkbook.Worksheets("SOWMilestoneList").Cells(SowRow, "A").Value = SOW
       ActiveWorkbook.Worksheets("SOWMilestoneList").Cells(SowRow, "B").Value = "True"

       SowRow = SowRow + 1

   End If

       Next r

       Range("C2").Select

        ActiveCell.FormulaR1C1 = _
        "=VLOOKUP(RC[-1],SOWMilestoneList!C[-2]:C[-1],2,FALSE)"
    Selection.AutoFill Destination:=Range("C2:C18990")
    Range("C2:C18990").Select

      Columns("C:C").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
        :=False, Transpose:=False

    End With

    Dim PSheet As Worksheet
    Dim DSheet As Worksheet
    Dim PCache As PivotCache
    Dim PTable As PivotTable
    Dim PRange As Range
    Dim LastRow1 As Long
    Dim LastCol As Long

    'Insert a New Blank Worksheet
    On Error Resume Next
    Application.DisplayAlerts = False
    Worksheets("NoMilestonesPT").Delete
    Sheets.Add Before:=ActiveSheet
    ActiveSheet.Name = "NoMilestonesPT"
    Application.DisplayAlerts = True
    Set PSheet = Worksheets("NoMilestonesPT")
    Set DSheet = Worksheets("NoMilestones")
    On Error Resume Next

    'Define Data Range
    LastRow1 = DSheet.Cells(Rows.Count, 1).End(xlUp).Row
    LastCol = DSheet.Cells(1, Columns.Count).End(xlToLeft).Column
    Set PRange = DSheet.Cells(1, 1).Resize(LastRow1, LastCol)

'Define Pivot Cache
Set PCache = ActiveWorkbook.PivotCaches.Create _
(SourceType:=xlDatabase, SourceData:=PRange). _
CreatePivotTable(TableDestination:=PSheet.Cells(2, 2), _
TableName:="NoMilestonesPivotTable")

    'Insert Blank Pivot Table
    Set PTable = PCache.CreatePivotTable _
    (TableDestination:=PSheet.Cells(1, 1), TableName:="NoMilestonesPivotTable")

End Sub


text:
Q: Querydsl delete query using limit I have a one question.
I want to use limit for delete query with querydsl. Is there any way?
delete(wedul).where(wedul.id.eq(10)).limit(10)

A: JPA (on which hibernate and querydsl is built) does not support something like a limit or rownum for deletes, because it is not a universally supported database concept.
A common approach to solving this would be to delete from the table where the 'id' in contained within a subquery, and the place the limits on the subquery.
See this other answer


text:
Q: Android studio(3.4.2) navigation architecture null pointer exception in design tab java.lang.NullPointerException
    at org.jetbrains.android.dom.navigation.NavigationSchema$TypeRef.<init>(NavigationSchema.java:183)
    at org.jetbrains.android.dom.navigation.NavigationSchema.lambda$buildDestinationTypeToDestinationMap$2(NavigationSchema.java:531)
    at java.util.HashMap.forEach(HashMap.java:1288)
    at org.jetbrains.android.dom.navigation.NavigationSchema.buildDestinationTypeToDestinationMap(NavigationSchema.java:531)
    at org.jetbrains.android.dom.navigation.NavigationSchema.init(NavigationSchema.java:460)
    at org.jetbrains.android.dom.navigation.NavigationSchema.createIfNecessary(NavigationSchema.java:389)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.lambda$tryToCreateSchema$3(NavDesignSurface.java:370)
    at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$0(DumbService.java:79)
    at com.intellij.openapi.project.DumbService.lambda$runReadActionInSmartMode$1(DumbService.java:123)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:977)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:116)
    at com.intellij.openapi.project.DumbService.runReadActionInSmartMode(DumbService.java:79)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.tryToCreateSchema(NavDesignSurface.java:368)
    at com.android.tools.idea.naveditor.surface.NavDesignSurface.lambda$goingToSetModel$0(NavDesignSurface.java:278)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

The error is too long to post it here, so I only post the first page of the error. When I open android project in android studio 3.4.2 that has an empty, default starter code, navigation.xml file the IDE shows an alert, IDE Error Occurred. But my project synced successfully, what i can't do is opening the navigation in design tab, it says "Waiting for build to finish".

A: Just don't use an empty file, but add the root node into there:
<?xml version="1.0" encoding="utf-8"?>
<navigation
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    app:startDestination="@id/someFragment"
    android:id="@+id/nav_graph">

</navigation>


text:
Q: Suave SQl Provider DatabaseProvider has already been given a value I am currently going through the Suave Music store tutorial and have come to the database portion, where they instruct you to build a SQL connection like this:
type Sql =
SqlDataProvider< "Server (LocalDb)\\v11.0;Database=SuaveMusicStore;Trusted_Connection=True;MultipleActiveResultSets=true",
    DatabaseVendor=Common.DatabaseProviderTypes.MSSQLSERVER >

However, I get the error "The static parameter 'DatabaseVendor' has already been given a value". I've tried looking at the SQL Provider Basics page, which suggests a different initialization method but have had no luck using it either. Has anyone else experienced this before?

A: I am using this for my connection string and it works for me, for Initial Catalog put the name of your database
let [<Literal>] ConnectionString = """Data Source=localhost;Initial Catalog=NavcareDB_backup;Integrated Security=True;"""
type Sql = SqlDataProvider<ConnectionString = ConnectionString,
                           DatabaseVendor = Common.DatabaseProviderTypes.MSSQLSERVER,
                           UseOptionTypes = true>


text:
Q: LDAP query for returning members of specific groups I need to get some users from LDAP, only those that belong to groups whose names begin with a pattern, something like this
((&objectcategory=user)(memberof=cn=**groupNamePattern_***,OU=distribution,DC=xx,DC=com))

I think it needs to do some sort of sub-query, so that it first retrieves the list of groups that match the pattern, then the users of those groups.
How such query can be expressed?

A: Why not query for:
(cn=**groupNamePattern_***)
with a base of OU=distribution,DC=xx,DC=com
and return the member list.


text:
Q: Evaluating an integral: $\int \frac{1}{(x+\sqrt{x+x^2})^2} dx$
$$\int \frac{1}{(x+\sqrt{x+x^2})^2} dx$$

I don't know how to approach this integral. I tried a few substitutions, but none of them got me to a desirable point.

A: We have if $x>0
 $ $$\int\frac{1}{\left(x+\sqrt{x+x^{2}}\right)^{2}}dx=\int\frac{1}{x^{2}\left(1+\sqrt{1+\frac{1}{x}}\right)^{2}}dx
 $$ and now put $u=1+1/x
 $, $du=-dx/x^{2}
 $ and so we get $$-\int\frac{1}{\left(1+\sqrt{u}\right)^{2}}du.
 $$ Now put $s=\sqrt{u}
 $, $ds=1/\left(2\sqrt{u}\right)du
 $ and get $$-2\int\frac{s}{\left(s+1\right)^{2}}ds
 $$ which can be split using partial fractions $$-2\int\frac{1}{s+1}ds+2\int\frac{1}{\left(s+1\right)^{2}}ds.
 $$ I think you can get it from here. If $x<-1
 $ you have $$-\int\frac{1}{\left(1-\sqrt{u}\right)^{2}}du
 $$ and you can use the same passage of the first part using $s=-\sqrt{u}
 $.


text:
Q: Windows Domain URL Our laptops are connected to a windows server 2019 with the domain name company.int
Everything works find and when I ping company.int it points to the windows server. The server is also responsible for internal DNS. All machines are using this server's ip as primary DNS and routers IP as secondary.
The problem is that we also want to have an intranet located at company.int. This will be a Drupal website hosted in our DMZ (not on the same segment with the DC and machines).
How  can I have it so that when users visit company.int from the browser they are redirected to the website and not the DC server? I tried to create an A record on the Windows Server www pointing to the IP of Drupal, problem is that Drupal is configured to be hosted on http://company.int and therefor when you call www it automatically redirects to company.int.
We are trying to avoid the situation of re-configuring the DC with a different name since this might cause some unexpected situations.
Any help is more than welcomed.

A: If it were me, I'd reconfigure Drupal to be hosted on www.company.int.


text:
Q: Automate backup of Azure API management services using Jenkins or any other tool Have written multiple Powershell scripts to take backup of AZure API management service. One script calls another and exports all the products and properties to my local machine.
I want to automate this process of backing up everything directly to Bitbucket. To achieve this i have configured Jenkins which is running on a CentOS server but, i don't know how to automate things using it?
I tried installing the Powershell Plugin on Jenkins but as i have multiple scripts written having dependency on one another, i just can't paste the whole thing as it is and run.
so is there a way i can run this multiple codes on Jenkins Powershell plugin instead of composing one single code and then run it?
Second thing, should Jenkins be installed on my local machine rather than on CentOS server in order to achieve this?
Or
if Jenkins has a plugin to link with my Azure account and export services to Bitbucket? (with Powershell codes out of picture)
Is there any other tool / alternative which is little less complicated?


text:
Q: Arrays.sort() error in main So i have a program that gets measurements of rain from the user and stores it into an array with the help of a Class RainFall that just has basic set/get  mutators and accessors. My problem is that for some reason the program crashes on the Arrays.sort() line. Is it that i need to create a new method just for that line? If so what would that look like?
import java.util.Arrays;
import java.util.Scanner;
public class Lab7rain {

  public static void main(String[] args) {
    double amount=0;//VARIABLE DECLARATIONS
    RainFall r = new RainFall(amount);//CREATE OBJECT
    Scanner kb = new Scanner(System.in);//ALLOCATE SPACE
    RainFall[] month = new RainFall[12];

    for(int i=0; i<12; i++){
     System.out.println("What was the amount of rain in "+r.date()+"?");//rain per month
     amount = kb.nextDouble();//gets input
     month[i]= new RainFall(amount); //stores amount into array slot
     System.out.println();
     r.setTotal(amount);//sends amount to method that adds them together to create a total
    }

    kb.close();

    r.setAvg();//initiates method that divides total by 12 to get average rain fall per month

    System.out.println(r.getTotal());//print total rain fall
    System.out.println(r.getAvg());//print average rain fall
    System.out.println();//skip line

    Arrays.sort(month);//i want this to sort the array so i can
    //then print out the highest and lowest months
    System.out.println(month[0]+" "+month[11]);
  }
}

Exception in thread "main" java.lang.ClassCastException: lab7rain.RainFall cannot be cast to java.lang.Comparable
    at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:290)
    at java.util.ComparableTimSort.sort(ComparableTimSort.java:157)
    at java.util.ComparableTimSort.sort(ComparableTimSort.java:146)
    at java.util.Arrays.sort(Arrays.java:472)
    at lab7rain.Lab7rain.main(Lab7rain.java:46)
Java Result: 1

A: Based on your error in the comment section, you need to implement the Comparable interface on the RainFall class before you can use the Arrays.sort() method or use a Comparator as @ElliotFrisch showed you in his answer.
public class RainFall implements Comparable<RainFall> {

    double amount;
    // your code

    public int compareTo(RainFall r) {
        return Double.compare(this.amount, r.amount);
    }

}

A: Your class RainFall needs to implement Comparable<RainFall>, or you could write a Comparator<RainFall> and use the Arrays.sort() that takes that. For example,
static class RainFallComparator implements Comparator<RainFall> {
  public int compare(RainFall a, RainFall b) {
    if (a.getAmount() < b.getAmount()) return -1;
    else if (a.getAmount() > b.getAmount()) return 1;
    return 0;
  }
}

and then
 Arrays.sort(month, new RainFallComparator());


text:
Q: natural language example to show difference between first order logic propositions while discussing some problem in formal logic i came across two different formulas:
$ \lnot \exists y (P(y) \land Q)$ and $ (\lnot \exists y P(y))\land Q$
now, these 2 are obviously not equivalent, as the first one is trivially true when Q is false, while the second one is false when Q is false.
i tried to think of an example in natural language that highlights their difference, but could not come up with one.
any ideas how to express these 2 different concepts in ordinary language?

A: Here's a contrivance:

*

*$ \lnot \exists y \:(P(y) \land Q)$
There is no deer that is herbivorous, which is to say,
animal-eating. (TRUE)
   (The given property is is incoherent as it contradicts an accepted definition.)

*$ \lnot \exists y P(y)\land Q$
There is no deer that is herbivorous, and herbivorous means
animal-eating. (FALSE)
   (The second conjunct is analytically false.)


text:
Q: DataSet DataTable - WriteXml con Genericos DataSet y DataTable tienen el método "WriteXml". En mi código algunos procedimientos almacenados devuelven un DataSet y otros devuelven un DataTable, los cuales luego se deben pasar a una cadena con formato XML para luego publicarlo usando WCF.
Para evitar escribir 02 métodos (uno para el ds y otro para el dt), es posible/correcto realizar el siguiente código?, por favor deseo algunas sugerencias. Muy agradecido de antemano.
/// <summary>
    /// Convierte un objeto de tipo DataSet o DataTable en una repreentación de cadena  con formato Xml
    /// </summary>
    /// <typeparam name="T"></typeparam>
    /// <param name="dataObject"></param>
    /// <param name="encoding"></param>
    /// <returns></returns>
    public static string DataToXmlString<T>(T dataObject, Encoding encoding) where T: new()
    {
        string result = string.Empty;
        if (dataObject == null)
            return result;
        else
        {
            XmlWriterSettings xmlSettings = new XmlWriterSettings()
            {
                // OmitXmlDeclaration = true, // Omite: <?xml version="1.0" encoding="utf-8" ?>
                Encoding = encoding,
                ConformanceLevel = ConformanceLevel.Document
            };

            using (MemoryStream memoryStream = new MemoryStream())
            {
                using (XmlWriter xmlWriter = XmlWriter.Create(memoryStream, xmlSettings))
                {
// Aquí es donde se hace la pregunta
                    if (dataObject is DataSet)
                        (dataObject as DataSet).WriteXml(xmlWriter, XmlWriteMode.WriteSchema);
                    else if (dataObject is DataTable)
                        (dataObject as DataTable).WriteXml(xmlWriter, XmlWriteMode.WriteSchema);

                    xmlWriter.Close();
                }
                result = encoding.GetString(memoryStream.ToArray());
            }
            return result;
        }
    }
    /// <summary>
    /// Convierte una cadena con formato Xml, en un objeto de tipo T
    /// </summary>
    /// <typeparam name="T"> Tipo al que será convertido</typeparam>
    /// <param name="stringXmlData"></param>
    /// <param name="encoding"></param>
    /// <returns>Objeto dle tipo T</returns>
    public static T XmlStringToData<T>(this string stringXmlData, Encoding encoding)
    {
        T returnObject = default(T);
        if (string.IsNullOrEmpty(stringXmlData)) return default(T);

        using (MemoryStream Xmlstream = new MemoryStream(encoding.GetBytes(stringXmlData)))
        {
            if (returnObject is DataSet)
                (returnObject as DataSet).ReadXml(Xmlstream, XmlReadMode.ReadSchema);
            else if (returnObject is DataTable)
                (returnObject as DataTable).ReadXml(Xmlstream);

            Xmlstream.Close();
        }
        return returnObject;
    }

A: utiliza dos métodos, para datatable usa el MemoryStream y para dataset es mas fácil usar el dataset.ToXml(); no tires tanto código


text:
Q: Firebase push notification in android not working I implemented push notification in Android using Firebase and I am receiving push notification using Firebase console. But when I try to connect to my server by sending device token and server key, then I am not receiving notifications (from my server).
Our server side team tested and it is working at their end, but my device is not receiving push notifications (device on which app is installed) and I am receiving push notification from Firebase.
How can I connect to the server? Is the problem in Android or with creating the google-services.json file?

A: While Using Firebase push notification there are two cases to handle data payload( e.g. your Activity name etc.).
case 1: When your app is running in foreground(currently running on screen) you would get data payload from RemoteMessage object in onMessageReceived(RemoteMessage remoteMessage)method that you have overridden in your class that must extend FirebaseMessagingService class.
For example :
public class FirebaseMessagingServiceHelper extends FirebaseMessagingService {
    private final String TAG = "FirebaseMsgServiceHelper";

@Override
public void onMessageReceived(RemoteMessage remoteMessage) {
    super.onMessageReceived(remoteMessage);

    Map<String, String> dataPayload = null;
    dataPayload = remoteMessage.getData();
    }
}

case 2: When your app is running in background you would get data payload as extras in intent in your app's launcher Activity.
For Example :-
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    //get notification data info
    Bundle bundle = getIntent().getExtras();
    if (bundle != null) {
    //bundle must contain all info sent in "data" field of the notification
   }
}

But these two cases were not working properly when I got name of the Activity that is supposed to be open when user clicks on a notification on Notification Drawer in click_action and data payload in data.
But when I putted down everything in data it worked fine for me in both the cases i.e. whether app is running in foreground or in background your app would receive data payload everytime in RemoteMessage object in onMessageReceived(RemoteMessage remoteMessage) method.
Below is the link I link from where I got idea.
 Firebase FCM notifications click_action payload


text:
Q: Log username in maillogs when there is SASL authentication failure I have a server with postfix and cyrus-sasl. When ever there is an authentication failure it reports in maillog below line.
postfix/smtpd[27669]: warning: unknown[185.xxx.xxx.xxx]: SASL LOGIN authentication failed: authentication failure

How can I make it so that it will also report the username that failed in the log file ( like SASL LOGIN authentication failed: authentication failure for bob )?

A: Try setting the logging level as
  log_level:4
in smtpd.conf ( might be  /usr/lib/sasl2/smtpd.conf )
*log_level controls the level of verbosity of messages sent to the syslogd service.
0 no messages
1 unusual errors
2 all authentication errors
3 log non-fatal warnings
4 more verbose than 3
5 more verbose than 4
6 traces of internal protocols
7 traces of internal protocols, including pass-words*

In /etc/postfix/master.cf, add -v  after a process like
smtp      inet  n       -       n       -       -       smtpd -v

You can also debug a specific client IP-address by setting theh following in master.cf
debug_peer_list = 192.168.0.1


text:
Q: Update a json file containing variables from another json file in C# I have a json config file with values as variables. I want to replace these variables with actual values that are stored in another json file.
Source data json file:
{
  "person": {
    "id": 15305,
    "gender": "Male",
    "dob": "1958-10-31T00:00:00",
    "name": {
      "id": 80587,
      "first": "John",
      "last": "Dominick"
    }
  },
  "ethnicity": [
    {
      "id": 2,
      "display": "Not Hispanic or Latino",
      "kbEthnicity": null
    }
  ],
  "race": [
    {
      "id": 4,
      "display": "Black"
    },
    {
      "id": 6,
      "display": "Other Race"
    }
  ]
}

Destination data json file:
{
  "dryRun": "true",
  "person": {
    "firstName": "[person.name.first]",
    "lastName": "[person.name.last]",
    "dateOfBirth": "[person.dob]",
    "gender": "[person.gender]",
    "race": "[race]"
  }
}

Final json file that I want:
{
"dryRun": "true",
"person": {
"firstName": "John",
"lastName": "Dominick",
"dateOfBirth": "1958-10-31T00:00:00",
"gender": "MALE",
"race": "Black, Other Race"
}
}
Here is the code that I wrote using the following SO post that reads both files and is able to extract the correct values from the source file, but I am stuck on what is the best way to create a final json file.
public static void  Main(string[] args)
{
    var sourceJson = File.ReadAllText("./sourcedata.json");
    var srcObj = JObject.Parse(sourceJson);
    var destJson = File.ReadAllText("./destinationdata.json");
    var destObj = JObject.Parse(destJson);

    var result = destObj.Descendants()
        .OfType<JProperty>()
        .Select(p => new KeyValuePair<string, object>(p.Path,
            p.Value.Type == JTokenType.Array || p.Value.Type == JTokenType.Object
                ? null : p.Value));

    foreach (var kvp in result)
    {
        var isVariable = kvp.Value == null ? false : Regex.IsMatch(kvp.Value.ToString(), @"^\[.*?\]$");
        if (isVariable)
        {
            var variable = Regex.Replace(kvp.Value.ToString(), @"[\[\]]+", "");
            Console.WriteLine($"Key: {kvp.Key}  Value: {kvp.Value}  Updated: {srcObj.SelectToken(variable)}");
        }
        else
        {
            Console.WriteLine($"Key: {kvp.Key}  Value: {kvp.Value}");
        }
    }
}

Another issue that I want to solve is how to concatenate the values if there is an array? Any help would be appreciated.

A: High level: You need two POCO objects: one to deserialize your source json (with the values), and one to serialize to your destination json.
You read in the source, deserialize to the source poco, translate from source poco to destination poco, and then serialize that as destination json.
I think that's much more straightforward than working with JObjects, etc.
Here is a slightly simplified version of your objects:
using System;
using Newtonsoft.Json;

public class Program
{
    public static void Main()
    {
        var json = @"{""person"":{""name"": {""first"": ""John"",""last"": ""Dominick""}}}";

        var objA = Newtonsoft.Json.JsonConvert.DeserializeObject<Source.MyObject>(json);
        Console.WriteLine("FirstName: " + objA.Person.Name.FirstName);

        var objB = new Destination.MyObject(objA);
        var outJson = Newtonsoft.Json.JsonConvert.SerializeObject(objB);
        Console.WriteLine(outJson);

    }
}
public class Source{
    public class MyObject
        {
            [JsonProperty("person")]
            public Person Person { get; set; }
        }
    public class Person
        {
            [JsonProperty("name")]
            public Name Name { get; set; }
        }
    public class Name
        {
            [JsonProperty("first")]
            public string FirstName { get; set; }

            [JsonProperty("last")]
            public string LastName { get; set; }
        }
}

public class Destination{
    public class MyObject{
        public MyObject(Source.MyObject sourceObject){
            Person = new Person();
            Person.FirstName = sourceObject.Person.Name.FirstName;
            Person.LastName = sourceObject.Person.Name.LastName;
        }

        [JsonProperty("person")]
        public Person Person {get;set;}
    }

    public class Person
    {
        [JsonProperty("firstName")]
        public string FirstName {get;set;}

        [JsonProperty("lastName")]
        public string LastName {get;set;}
    }
}

Output:

FirstName: John
{"person":{"firstName":"John","lastName":"Dominick"}}

see:
https://dotnetfiddle.net/0V4pEO


text:
Q: How to set value variable from checkbox checked laravel? I have blade:

                  Họ và tên
                  <input type="text" class="form-control" id="exampleInputEmail1" placeholder="Nhập tên" name="username" value="{{old('username')}}">

                  Email
                  <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Nhập địa chỉ email" name="email" value="{{old('email')}}">

                  Mật khẩu
                  <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Nhập mật khẩu" name="pass1">

                  Nhập lại mật khẩu
                  <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Nhập lại mật khẩu" name="pass2">

                    <input type="checkbox" name="cbadmin" value="1" {{old('cbadmin') ? "checked" : ''}} > Admin

I want set value variable $lv =1 while checkbox "cbadmin" checked. But not know how to retrieve it. I want set default lv=0, lv=1 if checkbox checked.
public function getAdd(AddUserRequest $request)
    {
        User::create([
            'name' => $request->username,
            'email' => $request->email,
            'password' => Hash::make($request->pass1),
            'level' => ????
        ]);
        return redirect('admin/manage-user/add')->with('success','Bạn đã thêm thành công!');
    }

A: You could check whether cbadmin exists in the $request. If it exists, it was checked and then you could set $lv to 1.
$lv=isset($request['cbadmin'])?1:0;

A: Use input() with a default value for the case of cbadmin being unchecked:
User::create([
    'name' => $request->username,
    'email' => $request->email,
    'password' => Hash::make($request->pass1),
    'level' => (int)$request->input('cbadmin', 0)
 );


text:
Q: Proving convexity of $f(K)=\ln\left(\frac{\sin(t\sqrt{K})}{\sin(\sqrt{K})}\right)$ for $K\in(0,\pi^2)$ Define for $K\in(0,\pi^2)$ the function
$$f:K\quad\mapsto\quad\ln\left(\frac{\sin(t\sqrt{K})}{\sin(\sqrt{K})}\right)\qquad t\in(0,1)\mbox{ fixed}.$$I need to prove convexity of this function as function of $K$ but how? As function of $K$, the second derivative is pretty terrifying.

A: $$f(K)=\log \left(\csc \left(\sqrt{K}\right) \sin \left(\sqrt{K} t\right)\right)=\log \left(\csc \left(\sqrt{K}\right) \right)+\log \left(\sin \left(t\sqrt{K} \right)\right)$$
$$f''(K)=\frac{\sqrt{K} \left(\csc ^2\left(\sqrt{K}\right)-t^2 \csc ^2\left(t\sqrt{K}
   \right)\right)-t \cot \left(t\sqrt{K}\right)+\cot \left(\sqrt{K}\right)}{4
   K^{3/2}}$$
Expanding as a series around $t=0$ gives
$$f''(K)=\frac{\sqrt{K} \cot \left(\sqrt{K}\right)+K \csc ^2\left(\sqrt{K}\right)-2}{4
   K^2}-\frac{t^4}{90}+O\left(t^6\right)$$ It is quite simple to show that the first term is always positive.
Moreover, for small values of $K$
$$f''(K)=\frac{1}{90}+\frac{2 K}{945}+\frac{K^2}{3150}+\frac{4
   K^3}{93555}+O\left(K^{4}\right)$$ and for $K$ close to $\pi^2$
$$f''(x)=\frac{1}{\left(K-\pi ^2\right)^2}+\frac{4 \pi ^2-33}{48 \pi ^4}+\frac{\left(21-2 \pi
   ^2\right) \left(K-\pi ^2\right)}{16 \pi ^6}+O\left(\left(K-\pi
   ^2\right)^2\right)$$


text:
Q: Polars Supertype on date when shift_and_fill I have the following two snippets that should do the same (ignore the edge case where 0 index is None):
date_to_fill = df['time_start'][0]
df['time_start'] = df['time_start'].shift_and_fill(window_size, date_to_fill)

df['time_start'] = df['time_start'].shift(window_size)
df['time_start'].fill_null("backward")

In both cases, the series is shifted by window_size positions, and then the first 0..window_size positions get filled with the initial data. However, when I run the former I get a polars exception:
exceptions.ComputeError: Failed to determine supertype of Datetime(Nanoseconds, Some("UTC")) and Datetime(Microseconds, None)

The exception is not thrown in the second snippet, though the same data is taken (or is the dt converted when taken as a singular variable)
EDIT: Test Data
[{'time_start': datetime.datetime(2022, 7, 25, 10, 43, 52),
  'time_end': datetime.datetime(2022, 7, 25, 10, 43, 7),
  'value': None,
  'min_value': 80,
  'max_value': 98,
  'avg_value': 88.66666666666667},
 {'time_start': datetime.datetime(2022, 7, 25, 10, 43, 49),
  'time_end': datetime.datetime(2022, 7, 25, 10, 43, 2),
  'value': 79,
  'min_value': 79,
  'max_value': 80,
  'avg_value': 82.33333333333333},
 {'time_start': datetime.datetime(2022, 7, 25, 10, 43, 21),
  'time_end': datetime.datetime(2022, 7, 25, 10, 43),
  'value': 79,
  'min_value': 79,
  'max_value': 80,
  'avg_value': 79.33333333333333}]

This is Polars 0.13.58


text:
Q: The APK won't run on the android emulator. (Unfortunately the app has stopped) I am new to android app development. I wrote an android code for a simple app that on clicking the Add one button, adds 1 to the total in the text field that's supposed to be above the button and on clicking subtract one button, subtracts 1 from the Text field above. Here is the code for it.
package com.example.ocrtransbybee;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.*;

public class StartingPoint extends Activity {

int counter;
Button add, sub;
TextView display;

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

    counter = 0;
    add = (Button) findViewById(R.id.bAdd);
    sub = (Button) findViewById(R.id.bSub);
    display = (Button) findViewById(R.id.tvDisplay);

add.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            counter++;
            display.setText("Your total is " + counter);
        }
    });
sub.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub
            counter--;
            display.setText("Your total is " + counter);
        }
    });

}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.starting_point, menu);
    return true;
}

}

And the layout xml code is:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context=".StartingPoint" >

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/hey"
    android:textSize="50sp"
    android:layout_gravity="center"
    android:gravity="center"
    android:id="@+id/tvDisplay"
    />

<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/Button1"
    android:textSize="15sp"
    android:layout_gravity="center"
    android:gravity="center"
    android:id="@+id/bAdd"
    />
<Button
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="@string/Button2"
    android:textSize="15sp"
    android:layout_gravity="center"
    android:gravity="center"
    android:id="@+id/bSub"
    />
    </LinearLayout>

And the runtime information:
[2014-02-16 20:57:49 - OCRTransByBee] New emulator found: emulator-5554
[2014-02-16 20:57:49 - OCRTransByBee] Waiting for HOME ('android.process.acore') to be launched...
[2014-02-16 21:00:41 - OCRTransByBee] HOME is up on device 'emulator-5554'

[2014-02-16 21:00:41 - OCRTransByBee] Uploading OCRTransByBee.apk onto device 'emulator-5554'

[2014-02-16 21:00:42 - OCRTransByBee] Installing OCRTransByBee.apk...

[2014-02-16 21:02:04 - OCRTransByBee] Success!

[2014-02-16 21:02:05 - OCRTransByBee] Starting activity com.example.ocrtransbybee.StartingPoint on device emulator-5554

[2014-02-16 21:02:11 - OCRTransByBee] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.ocrtransbybee/.StartingPoint }

It doesn't start in the emulator, the code seems fine to me, it was working fine in the school in my friend's laptop, it says "Unfortunately, the app has stopped" every time I try to run it.

A: You are casting TextView with a Button.
TextView display;

And you have
display = (Button) findViewById(R.id.tvDisplay);

Should be
display = (TextView) findViewById(R.id.tvDisplay);

A: You trying to cast display(TextView) object with Button Class.
Just replace
display = (Button) findViewById(R.id.tvDisplay);
with
display = (TextView) findViewById(R.id.tvDisplay);

A: There is cast class exception in code.
The problem is in this code of line.
display = (Button) findViewById(R.id.tvDisplay);

Change is to
display=  (TextView)findViewById(R.id.tvDisplay);


text:
Q: GET route only works with parameter - node.js + express I'm very new to node + express and having trouble setting up a get route. When I use a parameter within the route called out below, I am getting data back without any issues. However, when I try to return an object back without the parameter, I get a blank page from postman & localhost:3000.
I initially thought my loop was causing the issue but when I console.log the object I'm attempting to pass in the res.send, it appears just fine.
Below are two of my routes (in this instance, /cards/imgs returns a blank page but /cards/imgs:id path returns the url correctly:
edit 1: adding code above routes that define of idIndexes in routes.js
routes.js -
const cards = require('C:/Hearthstone/cards.json');
const data = cards["data"];
var idIndexes = [];
var cardClassIndexes = [];

for (let a in data) {
    idIndexes.push(data[a]["id"]);
};

// index the cards by their "cardClass"
for (let a in data) {
    cardClassIndexes.push(data[a]["cardClass"]);
};

module.exports = (app, db) => {
    // get all card image urls
    app.get('/cards/imgs', (req, res) => {
        const imgURL = 'http://media.services.zam.com/v1/media/byName/hs/cards/enus/'
        var imgArr = {};
        for (let id in idIndexes) {
            var cardID = idIndexes[id];
            var imgURL_Temp = imgURL + cardID + '.png';
            imgArr[cardID] = imgURL_Temp;
        };
        res.set('Content-Type', 'application/json');
        res.send(JSON.stringify(imgArr));
    });

    // get card image url based on id
    app.get('/cards/imgs/:id', (req, res) => {
        const id = req.params.id;
        const imgURL = 'http://media.services.zam.com/v1/media/byName/hs/cards/enus/'
        const imgURL_Temp = imgURL + id + '.png';
        var arr = {};
        arr["url"] = imgURL_Temp
        res.set('Content-Type', 'application/json');
        res.send(arr);
    });

    // get all card information
    app.get('/cards', (req, res) => {
        res.set('Content-Type', 'application/json');
        res.send(JSON.stringify(data));
    });
};

Below are the remaining files used for the API
index.js file -
const cardRoutes = require('./routes.js');

module.exports = (app, db) => {
    cardRoutes(app, db);
};

server.js file -
const express = require('express');
const MongoClient = require('mongodb').MongoClient;
const bodyParser = require('body-parser');

const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

const port = 3000;

const routes = require('./app/routes');

require('./app/routes')(app, {});

if (app.listen(port)) {
    console.log("Live on port: " + port);
};

cmd
localhost
localhost:3000/cards/
package.json file -
{
  "name": "Hearthstone",
  "version": "1.0.0",
  "description": "API for Hearthstone cards",
  "main": "index.js",
  "scripts": {
    "test": "start",
    "dev": "nodemon server.js"
  },
  "author": "michael gross",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.18.2",
    "express": "^4.16.2",
    "mongodb": "^3.0.2"
  },
  "devDependencies": {
    "nodemon": "^1.14.12"
  }
 }

A: idIndexes is not defined.
app.get('/cards/imgs', (req, res) => {
        const imgURL = 'http://media.services.zam.com/v1/media/byName/hs/cards/enus/'
        var imgArr = {};
        for (let id in idIndexes) { //here
            var cardID = idIndexes[id];
            var imgURL_Temp = imgURL + cardID + '.png';
            imgArr[cardID] = imgURL_Temp;
        };
        res.set('Content-Type', 'application/json');
        res.send(JSON.stringify(imgArr));
        });

A: Try changing your routes.js file like this...
routes.js
module.exports = (app, db) => {
    // get all card image urls
    app.get('/cards/imgs', (req, res) => {
        const imgURL = 'http://media.services.zam.com/v1/media/byName/hs/cards/enus/'
        var imgArr = {};
        for (let id in idIndexes) {
            var cardID = idIndexes[id];
            var imgURL_Temp = imgURL + cardID + '.png';
            imgArr[cardID] = imgURL_Temp;
        };
        res.status(200).send(imgArr);
    });

    // get card image url based on id
    app.get('/cards/imgs/:id', (req, res) => {
        const id = req.params.id;
        const imgURL = 'http://media.services.zam.com/v1/media/byName/hs/cards/enus/'
        const imgURL_Temp = imgURL + id + '.png';
        var arr = {};
        arr["url"] = imgURL_Temp
        res.status(200).send(arr);
    });
};


text:
Q: During add service hdfs in cloudera manager, I am getting error message failed to create tmp directory I installed cloudera manager 5.12.0 successfully . But when I try to add hdfs
service, I got following error message :
failed to create tmp directory . But it was installed. Then try to restart cluster. But if failed to start again . It says no data node role are associated with hdfs . At least one node is required.
Could anyone please tell me why I am getting error message like this ? How to solve the problem.
I am using centos 7.
Thanks


text:
Q: Employee Qualification Infotype 0024 In transaction PA30 after you enter a Personnel Number and select Infotype 0024, it will display all the qualifications of that employee (if they have any).
I want to create a report with 3 parameters ('Qualification group', 'Name' , 'Proficency' ) and after the user inserts data, to display all employees that have those skills. If I access table PA0024, it has no entries, so my question is:
In which table (or where) can I find all employees with their qualifications?
Any other suggestions on how to make this report would help.

A: As I recall, some qualifications can be stored in the PD tables.

*

*Qualifications are objets type 'Q' stored in HRP1000.

*Relations between an employee and its qualifications are stored into HRP1001. The field ADATANR of this relation is the key for an entry in table HRPAD31 (I think) which contains the rating of this employee for this qualification.

Others tables are T77TS (holds the Qualification IDs and text) and T77TP (holds the Qualification Scale IDs and Texts)
There are also function module in the function group "RHPP", such as RHPP_Q_PROFILE_READ (using P objects in the OBJECTS parameter)

A: Using the learner as input, you can execute LSO_LEARNER_GET_CPROFILE_C to get the different qualifications.