text:
Q: Fail to execute a specific cmd batch file in C# I'm using Process to execute a batch file which will generate certificate file.
The code works great when I execute other file (which contains openssl command). But when I execute a file which contains keytool command, it executed, but no file was generated.
I've:

*

*Set UseShellExecute true.

*Set WaitForExit(-1) and find the return was true, so it did executed.

*I clicked that batch file manually, and the file generates right away, so the command was fine :(

*BTW I'm using .Net Core MVC.

I can't find any error code anywhere, so I'm at my wits' end now.
Does anyone has a clue? Any help would be very appriciated!
success code(openssl):
I generate a p12 file (a certificate format) in that folder first, and it works fine.
private string Gen_P12(string domain, string pwd)
        {
            //generate folder
            string folder = @"D:\Temp\";
            if (!Directory.Exists(folder))
                Directory.CreateDirectory(folder);

            //generate bat(p12)
            string bat = "openssl.exe pkcs12 -export -inkey " + domain + ".key -in " + domain + ".cer -out " + domain + ".p12 -password pass:" + pwd +"\r\n";
            //download in folder
            var path = Path.Combine(folder, domain + "_P12.bat");
            using (FileStream fs = System.IO.File.Create(path))
            {
                byte[] content = new UTF8Encoding(true).GetBytes(bat);
                fs.Write(content, 0, content.Length);
            }

            Thread.Sleep(500);

            //execute
            ProcessStartInfo myBat = new ProcessStartInfo();
            string name = domain + "_P12.bat";
            myBat.FileName = name;
            myBat.WorkingDirectory = folder;
            myBat.UseShellExecute = true;
            //Process.Start(myBat);
            Process p = Process.Start(myBat);
            p.WaitForExit(-1);

            return folder;
        }

fail code(keytool):
Trying to use that P12 file and keytool command to generate a keystore (also a certificate format) but fail.
private string Gen_KS(string domain, string folder, string CA_domain, byte[] cer, string pwd)
        {
            //generate bat
            string bat = "keytool -importkeystore -srckeystore " + domain + ".p12 -srcstoretype PKCS12 -srcstorepass " + pwd + " -destkeystore " + domain + ".keystore -storepass " + pwd + "\r\n";
            var path = Path.Combine(folder, domain + "_KS.bat");

            using (FileStream fs = System.IO.File.Create(path))
            {
                byte[] content = new UTF8Encoding(true).GetBytes(bat);
                fs.Write(content, 0, content.Length);
            }

            Thread.Sleep(700);

            //execute
            ProcessStartInfo myBat = new ProcessStartInfo();
            myBat.WorkingDirectory = folder;
            string name = domain + "_KS.bat";
            myBat.FileName = name;
            myBat.UseShellExecute = true;
            Process p = Process.Start(myBat);
            var a = p.WaitForExit(-1);

            string route = folder + domain + ".keystore";
            return route;
        }

Thanks!

A: Thanks to @user9938, I solved the problem!
1. Brief conclusion:
I need to process the bat as administrator.
(And I still don't get why only do the keytool command needs administrator rights)
2. Find the errors: (How to apply StanderError when UseShellExecute=true)
In fact we don't have to set it true to execute commands.
Try this (replace execute section):
 Process process = new Process();
            try
            {
                process.StartInfo.UseShellExecute = false;
                process.StartInfo.CreateNoWindow = true;
                process.StartInfo.RedirectStandardInput = true;
                process.StartInfo.RedirectStandardOutput = true;
                process.StartInfo.RedirectStandardError = true;
                process.StartInfo.FileName = "cmd.exe";
                process.Start();
                process.StandardInput.WriteLine(bat); //command string, not the bat file
                process.StandardInput.AutoFlush = true;
                process.StandardInput.WriteLine("exit");
                StreamReader reader = process.StandardError;
                string curLine = reader.ReadLine();
                reader.Close();
                process.WaitForExit();
                process.Close();
            }catch (Exception e){}

Check the value of curLine through Breakpoints, the error message was: "'keytool' is not recognized as an internal or external command, operable program or batch file".
3. How to solve it:
Just set the Verb attribute as "runas".
            //execute
            ProcessStartInfo myBat = new ProcessStartInfo();
            myBat.WorkingDirectory = folder;
            string name = domain + "_KS.bat";
            myBat.Verb = "runas";
            myBat.FileName = name;
            myBat.UseShellExecute = true;
            Process p = Process.Start(myBat);
            var a = p.WaitForExit(-1);

Done! Thank you user9938<3


text:
Q: How to add data to SQL Server Express database using Entity Framework I'm writing simple program for my university. I created an Entity Framework model, draw diagrams, created database from model, applied SQL file on my database and now I'm trying to add some items to the DB.
I'm doing it this way:
using (NewsletterEntities context = new NewsletterEntities())
{
   Sender newSender = new Sender();
   newSender.Login = Login.Text;
   newSender.Password = Password.Text;
   newSender.Port = 23;
   newSender.SMTP = SMTP.Text;
   newSender.Email = Email.Text;
   newSender.SenderID = 0;

   context.Senders.AddObject(newSender);
   context.SaveChanges();
}

When I try to execute it it pops up with inner exception:

Cannot insert explicit value for identity column in table 'Senders' when IDENTITY_INSERT is set to OFF.

I was trying to look for the error, but I don't know much about entity framework and couldn't find anything specific.
Can anyone help?

A: The error is not about Entity Framework, it's about SQL Server, more specifically the Identity column.
My guess is that SenderID is an identity column. This means that the database is responsible for assigning sequential values to this field and you are not allowed to specify values for it (except if you use IDENTITY_INSERT, as the error message suggests).
Therefore, dropping the newSender.SenderID = 0; line from your code should solve the issue.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Getting a jar does not exist and java.lang.ClassNotFoundException while running a simple twitter sentiment analysis code I have been struggling with this for some time now. I have been trying to run a simple twitter sentiment analysis code which seemed to work fine earlier but doesn't work anymore. I am using spark 1.3.1 with scala 2.10.4. I read somewhere that TwitterUtils doesn't work with spark 1.0+ so I tried a workaround. Everything seems to be in place according to the books..the right directory structure for scala, a fat jar using sbt assembly, the right paths but somehow spark is unable to pickup the jar file and I also get a ClassNotFoundException with it.
What could possibly be going wrong and how can I fix it?
EDIT:
The command line

../bin/spark-submit --class Sentimenter --master local[4] /home/ubuntu/spark/spark_examples/target/scala-2.10/twitter-sentiment-assembly-1.0.jar

The Error:
Warning: Local jar /home/ubuntu/spark/spark_examples/target/scala-2.10/twitter-sentiment-assembly-1.0.jar does not exist, skipping.
java.lang.ClassNotFoundException: Sentimenter
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:274)
        at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:538)
        at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:166)
        at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:189)
        at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:110)
        at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

The build.sbt file:
lazy val root = (project in file(".")).
  settings(
    name := "twitter-sentiment",
    version := "1.0",
    scalaVersion := "2.10.4",
    mainClass in Compile := Some("Sentimenter")
  )

libraryDependencies ++= Seq(
  "org.apache.spark" %% "spark-core" % "1.3.1" % "provided",
  "org.apache.spark" %% "spark-streaming" % "1.3.1" % "provided",
  "org.apache.spark" % "spark-streaming-twitter_2.11" % "1.3.1"
)

