text:
Q: Getting text-overflow in a flex-box to work I have the following "top bar" which has as part of it data for the user. It will also contain his name. The code is as follows:

html, body, ul, li, a, input { box-sizing: border-box; outline: 0px solid transparent; }
.title-bar {
  border-bottom: 1px solid white;
  height: 128px;
  width: 100%;
  background-color: #999;
  float: left;
}
.user-info {
  width: 128px;
  height: 100%;
  align-items: center;
  border-left: 1px solid white;
  background-color: inherit;
  display: flex;
  justify-content: space-between;
  flex-flow: column nowrap;
  float: right;
  text-align: center;
}
.user-info span {
  overflow: hidden;
  text-overflow: '.';
}
.user-info .circle {
  border: 2px solid #369;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 32px;
  margin: 8px 8px;
  overflow: hidden;
  transition: border 0.15s ease-out;
  width: 32px;
}
.user-info .circle:hover { border-width: 4px; }
.user-info .container {
  border-top: 1px solid white;
  display: flex;
  justify-content: center;
  margin-top: 6px;width: 100%;
}

    Johnny B. Testname

As you can see, "Johnny B. Testname" cuts off on the bottom. This is because I have set overflow: hidden; on the span (it would otherwise push the other flex-items around which I do not want).
I was looking for a solution to "dynamically change the font-size," but I don't think that would look good (and I couldn't find anything workable). I found instead text-overflow; and as you can see, I've set it to `text-overflow: '.';
Only problem is: it isn't getting to the point where it needs to text-overflow. I've tried setting flex-shrink: 1; (which wouldn't matter as that's the default), display: inline; (I got desperate) and other CSS styles but none of them have fixed the problem. I don't want to set height or width as I still want that span to be dynamic.
Maybe I am using text-overflow wrong, but I think I am using per the MDN specs. I have also made a fiddle for this problem.
Thank you.

A: DEMO
.user-info span {
  overflow: hidden;
  text-overflow: ellipsis; /* for getting the end dots */
  display: inline-block; /* for making span a block (inline-block) so that it accepts max-width */
  max-width: 90%; /* specify the width */
  white-space: nowrap; /* for keeping text in single line */
}


text:
Q: How to implement map that returns always the same value? I have a following interface:
def some(foo: Map[SomeObject, String])
How to pass to this function argument such that it returns always the same thing? In other words map such that return always "bar" string ?

redpajama_set_name: RedPajamaStackExchange


text:
Q: Summation of big oh terms I read about asymptotic notation .I understood the limit definition of big oh notation.But while going about calculating O(1)+O(2)+.......…..+O(n),the sum comes out to be O(n ^2).Can anyone explain the same?

A: Due to the fact that $O(c) = O(1)$ where $c$ is any constant, I think your concern is this: if $f(n) = O(n)$ and if $$g(n) = \sum_{i=1}^n f(i)$$
then why is it true that $g(n) = O(n^2)$?
It is misleading to write something like $$g(n) = \sum_{i=1}^n O(i).$$
We do not view each particular instance of $f(i)$ as being $O(i)$; the statement $f(n) = O(n)$ is a statement about $f$ as a function of $n$, not about $f$ at any particular value.
So how do we go about proving that $g(n) = O(n^2)$?
Well, because $f$ is $O(n)$, there exist constants $C$ and $n_0$ such that $|f(n)| \ge Cn$ for all $n \ge n_0$.
So for $n \ge n_0$, we split the sum and use the triangle inequality to approximate:
$$|g(n)| \le \sum_{i=1}^{n_0-1} |f(i)| + \sum_{i=n_0}^n |f(i)| \le C' + \sum_{i=n_0}^n Ci.\tag{1}$$
Here $C'$ is just the constant value of the first $n_0$ terms.
We're allowed to be very loose in our estimates, so in the second sum in (1) we'll throw back in the numbers from $1$ to $n_0-1$ to get an even bigger bound:
$$|g(n)| \le C' + C \sum_{i=1}^n i = C' + \frac{Cn(n+1)}{2}.\tag{2}$$
It should be clear now that the right hand side of (2) is $O(n^2)$, by which I mean it is bounded by a constant multiple of $n^2$. Indeed, $$C' + \frac{C}{2}(n(n+1)) = C' + \frac{C}{2}(n^2 + n) \le C'n^2 + \frac{C}{2}(n^2 + n^2) = (C' + C)n^2.$$


text:
Q: Facebook Login Dialog does not work on iOS6 simulator I have been converting my application from the old Facebook SDK to the new Facebook SDK 3.1 in order to use the iOS6 native functionality as well as other Facebook functionality, and I am having a problem that happens consistently on the simulator and rarely on the device.
When I go to log into Facebook, instead of the app backgrounding and authenticating through Safari or the Facebook app, I get a modal window on top of my app for the login (I believe this started with iOS6, even before switching to Facebook SDK 3.0/3.1). This window allows me to enter username and password, but when I go to click "Okay" in the upper right to authenticate, nothing happens. No callback occurs to the application:openURL:sourceApplication:annotation: in the AppDelegate.

In my shared FacebookController code (which I use for multiple projects), I am initializing the FBSession when attempting to authorize as per Facebook's sample code:
FBSession *session = [[FBSession alloc] initWithAppID:nil permissions:readPermissions defaultAudience:FBSessionDefaultAudienceNone urlSchemeSuffix:self.fbUrlSchemeSuffix tokenCacheStrategy:nil];

