text:
Q: cant fetch city and district data due to a irrelevant error I have a database which contains city(sehir) and district(il) tables. In my registration form I want to fetch district data depending on city value. And there is a address table which has foreign keys to these tables. There is a column for postal code. First I made it integer value, when I tried it like this, my ajax call was working properly it was fetching all city and district data dynamically. But when I submitted form i got an error which says "Unable to cast object of type 'System.Int32' to type 'System.String'". I couldn't decide which value the error is mentioning. I've decided that it is postal code so I ve changed its type to varchar and updated it in my model class, when I did it this way, this time my ajax call was not working properly, the thing is that my ajax call has nothing to do with postal code. My Code:
Address Class:
public int kullaniciID { get; set; }
        public int? ulkeID { get; set; }

        [Required(ErrorMessage = "Şehir girmeniz gerekmektedir!")]
        public int sehirID { get; set; }

        [Required(ErrorMessage = "İlçe girmeniz gerekmektedir!")]
        public int ilceID { get; set; }

        [Required(ErrorMessage = "Posta kodu girmeniz gerekmektedir!")]
        [StringLength(6, ErrorMessage = "Posta kodu maksimum 6 haneye sahip olabilir!")]
        public string postaKodu { get; set; }

        [Required(ErrorMessage = "Açık adres girmeniz gerekmektedir!")]
        [MinLength(30,ErrorMessage = "Açık adres en az 30 karaktere sahip olmak zorundadır")]
        public string acikAdres { get; set; }

        [Required(ErrorMessage = "İlçe gerekli")]
        public virtual tblİlce tblİlce { get; set; }

        [Required(ErrorMessage = "Kullanıcı gerekli")]
        public virtual tblKullanici tblKullanici { get; set; }

        [Required(ErrorMessage = "Şehir gerekli")]
        public virtual tblSehir tblSehir { get; set; }

        [Required(ErrorMessage = "Ülke gerekli")]
        public virtual tblUlke tblUlke { get; set; }

Method to fetch data from db with ajax(in User Controller):
public JsonResult IlIlce(int? ilID, string tip)
        {
            db = new DatabaseContext();
            List<SelectListItem> sonuc = new List<SelectListItem>();

            bool isSuccessful = true;

            try
            {
                switch (tip)
                {
                    case "ilGetir":
                        //veritabanımızdaki iller tablomuzdan illerimizi sonuc değişkenimze atıyoruz
                        foreach (var sehir in db.tblSehir.ToList())
                        {
                            sonuc.Add(new SelectListItem
                            {
                                Text = sehir.sehirAdi,
                                Value = sehir.sehirID.ToString()
                            });
                        }
                        break;

                    case "ilceGetir":
                        //ilcelerimizi getireceğiz ilimizi selecten seçilen ilID sine göre
                        foreach (var ilce in db.tblİlce.Where(il => il.bagliOlduguSehirID == ilID).ToList())
                        {
                            sonuc.Add(new SelectListItem
                            {
                                Text = ilce.ilceAdi,
                                Value = ilce.ilceID.ToString()
                            });
                        }
                        break;

                    default:
                        break;
                }
            }
            catch (Exception)
            {
                //hata ile karşılaşırsak buraya düşüyor
                isSuccessful = false;
                sonuc = new List<SelectListItem>();
                sonuc.Add(new SelectListItem
                {
                    Text = "Bir hata oluştu :(",
                    Value = "Default"
                });

            }
            //Oluşturduğum sonucları json olarak geriye gönderiyorum
            return Json(new { ok = isSuccessful, text = sonuc });

    }

here is my register view, it contains jQuery code for ajax
@model IWP.Models.RegisterVM

@{
    ViewBag.Title = "Register";
}

Kayıt Formu

@if (ViewBag.Message != null)
{
    @ViewBag.Messsage
}

@using (Html.BeginForm("Register", "User", FormMethod.Post, new { @class = "w-100 d-flex justify-content-center" }))
{
    @Html.AntiForgeryToken()

        @Html.ValidationSummary(true, "", new { @class = "text-danger" })

            Kullanıcı adı

                @Html.EditorFor(model => model.User.kullaniciAdi, new { htmlAttributes = new { @class = "form-control", @required = "required" } })
                @Html.ValidationMessageFor(model => model.User.kullaniciAdi, "", new { @class = "text-danger" })

            Firma adı

                @Html.EditorFor(model => model.User.firmaAdi, new { htmlAttributes = new { @class = "form-control", @required = "required" } })
                @Html.ValidationMessageFor(model => model.User.firmaAdi, "", new { @class = "text-danger" })

            Şifre

                @Html.EditorFor(model => model.User.sifre, new { htmlAttributes = new { @class = "form-control", @required = "required", @type = "password" } })
                @Html.ValidationMessageFor(model => model.User.sifre, "", new { @class = "text-danger" })

            Şifre tekrar

                @Html.EditorFor(model => model.User.sifreTekrar, new { htmlAttributes = new { @class = "form-control", @required = "required", @type = "password" } })
                @Html.ValidationMessageFor(model => model.User.sifre, "", new { @class = "text-danger" })

            E-mail

                @Html.EditorFor(model => model.User.mail, new { htmlAttributes = new { @class = "form-control", @required = "required", @type = "text" } })
                @Html.ValidationMessageFor(model => model.User.mail, "", new { @class = "text-danger" })

            Telefon

                @Html.EditorFor(model => model.User.telefon, new { htmlAttributes = new { @class = "form-control", @type = "text", @required = "required" } })
                @Html.ValidationMessageFor(model => model.User.telefon, "", new { @class = "text-danger" })

            Bulunduğunuz il
            <select class="form-control col-md-12" name="city" id="il" required></select>

            Bulunduğunuz ilçe
            <select class="form-control col-md-12" name="district" id="ilce" disabled required>
                <option>Bir İl Seçiniz</option>
            </select>

            Posta kodunuz

                @Html.EditorFor(model => model.Address.postaKodu, new { htmlAttributes = new { @class = "form-control", @type = "text" } })
                @Html.ValidationMessageFor(model => model.Address.postaKodu, "", new { @class = "text-danger" })

            Açık adresiniz

                @Html.EditorFor(model => model.Address.acikAdres, new { htmlAttributes = new { @class = "form-control", @type = "text", @required = "required" } })
                @Html.ValidationMessageFor(model => model.Address.acikAdres, "", new { @class = "text-danger" })

                <input type="submit" value="Kaydol" class="btn btn-success" />

}

Finally my user model:
public partial class tblKullanici
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public tblKullanici()
        {
            this.tblBagis = new HashSet<tblBagis>();
            this.tblAdres = new HashSet<tblAdres>();
            this.tblSiparis = new HashSet<tblSiparis>();
        }

        public int kullaniciID { get; set; }

        [Required(ErrorMessage = "Kullanıcı adı girmeniz gerekmektedir!")]
        [StringLength(30, MinimumLength = 6, ErrorMessage = "Kullanıcı adınız 6 ila 30 karakter arasında olmak zorundadır!")]
        public string kullaniciAdi { get; set; }

        [Required(ErrorMessage = "Firma adı girmeniz gerekmektedir!")]
        [StringLength(70, ErrorMessage = "Firma adınız en fazla 70 karakter olabilir!")]
        public string firmaAdi { get; set; }

        [Required(AllowEmptyStrings = false, ErrorMessage = "Şifre girmeniz gerekmektedir!")]
        [DataType(DataType.Password)]
        [StringLength(35,MinimumLength = 6, ErrorMessage =("Şifreniz 6 ila 35 karakter arasında olmak zorundadır"))]
        public string sifre { get; set; }

        [NotMapped]
        [Required(ErrorMessage = "Bu alan gereklidir!")]
        [Compare("sifre", ErrorMessage = "Şifreler uyuşmamaktadır!")]
        public string sifreTekrar { get; set; }

        [Required(ErrorMessage = "E-mail girmeniz gerekmektedir!")]
        [DataType(DataType.EmailAddress)]
        [StringLength(70,ErrorMessage = "E-mail en fazla 70 karaktere sahip olabilir!")]
        public string mail { get; set; }

        [Required(ErrorMessage = "Telefon numarası girmeniz gerekmektedir!")]
        [MaxLength(16,ErrorMessage = "Telefon numaranız en fazla 16 haneli olabilir!")]
        public string telefon { get; set; }

        public System.DateTime olusturulmaTarihi { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<tblBagis> tblBagis { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<tblAdres> tblAdres { get; set; }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<tblSiparis> tblSiparis { get; set; }
    }

District(ilce) model:
public partial class tblİlce
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public tblİlce()
        {
            this.tblAdres = new HashSet<tblAdres>();
        }

        public int ilceID { get; set; }
        public string ilceAdi { get; set; }
        public int bagliOlduguSehirID { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<tblAdres> tblAdres { get; set; }
    }

City(sehir) model:
public partial class tblSehir
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
        public tblSehir()
        {
            this.tblAdres = new HashSet<tblAdres>();
        }

        public int sehirID { get; set; }
        public string sehirAdi { get; set; }

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
        public virtual ICollection<tblAdres> tblAdres { get; set; }
    }

Register Action:
[HttpPost]
        public ActionResult Register(RegisterVM model)
        {
            tblKullanici user = null;
            tblAdres address = null;

            if(model != null)
            {
                db = new DatabaseContext();
                user = model.User;
                address = model.Address;
                db.tblKullanici.Add(user);
                db.tblAdres.Add(address);

                db.SaveChanges();
                return RedirectToAction("Index", "App");
            }

            ViewBag.Message = "Kayıt işlemi sırasında hata oluştu!";
            return View(model);

        }

Thank you all for any kind of help from now..


text:
Q: wso2 split a string and iterate values What would be the best solution the split a string with ',' delimiter and iterate all values in wso2 ?
Can it be done in one time ? Or I have to store values in an array and then iterate ?
Sample : $ctx:keys = "key1,key2,key3,key4,key5"
Wanto to iterate simply those values and print
key1
key2
key3
key4
key5

I know it would be simple in any other language but in wso2 it seems to be a pain to do. Any simple way to do what I want ?

A: This is possible with the script mediator, But WSO2 is encouraging more not to use script mediator most of the times. Therefore, with a class mediator is could be very easily achieve.
Please refer the WSO2 documentation.

A: There is no straight way to do this... I think the easiest way to do this, is use ScriptMediator, like this:
<script language="js">
     var sample = mc.getProperty('keys').split(',');
     for(var s in sample) {
         java.lang.System.out.println(sample[s]);
         mc.getServiceLog().info('k: ' + sample[s]);
     }
</script>

If i remember in linux, the java.lang.System may not work, so you can use the Loging for just print.
Or maybe you can use xslt mediator following this topic: split function in xslt 1.0

redpajama_set_name: RedPajamaStackExchange