// META-INF discarding
val meta = """META.INF(.)*""".r
assemblyMergeStrategy in assembly := {
  case PathList("javax", "servlet", xs @ _*) => MergeStrategy.first
  case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.first
  case n if n.startsWith("reference.conf") => MergeStrategy.concat
  case n if n.endsWith(".conf") => MergeStrategy.concat
  case meta(_) => MergeStrategy.discard
  case x => MergeStrategy.first`

And here is the code I got from another forum on twitter sentiment
import org.apache.spark.streaming.StreamingContext
import org.apache.spark.streaming.StreamingContext._
import org.apache.spark.SparkContext
import org.apache.spark.streaming.twitter._
import org.apache.spark.SparkConf

object Sentimenter {
  def main(args: Array[String]) {
    System.setProperty("twitter4j.oauth.consumerKey","xxxxxxxxxxxxx");
    System.setProperty("twitter4j.oauth.consumerSecret","xxxxxxxxxxxx");
    System.setProperty("twitter4j.oauth.accessToken","xxxxxxxxxxxx");
    System.setProperty("twitter4j.oauth.accessTokenSecret","xxxxxxxxxx");

    val filters = new Array[String](2)
    filters(0) = "Big Data"
    filters(1) = "geofencing"
    val sparkConf = new SparkConf().setAppName("TweetSentiment").setMaster("local[4]").set("spark.driver.allowMultipleContexts", "true")
    val sc = new SparkContext(sparkConf)
    // get the list of positive words
    val pos_list =  sc.textFile("/home/ubuntu/spark/src/main/scala/Positive_Words.txt") //Random
      .filter(line => !line.isEmpty())
      .collect()
      .toSet
    // get the list of negative words
    val neg_list =  sc.textFile("/home/ubuntu/spark/src/main/scala/Negative_Words.txt") //Random
      .filter(line => !line.isEmpty())
      .collect()
      .toSet
    // create twitter stream
    val ssc = new StreamingContext(sparkConf, Seconds(5))
    val stream = TwitterUtils.createStream(ssc, None, filters)
    val tweets = stream.map(r => r.getText)
    tweets.print() // print tweet text
    ssc.start()
    ssc.awaitTermination()
  }
}

A: I think that if you write
../bin/spark-submit --class Sentimenter --master local[4] --jars /home/ubuntu/spark/spark_examples/target/scala-2.10/twitter-sentiment-assembly-1.0.jar
or try to rearrange the flags in the spark-submit e.g.:
../bin/spark-submit --jars /home/ubuntu/spark/spark_examples/target/scala-2.10/twitter-sentiment-assembly-1.0.jar --master local[4] --class Sentimenter
you could have it work.

A: In my view, it probably because spark fails to access your jar file. Try to move the jar file out of your home directory. It works for me.

A: In my case, the reason was that I was copying the JAR from S3 into my cluster with one EMR step, and then running spark-submit from another step. This meant that the JAR was getting copied into a step directory at /mnt/var/lib/hadoop/steps/<StepId>. Subsequently, spark-submit couldn't find the JAR, as running spark-submit <some-list-of-ars> jarfile.jar <some-other-args> would look for the JAR file in /mnt/var/lib/hadoop/steps/<DifferentStepID>.
I resolved this by copying the JAR into the home directory and then invoking the spark-submit with a fully qualified file path relative to the step directory. I.e. ../../../../../../home/hadoop/jarfile.jar


text:
Q: How to use ST_Intersection? Here's a quick summary about what I'm trying to do: I have 3 tables in Postgres, 'a' and 'b', each have a Polygon column, and 'c' has a Point column. What I'm trying to do here is to get the geometries intersections between 'a', 'b' and 'c', and to display such geometries on an OpenLayers vector layer.
I already know how to display any kind of geometry from a String in OpenLayers, but I'm having troubles with the PostGIS' ST_Intersection function, I'm doing this:
SELECT ST_Intersection(a.geom, b.geom) as inter from a, b;

where a.geom and b.geom are both the geometry columns, and I get this error message:
NOTICE:  TopologyException: found non-noded intersection between 515172 2.14408e+06, 497067 2.13373e+06 and 501321 2.13546e+06, 471202 2.14843e+06 500621 2.13576e+06
ERROR:  GEOS Intersection() threw an error!

Also I tried to express the resultant geometry as text using ST_AsText like this:
SELECT ST_AsText(ST_Intersection(a.geom, b.geom)) as inter from a, b;

but it send me this error message:
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

I don't know what I'm doing wrong, I just want to get the Polygons' WKT to display it on OpenLayers, here's how I display a geometry from a WKT:
                    var in_options = {
                        'internalProjection': new OpenLayers.Projection("EPSG:4326"),
                        'externalProjection': new OpenLayers.Projection("EPSG:4326")
                    };

                    var fea= new OpenLayers.Format.WKT(in_options).read(data); //data is the string with the WKT
                    vectorLayer.addFeatures([fea]); //this piece of code works great
                    map.zoomToExtent(bounds);

UPDATE: I tried the next:
SELECT ST_Intersection(a.geom, b.geom) as intersect_ab FROM a INNER JOIN b ON
ST_Intersection(a,b) WHERE ST_Overlaps(a.geom, b.geom)
AND ST_isvalid(a.geom)='t' AND ST_isvalid(b.geom)='t';

but I get the next error message:
ERROR: Function st_intersection(a,b) does not exist.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

I added the isvalid to verify only valid polygons are being evaluated, but it's telling the error is in the ST_Intersection(a,b), both a, b and c have the same SRID so I'm really confused, sorry if I'm asking too much, but I'm quite new with PostGIS so I hope I'm not bothering you a lot. Thanks.

A: The clue is
ERROR: Function st_intersection(a,b) does not exist.
HINT: No function matches the given name and argument types. You might need to add explicit type casts.

As the error message says you can't use st_intersection in that way. Summarizing the other answers you should use something like this:
SELECT ST_Intersection(a.geom, b.geom) as intersect_ab
FROM a INNER JOIN b ON ST_Intersects(a.geom,b.geom)
WHERE ST_isvalid(a.geom)='t' AND ST_isvalid(b.geom)='t';

AFAIK there is no sense to use st_overlaps and st_intersects in the same sentence as they are pretty similar.

A: I test between different layer of polygons and it failed if there is at least an invalid geometry in one of the layer. Did you check the validity of your polygons using ST_isvalid(the_geom)? It may be the key.

A: Try something like this:
SELECT  ST_Intersection(a.geom, b.geom) As intersect_ab
    FROM a INNER JOIN b ON ST_Intersection(a,b)
    WHERE ST_Overlaps(a.geom, b.geom)
    ;

Source

A: My guess would be that it fails if the intersection returns NULL. So you should add a where clause checking if there actually is an intersection before you try to create the WKT.

A: I tried to exclude the invalid geometries but it didn't work, so in the end I had to delete every invalid geometry and then use this:
SELECT ST_AsText(ST_Intersection(a.geom, b.geom)) as intersect_ab FROM a,b
WHERE ST_Overlaps(a.geom, b.geom) AND ST_isvalid(a.geom)='t' AND ST_isvalid(b.geom)='t';

As you can see I omitted the ST_Intersection(a,b) part, and this worked great, I'm kind of sad beacuse I couldn't find a way to exclude any invalid geometry from my select, anyway thanks to everyone for helping me out here.

A: I had this problem once.

NOTICE:  TopologyException: found non-noded intersection between xxx, xxxx and xxx, xxx  ERROR:  GEOS Intersection() threw an error!

I was able to resolve this error using this method.
- Use QGIS
- Add vector layer from your database
- Take the point from the error message and search for it in QGIS
"QuickWKT" (plugin) can be used to find it
- Then you will see the problem linestring
- Turn on edit mode
- Select "node tool" to show green node (node problem)
- Move node away from overlap node
- Save changes


text:
Q: Immersed submanifolds of same dimension Suppose $S\subseteq M$ is an immersed submanifold such that $\dim S = \dim M$ (and $S$ and $M$ are connected). Is it true that $S$ is diffeomorphic to $M$?

A: Ofcourse not. Consider $\mathbb{R}$ and  $\mathbb{R}\setminus \{0\}$. Only one of them is connected so they are not even homeomorphic.

A: It is a direct conclusion from the immersion lemma that $S$ and $M$ are local diffeomorphic:
Let $f:S \rightarrow M$ a smooth map and $x\in S$. Then $f$ is an immersion at $x$ if and only if $\text{dim} S - \text{dim} M  =: p\leq 0$ and there exist open neighbourhoods $U$ of $x$ and $V$ of $f(x)$, and a diffeomorphism $\phi$ of $V$ onto a product $U \times \Omega$ with $\Omega$ a open set of $\Bbb R ^p$ with $0\in \Omega$, such that
$$ \phi \circ f =i_1 $$
on $U$, where $i_1: x \mapsto (x,0)$ is the inclusion map on $U\times \Omega$.
In your case $p=0$.
In general, they are not global diffeomorphic.


text:
Q: PHP - Dynamic FORM > MySQL Insert I'm new here and I have one question.
I have one PHP-HTML Dynamic Form with this code:
  <form class="insert"  method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>?CategoryName=<?php echo $CategoryName; ?>">

<?php echo $lang['CATEGORY_NAME']; ?>:
  <?php
   $conn = new mysqli($SERVERNAME, $USERNAME, $PASSWORD, $DBNAME);
   if ($conn->connect_error) {
      die("Greska: " . $conn->connect_error);
   }
      $sql = "SELECT CategoryName FROM Categories WHERE ForUser = '$User_Check' ";
      $result = $conn->query($sql);
      if ($result->num_rows > 0) {
            echo "<select style='text-transform: uppercase;' onchange='location = this.options[this.selectedIndex].value;' class='form-control' name='CategoryName'>";
          while($row = $result->fetch_assoc()) {
          echo "<option value='?CategoryName=".$row['CategoryName']."'>".$row['CategoryName']."</option>";
      }
          echo "</select>";
  }
  else {
      echo "
$lang[MANAGE_CATEGORY_ALERT]
";
  }
  $conn->close();
  ?>
  <?php
   $conn = new mysqli($SERVERNAME, $USERNAME, $PASSWORD, $DBNAME);
   if ($conn->connect_error) {
      die("Greska: " . $conn->connect_error);
   }
      $sql = "SELECT FieldName FROM Fields WHERE ForUser = '$User_Check' AND ForCategory = '$CategoryName' ";
      $result = $conn->query($sql);
      if ($result->num_rows > 0) {
          while($row = $result->fetch_assoc()) {
          echo "".$row['FieldName'].":";
          echo "<input class='form-control' id='focusedInput' required type='text' placeholder='".$row['FieldName']."' name='".$row['FieldName']."'>";
      }
  }
  else {
      echo "
$lang[MANAGE_CATEGORY_ALERT]
";
  }
  $conn->close();
  ?>
  <input class="btn btn-primary" type="submit" value="<?php echo $lang['CREATE_CATEGORY_BUTTON']; ?>">
</form>

Now I have problem when I want to insert posted data into MySQL tables because PHP don't know where to insert posted data, and doesn't know where to enter which data.
Can anyone help me?

A: Your Question is not much clear but as i can understand from the code
you have 2 tables, categories and fields . and you are rendering the form using it . when u will submit the form, u will get all the fields and 'CategoryName' which you can fetch using a $_POST variable .
I dont know in which table u want to save the data but u can easily save it like any other form .
more over u can  open once in browser and save the generated file for debugging saving process so that u don't need to render again.
u can always var_dump $_POST to check the data u receive after submitting form.


text:
Q: Which is the best way to deploy a JBoss application? we are currently developing a JBoss application. To deploy it, we have a total of four servers (three years old). I am wondering which might be the best to do?
There could be a load balancer (even a load-balancer cluster, for failover) in front of two servers, each holding one JBoss and one PostgreSQl host inside XEN environments.
Does this make sense? Are there other, better options?
Thanks a lot for your advice!

A: The newer versions of JBoss (5.x and later) are easy to configure as a cluster (see my JBoss cluster post) to take advantage of sharing app session state behind the load balancer.
Therefore, if you run as a cluster then you can run them behind a load balancer (JBoss doesn't have its own built in load balancing ability).
Now, if these are 32-bit systems then you know that each JBoss instance (of the 4) can take only up to about 1.3GB of RAM .  So, when you run as a cluster you could consume up to 6 GB of ram for the 4 instances.   So, if each old server has 8GB of RAM you could theoretically run 4 instances of JBoss in a cluster on each piece of hardware, taking advantage of all the RAM.
Now, if the OS is 64-bit then you only need to run 1 instance of JBoss on each piece of hardware because the OS will allow JBoss to use up as much RAM as the system has.
So, lots of things to think about.


text:
Q: Change XXX host on error: "Host XXX is not allowed to connect to this MySQL server" When connecting to mysql server, I receive the error "Host XXX is not allowed to connect to this MySQL server". So, I want to change the XXX host name to another more understandable because the name is too long, and I want to configure a mysql user like: "user@understandable-host-name"
My OS is ubuntu 16.04 Server

Edit: please, dont confuse my ask with connections problems. I am connecting successfully. I only want to know HOW TO CHANGE XXX HOST NAME.
Doesnt work changing neither /etc/hosts nor /etc/hostname
I think is something related about rDNS, but I dont know how to change the name.


text:
Q: How to test asynchronous Stream in Dart I have simple class like this
abstract class ServerConnection {
  Stream onMessage;
  Future send(Message m);
  ...
}

You call send with message and asynchronous response will stream to onMessage. Now i need to send through this connection various messages and test responses. I made this test, but its not working (i am lost with these expectAsynces) and _waitForNextEvent is not very nice (but at least working!)
test('connection', () {
  getCon().then((ServerConnection c) {

    Future<Message> _waitForNextEvent(Stream s) {
      StreamSubscription ss;
      Completer c = new Completer();
      ss = s.listen((Message m) {
        ss.cancel();
        c.complete(m);
      });
      return c.future;
    }

    _waitForNextEvent(c.onMessage).then(expectAsync1(
      (m) => expect(m, new isInstanceOf<OkMessage>('OkMessage'))
    ));
    c.send(new StatusMessage());

    _waitForNextEvent(c.onMessage).then(expectAsync1(
      (m) => expect(m, new isInstanceOf<PongMessage>('PongMessage'))
    ));
    c.send(new PingMessage());
  });
});

So what is the right and elegant way to test Dart Streams?

A: Thank you Günter, async tests must be defined before async test itself. It is not easy to test longer async communication though.


text:
Q: How to add home folder to user without one I have a lxc container. I connect to it with sudo lxc-attach 100 which works fine. but I want to use it as a deployment target for jenkins (I know that I could use docker, but I haven't gotten that setup yet).
I have created a user jenkins with www-data as primary group using the command  useradd -g www-data jenkins which works fine, but there is no folder in /home which means that I am in doubt of where I should put the ~/.ssh/authorized_keys file with the public key of the ssh key of my Jenkins server.
I am aware that I could assign the user a password and log in using that and ssh-copy-id to push the key and then disallow password logins via SSH but I need to do this for several items and copy pasting (for now) seems easiest.

A: I realized that I ought to have provided the -d, --home HOME_DIR parameter.
I looked at the man page for useradd and usermod and discovered that I could supply the -d parameter to the usermod command as well...
I did so and the result was

usermod: no changes

Baffled, I  did su jenkins and cd which resulted in

sh: 1: cd: can't cd to /home/jenkins

I went back to my root prompt and created the directory
mkdir /home/jenkins && chown jenkins:www-data /home/jenkins
and now it seems to work as I expected.


text:
Q: HTML Multiselect Limit Is it possible to set limit to multipleselect?
Below is an example code where user can select more than 1 value.
<select multiple="multiple" name="choose">
<option value="1">Value 1</option>
<option value="2">Value 2</option>
<option value="3">Value 3</option>
<option value="4">Value 4</option>
<option value="5">Value 5</option>
<option value="6">Value 6</option>
</select>

But, how to limit user to select not more than 3 value.
Any idea?

A: You would do this via javascript on the client side, and then add a check on the server side as well in case the client has disabled javascript.
Here is some basic client side code to give you an idea:
<html>
    <body>
        <form onsubmit="validate()">
            <select multiple="multiple" id="choose" name="choose">
                <option value="1">Value 1</option>
                <option value="2">Value 2</option>
                <option value="3">Value 3</option>
                <option value="4">Value 4</option>
                <option value="5">Value 5</option>
                <option value="6">Value 6</option>
            </select><br>
            <input type="submit">
        </form>
        <script>
        function validate()
        {
            var selectChoose = document.getElementById('choose');
            var maxOptions = 2;
            var optionCount = 0;
            for (var i = 0; i < selectChoose.length; i++) {
                if (selectChoose[i].selected) {
                    optionCount++;
                    if (optionCount > maxOptions) {
                        alert("validation failed, not submitting")
                        return false;
                    }
                }
            }
            return true;
        }
        </script>
    </body>
</html>

A: Script that will disallow more than 3 elements to be selected (as opposed to just validating it at submit time).
http://jsfiddle.net/v33sszgp/
var verified = [];
document.querySelector('select').onchange = function(e) {
  if (this.querySelectorAll('option:checked').length <= 3) {
      verified = Array.apply(null, this.querySelectorAll('option:checked'));
  } else {
    Array.apply(null, this.querySelectorAll('option')).forEach(function(e) {
        e.selected = verified.indexOf(e) > -1;
    });
  }
}

Note there's some additional complexity related to preventing the item from actually being selected on the select and that it rather validates a user's actions and reverts it if it's invalid.

A: You can use jQuery
  $("select").change(function () {
      if($("select option:selected").length > 3) {
          //your code here
      }
  });

A: RedFilter has the right idea with validating by javascript.  Haven't tested, but you could do something like:
var options = document.all.tags("option");
var selectedCounter = 0;

for (var i=0; i < options.length; i++) {
   if (options[i].selected) {
      selectedCounter++;
   }
   checkCounter();
}

function checkCounter() {
   //disable all options here
}


text:
Q: How to add a timer on page load that stops when button is clicked? I want to add a timer to the page where it starts on page load.
Where it goes up in milliseconds.
Then stops when the mouse is clicked on the button.
How would I create a code example of that?
That is all I am trying to do in the code.
Add a timer that starts on page load.
Goes up in milliseconds.
Then stops when the button is clicked.
I want to be able to see the numbers going up.
https://jsfiddle.net/xvkwmndq/

// Counter
    var enterDate = new Date();
    function secondsSinceEnter()
    {
      return (new Date() - enterDate) / 1000;
    }

    // Usage example
    document.querySelector('button').onclick = function() {
      var sec = secondsSinceEnter();
      if (sec < 10)
          this.innerText = sec + " seconds";
      else
          this.innerText = 'You are here like for eternity';
    };
.play {
      -webkit-appearance: none;
      appearance: none;
      position: absolute;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      margin: auto;
      display: flex;
      justify-content: center;
      align-items: center;
      width: 90px;
      height: 90px;
      border-radius: 50%;
      cursor: pointer;
      border: 9px solid blue;
      background: transparent;
      filter: drop-shadow(3px 3px 3px #000000b3);
    }
<button class="play" type="button" aria-label="Open"></button>

A: Related to the jsfiddle in your comment:
Don't use this to access the button. Instead, just use document.querySelector:
document.querySelector('button').onclick = function() {
  var sec = secondsSinceEnter();
  if (sec < 10)
    document.querySelector('button').innerText = sec + " seconds";
  else
    document.querySelector('button').innerText = 'You are here like for eternity';
}

Then, you're just adding the time when the button is clicked. Additionally, you should call it every 0ms (every 'tick') using setInterval. So that you don't have to write the function twice, you could define it as a seperate function. Finally, remove the interval when the button is clicked.
Full script:
// Interval
var interval;

// Counter
var enterDate = new Date();
function secondsSinceEnter()
{
  return (new Date() - enterDate) / 1000;
}

// Event function
function evtFct()
{
  var sec = secondsSinceEnter().toFixed(3);
  if (sec < 10)
    document.querySelector('button').innerText = sec + " seconds";
  else
    document.querySelector('button').innerText = 'You are here like for eternity';
}

// Add interval to keep the current time uptodate
interval = setInterval(evtFct, 0); // Call evtFct every tick

// Usage example
document.querySelector('button').onclick = function()
{
  evtFct();
  clearInterval(interval); // Disable interval
}


text:
Q: View operation timestamps for long running operations in PSQL console When I do long running queries, I tend to use tmux and a psql console. It will not show me any output of when some operation was started or completed.
How can I get the psql console to show some timestamps?
Clarification:
I'm hoping for a non-scripting solution, just in the psql console. (Or does nobody use that console?) I'm maybe naive but still trying to do most of the database stuff using the database itself and its tools (using procedures, etc.)

A: There are various options for retrieving timing information while using psql.

*

*The \timing command.

*In scripts you can use

\echo `date`

to insert the date in the output.

*You can have the date in prompt strings using eg

\set PROMPT1 = '%`date` %n@%m:%/%R%# '

For both 2 and 3 you can supply arguments to date to get the date in the format you want.

*If using psql non-interactively, you can pipe the output through ts (from moreutils) or through awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'(GNU's version of awk is needed) to prepend a timestamp to each line of output.


text:
Q: Comparing CSV with different structure I'm trying write script for comparing two CSV files with different structure. I have one file named cisearch.csv and second file named export.csv.
cisearch.csv:
Name,P1,P2,P3,P4,P5
server1,100,,,,
server2,100,100,,,
server3,100,,,,
server4,100,50,70,80,80
export.csv:
Host;Drive
server1;Drive C: Disk Usage
server2;Drive C: Disk Usage
server2;Drive D: Disk Usage
server3;Drive C: Disk Usage
server4;Drive C: Disk Usage
server4;Drive D: Disk Usage
server4;Drive E: Disk Usage
server4;Drive F: Disk Usage
server4;Drive G: Disk Usage
From script I need only output where will be only item which are on cisearch.csv but not in export.csv. For example:
server4 Drive F:
server4 Drive G:
I know this for Drive C: but not for another...
$csvI = Import-Csv c:\workspace\cisearch.csv
foreach($line in $csvI ){
    $hostname = $line.Name
    $cDrive = $line.P1
    $dDrive = $line.P2
    $eDrive = $line.P3
    $fDrive = $line.P4
    $gDrive = $line.P5

    if ($cDrive -gt 0) {
        Select-String -pattern "$hostname;Drive C: Disk Usage" C:\workspace\export.csv | out-null
    } else {
        Write-Host Drive C: on $hostname non exist
    }
}

A: and what about:
function compareE {
    if ($eDrive -gt 0 ) {
        Select-String -pattern "$hostname;Drive E: Disk Usage" C:\workspace\NagiosExport.csv
    }else{
        Write-Host Drive E: on $hostname not monitored
    }
}

if($eDrive -gt 0) {
    compareE
    }


text:
Q: Extract only words with apostrophe from text file I need to extract words with apostrophe from text file. I have a program that extract words that their length are certain amount(in the following program 3) and have apostrophe. However I need the one to consider only and only those words with apostrophe without considering any other conditions.
   public static void main(String[] args) throws IOException {
    ArrayList<String> words = new ArrayList<String>();

    String s  = "I want to have a lot of money's when I am older.";
    Pattern p = Pattern.compile("[a-zA-Z']{3,}");
    Matcher m = p.matcher(s);
    while (m.find()) {
      words.add(m.group());
    }
    System.out.println(words);

A: But you know this of the word:

*

*contains chars before the apostrophe

*apostrophe

*more char(s)

Pattern p = Pattern.compile("\\w*'\\w*");

A: Try this:
Pattern p = Pattern.compile("[a-zA-Z]{2,}'[a-zA-Z]*");

With this regex you match words with two or more letters, and apostrophe and optional letter after the apostrophe. You can change the minimum/maximum letters in [a-zA-Z]{2,} and in the last part insted of asterisk you can use {min,max} to specify precisely

A: This pattern:
"[a-zA-Z']*'[a-zA-Z']*"

matches any sequence of letters/apostrophes, containing at least one apostrophe.
Therefore it will match even such things as:

*

*O'Neill's in "Colonel O'Neill's rifle."

*'n' in "Fish 'n' chips"


text:
Q: UICollectionViewDelegate shouldSelectItemAt not called Event based methods of my delegate are not called while others are called.  For example, willDisplayCell is called, but shouldHighlightItemAt and shouldSelectItemAt are not called.  I overwrote point(inside:...) method inside my custom UICollectionView, and it gets called and super returns true.  What could be causing this?  I'm on iOS 11.4, Swift 4.1, and Xcode 9.4.1.

A: I have added a supplementary view to the collection view that spans the entire area of its bounds.  This view was intercepting all tap events.  Once I set its isUserInteractionEnabled to false I started receiving highlight and selection calls on cells in my delegate.


text:
Q: C#: Headless Browser with Proxy and JavaScript I am currently using SimpleBrowser.WebDriver, a headless browser, for a project.
The browser only needs to be able to run some basic javascript code on a page, I do not want to manipulate the site with jscript or something.
Is there any way to set a proxy for it?
If not, can you recommend another solution for a headless browser with javascript and proxy support?
Thanks in advance

A: PhantomJS will help you here: http://phantomjs.org/
There is a webdriver for it: http://www.tomdupont.net/2013/08/phantomjs-headless-browser-for-net-webdriver.html
How to setup proxy: Add proxy to PhantomJSDriver (Selenium C#)


text:
Q: Help for reproducing this page with TikZ I am not new to LaTex/XeLaTeX, but, I am new to the TikZ world, I want to put the number page and the name of the book (or what ever) as this example: http://www.insecurityinsight.org/files/humanitarianexchange047.pdf, the number of the book is inside a red square, and the title of the book is in the side and both of them are in the edge of the open pages (remember is a book). Could you help me?
Thank you in advance


text:
Q: How can I use two custom fields in WP Query How can I use two custom field in WP query, one ('edition') to select only some articles and another ('order') to sort articles.
I try with this code, but sorting doesn't work.
// args
$args = array(
'posts_per_page'    => 6,
'post_type'         => 'post',
'post_status'       => 'future',
'meta_query'        => array(
                        array(
                            'key' => 'edition',
                            'value' => 1,
                         ),
                        ),
'meta_value_num'    => 'order',
'orderby'           => 'meta_value_num',
'order'             => 'ASC'
);

A: I solved with this
$args = array(
'posts_per_page'        => 6,
'post_type'         => 'post',
'post_status'       => 'future',
'meta_key'          => 'listorder',
'order'             => 'ASC',
'orderby'           =>  'meta_value_num',
'meta_query'        => array(
                        array(
                            'key' => 'edition',
                            'value' => 1,
                         ),
                        ),
);


text:
Q: What do you call these supporting furniture that are used to display objects in a museum or a tech show?
What do you call these supporting furniture that are used to display objects in a museum or a tech show? They sometimes have a protective glass and they sometimes do not, I am wondering if they are called the same regardless if they are found in museum or a tech show though like an electronics show where gadgets are displayed.

A: They may be called "pedestals" (as noted in a comment above) or "stands":

pedestal noun
: the base of an upright structure
// the pedestal of a statue

stand noun
: a frame on or in which something may be placed for support

Here is a website that makes frequent use of the term "pedestal" for these objects: https://www.gaylord.com/c/Pedestal-Cases
The glass case is often called a "vitrine":

: a glass showcase or cabinet especially for displaying fine wares or specimens

These terms may be used either at museums or at expositions (such as tech shows).
(All definitions are from Merriam-Webster online.)


text:
Q: Case When vs. Count in MySQL I have problem with this query on MySQL.
If tried this version :
mysql>  SELECT
    COUNT(*),
    myCode,
    myState
FROM
    `tbl_2016`
WHERE
    `myCode` LIKE '%XI10-2-020012%'
GROUP BY
    `myState`;

The output is :
+----------+---------------+--------------------------------+
| COUNT(*) | myCode        | myState                        |
+----------+---------------+--------------------------------+
|        5 | XI10-2-020012 | NULL                           |
|        4 | XI10-2-020012 | ACTIVE                         |
|        1 | XI10-2-020012 | NOT ACTIVE                     |
+----------+---------------+--------------------------------+
2 rows in set

But if tried this other versione with CASE WHEN syntax :
mysql> SELECT
    myCode,
    COUNT(
        CASE
        WHEN myState IN (
            'Active'
        ) THEN
            1
        ELSE
            0
        END
    ) AS `Active`,
    COUNT(
        CASE
        WHEN myState IN (
            'Not Active'
        ) THEN
            1
        ELSE
            0
        END
    ) AS `Not Active`
FROM
    `tbl_2016`
WHERE
        `myCode` LIKE '%XI10-2-020012%'
GROUP BY
    `myState`;

The output is different than the first version :
+---------------+--------+------------+
| myCode        | Active | Not Active |
+---------------+--------+------------+
| XI10-2-020012 |      4 |          4 |
+---------------+--------+------------+
1 row in set

How to do resolve this ?
Can you help me?
Thank you in advance, my code below.

A: Use SUM instead of COUNT in second version


text:
Q: How to edit my method to where it correctly calculates simple interest taking into account the previous year's amount as the new principal? Create an internal static void method that receives the original amount of investment principle as a
named parameter with the default value 1,000.0, the amount of annual interest as a named parameter with the default value of .01 and the number of years duration of the investment as a named parameter with the default value of 5.  The method uses format specifiers to output a simple table showing each year and the value of the investment at the end of each year.  There is no input in this method.  Tip: Look up the currency format specifier.
I am using A = P(1+rt) as the simple interest formula.
internal static void Table(double original, double interest, int[] yrs)
    {
        double[] A = new double[6];

        for (int i = 1; i < yrs.Length; i++)
        {
            A[i] = original * (1 + interest * i); //this is the line
        }

        for (int i = 1; i < yrs.Length; i++)
        {
            Console.WriteLine("Year " + i + " value: " + A[i].ToString("C", CultureInfo.CreateSpecificCulture("en-US")));
        }
    }

A: You forgot to add the default values for method parameters.
and years should be integer not an integer array.
internal static void Table(double original = 1000.0, double interest= 0.01, int years = 5)
{
    for (int i = 1; i <= years; i++)
    {
        original += original * interest;

        Console.WriteLine($"Year {i} value: {original.ToString("C", CultureInfo.CreateSpecificCulture("en-US"))}");*
    }
}


text:
Q: Can we use .filter() function with conditional rules for the searched properties? Let's assume that we have the following .filter function:
search(searchQuery: string) {
  let results = myArray.filter(item =>
    item.title.toLowerCase().includes(searchQuery) ||
    item.description.toLowerCase().includes(searchQuery)
  );

  return results;
}

For this example we can consider that item doesn't have a description property always but only some times.
In this case function will fail with an error:

ERROR TypeError: Cannot read property 'toLowerCase' of undefined

How can we can still search in the array and include the description property in the search only if it exists? Is this possible within the .filter() function?

A: You could take a default value.
Either directly
(item.description || '').toLowerCase().includes(searchQuery)

or take a destructuring with a default values.
results = myArray.filter(({ title = '', description = '' }) =>
    title.toLowerCase().includes(searchQuery) ||
    description.toLowerCase().includes(searchQuery)
);

A: You can do something like this:

const myArray = [
    {
        title: 'Test 123',
    },
    {
        title: 'Test 123',
        description: 'test',
    },
    {
        title: 'What',
    },
    {
        title: 'Fix',
        description: '456123',
    },
];

const search = (text) => {
    let results = myArray.filter(item => {
        if (item.description) {
            return item.title.toLowerCase().includes(text) || item.description.toLowerCase().includes(text);
        }
    });

    return results;
}

const results = search('test');

console.log(results);

A: search(searchQuery: string) {
  return myarray.filter(item => 'description' in item
    ? item.description.toLowerCase().includes(searchQuery)
    : item.title.toLowerCase().includes(searchQuery)
  );
}

Might want to do the same check for title too but how far down do you go.


text:
Q: Easy HTTP requests with gzip/deflate compression I'm trying to figure out how the best way to easily send HTTP/HTTPS requests and to handle gzip/deflate compressed responses along with cookies.
The best I found was https://github.com/mikeal/request which handles everything except compression. Is there a module or method that will do everything I ask?
If not, can I combine request and zlib in some manner? I tried to combine zlib and http.ServerRequest, and it failed miserably.

A: Here's a working example that gunzips the response
function gunzipJSON(response){

    var gunzip = zlib.createGunzip();
    var json = "";

    gunzip.on('data', function(data){
        json += data.toString();
    });

    gunzip.on('end', function(){
        parseJSON(json);
    });

    response.pipe(gunzip);
}

Full code: https://gist.github.com/0xPr0xy/5002984

A: Note: as of 2019, request has gzip decompression built in. You can still decompress requests manually using the below method.
You can simply combine request and zlib with streams.
Here is an example assuming you have a server listening on port 8000 :

var request = require('request'), zlib = require('zlib');

var headers = {
    'Accept-Encoding': 'gzip'
};

request({url:'http://localhost:8000/', 'headers': headers})
    .pipe(zlib.createGunzip()) // unzip
    .pipe(process.stdout); // do whatever you want with the stream

A: Check out the examples at http://nodejs.org/docs/v0.6.0/api/zlib.html#examples
zlib is now built into node.

A: Looking inside the source code - you must set the gzip param on the request lib itself for gzip to work. Not sure if this was intentional or not, but this is the current implementation. No extra headers are needed.
var request = require('request');
request.gzip = true;
request({url: 'https://...'},  // use encoding:null for buffer instead of UTF8
    function(error, response, body) { ... }
);

A: All the answers here did not work and I was getting raw bytes back instead and the gzip flag was not working either. As it turns out you need to set the encoding to null to prevent requests from transforming the response to utf-8 encoding and instead keeps the binary response.
const request = require("request-promise-native");
const zlib = require("zlib");

const url = getURL("index.txt");
const dataByteBuffer = await request(url, { encoding: null });
const dataString = zlib.gunzipSync(response);

A: For anyone coming across this in recent times, the request library supports gzip decompression out of the box now. Use as follows:
request(
    { method: 'GET'
    , uri: 'http://www.google.com'
    , gzip: true
    }
  , function (error, response, body) {
      // body is the decompressed response body
      console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity'))
      console.log('the decoded data is: ' + body)
    }
  )

From the github readme https://github.com/request/request

gzip - If true, add an Accept-Encoding header to request compressed
  content encodings from the server (if not already present) and decode
  supported content encodings in the response. Note: Automatic decoding
  of the response content is performed on the body data returned through
  request (both through the request stream and passed to the callback
  function) but is not performed on the response stream (available from
  the response event) which is the unmodified http.IncomingMessage
  object which may contain compressed data. See example below.


text:
Q: @font-face not showing bold version of font despite it declaration - why? I have created a small sandbox page, and while the CSS does work, the font-face is a problem for locally-hosted Open Sans downloaded from Google Fonts.
I've hosted the fonts locally so this test page is self-contained for now.

body {
 font-family: Helvetica,Arial,sans-serif;
}
h1,
h2,
h3,
h4,
h5 {
 font-family:"Open Sans", Helvetica, Arial,sans-serif;
 font-weight:400;
 font-style:normal;
 line-height:1.4em;
 color:#333;
 margin:0 0 15px 0;
}
h1 {
 font-size:22px;
}
h2 {
 font-size:20px;
}
h3 {
 font-size:18px;
}
h4 {
 font-size:16px;
}
h5 {
 font-size:14px;
}
p {
 font-family:"Open Sans", Helvetica, Arial,sans-serif;
 font-weight:400;
 font-style:normal;
 font-size:14px;
 line-height:1.2em;
 color:#333;
 margin:0 0 15px 0
}
a {
text-decoration: none;
}
b {
font-family: Open Sans, sans-serif;
font-weight: 700;
}
#header {
  background: #01b14c;
  width: 100%;
  box-shadow: 0 0 10px 0 rgba(0,0,0,.15);
  left: 0;
  right: 0;
  padding: 6px 0;
}
.fal.fa-phone::before {
  content: "\ea39";
}
.footer {
  padding: 60px 0;
  background: #000;
  color: #FFF;
}
#cloned-hometext {
width: 470px;
}

.about-text {
font-size: 13px;
}

@font-face {
    font-family: 'Open Sans';
    src: local('Open Sans Regular'), local('OpenSans-Regular'),
    url('fonts/OpenSans-Regular.ttf');
    font-display: swap;
    font-style: normal;
    font-weight: 400;
}

@font-face {
    font-family: 'Open Sans';
    src:
    url('fonts/OpenSans-Bold.ttf');
    font-weight: 700;
    font-display: swap;
    font-style: bold;
}

@font-face {
    font-family: 'Open Sans';
    src: local('Open Sans ExtraBold'), local('OpenSans-ExtraBold'),
    url('fonts/OpenSans-ExtraBold.ttf');
    font-weight: 900;
    font-display: swap;
    font-style: bold;
}
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>Test page</title>
    <link rel="stylesheet" type="text/css" href="styles/style.css">

A TEST

TEST

This is a test

This works

It's got to work

Content to come

Despite having the OpenSans-Bold font in fonts folder of styles where style.css resides the document only shows Open Sans or a faux-bold.
These are all the fonts in the directory:
OpenSans-Bold.ttf
OpenSans-ExtraBold.ttf
OpenSans-Medium.ttf
OpenSans-Regular.ttf
OpenSans-SemiBold.ttf
However, the bold font is not showing even when I declare   in HTML.
How can I resolve this in the CSS I have?
Note in the code above, that's the content of style.css ; it's not inline.

A: add format('truetype') to your @font-face declaration. Also if it doesn't work, then move the @font-face declarations to the top of CSS.
Also if Open Sans is your default font, then apply it to the body and you don't have to specify font-family to all your elements over and over, like you're doing now.
Also are you sure about the path to font files, looks like it might need some dots and slashes upfront.

A: Check your path url to your font file, if it was in the same path change url path to "url('./fonts/OpenSans-Regular.ttf')"


text:
Q: Custom typeface text size varies greatly between fonts I have a few TextViews in my app where I use a custom typeface. I have given the view centered layout gravity to get the text centered in its parent layout. It looks fine in the previewer with the Sans font, but when I change the typeface, the result looks like the text is shifted down, like this:

Compared to this:

Here is the xml for that element:
<FrameLayout android:id="@+id/Turn_ScoreA_Frame" android:padding="5dp" android:background="@color/teamA_secondary" android:layout_margin="5dp" android:layout_gravity="center" android:layout_height="50dp" android:layout_width="110dp">
   <android.view.View android:id="@+id/Turn_ScoreABG" android:background="@color/teamA_primary" android:layout_height="fill_parent" android:layout_width="fill_parent"></android.view.View>
   <TextView android:id="@+id/Turn_ScoreA" android:includeFontPadding="false" android:text="5" android:layout_gravity="center" android:layout_height="wrap_content" android:layout_width="wrap_content" android:textSize="32dp"></TextView>
</FrameLayout>

This also occurs when I use fill_parent for layout_width and height of the text view, with text gravity center. I set the custom Typeface in the OnCreate of the view in which this layout is used, just by using TextView.SetTypeface.
Does anyone know what could be causing this? I'm having trouble tracking anything down on this.
As a note, I've worked around this on several views by setting the margin_bottom to -10dp or so, but I'd like to remove that, and I can't get that hack to work on confined views like this one, anyways.
The font is Anton, by the way.
EDIT: This is definitely the result of the text being too large for its container. The thing is, Sans fits just fine, and the new font would fit but its measured size is too large. What I'm hoping is to find a way to get the text to remain at its current visible size and fit in the center of the container, in such a way that doesn't feel too hacky =)

A: You need to add:
android:includeFontPadding="false"

A: You have 3 options

*

*Decrease the text size

*Increase the height of FrameLayout

*Change the font which can fit correctly
you cannot change the property of the font, it is designed is such a way that it has empty space above it, which doesn't fit in your given android:layout_height="50dp" when  android:textSize="32dp"


text:
Q: jsf 2.0 ajax renders the whole page (from button) instead of just rendering a panelgroup I have a button that should render only one specific panelGroup (parentWrapper). Instead it re-render the whole page. This is the way it is supposed to work:

*

*The user looks for a excel document and enters the location in the fileupload component

*Then the user selects a Customer using the Autocomplete component

*Then the user clicks on the AddCustomer button. That executes the CustomerInSchedule (autocomplete) and the action editScheduleController.addCustomerRowFromLookAhead(), both are working fine.

*When the user clicks the AddCustomer button, the ajax is supposed to render only the :CustomerScheduleForm:parentWrapper. Instead of that the whole page is rendered. That creates issues in other parts of this page. So the question is: Why is ajax rendering the whole page and not just the panelGroup id ="parentWrapper" ?

<div align="center">
<h:panelGroup id="editScreenDiv" layout="block" style="width:1180px">
  <h:panelGrid border="0" columns="2" class="SimpleFormBoundedSection SubRegionBox" columnClasses="InputLabel,InputElement"     rowClasses="FirstRow,LastRow" headerClass="SectionHead">
   <!-- some stuff -->
   <l:fileUpload id="fileupload" value="#{editScheduleController.customerRateScheduleBean.sourceFile}" onchange="file_onchange()" rendered="#{editScheduleController.customerRateScheduleBean.action != 'editSchedule'}" />
   <!-- ... some stuff  -->
   <h:commandButton id="AddCustomer" value="Add"                  action="#{editScheduleController.addCustomerRowFromLookAhead()}" >
        </h:commandButton>
<p:autoComplete id="CustomerInSchedule" required="false" value="#{editScheduleController.customerNumberAndName}" completeMethod="#{editScheduleController.suggestAuthorizedCustomer}" minQueryLength="3" scrollHeight="250" size="65" maxlength="50" forceSelection="true">

For some reason I could not continue adding the xhtml code here. What follows is the rest of the code that belongs to the same page. I have omitted style attributes from the div and the dataTable.
<f:ajax render=":CustomerScheduleForm:parentWrapper"                        execute="CustomerInSchedule" onevent="clearCustomerInSchedule()"/>
</p:autoComplete>

<h:panelGroup id ="parentWrapper">
  <h:panelGroup id ="wrapper">
   <div>
     <h:dataTable id="customerTable" value="#{editScheduleController.customerRateScheduleBean.listOfCustomersInSchedule}"
        var="customerRow" >
  <!-- ...some stuff  -->
      </h:dataTable>
    </div>
  </h:panelGroup>

  </h:panelGrid>
 </h:panelGroup>
 <!-- ... some stuff  -->

A: Add an update to your commandButton, with the component to update : update=":CustomerScheduleForm:parentWrapper".
Edit : do this accordinaly with esiting commandButton to p: instead of h to use the update and ajax.


text:
Q: Change list behavior: Clicking list item SELECTS item rather than opening display page Context:  I have a requirement for a list that contains public and private data. The 'solutions' I found are mostly security through obscurity (views, web part trickiness etc) and not appropriate for my environment. The solution I have chosen is to create two lists, with private information linked to public table using a lookup column. I then have a web part page showing both lists, with connections enabled so when a user selects an item in the public list, the corresponding entry in the private list displays (only if they are in a group that has access to private).
Problem:
Although the solution is functional, the navigation is clunky and not intuitive to users. To select a list item they must click a tiny connection icon at the left. If they click elsewhere in the list, the item is highlighted however the  linked list is not refreshed based on the selection.
Objective:
When users click ANY field in the public list, it selects the list item and updates the filter, refreshing the connected (private) list. I found a solution while researching but it seems to be for a different version. Bonus points if it is possible to CTRL+Click to select multiple items simultaneously.
Constraints:
- It is not possible to use scripting or Power Shell.
So what do you think exchangers? Possible?


text:
Q: Can'tinstall arcgis for server 10.2 i have a problem installing arcgis server 10.2, i installed arcgis desktop 10.2.1, But when trying to install arcgis server it said that it wont be installed until i upgrated this list of product to 10.2, but i get empty list. i have a 64bits machine, and my arcgis for desktop is installed on program files (*86) could it be the source of the problem?

A: You cannot have different versions of the ArcGIS Suite installed on the same machine.  You already have Desktop 10.2.1 installed, so you need to install Server 10.2.1 or uninstall Desktop and reinstall the 10.2 version.  As a third option, install Server on a different machine.
I assume the reason you receive the blank list of software that you "need to upgrade" is because the installer sees that the server version is different from the installed version of Desktop and is smart enough to realize that Desktop is not a lower version so doesn't list it (though not smart enough to give you an error message that makes sense for your situation).


text:
Q: Spacing between checkboxes and values JSFiddle
How would I go about editing the HTML/CSS  to create spacing between each checkbox/value pairing? Right now each checkbox and each value are spaced evenly. I'd like value1 to be close to checkbox1, but checkbox2 to have some distance from the value1.
Code here:
.checkboxes {
  text-align:center;
}

.checkboxes input{
  margin: 0 20px 0;
}

    <input type="checkbox" name="One" value="One"> One
    <input type="checkbox" name="Two" value="Two"> Two
    <input type="checkbox" name="Three" value="Three"> Three
    <input type="checkbox" name="Four" value="Four"> Four

A: Use This Code

.checkboxes {
  text-align:center;
}

.checkboxes input{
  margin: 0px 0px 0px 0px;
}

.checkboxes label{
  margin: 0px 20px 0px 3px;
}

      <input type="checkbox" name="Mow" value="Mow"> One
      <input type="checkbox" name="Weedeat" value="Weedeat"> Two
      <input type="checkbox" name="Edge" value="Edge"> Three
      <input type="checkbox" name="Other" value="Other"> Four

A: you need to reduce right margin a bit and may need to increase left margin
.checkboxes input{
  margin: 0 5px 0 30px;
}

.checkboxes {
  text-align:center;
}

.checkboxes input{
  margin: 0 5px 0 30px;
}

        <input type="checkbox" name="Mow" value="Mow"> One
        <input type="checkbox" name="Weedeat" value="Weedeat"> Two
        <input type="checkbox" name="Edge" value="Edge"> Three
        <input type="checkbox" name="Other" value="Other"> Four

A: Use CSS in this way margin: top left bottom right;
.checkboxes input{
  margin: 0 5px 0 20px;
}

.checkboxes {
  text-align:center;
}

.checkboxes input{
  margin: 0 5px 0 20px;
}

    <input type="checkbox" name="One" value="One"> One
    <input type="checkbox" name="Two" value="Two"> Two
    <input type="checkbox" name="Three" value="Three"> Three
    <input type="checkbox" name="Four" value="Four"> Four

A: You can add a ID to checkbox one and write a style for that separately,
JSFiddle Code Here
   #chk1 {
      margin :0px !important;
    }

    <input type="checkbox" id="chk1" name="Mow" value="Mow"> One
    <input type="checkbox" name="Weedeat" value="Weedeat"> Two
    <input type="checkbox" name="Edge" value="Edge"> Three
    <input type="checkbox" name="Other" value="Other"> Four

A: You are currently declaring three values for the input's margin.
Declare four so you can target top, left, bottom, and right, respectively.

.checkboxes {
  text-align: center;
}

.checkboxes input{
  margin: 0 0 0 20px;
}

    <input type="checkbox" name="One" value="One"> One
    <input type="checkbox" name="Two" value="Two"> Two
    <input type="checkbox" name="Three" value="Three"> Three
    <input type="checkbox" name="Four" value="Four"> Four

A: you added padding on both side of checkbox
 /*margin: 0 20px;*/
  margin-left: 40px;

.checkboxes {
  text-align:center;
}

.checkboxes input{
  /*margin: 0 20px;*/
  margin-left: 40px;
}

    <input type="checkbox" name="One" value="One"> One
    <input type="checkbox" name="Two" value="Two"> Two
    <input type="checkbox" name="Three" value="Three"> Three
    <input type="checkbox" name="Four" value="Four"> Four

A: Just wrap each input and its text in its own element and give them spacing of some kind:

    <input type="checkbox" name="One" value="One">
    One

    <input type="checkbox" name="Two" value="Two">
    Two

    <input type="checkbox" name="Three" value="Three">
    Three

    <input type="checkbox" name="Four" value="Four">
    Four

.checkboxes {
  padding: 10px;
}

span {
  margin-left: 10px;
  margin-right: 10px;
}

https://jsfiddle.net/8to42fz8/5/

Also, what you want to use for text describing inputs is label, but plain text is just as well here.


text:
Q: Bluetooth "out of band" (OOB) limitation for developers on iOS? I'm generally curious what the reasons are why Bluetooth Out of Band is limited for 3rd party devs on iOS. It seem's like iOS is supporting it see Apple Watch pairing etc.
But why it's not public than for us?
Thanks you!


text:
Q: Using @inlineCallbacks in Twisted trial unit tests I have some trial unit tests. In my code base some methods return deferreds with callbacks added while others are decorated with @inlineCallbacks. I want to run the test without a reactor, as some of the methods don't do any I/O. I tought @inlineCallbacks just returns a deferred, so calling callbacks(0) to fire it would be enough. It seems not the case. Here is a minimal example:
from twisted.trial import unittest
from twisted.internet.defer import inlineCallbacks, returnValue, Deferred

def addone(val):
    d = Deferred()
    def cbk(res):
        return val + 1
    d.addCallback(cbk)
    return d

@inlineCallbacks
def call_addone(val):
    res = yield addone(val)
    returnValue(res)

class Tester(unittest.TestCase):

    def test_addone(self):
        d = addone(2)
        d.callback(0)   # whatever I pass is ignored
        self.assertEqual(3, self.successResultOf(d))

    def test_call_addone(self):
        d = call_addone(4)
        d.callback(0)   # whatever I pass is set as deferred's result
        self.assertEqual(5, self.successResultOf(d))

When I call addone(2) I get back a deferred that will return 2+1 when I fire it with callback(0). In this case the value passed to callback is ignored.
In the second test call_addone(4) returns a deferred too. But in this case the parameter passed to it is ignored, instead the return value will be whatever I pass to callback(). Why? I am clearly missing something.
Here is the output of trial runner:
test_trial
  Tester
    test_addone ...                                                        [OK]
    test_call_addone ...                                                 [FAIL]

===============================================================================
[FAIL]
Traceback (most recent call last):
  File "tests/test_trial.py", line 31, in test_call_addone
    self.assertEqual(5, self.successResultOf(d))
  File "/home/b/.local/share/virtualenvs/twproba-y019OThE/lib/python3.5/site-packages/twisted/trial/_synctest.py", line 432, in assertEqual
    super(_Assertions, self).assertEqual(first, second, msg)
  File "/usr/lib/python3.5/unittest/case.py", line 821, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.5/unittest/case.py", line 814, in _baseAssertEqual
    raise self.failureException(msg)
twisted.trial.unittest.FailTest: 5 != 0

test_trial.Tester.test_call_addone
-------------------------------------------------------------------------------
Ran 2 tests in 0.029s

FAILED (failures=1, successes=1)

A: These lines are pretty much wrong (given that call_addone is defined with inlineCallbacks):
    d = call_addone(4)
    d.callback(0)   # whatever I pass is set as deferred's result

This goes along with these lines being weird (given that inlineCallbacks is not used):
    d = addone(2)
    d.callback(0)   # whatever I pass is ignored

In both cases, you are asking some library code to create a Deferred and then your application code is supplying a result for the Deferred.  Since addone does what you want, clearly it's possible to use Deferred this way.  However, it's not a good practice.  Best practice is for the responsibility for creating and firing a Deferred to lie in the same place.  So, in this case, with the implementation of addone.
The reason your failing test fails is that you've not accounted for the implementation of inlineCallbacks which believes that it is indeed responsible for firing the Deferred it returns.  And the Deferred it returns is not the Deferred returned by the addone call it makes.  It keeps that Deferred to itself.
The result of d in:
    d = call_addone(4)
    d.callback(0)   # whatever I pass is set as deferred's result

is 0 precisely because you've supplied a result of 0.  You've supplied the result to the inlineCallbacks-managed Deferred and short-circuited all of the rest of the implementation of inlineCallbacks.  If the Deferred returned by addone did ever fire, you would likely see an AlreadyCalledError because inlineCallbacks would try to supply a result to d, the Deferred you already supplied a result to.


text:
Q: An error occurs when using ezdxf to describe the layer property description An error occurs when using ezdxf to describe the layer property description.
There are layer names that cause errors and layer names that do not. I do not know the cause.
I tried using the code below.
lay = dwg.layers.get('MyLayerHere')
app = 'AcAecLayerStandard'
dsc = 'MyDescriptionHere'

if lay.tags.has_xdata(app):
    lay.tags.set_xdata(app, [(1000, ''), (1000, dsc)])
else:
    dwg.appids.new(app)
    lay.tags.new_xdata(app, [(1000, ''), (1000, dsc)])

error contents
Traceback (most recent call last): File "file.py", line 777, in dwg.appids.new(app) File "C:\・・・\table.py", line 63, in new raise DXFTableEntryError('%s %s already exists!' % (self._dxfname, name)) ezdxf.lldxf.const.DXFTableEntryError: APPID AcAecLayerStandard already exists!

A: This error will arise in your code when attempting to assign a description to a layer without an existing description, but within a drawing containing other layers with a description (i.e. within a drawing in which the AcAecLayerStandard Application ID is already registered).
To avoid this, simply test whether the AcAecLayerStandard Application ID is already registered before adding it to the APPID symbol table, e.g.:
lay = dwg.layers.get('MyLayerHere')
app = 'AcAecLayerStandard'
dsc = 'MyDescriptionHere'

if lay.tags.has_xdata(app):
    lay.tags.set_xdata(app, [(1000, ''), (1000, dsc)])
else:
    if app not in dwg.appids:
        dwg.appids.new(app)
    lay.tags.new_xdata(app, [(1000, ''), (1000, dsc)])


text:
Q: Unable to reference new environments with RefTeX I was trying to add new environments to AUCTeX doing what the RefTeX's manual says, so I added the following to my .emacs:
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)

(setq reftex-label-alist
   '(("axiom"   ?a "ax:"  "~\\ref{%s}" nil ("axiom"   "ax.") -2)
     ("theorem" ?h "thr:" "~\\ref{%s}" t   ("theorem" "th.") -3)))

(add-hook 'LaTeX-mode-hook
   (lambda ()
     (LaTeX-add-environments
       '("axiom" LaTeX-env-label)
       '("theorem" LaTeX-env-label))))

The problem is that i have to reference these labels manually.
I've tried to do what the RefTeX manual says:

For example if you write: 'As we have shown in Theorem'and then press C-c ), RefTeX will know that you are looking for a theorem label and restrict the menu to only these labels without even asking.

But with the following MWE
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\newtheorem{axiom}{Axiom}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{axiom}
  \label{ax:1}
  An axiom
\end{axiom}
\begin{theorem}
  \label{thr:1}
  A theorem
\end{theorem}

As we have shown in Theorem
\end{document}

it does not work, because it shows me the Axiom and the Theorem and doesn't even let me choose one (so I have to press sspace and then choose one).
What could be the problem?

A: As a quick fix, you can set the toc variable to nil.
From the RefTeX manual :

A negative value will make unnumbered entries. Useful only for theorem-
  like environments which structure the document. Will be ignored for
  macros.

I fail to see how theorem-like environments are supposed to structure the document, but I understand that a label with negative depth in toc isn't made for crossreferencing.
A positive value works under some circumstances for me, and doesn't under others.
(setq reftex-label-alist
   '(("axiom"   ?a "ax:"  "~\\ref{%s}" nil ("axiom"   "ax."))
     ("theorem" ?h "thr:" "~\\ref{%s}" t   ("theorem" "th."))))

A: TL;DR: The version of reftex that comes with emacs is based on reftex 4.31. The current version of reftex is 4.34. It contains, among others, the following two changes:

2008-05-03  Ralf Angeli

*

*lisp/reftex-parse.el (reftex-parse-from-file): Move backward one
      char if a `\' was matched after a section macro.

  2008-04-13  Ralf Angeli

*

*lisp/reftex-parse.el (reftex-parse-from-file): Use beginning of
      match instead of end as bound.

You can also see the relevant bits here:
https://github.com/DamienCassou/RefTeX/commit/5f341de11651f7ec7eaed11f8faf0b2019a3b089
https://github.com/DamienCassou/RefTeX/commit/c1468af43fc660511551dc5a5ba5585db68e5cfc
Those two commits fix your problem. If you'd like to know more about what the problem is, please read on :)
You've associated the type "h" with theorems (through the ?h in reftex-label-alist). If you press C-c ) after the word Theorem, reftex-reference will be called and it will guess that you want a reference of type "h". You can also explicitly call (reftex-reference "h") from anywhere. reftex-reference is just a wrapper around reftex-offer-label-menu. You can thus also just call (reftex-offer-label-menu "h") to see a list of references (except that, again, it will be empty). That function is again a wrapper around reftex-insert-docstruct that is called in a temporary read-only buffer with special navigation handling.
In reftex-insert-docstruct, information on labels is retrieved from (symbol-value reftex-docstruct-symbol), which is filled through reftex-access-scan-info. The corresponding variable contains plenty of data. Here's what matters:
If you execute the following snippet of code in your minibuffer (using M-:):
(let (ls)
  (reftex-access-scan-info)
  (dolist (i (symbol-value reftex-docstruct-symbol) ls)
    (when (stringp (car i))
      (push (concat "Label: " (nth 0 i) ", Type: " (nth 1 i)) ls))))

you should get the following output:
("Label: thr:1, Type: s" "Label: ax:1, Type: s")

That tells you that the labels thr:1 and ax:1 have type "s" rather than "h" and "a", respectively. You can also double-check that by replacing sspace with ss in your workflow.
In the above, reftex-access-scan-info populates reftex-docstruct-symbol. It does that by tying reftex-docstruct-symbol to a variable using reftex-tie-multifile-symbols and the calling reftex-do-parse, which calls reftex-parse-from-file.
reftex-parse-from-file parses the TeX buffer by repeatedly searching using the regular expression reftex-everything-regexp; during scanning, that will look something like this:
"\\\\label{\\([^}]*\\)}\\|\\(^\\)[  ]*\\\\\\(begin{theorem}\\|begin{axiom}\\|part\\|chapter\\|section\\|subsection\\|subsubsection\\|frametitle\\|paragraph\\|subparagraph\\|addchap\\|addsec\\)\\*?\\(\\[[^]]*\\]\\)?[[{   \n]\\|\\(^\\)[  ]*\\\\\\(include\\|input\\)[{   ]+\\([^}    \n]+\\)\\|\\(^\\)[  ]*\\(\\\\appendix\\)\\|\\(\\\\glossary\\|\\\\index\\)[[{]"

Once it finds a match, it checks what pair of parentheses contains captured something. For the theorem and axiom environments and their labels, we get two matches -- that makes these environments different from e.g. equation, since there we only get a match for the label.
The first match, for the environment, comes from reftex-section-labels-all;
it's what causes the problem (as already pointed out by @T.Verron). Anything matched by that will be treated as a section (and thus get a label of type "s").
That is why replacing
(setq reftex-label-alist
   '(("axiom"   ?a "ax:"  "~\\ref{%s}" nil ("axiom"   "ax.") -2)
     ("theorem" ?h "thr:" "~\\ref{%s}" t   ("theorem" "th.") -3)))

