text:
Q: How to get IzPack tocheck for an existing version of the software? I have an application for which we use IzPack to create the installer. The installer is working fine in its current state, however, I need to add functionality that enables it to check whether an existing version of the software has been installed.
I understand IzPack supports this out of the box using its CheckedHelloPanel, unfortunately that only works for Windows, as it appears to depend on the windows registry.
Is there a way to configure IzPack such that it is able to detect existing installations?
I need to be able to detect whether there is one and merely display a message notifying the user... Bonus points for how to give the user the option to trigger the uninstaller of the existing installation.

*

*Assume that the software will only be installed using the new installer

*IzPack only: please do not suggest alternatives, as we cannot change that now

*If you suggest using <validator>, please include a code sample of the validator class, because I have considered this, but don't know where to start

A: I wrote this to allow my application to be installed over the jboss install.
public class JBossChecker {

 private static boolean tempJBossEnv;
 private static boolean tempJBossDirectoryExists;

 static {
  String s = System.getenv("JBOSS_HOME");
  tempJBossEnv= (s!=null);

  if( tempJBossEnv) {
   File f = new File(s);
   tempJBossDirectoryExists= ( f.exists() && f.isDirectory());
  }
  hasJBossEnv =tempJBossEnv;
  hasJBossDir = tempJBossDirectoryExists;
 }

 public static boolean hasJBossDir;
 public static boolean hasJBossEnv;

 public static void main(String[] args){
  System.out.println("Jboss environment "+hasJBossEnv);
  System.out.println("Jboss directory "+hasJBossDir);

 }
}

Then the installer has a section like
<conditions>
     <condition type="java" id="jbossEnv">
             <java>
                 <class>au.com.codarra.ela.installer.JBossChecker</class
                 <field>hasJBossEnv</field>
             </java>
             <returnvalue type="boolean">true</returnvalue>
 </condition>

 <condition type="java" id="jbossDir">
             <java>
                 <class>au.com.codarra.ela.installer.JBossChecker</class>
                 <field>hasJBossDir</field>
             </java>
             <returnvalue type="boolean">true</returnvalue>
 </condition>

</conditions>

<installerrequirements>
 <installerrequirement condition="jbossEnv" message="Your system does not have the environment variable JBOSS_HOME set. Cannot update your system. Is XXXX installed on this system?" />
 <installerrequirement condition="jbossDir" message="Your system does not have a directory at the location in the environement variable JBOSS_HOME . Cannot update your system. Is XXXX installed on this system?" />
</installerrequirements>

<dynamicvariables>
 <variable name="INSTALL_PATH" value="${ENV[JBOSS_HOME]}"/>
</dynamicvariables>

<jar src="c:\dev\xxxx\build\installer.jar" />

The bit at the end makes sure izpack adds it to the installer jar.

A: It only works on Windows, because only Windows has a registry.  However, in Linux apps traditionally don't have customized unified locations.  For example your run scripts would go in a bin folder, your binaries would go in /opt, your documentation would go in /var, etc.  The idea that there's one single "your-app" directory that is selected by the user and contains everything related to the application is a Windows concept.
So anyway, the way to solve this in Linux is to install the various parts of your app in non-user-defined locations.  That way you know exactly where your app would be if it was already installed.


text:
Q: How to create a stacked chart with cumulative line using Highchart.js Does anyone have any examples of using Highchart to achieve a result like the one in the image?
function drawChart(result) {
    var response =
        {
            Month: result.Month,
            Data: result.Data,
            Title: result.title
        };
    $('#dvChart').highcharts({
        chart: {
            type: 'column'
        },
        title: {
            text: title
        },

        xAxis: {
            categories: response.Month
        },
        yAxis: [{
            min: 0,
            title: {
                text: "# Of Tests"
            },

        },

        ],

        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0,
                stacking: 'normal',

                }
            }
        }

        ,
        series:
             response.Data
    });

}

My code above can achieve stacked chart but I dont know how to put cumulative lines to the chart.

A: To get line type series with stacked column series you should set type of type per series for ones with other type than the one defined in chart.type option.
Example: http://jsfiddle.net/t3v579uj/
$(function () {
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        xAxis: {
            categories: ['r', 'e', 's', 'p', 'o']
        },
        yAxis: [{
            min: 0,
            title: {
                text: "# Of Tests"
            }
        }],
        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0,
                stacking: 'normal'
            }
        },
        series: [{
            data: [1,2,3,4]
        },{
            data: [1,2,3,4]
        },{
            data: [1,2,3,4]
        },{
            type: 'line',
            data: [2,3,4,5]
        }]
    });
});

redpajama_set_name: RedPajamaStackExchange


text:
Q: Convert long string to integer without parseLong or parseInt Here's is the situation ... i have a binary file which contains 32-bit binary strings of characters (e.g   1011011100100110101010101011010 ) and i want to convert this to integer ... I have already tried to do it with parse-Int but if the most significant value is 1, i get back a negative number and i do not want that ... Then i tried it with parse-Long and it was okay but after that when i get this integer i have to send it to another class which can receive only integers , as a result i do casting from long to int and i get back a negative integer again ...  The only way to do that is with a piece of code that i found which does the opposite thing ( from int to string ) but i do not understand how to change-convert it. It is about masks which i do not know a lot of things.
Here is the code :
    private static String intToBitString(int n) {
         StringBuffer sb = new StringBuffer();
         for (int mask = 1 << 31; mask != 0; mask = mask >>> 1)
             sb.append((n & mask) == 0 ? "0" : "1");
         return sb.toString();
     }

Thank you in advance...

A: An integer with the highest bit set to 1 is a negative integer, regardless of the number of bits. Just add the heading zero to the string or alternatively clear the highest bit with bitwise AND (x & 0x7FFFFFFF). You can only store a 31 bit positive integer in java int.
Even if you assign such value to long (long x = 0xFFFFFFFF, will be -1), the sign bit expands and now you have the negative long (you can write 0x0FFFFFFFFL however to assign the expected 00000000FFFFFFFF to long). You still need to clear the high bits if this is unwanted behavior.
    int a = 0x80000007; // High bit 1 - negative!
    long b = a; // Sign expands!
            // Clearing high bits (mind leading 0 and
            // the long type suffix (L) in the hex constant:
    long c = b & 0x0FFFFFFFFL;
    System.out.println(a + ":" + Long.toHexString(b) + ":"
            + Long.toHexString(c));

The output: -2147483641:ffffffff80000007:80000007


text:
Q: Elementary equivalence of ordinals What is the smallest ordinal alpha which is elementarily equivalent to some smaller ordinal beta with the signature (<)?
What is the corresponding ordinal beta?
What if we instead require that beta be an elementary substructure of alpha?

A: The first-order theory of well-orderings was studied in great detail in a paper of Doner, Mostowski, and Tarski, "The elementary theory of well-ordering -- a metamathematical study" [Logic Colloquium '77, edited by A. Macintyre, L. Pacholski, and J. Paris, North-Holland (1978) pp. 1-54].  In particular, their Corollary 44 characterizes (unless their notation is very non-standard --- I haven't checked carefully) when two ordinals are elementarily equivalent.  Modulo an apparent typo in the definition just before the corollary (one of the strict inequalities should be non-strict), it seems that the first pair of distinct but elementarily equivalent ordinals is $\omega^\omega$ and $\omega^\omega\cdot2$.  A thorough reading of the paper (which I don't have time for right now) should also reveal the answer to your second question, about elementary submodels (probably the same pair of ordinals).

A: As far as I can see the problems are fully discussed in "The elementary theory of well orderings"  by Doner, Mostowski and Tarski mentioned already by Andreas Blass. Lemma 44 covers as Andreas Blass explained the elementary equivalence and Lemma 47 there answers the part on elementary substructures.


text:
Q: What happen if two sql table have the same column name while trying to write a sql query from the two? https://i.stack.imgur.com/MQ2Pi.png
If i were to write a sql query based of the "pid" from Research Project and Time records. Would the pid simply merge together or do i have to input two separate pid query when using both table?
Here is a example of what i mean, a sql query to find out what the names of projects and the total number of hours.
select title, workhours
from researchproject,timerecords
where pid IN (48,149,199)

^ would this be able to work? since there could be a massive corruption if two table have the same column name as a result they were not be able to merge for the final result.
or maybe a recursion method probably not necessary :
where pid IN (48,149,199)
or pid IN (48,149,199)


text:
Q: Order by modified date on a text calculated column Due to a business requirement, the dates need to be displayed using the following format: DD MMM YYYY HH:MM
Because I am converting modified date to text using the following formula on a calculated column: =TEXT(Modified,"dd mmm yyyy hh:mm"). When I want order the column ascending or descending the result is based on the text and I cannot order by dates any more.
How can I order by modified date when ordering this calculated column?
Ideally I don't have to have another column with the standard SharePoint modified date column to be able to order by date.
I am using SharePoint 2016 on premise, but I think that the answer would be valid for other versions.
An example would be great. Thanks a lot.

A: If I understand correctly, I think all you need to do is to ensure that the data type returned from this formula should be data/time.
Set the Data Type to Date/Time

Result

A: You can use the CSR to change the display format of list column.

*

*Edit your list view web part properties.

*Under Miscellaneous section you will see "JS Link"

*You can enter the path of JS file.

You can use the following code in a JS file update the path under JS Link property

(function () {
    var requestCtx = {};
    requestCtx.Templates = {};

    requestCtx.Templates.Fields = {
        'Modified': {'View': modifiedFieldTemplate}
    };

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(requestCtx);
})();

function modifiedFieldTemplate(ctx) {
    var date = new Date(ctx.CurrentItem.Modifed).format("dd MMM yyyy hh:mm");
    return date;
}


text:
Q: How To Add Selected Product Data In Database? I Have Used One Grid Serializer Module. In This Module, One Tab "Select Product"  in This Tab Has Display Product Grid  If Check box Has Select (Select Multiple Also) And Click Save Item, Then Record Should Saved Another Table  It is My ImageslideController.php Coding
        <?php

        class Chilly_Imageslide_Adminhtml_ImageslideController extends Mage_Adminhtml_Controller_Action
        {

            protected function _initAction()
            {
                $this->loadLayout()
                    ->_setActiveMenu('imageslide/items')
                    ->_addBreadcrumb(Mage::helper('adminhtml')->__('Items Manager'), Mage::helper('adminhtml')->__('Item Manager'));
                return $this;
            }

            public function indexAction() {
                $this->_initAction();
                $this->_addContent($this->getLayout()->createBlock('imageslide/adminhtml_imageslide'));
                $this->renderLayout();
            }
         public function productAction(){

                $this->loadLayout();
                $this->getLayout()->getBlock('product.grid')
                ->setProducts($this->getRequest()->getPost('products', null));
                $this->renderLayout();
            }
            public function productGridAction()
            {

                $this->loadLayout();
                $this->getLayout()->getBlock('product.grid')
                    ->setProducts($this->getRequest()->getPost('products', null));
                $this->renderLayout();
            }
            public function editAction()
            {
                $imageslideId     = $this->getRequest()->getParam('id');
                $imageslideModel  = Mage::getModel('imageslide/imageslide')->load($imageslideId);

                if ($imageslideModel->getId() || $imageslideId == 0) {

                    Mage::register('imageslide_data', $imageslideModel);

                    $this->loadLayout();
                    $this->_setActiveMenu('imageslide/items');

                    $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item Manager'), Mage::helper('adminhtml')->__('Item Manager'));
                    $this->_addBreadcrumb(Mage::helper('adminhtml')->__('Item News'), Mage::helper('adminhtml')->__('Item News'));

                    $this->getLayout()->getBlock('head')->setCanLoadExtJs(true);

                    $this->_addContent($this->getLayout()->createBlock('imageslide/adminhtml_imageslide_edit'))
                         ->_addLeft($this->getLayout()->createBlock('imageslide/adminhtml_imageslide_edit_tabs'));

                    $this->renderLayout();
                } else {
                    Mage::getSingleton('adminhtml/session')->addError(Mage::helper('imageslide')->__('Item does not exist'));
                    $this->_redirect('*/*/');
                }
            }

            public function newAction()
            {
                $this->_forward('edit');
            }

            public function saveAction()
            {
                if ( $this->getRequest()->getPost() ) {
                    try {
                        $postData = $this->getRequest()->getPost();
                        if(isset($postData['links'])){
                            $products = Mage::helper('adminhtml/js')->decodeGridSerializedInput($data['links']['products']); //Save the array to your database
                        }
                        //exit;
                        $imageslideModel = Mage::getModel('imageslide/imageslide');

                        $imageslideModel->setId($this->getRequest()->getParam('id'))
                            ->setTitle($postData['title'])
                            ->setCId($postData['c_id'])
                            ->setStatus($postData['status'])
                            ->save();
                        var_dump($products);
                        //var_dump($postData);exit;
                        Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully saved'));
                        Mage::getSingleton('adminhtml/session')->setimageslideData(false);

                        $this->_redirect('*/*/');
                        return;
                    } catch (Exception $e) {
                        Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
                        Mage::getSingleton('adminhtml/session')->setimageslideData($this->getRequest()->getPost());
                        $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
                        return;
                    }
                }
                $this->_redirect('*/*/');
            }

            public function deleteAction()
            {
                if( $this->getRequest()->getParam('id') > 0 ) {
                    try {
                        $imageslideModel = Mage::getModel('imageslide/imageslide');

                        $imageslideModel->setId($this->getRequest()->getParam('id'))
                            ->delete();

                        Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Item was successfully deleted'));
                        $this->_redirect('*/*/');
                    } catch (Exception $e) {
                        Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
                        $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));
                    }
                }
                $this->_redirect('*/*/');
            }
            /**
             * Product grid for AJAX request.
             * Sort and filter result for example.
             */
            public function gridAction()
            {
                $this->loadLayout();
                $this->getResponse()->setBody(
                       $this->getLayout()->createBlock('imageslide/adminhtml_imageslide_grid')->toHtml()
                );
            }
        }