text:
Q: What is the essential concept behind the difference in the fundamental solutions of the Stokes and Poisson equations? The fundamental solutions, i.e., the solution with a point source, of the Poisson's equation and the Stokes equations in 3D are:
$$\nabla^2 f=\delta(\boldsymbol x) \ \Longrightarrow\ G(\boldsymbol x,\boldsymbol x_0)=-\frac{1}{4\pi|\boldsymbol x-\boldsymbol x_0|}$$
$$\nabla^2\boldsymbol u = \nabla P +\boldsymbol g\delta(\boldsymbol x)\ \text{  with  }\ \ \nabla\cdot\boldsymbol u=0\ \Longrightarrow\  G_{j}(\boldsymbol x,\boldsymbol x_0)=-\frac{g_{j}}{8\pi|\boldsymbol x-\boldsymbol x_0|}-\frac{(x-x_0)_i (x-x_0)_j g_{j}}{8\pi|\boldsymbol x-\boldsymbol x_0|^3}$$
Clearly this two equations have a lot in common, because their highest order differential terms have the same form. This is evidently reflected in their leading order behaviour (the term decaying as $|x-x_0|^{-1}$) in the respective fundamental solutions.
But the condition on the divergence, and the vectorial nature of the Stokes equation seem to give rise to an important correction of order $|x-x_0|^{-3}$.
Physically and/or geometrically, what are this term and the respective correction related to?
IS it the incompressibility (and how)? Is it the vectorial nature?


text:
Q: Effects of time dilation on our observations of the Sun Forgive me if this question makes little sense -- I'm not a physicist, only an interested observer.
As I understand it, time is dilated in gravitational fields and the stronger the field the stronger the dilation -- the slower time flows. The sun is more massive than the earth, thousands of times more massive in fact (330k times afaik).
So, does this affect our observations of the sun? Is it taken into account when working out the physics that we're observing? When we watch a solar flare, are we watching it in slow-motion? Do solar winds accelerate up the gravity gradient towards us? Does this affect the measurements taken by SOHO (which is much further down the gravity well than we are)? And, does the Earth's constant acceleration affect these measurements too?
I realise that's lots of questions, but really I think it's just one: how does time dilation affect our observations of the sun?

A:
As I understand it, time is dilated in gravitational fields and the stronger the field the stronger the dilation -- the slower time flows.

The time dilation depends on the gravitational potential, which is approximately $-Gm/r$, not the gravitational field, which in Newtonian gravity would be $Gm/r^2$, and in general relativity isn't even an observable.

So, does this affect our observations of the sun?

Yes, but the effect is quite small. The effect is the potential divided by $c^2$, which for the sun comes out to be about 2 parts per million.

Is it taken into account when working out the physics that we're observing? When we watch a solar flare, are we watching it in slow-motion?

Very few observations are sensitive to an effect that small. Historically, people first tried to detect this for white dwarfs, which are much more compact and therefore have a bigger effect. You can detect such effects in sufficiently sensitive spectroscopic measurements, since the true wavelengths are known to very high precision.

Do solar winds accelerate up the gravity gradient towards us?

This depends on what you mean by accelerate.

And, does the Earth's constant acceleration affect these measurements too?

If by this you mean the gravitational potential of the earth, then yes, it can have a measurable effect on high-precision measurements. The classic confirmation of this was the Pound-Rebka experiment.

Does this affect the measurements taken by SOHO (which is much further down the gravity well than we are)?

What is generally detectable for spacecraft is the Doppler shifting of their radio signals, which can be thought of as a combination of kinematic and gravitational Doppler shifts.

A: A solar photon takes 8 minutes to reach Earth but has theoretically been travelling from the core to the corona of the Sun for maybe millions of years (no way to measure that) because in the sun's interior there are so many potential pathways for the photon to take that straight lines (available to it when it leaves) are not an option. It is said in $E=hf$ that the photon's energy is equivalent to its speed (the constant) and its frequency (level of vibration). On release from the body of the Sun, there would logically be a transition phase.
A physicist will have to provide further equations but as far as I understand it, gravitational effects do have an impact on the way we view light.


text:
Q: HTTP 500 javax.servlet.ServletException: file not found I'm developping a J2EE application that works fine when run from eclipse, but when I deploy it on tomcat I get the following exception, I don't understand what's wrong cause I need to refresh several times until the page is displayed
(eclipse returns empty file when trying to export war, so I deploy by copying all the files in WebContent in tomcat/webapps/my project, and I copy classes in my WEB-INF)
Etat HTTP 500 - javax.servlet.ServletException: Le fichier "/menu_dashboard_top.jsp" n'a pas été trouvé

javax.servlet.ServletException: Le fichier "/menu_dashboard_top.jsp" n'a pas été trouvé
org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServlet.java:418)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:398)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:934)
org.apache.jsp.impotg50_jsp._jspService(impotg50_jsp.java:173)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:431)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)

menu_dashboard_top.jsp is in WebContent, it's not a servlet just a jsp page that contains the menu that I include in all my web pages
I have mapped all my servlets in web.xml. Here is my web.xml file
 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>e-declaration</display-name>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>register</servlet-name>
    <servlet-class>servlet.register</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>register</servlet-name>
    <url-pattern>/register</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>login</servlet-name>
    <servlet-class>servlet.login</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>login</servlet-name>
    <url-pattern>/login</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>logout</servlet-name>
    <servlet-class>servlet.logout</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>logout</servlet-name>
    <url-pattern>/logout</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>profil</servlet-name>
    <servlet-class>servlet.profil</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>profil</servlet-name>
    <url-pattern>/profil</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>impotg50</servlet-name>
    <servlet-class>servlet.impotg50</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>impotg50</servlet-name>
    <url-pattern>/impotg50</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>aimpotg50</servlet-name>
    <servlet-class>servlet.aimpotg50</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>aimpotg50</servlet-name>
    <url-pattern>/aimpotg50</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>declaration</servlet-name>
    <servlet-class>servlet.declaration</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>declaration</servlet-name>
    <url-pattern>/declaration</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>dashboard</servlet-name>
    <servlet-class>servlet.dashboard</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>dashboard</servlet-name>
    <url-pattern>/dashboard</url-pattern>
  </servlet-mapping>
  <filter>
    <filter-name>Set Character Encoding</filter-name>
    <filter-class>org.apache.catalina.filters.SetCharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
      <param-name>ignore</param-name>
      <param-value>false</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>Set Character Encoding</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>

A: Fixed it by reinstalling tomcat from scratch


text:
Q: MongoDB $pull from array of objects and from multiple objects arrays inside array in single .updateOne() I have a library document, which looks like:
library: {
  '_id': ObjectId("58380bd7ae1d7b1278dbb79f"),
  'shelves': [
    {
      'type': 'sci-fi',
      'bookshelf': 1,
      'books': [ ObjectId("583817c043bf901f2c8ff2ce"), ObjectId("583817c043bf901f2c8ff2d1")]
    }
  ],
  'books': [
     {
       '_id': ObjectId("583817c043bf901f2c8ff2ce"),
       'title': 'Lorem',
       'author': 'Foo Bar',
     },
     {
       '_id': ObjectId("583817c043bf901f2c8ff2d1"),
       'title': 'Ipsum',
       'author': 'Dolor Sit',
     }
  ]
}

Question: Is it possible to $pull single book from library.books and from each of the library.shelves.books which contains it in single updateOne() (or any other method) call without restructuring? Assume that there will be a lot of shelves and one book can be on many of them.
Right now I am doing it in two separate calls, so wondering if it can be done more efficiently.
EDIT:
Let's say I want first book from the example above $pulled. Then, my library would look like:
library: {
  '_id': ObjectId("58380bd7ae1d7b1278dbb79f"),
  'shelves': [
    {
      'type': 'sci-fi',
      'bookshelf': 1,
      'books': [ ObjectId("583817c043bf901f2c8ff2d1")]
    }
  ],
  'books': [
     {
       '_id': ObjectId("583817c043bf901f2c8ff2d1"),
       'title': 'Ipsum',
       'author': 'Dolor Sit',
     }
  ]
}

A: You can just couple up the 2 $pulls in one update, one for pulling the item from the shelve and one for pulling it from the books:
> db.library.update({"shelves.books" : ObjectId("583817c043bf901f2c8ff2ce")},
...     {
...         $pull: {
...             "shelves.$.books" : { $in : [ObjectId("583817c043bf901f2c8ff2ce")] },
...             "books" : { "_id" : ObjectId("583817c043bf901f2c8ff2ce")}
...         }
...     })

Will return
> db.library.find().pretty()
{
        "_id" : ObjectId("58380bd7ae1d7b1278dbb79f"),
        "shelves" : [
                {
                        "type" : "sci-fi",
                        "bookshelf" : 1,
                        "books" : [
                                ObjectId("583817c043bf901f2c8ff2d1")
                        ]
                }
        ],
        "books" : [
                {
                        "_id" : ObjectId("583817c043bf901f2c8ff2d1"),
                        "title" : "Ipsum",
                        "author" : "Dolor Sit"
                }
        ]
}
>


text:
Q: Why must I create a type alias when using a variadic constructor function? I have a templated base class that takes an N amount of types:
template <typename... Ts>
class Base{};

When using protected inheritance on that base class,
template <typename... Ts>
class Derived : protected Base<Ts...>{
   //like so...
};

I would like to additionally include the public constructors of the base class:
template <typename... Ts>
class Derived : protected Base<Ts...>{

   //create an alias
   using Parent = Base<Ts...>;

   //get all constructors as well
   using Parent::Parent;
};

This works.
However, why must I include the Parent alias?
Is doesn't seem as though I can get the constructors without it.  The following attempt does not work:
template <typename... Ts>
class Derived : protected Base<Ts...>{

   //get all constructors as well
   using Base<Ts...>::Base<Ts...>;
};

error:
clang++ -std=c++1z -o main v.cpp
error: expected ';' after using declaration
       using Base<Ts...>::Base<Ts...>;
                              ^
                              ;
1 error generated.

I can cut off the template part, and it compiles, but this does not appear to be correct:
template <typename... Ts>
class Derived : protected Base<Ts...>{

   //get all constructors as well
   using Base<Ts...>::Base;
};

The reason I don't think it is correct is because it does not appear to work on vector.
does not compile:
template <typename... Ts>
class Derived : protected std::vector<Ts...>{

   //get all constructors as well
   using std::vector<Ts...>::std::vector;
};

However, using an alias does work.
compiles:
template <typename... Ts>
class Derived : protected std::vector<Ts...>{

   //create an alias
   using Parent = std::vector<Ts...>;

   //get all constructors as well
   using Parent::Parent;
};

Question:
Do I have to use an alias to get the same functionally, or is there a way to inline this without creating a new name for the base type?

A: You don't need a type alias. The problem is that the constuctor of Base<Ts...> is not called Base<Ts...>. It's called Base.
This works:
template<class...Ts>
struct Base {

};

template<class...Ts>
struct Derived : Base<Ts...>
{
    using Base<Ts...>::Base;
};

In addition, the name of std::vector<...>'s constructor is not std::vector, it is vector
This also works:
template<class...Ts>
struct Derived : std::vector<Ts...>
{
    using std::vector<Ts...>::vector;
};