with
(setq reftex-label-alist
   '(("axiom"   ?a "ax:"  "~\\ref{%s}" nil ("axiom"   "ax."))
     ("theorem" ?h "thr:" "~\\ref{%s}" t   ("theorem" "th."))))

serves as a workaround: it removes the first match.


text:
Q: Doubts about proof of completeness of finite-dimensional normed spaces
Every $n$-dimensional normed space $X$ (over $\mathbb R$ or $\mathbb C$) is complete.

Let $\{e_1,\dots,e_n\}$ be a basis for $X$ and define the norm $\|\cdot\|$ on $X$ by $\|x\|=\max_{i\leqslant n}|\alpha_i|$ whenever $x=\sum_{i=1}^n\alpha_ie_i$. We take a Cauchy sequence $(x_k)$. Since all $x\in X$ can be written as a unique linear combination of $\{e_1,\dots,e_n\}$, we write $x_k=\sum_{i=1}^n \alpha^k_i e_i$ for each $k\in\mathbb N$ and given $\varepsilon>0$, we know that there is $N$ such that $$ k,m\geqslant N\implies\|x_k-x_m\|=\left\|\sum_{i=1}^n\big(\alpha_i^k-\alpha_i^m\big)e_i\right\|=\max_{i\leqslant n}\big|\alpha_i^k-\alpha_i^m\big|<\varepsilon.$$ Then, for fixed $i\leqslant n$, we have $\big|\alpha_i^k-\alpha_i^m\big|<\varepsilon$ for $k,m\geqslant N$, i.e. $\big(\alpha_i^k\big)_{k\geqslant 1}$ is a Cauchy sequence in the complete space $\mathbb R$ (or $\mathbb C$) and thus converges to some $\alpha_i\in\mathbb R$ (or $\mathbb C$) for each $i\leqslant n$. Set $x=\sum_{i=1}^n\alpha_ie_i$ and let $m\to\infty$ in the above displayed equation so that $$k\geqslant N\implies \|x_k-x\|=\left\|\sum_{i=1}^n\big(\alpha_i^k-\alpha_i\big)e_i\right\|=\max_{i\leqslant n}\big|\alpha_i^k-\alpha_i\big|.$$

