text:
Q: How to install Visual C++ Redistributable Package 2015 with Inno Setup? I got this lines:
[Files]
Source: "vc_redist.x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall

[Run]
Filename: {tmp}\vc_redist.x64.exe; Parameters: "/install /passive /norestart";
 StatusMsg: Installing VC++ 2015 Redistributables...
Filename: "{app}\{#MyAppExeName}";
 Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}";
 Flags: nowait postinstall skipifsilent

But there's something wrong because it never installs the vc_redist.64.exe
EDIT: Here's the log.
[21:25:22,783]   *** Setup started
[21:25:29,299]   Setup version: Inno Setup version 5.5.9 (a)
[21:25:29,300]   Original Setup EXE: C:\Users\Justo\Desktop\pruebas\ANdi.exe
[21:25:29,301]   Setup command line: /SL5="$200EAA,183958979,53760,C:\Users\Justo\Desktop\pruebas\ANdi.exe" /SPAWNWND=$300F00 /NOTIFYWND=$170EEE /DEBUGWND=$1B60C36
[21:25:29,302]   Windows version: 10.0.14393  (NT platform: Yes)
[21:25:29,303]   64-bit Windows: Yes
[21:25:29,304]   Processor architecture: x64
[21:25:29,305]   User privileges: Administrative
[21:25:29,307]   64-bit install mode: No
[21:25:34,891]   Created temporary directory: C:\Users\Justo\AppData\Local\Temp\is-GVDUU.tmp
[21:25:44,315]   Starting the installation process.
[21:25:44,319]   Creating directory: C:\Program Files (x86)\ANdi
[21:25:44,321]   Directory for uninstall files: C:\Program Files (x86)\ANdi
[21:25:44,322]   Creating new uninstall log: C:\Program Files (x86)\ANdi\unins000.dat

[21:25:44,327]   -- File entry --
[21:25:44,329]   Dest filename: C:\Program Files (x86)\ANdi\unins000.exe
[21:25:44,332]   Time stamp of our file: 2016-12-26 21:25:29.248
[21:25:44,334]   Installing the file.
[21:25:44,337]   Uninstaller requires administrator: Yes
[21:25:44,462]   Successfully installed the file.

[21:25:44,471]   -- File entry --
[21:25:44,473]   Dest filename: C:\Program Files (x86)\ANdi\ANDI.exe
[21:25:44,475]   Time stamp of our file: 2016-12-23 15:54:56.000
[21:25:44,476]   Installing the file.
[21:25:50,568]   Successfully installed the file.

[21:25:50,578]   -- File entry --
[21:25:50,580]   Dest filename: C:\Program Files (x86)\ANdi\JPLEPH.exe
[21:25:50,582]   Time stamp of our file: 2016-11-03 20:07:04.000
[21:25:50,584]   Installing the file.
[21:25:50,605]   Successfully installed the file.

[21:25:50,616]   -- File entry --
[21:25:50,618]   Dest filename: C:\Program Files (x86)\ANdi\JPLEPH.430
[21:25:50,620]   Time stamp of our file: 2016-10-14 12:42:00.000
[21:25:50,621]   Installing the file.
[21:26:00,566]   Successfully installed the file.

[21:26:00,575]   -- File entry --
[21:26:00,577]   Dest filename: C:\WINDOWS\Fonts\astro.ttf
[21:26:00,585]   Time stamp of our file: 1996-09-03 03:00:00.000
[21:26:00,587]   Dest file exists.
[21:26:00,588]   Skipping due to "onlyifdoesntexist" flag.

[21:26:00,600]   -- File entry --
[21:26:00,602]   Dest filename: C:\Users\Justo\AppData\Local\Temp\is-
GVDUU.tmp\vc_redist.x64.exe
[21:26:00,604]   Time stamp of our file: 2016-12-26 18:52:40.000
[21:26:00,605]   Installing the file.
[21:26:02,005]   Successfully installed the file.

[21:26:02,014]   -- Icon entry --
[21:26:02,016]   Dest filename: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\ANdi.lnk
[21:26:02,018]   Creating the icon.
[21:26:02,048]   Successfully created the icon.

[21:26:02,057]   -- Icon entry --
[21:26:02,059]   Dest filename: C:\Users\Public\Desktop\ANdi.lnk
[21:26:02,061]   Creating the icon.
[21:26:02,073]   Successfully created the icon.
[21:26:02,087]   Installation process succeeded.

[21:26:02,099]   -- Run entry --
[21:26:02,100]   Run as: Current user
[21:26:02,102]   Type: Exec
[21:26:02,103]   Filename: C:\Users\Justo\AppData\Local\Temp\is-GVDUU.tmp\vc_redist.x64.exe
[21:26:02,105]   Parameters: /install /passive /norestart
[21:26:02,857]   Process exit code: 1638
[21:26:02,860]   Need to restart Windows? No

[21:26:05,117]   -- Run entry --
[21:26:05,119]   Run as: Original user
[21:26:05,121]   Type: Exec
[21:26:05,122]   Filename: C:\Program Files (x86)\ANdi\ANDI.exe
[21:26:05,388]   Deinitializing Setup.
[21:26:05,430]   *** Setup exit code: 0

Could you help me? Thanks a lot.

A: I appreciate it's late for an answer but this has a lot of views so I hope this information helps someone. The key parts are the function DoVcredistInstall and it's use in the Inno install step CurStepChanged.
Here are some snippets from an Inno Setup script I use: -
function DoVcredistInstall():Integer;
var
  ResultCode: Integer;
  strResultCode: String;

