text:
Q: Eigen SIGSEGV while doing make_pair I'm updating ~3yr old code and am crashing trying to make a pair out of Vector2d and Matrix2d. Roughly, the code is
vector<pair<Vector2d, Matrix2d>> list;
list.resize(points.size());
Vector2d md;
Matrix2d Sd;
for(int i=0; i<n; i++) {
    // do stuff to assign elements of md and Sd
    // ...
    list[i] = make_pair(md, Sd); // SIGSEGV on this line
}

I found an old bug that looks similar at the final two levels of the stack but that bug is marked as fixed and I confirmed that the fixes from that patch are still in place. I tried making a simple test case but it runs without issue. Does anyone have an idea what the problem might be?
Misc info:

*

*Arch linux

*gcc 6.1.1

*eigen 3.2.9

Here's the backtrace:
Thread 7 "flightControlle" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd7152700 (LWP 12024)]
0x00000000005e846b in _mm_load_pd (__P=0x0) at /usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/include/emmintrin.h:119
119       return *(__m128d *)__P;
(gdb) bt
#0  0x00000000005e846b in _mm_load_pd (__P=0x0) at /usr/lib/gcc/x86_64-pc-linux-gnu/6.1.1/include/emmintrin.h:119
#1  Eigen::internal::pload<double __vector(2)>(Eigen::internal::unpacket_traits<double __vector(2)>::type const*) (from=0x0) at /usr/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h:220
#2  0x000000000060310b in Eigen::internal::ploadt<double __vector(2), 1>(Eigen::internal::unpacket_traits<double __vector(2)>::type const*) (from=0x0) at /usr/include/eigen3/Eigen/src/Core/GenericPacketMath.h:290
#3  0x0000000000659523 in Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> >::packet<1> (this=0x0, rowId=0, colId=0) at /usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:184
#4  0x00000000006a40fe in Eigen::SwapWrapper<Eigen::Matrix<double, 2, 1, 0, 2, 1> >::copyPacket<Eigen::Matrix<double, 2, 1, 0, 2, 1>, 1, 1> (this=0x7fffd7150a30, rowId=0, colId=0, other=...)
    at /usr/include/eigen3/Eigen/src/Core/Swap.h:100
#5  0x00000000006a1da3 in Eigen::DenseCoeffsBase<Eigen::SwapWrapper<Eigen::Matrix<double, 2, 1, 0, 2, 1> >, 1>::copyPacketByOuterInner<Eigen::Matrix<double, 2, 1, 0, 2, 1>, 1, 1> (this=0x7fffd7150a30, outer=0,
    inner=0, other=...) at /usr/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h:548
#6  0x000000000069fa0e in Eigen::internal::assign_innervec_CompleteUnrolling<Eigen::SwapWrapper<Eigen::Matrix<double, 2, 1, 0, 2, 1> >, Eigen::Matrix<double, 2, 1, 0, 2, 1>, 0, 2>::run (dst=..., src=...)
    at /usr/include/eigen3/Eigen/src/Core/Assign.h:206
#7  0x000000000069d1f7 in Eigen::internal::assign_impl<Eigen::SwapWrapper<Eigen::Matrix<double, 2, 1, 0, 2, 1> >, Eigen::Matrix<double, 2, 1, 0, 2, 1>, 2, 2, 0>::run (dst=..., src=...)
    at /usr/include/eigen3/Eigen/src/Core/Assign.h:342
#8  0x000000000069af38 in Eigen::DenseBase<Eigen::SwapWrapper<Eigen::Matrix<double, 2, 1, 0, 2, 1> > >::lazyAssign<Eigen::Matrix<double, 2, 1, 0, 2, 1> > (this=0x7fffd7150a30, other=...)
    at /usr/include/eigen3/Eigen/src/Core/Assign.h:506
#9  0x000000000069856f in Eigen::DenseBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> >::swap<Eigen::Matrix<double, 2, 1, 0, 2, 1> > (this=0x7fffd7150c90, other=...)
    at /usr/include/eigen3/Eigen/src/Core/DenseBase.h:384
#10 0x000000000069591a in Eigen::internal::matrix_swap_impl<Eigen::Matrix<double, 2, 1, 0, 2, 1>, Eigen::Matrix<double, 2, 1, 0, 2, 1>, false>::run (a=..., b=...)
    at /usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:805
#11 0x0000000000693785 in Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> >::_swap<Eigen::Matrix<double, 2, 1, 0, 2, 1> > (this=0x7fffd7150c90, other=...)
    at /usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:682
#12 0x00000000006923c6 in Eigen::Matrix<double, 2, 1, 0, 2, 1>::swap<Eigen::Matrix<double, 2, 1, 0, 2, 1> > (this=0x7fffd7150c90, other=...) at /usr/include/eigen3/Eigen/src/Core/Matrix.h:334
#13 0x00000000006909f9 in Eigen::Matrix<double, 2, 1, 0, 2, 1>::operator=(Eigen::Matrix<double, 2, 1, 0, 2, 1>&&) (this=0x0,
    other=<unknown type in /home/ryantr/Software/FlightControl/Rover/build/flightController, CU 0x5b3bd1, DIE 0x73ce2f>) at /usr/include/eigen3/Eigen/src/Core/Matrix.h:224
#14 0x000000000068f440 in std::pair<Eigen::Matrix<double, 2, 1, 0, 2, 1>, Eigen::Matrix<double, 2, 2, 0, 2, 2> >::operator=(std::pair<Eigen::Matrix<double, 2, 1, 0, 2, 1>, Eigen::Matrix<double, 2, 2, 0, 2, 2> >&&) (this=0x0, __p=<unknown type in /home/ryantr/Software/FlightControl/Rover/build/flightController, CU 0x5b3bd1, DIE 0x73e9e5>) at /usr/include/c++/6.1.1/bits/stl_pair.h:319
#15 0x000000000068a452 in ICSL::Quadrotor::VelocityEstimator::calcPriorDistributions (mDeltaList=std::vector of length 1, capacity 1 = {...}, SDeltaList=std::vector of length 1, capacity 1 = {...},
    priorDistList=std::vector of length 0, capacity 0, points=std::vector of length 1, capacity 1 = {...}, mv=..., Sv=..., mz=0.050000000000000003, varz=1, focalLength=262.0029296875, dt=0.033000000000000002,
    omega=...) at /home/ryantr/Software/FlightControl/Rover/src/VelocityEstimator.cpp:566