At this point, my notes say that that the right-hand side above is $\leqslant \varepsilon$, instead of $<\varepsilon$. In general as I see it we have that there are $N_i$ such that $\big|\alpha_i^k-\alpha_i\big|<\varepsilon$ whenever $k\geqslant N_i$ for each $i\leqslant n$. Thus, for $k\geqslant \max_i N_i$ we have $\|x_k-x\|=\max_{i\leqslant n}\big|\alpha_i^k-\alpha_i\big|<\varepsilon$. But again, it is $<\varepsilon$, not $\leqslant \varepsilon$.

*

*Why do we have to include the possibility of equality with $\varepsilon$;

*Can we not bypass all this by writing $\lim_{k\to\infty}\|x_k-x\|=\lim_{k\to\infty}\max_{i\leqslant n}\big|\alpha_i^k-\alpha_i\big|=0$?
Thanks in advance.


text:
Q: CSS doesn't effect in blade I'm encountering a problem today: I just created a new blade view that displays my HTML, but my CSS doesn't work! I tried several ways like putting it directly on the page, putting it outside my layout, nothing to do... it works on all my other pages that are exactly the same place on my workspace.
Here is my blade file:
@extends('layouts.default')

@section('content')

{{ $article->titre }}

                                        {{ $article->created_at->format('d/m/Y') }}