I M USes Two Table One Is, 1.imageslide , 2.newsproduct in Second Table Record Should Be Stored.

A: you already getting the values
$currproduct='';
if(isset($postData['links'])){
      $products = Mage::helper('adminhtml/js')->decodeGridSerializedInput($data['links']['products']); //Save the array to your database
      $currproduct= implode(',',$products);
     }
 //exit;
$imageslideModel = Mage::getModel('imageslide/imageslide');

$imageslideModel->setId($this->getRequest()->getParam('id'))
                        ->setTitle($postData['title'])
                        ->setCId($postData['c_id'])
                        ->setStatus($postData['status'])
                        ->save();
 if($currproduct){ //add it heree  }


text:
Q: Embedding a C# Control Into a Website How do I embed a C# form control into an HTML page?
I found this tutorial: http://weblogs.asp.net/spano/archive/2007/09/19/hosting-a-windows-form-control-in-a-web-page.aspx
and tried to follow it... But it didn't work... Here is my code:
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
<object classid="http://ctrl.dll#ctrl.ctr" height="100" width="100" VIEWASTEXT/>
</body>
</html>

C#:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace ctrl
{
    [ComVisible(true)]
    public partial class ctr : UserControl
    {
        public ctr()
        {
            InitializeComponent();
        }
    }
}
//on the design view there is a button; dimensions are 100*100

Note that all (both) files are in the same folder.
Does anyone know what is wrong with this? (I tested this in IE and Chrome)


text:
Q: Would it be possible to use golang protobuf client to call C++ protobuf server? I need to use an existing C++ backed protobuf server (need to connect with unix socket) to receive protobuf requests.
And I want to use golang as the protobuf client to send request to the server.
However I found the autogenerated message definition in C++ and golang is different.
There are much more definition in C++ version of protobuf in ::google::protobuf::Message.
I use the following command to generate c++ protobuf definition based on the same proto definition:
protoc --proto_path=src --cpp_out=. src/sample.proto
protoc --proto_path=src --go_out=. src/sample.proto

But with the generated sample.pb.cc, sample.pb.h and sample.pb.go, the golang client message format is not recognized by the c++ server.
Is there a way to make this golang client c++ server protobuf communication work?
Thanks.
============================
2021.1.6 update: Add an example here:
Directory structure:
test
├── test.pb.cc
├── test.pb.go
├── test.pb.h
└── test.proto

proto file:
syntax = "proto2";

option go_package = "./;test";

package test;

message test {
    required uint64 key = 1;
}

protoc commands to generate the test.pb.go, test.pb.h, test.ph.cc files:
protoc --proto_path=test --cpp_out=test test/test.proto
protoc --proto_path=test --go_out=test test/test.proto

Then you can see the golang generated data structure in test.pb.go:
type Test struct {
    state         protoimpl.MessageState
    sizeCache     protoimpl.SizeCache
    unknownFields protoimpl.UnknownFields

    Key *uint64 `protobuf:"varint,1,req,name=key" json:"key,omitempty"`
}

C++ generated data structure:
class test : public ::google::protobuf::Message {
  ... // I'll ignore function definition

  static const int kKeyFieldNumber = 1;
  ::google::protobuf::UnknownFieldSet _unknown_fields_;
  ::google::protobuf::uint64 key_;
  mutable int _cached_size_;
  ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
  static test* default_instance_;
}

These two just seems not match...
For example, the _has_bits_ field kind of plays an important role in the c++ generated code, while there's no related logic in golang generated code.
// required uint64 key = 1;
inline bool test::has_key() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void test::set_has_key() {
  _has_bits_[0] |= 0x00000001u;
}
inline void test::clear_has_key() {
  _has_bits_[0] &= ~0x00000001u;
}
inline void test::clear_key() {
  key_ = GOOGLE_ULONGLONG(0);
  clear_has_key();
}
inline ::google::protobuf::uint64 test::key() const {
  return key_;
}
inline void test::set_key(::google::protobuf::uint64 value) {
  set_has_key();
  key_ = value;
}


text:
Q: Trying to hide/show partials based on if a input has text node.js handlebars so I have a page. there's a search bar. if the search bar has no text inputted, the page displays two partials, one for featured apps and one for most popular. but if someone inputs any text at all into the search bar then the featured apps and most popular apps partials disappear and the search results partial shows up. instead what happens is neither partials load. there's just a big blank space where they should be.
I tried doing this with jQuery but was having no luck. so now I'm back to trying to use dynamic partials but am also having no luck with that. if this can only be done with something like jQuery please let me know.
I was briefly trying to use a handlebar helper but I could not link it to the input id="searchApps" element without throwing an error because it keeps saying searchApps is undefined.
index.hbs (if this is missing any divs it's cause it's just part of the code)

      <input id="searchApps" type="text" placeholder="Search apps...">
      {{!-- so once someone types the first character here the searchResults partial should render. and it should be dynamic so results should further refine with each additional character typed--}}
      {{>sidebar}}

{{#if 'searchApps.length === 0'}}

      {{>searchResults}}

  {{else}}

        {{>featuredApps}}

          {{>mostPopularApps}}

{{/if}}

here is the jQuery I tried in the index.hbs file just before the  tag

so anyone know how I can do this?
thanks


text:
Q: How to automatically create a cart for a customer in prestashop? I would like to create automatically a cart for a customer with a product. Then the customer can login on the site and validate the cart.
I saw how to create a cart in my module but i don't understand how to affect the cart to a customer?

A: Binding created cart to customer is very simple:
$cart = new Cart();
//Add products or what so ever
$cart->id_customer = $my_customer_id;
$cart->update();

or simply update your ps_cart database table and set proper id_customer value. You can create a module with this code in a function with hook transplanted to actionAuthentication, which is executed after customer successful login to your e-shop.


text:
Q: _default_root.tk.call('package', 'require', 'Togl') I'm trying to run a code for molecular dynamics simulation which requires using 3D graphics.
I've installed all required packages (windows 7) but still have this error when running the code:
 File "C:/Users/San/Desktop/togl.py", line 3, in
    from OpenGL.Tk import *
  File "C:\Python27\lib\site-packages\OpenGL\Tk__init__.py", line 121, in
    _default_root.tk.call('package', 'require', 'Togl')
TclError: couldn't load library "C:/Python27/tcl/Togl2.0/Togl20.dll": this library or a dependent library could not be found in library path
Any help, please????
Thank you

A: This is a Tcl/Tk package for which you have a tkinter wrapper. It looks like your Tcl/Tk package is missing but you have the wrapper. You will need to obtain or build a version of togl that matches your version of Python so if you have a 64 bit version of python, build a 64 bit tcl extension package. Tcl/Tk extensions should be installed into the tcl subdirectory of your python installation so that the Tcl package command can load them.


text: Q: What are the differences between @nrwl/web:webpack and webpack? I'm starting to configure my project using Nx and webpack. I can not understand the use of Nx executers at all. What is the benefit of using @nrwl/web:webpack instead of webpack? All I understand is it's just a layer of abstraction over webpack. Are there any performance optimizations or something? Isn't it better to use webpack directly since it is simpler to configure and does not have any extra abstractions?


text:
Q: How to use `\phantom` to align equations along a sum operator? The following MWE shows the following bogus optimization problem with objective and constraints. I'm trying to achieve a visual alignment of the contraints in lines 2 and 3. However, a simple \phantom with the \sum_{...} as an argument does not create an equal space. I tried out adding {} left and right, but that did not seem to do be the solution, either. So the question is this:
How can I align the constraints on their operators?
(Btw: if there is a way to just use the & facilities from align directly to achieve this, I would be glad to see that as a solution. I do not see how.)
Image

M-not-WE
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\min_{x,y}\ & c_1 x_1 + c_2 x_2 + c_3 y \\
\mathrm{s.t.}\, &
  \sum_{i\in \{1,2\}} x_i \geq d \\
& \phantom{\sum_{i\in \{1,2\}}} % what to add here?
               x_i \leq y \ \forall i\in\{1, 2\}
\end{align*}
\end{document}

A: Use an aligned environment:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\min_{x,y}\ & c_1 x_1 + c_2 x_2 + c_3 y \\
\mathrm{s.t.}  & \begin{aligned}[t]
                   \sum_{i\in \{1,2\}} x_i & \geq d \\
                   x_i                     &\leq y \ \forall i\in\{1, 2\}
                 \end{aligned}
\end{align*}
\end{document}

A: Here is an approach using stacking a TABstack under the top line.
\documentclass{article}
\usepackage{tabstackengine}
\stackMath
\begin{document}
\[
\setstackgap{S}{5pt}
\def\stackalignment{l}
\stackunder{\displaystyle\min_{x,y}\ c_1 x_1 + c_2 x_2 + c_3 y}{%
\alignShortstack{%
\,\mathrm{s.t.}\,  \displaystyle\sum_{i\in \{1,2\}} x_i \geq& d \\
x_i \leq& y \ \forall i\in\{1, 2\}
}}
\]
\end{document}

A: If you want to use \phantom, you can do it as follows:
\begin{align*}
\min_{x,y}\ & c_1 x_1 + c_2 x_2 + c_3 y \\
\mathrm{s.t.}\, &
  \sum_{i\in \{1,2\}} x_i \geq d \\
& \phantom{{}\sum_{i\in \{1,2\}}{}} % what to add here?
               x_i \leq y \ \forall i\in\{1, 2\}
\end{align*}

The reason is that there is some space around the sum that separates the sum from its neighbours.  If the \sum has no direct neighbours, since it is "alone" within its \phantom group, then this space disappears.  If you add empty pairs of braces before and after the sum, the space is reinserted.

A: I propose a small improvement to @Harish Kumar's solution, using mathtools, and two variants for the layout of this equation:
\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{align*}
                                     & \min_{x,y}\{ c_1 x_1 + c_2 x_2 + c_3 y\} \\
                                     & \,\mathrm{s. t.}\enspace \begin{aligned}[t]
  \sum_{\mathclap{i\in \{1,2\}}} x_i & \geq d \\
  x_i & \leq y \ \forall i\in\{1, 2\}
  \end{aligned}
\end{align*}

\begin{align*}
            & \min_{x,y}\{ c_1 x_1 + c_2 x_2 + c_3 y\} \\
            & \,\mathrm{s. t.}\enspace \begin{aligned}[t]
  x_1 + x_2 & \geq d \\
  x_1,x_2 & \leq y
  \end{aligned}
\end{align*}

\begin{align*}
    & \min_{x,y}\{ c_1 x_1 + c_2 x_2 + c_3 y\} \\
    & \,\mathrm{s. t.}\enspace \begin{array}[t]{|l}
  x_1 + x_2 \geq d \\
  x_1,x_2\leq y
  \end{array}
\end{align*}
\end{document}


text:
Q: Unable to run GUI applications in Kali Linux When attempting to run programs in Kali Linux, notably insomnia and Postman, the app runs with no errors, but the screen is a frame containing whatever is behind it. Running as root, reboots, and re-installs had no changes.

A: It looks like insomnia and Postman are not present in the standard Kali repositories. Since you installed insomnia using apt, this means you've added non-Kali repositories to Kali.
From the official web pages of Kali Linux:

[...] adding other operating system's repositories into Kali (such as trying to put Ubuntu on Kali), will break your installation. This is the single most common reason why Kali Linux systems break.  If any guides are telling you to do anything else than the above, this is unofficial advice, and completely not supported by Kali Linux. More often than not, users in this case end up doing a reinstall after learning this lesson.

Although you haven't added a base repository of some other Linux distribution, you should note that neither insomnia nor Postman are claimed to be supported by Kali. It looks like you found out they indeed won't work "out of the box".
This might be because they need some X11 fonts or other resources that are guaranteed to be present in Debian/Ubuntu by dependencies between standard packages, but Kali apparently has different versions of those packages with stripped-down dependencies. If you want to make it work, you'll have to try and find out what are the actual technical requirements of these applications and which packages on Kali might satisfy those requirements.


text:
Q: D3 map legend issue I am creating a population map of the US. I have the map and legend working, but I made a drop down menu that allows me to filter by race. This works and changes the data on the map and legend, but I am having an issue where the legend text shows the new range, and all previous ranges as I change the drop down menu. Is there a way to have it so that it doesn't overlap the previous text but instead shows only the one correct text? I am using D3 with React.
This is the code to my legend:
svg.append("g")
    .attr("transform", "translate(580,20)")
    .append(() => Legend(color, {title: `2019 Population (x10^${exp})`, width: 300,tickFormat: ".1f"}))

The code to my color variable:
const color = d3.scaleQuantile([start/divider,end/divider], d3.schemeYlOrRd[9])

start and end change depending on how big the population sizes are
Edit/Update:
I found a work around to solving my issue, I'm just not sure if its best practice or if there's another way of doing it. I gave it a background color so that the previous info gets covered up
code:
svg.append("g")
    .attr("transform", "translate(580,20)")
    .append(() => Legend(color, {title: `2019 Population (x10^${exp})`, width: 300,tickFormat: ".1f"}))
    .append("rect")
    .attr("width", "100%")
    .attr("height", "100%")
    .attr("fill", "grey")

    svg.append("g")
    .attr("transform", "translate(580,20)")
    .append(() => Legend(color, {title: `2019 Population (x10^${exp})`, width: 300,tickFormat: ".1f"}))

A: Every time you do svg.append('g').transform(...).append(() => Legend()) you are adding a new <g> element.
Instead store the <g> selection in a variable and then remove its contents before adding a new legend.
const legendG = svg.append('g').attr('transform', 'translate(580, 20)')

function renderLegend(legendOptions) {

  legendG.selectAll('*').remove() // removes everything inside

  legendG.append(() => Legend(legendOptions))
}

// now call the `renderLegend` function every time you change something from the menu

And to answer your question if what you did is a good practice. I would say it is not, because you're just adding elements every time the user chooses something in the menu and it's just taking up more and more memory for storing the DOM. Not good for performance.


text:
Q: How do I order an IEnumerable such that a special item is always at the bottom? I have an IEnumerable<string> being passed to me which has the following items:

*

*HP

*Canon

*Lexmark

*Samsung

*Other

Now what I am trying to achieve is order the items alphabetically but I want to keep the other item last. I have gone ahead and used OrderBy(i => i)
which lists the items as follows:

*

*Canon

*HP

*Lexmark

*Other

*Samsung

The desired result I want is

*

*Canon

*HP

*Lexmark

*Samsung

*Other

I have tried using .OrderBy(i => i != "Other").ThenBy(i => i) but this puts Other item right at the top.
Can someone tell me how to achieve this please.

A: You have to use OrderByDescending because true is "higher" than false
list.OrderByDescending(s => s != "Other")
    .ThenBy(s => s);

You could also use
list.OrderBy(s => s == "Other" ? 1 : 0)
    .ThenBy(s => s);

Since you have asked, here are extension methods which simplify it for future use:
public static IEnumerable<T> OrderFirst<T>(this IEnumerable<T> sequence, Func<T, bool> predicate)
{
    return sequence.OrderByDescending(predicate);
}

public static IEnumerable<T> OrderLast<T>(this IEnumerable<T> sequence, Func<T, bool> predicate)
{
    return sequence.OrderBy(predicate);
}

Example usage:
var list = new List<string> { "HP", "Other", "Samsung" };
var otherLast = list.OrderLast(s => s == "Other").ToList();

A:
I have tried using .OrderBy(i => i != "Other").ThenBy(i => i) but this puts Other item right at the top.

So you're almost there, you just need to reverse the sort order of your first criterion: Replace OrderBy by OrderByDesc or replace i != "Other" with i == "Other.
Of course, it does not hurt to be explicit: It's not obvious how Booleans are sorted, so I'd prefer:
.OrderBy(i != "Other" ? 1 : 2).ThenBy(i => i);

A: Another option using tuples:
list.OrderBy(s => Tuple.Create(s=="Other",s));

or, in C# 7 :
list.OrderBy(s => (s=="Other",s));

OrderBy expects an expression that returns the key by which to sort. If you want to sort by multiple fields, you need to return an object or tuple that contains the field's values. It's no different than Select().
Tuples are needed because they already implement IComparable. Returning an anonymous object would fail because it doesn't implement this interface

A: Try this:
 //Imagining your list like this :
 var myList = new List<string>() {"HP", "Canon", "Lexmark", "Samsung", "Other"};

  var other = myList.Where(ro => ro == "Other").FirstOrDefault();
  myList.Remove(other);
  var finalList = myList.OrderBy(ro => ro).ToList();
  finalList.Add(other);

I hope this helps.

A: You can also do this by adding the "Other" at the end after the Order By:
 IEnumerable<string> lst = new string[]
      {
         "HP", "Canon", "Lexmark", "Samsung", "Other"
      };

 lst = lst.Select(x => x).Where(x => x != "Other").OrderBy(x => x).ToList();
 lst = lst.Concat(new string[] {"Other"}).ToList();

Or in short:
lst = lst.Select(x => x).Where(x => x != "Other").OrderBy(x => x).Concat(new string[] {"Other"}).ToList();


text:
Q: Function to Check if POST is empty and add custom error messages I have some code to check an empty post like this:
foreach($_POST as $key => $value)
    {
        if (empty($_POST[$key]))
        {
            $errors[] = "$key" . "is empty.";
        }
    }

how can i add some custom messages because using $key + is empty isn't good enough for me. i want to display custom messages for every post. maybe some function like validate($name, Please enter your name, required). but i don't have a clue how to do it, can anyone can provide me some method i can try?

A: Since you want a custom message depending on the key, you should just use a switch.
$errors = array();

foreach($_POST as $key => $value)
{
    if (empty($value))
    {
        switch($key) {
            case 'name':
                $errors[] = "The name is empty.";
                break;
            case 'age':
                $errors[] = "The age is empty.";
                break;
            default:
                $errors[] = $key . " is empty.";
        }
    }
}

* Edit *
If you want to do special treatment according to the key, and use a function :
$errors = array();

foreach($_POST as $key => $value)
{
    $result = validate($key, $value);
    if (!empty($result)) {
        $errors[] = $result;
    }
}

function validate($key, $value) {
    if ($key == 'name' && empty($value)) {
        return 'You must enter your name';
    }
    elseif ($key == 'age' && empty($value)) {
        return 'You must enter your date of birth';
    }
    elseif ($key == 'email' && filter_var($value, FILTER_VALIDATE_EMAIL) === false) {
        return 'Your email is incorrect';
    }

    return '';
}

A: Check for Form Validation scripts/tutorials with PHP.
Here are some quick findings:

*

*Using modular approach: http://www.sitepoint.com/form-validation-with-php/

*Using class based (OOP) approach: http://www.html-form-guide.com/php-form/php-form-validation.html

A: if you want to use same approach, then use this
foreach($_POST as $key => $value)
{
    if (empty($_POST[$key]))
    {
        $errors[] = getValidationMessage($key);
    }
}

function getValidationMessage($key){

    if($key == "user_name")
        return "please enter user name.";
    else if ($key == "date_of_birth")
        return "please enter you date of birth";

    //and so on,

    //based on param names in your html-forms
}

A: Something like this?
foreach ($_POST as $k => $v) {
    $errors[] = validate($k);
}

function validate($key) {
    if(empty($_POST[$key])) {
        switch ($key) {
            case 'name':
                $message = "Name is empty";
                break;
            case 'email':
                $message = "fill in your email address";
                break;
            default:
                $message = $key." is empty";
                break;
        }

        return $message;
    }
    return false;
}


text:
Q: What is difference between Oracle Apps and Oracle Application Server? I am very new to oracle, could anybody tell me what Oracle Apps and Oracle Application Server are.

A: Oracle Applications means software that helps you runs your enterprise businesses such as Accounting, Humans Resource, or Financials. But the Oracle Applications Server is the technology that, mostly installs on the server, integrates others software to work together. It can be called Middleware.
The first example is like Peoplesoft or SAP ERP. The latter is like Apache HTTP Server, Tomcat, Glassfish.

A: Assuming that you are referring to products sold by Oracle Corporation, or to Job Adverts for people to work with them.

*

*Oracle Apps = Oracle E-Business Suite, formerly known as Oracle Applications.

*Oracle Application Server = replaced by Oracle Weblogic Server, a j2ee application server for hosting j2ee applications (including but not limited to E-Business Suite).

A: Oracle Application server = it is a platform to build any application(web based)
oracle applications = it is used to run the application

A: Oracle apps is the application using which we can develop the application and oracle application server is an application server named weblogic through we can access Oracle E-bussiness Suit or oracle apps.


text:
Q: Android : Merging xml and programmatically generate layout I have requirement where I need to combine a programmatically generate layout and a xml. What approach should I take? Please let me know. Thank you.
Generate layout :
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    LinearLayout audio = new LinearLayout(this);

    audio.setGravity(Gravity.BOTTOM | Gravity.CENTER);

    RecordButton = new RecordButton(this);
    audio.addView(RecordButton,
                new LinearLayout.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT,
                    ViewGroup.LayoutParams.WRAP_CONTENT,
                    Gravity.CENTER | Gravity.BOTTOM));

    PlayButton = new PlayButton(this);
    audio.addView(PlayButton,
                new LinearLayout.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT,
                    ViewGroup.LayoutParams.WRAP_CONTENT,
                    Gravity.CENTER | Gravity.BOTTOM));

    setContentView(audio);
}