begin
  Log('Inside DoVcredistInstall');
  ResultCode := 0;
  NeedRestartFlag := False;

  if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7e9fae12-5bbf-47fb-b944-09c49e75c061}') then
    Begin
      Log('REDIST INSTALLED');
    End
  else
    Begin
      ProgressPage := CreateOutputProgressPage('Microsoft Redistributables Check');

      ProgressPage.Show;

      ExtractTemporaryFile('VC_redist.x86.exe');

      Exec(ExpandConstant('{tmp}\VC_redist.x86.exe'), '/q /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);

      strResultCode := IntToStr(ResultCode);

      ProgressPage.Hide;
    End;

  Log('VCREDIST RETURN CODE = ' + strResultCode);
  Result := ResultCode;
end;

{ Is app running check }
function IsAppRunning(FileName : string): Boolean;
var
  FSWbemLocator: Variant;
  FWMIService : Variant;
  FWbemObjectSet: Variant;
begin
  Result := false;
  FSWbemLocator := CreateOleObject('WBEMScripting.SWBEMLocator');
  FWMIService := FSWbemLocator.ConnectServer('', 'root\CIMV2', '', '');
  FWbemObjectSet := FWMIService.ExecQuery(Format('SELECT Name FROM Win32_Process Where Name="%s"',[FileName]));
  Result := (FWbemObjectSet.Count > 0);
  FWbemObjectSet := Unassigned;
  FWMIService := Unassigned;
  FSWbemLocator := Unassigned;

  if Result = TRUE then
    begin
      msgBox('App Already Running Error',mbInformation,MB_OK);
    end;

end;

{ Look for the specified Window open }
function myFindWindow(WindowData: String): Boolean;
var
 hWND: integer;
begin
  hWND := FindWindowByWindowName(WindowData);

  if hWND > 0 then
    begin
      MsgBox('Application Window Open Error',mbInformation,MB_OK);

      Result := True;
    end
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  VcredistResultCode: Integer;
  strVcredistResultCode: String;

  begin
    if CurStep = ssInstall then
      begin
        NeedRestartFlag := False;
        VcredistResultCode := DoVcredistInstall();
        strVcredistResultCode := 'CurStepChanged VcredistResultCode = ' + IntToStr(VcredistResultCode);
        Log(strVcredistResultCode);
        if (VcredistResultCode = 1641) OR (VcredistResultCode = 3010) then { runtime install restart required, 1641=reboot initiated by vcredist, 3010 = success but reboot required }
          begin
            NeedRestartFlag := True;
          end
        else
          begin
            if (VcredistResultCode <> 0) AND (VcredistResultCode <> 1638) then { runtime install failed 0=success, 1638=new version already installed, anything else = failed }
              begin
                MsgBox('Install error = ' + strVcredistResultCode',mbInformation,MB_OK);
                Abort();  { abort }
              end
          end
     end;
  end;

function NeedRestart(): Boolean;
begin
  if NeedRestartFlag then
  begin
    Log('Need restart');
    Result := True;
  end
    else
  begin
    Log('Do not need restart');
    Result := False;
  end;
end;

This checks for one specific version of the runtime so you will probably have to change the key data to reflect your version. I got the data from:
Detect if Visual C++ Redistributable for Visual Studio 2012 is installed


text:
Q: first_name last_name paypal ipn I am trying to send POST vars to paypal ipn like that:
<form class="form-horizontal paypal-button" method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" target="_top" style="opacity: 1;">
<input type="hidden" name="button" value="buynow">
<input type="hidden" name="business" value="vendedor@estadosbinarios.com">
<input type="hidden" name="quantity" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="shipping" value="0">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="notify_url" value="http://www.estadosbinarios.com/pagos/paypal_ipn.php">
<input type="hidden" name="return" value="http://www.estadosbinarios.com/pagos/success.php">
<input type="hidden" name="env" value="www.sandbox">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="bn" value="JavaScriptButton_buynow">
<!-- Enable override of buyers's address stored with PayPal . -->
<input type="hidden" name="address_override" value="1">
<input id="nombre" name="first_name" type="text" placeholder="" class="form-control input-md">
  <input id="nombre" name="last_name" type="text" placeholder="" class="form-control input-md">
</form>

But Paypal doesn´t care my vars first_name or last_name, paypal is always getting the vars from user account of paypal and overwriting that var.
Is there any way to choose my vars?

A: When people pay with PayPal through it is indeed going to use the info provided from the shipping address of their account.  You can't get around this with Payments Standard like you're using.
You could switch to the Express Checkout API which would give you the option of collecting the buyers name, address, etc. and then passing that over to PayPal in a way that cannot be overridden.  This way you'd get whatever they typed into your site instead of relying on PayPal to provide those details.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Is npm in Node like virtualenv in Django? I'm new to NodeJS and I'm having trouble understanding npm
I'm following this tutorial and I can't seem to map the concepts tot he ones I know from my Django experience.
Where exactly do my packages get installed? Can't I have project-specific packages like Django does with virtualenv? If I understand correctly this might cause compatibility issues in the future.

A: npm is like pip in Python, its a way to download and install packages. node_modules is a directory where these packages are installed. This is not the same as a virtual environment; which has the interpreter along with additional libraries.
In node, you can get a virtual environment (see: is there an virtual environment for node.js? for more details). The idea is the same - an isolated environment for better testing and portability.
In Python, there is requirements.txt (and pipenv), in node you have package.json (for packages), and modules (which go in node_modules).
The documentation goes into a bit more detail into the difference of these; but coming from Python you can think of a node package as something that has a package.json (so, like a setup.py), and a module is just any file you can import (or include() in node).

A: Hey when you install a package with npm the packages are installed to node_modules within the working directory (on a project to project basis).
With the exception of when installing packages globally (npm install -g packagename)

A: To add to the excellent answer above, and to confirm if this suspicion of mine is true:
The major difference between node_modules not creating a true virtual environment is that whenever you run a node application, it will "reach_out" to use the node/js interpreter that is installed "globally" .. this of course can be manipulated with nVm, but python's virtual environments don't run on a "globally" installed python interpreter, instead with the one scoped-narrowly to the virtual environment


text:
Q: How to check if selected text overflows into certain class Context:
I'm trying to figure out a way to tell if a certain user-highlighted portion of text includes a class, and if it does, disallow the user from highlighting that block of text.
On my website, users can create their own articles. On these articles, users can highlight text and comment on it. Take this text for example:

Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod

If this was a users's article, I could go in and highlight the text "Lorem ipsum", like so:

"Lorem ipsum dolor sit amet consectetur adipiscing elit sed do
  eiusmod."

This creates a class around the highlighted text which has background-color set to grey.
At this point, I want to disallow the user from highlighting any of the text that has already been highlighted ("Lorem ipsum"), because I have problems with highlighting words that are part of more than one highlight correctly.
So, I need a system where, when the user makes a highlight that includes any part of the text that is already contained in a class, for example:

"Lorem ipsum dolor sit amet consectetur adipiscing elit sed do
  eiusmod"

With the highlight "ipsum dolor" including "ipsum", which was already highlighted and already has a class name
That then an alert pops up and the highlight is not made.

What I have tried so far:
I have already tried using setting the css property user-select: none;

*

*This doesn't allow the user to highlight the text that has this class directly

*Though users can still start their cursor at a different point and bleed into the text with this property, making it possible to make the highlight.

Question & Example JSFiddle:
How can I tell if highlighted text contains text from a certain class?
Here's an example of what I want to happen when the user highlights text that is contained in another class:

$("div").click(function() {
    checkIfTextisAlreadyHighlighted();
});

function checkIfTextisAlreadyHighlighted() {
   var sel = window.getSelection();
    if (sel) {
       alert("This text contains the class *class name here* and cannot be highlighted.");
    }
}
.highlighted {
    background-color: lightGrey;
}

  Selecting this text should make this message appear if text that already contains class is highlighted. More random text.

A: Some explanations on the following implementation:

*

*Extract the selection and get the range.

*Once you have the range - check if the start & end is the same node (if so - we will not get the container element and therefor there is no classname that we can check agains - we need to check if the parent has the relevant class).

*If we have multiple elements in our selection - we can check if the cloned elements has the class we are after (using the querySelector).

*(This was not part of the question) - you can also remove the selection if you need it.

Here is a working example:

$("div").mouseup(function() {
    checkIfTextisAlreadyHighlighted();
});

function resetSelection() {
  window.getSelection().removeAllRanges();
}

function checkIfTextisAlreadyHighlighted() {
    const classToSearch = 'highlighted';
    const sel = window.getSelection();
    const range = sel.getRangeAt(0);
    if (range.startContainer === range.endContainer && range.startContainer.parentElement.classList.contains(classToSearch)) {
        alert(`This text contains the class ${classToSearch} and cannot be highlighted.`);
        resetSelection();
    } else {
        if (range.cloneContents().querySelector(`.${classToSearch}`) !== null) {
            alert(`This text contains the class ${classToSearch} and cannot be highlighted.`);
            resetSelection();
        }
    }
}
.highlighted {
    background-color: lightGrey;
}

  Selecting this text should make this message appear if text that already contains class is highlighted.
  More random text.
  Selecting this text should make this message appear if text that already contains class is highlighted.
  More random text.

A: If you just want to avoid user from selecting that specific highlighted text you can add
    user-select: none;
to its class.

.highlighted {
  background-color: grey;
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -moz-user-select: none;
}
Lorem ipsum dolor sit amet consectetur adipiscing elit sed do eiusmod.


text:
Q: P/Invoke Function Overloading I'm attempting to P/Invoke a C library from F#, and have encountered a peculiar issue. I have a module containing all my extern functions. The underlying C library has two functions with the same name, but different arguments. This, of course, is not allowed in an F# module.
module C =

  open System.Runtime.InteropServices

  [<DllImport("libc", CallingConvention = CallingConvention.Cdecl)>]
  extern int setValue(nativeint source, int value)

  [<DllImport("libc", CallingConvention = CallingConvention.Cdecl)>]
  extern int setValue(nativeint source, string value)

  // the previous function declaration cause the following compile-time error:
  // Duplicate definition of value 'setValue'

Is there some special way to work around this? I can not alter the C library.

A: The EntryPoint attribute should work (e.g. with an ordinal), if MSDN can be trusted (haven't tested in F#). Name your imported functions e.g. setValueInt() and setValueString().


text:
Q: QT slots and signals fail Hi there i got problem with signal and slots in qt.
In main i have created object of mainwindow.
in mainwindow.cpp i creating object of another class(modbus_tcp).
i also creating connection here
void MainWindow::on_ConnectB_clicked()
{

    modbus_tcp appts;
    appts.slave();
    connect(&appts,SIGNAL(msgSended(QString)),this,SLOT(msgEdit(QString)));
}

between slot declared in mainwindow.cpp/h
public slots:
void msgEdit(QString m);

void MainWindow::msgEdit(QString m)
{
ui->sendEdit->setText(m);
ui->recvEdit->setText(m);
//QMessageBox::information(0,"bad", "nope nope nope");
}

and signal declared in modbus_tcp.h
signals:
void msgSended(QString);

next i emiting signal in modbus_tcp.cpp
emit msgSended("asdasd");

and nothing happen
when i trying to emit in mainwindow.cpp its working
any ideas ?

A: void MainWindow::on_ConnectB_clicked()
{

    modbus_tcp appts;
    appts.slave();
    connect(&appts,SIGNAL(msgSended(QString)),this,SLOT(msgEdit(QString)));
}

appts was created in stack, so it will be deleted at the end of slot execution. Try to create it in the heap(try to use pointer).
void MainWindow::on_ConnectB_clicked()
{

    modbus_tcp *appts = new modbus_tcp;
    connect(appts,SIGNAL(msgSended(QString)),this,SLOT(msgEdit(QString)));//first!
    appts->slave();//now you can call it
}

Use pointers, but first of all connect, and after this call slave. You emit signal in slave, but there is no connection in this time. You should do connection firstly and after that, you will be able to catch signals.


text:
Q: Firebase file upload progress jumps from 0 to 100 I'm using the Firebase Storage to upload files.
https://firebase.google.com/docs/storage/web/upload-files#monitor_upload_progress
The upload works well, but the on("state_changed") event is called only twice, so my progress bar jumps from 0% to 100%. Is it possible to get some values between 0 and 100? This would be a better experience for the user.

A: The number of time the state_changed event is raised, depends on the size of the file you upload: if fires for each block of 256KB. So if the file is <256KB this is expected behavior.


text:
Q: Catching SIGINT with conditional exit in Python I want to catch a SIGINT signal in my Python script. However, the script should only terminate if the user enters the correct password after sending the SIGINT. Can this be done in Python? Some sample code to illustrate the problem:
import signal

def signal_handler(signal, frame):
    password = raw_input("Enter password: ")
    if password != "secret":
        print("Wrong password!")
        # TODO don't let process end
    else:
        print("Password correct. Exiting now.")

signal.signal(signal.SIGINT, signal_handler)

EDIT: Changed variable 'pass' to 'password', as suggested in the comments below.

A: You can capture the SIGINT and dispatch the call off to a function.
e.g.
import signal
import sys
import time

def confirm_password(signal, frame, secret="shhh"):
  password = raw_input("Enter password: ")

  if password == secret:
      sys.exit(0)
  else:
      print("Password incorrect.  Refusing to exit.")

while True:
    signal.signal(signal.SIGINT, confirm_password)
    time.sleep(1000)

edit to add code that I've verified to work, not an example from memory :)


text:
Q: Listview adapter with gridview inside linearlayout showing items below eachother instead of in two columns I'm creating a ListView custom adapter using a gridview inside a linear layout to display user profiles.
My XML design view shows them correctly. However, when I run the app, it's showing each item below each other instead of spread over 2 columns.
Any idea on what I'm doing wrong?
Example
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <GridView
        android:id="@+id/grid_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:numColumns="2"
        android:stretchMode="columnWidth"
        android:gravity="center" />

    <ImageView
        android:id="@+id/rimage"
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:layout_margin="10dp"
        android:contentDescription="@string/todo"
        app:srcCompat="@drawable/thumb_default_icon_female" />

    <TextView
        android:id="@+id/rnick"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:text="@string/nick" />

    <TextView
        android:id="@+id/rcity"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="10dp"
        android:text="@string/city" />
</LinearLayout>

Showing
List Items

A: First of you should not be using a GridView but instead a RecyclerView since it has replaced the functionality of the old ListView and GridView.
Than to achieve what you want you need to create a GridLayoutManager with span count 2.
RecyclerView.LayoutManager layoutManager = new GridLayoutManager(this, 2);
recyclerView.setLayoutManager(layoutManager);

documentation

A: try this
 gridLayoutManagerVertical =
            new GridLayoutManager(this,
                    2, //The number of Columns in the grid
                    LinearLayoutManager.VERTICAL,
                    false);

A: Your current list items logic is something like this:
Item 1--> LinearLayout
        -->GridView
        -->ImageView
        -->TextView
        -->TextView

Item 2--> LinearLayout
        -->GridView
        -->ImageView
        -->TextView
        -->TextView

So in actual case, your items are LinearLayouts taking up the whole width of the device's screen.
Instead of a ListView, you should use a GridView as your items' container and you should implement your customAdapter to use LinearLayout items:
Your GridView in your Activity's layout:
<GridView
    android:id="@+id/grid_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:numColumns="2"
    android:stretchMode="columnWidth"
    android:gravity="center" />

Your items' layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">

<ImageView
    android:id="@+id/rimage"
    android:layout_width="150dp"
    android:layout_height="150dp"
    android:layout_margin="10dp"
    android:contentDescription="@string/todo"
    app:srcCompat="@drawable/thumb_default_icon_female" />

<TextView
    android:id="@+id/rnick"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="10dp"
    android:text="@string/nick" />

<TextView
    android:id="@+id/rcity"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="10dp"
    android:text="@string/city" />

and set your adapter to your GridView directly. Make sure your adapter extends BaseAdapter (not ListAdapter);
yourGridView.setAdapter(yourCustomAdapter);

All in all, a better approach would be to use a RecyclerView with GridLayoutManager.
recyclerView.setLayoutManager(new GridLayoutManager(getContext(), 2));
            recyclerView.setHasFixedSize(true);
            recyclerView.setAdapter(adapter);

Here is a simple tutorial

A: Use Nested LinearLayout instead of gridLayout, also you i think you forgot to put view inside the gridLayout, since they are outside the gridLayout and child of LinearLayout thats why they are displaying one below another. try the code below
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal" android:layout_width="fill_parent"
android:layout_height="fill_parent">

<ImageView
    android:id="@+id/rimage"
    android:layout_width="150dp"
    android:layout_height="150dp"
    android:layout_margin="10dp"
    android:contentDescription="@string/todo"
    app:srcCompat="@drawable/thumb_default_icon_female" />
<LinearLayout
    android:id="@+id/grid_view"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center" >
<TextView
    android:id="@+id/rnick"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginStart="10dp"
    android:text="@string/nick" />

<TextView
    android:id="@+id/rcity"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="10dp"
    android:text="@string/city" />
 </LinearLayout>
</LinearLayout>


text:
Q: Cassandra materialized view on collection truncate If I truncate the entire source table in Cassandra. How will the MV(materialized views)'s have that reflection.
Does this process may create parity between source partition and MV's if the data is continuously inserted into the source partition?
can you please explain the flow of collection truncate with materialize view involved?
FYI my usecase is that: I will have regular ingrace of CURD operation on source partitions and there in between there will be a collection truncate request. so does Cassandra will ensure that there won't be any Parity between MV and source partition?


text:
Q: Mean field 3d Ising model in Landau theory I am solving a problem for some course I am following. I am given the Hamiltonian:
$$H = 3NJ \langle \sigma\rangle ^2 -6J\langle \sigma\rangle \sum_i\sigma_i,$$
where $i$ sums over all sites ($=N$). This is the Hamiltonian for the 3D mean field Ising model. The average spin per site is $\langle\sigma\rangle\equiv m$ from now on. $J$ is some interaction energy, most references take here $J/2$ but we had to use $J$, does not matter that much of course.
I found the canonical partition function as follows:
$$Z= \sum_{configs} e^{-\beta H} = e^{-3\beta NJm^2} \sum_{configs} \prod_{i}e ^{6\beta Jm \sigma_i} = e^{-3\beta NJm^2} \prod_i 2^{N-1} (2\cosh(6\beta Jm)) = e^{-3\beta JNm^2}(2\cosh(6\beta Jm))^N,$$
where $configs$ denotes the sum over all configurations and $\sigma_i = \pm1$ is used.
From this I found the consistency equation for $m$:
$$m = \tanh(6\beta Jm),$$
using $h=  6Jm$ and $m = \frac{1}{N\beta} \frac{\partial \ln(Z)}{\partial h}$.
From this I derived the critical temperature:
$$T_c = \frac{6J}{k_B}.$$
From this I had to derive the Landau parameters $a$ and $b$. I had to do this by expanding the consistency equation around $m\approx 0$ and $T\approx T_c$ using the reduced temperature $t=(T-T_c)/T_c$. For the problem I had to use $t$ and $M = mN$ for the total magnetization.
This gives:
$$1 \approx \frac{T_c}{T} - \frac{M^2}{3 N^2}(\frac{T_c}{T})^3 + \frac{2M^4}{15 N^4}(\frac{T_c}{T})^5,$$
and using $1+t  = \frac{T}{T_c}$ we find:
$$1 \approx \frac{1}{1+t} - \frac{M^2}{3N^2}(1+t)^{-3}+ \frac{2M^4}{15N^4}(1+t)^{-5}.$$
We can taylor expand this for $t \approx 0$ as follows:
$$1 = 1 -t -t^2 - \frac{M^2}{3N^2}(1-3t+6t^2) + \frac{2M^4}{15N^4}(1-5t+15t^2).$$
I had to expand this expression to second order in $t$ and second order in $M^2$. Now I have to find the coefficients $a,b$ in the following where $\phi$ is the canonical potential so $\ln(Z)$:
$$\phi(T,M) = \phi_0(T) -aJtM^2 -bJM^4.$$
Does anyone have an idea how to connect my previous equation to this one? I am really stuck at this point and I do not see how to connect these two equations.

A: So the free energy functional, with parameters $m$ and $T$ is given by the logarithm of the partition function:
$$ F(m,T) = - \frac{1}{\beta} \log Z = 3 J N m^2 + \frac{N}{2\beta} \log \cosh(6\beta J m)^2 - \frac{N}{\beta} \log 2 \ . $$
It is convenient of replacing $\cosh$ by $\cosh^2$ for the following reason: we have
$$ \tanh(6\beta J m)^2 = \frac{\cosh(6\beta J m)^2-1}{\cosh(6\beta J m)^2} $$
and thus, using the consistency equation
$$ \cosh(6\beta J m)^2 = \frac{1}{1- \tanh(6\beta J m)^2} = \frac{1}{1-m^2} \ . $$
Hence we get
$$ F(m,T) = 3 J N m^2 + \frac{N}{2\beta} \log \frac{1}{1-m^2} - \frac{N}{\beta} \log 2 $$
Expanding in $m$:
$$  F(m,T) = (1 - 6\beta J) \frac{N m^2}{2} + \frac{N m^4}{4 \beta} + \mathcal{O}(m^6)  \ .$$
Note that if $t = \frac{T-T_c}{T}$, then
$$ (1 - 6\beta J) = \frac{T}{T_c} \frac{T-T_c}{T_c} = t + t^2 $$
and
$$ \frac{1}{\beta} = T_c + t T_c $$
So
$$ F(m,t) = \frac{t N m^2}{2} + \frac{T_c N m^4}{4} + \mathcal{O}(t^2,m^6,m^4 t) $$
Which is a sensible Landau free energy functional, but is not formulated in terms of the total magnetization $M$, so that remains unclear to me.


text:
Q: PageAsyncTask messes threads I have a category page (Classic ASP.NET) which loads products from DB (MS SQL Server). Each product (implemented as userControl) has its own databound controls. I want to load these product controls in parallel so I created a helper module which creates PageAsyncTask and register it.
Public Module AsyncHelper

Public Delegate Sub AsyncDeleg()

Private Function OnBegin(sender As Object, e As EventArgs, cb As AsyncCallback, state As Object) As IAsyncResult
    Return DirectCast(state, AsyncDeleg).BeginInvoke(cb, state)
End Function

Private Sub OnEnd(ar As IAsyncResult)
    Try
        DirectCast(ar.AsyncState, AsyncDeleg).EndInvoke(ar)
        HttpContext.Current.Trace.Write("OnEnd", ar.CompletedSynchronously)
    Catch ex As Exception
        DirectCast(ar.AsyncState, AsyncDeleg).Invoke()
        HttpContext.Current.Trace.Write("OnEnd", ex.Message)
    End Try
End Sub

Public Sub RunAsyncTask(pg As Web.UI.Page, subToRun As AsyncDeleg)
    pg.RegisterAsyncTask(New PageAsyncTask(AddressOf OnBegin, AddressOf OnEnd, Nothing, subToRun, True))
End Sub

End Module

The call from the UserControl is very simple:
AsyncHelper.RunAsyncTask(Me.Page, New AsyncHelper.AsyncDeleg(AddressOf BindData))

Sub BindData queries DB and binds result to a repeater or ListView.
It works really in parallel but sometimes it produces exception like
Control not found
Stack empty
For this purpose catch in OnEnd works fine.
Much worse thing is that sometimes it takes part data from correct product and part from any random product without any kind of error ;(
Technical details:
.NET 4.5
httpRuntime targetFramework="4.5"
<%@ Page Async="true"
Any suggestions?
Thank you.


text:
Q: Facing issue in establishing Pyspark session i am trying to connect two database Postgres and Sql Server.
from pyspark.sql import SparkSession

spark = SparkSession \
    .builder \
    .appName("Spark SQL basic example") \
    .config("spark.jars", "mssql-jdbc-8.4.1.jre8.jar") \
    .getOrCreate()

spark1 = SparkSession \
    .builder \
    .appName("Spark SQL basic example") \
    .config("spark.jars", "postgresql-42.2.5.jar") \
    .getOrCreate()

i am able to read data from Postgres database, when i am creating only on spark session as below
spark = SparkSession \
    .builder \
    .appName("Spark SQL basic example") \
    .config("spark.jars", "mssql-jdbc-8.4.1.jre8.jar") \
    .getOrCreate()

i am able to connect to Sql Server. I am new to Pyspark, please suggest me how to connect to two databases by using a Single session. Please help. TIA.

A: Actually you can put multiple jars in the same Spark session, in your spark you only add mssql jar while spark1 only add postgresql jar, that's why you can't connect the postgres in spark. In fact, you can add multiple jar in the same session like .config("spark.jars.packages", "jar1,jar2,...").


text:
Q: what is the meaning of the phrase "preceding initialization" in section [expr.const] constexpr int func(int const& rf){
    return rf;
}
int main(){
   constexpr int value = func(0);
}

Consider the above code, the variable value shall be initialized by a constant expression, which is func(0), which firstly shall be a core constant expression. To determine whether the expression func(0)is a core constant expression, the following rules will be applied to it, that is:
expr.const#2.7

An expression e is a core constant expression unless the evaluation of e, following the rules of the abstract machine, would evaluate one of the following expressions:

an lvalue-to-rvalue conversion unless it is applied to

[...], or
(2.7.4)  a non-volatile glvalue of literal type that refers to a non-volatile object whose lifetime began within the evaluation of e;

Despite the lvalue-to-rvalue conversion is applied to rf and such conversion satisfied the bullet (2.7.4), however, take a look to the next paragraph, that is:
expr.const#2.11

an id-expression that refers to a variable or data member of reference type unless the reference has a preceding initialization and either

*

*(2.11.1) it is initialized with a constant expression or,

*(2.11.2) its lifetime began within the evaluation of e;

I don't know what actually the phrase preceding initialization mean? Does it mean that a variable should be initialized before using it, or it means that in a declaration of a variable shall have an initializer. Anyhow, before applying the lvalue-to-rvalue conversion  to glvalue rf, the glvalue rf should be evaluated to determine the identity of an object, which is ruling by:

A glvalue is an expression whose evaluation determines the identity of an object, bit-field, or function.

That means not only bullet [expr.const#2.7] shall be obeyed but also [expr.const#2.11] shall be obeyed.
Because id-expression rf is of reference type. So, in order to make the expression func(0) be a core constant expression, the id-expression rf must have a preceding initialization, and satisfies at least one of  bullet (2.11.1) and (2.11.2). In my example, the bullet (2.11.2) is obeyed by rf and the compiler agree that func(0) is a constant expression. The outcome is here, the outcome seems to evidence that preceding initialization means be initialized rather than have an initializer due to the parameter declaration does not have an initializer in the first example.
In order to check such a thought, I test the below code:
constexpr int func(int const& rf){
    constexpr int const& v = rf;
    return 0;
}
int main(){
   static int const data = 0;
   constexpr int value = func(data);
}

The outcomes of the compilers point out rf is not a constant expression. I'm confuse at this outcome. According to the above supposition. rf has a preceding initialization, and the bullet (2.11.1) is obeyed because data is a constant expression, even if the bullet (2.11.2) does not be satisfied.
So, I wonder what actually does the phrase preceding initialization mean? If it means that a declaration for a variable has an initializer, how could the expression func(0) in the first example be a constant expression?

A:
The outcome seems to evidence that "preceding initialization" means "be initialized" rather than have an initializer due to the parameter declaration does not have an initializer in the first example.

It does mean "be initialized", but it's more importantly about the visibility of a preceding initialization within the context of the expression being evaluated. In your example, in the context of evaluating func(0) the compiler has the context to see the initialization of rf with 0. However, in the context of evaluating just the expression rf within func, it doesn't see an initialization of rf. The analysis is local, as in it doesn't analyze every call-site. This leads to expression rf itself within func not being a constant expression while func(0) is a constant expression.
If you were to write this instead:
constexpr int func(int const& rf) {
  /* constexpr */ int const& v = rf;
  return v;
}

int main() {
  static int const data = 0;
  constexpr int value = func(data);
}

This is okay again because in the context of func(data), rf has a preceding initialization with a constant expression data, and v has a preceding initialization with rf which is not a constant expression but its lifetime began within the evaluation of func(data).

A: This is CWG2186:

2186. Unclear point that "preceding initialization" must precede
Similar to the concern of issue 2166, the requirement of 8.20 [expr.const] bullet 2.7.1 for
— a non-volatile glvalue of integral or enumeration type that refers to a complete non-volatile const object with a preceding initialization, initialized with a constant expression, or
does not specify the point at which the determination of "preceding initialization" is made: is it at the point at which the reference to the variable appears lexically, or is it the point at which the outermost constant evaluation occurs? There is implementation divergence on this point.

But the meaning should be "lexically", because ODR.


text:
Q: Exercise 3.D. in Robert G. Bartle's book Let us consider the problem 3.D. in the book
$\textbf{The Elements of Integration and Lebesgue Measure}$
of Robert G. Bartle
Let $X=\mathbb{N}$ and $\mathcal{A}$ be the $\sigma-$algebra of all subsets of $\mathbb{N}$. If $(a_n)$  is a sequence of nonnegative real numbers and if we define $\mu$ by
$$
\mu(\emptyset)=0; \quad \mu(E)=\sum_{n\in E}a_n, \quad E\ne\emptyset,
$$
then $\mu$ is a measure on $\mathcal{A}$. Conversely, every measure on $\mathcal{A}$ is obtained in this way for some sequence $(a_n)$ in $\overline{R}^+$.
I am stuck in proving the countably additive property of $\mu$.
My attempt. I intend to use the theory of double index series to prove countably additive property.
Thank you for all solutions.

A: The proof of countable additivity:
\begin{align*}
\mu\left( \bigcup_{i=1}^\infty E_i\right)&=\sum_{n\in\bigcup _{i=1}^\infty E_i}a_n
\end{align*}
Notice that $(E_i)$ is a disjoint sequence, then n belongs to one and only one $E_i$, which means:
$$\sum_{n\in\bigcup _{i=1}^\infty E_i}a_n = \sum_{i=1}^{\infty}\sum_{n\in E_i}a_n = \sum_{i=1}^{\infty} \mu(E_i)$$
The proof of every measure on A is obtained in this way for some sequence $(a_n)$ in $\overline{R}^+$:
For every $E\subset N$, $E=\bigcup_{i=1}^{\infty}{\{n_i\}}$, where $n_i\in N$ or $\{n_i\}=\emptyset$. From the countable additivity of $\mu$ we know that:
$$\mu(E) = \sum_{n \in E}\mu(\{n\})$$
We set $\mu(\{n\}):=a_n$, which establishs the proposition.

A: We have to check the following

*

*$\mu(\emptyset)=0$, by definition

*$\mu(E)=\sum_{n\in E}a_n\geq 0$, since $a_n\geq 0$, for all $n$.

*Let $\{E_k\}$ be disjoint, then\begin{align*}
\mu\left( \bigcup_{k=1}^\infty E_k\right)&=\sum_{n\in\bigcup E_k}a_n=\sum_{k=1}^\infty \sum_{n\in E_k}a_n=\sum_{k=1}^\infty\mu (E_k).
\end{align*}
Thus, $\mu$ is a measure on X. Conversely, for $(a_n)$ in $\overline{\mathbb{R}}^+$, we can obtain any measure on X using the enunciated definition of $\mu$.


text:
Q: What does Primordial essence do? What does primordial essence do? I have this bar in the center of my screen but I don't know how it fills up, what happens when it's full and what its purpose is.

A: It is used to switch to a different aspect.

In order to shift into your chosen aspect, you'll have to collect and
  have enough Primordial Essence to fill its meter, and you can obtain
  this by killing monsters. Once it is full, press [R], and you'll shift
  into your apocalyptic form, the meter will then begin to deplete over
  time and you'll revert back to your original form once it's empty.

This is something that is unlocked at the end of the first chapter.

The first aspect can be unlocked near the end of Chapter 1, you'll be
  given the opportunity to unlock and choose your first aspect, however,
  as you progress through the game, you can unlock other aspects and
  players can switch other aspects at any given time once you've
  obtained a new one.

Source: https://wolcen.wiki.fextralife.com/Aspects


text:
Q: Fullscreen button in html5 tag I'm writing a html5 page with a embedded video tag for iPad.
How can I hide or disable the fullscreen button? I just need to show the video without the fullscreen option.

A: You could try removing the "controls" attribute on the video tag and create your own play/pause button(s).
http://webkit.org/blog/140/html5-media-support/


text:
Q: 404 while connecting to /hello/1 but 200 while connecting to any other number such as /hello/12 in flask Trying to learn flask but stuck with some error or maybe an issue.
def check_int(no):
    return "number is %d" %no
app.add_url_rule('/hello/<int:no>', 'nothign_specific', check_int)

So when I do a curl call to http://127.0.0.1:5000/hello/1 it fails wherein the same curl call to any other number apart from 1 passes.
http://127.0.0.1:5000/hello/<any number apart from 1 passes>
127.0.0.1 - - [05/Aug/2016 14:17:48] "GET /hello/1/ HTTP/1.1" 404 -
127.0.0.1 - - [05/Aug/2016 14:18:01] "GET /hello/12 HTTP/1.1" 200 -

Can someone let me know what's happening around

A: In flask, if your route (or rule) definition has no trailing slash is explicit. If you would add a trailing / to your url rule, i.e.
'/hello/<int:no>/'

then you would be able to use both (request with or without /).
According to flask docs, a route with a trailing slash is treated similar to a folder name in a file system: If accessed without the slash, flask will recognize it and redirect you to the one with slash. Contrastingly, a route that is defined without a trailing slash is treated like the pathname of a file, i.e. it will throw 404 when accessed with a trailing slash.
Read more: http://flask.pocoo.org/docs/0.11/quickstart/, section "Unique URLs / Redirection Behavior"


text:
Q: Flexbox working differently on safari compared to chrome I have here a rather frustrating scenario where my font "History Maps" centres within its title box on chrome using flexbox, but does not at all within the safari browser. Please see: http://www.historymaps2.drcrittall.com/welcome.php
Here is the html and CSS:

 /* Parent elements */
    html,body {

     height:100%;
    }

    /* Sets the container-fluid, row and column classes to 100% of the html and body elements */
    .container-fluid,.row, .col-md-6, .col-xs-10 {
     height:100%;
    }

    #titleframe {

     position:relative;
     display:-webkit-box;
     display:-ms-flexbox;
     display:flex;/* Flex-box ensures font is centered both vertically and horizontally within the title frame using align-items and justify-content. See http://stackoverflow.com/questions/5703552/css-center-text-horizontal-and-vertical-inside-a-div-block */
        -webkit-box-align:center;
        -ms-flex-align:center;
        align-items:center;
        -webkit-box-pack:center;
        -ms-flex-pack:center;
        justify-content:center;
        max-width:100%; /* max-width ensures background does not stretch outside container div */
        height:15%;   /* Represents height relative to parent elements - in this case .container-fluid,.row, .col-md-6, .col-xs-10 which are all set to 100% */
        border-style:solid;
        border-width:2px;
        border-color:black;

        background: url("../img/pages/frame4.3.jpg");
        background-size: 100% 100%; /* Sets background image to fill 100% of container in both x and y directions. See: http://stackoverflow.com/questions/15160764/background-image-stretch-y-axis-only-keep-repeat-x */
        background-repeat:no-repeat;

    }

    #titlepaper {

        position:absolute;
        top:0px;
        left:0px;
        right:0px;
        bottom:0px;
        width:100%;
        height:100%;
        border-style:solid;
        border-width:2px;
        border-color:black;
        /*padding:12px 25px;*/
        padding: 2% 5.5% 2% 5%;

    }

    #maintitle {

        position:absolute;
        font-family:"Roboto Condensed", sans-serif;
        font-style:italic;
        font-weight: 700;
        color: black;
        text-shadow: 0px 3px 0px #b2a98f,
                     0px 14px 10px rgba(0,0,0,0.15),
                     0px 24px 2px rgba(0,0,0,0.1),
                     0px 34px 30px rgba(0,0,0,0.1);

        word-wrap:break-word;
        font-size:50px;
        width:500px;
        text-align: center;
        flex:1;

    }

    /* All media break-points: https://responsivedesign.is/develop/browser-feature-support/media-queries-for-common-device-breakpoints */
    @media only screen and (max-device-width : 480px) {

     /* Styles */
     #maintitle {

      font-size:30px;

      width:200px;

     }

    }
<!DOCTYPE html>

        <link href="/css/bootstrap.min.css" rel="stylesheet"/>

  <meta charset = "utf-8">

  <meta name="viewport" content = "width=device-width, initial-scale = 1">

        <link href="/css/welcome.css?parameter=2" rel="stylesheet"/>

        <title>History Maps</title>

         History Maps

If anyone can see why the font-centring behaves so differently on Chrome to Safari I would be most grateful to know why.
Kind Regards

A: Try either removing position: absolute; from #maintitle or changing it to relative.

/* Parent elements */
html,body {

    height:100%;
}

/* Sets the container-fluid, row and column classes to 100% of the html and body elements */
.container-fluid,.row, .col-md-6, .col-xs-10 {
    height:100%;
}

#titleframe {

    position:relative;
    display:-webkit-box;
    display:-ms-flexbox;
    display:flex;/* Flex-box ensures font is centered both vertically and horizontally within the title frame using align-items and justify-content. See http://stackoverflow.com/questions/5703552/css-center-text-horizontal-and-vertical-inside-a-div-block */
    -webkit-box-align:center;
    -ms-flex-align:center;
    align-items:center;
    -webkit-box-pack:center;
    -ms-flex-pack:center;
    justify-content:center;
    max-width:100%; /* max-width ensures background does not stretch outside container div */
    height:15%;   /* Represents height relative to parent elements - in this case .container-fluid,.row, .col-md-6, .col-xs-10 which are all set to 100% */
    border-style:solid;
    border-width:2px;
    border-color:black;

    background: url("../img/pages/frame4.3.jpg");
    background-size: 100% 100%; /* Sets background image to fill 100% of container in both x and y directions. See: http://stackoverflow.com/questions/15160764/background-image-stretch-y-axis-only-keep-repeat-x */
    background-repeat:no-repeat;

}