{{ $article->description }}

                                    <input type="text" name="search" class="search-btn" placeholder="Search Here">

Recent posts

Stetina savours Tour de France return

Top Fitness Gear to Help You Workout

The Southern Ocean is the 'newest' named ocean

@endsection

My Layout integrations:
<link type="text/css" rel="stylesheet" href="template/css/bootstrap.min.css">
    <link type="text/css" rel="stylesheet" href="template/font-awesome/css/font-awesome.min.css">
    <link type="text/css" rel="stylesheet" href="template/css/animate.min.css">
    <link type="text/css" rel="stylesheet" href="template/css/flexslider.css">
    <link type="text/css" rel="stylesheet" href="template/css/style.css">

    <link href="template/css/fonts/poppins.css" rel='stylesheet' type='text/css'>
    <link href="template/css/fonts/open-sans.css" type='text/css'>
    <link href="template/css/fonts/lato.css" rel='stylesheet' type='text/css'>

My workspace looks like this:

A: Try this
<link type="text/css" rel="stylesheet" href="/template/css/bootstrap.min.css">
<link type="text/css" rel="stylesheet" href="/template/font-awesome/css/font-awesome.min.css">
<link type="text/css" rel="stylesheet" href="/template/css/animate.min.css">
<link type="text/css" rel="stylesheet" href="/template/css/flexslider.css">
<link type="text/css" rel="stylesheet" href="/template/css/style.css">

