text:
Q: About definition of Ergodic theorem Let $(X,\Sigma, \mu)$ be a probability space, and $T:X\rightarrow X$ be a measure-preserving transformation. We say $\mu$ is ergodic with respect to $T$ if

for every $E\in \Sigma $ with $T^{-1}(E) = E$, either $\mu(E)=1$ or $0$.

I have a very fundamental problem about this definition:
the result "$\mu(E)=1$ or $0$" does not have any information about $T$ or does not say anything about $T$. So is  the condition "$T^{-1}(E)=E, \forall E\in \Sigma$" necessary?
$T^{-1}(E)=E$ should depend on the choice of $T$; I pick a particular $T$ such that $T^{-1}(E)=E$. However, $T$ does not show up in "$\mu(E)=1$ or $0$"

A: For any $E\in \Sigma$, let $P(E)$ be the implication "$\left(T^{-1}E=E\right)\Rightarrow \left(\mu(E)\in \{0,1\}\right)$". Ergodicity of $\mu$ with respect to $T$ means that fro all $E\in\Sigma$, proposition $P(E)$ is true. Since the first part of the implication involves $T$, the definition of ergodicity also implies $T$.
Note also that "$T^{-1}(E)=E, \forall E\in \Sigma$" does not hold in general. For example, if $\Sigma$ contains the singletons, this would force $T$to be the identity.


text:
Q: a series derived from a holomorphic function converges implies that the coefficients converge to $0$ Let $D=\{z\in\mathbb{C}\mid |z|<2\}$. Let $f:D\setminus\{\frac{i}{2}\}\longrightarrow \mathbb{C}$ be holomorphic with $f(z)=\sum_{n=0}^\infty a_nz^n$ for any $|z|<\frac{1}{2}$. Suppose $a_n\neq 0$ for all $n$. If $\frac{i}{2}$ is a simple pole of $f$, prove that $\lim_{n\to\infty} \frac{a_{n+1}}{a_n}=-2i$.
How to prove?
my attempt: a simple pole means that $\lim_{z\to \frac{i}{2}}(z-\frac{i}{2})f(z)=C\neq 0$. That is, $\lim_{z\to \frac{i}{2},|z|<\frac{1}{2}}(z-\frac{i}{2})\sum_{n=0}^\infty a_nz^n=\lim_{z\to \frac{i}{2},|z|<\frac{1}{2}}\sum_{n=0}^\infty (a_{n+1}-\frac{i}{2}a_n)z^n=C$. But I cannot obtain $\lim_{n\to\infty}a_{n+1}-\frac{i}{2}a_n=0$. How to solve?

A: Hint: if you subtract $c/(z - i/2)$ for some $c$, you get a function that is holomorphic in $D$.

A: Also with the approach taken in the question, $g(z)=(z-\frac i2)f(z)$ is holomorphic in the full disk $D$, so its power series in $z=0$ has a radius of convergence of at least $2$, so that
$$
(a_{n-1}-\tfrac i2a_n)(2-\varepsilon)^n
$$
is bounded for any $ε>0$.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Failed to convert value of type java.util.HashMap to boolean I'm trying to detect the connection state of my app, but this is the Error am facing:
Failed to convert value of type java.util.HashMap to boolean

I am using Firebase. The error is on line:
boolean connected = dataSnapshot.getValue(Boolean.class);

So the Error comes in the OnDataFinishedLoading() method . Data was coming at first, but now I just want to detect the apps network connection. Below is my code:
public class MainActivity extends AppCompatActivity
        implements NavigationView.OnNavigationItemSelectedListener {

    public static String KEY_HEADLINES="headlines";
    public static String KEY_DETAILS="details";

   // private static final String TAG = "Ask Doctor App";

    ProgressBar pb;

   public  List<NewsModel> newslist;

   public NewsAdapter2 adapter;
    private RecyclerView mRecyclerView;

    private DatabaseReference mRef;
    ImageView image_news;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        // call the array list
        newslist = new ArrayList<NewsModel>();

        pb = (ProgressBar) findViewById(R.id.progressBarNews);
        image_news =(ImageView) findViewById(R.id.image_news);
        mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
       mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        //Enabling offline capabilities
        FirebaseDatabase.getInstance().setPersistenceEnabled(true);

         // firebase initialisation......
        mRef =  FirebaseDatabase.getInstance().getReference("News");
        // keep my data synced
        mRef.keepSynced(true);

        OnDataFinishedLoading();

        // load data

        //declare the toolbar
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

     //   ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
        //NetworkInfo netInfo = cm.getActiveNetworkInfo();

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
              /*  if (isOnline()) {

                    Snackbar.make(view, "Refreshing news ....", Snackbar.LENGTH_LONG)
                            .setAction("Thanks.", null).show();
                } else {
                    Snackbar.make(view, "There's a Network problem", Snackbar.LENGTH_LONG)
                            .setAction("", null).show();

                }

                Snackbar.make(view, "Refreshing news ....", Snackbar.LENGTH_LONG)
                        .setAction("Thanks.", null).show();*/
            }
        });

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawer.setDrawerListener(toggle);
        toggle.syncState();

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);

    }

private void OnDataFinishedLoading(){

    mRef.addChildEventListener(new ChildEventListener() {
        @Override
        public void onChildAdded(DataSnapshot dataSnapshot, String s) {

            boolean connected = dataSnapshot.getValue(Boolean.class);
            if(connected) {

                pb.setVisibility(View.INVISIBLE);
                LoadData(dataSnapshot);

            } else{
               Toast.makeText(MainActivity.this,"No Network",Toast.LENGTH_LONG).show();

            }

        }

        @Override
        public void onChildChanged(DataSnapshot dataSnapshot, String s) {
            LoadData(dataSnapshot);
        }

        @Override
        public void onChildRemoved(DataSnapshot dataSnapshot) {

        }

        @Override
        public void onChildMoved(DataSnapshot dataSnapshot, String s) {

        }

        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });

}

    public void LoadData (DataSnapshot dataSnapshot){

        System.out.println(dataSnapshot.getValue());

        NewsModel news_model =dataSnapshot.getValue(NewsModel.class);

        newslist.add(news_model);

        adapter = new NewsAdapter2(MainActivity.this, newslist);
        mRecyclerView.setAdapter(adapter);

    }

   /* protected boolean isOnline() {
        ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo netInfo = cm.getActiveNetworkInfo();
        if (netInfo != null && netInfo.isConnectedOrConnecting()) {
            return true;
        } else {
            return false;
        }
    }
*/

    @Override
    public void onBackPressed() {
        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        if (drawer.isDrawerOpen(GravityCompat.START)) {
            drawer.closeDrawer(GravityCompat.START);
        } else {
            super.onBackPressed();
        }
    }

    /*@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }*/

  /*  @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }*/

    @SuppressWarnings("StatementWithEmptyBody")
    @Override
    public boolean onNavigationItemSelected(MenuItem item) {
        // Handle navigation view item clicks here.
        int id = item.getItemId();
        Intent i;
        if (id == R.id.hospitals) {

            i = new Intent(MainActivity.this, HealthCentres.class);
            startActivity(i);

        } else if (id == R.id.doctors) {

            i = new Intent(MainActivity.this, Doctors.class);
            startActivity(i);

        } /*else if (id == R.id.location) {
            i = new Intent(MainActivity.this, Location.class);
            startActivity(i);

        } */else if (id == R.id.tips) {
            i = new Intent(MainActivity.this, Tips.class);
            startActivity(i);

        } /*else if (id == R.id.faq) {

        }
        */
        /*
        else if (id == R.id.suggestions) {

        }
        */
        else if (id == R.id.contacts) {
            i= new Intent(MainActivity.this, ContactUs.class);
            startActivity(i);

        }
        /*
        else if (id == R.id.settings) {

        }
        */
        else if (id == R.id.about) {
            i = new Intent(MainActivity.this, AboutUs.class);
            startActivity(i);

        }

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        drawer.closeDrawer(GravityCompat.START);
        return true;
    }

}