However, don't derive from std:: containers! Encapsulate them.

A: In your example Base does not have a template constructor so using Base<Ts...>::Base<Ts...>; is trying to find a constructor that does not exist.
Imagine I had a class like yours
class Base{
    public:
        Base(){}

        template<typename ... Ts>
        Base(){}
};

Which constructor would using Base<Ts...>::Base<Ts...> choose?
The reason that using Parent = Base<Ts...> works is because when you write using Parent::Parent you are trying to find a constructor of Parent that is not templated. It expands to using Base<Ts...>::Base;.

A: using Base<Ts...>::Base<Ts...>; is illegal because of a very general rule in [namespace.udecl]p5:

A using-declaration shall not name a template-id.

This is very similar to the fact that you cannot name a specific overload in using-declarations. However, I do not know the rationale for this rule.

The relation between constructors and names... is complicated:

*

*"Constructors do not have names." [class.ctor]p1

*"The point of declaration of a using-declaration that does not name a constructor [...]" [class.ctor]p4
So while constructors do not have names, they can be named. To me, this seems similar to anonymous types:
struct { int m; } x;
decltype(x) // refers to the type of `x` which has no name

A using-declaration that shall inherit constructors must name a constructor.

[class.qual]p2 specifies how a constructor can be named in qualified-ids (consisting of a nested-name-specifier and an unqualified-id):

In a lookup in which function names are not ignored and the
  nested-name-specifier nominates a class C:

*

*(2.1) if the name specified after the nested-name-specifier, when looked up in C, is the injected-class-name of C, or

*(2.2) in a using-declaration that is a member-declaration, if the name specified after the nested-name-specifier is the same as
  the identifier or the simple-template-id's template-name in the last
  component of the nested-name-specifier,

  the name is instead considered to name the constructor of class C.

To address/comment some other answers, I'll digress a bit..
One can argue that (2.1) does not apply in the OP: while Base contains an injected-class-name, this name is Base and not Base<Ts...>. The name specified after the nested-name-specifier is Base<Ts...>, which is not the injected-class-name.
Note that the injected-class-name of a dependent base class is not known until instantiation time. Consider
template<typename T>
struct foo : T {
    using T::name;
    void name(double);
};

struct name { name(int); };
struct bar { void name(int); };

foo<name> // constructor inheritance?
foo<bar>  // makes a function visible?

clang++ rejects this example, while g++ accepts it. This is CWG 2070
We do know however at the point of definition that Base in the OP is a class, and therefore could infer the injected-class-name. This would require a distinction between types whose name is know at the point of definition and those where it is not. Alias templates can hide this, so this is not a trivial distinction of the form of the qualified-id in the using-declaration.
In any case, the bullet point (2.2) does not apply to Base<Ts...>::Base<Ts...>: Its nested-name-specifier is Base<Ts...>. The template-name of this is Base. The name after the nested-name-specifier is Base<Ts...>.

[class.qual]p2.2 allows using Base<Ts...>::Base and parent::parent, simply by looking at the identifiers used within the qualified-id. No actual name lookup needs to be performed here. The form itself is sufficient to name a constructor.


text:
Q: How to know what icon is being used in the dock? I want to replace the synaptic icon (although it could be any other).
I have found the Desktop Entry, Icon Theme and Icon Naming specifications that gnome follows (somewhat?), but even though I've been reading for a while now, the time has come to ask.
In /usr/share/applications there is "Synaptic Package Manager", and it contains Icon=synaptic. Now, I kinda guess that I maybe know that the dock uses the 48x48 size of icons, but when I put both "synaptic.svg" and "synaptic.png" (because I don't know how to figure out which extension is being looked for), even a plain "synaptic" in my 48x48 theme folder (and others, and other themes... etc, even using ~/.icons to be sure it gets looked up first), guess what?
The icon doesn't change.
Not even after a lot of gtk-update-icon-cache whatevertheme both in usr/share/icons and in $HOME/.icons
I'm a bit confused. It's a freaking icon. I've sudo find / -name "*synaptic*"ed and all, (restart included), but I don't see the icon that is actually being used. There must be something that I'm missing...
So I turn to you. It can't be this crushingly impossible to find out what icon is being used. I'm open to consider attaching debuggers and/or dissemblers if necessary (that could be memorable), but I have made the decision that I'm gonna change that icon.
Would you please help me, if you can? I will thank you a lot.
This is Ubuntu 10.04 LTS, the theme is "elementary", and my computer is a pretty standard Acer laptop.

A: Open synaptic.desktop file using the following command:
sudo -i gedit /usr/share/app-install/desktop/synaptic:synaptic.desktop

and change the line:
Icon=synaptic

with:
Icon=/path/to/new/icon

Save the file and close it. It does not matter what extension has icon (.svg, .png, etc), the important thing is that the path to the new icon (inclusive its extension) to be introduced correctly.
That should be enough.

A: To change the icon of an application it is often better to just use a custom .desktop file in the user's home directory rather than changing icon files in the system-wide icon themes. It is also advisable to not edit a .dektop file in /usr/share/applications as this may be reset any time (e.g. by an update).
A good approach to display a different icon, and without the need of root permissions or tampering with root directories is to just copy any application's .desktop file to ~/.local/share/applications.
We can then edit the desktop file with any editor to change the path to our custom icon:
Icon=/full/path/to/icon  # or name of icon

We have to grant this .desktop file permission "Allow executing file as program".
After logging out and log back in the settings in ~/.local/share/applications will override system wide settings and our desired icon will be displayed.


text:
Q: iOS Voip Socket will not run in background I am getting a VOIP socket to run in the background in an iOS application.
My connection works fine, but it won't wake up when my app goes into the background. If I open the app back up, though, it responds to any messages it got while it was asleep.
I set up my stream like this:
CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault,
                                   (CFStringRef) @"test.iusealocaltestserver.com",
                                   5060,
                                   &myReadStream,
                                   &myWriteStream);
CFReadStreamSetProperty (    myReadStream,
                             kCFStreamNetworkServiceType,
                             kCFStreamNetworkServiceTypeVoIP
                             );

CFSocketNativeHandle native;
CFDataRef nativeProp = CFReadStreamCopyProperty(myReadStream, kCFStreamPropertySocketNativeHandle);

CFDataGetBytes(nativeProp, CFRangeMake(0, CFDataGetLength(nativeProp)), (UInt8 *)&native);
CFRelease(nativeProp);

CFSocketRef theSocket = CFSocketCreateWithNative(kCFAllocatorDefault, native, 0, NULL, NULL);

CFSocketGetContext(theSocket,&theContext);

CFOptionFlags readStreamEvents = kCFStreamEventHasBytesAvailable |
kCFStreamEventErrorOccurred     |
kCFStreamEventEndEncountered    |
kCFStreamEventOpenCompleted;

CFReadStreamSetClient(myReadStream,
                           readStreamEvents,
                           (CFReadStreamClientCallBack)&MyCFReadStreamCallback,
                      (CFStreamClientContext *)(&theContext));

CFReadStreamScheduleWithRunLoop(myReadStream, CFRunLoopGetCurrent(),
                                kCFRunLoopCommonModes);

Then my callback is set up like this:
static void MyCFReadStreamCallback(CFReadStreamRef stream, CFStreamEventType type, void *pInfo);

static void MyCFReadStreamCallback (CFReadStreamRef stream, CFStreamEventType type, void *pInfo)
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSLog(@"Callback Happened");

   [pool release];
}

"Callback Happened" is getting called when I receive data and the app is open, but it doesn't if the app is minimized. When the app comes back up, though, it processes any data it received while minimized.
I added the voip tag to the info.plist. My CFReadStreamSetProperty returns true. I am running on a device not a simulator. It still doesn't work though, so I dont know what my problem could be. I probably just did something silly, but there's almost nothing online to check my code against.
EDIT: I can't test any of the answers because I am no longer working on this project and don't have access to a mac/iOs sdk. If someone with a similar problem found one of the below answers useful, let me know and I will vote it best answer.

A: I was stuck with the exact same scenario.
My problem was that i've configured more than one socket as a Voip socket.
you can see at Apple's documentations about voip that they say:

"Configure one of the application's sockets for VoIP usage"
I guess they are only waking your app according to a single socket.
all other stuff mentioned is still correct:

*

*kCFStreamNetworkServiceTypeVoIP

*'info.plist' UIBackgroundModes: voip, audio

*'info.plist' UIRequiresPersistentWifi key

*will NOT work over simulator

A: I'm also facing same problem. but in my case everything is working fine, unless network changes happen. I used apple "reachability" class to detect network changes. if the app is in background upto sometime my socket is working even if i manually switched my network for the following.

*

*wifi -> 3g

*3g -> wifi

After sometime, let say again im trying network switch manually. nothing is happ it seems my app is not detecting network changes. I read the below apple doc. i'm sure doing wrong(or) disunderstood  step 3 and 6.
There are several requirements for implementing a VoIP app:
1. Add the UIBackgroundModes key to your app's Info.plist file. Set the value of this key to an array that includes the voip string.

*

*Configure one of the app's sockets for VoIP usage.

*Before moving to the background, call the setKeepAliveTimeout:handler: method to install a handler to be executed periodically. Your app can use this handler to maintain its service connection.

*Configure your audio session to handle transitions to and from active use.
5. To ensure a better user experience on iPhone, use the Core Telephony framework to adjust your behavior in relation to cell-based phone calls; see Core Telephony Framework Reference.

*

*To ensure good performance for your VoIP app, use the System Configuration framework to detect network changes and allow your app to sleep as much as possible.

A: If you want to let your VOIP application run in background , except those base settings in plist file, you need a TCP socket who's property is set to VOIP, than the iOS system will take care this socket for you, when your application enter background , every thing was 'sleep' except that tcp socket. and if VOIP server send some data thought that TCP socket, your application will be awake up for 10 secs. during this time, you can post a local notification.
Only Tcp socket can be set as VOIP Socket. But from i know , mostly VOIP application are based on UDP socket. if you do not want to separate the control socket from the data socket. you should create another tcp socket which is focus on 'awake' your application , and from my personal experience , it's very hard to keep this 'awake' signal and the real sip control signal synchronize, the application always miss the sip invite request.
So,the best way is separating the sip control single from the UDP data socket , make it as a tcp socket , this is the best solution , but never use tcp socket to transfer voice data.
Another dirty way: keep the application awake all the time.
  As i said , each TCP single the application received thought that 'VOIP' tcp socket , will keep application awake for 10 seconds, so at the end of this duration(after 9 secs) , you can send a response to the server to ask for another signal , when the next signal arrived, the application will be awake again,after 9 secs , send response again. keep doing this, your application will awake forever.