<link href="/template/css/fonts/poppins.css" rel='stylesheet' type='text/css'>
<link href="/template/css/fonts/open-sans.css" type='text/css'>
<link href="/template/css/fonts/lato.css" rel='stylesheet' type='text/css'>


text:
Q: Exchange server 2016: Local telnet on port 25 works fine but telnet to port 25 from external IP does not show banner I have been trying to setup Exchange 2016 for few days.
everything is working perfectly. emails are working locally but sending emails from gmail and other outsiders does not work.
i have setup my DC with this domain name "foo.local"
and my email domain is "foo.us"
out Exchange is hosted behind the firewall. and all necessary ports are being forwarded and tested specially 25
now i have setup everything properly. MX, autodiscover, mail.foo.us etc. even test from https://testconnectivity.microsoft.com/ (outlook connectivity seems pass) (but fail with inbound smtp email saying "The connection was established but a banner was never received."
i can exchange emails b/w local account just fine.
when i telnet from any local PC to server i see this banner.
220 mail.foo.us Microsoft ESMTP MAIL Service ready at Mon, 9 Apr 2018 01:02:24 -0700
but when i telnet to my server from external IP. or from internet
Trying 108.x.x.148...
Connected to mail.foo.us.
Escape character is '^]'.
(the upper massage shows no banner)
"default frontend" Connector is set with listening on All IPs and providing annonymus access to outsider. but still no luck please help.