xml :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:gravity="top">

<Button
android:id="@+id/next"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="130dp"
android:background="#54C571"
android:text="Next"
android:textColor="#FFFFFF"
android:textSize="23sp"
android:textStyle="bold" />

A: Create a container view to hold your view and add the generated view to that,
This is the xml,
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FFFFFF"
    android:gravity="top">

    <Button
        android:id="@+id/next"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="130dp"
        android:background="#54C571"
        android:text="Next"
        android:textColor="#FFFFFF"
        android:textSize="23sp"
        android:textStyle="bold" />

    <!-- create a container view to hold your view -->
    <LinearLayout
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/next" />

</RelativeLayout>

In your code,
@Override
public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
    setContentView(R.layout.the_above_layout);

    LinearLayout container = (LinearLayout) findViewById(R.id.container);

    LinearLayout audio = new LinearLayout(this);

    audio.setGravity(Gravity.BOTTOM | Gravity.CENTER);

    RecordButton = new RecordButton(this);
    audio.addView(RecordButton,
                new LinearLayout.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT,
                    ViewGroup.LayoutParams.WRAP_CONTENT,
                    Gravity.CENTER | Gravity.BOTTOM));

    PlayButton = new PlayButton(this);
    audio.addView(PlayButton,
                new LinearLayout.LayoutParams(
                    ViewGroup.LayoutParams.WRAP_CONTENT,
                    ViewGroup.LayoutParams.WRAP_CONTENT,
                    Gravity.CENTER | Gravity.BOTTOM));

    // add the view to your container
    container.addView(audio);
}


