text:
Q: Initializing edges with dijkstra's algorithm I am confused on how to initialize my Pointer (edge) class when implementing my Dijkstra's algorithm. The Node class holds an ArrayList of Pointer's called neighbors, which represent the 4 neighbors on any side of the Node. My Pointer class takes the target Node (where it's pointing) as an argument in the constructor. They are all added to a 36x25 2-dimmentional array of Nodes.
As of now I am using a setNeighbors() method ran through each node constructed on a 36x25 grid once all have been constructed, which searches through every possible Node as much as 4 times depending on its relevance in the grid (a corner has 2 neighbors), and breaks once the neighbor is found by comparing (x,y) coordinates.
This initialization process takes entirely too long for my purpose so I wanted to know if anyone can show me a way that would do this initialization if a more efficient manner.
I have a class Node:
import java.util.ArrayList;

public class Node implements Comparable<Node>
{
     public int x;
     public int y;
     public ArrayList<Pointer> neighbors = new ArrayList<Pointer>();
     public double minDistance = Double.POSITIVE_INFINITY;
     public Node previous;

     public Node(int xPos, int yPos)
     {
        x = xPos;
        y = yPos;
     }

     public int compareTo(Node other)
     {
        return Double.compare(minDistance, other.minDistance);
     }
}

And a class Pointer:
public class Pointer
{
     public final Node target;
     public final double weight = 1;
     public Pointer(Node targ)
     {
       target = targ;
     }
}

A: Well you can let the grid represent something like a square grid with a lower and upper bound on both x and y, you could then create a recursive method where you initialize a node at (x,y) and that initialized node will initialize its north/west/south/east neighbors if those nodes x,y positions are still within the grid, else you have hit the wall and you cannot intialize any more in that direction. The problem here is what Pointer does, it seems like a class that complicates things. If the grid is square you can keep
Node north;
Node west
Node south
Node east

fields in your Node class.
If the grid is not square you can still keep a
List<Node> connectedTo


text:
Q: Why isn't this ideal equal to $0$? Let $I$ be a maximal ideal in $K[X,Y]$, where $K[X,Y]$ is the polynomial ring in two indeterminates over a field $K$. I would like to prove that at least one of $I \cap K[X]$ and $I \cap K[Y]$ is not equal to the zero ideal.
I think that if $I \cap K[X]=I \cap K[Y]=0$, then this assumption causes a contradiction with $I$'s maximality. However, I can't prove it.
Would you have any hints or ideas?
Thank you.

A: [Updated due to comment below from Lukas Hager.]
This follows from the Zariski Lemma. Zariski says that any finitely-generated field extension is a finite(-dimensional) extension.
You actually get that $I\cap K[x]\neq 0$ and $I\cap K[y]\neq 0.$
Even more generally, for any non-constant $f(x,y)\in K[x,y],$ $I\cap K[f(x,y)]\neq 0.$
Since $I$ is maximal, $k=K[x,y]/I$ is a finitely generated field extension of $K,$ and thus finite-dimensional.
If $n$ is the dimension, and $\overline x$ is the image of $x$ in $k,$ then $1,\overline x,\overline x^2,\dots,\overline x^n$ are not linearly independent over $K,$ so for some non-zero $q(x)\in K[x],$ $q(\overline x)=0$ But that means $q(x)\in I.$
This proves the same for maximal ideals of $K[x_1,x_2,\dots,x_m]$ for any $m.$ Indeed, Zariski's Lemma is equivalent to this general case.
Of course, if this were an exercise before knowing Zariski, this answer would be inadequate without also proving Zariski...

My Original Post
Not an answer, but we can show that if $I\cap K[x]\neq 0$ then $I\cap K[y]\neq 0.$
Let $k=K[x,y]/I$ be the quotient. Since $I$ is maximal, $k$ is a field extension of $K.$ Let $\overline x,\overline y$ be the images of $x,y$ in $K.$
Since $I\cap K[x]$ is an ideal in $K[x],$ if it is non-zero, let there is an irreducible $q(x)\in K[x]$ such that $q(\overline x)=0$ in $k.$ So $\overline x$ is algebraic over $K.$
If $I= \langle q(x)\rangle,$ then $I$ is not maximal, because we can find a bigger ideal, $\langle q(x),y\rangle.$
So some $f(x,y)\in I$ is not divisible by $q(x).$
Write $f$ as a polynomial in $K[x][y],$ so $$f(x,y)=\sum_{i=0}^n a_{i}(x) y^i.$$
Then not all the $a_i(x)$ are divisible by $q(x),$ so $g(y)=f(\overline x,y)$ is a non-zero polynomial in $K[\overline x][y],$ and $g(\overline y)=f(\overline x,\overline y)=0.$
So $\overline y$ is algebraic over $K(\overline x)$ and $\overline x$ is algebraic over $K,$ so $\overline y$ is algebraic over $K,$ and thus some non-zero $p(y)\in I.$

This means that your statement is equivalent to the statement:

If $I$ is a maximal ideal in $K[x,y]$ then $K[x,y]/I$ is a finite  extension of $K.$

A: Let $\mathfrak{m}$ be maximal such that $\mathfrak{m} \cap K[X] =0$, then $x$ (which I'll use as notation for the class of $X$ in $K[X,Y]/\mathfrak{m}$, same for $y$ and $Y$) is transcendental over $K$.
Case 1: $y$ is transcendental over $K(x)$, then we have that $K[X,Y]/\mathfrak{m}$ contains both $K(x)$ and $K(y)$. But $K[X,Y]/\mathfrak{m}$ is generated as an algebra by $X$ and $y$, so we get that $K[X,Y]/\mathfrak{m}=K(x)(y)=K(x,y)\cong K(X,Y)$
Case 2: $y$ is algebraic over $K(x)$, so $K[X,Y]/\mathfrak{m}$ is a finite extension of $K(x)$.
I claim that in both cases, $K[X,Y]/\mathfrak{m}$ is not finitely generated as a $K$-algebra, which is a contradiction. In the first case, this is easy: there are infinitely many irreducible polynomials in $K[X,Y]$, so considering the collection $\{\frac{1}{p}\}$, where $p$ runs over the irreducble polynomials gives the result.
In the second case: Apply the Artin-Tate lemma (which has a short and elementary proof, see the link), to see that $K(x) \cong K(X)$ is a finitely generated algebra. As in the first case, there are infinitely many irreducible polynomials in $K[X]$, so the same argument gives a contradiction.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Angular Material: display matError with matTooltip I want to display the validation error with inside a bubble under the input, which is visible as long as the user focuses the element.
Obviously this is not an easy task, and I gave up on my first try to do this only with CSS (cannot make it overly certain elements, what if the element is at the end of the page etc.).
So I went back to the angular page and found the matTooltip, which behaves exactly as I want. (on top of other element, changes position when at the end of the page etc.) :) However I'm stuck on how to best combine those two.
matError is tightly coupled with matFormField, matTooltip is more or less independent.
Has somebody tried this or something similar?

A: You can use it combining matTooltip and matTooltipDisabled:
<div class="example-container">
  <mat-form-field>
    <input
      matInput
      placeholder="Enter your email"
      [formControl]="email"
      [matTooltip]="getErrorMessage()"
      [matTooltipDisabled]="!email.invalid">
  </mat-form-field>
</div>

The Stackblitz example: https://stackblitz.com/edit/angular-lpnqm5
Hope it helps!


text:
Q: Is it possible to imply the name of the parameters of a params array using the nameof operator? I thought I could make use of the new c# 6 operator nameof to build a dictionary of key/values implicitly from a params array.
As an example, consider the following method call:
string myName = "John", myAge = "33", myAddress = "Melbourne";
Test(myName, myAge, myAddress);

I am not sure there will be an implementation of Test that will be able to imply the name of the elements, from the params array.
Is there a way to do this using just nameof, without reflection ?
private static void Test(params string[] values)
{
    List<string> keyValueList = new List<string>();

    //for(int i = 0; i < values.Length; i++)
    foreach(var p in values)
    {
        //"Key" is always "p", obviously
        Console.WriteLine($"Key: {nameof(p)}, Value: {p}");
    }
}

A: No, that is not possible. You don't have any knowledge of the variables names used. Such information is not passed to the callee.
You could achieve what you want like this:
private static void Test(params string[][] values)
{
    ...
}

public static void Main(string[] args)
{
    string myName = "John", myAge = "33", myAddress = "Melbourne";
    Test(new string[] { nameof(myName), myName });
}

Or using a dictionary:
private static void Test(Dictionary<string, string> values)
{
    ...
}

public static void Main(string[] args)
{
    string myName = "John", myAge = "33", myAddress = "Melbourne";
    Test(new Dictionary<string, string> { { nameof(myName), myName }, { nameof(myAge), myAge} });
}

Or using dynamic:
private static void Test(dynamic values)
{
    var dict = ((IDictionary<string, object>)values);
}

public static void Main(string[] args)
{
    dynamic values = new ExpandoObject();
    values.A = "a";
    Test(values);
}

Another possibility would be the use of an Expression, which you pass in to the method. There you could extract the variable name from the expression and execute the expression for its value.


text:
Q: Is there a way to use the UIImagePickerController with your own images? I was wondering if there is a way to make a UIImagePickerController use a collection of images that you specify (in other words I make 10 photos of doorbells and make the UIImagePickerController show me those photos and let the user select one).
In other words, a custom photo gallery is where I'm heading. Is there a way that I can do this?

A: As St3fan already mentioned, you can't use the UIImagePickerController for your own images.
Instead, why don't you try to use the JPImagePickerController which is developed by Jeena Paradies.
This class is a UIImagePickerController clone and allows you to use external images both your own local images or images on the web.
In fact, Three20 framework is more powerful, but JPImagePickerController is simpler and easier to use.

Check out http://github.com/jeena/JPImagePickerController

A: No, but the Three20 framework (used by the Facebook app) contains an open source implementation that you can use in your own application. It does exactly what you want (and more).
Check out http://github.com/facebook/three20/

A: Kinda late to the party here, but I made an even simpler control that does exactly this:
https://github.com/whalefood/WFImagePickerPlus


text:
Q: How to check the whether the android device has google play services running on 10.2 or greater As per the documentation on official page of google the SMSRetriever api needs google play services min 10.2 on device.

Prerequisites
The SMS Retriever API is available only on Android devices with Play
  services version 10.2 and newer.
  https://developers.google.com/identity/sms-retriever/request#2_start_the_sms_retriever

How to implement the check for that ? I have also checked the method
public int isGooglePlayServicesAvailable (Context context, int minApkVersion)

of GoogleApiAvailability class. But now again what will be value of minApkVersion in case of google play services 10.2. Any one please let me know how to implement this in a best way.