A: You might need to set <key>UIBackgroundModes</key><array><string>audio</string></array> in Info.plist, and you need to make sure that the audio session is active/running/whatever before you switch apps (the assumption is that you won't suddenly start recording/playing music/whatever when your app is in the background).
The docs say that "audio" lets you play audio in the background, but presumably this also applies to recording audio. If it doesn't work, there are a few things you could try:

*

*Set both "voip" and "audio".

*Play silence (this might be easiest to do with the Audio Queue API).

A: Do you have a 'applicationDidEnterBackground:' in your application delegate.  I'm pretty sure that I've read somewhere (that I can't find), that you need to have it defined for ios to recognize that you support background modes.  You don't need to implement anything in it.
e.g.
- (void)applicationDidEnterBackground:(UIApplication *)application
{
}


text:
Q: Retrieving hidden cells from excel file in PHPExcel How to retrieve hidden cells in a .xslx (excel) file, using PHPExcel ?

A: You retrieve the values of cells in hidden rows or columns in exactly the same way you retrieve values of cells in non-hidden rows or columns.
$objPHPExcel->getActiveSheet()
    ->getCell('C1')
    ->getValue();

will work whether the cell is hidden or not.
"Hiding" cells, is something that the MS Excel GUI does, but the cell is still just a normal cell to PHPExcel.


text:
Q: Orleans EventHub stream provider I am using the EventHubStream provider in a project based on Orleans.
After the system has been running a few minutes Orleans starts throwing  a QueueCacheMissException while trying to push an event to OnNext from a producer.
i have tried to increase the size of the cache but that helped only for a while.
Is this a normal behavior due to the size of the cache?
In this situation should i unsubscribe and subscribe again? i have tried to resume stream but that didn't work, the stream was in faulted state... any ideas?

A: It is likely that the service is reading events from eventhub faster than grains are processing them.  EventHub can deliver events at a rate of ~1k/second per partition.
The latest version of the EventHub stream provider supports backpressure that should prevent this problem, but it has not been released.  You can however build your own nugets.


text:
Q: What is equivalent of isNullOrEmpty in Postgresql select command? select complaintno from complaintprocess  where endtime='';

It Is Not Working
In complaintprocess table endtime datatype is timestamp without time zone.
 Here I want to get one of the column in complaintprocess where endtime is empty.

A: You could not store '' as timestamp. I suspect that by blank you mean NULL value.
SELECT CAST('' AS timestamp);
-- ERROR: invalid input syntax for type timestamp: ""

To filter them you could use:
SELECT complaintno
FROM complaintprocess
WHERE endtime IS NULL;


text:
Q: What would be the best way to explain color confinement in quarks? To someone who is not so experienced in advanced physics, how do you explain or teach them why something as complex as color confinement prevents us from being able to see or prove that there are any type of quarks existing in the quantum level and why not even with the strongest microscopes are they visible.

A: I agree with John Rennie, that you should read the article about confinement, but I will still attempt to answer what you may want to explain/teach to give your students a reasonable overview.
A good point to start would be the phenomenology. Don't make particle physics a black box. Show what we actually "see" in accelerator experiments! For the purposes of this problem we are seeing heavy particles called baryons (the most common ones are the proton and the neutron) and mesons.
Reactions with these particles happen to conserve the so called Baryon number, which is $B=1$ for baryons, $B=-1$ for anti-baryons and $B=0$ for mesons. $B$ is a conserved quantity, i.e. a good quantum number which behaves similar to an electric charges.
Proceed by explaining that physicists also noticed that one can identify additional quantum numbers like the Isospin $I_3$, which behaves similar to an angular momentum quantum number, Charm $C$, the Strangeness $S$, Topness $T$ and Bottomness $B'$. These are called "flavour quantum numbers". Flavour quantum numbers happen to be preserved in processes that happen due to electromagnetic and strong interactions, but they are not preserved by the weak interaction.
Now you can show that with these quantum numbers one can then sort all of the observed hadrons and mesons into multiple diagrams similar to the periodic table or the table of isotopes. If you can afford the time, show the similarity. It follows from the underlying symmetries of this order that hadrons can be understood as compound particles made up of three sub-units, while mesons are made up of two. The subunits were called quarks, the particles carrying the strong force between them were called gluons. Overlay the quark content of each particle with your original hadron/meson diagrams. Let students experience how the combinations of two/three quarks add up to a neat sub-nuclear puzzle. This should give students some confidence, that the quark idea is maybe not so bad, after all!
Once you have established that confidence you can say that curiously not a single quark has been seen in any one of these experiments (they would give themselves away by their fractional charge!).
And this is the point where the confinement hypothesis comes into play. By defining a suitable interaction between the quarks one can find a field theory which predicts, that any attempt to create a free quark will automatically produce new quarks in the process, i.e. the resulting particle will always be a meson or a hadron, but never a quark. This is where the pictures of snapping rubber bands may come handy.
One can, of course, leave a few of these steps out, and show the snapping rubber bands right away, but it may be better to give students at least a glimpse of the full picture, rather than just a random fact about confinement.


text:
Q: Write-progress during Start-process -Wait I'm trying to create an installation script and display a progress bar during the install.
$localfolder= (Get-Location).path
start-process -FilePath "$localfolder\Installer.exe" -ArgumentList "/silent /accepteula" -Wait

and as progress bar I want to add:
for($i = 0; $i -le 100; $i++)
{
Write-Progress -Activity "Installer" -PercentComplete $i -Status "Installing";
Sleep -Milliseconds 100;
}

But I can't find the way to run the progress bar while the installer is running.
If someone has an idea...

A: You could muck around with threading options, for your progress bar, but I don't recommend it.
Instead, forego -Wait with Start-Process, and use -PassThru to return a [System.Diagnostics.Process] object.
With that, you can check for the process having terminated yourself.
This is important for two reasons, both related to the fact that your progress bar isn't actually tracking the progress of the installation:

*

*You want to be able to abort the progress bar as soon as the process is finished.

*You maybe want to reset the progress bar to 0 if it happens to take longer than 10,000 milliseconds.

The Process object has a boolean property called .HasExited which you can use for this purpose.
With all that in mind, I'd do something like this:
$localfolder= (Get-Location).path
$process = Start-Process -FilePath "$localfolder\Installer.exe" -ArgumentList "/silent /accepteula" -PassThru

for($i = 0; $i -le 100; $i = ($i + 1) % 100)
{
    Write-Progress -Activity "Installer" -PercentComplete $i -Status "Installing"
    Start-Sleep -Milliseconds 100
    if ($process.HasExited) {
        Write-Progress -Activity "Installer" -Completed
        break
    }
}

Summary of Changes

*

*Start-Process now uses -PassThru instead of -Wait and assigns the process object to the $process variable.

*The for loop's iterator uses $i = ($i + 1) % 100 instead of $i++, so that it keeps resetting to 0 when it reaches 100.

*An if block checks to see if the process has exited; if so, it ends the progress bar and then breaks out of the loop.

Slight caveat: the for loop is now an infinite loop that only breaks when the process exits. If the process is stuck, so is the loop. You could separately time the operation and handle a timeout if you wanted to.

A: You can make the Progressbar into a function and call it whenever you need to.
Make sure you set this up:
$ProgramName = "installer.exe"
$Attributes = "/accepteula"
Function LoadingBar {For($I = 0; $I -le 100; $I = ($I + 1) % 100){Write-Progress -Activity "$ProgramName" -CurrentOperation "Please wait for instalation to complete... The bar will loop." -PercentComplete $I -Status "Installing";Start-Sleep -M 500;If ($LoadingProcess.HasExited) {Write-Progress -Activity "Installer" -Completed;Sleep 1;Break}}}

Then, you can call it like so,
$LoadingProcess = Start-Process -FilePath "F:\PortableApps\7zip\7zFM.exe" -ArgumentList "$Attributes" -PassThru;LoadingBar;Sleep 1;$LoadingProcess.WaitForExit() | Out-Null

This will display a progressbar at the top with the program name, action (Installing) and when the program is done, it will continue.


text:
Q: Upper bound to multinomial coefficient sum I'm currently stuck on what seems like a very trivial problem. I have the following calculation
$$
\sum_{k_1+k_2=0}^{n} {n \choose n - k_1 - k_2, k_1, k_2}^2 \le \sum_{k_1+k_2=0}^{n} {n \choose \frac{n}{3}, \frac{n}{3}, \frac{n}{3}}^2
= {n \choose \frac{n}{3}, \frac{n}{3}, \frac{n}{3}}^2 \sum_{k_1+k_2=0}^{n} 1
$$
I need to find the value of the following to complete the calculation
$$\sum_{k_1+k_2=0}^{n} 1$$
At first glance, I thought that it would equal to $(n + 1)$ but now I'm fairly sure it won't be. This seems like a combinatorial problem where we have to find all $k_1$ and $k_2$ such that the sum of the two will be every integer from $0$ to $n$.
Any help would be appreciated with finding the value of this sum.

A: It looks to me as if this is a double sum with $0\le k_1 \le n$, $0\le k_2 \le n$ and $0\le k_1+k_2 \le n$.
You could rewrite it as a double sum with  $0\le k_1 \le n$ and $0\le k_2 \le n-k_1$, i.e. as $$\sum_{k_1=0}^{n}  \sum_{k_2=0}^{n-k_1} 1 = \sum_{k_1=0}^{n} (n-k_1+1) = n(n+1)- \left(\sum_{k_1=0}^{n} k_1\right) +(n+1) = \frac{(n+1)(n+2)}{2}. $$


text:
Q: Placehold for variable names in python2 In python2, if I want to print something like:
print 'enrollment:' + str(len(enrollment))
print 'submissions:' + str(len(submissions))

I need to output the title and the length ; tried to format:
print ('%d:' + str(len('%d'))) %enrollment

which gives me:

"TypeError: %d format: a number is required, not dict"

BTW both "enrollment" and "submissions" are variables storing dictionary
Is there a way to apply a placeholder for both string and the variable name?

A: I think you are perhaps looking for something like the following:
>>> enrollment = {'a':1,'b':2}
>>> submissions = {'a':1,'b':2,'c':3}
>>> for x in ['enrollment','submissions']:
...     print('%s: '+str(len(eval(x)))) % x
...
enrollment: 2
submissions: 3

Note that here the dictionary for a given iteration x is actually the name of the dictionary as a string, which is evaled to get the dictionary for counting
It should also be noted that using eval is generally frowned upon - if the string passed into this function is valid python code, it will get executed - so if the string passed in comes from e.g. user input, the user could potentially run code you don't want to be run. In a case like this where the strings are hard-coded in your own code, it should be fine though.

A: Generally if you need a name to be associated permanently with an object then you should use a dictionary, not try to back-trace from the object back to a variable name.  It requires some design thought, but is worth doing if you really need that association, for example:
coll = {'enrollment' : {'k1':'v1','k2':'v2', 'k3':None},
        'submissions': {...}}

for key, val in coll.items():
    print '%s: %d' % (key, len(val))

This avoids eval, which is generally frowned upon:  Why is using 'eval' a bad practice?


text:
Q: gem numbers_and_words not working for decimal values I used gem numbers_and_words but it is not working for decimal values. Then I tried another gem currency-in-words but it is also not working.What gem shall I use for converting the amount in words?
Or is there any method for this ?
number_to_human is also of no use to me.
Please suggest me so that I get these outputs:
43545.347  Forty three thousand five hundred forty five and three hundred forty seven paise

A: I think you didn't take enough time to check out the https://github.com/bcarrere/currency-in-words gem, since in the description it gives quite a clear view on how to use the gem.
Also make sure you bundle install and restart your server.
EDIT: also make sure that you are using the American notation for digit separation with the dot (.) and not the comma (,)


text:
Q: System.Uri Class: Different escaping behaviour in Azure vs. .Net Framework I have the following code in a class library project (the Url has been simplified but it still demonstrates the same behaviour):
Uri oUri = new Uri("https://xzyserver.com/MyFolder%2FMyPage?querystring");

I have found that the System.Uri class is unescaping my Urls differently locally vs. in an Azure Worker Role.
If the class library runs in a desktop app oUri.AbsoluteUri returns different values to that running in Azure (both in the Compute Emulator and in a production worker role):
Locally = MyFolder%2FMyPage?querystring
InAzure = MyFolder/MyPage?querystring
(I have had to remove the start of the URLs in the two lines above because Stack Overflow was telling me there are too many links in my post)
The local behaviour is what I need (as part of a third party authentication process, a security token is calculated based on the request Uri and other parts of the request body, this unescaping breaks that process).  The Uri is used with the classes in the System.Net.Http namespace.
I have tried the obsolete form of the Uri constructor (sUri, bDontEscape) but this didn't make any difference.
Further, the behaviour seems inconsistent - I also tried the following:
Uri oUri = new Uri("https://xzyserver.com/MyFolder%252FMyPage?querystring");

However, the unescaping only seems to apply to %2F to "/", the %25 didn't unescape back to "%", instead oUri.AbsoluteUri returns the full original Url with no unescaping.
Is this a known/documented problem?  Any simple workaround that I may have missed?
PS.  The classes in the System.Net.Http namespace take either a Uri object or a string Uri in many of their constructors, but the same issue applies to both.  I expect the classes are simply creating a Uri under the covers for the string based overloads.

A: After further research, I have discovered this behaviour is by design but can be crudely controlled from the app.config file from .net 4.0 onwards.
http://msdn.microsoft.com/en-us/library/ee656542(v=vs.110).aspx
The documentation suggests the default behaviour should be as Azure.  I cannot find the override configured for my local system (perhaps the default for a client desktop installation is that the override is enabled?).  No matter really, at least I understand the behaviour now.
Adding the override into the Azure worker role app.config file has solved the problem.


text:
Q: Какое будущее у Node.js Здравствуйте! Помогите определится.
Недавно приступил к изучению веб-программирования, для серверной части выбрал PHP, а для клиентской, естественно - JavaScript. После небольшого ознакомления JS мне понравился больше чем PHP(какой-то он нудной). И вот теперь думаю, может стоит начать изучать вместо PHP NodeJS, чтобы уже полностью погрузится в одну технологию. Что Вы об этом думаете?

A: я бы рекомендовал изучать оба в параллельном режиме, ибо:
во-1, пхп еще долго не умрет и будет востребован.
во-2, ноде.жс также будет пользоваться спросом ввиду своей производительности и легкости

(сам с 2004 года на пхп, сейчас делаю некоторые модули на ноде.жс, поскольку пхп не успевает кое-где..)
A: Изучайте Python,а затем и фреймворк Django.
Ну а Ноду,если собираетесь создавать асинхронные фигнюшки.
A: Если для фана - то конечно изучайте что то одно. Если Вы планируете сделать программирование Вашей работой, то ещё много чего нужно выучить (например ещё MySQL).
upd
На хабре проскочила статья, где показано, как на базе nodejs делают кроссплатформенные приложения.


text:
Q: Missing all my Iphoto pictures I have a Apple Macintosh running OSX 10.6.8. I have used iphoto since I bought my computer. I can't find my pictures - this happened once before and all I did was a "search" but that isn't working this time. What can I do to recover these images, and what locations and what tools should I be looking at to recover these images?

A: Your iPhoto Library, which contains photos stored in iPhoto, is located in your Pictures folder. If you are using a newer version of iPhoto, you will need to right-click on the iPhoto Library and select Show Package Contents to view the files.
If you have trouble finding it, this guide on moving the iPhoto library also has instructions on finding it.


text:
Q: Entity Framework - How to get Standard Deviation using GroupBy? I'm using entity framework 5, code first fluent API. I've built a simple query with a GroupBy for aggregation:
                        var query = context.Table1
                                    .GroupBy(g => new
                                    {
                                        Prop1= g.Prop1,
                                        Prop2 = g.Prop2
                                    })
                                    .Select(s => new
                                    {
                                        Prop1= s.Key.Prop1,
                                        Prop2= s.Key.Prop2,
                                        Avg = s.Average(m => m.Minutes),
                                        Min = s.Min(m => m.Minutes),
                                        Max = s.Max(m => m.Minutes),
                                        StdDev = //How to get standard deviation of Minutes here?
                                    })
                                    .ToList();

Along with other aggregation (average, min, max), how can I get standard deviation of Minutes in my select? I've heard there is a canonical function for StdDev but have been unable to figure out how to apply it in this case. Any help or a nudge in the right direction would be greatly appreciated!

A: You should be able to use EntityFunctions.StandardDeviation in System.Data.Objects like this:
StdDev = EntityFunctions.StandardDeviation(s.Select(m => m.Minutes))

(If you were using EF 6, it would be System.Data.Entity.DbFunctions.StandardDeviation())


text:
Q: How can I navigate to a nested stack screen inside a sibling tab while preserving its initial screen? (React Navigation) The Code:
I'm using React Navigation 6 with the following hierarchy:
MainTabNavigator
    HomeStack
        HomeScreen (HomeStack initial screen, contains a "Pay" button)
        OtherScreen
    MembershipStack
        MembershipHomeScreen (MembershipStack initial screen)
        PayMembershipScreen (should always navigate back to MembershipHomeScreen)

The App launches into HomeScreen (inside HomeStack), so the MembershipStack tab won't be loaded yet.
There is a "Pay" button inside HomeScreen that redirects to PayMembershipScreen inside MembershipStack.
Code of the HomeScreen with the "Pay" button press handler:
const HomeScreen = ({navigation}) => {

    const payPressHandler = useCallback(() => {
        // The parent navigator here is MainTabNavigator
        navigation.getParent().navigate("MembershipStack", { screen: "PayMembershipScreen" })
    }, [navigation])

    return (
        <TouchableOpacity onPress={payPressHandler}>
            <Text>Go to Pay screen!</Text>
        </TouchableOpacity>
    )
}

The "Pay" button inside HomeScreen does navigate to PayMembershipScreen with this code.
The Problem:
When the MembershipStack tab has not yet been loaded (i.e. when the App just launched), the following happens:

*

*User clicks the "Pay" button on HomeScreen.

*App navigates to PayMembershipScreen.

*PayMembershipScreen becomes the initial screen on MembershipStack.

*User can't go back to MembershipHomeScreen from PayMembershipScreen.

The question is: how can I navigate from HomeScreen directly to PayMembershipScreen and after that be able to go back to MembershipHomeScreen (i.e. have it available as the initial screen in the MembershipStack history)?
What I've tried so far:
1. Setting lazy: false on the MainTabNavigator options.
This approach does make sure that MembershipHomeScreen is always the initial screen on MembershipStack, since all stacks (and their initial screens) will be loaded when the App launches. However this comes with a noticeable drawback in performance, since there's at least 5 tabs in the actual project.
Also, since MembershipHomeScreen is already focused inside MembershipStack, there's a weird MembershipHomeScreen to PayMembershipScreen transition animation when the "Pay" button on HomeScreen is pressed. I just want the user to see a transition from HomeScreen to PayMembershipScreen at most, nothing flashing inbetween.

2. Define a param on MembershipHomeScreen to indicate when I want to redirect to PayMembershipScreen.
On this approach, I'm using a boolean param on MembershipHomeScreen called redirectToPayment:
Code inside MembershipHomeScreen:
const MembershipHomeScreen = ({navigation, route}) => {
    const { redirectToPayment = false } = route.params

    const redirectIfNeeded = useCallback(() => {
        if (redirectToPayment) {
            // reset the param
            navigation.setParams({ redirectToPayment: false })
            // redirect to the desired screen
            navigation.navigate("PayMembershipScreen")
        }
    }, [redirectToPayment, navigation])

    // Using layout effect to avoid rendering MembershipHomeScreen when redirecting.
    useLayoutEffect(redirectIfNeeded)

    return (
        <Text>
            This is just the membership home screen,
            not the target screen of the "Pay" button.
        </Text>
    )
}

And on the HomeScreen:
const payPressHandler = useCallback(() => {
    navigation
        .getParent()
        .navigate(
            "MembershipStack",
            { screen: "MembershipHomeScreen", params: { redirectToPayment: true } }
        )
}, [navigation])

The use of React's useLayoutEffect comes with the known drawback of freezing the screen since it will leave any rendering tasks on hold while it's running. I'm able to notice a 2 seconds freeze in the HomeScreen when I press the "Pay" button on a 4GB RAM Moto G7...
...and even after using useLayoutEffect, the MembershipHomeScreen still renders nonetheless to show a transition animation between MembershipHomeScreen and PayMembershipScreen.
Same behavior with useEffect, except it renders the MembershipHomeScreen instead of a 2 seconds freeze.

3. Using React Navigation's dispatch function to customize the route history.
On this approach, I intend to dispatch a custom action that does the following to the navigation state of MainTabNavigator:
Before:
index: 0
routes: [
    0: {
        name: "HomeStack",
        state: {
            index: 0,
            routes: [
                0: {
                    name: "Home" // <-- currently active screen
                }
            ]
        }
    },
    1: {
        name: "MembershipStack",
        state: undefined // <-- this is an unloaded tab
    }
]

After:
index: 1
routes: [
    0: {
        name: "HomeStack",
        state: {
            index: 0,
            routes: [
                0: {
                    name: "Home"
                }
            ]
        }
    },
    1: {
        name: "MembershipStack",
        state: {
            index: 1,
            routes: [
                0: {
                    name: "MembershipHomeScreen"
                },
                1: {
                    name: "PayMembershipScreen" // <-- currently active screen
                }
            ]
        }
    },
]

Here's the code I'm using inside the HomeScreen for that:
const payPressHandler = useCallback(() => {

        navigation.getParent().dispatch(state => {
            const membershipTabIndex = state.routes.findIndex(r => r.name === "MembershipStack")

            // get the current navigation state inside the MembershipStack
            let membershipTabState = state.routes[membershipTabIndex].state

            // point to PayMembershipScreen without overriding the initial screen on that tab
            if (!membershipTabState) {
                // tab is unloaded, so just set the ideal state
                membershipTabState = { index: 1, routes: [{ name: "MembershipHomeScreen" }, { name: "PayMembershipScreen" }] }
            } else {
                // tab already has a navigation state, so we'll point to PayMembershipScreen
                // if it's loaded in the stack. Otherwise, we'll add it and point to it.
                let payMembershipScreenIndex = membershipTabState.routes.findIndex(r => r.name === "PayMembershipScreen")

                if (payMembershipScreenIndex === -1) {
                    payMembershipScreenIndex = membershipTabState.routes.push({ name: "PayMembershipScreen" }) - 1
                }

                membershipTabState.index = payMembershipScreenIndex
            }

            // update the MembershipStack tab with the new state
            const routes = state.routes.map((r, i) => i === membershipTabIndex ? { ...r, state: membershipTabState} : r)

            // update the MainTabNavigator state
            return CommonActions.reset({
                ...state,
                routes,
                index: membershipTabIndex
            })
        })
}, [navigation])

That code almost accomplishes the expected outcome:

*

*It navigates from HomeScreen to PayMembershipScreen successfuly.

*The user can go back to MembershipHomeScreen from PayMembershipScreen.

*MembershipHomeScreen does not render in-between during the transition.

However:

*

*It won't work a second time if you do go back to MembershipHomeScreen from PayMembershipScreen.

Turns out, if I go back to MembershipHomeScreen once I'm inside PayMembershipScreen, then go back to the HomeStack and press the "Pay" button again, it will now navigate to MembershipHomeScreen instead of PayMembershipScreen.
Additionally, the MembershipHomeScreen will now display a disabled back button in the header (probably a bug).
This last approach is so far the closest to getting the desired outcome, so I really hope that it only needs a fix in the logic and it's not really a bug.

Summary:
Is anyone able find a solution that achieves the expected outcome? To sum up:

*

*It should make the "Pay" button navigate from HomeScreen to PayMembershipScreen.

*The user should be able to go back to MembershipHomeScreen once they're in PayMembershipScreen.

*The MembershipHomeScreen should not flash in the transition from HomeScreen to PayMembershipScreen.

*The screen should not freeze inbetween the transitions (no use of useLayoutEffect).

*Don't load all tabs on App launch (it's too much burden on the actual 5-tab project).

*If the user navigates back to MembershipHomeScreen once they're inPayMembershipScreen, pressing the "Pay" button on HomeScreen again should open the PayMembershipScreen again (no buggy behavior).

Minimal reproducible example:
Here's a snack with all of the approaches mentioned. Please check it out and use it as a playground for your solution!
https://snack.expo.dev/@ger88555/tabs-with-stacks-and-a-button

A: Solution
I got the expected outcome with the following approach:

*

*Navigate directly to PayMembershipScreen when the "Pay" button is pressed.

*Inside PayMembershipScreen, add MembershipHomeScreen to the top of MembershipStack history if not already present.

The Code
Code inside HomeScreen (no changes):
const HomeScreen = ({navigation}) => {

    const payPressHandler = useCallback(() => {
        navigation.getParent().navigate("MembershipStack", { screen: "PayMembershipScreen" })
    }, [navigation])

    return (
        <TouchableOpacity onPress={payPressHandler}>
            <Text>Go to Pay screen!</Text>
        </TouchableOpacity>
    )
}

New useAssertInitialScreen hook:
const useAssertInitialScreen = ({ navigation, name }) => {
    useEffect(() => {
        if (navigation.canGoBack() === false) {
            navigation.dispatch((state) => {
                const routes = [{ name }, ...state.routes]

                return CommonActions.reset({
                    ...state,
                    routes,
                    index: state.index + 1
                })
            })
        }
    }, [navigation])
}

Note: I'm passing the navigation prop down the hook since it's also used in the screen, but it could also be obtained from React Navigation's useNavigation hook.
Code inside PayMembershipScreen:
const PayMembershipScreen = ({navigation}) => {

    useAssertInitialScreen({ navigation, name: "MembershipHomeScreen" })

    return (
        <View>
            <Text>
                This is the PayMembershipScreen AKA the target
            </Text>
        </View>
    )
}

Demo
Here's a snack with the code of this answer:
https://snack.expo.dev/@ger88555/tabs-with-stacks-and-a-button---a-solution

I still want to see whether there's a cleaner solution than handling the "Pay" button's functionality inside its target screen.
I'll mark as the accepted answer any other solution that gets the expected outcome :)


text:
Q: Can't find record from id Does anyone have any idea of what I could be missing?
Here is my Code:
<% @comments.each do |comment| %>

 <%= @cId = comment.store_id %>
<%=  Store.find(@cId).title %>
<%= comment.description %>
<% end %>

@cId does return all the numbers in the collection, but when I use it inside the
Store.find(@cId) it returns :
Couldn't find Restaurant with 'id'=

If I print out  @cId = comment.store_id i get:
90 87 87 87 89 89 89 89 87 89 89 87 89 2 2 2 2 2 2 3 3 3
Also, If I hard code it like this :
  Store.find(90)  It works

A: Don't use @ in cId, the @ makes it an instance variable which you don't need. Also don't call it cId but store_id because that's what it is.
It might be you have a comment without a store_id, and of course printing that in your view won't show anything...
<% @comments.each do |comment| %>

    <% if comment.store_id %><%= Store.find(comment.store_id).title %><% end %>

  <%= comment.description %>
<% end %>

I bet you have belongs_to :store on Comment, read the guide on relations and you'll find that you can improve your code even further.

A: I found my issue. I was not testing for nil values. So I added an if nil.


text:
Q: Android: Get current location in China I need to get current location in China but current location manager is not working in china.Its not showing latitude and longitude. Please tell me how can I get this? Many Thanks

A: Fact 1: All Google services are blocked in China.
Fact 2: Although it gives a feeling that AOSP is nothing to do with Google, it's really not.
The truth is that once you used NETWORK_PROVIDER to get a location, a message was send to Google location server to check out the location, and returned the location back to you. For the reason every Chinese knows about, you can't access the server, that's why when you combine NETWORK_PROVIDER and GPS_PROVIDER together, debug codes in a room, nothing get returned(GPS is not accessible in a room).
Solution:

*

*Use android ROM modified by Chinese company like XIAOMI, MEIZU etc. These ROMs modify the framework and redirect the NETWORK_PROVIDER message to other servers.

*Use some third-party location service like BAIDU location SDK.


text:
Q: What is the total number of combinations such that a $6$-digit pin contains exactly $4$ distinct digits? Including $0$ as the leading digit e.g. $011232$
The solution is $$C(10, 4) \cdot \left[C(4, 2) \cdot \frac{6!}{(2!)^2} + C(4, 1) \cdot \frac{6!}{3!}\right]$$ I understand what it represents; taking into account the outcome where $1$ digit repeats thrice and the outcome where $2$ digits repeat twice.
However, I don't understand how it represents these outcomes where $2$ digits are repeated twice. Why do we multiply $C(4, 2)$ by  $6!/(2!)^2$?
E.g. the outcome were $1$ digit is repeated thrice makes sense to me; if the digits are thought of _ _ _ _ _ _ then $6!/3!$ just represents the number of ways I can fill the non-repeating digits in the placeholders. Nothing else matters here since the other placeholders are filled by the same number so you can't form more permutations.
I'm looking for a similar explanation for the the other scenario.

A: (C/P from comments at the suggestion of N.F. Taussig)
Choose the four digits in $\binom{10}{4}$ ways. Then choose the two digits (say $a$ and $b$) that get repeated in $\binom{4}{2}$ ways. So we have our collection of six digits. There are $6!$ ways to order six digits. But we have to divide by $2!$ because the two digits $a$ are indistinguishable. Similarly divide by $2!$ again for the two digits $b$. This explains the factor of $(6!)/(2!)^2$.


text:
Q: Flutter No Method `get` in DocumentSnapshot Despite the documentation here, Flutter is giving me the error:
The method 'get' isn't defined for the class 'DocumentSnapshot'.
Here is my code:
  Future<Object> getFromDocumentSnapshot(String email, String field) async {
    Firestore.instance
        .collection('users')
        .document(email)
        .get()
        .then((DocumentSnapshot ds) {
      return ds.get(field);
    });
  }

Not sure about this one. Any obvious issues? Thanks!

A: The link that you referenced is for javascript and not flutter which uses dart programming language. If you want to get a document in flutter, then you have to do the following:
Firestore.instance
        .collection('talks')
        .document('document-name')
        .get()
        .then((DocumentSnapshot ds) {
      // use ds as a snapshot
    });

You need to use the plugin cloud_firestore:
https://pub.dev/packages/cloud_firestore
As you can see the DocumentSnapshot does not contain method get():
https://github.com/FirebaseExtended/flutterfire/blob/master/packages/cloud_firestore/cloud_firestore/lib/src/document_snapshot.dart

A: To access the data in the DocumentSnapshot object, use its data property. For example:
Firestore.instance
    .collection('users')
    .document(email)
    .get()
    .then((DocumentSnapshot ds) {
  return ds.data[field];
});


text:
Q: How to get a website image url when inputted on textbox/textarea I am trying to get an image from a website when inputted on a textbox/textarea but I am having a hard time with it.
Basically, its like facebook when you try to share a url. Facebook extracts an image from that URL and pastes that somewhere below. I want to do something like that but to no avail.

A: May be this will helpful to you
$contents= file_get_contents('http://mydomain.com/folder/image.jpg');

here http://mydomain.com/folder/image.jpg comes from textbox or textarea.

A: Assuming that you input a URL into an input/textarea, you would have to do a couple of things. file_get_contents of the site, then preg_match_all of the src's of the images. Then you would need the user to allow which image they wanted to select (google+ does a nice job of this). This would best be served up by ajax.

A: Follow this.May be this is what you need image extract from url


text:
Q: How do I use texSubImage2D to show sprites in webgl? I can display my entire sprite (32x512) successfully with this call to gl.texImage2D:
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, image);
It's squished horizontally, like I expected, but it renders on the screen at least. I'm trying to only display the first 32x32 sprite in the sheet and I assumed that I could simply use gl.texSubImage2D to achieve this effect. I tried a simple replacement of texImage2D with texSubImage2D (with modified parameters) but I just get a black box on the screen. Here's the code I'm using:
gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, 32, 32, gl.RGBA, gl.UNSIGNED_BYTE, image);
Am I missing something about the implementation of texSubImage2D? Is there some other step I have to do? Or is texSubImage2D not the right way to do sprite sheets?