text:
Q: Evaluate event detection model using ROC curves I am trying to evaluate the performance of an event picking model that attempts to find the onset of a signal in a noisy time series.
Data contains the true signal time (ground truth) and the predicted signal time (output of the model). I've calculated the residuals by taking the absolute difference between the true time and predicted time
residual = abs(true-prediction)

I have set an arbitrary threshold (eg. 8 samples) samples to determine if the an event pick is classed as accurate or not.
if residual < threshold then prediction is accurate

I would like to plot a ROC curve to compare different models by adjusting the "accuracy threshold" value and record the total number of accurate picks.
From my understanding, an accurate pick can be classed as a True Positive, and inaccurate pick is classed as a False Positive. How do I find the False Negatives and True Negatives needed to calculate ROC curves.
Example dataset showing 10 predictions
threshold = 8

    True        Prediction  Residual    Accurate?(<8)
0   654         661         7           1
1   615         623         8           0
2   577         585         8           0
3   540         548         8           0
4   502         510         8           0
5   465         479         14          0
6   429         437         8           0
7   393         400         7           1
8   358         365         7           1
9   325         333         8           0


text:
Q: How to add the scroll bar for FullCalendar.js for mobile devices? I am currently using FullCalendar.js which has many events where the scroll bar appears on the desktop version of the page. However, when I go the mobile version or tablet version of the page, the scroll bar is non-existent and it blows up the page.
I am currently using media queries and yet it still does not display the scroll bar.
UPDATE:
This is the css I am using but does not work
CSS code:
@media(max-width:480px){
    .fc-scroller{
        overflow-x:hidden !important;
        overflow-y: scroll !important;
        height:100px !important
    }


text:
Q: My friends cannot hear audio on my website while I can My website is and I have a song playing in the background. When I access the site I can hear the music, but when I tell my friends to go on they cannot hear the audio.
Seems they only not hear it when I use the audio tag. They can hear it when the audio is embed.

A: It works fine in desktop browsers.
they probably use ios devices , safari disables autoplay, instead requiring that play be initiated as part of a user interaction (e.g., you can start playback within a touchstart listener). There's a bit of documentation about this on Apple's developer documentation. There's also this article Overcoming iOS HTML5 audio limitations on IBM's developer site that has examples and more detail.


text:
Q: Symfony 2 - not authenticating user using bcrypt I add a user to the database.
I encode their password using bcrypt encryption:
$factory = $this->get('security.encoder_factory');
$encoder = $factory->getEncoder($user);
$password = $encoder->encodePassword($user->getPassword(),$user->getSalt());
$postData->setPassword($password);

This all persists to the database just fine.
On my User Entity my getSalt() method returns null:
public function getSalt(){
    return null;
}

Now when I try to authenticate the symfony logs tells me that I am entering bad credentials.
However...
If i use this site to encrypt my password with bcrypt:
http://bcrypthashgenerator.apphb.com/
Then enter the result into the database manually and try and authenticate with the users password i have updated with the results from the above link,
It works fine.
So there is something I have not set, that when I am encrypting the password that symfony cannot authenticate against it.
I have tried the setting a salt on the getSalt(), setting it to an empty string.
EDIT
I am using php 5.5.9
I have also tried using the BCryptPasswordEncoder($cost) class,
setting the cost on the __construct the same as what's in my security.yml
and it still does not authenticate.
EDIT
I have also tried installing this class via composer to as suggested here.
EDIT
If I use the php method:
password_hash('testertester',PASSWORD_BCRYPT,array('cost'=>13));

It authenticates perfectly.
So its something to do deeper in Symfony. I'll keep digging.
Still no luck :-/
I am scouring the web to no avail so far.
Any help would be greatly appreciated.
Ad

A: I was passing in the existing entity object not the submitted data object!!
$postData = $form->getdata();

$factory = $this->get('security.encoder_factory');

$encoder = $factory->getEncoder($user);

$password = $encoder->encodePassword($user->getPassword(),$user->getSalt());

$postData->setPassword($password);

Note this line here:
$user->getPassword() needed to be $postData->getPassword()
$password = $encoder->encodePassword($postData->getPassword(),$user->getSalt());

You live and learn ay!


text:
Q: Should I use RAID or is there a better way to keep my data safe? Right now, I have a 2 TB Samsung drive sitting in a USB enclosure attached to the back of my iMac. All are relatively new (about half a year in terms of the HDD and case) but I'm always afraid of the drive dying.
I was wondering what people would suggest is the best way to me to make my data redundant.
Here are my uses and requirements:

*

*Time-Machine-friendly

*Mac friendly (bonus points for playing well with Windows)

*Something that requires almost no attention

*Full data protection

*Aside as the place I keep my system backups it'll also be where I keep my movies and project archive

*Gigabyte ethernet or firewire 800

Now, I've thought about going RAID10 or getting something like a Drobo, but I've also been hearing that not everyone actually needs RAID and other solutions are better. I've thought about just getting two 4TB LaCie drives and having an app that will automatically sync the two drives for me, might that be a better choice?
Any tips and advice you guys can give me would be greatly appreciated! This is sort of my first foray into more-advanced backups and data protection so please be gentle.

A: RAID is not a backup solution.  It doesn't protect you from rm -rf.  It protects you from drive failures (differing numbers of drive failures depending on your array size and RAID level).
My data protection scheme for Macs was inspired by jwz's advice.  It consists of encrypted compressed sparsebundles on external drives.  The nice thing about this setup is that I can rsync the unmounted bundles periodically.
You can coax time machine into backing up to a local encrypted sparsebundle.

A: I agree that RAID isn't the best for most users. I don't trust Time Machine either, though I use it for incremental backups. I prefer to back up my Mac partition with Time Machine and periodically make a clone with SuperDuper. I've had issues with Time Machine losing data on restores.


text:
Q: Zorich's proof on L'Hospital's Rule The following proof on L'Hospital's Rule is excerpted from Zorich's Mathematical Analysis I, I have questions concerning the selected part in the proof :

*

*Why it is obviously possible to have $\dfrac {f\left( y\right) }{g\left( x\right) }\rightarrow 0$ and $\dfrac {g\left( y\right) }{g\left( x\right) }\rightarrow 0$ as $x\rightarrow a^{+}$ and $y\rightarrow a^{+}$, especially under the  hypothesis $2^0$ ? Anyone can explain it in detail?

*The proof also requires $y\rightarrow a^{+}$, so I found the
conclusion the proof come to is NOT $\dfrac {f\left( x\right)
}{g\left( x\right) }\rightarrow A$  as $x\rightarrow a^{+}$, but
should also added with the condition $y\rightarrow a^{+}$, and since
$x<y$, then $x\rightarrow a^{+}$ could be ensured by $y\rightarrow
a^{+}$, so I think the proof only proved that $\dfrac {f\left(
x\right) }{g\left( x\right) }\rightarrow A$  as $y\rightarrow a^{+}$
( but not $x\rightarrow a^{+}$). In a nutshell, I think the proof
didn't achieve the goal of proving L'Hospital's Rule, am I all right
?

A: The following is my remedy on the author(Zorichs)'s proof.
I replaced his $y$ with $x_{0}$, $\xi$ with $c$, then take the equality as
$$\begin{matrix}
\frac{f\left( x \right)}{g\left( x \right)} = \frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}\left( 1 - \frac{g\left( x_{0} \right)}{g\left( x \right)} \right) + \frac{f\left( x_{0} \right)}{g\left( x \right)} \\
\end{matrix}$$
Since $x_{0}$ can be chosen arbitrarily in $(a,\ x_{0})$, we can chose a $x_{0}$ near enough to the right side of $a$, then $\frac{f^{'}\left( x \right)}{g^{'}\left( x \right)}$ can be made as close as we please to $L$ in $(a,\ x_{0})$ due to $\lim_{x \rightarrow a^{+}}\frac{f^{'}\left( x \right)}{g^{'}\left( x \right)} = L$ and$\ x < x_{0}$, so can $\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}$ for $c < x_{0}$. As $1 - \frac{g\left( x_{0} \right)}{g\left( x \right)} \rightarrow 1$ and $\frac{f\left( x_{0} \right)}{g\left( x \right)} \rightarrow 0$ for $\lim_{x \rightarrow a^{+}}{g\left( x \right)} = \infty$, the right side of the equality tends to $\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}$ as $x \rightarrow a^{+}$, which in turn is close to $L$, so $\frac{f\left( x \right)}{g\left( x \right)} \rightarrow L$ as $x \rightarrow a^{+}$, this is what the ∞/∞ case L'Hospital's Rule seeks.