#titlepaper {

    position:absolute;
    top:0px;
    left:0px;
    right:0px;
    bottom:0px;
    width:100%;
    height:100%;
    border-style:solid;
    border-width:2px;
    border-color:black;
    /*padding:12px 25px;*/
    padding: 2% 5.5% 2% 5%;

}

#maintitle {

    position:relative;
    font-family:"Roboto Condensed", sans-serif;
    font-style:italic;
    font-weight: 700;
    color: black;
    text-shadow: 0px 3px 0px #b2a98f,
                 0px 14px 10px rgba(0,0,0,0.15),
                 0px 24px 2px rgba(0,0,0,0.1),
                 0px 34px 30px rgba(0,0,0,0.1);

    word-wrap:break-word;
    font-size:50px;
    width:500px;
    text-align: center;
    flex:1;
}

/* All media break-points: https://responsivedesign.is/develop/browser-feature-support/media-queries-for-common-device-breakpoints */
@media only screen and (max-device-width : 480px) {

    /* Styles */
    #maintitle {

        font-size:30px;

        width:200px;

    }

}

                    History Maps


text:
Q: Integration by Parts with a logarithm Im not sure how i go about integrating a function being:
$$\int^{\sqrt{2}}_{1} r^{3}\log({r^2}) dr$$
I assume you use parts but it keeps making me go round in circles.
Any help would be appreciated.
My attempt was:
$$u=log(r^{2}) \rightarrow u'=\frac{2}{r},$$ $$v=\frac{r^4}{4} \rightarrow v'=r^{3}$$
so using the equation $uv- \int uv'$ i get:
$$\frac{r^{4}}{4}log(r^{2})- \int log(r^{2})r^{3}$$