A: texSubImage2D is not the function you want. You're running into three problems:

*

*texSubImage2D does not copy a subset of image into the GL texture. It copies the entirety of image on top of the GL texture at a given offset.

*texSubImage2D can only modify existing texture data, and will mess up unless texImage2D has been called first for the GL texture.

*The calling style you're using for texSubImage2D expects a pixel array instead of an HTMLImageElement.

There are four possible signatures for these methods:
// These two accept the normal HTMLImageElement, etc. for the last param.

texImage2D(enum target, int level,  enum internalformat, enum format,
  enum type, Object object);
texSubImage2D(enum target, int level, int xoffset, int yoffset,
  enum format, enum type, Object object);

// These two accept a Uint8Array[] of pixels as the last parameter, despite
// being documented as wanting an ImageData object. The only reason these
// have a width/height param is *because* they take a pixel array, and GL
// doesn't know how large the image is.

texImage2D(enum target, int level, enum internalformat, long width,
  long height, int border, enum format, enum type, Object pixels);
texSubImage2D(enum target, int level, int xoffset, int yoffset,
  long width, long height, enum format, enum type, Object pixels);

To create a texture using the first 32x32 pixels of your image, do something like this instead:
var spriteCanvas = document.createElement('canvas');
spriteCanvas.width = 32;
spriteCanvas.height = 32;