Update:
I will clarify what I mean by the right hand side tends to $\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}$ as $x \rightarrow a^{+}$ using the $\epsilon,\delta$ stuff.
The difference between $\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}$ and the right hand side of the equality is : $|\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)} - \left\lbrack \frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}\left( 1 - \frac{g\left( x_{0} \right)}{g\left( x \right)} \right) + \frac{f\left( x_{0} \right)}{g\left( x \right)} \right\rbrack|$=$\ |\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)} \times \frac{g\left( x_{0} \right) - f\left( x_{0} \right)}{g\left( x \right)}|$.
Since $\lim_{x \rightarrow a}{g\left( x \right)} = \infty$,for every $\epsilon_{3} > 0$, there is a $\delta_{3} > 0$ such that $|\frac{g\left( x_{0} \right) - f\left( x_{0} \right)}{g\left( x \right)}| < \varepsilon_{3}$ where ${x\epsilon(a,a + \delta}_{3})$.
Since $\lim_{x \rightarrow a}\frac{f^{'}(x)}{g^{'}\left( x \right)} = L$, for every $\epsilon_{1} > 0$, there is a $\delta_{1} > 0$ such that $L - \epsilon_{1} < \frac{f^{'}\left( x \right)}{g^{'}\left( x \right)} < {L + \epsilon}_{1}$ where ${x\epsilon(a,a + \delta}_{1})$, then $|\frac{f^{'}\left( x \right)}{g^{'}\left( x \right)}| < {|L| + \epsilon}_{1}$. In order to ensure $\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}$ also satisfy the inequality, one can choose $x_{0} = a + \delta_{1}$ so that $c$ of $\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}$ within ${(a,a + \delta}_{1})$. Therefore,
$$|\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)} \times \frac{g\left( x_{0} \right) - f\left( x_{0} \right)}{g\left( x \right)}| < |\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}| \times \varepsilon_{3} < ({\left| L \right| + \epsilon}_{1}) \times \varepsilon_{3}$$
Because $\varepsilon_{3}$ can be chosen arbitrarily small, which in turn can make $({\left| L \right| + \epsilon}_{1}) \times \varepsilon_{3}$ arbitrarily small as well, this is what I mean by the right hand side tends to $\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}$ as $x \rightarrow a^{+}$, it is equivalent to say $\frac{f\left( x \right)}{g\left( x \right)} = \frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}\left( 1 - \frac{g\left( x_{0} \right)}{g\left( x \right)} \right) + \frac{f\left( x_{0} \right)}{g\left( x \right)}$ is close to $\frac{f^{'}\left( c \right)}{g^{'}\left( c \right)}$ as $x \rightarrow a^{+}$, so both share the same limit.

A: As to your second question which you haven't found a solution for, note that $\frac{f(x)}{g(x)}$ equals $\frac{f(y)}{g(x)}+\frac{f'(\zeta(y))}{g'(\zeta(y))}(1-\frac{g(y)}{g(x)})$ for every $y$, so you can make $y$ approach any quantity in the right side of this equality without affecting the left side.

A: Fix a sequence $x_n\to a^+$.

*

*Under $1^o$, note that for fixed $x>a$, we have $\frac{f(y)}{g(x)}\to 0$ and $\frac{g(y)}{g(x)}\to 0$ as $y\to a^+$. Thus for our given $x_n$, we can find $y_n$ such that $a<y_n<x_n$ and $\left|\frac{f(y_n)}{g(x_n)}\right|<\frac1n$ and $\left|\frac{g(y_n)}{g(x_n)}\right|<\frac1n$.

*Under condition $2^o$, for fixed $y>a$, we have $\frac{f(y)}{g(x)}\to 0$ and $\frac{g(y)}{g(x)}\to 0$ as $x\to a^+$. Let $z_n:=a+\frac{b-a}n$. Then there exists $\delta_n>0$ such that and $\left|\frac{f(z_n)}{g(x)}\right|<\frac1n$ and $\left|\frac{g(z_n)}{g(x)}\right|<\frac1n$ for all $x\in \left]a,a+\delta_n\right[$.
We may assume wlog that $\delta_n\to 0$.
Now for our given $x_n>a$ let $N(n)$ be maximal such that $x_n<a+\delta_{N(n)}$.
Then $x_n\to a$ guarantees $N(n)\to +\infty$. Let $y_n=z_{N(n))}$.
Then clearly $a<x_n<y_n$ and $y_n\to $a$.
Thus in both cases we obtain a sequence $y_n\to a^+$ such that $a<x_n< y_n$ for all $n$ and $\frac{f(y_n)}{g(x_n)}\to 0$ and $\frac{g(y_n)}{g(x_n)}\to 0$. With the accordingly found sequence $\xi_n$, we have $\xi_n\to a$ and hence
$$ \frac{f(x_n)}{g(x_n)}=\frac{f(y_n)}{g(x_n)}+\frac{f(\xi_n)}{g(\xi_n)}\left(1-\frac{g(y_n)}{g(x_n)}\right)\to A.$$
(This is true even if $A$ is infinite).
As $x_n$ was an arbitrary sequence with $x_n\to a$, we conclude
$$ \frac{f(x)}{g(x)}\to A.$$

A: Here is one way to prove the second part of L'Hospital's Rule which deals with the form "$\text{anything} /\infty $".
Let $\epsilon >0$ be arbitrary and then we choose a $\delta_1>0$ such that $$L-\epsilon<\frac{f'(x)} {g'(x)} <L+\epsilon\tag{1}$$ whenever $a<x<a+\delta_1$. Next choose a fixed number $x_0\in(a,a+\delta_1)$ and then we have the identity $$\frac{f(x)} {g(x)} =\frac{f'(c_x)} {g'(c_x)} \left(1-\frac{g(x_0)}{g(x)}\right)+\frac{f(x_0)}{g(x)}\tag{2}$$ for all $x$ with $a<x<x_0$ and some $c_x\in(x, x_0)$.
Since $g(x_0)/g(x)\to 0$ as $x\to a^+$ we can find another $\delta_2>0$ such that $$\left|\frac{g(x_0)}{g(x)}\right|<1\tag{3}$$ whenever $a<x<a+\delta_2$. Let $$\delta=\min(x_0-a,\delta_2)$$ and then we have the inequality $$(L-\epsilon) \left(1-\frac{g(x_0)}{g(x)}\right)+\frac{f(x_0)}{g(x)} <\frac{f(x)} {g(x)} < (L+\epsilon) \left(1-\frac{g(x_0)}{g(x)}\right)+\frac{f(x_0)}{g(x)}$$ whenever $a<x<a+\delta$ using $(1),(2),(3)$.
Now taking limits as $x\to a^+$ we get $$L-\epsilon\leq\liminf_{x\to a^+} \frac{f(x)} {g(x)} \leq\limsup_{x\to a^+} \frac{f(x)} {g(x)} \leq L+\epsilon$$ Since $\epsilon $ is arbitrary it follows that $f(x) /g(x) \to L$ as $x\to a^+$.
Note that $x_0$ is fixed in above proof and the variable $c_x$ lying in $(x, x_0)$ does not necessarily tend to $a$ as $x\to a^+$. Hence we can't the predict the limiting behavior of ratio $f'(c_x) /g'(c_x) $. But we know that this ratio lies between $L-\epsilon $ and $L+\epsilon$ and that is sufficient to predict the limiting behavior of $f/g$.
The same proof works with minor modifications if $L=\infty$ or $L=-\infty$.