if(session.state == FBSessionStateCreated || session.state == FBSessionStateCreatedTokenLoaded)
{
  [FBSession setActiveSession:session];

  // we open after the fact, in order to avoid overlapping close
  // and open handler calls for blocks
  [session openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
...

The code for the completion handler is never executed unless I click the x cancel button on the dialog (in which case I get an error as expected).
I am setting the FacebookAppID in my iOS target properties (info.plist) and I have the URL Schemes set up with fb###[url_scheme_suffix] as well.
The only difference I have between my code and the Facebook sample code is that I am using url scheme suffixes as I have a free and paid version of our app.
If the app uses Safari to log in, it works with the code as given. If it fast-switches to the Facebook app, it also works. Additionally, the shared facebook ios6 account settings work. The app only fails if it uses the in app modal.
Has anyone else encountered this?

A: The same thing is happening to me. It only occurs on the simulator (iphone5 4 inches, ios6), so I don't know if this issue will be present in actual devices.
After a couple of debugging sessions, i found that the FBDialog's webView:shouldStartLoadWithRequest:navigationType: method was not processing a url that was carrying the access_token. When facebook passes the access_token, it means you are authenticated. So, I figured, there was something missing there.
Here is the shape of the url that is not being processed:
fb122222222222222://authorize/#access_token=...&expires_in=5102464&code=...
Note that the url scheme is the same fb+API Key you have configured in the Info.plist file in your app.
Here is what I did in order to fix this issue. Note that I added a new else-if branch, in which I call the dialog success in case we have the access token:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
 navigationType:(UIWebViewNavigationType)navigationType {
    NSURL* url = request.URL;

    if ([url.scheme isEqualToString:@"fbconnect"]) {
        if ([[url.resourceSpecifier substringToIndex:8] isEqualToString:@"//cancel"]) {
            NSString * errorCode = [self getStringFromUrl:[url absoluteString] needle:@"error_code="];
            NSString * errorStr = [self getStringFromUrl:[url absoluteString] needle:@"error_msg="];
            if (errorCode) {
                NSDictionary * errorData = [NSDictionary dictionaryWithObject:errorStr forKey:@"error_msg"];
                NSError * error = [NSError errorWithDomain:@"facebookErrDomain"
                                                      code:[errorCode intValue]
                                                  userInfo:errorData];
                [self dismissWithError:error animated:YES];
            } else {
                [self dialogDidCancel:url];
            }
        } else {
            if (_frictionlessSettings.enabled) {
                [self dialogSuccessHandleFrictionlessResponses:url];
            }
            [self dialogDidSucceed:url];
        }
        return NO;
    }
//THIS IS WHAT I'VE ADDED>>>>
        else if ([[[[[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleURLTypes"] firstObject] objectForKey:@"CFBundleURLSchemes"] firstObject] isEqual:url.scheme])
        {
            [self dialogDidSucceed:url];
            return NO;
        }
//<<<<<
    else if ([_loadingURL isEqual:url]) {
        return YES;
    } else if (navigationType == UIWebViewNavigationTypeLinkClicked) {
        if ([_delegate respondsToSelector:@selector(dialog:shouldOpenURLInExternalBrowser:)]) {
            if (![_delegate dialog:self shouldOpenURLInExternalBrowser:url]) {
                return NO;
            }
        }

        [[UIApplication sharedApplication] openURL:request.URL];
        return NO;
    } else {
        return YES;
    }
}

I is worth mentioning that i am following all the fb sdk guidelines (3.1) and I havent made any further changes to the src code.
With those changes, the fb login process works as expected.
I hope this helps!


text:
Q: connect mongodb by mongo-go-driver consume huge memory I'm using mongo-go-driver, parallel connect several ports to check whether the port is listened by mongodb
go version 1.12.3
mongo-go-driver v1.0
type BaseServerStatus struct {
   Host           string    `bson:"host"`
   Version        string    `bson:"version"`
   Process        string    `bson:"process"`
   Pid            int64     `bson:"pid"`
   Uptime         int64     `bson:"uptime"`
   UptimeMillis   int64     `bson:"uptimeMillis"`
   UptimeEstimate int64     `bson:"uptimeEstimate"`
   LocalTime      time.Time `bson:"localTime"`
}

func GetBaseServerStatus(ip, port string) (srvStatus *BaseServerStatus, err error) {
   opts := options.Client()
   opts.SetDirect(true)
   opts.SetServerSelectionTimeout(1 * time.Second)
   opts.SetConnectTimeout(2 * time.Second)
   opts.SetSocketTimeout(2 * time.Second)
   opts.SetMaxConnIdleTime(1 * time.Second)
   opts.SetMaxPoolSize(1)
   url := fmt.Sprintf("mongodb://%s:%s/admin", ip, port)
   opts.ApplyURI(url)
   ctx, _ := context.WithTimeout(context.Background(), 2*time.Second)
   conn, err := mongo.Connect(ctx, opts)
   if err != nil {
      fmt.Printf("new %s:%s mongo connection error: %v\n", ip, port, err)
      return
   }
   defer conn.Disconnect(ctx)
   err = conn.Ping(ctx, nil)
   if err != nil {
      fmt.Printf("ping %s:%s ping error: %v\n", ip, port, err)
      return
   }
   sr := conn.Database("admin").RunCommand(ctx, bson.D{{"serverStatus", 1}})
   if sr.Err() != nil {
      fmt.Printf("get  %s:%s server status error: %v\n", ip, port, sr.Err())
      return
   }
   srvStatus = new(BaseServerStatus)
   err = sr.Decode(srvStatus)
   return
}

func main()  {
   var wg sync.WaitGroup
   //ips := []string{"xxx.xxx.xxx.xxx:22"}
   ips := []string{"xxx.xxx.xxx.xxx:22", "xxx.xxx.xxx.xxx:80", "xxx.xxx.xxx.xxx:7005", "xxx.xxx.xxx.xxx:7017", "xxx.xxx.xxx.xxx:7006", "xxx.xxx.xxx.xxx:7016", "xxx.xxx.xxx.xxx:7018", "xxx.xxx.xxx.xxx:7014", "xxx.xxx.xxx.xxx:199", "xxx.xxx.xxx.xxx:8182", "xxx.xxx.xxx.xxx:7015", "xxx.xxx.xxx.xxx:7022", "xxx.xxx.xxx.xxx:7013", "xxx.xxx.xxx.xxx:7020", "xxx.xxx.xxx.xxx:9009", "xxx.xxx.xxx.xxx:7004", "xxx.xxx.xxx.xxx:7008", "xxx.xxx.xxx.xxx:7002", "xxx.xxx.xxx.xxx:7021", "xxx.xxx.xxx.xxx:7007", "xxx.xxx.xxx.xxx:7024", "xxx.xxx.xxx.xxx:7010", "xxx.xxx.xxx.xxx:7011", "xxx.xxx.xxx.xxx:7003", "xxx.xxx.xxx.xxx:7012", "xxx.xxx.xxx.xxx:7009", "xxx.xxx.xxx.xxx:7019", "xxx.xxx.xxx.xxx:8001", "xxx.xxx.xxx.xxx:7023", "xxx.xxx.xxx.xxx:111", "xxx.xxx.xxx.xxx:7001", "xxx.xxx.xxx.xxx:8002", "xxx.xxx.xxx.xxx:19313", "xxx.xxx.xxx.xxx:15772", "xxx.xxx.xxx.xxx:19777", "xxx.xxx.xxx.xxx:15778", "xxx.xxx.xxx.xxx:15776"}

   for _, ip := range ips {
      wg.Add(1)
      //time.Sleep(3 * time.Second)
      go func(addr string) {
         fmt.Printf("start to probe port %s\n", addr)
         GetBaseServerStatus(strings.Split(addr, ":")[0], strings.Split(addr, ":")[1])
         wg.Done()
      }(ip)
   }
   wg.Wait()
   fmt.Println("scan end")
   time.Sleep(20 * time.Second)

}

however, run this code ,it consume 26GB memory
I use pprof to diagnose, see below
Showing top 10 nodes out of 15
      flat  flat%   sum%        cum   cum%
   26.29GB 96.86% 96.86%    26.29GB 96.86%  go.mongodb.org/mongo-driver/x/network/connection.(*connection).ReadWireMessage


text:
Q: representing a matrix with column/row labels
I would like to create a 2d Array with Java, or a Matrix with a int numbers.
I've already did that..but I still don't know how to assign labels to the rows/columns.
I would like to be able to access any number inside the matrix based on the row/columns
This is my java code
 Gson gson = new Gson();
    int[][] data = {{78, 0, 0, 0, 0}, {0, 54, 0, 0, 0}, {0, 0, 12, 0, 0}, {0, 0, 0, 74, 0}, {0, 0, 0, 0, 11}};
    String json = gson.toJson(data);

    // Convert JSON string into multidimensional array of int.
    int[][] dataHeatMap = gson.fromJson(json, int[][].class);
    for (int[] i : dataHeatMap) {
        for (int j : i) {
            System.out.print(j + " ");
        }
        System.out.println("");
    }
    return json;

A: You can use Enums:
public enum ROW {a, b, c, d, e}
public enum COL {f, g, h, i, j}

data[ROW.a.ordinal()][COL.f.ordinal()] = 3;

A: Use ENUM types which does represend the special index of your 2dim Array. Give them a field called value/name/... and create them with the index of them in the array. Afterwards you can easy call them with getting their letter-value which does represent the array index.
It´s very readable and ENUM.<VALUE> does not represent an INT value. So this is the way how you can do it.
public enum ROW {
        A(0), B(1), C(2), D(3), E(4);

        private final int value;
        ROW(int value) { this.value = value; }
        public int getValue() { return value; }
    }

    public enum COL {
        F(0), G(1), H(2), I(3), J(4);

        private final int value;
        COL(int value) { this.value = value; }
        public int getValue() { return value; }
    }

    public static void main(String []args){
        int[][] matrix = {{78, 0, 0, 0, 0}, {0, 54, 0, 0, 0}, {0, 0, 12, 0, 0}, {0, 0, 0, 74, 0}, {0, 0, 0, 0, 11}};
        System.out.println("Value: " + matrix[ROW.A.getValue()][COL.F.getValue()]);
    }

I would prefer the way above because you see what directly happens and can assign any value you want. But you just can use ENUM.ordinal(), too.
Then data[ROW.a.ordinal()][...] will return 0 for ROW because it´s listed first. b will return 1,... It just depends on the way they are listed/created on the ENUM.


text:
Q: Adding force to an object (like a trampoline) I have objects that act like trampolines, and I have an object that when it falls on the trampoline it should be shot in the direction that the trampoline is facing (Up/Down/Left/Right/Angled etc.).
I have tried two things to try an accomplish this, and neither works. Here was my first attempt:
void OnCollisionEnter2D(Collision2D other){
    if(other.gameObject.tag == "Player"){
        other.gameObject.rigidbody2D.AddForce(Vector2.up * 2500, ForceMode2D.Impulse);
    }
}

And here was my second attempt:
void OnCollisionEnter2D(Collision2D other){
    if(other.gameObject.tag == "Player"){
        other.gameObject.rigidbody2D.AddForce(gameObject.transform.rotation.eulerAngles * 2500, ForceMode2D.Impulse);
    }
}

What can I use to get the effect that I am looking for?
EDIT
Here is the full method if that helps at all:
void OnCollisionEnter2D(Collision2D other){
    if(other.gameObject.tag == "Player"){
        other.gameObject.rigidbody2D.velocity = Vector2.zero;

        other.gameObject.rigidbody2D.AddForce(transform.forward * forceAmount, ForceMode2D.Impulse);

        gameObject.GetComponent<SpriteRenderer>().color = new Color(Color2.Rand(), Color2.Rand(), Color2.Rand(), 1f);
    }
}

A: If you want to bounce in direction trampoline is facing, in your first attempt instead of
other.gameObject.rigidbody2D.AddForce(Vector2.up * 2500, ForceMode2D.Impulse);

use
other.gameObject.rigidbody2D.AddForce(transform.forward * 2500, ForceMode2D.Impulse);

If you want to have fixed force consider changing rigidbody2D.velocity directly.


text:
Q: Flask_app second Webapp overwritten Today I tried to start a new web app. But while making a second web app, I did not notice that the sourcecode directory was the same as my first web app. Consequently, my first web-app-sourcecode was overwritten by a standard boilerplate flask_app template.
I did retrieve the flask_app-cpython-36.pyc, but tryng to decompile it using uncompyle6, I keep on getting the error
ImportError: Ill-formed bytecode file flask_app.cpython-36.pyc <class 'TypeError'> File flask_app.cpython-36.pyc doesn't smell like Python bytecode: expecting code indicator 'c'; got ''
Is there a way to go back to the previous version of the flask_app?


text:
Q: Applicative validation syntax scalaz + shapeless 2.0 I'm trying to convert this Applicative validation syntax example into Scalaz 7 + Shapeless 2.0
//for jupyter-scala kernel
//classpath.add("org.scalaz" %% "scalaz-core" % "7.2.7")
//classpath.add("com.chuusai" %% "shapeless" % "2.3.2")

case class Foo(a: Int, b: Char, c: String)

First the Scalaz syntax
import scalaz._
import Scalaz._

type ErrorsOr[A] = ValidationNel[String, A]
type Validator[A] = String => ErrorsOr[A]

val checkA: Validator[Int] = (s: String) =>
   try s.toInt.success catch {
   case _: NumberFormatException => "Not a number!".failureNel
}

val checkB: Validator[Char] = (s: String) =>
  if (s.size != 1 || s.head < 'a' || s.head > 'z') {
    "Not a lower case letter!".failureNel
  } else s.head.success

val checkC: Validator[String] = (s: String) =>
  if (s.size == 4) s.success else "Wrong size!".failureNel

def validateFoo(a: String, b: String, c: String) =
    (checkA(a) |@| checkB(b) |@| checkC(c))(Foo.apply _)

println(validateFoo("ab", "cd", "ef"))
//Failure(NonEmpty[Not a number!,Not a lower case letter!,Wrong size!])
println(validateFoo("42", "cd", "ef"))
//Failure(NonEmpty[Not a lower case letter!,Wrong size!])

def validateFoo2(a: String, b: String, c: String):Validation[NonEmptyList[String], Foo] =
  checkC(c) <*> (checkB(b) <*> (checkA(a) map (Foo.apply _).curried))

println(validateFoo2("42", "cd", "ef"))
//Failure(NonEmpty[Not a lower case letter!,Wrong size!])

So far so good, now into Shapeless 2.0
import shapeless._
import shapeless.ops.hlist._
import shapeless.ops.function._
import shapeless.poly._
import shapeless.syntax.std.function._

object applier extends Poly2 {
  implicit def ap[F[_]: Applicative, H, T <: HList, R]:
    Case2.Aux[applier.type, F[(H :: T) => R], F[H], F[T => R]] =
    at[F[(H :: T) => R], F[H]](
      (f, fa) => fa <*> f.map(hf => (h: H) => (t: T) => hf(h :: t))
    )
}

class Lifter[F[_]: Applicative] {
  def lift[G, H, A <: HList, M <: HList, R](g: G)(implicit
    hlG: FnToProduct.Aux[G, A => R],
    mapped: Mapped.Aux[A, F, M],
    unH: FnFromProduct.Aux[M => F[R], H],
    folder: LeftFolder.Aux[M, F[A => R], applier.type, F[HNil => R]]
  ) = unH((m: M) => folder(m, hlG(g).point[F]).map(_(HNil)))
}

def into[F[_]: Applicative] = new Lifter[F]

val liftedFoo = into[ErrorsOr] lift (Foo.apply _)

def validateFooGeneric(a: String, b: String, c: String) =
  liftedFoo(checkA(a), checkB(b), checkC(c))

println(validateFooGeneric("42", "cd", "ef"))
//Failure(NonEmpty[Not a lower case letter!,Wrong size!])

Now the final bit
    def validate[F[_], G, H, V <: HList, I <: HList, M <: HList, A <: HList, R]
  (g: G)(v: V)(implicit
  hlG: FnToProduct.Aux[G, A => R],
  zip: ZipApply.Aux[V, I, M],
  mapped: Mapped.Aux[A, F, M],
  unH: FnFromProduct.Aux[I => F[R], H],
  folder: LeftFolder.Aux[M, F[A => R], applier.type, F[HNil => R]],
  appl: Applicative[F]
) = unH((in: I) => folder(zip(v, in), hlG(g).point[F]).map(_(HNil)))

All compiling but when one attempts to use it, e.g.:
val validateFooShapeless = validate(Foo.apply _)(checkA :: checkB :: checkC :: HNil)

I get an error
could not find implicit value for parameter mapped: shapeless.ops.hlist.Mapped.Aux[A,F,M]
validate(Foo.apply _)(checkA :: checkB :: checkC :: HNil)
                     ^

Any ideas, pointers would be appreciated

A: You need SI-2712 improvement for implicit search to work correctly on type lambdas (for example, Validator[?]). Update Scala to 2.11.11+ or 2.12.2+ and add the following to your build.sbt:
scalacOptions ++= Seq("-Ypartial-unification")

For 2.10.x, there's a compiler plugin, which you can activate with the following line in build.sbt:
addCompilerPlugin("com.milessabin" % "si2712fix-plugin_2.10.6" % "1.2.0")


text:
Q: Is there any system restore in Ubuntu like Windows? I followed the instructions that in Install gnome 3.8 in Ubuntu 13.04 and then after restarting many programmes stopped working and fails to start like Rhythombox / Cairo dock / Totem / Weather / Empathy
Is there any way to cancel what I did or remove installed packages?
They're a lot of packages (about 90 MB) and I can't purge them because I can not remember them all.

A: You can get the list of recently installed packages that were installed via apt-get or Software Center by following command:
cat /var/log/dpkg.log | grep "\ install\ "

you can see all the packages from it and then remove them.

A: *

*Backup any data that you want.

*Shut down your PC.

*Insert installation disk/usb turn on PC.

*Bring up boot menu, set to boot from CD-ROM/USB.

*set to delete the other ubuntu/ delete partition.

this is the ubuntu equivalent of a system restore.


text:
Q: NullReferenceException, how can i solve this Unity is saying that something is going wrong in the void update()
any ideas as to what this may be?
I have all the variables defined below but Unity says that some object reference is not set to an instance of an object
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GameStatus : MonoBehaviour
{
    public Text PointsCounter;

    public int FightPoints = 0;
    public int FightDamage = 1;

    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        PointsCounter.text = "Points: " + FightPoints;
    }

    private void Awake()
    {
        DontDestroyOnLoad(gameObject);

    }
}

A: You never create an instance of PointsCounter so it is null when you hit the line PointsCounter.text = "Points: " + FightPoints;
Instantiate the PointsCounter:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GameStatus : MonoBehaviour
{
    public Text PointsCounter;

    public int FightPoints = 0;
    public int FightDamage = 1;

    // Start is called before the first frame update
    void Start()
    {
        PointsCounter = new Text(); // may or may not work; depends on if UnityEngine.UI.Text has an empty constructor; it probably doesn't, see explanation below if not
    }

    // Update is called once per frame
    void Update()
    {
        PointsCounter.text = "Points: " + FightPoints;
    }

    private void Awake()
    {
        DontDestroyOnLoad(gameObject);

    }
}

Though, given that you are using Unity, PointsCounter probably needs to be assigned using the editor. Go to your Unity Hierarchy and ensure the GameObject with this GameStatus behavior has a PointsCounter property set in the UI


text:
Q: How to test if model can explain data? I have a purely deterministic system-theoretic background, so please bear with me if this is elementary.
The question is related to: How to test whether a series data follow Ornstein-Uhlenbeck process (OU process)?, but my case is more generic.
I have fitted a parametric (1-5 parameters, case-specific) dynamic model to financial time series data; in the simplest case, the model reduces to an Ornstein-Uhlenbeck specification. I do not (yet) aim to predict anything. I want to confirm - or refute - the hypothesis that this model describes the data. How can I do it? The model is based on sound economic theory (under certain circumstances), and I am now investigating its validity in practice.
My initial thought was to study the statistical properties of the residual process, i.e. $y_{actual}(t) - y_{model}(t)$. But should I test for stationarity (e.g. Augmented Dickey-Fuller)? Or normality (e.g. Kolmogorov-Smirnov)? Basically, the residual process should be unpredictable for the model to hold true, right?
On the one hand, I am haunted by the Weierstrass approximation theorem, which implies that by increasing model complexity, I can always find a model to describe any sufficiently well-behaved data series. On the other hand, I keep reading journal papers (e.g. the widely cited ones by D. Sornette and coworkers on bubbles and crashes) where specific deterministic models are fit to explain dynamical phenomena of financial markets. As far as I understand, a major argument in favour of such models is that a certain fixed model (with case-specific parameter values) appears to provide a good description of the target series in several different circumstances and time periods. This reasoning would be sufficient for my case, too, as indicated above, but I fear I am missing something important.


text:
Q: Require_once In laravel I have a plugin for my site and I duplicate the folder structure and renamed the files, I try to load the new plugin I made in the global.php file the same way the original plugin loaded with
//load plugins
if(File::exists(public_path('plugins/releasedate/protected/start.php')))
{
File::requireOnce(public_path('plugins/releasedate/protected/start.php'));
}

But when I'm adding the other plugin
//load plugins
if(File::exists(public_path('plugins/releasedate/protected/start.php')))
{
File::requireOnce(public_path('plugins/releasedate/protected/start.php'));
}

if(File::exists(public_path('plugins/streaming/protected/start.php')))
{
File::requireOnce(public_path('plugins/streaming/protected/start.php'));
}

It load's only the first plugin. Or can I use only one requireOnce in my script?

A: Try:
$plugins = array(
    public_path('plugins/releasedate/protected/start.php'),
    public_path('plugins/streaming/protected/start.php')
);

foreach($plugins AS $plugin) {
    if(!is_file($plugin)) {
        die("NO FILE: ".$plugin);
    }

    require_once($plugin);
}

A: I merged my files without a plugin folder and start.php file and everything seems to be fine. Thank you all


text:
Q: MySQL - Сопоставить каждое значение из ячейки одного столбца со значениями в другом и заменить его значением из соседнего столбца Есть таблица contents, которая содержит 13 столбцов и 1,5 млн строк.

Столбец rel_gall (text, utf8_general_ci) содержит в ячейках список значений с разделителем запятая.
Ячейка может содержать от нуля (ячейка может быть пустой) до тридцати значений с разделителем запятая. Значения между разделителем могут содержать буквы разного регистра и цифры.
(пример: cRbkmw,wiwvRDJ,ivhswa,iqexFT,hjJmkT,uiiwRnT,iklbJr,ibjTof,lvibeib,imiJoh).
Столбец HEX (varchar(250), utf8_general_ci) содержит в ячейках значение, которое встречается в ячейках столбца rel_gall. Столбец HEX не уникальный, строки повторяются. Из рандомного набора значений столбца HEX и состоит ячейка столбца rel_gall.
Столбец HEX_new (varchar(250), utf8_general_ci) содержит в ячейках новое значение HEX. На эти значения мы будем обновлять значения в столбце rel_gall. Столбец HEX_new не уникальный, строки повторяются.
Нужно сопоставить каждое значение из ячейки столбца rel_gall со значениями в ячейках столбца HEX (достаточно первого совпадения) и заменить значение из ячейки rel_gall на новое значение из соседнего столбца HEX_new.
Пример:

Строка id 4. Значение в столбце rel_gall xRbhmw должно замениться на g3b1p5j7f3g1e1, hiiwRRJ -> z6k0d2f1c0t6k6, bbJmxT -> n0m3j7v6h1w8c5, iTohwbT -> q4o2p2o0o5l3p6, imibJo -> q7k4e3m1n1y3h1 и т.д.

A: Ответ полностью обновлен после обсуждения.
Для начала лучше сделать копию таблицы contents, на всяк случай... если что-то пойдет не так. Потом сотрете.
Создаем временную таблицу.
CREATE TABLE `__temp` (
  `id` int(11) NOT NULL,
  `tHEX` varchar(250) NOT NULL,
  `tHEX_new` varchar(250) NOT NULL,
  PRIMARY KEY (`id`,`tHEX`,`tHEX_new`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Вносим в нее данные (может занять время из-за FIND_IN_SET())
INSERT INTO __temp (id, tHEX, tHEX_new)
SELECT c.id, c2.HEX, c2.HEX_new
FROM contents c JOIN contents c2 ON FIND_IN_SET(c2.HEX, c.rel_gall)>0;

Обновляем источник
UPDATE contents c
JOIN (SELECT id, GROUP_CONCAT(tHEX_new) as hexes FROM __temp GROUP BY id) gr ON c.id=gr.id
SET c.rel_gall=gr.hexes;

Кстати, если так все сделать, то из rel_gall уйдут все строчки, которые не упомянуты в contents.HEX. Насколько я понял, в Вашем случае это как раз плюс. :)


text:
Q: How do I update a text label inside a table view based on segmented control selection? I am creating a news feed. I have a view controller that allows the user to fill out info and hit post. Part of the info involves selecting XBOX, PS4, or PC in a segmented control. So if they select XBOX, then the text label inside the table cell should say XBOX when they post to the news feed. I am having trouble connecting everything as I am relatively new to iOS programming.
This is the view controller that allows you to post to the news feed:
import Foundation
import UIKit
import Firebase
import FirebaseDatabase

class NewPost: UIViewController, UITextViewDelegate {

    @IBOutlet var enterGamertag: UITextField!
    @IBOutlet var enterMessage: UITextField!
    @IBOutlet var platformSegmentedControl: UISegmentedControl!

    override func viewDidLoad() {
        super.viewDidLoad()

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }

    //ADDTOLIST BUTTON
    @IBAction func addToList(_ sender: UIButton) {

        let postRef = Database.database().reference().child("posts").childByAutoId()

        let postObject = [
            "gamerTag": enterGamertag.text as Any,
            "bodytext": enterMessage.text as Any,
            "platformSelected": platformSegmentedControl.selectedSegmentIndex as Any,
            "timestamp": [".sv":"timestamp"]
            ] as [String:Any]

        postRef.setValue(postObject, withCompletionBlock: { error, ref in
            if error == nil {
                self.dismiss(animated: true, completion: nil)
            } else {
                // Handle the error
            }
        })

    }

    //dismiss keyboard
    @IBAction func dismissKeyboard(_ sender: UITextField) {
        self.resignFirstResponder()
    }

    @IBAction func micPressed(_ sender: UIButton) {
        if sender.isSelected {
            sender.isSelected = false
        }   else {
            sender.isSelected = true
        }
    }

    @IBAction func logOutPressed(_ sender: UIButton) {

        try! Auth.auth().signOut()
        performSegue(withIdentifier: "logOut", sender: self)

    }

    @IBAction func platformSegmentPressed(_ sender: UISegmentedControl) {

        let getIndex = platformSegmentedControl.selectedSegmentIndex

        switch (getIndex) {
        case 0:

        default:
            <#code#>
        }

    }

}

Here is the newsfeed view controller:
import UIKit
import Firebase

class FeedTable: UIViewController, UITableViewDelegate, UITableViewDataSource {

    @IBOutlet var tableFeedView: UITableView!

    var posts = [Post]()

    //VIEWDIDLOAD
    override func viewDidLoad() {
        super.viewDidLoad()

        observePosts()

        // Hide the navigation bar on the this view controller

        tableFeedView.delegate = self
        tableFeedView.dataSource = self

        tableFeedView.register(UINib(nibName: "PostTableViewCell", bundle: nil), forCellReuseIdentifier: "customTableCell")

//        self.tableFeedView?.backgroundColor = UIColor.black
        tableFeedView.tableFooterView = UIView()

        configureTableView()

    }

    func observePosts() {

        let postRef = Database.database().reference().child("posts")

        postRef.observe(.value, with: { snapshot in

            var tempPosts = [Post]()

            for child in snapshot.children {
                if let childSnapshot = child as? DataSnapshot,
                    let dict = childSnapshot.value as? [String:Any],
                    let gamerTag = dict["gamerTag"] as? String,
                    let bodytext = dict["bodytext"] as? String,
                    let timestamp = dict["timestamp"] as? Double {

                    let post = Post(id: childSnapshot.key, gamerTag: gamerTag, bodyText: bodytext, timestamp: timestamp)
                    tempPosts.append(post)

                }
            }

            self.posts = tempPosts
            self.tableFeedView.reloadData()

        })

    }

    @IBAction func refreshTable(_ sender: UIButton) {
        tableFeedView.reloadData()
    }

    //Cell For Row At
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell:PostTableViewCell = tableView.dequeueReusableCell(withIdentifier: "customTableCell", for: indexPath) as! PostTableViewCell
        cell .set(post: posts[indexPath.row])
        return cell
    }

    //Number Of Rows
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return posts.count
    }

    //Automatic Row Height
    func configureTableView() {
        tableFeedView.rowHeight = UITableViewAutomaticDimension
        tableFeedView.estimatedRowHeight = 120.0
    }

}

Here is the Posting profile class:
import Foundation

class Post {

    enum platform {
        case XBOX1
        case PS4
        case PC
    }

    var id: String
    var gamerTag: String
    var bodyText: String
    var timestamp: Double
    var platform: platform = .XBOX1

    init(id: String, gamerTag: String, bodyText: String, timestamp: Double, platform: platform) {

        self.id = id
        self.gamerTag = gamerTag
        self.bodyText = bodyText
        self.timestamp = timestamp
        self.platform = platform

    }

}

And here is the table cell class:
import UIKit

class PostTableViewCell: UITableViewCell {

    @IBOutlet weak var customMessageBody: UILabel!
    @IBOutlet weak var customConsole: UILabel!
    @IBOutlet weak var ifMicUsed: UIImageView!
    @IBOutlet weak var timeAdded: UILabel!
    @IBOutlet weak var gameMode: UILabel!
    @IBOutlet weak var customGamerTag: UILabel!

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

    func set(post:Post){

        customGamerTag.text = post.gamerTag
        customMessageBody.text = post.bodyText
        timeAdded.text = "\(post.timestamp) minutes ago."
        customConsole.text = "\(post.platform)"

    }

}


text:
Q: Issue with `pgflibrary` and MiKTeX After reading "Tikz shape similar to rectangle with selective drawing of borders," I tried to compile the following code:
\documentclass[tikz]{standalone}
\usetikzlibrary{chains} \usetikzlibrary{qrr.shapes.openrectangle}
\tikzset{nodes={rounded corners, text height=\heightof{f}, text width=\widthof{aaaa}, ultra thick, draw, open rectangle fill=blue!40, shape=open rectangle,
  append after command={(\tikzlastnode.south west) edge[to path={rectangle (\tikztotarget)}, very thin] (\tikzlastnode.north east)}}}
\begin{document}
\begin{tikzpicture}[x=1.1cm, Start chain/.style={start chain=ch#1 going below}, Start chain/.list={1,...,4}, node distance=+2pt]\ttfamily
\foreach \ch/\si in {1/{e, n, w, s},
                     2/{nws, ews, ens, enw},
                     3/{en, nw, ws, es},
                     4/{, full, ew, ns}}
  \foreach \Si in \si
    \node[at=(right:\ch), on chain=ch\ch, open rectangle sides=\Si] {\Si};
\end{tikzpicture}
\end{document}

but received the following error:
! I can't find file `pgflibraryqrr.shapes.openrectangle.code.tex'.
<argument> ...input pgflibrary\pgf@temp .code.tex

I checked my MiKTeX installation, and the epigraph package is included therein.
How do I resolve this issue?


text:
Q: How does ::selection's specificity work against type selectors? Some questions about using CSS to specify the color of selected text:
Imagine that a rule like the following exists in the default CSS that's implemented by the browser:
::selection { background-color: Highlight; color: HighlightText; }

Further imagine that a rule like the following is defined in any site-specific authored stylesheet:
body { background-color: white }

*

*Given these rules, what would the background-color of the selected body text be? Would it be white, or Highlight?
Perhaps the rule in the author stylesheet should override the default rule: because according to specificity, body is just as specific as ::selection and is specified later (and should therefore override the previous entry).
On the other hand, that would result in text being invisible when it's selected (because if Highlight is blue and HighlightText is white so that selected text is white-on-blue, then overriding the background-color of selected text so that it's white would result in its being white-on-white).

*Assuming that the behaviour in step 2 is undesirable, how to avoid it?

*

*Say that it's a bug in the user stylesheet, which shouldn't ever specify background-color without also specifying color?

*Say that body isn't a match for selected body text except when the ::selection pseudo-element is specified as part of the selector?

A: Type selectors (e.g. body) and pseudo-element selectors (e.g. ::selection) do indeed have the same specificity, but specificity only comes into play when two selectors select the same element.
The body selector doesn't select selected text, or any text at all — it selects the  element. It's the element, and not its text, that has the background-color.
Whereas ::selection selects an imaginary element that surrounds currently selected text on the page. So there's no conflict between styles set on body and ::selection, because the selectors select different things.
Example
Imagine you had the following HTML:

    I am some body text.

I am some text in a paragraph.

And the following CSS:
p {
    background-color: red;
}

body {
    background-color: white;
}

Both selectors have the same specificity, but the
's background will still be red, because it's not the  element.
The same is true if you replace p with ::selection — selected text's background will be red, because text within the  element is not the  element.
So, basically, what you said here:

body isn't a match for selected body text except when the ::selection pseudo-element is specified as part of the selector

A: The following style:
body { background-color: white }

applies to background color of your page.
On the other hand, this rule:
::selection { background-color: Highlight; color: HighlightText; }

applies styles when you select text on your page.
So they do completely different things and there is no question of collision between them.

A:
Why was it removed?

Well that would be a question you would have to ask of the W3C committee that removed it from the draft. My understanding is there has been a lot of internal turmoil within the W3C community since they began writing the HTML5 and CSS3 drafts. Certain individuals that run projects developing the browsers (and I wont go into names) wanted it done one way, and developers be damned. The developer community wanted it done another way, and so began feud over who should control the W3C.

Given these rules, what would the background color of selected body text be: would it be white, or Highlight?

Sarfraz hit it on the head here, the :selection pseudo-class will only effect selected text. So in your example when you highlight something the background color changes to Highlight, when it is unselected it returns to white.
I haven't tested this particular example but here is what I understand of it

A: ::selection will override the background color once the selection is made, and will bring it back to the body{background-color: white;} once the text is deselected.
we just have to make sure to always give a proper color and background values to both the selection and the main style.


text:
Q: How to initialize a bitfield inside structure declaration? MSVC++ gives me a compiler error when I try to initialize a bit field inside structure declaration:
struct SomeStruct
{
    bool a : 1 = false; // compiler error
    bool a = false : 1; // compiler error
} ;

What is the syntax for initializing bit fields inside structure declaration?

A: The error I get from clang is very telling:

bitfield member cannot have an in-class initializer

So you simply can't do it, you need a constructor that initializes the members.

A: I am a bit surprised but apparently Visual Studio is correct here, if we look at the grammar from section 9.2 of the draft C++11 standard it says:
member-declarator:
  declarator virt-specifier-seqopt pure-specifieropt
  declarator brace-or-equal-initializeropt
  identifieropt attribute-specifier-seqopt: constant-expression

and bit-fields are not allowed to have a brace-or-equal-initializer. It is not clear to me why this restriction exists though. This feels like the first time I realized a in-class initializer makes a class a non-aggregate.
This apparently is a defect:

The grammar for member-declarator (9.2 [class.mem]) does not, but should, allow for a brace-or-equal-initializer on a bit-field declarator.

This issue was apparently also caught before C++11 was finalized as we can see from Issues Found Implementing C++0x:

*(Richard Smith) class.mem: bitfield members cannot have in-class initializers

  The grammar does not allow a
  brace-or-equal-initializer for a bitfield member. This seems like an
  oversight. A brace-or-equal-initializer after a constant- expression
  appears to be unambiguous.
clang behavior: clang implements the letter of the standard.
suggested resolution: Change the grammar as follows:
member-declarator:
    identifieropt attribute-specifier-seqopt : constant-expression brace-or-equal-initializeropt

but apparently this feel through the cracks.


text:
Q: Keep count of read for each month in array of object Suppose I have an array of object as:
const sampleArray = [{"read":true,"readDate":2021-01-15T18:21:34.059Z},
                     {"read":true,"readDate":2021-01-15T18:21:34.059Z},
                     {"read":true,"readDate":2021-02-15T18:21:34.059Z},
                     {"read":true,"readDate":2021-04-15T18:21:34.059Z},
                     {"read":true,"readDate":2021-12-15T18:21:34.059Z}]

I want to keep count of read for each month and where the month is missing it should give 0.
Expected O/P :
 [2,1,0,1,0,0,0,0,0,0,0,12] => In jan -2 count, feb - 1 count, april - 1 count, dec - 1 count and rest months there is no read data.

For this I tried :
let invoiceInfoArray = [];
var d = new Date();
var n = d.getMonth();
for (let i = 0; i < sampleArray.length; i++) {
     if (sampleArray[i].readDate.getMonth() + 1 == n) {
           invoiceInfoArray.push(invoiceInfo[i])
      }
}

Also I thought as if I check for each condition but this will also not be feasible as it will check for particular month and if not available it will automatically insert 0 for rest which is incorrect,
   for (let i = 0; i < sampleArray.length; i++) {
       if (sampleArray[i].readDate.getMonth() + 1 == 1) {
             invoiceInfoArray.push(invoiceInfo[i])
       } else if (sampleArray[i].readDate.getMonth() + 1 != 1) {
             invoiceInfoArray.push(0)
       } else if (sampleArray[i].readDate.getMonth() + 1 == 2) {
             invoiceInfoArray.push(invoiceInfo[i])
       }  else if (sampleArray[i].readDate.getMonth() + 1 != 2) {
             invoiceInfoArray.push(0)
       }
   }

I'm unable to form logic on how I can achieve my target such that I want to keep count of read for each month and where the month is missing it should give 0.
Expected O/P :
 [2,1,0,1,0,0,0,0,0,0,0,1] => In jan -2 count, feb - 1 count, april - 1 count, dec - 1 count and rest months there is no read data.

Please let me know if anyone needs any further details. Any guidance will really be helpful.

A: Create a new array of 12 length and make the readDate as a Date object and get the month from getMonth.
You can create a new array with 12elements and prefilled with 0 as
const months = Array(12).fill(0);
// or
const months = new Array(12).fill(0);

read about Array, fill

const sampleArray = [{
    read: true,
    readDate: "2021-01-15T18:21:34.059Z"
  },
  {
    read: true,
    readDate: "2021-01-15T18:21:34.059Z"
  },
  {
    read: true,
    readDate: "2021-02-15T18:21:34.059Z"
  },
  {
    read: true,
    readDate: "2021-04-15T18:21:34.059Z"
  },
  {
    read: true,
    readDate: "2021-12-15T18:21:34.059Z"
  },
];

const months = Array(12).fill(0);
// or
// const months = new Array(12).fill(0);

sampleArray.forEach((obj) => {
  const month = new Date(obj.readDate).getMonth();
  ++months[month];
});

console.log(months);


text:
Q: Accessible TeX/LaTeX textbooks, primers, and materials? I apologize, as this is a somewhat off-the-beaten-trail question.
I'm looking for textbooks (or other educational materials) on TeX and LaTeX that fulfill one or more of the following:

*

*Reads/renders well with a screen reader (namely TextHelps's Read & Write Gold);

*is typeset (or can be re-typeset) with a LD-friendly font such as OpenDyslexic;

*comes with online materials in the vein of MyMathLab or MyCommunicationLab (viz. flashcards and quizzes);

*has an audiobook version (MP3 or DTB); and/or

*is available via BookShare.

I hope this question isn't too off-topic, because I have been having a genuinely hard time finding a textbook or primer that meets my needs.

P.S: Are there any TeX/LaTeX tutors in the Washington, D.C. area? 1:1 instruction is how I learn best, to be frank.
P.P.S: Are there any good flashcard sets for memorizing LaTeX snippets, macros, and commands?

A: (Converting my comment into an answer.)
My series of LaTeX books are provided as paperback, PDF (free) and HTML (free). The HTML versions were specifically designed to be accessible, although I don't have all the accessibility software installed to test it. With the HTML versions, you can use your browser to switch off the CSS and set the font to a size or style that's easier to read. Most of the images showing the typeset output from the examples either have a brief description in the alt tag or link to a page with a longer description and the nearest HTML approximation.
The first two volumes are: LaTeX for Complete Novices and Using LaTeX to Write a PhD Thesis. The third volume (which covers more advanced topics) isn't finished yet, but it will follow the same format as the other two.


text:
Q: How do I stop Access from auto sorting my data on import? I am importing an Excel spreadsheet into Access 2010. I created a Saved Import that will import a column of data intentionally out of order. The query I created needs to take the exact order of this data, return a value associated with it from a master table in our company's DB, then allow me to export both of these fields to Excel. I need to do this because I need to copy and paste the export on top of the values of another spreadsheet.
The problem is that when I import into Access the FG column is sorted by A-Z. This can be seen in both the table import and the results of the query. How do I keep my data in the mixed up order throughout the whole process?
Prepared Import sheet
FG
D
B
E
A
C

After importing
FG
A
B
C
D
E

Query
FG         Description
A          descript of A
B          descript of B
C          descript of C
D          descript of D
E          descript of E

A: To solve this problem, I had to use the option "Let Access create a primary key for me" when importing. This allowed the table to be populated with the data in the same order as was on the import spreadsheet. To make sure the query also keeps this same order, I had to include the new "ID" field as part of the results.
Final SQL Code
SELECT FGImport.ID, FGImport.FG, dbo_Active_Part_Number_List_Syteline.description
FROM dbo_Active_Part_Number_List_Syteline RIGHT JOIN FGImport ON dbo_Active_Part_Number_List_Syteline.item = FGImport.FG
GROUP BY FGImport.ID, FGImport.FG, dbo_Active_Part_Number_List_Syteline.description;

A: This may be an OLD post, but I would suggest opening Excel and creating a simple macro to enumerate the records before importing to Access; once you've imported the file, this enumartion (we'll call it "MacroField") will be part of the data set you import (We'll call this table "Table1"). You'll still retain the records original formatting by querying the record and ordering by Table1.MacroField asc/desc.  There has to be a better way of doing it, but if you're in a pinch this does the trick.

Sub liminal()
For i = 1 To ThisWorkbook.Sheets.Count
If Sheets(i).Name <> "PrimaryTab" Then
    ct = 0
    Sheets(i).Activate
    Range("B1000000").Select
    Selection.End(xlUp).Select
    en = ActiveCell.Row

        For p = 1 To en
            ct = ct + 1
            Sheets(i).Range("A" & p).Value = ct
        Next p

End If

Next i
Sheets("PrimaryTab").Range("A1").Select
MsgBox "Data Set, please open and load to MS ACCDB"
End Sub

A: If you want to import an Excel table (let's say with three columns) and you want the first row of the Access table (you are importing the data into) to have the Columns Title, then you create and Access table "myTable" with these fields:
F1 (Data Type: whatever)
F2 (Data Type: whatever)
F3 (Data Type: whatever)
Order (Data Type: AutoNumber)

In Access VBA you will use the following command:
ImportFile = "C:\myExcelFile"

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "myTable", ImporteFile, False

When the Excel file is imported, the data will be alphabetical sorted by the first column; but the Field "Order" will have the sequential order of the data as in the Excel File.  You can use a query on the table to sort the data by the field "Order", thus getting back the same data arrangement as in the Excel Table.


text:
Q: Extracting an asymptotic from a sequence defined by a recurrence relation Suppose I have a sequence defined via its first term and a recurrence relation involving summation over all previous values with some coefficients. Here is the sequence I am interested in right now (although I would like to find a general method applicable to other sequences as well, if possible):
$$a_0=1,\quad a_n=\sum_{k=0}^{n-1}\frac{a_k}{(n-k+1)!\,(2^n-1)}.\tag1$$
This sequence is positive rational, monotone decreasing, decaying faster than exponentially, with a few initial terms: $$1,\,\frac12,\,\frac5{36},\,\frac1{36},\,\frac{143}{32400},\,\frac{19}{32400},\,\frac{1153}{17146080},\,\frac{583}{857
   30400},\,\dots\tag2$$
It is related to values of the Fabius function. I'm interested in its asymptotic expansion for $n\to\infty$. Using empirical numeric methods, and with some luck, I came to this conjecture:
$$\log_2a_n\stackrel{\color{#aaaaaa}?}=-n \log_2n+\frac{n}{\log2}-\frac{\log _2^2n}{2} +\left(1-\frac{1}{2 \log ^22}-\frac{2}{\log2}\right)+\mathcal O\!\left(\frac{\log^2n}{n}\right)\!.\tag3$$
Could you suggest a way to prove it and find a few next terms of this asymptotic expansion?
How should I approach problems like this in general?

Update: The sequence in question is directly connected to the values of the Fabius function at negative integer powers of two: $$F\!\left(2^{-n}\right)=2^{-\binom n2}a_n.\tag4$$
There is also a direct non-recursive formula for it (conjectured):
$$a_n\stackrel{\color{#aaaaaa}?}=\frac{(-1)^n}{(2;2)_n}\sum_{k=0}^n\frac{\binom n k_2}{2^{(n-1)k}(n+k)!}\sum_{\ell=0}^{2^k-1}(-1)^{\sigma_2(\ell)}\left(\ell-2^k+\tfrac12\right)^{n+k},\tag5$$
where $\left(q;q\right)_n=\prod_{k=1}^n\!\left(1-q^k\right)$ is the q‑Pochhammer symbol, ${\binom n k}_q=\frac{\left(q;q\right)_n}{\left(q;q\right)_k\,\left(q;q\right)_{n-k}}$ is the q‑binomial coefficient, and $\sigma_2(\ell)$ is the sum of binary digits of $\ell$; note that $(-1)^{\sigma_2\left(\ell\right)}$ is just the signed version of the Thue–Morse sequence.

A: This is not a proper answer since it involves several heuristics. I will use the generating function $f(x)$ found by @skbmoore. For convenience, let $g(x)=f(2x)$. I would like to use Hayman's formula for the asymptotics of the Maclaurin coefficients of certain entire functions. The first non-trivial assumption is that $g(x)$ is admissible in the sense of Hayman, i.e., we can use his formula. Note that the Maclaurin coefficients of $g(x)$ are $2^n a_n$.
First, we estimate the growth of the logarithmic derivative. It can be shown that
\begin{align*}
a(r) :\!&= r\frac{{g'(r)}}{{g(r)}} = 2r + \sum\limits_{k = 0}^\infty  {\left( {\frac{{r/2^k }}{{e^{r/2^k }  - 1}} - 1} \right)} \\ & = 2r - \frac{{\log r}}{{\log 2}} - \frac{1}{2} - \sum\limits_{k = 1}^\infty  {\frac{{2^k r}}{{e^{2^k r}  - 1}}} +c(r),
\end{align*}
where the function $c(r)$ is bounded and staisfies $c(r)=c(2r)$. Numerics suggests that $|c(r)|<2\times 10^{-5}$. Hayman defines the sequence $r_n$ via $a(r_n ) = n$. Using the above, I found
$$
r_n  = \frac{n}{2} + \frac{{\log n}}{{2\log 2}} - \frac{1}{4} + o(1)
$$
as $n\to +\infty$. We also have $b(r) := ra'(r) = 2r + \mathcal{O}(1)$ for large $r$. Now
\begin{align*}
\log g(r) & = \int_1^r {\frac{{a(t)}}{t}dt}  + \log g(1) \\ & = 2r - \frac{{\log ^2 r}}{{2\log 2}} - \frac{{\log r}}{2} + C_0 - \sum\limits_{k = 1}^\infty \log (1 - e^{ - 2^k r} )  + d(r),
\end{align*}
with some real constant $C_0$ and with a bounded function $d(r)$ which staisfies $d(r)=d(2r)$. Therefore, by Hayman's formula,
\begin{align*}
\log (2^n a_n ) & =  - n\log r_n  + \log g(r_n ) - \frac{1}{2}\log (2\pi ) - \frac{1}{2}\log b(r_n ) + o(1)
\\ &
 =  - n\log \left( {\frac{n}{2}} \right) + n - \frac{{\log ^2 n}}{{2\log 2}} + C_1 +d(r_n)+ o(1)
\end{align*}
as $n\to +\infty$ with some real constant $C_1$. Equivalently,
$$
\log _2 a_n  =  - n\log _2 n + \frac{n}{{\log 2}} - \frac{{\log _2^2 n}}{2} + C_2 +d(r_n)+ o(1)
$$
as $n\to +\infty$ with some real constant $C_2$.

A: The following might help, but it's not a complete solution.
The coefficients $a_n$ have an alternative expression, where the $B_n$ are the Bernoulli numbers:
$$ \tag{1} a_n = \sum_{k=0}^n 2^k a_k \  \frac{B_{n-k}}{(n-k)!} $$
To prove $(1)$, start with the recursion given in the problem statement, flip the direction of summation, and pull the $a_n$ term into the sum to get
$$2^n a_n = \sum_{k=0}^n \frac{1}{k+1} \binom{n}{k} a_{n-k} \frac{(n-k)!}{n!} $$
Set $c_{n} = n!a_n$ so that
$$2^n a_n = \sum_{k=0}^n \frac{1}{k+1} \binom{n}{k} c_{n-k} $$
This equation is invertible, e.g. Binomial Transform of a Particular Binomial Sum
Reverting back to $a_n$ gives the formula $(1)$. Define a generating function $f(x) =\sum_{n \ge 0} a_n x^n$. Then $(1)$ implies the functional equation
$$ \tag{2} \quad f(x) = f(2x) \frac{x}{e^x -1} $$
Iterate on $(2)$, and formally the solution is
$$ \tag{3} \quad f(x) = \prod_{k=0}^\infty \frac{ \exp{\big(x \ 2^{-k-1}\big)} - 1}{x \ 2^{-k-1} } $$
I've calculated many of the $a_n$ and checked that $(3)$ is satisfied numerically when the product is truncated and $x$ is sufficiently small.
$(3)$ looks like a formidable equation to do asymptotic analysis on. $(2)$ looks like a trick with a Mellin transform might be advantageous. The closest thing I know of that looks like the proposed asymptotic expansion has to do with Rice integrals, and instead of Bernoulli numbers, binomials appear in the sum. See example $4$ in $[1]$.
Edit 1/13/2022.
Summary: the asymptotics of $a_n$ can be approximated by a saddle point analysis of the large $x$ asymptotics of $f(x)$ given above.  Here is a short algorithm for calculation:
$$ \tag{4} x_0=-\frac{1}{\log{2}}W_{-1}\big( -\log{2} \cdot 2^{-n} \big) $$
$$ \tag{5} C=2^{-1/12}\exp{\Big(\big( \gamma_1 + \gamma^2/2-\pi^2/12 \big) }/\log{2} \Big) $$
$$ \tag{6} F(x)=C\sqrt{x}\exp{\big(x -\frac{1}{2 \log{2}}\log^2 x \big)}$$
$$b(x)=x \frac{d}{dx}(x \frac{d}{dx} \log{(F(x)} ) $$
$$\tag{7} a_n^{A} \sim (2 \pi b(x_0))^{-1/2} F(x_0) x_0^{-n} $$
Notation: $W_{-1}(x)$ is the Lambert W function on the '-1 branch' and is implemented in Mathematica as ProductLog[-1,x]. The $\gamma$ is Euler's constant and $\gamma_1$ is the first Stieltjes constant, $\gamma_1 \approx$ -0.0728158.
Here is a table comparing the true $a_n,$ the approximation (above) $a_n^{A},$ and the proposed approximation,  $a_n^{P} = 2^{ (eq.3)}$ where eq. 3 corresponds to that in the proposers write up.
$$
\begin{array}{c|lcr}
n & a_n & a_n^{A} & a_n^{P} \quad \\
\hline
20 & 6.08905 \,\cdot\, 10^{-22} & 6.07191\,\cdot\, 10^{-22} & 9.3967\,\cdot\, 10^{-22}  \\
40 & 1.00137 \,\cdot\, 10^{-52}& 1.00047\,\cdot\, 10^{-52} & 1.3980\,\cdot\, 10^{-52}  \\
60 & 1.30647\,\cdot\, 10^{-87} & 1.30565\,\cdot\, 10^{-87} & 1.7222\,\cdot\, 10^{-87}  \\
80 & 3.13549\,\cdot\, 10^{-125} & 3.13398\,\cdot\, 10^{-125} & 3.9804\,\cdot\, 10^{-125}
\end{array}
$$
The approximation $a_n^{A}$ is excellent, about 3 significant digits for $n=20,$ and about 4 digits for $n=80.$  A comment before sketching the proof.  The proposer's solution seems to have missed the constant, and otherwise the expansion seems to be an asymptotic expansion of the Lambert W function,
$$ W(x) \sim \log{x} - \log{\log{x}} + \cdots $$
The first part of the proof is to show that, for large $x$
$$ \tag{4} \quad f(x) = \prod_{k=1}^\infty \frac{ \exp{\big(x \ 2^{-k}\big)} - 1}{x \ 2^{-k} }
\sim F(x)\exp{\big(P(x) \big)}
$$
where $F(x)$ is given by eqs. (5) & (6) and $P(x)$ is given by
$$P(x)=\sum_{k=-\infty, k \ne 0}^\infty\ \frac{1}{2\pi i k}\Gamma\big(1-\frac{2 \pi i k}{\log2} \big)
\zeta\big(1-\frac{2 \pi i k}{\log2} \big) \exp{\big(x  \, \frac{2 \pi i k}{\log2} \big)}.$$
The formulas presented are a slight modification of that presented in Example 9.3 in reference [2].  We are going to ignore $P(x),$ in subsequent analysis, mainly because the amplitudes of the oscillations are tiny, with magnitudes of $7.4\,\cdot\,10^{-7}, 4.4\,\cdot\,10^{-13}\cdots$ for $k=1,2...$ However, if you want even more precise asymptotics (3 or 4 digits is not enough?) then they have to be included.
Reference [2] deals with a problem that has the functional equation
$$ g(x) = g(2x)\frac{x}{1-e^{-x}} $$
Note how close that is to the functional equation in (3).  On taking logarithms we have
$$\log{\big(f(x)\big)} = \sum_{k=1}^\infty \log{\Big(
\frac{ \exp{\big(x \ 2^{-k}\big)} - 1}{x \ 2^{-k} } \Big) }
$$
$$ = \sum_{k=1}^\infty \log{\Big(\exp{\big(x \ 2^{-k}\big)}\Big) } + \log{\Big(
\frac{ 1-\exp{\big(-x \ 2^{-k}\big)} }{x \ 2^{-k} } \Big) }
$$
$$=x+ \sum_{k=1}^\infty \log{\Big(
\frac{ 1-\exp{\big(-x \ 2^{-k}\big)} }{x \ 2^{-k} } \Big) }$$
The infinite sum is precisely that given in ref. [2] for $g(x)$, so its asymptotics can be copied verbatim, which I have done. Very briefly, the technique is to find the Mellin transform for the sum, then find the asymptotics by moving the contour of integration over the function's singularities.  Later on, the reference extracts the asymptotics for the coefficients of $g(x)$ by using a process called dePoissionization, but that requires a growth restriction on the function. The addition of $e^x$ for my $f(x)$ destroys that possibility.  However, traditional saddle point works.  In that situation, one can use eq. (7) for a generic function $F(x).$ How does one determine the saddle point?  Look at the Cauchy representation of $a_n,$
$$ a_n = \frac{1}{2 \pi i} \oint \frac{F(x)}{x^{n+1}} dx$$
$$ \rightarrow \frac{1}{2 \pi i} \oint \exp{\big( x - n\log{x} - \frac{1}{2 \log{2}}\log^2{x} \big)} \frac{dx}{\sqrt{x}}
$$
The saddle point $x0$ is that in which the derivative of the argument of the exponential is zero,
$$ \frac{d}{dx} \big(x - n\log{x} - \frac{1}{2 \log{2}}\log^2{x}  \big)\overset{!}{=} 0 $$
The solution to this equation for $x=x_0$ is given in eq. (4).
$[1]$ Mellin transform and asymptotics: Finite differences and Rice's integrals, P. Flajolet & R. Sedgewick, Ther. Comp. Sci 144 (1995) 101-124.
$[2]$ Average Case Analysis of Algorithms on Sequences W. Szpankowski, Wiley-Interscience, 2001.


text:
Q: Combine array of objects on every third elemnt of the first array I have two different sets of array of objects.
        arr1 = [
                   {name: 'abcd', class: 'ef', pattern:'ds'},
                   {name: 'wdw', class: 'ef', pattern:'123'},
                   {name: 'wdd', class: 'ef', pattern:'d12sasds'},
                   {name: 'wdwd', class: 'a', pattern:'sd'},
                   {name: 'abcd', class: 'ef', pattern:'ds'},
                   {name: 'wdw', class: 'ef', pattern:'123'},
                   {name: 'wdd', class: 'ef', pattern:'d12sasds'},
                   {name: 'wdwd', class: 'a', pattern:'sd'},
                ]

and
arr2 = [
                   {height: '123', weight:'12'},
                   {height: '123', weight:'12'},
       ]

I want to combine these two array and put every element from the arr2 into arr1 on the third position..
so my new array looks like
newarr = [
                   {name: 'abcd', class: 'ef', pattern:'ds'},
                   {name: 'wdw', class: 'ef', pattern:'123'},
                   {name: 'wdd', class: 'ef', pattern:'d12sasds'},
                   {height: '123', weight:'12'},
                   {name: 'wdwd', class: 'a', pattern:'sd'},
                   {name: 'abcd', class: 'ef', pattern:'ds'},
                   {name: 'wdw', class: 'ef', pattern:'123'},
                   {height: '123', weight:'12'},
                   {name: 'wdd', class: 'ef', pattern:'d12sasds'},
                   {name: 'wdwd', class: 'a', pattern:'sd'},
       ]

A:

function a(arr1,arr2){
    let arr3 = [];
    let i,n
    i = 0;
    n = 0;
    while (i < arr1.length) {
        if(i != 0 && String(i/3).split(".").length == 1 && n < arr2.length){
            arr3[arr3.length] = arr2[n];
            n++;
        }
        arr3[arr3.length] = arr1[i];
        i++;
    }
    return arr3;
}
arr1 = [
    {name: 'abcd', class: 'ef', pattern:'ds'},
    {name: 'wdw', class: 'ef', pattern:'123'},
    {name: 'wdd', class: 'ef', pattern:'d12sasds'},
    {name: 'wdwd', class: 'a', pattern:'sd'},
    {name: 'abcd', class: 'ef', pattern:'ds'},
    {name: 'wdw', class: 'ef', pattern:'123'},
    {name: 'wdd', class: 'ef', pattern:'d12sasds'},
    {name: 'wdwd', class: 'a', pattern:'sd'}
];
arr2 = [
    {height: '123', weight:'12'},
    {height: '123', weight:'12'}
];
console.log(a(arr1,arr2));


text:
Q: soap in ios requires cookies to be enabled. How to add it in soap header? I have this webservice (.asmx) and this obj-c code (generated from wsdl2code.com)
All working fine - can connect and all that, but I need to set some extra header information into the soap calls.
In .net I only can use the service if I set the 'AllowCookies' flag WCF-config to true.
Like this:
var session = new WebServiceSoapClient();
     ((BasicHttpBinding)session.Endpoint.Binding).AllowCookies = true;

If I just used the service directly it would throw a 'user not authenticated' exception.
Now, Im having this problem again on iOS platform, and I don't know how/where to add the information. I found this post and thought I could use it to do like the same trick, with just overriding a setting. No success.
Anyone got a solution?  Or information about which header to set?
(I get a token back from the first authentication, which I guess should be used here..)
UPDATE:
I opened up communication with an asp.net webapp and the webservice, and used Fiddler2 to investigate the header. It wasn't clear to me at first, because the 'Cookie'-header only contained the default auth-string in asp.net: "ASP.NET_SessionId={xxxxxxxxxxxxx}". But I only used the actual value and not not whole string. I guess this was a lack of basic HTTP header knowledge... I appended the whole string to a header 'Cookie' in all future requests, and it worked!

A: UPDATE:
I opened up communication with an asp.net webapp and the webservice, and used Fiddler2 to investigate the header. It wasn't clear to me at first, because the 'Cookie'-header only contained the default auth-string in asp.net: "ASP.NET_SessionId={xxxxxxxxxxxxx}". But I only used the actual value and not not whole string. I guess this was a lack of basic HTTP header knowledge... I appended the whole string to a header 'Cookie' in all future requests, and it worked!


text:
Q: SSIS Derived Column Transformation Editor I have a csv file that I'm loading into a database
example of content of csv
"name","house,up a hill","drive"

I have set the column delimiter to be ", within the connection manager
which gives me data in 3 columns
column 1 =   "name
column 2 = house,up a hill
column 3 = drive"

I need to then remove any " from any of the text in the three columns I have added Derived Column to my package and and added the following
REPLACE(column 1,'"','')

this hasn't worked, I thought the replace worked as column name, text to replace, replace with
any help would be appriciated

A: Write it like this in your derived column task
REPLACE( [COLUMNAME],"\"","")


text:
Q: Running a method for each field existing in the mysql table Hello i have a small table in mysql which contains few fields with a description, name, price, id.
Foreach of the items inserted in this table i need to run a certain method in php to make some math based on the price field. How could i do this any ideas(in the future they will be more than two or three so it should be something a little bit dynamic if posible ) .
Update: this is the table.
-- Dumping structure for table print_finishes
DROP TABLE IF EXISTS `print_finishes`;
CREATE TABLE IF NOT EXISTS `print_finishes` (
  `FinishesId` int(11) NOT NULL AUTO_INCREMENT,
  `FinishesName` varchar(100) NOT NULL,
  `FinishesPrice` varchar(100) NOT NULL,
  PRIMARY KEY (`FinishesId`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

Update: Ok for those who didn't quite understand my question:
IN PHP:

*

*I make a select based on the id's that are comming from a form.

*Irun a foreach to loop data that is returned from mysql.

*Now i need away to call up a method that is unique for each of the fields that i
return. ( this is the part that i don't know how to do it.

Example data returned

*

*CutContour - 2euros

*Laminate - 5euros

in that foreach i need to check somehow if i have a cutcontour option or something like that and run a method called CalculatePriceBasedOnCutContour ( which in my case the formula would be square meters multiplied by 2 euros now when it finds laminate option i need to run another method for example CalculatePricebasedOnLaminate (in this case i could use the same method that i called for cutcontour because the formula would be the same only the price changes.
/**
 * Calculate Finishes for cut countour
 * @param int $cutContourPrice [description]
 * @param int $squareMeters    [description]
 */
public function CalculateWithFinishes($cutContourPrice, $squareMeters ) {
    $this->_cutContourPrice = $cutContourPrice * $squareMeters;
}

Third Update:
A simple way of doing would be like this:
if($printFinishes['name'] = 'CutContour) {
    $this->CalculateWithFinishes($arg1, $arg2);
}

and this should be made dynamic because i can't know how they will be named in database
It was too long to post it as a comment.

A unique method based on the type selected. but i can have even three types selected from finishes tables. i can have laminate, cut contour, bonding on cmyk forex ( each of these finishes has a different price and some of them are calculated based on square meters ) to give a better understanding on what i'm doing it is about storing orders from a print shop in database and make price calculations and reports at the end of the month how much material was printed, how much was lost, how much material was lost during printing process and when it comes to order we have a big list of finishes based for each product. if you print on vinyl you could have even 5 types of finishes applied to it some of them calculated in square meters some of them not and i need to know what formulas should i apply and when based on what i select from a form.
So when i get the data from the form and get the required prices from the database i need a way to find out what finishes i applied to know what function i call to calculate the price.
This is how i calculate on daily bases:
Width * Height * finishes price * print square meter price * euro price * vat tax.
1.37 * 2 * 3 = 8.22 euros the cost of cut contour on the print
1.37 * 2 * 10 = 27.4 euros the cost of the printing process
35.62 * 4.5 * 1.24 = the total cost of the printing with finishes converted to my curency and added the vat tax
Translation width of the material multiplied by height ( everything is in meters ), that returns me the square meter then i apply a finishes price of 3 ( cut contour on the print ), then i apply the print price ( 10 euros / square meter ) then i convert the euro in my curency then i apply a vat tax on the final price.

A: Little example:
<?php
mysqli_connect($host, $user, $password);
//Connecting to the server
mysqli_select_db($yourdb);
//Select DB
$query=mysqli_query("SELECT * FROM print_finishes");
//Query
while($row=mysqli_fetch_assoc($query)){
//While PHP can get a new row from the output
echo $row['FinishesId'];
echo '
';
echo $row['FinishesName'];
echo '
';
echo $row['FinishesPrice'];
echo '
';
echo '
';
}
?>


text:
Q: Why is the smallest element of a well-ordered set in the order topology both open and closed? In the proof of Theorem 32.4. of Munkres' Topology it is claimed without proof that

Let $X$ be a well-ordered set. ... Assume that the closed set $A$ contains the smallest element $a_0$ of $X$. The set ${\{a_0}\}$ is both open and closed in $X$.

It is closed of course but why open? Even in the simplest example $A=[1,2]$ and $X=[1,3]$, ${\{1}\}$ is not open as $(1,3]$ is not closed!

A: You have to use the fact that $X$ is well-ordered, not just totally ordered.  If $X=\{a_0\}$, then clearly it is open.  Otherwise, $X\setminus\{a_0\}$ has a least element $a_1$.  The set $\{a_0\}$ is then equal to the open interval $(-\infty, a_1)$.


text:
Q: Discontinuity of electric potential in parallel plate capacitor Using Gauss' law, an idealisation of infinitely large plates and symmetry arguments one can show that the electric field of a parallel plate capacitor vanishes outside the plates and is constant between them.
Let us assume that one plate lies on the $xy$-plane, the other a distance $d$ above it (ie. at $z=d$).
Using the fact that the negative gradient of the electric potential equals the electric field, after integrating one finds that the potential between the plates is linearly dependant on $z$ plus an integration constant, say $c_2$. Outside it is constant (say with $c_1$ for $z>d$ and $c_3$ for $z<0$).
I read quite often in textbooks that after integrating a conservative vector field, we can explicitly calculate the integration constants by using the boundary conditions that come from the continuity of the potential and the fact that the potential vanishes at infinity.
When we apply this concept to the parallel plate capacitor however, it results in a contradiction; namely the only solution satisfying the conditions is the zero potential on the whole space, but then the electric field in turn must be zero everywhere.
I don't seem to be able to find the cause of this contradiction: does it come to existence by the idealisation argumentation, or can't we always say that the scalar potential of a conservative vector field must be continuous everywhere?
It seems that the argumentations above work perfectly fine for spherical and cylindrical capacitors, which makes me even more perplex.
Thanks for any insight!

A: One has to be careful with boundary conditions. In general, for finite volume charges distribution ($\rho$ in $C m^{-3}$), the potential is continuous and vanishes at the infinity.
However, in some problems, in particular when there are infinite distributions such as an infinite plane, the potential doesn't vanish at the infinity.
When charges are distributed on a surface (density $\sigma$ in $C m^{-2}$) the electric field is not continuous and the gap can be computed with
$$\mathbf{E_2 - E_1} = \frac{\sigma}{\epsilon_0} \mathbf{n}$$ where $\mathbf{n}$ is a unitary vector normal to the surface. The potential is continuous.
When charges are distributed along a wire or localized at one point (density $\lambda$ q in $C m^{-1}$ , q in $C$), the potential diverges.
Now for your problem, the distribution is infinite so the potential cannot be set to zero at infinity. It is constant in (V1 for $z >d$) and (V2 for $z< 0$) but the two constants are different. The difference $V_2 - V_1$ is fixed par the charge distribution $\sigma$ : $\Delta V = 2 \frac{\sigma h}{\epsilon_0}$, with $h$ the distance between the two plates.


text:
Q: PHP Remove dupllicate array value which is a date I have an array,
`Array
(
[0] => 2019-08-02
[1] => 2019-08-02
[2] => 2019-08-03
)`

I need to remove duplicates from this array.I tried converting strtotime and compared But not getting result.
Please help
Regards,
Rekha

A: You can just write the code like this:
$arr = array_unique($arr)

Hope this helps.


text:
Q: Gray border when hiding tabitems and border I have a fairly standard TabControl (no controltemplates). When there is only one tab the tab is hidden with following trigger:
            <TabControl.ItemContainerStyle>
                <Style TargetType="{x:Type TabItem}">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type TabControl}}, Path=Items.Count}" Value="1">
                            <Setter Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TabControl.ItemContainerStyle>

The border of TabControl is also removed with the following trigger:
            <TabControl.Style>
                <Style TargetType="TabControl">
                    <Setter Property="Margin" Value="0,5,0,0"/>
                    <Setter Property="BorderThickness" Value="0,1,0,0"/>
                        <Style.Triggers>
                        <DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource Self}}" Value="1">
                            <Setter Property="BorderThickness" Value="0,0,0,0"/>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TabControl.Style>

This works well except for one thing. The TabItems are gone and the border also. BUT, there is still a light gray border (about 2px wide) surrounding the ContentPresenter (see screenshot). I have tried various solutions (controltemplate modifications) that i've found but they have all caused various other issues. How do i get rid of this border?

A: The border is exactly the border of the TabControl. You can also add a Style trigger for the TabControl to remove the border (by setting BorderThickness to 0):
<TabControl.Style>
      <Style TargetType="TabControl">
         <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},
                                   Path=Items.Count}" Value="1">
               <Setter Property="BorderThickness" Value="0"/>
            </DataTrigger>
         </Style.Triggers>
      </Style>
</TabControl.Style>


text:
Q: Package Repository for ARM32 Is there a repository of .deb packages for 32-bit ARM architecture. I'm having issues compiling several gnome packages and I'd rather acquire the binaries directly.

A: There are Debian and Arch repositories, but not Ubuntu.
https://github.com/archlinuxarm/PKGBUILDs


text:
Q: Ugly popups on beta sites I was using a beta site and I noticed how ugly the popup notices are on there. Unlike the notices on non-beta sites, I feel like I'm stuck 5-10 years ago in windows XP or earlier. Why don't these look more like the standard ones on the other sites? Both are shown below.
 (non-beta) (Game developers)
(beta)


text:
Q: Increase element size everytime window is resized my problem today is that I have 12 elements with size 60px x 60px and I'd like to increase the size with 0.2 everytime the screen size increase of 10px, with javascript. For example: screensize 600px and element size 60.2 x 60.2, screensize 610px and element size 60.4 x 60.4 and so on. It would give something like this to increase :
var circle_data={
        container: document.querySelector(".container"),
        classname: "astro-item",
        nb_elem: 12,
        elem_size: 60,
    };
    var screenSize = window.innerWidth;
    circle_data.elem_size += 0.2;

The thing is that I don't know how to increase everytime the screen size increase by 10px
Thanks for your help !!
So with your answers here's the code I tried but it doesn't work, maybe because I already have a function that set elements size up, here's the full script:
function circle_container(objdata) {
            var circle_dim=objdata.container.getBoundingClientRect();
            var rayon=Math.round(circle_dim.width/2 - objdata.elem_size/2);
            var center_x=rayon;
            var center_y=rayon;

            if (objdata.rayon) rayon*=objdata.rayon/100;

            for(var i=0;i<objdata.nb_elem;i++) {
                var new_elem=objdata.container.querySelector("."+objdata.classname+i);
                if (!new_elem) {
                    var new_elem=document.createElement("button");
                    new_elem.className="astro-item"+" "+objdata.classname+i;
                    var new_img=document.createElement("img");
                    new_img.src = astroList[i].icon;
                }

                new_elem.style.position="absolute";
                new_elem.style.width=objdata.elem_size+"px";
                new_elem.style.height=objdata.elem_size+"px";

                new_elem.style.top=Math.round( (center_y - rayon * Math.cos(i*(2*Math.PI)/objdata.nb_elem)))+"px";
                new_elem.style.left=Math.round( (center_x + rayon * Math.sin(i*(2*Math.PI)/objdata.nb_elem)))+"px";

                objdata.container.appendChild(new_elem);
                new_elem.appendChild(new_img);
            }
        }

        var circle_data={
            container: document.querySelector(".container"),
            classname: "astro-item",
            nb_elem: 12,
            elem_size: 60,
        };
        function onResize(e) {
            var screenSize = e.target.outerWidth;
            var width = (screenSize - (screenSize %  100) + (((screenSize + 10) %  100)/10 *2))/10;
            var items = document.querySelectorAll('.astro-item');
            for(var i = 0; i < items.length; i++) {
                items[i].innerHTML  = 'width: ' + screenSize + ' size: ' + width ;
            }

        }
        circle_container(circle_data);
        addEvent(window,"resize",function() {
            circle_container(circle_data);
            onresize();
        });

The purpose of this function is to create 12 buttons aligned in circle (just like a wheel) and fully responsive, that's why I need them to get bigger when the screen gets larger. Thank you so much !

A: With pure javascript bind an event onresize and set size based on window width.  The size increase 0.2 everytime the screen size increase of 10px:
window.addEventListener("resize", onresize);

var onresize = function(e) {

       var width = e.target.outerWidth;
       circle_data.elem_size = (width - (width %  100) + (((width + 10) %
      100)/10 *2))/10;
}

Working example:
(open in full screen)
*Edited for max min limitations

 var min = 500; //min width in pixel
var max= 700;  //max width in pixel

window.addEventListener("resize", onresize);

var onresize = function(e) {

       var width = e.target.outerWidth;
       var s = (width - (width %  100) + (((width + 10) %  100)/10 *2))/10

     if(width <=max && width >=min){
        //change size here
         document.getElementById('s').innerHTML  = 'width: ' + width + ' size: ' + s ;
    }

}
<span id='s'> </span>


text:
Q: base vs Narrow in lightning-card in LWC I am new to LWC and trying to understand the concepts.
In lightning-card, as per the documentation, the variant can be base(which is default) or Narrow. But from the below code, the output is same for both variants. Please let me know if I am missing something here.

    <template>
        <lightning-card  title="Base variant" icon-name="standard:account">
            <lightning-button label="Save" slot="actions"></lightning-button>

Card Body

Card Footer

        </lightning-card>

        <lightning-card  variant="Narrow"  title="Narrow variant" icon-name="standard:account">
            <lightning-button label="Save" slot="actions"></lightning-button>

Card Body

Card Footer

        </lightning-card>
    </template>

A: The lightning base components incorporate Lighting Design System (SLDS) markup and classes. The base components handle the details and then provide simple attributes that enable you to provide variations in style. If you look at SLDS, you can see the pieces they are using and the classes that enable variations they're utilizing. For your question:
Saying
<lighting card variant="Narrow">

Shows the following when you inspect in chrome:
article class="slds-card slds-card_narrow">

....etc

You can see the classes and how to implement your own within the blueprint for card.
It seems, this example, is a case where SLDS may have made narrow obsolete as it's not mentioned or included in the Overview of CSS Classes within the SLDS documentation for Card. In testing, the card seems to resize according to its parent element. The likely scenario is that the lightning base component documentation is incorrect and hasn't been updated to remove this variant.
Compare that to lightning-button, where the variants you use (ex. base, brand, inverse) are all listed within the blueprint for button (ex. slds-button, slds-button_brand, slds-button_inverse).


text:
Q: Not Printing desire output using arrays and reading from files The program function is to read from two separate text files, One text file is called gifts(random names) and cost(total cost for each day). I have to print if the user input is 3, it will print the 3 lines with the cost of those 3 days. Additionally, I have to print the total cost of the 12 days.
My code
import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

import java.text.NumberFormat;

public class GiftsTwelveDays{

    public static void main(String[] args) {

        String[] gifts = new String[12];

        double[] costGifts = new double[12];

        String total = new String();

        //Following code reads the Gifts.txt file

        File file = new File("gifts.txt");

        try
        {
            Scanner scannerFile = new Scanner(file);

            while (scannerFile.hasNextLine())

            {
                int i = scannerFile.nextInt();

                String present = scannerFile.nextLine();

                gifts[i - 1] = present;

            }

            scannerFile.close();

        }

        catch (FileNotFoundException e)

        {
            System.out.println("File not Found.");
        }

        //This reads the cost and stores in array of double

        File file1 = new File("cost.txt");

        try
        {
            Scanner scannerFile = new Scanner(file1);

            while (scannerFile.hasNextInt()) {

                scannerFile.next();

                if(scannerFile.hasNextInt())

                {

                    int i = scannerFile.nextInt();

                    double cost = scannerFile.nextDouble();

                    costGifts[i-1] = cost;

                }

                else
                {

                    scannerFile.nextInt();

                    total = scannerFile.nextLine();

                }

            }

            scannerFile.close();

        }

        catch (FileNotFoundException e)
        {

            System.out.println("File could not be found");;

        }

        //following gets user input and runs

        Scanner userInput = new Scanner(System.in);

        NumberFormat money = NumberFormat.getInstance(); //for format with comma

        money.setGroupingUsed(true);

        double costDay = 0;

        System.out.println("Enter the day:");

        int choice = userInput.nextInt();

        userInput.nextLine();

        if (choice < 1 || choice > 12)//runs if choice is invalid

        {

            System.out.println("Invalid Choice");

        }

        else

        {

            System.out.println("Your gifts for the day " + choice + " are: \n");

            //calculates the day cost and prints gift simultaneously

            for(int i = 0; i < choice; i++)

            {

                System.out.println((i + 1) + gifts[i]);

                costDay = costDay + costGifts[i];

            }

            //prints the calculated cost.

            System.out.println("\nCost of Day: $" + money.format(costDay));

            System.out.println("\nTotal Cost for Twelve Days: $" + total);

        }

    }

}

Output:
Enter the day:
3
Your gifts for the day 3 are:

1 Patridge in a Pear Tree
2 Turtle Doves
3 French Hen

Cost of Day: $0

Total Cost for Twelve Days: $

gifts.txt
1 Patridge in a Pear Tree
2 Turtle Doves
3 French Hen
4 Calling Birds
5 Gold Rings
6 Geese-a-Laying
7 Swans-a-Swimming
8 Maids-a-Milking
9 Ladies Dancing
10 Lords-a-Leaping
11 Piper
12 Drummers Drumming

cost.txt
220.13
595.13
776.63
1376.59
2126.59
2516.59
15641.59
15699.59
23252.43
33252.43
36056.83
39094.93

A: The issue is your use of scannerFile.hasNextInt() when evaluating cost.txt. The file cost.txt only contains doubles, so that first call returns false, so the costGifts[] array is never populated.
Try using scannerFile.hasNextDouble() instead and see if that fixes your issue.

A: The way you were scanning the costs.txt document had some issues.
There is no Integer type value in the text , so the hasNextInt() function will always return false to you.
Instead of summing up all the values in the total variable you were inputting the last value read from the file in a String variable , furthermore you were expecting an Integer value again so the String was left empty , that is why you were not seeing anything on the output and only the last value after the fix provided above.
I altered your code like this
Firstly i changed the type of Total from String to Double
Then i changed your scanning section from this :
 while (scannerFile.hasNextInt()) {

            scannerFile.next();

            if(scannerFile.hasNextInt())

            {

                int i = scannerFile.nextInt();

                double cost = scannerFile.nextDouble();

                costGifts[i-1] = cost;

            }

            else
            {

                scannerFile.nextInt();

                total = scannerFile.nextLine();

            }

        }

        scannerFile.close();

To this :
int i = 0;
        while (scannerFile.hasNextDouble()) {

                double cost = scannerFile.nextDouble();
                costGifts[i] = cost;
                i++;
                total += cost;

        }

        scannerFile.close();

    }

Now the total is calculated correctly while you are reading each line and you are also making sure that you are not skipping any lines.


text:
Q: Nested for each loops in Objective-C I have two arrays fetch from web servers, both only contains same numbers of dictionaries. i want to parse every dictionary in two nested for each loops, so used following code:
for (NSDictionary *subscription in feedsArray)
{
    for (NSDictionary *unreadCount in unreadCountsArray)
    {
        [RDInsertObjects insertFeedsWithSubscription:subscription
                         unreadCount:unreadCount];
    }
}

But the results returned isn't me wanted, the inner for loop seemed executed over many times, anyone can tell me how exactly do right things to make this code make sense?

A: The way you do it, for each single iteration of the first loop the second loop iterates completely.
I think it won't work with a for-in loop. But you said the number of items in the two arrays is the same - so you can easily do:
for (i=0; i< feedsArray.count; i++) {
  NSDictionary subscription = feedsArray[i];
  NSDictionary unreadCount = unreadCountsArray[i];

  [RDInsertObjects insertFeedsWithSubscription: subscription unreadCount: unreadCount];
}

This will only work, if the number of items in the array are always ever the same - if sometime they aren't, you need a modification to prevent an out-of-bounds error or it will crash!


text:
Q: MSSQL DB restoration from Azure SQL VM to SQL managed instance via log replay service fails I was trying to perform an MSSQL DB restoration via Log Replay Service from Azure SQL VM running on SQL 2016 on to SQL managed instance\General Purpose tier. Im using Azure Cli to perform the restoration with continuous mode. It fails with a generic error which doesnt give much information.

(InternalServerError) An unexpected error occured while processing the request. Tracking ID: '59763add-7356-4fe4-b797-be1fca9db677'

Can some experts guide me on this error or help me to understand where the issue is?

A: Although going through the snip, I can see no syntactical error please recheck if all the parameters are used correctly refering the doc here. Since it appears to be a retryable error try the same CLI command after a few minutes. If the issues persists, report it or reach out to Microsoft support for a official response.


text:
Q: WebUIValidation.js gets reloaded in async calls when in CompositeScript and UpdatePanel My scenario:

*

*I have a validator in an UpdatePanel.

*I want to combine my scripts so I am using CompositeScript in ScriptManager, and including a reference to WebUIValidation.js

*I am using .NET 4.0

My problem:

*

*When I asynchronously update the panel, .NET loads WebUIValidation.js (in a Scriptresource.axd file) in the async response, even though it has been loaded in the initial CompositeScript-generated script.  This is a problem because I have custom code that hijacks some functions in WebUIValidation.js, and the async response overrides my hijacks.

*If you move the reference to WebUIValidation.js to Scripts in ScriptManager, there is no problem.

*If you were to have WebUIValidation.js as the only item in CompositeScript (pointless I know) then there is no problem.

*This async reload does not happen with other .NET library scripts, e.g. WebForm.js
What I want to find out:

*

*is there a reason why WebUIValidation.js is loaded in the async response when it is already included in the CompositeScript?
Someone has posted a similar (but not duplicate) issue today, and is veering towards saying that WebUIValidation.js might not be handled by ScriptManager.  Can anyone verify this?
To replicate use the following two files
test1.js
// To be added to the composite script
console.log('Test 1 Loaded');

test.aspx
<%@ Page Language="vb" AutoEventWireup="false"  %>

<!DOCTYPE html>

    <title></title>

    <form runat="server">
        <asp:ScriptManager runat="server">
            <CompositeScript>

            </CompositeScript>
        </asp:ScriptManager>

WebUIValidation.js, CompositeScript and UpdatePanel test

        <asp:UpdatePanel runat="server" ID="ButtonUpdatePanel">
            <ContentTemplate>
                <asp:Label runat="server" >This is a section with a validator that is within an UpdatePanel.  If you look at the scripts loaded, you will see the composite script in the detail.</asp:Label>
                <asp:Textbox ID="TestInputForValidator" runat="server" Text="This is populated so it will validate"/>
                <asp:RequiredFieldValidator runat="server" ControlToValidate="TestInputForValidator" ErrorMessage="You must write something" />

                <asp:Button ID="TestButton" Text="Click Me!" runat="server"  />

                <asp:Literal ID="ButtonClickFeedback" runat="server" />
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="TestButton" />
            </Triggers>
        </asp:UpdatePanel>
    </form>

If you use your Developer Tools to inspect what scripts are being loaded in, you should see an additional Scriptresource.axd (that contains WebUIValidation.js) getting loaded in after clicking the button, in spite of the existence of a Scriptresource.axd with the composite script.  test.js is just a sample js file to simulate the idea of composite scripts.

A: Sharing my investigation on why it's loading these scripts again (WebUIValidation.js or Focus.js). I've just found about Focus.js for now.
First, the origination of the http request is in the partial update generated by the update panel. If you look at the reponse to the asynchronous xhr POST request, you'll have something like this. Note almost at the end the ScriptResource.axd url. This is processed by the ajax framework on the client side and since it's a script block with a path, it gets loaded:
1|#||4|2999|updatePanel|ctl00_LoginContent_ctl00|

[...html content here]
|
0|hiddenField|__LASTFOCUS||
0|hiddenField|__EVENTTARGET||
0|hiddenField|__EVENTARGUMENT||
904|hiddenField|__VIEWSTATE|UdWhNvH6wpBcPOigY[...]SIphbw==|
8|hiddenField|__VIEWSTATEGENERATOR|25748CED|
176|hiddenField|__EVENTVALIDATION|q+FUEVGVj+t[...]AzAm|
0|asyncPostBackControlIDs|||
0|postBackControlIDs|||
26|updatePanelIDs||tctl00$LoginContent$ctl00,|
0|childUpdatePanelIDs|||
25|panelsToRefreshIDs||ctl00$LoginContent$ctl00,|
2|asyncPostBackTimeout||90|
14|formAction||./Default.aspx|
119|scriptBlock|ScriptContentNoTags|function PopulateTimeZoneOffset(){[my own js here...]}|
154|scriptBlock|ScriptPath|/ScriptResource.axd?d=Uup1Lt[...]q450&t=ffffffffd4ee116f|
31|focus||ctl00_LoginContent_LoginControl|

Now debugging server side code, loading the .net assemblies symbols from https://referencesource.microsoft.com/ (with VS configuration as described there).
PageRequestmanager.cs
    private void ProcessFocus(HtmlTextWriter writer) {
        // Roughly stolen from Whidbey Page.cs
        if (_requireFocusScript) {
            Debug.Assert(ClientSupportsFocus, "If ClientSupportsFocus is false then we never should have set _requireFocusScript to true.");
            string focusedControlId = String.Empty;

            // Someone calling SetFocus(controlId) has the most precedent
            if (!String.IsNullOrEmpty(_focusedControlID)) {
                focusedControlId = _focusedControlID;
            }
            else {
                if (_focusedControl != null && _focusedControl.Visible) {
                    focusedControlId = _focusedControl.ClientID;
                }
            }
            if (focusedControlId.Length > 0) {
                // Register focus script library
                string focusResourceUrl = _owner.GetScriptResourceUrl("Focus.js", typeof(HtmlForm).Assembly);
                EncodeString(writer, ScriptBlockToken, "ScriptPath", focusResourceUrl);
                // *********** THIS ENCODESTRING OUTPUTS THE PROBLEM !!!

                // Send the target control ID to the client
                EncodeString(writer, FocusToken, String.Empty, focusedControlId);
            }
        }
    }

We are deep inside Page.ProcessRequest, and now in Page.Render, RenderPageCallback and ProcessFocus. The highlighted EncodeString near the end writes directly to the writer things like "len|type|id|content|", including writer.Write(content); where content is "/ScriptResource.axd?d=Uup1IW...q450&t=ffffffffd4ee116f". There is no check to see if this script is already registered with the ScriptManager, it's not calling ScriptManager.RegisterXXXX.
So it seems to me that's the cause of getting another http request for something that's already loaded. ProcessFocus is done as part of "Render", far too late to use any ScriptManager functinality.
I can't think of a way to avoid this http request (apart from not using any SetFocus type thing from the .net framework).
(Running VS 2015, .net framework 4.6.2, ajax control toolkit 17.1)


text:
Q: Not able to make Resque work I'm trying to make Resque work with my project, but unfortunately it seems that for some reasons Resque is not able to write on Redis.
Redis seems to be configured correctly, I'm able to connect with redis-cli and issue commands, runs on port 6379 as configured inside my Rails 3.0.5 app.
When I try to Resque enqueue something the job is queued, but it doesn't seem that something actually happens on Redis (0 clients connected inside my Redis logs).
When I restart the console, the queue is empty, with no workers running.
Everything fails silently, I have nothing in my rails logs, nothing on the console, nothing if I start a worker, it just (obviously) doesn't find any job to perform.
https://gist.github.com/867620
Any suggestions on how to fix or debug this ?

A: The problem was that I was including resque_spec in the bundle.
Obviously, resque_spec was stubbing Resque.enqueue, making my mistake very stupid and very difficult to spot.