A: SmsRetrieverClient follows the newer GoogleApi connection pattern so you shouldn't have to worry about the version compatibility as the underlying framework handles all the resolution for you.
It may actually be better UX to specifically handle the failure case as well by adding listeners to these Task-returning API calls (https://developers.google.com/android/reference/com/google/android/gms/tasks/Task) instead of checking for availability beforehand.

A: Just a work around to get the version comparision done.
 public boolean onCreate(Bundle savedInstanceState){
            super.onCreate(savedInstanceState);
            if (googlePlayServiceEnabled() && isWithSMSRetrieverSupportedPlayServiceVersion()){
                //Good to go
                return true;
            }
            else{
                return false;
            }
    }

Checks if GooglePlay Service is Enabled and Displays proper error dialog on errors.
private boolean googlePlayServiceEnabled() {
        try {
            GoogleApiAvailability instance = GoogleApiAvailability.getInstance();
            int responseCode = instance.isGooglePlayServicesAvailable(context);
            switch (responseCode) {
                case ConnectionResult.SUCCESS:
                    return true;
                default:
                    Dialog errorDialog = instance.getErrorDialog(this, responseCode, 123);
                    errorDialog.setCancelable(false);
                    errorDialog.show();
                    break;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
}

Implicitly gets the installed play services version and compares it with 10.2
private boolean isWithSMSRetrieverSupportedPlayServiceVersion() {
        try {
            PackageInfo pi = getPackageManager().getPackageInfo(GoogleApiAvailability.GOOGLE_PLAY_SERVICES_PACKAGE, 0);
            if (pi == null)
                return false;
            if (pi.versionName == null || pi.versionName.isEmpty())
                return false;

            String playServicesVersion = pi.versionName;
            return isPlayServicesVersionValidForSMSRetriever(playServicesVersion);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

public static boolean isPlayServicesVersionValidForSMSRetriever(String v) {
        try {
            String index1 = v.substring(0, v.indexOf('.', 0));

            int versionInt1 = Integer.parseInt(index1);
            if (versionInt1 < 10)
                return false;
            else if (versionInt1 == 10) {
                String index2 = v.substring(3, 4);
                int versionInt2 = Integer.parseInt(index2);
                if (versionInt2 < 2) {
                    return false;
                } else {
                    return true;
                }
            } else
                return true;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }

A: I know this is an old question, and already answered. But I need to write this for the record.

Situation:
In my case, galaxy S2 (google play service version 3.1.59), I couldn' get response from neither addOnSuccessListener nor addOnFailureListener. Also, addOnCompleteListener or addOnCanceledListener was not called.

What I tried:
I want use isGooglePlayServicesAvailable with minApkVersion, but there was no version history list of google play service!

My solution is
Use isGooglePlayServicesAvailable without minApkVersion. I mean the deprecated method. In that method, it is checking google play version with GOOGLE_PLAY_SERVICES_VERSION_CODE, and this is the google play service of installed one.
@HideFirstParty
@KeepForSdk
public int isGooglePlayServicesAvailable(Context var1) {
    return this.isGooglePlayServicesAvailable(var1, GOOGLE_PLAY_SERVICES_VERSION_CODE);
}


text:
Q: TemplateDoesNotExist at / template not defined I have tried to set-up my first simple CBV in Django but despite reading literally all related information and trying out all possible path options to my index.html I receive the same message from above. Last version follows:
Python-Version: 3.9.13
Django: 4.1
**urls.py**

from django.urls import path
from core.views import Servicelist

urlpatterns = [
path('', Servicelist.as_view(), name='service')
]

**views.py**

from core.models import Item
from django.views.generic.list import ListView

class Servicelist(ListView):
    model = Item
    template_name:'paraticosmetics/index.html'
    context_object_name = "items"

    I receive message that index is not defined Pylance(reportundefinedVariable)

  **setting.py**

**setting.py**

INSTALLED_APPS = [
    "django.contrib.admin",
    "django.contrib.auth",
    "django.contrib.contenttypes",
    "django.contrib.sessions",
    "django.contrib.messages",
    "django.contrib.staticfiles",
    'django.contrib.sites',
    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'core.apps.CoreConfig',
     ]

 TEMPLATES = [
    {
          "BACKEND": "django.template.backends.django.DjangoTemplates",
          "DIRS": [BASE_DIR/'core/templates/paraticosmetics/'],
          "APP_DIRS": True,
   ....

A: Is your app called 'paraticosmetics'?  Try adding that to your INSTALLED_APPS list
 'core.apps.CoreConfig',
 'paraticosmetics',
 ]

A: template_name:'paraticosmetics/index.html'
This line might be them problem you need = (a variable assignment) instead of : ( a type definition )
If not, show us the values of BASE_DIR, TEMPLATES and your project's directory structure.


text:
Q: Permanently delete file from google drive How permanently delete file on google drive using google script
I find only method setTrashed. It moved file into Trash, but how remove file permanently

A: Apps Script has the ability to access Google API's, but you need to explicitly enable them before they can be used.
The Drive API, can be used to delete a file.
Drive API - Delete
The Drive API method is Remove method instead of Delete.
To enable the Drive API, open the Resources menu, then choose the Advanced Google Services, and a menu will pop up. You need to click the Drive API service. Make sure that the green "ON" text is showing.

Once you've done that, you can use the auto-complete in the code editor to see what is available for methods. When you type the word "Drive" in the code editor, then enter a period, a context menu will appear. Then you can choose Files, etc.
Drive.Files.remove(fileId);

NOTE:
Take note of the link: Google Developers Console
You must visit your Console, and enable the services there also.  And it looks like the only way you can get to your Apps Script Project in the Console is through the link in that Advanced Google Services pop up window.  Going to the Google console without the correct project number in the URL fails to show your Apps Script project.
You can get to the console with:
Google Console
But that is a dead end because it doesn't show the Apps Script projects that you own.


text:
Q: Android live streaming using wowza + libstreaming I wanted to stream live video with the help of the wowza server. Currently am using libstreaming along with wowza and it works fine.
It works fine with WiFi. 4mbps speed.
But Problem comes when it is connected to 3G, even when it is at least resolution -> 320x240. It gets pixelated, faded, and sometimes stops.
Is there anything i can do stuff like buffering the video rather getting pixelated/faded/poor quality video ?
Is there any API other than libstreaming ?
Thanks

A: Can you measure the actual bandwidth your service provider gives to you for streaming protocol over 3G? Some SPs deliberately give less priority to streaming (or torrent).
My idea is that this might be the root cause..


text:
Q: Why does animationend/webkitAnimationEnd event have a delay before it's called? When i listen to animationend, it is fired after a delay. You can see the animation complete (the div is moved into the correct spot), yet the event doesn't fire for another 300-500ms.
JSFiddle: https://jsfiddle.net/9q0scpa0/4/
Why is this?
HTML:

    Page 1

Page 1

Page 1

Page 1

    Page 1

Page 1

Page 1

    Page 1

Page 1

Page 1

    Page 1

Page 1

Page 1

    Page 2

CSS:
*
{
  margin: 0em;
  padding: 0em;
}

html
{
  height: 100%;
  width: 100%;
}

body
{
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.page
{
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: red;
}

@keyframes moveNext
{
  0% {
    transform: translate(0em,100%);
    -webkit-transform: translate(0em,0%);
    -moz-transform: translate(0em,0%);
  }

  100% {
    transform: translate(0em,-100%);
    -webkit-transform: translate(0em,-100%);
    -moz-transform: translate(0em,-100%);
  }
}

@keyframes movePrevious
{
  0% {
    transform: translate(0em,-100%);
    -webkit-transform: translate(0em,-100%);
    -moz-transform: translate(0em,-100%);
    display: block;
  }

  100% {
    transform: translate(0em,0%);
    -webkit-transform: translate(0em,0%);
    -moz-transform: translate(0em,0%);
  }
}

#page1.leave
{
  z-index: 0;
  animation-name: moveNext;
  -webkit-animation-delay: 200ms;
  animation-delay: 200ms;
  animation-duration: 800ms;
  animation-iteration-count: 1;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

#page2.enter
{
  background-color: blue;
  z-index: 1;
  animation-name: moveNext;
  animation-duration: 750ms;
  animation-iteration-count: 1;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

#page1.enter
{
  z-index: 0;
  animation-name: movePrevious;
  animation-duration: 800ms;
  animation-iteration-count: 1;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

#page2.leave
{
  background-color: blue;
  z-index: 1;
  animation-name: movePrevious;
  -webkit-animation-delay: 200ms;
  animation-delay: 200ms;
  animation-duration: 750ms;
  animation-iteration-count: 1;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

JavaScript:
var isMoveNext = true;
var page1 = document.getElementById( "page1" );
var page2 = document.getElementById( "page2" );

window.restart = function()
{
  //Moving next
  if ( isMoveNext )
  {
    page1.className = "page leave";
    page2.className = "page enter";
    isMoveNext = false;
  }

  else
  {
    page1.className = "page enter";
    page2.className = "page leave";
    isMoveNext = true;
  }
}

page1.addEventListener( "animationend", function(event) { console.log( "page 1" ); }, false );
page2.addEventListener( "animationend", function(event) { console.log( "page 2" ); }, false );
page1.addEventListener( "webkitAnimationEnd", function(event) { console.log( "page 1" ); }, false );
page2.addEventListener( "webkitAnimationEnd", function(event) { console.log( "page 2" ); }, false );
page1.addEventListener( "MSAnimationEnd", function(event) { console.log( "page 1" ); }, false );
page2.addEventListener( "MSAnimationEnd", function(event) { console.log( "page 2" ); }, false );

A: It's due to the easing. Even if the animation looks close to done, it's still moving very small amounts until it hits some threshold which snaps it to the end value. This threshold is intentionally kept very small to prevent visible snapping when easing out.
If you switch the easing to linear the animationend event should fire as soon as the animation visually reaches the end.


text:
Q: jQuery: physical click on one siblings child to trigger virtual click on other siblings child Im trying and trying to get my script to work, but I just cant.. Here's my code:
HTML: http://pastebin.com/5s2n2C4X
jQuery: http://pastebin.com/Xh0dAy6A
The problem: It's for a portfolio. When I click the item trigger, a popupanimation is triggered to display the info about that specific item. I want to add arrows (trigger next/prev item (line 51-57 jQuery)). As it is right now, I can without any trouble click on the actual item trigger and get the project that I clicked on. When that is showing, I can click on the other items, and it then closes the current window and opens the new one. Perfect, just the way I want it. But.. If I, god forbid, click on the arrows it simply won't work. It closes the current window (like it should), and opens the new one (like it should) for just a couple of milliseconds before closing it straight away (not the way it should be..).
Does anyone have a clue as how to solve this extremely irritating problem? Thank you so much in advance!

A: When all you want to do is change what is displayed in the popup, you should do that, rather than go through the process of first closing the current popup, then opening a new one.
Here is an extremely simplified example of doing that:
http://jsfiddle.net/7jK4t/


text:
Q: removeClass() срабатывает только один раз Есть форма с одним input. При submit, если input пуст, я добавляю к нему эффект подрагивания с помощью соответствующего CSS класса (.shake). Эффект shake делаю используя CSS Animation и keyframes.
$('form').on('submit', function(event){
   event.preventDefault();
   var input = $('input').removeClass('shake');

   if (!input.val()) {
      input.addClass('shake');
   }
})

Эффект виден каждый раз когда я присваиваю класс .shake к элементу. Поэтому, если input уже имеет класс .shake (от предыдущих действий), то вначале я его удаляю.
Проблема: Удаление и присваивание класса каждый раз происходит как нужно, но эффект видел только один раз. При этом, в режиме отладки скрипта, при пошаговом выполнении все работает хорошо. Эффект виден при каждом нажатии.
В чем может быть проблема?


text:
Q: Plotting n-many lines on a ListLinePlot with Epilog information I have a graph that I made that has 2 sets of data, and plots these as 2 lines using LineLinePlot, does some simple calculations and writes these as an Epilog on the plot.

However, this was done by hand, there's just 2 sets of all the code. Which made me start thinking, how would I go about generalising this to n-many data sets, so I could just enter the stack of data, and the code would produce that line and it's calculations and epilog box (I appreciate I might run into problems with limited space on the graph to put the epilog boxes - I guess they could be put to the right hand side off the graph)
Would it use a loop in some way?
Current 'manual' version for 2 lines included below (minimised where i can):
dataSet = {{63, 1.26}, {92, 1.74}, {156, 1.88}, {250, 2.33}, {317,
    2.69}, {351, 2.85}, {357, 3.42}, {391, 3.43}, {422, 3.44}};
dataSet2 = {{50, 0.55}, {167, 1.6}, {169, 2.47}, {182, 3.2}, {227,
    3.32}, {232, 3.39}, {262, 3.91}, {281, 1.26}, {310, 1.74}, {374,
    1.88}, {468, 2.33}, {535, 2.69}, {575, 3.42}, {609, 3.43}, {640,
    3.44}};

set[1] = Cases[dataSet, {x_, y_} /; x < 423];
set[2] = Cases[dataSet2, {x_, y_} /; x < 263];
set[3] = Cases[dataSet2, {x_, y_} /; x > 264];

avgCurrent =
 Integrate[
     Interpolation[dataSet, InterpolationOrder -> 1][x], {x,
      dataSet[[1, 1]], dataSet[[-1, 1]]}]/(Subtract @@
      dataSet[[{-1, 1}, 1]]) // N // SetPrecision[#, 3] &
maxCurrent = MaximalBy[dataSet, Last][[1, 2]];
noPoints = Length[dataSet];
lifeTime = dataSet[[-1, 1]];

avgCurrent2 =
 Integrate[
     Interpolation[dataSet2, InterpolationOrder -> 1][x], {x,
      dataSet2[[1, 1]], dataSet2[[-1, 1]]}]/(Subtract @@
      dataSet2[[{-1, 1}, 1]]) // N // SetPrecision[#, 3] &
maxCurrent2 = MaximalBy[dataSet2, Last][[1, 2]];
noPoints2 = Length[dataSet2];
lifeTime2 = dataSet2[[-1, 1]];

ListLinePlot[{set[1], set[2], set[3]},
 PlotRange -> {{0, 700}, {0, 6}},
 PlotStyle -> {Directive[RGBColor[0.4, 0.5, 0.6],
    AbsoluteThickness[2.5]],
   Directive[RGBColor[0.8, 0.5, 0.6], AbsoluteThickness[2.5]],
   Directive[RGBColor[0.8, 0.5, 0.6], AbsoluteThickness[2.5]]},
 PlotTheme -> "Detailed",
 Epilog -> {{Blue, AbsolutePointSize[4], Point[dataSet]}, {Dashed,
    Line[{{262, 3.91`}, {281, 1.26`}}]}, {Purple,
    AbsolutePointSize[4], Point[dataSet2]},
   Inset[Framed[
     Grid[{{Style["Cathode 284 - Drilled",
         Bold]}, {"Average Current: ", avgCurrent,
        " \[Mu]A"}, {"Maximum Current: ", maxCurrent,
        " \[Mu]A"}, {"Active Cathode Lifetime: ", lifeTime,
        "minutes"}, {"Number of Data Points: ", noPoints}}],
     Background -> White, RoundingRadius -> 5], Scaled[{.40, .85}]],
   Inset[Framed[
     Grid[{{Style["Cathode 285 - Undrilled", Bold,
         TextAlignment -> Center]}, {"Average Current: ", avgCurrent2,
         " \[Mu]A"}, {"Maximum Current: ", maxCurrent2,
        " \[Mu]A"}, {"Active Cathode Lifetime: ", lifeTime2,
        "minutes"}, {"Number of Data Points: ", noPoints2}}],
     Background -> White, RoundingRadius -> 5], Scaled[{.80, .85}]]},
 PlotLabel ->
  "Current Yield: Drilled Iron Cathode vs. Undrilled Iron Cathode",
 PlotLegends ->
  Placed[LineLegend[{"Iron (Cathode 284 - Drilled)",
     "Iron (Cathode 285 - Undrilled)"},
    LegendFunction -> "Panel"], {0.80, 0.28}],
 LabelStyle -> {Black, Bold}, Frame -> {{True, False}, {True, False}},
  FrameLabel -> {"Cathode Runtime (minutes)", "Current (\[Mu]A)"},
 ImageSize -> {550, 550}, InterpolationOrder -> 1]

A: Clear["Global`*"]

n = 2;

Use indexed variables, e.g., dataSet[2] rather than dataSet2. This will facilitate mapping of repetitive code.
dataSet[1] = {{63, 1.26}, {92, 1.74}, {156, 1.88}, {250, 2.33}, {317,
    2.69}, {351, 2.85}, {357, 3.42}, {391, 3.43}, {422, 3.44}};
dataSet[2] = {{50, 0.55}, {167, 1.6}, {169, 2.47}, {182, 3.2}, {227,
    3.32}, {232, 3.39}, {262, 3.91}, {281, 1.26}, {310, 1.74}, {374,
    1.88}, {468, 2.33}, {535, 2.69}, {575, 3.42}, {609, 3.43}, {640, 3.44}};

Automatically detect the break in the data
data = Sequence @@@ (Split[#, #1[[2]] < #2[[2]] &] & /@ (dataSet /@
       Range[n]));

Evaluate[set /@ Range[Length@data]] = data;

(avgCurrent[#] =
     SetPrecision[
      Integrate[
        Interpolation[dataSet[#],
          InterpolationOrder -> 1][x],
        {x, dataSet[#][[1, 1]], dataSet[#][[-1, 1]]}]/
       (Subtract @@ dataSet[#][[{-1, 1}, 1]]),
      3]) & /@
  Range[n];

(maxCurrent[#] =
     MaximalBy[dataSet[#], Last][[1, 2]]) & /@ Range[n];
(noPoints[#] =
     Length[dataSet[#]]) & /@ Range[n];
(lifeTime[#] =
     dataSet[#][[-1, 1]]) & /@ Range[n];

Plotting,
ListLinePlot[data,
 PlotRange -> {{0, 700}, {0, 6}},
 PlotStyle -> (
   Directive[RGBColor[#, 0.5, 0.6],
      AbsoluteThickness[2.5]] & /@
    {0.4, 0.8, 0.8}),
 PlotMarkers -> (Style["●", #, 8] & /@
    {Blue, Purple, Purple}),
 PlotTheme -> "Detailed",
 Epilog -> {
   {Dashed, Line[{Last@set[2], First@set[3]}]},
   Inset[
      Framed[
       Grid[{
         {Style[#[[2]], Bold, TextAlignment -> Center]},
         {"Average Current: ", avgCurrent[#[[1]]], " μA"},
         {"Maximum Current: ", maxCurrent[#[[1]]], " μA"},
         {"Active Cathode Lifetime: ", lifeTime[#[[1]]], "minutes"},
         {"Number of Data Points: ", noPoints[#[[1]]]}}],
       Background -> White, RoundingRadius -> 5],
      Scaled[{#[[3]], .85}]] & /@ {
     {1, "Cathode 284 - Drilled", 0.4},
     {2, "Cathode 285 - Undrilled", 0.8}}},
 PlotLabel ->
  "Current Yield: Drilled Iron Cathode vs. Undrilled Iron Cathode",
 PlotLegends ->
  Placed[
   LineLegend[{
     "Iron (Cathode 284 - Drilled)",
     "Iron (Cathode 285 - Undrilled)"},
    LegendFunction -> "Panel"],
   {0.8, 0.25}],
 LabelStyle -> {Black, Bold},
 Frame -> {{True, False}, {True, False}},
 FrameLabel -> {"Cathode Runtime (minutes)", "Current (μA)"},
 ImageSize -> 550,
 InterpolationOrder -> 1]


text:
Q: Get value from array Angular 2 I'm getting an array from an API, like this:
Array(4)
 0:{email: "mail@mail.com", name: "Billie", lastName: "Jean",
id: "5b6f79"}
 1:{email: "mail@mail.com", name: "John", lastName: "Doe",
id: "8b6z75"}
...

What I want is to extract the id to use it in my class to construct an URL like ${this.sellerData}/clients/ID where the ID is the one from the array.
I have tried this:
this.sellerClients = data.clients;
  console.log (this.sellerClients);
  //prints the array in console
  for (let clientid of this.sellerClients ) {
     console.log(clientid);
         clientid = this.clientIdNumber;
  }

But I only get an object with the values:
{email: "mail@mail.com", name: "Billy", lastName: "Jean", id: "5b6f79"}
...

Thank you for your help!

A: while iterating the array  clientid will be {email: "mail@mail.com", name: "Billy", lastName: "Jean", id: "5b6f79"} as you want only id you can get it by clientid.id
for (let clientid of this.sellerClients ) {
     clientid = clientid.id;
}

A: I'm not sure but i think that this is what that you are tring to do
const result = data.clients.map(el => {return {...el, id : this.clientIdNumber}});

this code gets the data from the array and replace all of the id in that array to the clientIdNumber.
if i didn't understand the question currect me so i coul'd correct the code..

A: That looks like an object array. If you assign it to a variable say 'clients':
 clients =
 [
   {email: "mail@mail.com", name: "Billie", lastName: "Jean", id: "5b6f79"},
   {email: "mail@mail.com", name: "John",   lastName: "Doe",  id: "8b6z75"}
 ];

To get to the client id, you'd have to first iterate through each object:
for(var i = 0, len = clients.length; i < len; i++)
{
    console.log(clients[i].id); //Would give you the id of each client
}

The above loop would print:
"5b6f79"
"8b6z75"

A: You need to access id of client Object
for (let client of this.sellerClients ) {
     console.log(client );
     clientid = client.Id;
}


text:
Q: "macro not found: _after_build" Ant error building hybris with IntelliJ IDEA I'm trying to get the internal ant tool working with the hybris ecommerce suite.
When I'm invoking ant from the console, it works fine.
Using the Ant tool supplied by IntelliJ, I get the following error message when invoking the "all" target:
F:\pathtohybrisinstall\bin\platform\resources\ant\util.xml:130: macro not found: _after_build
at de.hybris.ant.taskdefs.CallMacro.execute(CallMacro.java:58)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at net.sf.antcontrib.logic.TryCatchTask.execute(TryCatchTask.java:207)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.Main.start(Main.java:198)
at org.apache.tools.ant.Main.main(Main.java:286)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:30)

A: Due to description from IntelliJ IDEA Help center, Ant integration is shipped with IntelliJ IDEA, that means, that the Ant you run via console is not the same, that the one used by IDE.
So the exception could be caused by  versions incompatibility. You can change the Ant distibution, used by IDE, in your build file properties on execution tab. Just provide there aa Ant distribution you use in your console.

A: Based on your subsequent comment I imagine that the extname param is not being set correctly.
Are you simply calling ant build from your IDE? I would take a look at codegen.xml which is used for the Eclipse integration. There are a few settings imported prior to calling gensource. One of these is importing the contrib library that contains the trycatch target that prevents errors like the one you see there. Perhaps that is related but I am not sure.
Basically, we support Eclipse by default.

A: intellij IDEA did not  support ant-contrib try/catch block which is used in hybris build. There are multiple fixes to ant in intellij 2017.2.
When you import your hybris project using Hybris Integration plugin it'll set up all ant related settings for you.
You can install it to your IDE directly from the repository by clicking on the "Browse Repositories" button in Settings/Plugins dialog.


text:
Q: Scheduled messages without setInterval() I want to schedule some things like sending messages with my discord bot.
E.g.: I want the bot to send "Good Morning" every day at 8 am or announce some things.
My problem is: I can't use something like setInterval() to execute every 24 hours because if the bot goes offline or has to be restarted it would reset or delay the interval.
Question: How do I execute something at a specific point in time without having to worry about the bot sometimes being offline?

A: You can use the cron package: you schedule a job that runs every day at a specific hour (time will be read on the system clock, you'll have to figure it out by yourself for timezones).
Here's an example of a message being sent every day at 8:00 am.
const cron = require('cron');

const channel; // Let's say this is the channel where you want to send it.
const job = new cron.CronJob('0 0 8 * * *', () => {
  channel.send("It's 8:00 am.");
});

About the 0 0 8 * * * pattern: its format is second minute hour month-day month week-day.
You can find more about cron patterns here.


text:
Q: Can I open a downloaded file with js/jquery/vue.js? Is it possible to download a file and then automatically open it for the user using javascript, jquery or vue.js?

A: Maybe this link can help you:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/downloads/open .
:)

A: Only filetypes suported by your client's browser.
use iframe to do so.


text:
Q: Не работает обтекание слева Почему не работает обтекание слева для class="sidebar"

/* Убираем отступы у списка */

ul {
  padding: 0;
  margin: 0;
}

ol {
  padding: 0;
  margin: 0;
}

.wrapper {
  margin-right: auto;
  margin-left: auto;
  width: 960px;
  height: 1271px;
}

.sidebar {
  width: 330px;
  height: 1271px;
  float: left;
}

.sidebar_photo {
  margin: 100px 0 0 0;
  border-radius: 2px;
}

.sidebar_writers {
  margin: 52px 0 30px 0;
  font-size: 19px;
  color: rgb(21, 169, 139);
  font-family: "Georgia";
  list-style: none;
}

.sidebar_writers_item {
  margin: 19px 0 0 20px;
  font-size: 19px;
  color: rgb(85, 85, 85);
  font-family: "Georgia";
}

.sidebar_films {
  margin: 60px 0 24px 0;
  font-size: 19px;
  color: rgb(21, 169, 139);
  font-family: "Georgia";
  list-style: none;
}

.sidebar_films_item {
  margin: 19px 0 0 16px;
  font-size: 19px;
  color: rgb(85, 85, 85);
  font-family: "Georgia";
}

.content {
  width: 630px;
  height: 1271px;
}

.content_photo {}

.content_quote {}

.content_title {}

.content_item {}

.content_link {}

Любимые писатели

Пабло Неруда

Рубен Фонсека

Исабель Аленде

Симоне Бевуар

Любимые фильмы

Чикаго (2002)

Дни жатвы (1978)

Бумажная луна (1973)

Сталкер (1979)

"If you have a procedure with ten parameters, you probably missed some."

Jackie Chan

Люди считают меня оптимистичным, инициативным членом команды с отличными навыками общения. Последние несколько лет я занимаюсь подготовкой руководящих кадров, работаю в сфере телемаркетинга и обслуживания клиентов в разных отраслях промышленности.
          Я обладаю опытом успешного назначения людей на должности уровня начальников технологических отделов и подготовки эффективных руководителей. В моем послужном списке – поддержание постоянного объема назначений и мероприятий. Кроме того, я постоянно
          вхожу в первую десятку по объему продаж и мог бы делать то же самое для вашей компании

Мои увлечения...

изучаю восточную культуру, языки; увлекаюсь оригами; занимаюсь художественным переводом книг; реставрирую старинные церкви и здания; выходные дни провожу на раскопках исторических поселений; уделяю время сбору мусора на пляжах, в лесах, лесопосадках;
          благоустраиваю свой город; рисую мультипликационные фильмы; создаю развивающие книги для детей.

        напиши мне

A: Таг sidebar не закрыт ...

ul {
  padding: 0;
  margin: 0;
}

ol {
  padding: 0;
  margin: 0;
}

.wrapper {
  margin-right: auto;
  margin-left: auto;
  width: 960px;
  height: 1271px;
}

.sidebar {
  width: 330px;
  height: 1271px;
  float: left;
  margin-right: 20px;
}

.sidebar_photo {
  margin: 100px 0 0 0;
  border-radius: 2px;
}

.sidebar_writers {
  margin: 52px 0 30px 0;
  font-size: 19px;
  color: rgb(21, 169, 139);
  font-family: "Georgia";
  list-style: none;
}

Любимые писатели

Пабло Неруда

Рубен Фонсека

Исабель Аленде

Симоне Бевуар

Любимые фильмы

Чикаго (2002)

Дни жатвы (1978)

Бумажная луна (1973)

Сталкер (1979)

"If you have a procedure with ten parameters, you probably missed some."

Jackie Chan

Люди считают меня оптимистичным, инициативным членом команды с отличными навыками общения. Последние несколько лет я занимаюсь подготовкой руководящих кадров, работаю в сфере телемаркетинга и обслуживания клиентов в разных отраслях промышленности.
      Я обладаю опытом успешного назначения людей на должности уровня начальников технологических отделов и подготовки эффективных руководителей. В моем послужном списке – поддержание постоянного объема назначений и мероприятий. Кроме того, я постоянно
      вхожу в первую десятку по объему продаж и мог бы делать то же самое для вашей компании

Мои увлечения...

изучаю восточную культуру, языки; увлекаюсь оригами; занимаюсь художественным переводом книг; реставрирую старинные церкви и здания; выходные дни провожу на раскопках исторических поселений; уделяю время сбору мусора на пляжах, в лесах, лесопосадках;
      благоустраиваю свой город; рисую мультипликационные фильмы; создаю развивающие книги для детей.

    напиши мне


text:
Q: show message if search item did not found using ng-multiselect-dropdown Search filter in Angular I am using ng-multiselect-dropdown for the search filter...
I would like to show 'No items Matches' message if the searched item is not available in the dropdown List...
Angular component
  this.getDynamicFilterList();
  this.settings = {
    singleSelection: false,
    idField: 'tag_id',
    textField: 'tag_name',
    selectAllText: 'Select All',
    unSelectAllText: 'UnSelect All',
    itemsShowLimit: 3,
    allowSearchFilter: true,
    clearSearchFilter: true,
  };
}

getDynamicFilterList() {
  this.filterService.getDynamicFilter().subscribe(res => {
    let dummyArr = [];
    for (let key in res.data) {
      dummyArr.push(res.data[key])
    }
    let group = {}
    this.filterDynamicDropdown = dummyArr;
    this.filterDynamicDropdown.forEach(dynamic_filter => {
      group[dynamic_filter.category_id] = new FormControl('');
    })
    this.dynamicFormGroup = new FormGroup(group);
  })
}```

***Angular Template***
```<form [formGroup]="dynamicFormGroup" *ngIf="dynamicFormGroup">
<div class="form-group row" *ngFor="let item of filterDynamicDropdown">
  <ng-multiselect-dropdown class="dynamic-dropdown" placeholder="{{item.category_name}}" [settings]="settings"
    [data]="item.value" [disabled]="false" (onFilterChange)="onFilterChange($event,item.value)"
    (onSelect)="onItemSelect($event)" (onDeSelect)="onDeSelect($event)"
    (onSelectAll)="onSelectAll($event)" (onDeSelectAll)="onDeSelectAll($event)" formControlName="{{item.category_id}}">
  </ng-multiselect-dropdown>
</div>
</form>```

A: UPDATE
Track pull request here
OLD
Try adding 'noDataAvailablePlaceholderText' property to this.settings as follows:
this.settings = {
   singleSelection: false,
   idField: 'tag_id',
   textField: 'tag_name',
   selectAllText: 'Select All',
   unSelectAllText: 'UnSelect All',
   itemsShowLimit: 3,
   allowSearchFilter: true,
   clearSearchFilter: true,
   noDataAvailablePlaceholderText: 'No items Matches'
};


text:
Q: Example of how to use UWP NavigationView in Prism 7.2 I have been using a variation of the Template 10 approach to using NavigationView.  See Alternative way to create shell in Prism.Windows 7.1.0?
With the Prism 7.2 pre-release, the call to NavigationService.Create does not seem to be available.
My goal is to allow navigation using the UWP NavigationView and Prism 7.2. I having been banging my head against this without success but hopefully there is a simple solution I am missing?
[Update] 21 Mar 2019: Prism support for UWP has been abandoned pending reassessment of the path forward. See https://github.com/PrismLibrary/Prism/issues/1745

A: You are not the only one having an issue with this, see the related question on GitHub.
The Create method was removed, but you can now create NavigationService using the CreateNavigationService method in PrismApplicationBase (see code on GitHub). It has the same arguments so you should be able to use it instead of the Create method you have been using up to this point.


text:
Q: I want to populate an array [ ] , with a spread syntax by a given number of times So I have a var size that may vary which counts how many arrays are passed in an argument.
concatenate(...arg){
 let size = arg.length ;
}

I want to use spread syntax by a number of times equal with that size ,more specific I want to concatenate all arrays, for example :
let arr1 = [1,2,3];
let arr2 = [3,2,1];
let arr3 = [4,5,6];
// unknown number of array

let finalArr = [...arr1,...arr2,...arr3,...etc];

So what I want to ask you is to replace the hardcoded finalArr, with a template that can take care of that for me?
What I tried so far :
// Arrays share the same content,ex : Arr : {content:[Arr(3)}
function concatenate(...arg){
 let size = arg.length;
 let arrays = arg;
 let tmplt = Arr(size+1).join(`Arr${size}`);
 let finalArr = [];
 while(size>=0){
  finalArr= [tmplt];
  size--;
}
return finalArr;
}

//input
let var1 = [{content:[2,9,10]}];
let var2 = [{content:[3,1,3]}];
let var3 = [{content:[9,1,8]}];
var1.concatenate(var2,var3);

// expected output
[2,9,10,3,1,3,9,1,8]

Finally, I try to reproduce the concat() method of Array within a class List that I made. The rules are : no Array.prototype.methods() allowed .
Full code so far :
 class List {
  constructor(items){
   this.content = !items ? [] : items;
   this.size = this.length();
 }
 length(arg=0){
  let size = arg;
  if(!this.content[arg]){
   return size;
 }
  size++;
 return this.length(size);
 }
 append(arg){
  if(this.size ==0 && this.size == arg.size){
   this.content = new List();
   return this.content;
 }
 this.content = [...this.content,...arg.content]
 return this.content;
 }
 concatenate(...arg){
  let test = arg;
  let size = 0;
  let final = [];
  while(test[size]!=undefined){
  // final += [...test[size].content];
  size++;
  let x = Array(size+1).join(`...test${size}.content`);
  while(size>=0){
    size--;

     }
    }

   }

  }

  let aList = new List([2,9,10]);

  let anotherList = new List([3,14,1]);

  let thirdList = new List([9,0,8]);

  aList.concatenate(anotherList,thirdList);

A: You can use a generator function which takes arrays delegates to each of the iterators. This allows you to flatten as many arrays as you want and can be used with spread notation:

function* concat(...arrays) {
  for (const array of arrays)
    yield* array;
}

function concatenate(...arg){
 return [...concat(...arg)];
}

let arr1 = [1,2,3];
let arr2 = [3,2,1];
let arr3 = [4,5,6];

let finalArr = concatenate(arr1, arr2, arr3);

console.log(finalArr);
.as-console-wrapper { max-height: 100% !important; }

A: You could take nested for loops.

function concatenate(...args) {
    const result = [];
    for (const array of args) for (const { content } of array) result.push(...content);
    return result;
}

const
    var1 = [{ content: [2, 9, 10] }],
    var2 = [{ content: [3, 1, 3] }],
    var3 = [{ content: [9, 1, 8] }];

console.log(...concatenate(var1, var2, var3)); // [2, 9, 10, 3, 1, 3, 9, 1, 8]

A: You can use the .push method on arrays to concatenate them.

let arr1 = [1,2,3];
let arr2 = [3,2,1];
let arr3 = [4,5,6];

function concatenate(...arg){
 let size = arg.length ;
  let finalArr = [];

  for(let i = 0; i < size; i++)
    finalArr.push(...arg[i]);
  return finalArr
}

finalArr = concatenate(arr1, arr2, arr3);
console.log(finalArr);


text:
Q: follow a twitter account with in iPhone app using MGTwitterEngine I need any source code by which I can  follow an account using MGTwitterEngine. It should be for iOS and please tell me if I can follow an account using oAuth or not.

A: It is possible using the POST "friendships/create" method:
https://dev.twitter.com/docs/api/1/post/friendships/create
Have you got the MGTwitterEngine authenticated and have a init'ed version of the _engine or do you need code for this?
If you have once authenticated you simply need to call the on the MGTwitterEngine:

*

*(NSString *)enableUpdatesFor:(NSString *)username; // friendships/create (follow username)

...to create a friendship.
Cheers
-JM


text:
Q: How to check if image is available else download and display in Flutter? I am making an app which shows the cryptocurrency market but I want to show icons as well, so if I manually add the icons in the pubspec as assets and then display them, it's going to take a lot of time, about 10 hours. So I resolved to automation.
Can someone explain how to implement the following in Flutter?
 OR provide me with a better solution?
try {
 //get image from file
} catch ( exception ) {
 //download image
 //get image from file
}

A: in this situation you can cache the images using Cached network image plugin

A flutter library to show images from the internet and keep them in
  the cache directory.


text:
Q: Nested Floor/Ceiling Function for non-Integer Divisors I am trying to figure out how to find the Floor and Ceiling of a nested Multiplication of fractions.
I understand that
$
\left\lceil{\frac{x}{mn}}\right \rceil=  \left\lceil{\frac{\lceil{\frac{x}{m}}\rceil}{n}}\right\rceil
$
works when x, m, n are all integers, and also for the Floor Function thanks to this great answer by Brian M. Scott but what about something like this:
⌈⌈⌈53 * 1/2⌉ * 9/5⌉ * 4/7⌉
or the inverse
⌊⌊⌊53 * 1/2⌋ * 9/5⌋ *4/7⌋
I have done some noodling and if you simply take the floor of each in a iterative process it sometimes yields different results depending on the order that you choose the fractions to multiply with. I would like to figure what the fixed lower/upper limit would be regardless of the order in which you multiply x by each of the fractions iteratively.
Is there a known method for working this out that is provably true?
Thanks in advance!

A: The property
$
\left\lceil{\frac{x}{mn}}\right \rceil=  \left\lceil{\frac{\lceil{\frac{x}{m}}\rceil}{n}}\right\rceil
$
allows the removal of the inner ceiling operators in an expression when $n$ is a positive integer. In general expressions where the above rule does not apply, the ceilings cannot be eliminated:
\begin{align}
&\lceil \lceil \lceil 53 * 1/2 \rceil * 9/5 \rceil * 4/7 \rceil\\
=&\lceil \lceil 27 * 9/5 \rceil * 4/7 \rceil\\
=&\lceil 49 * 4/7 \rceil\\
=&28
\end{align}
Eliminating ceilings arbitrarily is unsound but if you were to do it you would never exceed $28$ since $x \le \lceil x \rceil$ for any $x \in \mathbb{R}$.


text:
Q: Do I need do wrap an  with  to indicate it is a button? So basically I have the following markup:
<button type="button"> <svg class="search"> ... </svg> </button>

The SVG itself does not indicate that it is a clickable element, but a button does. So for screen-readers (or blind people) it could be an improvement. Am I correct?

A: There is no reason you cannot put an SVG in a <button> element.  Or you can add the attribute role="button" to tell screen readers that it is a button.
<svg class="search" role="button">...</svg>


text:
Q: boost geometry intersection give strange results I want to use the intersection function from boost geometry with a line and a polygon. I expect that the intersection is the part of the line which lies inside the polygon.
Unfortunately boost geometry returns the part of the line which lies outside of the polygon. Is this a bug in boost geometry or is something wrong with my code?
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/ring.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/segment.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/multi/geometries/multi_point.hpp>
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/algorithms/intersection.hpp>

namespace bg = boost::geometry;

using value_type = double ;
using cs_type = bg::cs::cartesian;
using point_type = bg::model::point< value_type , 2 , cs_type >;
using polygon_type = bg::model::ring< point_type > ;
using line_string_type = bg::model::linestring< point_type >;
using multi_line_type = bg::model::multi_linestring< line_string_type >;

int main( int argc , char *argv[] )
{
    line_string_type line;
    line.push_back( point_type { 13.37688020921095 , 53.66231710654281 } );
    line.push_back( point_type { 13.3857295713429 , 53.6636835518369 } );
    line.push_back( point_type { 13.39213495232734 , 53.66501934623722 } );
    line.push_back( point_type { 13.39719615524716 , 53.66546436809296 } );
    line.push_back( point_type { 13.40724694386097 , 53.66240690770171 } );

    polygon_type polygon;
    polygon.push_back( point_type { 13.35 , 53.64 } );
    polygon.push_back( point_type { 13.39 , 53.64 } );
    polygon.push_back( point_type { 13.39 , 53.68 } );
    polygon.push_back( point_type { 13.35 , 53.68 } );
    polygon.push_back( point_type { 13.35 , 53.64 } );

    multi_line_type intersection;
    bg::intersection( line , polygon , intersection );

    return 0;
}

A: Make sure your input geometries satisfy the pre-conditions documented.
You can use bg::correct to fix most issues (such as proper CCW ordering of points in the polygon, closing unclosed polygons etc.):
Live On Coliru
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/ring.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/segment.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/multi/geometries/multi_point.hpp>
#include <boost/geometry/multi/geometries/multi_linestring.hpp>
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry/algorithms/intersection.hpp>

namespace bg = boost::geometry;

using value_type       = double;
using cs_type          = bg::cs::cartesian;
using point_type       = bg::model::point<value_type, 2, cs_type>;
using polygon_type     = bg::model::ring<point_type>;
using line_string_type = bg::model::linestring<point_type>;
using multi_line_type  = bg::model::multi_linestring<line_string_type>;

int main()
{
    line_string_type line;
    line.push_back(point_type{13.37688020921095, 53.66231710654281});
    line.push_back(point_type{13.3857295713429,  53.6636835518369});
    line.push_back(point_type{13.39213495232734, 53.66501934623722});
    line.push_back(point_type{13.39719615524716, 53.66546436809296});
    line.push_back(point_type{13.40724694386097, 53.66240690770171});
    bg::correct(line);

    polygon_type polygon;
    polygon.push_back(point_type{13.35, 53.64});
    polygon.push_back(point_type{13.39, 53.64});
    polygon.push_back(point_type{13.39, 53.68});
    polygon.push_back(point_type{13.35, 53.68});
    polygon.push_back(point_type{13.35, 53.64});
    bg::correct(polygon);

    multi_line_type intersection;
    bg::intersection(line, polygon, intersection);

    std::cout << bg::wkt(intersection);
}

This prints
MULTILINESTRING((13.3769 53.6623,13.3857 53.6637,13.39 53.6646))

With the input un-corrected it would have printed this instead:
MULTILINESTRING((13.39 53.6646,13.3921 53.665,13.3972 53.6655,13.4072 53.6624))


text:
Q: something wrong with recaptcha style i'm using recaptcha in this page http://www.mawk3y.net/news2/contactus.php but suddenly style has been changed without any reason here's the code
<script type="text/javascript">
  var RecaptchaOptions = {
    theme : 'clean'
  };
</script>

<?php
  require_once('recaptcha/recaptchalib.php');
  $publickey = "key here";
 echo recaptcha_get_html($publickey);

A: Just moved the recaptcha out of the main div containing the table and it has no problem now I didn't know the reason


text:
Q: Eloquent global scope interfering with Delete requests I have this global scope:
class EarmarkScope implements Scope
{
    public function apply(Builder $builder, Model $model)
    {
        $builder->leftJoin('users', 'users.id', '=', 'earmarks.by_id')
            ->leftJoin('locations', 'locations.id', '=', 'earmarks.location_id')
            ->select('earmarks.*', 'users.name AS by', 'locations.location')
            ->orderBy('date', 'ASC');
    }
}

But when trying to call: Earmark::destroy($id); I get this error:

SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in
  where clause is ambiguous (SQL: select earmarks.*, users.name as
  by, locations.location from earmarks left join users on
  users.id = earmarks.by_id left join locations on
  locations.id = earmarks.location_id where id in (72) order
  by date asc)

I realize the global scope is causing this, but having that scope saves me so, so much time on SELECT queries. How can I avoid it causing a problem with destroy() and other useful Laravel functions like find() ?

A: You're doing it quite wrong here.
A. Set up relations on your models. There is absolutely no need for global scope here.
B. Don't use joins on your global scope, but use whereIn
$builder->whereIn(
    'by_id', function ($q) {
    $q->select('users.id')
        ->from('users')
        ->where('something useful...');

}
);


text:
Q: HtmlAgilityPack SelectNodes InnerText returns placeholder text not actual value in my app i want to scrape a web page to extract the values i am interesting.
(ShopData is the HtmlNodeCollection)
and my C# code like this :
var ShopName = ShopData.SelectNodes(".//div[@class='shop-name']");

this return null
if i try this, returns the node:
var ShopName1 = ShopData.SelectNodes(".//div[contains(@class, 'shop cf')]")

why .//div[@class='shop-name'] does not work?
if i do ShopData.SelectNodes(".//div[contains(@class, 'shop cf')]").ToList()[0];
then the innertext is empty.
the same time ShopData.SelectNodes(".//div[@class='price']").ToList()[0].InnerText return text normally.
what are the difference between this 2 functions?
my web page looks like this:

        <i class="icon tooltip-parent js-tooltip-handler trustmark" data-trigger="toggle" data-type="string" data-theme="light" data-content="Το κατάστημα διαθέτει πιστοποίηση GRECA Trustmark που σημαίνει ότι έχει δεσμευτεί να εργαστεί σύμφωνα με τον Eλληνικό και Ευρωπαϊκό (αντίστοιχα) Κώδικα Ηλεκτρονικού Εμπορίου, διασφαλίζοντας δεοντολογικά πρότυπα στην ψηφιακή αγορά.
Περισσότερες πληροφορίες στην ιστοσελίδα του GRECA.
" data-placement="left">
GRECA Trustmark

Electroholic

Πολυμηχάνημα Epson EcoTank ITS L6170 WiFi ink - έως 60 δόσεις

Παράδοση έως 30 ημέρες

358,00 €+ 9,00 € Μεταφορικά+ 2,00 € Αντικαταβολή369,00 €

<i class="icon tooltip-parent js-tooltip-handler trustmark" data-trigger="toggle" data-type="string" data-theme="light" data-content="Το κατάστημα διαθέτει πιστοποίηση GRECA Trustmark που σημαίνει ότι έχει δεσμευτεί να εργαστεί σύμφωνα με τον Eλληνικό και Ευρωπαϊκό (αντίστοιχα) Κώδικα Ηλεκτρονικού Εμπορίου, διασφαλίζοντας δεοντολογικά πρότυπα στην ψηφιακή αγορά.
Περισσότερες πληροφορίες στην ιστοσελίδα του GRECA.
" data-placement="auto vertical">GRECA Trustmark

            <button class="shop-tab js-shop-tab icon ">

1493
3,9

                        1493

            </button>
            <button class="shop-tab js-shop-tab icon location-tab multi-shops ">
                Περιστέρι, Αττική</button>

A: OK, i figure out what is goin on.
the web page use AJAX calls and thats why i cannot see them.


text:
Q: Can I compell MSBuild.exe to finish in VBS (64-bit Windows 7)? ong story with code samples:
I'm doing automated test builds using vb scripting and I see the following line execute differently in 32-bit and 64-bit Windows 7:
CmdLine ("cmd /c C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe C:\Users\tester_kafka\Documents\VisualStudio2012\Projects\CFX_Manager_UITest\CFX_Manager_UITest.sln")

where CmdLine is a function like this:
Function CmdLine(strCommand)
Set WshShell = CreateObject("WScript.Shell")
Set WshShellExec = WshShell.Exec(strCommand)
Do While WshShellExec.Status = 0
WScript.Sleep 100
Loop
End Function

In the 32-bit Windows 7 system, the build completes and the vb script proceeds to completion.  In the 64-bit Windows 7 system, the cmd window remains open until closed manually, then the script proceeds to completion.  The goal is, of course, to automate the script in 64-bit to proceed automatically.
I have tried adding the & exit to the line, and the /nr:false switch to MSBuild.exe and messing with the quotes (not sure what else to try, frankly...).  Should I be doing something simpler?  And why should the OS make that much difference?
Any information would be welcome, even if it's not a solution.  Thank you all.

A: Try this:
Function CmdLine(strCommand)
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run strCommand, , true
End Function


text:
Q: py2app worked with Homebrew, now it builds w/ module missing I have a new MacBook w/ Yosemite. In an attempt to get OSC, Zeroconf, PySide and Kivy working, I installed too much via Homebrew.  I've successfully (?) undone most of the damage, I think, and have installed all the Python modules so that Apple's Python finds everything... from the terminal window.
However, now my code runs from the console, correctly importing a custom pythonosc module installed with "sudo python setup.py install", but when I package it with py2app it can no longer find pythonosc. (It found it previously with Python et al installed a la Homebrew.)

A: You say you've "installed too much via Homebrew" and need "Apple's Python to find everything"

After installing Python modules into Homebrew's site-packages, you can make them importable from outside.

First make a directory here (assuming 2.7):
mkdir -p ~/Library/Python/2.7/lib/python/site-packages
Then put a path file in it:
echo 'import site; site.addsitedir("'$(brew --prefix)'/lib/python2.7/site-packages")' >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth


text:
Q: nmon NFS Performance Counters/Metrics I have recently used nmon to record NFS client performance data from a suse 10 SP4 host and now need help understanding what the captured read & write figures truly indicate.  With other performance measurement tools it was fairly obvious what the counters measured..  Writes(KB) = write throughput in KB or Read/Sec = read operations per second, etc.
nmon and other NFS tools simply label read activity as "read" so if anyone here can point me to a document/website or at least tell me your opinion on what the actual metric is for "access", "read" and "write".  I expect it is a simple point-in-time capture of read operations count, such as 100 reads processing at sampling time, but I do need to know for sure.
Thanks

A: Have you looked at nfsstat? It seems to break down the activity type well...
Server rpc stats:
calls      badcalls   badclnt    badauth    xdrcall
944958162   0          0          0          0

Server nfs v3:
null         getattr      setattr      lookup       access       readlink
0         0% 139832    0% 22081     0% 3129178   0% 353869    0% 0         0%
read         write        create       mkdir        symlink      mknod
765558883 81% 175500547 18% 37272     0% 11        0% 0         0% 0         0%
remove       rmdir        rename       link         readdir      readdirplus
33032     0% 1         0% 4084      0% 0         0% 0         0% 40464     0%
fsstat       fsinfo       pathconf     commit
165633    0% 9         0% 0         0% 0         0%


text:
Q: Disable button if nothing is selected in ui-select I've got this code to generate a ui-select:
<ui-select ng-model="newTask.work" theme="select2" class="form-control" title="Scegli un lavoro">
    <ui-select-match placeholder="Scegli un lavoro">{{$select.selected.label}}</ui-select-match>
        <ui-select-choices repeat="item in lavori | filter: $select.search">

        </ui-select-choices>
</ui-select>

I would like to disable a button if this ui-select has nothing selected, but writing this doesn't work
ng-disabled="!work"
How can I do this?
Thanks.

A: As others have said, a Plunkr would help.
Out of interest, does this make any difference:
ng-disabled="!newTask.work || newTask.work.length == 0"

One other tip: during development, when you hit issues like this, it's worth sticking this on your webpage:

{{ newTask.work | json }}

It'll show you the raw value of your binded Angular variable, so you can see its value change as you select/unselect items in your <ui-select> control.
Hope this helps.
Update (after seeing the Plunkr):
If you add the following lines to your script.js, you'll see that the pre I suggested does show the value you select in your drop down list, and from there, you can set your ng-disabled flag:
  $scope.newTask =
  {
      work: null
  };

... and your button will become enabled when you select an item in your drop down list.
(This is why I recommend the pre idea..  it showed nothing in your Plunkr, even after selecting an item, immediately showing that your Angular variable wasn't bound to the select, or didn't exist.)


text:
Q: How to create or setup private app store for iPhone/iPad applications Team,
I would like to know how to set up appstore for its enterprise program, with only iOS applications. To be more clear on my question, I run a business and I have applications created for my business which will be used only by customers to whom I give privileges. I don't want to put these business apps into apple's app store, where anyone can browse and install the application.
Is it possible to maintain a store for my business alone where only those who I provide access to, can be able to browse and install the applications?.

A: Yes you can.
Thats what companies with products like Afaria and Appearean to name a few do.

A: In a word: no.  You can't deliver apps publicly (outside your own enterprise) to non-jailbroken phones, except via the app-store.

A: Maybe TestFlight comes close to what you think?
The target device(s) get a link with which they get to your TestFlight site. When they visit it the first time, they'll have to register their device via a profile and then get a testflight app from which they can download your app as often as they want.
Con: No payment possible.
cheers
Finn

A: Looking for the same thing and found this https://developer.apple.com/programs/volume/b2b/. Its for Business 2 business distriubtion

A: You might be interested in the iOS Developer Enterprise Program, although it doesn't fit your description exactly.

A: You can't.
Deployment of iOS apps to any non-employee's stock OS devices, on 100 or more devices, or for a longer duration than past your Ad Hoc Distribution certificate expiration date, requires submitting your App to the iOS App store, and distributing it from there if approved by Apple.  This is true for all individual, company or enterprise developers.
For employees of D&B rated corporations, or for fewer than 100 devices for only some number of months, there are other options.


text:
Q: Correct cookie management I am not sure if I should post this on it security or / stackoverflow because I am concerned about security and performance.
I am trying to find a reliable source for cookie management. I read though OWASP so i roughly know what can be dangerous.
But I need to authenticate my users with cookies. Is there a complete step by step guide?
What I did:

*

*generate a random and unique string.

*associate the random string with a user in my cache rndstring -> user

*create a secure and signed cookie. value= hash(rndstring+secret)|rndstring

*if the user comes back, I check if the hashes matches, and if the rndstring is in my cache.

*if yes get the user.
I think my approach is flawed because I made it by myself.
Another problem would be that I safe the user object from the db in my cache. If the user updates his profile I would also have to update the cache.
I am using java with the play2 framework + mongoDB.
What resources can you recommend me?

A: I think this is a question for Security StackExchange and I note that you've asked similar questions there, recently with an excellent answer from DW. There are plenty of folk on the security.stackexchange.com forum who'll critique your methodology.
I personally wouldn't recommend developing your own session management, in fact I'd advise against it. The "play framework" session management has been reviewed by many folks, whereas yours hasn't and can easily have vulnerabilities that you've simply missed. I would use the built-in session management provided by your chosen programming framework. Have you read the play documentation?
In terms of resources, you should check out the Secure Development Principles from David Rook - here and here.
If you change your mind using cookies, you could look at web keys,, which is a method for inserting an unguessable token into a URL.
When reading Owasp, did you read the latest Session Management cheatsheet? I think that a lot of your questions are answered there.
One final resource is the SANS Top 25 Software Errors.

A: I would recommend you also generate a new unique string and update your cookie value every time when you check the hashes and they matches. This will improve the security of your system. Since probability of hacking reduces in case of theft of cookies.


text:
Q: How to plot this data with errorBar B = ErrorListLogPlot[{{{13.952, 364.7}, ErrorBar[36.4]}, {{19.13, 309.11}, ErrorBar[30.9]}, {{21, 294.159}, ErrorBar[29.4]}, {{26.2635, 237.26}, ErrorBar[23.7]},
    {{29.0713, 191.367}, ErrorBar[19.1]}, {{32.959, 151.82}, ErrorBar[15.1]}, {{37.2786, 118.47}, ErrorBar[11.8]}, {{42.246, 86.529}, ErrorBar[8.6]},
    {{46.1339, 67.5217}, ErrorBar[6.7]}, {{48.9417, 39.7778}, ErrorBar[3.9]}, {{52.6134, 32.0836}, ErrorBar[3.2]}, {{54.7732, 24.2215}, ErrorBar[2.4]},
    {{58.2289, 14.0352}, ErrorBar[1.4]}, {{62.7646, 6.13975}, ErrorBar[0.6]}, {{67.5162, 3.617}, ErrorBar[0.36]}, {{71.8359, 2.20246}, ErrorBar[0.22]},
    {{78.0994, 1.92956}, ErrorBar[0.19]}, {{81.987, 1.36348}, ErrorBar[0.13]}, Null, {{88.4665, 1.34112}, ErrorBar[0.13]}, Null,
    {{95.162, 1.34112}, ErrorBar[0.13]}, {{104.665, 1.36348}, ErrorBar[0.13]}}, {{115.464, 0.979543}, ErrorBar[0.09]}, {{125.616, 0.777114}, ErrorBar[0.55]},
   PlotRange -> {{20, 70}, {0.1, 300}}, Frame -> True, FrameLabel -> {"θcm", "dσ/dΩ(mb)"}, LabelStyle -> Directive[Bold, Medium],
   PlotLegends -> Placed[{"(dσ/dΩ)Exp"}, Center], PlotStyle -> Directive[Red, Medium]]

this what is shown it is empty of point
LegendedGraphics[{{}, {}, {}, {}, {}, {}}, {DisplayFunction -> Identity, GridLines -> {None, None}, DisplayFunction -> Identity, DisplayFunction -> Identity,
DisplayFunction -> Identity, PlotRangePadding -> {{0, 0}, {0, 0}}, AxesOrigin -> {10.35, -2.245020465669194},
PlotRange -> {{10, 80}, {-2.3025850929940455, Log[10000]}}, PlotRangeClipping -> True, ImagePadding -> All, DisplayFunction -> Identity,
AspectRatio -> GoldenRatio^(-1), Axes -> {True, True}, AxesLabel -> {None, None}, AxesOrigin -> {10.35, -2.245020465669194}, DisplayFunction :> Identity,
Frame -> {{True, True}, {True, True}}, FrameLabel -> {{"d[Sigma]/d[CapitalOmega", None}, {"[Theta]cm", None}},
FrameTicks -> {{ChartingScaledTicks[{Log, Exp}], ChartingScaledFrameTicks[{Log, Exp}]}, {Automatic, Automatic}}, GridLines -> {None, None},
GridLinesStyle -> Directive[GrayLevel[0.5, 0.4]], LabelStyle -> Directive[Bold, Medium],
Method -> {"CoordinatesToolOptions" -> {"DisplayFunction" -> ({(Identity[#1] & )[#1[[1]]], (Exp[#1] & )[#1[[2]]]} & ),
"CopiedValueFunction" -> ({(Identity[#1] & )[#1[[1]]], (Exp[#1] & )[#1[[2]]]} & )}}, PlotRange -> {{10, 80}, {-2.3025850929940455, Log[10000]}},
PlotRangeClipping -> True, PlotRangePadding -> {{0, 0}, {0, 0}}, Ticks -> {Automatic, Charting`ScaledTicks[{Log, Exp}]}}],
Placed[Unevaluated[PointLegend[{Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]],
Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6],
RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]],
Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6],
RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]],
Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6],
RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]],
Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6],
RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]],
Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6],
RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]],
Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6],
RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]],
Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6],
RGBColor[1, 0, 0]], Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]],
Directive[PointSize[0.012833333333333334], AbsoluteThickness[1.6], RGBColor[1, 0, 0]]}, {"(d[Sigma]/d[CapitalOmega])Exp"}, LegendMarkers -> {{False, Automatic}},
Joined -> {False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False,
False, False}, LabelStyle -> Directive[Bold, Medium], LegendLayout -> {"Column", {Automatic, 5}}]], Center, Identity]]

A: data = {{{13.952, 364.7}, ErrorBar[36.4]}, {{19.13, 309.11},
    ErrorBar[30.9]}, {{21, 294.159},
    ErrorBar[29.4]}, {{26.2635, 237.26},
    ErrorBar[23.7]}, {{29.0713, 191.367},
    ErrorBar[19.1]}, {{32.959, 151.82},
    ErrorBar[15.1]}, {{37.2786, 118.47},
    ErrorBar[11.8]}, {{42.246, 86.529},
    ErrorBar[8.6]}, {{46.1339, 67.5217},
    ErrorBar[6.7]}, {{48.9417, 39.7778},
    ErrorBar[3.9]}, {{52.6134, 32.0836},
    ErrorBar[3.2]}, {{54.7732, 24.2215},
    ErrorBar[2.4]}, {{58.2289, 14.0352},
    ErrorBar[1.4]}, {{62.7646, 6.13975},
    ErrorBar[0.6]}, {{67.5162, 3.617},
    ErrorBar[0.36]}, {{71.8359, 2.20246},
    ErrorBar[0.22]}, {{78.0994, 1.92956},
    ErrorBar[0.19]}, {{81.987, 1.36348}, ErrorBar[0.13]},
   Null, {{88.4665, 1.34112}, ErrorBar[0.13]},
   Null, {{95.162, 1.34112}, ErrorBar[0.13]}, {{104.665, 1.36348},
    ErrorBar[0.13]}, {{115.464, 0.979543},
    ErrorBar[0.09]}, {{125.616, 0.777114}, ErrorBar[0.55]}};

data2 = data /.
   {Null :>
     Nothing, {{x_, y_}, ErrorBar[err_]} :> {x, Around[y, err]}};

B = ListLogPlot[data2,
  PlotRange -> {{20, 70}, {0.1, 300}},
  Frame -> True,
  FrameLabel -> {"θcm", "dσ/dΩ(mb)"},
  LabelStyle -> Directive[Bold, Medium],
  PlotLegends -> Placed[{"(dσ/dΩ)Exp"}, Center],
  PlotStyle -> Directive[Red, Medium]]

EDIT: To see all of the data
B2 = ListLogPlot[data2,
  PlotRange -> All,
  Frame -> True,
  FrameLabel -> {"θcm", "dσ/dΩ(mb)"},
  LabelStyle -> Directive[Bold, Medium],
  PlotLegends -> Placed[{"(dσ/dΩ)Exp"}, {.7, .65}],
  PlotStyle -> Directive[Red, Medium]]


text:
Q: Crosscompiling for ARM9 in Linux I am always using this procedure to cross compile programs for ARM926ej-s on my Arch Linux machine:
1st I compile the assembly source files using:
arm-none-eabi-as -mcpu=arm926ej-s -c -Wall -ooutput_as.o input_as.s

2nd I compile C source files using:
arm-none-eabi-gcc -mcpu=arm926ej-s -c -Wall -mno-thumb-interwork -mapcs-frame -mno-sched-prolog -fno-hosted -O3 -gdwarf-2 -ooutput_c.o input_c.c

3rd I link those to get an executable elf file executable:
arm-none-eabi-ld -Tlinker_script.ld -oexecutable output_as.o output_c.o

4th I convert elf into binary using:
arm-none-eabi-objcopy -Ielf32-littlearm -Obinary --strip-all --verbose executable executable_bin

5th I prepare the binary for the USB-DFU transfer using application unsimgcr - this application somehow prepares the format to be uploaded to ARM microprocessors:
unsimgcr -pd executable_bin executable_bin_usb

And then i usualy upload the prepared program executable_bin_usb to the ARM926ej-s using application dfu-util like this:
sudo dfu-util -R -t2048 -Dexecutable_bin_usb

For some reason when in step 5 when I use unsimgcr i get this error:
[ziga@ziga-cq56 test]$ unsimgcr -pd executable_bin executable_bin_usbLPC3130/31/41/52 Un-Secure Image Creator Utility v1.1

Opening executable_bin
Incompatible file size!

Does anyone have any clue what i might be doing wrong or what is wrong in my program which is just a basic test program - here are all the source files which I got here (this toolchain works for other programs):
input_as.s
.section INTERRUPT_VECTOR, "x"
.global _Reset
_Reset:
  B Reset_Handler
  B .
  B .
  B .
  B .
  B .
  B .
  B .

Reset_Handler:
  LDR sp, =stack_top
  BL c_entry
  B .

input_c.c
int c_entry() {
  return 0;
}

linker_script.ld
ENTRY(_Reset)
SECTIONS
{
 . = 0x11029000;
 .text : {
 startup.o (INTERRUPT_VECTOR)
 *(.text)
 }
 .data : { *(.data) }
 .bss : { *(.bss) }
 . = . + 0x1000;
 stack_top = .;
}

In linker script we set the entry point at location 0x11029000 which is needed in ARM, but i have no idea why would the size of my program be incompatible... Does anyone have any clue?
If I use the command arm-none-eabi-readelf -a executableto get some info about my elf file executable i get this info. It might come handy:
[ziga@ziga-cq56 test]$ arm-none-eabi-readelf -a executable
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x11029000
  Start of program headers:          52 (bytes into file)
  Start of section headers:          4716 (bytes into file)
  Flags:                             0x5000002, has entry point, Version5 EABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         1
  Size of section headers:           40 (bytes)
  Number of section headers:         14
  Section header string table index: 11

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .text             PROGBITS        11029000 001000 000038 00  AX  0   0  4
  [ 2] .ARM.attributes   ARM_ATTRIBUTES  00000000 001038 000030 00      0   0  1
  [ 3] .comment          PROGBITS        00000000 001068 00002a 01  MS  0   0  1
  [ 4] .debug_abbrev     PROGBITS        00000000 001092 000034 00      0   0  1
  [ 5] .debug_info       PROGBITS        00000000 0010c6 000044 00      0   0  1
  [ 6] .debug_line       PROGBITS        00000000 00110a 000035 00      0   0  1
  [ 7] .debug_pubnames   PROGBITS        00000000 00113f 00001e 00      0   0  1
  [ 8] .debug_aranges    PROGBITS        00000000 00115d 000020 00      0   0  1
  [ 9] .debug_str        PROGBITS        00000000 00117d 000034 01  MS  0   0  1
  [10] .debug_frame      PROGBITS        00000000 0011b4 000020 00      0   0  4
  [11] .shstrtab         STRTAB          00000000 0011d4 000097 00      0   0  1
  [12] .symtab           SYMTAB          00000000 00149c 000140 10     13  17  4
  [13] .strtab           STRTAB          00000000 0015dc 000035 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x11028000 0x11028000 0x01038 0x01038 R E 0x8000

 Section to Segment mapping:
  Segment Sections...
   00     .text

There is no dynamic section in this file.

There are no relocations in this file.

There are no unwind sections in this file.

Symbol table '.symtab' contains 20 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 11029000     0 SECTION LOCAL  DEFAULT    1
     2: 00000000     0 SECTION LOCAL  DEFAULT    2
     3: 00000000     0 SECTION LOCAL  DEFAULT    3
     4: 00000000     0 SECTION LOCAL  DEFAULT    4
     5: 00000000     0 SECTION LOCAL  DEFAULT    5
     6: 00000000     0 SECTION LOCAL  DEFAULT    6
     7: 00000000     0 SECTION LOCAL  DEFAULT    7
     8: 00000000     0 SECTION LOCAL  DEFAULT    8
     9: 00000000     0 SECTION LOCAL  DEFAULT    9
    10: 00000000     0 SECTION LOCAL  DEFAULT   10
    11: 11029020     0 NOTYPE  LOCAL  DEFAULT    1 Reset_Handler
    12: 11029000     0 NOTYPE  LOCAL  DEFAULT    1 $a
    13: 1102902c     0 NOTYPE  LOCAL  DEFAULT    1 $d
    14: 00000000     0 FILE    LOCAL  DEFAULT  ABS main.c
    15: 11029030     0 NOTYPE  LOCAL  DEFAULT    1 $a
    16: 00000010     0 NOTYPE  LOCAL  DEFAULT   10 $d
    17: 11029538     0 NOTYPE  GLOBAL DEFAULT  ABS stack_top
    18: 11029030     8 FUNC    GLOBAL DEFAULT    1 c_entry
    19: 11029000     0 NOTYPE  GLOBAL DEFAULT    1 _Reset

No version information found in this file.
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "ARM926EJ-S"
  Tag_CPU_arch: v5TEJ
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_enum_size: small
  Tag_DIV_use: Not allowed


text:
Q: How can I improve displaying repetitive equations I'm looking to improve my report quality by making equations more clear. As the equations I'm stating are repetitive a couple of times throughout the report I thought it would be better to use matrix notation.
Currently the equations look like this:
\begin{align}
    dCA_{p,1} =  - &1 \cdot A - 2 \cdot B + 3 \cdot C \nonumber\\
                 + &4 \cdot A \cdot B + 5 \cdot A^2 - 6 \cdot C ^2\label{eq:dCA_p_1_2}\\
    dCA_{m,1} =  &8 \cdot A - 9 \cdot B + 5 \cdot C \nonumber\\
                - &5 \cdot A \cdot B - 4 \cdot A^2 + 1 \cdot B^2\label{eq:dCA_m_1_2}\\
                - &3 \cdot C ^2\nonumber\\
    dCA_{l,1} =  &3 - 3 \cdot A - 2 \cdot B - 3 \cdot C  + 3 \cdot D\nonumber\\
                + &5 \cdot A\cdot B - 3 \cdot A\cdot D \label{eq:dCA_l_1_2}\\
                - &1 \cdot B\cdot D - 2 \cdot C \cdot D + 3 \cdot B^2\nonumber\\
                + &2 \cdot C ^2 + 6 \cdot D^2\nonumber\\
\end{align}

One can clearly notice the repetitive parameters A , B , C and D. Therefore I tried the following approach:
\begin{equation}
  \left( \begin{array}{c}
    dCA_{p,1}\\
    dCA_{m,1}\\
    dCA_{l,1}  \end{array}\right)
  =
  \left(\begin{array}{cccccccccccccc}
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14
  \end{array}\right)
  \left(\begin{array}{c}
      A\\
      B\\
      C\\
      D\\
      A\cdot B\\
      A\cdot C\\
      A\cdot D\\
      B\cdot C\\
      B\cdot D\\
      C\cdot D\\
      A^2\\
      B^2\\
      C^2\\
      D^2 \end{array}\right)
\end{equation}

This output is however very wide and long. Already with single rounded numbers. Actual numbers would be a 4 digit number, for example: 2.314.

Is the last approach the way to go or are there other possibilities? Maybe there is a way to reduce the length by rewriting the squared signs in another way. I'm not sure how accomplish this.
Replacing the array with pmatrix gives a slightly slimmer expression, yet still very wide...
\begin{equation}
  \left( \begin{array}{c}
    dCA_{p,1}\\
    dCA_{m,1}\\
    dCA_{l,1}  \end{array}\right)
  =
  \begin{pmatrix}
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 \\
    1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14
  \end{pmatrix}   \left(\begin{array}{c}
      A\\
      B\\
      C\\
      D\\
      A\cdot B\\
      A\cdot C\\
      A\cdot D\\
      B\cdot C\\
      B\cdot D\\
      C\cdot D\\
      A^2\\
      B^2\\
      C^2\\
      D^2 \end{array}\right)
\end{equation}

As proposed by Mico, as far as i understood:
\begin{equation}
  \begin{pmatrix}
    dCA_{p,1}\\
    dCA_{m,1}\\
    dCA_{l,1}
  \pmatrix{pmatrix}
  =
  \begin{pmatrix}
    1 & 2 & 3 & 4  \\
    1 & 2 & 3 & 4  \\
    1 & 2 & 3 & 4
  \end{pmatrix}
  \begin{pmatrix}
      A\\
      B\\
      C\\
      D
   \end{pmatrix}
   +
   \begin{pmatrix}
        1 & 2 & 3 & 4 & 5 & 6 \\
        1 & 2 & 3 & 4 & 5 & 6 \\
        1 & 2 & 3 & 4 & 5 & 6
   \end{pmatrix}
   \begin{pmatrix}
   A\cdot B\\
   A\cdot C\\
   A\cdot D\\
   B\cdot C\\
   B\cdot D\\
   C\cdot D
   \begin{pmatrix}
   +
   \begin{pmatrix}
    1 & 2 & 3 & 4  \\
    1 & 2 & 3 & 4  \\
    1 & 2 & 3 & 4
   \end{pmatrix}
   \begin{pmatrix}
   A^2\\
   B^2\\
   C^2\\
   D^2
   \begin{pmatrix}
\end{equation}

A: The actual matrix would be too sparse to be useful in reading. I'd exploit the natural division of the terms into three categories: linear, product of two distinct variables, squares.
Typesetting vertically the fifteen-row matrix is too space consuming.
\documentclass{article}
\usepackage{amsmath}

\setcounter{MaxMatrixCols}{15}

\begin{document}

\begin{align}
dCA_{p,1} &= - A - 2 B + 3 C \notag \\
          &\qquad + 4 A B \notag \\
          &\qquad + 5 A^2 - 6 C ^2 \label{eq:dCA_p_1_2}
\\[1ex]
dCA_{m,1} &= 8 A - 9 B + 5 C \notag \\
          &\qquad - 5 A B \notag \\
          &\qquad - 4 A^2 + 1 B^2 - 3 C ^2 \label{eq:dCA_m_1_2}
\\[1ex]
dCA_{l,1} &=  3 - 3 A - 2 B - 3 C  + 3 D \notag \\
          &\qquad + 5 AB - 3 AD - BD - 2 C D \notag \\
          &\qquad + 3 B^2 + 2 C^2 + 6 D^2 \label{eq:dCA_l_1_2}
\end{align}

\begin{equation}
  \begin{pmatrix}
  dCA_{p,1}\\
  dCA_{m,1}\\
  dCA_{l,1}
  \end{pmatrix}
  = MT
\end{equation}
where
\begin{align*}
M &= \begin{pmatrix}
     % 0    A    B    C    D   AB   AC   AD   BC   BD   CD   A2   B2   C2   D2
       0 & -1 & -2 &  3 &  0 &  4 &  0 &  0 &  0 &  0 &  0 &  5 &  0 &  0 &  0 \\
       0 &  8 & -9 &  5 &  0 & -5 &  0 &  0 &  0 &  0 &  0 & -4 &  1 & -3 &  0 \\
       3 & -3 & -2 & -3 &  3 &  5 &  0 & -3 &  0 & -1 & -2 &  0 &  3 &  2 &  6
  \end{pmatrix}
\\
T &=
     \addtolength{\arraycolsep}{-2pt}
     \begin{pmatrix}
     1 & A & B & C & D & AB & AC & AD & BC & BD & CD & A^2 & B^2 & C^2 & D^2
     \end{pmatrix}^T
\end{align*}
are the necessary matrices.

\end{document}

A: I would like to suggest a variant of your idea to use matrix algebra to display the equations. However, instead of displaying a (3x14) matrix and a (14x1) column vector, one could display three smaller matrices of order (3x4), (3x6), and (3x4) and column vectors of length 4, 6, and 4, respectively, to capture the linear, bilinear, and quadratic terms in A, B, C, and D.
This setup should give you enough space to use "real" coefficients, not just signed integers.
Whatever else you end up doing, I'd recommend losing the \cdot terms.
(Aside: I provide no guarantee that I transcribed the coefficients correctly in the matrices shown below!)

\documentclass{article}
\usepackage{mathtools} % for 'pmatrix*' env.
\setcounter{MaxMatrixCols}{14}
\newcommand\vn[1]{\textit{#1}}
\begin{document}

\begin{equation}
\begin{split}
  \begin{pmatrix}
    d\vn{CA}_{p,1}\\
    d\vn{CA}_{m,1}\\
    d\vn{CA}_{l,1}
  \end{pmatrix}
  &=
  \begin{pmatrix*}[r]
   -1 & -2 &  3 & 0 \\
    8 & -9 &  5 & 0 \\
   -3 & -2 & -3 & 3
  \end{pmatrix*}
  \begin{pmatrix}
    A \\ B \\ C \\ D
  \end{pmatrix} \\
  &\quad+
  \begin{pmatrix*}[r]
    4 & 0 &  0 & 0 &  0 &  0 \\
   -5 & 0 &  0 & 0 &  0 &  0 \\
    0 & 0 &  0 & 0 & -1 & -2
  \end{pmatrix*}
  \begin{pmatrix}
    A B \\ A C \\ A D \\ B C \\ B D \\ C D
  \end{pmatrix} \\
  &\quad+
  \begin{pmatrix*}[r]
   5 & 0 & -6 &  0 \\
   0 & 0 & -3 &  0 \\
   0 & 0 &  2 &  6
  \end{pmatrix*}
  \begin{pmatrix}
      A^2 \\ B^2 \\ C^2 \\ D^2
  \end{pmatrix}
\end{split}
\end{equation}
\end{document}


text:
Q: alternatives to rsync? I'm trying to script a backup system for several servers, some Windows, some Linux. I'd love to be able to use rsync but I can't (at least not in all situations, since some servers I can't install rsync to, and some are Win servers).
I've tested with wget in FTP mode with the "timestamping" option, and it seems to work pretty well regardless of platform. Are there other options that may be more robust/reliable, that will do incremental backups regardless of platform?
Thanks for any ideas

A: You might try Unison.
http://www.cis.upenn.edu/~bcpierce/unison/

A: You definitely want to have a look at rdiff-backup. And Server Fault. ;)


text:
Q: How to return Double with map I try to making token lexical analyzer
and I want return Double type using map in scala
    var m = Map[String,Double]()
    def parseItem(tok: Tokenizer): Double = {
    val startPos = tok.tokenPos
    val t = tok.token
    tok.next()
    //(other codes)
    else if (t.isIdentifier) {
      var t1 = tok.token
      if(t1.text == "=") {
        tok.next()
        var t2 = tok.token
        if(t2.isNumber) {
          m += (t.text -> t2.number)
          println("Idenrifier sorted :" + t.text)
          0
        }else if(t2.isIdentifier && m.get(t2.text) == None){
            println("Error!!! RHS is Wrong identifier!!!")
            throw new SyntaxError(startPos, "expected number, identifier, or '('")
        }else{
          m += (t.text -> m.get(t2.text))
          println("Idenrifier sorted :" + t.text)
          0
        }
      }else{
          m.get(t.text)
      }

the error code is :Option[Double]
I think return type is Double But I can't understanding this error

A:   m.get(t.text) is of type Option[Double]

You can use the apply method of the Map but keep in mind that the apply method returns the value associated with a given key directly, without wrapping it in an Option. If the key is not defined in the map, an exception is raised.
You can use m(t.text) or m.apply(t.text)
Or you can use m getOrElse (t.text, defaultValue)  ,which returns the value associated with key t.text in the m map , or the defaultValue  if not found.


text:
Q: Basic Auth & Internet Explorer Automation in Powershell I'm in the need of automating an administration task of a web application.
I used Powershell and the InternetExplorer.Application ComObject to accomplish this task. The relevant part is to navigate to a webpage and gather all relevant links, navigate there and click on a button on those pages.
Now, one of the administrators wants to add Basic Auth to those pages, but I can't figure out, how to get this working from powershell.
Has anyone any ideas, how to use Basic Auth here? Searching google, I'm only seeing tips like "use WebClient instead of IE". Also, the following won't work:
$url = "http://"+$user+":"+$pass+"@example.com/admin/something"
$ie.navigate($url)

A: Can you use integrated NTLM authentication instead of basic auth? I have used the COM object automation and PowerShell before with NTLM auth and it works like a champ.


text:
Q: Remove Tax at Checkout for B2B customers in Magento I need to dynamicaly remove tax during checkout for business to business customers in Magento.  I have a module which asks for a VAT ID during checkout and checks it against the European Online VAT-ID Validation Service. If the VAT ID is valid, the tax should be removed during checkout.
The module already assigns new customers with valid VAT ID to the according business to business group in Magento. Customers who order for the first time and create their account during that first checkout, get charged VAT (even with valid VAT-ID).
I basically need to know, how this can be done, which methods involved, etc.

A: I've got a similar setup going on at the moment, what I have done is if the VAT# at checkout is stored in mage_checkout_model_session. The call
Mage::getSingleton('checkout/session')->getQuote()->getCustomerTaxvat()

In my instance is returning the VAT number for me to check elsewhere. Your VAT# validator is certainly setting something similar to this. At this point you can either create a new module to modify the tax, or override the controller with
$x = Mage::getSingleton('where_your_extension/stores_the_value)->getIsVatValid();
if ($x) $this->setTaxValue( 0 );
else //magento sets it automatically

and it will set the tax rate to zero for the remainder of the session. It will work with guests and registered customers.


text:
Q: How to pass array using asp-route? Form returns url format: localhost2343/index?Colors=red&Colors=blue&Colors=pink
asp-route return url format: localhost2343/index?Colors=red,blue,pink
If I use form submit button than everything seems good. But If i click on sort hyperlink than it will pass URL Colors=System.String%5B%5D
How can I pass value of Colors inside asp-route?
<form asp-page="./index" method="get">
     <select asp-for="Colors" asp-items="@Model.Colors_SELECT" class="MultiSelect" multiple>
        <option value="">All</option>
   </select>
    ...
</form>

  ...

           @Html.DisplayNameFor(model =>
    model.MyList[0].Colors)

...

  [BindProperty(SupportsGet = true)]
    public string[]? Colors { get; set; }
    public SelectList? Colors_SELECT { get; set; }

public async Task OnGetAsync()
{
   // Form - URL Format
   // get values from URL & set inside selectlist
   var result = Request.Query["Colors"];
   var i = 0;
   foreach (string? item in result) {
          Colors[i] = item;
          i++;
   }
}

Update - I tried this but on sort link, it removes Sort variable & it picks only 1 Colors (not multi)

           [BindProperty(SupportsGet = true)]
           public Dictionary<string, string> routeData { get; set; }
             ....
           var routeData = new Dictionary<string, string>();
            routeData.Add("SortOrder", CurrentSort);
            routeData.Add("SearchString", SearchString);
            for (int i = 0; i < result.Count; i++)
            {
              var myParam = result[i];
             routeData.Add($"Colors{i}", myParam.ToString());
            }

A: This may help:
To get the selected values from a select element in a Razor page, you can use the Request.Form["selectName"] collection.
For example, consider the following select element:
@page "{Colors}"

<form method="post">
  <select multiple name="colors">
    <option value="red">Red</option>
    <option value="blue">Blue</option>
    <option value="pink">Pink</option>
  </select>
  <button type="submit" asp-page-handler="GetColors">Submit</button>
</form>

To get the selected values in the form submission handler and modify the query string in the URL and include the selected values (red, blue, pink), you can try the following code:
public IActionResult OnGet(string? Colors)
{
    if (string.IsNullOrWhiteSpace(Colors))
    {
        // do something
        return Page();
    }

    if (!string.IsNullOrWhiteSpace(Colors))
    {
        // Do something
        return Page();
    }

    return Page();
}

public IActionResult OnPostGetColors()
{
    IDictionary<string, string> params = new Dictionary<string, string>();
    var selectedColors = string.Join(",", Request.Form["colors"]);
    params.Add("Colors", selectedColors);
    string query = "";
    foreach (var p in params)
        query += $"{p.Key}={p.Value}";

    var url = $"{HttpContext.Request.Path}?{query}";
    return Redirect(url); // url : https://localhost:7272/index?Colors=red,blue,pink
}

This code will help you submit the selected values through the URL as a query string, and then will redirect the user to a new URL with the selected values added to the query string as multiple values for the colors parameter.