A: Make this substitution before you use Integration by parts:
$$u = r^2$$

A: Recall that $\log(r^2) = 2\log r$.  So then
\begin{align}
  \int_1^{\sqrt{2}} r^3 \log(r^2) \, dr
    &= \int_1^{\sqrt{2}} r^3 \cdot 2 \log r \, dr\\[0.3cm]
    &= 2\int_1^{\sqrt{2}} r^3 \log r \, dr
\end{align}
Now let $u = \log r$ so that $dv = r^3 \, dr$, and $du = \dfrac{1}{r} \, dr$ (I'm assuming by $\log$ you mean natural log and not common log) and $v = \dfrac{1}{4}r^4$.  So then
\begin{align}
  2\int_1^{\sqrt{2}} r^3 \log r \, dr
    &= 2\left[\frac{1}{4}r^4\log r\bigg|_1^{\sqrt{2}} - \int_1^{\sqrt{2}} \frac{1}{4}r^4 \cdot \frac{1}{r} \, dr\right]
\end{align}
Can you take it from here?

A: You are not working by parts the right way.
$$\int u'vdr=uv-\int uv'dr$$ yields
$$\int r^3\ln(r^2)dr=\frac{r^4}4\ln(r^2)-\int\frac{r^4}4\frac{2dr}r=\frac{r^4}4\ln(r^2)-\frac{r^4}8.$$

A: Logarithms are good to differentiate, powers are good to integrate.  So call this $\int u \; dv$ with $u = \log(r^3)$ and $dv = r^3\; dr$.

A: $$\int_{1}^{\sqrt{2}}r^3\ln(r^2)\space\text{d}r=$$

Integrate by parts, $\int f\space\text{d}g=fg-\int g\space\text{d}f$ where:
$$f=\ln(r),\text{d}g=r^3\space\text{d}r,\text{d}f=\frac{1}{r}\space\text{d}r,g=\frac{r^4}{4}$$

$$\left[\frac{r^4\ln(r)}{2}\right]_{1}^{\sqrt{2}}-\frac{1}{2}\int_{1}^{\sqrt{2}}r^3\space\text{d}r=$$

Use $\int y^b\space\text{d}y=\frac{y^{b+1}}{b+1}+\text{C}$:

$$\left[\frac{r^4\ln(r)}{2}\right]_{1}^{\sqrt{2}}-\frac{1}{2}\left[\frac{r^4}{4}\right]_{1}^{\sqrt{2}}=$$
$$\frac{1}{2}\left[r^4\ln(r)\right]_{1}^{\sqrt{2}}-\frac{1}{8}\left[r^4\right]_{1}^{\sqrt{2}}=$$
$$\frac{1}{2}\left(\left(\sqrt{2}\right)^4\ln(\sqrt{2})-1^4\ln(1)\right)-\frac{1}{8}\left(\left(\sqrt{2}\right)^4-1^4\right)=$$
$$\frac{1}{2}\left(4\cdot\ln(\sqrt{2})-0\right)-\frac{1}{8}\left(4-1\right)=$$
$$2\ln(\sqrt{2})-\frac{3}{8}=$$
$$\ln(2)-\frac{3}{8}$$


text:
Q: Weekly replacing string from multiple files I have to replace a certain string in multiple files every week. I was trying to simplify that process using PowerShell the line that has to be replaced is following:
extract_mdp_staging_error(149);

other files look the same but the String is different for ex.
extract_kdp_staging(149);
extract_zub_staging_error(149);
...

Is there a way to tell my script just to search for the text part in the () and replace it with a user Input? Cause I can't use hardcoded searches since next week there won't be 149 but 150 and so on.
EDIT
I have been using a script to replace the whole line in a file using PowerShell for another application, but I couldn't figure out how to code it, so it only replaces the part in the brackets. PowerShell Script:
Get-ChildItem C:\Users\mosermich\Desktop\Extractor\Ressources -Filter '*.sql' -ErrorAction Stop | ForEach-Object {
        $content = Get-Content $_.Fullname
        $content[7] = '   rel.nr sqlldr {0}' -f $releasenr
        $content | Set-Content -Path $_.FullName
        }

And here is one of the files that in which I would need to replace the number in the () on line 2:
begin
extract_zdlb_staging(149);
commit;
end;
/
quit;

A: I would use a regex with a positive lookahead and lookbehind:
$userInput = 250
$filePath = 'yourFilePath'

$content = Get-Content $filePath
$content -replace '(?<=\()(\d+)(?=\))', $userInput | Set-Content $filePath

Regex:
(?<=\()(\d+)(?=\))

Edit:
Here the script adopted to your example:
$userInput = 250 # The number you want to put in the parentheses
Get-ChildItem C:\Users\mosermich\Desktop\Extractor\Ressources -Filter '*.sql' -ErrorAction Stop |
    ForEach-Object {
        $content = Get-Content $_.Fullname
        $content -replace '(?<=\()(\d+)(?=\))', $userInput | Set-Content $_.Fullname
    }


text:
Q: How to enable intel virtualization technology if it is disabled in intel processor identification utiity? I have installed a virtual machine on Oracle virtual box, but it is showing black screen error with cursor, in logs, there was an issue as:
00:00:06.668127 HM: HMR3Init: Attempting fall back to NEM: VT-x is not available
Screeshot 1:
In Bios setting intel virtualization is enabled
But later it was found that in Intel Processor Identification Utility, Intel Virtualization was disabled so, how to enable the same.
Intel Processor Identifiaction Utility
Black Screen error in virtual box

A: The problem has been solved after switching off core isolation in device security under windows security option, now virtual machines are running perfectly fine. Thank you everyone!

A: According to your BIOS screenshot, your computer model supports VT-d but not VT-x.
You need both VT-d and VT-x.
The full names by Intel are:

*

*Intel® Virtualization Technology for Directed I/O (VT-d)

*Intel® VT-x with Extended Page Tables (EPT)


text:
Q: Mocking moment.js react props with jest and enzyme Say i have a child component that takes two moment objects as props such as:
import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';

class ChildComponent extends React.Component {
    constructor(props) {
        super(props);
    }

    startAndEndDateOnSameDay() {
        return this.props.startDate.isSame(this.props.endDate, 'date')
    }

    render() {
        let formattedDate;
        if(this.startAndEndDateOnSameDay()) {
            formattedDate = this.props.startDate.format();
        }
        else {
            formattedDate = this.props.endDate.fromNow();
        }

        return (
            <div>{formattedDate}</div>
        );
    }
}

ChildComponent.propTypes = {
    startDate: PropTypes.instanceOf(moment).isRequired,
    endDate: PropTypes.instanceOf(moment).isRequired
}

export default ChildComponent;

And a parent component that passes down two moment objects to the child component like:
import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import ChildComponent from './ChildComponent';

class ParentComponent extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            startDate: moment(),
            endDate: moment()
        };
    }

    render() {
        return (
            <ChildComponent startDate={this.state.startDate} endDate={this.state.endDate}/>
        );
    }
}