A: Ok, so the core problem you're having is that Firebase is returning a Map, not a Boolean. That's because of the way you have this configured--every time a child is added, you try to look at the DataSnapshot (that's what the listener you setup does), and tries to get a Boolean value out. However, the Snapshot is the child added to the database (and not a boolean) so instead you get a map out.
If all you want to do is verify that a child was added successfully, I'd do the following:
    public void onChildAdded(DataSnapshot dataSnapshot, String s) {

       Object value = dataSnapshot.getValue();

       if(value != null) {
            pb.setVisibility(View.INVISIBLE);
            LoadData(dataSnapshot);
        } else{
           Toast.makeText(MainActivity.this,"No Network",Toast.LENGTH_LONG).show();
        }
    }

However, this isn't really going to solve your network connectivity problem. It'll just do stuff whenever a non-null child gets added to the firebase object, which could happen frequently. Also in LoadData, you don't check to make sure that the object passed in isn't null.


text:
Q: Generating and printing random multiple lists in python I want to generate multiple random lists and print them. How shall I append each list uniquely with every loop? The code below doesn't append the list that is being generated with the empty lists. It simply prints the empty lists.
import numpy as np
a,b,c,d,e=[],[],[],[],[]
for i in range(0,4):
    j=np.random.randint(0,15,size=7)
    [a,b,c,d,e].append(j)
print(a,b,c,d,e)

A:
a,b,c,d,e=[],[],[],[],[]
# ...
[a,b,c,d,e].append(j)

This does not change a, b, c, d, e.
It creates a new list containing a, b, c, d, e, appends j to it, and then discards it.
To append j to each of a, b, c, d, e, use a for loop:
for lst in [a,b,c,d,e]:
    lst.append(j)

A: This will generate a random sequence(list) containing numbers between 0 and 15.
import random

for _ in range(4):
    print(random.sample(range(16),15))

random.sample(population, k)

*

*Return a k length list of unique elements chosen from the population
sequence or set.

*Used for random sampling without replacement.

*If the population contains repeats, then each occurrence is a
possible selection in the sample.


text:
Q: How to make local /etc/group take priority over LDAP when names collide? We have a working LDAP set up. However we hit a problem recently due to some user names and group names existing both in the local files and in LDAP. Specifically the apache user and group existed both in:

*

*/etc/passwd and /etc/group

*LDAP as both user and group

After a recent yum update (CentOS 5), it appeared that the group ID of the process had changed from the value in /etc/group to the value in LDAP (while the user ID remained the ID from /etc/passwd). As some of the files needed by httpd were owned by user root, with group apache (from /etc/group) but not world readable, this caused problems.
Note that we already have nss_initgroups_ignoreusers apache,... in both /etc/ldap.conf and /etc/openldap/ldap.conf. Also, in /etc/nsswitch.conf we have
passwd:     files ldap
group:     files ldap
shadow:     files ldap

and the rest of the normal bits and bobs.
So if a name exists in both LDAP and the local files, is there a way to ensure that the ID from the local files will take precedence over the ID in LDAP?

A: I don't know if it's a typo in your example but the group database is called group and not groups.
You should be able to force the search to stop after a successful lookup e.g.
passwd:    files [SUCCESS=return] ldap
group:     files [SUCCESS=return] ldap

The above should be the deafult action anyway so you should confirm that what you are looking for really is in the files.

NOTES
         Within each process that uses nsswitch.conf, the entire  file
  is  read
         only  once;  if  the  file  is later changed, the process will
  continue
         using the old configuration.


text:
Q: Position imageButtons near a certain image I have a problem with the positioning of ImageButtons near a certain image due to quite a lot of  device screen sizes. That is possible to position everything for 1 or 2 screen sizes but no more because it becomes to locate in the wrong place. I have looked for any solution for this issue and found that it is possible to optimaze all imagesdistances programmatically but a lot of programmmatical properties require 11 API for it. My app should work with 2.2, 2.3 versions too. Another solution is the creating of layout qualifiers but there is some screen sizes where my imageButtons position a bit wrongly and this way demand to create a lot of files, folders. Could you recommend me something interesting in this issue? Something what is more optimal and doesnt eat device performance too much. I try to realize this picture http://s018.radikal.ru/i507/1209/07/e3f1024a5780.jpg
<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rlInjury"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:padding="10dp" >

<ImageView
    android:id="@+id/imMonkey"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="fitCenter"
    android:scaleX="0.8"
    android:scaleY="0.8"
    android:src="@drawable/monkey" />

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical" >

        <ImageButton
            android:id="@+id/ib1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter"
            android:src="@drawable/pointer1" />

        <ImageButton
            android:id="@+id/ib2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter"
            android:src="@drawable/pointer3" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:orientation="vertical" >

        <ImageButton
            android:id="@+id/ib4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter"
            android:src="@drawable/pointer2" />

        <ImageButton
            android:id="@+id/ib5"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:scaleType="fitCenter"
            android:src="@drawable/pointer2" />
    </LinearLayout>
</LinearLayout>

A: In My opinion you should create layout (xml) file for each screen size devices like  layout-small,layout-large,layout-medium.I think there is not such a method.


text:
Q: Platform issue in require('os') I have created an Ionic 3(A5) app. I am running this as node-webkit (NW.JS) app on Mac. If I write inside index.html script tag and check, require('os') platform returns 'darwin' and require('fs') returns full set of object correctly. But if I write same script inside a .ts file - require('os') platform returns 'browser' and require('fs') returns empty object.
I am using @types/node in devDependencies.
Code inside index.html -
 var os = require('os');
 var fs = require('fs');
 console.log('Log from index.html');
 console.log('platform = ' + os.platform());
 console.log('fs = ');
 console.log(fs);

Code inside app.component.ts -
var os = require('os');
var fs = require('fs');
console.log('Log from app.component.ts');
console.log('platform = ' + os.platform());
console.log('fs = ');
console.log(fs);

A: Based on a reply from The Jared Wilcurt @TheJaredWilcurt on gitter.im,
Node and Chromium don't know what a TS file is. you need to use something to transpile it to code that can actually be ran. TS is a meta-language, like Markdown, Sass, HAML, CoffeeScript, JSX, etc. Node only understands JavaScript, Chromium only understands HTML, CSS, and JS.
If you are using something to transpile it and it alters your require statements, then that is the problem. You should inspect the actual code you are telling the environment to run.
This was happening because the Ionic transpiler was changing the code in some way. I changed the code
from
var os = require('os');
var fs = require('fs');

to
var os = nw.require('os');
var fs = nw.require('fs');

Now the only problem was that TypeScript compiler was not recognizing 'nw' as it was supposed to come at runtime. I have added
declare var nw: any;

on top.
All fine now.


text:
Q: Would a mini-blackhole collision with Earth cause heating? Let's forget about the probability of this event. I am a mad scientist on the Moon, I created a micro black hole of the diameter $r=0.5cm$. I have to be fast before it evaporates due to Hawking radiation, but before shooting it to the Earth, doubt stops me.
As soon as my blackhole reaches the ground (and even before), it starts sucking material. Everything it "touches" would disappear under the event horizon. It couldn't create shockwaves and alike. How could then it produce the massive blast of heat and destruction it supposed to?
I consider two scenarios:

*

*The black hole travels to the Earth with relatively low speed. This way the (zero) momentum of the material it sucks during interaction would slow it down enough to finally stop. After that, it would slowly but surely consume the whole Earth. This is the less interesting problem therefore.

*The black hole hits Earth with a significant portion of light speed. It wouldn't even bother with the sucked material, even the whole planet couldn't stop it. Speaking of an asteroid, this would be the holly way of total destruction. But I have an event horizon...
So, there is the question:
In both cases, would it, and if, by what effect and how much would the black hole heat up the impact zone?
I have some theories. Maybe the gravitational turbulence the encounter causes locally would cause enough heat to be destructive. This seems to work only for the first case: a speeding hole would have little time to accelerate the ground material. Maybe the material it sucks up would emit strong enough radiation. Or the collision's energy would indeed only increase the black hole's mass, and I would only get a neat 0.5cm wide hole in the ground with slowly (?) rising diameter. (In this case, I'd wonder if any friction-like phenomena would occur apart from the momentum of sucked material...)
Note: I am not interested in the effects of Hawking radiation of the black hole, though I don't know how significant would it be. If it is so big it makes the neglection unrealistic, feel free to produce a bigger mini-blackhole.

A: A black hole with radius $r~=~.5cm$ $=~2GM/c^2$ leads to the mass
$$
M~=~\frac{rc^2}{2G}~=~3.38\times 10^{24}kg.
$$
This is nearly the mass of the Earth. This is not a microblack hole, but a sort of midi-mini-black hole. If the moon were a black hole it would have a Hawking radiation temperature equal to the CMB background. This black hole would be colder. So Hawking radiation would not be a problem with respect to this black hole. However, the gravitation of the black hole would be significant and the collision would be a bit like a bullet smashing a watermelon to bits.


text:
Q: Jquery check all dynamic checkboxlist in MVC view Recently I created this dynamic checkboxlist and display them in C# MVC Razor view.

    @for (int i = 0; i < Model.sites.Count; i++)
    {

            @Html.CheckBoxFor(m => m.sites[i].IsCheck)
            @Html.LabelFor(m => m.sites[i].IsCheck, Model.sites[i].SiteName)
            @Html.HiddenFor(m => m.sites[i].SiteId)
            @Html.HiddenFor(m => m.sites[i].SiteName)

        for (int j = 0; j < Model.sites[i].Roomz.Count; j++)
        {
            @Html.CheckBoxFor(m => m.sites[i].Roomz[j].IsCheck)
            @Html.LabelFor(m => m.sites[i].Roomz[j].IsCheck, Model.sites[i].Roomz[j].RoomName)
            @Html.HiddenFor(m => m.sites[i].Roomz[j].RoomId)
            @Html.HiddenFor(m => m.sites[i].Roomz[j].RoomName)
        }
    }

below image is the display of the checkboxes

How do i use jquery on check the sites.ischeck to check all those sub-item under the same sites? example check CO2 will also check suite 1&2

A: Modify the html so that you can use a relative selector including adding class names to the checkboxes.

    @for (int i = 0; i < Model.sites.Count; i++)
    {

            @Html.CheckBoxFor(m => m.sites[i].IsCheck, new { class = "parent" })
            @Html.LabelFor(m => m.sites[i].IsCheck, Model.sites[i].SiteName)
            @Html.HiddenFor(m => m.sites[i].SiteId)
            @Html.HiddenFor(m => m.sites[i].SiteName)

 // suggest you style this to give a margin-left so its indented relative to the parent
                for (int j = 0; j < Model.sites[i].Roomz.Count; j++)
                {
                    @Html.CheckBoxFor(m => m.sites[i].Roomz[j].IsCheck, new { class = "child" })
                    @Html.LabelFor(m => m.sites[i].Roomz[j].IsCheck, Model.sites[i].Roomz[j].RoomName)
                    @Html.HiddenFor(m => m.sites[i].Roomz[j].RoomId)
                    @Html.HiddenFor(m => m.sites[i].Roomz[j].RoomName)
                }

    }

Then you can handle the .change() event of the 'parent' checkbox and get the 'child' checkboxes within the same
 element
$('.parent').click(function() {
    var isChecked = $(this).is(':checked');
    var children = $(this).closest('li').find('.child');
    $.each(children, function(index, item) {
        $(this).prop('checked', isChecked);
    });
});

You will probably also want to handle the the child checkboxes as well, so that if you uncheck any child, the parent will also be unchecked, or if you check a child, and all the children are also checked, the the parent will be checked.
$('.child').click(function () {
    var parent = $(this).closest('li').find('.parent');
    var isChecked = $(this).is(':checked');
    if (!isChecked) {
        // the parent must be unchecked
        parent.prop('checked', false);
    } else {
        // check if all siblings have the same checked status
        var siblings = $(this).siblings('.child');
        var total = siblings.length;
        var matches = siblings.filter(function () {
            return $(this).prop('checked') == isChecked;
        }).length;
        if (matches === total) {
            parent.prop('checked', isChecked);
        }
    }
})

A: i think you are doing it i wrong way. Rather then this you can use this code :

@for (int i = 0; i < Model.sites.Count; i++)
{

        @Html.CheckBoxFor(m => m.sites[i].IsCheck)
        @Html.LabelFor(m => m.sites[i].IsCheck, Model.sites[i].SiteName)
        @Html.HiddenFor(m => m.sites[i].SiteId)
        @Html.HiddenFor(m => m.sites[i].SiteName)

               for (int j = 0; j < Model.sites[i].Roomz.Count; j++)
              {

                   @Html.CheckBoxFor(m => m.sites[i].Roomz[j].IsCheck)
                   @Html.LabelFor(m => m.sites[i].Roomz[j].IsCheck,Model.sites[i].Roomz[j].RoomName)
                   @Html.HiddenFor(m => m.sites[i].Roomz[j].RoomId)
                   @Html.HiddenFor(m => m.sites[i].Roomz[j].RoomName)

              }

    }

Now write this code to select subcategories on checkbox change:
    $('input[type="checkbox"]').change(function(){
      if($(this).prop('checked')==true)
        {
          if($(this).find('ul').length>0)//check if child is present or not
            {
              $(this).find('ul li input[type="checkbox"]').each(function(){
                 $(this).prop('checked',true);
             });

            }

         }

    });


text:
Q: How to see the actual configuration values for apache cassandra in cqlsh? This is what I have in cassandra.yaml
prepared_statements_cache_size_mb: 500MB

Is it possible to see the actual value of that variable once you're in cqlsh?

A: Since Cassandra 4.0 you'll able to do that by reading from system_views.settings table.
See the blog post from TLP on topic of virtual tables...

A: Because CQL statements are sent to the cluster (which should be three or more nodes), you can't use CQL to read settings on an individual node.  The value for prepared_statements_cache is just for that node.
You could use JMX to read org.apache.cassandra.config.Config on a node, including prepared_statements_cache_size_mb.


text:
Q: Is there a way to conditionally ignore a certain JPA entity column when returning the results set There is this JPA Entity (let's call it Foo) that I use to display on the FrontEnd. The Entity is linked to another entity by a join (Let's call it Bar).
So the backstory here is that I don't need Bar in the FrontEnd call (When calling the Foo Entity/ties), I only need it for a BackEnd call (When calling the Foo Entity/ties). Is there a way to conditionally exclude the joined Bar entity when calling Foo entities via the JPA FooRepository?
PS: Let's say one Foo entity is linked to a 1000 Bar entities and I don't want it to delay displaying in the FrontEnd because of entities that are not going to be useful in the FrontEnd.
The below is the JPA Entity for Foo
  public class Foo implements Serializable {

    @Id
    @Column(name = "id")
    private BigInteger id;

    @Column(name = "name")
    private String name;

    @OneToMany(cascade = CascadeType.ALL)
    @JoinColumns({
            @JoinColumn(name = "id" , referencedColumnName = "foo_id")
    })
    private List<Bar> barList;

 }

And this is the JPA Entity for Bar

  public class Bar implements Serializable {

    @Id
    @Column(name = "key")
    private BigInteger key;

    @Column(name = "foo_id")
    private BigInteger fooId;

    @Column(name = "back_code")
    private String backCode;

    @Column(name = "date_cap")
    private Date dateCap;

    @Column(name = "hash")
    private String hash;

 }

Below is the JPA Repository for Foo, with no custom methods, I am only using findAll() and findById()
public interface FooRepository extends JpaRepository<Foo, BigInteger>{
}

A: Mark barList with FetchType.Lazy
@OneToMany(fetch=FetchType.LAZY, ...)

That will make it not load the barList by default.
In the method where you want to load barList you access the list somehow, for instance with calling its size()
@Transactional
public Foo getFullyPopulatedFoo(BigInteger key) {
  var foo = fooRepo.findById(key)
  foo.getBarList().size(); // may cause error if foo was not found
  return foo;
}

or by having a separate method to return its barList.
Notice that loading the barList need to be done within the same transaction as fetching Foo, for instance in a service method.
@Transactional
public List<Bar> getBarsFromFoo(BigInteger key) {
  return fooRepo.findById(key).getBarList(); // may cause error if not found
}

What to consider is if it would be better to remap Foo / Bar to some sort of DTO before leaving the service/transaction layer since if you return Foo without populating barList, then you return an incomplete entity that may or may not have entries in the database but not in the entity you have returned.


text:
Q: how to fire change event on select emberjs The behavior that i want is when changing the select is to save it's model
I though about using observable, but i have another problem
my view looks something like this
{{#each item in model.Items}}

  {{view Ember.Select
    content=typesLookup
    selection=type
    prompt="Select Type"
  }}

{{/each}}

so if i went with the observables solution, what i want is to also know the specific item that has changed to update it

A: add the observer and selection on an itemController.
App.FooController = Em.ObjectController.extend({
  type:undefined,
  watchType: function(){
    console.log('this model changed', this.get('model'));
  }.observes('type')
});

{{#each item in model.Items itemController='foo'}}

    {{view Ember.Select
      content=typesLookup
      selection=item.type
      prompt="Select Type"
    }}

{{/each}}


text:
Q: MVC3 - posting byte array to a controller - Database RowVersion I am working on an MVC3 application.  My client side ViewModel contains a SQL Server RowVersion property, which is a byte[]. It is rendered as an Object array on the client side.  When I attempt to post my view model to a controller, the RowVersion property is always null.
I am assuming that the Controller serializer (JsonValueProviderFactory) is ignoring the Object array property.
I have seen this blog, however this does not apply, as I am posting JSON and not the form markup:
http://thedatafarm.com/blog/data-access/round-tripping-a-timestamp-field-with-ef4-1-code-first-and-mvc-3/
My view renders my viewmodel like so:
<script type="text/javascript">
  var viewModel = @Html.Raw( Json.Encode( this.Model ) );
</script>

I then post the viewModel to the controller like so:
    var data = {
        'contact': viewModel
    };

    $.ajax({
        type: 'POST',
        url: '/Contact/Save',
        contentType: "application/json; charset=utf-8",
        data: JSON.stringify(data),
        dataType: 'json',
        success: function (data) {
            // Success
        },
        error: function (XMLHttpRequest, textStatus, errorThrown) {
            alert(XMLHttpRequest.responseText);
        }
    });

Here is my action in the controller:
  [HttpPost]
  public JsonResult Save(Contact contact) {
     return this.Json( this._contactService.Save( contact ) );
  }

UPDATE: based on Darin's answer.
I was hoping for a cleaner solution, but since Darin provided the only answer, I will have to add a custom property that will serialize my byte[] "row_version" property to a Base64 string.  And when the Base64 string is set to the new custom property, it converts the string back to a byte[].  Below is the custom "RowVersion" property that I added to my model:
  public byte[] row_version {
     get;
     set;
  }

  public string RowVersion {
     get {

        if( this.row_version != null )
           return Convert.ToBase64String( this.row_version );

        return string.Empty;
     }
     set {

        if( string.IsNullOrEmpty( value ) )
           this.row_version = null;
        else
           this.row_version = Convert.FromBase64String( value );
     }
  }

A:
My client side ViewModel contains a SQL Server RowVersion property, which is a byte[]

Make it so that instead of a byte[] your view model contains a string property which is the base64 representation of this byte[]. Then you won't have any problems roundtripping it to the client and back to the server where you will be able to get the original byte[] from the Base64 string.

A: Json.NET automatically encodes byte arrays as Base64.
You can use JsonNetResult instead of JsonResult:
from https://gist.github.com/DavidDeSloovere/5689824:
using System;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

public class JsonNetResult : JsonResult
{
    public override void ExecuteResult(ControllerContext context)
    {
        if (context == null)
        {
            throw new ArgumentNullException("context");
        }

        var response = context.HttpContext.Response;

        response.ContentType = !string.IsNullOrEmpty(this.ContentType) ? this.ContentType : "application/json";

        if (this.ContentEncoding != null)
        {
            response.ContentEncoding = this.ContentEncoding;
        }

        if (this.Data == null)
        {
            return;
        }

        var jsonSerializerSettings = new JsonSerializerSettings();
        jsonSerializerSettings.DateFormatHandling = DateFormatHandling.IsoDateFormat;
        jsonSerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
        var formatting = HttpContext.Current != null && HttpContext.Current.IsDebuggingEnabled ? Formatting.Indented : Formatting.None;
        var serializedObject = JsonConvert.SerializeObject(Data, formatting, jsonSerializerSettings);
        response.Write(serializedObject);
    }
}

Usage:
[HttpPost]
public JsonResult Save(Contact contact) {
    return new JsonNetResult { Data = _contactService.Save(contact) };
}


text:
Q: How to Manage Two Drop Down ( A, B) widget ( B's menu item list is based on A's selected value ) in Model Bottom Sheet widget in Flutter? Search Screen Filter options set in Bottom Sheet widget in Flutter.
It has two drop down widgets like A and B
Based on the A selected menu item, API call happen and Need to pass the response again Bottom sheet without recreating the bottom sheet instance( to prevent from losing previous selected data ). Using SetterState Manged the state of Bottom sheet A drop down,
Now how to pass the API response data from main screen to Bottom sheet B drop down menu item?


text:
Q: GNU plot: How to plot a sphere and imported file on the same frame? I am very new to GNU plot. Now, I am trying to plot a sphere and imported .txt file at the same frame. However, I cannot figure out a suitable way. Here are my attempts:

*

*Using only splot.
set parametric ; unset pm3d ; splot [-pi:pi] [-pi/2:pi/2] cos(u)*cos(v), cos(u)*sin(v), sin(u) ; unset parametric ; splot "traj_3dtest.txt" u 2:3:4
But there is only splot "traj_3dtest.txt" u 2:3:4 in output file.

*Using multiplot
set parametric
 splot cos(u)*cos(v), cos(u)*sin(v), sin(u)
 splot "traj_3dtest.txt" u 2:3:4
But the output shows that overlapped two plot, prnt_scrn_1
Here are also extra question: how to plot the spherical "surface"? I mean, I don't want a sphere with contours but a gray surface.
NOTE: the data file format
#      T          X        Y        Z       Vx       Vy       Vz
      1.00   -0.429   -0.847    0.314   -.09755   -.29510   -.15748
      2.00   -0.429   -0.848    0.314   -.09752   -.29504   -.15750
      3.00   -0.429   -0.848    0.313   -.09749   -.29497   -.15752
      4.00   -0.429   -0.848    0.313   -.09746   -.29491   -.15755

A: If you want both in the same frame, but not overlapping:
splot cos(u)*cos(v), cos(u)*sin(v), sin(u), "traj_3dtest.txt" u 2:3:4

From your multiplot example, you'd have the two plots with separate axis:
set multiplot layout 2,1
splot cos(u)*cos(v), cos(u)*sin(v), sin(u)
splot "traj_3dtest.txt" u 2:3:4

or
set multiplot

set origin 0,0.5
set size 1,0.5
splot cos(u)*cos(v), cos(u)*sin(v), sin(u)

set origin 0,0
set size 1,0.5
splot "traj_3dtest.txt" u 2:3:4


text:
Q: What is the power of a three phase circuit? P = sqrt(3)*U * I * cos(f) is the real power for a symmetric load (U and I are RMS values of voltage and current of a single load), but what about generators?Do they have to have equal electromotive forces too?

A: Neither loads nor generators "have to have" symmetric or equal electromotive forces, but it is desirable for economic utilization of equipment for the loads and sources to be symmetric. It is also less complicated to calculate power is everything is symmetric. The formula cited in the question applies only to balanced (symmetric) systems.
If the load or source is not balanced, the two-wattmeter method can be used to measure the power. The two-wattmeter method can be employed to measure the power in a 3 phase, three wire, star or delta connected, balanced or unbalanced load. The total power absorbed by the three loads, is equal to the sum of the powers measured by the two wattmeters.
The method of symmetrical components is used to simplify the analysis of three-phase unbalanced systems. The method involves converting a three-phase unbalanced system into two sets of balanced phasors and a set of single-phase phasors. These sets of phasors are called the positive-, negative-, and zero-sequence symmetrical components.
The two-wattmeter method and the method of symmetrical components are derived and described in detail in course notes and reference material that can be found on the internet as well as in text books that can be found in libraries.

A: Don't know if this will help as your question is still very vague to me, but you can let me know.
Remember the general power equation measured in Watts, (P= voltage x current), where the total power P is a product of the voltage and the current. This can be applied to find the power PRODUCED by a voltage source e.g. a generator, or the power CONSUMED by a load e.g. a heater. It does not matter if power is delivered or consumed, it is just a measurement. However this formula is generally more useful for DC circuits.
But your mentioned formula (P= 1.73 x V x I x p.f) is for calculating 3 phase AC power, hence the 1.73 constant (sqrt of 3) and the power factor (p.f). As you have sort of discovered, this equation requires all voltages, current and impedances to be reasonably balanced. If load impedances are different, the generator output voltages will be different and your formula cannot be used accurately. What you could do is work out the total power per phase by removing the 1.73 (sqrt of 3) from the equation, giving you the power per phase (P= V x I x p.f). Then adding the 3 different powers together will give you the total 3 phase power either DELIVERED from source or CONSUMED by the load (whatever you are trying to work out, remembering the power factors will be different for the genset and the load).
On a side note, the output voltage of a generator depends on the load connected. A generator with a balanced load will have identical output voltages (ignoring synchronous reactance variances of the windings). Now a generator with an unbalanced load connected, will NOT have identical output voltages as the current drawn will be different, producing different internal voltage drops. To work out power in this case, each phase must be treated as a single phase load (be careful with generator & load winding configurations as this can complicate it slightly).
As you stated in your question, these must be RMS values for your mentioned equation to stand true.
Also it may help if you do some background research on how 3 phase generators generate voltage, and how phase voltages may vary depending on phase loading. This is another topic which requires too much explanation in this question, but feel free to post another question if need be.


text:
Q: Why Javascript ===/== string equality sometimes has constant time complexity and sometimes has linear time complexity? After I found that the common/latest Javascript implementations are using String Interning for perfomance boost (Do common JavaScript implementations use string interning?), I thought === for strings would get the constant O(1) time. So I gave a wrong answer to this question:
JavaScript string equality performance comparison
Since according to the OP of that question it is O(N), doubling the string input doubles the time the equality needs. He didn't provide any jsPerf so more investigation is needed,
So my scenario using string interning would be:
var str1 = "stringwithmillionchars"; //stored in address 51242
var str2 = "stringwithmillionchars"; //stored in address 12313
The "stringwithmillionchars" would  be stored once let's say in address 201012 of memory
and both str1 and str2 would be "pointing" to this address 201012. This address could then be determined with some kind of hashing to map to specific locations in memory.
So when doing
"stringwithmillionchars" === "stringwithmillionchars"
would look like
getContentOfAddress(51242)===getContentOfAddress(12313)
or 201012 === 201012
which would take O(1)/constant time
JSPerfs/Performance updates:
JSPerf seems to show constant time even if the string is 16 times longer?? Please have a look:
http://jsperf.com/eqaulity-is-constant-time
Probably the strings are too small on the above:
This probably show linear time (thanks to sergioFC) the strings are built with a loop. I tried without functions - still linear time / I changed it a bit http://jsfiddle.net/f8yf3c7d/3/ .
According to https://www.dropbox.com/s/8ty3hev1b109qjj/compare.html?dl=0 (12MB file that sergioFC made) when you have a string and you already have assigned the value in quotes no matter how big the t1 and t2 are (e.g 5930496  chars), it is taking it 0-1ms/instant time.
It seems that when you build a string using a for loop or a function then the string is not interned. So interning happens only when you directly assign a string with quotes like var str = "test";

A: According to the ECMAScript 5.1 Specification's Strict Equal Comparison algorithm, even if the type of Objects being compared is String, all the characters are checked to see if they are equal.

*If Type(x) is String, then return true if x and y are exactly the same sequence of characters (same length and same characters in corresponding positions); otherwise, return false.

Interning is strictly an implementation thingy, to boost performance. The language standard doesn't impose any rules in that regard. So, its up to the implementers of the specification to intern strings or not.

A: Based on all the Performance Tests (see original post) for strings a and b the operation a === b takes:

*

*constant time O(1) if the strings are interned. From the examples it seems that interning only happens with directly assigned strings like var str = "test"; and not if you build it with concatenation using for-loops or functions.

*linear time O(N) since in all the other cases the length of the two strings is compared first. If it is equal then we have character by character comparison. Else of course they are not equal. N is the length of the string.

A: First of all, it would be nice to see a JSPerf test which demonstrates the claim that doubling the string size doubles the execution time.
Next, let's take that as granted. Here's my (unproven, unchecked, and probably unrelated to reality) theory.
Compairing two memory addresses is fast, no matter how much data is references. But you have to INTERN this strings first. If you have in your code
var a = "1234";
var b = "1234";

Then the engine first has to understand that these two strings are the same and can point to the same address. So at least once these strings has to be compared fully. So basically here are the following options:

*

*The engine compares and interns strings directly when parsing the code. In this case equals strings should get the same address.

*The engine may say "these strings are two big, I don't want to intern them" and has two copies.

*The engine may intern these strings later.

In the two latter cases string comparison will influence the test results. In the last case - even if the strings are finally interned.
But as I wrote, a wild theory, for theory's sage. I'd first like to see some JSPerf.


text:
Q: How to send a JSON as a body to a request in place of a xml ios objective c I was sending xml file as a body before stated as follows:
[[NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><vs:ClientID version=\"0.4\" xmlns:vs=\"http://www.@@@@@@.com/schemas/store\">%@</vs:ClientID>", openUDID] UTF8String];

Now i need to send the same body as a JSON for the request.
How can i achieve that?

A: you can do this by creating a dictionary of data you want to send
NSMutableDictionary *reqDictionary = [[NSMutableDictionary alloc]init];
[reqDictionary setValue:@"yourValue1" forKey:@"YourKey1"];
[reqDictionary setValue:@"yourValue2" forKey:@"YourKey2"];

NSData *jsonData = [NSJSONSerialization dataWithJSONObject:fieldsArray options:NSJSONWritingPrettyPrinted  error:&error];

NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];

Now the jsonString is the final string you want to post


text:
Q: Viewing a VB6 file in Visual Studio 2010 without trying to "build" it I have a C#/.Net 4.0 project in Visual Studio 2010.    Parts of this project were originally from an old VB6 program that was converted to C#.
Sometimes I need to look at the old VB6 code side-by-side with the C# code, and so it's very convenient to just open and view the file in Visual Studio.   V.S. even  displays comments and keywords in appropriate colors for easy viewing.  To open the VB6 file I'm doing a File>Open>File.   The VB6 file has a .cls extension.
The problem is that when I do that it also tries to do background compilation of it, so as soon as I open it, it registers hundreds of errors because VB6 isn't a supported language and even if I do a Build Solution or Rebuild Solution it includes those results in the build so I can't build my C# project when the VB6 file is open.
1.  Why does it do this, considering that the VB6 file is not part of the current solution or project?
2.  How do I turn it off so I can view the file but not have Visual Studio try to compile it?

A: Why does it do this?
The cls extension is mapped to the Visual Basic language service.  It will interpret any file with that extension as a VB.Net file and process it as such.
The Visual Basic Language service is always compiling files to a degree in the background.  It doesn't actually produce EXE / DLL but will go far enough to provide semantic information to the front end.  This is used in intellisense, code highlighting, error squiggles, etc ...
How do I turn it off?
Unfortunately you can't.  Visual Basic background compilation is not configurable.  Hence any file which it believes to be VB.Net code will be processed in the background and errors will be displayed.
The only way to view it without errors is to rename the file to an extension not thought to be VB.Net code (like txt)


text:
Q: How to Turn on Music (ipod library) on iPhone? I already know how to keep play music at background in my app.
I don't want to know that.
I want this.
how to Automatically turn on ipot music in background & sleep mode at custom time.
it's thought impossible to me.
but that's possible. and no jail break.
i wanna know that.  please help me.

A: Take a look at the following background task guide from the iOS docs
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html
There are restrictions on what can be carried out in the background. Certain apps that support audio, location, and voip are allowed to run in background using the UIBackgroundModes key. With the audio background task, it will not be suspended until the audio session stops.
It seems that you don't want to initiate a session until a certain time. You could potentially look at beginBackgroundTaskWithExpirationHandler: .
Also if you are looking for a timed alarm, you can always attach a different tone to a local notification.
As far as I am aware, there is no "out-of-the-box" way to do what your asking.


text:
Q: How can I implement a generic interface in Rhino JS? I have an application that contains a generic interface:
public interface IMyInterface<T> {
    public int calcStuff(T input);
}

I can clearly implement this in Java:
public class Implementor implements IMyInterface<FooObject>{
    public int calcStuff(FooObject input){ ... }
}

I have found a tutorial on implementing Java non-generic interfaces in Rhino and can verify that it works in my context.
As far as I understand Javascript has no generics due to the dynamic type system and other factors, so Rhino does not provide such a concession in its JS parser. Any attempts to do research lead me to a plethora of results about Rhino mocks generic interfaces but not Rhino JS generic interface implementation.

A: From a Javascript point of few, there are no generics, no interfaces, not even classes. In Javascript you have Objects with functions that may be created from prototypes.
To "implement" a Java interface in Javascript only means, to provide some Javascript object, that has the same function names as the interfaces method names, and these functions have the same number of arguments as the corresponding interface methods.
So to implement the generic example interface you provided, you can write something like this:
myGenericInterfaceImpl = new Object();
// Generic type is supposed to be <String> int calcStuff(String)
myGenericInterfaceImpl.calcStuff = function(input) {
        println("--- calcStuff called ---");
        println("input" + input);
        println("typeof(input):" + typeof(input));

        // do something with the String input
        println(input.charAt(0));
        return input.length();
    }

Here it is assumed, that the intended generic class is of type String.
Now lets say, you have a Java class, that accepts this interface with a generic String type:
public static class MyClass {
    public static void callMyInterface(IMyInterface<String> myInterface){
        System.out.println(myInterface.calcStuff("some Input"));
    }
}

You can then call this method from Javascript like so:
// do some Java thing with the generic String type interface
Packages.myPackage.MyClass.callMyInterface(new Packages.myPackage.IMyInterface(myInterfaceImpl)));

Some background information on the topic
If you are interested in what goes on behind the scenes in Rhino, when implementing a Java interface in Javascript, I recommend to have a look at the following Rhino classes:

*

*https://github.com/mozilla/rhino/blob/master/src/org/mozilla/javascript/jdk13/VMBridge_jdk13.java

*https://github.com/mozilla/rhino/blob/master/src/org/mozilla/javascript/InterfaceAdapter.java
Essentially the static method InterfaceAdapter#create() will call VMBridge#newInterfaceProxy(), which returns a Java Proxy for the interface, that uses an instance of InterfaceAdapter to handle method invocations on your interface. This proxy will map any Java method call on the interface to the corresponding Javascript functions.
 **
 * Make glue object implementing interface cl that will
 * call the supplied JS function when called.
 * Only interfaces were all methods have the same signature is supported.
 *
 * @return The glue object or null if <tt>cl</tt> is not interface or
 *         has methods with different signatures.
 */
static Object create(Context cx, Class<?> cl, ScriptableObject object)

When I first worked with generic interfaces in both Java and Javascript, it also helped me quite a lot to understand what is going on, by step debugging my invocations on the created Rhino proxies (but you will of course need the Rhino source to do that, and setting it up can be a little cumbersome).
Also note, that the default Rhino implementation used by the Java Scripting API does not allow to implement multiple Java interfaces or to extend Java classes. From the Java Scripting Programmer's Guide:

Rhino's JavaAdapter has been overridden. JavaAdapter is the feature by
  which Java class can be extended by JavaScript and Java interfaces may
  be implemented by JavaScript. We have replaced Rhino's JavaAdapter
  with our own implementation of JavaAdapter. In our implementation,
  only single Java interface may be implemented by a JavaScript object.

So if you need these features, you will need to install the original Rhino implementation anyway (which makes it easier to set up the source code).


text:
Q: Subquery returns more than 1 row I have this query:
UPDATE student_info
    set grade = (SELECT tempTable.grade
                     FROM tempTable
                     WHERE student_info.s_id = (SELECT s_id FROM tempTable))

I've also tried the suggested solution here:
http://dev.mysql.com/doc/refman/5.0/en/subquery-errors.html

A: I guess you want:
UPDATE student_info
  JOIN tempTable
    ON tempTable.s_id = student_info.s_id
SET student_info.grade = tempTable.grade

A: Your subquery is returning more than one row, possibly because the JOIN is incorrect.  Try:
UPDATE student_info
    SET grade = (SELECT grade
         FROM tempTable
         WHERE s_id = student_info.s_id)

This of course assumes that tempTable only contains one record per s_id.  If there are more that one then you need to take the TOP 1 ordered by some attribute (latest?  highest?)


text:
Q: Open a pop-up on clicking anchor instead of new window I want to create a link to a pop-up. My problem is, when I click the button for the first time, it will render a pop-up but, when I click it further, it will open new windows.
I want to make sure that, only one pop-up gets rendered and, prevent opening of new windows when clicked multiple times.
Some Text

A: You are trying to open a new window in two different ways, using anchor ('href') and using JavaScript, which may lead to opening of two different windows. In your case, the JavaScript renders the desired popup whereas, the anchor tag opens the new window.
I suggest removing the anchor tag and use mere JavaScript to solve your issue. Please find the below code for your reference.
Some Text


text:
Q: GWT: Loading an Applet inside an application I am trying to integrate an existing applet packaged as jar file in an existing GWT application built with maven.
Now I am not being able to figure out, why the applet class is not being found. A ClassNotFoundException is being thrown when I try to load the applet, saying that the applet class cannot be found.
The GWT Maven project has several modules and the applet I want to integrate is in its own Maven module.
The applet jar file is being signed and packaged as in the final war file for the GWT app by the maven build process.
When I deploy the war file in a Tomcat server I have the following structure under the webapps folder:

webapps
  my_gwt_app
      WEB-INF
        classes
        deploy
        lib
          signed_applet.jar
          other_application_dependency.jar
        views
        web.xml

Here is the HTML result which is being generated by my GWT presenter:
<applet code="com.example.MyApplet.class" archive="/my_gwt_app/WEB-INF/lib/signed_applet.jar" width="1000" height="800" id="my-applet">
    <param name="permissions" value="all-permissions">
</applet>

Could someone tell me what I am doing wrong?
Thanks!

A: Nothing in the lib or classes directory is available to be served to clients that visit the site.  It will be necessary to move the Jar to another place on the server.
In addition to that:
The following path is simply wrong.
archive="/my_gwt_app/WEB-INF/lib/signed_applet.jar"

WEB-INF would typically be the 'root' of the site.

<param name="permissions" value="all-permissions">

Whatever you are trying to achieve there, it will not add permissions to the applet.

A:
I added the "applet" folder under the root folder (http://dev-server.com:8080/my_gwt_app/ not under WEB-INF) and called the URL "http://dev-server.com:8080/my_gwt_app/applet/signed_applet.jar" in the browser. The jar could be found.
But when I configure my applet like
<applet id="my-applet" width="1000" height="800"
     code="com.example.MyApplet.class"" archive="../applet/signed_applet.jar">
</applet>

I still getting the ClassNotFoundException.

A: My problem was the jar file path configuration.
I put it in the my_gwt_app/gwt_module/applet directory and configured the applet with this jar path.
Now it works fine.


text:
Q: ZPL Page Break / Generating Multiple pages I am using ZPL for the first time to generate shipping labels.  I am using a ruby-on-rails gem https://github.com/rjocoleman/labelary to ultimately turn the ZPL sting into a pdf.  I want to create multiple pages, incrementing a variable for each page using a loop until enough pages have been created.  Say the ZPL looks like this:
^XA

^FX Top section with company logo, name and address.
^CF0,60
^FO50,50^GB100,100,100^FS
^FO75,75^FR^GB100,100,100^FS
^FO88,88^GB50,50,50^FS
^FO220,50^FDInternational Shipping, Inc.^FS
^CF0,40
^FO220,100^FD1000 Shipping Lane^FS
^FO220,135^FDShelbyville TN 38102^FS
^FO220,170^FDUnited States (USA)^FS
^FO50,250^GB700,1,3^FS

^FX Second section with recipient address and permit information.
^CFA,30
^FO50,300^FDJohn Doe^FS
^FO50,340^FD100 Main Street^FS
^FO50,380^FDSpringfield TN 39021^FS
^FO50,420^FDUnited States (USA)^FS
^CFA,15
^FO600,300^GB150,150,3^FS
^FO638,340^FDPermit^FS
^FO638,390^FD123456^FS
^FO50,500^GB700,1,3^FS

^FX Third section with barcode.
^BY5,2,270
^FO175,550^BC^FD1234567890^FS

^FX Fourth section (the two boxes on the bottom).
^FO50,900^GB700,250,3^FS
^FO400,900^GB1,250,3^FS
^CF0,40
^FO100,960^FDShipping Ctr. X34B-1^FS
^FO100,1010^FDREF1 F00B47^FS
^FO100,1060^FDREF2 BL4H8^FS
^CF0,190
^FO485,965^FDCA^FS

^XZ

How can I add a page break to the end of the ZPL string, so the loop can create a new identical page after the first one (all in a single zpl string)?
Thanks in advance

A: If your pages are truly identical, you could just use the ^PQ command to set the number of copies you want to print (e.g. ^PQ3 to print three copies). This command must appear before the ^XZ command.
However if your pages aren't identical (maybe you have a sequence number or something), just start a new format by using a new ^XA command after your first page is done.


text:
Q: Example of a non-reflexive Banach space and two sequences Let $(E,\mathcal {A}, \mu ) $ be a finite measure space and $X$ be a Banach space. The set of all Bochner-integrable functions from $E$ into $X$ is denoted by $\mathcal{L}_X^1$.
If $X$ is reflexive, we have the following theorem

Theorem 1
Let $ (f_n)_{n\geq 1} \subset \mathcal {L}_{X}^1$ is a sequence  with : $$\sup_n \int_{E}{\|f_n\| d\mu} < \infty .$$
Then there exist $ h _{\infty} \in  \mathcal {L}_{\mathbb {R}}^1 $ and a sub-sequence $ (g_k)_k $ of $(f_n)_n $  such that for every sub-sequence $ (h_m)_m $ of $(g_k)_k$ : $$ \frac{1}{i}\sum_{j=1}^{i}{h_j(t)}\to   h _{\infty}(t) \text{ weakly in }X\text{ a.e. }$$

Proof of this result exists in the article "Infinite-dimensional extension of a theorem of Komlos" by Erik J. Balder (Theorem A).
If $X$ is not reflexive, we have the following theorem

Theorem 2
Let $ (f_n)_{n\geq 1} \subset \mathcal {L}_{X}^1$ is a sequence  with :
$$
\begin{cases}
\bullet~~ \{f_n(t)\}\text{ is relatively weakly compact a.e.,}\\
\bullet~~ \sup_n \int_{E}{\|f_n\| d\mu} < \infty.\\
\end{cases}
$$
Then there exist $ h _{\infty} \in  \mathcal {L}_{\mathbb {R}}^1 $ and a sub-sequence $ (g_k)_k $ of $(f_n)_n $  such that for every sub-sequence $ (h_m)_m $ of $(g_k)_k$ : $$ \frac{1}{i}\sum_{j=1}^{i}{h_j(t)}\to   h _{\infty}(t) \text{ weakly in }X\text{ a.e. }$$

Proof of this result exists in the article "Infinite-dimensional extension of a theorem of Komlos" by Erik J. Balder (Theorem B).
My problem:
I want an example of a non-reflexive Banach space and two sequences, such that:

*

*The first sequence is bounded in $\mathcal {L}_{X}^1$ but it does not verify the consequence of Theorem 1.

*The second sequence verifying the hypotheses of Theorem 2 and its consequences.


text:
Q: SKPhysicsContact.CollisionImpulse value seems inconsistent I'm creating a game where a player navigates their vessel (SKSpriteNode A) and tries to make contact with a stationary rectangular sprite that is slowly rotating (SKSpriteNode B).  They can navigate their vessel via impulses to speed up, slow down, change directions, etc.  When contact is made, I use the SKPhysicsContact object's "CollisionImpulse" property to judge whether or not the collision was too harsh.  Both objects have the same mass.  The problem is that I'm getting inconsistent results while testing.  I will collide with the object at seemingly the same speed every time and get very different CollisionImpulse values (sometimes around 10, other times around 30).
Since object A is stationary (albeit rotating) and only object B is moving, my assumption is that the CollisionImpulse value will be solely based on the speed of object B at the time of impact, but that does not seem to be the case.
Does object A's rotation affect the CollisionImpulse?  Is there something else that can impact the CollisionImpulse value that I'm missing?


text:
Q: CMake file being added in linking step I have a project with several sub directories I'm compiling with CMake. Sometimes, when I do mkdir build && cd build && cmake .. && cmake --build . I get g++: error: mysub: linker input file not found. For some reason, on the link step, there is a mysub added to the compilation command. It happens after the includes. Sometimes, cleaning the build directory and rerunning cmake .. will fix it, sometimes it won't.
The options I'm telling CMake to use are:
function(addcxxwarn opt)
    add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${opt}>")
endfunction()

addcxxwarn(${name} -Wall)
addcxxwarn(${name} -Wextra)
addcxxwarn(${name} -Wshadow)
addcxxwarn(${name} -Wpointer-arith)
addcxxwarn(${name} -Wcast-qual)
addcxxwarn(${name} -Wswitch-default)
addcxxwarn(${name} -Wcast-align)
addcxxwarn(${name} -Wundef)
addcxxwarn(${name} -Wwrite-strings)
addcxxwarn(${name} -Wconversion)
addcxxwarn(${name} -Wunreachable-code)
addcxxwarn(${name} -pedantic)
addcxxwarn(${name} -funroll-loops)
addcxxwarn(${name} -fno-common)
addcxxwarn(${name} -fno-exceptions)
addcxxwarn(${name} -ffloat-store)
addcxxwarn(${name} -fstrict-aliasing)

link_libraries(gsl gslcblas)
if (UNIX AND NOT APPLE)
    include_directories(/opt/local/include)
    link_directories(/opt/local/lib /opt/local/lib/libgcc)
    link_libraries(gfortran blitz)
elseif (UNIX)
    include_directories(/home/fitzpatrickr/include)
    link_directories(/home/fitzpatrickr/lib)
    link_libraries(gfortran.5)
endif()

add_compile_options("$<$<CONFIG:Debug>:-g;-Og;-Werror>")
add_compile_options("$<$<CONFIG:Release>:-O3>")
add_compile_options("$<$<CONFIG:RelWithDebInfo>:-g;-O3>")

and
configure_file(macro_defs.h.in macro_defs.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

I don't see anywhere else where things are added to link or include options.


text:
Q: Why does the library version get downgraded? I try to compile logback-core in my "common" project.
compile "ch.qos.logback:logback-core:1.2.6"

After running gradle Tasks/help/dependencies this is where the logback-core lib shows up. No other lib is using a different version of logback. So why is it downgraded to .3?
+--- project :common
|    +--- ch.qos.logback:logback-core:1.2.6 -> 1.2.3


text:
Q: Descent direction with symmetrically positive definite hessian matrix and $∇f(x_{k})=0$ with $Hf(xk)d_{k}=−∇f(x_{k})$ I have the following problem which I can't figure out how to solve it.
Let $f:R^n→R$ be twice continuously differentiable. Furthermore, let $d_{k}$ denote the solution of the Newton equation $Hf(xk)d_{k}=−∇f(x_{k})$ for the Hessian matrix $Hf(x_{k})$ and the gradient $∇f(x_{k})$. I must show that $d_{k}$ defines a descent direction at $f$ at $x_{k}$ if $Hf(x_{k})$ is symmetrically positive definite and $∇f(x_{k})=0$.
Can someone help me?

A: We say that $d_k$ is a descent direction if $\langle d_k,\nabla f(x_k)\rangle\leq 0$, this is because a Taylor expansion yields,
$$ f(x_k+d_k) = f(x_k) + \langle d_k,\nabla f(x_k)\rangle + o(\Vert d_k\Vert),$$
thus up to a first-order approximation (which must be treated carefully), $f(x_k+d_k) \leq f(x_k)$, if $\langle d_k,\nabla f(x_k)\rangle\leq 0$.
In your case, $ \langle d_k,\nabla f(x_k)\rangle = - \langle H_f(x_k)\nabla f(x_k),\nabla f(x_k)\rangle$. This quantity is (strictly) negative if $H_f(x_k)$ is (definite) positive, by definition of a positive matrix.
If you want to convince yourself of that, you can diagonalize $H_f(x_k)$ in an orthogonal basis.


text:
Q: How to add mapreduce.reduce.memory.mb property to EMR Cluster in Cloud Formation template? I've been taking a look on how to modify the default values that EMR gives to the cluster depending on the type of machine it is.
In my case, it's a pretty basic setup of a m4.large as master and c3.2xlarge as core and the same for the task. The value that EMR sets for this property in the Task is 2880 (from http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/TaskConfiguration_H2.html). However, I need to increase this default value.
I've been trying to change this default configuration in my Cloud Formation template but for some reason it doesn't accept it. This is what I'm adding to the CF template, I can't seem to find any examples of this online:
    "Configurations" : [{
      "Classification": "mapred-site",
      "Properties": {
        "mapreduce.reduce.memory.mb": "4096"
    }}]

Any help would be greatly appreciated!

A: I had a similar problem, the solution for me was the change the key name from Properties to ConfigurationProperties because the syntax in CF specifically seems to be a bit different than you'd use within EMR's config section.
Try this:
"Configurations": [
  {
      "Classification": "mapred-site",
      "ConfigurationProperties": {
        "mapreduce.reduce.memory.mb": "4096"
      },
      "Configurations": []
  }
]


text:
Q: In my code why date of month are different in Java Date or Calendar? Here is my code.
Calendar calendar= Calendar.getInstance();
    System.out.println("Calender: "+calendar);
    System.out.println("Calender Date: "+calendar.DAY_OF_MONTH);
    System.out.println("Date: "+new Date().getDate());

Output:

In red box Calendar show DAY_OF_MONTH=14, but calendar.DAY_OF_MONTH show 5.

A: Calendar.DAY_OF_MONTH is a constant value, which points at the day of the month field.
To get the actual value, you'd need to call:
calendar.get(Calendar.DAY_OF_MONTH)

A: what you are printing here
System.out.println("Calender Date: "+calendar.DAY_OF_MONTH);

is the value of the constant DAY_OF_MONTH
The correct way to get the value is calendar.get(Calendar.DAY_OF_MONTH)

A: calendar.DAY_OF_MONTH is only a key. The DAY_OF_MONTH from Calendar you get via calendar.get(Calendar.DAY_OF_MONTH)

A: Yes, because you are accessing the constant field value for DAY_OF_MONTH and not the actual day of month.

A: You should use calendar.get(Calendar.DAY_OF_MONTH) instead. You are currently printing out a constant in the Calendar class used to get the field's value in a given instance.

A: System.out.println("Calender Date: "+calendar.DAY_OF_MONTH);
You just get the constant field value for DAY_OF_MONTH  from Calendar,
it's not the actual day ,so you get two different results,
if you want to get the actual day of month,you can do this:
calendar.get(Calendar.DAY_OF_MONTH)


text:
Q: Change folder icon color programmatically I wanted to changed the color of folder icon of windows. Is that possible by any means of shell or just by modifying desktop.ini through C#?

A: If you want to do this programatically, I would start by looking at the Portable Executable file format (Wikipedia entry). The resources section (.rsrc, see section 6.9) should contain the icon. Using this information, you can write a tool to modify the icon.


text:
Q: Azimuth coming back as 0 I am trying to get the azimuth of the users phone when they take a picture. However, when I put the azimuth to the screen just for debugging purposes currently, it always comes back at 0.0. I am new to using Sensors so I am trying to figure this out. My code is
private void dispatchTakePictureIntent() {
    double latitude, longitude;
    if (mGpsLocationTracker.canGetLocation()) {
        latitude = mGpsLocationTracker.getLatitude();
        longitude = mGpsLocationTracker.getLongitude();
    } else {
        latitude = 0;
        longitude = 0;
    }
    Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
        startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);
    }

    Toast.makeText(this, "" + latitude + ", " + longitude, Toast.LENGTH_SHORT).show();

    getDirection ();

    Toast.makeText(this, Float.toString(degree), Toast.LENGTH_SHORT).show();
}

public void getDirection() {
    SensorManager mySensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
    List<Sensor> mySensors = mySensorManager.getSensorList(Sensor.TYPE_ORIENTATION);
    if(mySensors.size() > 0){
        mySensorManager.registerListener(mySensorEventListener, mySensors.get(0), SensorManager.SENSOR_DELAY_UI);
    }
}

/*
DOES NOT WORK. NEED TO FIX
 */
private SensorEventListener mySensorEventListener = new SensorEventListener(){

    @Override
    public void onAccuracyChanged(Sensor sensor, int accuracy) {
        // TODO Auto-generated method stub
    }

    @Override
    public void onSensorChanged(SensorEvent event) {
        // TODO Auto-generated method stub
        float radianValue = Math.round(event.values[0]);
        degree = (float) Math.toDegrees(radianValue);
        if (degree < 0.0f) {
            degree += 360.0f;
        }

    }
};

public void takePicture (View view) {
    dispatchTakePictureIntent();
}

Can anyone help me with what I'm doing wrong

A: Doesn't the orientation sensor return the angle in degrees? You're assuming radians and converting to degrees.  Given that though, it still should't give you 0.

A: TYPE_ORIENTATION is depreciated and does not give the correct result
if the device is not flat. You need to use TYPE_ACCELEROMETER and TYPE_MAGNETIC_FIELD to obtain the rotation matrix and then call remapCoordinateSystem before calling getOrientation.


text:
Q: Errors when trying to add an App or Page on any site collection SP 2013 I'm having this random issue. When trying to add an app or a page on any of my site collections i get this error:

Could not load file or assembly
  'App_Web_errorv15.master.9c9699a8.tism8wyx, Version=0.0.0.0,
  Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
  parameter is incorrect. (Exception from HRESULT: 0x80070057
  (E_INVALIDARG))

I checked the logs and I find the same error msg on there:

05/04/2017 12:14:31.38    w3wp.exe (0x0BDC)
    0x1E14  SharePoint Foundation           General
    ajlz0   High        Getting Error Message for Exception
  System.Web.HttpParseException (0x80004005): Could not load file or
  assembly 'App_Web_errorv15.master.9c9699a8.rkml6usk, Version=0.0.0.0,
  Culture=neutral, PublicKeyToken=null' or one of its dependencies. The
  parameter is incorrect. (Exception from HRESULT: 0x80070057
  (E_INVALIDARG)) ---> System.Web.HttpParseException (0x80004005): Could
  not load file or assembly 'App_Web_errorv15.master.9c9699a8.rkml6usk,
  Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
  dependencies. The parameter is incorrect. (Exception from HRESULT:
  0x80070057 (E_INVALIDARG)) ---> System.IO.FileLoadException: Could not
  load file or assembly 'App_Web_errorv15.master.9c9699a8.rkml6usk,
  Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its
  dependencies. ... f670ee9d-19e0-70c4-ffb0-92253840f919

Any ideas as to why this is happening?

A: Try to use Fuslogvw for getting details of the failed assembly binds.

A: Thanks for your responses guys - i was able to fix it by running the PSCONFIG and rebooting the web servers. Not sure exactly what caused this issue but PSCONFIG seemed to have fixed it.


text: Q: Android app for Magento store using REST or SOAP? Hi there i want to know which service to use for making a mobile application for magento does it have to be rest or soap i want to have complete functionality as that of my website inside mobile app.any type of personal experience and help is much appreciated


text:
Q: Load LLDB commands into XCode Has anyone loaded commands into LLDB for a debugging session of an XCode app.
I'm in XCode 6.1.1 and iOS 8.x
I don't know any Python, so id highly prefer avoiding having to involve Python.
I would like to load this stuff I type by hand from a file, so I don't have to keep typing it over and over each time I re-run the debug session...
(lldb) breakpoint set --func-regex "SomeClass"
Breakpoint 10: 48 locations.
(lldb) breakpoint set --func-regex "AnotherClass"
Breakpoint 11: 15 locations.
(lldb) breakpoint set --func-regex "ThisClass"
Breakpoint 12: 15 locations.
(lldb) breakpoint set --func-regex "ThatClass"
Breakpoint 13: 57 locations.
(lldb) breakpoint set --func-regex "OurClass"
Breakpoint 14: 98 locations.
(lldb) breakpoint set --func-regex "YourClass"
Breakpoint 15: 22 locations.
(lldb) breakpoint set --func-regex "HerClass"
Breakpoint 16: 17 locations.
(lldb) breakpoint set --func-regex "HisClass"
Breakpoint 17: 46 locations.
(lldb) breakpoint set --func-regex "TheyreClass"
Breakpoint 18: 63 locations.

(lldb) breakpoint command add 10
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE
(lldb) breakpoint command add 11
Enter your debugger command(s).  Type 'DONE' to end.
> frame info; continue; DONE
> DONE
(lldb) breakpoint command delete 11
(lldb) breakpoint command add 11
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE
(lldb) breakpoint command add 12
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE
(lldb) breakpoint command add 13
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE
(lldb) breakpoint command add 14
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE
(lldb) breakpoint command add 15
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE
(lldb) breakpoint command add 16
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE
(lldb) breakpoint command add 17
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE
(lldb) breakpoint command add 18
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE

Thanks

A: One way to do this would be to set a breakpoint on the main() function of your app, and via the Xcode UI bind it to execute a debugger command of the form
command source <myMagicFile>

and then auto continue
The file would then contain the commands you want executed, and since the breakpoint is on main(), your file would get loaded and the commands executed each time you start debugging your app
As a hint, it is probably safer to add each breakpoint and then do breakpoint command add directly after. Breakpoint command add will then automatically refer to the last breakpoint you created, so you don't have to rely on breakpoint IDs
For instance:
breakpoint set --func-regex "SomeClass"
breakpoint command add
Enter your debugger command(s).  Type 'DONE' to end.
> frame info
> continue
> DONE
breakpoint set --func-regex "AnotherClass"

[...]


text:
Q: Python IF and AND statement #value error ( TypeError: Cannot perform 'rand_' with a dtyped [object] array and scalar of type [bool] i'm trying to making condition ( if and ) but it keep error me
DF
         Segment Out_going Calls
0    Outbound               0
1         nan              10
2    Outbound               0
3    Outbound               0
4    Outbound               0
..        ...             ...
275  Outbound               0
276  Outbound              10
277  Outbound              13
278  Outbound               4
279  Outbound               0

i used below code
PG["Final_Stuff"]=np.where(PG['Segment'] == 'inbound' & PG['Out_going Calls'] == 0, 0, PG["0"])

below is the error appear
TypeError: Cannot perform 'rand_' with a dtyped [object] array and scalar of type [bool]

Complete Error
    TypeError                                 Traceback (most recent call last)
C:\Program Files\Python310\lib\site-packages\pandas\core\ops\array_ops.py in na_logical_op(x, y, op)
    301         #  (xint or xbool) and (yint or bool)
--> 302         result = op(x, y)
    303     except TypeError:

C:\Program Files\Python310\lib\site-packages\pandas\core\roperator.py in rand_(left, right)
     51 def rand_(left, right):
---> 52     return operator.and_(right, left)
     53

TypeError: unsupported operand type(s) for &: 'str' and 'str'

During handling of the above exception, another exception occurred:

TypeError                                 Traceback (most recent call last)
C:\Program Files\Python310\lib\site-packages\pandas\core\ops\array_ops.py in na_logical_op(x, y, op)
    315             try:
--> 316                 result = libops.scalar_binop(x, y, op)
    317             except (

C:\Program Files\Python310\lib\site-packages\pandas\_libs\ops.pyx in pandas._libs.ops.scalar_binop()

C:\Program Files\Python310\lib\site-packages\pandas\core\roperator.py in rand_(left, right)
     51 def rand_(left, right):
---> 52     return operator.and_(right, left)
     53

TypeError: unsupported operand type(s) for &: 'bool' and 'str'

The above exception was the direct cause of the following exception:

TypeError                                 Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_14048/3217482720.py in <module>
      1 # if agent have not outbound call or POM then he his trans time will be deduct from FTE
----> 2 PG["Final_Stuff"]=np.where(PG['Segment'] == 'inbound' & PG['Out_going Calls'] == 0, 0, PG["0"])
      3
      4 #print(PG.head(2))
      5 #PG.to_excel('Test.xlsx' ,index=False)

C:\Program Files\Python310\lib\site-packages\pandas\core\ops\common.py in new_method(self, other)
     67         other = item_from_zerodim(other)
     68
---> 69         return method(self, other)
     70
     71     return new_method

C:\Program Files\Python310\lib\site-packages\pandas\core\arraylike.py in __rand__(self, other)
     64     @unpack_zerodim_and_defer("__rand__")
     65     def __rand__(self, other):
---> 66         return self._logical_method(other, roperator.rand_)
     67
     68     @unpack_zerodim_and_defer("__or__")

C:\Program Files\Python310\lib\site-packages\pandas\core\series.py in _logical_method(self, other, op)
   5511         rvalues = extract_array(other, extract_numpy=True, extract_range=True)
   5512
-> 5513         res_values = ops.logical_op(lvalues, rvalues, op)
   5514         return self._construct_result(res_values, name=res_name)
   5515

C:\Program Files\Python310\lib\site-packages\pandas\core\ops\array_ops.py in logical_op(left, right, op)
    390         filler = fill_int if is_self_int_dtype and is_other_int_dtype else fill_bool
    391
--> 392         res_values = na_logical_op(lvalues, rvalues, op)
    393         # error: Cannot call function of unknown type
    394         res_values = filler(res_values)  # type: ignore[operator]

C:\Program Files\Python310\lib\site-packages\pandas\core\ops\array_ops.py in na_logical_op(x, y, op)
    323             ) as err:
    324                 typ = type(y).__name__
--> 325                 raise TypeError(
    326                     f"Cannot perform '{op.__name__}' with a dtyped [{x.dtype}] array "
    327                     f"and scalar of type [{typ}]"

TypeError: Cannot perform 'rand_' with a dtyped [object] array and scalar of type [bool]


text:
Q: joining a list together with index's I have been working on a bucket sort algorithm.
might be simple but how would I join these buckets(index's) together without interrupting the second list.
list1 = [[], ['aa', 'aa'], [], ['bbbb', 'bbbb']]

hidden in test file:
list2 = [[], ['aa', 'aa']]

the result I am after is:
list1 = ['aa', 'aa', 'bbbb', 'bbbb']
list2 = ['aa', 'aa']

I have managed to sort these lists by size but unable to put them into a single list without interrupting list2. as the index would be out of range.
thanks guys.

A: To join the elements of such a list simply use
>>> import itertools
>>> list(itertools.chain.from_iterable(list1))
['aa', 'aa', 'bbbb', 'bbbb']

A: You can add/concatinate them.
list1 = [[], ['aa', 'aa'], [], ['bbbb', 'bbbb']]
finishlist = []
for element in list1:
    finishlist = finishlist + element

print(finishlist)

output:
['aa', 'aa', 'bbbb', 'bbbb']

A: You can use a simple for loop:
list1 = [[], ['aa', 'aa'], [], ['bbbb', 'bbbb']]

l = []
for i in list1:
    l += i # or l.extend(i)

print(l)
# ['aa', 'aa', 'bbbb', 'bbbb']

Alternatively you can use a list comprehension:
[i for subl in list1 for i in subl]

A: You can iteratively combine the lists into one list:
from functools import reduce
list1 = [[], ['aa', 'aa'], [], ['bbbb', 'bbbb']]

reduced = reduce((lambda x, y: x + y), list1)
print(reduced)  # prints ['aa', 'aa', 'bbbb', 'bbbb']


text:
Q: Unable to send cookie while sending form data service in jmeter below are the screenshots of the script
raiseInquiry service
when i run i get error 401 unauthorized response from raise Inquiry service
but login service is success but not able to add cookie with the login request even though i had added cookie manager.
and how can I add a file to the parameters(encircled in dark)in jmeter below screen shots
screenShotPostman
When i ran the above scenario in postman it worked, and found out that no cookie is associated with the raise inquiry service

A: Change the following configuration in jmeter.properties in JMeter /bin folder and try: (remove # to uncomment)
CookieManager.save.cookies=true
CookieManager.check.cookies=false

Restart JMeter and run the script again.


text:
Q: Conversion of X,Y in Decimal Degree form I found a DBF file from some govt site, It has X value as 6265001.698875606
and Y value as 2287922.0458578467 and so on.
I want to convert these values into Decimal Degree format so that I could create points and could plot in my ArcGIS software, can anyone suggest me how to convert these values to decimal degree format?
Few more examples are:-
      X          ,          Y
6189755.067873105,  2289006.0368001014
6203424.773145199   2289971.025355682
6257970.097453281   2297143.056615263
6360789.086368695   2298715.5160687715
6342105.368158773   2299252.8617788553
6186809.299486443   2300760.374511853

A: You need to know the coordinate system of the coordinates in order to plot and also if you want to convert into lat/long. For example check at data source if there is any documentation. Then do this:
1 - Run tool Make XY Event Layer:

Creates a new point feature layer based on x- and y-coordinates
  defined in a source table. If the source table contains z-coordinates
  (elevation values), that field can also be specified in the creation
  of the event layer. The layer created by this tool is temporary.

After this the coordinates will be visible as points in the map.
2 - To make the layer permanent run Copy Features:

Copies features from the input feature class or layer to a new feature
  class.

3 - And if you want to convert into lat/long run Project:

Projects spatial data from one coordinate system to another.

A: But if you really have no idea whether the original data is in UTM or some other local coordinate reference system (CRS) you have to do some sleuthing.  Add some data with the correct CRS to a new MXD.  Next, make an XY Event layer as @BERA suggests from your mystery data.  If the mystery data draws in the correct location then the XY data uses the same CRS as the dataframe.  If the XY data are not in the correct location then change the dataframe CRS until the data draw in the correct location.  Use caution-some datums  may have small differences in the shift depending on your location.


text:
Q: R_on for inverter gate What \$R_{on}\$ do I use to calculate the delay for an inverter gate? In my class we came  up with two definitions of \$R_{on}\$, one for saturation and one for triode. Is there a certain mode I should assume for the transistor or do I need to calculate it by hand? I wasn't given a V_in though so I don't know how I'd be able to calculate the mode by hand. Am I missing something really obvious?
Drawing of the inverter:

A: Suppose we're talking about the falling transition time of an inverter. We assume that the PMOS transistor is completely cut off and that \$V_{GS}\$ for the NMOS is equal to the supply voltage. Now, for most of the range of voltages that the output will swing, from \$V_{DD}\$ to ground, \$V_{DS}\$ will be large enough that the NMOS will be in saturation. The real definition of "most" depends on the switching points that you use to define the "transition time"...20% to 80% of \$V_{DD}\$ is typical. So, the transition time for the output is mostly dependent on the \$I_{DS(sat)}\$, and it's only as the output voltage gets close to its final value that the triode region \$R_{DS}\$ becomes significant.
Of course, this is all just a rough approximation. The input transition time can not be ignored in practice. Your best answers will come from a good SPICE simulation.

A: For standard logic, CMOS Vdd controls RdsOn (Ron), depending on T and Vdd tolerance with mfg tolerances.   Pch FETs tend to be slightly larger as they channel Ron is higher slightly for the same size, so as to match them for complementary threshold and symmetrical slew rate.
CD4000 family was around 300 ohms +/- 50% measured by datasheet at various Vdd levels for Vol/Iol=Ron  with Vgs(th)= +/-1.5V by design.   The higher Vdd produces lower Ron. At one time it was well known in the 70's that Fairchild and Harris were faster than NSC,  MOT were the slowest. This could have been due to lower RdsOn and/or lower Miller Cfb as all FETs have a somewhat constant Ron*C=T constant for a given Vds max with some major differences for power FETs.
For 5V logic families, the Ron is 50 to 66 (? AFAICR) Ohms +/- 50 % depending on temp and Vdd tolerance, by defacto design.
For 3.3V logic it is 25 Ohms +/- 50(?)%  e.g. ARM chips
For 1.6V logic it is about the same, so each FET family has a controlled Vgs and Ron to prevent shootthru heat damage yet low Ron to produce a rated Slew Rate for a rated load capacitance.


text:
Q: Why is this sentence not in the subjunctive? "If you draw yourself, how would it turn out?"
If you draw yourself, how would it turn out?

Someone said it should be like "If you were to draw...", but why? I'm not troubled with the "were to" sentence. I'm just quite confused by the fact that "If you draw..." is wrong.


text:
Q: How to pull a dependency with specific setting in a conanfile.py? I am creating a recipe for my project.  The project has a dependency on a package, for example "pcapplusplus/18.08".  Easy enough, I do this with:
class MyProject(ConanFile):
    name = "myproject"
    version = "0.1"
    settings = "os", "compiler", "build_type", "arch"

    # ...simplified...

    requires = "pcapplusplus/18.08"

    # ... configure, build etc

Except the pcapplusplus dependency has to be pulled with the setting compiler.version=15.  Akin to this syntax in a profile:
[settings]
pcapplusplus:compiler.version=15

Or from conan install:
conan install . -s pcapplusplus:compiler.version=15

How is this done in a conanfile.py?

A: The [settings] you are describing is not a conanfile.txt. It is a profile file that must be used as:
$ conan install <path-to-conanfile> --profile=<path-to-profile>

The profile files can be used both for conanfile.txt and conanfile.py files.


text:
Q: Emulator Not Running on Android Studio I am trying to run an emulator over Android Studio, but it's not starting.
I have Android studio (version 23 marshmallow), configured with
minSdkVersion 21
targetSdkVersion 23

When I run my app in emulation (nexus 5x api 23 android 6.0), I get the following error:

Error while waiting for device: The emulator process for AVD
  Nexus_5X_API_23 was killed.

Can anybody help me on this, please?

A: In my case docker / dlite was running and once I stopped them, the emulator started to work.
docker stop $(docker ps -a -q)
dlite stop

Or quit docker for mac via the top right menu bar item.
Note that you might need to restart Android Studio.

A: If you take a look at the 4: Run log, it says:

emulator: ERROR: Unfortunately, there's an incompatibility between
  HAXM hypervisor and VirtualBox 4.3.30+ which doesn't allow multiple
  hypervisors to co-exist.  It is being actively worked on; you can find
  out more about the issue at http://b.android.com/197915 (Android) and
  https://www.virtualbox.org/ticket/14294 (VirtualBox)

In my case, there was a VirtualBox docker instance running and once I stopped it, the emulator started to work.

A: Installing Microsoft Visual C++ 2015-2019, did the trick for me... was missing a dll file for some reason.
Debugging

*

*Android Studio just said emulator crashed.

*Run the emulator.exe in cmd really helps in windows.

*$HOME/tools is where you find emulator.exe

*emulator.exe @name_of_avd or just do emulator.exe -list-avds

All the best

A: If your running Windows OS, then check whether the graphics driver is installed and is working fine. As the emulator needs good and/or proper graphics configuration. Try installing the graphics driver if not installed and running the emulator again.
Hope this works!, this worked for me.

A: My problem was with Nexus 6 23 and resolved it doing the following:

*

*cd $HOME/Android/Sdk/emulator/lib64/libstdc++

*Rename the file libstdc++.so.6 (Ubuntu):
mv libstdc++.so.6 libstdc++.so.6.bak

*Ready, it worked for me!

I hope it can help you!


text:
Q: Dax measure that counts number of occurrence I want to create measure Invoice Counter that shows number of invoices per customer. This measure must reflect slicer in the page.

If in year slicer is selected year = 2022, measure should reflex this.

Sorry I don't paste my test code here, it was nonsense so far.
Thanks for help.

A: Your modelling approach is a little awkward: Your table shows an Invoice Counter of 3 for the single invoice 11 in 2022 for "jack", and the sum of Invoice Counter is 14, although there are 6 different invoices only. This is at least confusing ...
Your Invoice counter measure should aggregate invoice like this:
Invoice Counter =
CALCULATE(
    COUNT('Table'[invoice]),
    ALLEXCEPT('Table', 'Table'[customer])
)

but then you can't filter it by invoice again, because that will undo the above aggregation. Just put customer, year and Invoice Counter in one table and of cause you can filter that table by year, if you like:


text:
Q: DIrectadmin after enable SSL too many redirects I'm stuck on a problem. After enabling SSL in DA for domain and add RewriteRule to htaccess, I have a redirect loop.
Here is my vhost config file:
<VirtualHost 111.222.33.44:80 >
ServerName www.my-shop.net
ServerAlias www.my-shop.net my-shop.net
ServerAdmin webmaster@my-shop.net
DocumentRoot /home/admin/domains/my-shop.net/public_html/application/public
ScriptAlias /cgi-bin/ /home/admin/domains/my-shop.net/public_html/application/public/cgi-bin/
UseCanonicalName OFF
<IfModule !mod_ruid2.c>
    SuexecUserGroup admin admin
</IfModule>
CustomLog /var/log/httpd/domains/my-shop.net.bytes bytes
CustomLog /var/log/httpd/domains/my-shop.net.log combined
ErrorLog /var/log/httpd/domains/my-shop.net.error.log
<Directory /home/admin/domains/my-shop.net/public_html/application/public>
    php_admin_flag safe_mode OFF
    php_admin_flag engine ON
    php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@my-shop.net'
    php_admin_value mail.log /home/admin/.php/php-mail.log
    php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/
</Directory>

<VirtualHost 111.222.33.44:443 >
SSLEngine on
SSLCertificateFile /usr/local/directadmin/data/users/admin/domains/my-shop.net.cert.combined
SSLCertificateKeyFile /usr/local/directadmin/data/users/admin/domains/my-shop.net.key
SSLCACertificateFile /usr/local/directadmin/data/users/admin/domains/my-shop.net.cacert
ServerName www.my-shop.net
ServerAlias www.my-shop.net my-shop.net
ServerAdmin webmaster@my-shop.net
DocumentRoot /home/admin/domains/my-shop.net/public_html/application/public
ScriptAlias /cgi-bin/ /home/admin/domains/my-shop.net/public_html/cgi-bin/
UseCanonicalName OFF
<IfModule !mod_ruid2.c>
    SuexecUserGroup admin admin
</IfModule>
CustomLog /var/log/httpd/domains/my-shop.net.bytes bytes
CustomLog /var/log/httpd/domains/my-shop.net.log combined
ErrorLog /var/log/httpd/domains/my-shop.net.error.log
<Directory /home/admin/domains/my-shop.net/public_html/application/public>
    php_admin_flag safe_mode OFF
    php_admin_flag engine ON
    php_admin_value sendmail_path '/usr/sbin/sendmail -t -i -f admin@my-shop.net'
    php_admin_value mail.log /home/admin/.php/php-mail.log
    php_admin_value open_basedir /home/admin/:/tmp:/var/tmp:/usr/local/lib/php/
</Directory>

Custom code:
|*if !SUB|
|?DOCROOT=/home/admin/domains/my-shop.net/public_html/application/public|
|*endif|

What should be fixed in configuration? I feel more confident in the administration of nginx..


text:
Q: org-mode: Visible export of drawer What I want is really to be able to export the :PROPERTIES: of my items and somehow override the default hide behavior. That is apparently impossible. Next best thing is to define a "drawer." So :MYDRAWER: is something I can define -- and it will appear on an export. My problem is drawers don't allow the nice key:value subcategories of properties. With properties I can do this:
:PROPERTIES:
:Author: Victor Andrade
:Author2:
:Title: My Missions for Revolutionary Bolivia, 1944-1962
:Subtitle:
:Published: 1976
:Read: 2010
:Subject: History
:Area: Bolivia
:Comments:
:END:

But I can't do that with drawers. Trying to add key:value categories between :MYDRAWER: and :END: just gets treated as text. Is there any way for me to have nice properties-like layout get exported? And again, I'm not really sure what to do with the org-mode customization option either (...group Org Export\Org Export General\Org Export With Drawers. I'm guessing all drawers are exported unless you set this not to. Right?

A: Try something such as:
#+OPTIONS: d:(not "MYDRAWER")


text:
Q: Getting strange error while installing AWS SDK via PEAR I am getting this error while installing AWS SDK via PEAR. I never got this before.
$ sudo pear channel-discover pear.amazonwebservices.com
Adding Channel "pear.amazonwebservices.com" succeeded
Discovery of channel "pear.amazonwebservices.com" succeeded
$ sudo pear install aws/sdk
Unknown remote channel: guzzlephp.org/pear
aws/sdk requires package "channel://guzzlephp.org/pear/Guzzle" (version >= 3.0.2)
No valid packages found
install failed

Can somebody give me a hand.

A: Had the same problem, but this fixed it:
Install the old package first
sudo pear -D auto_discover=1  install pear.amazonwebservices.com/sdk-1.6.0

Then update it
sudo pear install pear.amazonwebservices.com/sdk

To check:
ubuntu@ip-xx-xx-xx:~$ sudo pear install aws/sdk
aws/sdk is already installed and is the same as the released version 2.4.0

A: Try this before installing the SDK:
sudo pear install --alldeps --force guzzle/guzzle

A: Taken from here:
https://github.com/aws/aws-sdk-php/blob/master/README.md#installing-via-pear
Installing via PEAR
PEAR, which stands for PHP Extension and Application Repository, is a framework and distribution system for reusable PHP components. It is the PHP equivalent of other package management solutions like Yum that install packages system-wide.
PEAR packages are easy to install, and are available in your PHP environment path so that they are accessible to any PHP project. PEAR packages are not specific to your project, but rather to the machine they're installed on.
From the command-line, you can install the SDK with PEAR as follows. Note: You may need to use sudo for the following command.
pear -D auto_discover=1 install pear.amazonwebservices.com/sdk

Once the SDK has been installed via PEAR, you can load the phar into your project with:
require 'AWSSDKforPHP/aws.phar';

A: well I ended up installing the old package (I didn't need the new stuff such as glacier etc)
pear install aws/sdk-1.5.17.1


text:
Q: linux + how to stop files creation under /var/spool/clientmqueue please advice how to stop the file creation under the directory -
     /var/spool/clientmqueue

the reason for that because the clientmqeueue folder have huge capacity and files created every day
I verify the folder capacity by du -sh , and folder nearly to 500M
please advice for all possibilities

A: You can fix this by fixing/removing/killing the application that writes to it. Workarounds like removing the directory or changing its mode just address the symptom, not the root cause.

A: You can change directory permissions by command

chattr +i  /var/spool/clientmqeueue

By this , no files can be created in this dicretory. if you want to remove protection, just run

chattr -i  /var/spool/clientmqeueue

A: I faced the same problem yesterday,It consumed 40GB of my disk space, I changed the directory permission of the clientmqueue. That's it