A: The only thing it could be on Exchange is the remote IP address range. That needs to be set to allow connections from all IP addresses - which is the default.
Other than that, it is unlikely to be an Exchange issue. I would be looking at your firewall. Even if you didn't have anonymous enabled, you would still get the banner, because it would connect. No banner means the connection isn't being made to Exchange.


text:
Q: JQuery : troubles selecting an html element that is clicked on In a django project, I'm trying to make a table with cells turning red when user clicks on it.
here is my template :

Horaire

lun.

Mar.

Mer.

Jeu.

Ven.

Sam.

Dim.

    {% with hours="9h 9h30 10h 10h30 11h 11h30 12h 12h30 13h 13h30 14h 14h30 15h 15h30 16h 16h30 17h 17h30 18h 18h30 19h 19h30 20h 20h30 21h" %}
    {% for i in hours.split %}

{{ i }}

    {% endfor %}
    {% endwith %}

But that script does nothing, even in the console log nothing appears.
Then I tried to remove the "onclick" attribute on the cells and imported a js file with this code (I tried the following functions one after the other) with no more results :
$(document).ready(function() {

$("#this_week").children().find('.available').click(function(event){
    $(event.target).removeClass("available").addClass("unavailable");
    console.log($(event.target));
});

$("#this_week").children().find('.available').click(function(){
    $(this).removeClass("available").addClass("unavailable");
    console.log($(this));
});

});

I also tried to remove the "children()" part and other little changes but I don't know what to try next. Any ideas about what I'm doing wrong ?

A: Here is the simplest method
All I did was to remove the onclick and add
$(".available").on("click",function() {
  $(this).toggleClass("available unavailable");
});

The creation of the table is irrelevant, I use jQuery here purely to create the cells for the example

$.each("9h 9h30 10h 10h30 11h 11h30 12h 12h30 13h 13h30 14h 14h30 15h 15h30 16h 16h30 17h 17h30 18h 18h30 19h 19h30 20h 20h30 21h".split(" "),function(i,hour) {

        $("#hours").append(`

${hour}

`);
})
$(".available").on("click",function() {
  $(this).toggleClass("available unavailable");
});
.available { background-color:green }
.unavailable { background-color:red }