export default ParentComponent;

And I am trying to test these components with jest and enzyme with:
import React from 'react';
import { shallow } from 'enzyme';
import ParentComponent from '../components/ParentComponent';

describe('<ParentComponent />', () => {
    let wrapper;

    beforeAll(() => {
        wrapper = shallow(<ParentComponent/>);
    });

    it('should render the component correctly', () => {
        expect(wrapper).toMatchSnapshot();
    });
});

And
import React from 'react';
import { shallow } from 'enzyme';
import ChildComponent from '../components/ChildComponent';
import moment from 'moment';

describe('<ChildComponent />', () => {
    let wrapper;

    beforeAll(() => {
        wrapper = shallow(<ChildComponent startDate={moment()} endDate={moment()}/>);
    });

    it('should render the component correctly', () => {
        expect(wrapper).toMatchSnapshot();
    });

    describe('when the the start date and end date are on the same day', () => {
        it('should print a the formatted start date', () => {
            expect(wrapper.text()).toEqual('mock format here');
        });
    });

    describe('when the start and end date are not on the same day', () => {
        it('should print the the end date from now', () => {
            expect(wrapper.text()).toEqual('mock from now here');
        });
    });
});

How do I mock the moment.js library functions in order for my tests to work?
I am trying to create a manual mock file within the __mocks__ folder that will mock the moment library's functions for both test suites. The current issues I am running into:

*

*How do i mock the moment() constructor from within the mock file to always return the same date, so my snapshot tests will always pass?

*How do i mock the the .isSame(), .format(), and .fromNow() functions to always return the same value regardless of the current time?

So far, I have the follow test file that breaks all my tests. I was following the documentation here:
const moment = require('moment');

function isSame() {
  return true;
}

function fromNow() {
  return 'Tomorrow at 12:00 pm'
}

function format() {
  return 'Sept 16th 19';
}

exports.isSame = isSame;
exports.fromNow = fromNow;
exports.format = format;

When I use this file, i get errors within my component that say startDate and endDate are undefined.

A: I ended up solving this by creating a manual mock in the mocks folder. The key is that moment exports it's prototype with moment.fn.
import fixtures from '../__fixtures__/moment';

const moment = require.requireActual('moment');

// By default, the isSame function will always return true
let isSame = true;

moment.fn.isSame = () => isSame;
moment.fn.calendar = () => fixtures.CALENDAR;
moment.fn.fromNow = () => fixtures.FROM_NOW;

// Since format is often called with a variety of format strings, we need to
// differentiate how we are calling the function
moment.fn.format = (format) => {
    switch (format) {
    case 'MMM Do YY':
        return fixtures.DATE;
    case 'H:mm a':
        return fixtures.TIME;
    case 'MMM Do YY H:mm a':
        return fixtures.DATETIME;
    default:
        return Error('Unsupported format in moment mock. Add case to __mocks__/moment.js');
    }
};
moment.duration.fn.humanize = () => fixtures.DURATION;

// This function is added to moment's prototype in order for our tests to
// change moment's isSame behaviour
moment.fn.__isSame = (value) => { isSame = value; };

// This resets the isSame behaviour back to default
moment.fn.__reset = () => {
    moment.fn.isSame = () => true;
};

export default moment;

Jest automatically loads this file when running the tests, and I can then test my components like:
it('renders a moment duration', () => {
    expect(wrapper.text()).toEqual(fixtures.DURATION);
});

If i need to change the behavior of the .isSame function, I can modify it with:
import moment from 'moment';

beforeAll(() => {
    moment.fn.__isSame(false);
});

A: If you are using JEST to test, I can recommend you https://github.com/hustcc/jest-date-mock Then you can mock current date using
advanceTo(new Date(2018, 5, 27, 0, 0, 0));

Best practice to test is to mock fixed date and compare with result


text:
Q: How MAP member function are different from member function of Object Type in Oracle I am curious about MAP keyword given to member function of Object type and wish know about how MAP member function are different from member function of Object Type in Oracle

A: MAP member function are special functions used to compare objects. "Ordinary" member functions are for your own usage.
The real comparison is more between MAP member functions and ORDER methods.
You can define either one or the other for your objects. It will be automatically called when you compare two objects using the relational operators <, <=, >, ... as well as when performing implicit comparison using DISTINCT, GROUP BY, UNION, and ORDER BY clauses.
But:

*

*The former one will define ordering of your object by mapping them to a scalar value

*The later will force you to programmatically  define comparison rules  between two objects.

MAP member function implies an absolute ordering, whereas ORDER method will use relative ordering.


text:
Q: Passing escape sequences in the args[] array on Windows I was reading SCJP guide, and found the following question, it's looks very easy and might be easy for someone. But, i was really stuck to find out the solution.
import java.util.regex.*;

class study{

    public static void main(String[] args) {
      Pattern p = Pattern.compile(args[0]);
      Matcher m = p.matcher(args[1]);
      boolean b=false;
      while(b=m.find()){
      System.out.print(m.start()+" "+m.group());
     }
    }

}

In that question the command line argument was given like
java study "\d*" ab34ef

And, said what would be the ouput, my guess was 334 or 234 and it was in that option. But, answer (on Windows) was 01234456. So, my first question is How ??
Now, people say, why didn't you tried. Then, i will say, Yes i did. But, in my case I didn't get any output on my screen. Then, i tried to figure out considering all type of input and their values.

In the above screenshot, second output shown, when i included System.out.print(args[0]+" "+args[1]); inside main method.
Even, i changed the command line to this
java study "\\d*" ab34ef

Then also, i didn't get any output. So, anyone explain all this thing .
OUTPUT==
java study "\d*" ab34ef
No output
java study "\\d*" ab34ef
No output

Then i add System.out.print(args[0]+" "+args[1]); inside main method.
java study "\d*" ab34ef
\Document and Setting ab34ef
java study "\\d*" ab34ef
\\d* ab34ef

Note : No output means it is not showing anything.

A: Actually what happens is, when you pass \d* as command line argument, it is treated as \d followed by * wildcard. So, the argument is replaced by all the files starting with \d in that directory. (This behaviour happens on Windows. Though I don't know about Linux, as I haven't used it).
So, you are not passing the regular expression, rather the file/directory names starting with \d in to your program.
Try to print the arguments in your code: -
System.out.println(args[0] + " : " + args[1]);

This will give you some file/directory names starting with \d...

Workaround: -
If you want to pass regex, you can use a work around. Pass " \d*" as regex with a space in the front, and in your code, use args[0].trim() or args[0].replace(" ", ""); instead of args[0].
So, call it as: -
java Foo " \d*" ab34ef

And change your code to: -
Pattern p = Pattern.compile(args[0].replace(" ", ""));
Matcher m = p.matcher(args[1]);

This will do the job for you.

Now that was the problem of passing Regex through command line.
As for why you are getting that output, Check out this answer - string-replaceall-strange-behaviour, which is about similar problem. You will get an idea of why this is happening.

A: i got the result, you wanted, with
java study "\d*" ab34ef