var spriteContext = spriteCanvas.getContext('2d');
spriteContext.drawImage(image, 0, 0);

gl.bindTexture(gl.TEXTURE_2D, texture);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, spriteCanvas);


text:
Q: Want to get better quality out of a DensityPlot3D[] The plot shown below was obtained from a similar program mentioned in the following post.
3D Elastic waves in a glass
How can I have a contour bar (color contours) along with the plot?
The code shown below generated the plot, but the colors are not good and the plot is neither continuous and nor uniform. It is too blurred. How I can change it to show high-resolution graphics? Also, how I can put labels on the axes; for example, $ x $, $ y $, and $ z $?
Could anyone help me?

Needs["NDSolve`FEM`"]
L = .14; L1 = .01; r1 = .085/2; r2 = .055/
  2; del = .006;(*cg=3962 m/s,3980,5100,5640*);
reg = RegionUnion[
   ImplicitRegion[(r2 + (r1 - r2) (-L1)/(L - L1))^2 <=
      x^2 + y^2 <= (r2 + (r1 - r2) (-L1)/(L - L1) + del)^2 &&
     0 <= z <= L, {x, y, z}],
   ImplicitRegion[(r2 + (r1 - r2) (-L1)/(L - L1))^2 <=
      x^2 + y^2 <= (r2 + (r1 - r2) (-L1)/(L - L1) + del)^2 &&
     0 <= z <= L, {x, y, z}]];