text:
Q: Can't boot on windows 10, Windows Boot manager entry has disappeared from UEFI After trying to install Qubes unsuccessfully I rebooted my computer and my boot entries were gone. Before I had grub and Windows Boot that I could boot on from the UEFI boot menu.
So I go to the windows command line from the installation CD and type bootrec /rebuildbcd or /scanos it says that 0 windows installations have been detected. However the windows partition is still accessible and seems fine by all means, the windows folder is still there...
Other threads on this problem refer to things to do inside C:\boot but I don't have such a folder and thoses threads are on Windows 7 or Vista so does anyone have an idea on what I have to do ? Is there an equivalent of C:\Boot for windows 10 ? How do I restore the windows 10 boot ?

A: bcdboot.exe can help creating/fixing boot files.
You boot installation/repair DVD/USB the UEFI way (eventually disable CSM so you cannot boot non UEFI media).
Boot files for EFI/UEFI are on EFI System Partition on GPT style disks. Exact path for Windows - \EFI\Microsoft\Boot (and \EFI\Boot - fallback).
Select repair and open command console:
bcdboot C:\windows /s S:

where C: drive is mapped to Windows partition and S: drive is mapped to EFI System partition (ESP).
For mapping ESP you can use diskpart.exe or mountvol.exe. With diskpart, you can see what the drive letter mappings are using list volume.
Note: keep CSM (BIOS emulation) disabled unless you have to do something special so firmware allows boot only to UEFI media or GPT disk.

A: as root edit
/boot/grub2/grub.cfg

add this to the very end
insert this in the 40_custom section:
menuentry "Windows" {
insmod part_msdos
insmod ntfs
set root='hd0,msdos1'
chainloader +1
}


text:
Q: Express non-linear algebraic equation in terms of variable $\nu$ I have the following equation that I would like write explicitly in terms of $\nu$,
$$\frac{8\epsilon\gamma^2}{A(8\epsilon\gamma^2)-\nu^2}\left[\lambda-\frac{\beta\nu}{2\gamma}E_1+\frac{\beta\nu^2}{8\epsilon\gamma^2}E_2\right]-\left(\frac{2\beta\epsilon\gamma\nu}{A(8\epsilon\gamma^2)-\nu^2}E_3+\frac{\beta\nu^2}{8\epsilon\gamma^2}E_4\right)^2 = 0,$$
where $\epsilon,\gamma,\lambda,E_1,E_2,E_3$ and $E_4$ are constants. Is there any way one can do this? Advise on close approximations or simplification techniques will also be very much appreciated.


text:
Q: print the selected area in a web page of laravel through javascript or css i have a page of reporting which contents navs headers and footers now i want to print the table and 4 fields which i put in a same div named printme

                        Type
                            <select class="form-control" name="report_type" id="report_type">
                                <option value="">Report Type</option>
                                <option value="product wise">Product Wise</option>
                                <option value="salesman wise">Salesman Wise</option>
                                <option value="orderbooker wise">OrderBooker Wise</option>
                                <option value="vendor wise">Vendor Wise</option>
                                <option value="client wise">Client Wise</option>

                            </select>

                        Resource Name
                            <select class="form-control" name="resource_name" id="resource_name">
                                <option value="">Name
                                </option>
                            </select>

                        From Date
                        <input class="form-control" type="date" placeholder="From Date" name="from_date" id="from_date" /required>

                        To Date
                        <input class="form-control" type="date" placeholder="To Date" name="to_date" id="to_date" /required>

its javascript code is here
function printDiv(divName){
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;

document.body.innerHTML = printContents;

window.print();

document.body.innerHTML = originalContents;

}
this function triggers on a button but doing with this method it erases the data of four fields at the top
<button class="btn btn-sm btn-danger" onclick="printDiv('printme')"> Print Report</button>

i only want the print of Report Type
Resource Name
from Date
To date[full page
also tried this through CSS but is not working
#printme {
display: none;
}
@media print {
.no-printme  {
    display: none;
}
 #printme  {
    display: block;
}

}
anyone please help to print the table and four fields at the top in a page

A: just come to a solution that laravel has its on style.css file in view/css go there and find @media print you will get
@media print {
 .d-print-none {
display: none !important;}
 .d-print-inline {
display: inline !important;}

 .d-print-inline-block {
display: inline-block !important;}

 .d-print-block {
display: block !important;}

 .d-print-table {
display: table !important;}

 .d-print-table-row {
display: table-row !important;}

 .d-print-table-cell {
display: table-cell !important;}

 .d-print-flex
display: -ms-flexbox !important;
display: flex !important; }

 .d-print-inline-flex {
display: -ms-inline-flexbox !important;
display: inline-flex !important;}}

now hide the elements by using class ="d-print-none" in tag attributes and you are done
other d-print options are also available for display in print you can try it


text:
Q: VS2017 C++ debugger skipping lines of code I did a quick search and found nothing similar to this question. Maybe I don't know how to search for this one, sorry.
I recently moved to VS2017 (community version) from VS2015. I'm involved in a project where I develop in C++. Sometimes I need to debug, as usual.
I noticed the debugger on VS2017 doesn't work as it did on 2015 version. I don't know if it's a configuration problem.
The problem is that Step over, Step Into, Step Out don't work the expected way (execute a code line and move to the next one/etc).
I uploaded here a screenshot of the debugger behaviour:
https://imgur.com/a/FZSMFSJ
Just pressing F10 (Step Over), the debugger moves that way (line 222->239->242->244->248->244->248->254), skipping code lines in between, even moving forwards and backwards.
As it is seen in the other images, the breakpoint works alright, and there are 2 types of "debug line indicators", with different message.
How can I set the VS options to get the wanted debug?


text:
Q: C++ мин. и макс. элемент массива за один проход нужно массив из 12 чисел заполнить с клавиатуры и за один проход найти максимальный и минимальный элемент в нем. написал код но не понимаю почему не работает. подскажите пожалуйста
#include <iostream>
using namespace std;

int main()
{
    int arr[12], min, max;
    for (int i = 0; i < 12; i++) {
        cin >> arr[i];
    }
    do {
        min = arr[0];
        max = arr[0];
    } while (0);
    for (int k = 1; k < 12; k++) {
        if (arr[k] > max) {
            max = arr[k];
        }
        else if (arr[k] < min) {
            min = arr[k];
        }
    cout << "max is: " << max << " " << "min is: " << min;
    return 0;
        }
}

A: Попробуйте так:
#include <iostream>
using namespace std;

int main()
{
    int a, min, max;
    cin >> a;
    min = max = a;
    for (int i = 1; i < 12; i++) {
        cin >> a;
        if (min > a) min = a;
        if (max < a) max = a;
    }
    cout << "max is: " << max << " " << "min is: " << min;
}

Если ну никак без массива -
#include <iostream>
using namespace std;

int main()
{
    int a[12], min, max;
    cin >> a[0];
    min = max = a[0];
    for (int i = 1; i < 12; i++) {
        cin >> a[i];
        if (min > a[i]) min = a[i];
        if (max < a[i]) max = a[i];
    }
    cout << "max is: " << max << " " << "min is: " << min;
}

Update
Кстати, у вас для исправления ситуации было достаточно заменить
cout << "max is: " << max << " " << "min is: " << min;
return 0;
    }

на
    }
cout << "max is: " << max << " " << "min is: " << min;
return 0;

Все после этого работает :)

A: У вас так же не присвоено значение max и min. В некоторых случаях может найти неправильный максимум или минимум. Нужно для максимального элемента устанавливать то значение, которого не может быть. Например для массива из положительных чисел. max должен быть равен -1 к примеру. А min должен быть равен числу которое будет всегда больше любого. Например макс. число массива 1000. min должен быть 1001.


text:
Q: Swift 3 - Como redimensionar UITableView automaticamente Como redimensionar automaticamente um UITableView de acordo com a quantidade de conteúdo no mesmo?
Quero fazer algo como o que dá pra fazer com um UiTextView:
MyTextView.sizeToFit()

A: Voce precisa pegar a altura da celula, pedir pro array que voce usa como dataSource o count e entao setar o tamanho no frame, segue uma ideia:
var tamanhoCell = tableView.rowHeight
var count = seuArray.count
tableView.frame = CGRectMake(tableView.frame.origin.x, tableView.frame.origin.y, tableView.frame.size.width, tamanhoCell * count);

Ainda acho que sua pergunta nao faz muito sentido, porque o TableView foi feito pra acomodar os itens ali dentro sem aumentar sua altura, mas boa sorte!

A: Simples, basta inserir este código no seu viewDidLoad:
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 76

Na primeira linha, ele vai dimensionar automaticamente.
Na segunda, você estima a altura mais utilizada. Na teoria, você precisa somente da primeira, mas eu recomendo utilizar as duas.
Abraços.


text:
Q: Android Multiple dex files define Lcom/google/android/gms/common/api/zza Building project and deploying app to the emulator with API level 22 or 25 goes ok, but when i try to build APK or deploy app to my real device with API level 16 i get the following error:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/common/api/zza;

My project build.gradle file:
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta4'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

My app build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        applicationId "<aplication id here>"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

}

dependencies {

    final SUPPORT_LIBRARY_VERSION = '25.0.1'
    final DAGGER_VERSION = '2.4'
    final BUTTERKNIFE_VERSION = '8.0.1'
    final TIMBER_VERISON = '4.3.0'
    final LEAKCANARY_VERSION = '1.4'
    final FIREBASE_VERSION = '10.0.0'
    final FIREBASE_UI_VERSION = '1.0.0'

    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
    compile "com.android.support:support-vector-drawable:$SUPPORT_LIBRARY_VERSION"

    compile "com.google.dagger:dagger:$DAGGER_VERSION"
    apt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"

    compile "com.google.firebase:firebase-database:$FIREBASE_VERSION"
    compile "com.firebaseui:firebase-ui-database:$FIREBASE_UI_VERSION"

    compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
    apt "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"

    compile "com.jakewharton.timber:timber:$TIMBER_VERISON"

    debugCompile "com.squareup.leakcanary:leakcanary-android:$LEAKCANARY_VERSION"

    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    testCompile 'junit:junit:4.12'
}

Note: if i add the "multiDexEnabled true" line to my defaultConfig i'll get the following error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/common/api/zza.class

A: Move this:
apply plugin: 'com.google.gms.google-services'

to the bottom of your app/build.gradle file.