but maybe try the same, as Rohit Jain commented:
java study "\\d*" ab34ef

but it should work with your line! (on linux it does, maybe it's a windows problem)

A: Try this.
java study d* ab34ef

Here is why.
Escape sequences are for the Java compiler, The compiler will see, for example, a '\' followed by a 'n', and replace them both with a single newline character. Escape sequences have no meaning at all to Java when a program is running; they only mean something to the compiler when they appear in source code.
Embedding special characters into the arguments to a Java program is actually not a Java issue at all -- it's an operating system issue.
If you want to do the same thing from your source you have to pass the string like below.
Pattern p = Pattern.compile("\\d*");
Matcher m = p.matcher("ab34ef");

If you want to run via comman line just passing without escape characters will do
 d* ab34ef

Use some IDE like Eclipse and debug to find what exactly its being passed.

A: To answer the first part of your question, the regular expression \d* matches zero or more digits, i.e. one of the things it is allowed to match is the empty string.  Thus given the input string
ab34ef

the pattern matches

*

*the empty string at position 0

*the empty string at position 1

*the string 34 at position 2

*the empty string at position 4

*the empty string at position 5

*the empty string at position 6

which explains the expected answer.


text:
Q: Deleting duplicate rows with two specific column duplicates I'm trying to delete duplicate rows from my database, that has the same 'input' column, and 'response' column. Right now, I have a query that SELECT all the duplicates, but I'm not sure how to write the query to delete the duplicates:
SELECT * , COUNT( * ) AS matches
FROM allData
GROUP BY input, response
HAVING matches > 1

If I'm writing the DELETE query, I think it would something like
DELETE FROM allData WHERE blah = blah

^---But that doesn't let me select the 'count(*)' or 'group by', so I'm not really sure how to properly write this.

A: Try this;)
DELETE
    T1
FROM allData T1
INNER JOIN (
    SELECT input, response
    FROM allData
    GROUP BY input, response
    HAVING COUNT(1) > 1
) T2 ON T1.input = T2.input AND T1.response = T2.response

Edited:
DELETE T1
FROM allData T1
INNER JOIN allData T2 ON T1.input = T2.input AND T1.response = T2.response AND T1.id > T2.id

This will remain the record which has the minimum id.
And take a look of Delete all duplicate rows except for one in mysql.


text:
Q: Get authors name and URL for tag from google scholar I wish to write to a CSV file a list of all authors with their URL to a CSV file who class themselves as a specific tag on Google Scholar. For example, if we were to take 'security' I would want this output:
author          url
Howon Kim       https://scholar.google.pl/citations?user=YUoJP-oAAAAJ&hl=pl
Adrian Perrig   https://scholar.google.pl/citations?user=n-Oret4AAAAJ&hl=pl
...             ...

I have written this code which prints each author's name
# -*- coding: utf-8 -*-
import urllib.request
import csv
from bs4 import BeautifulSoup
url = "http://scholar.google.pl/citations?view_op=search_authors&hl=pl&mauthors=label:security"
page = urllib.request.urlopen(url)
soup = BeautifulSoup(page, 'lxml')
mydivs = soup.findAll("h3", { "class" : "gsc_1usr_name"})
outputFile = open('sample.csv', 'w', newline='')
outputWriter = csv.writer(outputFile)
for each in mydivs:
    for anchor in each.find_all('a'):
        print (anchor.text)

However, this only does it for the first page. Instead, I would like to go through every page. How can I do this?

A: I'm not writing the code for you.. but I'll give you an outline for how you can.
Look at the bottom of the page. See the next button? Search for it the containing div has an id of gsc_authors_bottom_pag which should be easy to find. I'd do this with selenium, find the next button (right) and click it. Wait for the page to load, scrape repeat. Handle edge cases (out of pages, etc).
If the after_author=* bit didn't change in the url you could just increment the url start.. but unless you want to try to crack that code (unlikely) then just click the next button.

A: This page use <button> instead of <a> for link to next/previous page.
Button to next page has aria-label="Następna".
There are two buttons to next page but you can use any of them.
Button has JavaScript code to redirect to new page
 window.location=url_to_next_page

but it is simple text so you can use slicing to get only url
import urllib.request
from bs4 import BeautifulSoup

url = "http://scholar.google.pl/citations?view_op=search_authors&hl=pl&mauthors=label:security"

while True:
    page = urllib.request.urlopen(url)
    soup = BeautifulSoup(page, 'lxml')

    # ... do something on page ...

    # find buttons to next page
    buttons = soup.findAll("button", {"aria-label": "Następna"})

    # exit if no buttons
    if not buttons:
        break

    on_click = buttons[0].get('onclick')

    print('javascript:', on_click)

    #add `domain` and remove `window.location='` and `'` at the end
    url = 'http://scholar.google.pl' + on_click[17:-1]
    # converting some codes to chars
    url = url.encode('utf-8').decode('unicode_escape')

    print('url:', url)

BTW: if you speak Polish then you can visit on Facebook: Python Poland or Python: pierwsze kroki

A: Since furas is already answered on how to loop through all pages, this is a complementary answer to his answer. The script below scrapes much more than your question asks and scrapes to a .csv file.
Code and example in online IDE:
from bs4 import BeautifulSoup
import requests, lxml, os, csv

headers = {
    'User-agent':
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19582"
}

def get_profiles_to_csv():
    html = requests.get('http://scholar.google.pl/citations?view_op=search_authors&hl=pl&mauthors=label:security', headers=headers).text
    soup = BeautifulSoup(html, 'lxml')

    # creating CSV File
    with open('awesome_file.csv', mode='w') as csv_file:
      # defining column names
      fieldnames = ['Author', 'URL']
      # defining .csv writer
      # https://docs.python.org/3/library/csv.html#csv.DictWriter
      writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
      # writing (creating) columns
      writer.writeheader()

      # collecting scraped data
      author_data = []

      # Selecting container where all data located
      for result in soup.select('.gs_ai_chpr'):
        name = result.select_one('.gs_ai_name a').text
        link = result.select_one('.gs_ai_name a')['href']

        # https://stackoverflow.com/a/6633693/15164646
        # id = link
        # id_identifer = 'user='
        # before_keyword, keyword, after_keyword = id.partition(id_identifer)
        # author_id = after_keyword
        # affiliations = result.select_one('.gs_ai_aff').text
        # email = result.select_one('.gs_ai_eml').text
        # try:
        #   interests = result.select_one('.gs_ai_one_int').text
        # except:
        #   interests = None

        # "Cited by 107390" = getting text string -> splitting by a space -> ['Cited', 'by', '21180'] and taking [2] index which is the number.
        # cited_by = result.select_one('.gs_ai_cby').text.split(' ')[2]

        # because we have a csv.DictWriter() we converting to the required format
        # dict() keys should be exactly the same as fieldnames, otherwise it will throw an error
        author_data.append({
          'Author': name,
          'URL': f'https://scholar.google.com{link}',
        })

      # iterating over celebrity data list() that became dict() and writing it to the .csv
      for data in author_data:
        writer.writerow(data)

        # print(f'{name}\nhttps://scholar.google.com{link}\n{author_id}\n{affiliations}\n{email}\n{interests}\n{cited_by}\n')

# output from created csv:
'''
Author,URL
Johnson Thomas,https://scholar.google.com/citations?hl=pl&user=eKLr0EgAAAAJ
Martin Abadi,https://scholar.google.com/citations?hl=pl&user=vWTI60AAAAAJ
Adrian Perrig,https://scholar.google.com/citations?hl=pl&user=n-Oret4AAAAJ
Vern Paxson,https://scholar.google.com/citations?hl=pl&user=HvwPRJ0AAAAJ
Frans Kaashoek,https://scholar.google.com/citations?hl=pl&user=YCoLskoAAAAJ
Mihir Bellare,https://scholar.google.com/citations?hl=pl&user=2pW1g5IAAAAJ
Matei Zaharia,https://scholar.google.com/citations?hl=pl&user=I1EvjZsAAAAJ
John A. Clark,https://scholar.google.com/citations?hl=pl&user=xu3n6owAAAAJ
Helen J. Wang,https://scholar.google.com/citations?hl=pl&user=qhu-DxwAAAAJ
Zhu Han,https://scholar.google.com/citations?hl=pl&user=ty7wIXoAAAAJ
'''

Alternatively, you can do the same thing using Google Scholar Profiles API from SerpApi. It's a paid API with a free plan.
Code to integrate:
from serpapi import GoogleSearch
from urllib.parse import urlsplit, parse_qsl
import csv, os

def get_profiles_to_csv():
    with open('awesome_serpapi_file_pagination.csv', mode='w') as csv_file:
        fieldnames = ['Author', 'URL']
        writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
        writer.writeheader()

        params = {
            "api_key": os.getenv("API_KEY"),
            "engine": "google_scholar_profiles",
            "mauthors": "label:security"
        }

        search = GoogleSearch(params)

        while True:
            results = search.get_dict()
            try:
              for result in results['profiles']:
                  name = result['name']
                  link = result['link']

                  writer.writerow({'Author': name, 'URL': link})
            except:
              print('Done')
              break

            if (not 'pagination' in results) and (not 'next' in results['pagination']):
                break

            search.params_dict.update(dict(parse_qsl(urlsplit(results["pagination"]["next"]).query)))

get_profiles_to_csv()

# part of the output from created csv:
'''
Author,URL
Johnson Thomas,https://scholar.google.com/citations?hl=en&user=eKLr0EgAAAAJ
Martin Abadi,https://scholar.google.com/citations?hl=en&user=vWTI60AAAAAJ
Adrian Perrig,https://scholar.google.com/citations?hl=en&user=n-Oret4AAAAJ
Vern Paxson,https://scholar.google.com/citations?hl=en&user=HvwPRJ0AAAAJ
Frans Kaashoek,https://scholar.google.com/citations?hl=en&user=YCoLskoAAAAJ
Mihir Bellare,https://scholar.google.com/citations?hl=en&user=2pW1g5IAAAAJ
Matei Zaharia,https://scholar.google.com/citations?hl=en&user=I1EvjZsAAAAJ
John A. Clark,https://scholar.google.com/citations?hl=en&user=xu3n6owAAAAJ
Helen J. Wang,https://scholar.google.com/citations?hl=en&user=qhu-DxwAAAAJ
Zhu Han,https://scholar.google.com/citations?hl=en&user=ty7wIXoAAAAJ
'''

Disclaimer, I work for SerpApi.


text:
Q: Email alert to contain full details of list item created I have created a basic workflow that sends an email to a specific person when a new item is created.
However, this person wants all the details of that list item in the email. (They don't want to open the list in SharePoint).
They use to get something that looks like this:

That workflow mysteriously broke a couple of months ago and I'm now trying to recreate it. The best I can get to is something like this.

I'm doing this through Flow. When I set up an alert it sends out a blank email - all it says is a new list item was created. (And that doesn't seem to even work!)
Appreciate the help

A: Create a flow from blank and select the trigger, "When an item is created" using SharePoint Connector.
Enter your Site address and list name.
Create a new step and select Office 365 Outlook then "Send an email" action.
Enter the email address of the user who needs to get the mail and subject.
Then in the body, Type the words you need and input corresponding dynamic content in front of each word.
However, ensure you select the option IsHtml to be Yes and in your body, type the mail in form of html i.e If you need to bolden the wordings you need to put it in <b> </b> tag and to have a line break you need to put a <br/> tag


text:
Q: How to preload largest-contentful-paint image in react helmet I received this warning in lighthouse

I tried doing what that learn more link told me to do, and include a preload tag in the head for the image, but I still get the warning

I tried this preload tag, the url is the one which is in the browser when I right click the image and select "open in new tab"
<link rel="preload" as="image" href={`https://example.com:8080/src/assets/images/example.webp`} />

The image is just imported into the jsx component like import banner from "images/banner-large.png"; and then rendered with an image tag like       <img src={example} className="w-100 banner-img" alt="Description" />