Horaire

Lun.

Mar.

Mer.

Jeu.

Ven.

Sam.

Dim.

A: You need pass this in onclick function, by defualt this refers to window object.
HTML

Js

A: Remove onclick=deliveryBooking(), and use this code.
$('#this_week').on('click', '.available, .unavailable', function(){
    $(this).toggleClass('available unavailable')
})

This code uses event delegation. Please read jQuery API in case you need to understand more. .on / .toggleClass
On an unrelated note, I think your markup is probably wrong.  is used for table headers, while you  for cells which contain actual data. I think all the  within you for loop need to be changed to , except the first one.


text:
Q: Give a bijection from $\Bbb N\to\omega^{\omega}$ based upon counting consecutive similar digits of binary strings Question
Give a bijection from $\omega^{\omega}\to\Bbb N$ based upon counting consecutive similar digits of binary strings:  There is a near-bijection given in attempt 1 below; the aim is to fix it to give a bijection with near order-isomorphism to the original function.
$\omega^{\omega}$ is the set of ordinals expressible in Cantor normal form as:
$$\sum_{i=k}^0\omega^i\cdot a_i:a_i\in\Bbb N_{\geq0}$$
Step 1
A near-bijection is to let $a_i$  count the number of consecutive ones and twos in an integer's binary representation:
$27=11011_2\mapsto\omega^2\cdot2+\omega+2$
But since there are no zero-length sequences of ones or twos in binary representations, this is unable to represent any ordinal having a finitely long sequence of consecutive zero coefficients.  For example $\omega^2+2$ has no binary string representation.
Step 2
One can then reduce each coefficient by $1$ like this:
$27=11011_2\mapsto\omega^2+1$
This now represents zero coefficients, but it fails to inject because it gives the same ordinal $0$ for all the following numbers:
$S_n=1,2,5,10,21,42,85,\ldots$.
Attempt
The task is to fix this approach with a near order-isomorphism.  I'm not sure how to proceed but I have a rough hunch we might be able to add or multiply a number (which may not truly be an ordinal) of the following form or similar:
$$\beta=\sum_{i=0}^\infty\omega^{2i+k}\cdot$$
Also, perhaps we can count up the number of $S_n$ having a representation shorter than any given integer and increase the ordinal by that many.  But I'm unclear precisely how to complete the job.

A: I don't know why you insist on talking about ordinals when Noah told you it is nothing more than an unnecessary distraction, since a bijection from naturals to finite sequences of naturals will do. Here is one bijection based on the binary representation and blocks of consecutive similar digits:

*

*Map $0$ to $⟨⟩$.

*For each positive natural $n$, write down the binary representation of $n$, and split it into blocks each of which starts with a "$1$" and has only "$0$"s after that, and count the number of zeroes in each block, and map $n$ to that sequence of counts. For example, $1101_2$ is mapped to $⟨0,1,0⟩$.

Note that every positive natural is mapped to a unique non-empty tuple, and that every non-empty tuple is mapped to from some positive natural.
To biject from finite sequences to finite sequences where the first term (if any) is non-zero, simply add one to that first term.
Alternatively (as said in comments), to biject from naturals to $ω^ω$, pad the binary representation with infinitely many zeroes to its left, and map it to the finite sum $\sum_{k=0}^∞ ω^k·a_k$ where $a_k$ is the number of ones after the $(k+1)$-th rightmost zero but before the $k$-th rightmost zero (or the rightmost end if $k=0$). This also handles $0$ correctly. Obviously, you can also compute the mapping without doing the padding.


text:
Q: Identifying RHEL disk other than by UUID in /etc/fstab for Disaster Recovery from another site For our disaster recovery setup there is a set of disk which are replicated from our production site to the disaster site. On the production site the RHEL servers have /boot filesystem setup on disks specified via UUID in the /etc/fstab .
However when the DR counterpart server at the disaster site is booted up with the replicated root disk from the disaster site storage array instead, then the UUIDs for the disk with the production data are different so that the system cannot find the /boot device.
So I am hoping to find some thoughts on the best practice for setting up /etc/fstab so they will create consistently even where the UUID for the physical devices may change.
The reason that UUID is chosen to reference disk in /etc/fstab is due to these being SAN attached disk. So if target path to disk changes or something else, then we need to make certain that /boot FS will always be found via something unique.
Filesystems on the logical volumes are referenced using LV path instead.

A: For /boot you should be able to label the filesystem and then refer to it by label. Indeed, by default RHEL already labels /boot as /boot.
e2label /dev/disk/by-uuid/**** /boot

will change the disk's label to /boot.
You can then refer to it in /etc/fstab:
LABEL=/boot       /boot           ext3            rw,relatime        0 2

LVM volumes should just be referred to by their VG/LV as you are already doing.


text:
Q: About -derived subgroup- of a group $G$ This question is already solved, I am typing down the resolution from manual solutions. However there are some steps that I did not understand properly, could anyone help me?
P.S. My doubts are in ${\color{red}{\text{Color Red}}}$.
QUESTION: Let $G$ be a group and $\mathcal{H}$ be a family of normal subgroups $N$ of $G$ such that $G/N$ is abelian. Let $I=\displaystyle\bigcap_{n \in \mathcal{H}} N$ the intersection of subgroups of $G$ belonging to the family $\mathcal{H}$. Prove that $G/I$ is abelian.
$I$ is called by derived subgroup or commutative subgroup of $G$.
SOLUTION FROM MANUAL SOLUTIONS:
Let's consider the direct product $X=\displaystyle\Pi_{N \in \mathcal{H}} G/N$. We have the canonical homomorphism $\pi:G\rightarrow X$, given by $g\mapsto \displaystyle(gN)_{N\in \mathcal{H}}$, which the kernel is $I$, then by the isomorphism theorem we have $G/I$ is isomorph to a subgroup of $X$. However $X$ is abelian, and because this it is a direct product of abelian groups, it follows that $G/I$ is abelian too.
${\color{red}{\text{Why kernel$(\pi)=I$?}}}$

A: We have the following sequence of equivalent statements:
$$\begin{align}
g \in \ker \pi &\iff \forall N \in \mathcal H : gN = N\\
& \iff \forall N \in \mathcal H : g \in N \\
&\iff g \in \bigcap_{N \in \mathcal H}N.
\end{align}$$

A: $gN=e\in G/N\iff gN=N\iff g\in N$.
But $g\in\operatorname{ker}\pi\iff gN=e\in G/N,\,\forall N\in\mathcal H$.
Thus $\operatorname{ker}\pi=\bigcap_{N\in\mathcal H}N$.


text:
Q: DB2 connection string password encryption I am working on .net application which connect with DB2 ibm.
Connection string used in web.config file is

Client run fortify tools which find vulnerability in code for above mentioned code they mentioned like that there is insecure transport database in connection string.
In c# normal sql server connectivity we can resolve it by passing encrypt=true and TrustServerCertificate=false how we can do it for DB2?
In SQL server case we install TLS1.2 and use third part certificate as we disable self signed certificate.


text:
Q: How to prevent installing documentation for gems automatically using gem v. 2.0 Previously set up my system to suppress installing gem documentation with --no-ri and --no-rdoc.
Ruby 2.0.0 and gem 2.0.0 seems to have removed the --no-ri flag (and functionality?).
Even when specifying --no-rdoc, I still get installing documentation:
~/dev/ruby> gem install bundler --no-rdoc
Fetching: bundler-1.3.1.gem (100%)
Successfully installed bundler-1.3.1
Done installing documentation for bundler (0 sec).

How to see whether or not documentation is installed? If it is installed, how to suppress for all gem installs?

A: The option has changed to --no-document (see http://rubygems.rubyforge.org/rubygems-update/History_txt.html)

A: As gem help install states:

Usage: gem install GEMNAME [GEMNAME ...] [options] -- --build-flags [options]
...
  Install/Update Options:
    ...
        --[no-]document [TYPES]      Generate documentation for installed gems
                                     List the documentation types you wish to
                                     generate.  For example: rdoc,ri
    -N, --no-document                Disable documentation generation

In short:

*

*--no-rdoc is now --no-document rdoc

*--no-ri is now --no-document ri.

*You can prevent both from installing with either --no-document or -N.
(Unfortunately as of this writing the documentation on Rubygems.org is currently out-of-date, so ignore that for now.)


text:
Q: react native using multi props to same component i'm using ReactNative with Expo, trying build reusable component there is to many props i will use to change the title , image and description.
ServiceCardDescription.js
  export default function ServiceCardDescription(props) {
    return (
        <TouchableOpacity
        style={[
          styles.Box,
          {
            flexDirection: i18n.locale == "ar"? 'row-reverse' : 'row',
          },
        ]}
        onPress={() => {
          Analytics.logEvent("select_serivce", {
            selected_service: "writing",
          });
          this.props.navigation.navigate("Gender", {
            search_type: 2,
            requestType: 1,
          });
        }}
      >
        <Image
          source={require("../../assets/images/writingIcon.png")}
          style={{
            width: "20%",
            height: 48,
          }}
        />
        <View>
        <Text
          style={{
            fontSize: 14,
            lineHeight: 20,
            letterSpacing: 0,
            textAlign: i18n.locale == "ar" ? "right" : "left",
            color: "#8f92a1",
            fontFamily: "FrutigerLTArabicBold",
          }}
        >
          {i18n.t("home.writing")}
        </Text>
        <Text
          style={{
            fontSize: 10,
            lineHeight: 20,
            color: "#8f92a1",
            fontFamily: "FrutigerLTArabicBold",
          }}
        >
          {i18n.t("home.writingDescription")}
        </Text>
        </View>
      </TouchableOpacity>
    );
  }

i store all these value one name, so can i use some specific variable and send it as props working on title , image and description ?
at the onPress selected_service: "writing" , Image tag there is writingIcon, Text tag writing and writingDescription
how can i render the component <ServiceCardDescription/> with these props ?

A: This might help
Usage:
export default function App() {

  // create props here
  const data = {
    selected_service: "writing",
    image: require("../../assets/images/writingIcon.png"),
    desc: i18n.t("home.writingDescription"),
  };

  return (
    <View>
      <ServiceCardDescription data={data} />
    </View>
  );
}

ServiceCardDescription.js
export default function ServiceCardDescription(props) {
  // extract props here
  const { selected_service, image, desc } = props.data;

  return (
    ....
      onPress={() => {
        Analytics.logEvent("select_serivce", {
          selected_service: selected_service,
        });
        ....
      }}
    >
      <Image
        source={image}
        style={{
          width: "20%",
          height: 48,
        }}
      />
      <View>
        <Text
          ....
        >
          {i18n.t("home.writing")}
        </Text>
        <Text
          ....
        >
          {desc}
        </Text>
      </View>
    ....
  );
}