A: Although I had the same error but the above solution did not work for me. I managed to solve the error by downgrading my firebase-ui library version from 2.0.0 to 1.2.0 and added the following to Project level build.gradle file:
allprojects {
    repositories {
        jcenter()

        // Add the following
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
}

A: for me, I just update firebase library to the newest version and it just worked

A: This probably doesn't apply to the original question, but in case it helps someone else. I ran into this error with my ionic v1 project. I don't use firebase, but I did fix it with this answer (easy fix for me - standardize all google service versions to be the same in android/project.properties)


text:
Q: Getting Mobile Number through Https request in GPRS Generally when we are using GPRS connection , the request will be sent to appropriate host as a http(s) request .  In receiving side ( PHP ) , we are able to get the IP address using $_SERVER or $_REQUEST variable  . Like that is there any way to get the mobile number that  means from which mobile number request being given. Can any one help me out of this problem....
Thanks

A: No you cannot get the mobile number. Http does not know about the GSM client that is your mobile phone. Even the mobile does not have an IP, the IP you're getting is the IP of the GPRS gateway of the telecom service provider of the mobile SIM card.
Only way out is to prompt the user to input his mobile number and trust the user for he has given correct mobile number and get that mobile number from Http-GET or Http-POST at your server-side.

A: Nope. You cant get any phone number information of any 3G or GPRS device. Cellular service provides not gives this data.

A: If you have the possibility to open a WAP page, you might get the MSISDN since it is included in the request header per default.

A: It is possible, but there's no global standard, each operator uses their own standard depending on different things (software used, whitelists etc).
See this answer for more details:
Can a mobile web application access the devices phone number?


text:
Q: Documentation for options to lucidabr package In postings related to the lucidabr package (like here) one sometimes sees options like expert, nofontinfo, lucidascale, and so on.  I tried to find documentation for them, but didn't succeed so far.  Where can I find a list of all options together with their meaning?

A: The "manual" that comes from lucidabr.sty is indeed not very detailed.
Reading the package code, we identify the options
expert noexpert
nolucidascale lucidascale lucidasmallscale
mathitalic1 mathitalic2 mathitalic3
slantedgreek uprightgreek vargreek
noamssymbols
OT1 T1 LY1
seriftt
fax casual calligraphic handwriting
altbullet
errorshow warningshow nofontinfo

and the default options are
noexpert,lucidascale,slantedgreek,mathitalic1,errorshow

Let's examine the various groups.
expert noexpert
The former relies on the full set of Lucida Bright fonts available and defines some more math fonts, namely mathupright for using different upright letters in math, instead of the standard text ones. It also assigns more fonts to the bold math version.
nolucidascale lucidascale lucidasmallscale
With the nolucidascale option the fonts are simply scaled at the stated font size; with lucidascale the scaling is adjusted to emulate "optical" scaling; for instance at 10pt the font will be scaled at 95% of what would be the normal size, but at 11pt the scaling will be 94%, down to 89% for fonts above 22.5pt. With lucidasmallscale the percentages are lower.
mathitalic1 mathitalic2 mathitalic3
The first option uses it shape for math letters; the second one uses itx so some letters will be slightly different. With mathitalic3, math letters will be upright.
slantedgreek uprightgreek vargreek
The first two are self-explaining: uppercase Greek letters in math will be either slanted or upright. Note that uprightgreek needs expert. The vargreek option defines \up<letter> and \var<Letter> for Greek letters.
noamssymbols
This option doesn't load the Lucida version of the symbols provided by amssymb.
OT1 T1 LY1
These options choose the requested encoding for the operators math font.
seriftt
This option sets a different font for typewriter type than the default.
fax casual calligraphic handwriting
These options are for the text fonts. The first two choose a different family for the text fonts, the last two act on the italic fonts.
altbullet
This uses the Computer Modern bullet, rather than the Lucida version
errorshow warningshow nofontinfo
These are for debugging font usage.

A: They are deducible, I wouldn't exactly say documented, from the package documentation lucidabr.pdf available from
https://ctan.org/tex-archive/macros/latex/contrib/psnfssx/lucidabr
which says

The new Expert set for bold math

At least in its original distributions the fonts were available in two sets, a basic set and at extra cost an "expert" set that included fonts for bold math.
So the expert option configures latex \boldmath to use the optional fonts.
The lucidascale option is

Set up the variant text and math sizes which Y&Y suggest for Lucida. The figures for these two options actually come from Frank Mittelbach (oh great one). The default is to scale, but two options allow you to revert to normal behaviour, or get even smaller

A: You have the alternative of using the OpenType versions of the fonts in unicode-math.
It's possible to download additional fonts similar to expert, including handwriting and calligraphy, from Lucida Fonts.
You can get a different upright alphabet from the text letters by loading it with \setmathfont[range=up]{...}.  Then, \symup will get you upright math letters and \mathrm the default text font.  I sometimes use this to load Upright Italic fonts for upright math, or Hermann Zapf's Euler as an upright companion for Palatino/Asana/Pagella.
The options like lucidascale are replaced by the Scale= font option.  I normally set Scale=Lowercase as the default and load the main font at Scale=1.0, so it appears at its natural size and all fonts are scaled to the same x-height.
The mathitalic1 and mathitalic2 options would be replaced by \setmathfont[range=it]{...} and using \symit.  As with \mathrm, \mathit gibes you the default text font.
The \mathitalic3 option is equivalent to \usepackage[math-style=upright]{unicode-math}.  The slantedgreek option is equivalent to \usepackage[math-style=ISO]{unicode-math}.
The \seriftt option is equivalent to loading a different font with \setmonofont.
The altbullet option would be something like \setmathfont[range=\bullet]{Latin Modern Math}.
There are no equivalents to selecting an 8-bit font encoding: you will be using Unicode.  There is also no equivalent for noamssymbols, because the limit on the number of math alphabets is gone.
Unfortunately, selecting \setmathfont with a range= is incompatible with selecting a version=, as of Unicode-Math 0.8q, and you need \setmathfont[version=bold]{LucidaBrightMathOT-Demi.otf} to use \boldmath or \boldsymbol.


text:
Q: URL parameter validation in R Shiny? I'm trying to figure out how to validate input parameters passed through URL for a Shiny app, to prevent malicious inputs. I'm not sure if Shiny's built-in enableBookmarking function already takes care of this, however; if you type in an invalid parameter, it resets that input to the default.
1) Is this sufficient, security-wise?
2) If not, what might be a good way to fix it? I'm thinking requiring that a given input matches a drop-down list option (i.e. input$date %in% dateoptions) but I'm not sure where to put that within the app.
Here's a simple Shiny app with URL bookmarking:
dateoptions <- c("July 11 2016" = "07112016",
                 "July 14 2016" = "07142016",
                 "July 17 2016" = "07172016")
variableoptions <- c("GPS Altitude" = "GPS_ALT",
                     "Temperature" = "TEMPERATURE",
                     "Carbon dioxide" = "CO2")

ui <- function(request) {
  fluidPage(
    selectInput('date', 'Choose date:',
                dateoptions),
    selectInput('variable', 'Choose variable:',
                variableoptions),
    uiOutput("message")
  )
}

server <- function(input, output, session) {

output$message <- renderUI(print(paste("The URL reflects your selection of", input$date, "and", input$variable)))

observe({
  reactiveValuesToList(input)
  session$doBookmark()
})

onBookmarked(function(url) {
  updateQueryString(url)
})
}

shinyApp(ui, server, enableBookmarking = "url")

Thanks in advance for any help.


text:
Q: suppress list elements that have already been encountered Hi I have a velocity template that I am trying to edit
it currently has a block that looks like
#foreach( $element in $myList )
  $element.field1 ($element.field2) issued by $element.field ($element.field4 )

#end

the problem is some elements in the list are duplicated and I need to suppress the duplicates.
psuedo code for what I want is
for each element in list
    if element is not in displayed
        display element
        add element to displayed
    endif
endfor

can someone point me in the right direction?

A: This kind of logic (de-duplication) is probably something to be avoided in your view (Velocity) layer.  Following Model-View-Controller, it would be better to have this logic managed by controller classes, leaving the Velocity template to simply render the data structure it is passed.
For example, by using a data structure such as a java.util.Set, duplicates would not be admitted and so there would be no need for the template to de-duplicate.
Personally I found Rob Harrop's Pro Jakarta Velocity a really good guide to MVC, especially Chapter 4 "Using Velocity in an MVC environment".
Have the model use a Set, have your controller code populate the set, and then the simple loop in your template code can be used as it is now.
In general, the less logic you implement in your view layer, the better.  It will also make your code easier to test, so you can verify its behaviour without having to fire up the presentation components, app servers etc etc.
If there really is no choice and the logic absolutely must be written in the template, then the following implements the psuedocode presented:
#set($displayed = [])
#foreach( $element in $myList )
  #if(!$displayed.contains($element))
    $element.field1 ($element.field2) issued by $element.field ($element.field4 )

    #set($ignore = $displayed.add($element))
  #end
#end

Note the messiness with #set($ignore = $displayed.add($element)) - this has to be done to suppress the output from java.util.List's add() method (boolean) from being output.  Another reason not to write this in template code!
Of course, you would also need to make sure that equals() is correctly implemented on the type added to the list so that the List operations - contains() and add() work correctly.
Definitely an inferior solution to the MVC approach above, but presented as an option of last resort.


text:
Q: Show that $\int_{0}^{\infty}\frac{1}{\left(x!\right)!}dx>2$ Problem :
Show that :
$$\int_{0}^{\infty}\frac{1}{\left(x!\right)!}dx>2$$
I have tried to apply twice the Stirling formula without success .As other remarks the crucial part is for $x\in[0,3]$.
For the Craft work I have tried to show the inequality for $x\in[0,1]$ :
$$x^{-0.1375x^{1.25}}\leq \frac{1}{\left(x!\right)!}$$
But I cannot find a path for the rest of the crucial interval .
As other attempt the function in the integral seems to be concave on $[0,2]$ wich allows us to a linear approximation but how to show it I haven't the skills for that .
Disgression :
We have also :
$$\int_{0}^{\infty}\left(x^{-x}+\frac{1}{\left(x!\right)!}\right)dx<4$$
So how to show it properly ?

A: Just an idea
Consider
$$I=\int_{a-\epsilon}^{a+\epsilon}\frac{dx}{\left(x!\right)!}$$ Expand the integrand as a series around $x=a$ to $O\left((x-a)^3\right)$
This would give
$$\frac{3 \,\Gamma (1+\Gamma (a+1))\,I- 6\epsilon}{\Gamma(a+1)\,\epsilon ^3}=$$
$$\psi ^{(0)}(a+1)^2 \left(-H_{\Gamma (a+1)}+\Gamma (a+1) \psi ^{(0)}(\Gamma
   (a+1)+1)^2-a \Gamma (a) \psi ^{(1)}(\Gamma (a+1)+1)+\gamma \right)-\psi
   ^{(1)}(a+1) \psi ^{(0)}(\Gamma (a+1)+1)$$