param = {Y -> 169*10^9, \[Nu] -> 0.3}; rho = 2332;
ClearAll[stressOperator];
stressOperator[
   Y_, \[Nu]_] := {Inactive[
      Div][{{0, 0, -((Y*\[Nu])/((1 - 2*\[Nu])*(1 + \[Nu])))}, {0, 0,
        0}, {-Y/(2*(1 + \[Nu])), 0, 0}}.Inactive[Grad][
       w[t, x, y, z], {x, y, z}], {x, y, z}] +
    Inactive[
      Div][{{0, -((Y*\[Nu])/((1 - 2*\[Nu])*(1 + \[Nu]))),
        0}, {-Y/(2*(1 + \[Nu])), 0, 0}, {0, 0, 0}}.Inactive[Grad][
       v[t, x, y, z], {x, y, z}], {x, y, z}] +
    Inactive[
      Div][{{-((Y*(1 - \[Nu]))/((1 - 2*\[Nu])*(1 + \[Nu]))), 0,
        0}, {0, -Y/(2*(1 + \[Nu])), 0}, {0,
        0, -Y/(2*(1 + \[Nu]))}}.Inactive[Grad][
       u[t, x, y, z], {x, y, z}], {x, y, z}],
   Inactive[
      Div][{{0, 0, 0}, {0,
        0, -((Y*\[Nu])/((1 -
               2*\[Nu])*(1 + \[Nu])))}, {0, -Y/(2*(1 + \[Nu])),
        0}}.Inactive[Grad][w[t, x, y, z], {x, y, z}], {x, y, z}] +
    Inactive[
      Div][{{0, -Y/(2*(1 + \[Nu])),
        0}, {-((Y*\[Nu])/((1 - 2*\[Nu])*(1 + \[Nu]))), 0, 0}, {0, 0,
        0}}.Inactive[Grad][u[t, x, y, z], {x, y, z}], {x, y, z}] +
    Inactive[
      Div][{{-Y/(2*(1 + \[Nu])), 0,
        0}, {0, -((Y*(1 - \[Nu]))/((1 - 2*\[Nu])*(1 + \[Nu]))),
        0}, {0, 0, -Y/(2*(1 + \[Nu]))}}.Inactive[Grad][
       v[t, x, y, z], {x, y, z}], {x, y, z}],
   Inactive[
      Div][{{0, 0, 0}, {0,
        0, -Y/(2*(1 + \[Nu]))}, {0, -((Y*\[Nu])/((1 -
               2*\[Nu])*(1 + \[Nu]))), 0}}.Inactive[Grad][
       v[t, x, y, z], {x, y, z}], {x, y, z}] +
    Inactive[
      Div][{{0, 0, -Y/(2*(1 + \[Nu]))}, {0, 0,
        0}, {-((Y*\[Nu])/((1 - 2*\[Nu])*(1 + \[Nu]))), 0,
        0}}.Inactive[Grad][u[t, x, y, z], {x, y, z}], {x, y, z}] +
    Inactive[
      Div][{{-Y/(2*(1 + \[Nu])), 0, 0}, {0, -Y/(2*(1 + \[Nu])),
        0}, {0, 0, -((Y*(1 - \[Nu]))/((1 -
               2*\[Nu])*(1 + \[Nu])))}}.Inactive[Grad][
       w[t, x, y, z], {x, y, z}], {x, y, z}]};

{vals, funs} =
  NDEigensystem[
   stressOperator[169*10^9, 0.3] +
     rho {D[u[t, x, y, z], {t, 2}], D[v[t, x, y, z], {t, 2}],
       D[w[t, x, y, z], {t, 2}]} == {0, 0, 0}, {u, v, w},
   t, {x, y, z} \[Element] reg, 15];
Abs[vals]/(2 Pi)
    DensityPlot3D[
      Re[funs[[15, 3]][x, y, z]], {x, y, z} ∈ reg,
      ColorFunction -> "Rainbow",
      Boxed -> False,
      PlotLabel -> Row[{"f = ", Abs[vals[[15]]]/2/Pi}],
      BoxRatios -> Automatic, PlotPoints -> 50]

A: First, although it will not make a difference, you will want to look at your region. You take a RegionUnion of two identical implicit regions. Just one implicit region would suffice.
Next, if you look at the answers in the post that you linked, they suggest that the default mesher may not capture features well for cylindrical geometry. You can see that that it indeed applies to your case as well by executing the following function.
funs[[15, 3]]["ElementMesh"]["Wireframe"]

If you want to make pretty images, it is best to start with a mesh that captures the sharp features. You can follow one of the answers' approaches, or you can use the structured mesh approach that I will provide below.
Structured hex mesh
Helper functions
We import the required FEM package and define some helper functions that will allow us to create an annular structured hex mesh.
(*Import required FEM package*)
Needs["NDSolve`FEM`"];
pointsToMesh[data_] :=
  MeshRegion[Transpose[{data}],
   Line@Table[{i, i + 1}, {i, Length[data] - 1}]];
rp2DMesh[rh_, rv_, marker_] := Module[{sqr, crd, inc, msh, mrkrs},
  sqr = RegionProduct[rh, rv];
  crd = MeshCoordinates[sqr];
  inc = Delete[0] /@ MeshCells[sqr, 2];
  mrkrs = ConstantArray[marker, First@Dimensions@inc];
  msh = ToElementMesh["Coordinates" -> crd,
    "MeshElements" -> {QuadElement[inc, mrkrs]}]
  ]
rp3DMesh[r2D_, rv_, marker_ : 1] := Module[{rp, crd, inc, msh, mrkrs},
  rp = RegionProduct[r2D, rv];
  crd = MeshCoordinates[rp];
  inc = Delete[0] /@ MeshCells[rp, 3];
  mrkrs = ConstantArray[marker, First@Dimensions@inc];
  msh = ToElementMesh["Coordinates" -> crd,
    "MeshElements" -> {HexahedronElement[inc, mrkrs]}]
  ]