I'm also using img-optimizer-loaderto web-optimize my images and convert them to webp in my webpack config like below
{
    test: /\.(gif|png|jpe?g|webm|webp)$/i,
    use: [
      {
        loader: "img-optimize-loader",

        options: {
          compress: {
            // This will transform your png/jpg into webp.
            webp: {
              quality: 75,
            },
            disableOnDevelopment: true,
          },
          name: "[path][name].[ext]",
        },
      },
    ],
  },

It's worth noting that I import my images like
import image from 'src/assets/images/example.png'

but because of img-optimize-loader, all my images are converted to webp in the build, and the webp images are the ones displayed.

A: Import and use Helmet right inside your image component:
import { Helmet } from 'react-helmet'
import example from "images/example.png";

function Image () {
  return (
    <Helmet>
      <link rel="preload" as="image" href={example}>
    </Helmet>
  )
}

A: It is not a front-end issue but rather a back-end one. In this case, react-helmet won't be of any help.
Here is an article that explain how to deal with dynamic meta tags to a React app without SSR.
https://blog.logrocket.com/adding-dynamic-meta-tags-react-app-without-ssr/
I also recommend reading this post https://stackoverflow.com/a/62853922/9580264


text:
Q: OpenSSL Security Fix in Wildfly i have a lot of wildfly  instances (10, 18, 26) running on client side servers. The OpenSSL Team announced a critical security fix for this week:
https://mta.openssl.org/pipermail/openssl-announce/2022-October/000238.html
We get a lot of questions if the wildfly is affected by this or not.
I know that the wildfly uses an internal openssl binding jar (https://github.com/wildfly-security/wildfly-openssl) but don't know if its affected or not. As i understand, the jar itself uses native openssl libraries, installed on the system. For linux systems, its clear. Openssl is mostly installed.
But on Windows, in many cases, there is no openssl installed. What libraries ist wildfly using instead for ssl capabilities?
Does anyone knows whether wildfly is affected or not?
Thanks
zwaem


text:
Q: How to convert WGS84 degrees coordinates to SK42 in meters in Java How to convert WGS84 degrees coordinates to SK42 in meters in Java? Are there any code examples?

A: I have found, combined and translate to Java something like that. But i dont know about how precise it is. It returns northing(XXXXXXX.XXXXXm) and easting(NXXXXXX.XXXXXm) in meters. N-zone number
    public double[] WGS84ToSK42Meters(double latWgs84, double longWgs84, double heightWgs84)
            {
//Часть 1: Перевод Wgs84 географических координат(долготы и широты в градусах) в СК42 географические координаты (долготу и широту в градусах)//Part 1: Converting Wgs84 geographical coordinates(longitude and latitude in degrees) to SK42 geographical coordinates(longitude and latitude in degrees)
                double ro = 206264.8062;//Число угловых секунд в радиане//The number of angular seconds in radians
                double aP = 6378245; // Большая полуось//Large semi - axis
                double alP = 1 / 298.3; // Сжатие//Compression
                double e2P = 2 * alP - Math.pow(alP,2); // Квадрат эксцентриситета//Eccentricity square

                // Эллипсоид WGS84 (GRS80, эти два эллипсоида сходны по большинству параметров)//Ellipsoid WGS84 (GRS80, these two ellipsoids are similar in most parameters)
                double aW = 6378137; // Большая полуось//Large semi - axis
                double alW = 1 / 298.257223563; // Сжатие//Compression
                double e2W = 2 * alW - Math.pow(alW, 2); // Квадрат эксцентриситета//Eccentricity square

                // Вспомогательные значения для преобразования эллипсоидов
    //Auxiliary values for converting ellipsoids
                double a1 = (aP + aW) / 2;
                double e21 = (e2P + e2W) / 2;
                double da = aW - aP;
                double de2 = e2W - e2P;

                // Линейные элементы трансформирования, в метрах//Linear transformation elements, in meters
                double dx = 23.92;
                double dy = -141.27;
                double dz = -80.9;

                // Угловые элементы трансформирования, в секундах//Angular transformation elements, in seconds
                double wx = 0;
                double wy = 0;
                double wz = 0;

                // Дифференциальное различие масштабов//Differential difference of scales
                double ms = 0;

                double B, L, M11, N1;
                B = latWgs84 * Math.PI / 180;
                L = longWgs84 * Math.PI / 180;
                M11 = a1 * (1 - e21) / Math.pow((1 - e21 * Math.pow(Math.sin(B),2)),1.5);
                N1 = a1 * Math.pow((1 - e21 * Math.pow(Math.sin(B),2)),-0.5);
                double dB = ro / (M11 + heightWgs84) * (N1 / a1 * e21 * Math.sin(B) * Math.cos(B) * da + (Math.pow(N1,2) / Math.pow(a1,2) + 1) * N1 * Math.sin(B) * Math.cos(B) * de2 / 2 - (dx * Math.cos(L) + dy * Math.sin(L)) * Math.sin(B) + dz * Math.cos(B)) - wx * Math.sin(L) * (1 + e21 * Math.cos(2 * B)) + wy * Math.cos(L) * (1 + e21 * Math.cos(2 * B)) - ro * ms * e21 * Math.sin(B) * Math.cos(B);

                double SK42_LatDegrees = latWgs84 - dB / 3600;//широта в ск42 в градусах//latitude in sk42 in degrees

                B = latWgs84 * Math.PI / 180;
                L = longWgs84 * Math.PI / 180;
                N1 = a1 * Math.pow((1 - e21 * Math.pow(Math.sin(B),2)), -0.5);
                double dL = ro / ((N1 + heightWgs84) * Math.cos(B)) * (-dx * Math.sin(L) + dy * Math.cos(L)) + Math.tan(B) * (1 - e21) * (wx * Math.cos(L) + wy * Math.sin(L)) - wz;

                double SK42_LongDegrees = longWgs84 - dL / 3600;//долгота в ск42 в градусах//longitude in sk42 in degrees

// Часть 2: Перевод СК42 географических координат (широты и долготы в градусах) в СК42 прямоугольные координаты (северное и восточное смещения в метрах)//Part 2: Converting of SK42 geographical coordinates (latitude and longitude in degrees) into SK42 rectangular coordinates(easting and northing in meters)
                // Номер зоны Гаусса-Крюгера//Number of the Gauss-Kruger zone
                int zone =  (int) (SK42_LongDegrees/6.0+1);

                // Параметры эллипсоида Красовского//Parameters of the Krasovsky ellipsoid
                double a = 6378245.0;          // Большая (экваториальная) полуось//Large (equatorial) semi-axis
                double b = 6356863.019;        // Малая (полярная) полуось//Small (polar) semi-axis
                double e2 = (Math.pow(a,2)-Math.pow(b,2))/Math.pow(a,2);  // Эксцентриситет//Eccentricity
                double n = (a-b)/(a+b);        // Приплюснутость//Flatness

                // Параметры зоны Гаусса-Крюгера//Parameters of the Gauss-Kruger zone
                double F = 1.0;                   // Масштабный коэффициент//Scale factor
                double Lat0 = 0.0;                // Начальная параллель (в радианах)//Initial parallel (in radians)
                double Lon0 = (zone*6-3)* Math.PI/180;  // Центральный меридиан (в радианах)//Central Meridian (in radians)
                double N0 = 0.0;                  // Условное северное смещение для начальной параллели//Conditional north offset for the initial parallel
                double E0 = zone*1e6+500000.0;    // Условное восточное смещение для центрального меридиана//Conditional eastern offset for the central meridian

                // Перевод широты и долготы в радианы//Converting latitude and longitude to radians
                double Lat = SK42_LatDegrees*Math.PI/180.0;
                double Lon = SK42_LongDegrees*Math.PI/180.0;

                // Вычисление переменных для преобразования//Calculating variables for conversion
                double sinLat = Math.sin(Lat);
                double cosLat = Math.cos(Lat);
                double tanLat = Math.tan(Lat);

                double v = a * F * Math.pow(1-e2* Math.pow(sinLat,2),-0.5);
                double p = a*F*(1-e2) * Math.pow(1-e2*Math.pow(sinLat,2),-1.5);
                double n2 = v/p-1;
                double M1 = (1+n+5.0/4.0* Math.pow(n,2) +5.0/4.0* Math.pow(n,3)) * (Lat-Lat0);
                double M2 = (3*n+3* Math.pow(n,2) +21.0/8.0* Math.pow(n,3)) * Math.sin(Lat - Lat0) * Math.cos(Lat + Lat0);
                double M3 = (15.0/8.0* Math.pow(n,2) +15.0/8.0* Math.pow(n,3))*Math.sin(2 * (Lat - Lat0))*Math.cos(2 * (Lat + Lat0));
                double M4 = 35.0/24.0* Math.pow(n,3) *Math.sin(3 * (Lat - Lat0)) * Math.cos(3 * (Lat + Lat0));
                double M = b*F*(M1-M2+M3-M4);
                double I = M+N0;
                double II = v/2 * sinLat * cosLat;
                double III = v/24 * sinLat * Math.pow(cosLat,3) * (5-Math.pow(tanLat,2)+9*n2);
                double IIIA = v/720 * sinLat * Math.pow(cosLat,5) * (61-58*Math.pow(tanLat,2)+Math.pow(tanLat,4));
                double IV = v * cosLat;
                double V = v/6 * Math.pow(cosLat,3) * (v/p-Math.pow(tanLat,2));
                double VI = v/120 * Math.pow(cosLat,5) * (5-18*Math.pow(tanLat,2)+Math.pow(tanLat,4)+14*n2-58*Math.pow(tanLat,2)*n2);

                // Вычисление северного и восточного смещения (в метрах)//Calculation of the north and east offset (in meters)
                double N = I+II* Math.pow(Lon-Lon0,2)+III* Math.pow(Lon-Lon0,4)+IIIA* Math.pow(Lon-Lon0,6);
                double E = E0+IV*(Lon-Lon0)+V* Math.pow(Lon-Lon0,3)+VI* Math.pow(Lon-Lon0,5);

                return new double[] {N, E};
            }


text:
Q: Crystal reports, sub-reports, and shared variables I have a formula @InitVars in the page header which includes the following, and similar lines:
shared numbervar runWaste:=0;

In Details v, I have a sub-report, which has a formula @SetRunWaste:
shared numbervar runWaste;
if (OnFirstRecord) then
(
if not(isnull({x.x-or})) and
not(isnull({x.y-override})) and {x.y-override} = true then
runWaste:={x.x-or}
  else
runWaste:= {x.x}
);
runWaste

I can see the output of this formula in the sub-report is 18.00.
However, both in another sub-report, in Details az, and in the main report in Details w (as a test), I have the following formula @test:
shared numbervar runWaste;
runWaste;

In both places, it shows as 0.00.
Why is it showing 0 not 18?
I'm using Crystal Reports version 11.0.0.895.

A: The problem is that @InitVars is in the page header, not the report header. It is resetting the variable to 0 at the top of every page.
Moving @InitVars to the report header fixed it so the correct number comes up in the sub-report in Details az.
I still see some odd behavior when I include the variable in the main report, but since that was just for debugging, not the main target, I don't care.

A: I have a vague memory that I'm now having a hard time substantiating about shared variables not passing back up from a subreport.  Still looking; good thing it's Friday afternoon.
Edit:  I can't find what I was looking for, so a general thought.  Check evaluation time, and make sure that the later section on the main report is evaluating after the subreport (WhilePrintingRecords might be your friend here).

A: From the article Adding Sub reports ,Find Sub Total and Grand Total(To main Report):

Crystal Reports is a business
  intelligence application used to
  design and generate reports from a
  wide range of data sources. Sub
  Reports are child reports of the main
  report which can be embedded in main
  report. Sub reports are very much
  useful in building reports.
Adding Sub reports find the sub total
  and grand total of each sub report in
  the main report
Main report
Sub Report 1
Sub Total: sum (LabTotal )
Sub Report 2
Sub Total: sum (ItemTotal)
Grand Total
Sub reports are very useful option in
  crystal report. Suppose we want to
  find
Adding Crystal report

*

*Add New Item->Crystal Report

*If we want to create Crystal Report our own format select "As a Blank
  Report" from crystal report gallery

*Right Click on the "Database fields" in the Database fields and
  select tables from the database then
  make Links (if necessary)

*Right Click from "Details Section" and Add sub report.

*Repeat the same things that we have done in the main report and drag
  needed fields to details section sub
  report

  For Eg: We are creating labour report
  the total labour rate can be
  calculated as
In Formula field –name LabTotal
WhilePrintingRecords; Shared NumberVar
  LabTotal := Sum
  ({PC_LABOUR_DETAILS.Total})
({PC_LABOUR_DETAILS) -- table Total
  ---field
and add sum of LabTotal in to the sub
  total field
If we have another sub report to add
  ion the main page ,again right click
  on the "Details Section" and add new
  section ->Details(b) And repeat step 4
  and 5 Here we are adding second sub
  report for material and subtotal of
  materials can be caculated as
In Formula field –name ItemTotal
WhilePrintingRecords; Shared NumberVar
  ItemTotal := Sum
  {PC_MATERIAL_DETAILS.Total})
({PC_MATERIAL_DETAILS) --table Total
  -- field
and add sum of ItemTotal in to the sub
  total field
Main report
To find the grand total of both sub
  reports
In Formula field name-GrandTotal
WhilePrintingRecords; Shared NumberVar
  ItemTotal; Shared NumberVar LabTotal;
  NumberVar TotalAmount; TotalAmount :=
  ItemTotal+LabTotal; TotalAmount


text:
Q: Integral , polynomials and exponential : closed-form formula I would like to calculate an integral under the following form : $$\int_{t_1}^{t_2}{(t-t_1)e^{at+bt^2}dt}$$
where $0<t_1<t_2$, and $(a,b)\in \mathbb{R^2}$.
I made unfruitful researches on this type of integral, hence I ask your help. Thanks.

A: If $a=0$ or $b=0$ trivial. Assume $a\ne0\ne b$. Completing the square in the exponential exponent polynomial we get $t^2+\frac{a}{b}t+\frac{a^2}{4b^2}-\frac{a^2}{4b^2}=\left(t-\frac{a}{2b}\right)^2-\frac{a^2}{4b^2}$. So that $\exp\left(bt^2+at\right)=k\exp \left[b\left(t-\frac{a}{2b}\right)^2\right]$, where $k=\exp \left[b\left(-\frac{a^2}{4b^2}\right)\right]$. Now if $t_1=\frac{a}{2b}$, then the we have a trivial case. If not, add and subtract $\frac{a}{2b}$ in the linear polynomial; i.e., $t-t_1=t-t_1+\frac{a}{2b}-\frac{a}{2b}=t-\frac{a}{2b}+C$, where $C=t_1+\frac{a}{2b}$. Thus,
\begin{align}
\int_{t_1}^{t_2}{\left(t-t_1\right) \exp\left(bt^2+at\right)}dt=k\int_{t_1}^{t_2}{\left(t-\frac{a}{2b}\right) \exp \left[b\left(t-\frac{a}{2b}\right)^2\right]}dt:=I_1
\\
-k\cdot C\int_{t_1}^{t_2}{\exp \left[b\left(t-\frac{a}{2b}\right)^2\right]}dt:=I_2
\end{align}
$I_1$ is trivial to evaluate. The value of $I_2$ doesn't have a closed form if $b>0$. If $b<0$ then transform the integral to be defined on $(0,\infty)$ and then use Gamma function.


text:
Q: SQLite3 open file problems I'm using GTK+ and SQLite as a front end for a small database program, and I cannot get SQLite to properly detect file type on open.  Not matter what is opened, it returns SQLITE_OK.
I tried sqlite3_open and sqlite3_open_v2, the problem still persists.  The output is always the same, regardless of what filetype is opened:
/home/shawn/Programming/languagedb/lang.db
0 6304656
good
/home/shawn/Programming/languagedb/Makefile
0 6304656
good

And here is the related code:
void OpenDialog()
{
    GtkWidget *WinOpen;

    WinOpen = gtk_file_chooser_dialog_new("Open Database",GTK_WINDOW(WinOpen),GTK_FILE_CHOOSER_ACTION_OPEN,GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL,GTK_STOCK_OPEN,GTK_RESPONSE_ACCEPT,NULL);

    if(GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(WinOpen)))
    {
        char *filename;
        filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(WinOpen));
        printf("%s\n",filename);

        db = NULL;
        rc = sqlite3_open_v2(filename,&db,SQLITE_OPEN_READONLY,NULL);

        printf("%i %i\n",rc,&db);

        if(SQLITE_OK == rc && NULL != db)
        {
            printf("good\n");
        }

        sqlite3_close(db);
    }

    gtk_widget_destroy(WinOpen);
}