Trying for $a=\frac 1 {10}$, $\epsilon=\frac 1{100}$ this gives
$\color{red}{0.020399654}215$ while numerical integration gives
$\color{red}{0.020399654197}$
Using instead the simplest $[1,1]$ Padé approximant, for the same conditions, it would give
$\color{red}{0.0203996541}54$


text:
Q: Best way to share a single class dependency in Java I often make many Java projects to deal with parsing and string manipulation. Since the native String class from Java is a bit limited for these cases, I always end up creating an utility class to manipulate Strings.
However, copying and pasting the same (or almost the same) class in every project is a hassle. So I'm planning to make a single version of this and share as a dependency between projects. The only way to do this that I know of is versioning a maven project in git and importing it as a jar in other maven projects. But is there a simpler solution?
Creating a separate repository and packaging a single class into a jar seems a bit of an overhead. Plus, some simple non-maven projects would have to create a pom.xml just to download this class. So I wonder, is there any other tool to share simple dependencies for small projects? What is the best way to handle this situation?


text:
Q: Where does Glassfish 2.1 stores cached JSP? I'm looking for some information I haven't found anywhere else, as title says: I cannot find where glassfish is storing JSP pages upon runtime compilation, I already looked in the following directories:

*

*WEB-INF/jsp under my deployed EAR, doesn't exist

*domain1/generated/jsp/j2ee-apps/etc etc has no .java files

*I made a search in the whole glassfish folder and I didn't find any .java files related to JSPs...

Any other hint?
Do I have to setup Glassfish in some way? Setup some properties? (I set jspCachingEnabled=true in the web-container only)
Thanks in advance.

A: GlassFish does not keep the generated java sources for a jsp after they have been compiled by default.  You can change that by adding the following snippet into your sun-web.xml file...
  <jsp-config>
    <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java code.</description>
    </property>

If your jsp (mypage.jsp) is in a war file (mywebapp.war), then the java file will be under
%GLASSFISH_HOME%\domains\domain1\generated\jsp\j2ee-modules\mywebapp_war\org\apache\jsp\mypage_jsp.java

If your jsp (mypage.jsp) is in a war file (mywebapp.war) that is part of an EAR (myentapp.ear) then the java file will be under
%GLASSFISH_HOME%\domains\domain1\generated\jsp\j2ee-apps\myentapp\mywebapp_war\org\apache\jsp\mypage_jsp.java


text:
Q: SSIS connection to Dynamics CRM Online via the TDS endpoint The Dynamics CRM (online) instance has the TDS endpoint enabled (both port 1433 and 5558), I can connect to it and execute SQL commands from SSMS.
Now I'm trying to connect to it from SSIS following the instructions from Kingswaysoft. I get this error when creating an ADO.Net connection from SSIS:

Test connection failed because of an error in initializing provider.
One or more errors occurred.

I noticed that when connecting succesfully from SSMS I'm using Azure Active Directory - Universal with MFA authentication, but in SSIS only Azure Active Directory - Password is available. When trying to connect with AAD-Password in SSMS I get:

Cannot connect to xyz.crm3.dynamics.com.  ADSTS53001: Device is not in
required device state: domain_joined.  Conditional Access policy
requires a domain joined device, and the device is not domain joined.

My understanding is that the AAD-Universal authentication requires interactive login and AAD-Password is non-interactive. So it makes sense that SSIS only offers AAD-Password, as the packages are mostly executed unattended.
All our users are currently set for MFA. Is there any way to still use the TDS endpoint with SSIS?

A: There is no other way available. As per the error, there is a conditional access policy which is allowing the connection form domain joined machine with MFA enabled.
May be you can check with admin to give permissions for one user to connect without MFA or conditional access policy and see if that works(AAD-Password).


text:
Q: Flex modulleader url, why cant it just look at the root? We are using pureMVC multicore as the flex Framework,
When we need to load a module we use the first line "moduleEval.swf";.
It works well in local for testing.
But not on the production server which is obvioulsy online, in which case i need to put he full URL.
Is that normal ?
 moduleLoader.url = "moduleEval.swf";
//moduleLoader.url = "http://www.foobar.com/site_media/mymodule.swf";

Thanks,
Greg

A: I almost always use absolute urls, without the site name. The URL base directory is wherever your root application is. So if you load a module within another app, and that module loads another or something, any relative urls are relative to the base app.
moduleLoader.url = "/site_media/moduleEval.swf";


text:
Q: Creating a set of views takes a long time (Appcelerator) and blocks user interactions on iOS only I am creating a list (ScrollView) with some custom "rows" (The image contains a single "row"). I show 5 rows and have added an event listener so that when the user scrolls to the end, 5 more elements are loaded and displayed. I made this using Alloy but I noticed it was taking too long so I tried writing the views manually.

// created the views programmatically to see if there was any difference from Alloy

function createRow(args) {
 var container = Ti.UI.createView({
  layout: "vertical",
  width: Ti.UI.FILL,
  height: "42dp"
 });
 var rowContent = Ti.UI.createView({
  width: Titanium.UI.FILL,
  height: "41dp", //Titanium.UI.FILL,
  layout: "horizontal",
  left: "16dp",
  right: "16dp"
 });
 var border = Ti.UI.createView({
  left: "16dp",
  right: "16dp",
  height: "1dp",
  backgroundColor: Colors.darkGrey
 });

 var titleScroll = Ti.UI.createScrollView({
  scrollType: "horizontal",
  width: "49%",
  horizontalWrap: false
 });
 var scrollContainer = Ti.UI.createScrollView({
  scrollType: "horizontal",
  horizontalWrap: false,
  width: "50%"
 });
 var scroll = Ti.UI.createView({
  layout: "horizontal",
  horizontalWrap: false,
  right: 0,
  width: Ti.UI.SIZE,
  height: Titanium.UI.SIZE
 });
 var title = Ti.UI.createLabel({
  text: args.title,
  font: args.isTitle ? {font: "Lato-Regular", fontSize: "22dp"} : {fontFamily: "Lato-Regular", fontSize: "15"},
  horizontalWrap: false,
  wordWrap: false,
  left: 0,
  color: Colors.grey,
  minimumFontSize: "15dp"
 });
 if(args.value) {
  var t = args.value.join();

  scroll.add(Ti.UI.createLabel({
   text: t,
   color: args.action ? Colors.blue : Colors.black,
   font: {fontSize: "15dp", fontFamily: "Lato-Regular"},
   right: "5dp",
   width: Ti.UI.SIZE,
   horizontalWrap: false,
   wordWrap: false,
   minimumFontSize: "15dp"
  }));
 }

 if(args.data)
  scrollContainer.data = args.data; //just a dump of the data used by the click handler

 if(args.action)
  scrollContainer.addEventListener("click",args.action);

 scrollContainer.add(scroll);
 titleScroll.add(title);
 rowContent.add(titleScroll);
 rowContent.add(scrollContainer);
 container.add(rowContent);
 container.add(border);

 return container; //Ti.UI.View
}

function createHeader(args) {
 var header = Ti.UI.createView({
  layout: "horizontal",
  height: "44dp",
  backgroundColor: "#fff"
 });

 var leftView = Ti.UI.createView({
  width: "25%",
  height: Ti.UI.FILL
 });
 var rightView = Ti.UI.createView({
  width: "25%",
  height: Ti.UI.FILL
 });
 var centerView = Ti.UI.createView({
  width: "49%",
  height: Ti.UI.FILL
 });
 var verticalAligner = Ti.UI.createView({
  height: Ti.UI.SIZE,
  width: Ti.UI.SIZE,
  layout: "vertical"
 });
 var headerTitle = Ti.UI.createLabel({
  color: Colors.green,
  font: {fontSize: "16.5dp", fontFamily: "Lato-Regular"},
  textAlign: "center",
  horizontalWrap: false,
  wordWrap: false
 });
 var headerSubtitle = Ti.UI.createLabel({
  font: {fontSize: "14dp", fontFamily: "Lato-Regular"},
  textAlign: "center",
  color: Colors.grey,
  horizontalWrap: false,
  wordWrap: false
 });

 if(args.rightView)
  rightView.add(args.rightView);
 if(args.leftView)
  leftView.add(args.leftView);

 verticalAligner.add(headerTitle);
 verticalAligner.add(headerSubtitle);
 centerView.add(verticalAligner);
 header.add(leftView);
 header.add(centerView);
 header.add(rightView);

 headerTitle.text = args.title;
 headerSubtitle.text = args.subTitle;

 return header;
}

function createBlock(args) {
 var container = Ti.UI.createView({
  layout: "vertical",
  width: "100%",
  height: Ti.UI.SIZE
 });
 var covers = Ti.UI.createView({ //
  height: "119dp"
 });
 var content = Ti.UI.createView({
  height: Ti.UI.SIZE,
  layout: "vertical"
 });
 function goToEvent() {
  Storage.event.id = args.event;
  Alloy.Globals.openWin("event");
 }

 var data = new D.data();
 var w = Android ? Ti.Platform.displayCaps.platformWidth :  Measure.dpToPX(Ti.Platform.displayCaps.platformWidth);
 var h = Measure.dpToPX(119); //Android ? Alloy.Globals.dpToPX(119) : Measure.dpToPX(119);
 if(args.images) {
  //setTimeout(function() { //timeout didn't make any difference
   var image = null;
   //for(var i = 0; i < args.images.length; i++) {
    image = Ti.UI.createImageView({
     image: data.getBlobResized({ //returns a URL for the picture
      id: args.images[0], //i
      width: w,
      height: h
     }),
     width: iOS ? Measure.pxToDP(w) : Alloy.Globals.pxToDP(w),
     height: iOS ? Measure.pxToDP(h): Alloy.Globals.pxToDP(h)
    });
    image.addEventListener("click",goToEvent);
    covers.add(image); //addView
   //}
  //},0);
 }

 var row = null;

 if(args.rows) {
  for(var j=0; j < args.rows.length; j++) {
   //row = Alloy.createController("index/events/block/row",args.rows[j]).getView();
   content.add(createRow(args.rows[j]));
  }
 }

 container.add(createHeader(args));
 container.add(covers);
 container.add(content);

 return container;
}

In particular, in the code provided, I call 4 times the function createRow() which creates a row inside the element (as seen in the picture). This function takes 7ms to 10ms to run for some reason. So calling it 4 times means it slows the whole process 28-40ms.
On Android the app doesn't lag at all. On iOS it stops user interaction completely until these operations are done

*

*Using latest Titanium SDK (5.2.2GA) on Appcelerator Studio

*Testing on iPhone 5, iOS simulator (4s,5,6,6s)

Thank you for your help