annularMesh[r_, th_, rh_, rv_, marker_] :=
 Module[{r1, r2, th1, th2, m1, crd, melms, newcrd, em, mr},
  {r1, r2} = r;
  {th1, th2} = th;
   m1 = rp2DMesh[rh, rv, marker];
  crd = m1["Coordinates"];
  melms = m1["MeshElements"];
  newcrd = {#1 Cos[#2], #1 Sin[#2]} & @@@ ({r1 + (r2 - r1) #1,
        th1 + (th2 - th1) #2} & @@@ crd);
  em = ToElementMesh["Coordinates" -> newcrd, "MeshElements" -> melms];
  mr = MeshRegion@em;
  <|"Mesh" -> em, "Region" -> mr|>
  ]

Construct structured annular cylindrical hex mesh
The following code will construct a nice structured annular cylindrical hex mesh. You can course and or refine the mesh if desired—the parameters used in this mesh required about 16 GB of memory to solve.
subs = {L -> .14, L1 -> .01, r1 -> .085/2, r2 -> .055/2, del -> .006};
rinner = (r2 + (r1 - r2) (-L1)/(L - L1)) /. subs;
router = (r2 + (r1 - r2) (-L1)/(L - L1) + del) /. subs;
l = L /. subs;
nRadial = 4;
nAngular = 90;
theta = 360 Degree;
afrac = theta/(360 Degree);
rh = pointsToMesh[Subdivide[0, 1, nRadial]];
rv = pointsToMesh[Subdivide[0, 1, nAngular afrac]];
m = annularMesh[{rinner, router}, {0 Degree, theta}, rh, rv, 1];
mesh = rp3DMesh[m["Region"],
   pointsToMesh[Subdivide[0, L, 40] /. subs]];
bmesh = ToBoundaryMesh[mesh];
groups = bmesh["BoundaryElementMarkerUnion"];
temp = Most[Range[0, 1, 1/(Length[groups])]];
colors = ColorData["BrightBands"][#] & /@ temp
bmesh["Wireframe"["MeshElementStyle" -> FaceForm /@ colors]]

As you can see, the structured mesh captures these sharp features at the end caps.
Solve the Eigensystem
To solve the Eigensystem, you need to make a slight modification to NDEigensystem, as shown below:
{vals, funs} =
  NDEigensystem[
   stressOperator[169*10^9, 0.3] +
     rho {D[u[t, x, y, z], {t, 2}], D[v[t, x, y, z], {t, 2}],
       D[w[t, x, y, z], {t, 2}]} == {0, 0, 0}, {u, v, w},
   t, {x, y, z} ∈ mesh, 15];

Visualizations
DensityPlot3D
DensityPlot3Dis probably not the most efficient way to view objects with thin walls for three reasons. First, DensityPlot3D requires much memory versus other possible visualization techniques. Second, resolving thin regions becomes doubly difficult. Third, it can take a long time. The following code produces a density plot that looks superior to that in the OP, but in my opinion, it is not a great visualization.
DensityPlot3D[Re[funs[[15, 3]][x, y, z]], {x, y, z} ∈ mesh,
 ColorFunction -> "Rainbow", Boxed -> False,
 PlotLabel -> Row[{"f = ", Abs[vals[[15]]]/2/Pi}],
 BoxRatios -> Automatic,
 RegionFunction ->
  Function[{x, y, z,
    f}, (x^2 + y^2 <= router^2 || x^2 + y^2 >= rinner^2) &&
    0 <= z <= l], PlotPoints -> 200, PlotLegends -> Automatic,
 AxesLabel -> {"x", "y", "z"}]

SliceDensityPlot3D
SliceDensityPlot3Dshould be the function to create clip planes and iso-surfaces. As you can see, if you put exact values for the curved surfaces, the results are not very good.
Show[SliceDensityPlot3D[
  Re[funs[[15, 3]][x, y, z]], {x^2 + y^2 == rinner^2,
   x^2 + y^2 == router^2, z == 0, z == l}, {x, y, z} ∈ mesh,
  ColorFunction -> "Rainbow", Axes -> False,
  PlotLabel -> Row[{"f = ", Abs[vals[[15]]]/2/Pi}],
  BoxRatios -> Automatic, PlotPoints -> {100, 100, 40},
  PlotLegends -> Automatic], Boxed -> False]

If you put a slight offset in for each of the radii, the results are much better. However, if you look closely, you can see a slight offset at the end caps.
Show[SliceDensityPlot3D[
  Re[funs[[15, 3]][x, y, z]], {x^2 + y^2 == 1.01 rinner^2,
   x^2 + y^2 == 0.99 router^2, z == 0, z == l}, {x, y, z} ∈
   mesh, ColorFunction -> "Rainbow", Axes -> False,
  PlotLabel -> Row[{"f = ", Abs[vals[[15]]]/2/Pi}],
  BoxRatios -> Automatic, PlotPoints -> {100, 100, 40},
  PlotLegends -> Automatic], Boxed -> False]

The advantage of this method is that it is much faster than a volumetric rendering. The visualization has a much higher resolution and better contrast on the boundary surfaces than the volumetric rendering.
Custom plotting
One advantage of using a structured mesh is selecting nodal points where the interpolation functions are interpreted. First, it will create some helper functions to create a variety of DensityPlot's.
Helper functions
(*Helper functions for various ListDensityPlots*)
eps = 0.000001;
epsf = eps/1000;
fPos[x_, v_] := Flatten@Position[x, _?(Abs[# - v] < eps &), 1]
(*Radial ListDensityPlot by index*)
Clear[ldprfn]
ldprfn[ridx_, cf_ : "Rainbow", opac_ : 0.75] :=
 Module[{cd, ids, data, app, ldpg, ldpo, ldp, gc, gco, cylo, cyl,
   vcpos},
  cd = If[StringQ[cf], ColorData[cf], cf];
  ids = ridxfn[ridx];
  data = {θs[[ids]], zs[[ids]], zvals[[ids]]} // Transpose;
  app = MapAt[-# &, data[[fPos[θs[[ids]], Pi]]], {All, 1}];
  data = Join[data, app];
  ldpg = ListDensityPlot[data, ColorFunction -> GrayLevel,
    PlotRange -> zmnmx];
  vcpos =
   Position[ldpg, HoldPattern[VertexColors -> _]]~Join~{2} // Flatten;
  ldpo = ReplacePart[ldpg, vcpos -> (cd /@ ldpg[[## & @@ vcpos]])];
  ldp = ReplacePart[ldpg,
    vcpos -> (Opacity[opac, #] & /@ (cd /@ ldpg[[## & @@ vcpos]]))];
  gco = First@Cases[ldpo, _GraphicsComplex, Infinity];
  gc = First@Cases[ldp, _GraphicsComplex, Infinity];
  cylo = Graphics3D[
    gco /. {θ_, z_} /;
       AllTrue[{θ, z},
        Developer`RealQ] :> {uniqRs[[ridx]] Cos[θ],
       uniqRs[[ridx]]  Sin[θ], z}];
  cyl = Graphics3D[
    gc /. {θ_, z_} /;
       AllTrue[{θ, z},
        Developer`RealQ] :> {uniqRs[[ridx]] Cos[θ],
       uniqRs[[ridx]]  Sin[θ], z}];
  <|"Data" -> data, "DensityPlot" -> ldp, "DensityPlotOpaque" -> ldpo,
    "CylDensityPlot" -> cyl, "CylDensityPlotOpaque" -> cylo|>
  ]
(*Z level ListDensityPlot by index*)
Clear[ldpzfn]
ldpzfn[zidx_, cf_ : "Rainbow", opac_ : 0.75] :=
 Module[{cd, ids, data, dataxy, app, lp, ldpg, ldpo, ldp, gc, gco,
   cylo, cyl, vcpos, z},
  cd = If[StringQ[cf], ColorData[cf], cf];
  ids = zidxfn[zidx];
  data = {xs[[ids]], ys[[ids]], zvals[[ids]]} // Transpose;
  ldpg = ListDensityPlot[data, ColorFunction -> GrayLevel,
    PlotRange -> zmnmx,
    RegionFunction ->
     Function[{x, y, z}, 1.0001*rinner <= Norm[{x, y}] <= router]];
  vcpos =
   Position[ldpg, HoldPattern[VertexColors -> _]]~Join~{2} // Flatten;
  ldpo = ReplacePart[ldpg, vcpos -> (cd /@ ldpg[[## & @@ vcpos]])];
  ldp = ReplacePart[ldpg,
    vcpos -> (Opacity[opac, #] & /@ (cd /@ ldpg[[## & @@ vcpos]]))];
  gco = First@Cases[ldpo, _GraphicsComplex, Infinity];
  gc = First@Cases[ldp, _GraphicsComplex, Infinity];
  cylo = Graphics3D[
    gco /. {x_, y_} /; AllTrue[{x, y}, Developer`RealQ] :> {x, y,
       uniqZs[[zidx]]}];
  cyl = Graphics3D[
    gc /. {x_, y_} /; AllTrue[{x, y}, Developer`RealQ] :> {x, y,
       uniqZs[[zidx]]}];
  <|"Data" -> data, "DensityPlot" -> ldp, "DensityPlotOpaque" -> ldpo,
    "CylDensityPlot" -> cyl, "CylDensityPlotOpaque" -> cylo|>
  ]

Collect solution data and defined functions pick off radial and Z coordinates
(*Eigen mode*)
mode = 15;
(*Get coordinates and solution data*)
crd = mesh["Coordinates"];
{xs, ys, zs} = crd // Transpose;
zvals = Re[funs[[mode, 3]]["ValuesOnGrid"]];
zmnmx = MinMax[zvals];
(*Create substitutions to map between cylindrical and Cartesian \
coordinates*)
cart2cyl = {x_, y_, z_} ->
   CoordinateTransform["Cartesian" -> "Cylindrical", {x, y, z}];
cyl2cart = {r_, θ_, z_} ->
   CoordinateTransform[
    "Cylindrical" -> "Cartesian", {r, θ, z}];
cylcrds = crd /. cart2cyl;
{rs, θs, zs} = cylcrds // Transpose;
(*Use nearest functions to pick off selected radial and Z coordinates*)
rnf = Nearest[rs -> "Index"];
uniqRs = Union[Round[rs, epsf]];
ridxfn = rnf[uniqRs[[#]], {All, eps}] &;
znf = Nearest[zs -> "Index"];
uniqZs = Union[Round[zs, epsf]];
zidxfn = znf[uniqZs[[#]], {All, eps}] &;
(*A custom highly banded color map*)
img = Uncompress[Import["https://pastebin.com/raw/X1RTREmc"]];
dims = ImageDimensions[img];
colors2 =
  RGBColor[#] & /@
   ImageData[img][[IntegerPart@(dims[[2]]/2), 1 ;; -1]];

Create cylindrical bounding surface with custom color map
We will now conduct tests on our workflow using a custom color map with a highly banded structure. The following will show the bounding surfaces with both opaque and translucent coloring.
cf = (Blend[colors2, #] &);
(*cf = "Rainbow";*)
ldri = ldprfn[1, cf];
ldro = ldprfn[5, cf];
ldzb = ldpzfn[1, cf];
ldzt = ldpzfn[uniqZs // Length, cf];
Show[{ldri["CylDensityPlotOpaque"], ldro["CylDensityPlotOpaque"],
  ldzb["CylDensityPlotOpaque"], ldzt["CylDensityPlotOpaque"]},
 Boxed -> False]
Show[{ldri["CylDensityPlot"], ldro["CylDensityPlot"],
  ldzb["CylDensityPlot"], ldzt["CylDensityPlot"]}, Boxed -> False]

These results appear to work as intended in the highly banded color map gives a nice banded structure without resorting to mesh lines or a contour plot.
Two-dimensional ListDensityPlot
Fundamentally, the basic approach is to take a two-dimensional ListDensityPlot, converted into a GraphicsComplex and perform a 2D to 3D coordinate transformation.
You can see going from the inner wall to the outer wall (left to right) the ListDensityPlot in 2D.
ldprs = ldprfn[#, (Blend[colors2, #] &)] & /@ Range[uniqRs // Length];
GraphicsRow[#["DensityPlotOpaque"] & /@ ldprs, ImageSize -> 1000]

Peeling the onion
With this approach, it is relatively straightforward to create a Manipulate function that will allow one to peel back the outer layers to view the inner layers. An example is shown below:
(* Surface Association for CheckBoxBar *)
rsurfs = Range[uniqRs // Length];
surfaces =
  AssociationThread[rsurfs,
   ldprs[[#]]["CylDensityPlotOpaque"] & /@ rsurfs];
surfaces =
  Append[surfaces, {"top" -> ldzt["CylDensityPlotOpaque"],
    "bot" -> ldzb["CylDensityPlotOpaque"]}];
(* Visualization *)
Manipulate[Show[{
   {Append[choices, {"top", "bot"}] /. surfaces}},
  Boxed -> False], {{choices, rsurfs}, rsurfs, CheckboxBar},
 ControlPlacement -> Top]


text:
Q: Comparing SSID to a string I have trying to do something when I get to know that in my wifilist this SSID is present
My code is somewhat :
List<ScanResult> wifilist = wifi.getScanResults();

for(int i=0;i<wifilist.size();i++){
 if (wifilist.get(i).SSID.equals("Wifi1")){

                        // Do somthing
                      }
}

Where Wifi1 is name of the wifi network.
But I m not able to do so as if it seem wifilist.get(i).SSID isn't able to compare it to "Wifi1". If you can tell me where I am wrong

A:      WifiManager mWifiManager;

   List<ScanResult> mScanResults = mWifiManager.getScanResults();

    for(ScanResult results : mScanResults) {

        Log.d("SSID  result", results.SSID);

        if (results.SSID.equals("WIFI NAME")) {

            break;
        }

    }

A: What does wifilist.get(i).SSID.getClass() say? If it isn't java.lang.String, then you most probably need to call .toString() and you're done.

A: SSID has double quotation marks. Instead of
SSID.equals("Wifi1")

you should use
SSID.equals("\"Wifi1\"")