Here's info on the state of md and Sd if that makes a difference:
$1 = {<Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> >> = {<Eigen::MatrixBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> >> = {<Eigen::DenseBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> >> = {<Eigen::internal::special_scalar_op_base<Eigen::Matrix<double, 2, 1, 0, 2, 1>, double, double, Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 1, 0, 2, 1>, 3>, false>> = {<Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 1, 0, 2, 1>, 3>> = {<Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 1, 0, 2, 1>, 1>> = {<Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 1, 0, 2, 1>, 0>> = {<Eigen::EigenBase<Eigen::Matrix<double, 2, 1, 0, 2, 1> >> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, m_storage = {m_data = {array = {-6.5748748779296875,
          -96.418296813964844}}}}, <No data fields>}
(gdb) p Sd
$2 = {<Eigen::PlainObjectBase<Eigen::Matrix<double, 2, 2, 0, 2, 2> >> = {<Eigen::MatrixBase<Eigen::Matrix<double, 2, 2, 0, 2, 2> >> = {<Eigen::DenseBase<Eigen::Matrix<double, 2, 2, 0, 2, 2> >> = {<Eigen::internal::special_scalar_op_base<Eigen::Matrix<double, 2, 2, 0, 2, 2>, double, double, Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 2, 0, 2, 2>, 3>, false>> = {<Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 2, 0, 2, 2>, 3>> = {<Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 2, 0, 2, 2>, 1>> = {<Eigen::DenseCoeffsBase<Eigen::Matrix<double, 2, 2, 0, 2, 2>, 0>> = {<Eigen::EigenBase<Eigen::Matrix<double, 2, 2, 0, 2, 2> >> = {<No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, <No data fields>}, m_storage = {m_data = {array = {8947423.3324944824, 110733.5419973651,
          110733.5419973651, 13614569.654632445}}}}, <No data fields>}

A: This is an alignement issue. See this intro, and in your case this page will give you the solution. In short, either use non-aligned types:
typedef Matrix<double,2,1,DontAlign> Vector2du;
typedef Matrix<double,2,2,DontAlign> Matrix2du;
vector<pair<Vector2du, Matrix2du>> list;

or pass an aligned allocator to std::vector:
vector<pair<Vector2du, Matrix2du>,Eigen::aligned_allocator<pair<Vector2du, Matrix2du>>> list;


text:
Q: Accessing Hive queries from Jenkins I am planning to use Jenkins with Hive. I have created some Hive scripts: test1.hql, test2.hql, test3.hql which lie on the sample server "ssh rt@test1.test2.net" location "/home/rt"
test1.hql:
select id, name from tblA;

test2.hql:
select id, name from tblB;

test3.hql:
select id, name from tblC;

How can I execute it from Jenkins?
On Jenkins up-to below is what I did:
New Job > Job name as test > Build a free-style software project
How can I point to my .hql scripts from Jenkins and what settings do I need to have? I am new to Jenkins.
Any help?
Thanks.

A: Found something:
Create a Jenkins job
In the configuration of that job there is a "Build" section with "Add build step"
Add a "Execute Shell" step, and  put your code.
that code would be basically:
hive -f /pathtohql/test1.hql
The only issue i see with this is that the m/c with jenkins will have to have hive installed and pointing to the correct metastore & cluster.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to modify CONFIG_CPU_TYPE in .config I'm building OpenWrt from source to run in QEMU for a research project. I want to use an x86-64 build since it will be a little easier for my purposes. when I go through the process of downloading and building all is successful except it won't run in qemu as the default CPU type is "pentium4".
As I understand OpenWrt the build configuration is stored in .config. The .config file is created/modified one of three ways:
make menuconfig
make kernel_config
make defconfig
I've used the search option in menuconfig and kernel_config and I see no setting for CONFIG_CPU_TYPE. I manually changed the setting as well as the associated options and get a successful build with target_i386_i486_musl.
I'd rather not modify .config directly if I don't have to. What is the correct way to change this setting?

A: Manually changing/adding parameter in .config won't help, as those parameters are not defined in the framework.
If you want to build it from the source then may be start by selecting
Target System (x86)
Subtarget (x86_64)
Target Profile (Generic)

in make menuconfig. OR
You can directly download the x86 image and use it(external links).


text:
Q: Dropped by every time I click ctrl + F5 When I log into the site I come over to blabla.com/login/
HTML:
<?php
 if(isset($_POST["login"]))
 {
     $logind = $mebe->logind();
 }
 ?>
 <form action="<?php $_SERVER['PHP_SELF'];?>" method="post">

             Brugernavn
             <input type="text" name="brugernavn" maxlength="300">

             Adgangskode
             <input type="password" name="pass">

             <input type="submit" name="login" value="Log ind">

 </form>

PHP: (login function is here:)
function logind()
 {
     if($_POST["brugernavn"] == "")
     {
         $error = 1;
     }
     if($_POST["pass"] == "")
     {
         $error = 1;
     }
     if($error != 1)
     {
         if ($stmt = $this->mysqli->prepare("SELECT id, brugernavn, rank, ranknavn FROM bruger WHERE brugernavn = ? AND adgangskode = ?"))
         {
             $stmt->bind_param('ss', $brugernavn, $adgangskode);
             $brugernavn = $_POST["brugernavn"];
             $adgangskode = sha1($_POST["pass"]);

             $stmt->execute();
             $stmt->store_result();
             $stmt->bind_result($id, $brugernavn, $rank, $ranknavn);
             $stmt->fetch();
             $count = $stmt->num_rows;
             $stmt->close();

             if($count > 0)
             {
                 $_SESSION["logged_in"] = true;
                 $_SESSION["id"] = $id;
                 $_SESSION["brugernavn"] = $brugernavn;
                 $_SESSION["rank"] = $rank;
                 $_SESSION["ranknavn"] = $ranknavn;

                     if($_SESSION["logged_in"] == true and $_SESSION["rank"] >= 1)
                     {
                         ?>

                         <?php
                     }
                     else
                     {
                         echo "Fejl..";
                     }
             }
             else
             {
             ?>

Forkert Brugernavn / Password.

             <?php
             }
         }
         //fejl
         else
         {
             echo 'Der opstod en fejl i erklæringen: ' . $this->mysqli->error;
         }
     }
     else
     {
     ?>

Forkert, Prøv igen!

     <?php
     }
 }

If I use header('Location: /wall/'); then it will be just on the login page and did not show that one is log into the site in some way.
EIDT
it close site - only for users;
<?php
session_start();
include("phpFiler/fun.php");
$mebe = new mebe;
$db = $mebe->db_c();
error_reporting(E_ERROR);
if($_SESSION["logged_in"] == true)
{
?>

and open for alle users
<?php
session_start();
include("phpFiler/fun.php");
$mebe = new mebe;
$db = $mebe->db_c();
error_reporting(E_ERROR);
?>


text:
Q: 1.9 - Incorrect Configurable Product Price I'm using Magento CE 1.9.0.1 and having an issue on a Configurable Product for a Jewellery store - refer image below.
I've set the price for the actual configurable product as the lowest price option of the associated products ($2400). I've then set the fixed price for each associated product for the Super product attribute. However, on the front-end, the price shows as $2400, but then when I Choose an Option from the attribute drop-down, it adds the price of the associated product option to the price of the configurable product, which then ends up being $4800 or $4873!
I then then tried setting the actual configurable product price to $0, but then this shows the product price as $0 in the catalog view and product detail page.
I've come across Simple Configurable Products extension, but this is only compatible up to CE 1.5.
Can anyone please help me out with this confusing dilemma?
EDIT: I am using the Dresscode theme from Themeforest.

A: simple configurable products also works with 1.9.0.1. You should get it on github and apply all patches.
Of course there are also some other paid extensions.

A: Welcome to the wonderful world of configurable product pricing.
If you don't want to install an extension you need to set the configurable product to the price of the base item (75cm @ $2400) and the price of the 85cm option to $73 fixed, which will make it always more $73 more expensive than the 75cm one (and will display (+$73) in the option dropdown with the default theme.
Assuming the simple products are not in the catalog or searchable, the price you set for them is irrelevant.
As Reinsch has said, there are extensions around that will try and work in an easier to use format.


text:
Q: Add CSS to a single column in Sharepoint 2013 Is there any way of targeting a single column in a document library?
I am wanting to apply CSS to just the Name (linked to document with edit menu) column (through a Script Editor or via the Masterpage, I don't mind as it will be needed for all libraries that are created within this site.

A: Based on your previous posts (this post and this post), you display the menu ellipsis (...) for the last column in the view and want to hide the menu ellipsis for the Name (linked to document with edit menu) column.
In this scenario, the menu ellipsis for the Name (linked to document with edit menu) column is the first one. You can use the JavaScript to hide the first menu ellipsis (...) in the view.
Demo:

Use the scripts below on the page:
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("ready");
function ready(){
    var links = document.getElementsByClassName("ms-list-itemLink");
    for (var i=0; i<links.length; i++){
        // there are two link cells
        // get first link for each row
        if (i%2 == 0){
            links[i].style.visibility = "hidden";
        }
    }
}
</script>

Result:

A: Yes, You can do it via JS Link for List View. This tutorial learn SharePoint Templates for Views and for Forms(new/display/edit) very deeply and comprehensive. I strictly advise you to consider full reading of them.


text:
Q: accessing router via telnet lib python I'm working on a code that uses telnetlib of python to connect to a router and execute commands and stores the output in a file.
I'm using read_until('#') function and expecting a Router prompt, then execute the next command but my code freezes when I receive a '--More--' data from the remote telnet side. I tried using a pattern match to find '--More--' but then sometime the --More-- keyword doesn't come at once.
Any suggestion ?
Do I have to send some IAC command to the remote telnet side ?

A:
sometime the --More-- keyword doesn't come at once

Try passing in a timeout.
Example: set timeout to 5 seconds for  read_until():
read_until('--More--', 5)

Alternatively, you could use the expect() function to look for either '#' or '--More--' with a timeout:
expect(['#', '--More--'], 5)


text:
Q: Make layers in the same graph in Python I have three types of data that are equivalent to the monthly total, I need to create a stacked area chart that has a layer of a column chart on top showing the same value per month. I managed to make the two graphs with matplot but it shows me them separately.
data1=[13,17,19,20,23,21,27,25]
data2=[7,6,8,9,8,9,9,9]
data3=[53,45,53,61,59,67,69,68]

mes=["Enero","Febrero","Marzo","Abril","Mayo", "Junio", "Julio", "Agosto"]

# Basic stacked area chart.
pal = ["#b5030f", "#efb810", "#0a497b"]
plt.figure(figsize=(9,7))
plt.stackplot(mes,data3, data2, data1, colors=pal)
plt.legend(loc='upper left')

# Bar plot
plt.figure(figsize=(9,7))
plt.bar(mes,data3,color="#5AAB61")
plt.bar(mes,data2,color="#5AAB61",bottom=np.array(data3))
plt.bar(mes,data1,color="#5AAB61",bottom=np.array(data3)+np.array(data2))

plt.legend(loc="lower left",bbox_to_anchor=(0.8,1.0))
plt.show()


text:
Q: Design Patterns, Multiple Inheritance This might be c# basics 101, but I just thought if I don't ask I'll never know, and be doomed to write badly structured code... (the project will be in MVC, so my controllers will need to inherit from the controller class too)
Anyhow. I'd like to structure my code something like this.
public class Global_Base_Class: System.Web.Mvc.Controller { }

public class Production_Base : Global_Base_Class { GetPoducts, AddProduct... }

public class Risk_Base : Global_Base_Class { GetRisk, AddRisk...  }

public class Example_View_Controller_A : Production_Base { }

public class Example_View_Controller_B : Risk_Base { }

What if I need/would like to have (to DRY up my code)
public class Example_View_Controller_C : Production_Base, Risk_Base

I've read that Multiple Inheritance isn't good practice/not allowed in c#...
What would be the best route/best practice for me to use to achieve this?
Any help/links will be appreciated

A: First of all: Don't name your classes like that. Microsoft have written a set of guidelines: http://msdn.microsoft.com/en-us/library/ms229002.aspx
Your structure is not valid in any OOP language since the relationships are not is-a. A controller is a MVC controller and not a class with your business logic. Google favor composition over inheritance to know more.
So the answer is
Move the common functionality to a separate class which you include in all classes that needs it. (RiskService or ProductionService)


text:
Q: Why are picewise continuous functions on $[a,b]$ bounded? Consider a picewise continuous function $f:[a,b] \to \mathbb{R}$, i.e there are $a=t_0<\dots <t_n=b$ such that $f$ is continuous on each open interval $(t_i,t_{i+1})$ and the limits $\lim\limits_{x \uparrow t_i}f(x)$ and  $\lim\limits_{x \downarrow t_i}f(x)$ exists for all $i=1,\dots,n$.
Why does there exist a constant $M>0$ such that $|f(x)| \leq M$ for all $x \in [a,b]$?

A: The extreme value theorem tells us that if $f$ is continuous on a closed and bounded interval, then it is bounded (and that it achieves these bounds as well).

Let us see how we can apply that your case. Let $i \in \{0, \ldots, n-1\}$ and consider the function $g_i$ defined on $[t_{i}, t_{i+1}]$ as follows:
$$g_i(t) := \begin{cases}f(t) & t \in (t_i, t_{i+1})\\\displaystyle\lim_{x\to t_i^+}f(x) & t = t_i\\\displaystyle\lim_{x\to t_{i+1}^-}f(x) & t = t_{i+1}\\\end{cases}$$
It is an easy check that $g_i$ is continuous on $[t_i, t_{i+1}]$. Thus, there exists $M_i$ such that $|g_i(x)| \le M_i$ for all $x \in [t_i, t_{i+1}]$.
In turn, this gives us that $|f(x)| \le M_i$ for all $x \in (t_i, t_{i+1})$.

Now, to conclude, we simply choose
$$M = \max\{M_0, \ldots, M_{n-1}, |f(t_0)|, \ldots, |f(t_n)|\}.$$
It is easy to see that
$$|f(x)| \le M \qquad \forall \; x \in [a, b].$$

A: On each interval $(t_j,t_{j+1})$, $f$ is bounded because it is continuous and has limits on the edges. Say $|f(x)| \leqslant M_j$ on this interval. As $f$ is well defined, it has a value at each point, so it has too at each $t_j$. Thus, if $M = \max \left\{M_0,M_1,\ldots,M_{n-1}, |f(t_0)|,|f(t_1)|,\ldots,|f(t_n)| \right\}$, then for all $x$, you have $|f(x)| \leqslant M$.

A: From the fact that the limites $\lim_{x\to t_i^+} f(x)$ and $\lim_{x\to t_i^-}$ exist, it follows that for all $i$ $f$ is bounded on $[t_i-\varepsilon,t_i+\varepsilon]$ for $\epsilon>0$ sufficiently small. Also $f$ is bounded on each closed interval $[t_i+\varepsilon/2,t_{i+1}-\varepsilon/2]$ by continuity. So $[a,b]$ is the union of finitely many intervals on which $f$ is bounded, so $f$ is bounded on the whole $[a,b]$.

A: Of course, the boundedness theorem implies that $|f(x)|\leq M$, i.e., $f(x)$ is bounded, for all $x\in[a,b]$ if the function would have been continuous on the closed intervals $[t_i,t_{i+1}]$. You can receive great insight from the proof to the same.
In this case, instead of looking at the entirety of $[a,b]$ at once, let us look at an arbitrary open interval $(t_i, t_{i+1})$. If I was simply to explain it, essentially what is happening here is that the existence of each of the limits $\lim_{x\to t_i^+}$ and $\lim_{x\to t_{i+1}^-}$ implies that they are finite. Moreover, because the function is continuous over the interval and these two limits are finite, the function is necessarily bounded in each of these intervals. If it was otherwise, there would be a discontinuity within such an interval because the value of the function at some point within the interval would approach infinity, in contradiction to the given conditions. Thus, $|f(x)|\leq M_i,\ \forall x\in[t_i,t_{i+1}]$. For all such intervals, we will get such values $M_i$. The required value of $M$ is the maximum of all such values.


text:
Q: Get open extensions using Graph API C# I am building a ASP.NET Core website, where the user signs in, and is able to save things like the theme of the page, which then triggers some js code:
var data = {
    userName: userName,
    key: "theme",
    value: localStorage.getItem("theme")
}

var pendingRequest;

if (pendingRequest) {
    pendingRequest.abort()
    pendingRequest = null;
}

pendingRequest = $.post('/Account/setExtension', data, function (data) {
    pendingRequest = null;
    $('#settingsModal').modal('hide');
});

which calls the controller:
        [HttpPost]
    public void setExtension(string userName, string key, string value)
    {
        Dictionary<string, object> addData = new Dictionary<string, object>
        {
            {key, value }
        };
        GraphHelper.updateExtension(userName, "com.user.roamingSettings", addData).ConfigureAwait(false);
    }

which calls the checks if the extension exists, and then decides to create it, or update the existing extension:
        public static async Task<bool> extensionExistsAsync(string userName, string extensionName)
    {
        try
        {
            var graphClient = GetAuthenticatedClient();

            // if extension doesnt exist
            bool extensionFound = false;
            var extensions = await graphClient.Users[userName].Extensions.Request().GetAsync();

            foreach (var extension in extensions)
            {
                if (extension.Id == extensionName)
                {
                    extensionFound = true;
                }
            }
            return extensionFound;

        }
        catch (Exception e)
        {
            Debug.WriteLine(e.Message.ToString());
            throw;
        }
    }

The problem is, the code just stops running on this line:
var extensions = await graphClient.Users[userName].Extensions.Request().GetAsync();

It doesn't throw or anything. Stepping through it line by line, it returns all the way to the assignment, and the output window is empty when it stops. Why is this? How can I get an extension by name, or get all extensions to see which ones exist, either by graph api, or calls?

A: When ever you use the below call
var extensions = await graphClient.Users[userName].Extensions.Request().GetAsync();

you will be getting UserExtensionsCollectionPage object which gives the list of extensions of a user.
This page doesn't have Id property, the extension objects that are present in this UserExtensionsCollectionPage object have it. So use the below code to print the id and type of the Extensions.
var extensions = await graphClient.Users["a1ee289f-4cab-4fc3-885f-d4cbefb48895"].Extensions.Request().GetAsync();
foreach(var data in extensions.CurrentPage)
{
     Console.WriteLine("Id: " + data.Id + "Type: " + data.ODataType );
}

This will give you the data as below.


text:
Q: Java split and add elements into corrsponding data type arraylists My problem is when a user enters text it should have two elements to split when using .split() however with the items it splits how do I put them into different lists so that I can use integer based list to make calculations.
e.g.
a user enters "skyrim , 100" the 'skyrim' entry is a string however with the number (integer) '100' I want to split it removing the comma and add it to a ArrayList for calculations and with other inputs added.
game name(String) , hours(integers) <- template

*

*skyrim , 100

*oblivion , 25

*GTA V , 50

so the listed items above are user input with 2 arguments separated by a comma, which will be split, then I need to add them to different arraylists.
Scanner input = new Scanner(System.in);

Arraylist<String> game = new Arraylist<>();
Arraylist<Integer> hours = new Arraylist<>();
Arraylist<Object> allGameData = new Arraylist<>();

String gameEntry = input.nextLine().split(" , ");

allGameData.add(gameEntry);

foreach(object items : allGameData) {
System.out.println(items);
}

so from here I should have:
skyrim , 100 , oblivion, 25, GTAV , 50
How do i put the game names into the game list and the numbers into the hours list?

A: Well for starters, the class you should be using is ArrayList with a capital L. So you need to change:
Arraylist<String> game = new Arraylist<>();
Arraylist<Integer> hours = new Arraylist<>();
Arraylist<Object> allGameData = new Arraylist<>();

to this:
ArrayList<String> game = new ArrayList<>();
ArrayList<Integer> hours = new ArrayList<>();
ArrayList<Object> allGameData = new ArrayList<>();

After we have them initialized correctly we add to the ArrayList with #.add so in your case you would add to the game and hours list like:
game.add("some game");
hours.add(10);

When you split your input with input.nextLine().split(" , "); we are expecting a String array to be returned. Currently you are trying to set this to just a String instead of a String array.
while (true){
    System.out.println("Enter \"game , hours\" or \"Quit\"");
    String line = input.nextLine();
    if (line.equals("Quit")) break;
    allGameData.add(line);
    String[] parsedData = line.split(" , ");
    game.add(parsedData[0]);
    hours.add(Integer.parseInt(parsedData[1]));
}

A: You can use Integer.parseInt().  The code you submitted looks pseudo-codey, but this is something like what You're going for:
String gameEntry = input.nextLine();
allGameData.add(gameEntry);
String[] splitGameEntry = input.nextLine().split(" , ");
game.add(splitGameEntry[0]);
hours.add(Integer.parseInt(splitGameEntry[1]));

I don't know exactly what you're trying to accomplish with this code, but you may want to organize the game/hours into a class that holds both values.  Your code would then look something like this:
public class GameInfo
{
    private String name;
    private int hours;

    public GameInfo(String name, int hours)
    {
        this.name = name;
        this.hours = hours;
    }

    [getters/setters]

    @Override
    public String toString()
    {
        return name + ":  " + hours + " hours played!";
    }
}

public class Main
{

    public void doSomething()
    {
        Scanner input = new Scanner(System.in);

        List<GameInfo> gameInfo = new ArrayList<>();

        String[] gameEntry = input.nextLint().split(" , ");

        gameInfo.add(new GameInfo(gameEntry[0], Integer.parseInt(gameEntry[1]));

        for(GameInfo gameInfoPiece : gameInfo)
        {
            System.out.println(gameInfoPiece);
        }
    }
}

Using this approach, you would be able to add as much information into the GameInfo class as you want.  For instance, if you wanted to change hours to expectedHoursToComplete and add actualHoursToComplete, you could easily do that.

A: You may find it easier if you rethink your approach. Rather than have 3 separate lists why not store it all in a single Map<String,Integer> where the key is the game name and the value is the number of hours.
Your code would look something like the following:
    Scanner scan = new Scanner(System.in);

    Map<String, Integer> gameHoursMap = new HashMap<>();

    String currentValue = scan.nextLine();

    // Loop until you meet some criteria to end such as typing q or quit
    while(!currentValue.equalsIgnoreCase("q")){

        // You would need to handle when the value of currentValue doesn't fit what you would normally be expecting before doing the rest
        String[] vals = currentValue.split(",");

        // Call trim method on the String incase there is any lingering whitespace
        gameHoursMap.put(vals[0].trim(), Integer.valueOf(vals[1].trim()));

        currentValue = scan.nextLine();
    }

You would obviously need to write some error handling for when the input doesn't fit with what you're expecting but you get the gist.
UPDATE:
If you wanted to have more complicated info stored for each game you could wrap it up in a custom class GameInfo and then have a Map<String,GameInfo> where the key is the name and the value is the GameInfo. This would allow you to retrieve all of the game info for a game just based on the name.
public class GameInfo {

   private String name;
   private int hoursPlayed;
   private int level;

   // etc
}

You would then amend the while loop to create the GameInfo object instead of just putting a String and int into the Map
// Create the GameInfo object from the corresponding input supplied by the user
GameInfo game = new GameInfo(vals[0].trim(), Integer.valueOf(vals[1].trim()), Integer.valueOf(vals[2].trim()));

// Put it in the map with the name as the key
gameMap.put(game.getName(), game);


text:
Q: ArcGIS Javascript Viewer with ArcGIS Server I'm certain this question must have been asked/answered, but I just can't find it.
I'm running ArcGIS Server and want to build a basic viewer that points to my locally hosted services.  I'm not interested in doing anything with ArcGIS.com; however all the examples hosted at esri illustrate interfacing with ArcGIS.com.
How can I point to my local map?
Alternatively, can you point me to where I can find the answer (as I'm certain this must have been asked already)

A: You should get started with ArcGIS API for JavaScript. Using this tutorial will help you build your first application

A: I'm assuming that you have a local Mapservice which is dynamic (i.e. not cached)
Please have a look at this sample: Dynamic map service
You will see that they are adding a map service using the following line of code:
var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer(
"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer", {
          "opacity":0.5,
          "imageParameters":imageParameters
        });

You need to provide the URL of the REST endpoint of your dynamic map service.
If the hostname of your server is myserver and the name of your service is say myMapService, you can use the following line of code:
var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer(
"http://myserver/ArcGIS/rest/services/myMapService/MapServer", {
          "opacity":1, /* 100 % opacity */
          "imageParameters":imageParameters
        });


text:
Q: Querying database inside XSLT to and apply the result to output XML I need to query database based on ProductItemId and get ProductName, ProductItemCode, ProductType and ActCode for the below XML. I am using SaxonEE for the transformation. The query should trigger inside the XSLT
My input XML is:
<?xml version="1.0" encoding="UTF-8"?>
<ListOfSublines>
   <OrderSubline>
      <OrderSublineNumber>1</OrderSublineNumber>
      <OrderSublineType>ADD</OrderSublineType>
      <OrderlineInstance>120</OrderlineInstance>
      <Lob/>
      <Circle/>
      <Zone/>
      <ProductItem>
         <ProductItemId>10</ProductItemId>
         <AdditionalParams>
            <Parameter name="LOC_CODE" value="25"/>
            <Parameter name="LOC_DESC" value="Kolkata Circle"/>
         </AdditionalParams>
      </ProductItem>
   </OrderSubline>
   <OrderSubline>
      <OrderSublineNumber>2</OrderSublineNumber>
      <OrderSublineType>ADD</OrderSublineType>
      <OrderlineInstance>121</OrderlineInstance>
      <Lob/>
      <Circle/>
      <Zone/>
      <ProductItem>
         <ProductItemId>11</ProductItemId>
         <AdditionalParams>
            <Parameter name="PRODUCT_INDICATOR" value="Mobility Voice"/>
            <Parameter name="RATE CLASS" value="1"/>
            <Parameter name="RRCC" value="Bharti Tele-Ventures"/>
         </AdditionalParams>
      </ProductItem>
   </OrderSubline>
   <OrderSubline>
      <OrderSublineNumber>3</OrderSublineNumber>
      <OrderSublineType>ADD</OrderSublineType>
      <OrderlineInstance>122</OrderlineInstance>
      <Lob/>
      <Circle/>
      <Zone/>
      <ProductItem>
         <ProductItemId>12</ProductItemId>
         <AdditionalParams/>
      </ProductItem>
   </OrderSubline>

</ListOfSublines>

Expected Output:
<?xml version="1.0" encoding="UTF-8"?>
    <ListOfSublines>
       <OrderSubline>
          <OrderSublineNumber>1</OrderSublineNumber>
          <OrderSublineType>ADD</OrderSublineType>
          <OrderlineInstance>120</OrderlineInstance>
          <Lob/>
          <Circle/>
          <Zone/>
          <ProductItem>
             <ProductItemId>10</ProductItemId>
             <ProductName>Value from Oracle Db based on ProductItemId 10</ProductName>
             <ProductItemCode>Value from Oracle Db</ProductItemCode>
             <ProductType>Value from Oracle Db</ProductType>
             <ActCode>Value from Oracle Db</ActCode>
             <AdditionalParams>
                <Parameter name="LOC_CODE" value="25"/>
                <Parameter name="LOC_DESC" value="Kolkata Circle"/>
             </AdditionalParams>
          </ProductItem>
       </OrderSubline>
       <OrderSubline>
          <OrderSublineNumber>2</OrderSublineNumber>
          <OrderSublineType>ADD</OrderSublineType>
          <OrderlineInstance>121</OrderlineInstance>
          <Lob/>
          <Circle/>
          <Zone/>
          <ProductItem>
             <ProductItemId>11</ProductItemId>
             <ProductName>Value from Oracle Db based on ProductItemId 11</ProductName>
             <ProductItemCode>Value from Oracle Db</ProductItemCode>
             <ProductType>Value from Oracle Db</ProductType>
             <ActCode>Value from Oracle Db</ActCode>
             <AdditionalParams>
                <Parameter name="PRODUCT_INDICATOR" value="Mobility Voice"/>
                <Parameter name="RATE CLASS" value="1"/>
                <Parameter name="RRCC" value="Bharti Tele-Ventures"/>
             </AdditionalParams>
          </ProductItem>
       </OrderSubline>
       <OrderSubline>
          <OrderSublineNumber>3</OrderSublineNumber>
          <OrderSublineType>ADD</OrderSublineType>
          <OrderlineInstance>122</OrderlineInstance>
          <Lob/>
          <Circle/>
          <Zone/>
          <ProductItem>
             <ProductItemId>12</ProductItemId>
             <ProductName>Value from Oracle Db based on ProductItemId 12</ProductName>
             <ProductItemCode>Value from Oracle Db</ProductItemCode>
             <ProductType>Value from Oracle Db</ProductType>
             <ActCode>Value from Oracle Db</ActCode>
             <AdditionalParams/>
          </ProductItem>
       </OrderSubline>

    </ListOfSublines>

A: You can either use Saxon's SQL extension (which does the 20% of things that 80% of people need, but is by no means complete), or you can write your own extensions using the Java extensibility mechanisms.

A: Both SQL and XSLT are special-purpose languages (sharing the trait of declarative types), meant to do one particular thing. For SQL that usually means database manipulation or retrieval or DDL and DML procedures, and for XSLT that means manipulating XML documents.
Consider using a general purpose language such as Java (an Oracle product), C#, Python, PHP, Perl, VB even R and SAS and still others to handle your Oracle database retrieval needs and XML document parsing and manipulation. Additionally, these aforementioned languages and others maintain their own libraries for XSLT 1.0 processors including XPath 1.0 and XML DOM document libraries. Even more, these languages can call external executables such as Saxon EE via command line (threading or subprocesses) passing needed arguments such as xml or xslt document paths. Finally, these same languages maintain SQL ODBC/OLEDB api libraries including for Oracle databases. By the way, Oracle maintains (like other enterprise level RDMS -SQL Server, PostgreSQL) its own XML manipulation syntax and features in its PL/SQL dialect.
Altogether, for your needs, consider the following steps:

*

*Choose a familiar general purpose language (aforementioned or others);

*Install its requisite Oracle database connector API (i.e., Java's JDBC
driver,
Python's cx_Oracle, PHP's
PDO DSN);

*Query database for select data with SQL;

*Iterate through query data to dynamically create input XML document;

*Run XSLT with general purpose coding or external executable for final XML output;

A: Thanks @Michael for the hint, I tried SAXON SQL extensions and was able to query database.
This is the XSLT code which is working fine for me:
    <xsl:transform version="2.0"
      exclude-result-prefixes="java saxon xsd xsi xsl"
      extension-element-prefixes="saxon sql"

      xmlns:java="http://saxon.sf.net/java-type"
      xmlns:saxon="http://saxon.sf.net/"
      xmlns:sql="java://net.sf.saxon.sql.SQLElementFactory"

      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    >
<xsl:variable name="count" select="0" saxon:assignable="yes"/>
      <xsl:output method="xml" indent="yes"/>
      <xsl:preserve-space elements="*" />

      <xsl:param name="jdbc.driver"   as="xsd:string" select="'com.mysql.jdbc.Driver'" />

      <xsl:param name="jdbc.database" as="xsd:string" select="'jdbc:mysql://localhost:3306/test'" />

      <xsl:param name="jdbc.user" as="xsd:string" select="'root'" />
      <xsl:param name="jdbc.pass" as="xsd:string" select="'root'" />
      <xsl:template match="BOOKS">

            <xsl:variable name="sql.conn" as="java:java.sql.Connection">
              <sql:connect driver="{$jdbc.driver}" database="{$jdbc.database}" user="{$jdbc.user}" password="{$jdbc.pass}">
                <xsl:fallback>
                  <xsl:message terminate="yes">SQL extenstions are not installed</xsl:message>
                </xsl:fallback>
              </sql:connect>
            </xsl:variable>

    <xsl:for-each select="ITEM">
        <sql:insert connection="$sql.conn" table="book">
            <sql:column name="title" select="TITLE"/>
            <sql:column name="author" select="AUTHOR"/>
            <sql:column name="category" select="@CAT"/>
        </sql:insert>
        <saxon:assign name="count" select="$count+1"/>
    </xsl:for-each>
<xsl:variable name="book-table">
    <sql:query connection="$sql.conn" table="book" column="*" row-tag="book" column-tag="col"/>
    </xsl:variable>

    <xsl:message>There are now <xsl:value-of select="count($book-table//book)"/> books.</xsl:message>
    <new-book-table>
        <xsl:copy-of select="$book-table"/>
    </new-book-table>

      </xsl:template>

    </xsl:transform>

Hope it help others.


text:
Q: CORS on AWS API Gateway and S3 I am calling an AWS API which uses lambda function. I am calling it from a HTML page which is hosted in S3 (static web hosting). While calling the API I get CORS error:

Access to XMLHttpRequest at '' from origin
  '' has been blocked by CORS policy: No
  'Access-Control-Allow-Origin' header is present on the requested
  resource.

I have tried it after enabling CORS on API, Specifying CORS on S3 bucket but it is not working.
Seems, I am missing the right place where CORS headers are to be specifies.
Additional information:
I get following information in chrome developer tool
**Response Headers**
content-length: 42
content-type: application/json
date: Mon, 24 Feb 2020 04:28:51 GMT
status: 403
x-amz-apigw-id: IYmYgFQvoAMFy6Q=
x-amzn-errortype: MissingAuthenticationTokenException
x-amzn-requestid: 79b18379-383d-4ddb-a061-77f55b5727c3

**Request Headers**
authority: apiid-api.us-east-1.amazonaws.com
method: POST
path: /Prod
scheme: https
accept: application/json, text/javascript, */*; q=0.01
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9,hi;q=0.8
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
access-control-allow-methods: GET, OPTIONS
access-control-allow-origin: https://apiid.execute-api.us-east-1.amazonaws.com/Prod
content-length: 117
content-type: application/json; charset=UTF-8
origin: http://example.com
referer: http://example.com/
sec-fetch-mode: cors
sec-fetch-site: cross-site
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36

Lambda function code:
var AWS = require('aws-sdk');
var ses = new AWS.SES();

var RECEIVER = 'example@gmail.com';
var SENDER = 'example@gmail.com';

var response = {
 "isBase64Encoded": false,
 "headers": { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*'},
 "statusCode": 200,
 "body": "{\"result\": \"Success.\"}"
 };

exports.handler = function (event, context) {
    console.log('Received event:', event);
    sendEmail(event, function (err, data) {
        context.done(err, null);
    });
};

function sendEmail (event, done) {
    var params = {
        Destination: {
            ToAddresses: [
                RECEIVER
            ]
        },
        Message: {
            Body: {
                Text: {
                    Data: 'name: ' + event.name + '\nphone: ' + event.phone + '\nemail: ' + event.email + '\ndesc: ' + event.desc,
                    Charset: 'UTF-8'
                }
            },
            Subject: {
                Data: 'Website Referral Form: ' + event.name,
                Charset: 'UTF-8'
            }
        },
        Source: SENDER
    };
    ses.sendEmail(params, done);
}

A:
No 'Access-Control-Allow-Origin' header is present on the requested resource.

This is saying that the resource you requested, your Lambda via API Gateway, is not returning an Access-Control-Allow-Origin header in its response; the browser is expecting the CORS headers in the response from the API (possibly because of an OPTIONS request), but the response doesn't have them.
You've not said so specifically but I'm assuming you're using a Lambda proxy integration on your API gateway. To solve your issue, add a Access-Control-Allow-Origin: * header to the response your Lambda returns. You've not specified the language your Lambda is written in, or provided your Lambda code, but if it was in NodeJS, a snippet of what you'd return might look something like:
    const result = {
        statusCode: 200,
        headers: {
            'Access-Control-Allow-Origin': '*',
            // other required headers
        },
        body: object_you_are_returning
    };

    return result;

A: Very surprisingly, the reason seems to be "the client-side shouldn't have 'Access-Control-Allow-Origin': '*'. That should only be in the Lambda code, apparently, and adding it to the jQuery code will cause the preflight to fail for some reason."
https://github.com/serverless/serverless/issues/4037#issuecomment-320434887
Supplement information following the comment:
I also tried to use ajax hosted in S3 to call my Lambda function through API Gateway. I have tried many suggestions especially this solution (http://stackoverflow.com/a/52683640/13530447), but none of them works for me. In the developer-mode of Chrome, I kept seeing the error "Access to XMLHttpRequest at '[my API]' from origin '[my S3 website]' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response." I solved this by removing 'Access-Control-Allow-Origin': '*' in ajax. Still take the solution (http://stackoverflow.com/a/52683640/13530447) as an example, it will work by changing
$.ajax(
{
    url: 'https://npvkf9jnqb.execute-api.us-east-1.amazonaws.com/v1',
    headers: {'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*'
},
    crossDomain: true,
    type:'GET',
    dataType: 'text',
    success: function(data)
    {
        window.alert(data);
    }
});

into
$.ajax(
{
    url: 'https://npvkf9jnqb.execute-api.us-east-1.amazonaws.com/v1',
    headers: {'Content-Type': 'application/json'},
    crossDomain: true,
    type:'GET',
    dataType: 'text',
    success: function(data)
    {
        window.alert(data);
    }
});


text:
Q: Run IntelliJ in client-server mode Currently, IntelliJ IDEA does not have a "Remote Development" feature.
Lets say I have two machines: Machine 1 (very good configuration ex 64GB ram with Intel Xeon processors) and Machine 2 (Macbook Pro with 8GB RAM).
Lets say I have IntelliJ IDEA installed on both machines. The problem now is, there is no client-server mode for the IDE. The closes thing I have is to use OpenNX.
What I'm looking for is a plugin/feature that enable remote development. What I mean by this is: On my macbook, I should be able to add Machine 1 as a "server". And once that is done, the IntelliJ IDEA on my macbook will only act as a client for the IntelliJ IDEA on my Linux box. Basically it would be replicating the UI. However, the catch here is that, it shouldn't do so by sending images (the way any VNC or NX client would). Instead, since it is for a specific application most of the data can be managed through text data only.
Since OpenNX uses images, even with compression it wouldn't match up the performance of text only transmission.
Basically I'm looking for IDEA on one machine to be a client (Remote GUI) for IDEA on another machine.
UPDATE
The eventual answer is: This is not possible (As of now). While I was aware of other options, that wasn't what I really wanted. However, it appears there is no such option.
The main reason why I wanted the option was because my desktop (remote Linux box) has a much higher configuration (Intel Xeon 2GHz processor and 64GB RAM) and my client was an Macbook Pro with Intel Core i7 and 8GB RAM. (By no means any less). However, due to the size of my codebase etc, the indexing of the code etc by the IDE slows it down.
Both client and server are perfectly capable of running an IDE by themselves. However, due the size of the code base it would be better to have the build of the work being done by the IDE on the server and the client being just the front end to it.
The other solutions like VNC, Nomachine - OpenNx all use image compression. And when your client is a Mac, you run into keyboard mapping problems. A client-server mode in the IDE itself would use text compression instead and would be much faster. It would also solve the keyboard mapping problems.
While to me, it sounds like a good idea, it probably doesn't get used by enough people for it to be a feature of the IDE.
Note: I would also be open to considering Eclipse as the IDE if this feature is available. Any answers will always be apreciated.

A: You'd probably be better off switching instead to a remote code repository that you keep in sync.  While the concept of doing this in an IDE plugin is interesting, it has some fundamental flaws.  What happens when the machines can't talk to each other? Are you unable to work at that point, or can you work offline.  If you work offline on both machines, how do you reconcile changes...
I suggest looking into using "git".  You can set up a remote repository very easily.  If you have ssh access to either machine or some other shared machine, you can create a remote repository on that machine, and your "client" machines can easily push files/changes around.
There are plenty of other code repository options, but I've found git the easiest to set up.


text:
Q: kaptGenerateStubs task throws java.lang.StackOverflowError We have a Java / Kotlin project that builds on Jenkins job, sometimes, it just throws java.lang.StackOverflowError and after restarting job it disappears.
Do any of you encounter this before?
14:00:01 > Task :app:mergeClientFlavorDebugAssets
14:00:01 > Task :app:processClientFlavorDebugJavaRes NO-SOURCE
14:00:01 > Task :app:dataBindingMergeGenClassesClientFlavorDebug
14:00:02 > Task :app:mergeClientFlavorDebugResources
14:00:03 > Task :app:dataBindingGenBaseClassesClientFlavorDebug
14:00:09 > Task :app:processClientFlavorDebugResources
14:00:26
14:00:26 > Task :app:kaptGenerateStubsClientFlavorDebugKotlin
14:00:26 e: java.lang.StackOverflowError
14:00:27    at org.jetbrains.kotlin.parsing.KotlinExpressionParsing.parsePrefixExpression(KotlinExpressionParsing.java:343)
14:00:27    at org.jetbrains.kotlin.parsing.KotlinExpressionParsing.access$200(KotlinExpressionParsing.java:43)
14:00:27    at org.jetbrains.kotlin.parsing.KotlinExpressionParsing$Precedence$2.parseHigherPrecedence(KotlinExpressionParsing.java:167)
...


text:
Q: Creating a calendar event in SharePoint I need to create a recurring event in SharePoint calendar. I am able to create non-recurring events. Please help.

A: Check out the following resource on MSDN:
How to: Add a Recurring Event to Lists on Multiple Sites


text:
Q: Intermittent problems with nuget pack called via powershell I am trying to alter our build process so that particular folders are packed into nuget packages (this is after they have been built), so that they can then be deployed by Octopus deploy. The powershell scripts to do this work fine on my computer.
However, when I run them on the build computer they will work for one folder, and then start failing. If I change the filter so it operates against one of the folders that failed in the previous build it will work for that folder, but not any of the subsequent ones.
The powershell script looks like this:
#pack into nuget
$command = "$scriptpath\nuget.exe pack ""$nuspecfile"" -NoPackageAnalysis -OutputDirectory ""$deployFolder\..\nuget"""
write-host "command is: $command"
iex $command

It works for all the subfolders in the first folder to produce 8 nuget packages, and I get the following output:
command is:[...]
Attempting to build package from 'ECF_Database_Upgrade_QA.nuspec'.
Successfully created package '\zaklpegffs004\Group\IT\IT Projects\Active Project Status\TFS\Drop\WWOL.Dev\WWOL.Dev_0.0.0.{CS}_Dev.94\QA\ECF Database Upgrade..
uget\ECF_Database_Upgrade_QA.0.0.0.9156.nupkg'.
When it fails I just get the following in the logs:
command is: [...]
with no other output
Latest update
I have added code to write the return code from the batch file, like so:
write-host $LastExitCode

This returns 0 for the times when it works and -1073741502 when it fails.

A: The answer in case anyone else ever runs into this problem, is that after Write-Host has been called a number of times there seems to be a bug which stops external exes from being launched (in my case nuget.exe)
I commented out all the write-host commands and the call to nuget started working perfectly.
Similar problem and solution here:


text:
Q: Class attribute for two instances of the same class There is this code:
class Sample:
    variable = 2
object1 = Sample()
object2 = Sample()
print object1.variable  # 2
print object2.variable  # 2
object1.variable = 1
print object1.variable  # 1
print object2.variable  # 2 <- why not 1 too?

Why object2.variable is not also 1 after assignment to class variable?

A: Don't confuse this with a static variable. In your case, both objects have a name variable point to a 2 object after instantiation. Now if you change the variable to 1 in one object, all you do is bind the name to a different object, i.e. the 1 object. The name in object2 still refers to a 2 object. The original class object is untouched and still has the name variable point to a 2, so object3 = Sample() will have a 2 bound to variable as well.
One way to get around this is to write the class like the following:
>>> class Sample:
...     variable=[2]
...
>>> object1 = Sample()
>>> object2 = Sample()
>>> print object1.variable[0]; print object2.variable[0]
2
2
>>> object1.variable[0]=1
>>> print object1.variable[0]; print object2.variable[0]
1
1

This is because all classes bind the name variable to the same, muatable object, and you manipulate the contents of this same object (variable[0]).

A: Because you assign new instance variable into instance, not class variable. If you can change class attribute, then you must set variable through __class__ attribute. (Or directly to class object.)
class Sample:
    variable = 2
object1 = Sample()
object2 = Sample()
print object1.variable  # 2
print object2.variable  # 2
object1.__class__.variable = 1 # or Sample.variable = 1
print object1.variable  # 1
print object2.variable  # 1

A: Take a look at this question.
In a nutshell, your class and your class instance have different namespaces (Actually, this is not very correct because instance namespace kinda places on top of class' namespace so that in case if you have a class atribute and an instance attribute with the same name, instance' one will be accessed through inst.attr , otherways - class' one). So, when you do
object1.variable = 1

you do not actually change class variable (which is often called static field in other languages), you just bind a new field called variable to your class instance object1.
What you probably want to do is to change class variable, not instance one. It could be done like this:
Sample.variable = 1

or like this:
object1.__class__.variable = 1

A: Two instances of a same class don't share the same memory and the same variables. For instance, you can have a Car whose color is red and another whose color is blue.

A: You've answered the question in the title. They are two separate and distinct instances of the same class. object1 and object2 are different objects and therefore anything that happens to one of these objects will not alter the other.

A: Because object1 is a different object than object2. To have them be the same, you need to do
class Sample:
  variable = 2
object1 = Sample()
object2 = object1
print object1.variable
print object2.variable
object1.variable = 1
print object1.variable
print object2.variable

Note the line that says
object2 = object1

A: This is perhaps counterintuitive, but when you write
object1.variable = 1

You're not assigning to the class variable, but defining an instance variable of the same name. (You can inspect object1's __dict__ to verify this). Notice that if you write
Sample.variable

or
object1.__class__.variable

You'll get 2 in both cases, because variable was never actually changed. To assign to it, you can refer to it as above -- object1.__class__.variable = 1, for instance, makes it so that object2.variable == 1 also.


text:
Q: How could I select the keys py correct value in javascript? I have a object in below
{ "a": true, "b": true, "c": false, "d": true }

and I wanna get the array [a,b,d] by select the object when its value is true, I know I can use for loop to struggle to do it, but I wanna just a elegant API to help handle it, cause I an a rubist(write ruby code), there's exist the select API can help me, but in javascript world, it seems lack of those API, everything looks must do by yourself, that's weird.
I have study the lib lodash, it looks exist many good tool/API, but for now, I havn't get the function I want, maybe the reason is I'm not familiar with lodash lib, anyway, is anyone know how can select the keys from object values I specify in elegant API/way?

A: Try this :
var keys = [];
_.each( obj, function( val, key ) {
  if ( val ) {
    keys.push(key);
  }
});

A: You can use Object.keys combine with filter

var obj = { "a": true, "b": true, "c": false, "d": true }

var result = Object.keys(obj).filter(k => obj[k]);

console.log(result)


text:
Q: How to do addAll from multiple sql result in hibernate? I'm running sql seperately, because hibernate doesn't support "union". So how to do addAll from those results.
public List<Product> findlist(String pid) {
     List <Product> result1 ;
     List <Product> result2;
     Object[] obj = {pid};
      result1.add(findAllByQuery(PRODUCT_DIVISION1,obj));
      result1.add(findAllByQuery(PRODUCT_DIVISION2,obj));
      return result1.addAll(result1);
  }

PRODUCT_DIVISION1 = "query";
PRODUCT_DIVISION2 = "query";

Please advise.

A: return result1.addAll(result1); doesn't make sense to me, it's adding the content of itself. Also the 'add' method supposed to be used to add one element only. You list is also uninitialized.
What you're trying to achieve sounds straight forward, you just need to query each collection and combine it
List <Product> result = findAllByQuery(PRODUCT_DIVISION1,obj);
result.addAll(findAllByQuery(PRODUCT_DIVISION2,obj)
return result;


text:
Q: Bootstrap tab with custom border I'm working on wizard where the header is the one showed at following picture. I'm using Bootstrap-4 tabs components and :after pseudo element approach on li element, but I don't know how to get the background with two color.
Desired result

HTML snippet

         Frete

         Pagamento

         Revise e Confirme

CSS snippet
&:after {
    content: '';
    border-right: 1px solid #666666;
    display: block;
    height: 100%;
    top: 0;
    position: absolute;
    transform: skewX(-45deg);
}

Actual result

A: I would probably style the actual tabs. Styling pseudo-elements brings in a level of complication that you don't want to deal with.
Here I'm skewing the tabs right, then adding an inner span element to skew the text back to vertical.
I'm using pseudo:before to create the 90-degree left side to the first tab. You could do the same for the final tab. It may be tricky to get the shadows and borders to work out, but I think it's feasible.
.nav-tabs .nav-item {
  transform: skew(-22.5deg);
  box-shadow: 5px 5px 15px rgba(0, 0, 0, .2);
}

li.nav-item:first-child::before {
  content: '';
  height: 40px;
  background: #fff;
  width: 20px;
  position: absolute;
  transform: skew(22.5deg);
  top: 1px;
  left: -8px;
}

.nav-tabs .nav-item a span {
  transform: skew(22.5deg);
  display: inline-block;
}

    Home

Fiddle demo

A: Here a version based on Isherwood answer that fixes the first and last tab border issue. I know that isn't the most eficient solution but worked well.
Result

HTML code

            Frete

            Pagamento

            Revise e Confirme

CSS code (SASS)
.tabs-wrapper {
    margin-top: 5rem;

    .nav {
      background-color: $cinza;
      padding: 0;

      .nav-item {
        transform: skew(-22.5deg);
        box-shadow: 5px 5px 15px rgba(0, 0, 0, .2);

        .nav-link {
          @include transition(all 1s);
          color: $gray-500;
          background-color: $cinza;

          span {
            font-size: 1.2rem;
            transform: skew(22.5deg);
            display: inline-block;
            padding: 1rem 0;
          }

          &.active {
            @include transition(all 1s);
            background-color: #fff;
            color: $gray-900;
            font-weight: 700;
          }

          &.first {
            &:before {
              @include transition(all 1s);
              position: absolute;
              content: '';
              background: $cinza;
              height: 100%;
              width: 2rem;
              top: 0;
              left: -1rem;
              transform: skew(22.5deg);
            }

            &.active {
              &:before {
                @include transition(all 1s);
                background: #fff;
              }
            }
          }

          &.last {
            &:before {
              @include transition(all 1s);
              position: absolute;
              content: '';
              background: $cinza;
              height: 100%;
              width: 2rem;
              top: 0;
              right: -1rem;
              transform: skew(22.5deg);
            }

            &.active {
              &:before {
                @include transition(all 1s);
                background: #fff;
              }
            }
          }
        }
      }
    }


text:
Q: Azure DataCacheClient failing to respond from time to time I am experiencing a problem with azure caching. My website is a very simple website which does not use any sessions, but azure applications must have at least 1 DataCacheClient set.
The website works perfectly, there is no problem when I browse the site BUT, I have included an email notification service within the Application_error of the global ofthe site to know if users are experiencing any errors when using the site.
As soon as I included the email error sending code, my mailbox started recieving the same error which includes:
Error Message:ErrorCode:SubStatus:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.)
Now I know that this can occur when the connection to azure services is lost, but why is it happening constantly? How can we fix it?
Any help would be appreciated!
Thanks!

A: If you are not utilizing sessions why are you connecting to Azure cache?  You do not need to instrument Azure AppFabric cache connection in the web.config, unless you have a particular need for it.
How many instances are you running on, how big is your azure cache account and is everyone of your users receiving the error or only intermittently? If the latter, is it after a some period of inactivity on the site that folks get errors?


text:
Q: Manage orientation change in my project I am working on application with bluetooth connectivity.I have placed my bluetooth enabler (intent) code in onCreate() of my activity.  When orientation of the phone changes my phone is trying to reconnect the device. I have tried to handle Configurationchanges events from manifest and activity both, But it seems like not working for me. Please suggest me any solution for this I am running out of time.
Thanks in advance!

A: you can use this code
 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);

  if (savedInstanceState != null)
  {
   menuOut[0] = savedInstanceState.getBoolean("slide");
  }else
  {
  initLayout();
  adapter = new MyAdapter(this);
  ((ListView) findViewById(R.id.list1)).setAdapter(adapter);
  }
 }

this function are use outside oncreate method.

@Override
 protected void onSaveInstanceState(Bundle outState) {
  // TODO Auto-generated method stub

  outState.putBoolean("slide", true);
  super.onSaveInstanceState(outState);

 }

A: Try using a boolean value to check if you have already connected to your bluetooth device. Use SharedPreferences to store this value and then check its value in the overridden "onResume()" function.


text:
Q: Firebase Authorization is not checking if the user is logged in properly in my flutter app I want to check if a user is logged in before or not and based on this navigate them to either HomePage or SignIn page. The code I am using is not working fine, it is not navigating to the SignIn page after I've done registration and deleted the account in Firebase Console. In short, when I delete a user, who registered well before, in Firebase Console the application is keeping to show the HomePage and all the posts the user made. How can I handle it?
"In short, I want to navigate the user to SignIn page after I delete his account in Firebase Console"
Here is the code in my main.dart file:
_check(){
 final FirebaseAuth auth = FirebaseAuth.instance;
 final User? user = auth.currentUser;
 if(user == null){
   HiveDB.deleteUser();
   return SignInPage();
 }
 HiveDB.putUser(id: user.uid);
 return HomePage();
}

@override
void initState() {
  // TODO: implement initState
  super.initState();
   _check();
}

@override
Widget build(BuildContext context) {
  return MaterialApp(
    home: _check(),
    routes: {
      SignInPage.id:(context) => SignInPage(),
      SignUpPage.id:(context) => SignUpPage(),
      HomePage.id:(context) => HomePage(),
    },
  );
}

The _check() function is not working as it's desired...

A: This is something that can be resolved by using async . the problem is you are getting response in future but the action is performed before. Please check the following documentation for detailed overview:
https://dart.dev/codelabs/async-await

A: While Firebase persists the user info in local storage and automatically restores it when the app/page reloads, this requires that it makes an asynchronous call to the server and thus may not be ready by the time your check runs.
Instead of depending on currentUser, you'll want to listen for changes to the authentication state through the authStateChanges stream. Most apps wrap this in a StreamBuilder and then show the correct screen based on the stream state and last event.


text:
Q: debug jquery elastislide plugin error I am using the elastislide plugin found at http://tympanus.net/codrops/2011/09/12/elastislide-responsive-carousel/ . Now it works fine except when I try to manually set the current image.
My code:
var wdornot_carousel = $("#wdornot_carousel").elastislide({
...
...
});
wdornot_carousel.setCurrent(5);

With this I get the error: TypeError: this.$carousel is undefined on line 655
So inside the js, on line 651, that is just a bit before that error, I did console.log(this);, which gave me an object which does have a $carousel property referencing a jquery object...so why is this.$carousel being seen as undefined?

A: Do you have any other javascript frameworks such as Prototype included.
Prototype also uses the $ and can cause conflicts like this.
You can use both libraries safely by using the noConflict function
<script src="other_lib.js"></script>
<script src="jquery.js"></script>
<script>
$.noConflict();
jQuery( document ).ready(function( $ ) {
// Code that uses jQuery's $ can follow here.
});
// Code that uses other library's $ can follow here.
</script>

Check out the documentation here http://api.jquery.com/jQuery.noConflict/


text:
Q: Proving that there is an exact sequence
This is what I got so far before getting stuck
Proof: Show that $im \iota \subseteq ker f$. Let $g \in im \ \iota$. Then there is some $n \in ker\  f$ such that $g = \iota(n)$. If $f: M \rightarrow N$ is surjective, then $im \ \iota = M$. Since $g \in im \ \iota$, then $f(g) = f(\iota(n)) = 0$ implies $g \in ker f$. So $im \ \iota \subseteq ker f$. Next we show that $ker f \subseteq im \ \iota$. Let $h \in ker f$, then the definition of $ker f$ means that $h \in im \ \iota$ if $f$ is surjective.
In the problem I used $\iota $ as the map from $0 \rightarrow ker f$. I also used the definitions of both the $im \iota$ and $ker f$. My question is whether if this outline makes any sense or if there's an appropriate way to approach the problem. I'm not sure if I should approach the relations $imf = ker \iota'$, where $\iota': N \rightarrow co ker f$. Similarly but using $co ker f$ instead of $ker f$. Confusion arises when I use the definition of exactness, i.e. $im \ \iota = ker \ f$ and then there's the $ker \ f $ in the exact sequence $0 \rightarrow ker f \rightarrow M \rightarrow N$. Are these two $ker f$ the same? Sorry this feels like a dumb question.

A: The inclusion map $\iota:\ker(f)\rightarrow M$ and the quotient map $\mathcal{Q}:N\rightarrow \text{coker}(f)$ should do the trick.
First look at $0\rightarrow\ker(f)\overset{\iota}{\rightarrow} M$. The first arrow is the zero map, whose image is $\{0\}$ and this is the same as the kernel of the inclusion map $\iota$.
Now look at $\ker(f)\overset{\iota}{\rightarrow}M\overset{f}{\rightarrow}N$. The image of $\iota$ is precisely $\ker(f)$, so there is nothing to check here. (To answer your question, the $\ker(f)$ in the exact sequence is the kernel of the given map $f:M\rightarrow N$).
Have a go at the last part, just by computing the image and kernel of the relevant maps.


text:
Q: Own OSM map tile server seems not to render or is very slow I have a problem with my own tile server. I tested it with https://download.geofabrik.de/europe/germany/bayern-latest.osm.pbf and everything works fine. At the beginning it took about 200 seconds to render the first tile but then it worked quite good. After this I load up another set https://download.geofabrik.de/europe/germany/saarland-latest.osm.pbf with –create and it worked still. Then I wanted to try the same with a bigger set (Germany, Switzerland, Austria) http://download.geofabrik.de/europe/dach-latest.osm.pbf. It took about 12 hours to process the osm2pgsql. Now I started the tile server again and it seems not to work. Other possibility is that it is very slow. Here is the grep rendered:
Mar 24 10:36:47 h2929534 renderd[8445]: DEBUG: Loading font: /usr/share/fonts/truetype/unifont/unifont_csur.ttf
Mar 24 10:36:47 h2929534 renderd[8445]: DEBUG: Loading font: /usr/share/fonts/truetype/unifont/unifont.ttf
Mar 24 10:36:47 h2929534 renderd[8445]: Loading parameterization function for
Mar 24 10:36:47 h2929534 renderd[8445]: Starting stats thread
Mar 24 10:36:47 h2929534 renderd[8445]: Loading parameterization function for
Mar 24 10:36:47 h2929534 renderd[8445]: message repeated 5 times: [ Loading parameterization function for]
Mar 24 10:36:54 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 8, number 1
Mar 24 10:36:54 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 10:36:54 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(8) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 10:36:56 h2929534 renderd[8445]: Using web mercator projection settings
Mar 24 10:36:56 h2929534 renderd[8445]: DEBUG: START TILE ajt 19 247504-247511 167632-167639, new metatile
Mar 24 10:36:56 h2929534 renderd[8445]: Rendering projected coordinates 19 247504 167632 -> -1119038.094096|7223604.921066 -1118426.597869|7224216.417292 to a 8 x 8 tile
Mar 24 10:36:57 h2929534 renderd[8445]: Using web mercator projection settings
Mar 24 10:36:57 h2929534 renderd[8445]: message repeated 5 times: [ Using web mercator projection settings]
Mar 24 10:37:24 h2929534 renderd[8445]: DEBUG: Connection 0, fd 8 closed, now 0 left
Mar 24 10:37:45 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 7, number 1
Mar 24 10:37:45 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 10:37:45 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 10:38:15 h2929534 renderd[8445]: DEBUG: Connection 0, fd 7 closed, now 0 left
Mar 24 10:39:21 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 7, number 1
Mar 24 10:39:21 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 10:39:21 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 10:39:51 h2929534 renderd[8445]: DEBUG: Connection 0, fd 7 closed, now 0 left
Mar 24 10:43:44 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 7, number 1
Mar 24 10:43:44 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 10:43:44 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 10:44:14 h2929534 renderd[8445]: DEBUG: Connection 0, fd 7 closed, now 0 left
Mar 24 10:59:42 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 7, number 1
Mar 24 10:59:42 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 10:59:42 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 11:00:12 h2929534 renderd[8445]: DEBUG: Connection 0, fd 7 closed, now 0 left
Mar 24 11:00:56 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 7, number 1
Mar 24 11:00:57 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 11:00:57 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 11:01:26 h2929534 renderd[8445]: DEBUG: Connection 0, fd 7 closed, now 0 left
Mar 24 11:11:53 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 7, number 1
Mar 24 11:11:53 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 11:11:53 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 11:12:23 h2929534 renderd[8445]: DEBUG: Connection 0, fd 7 closed, now 0 left
Mar 24 11:13:48 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 7, number 1
Mar 24 11:13:48 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 11:13:48 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 11:14:18 h2929534 renderd[8445]: DEBUG: Connection 0, fd 7 closed, now 0 left
Mar 24 11:16:09 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 7, number 1
Mar 24 11:16:09 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 11:16:09 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 11:16:39 h2929534 renderd[8445]: DEBUG: Connection 0, fd 7 closed, now 0 left
Mar 24 11:21:53 h2929534 renderd[8445]: DEBUG: Got incoming connection, fd 7, number 1
Mar 24 11:21:53 h2929534 renderd[8445]: DEBUG: Got incoming request with protocol version 2
Mar 24 11:21:53 h2929534 renderd[8445]: DEBUG: Got command RenderPrio fd(7) xml(ajt), z(19), x(247506), y(167636), mime(image/png), options()
Mar 24 11:22:23 h2929534 renderd[8445]: DEBUG: Connection 0, fd 7 closed, now 0 left

I tried to render the /hot/19/247506/167636.png
System:
Ubuntu 18.04 LTS on V-Server
32 GB ram
800 GB SSD 8 core cpu


text:
Q: Visual Studio post publish/or build solution ZIP Is there a way to automatically Zip/archive the entire solution after I right click on the project file and click "Publish"?
I've ran into some issue trying to revert to previous versions of my application because I forgot to check everything in after a publish. And someimtes TFS is tricky to get a snapshot of the app at a given date. Having a ZIP archive of each time there was a publish or build would be very beneficial.

A: If you are building a Web application, your website project should have a tab where you can set the "Package/Publish Web" settings for different build configurations. This should allow you to generate ZIP packages when building.
For the standard 'Debug' build that most developer's use on their machine, you won't want this on, but you might want to configure it for other build configurations.
Some good MSDN reads on the topic are:
ASP.NET Web Application Project Deployment Overview
How to: Create an Automated Build and Deployment Solution with Team Foundation Server Team Build

A: Common practice is to do that on build server side. Any continuous integration system allows to perform actions on successful build. Not a good practice to increase build time on developer's machine, because it would affect productivity.


text:
Q: AWS Route 53 health check keeps alarming from inactive region I have a Route 53 health check with all the regions selected except US East (N. Virginia). However, it keeps alarming from that region from time to time. Why's that? Here's the alarm config:

Here's an example of the alarm:
You are receiving this email because your Amazon CloudWatch Alarm "***********-Low-HealthCheckStatus" in the US East (N. Virginia) region has entered the ALARM state, because "Threshold Crossed: 1 datapoint [0.0 (12/04/18 14:01:00)] was less than the threshold (1.0)." at "Thursday 12 April, 2018 14:02:29 UTC".

View this alarm in the AWS Management Console:
https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#s=Alarms&alarm=**************************-Low-HealthCheckStatus

Alarm Details:
- Name:                       ******************************
- Description:
- State Change:               OK -> ALARM
- Reason for State Change:    Threshold Crossed: 1 datapoint [0.0 (12/04/18 14:01:00)] was less than the threshold (1.0).
- Timestamp:                  Thursday 12 April, 2018 14:02:29 UTC
- AWS Account:                ******************************

Threshold:
- The alarm is in the ALARM state when the metric is LessThanThreshold 1.0 for 60 seconds.

Monitored Metric:
- MetricNamespace:                     AWS/Route53
- MetricName:                          HealthCheckStatus
- Dimensions:                          [HealthCheckId =************]
- Period:                              60 seconds
- Statistic:                           Minimum
- Unit:                                not specified

State Change Actions:
- OK:
- ALARM: [arn:aws:sns:us-east-1:***********************]
- INSUFFICIENT_DATA:

I've really got bored of this. How to fix it? I need health checks only from Europe.

A: You are misinterpreting the meaning of this part of the alarm message.  Route 53 checks alarms always come from us-east-1, regardless, because Route 53 is operationally based out of us-east-1.  All the global health checkers funnel their test results back there for aggregation at a central point.  Being based in us-east-1, it communicates with CloudWatch only in us-east-1, and stores the metrics there.

[in the console, select] US East (N. Virginia). Route 53 metrics are not available if you select any other region as the current region.
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/monitoring-health-checks.html

"Amazon CloudWatch Alarm "...-Low-HealthCheckStatus" in the US East (N. Virginia) region..."
This does not mean the us-east-1 region is testing your endpoint or detecting the failure. The us-east-1 region's ability to reach your service is not being tested if that region is not in your configurarion.
Your health check metrics are stored in the US East (N. Virginia) region (us-east-1) because that is where all Route 53 health check metrics are stored, so that's how the message is always tagged.
But your health check is failing for reasons unrelated to us-east-1.  In the Route 53 console, you can see the most recent failure from each regional health checker and you should find that your site does have some kind of reachability issue that is occurring.

A: us-east-1 is the region where the 'global' health percentage metric is calculated based on statuses collected by distributed nodes located in 'Health Checker Regions'.
The cloud watch alarm therefore is produced in us-east-1.


text:
Q: How do I enable a font feature? I am trying to enable the Historical Ligatures feature in EB Garamond. The guide to the font calls this feature hlig. However, I have no idea how to enable the feature.
I found a question that seems to be related: querying whether a font feature has been activated via a fontspec command. It mentions an \addfontfeatures command, but when I try \addfontfeatures{hlig}, I get an error: "The key 'fontspec/hlig' is unknown and is being ignored."
I haven't been able to find any concrete source about how I enable features. I feel like I'm missing something rather important.
Code:
\documentclass{article}
\usepackage{fontspec}
\usepackage{ebgaramond}
\addfontfeatures{Ligatures=Historic}

\begin{document}

These words should have ligatures: standard, acta, select.

\end{document}

A: The ebgaramond package does not currently have an option to enable the historic ligatures feature. This would be the preferred way to select the ligatures.
Using \addfontfeatures in the preamble does not work, because it applies only to the font of the current group. So instead I place the \addfontfeatures command inside \AtBeginDocument, so it takes effect as soon as the document begins:
\documentclass{article}
\usepackage{ebgaramond}
\AtBeginDocument{\addfontfeatures{Ligatures=Historic}}

\begin{document}

These words should have ligatures: standard, acta, select.

\end{document}

This only works with Xe/LuaLaTeX. The converted versions of the fonts included in the package for pdfLaTeX do not have access to these ligatures.


text:
Q: Pattern matching natural powers as products I thought that Mathematica would be smart enough to know that f[t]^2 should match a_ * b_ with a and b both taking the value f[t], but it doesn't.
I'm writing some rules for identities involving products. It's mainly finding different ways of doing integration by parts. Am I forced to write separate rules for handling powers, or can Mathematica be persuaded to matchf[t]^2 as a_ * b_?
I would like to handle arbitrarily large natural powers, so f[t]^3 should match a_ * b_ with a as f[t] and b as f[t]^2, or vice versa. f[t]^4 should match as both f[t] * f[t]^3 and f[t]^2 * f[t]^2. I'm using ReplaceList, so the order is unimportant. I want the behaviour to be identical to if the powers were represented as f[t] * f[t] * f[t] ....
If not, is there a nice single pattern I can use to match all cases? I've been looking at Alternatives, but I don't know how to capture the a and b values properly when dealing with the powers forms.

A: By replacing multiplication with NonCommutativeMultiply, which is an associative but noncommutative symbol with no built-in meaning, you can preprocess your expressions in the desired explicit form:
expr = a^3 + b c (1 + c + c^2);

A = Expand[expr] /. {Times -> NonCommutativeMultiply,
                     x_^n_Integer :> NonCommutativeMultiply @@ ConstantArray[x, n]}

(*    b ** c + a ** a ** a + b ** c ** c + b ** c ** c ** c    *)

From here you can continue applying your rules by pattern-matching, for example
A /. {x_ ** y_ ** z_ ** w_ :> func4[x, y, z, w],
      x_ ** y_ ** z_ :> func3[x, y, z],
      x_ ** y_ :> func2[x, y]}

(*    func2[b, c] + func3[a, a, a] + func3[b, c, c] + func4[b, c, c, c]    *)


text:
Q: Can you facet on a indicator variable in ggplot2? types = c("A", "B", "C")
df = data.frame(n = rnorm(100), type=sample(types, 100, replace = TRUE))
ggplot(data=df, aes(n)) + geom_histogram() + facet_grid(~type)

Above is how I normally used facetting. But can I use it when instead of a categorical variable I have a set of columns that are indicator variables such as:
df = data.frame(n = rnorm(100), A=rbinom(100, 1, .5), B=rbinom(100, 1, .5), C=rbinom(100, 1, .5))

Now the "Type" variable from my previous example isn't mutually exclusive. An observation can be "A and B" or "A and B and C" for example. However, I'd still like an individual histogram for any observation that has the presence of A, B, or C?

A: I would reshape the data with tidyr so that data in more that one category are duplicated. filter to remove unwanted cases.
df <- data.frame(
  n = rnorm(100),
  A = rbinom(100, 1, .5),
  B = rbinom(100, 1, .5),
  C = rbinom(100, 1, .5)
)

library("tidyr")
library("dplyr")
library("ggplot2")

df %>% gather(key = "type", value = "value", -n) %>%
  filter(value == 1) %>%
  ggplot(aes(x = n)) +
    geom_histogram() +
    facet_wrap(~type)

A: I've always despised gather, so I'll add another method and one for the data.table fans.
library(data.table)
DT <- melt(setDT(df), id= "n", variable = "type")[value > 0]
ggplot(DT,aes(n)) + geom_histogram() + facet_grid(~type)

#tidyland
library(reshape2)
library(dplyr)
library(ggplot2)
df %>%
  melt(id = "n", variable = "type") %>%
  filter(value > 0) %>%
  ggplot(aes(n)) + geom_histogram() + facet_grid(~type)


text:
Q: Invertible Elements of $\mathbb{Z}_{n}$ I have the following problem that I am stuck on.
Assume $n>1$ and let $U(\mathbb{Z}_{n})$ be the set of invertible elements of $\mathbb{Z}_{n}$ as a quotient ring. Show that $U(\mathbb{Z}_{n})$ consists of those elements $\overline{x}=x+n\mathbb{Z}$ for which $gcd(x,n)=1$.
My work so far: Let $\overline{x}\in U(\mathbb{Z}_{n})$. Then $\exists$ $\overline{y}\in\mathbb{Z}_{n}$ such that $\overline{x} \cdot\overline{y}=\overline{xy}=\overline{1}$. Thus, we have $xy-1=kn$ in $n\mathbb{Z}$ for some $k\in\mathbb{Z}$.......
I'm not sure how to go from here. Am I even on the right track? Thanks in advance for any help!

A: You have it right, you just miss the main asset to solve this problem which is the Bezout identity.
It states that there  always exists $(a,b)\in\mathbb Z^2$ such that $ax+bn=\gcd(x,n)$. In addition, $\gcd(x,n)$ is also the smallest positive number achievable by linear combination of $x$ and $n$ (for $a,b$ not both zero of course).
Here is a thread, I participated to recently, but there may be others, Bezout is a popular tool:
Understanding the Existence and Uniqueness of the GCD
Once you get this, $x$ invertible leads to $\exists a\in\mathbb Z\mid ax\equiv 1\pmod{n}\iff \exists k\in\mathbb Z\mid ax=1+kn$ and finally there exists $(a,k)\in\mathbb Z^2$ such that $ax+(-k)n=1\iff \gcd(x,n)=1$.


text:
Q: Exiting a loop in my python function when a specific value is empty I am having a problem with needing to skip this iteration when the variable queue is blank/empty.
What I am trying to do is is end the function so that the loop that is using the function process_zip_file can move on to the next file.
What happens is I open a csv file and look at the header rows to build out a directory path. I get a payload sometimes that has an empty record in the CSV so I just need to skip this itaration.
When it gets to this line:
 queue_dir_path = os.path.join(output_dir_path, queue)
This is were I have the issue. and get the error:

queue_dir_path = os.path.join(output_dir_path, queue)
UnboundLocalError: local variable 'queue' referenced before assignment

How can I do this?
    # setting today as the date to name the ouput directory
    today = date.today()
    # joining the output_root_dir_path and today as the output directory
    todays_dir_path = os.path.join(output_root_dir_path, today.strftime("%m%d%Y"))

    logging.debug("Checking for directory: {}".format(todays_dir_path))
    # if the directory does not exist, create it
    if not os.path.isdir(todays_dir_path):
        logging.debug("{} not found - creating".format(todays_dir_path))
        os.makedirs(todays_dir_path)
    # creating a temp directory to unzip the zip file
    tempdir = tempfile.mkdtemp(dir=output_root_dir_path + '\\tmp', prefix="TEMP")

    logging.debug("Created temporary directory: {}".format(tempdir))
    # building the path to the unzipped file
    new_zip_file_path = os.path.join(tempdir, os.path.basename(zip_file_path))

    logging.debug("Moving ZIP file: {} -> {}".format(zip_file_path, new_zip_file_path))
    # moving the zip file to the temp directory
    shutil.move(zip_file_path, new_zip_file_path)

    logging.info("ZIP file moved to: {}".format(new_zip_file_path))

    tempdir2 = os.path.join(tempdir, str(time.time()))
    os.mkdir(tempdir2)
    # unzipping the file into the temp directory
    try:
        zip_f = zipfile.ZipFile(new_zip_file_path)
    except Exception as e:
        logging.error("Failed opening zip file with error: {}".format(e))
        return
    # setting csv to an empty list
    csv_file_path = None
    # looping through the files in the zip file
    for file in zip_f.namelist():
        zip_f.extract(file, path=tempdir2)

        extracted_path = os.path.join(tempdir2, file)
        # if the file is a csv file, set the csv_file_path to the extracted path
        if file.endswith(".csv") and os.path.isfile(extracted_path):
            csv_file_path = extracted_path
    # setting the output file path
    output_dir_path = os.path.join(
        output_root_dir_path, os.path.join(today.strftime("%m%d%Y"))
    )

    logging.debug("Output dir path: {}".format(output_dir_path))
    # if the output_dir_path is not a directory
    if not os.path.isdir(output_dir_path):
        #log that we are creating, and create the directory
        logging.debug("Creating output dir")
        os.makedirs(output_dir_path)
    # no idea why they use assert here Jason
    assert csv_file_path is not None
    # define a dictionary of record id's
    record_ids_by_filename = dict()
    queue_by_filename = dict()
    # open the csv file and read it
    csv_f = open(csv_file_path, "r", encoding="utf-8")
    csv_reader = csv.DictReader(csv_f)
    #loop through the rows in the csv file
    for row in csv_reader:
        record_id = row.get("RECORDDETAILID")
        pdf_filename = row.get("PRODUCT")
        queue = row.get("QUEUE")
        #
        if record_id is None or pdf_filename is None:
            continue
        record_ids_by_filename[pdf_filename] = record_id
        if queue is not None:
            queue_by_filename[pdf_filename] = queue
        logging.debug(row)
    queue_dir_path = os.path.join(output_dir_path, queue)
    if not os.path.isdir(queue_dir_path):
        os.makedirs(queue_dir_path)
    new_csv_file_path = os.path.join(queue_dir_path, os.path.basename(csv_file_path))
    logging.info("Copying CSV file: {} -> {}".format(csv_file_path, new_csv_file_path))
    shutil.copy(csv_file_path, new_csv_file_path)
    output_zip_file_path = os.path.join(queue_dir_path, os.path.basename(new_zip_file_path))
    logging.info(
        "Copying ZIP file: {} -> {}".format(new_zip_file_path, output_zip_file_path)
    )
    shutil.copy(new_zip_file_path, output_zip_file_path)
    for root, dirs, files in os.walk(tempdir2):
        for f in files:
            record_id = record_ids_by_filename.get(f)
            queue = queue_by_filename.get(f)
            if record_id is None or queue is None:
                continue
            f = os.path.join(root, f)
            # TODO This is a possible point to assemble the
            record_dir_path = os.path.join(
                output_dir_path, os.path.join(queue, record_id)
            )
            if not os.path.isdir(record_dir_path):
                logging.info("Creating directory: {}".format(record_dir_path))
                os.makedirs(record_dir_path)
            new_filepath = os.path.join(record_dir_path, os.path.basename(f))
            logging.info("Moving PDF file: {} -> {}".format(f, new_filepath))
            shutil.move(f, new_filepath)

    logging.info("Removing temporary directory {}...".format(tempdir))
    os.chdir(output_root_dir_path)
    #shutil.rmtree(tempdir)
    return tempdir

A: The error says it all. The queue variable is undefined. queue's scope is inside the loop, and you are using it outside. Either define it or use it in the right scope.

A: Your error is in the queue variable and is in the loop's scope which means that it can only be used in the loop. Use it in the correct scope by either making it global in some way(bad practice) or use it in the right scope.


text:
Q: Logging using Log4j.xml in Glassfish I was using WAS as my application server for deploying ear project.Presently changed to Glassfish. I am using log4j.xml file for logging. Logging is not working in Glassfish.
Is there any dependency in using log4j.xml with glassfish.
Any suggestions/pointers is appreciated

A: If your log4j library is included within your EAR file, then check your app server's JVM properties to ensure the log4j.configuration property is set:

*

*Login to the Glassfish Admin Console (http://[hostname]:4848/)

*For your server, navigate to Configuration > JVM Settings > JVM Options

*If an entry for -Dlog4j.configuration exists, verify that it contains the location of your log4j.xml file

*If an entry do not exist for -Dlog4j.configuration, create one.  It must follow the following template: -Dlog4j.configuration=file:///path/to/your/log4j.xml


text:
Q: import mysql.connector ModuleNotFoundError: No module named 'mysql' In my program, I use import mysql.connector, but it doesn't work.
I saw other similar issues but they didn't help.
When I try to import in the python interpreter(version: 3.9.6) it works but when I use it in a code it is not.

A: windows:
python -m pip install mysql-connector-python

Linux (Debian):
sudo -m pip install mysql-connector-python

python code:
import mysql.connector as mysql
mysql.connect(host="server-ip-here", user="mysql-username-here", password="mysql-password-here", database="database-name-here")


text:
Q: PHP: visualize your app workflow and function to function relation i'm searching for a software that would help me visualize my application workflow, and function to function relation.
i'm using codeigniter, and my app is growing bigger and bigger ever day, and as i'm working alone. i'm starting to get schizophrenic !
today i'm a building db models, tomorrow may be view js, and html, day after controllers, etc..
so will all this going around i started to forget how i did this or that.. and i have to go back and forth reading my old code.. along with too many replicated functions that i find every day and have to fix.
Need to :

*

*Chart application workflow

*Help me visualize my class's methods, and there relations with other class's

I'm currently keeping my docs and charts in an .docx file, which is painful, and doesnt help alot !.
i'm not a prof. developer, its my hobby since childhood. so i have never saw how application design and architecture should be build. instead i just dive in and brain storm !, so i need to grow up ! would appreciate if you can point me on right direction of how i can stop brain storming and move into more prof. way .

A: Consider using a Sankey Diagram to help visualize workflow.

I've seen hierarchy charts used to depict workflow (as you have illustrated in your question), but always thought they were missing something--nodes that can have two parents, for example. A Sankey diagram solves that problem, and provides a trivial way to introduce the concept of how much volume moves between "nodes". Also, by definition, a flowchart is "a type of diagram that represents a workflow or process". The Sankey diagram looks like it's flowing much more than a hierarchy chart.
For more information, check out David Pallmann's convincing case for using Sankey diagrams to visualize workflow.
I was able to create this workflow visualization in 10 minutes by forking the Highcharts's Sankey demo and customizing the series data to the following:
    data: [
        ['Event Submission', 'Event Submission Close', 250],
        ['Event Submission', 'Create Incident', 750],
        ['Event Submission Close', 'Approve', 240],
        ['Event Submission Close', 'Reject', 10],
        ['Approve', 'After Action Review', 640],
        ['Create Incident', 'Contained', 400],
        ['Create Incident', 'Provide Analysis', 150],
        ['Create Incident', 'Incident Close', 125],
        ['Contained', 'Containment Approval', 370],
        ['Contained', 'Containment Rejection', 30],
        ['Incident Close', 'Approve', 110],
        ['Incident Close', 'Reject', 15],
        ['Containment Approval', 'Eradicated', 320],
        ['Containment Approval', 'Provide Analysis', 50],
        ['Eradicated', 'Eradication Approval', 315],
        ['Eradicated', 'Eradication Rejection', 5],
        ['Eradication Approval', 'Recovered', 315],
        ['Eradication Approval', 'Provide Analysis', 5],
        ['Recovered', 'Approve', 310],
        ['Recovered', 'Reject', 5]
    ]

So, in your case, if you can find something that will automagically map how your elements are associated with each other, you need only format those mappings into the above syntax and Highcharts will be able to do the rest!