A: As I also said in this answer you need to execute a non-pragma statement against the open database handle before SQLite tries to read, and then verify the file's contents.


text:
Q: How to setup a Jenkins CI cluster for single/cross platform development? I have 3 applications that need to be build. One application is Linux-only, one is Windows-only, and one is cross-platform. Currently, I clone the repositories manually on the related build system. I want to automate this process.
The (optimal) solution should be that I have a 2-node-cluster of Jenkins, one Linux node and one Windows node. I setup a build job one one node (no matter which) and define my build targets (cross-platform, Linux-only, Windows-only). The job definitions are shared within the Jenkins cluster and do not need to be transferred across the nodes.
How do I setup a 2-node Jenkins "cross-platform" cluster? How to define the build target (cross, Linux, Windows) for specific job definitions?

A: When adding the Windows and Linux executors to Jenkins, be sure to give them appropriate linux and windows labels.
Then, in your Jenkinsfile, use multiple agents to define several different execution environments.
For instance:
pipeline {
    agent none
    stages {
        stage('Build on Linux') {
            agent {
                label 'linux'
            }
            steps {
                sh 'my-build-command'
            }
        }
        stage('Build on Windows') {
            agent {
                label 'windows'
            }
            steps {
                bat 'myBuildCommand'
            }
        }
    }
}

Here's an example from the official documentation on how to use agent to run different steps on different platforms such as Linux and Windows.
Here's the full documentation for the agent directive.
This is for declarative pipeline.  If you are using scripted pipelines, use node() instead.


text:
Q: Gurobi library not found I use qtcreator and gurobi.
I get an error: unable to open file ligburobi50.so.
I checked and the file is there, I even gave it 777 permission, to no avail. Any ideas what is going on here?
This is the QTcreator project file:

# -------------------------------------------------
# Project created by QtCreator 2011-10-18T10:38:12
# -------------------------------------------------
TARGET = Forum
QT       -= gui

CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app

INCLUDEPATH += /opt/gurobi500/linux64/include
LIBS += -L /opt/gurobi500/linux64/lib -lgurobi_c++ -lgurobi50 -lpthread

SOURCES += main.cpp

I know I have little information, but this is actually on a computer of a colleague of mine who is abroad and I have to run this code by tomorrow. Thanks!

A: The message "no license code" is coming from the gurobi library being called by your program. You are properly compiling and linking to all the shared libraries.  The gurobi library checks for a license key file (gurobi.lic).  By default gurobi will check in your home directory and in /opt/gurobi550/.  If the file is in another place, or you want to name it something other than gurobi.lic, you can set the environment variable GRB_LICENSE_FILE.;

A: Added the following lines to .bashrc
export GUROBI_HOME="/opt/gurobi550/linux64"
export PATH="${PATH}:${GUROBI_HOME}/bin"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib:/opt/boost_1_54_0/lib"
export CPLUS_INCLUDE_PATH="${CPLUS_INCLUDE_PATH}:/opt/boost_1_54_0/include"
#export GRB_LICENSE_FILE=/media/Software/Licenses/Gurobi/gurobi.lic

And that fixed it.


text:
Q: Open only one page of report in Microsoft Access via VBA What I want to do is very simple, but I'm totally new to VBA. I want to open a report and filter it by page number, so that I could open, say, only page 2. I already have a variable for how many pages it is. I just need to know what to put in the filter argument of the DoCmd.OpenReport function.
The overall goal is to export each page as a separate PDF. If I can do the above, I can do the rest, but if there's something really simple I'm missing, I'm open to suggestions. Thanks.
This is Access 2010 by the way.

A: To print single pages you can work with the printer object ( http://msdn.microsoft.com/en-us/library/ff837177.aspx ) and the PrintOut command ( http://msdn.microsoft.com/en-us/library/aa220516(v=office.11).aspx ), however, it seems likely that you have a natural break, such as a customer record, and these breaks can be used with the Where argument of OpenReport to easily get separate reports.
EDIT re comments
Very roughly:
sSQL = "SELECT SuitableField FROM Atable ORDER BY Something"

Set rs = CurrentDB.OpenRecordset(sSQL)

Do While Not rs.EOF
   DoCmd.OpenReport "TheReport", acViewNormal, , _
       "SuitableField='" & rs!SuitableField & "'"
   rs.MoveNext
Loop

You may wish to do some work to ensure you are choosing reports with data in them.


text:
Q: With how may ways can the people get out of the elevator,if they are not distinguishable There is an elevator with 8 people and 5 floors.With how may ways can these 8 people get out of the elevator,if we consider that they are not distinguishable?Which formula can I use to find it?

A: Your question is the same as the following question :
Find the number of sets of $(a,b,c,d,e)\ (a,b,c,d,e\in\mathbb Z)$ such that
$$a+b+c+d+e=8.$$
The answer is
$$\frac{12!}{4!8!}=\binom{12}{4}=495.$$
Imagine you have 8 circles and 4 short lines, and arrange them in a row. Then, count the number of balls in each section divided by lines.
For example, the following represents we have $(a,b,c,d,e)=(2,2,0,1,3).$ And we can think this as that $2$ people get out of the elevator on the 1st floor, $2$ people on 2nd floor...
$$\circ\circ|\circ\circ\ ||\circ|\circ\circ\circ$$
I hope this helps.


text:
Q: Given the differential equation $y'+a(t)y=f(t)$ , show that every solution tends to $0$ as $t$ approaches infinity. I know this is a duplicate but I've read the answers and I still don't know how to proceed.
Given the differential equation $y'+a(t)y=f(t)$ with $a(t)$ and $f(t)$ continuous for: $-\infty < t < \infty$, $ $ $a(t)\geq c >0$ $\lim_{t \to \infty} f(t) = 0$
And we want to show that every solution goes to 0 as t goes to infinity.
$$y'+a(t)y=f(t)$$
Let $\mu(t) = e^{\int a(t)dt}$ be the integrating factor.
$$\mu(t) =  e^{A(t)} \text{ where } A(t) = \int a(t)dt$$
By multiplying both sides of the equation by $\mu(t)$ we obtain:
$$\mu(t)(y'+a(t)y)=\mu(t)f(t)$$
$$\frac{d}{dt}\mu(t)y=\mu(t)f(t)$$
$$y = \mu(t)^{-1}\int \mu(t)f(t)dt$$
I believe the last expression could also be rewritten like this
$$y(t) =e^{-A(t)}(\int_{t_0}^{t} e^{A(s)}f(s)ds +y_0) $$ where $y_0$ is a constant
In the previous post some things were sugested like using the Gronwall's Inequality but I have no idea how I would apply it in this particular case.
My understanding of the Gronwal Inequality is that I would need to find $\beta(t)$ such that: $$y'(t) <= \beta(t)y(t)$$
This doesn't seem to be the case since if
$$y' = f(t)-a(t)y \leq f(t) - cy$$ yet $f(t)$ isn't being multiplied by $y$
The homogeneous solution clearly goes to $0$ I can't understand why all particular solutions must also go to $0$
I hope my question was clear enough if you're unable to understand anything that I've written please tell me.