text:
Q: Install and Uninstall Your Windows Service Using Pre-build and Post-Build Events I have these scripts in pre-build and post-build events of visual studio for uninstalling and installing windows service
%WinDir%\Microsoft.NET\Framework\v4.0.30319\installutil /u "$(TargetPath)"

%WinDir%\Microsoft.NET\Framework\v4.0.30319\installutil "$(TargetPath)"

When I build first time it works;
When I rebuild, I get this file not found exception
 System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Projects\DeviceManagement.ServiceHost\bin\Debug\DeviceManagement.ServiceHost.exe' or one of its dependencies. The system cannot find the file specified..
I can see this exe file in my debug folder though.

A: Rebuild does a clean, so it makes sense that the output isn't going to be there on pre-build. No need to do anything in the pre-build event.


text:
Q: Converting a pointer to a double pointer in C I would like to call a method with the following signature.
error (*handler)(obj **, const char *, void*)

Because the context variable is a pointer, it needs to be converted to a pointer to a pointer. However, doing it the following way throws the compile error gfserver.c:185:20: error: invalid type argument of unary '*' (have 'gfcontext_t {aka struct gfcontext_t}'). How can this pointer be converted to a double pointer?
obj *context = (obj *)malloc(sizeof(obj));
m->handler(**context, request, handlerarg);

A: For any pointer (or array) p and index i, the expression *(p + i)  is exactly equal to p[i]. From that follows that *p is equal to p[0].
Put into the context (pun not intended) of your question, **context would then be equal to context[0][0] which makes no sense.
It seems you should use the address-of operator & to get a pointer to the pointer. As in &context.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Using multiple TCA9548A multiplexers The case is that I have 5 temperature sensors.
I want to connect 4 of them to the first TCA9548A (TCAADDR0), the SDA and SCL busses (from the ports 0 to 3) and connect the fifth one to the second TCA9548A (TCAADDR1).
If the fifth sensor connect is connected to the busses 0 to 3 of TCAADDR1, I receive an incorrect temperature. However, if I connect it the busses No.4 of the TCAADDR1, I receive the correct temperature.
I think the problem is that I can not switch off the TCAADDR0 and only talk to the TCAADDR1.
On the other hand, if I connect A0 of the TCAADDR1 to the 5V, I have 3 addresses 0x70 0x71 and 0x77. If I don't connect it, I have 0x70 and 0x77. So I decided not to connect A0 to 5V.
This is my program code:
#include <Wire.h>
#include <Adafruit_BMP085.h>
Adafruit_BMP085 bmp;

Adafruit_BMP085 bmp180_0;
Adafruit_BMP085 bmp180_1;
Adafruit_BMP085 bmp180_2;
Adafruit_BMP085 bmp180_3;
Adafruit_BMP085 bmp180_4;

#define TCAADDR0 0x70
#define TCAADDR1 0x77

void tcaselect0(uint8_t sensor) {
  unsigned int mask = 1 << sensor;
  Wire.beginTransmission(TCAADDR0);
  Wire.write(lowByte(mask));
  Wire.endTransmission();
  Wire.beginTransmission(TCAADDR1);
  Wire.write(highByte(mask));
  Wire.endTransmission();
  delay(1);
}

void tcaselect1(uint8_t sensor) {
  unsigned int mask = 1 << sensor;
  Wire.beginTransmission(TCAADDR0);
  Wire.write(lowByte(mask));
  Wire.endTransmission();
  Wire.beginTransmission(TCAADDR1);
  Wire.write(highByte(mask));
  Wire.endTransmission();
  delay(1);
}

void setup() {
  Serial.begin(9600);
  Wire.begin();  //enabling the I2C protocol through the Wire.begin()

  //FIRST SENSOR**
  tcaselect0(0);
  if (bmp180_0.begin() != 0x60)
  { Serial.print(F("BMP180 Nr.1 detected?\t")); Serial.println(F("No"));}
  else
  { Serial.print(F("BMP180 Nr.1 detected?\t")); Serial.println(F("Yes"));}

  //SECOND SENSOR
  tcaselect0(1);
  if (bmp180_1.begin() != 0x60)
  { Serial.print(F("BMP180 Nr.2 detected?\t")); Serial.println(F("No"));}
  else
  { Serial.print(F("BMP180 Nr.2 detected?\t")); Serial.println(F("Yes"));}

  //THIRD SENSOR
  tcaselect0(2);
  if (bmp180_2.begin() != 0x60)
  { Serial.print(F("BMP180 Nr.3 detected?\t")); Serial.println(F("No"));}
  else
  { Serial.print(F("BMP180 Nr.3 detected?\t")); Serial.println(F("Yes"));}

  //FOURTH SENSOR
  tcaselect0(3);
  if (bmp180_3.begin() != 0x60)
  { Serial.print(F("BMP180 Nr.4 detected?\t")); Serial.println(F("No"));}
  else
  { Serial.print(F("BMP180 Nr.4 detected?\t")); Serial.println(F("Yes"));}

Wire.beginTransmission(TCAADDR0);
Wire.write(0);
Wire.endTransmission();

  //*FIFTH SENSOR
  tcaselect1(4);
  if (bmp180_4.begin() != 0x60)
  { Serial.print(F("BMP180 Nr.5 detected?\t")); Serial.println(F("No"));}
  else
  { Serial.print(F("BMP180 Nr.5 detected?\t")); Serial.println(F("Yes"));}

  Serial.println();
  Serial.println(F("##############################"));            //30-times #
  Serial.println(F("Initialization Finished"));
  Serial.println(F("##############################"));            //30-times #
  Serial.println();
  Serial.println();

}

void loop()
{

  //SENSOR-FIRST
    tcaselect0(0);
    Serial.println("*****SENSOR NO.1***** ");
    Serial.print("Temperature = ");
    Serial.print(bmp180_0.readTemperature());
    Serial.println(" *C");

//*SENSOR-SECOND
    tcaselect0(1);
    Serial.println("*****SENSOR NO.2***** ");
    Serial.print("Temperature = ");
    Serial.print(bmp180_1.readTemperature());
    Serial.println(" *C");

//**SENSOR-THIRD
    tcaselect0(2);
     Serial.println("*****SENSOR NO.3***** ");
    Serial.print("Temperature = ");
    Serial.print(bmp180_2.readTemperature());
    Serial.println(" *C");

//*SENSOR-FOURTH
    tcaselect0(3);
     Serial.println("*****SENSOR NO.4***** ");
    Serial.print("Temperature = ");
    Serial.print(bmp180_3.readTemperature());
    Serial.println(" *C");

Wire.beginTransmission(TCAADDR0);
Wire.write(0);
Wire.endTransmission();

//*SENSOR-FIFTH
    tcaselect1(4);
     Serial.println("*****SENSOR NO.5***** ");
    Serial.print("Temperature = ");
    Serial.print(bmp180_4.readTemperature());
    Serial.println(" *C");

    Serial.println();
    delay(2000);

}

A: The TCA9548A has three address pins, A0-A2 which let you set the address of the mux. Therefore, you can place two of them on your main buss, at different addresses (for example, 0x70 and 0x71). I'd place 5 of your sensors on each mux.
To switch between mixes, first write to the first mux, disabling all channels and then write to the second mux, enabling the selected channel. This could be generalized as always disabling the existing channel before enabling the new channel. You could create a table, indexed by the sensor number, containing the addresses of the mux and the value to write into the mux register.


text:
Q: Error in Connecting to TFS with Visual Studio 2012
This is the error I get when I try to connect to TFS. The only change that I had made to Windows Live account was to enable "Two-Step verification".
Visual Studio isn't giving me an option to change the credentials in case I may have entered it wrong the first try I made to connect.
I was able to connect to TFS from another system.
Any help would be appreciated.

A: I was also encountering same error which is resolved after cleaning up cache.
Try after deleting cache from following location in your system :
C:\Users\gaurav1\AppData\Local\Microsoft\Team Foundation

make sure you close all visual studio instances before deleting cache.
Thanks,
Gaurav


text:
Q: Invalid CSS after " ": expected 1 selector or at-rule, was "{" I am trying out Vue with SASS but I run into a problem ben using npm run build. I use webpack sass-loader. Can anyone help me out here? I suspect the problem is somewhere in my webpack config, but I can not find the problem.
Error output:
ERROR in ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-42a765dc","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js?indentedSyntax!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Header.vue
Module build failed:
<template>
^
      Invalid CSS after " ": expected 1 selector or at-rule, was "{"
      in /Users/rafrasenberg/webconexus/src/wcxwebsite/src/components/Header.vue (line 1, column 1)
 @ ./node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-42a765dc","scoped":true,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js?indentedSyntax!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Header.vue 4:14-355
 @ ./src/components/Header.vue
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue
 @ ./src/App.vue
 @ ./src/main.js

The header.vue file:
<template>

UA

        <router-link tag='li' :to="{ name: 'home'}">
          Home
        </router-link>
        <router-link tag='li' :to="{ name: 'cutecat'}">
          CuteCat
        </router-link>

</template>

And now my webpack.config.js:
var path = require('path')
var webpack = require('webpack')
var BundleTracker = require('webpack-bundle-tracker')
var WriteFilePlugin = require('write-file-webpack-plugin')

module.exports = {
  entry: './src/main.js',
  output: {
    path: path.resolve(__dirname, './dist'),
    filename: 'bundle.js'
  },
  plugins: [
  new BundleTracker({filename: 'webpack-stats.json'}),
  new WriteFilePlugin()
  ],
  module: {
    rules: [
      {
        test: /\.scss$/,
           use: [
               "style-loader", // creates style nodes from JS strings
               "css-loader", // translates CSS into CommonJS
               "sass-loader" // compiles Sass to CSS, using Node Sass by default
           ]
      },
      {
        test: /\.vue$/,
        loader: 'vue-loader',
      },
      {
        test: /\.js$/,
        loader: 'babel-loader',
        exclude: /node_modules/
      },
      {
        test: /\.(png|jpg|gif|svg)$/,
        loader: 'url-loader',
        options: {
          name: '[name].[ext]?[hash]'
        }
      }
    ]
  },
  resolve: {
    alias: {
      'vue$': 'vue/dist/vue.esm.js',
      '@': path.resolve('src')
    },
    extensions: ['*', '.js', '.vue', '.json']
  },
  devServer: {
    historyApiFallback: true,
    noInfo: true,
    overlay: true
  },
  performance: {
    hints: false
  },
  devtool: '#eval-source-map'
}

if (process.env.NODE_ENV === 'production') {
  module.exports.devtool = '#source-map'
  // http://vue-loader.vuejs.org/en/workflow/production.html
  module.exports.plugins = (module.exports.plugins || []).concat([
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: '"production"'
      }
    }),
    new webpack.optimize.UglifyJsPlugin({
      sourceMap: true,
      compress: {
        warnings: false
      }
    }),
    new webpack.LoaderOptionsPlugin({
      minimize: true
    })
  ])
}

My package.json with all my installed dependencies:
{
  "name": "wcxwebsite",
  "description": "A Vue.js project",
  "version": "1.0.0",
  "author": "webconexus <raf@webconexus.nl>",
  "license": "MIT",
  "private": true,
  "scripts": {
    "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
    "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
  },
  "dependencies": {
    "vue": "^2.5.11"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ],
  "devDependencies": {
    "babel-core": "^6.26.3",
    "babel-loader": "^7.1.5",
    "babel-preset-env": "^1.7.0",
    "babel-preset-stage-3": "^6.24.1",
    "cross-env": "^5.0.5",
    "css-loader": "^0.28.11",
    "file-loader": "^1.1.4",
    "node-sass": "^4.11.0",
    "sass-loader": "^6.0.7",
    "style-loader": "^0.23.1",
    "vue-loader": "^13.0.5",
    "vue-template-compiler": "^2.4.4",
    "webpack": "^3.12.0",
    "webpack-bundle-tracker": "^0.4.2-beta",
    "webpack-dev-server": ">=3.1.11",
    "write-file-webpack-plugin": "^4.5.0"
  }
}

Who can help me out?

A: If this helps anyone, I got this error because of a wrong indent:
@import ...

  .class
  ...

When it should be:
@import ...

.class
  ...

A:

Webpack.config.js
Add extra rule to it
  {
    test: /\.sass$/,
    use: [
      'vue-style-loader',
      'css-loader',
      {
        loader: 'sass-loader',
        options: {
          indentedSyntax: true
        }
      }
    ]
  }


text:
Q: PostgreSQL performance tuning and max connections (practically) For the past few weeks I've been tuning and messing with PostgreSQL which I'm going to use with my next project.
My Specs are:

*

*DigitalOcean 8 Cores 16GB SSD x2 (One for DB, another for Web)

*Centos 7

*PHP5 , Nginx

The things that I've tried:

*

*Pgtune

*PgBouncer & Pgpool (connection pooling & load balancing)

*Tuning php-fpm & nginx (worker_processes, worker_connections,
    pm.max_children etc)

*Linux file handle limits and socket tweaking.
I'm testing it by calling the webpage with ApacheBench to insert. Is it practical?
ab -n 17500 -c 1750 -r http://example.com/insert.php

So far I can only get it to handle 1700-2000 connections concurrently without dropping any transaction (usually prematurely closed connection or resource temporarily unavailable in nginx error log or Sorry, too many clients already return by PostgreSQL).
I tried both TCP/IP and unix socket for php-fpm and TCP/IP seems to be more scalable than unix socket.
Can PHP use connection pooling? Since the way I'm calling the DB from the web server are still the same(making alot of individual connections to pgpool or pgbouncer).
My goal is to handle at least 10,000 transactions concurrently. What are the deciding factors? Is it a bottleneck between web server to db (php-fpm) or PostgreSQL itself? Usually, how do big companies (PHP web application) handle such volume?

A: The best load test is with a real-world load; the closer to that your load test is, the better.
If you have many concurrent requests, connection pooling is a must and pgBouncer is the standard answer.
It is impossible to do performance tuning in the scope of an answer, and indeed this question will probably be closed for being too broad, but I'll give you some general leads:
The goal is to find the bottlenecks, that is resources where your system is at the limit. Narrow it down: is it the application, the web server, or the database? Once you know which component limits you, find the individual limiting resource. Is it I/O? CPU time? Memory? The time it takes to establish a database connection? Locks?
One important rule is not to start twiddling knobs at random before you know where the problem is. That is likely to give you a misconfigured system. Find a theory, try a solution, and if it does not have the desired effect, reset the setting to the value it had before.
I don't understand your setup: First you say that you have a machine for the database and one for the application, then you say that you tried local socket connections.


text:
Q: How do I animate height of list item upwards without screwing up the other list items? I'm having a bit of a problem with this hover effect I'm trying to create in a menu. I simply want each box to move up a little when hovered over. From what I've produced, however, the height changes fine, but it takes all of the other a's in the list up with it. I want it to individually change height without moving the other menu items at all.
Does anyone have any advice as to what I should do to fix this?
I've tried doing the absolute positioning on the individual a's instead of on the ul, but that ruins the centering (all of the list items collapse into one another and I'm forced to have imprecise positioning that doesn't scale correctly with the browser.)
Thanks for your time and patience (I'm new at this, still learning.)
Here's a fiddle to demonstrate what I'm talking about.
Here's the markup:

Work

About

Blog

Contact

And the CSS:
.nav {
    text-align: center;
}

.nav ul {
    position: absolute;
    bottom: 0;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
}

.nav ul li {
    list-style: none;
    display: inline;
    padding-left: 0.5em;
    padding-right: 0.5em;
}

.nav ul li a {
    display: inline-block;
    text-decoration: none;
    background: #F7941E;
    color: #414042;
    text-transform: uppercase;
    height: 130px;
    width: 120px;
}

.nav ul li a:hover {
    height: 150px;
}

A: Here's what I came up with:
http://jsfiddle.net/lhill86/Lnm6q0wy/
Hope this helps
Added an aditonnal container:

Work

About

Blog

Contact

Here's the CSS:
.nav {
    text-align: center;
}

.nav ul {
    position: absolute;
    bottom: 0;
    margin-left: auto;
    margin-right: auto;
    left: 0;
    right: 0;
    height:150px;
}

.nav ul li {
    list-style: none;
    display: inline-block;
    padding-left: 0.5em;
    padding-right: 0.5em;
    background:white;
    height:150px;
}

.nav ul li a {
    display: inline-block;
    text-decoration: none;
    background:#F7941E;
    color: #414042;
    text-transform: uppercase;
    height: 130px;
    width: 120px;
}
.nest{
    display:inline-block;
    margin-bottom:0px;
    height:130px;
    background-color: #F7941E;
}
.nest a:hover{
    height: 150px;
    margin-top:0px;
}

Edit:
Sorry didn't post the latest version. But here is the final CSS that works:
.nav {
    text-align: center;
}

.nav ul {
    position: absolute;
    bottom: 0;
    margin-left: auto;
    margin-right: auto;
    padding-bottom: 0px;
    margin-bottom:0;
    left: 0;
    right: 0;
    height:150px;
}

.nav ul li {
    list-style: none;
    display: inline-block;
    padding-left: 0.5em;
    padding-right: 0.5em;
    background:white;
    height:150px;
}

.nav ul li a {
    display: inline-block;
    text-decoration: none;
    background:#F7941E;
    color: #414042;
    text-transform: uppercase;
    height: 130px;
    width: 120px;
}
.nest{
    display:inline-block;
    margin-bottom:0px;
    height:130px;
    background-color: #F7941E;
}
.nest a:hover{
    position:relative;
    top:-20px;
    height: 150px;
}

A: Use padding instead like so:
.nav ul li a:hover {
padding-top:30px;
}

Fiddle: http://jsfiddle.net/YoshiMaster/Lnm6q0wy/3/

A: One idea to achieve this is, shifting the margin-top property.
Since you applied display: inline on li, margin-top and margin-bottom will not work on a. You can consider using display: block for li and float them to the left
.nav ul li {
    display: block;
    float: left;
}

Then set a margin-top to a and remove it on hover.
.nav ul li a {
    margin-top: 20px;
}

.nav ul li a:hover {
    margin-top: 0;
}

Thus you will get the desired output.
DEMO


text:
Q: How to make a mouse trail with CSS/JS so that elements are still clickable? I'd like to have a mouse trail when the mouse moves. The trail should be built out of small icons/images loosing capacity over time. (for simplicity I removed the capacity transition code in the demo) I tried to have this effect, creating a grid which lays on top of all other elements. This grid consists of small divs with a background-image. The opacity of every div is set to 0. Visually the solution works, but the elements on the whole page are not clickable any more. How is it possible to have the same visual effect and yet all elements on the page are still clickable?
I tried to make the z-index of clickable elements higher than the z-index of the grid-elements. The elements are then clickable. But then the trail effect does not show on them, which is not what it should be like.
I researched for a solution and came across these pages/tutorials below, but they don't offer a solution to my problem:
https://medium.com/@dailyfire/cursor-trails-3-simple-css-tricks-to-add-to-any-website-part-1-64750798583c
https://www.youtube.com/watch?v=rfpRZ2t_BrQ
Javascript\Jquery mouse cursor - Inconsistencies when hovering items

const body = document.getElementsByTagName("body")[0];
const mouseMovementContainer = document.createElement("div");

mouseMovementContainer.setAttribute("id", "mouseMovementContainer");
mouseMovementContainer.classList.add("mouseMovement");

body.insertBefore(mouseMovementContainer, body.firstChild);

createNewGrid();

function createNewGrid () {
    for(let i = 0; i <= 1000; i++){
        const square = createOneSquare();
        mouseMovementContainer.appendChild(square);
    }
}

function createOneSquare () {
    const div = document.createElement("div");
    div.classList.add("square");
    return div;
}
a{
  font-size: 40px;
}

.mouseMovement {
  background-color: transparent;
  position: fixed;
  z-index: 100;
  display:flex;
  flex-wrap: wrap;
}

.square {
  width: 40px;
  height: 40px;
  background-image: url("https://icon-library.com/images/fire-icon-free/fire-icon-free-1.jpg");
  background-size: cover;
  opacity: 0;
}

.square:hover {
  opacity: 1;
}
Go to Google!!!!

A: Setting the z-index works
Setting pointer events does not work since the mousemove is also removed
.mouseMovement {
  background-color: transparent;
  position: fixed;
  z-index: 100;
  display:flex;
  flex-wrap: wrap;
  z-index: -1;
}

const body = document.getElementsByTagName("body")[0];
const mouseMovementContainer = document.createElement("div");

mouseMovementContainer.setAttribute("id", "mouseMovementContainer");
mouseMovementContainer.classList.add("mouseMovement");

body.insertBefore(mouseMovementContainer, body.firstChild);

createNewGrid();

function createNewGrid () {
    for(let i = 0; i <= 1000; i++){
        const square = createOneSquare();
        mouseMovementContainer.appendChild(square);
    }
}

function createOneSquare () {
    const div = document.createElement("div");
    div.classList.add("square");
    return div;
}
a {
  font-size: 40px;
}

.mouseMovement {
  background-color: transparent;
  position: fixed;
  z-index: 100;
  display:flex;
  flex-wrap: wrap;
  z-index: -1;
}

.square {
  width: 40px;
  height: 40px;
  background-image: url("https://icon-library.com/images/fire-icon-free/fire-icon-free-1.jpg");
  background-size: cover;
  opacity: 0;

}

.square:hover {
  opacity: 1;
}
Go to Google!!!!

A: Setting pointer-events:none; allows you to click "through" the div to the content below.


text:
Q: Error in my proof? What is wrong in this proof. It seems correct to me but still doesn't make proper sense.
$$\sqrt{\cdots\sqrt{\sqrt{\sqrt{5}}}}=5^{1/\infty}=5^0=1$$
EDIT
So does this mean that
$5^{1/\infty} = 1$
$(5^{1/\infty})^\infty = 1^\infty$
But according to me, $1^\infty$ is indeterminate.

A: I guess you mean this:
$$\lim_{n\to\infty}5^{1/2^n}=1$$

A: Let $x=\sqrt{\sqrt{...\sqrt{5}}}$.
$$x^2 = \sqrt{\sqrt{...\sqrt{5}}} = x$$
$$x = 0 \,  or \, 1 $$
Verify:$$\sqrt{5}=2.24$$
$$\sqrt{\sqrt{5}}=1.50$$
$$...$$
From the pattern we can see $x$ tends to $1$, so $x = 0$ is rejected.

A: What seems incorrect is because the language seems informal. Formally, one would write
$$
x_0=5, \quad x_n = \sqrt{x_{n-1}}
$$
to describe the iterations of the square roots. One computes easily that
$$
x_n = x_0^{1/{2^n}}
$$
and since $x_0^{1/n} \to 1$ for all $x_0 > 0$, so does $x_n$. (You can prove this by showing that the logarithm of the sequence goes to $0$ ; this is trivial.)
Hope that helps,

A: $\sqrt{...\sqrt{\sqrt{\sqrt{5}}}}=\lim x_n$, where $x_n=5^{(1/2^n)} (n\in\mathbb{N})$

A: $$n=\sqrt{...\sqrt{\sqrt{\sqrt{5}}}}$$
Since there's an infinite cascade of roots, we can add 1 (or as many as we want):
$$n=\sqrt{...\sqrt{\sqrt{\sqrt{\sqrt{5}}}}}$$
Replacing by the $n$ from the first equation:
$$n=\sqrt{n}$$
or
$$n^2=n$$
Since square roots of a number greater than 1 never can become less than 1, we can discard the solution $n=0$, so we can divide both sides by n, and
$$n=1$$

A: $$\lim_{n\to\infty}x^{1/2^n}=1$$ because the exponent approaches zero

A: Note that $\lim_{n\to \infty}x_n^{y_n}=(\lim_{n\to \infty}x_n)^{\lim_{n\to \infty}y_n}$

A: Using $1/\infty$ doesn't make sense, as already stated, because ∞ is not a number, it is a concept. I believe this is the closest thing to what you're really asking.
$$\lim_{n\to\infty}5^{1/n}=1$$
This is true. n never actually reaches infinity, but we find what happens as it gets closer and closer. And it does, indeed, approach 1.
This is because as n gets larger and larger, 1/n gets smaller and smaller. It is known as infinitesimal, essentially zero. It's a little more complicated than just zero (if you're interested, learn calculus, specifically limits and infinitesimals) but for the purposes of this, it's as good as zero. And because $5^{0}=1$, the limit shown above is equal to 1.
Edit: I'd also like to add that using infinity as a number is a bad idea.
$$1+\infty = \infty$$
$$2+\infty = \infty$$
$$1+\infty = 2+\infty$$
$$1 = 2$$


text:
Q: PowerCLI Get-VM filter out blank IP Address I need to filter out the blanks in the "IP Address" column of the below PowerCLI script but am having a hard time figuring it out.
Here's the core script.
Get-VM | select Name, @{N="IP Address";E={@($_.guest.IPAddress[3])}}, Guest, PowerState

Here's one of the scripts I've tried and failed at.
Get-VM | select Name, @{N="IP Address";E={@($_.guest.IPAddress[3])}}, Guest, PowerState | where-object { @{N="IP Address";E={@($_.guest.IPAddress[3])}} -ne "" }

Any help would be appreciated.
Thank you,
-Rob

A: You have already made the customer property. You can now use it directly for filtering
Get-VM | select Name, @{N="IP Address";E={@($_.guest.IPAddress[3])}}, Guest, PowerState | where-object{$_."IP Address"}

or
Get-VM | Where-Object{$_.guest.IPAddress[3]} | select Name, @{N="IP Address";E={@($_.guest.IPAddress[3])}}, Guest, PowerState

If the property is null or empty the that will evaluate to false. In your example you were evaluating the creation of hash table. First example checks your newly created IP Address property. Second checks the source data for that property. Either way they should evaluate the same.


text:
Q: how to uninstall shopware plugin manually I tried to install a Shopware plugin via the backend (plugin page).
After clicking on download and entering my Shopware login data, the following error message appears immediately:
An error has occurred on the SBP server.
Error code: OrdersException-2

I wanted to install it again and change my last input.
But now the same error message appears immediately and ends my attempt immediately.
It is not listed in the backend (plugin page).
How do I get this plugin uninstalled completely clean?
I have FTP access.
I using shopware Version 5.4.6
DSGVO Kit Lite

A: You can try delete the plugin with ssh (for this command you need to be in the shopware dir ofcourse):
php bin/console sw:plugin:delete {plugin name}

If this doesn't work, you can try to delete the plugin in the database. You can find the plugin in the table s_core_plugins. If deleted here it should be gone.

A: I gess you deleted it after deinstallation, so it isn't on your server any more (and therefore not listed in the plugin-manager). In this case you need the zip file of the plugin. It can be downloaded via your shopware account (account.shopware.com) and you can upload the zipfile directly to your plugin-manager. This would be the easiest way if the login issues persists in your plugin-manager.


text:
Q: Segue from UICollectionViewCell xib to UIViewController I have UICollectionViewCell (Paging enabled, width & height equal to view) which have another UICollectionView (2nd level, which is added programatically) inside cell. 2nd level UICollectionView has  UICollectionViewCell using xib(CustomMenuViewController).
In this xib file, I have a button, by pressing this button I want to go to another UIViewController.
class Cellnew: UICollectionViewCell, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout{

    let cellId = "mycell";

    override init(frame: CGRect) {
        super.init(frame: frame);

        setupViews();
        self.collectionView.register(UINib(nibName: "subMenuCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "mycell")
           }

    lazy var menuBar : MenuBar = {
        let mb = MenuBar()
        return mb

    }()

    func setupViews(){
        addSubview(collectionView);

        collectionView.delegate = self;
        collectionView.dataSource = self;

        collectionView.leftAnchor.constraint(equalTo: leftAnchor).isActive = true;
        collectionView.rightAnchor.constraint(equalTo: rightAnchor).isActive = true;
        collectionView.topAnchor.constraint(equalTo: topAnchor).isActive = true;
        collectionView.bottomAnchor.constraint(equalTo: bottomAnchor).isActive = true;
        collectionView.heightAnchor.constraint(equalToConstant: 200).isActive = true

    }

    let collectionView: UICollectionView = {
        let layout = UICollectionViewFlowLayout();
        layout.minimumLineSpacing = 30
        layout.minimumInteritemSpacing = 0
        layout.scrollDirection = .vertical; //set scroll direction to horizontal
        let cv = UICollectionView(frame: .zero, collectionViewLayout: layout);
        cv.backgroundColor = UIColor.hexStringToUIColor(hex: "F9F9F9")
        cv.translatesAutoresizingMaskIntoConstraints = false;
        cv.contentInset = UIEdgeInsetsMake(50, 0, 150, 0)

        return cv;
    }();

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {

        let cell : subMenuCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId, for: indexPath) as! subMenuCollectionViewCell

        cell.mImagePress.addTarget(self,action:#selector(self.toCustommenu), for: .touchUpInside)
        return cell;
        }

    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
        return UIEdgeInsetsMake(20, 10, 20, 10);
                }

    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        return 5;
                }

  @objc func toCustommenu(){

      //What can i do here

                }

    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        collectionView.reloadData()
        print("menutapped")
        let myDict: [String: Any] = ["CellNo": indexPath.row]
        NotificationCenter.default.post(name: .refresh, object: myDict)

    }
    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        return CGSize(width:( self.frame.width/2)-10-10, height: self.frame.height/3);
    }
        required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}

A: I am assuming you have an initial UIViewController that contains the outermost collection view inside a storyboard. I'm also assuming this is the view that should transition to another view controlled by a second UIViewController.
Since you are working programmatically inside the collection view, your best bet would most likely be creating a segue from the initial view controller to the secondary view controller and triggering it by name.
To do this:

*

*Locate the initial view controller and secondary view controller on the storyboard.

*Control-drag from the yellow circle on the top bar of the initial view controller to the secondary view.

*From the pop-up menu, under "Manual Segue", select the correct option, likely to be "Show".

*Click on the segue that is created and give it an identifier.

*In your code, whenever you want to perform the transition, call performSegue(withIdentifier:sender:) (passing in the identifier string you specified for the segue) on the UIViewController the outermost collection view is contained in.

A: 1.Connect a segue from parentViewController to destinationViewController.
2.Parent View Controller
class parentViewcontroller : ViewController , ParentCellProtocol
{

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell

    {
        Create instance of cell - parentCollectionViewCell
        //Set the delegate
        parentCollectionViewCell.parentDelegate = self
    }

    //Implement the ParentCellProtocol delegate method
    func buttonClickedFromParentCell()
    {
        //Perform segue here
    }
}

3.Parent Custom cell
protocol ParentCellProtocol
   {
      func buttonClickedFromParentCell()
   }

   class ParentCell : ChildCellProtocol
   {
      //Create an instance of protocol.
      var parentDelegate : ParentCellProtocol?

      //Implement ChildCellProtocol Method
      func buttonClickedFromChild(){

         parentDelegate.buttonClickedFromParentCell()
      }

      func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
      {
         Create instance of cell - childCustomCell
         //Set the delegate
         childCustomCell. childDelegate = self
      }
   }

4.Child Custom cell
protocol ChildCellProtocol {
    func buttonClickedFromChild()
}

class ChildCell
{
    //Create an instance of protocol.
    var childDelegate : ChildCellProtocol?

    //call the delegate method on button click.
    func toCustommenu(){

        //What can i do here
        childDelegate.buttonClickedFromChild()
    }
}

Hope it helps you!


text:
Q: Changing the filename of an image picked from UIWebView I have a UIWebView that visits a .jsp page with a button that when pressed requests the user for an existing image or to take a picture, which is just a UIPickerViewController that could maybe be overridden. When the image is selected it is returned to the form of the .jsp page. Is it possible to change the filename of the image that is selected before it is returned to the form of the .jsp page?
UIWebview Init Code
    NSString *urlAddress = [NSString stringWithFormat:@"Address/UserImage.jsp", [Utilities getIP]];
    NSURL *url = [NSURL URLWithString:urlAddress];
    NSURLRequest *objRequest = [NSURLRequest requestWithURL:url];
    [webView loadRequest:objRequest];
    webView.delegate=self;

Before button selection: http://imgur.com/dsS9j7G
After button selection: http://imgur.com/ImnTHQA,9sQtAwe


text:
Q: Existence (or reason of lack) of simple cmos LIFO registers IC There's a project I'm working on that needs a simple LIFO register.
What I mean by simple is to support the PUSH & POP operations, and I guess EMPTY and FULL indicators.
I must be searching with the wrong keywords on  Google, because searches such as "CMOS LIFO register" come with educational papers, and not ICs.
The 7400 series IC list I'm sticking to doesn't list an IC that does those.
While I can simply accept that there's no such IC, that would be surprising, as the demand, should be sufficient (I'm not a market nor electronics expert, I'm simply guessing). So, if there's no CMOS stack register out there , why exactly ?
So I guess my questions are :

*

*Is there any basic CMOS LIFO register or equivalent ?

*If there doesn't exist such IC, why ?

Sorry if my question is just a result of my poor Googling skills, by the way.

A: A universal shift register IC can implement the function you're thinking of. For example, the 74194. No empty/full indicator as that would require a counter. Push/pop are left/right shift.

A: I would suggest using an SRAM and an up/down counter. Might need a bus switch as well for reading. How big of a stack are you trying to build?


text:
Q: Magento 2 how to lock a customer account when it's in an specific group? I have been searching how to lock a customer account but had no luck.
My idea is to create a customer group called Locked, and every customer that is assigned to that group will be locked.
I was thinking that a Plugin or Observer might work everytime I switch a customer to this group, but then how do I lock the account? is there something like
$customerStatus = $customer->isLocked(); or a method that I can use to lock the customer?
Greetings!

A: You can use customer_login event observer to get customer group after login and then logout the customer in observer

app/code/Vendor/Module/etc/events.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="customer_login">
        <observer name="customer_login_observer" instance="Vendor\Module\Observer\CustomerLogin" />
    </event>
</config>

app/code/Vendor/Module/Observer/CustomerLogin.php

<?php

namespace Vendor\Module\Observer;

use Magento\Framework\Event\ObserverInterface;

class CustomerLogin implements ObserverInterface
{
    /**
     * @var \Magento\Framework\App\ResponseFactory
     */
    private $responseFactory;

    /**
     * @var \Magento\Framework\UrlInterface
     */
    private $url;
    private $customerSession;
    private $messageManager;

    public function __construct(
        \Magento\Framework\App\ResponseFactory $responseFactory,
        \Magento\Framework\UrlInterface $url,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Framework\Message\ManagerInterface $messageManager
    ) {
        $this->responseFactory = $responseFactory;
        $this->url = $url;
        $this->customerSession= $customerSession;
        $this->messageManager = $messageManager;
    }
    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $customer = $observer->getEvent()->getCustomer();
        $customerGroup = $customer->getGroupId();
        if($customerGroup=="locked"){
            $this->customerSession->logout();
            $this->messageManager->addErrorMessage(__('You are Locked'));
            $redirectionUrl = $this->url->getUrl('set-your-redirect-url');
            $this->responseFactory->create()->setRedirect($redirectionUrl)->sendResponse();
            return $this;
        }
    }
}


text:
Q: CFSG-free bound for the number of generators of a finite simple group We know that every finite simple group can be generated by $2$ elements.
This (correct me if I'm wrong) was proved, as far as I know, by Steinberg (Steinberg, R. (1962). Generators for Simple Groups. Canadian Journal of Mathematics, 14, 277-283) for Chevalley groups and by Aschbacher and Guralnick (M. Aschbacher, R. Guralnick, Some applications of the first cohomology group, Journal of Algebra, Volume 90, Issue 2, 1984, Pages 446-460, Theorem B) for the other simple groups, using the classification of the finite simple groups (CFSG).
We also know, by an easy application of Lagrange's theorem, that a group of order $n$ can be generated by at most $\log_2(n)$ elements.
My question is the following. Are there results proving that every simple group of finite order $n$ can be generated by $d$ elements, where $d$ is some quantity between $2$ and $\log_2(n)$ (for example $\log_2 \log_2 (n)$ or - more optimistically - an unspecified constant) without using the classification of finite simple groups?

A: Still elementary, but marginally stronger than the $\log_{2}(n)$ bound is: every non-Abelian finite simple group $G$ of order $n$ can be generated by fewer than $\log_{p}(n)$ elements, where $p$ is the largest prime divisor of $\lvert G\rvert$. In particular (using Burnside's $p^{a}q^{b}$-theorem), such a group $G$ can be generated by fewer than $\log_{5}(n)$ elements, since we always have $p \geq 5$. This improves the $\log_{2}(n)$ bound by a  factor of at least $2$, but is still very weak. The proof is easy and elementary— $G$ is generated by its elements of order $p$. Let $S$ be a set of elements of order $p$ of $G$ which generates $G$ with $\lvert S\rvert$ minimal. Then for each positive integer $j$, any $j$ elements of $S$
generate a subgroup of order $p^{j}$ or greater, so $\lvert S\rvert < \log_{p}(\lvert G\rvert)$.
I don't know what the best known "elementary" bound is (or even if this is a well-defined quantity). I seriously doubt whether there is a constant-type bound known without using CFSG.


text:
Q: How can the Laplace transform be used to solve piecewise functions? For example, suppose we have the following two problems that we'd like to find the Laplace transform of:

*

*$f(t) = \begin{cases}
1, & t \lt 2 \\
0, & t \geq 2
\end{cases}$

*$f(t) = \begin{cases}
1-0.5t, & t \lt 2 \\
5, & t \geq 2
\end{cases}$
Is there a general method to solve these sorts of problems?  How can I approach them and make solving them more intuitive?
Thanks for the help!

A: The definition of the Laplace transform is given as
$F(s)= \mathcal{L} \left\{f\right\}(s)
  =\int_{0}^{\infty} \mathrm{e}^{-st} f(t)\,\mathrm{d}t, \qquad s\in\mathbb{C}.$
So if we take example 1), we get
\begin{align*}F(s) = \mathcal{L} \left\{f\right\}(s)
  =\int_{0}^{\infty} \mathrm{e}^{-st} f(t)\,\mathrm{d}t &=
\int_{0}^{2} \mathrm{e}^{-st} f(t)\,\mathrm{d}t+
\int_{2}^{\infty} \mathrm{e}^{-st} f(t)\,\mathrm{d}t
\\ &= \int_{0}^{2} \mathrm{e}^{-st} \cdot 1\,\mathrm{d}t+
\int_{2}^{\infty} \mathrm{e}^{-st} \cdot 0\,\mathrm{d}t
\\ &=\int_{0}^{2} \mathrm{e}^{-st} \,\mathrm{d}t
\\ &= \Bigl[-\frac{1}{s} e^{-st} \Bigr]_0^ 2 = -\frac{1}{s} e^{-2s} +\frac{1}{s}
\end{align*}
So the general approach is to split the integral at that points, at which $f$ changes.

A: Here is the first one
$$ \int_{0}^{\infty}f(t)e^{-st}dt = \int_{0}^{2}1.e^{-st}dt+ \int_{2}^{\infty}0.e^{-st}dt $$
You can do the other function with the same technique.


text:
Q: Javascript button event to trigger a form based calculation is not working I'm sorry that a few variables are in dutch, I could change it to English if necessary.
This script should calculate the fee of the textbox "kosten".
The fee is calculated by applying a percentage, this is made possible by selecting a number in the combobox.
For some reason, when clicking on the button "totaalfooi" to start the calculation and get a result, nothing happends..
Javascript code:

function berekenkosten() {
    var inputkosten = document.getElementById('kosten');
    var kosten = 0;
    if (inputkosten.value != "") {
        kosten = parseInt(inputkosten.value);
    }
    return kosten;
}
var procentfooi = new Array();
procentfooi["1"]=2;
procentfooi["2"]=2.5;
procentfooi["3"]=3;
procentfooi["4"]=3.5;
procentfooi["5"]=4;

function berekenfooi () {
    var berekenfooi=0;
    for(var i = 0;
        i < procentfooi.length; i++) {
        if(procentfooi[i].checked) {
            berekenfooi=procentfooi[procentfooi[i].value];
            break;
        }
    }
    return berekenfooi;
}

function berekentotaal () {
    var totaalfooi = (berekenfooi/100) * berekenkosten();
    document.getElementById(totaalfooi).innerHTML = "Totale fooi bedraagt: $" + totaalfooi;

}

Totale kosten <input type="text" id="kosten">

 Graad van tevredenheid op 5
    <select>
        <option value="1" >1</option>
        <option value="2" >2</option>
        <option value="3" >3</option>
        <option value="4" >4</option>
        <option value="5" >5</option>
    </select>
    <input type="button" value="bereken" onclick="berekentotaal()">

A: You had multiple syntax errors which are fixed in the example below.
You cannot have variables named the same as functions, these will overwrite each other.
You cannot treat a function variable as a value type, you have to invoke the function.
getElementById takes a string argument, you were passing "variables" that were unassigned.
You needed an ID on your select, to then choose it by.  You were iterating over an array which was not bound to the DOM.
A few other modifications, this works in the snippet and if you copy it over, should work to fix your problems.

            function berekenkosten() {
                var inputkosten = document.getElementById('kosten');
                var kosten = 0;
                if (inputkosten.value != "") {
                    kosten = parseInt(inputkosten.value);
                }
                return kosten;
            }

            function berekenfooi () {
                var procentfooi = document.getElementById("procentfooi");
                var percentToReturn=procentfooi.options[procentfooi.selectedIndex].value;
                console.log(percentToReturn + " with " + procentfooi.length);
                return parseFloat(percentToReturn);
            }

            function berekentotaal () {
                var totaalfooi = (berekenfooi()/100) * berekenkosten();
                document.getElementById("totaalfooi").innerHTML = "Totale fooi bedraagt: $" + totaalfooi;

            }

Totale kosten <input type="text" id="kosten">

 Graad van tevredenheid op 5
    <select id='procentfooi'>
        <option value="1" >1</option>
        <option value="2" >2</option>
        <option value="3" >3</option>
        <option value="4" >4</option>
        <option value="5" >5</option>
    </select>
    <input type="button" value="bereken" onclick="berekentotaal()">

Snippet results:

A: Skimming through your code, it seems that the problem lies in this line:
document.getElementById(totaalfooi).innerHTML = "Totale fooi bedraagt: $" + totaalfooi;

totaalfooi is a result of a calculation, so I guess you meant to pass the  string:
document.getElementById('totaalfooi').innerHTML = "Totale fooi bedraagt: $" + totaalfooi;

A: Also, in this line:
var totaalfooi = (berekenfooi/100) * berekenkosten();
You're dividing berekenfooi by 100, but berekenfooi is a function you define earlier, not a value.  So it should be:
var totaalfooi = (berekenfooi()/100) * berekenkosten();

A: Change your code to this
function berekenkosten() {
    var inputkosten = document.getElementById('kosten');
    var kosten = 0;
    if (inputkosten.value != "") {
        kosten = parseInt(inputkosten.value);
    }
    return kosten;
}

function berekenfooi() {
    var berekenfooi = 0,
    seloption = document.querySelector('#JSfee select'),
    procentfooi = [2, 2.5, 3, 3.5, 4]
    return procentfooi[seloption.selectedIndex];
}

function berekentotaal() {
    var totaalfooi = (berekenfooi()/100) * berekenkosten();
    document.getElementById('totaalfooi').innerHTML = "Totale fooi bedraagt: $" + totaalfooi;
}

You have some syntactical errors in your berekentotaal function, berekenfooi is a function not an object therefore must be called with () and getElementById requires an string to find the element. With this solution you don't need the values in the select so they could be written like this
<select>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
</select>


text:
Q: java.lang.NoClassDefFoundError: when trying to get wsdl I'm facing some issue and I have no idea how to solve it.
I'm publishing jax-ws service, and when I want to access to created wsdl file I'm getting this error:
org.eclipse.jetty.util.log - /ws?wsdl: java.lang.NoClassDefFoundError: org/eclipse/jetty/io/AbstractConnection

My code for creating and publishing service:
SOAPHandlerImpl handlerImpl = new SOAPHandlerImpl();
JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
svrFactory.setServiceClass(SOAPHandler.class);
svrFactory.setAddress("http://localhost:81/ws");
svrFactory.setServiceBean(handlerImpl);
svrFactory.getInInterceptors().add(new LoggingInInterceptor());
svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
svrFactory.create();
System.out.println("Service created");

I found some solutions, I have added jetty-util to my classpath but it didn't fixed issue.
Anyone have some idea what am I doing wrong? Thanks for advance.

A: Ok, problem solved. I had to add jetty-io to classpath.


text:
Q: How to distribute an application that relies on DLL's for 32-bit and 64-bit machines I have an application that uses a 3rd party jar (utils.jar), which calls a 3rd party DLL (utils.dll). The jar file manages calls to DLL including the name of the DLL. There is a 32-bit version and a 64-bit version of the DLL.
Currently, the application can only run on 32-bit machines. When I try to run it on a 64-bit machine, it tells me
Can't load IA 32-bit .dll on a AMD 64-bit platform

When I replace the 32-bit dll with the 64-bit, it works fine. I don't want to maintain two separate releases if I can avoid it (one using 32-bit library, the other using 64-bit library). Is there a way to build the application so that it can figure out which version of the library it needs to use?
Our projects are built using Ant, though I can explore other alternatives if necessary.

A: You have to create an additonal ant target such that it builds always a x32 and a x64 variant of your application.

I don't want to maintain two separate releases

If the ant your skript always produce both deliverys that its not much addional effort.

A: When you do loadLibary you could compose the library name with the System.getProperty("os.arch"). So, you bundle all dlls, and the related version will be chosen at run-time.

A: For deploying Java desktop apps., the best option is usually to install the app. using Java Web Start1.  JWS works on Windows, OS X & *nix.

*

*
JWS provides many appealing features including, but not limited to, splash screens, desktop integration, file associations, automatic update (including lazy downloads and programmatic control of updates), partitioning of natives & other resource downloads by platform, architecture or Java version, configuration of run-time environment (minimum J2SE version, run-time options, RAM etc.), easy management of common resources using extensions..


text:
Q: "Anger of a Sire" sci fi portal web novel This paperback was read a long time, possibly late seventies to mid eighties.
Some hidden society who guard and monitor various portals that lead to Earth, however the portals are staggered throughout time, Ancient Greece, mid Europe during the Black Death, American civil war and others I can't remember.
The portals lead to other worlds and societies but a lot have been overrun by these vicious, intelligent man size insects who call themselves the Na.
They are hive creatures but have placid Queens, they are led by Sires who are like supreme warlord emperors.
There was one section where a rogue explorer  Na finds an empty moon and decides to use it to set himself up as a Sire, he steals a number of royal eggs and kills off any males who hatch so he will end up with a load of females to breed with.
He somehow ends up with some Earth bad guys who've stumbled across the portal network and are a-plundering across time and space. They give him some corned beef and the protein causes him to transform too rapidly into full Sire mode (I think this kills him).
In another part of the story some guy in Ancient Crete or Greece gets an alert a Na is coming through a portal and he blasts it with a device that transmits "ANGER OF A SIRE" and then has to tow the body out to sea in darkness and weigh it down.

A: Masters of the Maze by Avram Davidson contains the phrase you've mentioned

Concerning this last, he was told, "It isn't ornamental or vestigeal,
  like the tiler's sword at a Blue Lodge meeting. It's functional. It
  disseminates . . . 'broadcasts' is a useful new word which might apply
  . . . it broadcasts what is known as anger of a Sire."

and a character called "the Na"

So the Na bowed low, and let his breath out. For a while it seemed
  almost as though the Sire did not see him, so preoccupied he was. Then
  he said, "Take food, the Na."

Per wikipedia;

"an intricate Parallel-Worlds adventure with sharply characterized
  humans and remote Secret Masters involved in barring interdimensional
  transit to a remarkably vivid insectoid Alien race"


text:
Q: Right settings for firewall rule C# I got a new question, what firewall settings is needed for blocking an IP address ? I found the property "RemoteAddress", like firewallRule.RemoteAddress, but I dont know how to use it. This is what I found on stackoverflow ( following code blocks all access to internet ), Thanks.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NETCONLib;
using NATUPNPLib;
using NetFwTypeLib;

namespace WindowsFormsApplication1
{

public class Form1 : Form
{

    public Form1()
    {
        InitializeComponent();
        INetFwRule firewallRule = (INetFwRule)Activator.CreateInstance(
        Type.GetTypeFromProgID("HNetCfg.FWRule"));
        firewallRule.Action = NET_FW_ACTION_.NET_FW_ACTION_BLOCK;
        firewallRule.Description = "Used to block all internet access.";
        firewallRule.Direction = NET_FW_RULE_DIRECTION_.NET_FW_RULE_DIR_OUT;
        firewallRule.Enabled = true;
        firewallRule.InterfaceTypes = "All";
        firewallRule.Name = "Block Internet";

        INetFwPolicy2 firewallPolicy = (INetFwPolicy2)Activator.CreateInstance(
        Type.GetTypeFromProgID("HNetCfg.FwPolicy2"));
        firewallPolicy.Rules.Add(firewallRule);
    }
}
}

A: You can use list of ip addresses (subnets, aliases) splitted by commas
$Rule.RemoteAddresses = RemoteAddresses = 'LocalSubnet,10.1.1.1/255.255.255.255,12.5.0.0/255.255.0.0'

A: As far as I can tell, you have to retrieve the RemoteAddresses list first before adding to it. Otherwise, it just overwrites each IP with the next one. The format needs to be as Jan described in his/her answer. However, the subnet "/255.255.255.255" is not needed when adding a single IP address. My app only blocks a single ip at a time, but you can put ranges in there as Jan describes. Most the credit goes to others on SO with exception of the RemoteAddresses part. If there's a better/cleaner way, I would love to hear it. Here's how I ended up doing it:
        private void BlockIp(string ip, string ruleName)
        {
            INetFwPolicy2 firewallPolicy = (INetFwPolicy2)Activator.CreateInstance(Type.GetTypeFromProgID("HNetCfg.FwPolicy2"));
            INetFwRule firewallRule = firewallPolicy.Rules.OfType<INetFwRule>().Where(x => x.Name == ruleName).FirstOrDefault();

            if (firewallRule == null)
            {
                firewallRule = (INetFwRule)Activator.CreateInstance(Type.GetTypeFromProgID("HNetCfg.FWRule"));
                firewallRule.Name = ruleName;
                firewallPolicy.Rules.Add(firewallRule);
                firewallRule.Description = "Block inbound traffic";
                firewallRule.Profiles = (int)NET_FW_PROFILE_TYPE2_.NET_FW_PROFILE2_ALL;
                firewallRule.Protocol = (int)NET_FW_IP_PROTOCOL_.NET_FW_IP_PROTOCOL_TCP;
                firewallRule.Direction = NET_FW_RULE_DIRECTION_.NET_FW_RULE_DIR_IN;
                firewallRule.Action = NET_FW_ACTION_.NET_FW_ACTION_BLOCK;
                //firewallRule.LocalPorts = "8080";
                //firewallRule.Grouping = "@firewallapi.dll,-23255";
                firewallRule.Enabled = true;
                firewallRule.RemoteAddresses = ip;
                //firewallPolicy.Rules.Add(firewallRule); //throws error, not needed
            } else {
                var remoteAddresses = firewallRule.RemoteAddresses;
                firewallRule.RemoteAddresses = remoteAddresses + "," + ip;
            }
        }


text:
Q: Express SessionID not persistent, no browser cookie I'm trying to setup a simple passport login using node, express and angular. I'm having trouble getting sessions to persist, I think because it's not setting a browser cookie, but why?
There's no cookie set in my browser, and the sessionID recognized by node is different every request.
This is using Express 4, which seems pretty significantly different from Exp3. I think it may have something to do with middlware ordering or session storage configuration. I'm trying to get away with default handling, which I think is MemoryStore in Exp4, but It doesn't seem to be working.
Also, I should mention that the static HTML/CSS are served by apache, not node. Node is just setup for API calls.
Here are the relevant lines from package.json.
"dependencies": {
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "^1.10.1",
    "connect-flash": "^0.1.1",
    "cookie-parser": "^1.3.3",
    "express": "^4.11.0",
    "express-session": "^1.10.1",
    "mongoose": "^3.8.21",
    "morgan": "^1.5.1",
    "passport": "^0.2.1"
  }

And the middleware setup
var express = require('express');
var morgan = require('morgan');
var mongoose = require('mongoose');
var passport = require('passport');
var flash    = require('connect-flash');
var app = express();

var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var session = require('express-session');

...
app.use(morgan('dev')); // log every request to the console
app.use(cookieParser()); // read cookies (needed for auth)

app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());

app.use(session({
  secret: 'DGUBJH7H6G6GTF5R53R54RSBH',
  resave: true,
  saveUninitialized: true
}));
app.use(passport.initialize());
app.use(passport.session());
app.use(flash());

app.use(function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
  next();
});

require('./config/routes.js')(app, passport);

The Routes
app.post('/login', passport.authenticate('local-login'), function(req, res) {
    var user = req.user;
    res.send(user);
  });
app.get('/user', isLoggedIn, function (req, res) {
    var user = req.user;
    res.send(user);
  });
function isLoggedIn(req, res, next) {
  var user = req.user;
  // if user is authenticated in the session, carry on
  if (req.isAuthenticated())
    return next();

  res.status(403).send();
}

I could also post the passport code with the serialize and deserialize functions, but I'm not sure they're relevant for this. I just need to figure out why this code isn't setting browser cookies! Any Help would be greatly appreciated!

A: Here, you are only setting the session but not setting the cookie. So, try to set the cookie
// configuration
app.use(express.cookieParser());
// or  `express.cookieParser('secret')` for signed cookies

// routing
app.get('/foo', function (req, res) {
    res.cookie('bar', 'baz');
`});

app.get('/bar', function (req, res) {
    res.send(req.cookies.bar);
});

A: So the main problem here for me was that I was doing my login call asynchronously with angular's $http service. It seems that most browsers wont set a cookie based on the header of an asynchronous request. I changed My login form to point directly to my node login callback and now it does a page reload in order to set the cookie, then immediately redirects to the main page of my app.


text:
Q: How do I annotate rust variables' data type without assignment? I'm new to rust, and I'd like to declare a typed variable without initializing it. Is this possible in Rust? If so, is it advisable or are there better, more rustacean-y ways to do it?
I'm looking at the following code from rustlings which fails to compile because it can't infer the type of x:
    let x;
    if x == 10 {
        println!("Ten!");
    }

So, I tried this:
let x: i32;

however, now the compiler will throw an error on the comparison line saying that x hadn't been declared.
This works fine, but I was left wondering if one can declare the type without an assignment.
let x: i32 = 10;

Or is the correct way to do it involve designing your code to avoid such situations in the first place? I come from a C background and I'm probably a little too comfortable with being lazy with types.

A: In rust, the type of a variable is usually inferred from the context.
The context can include any of the following:

*

*The type of the value being assigned:

let x = String::new(); //x is now a String

*

*The return type of the function being called:

fn foo() -> usize {
    40
}
let x = foo(); //x is now usize

But if you don't have a type to infer, as in there is no assignment to the variable:
let x;

Then rust cannot infer the type. Therefore, it will get mad at you.
Another problem that needs to be addressed in this answer; the fact that rust doesn't allow the reading of uninitialized variables. The following value, x is uninitialized:
let x: u32;

Reading the value of an uninitialized u32 probably wouldn't do too much, but consider the following:
struct MyString {
    ptr: *const u8,
    len: usize,
    cap: usize,
}

If we were to provide a safe wrapper around this, this would be perfectly fine, after all, this is essentially what the stdlib String boils down to. But, if we were to own an uninitialized MyString and tried to read its contents, we'd end up reading a garbage address from the ptr, and a garbage len and cap. This would lead to reading a garbage pointer, which is undefined behavior, which is rust's #1 priority to eliminate.
So, to recap:
✓ Every variable must have a type determinable at runtime (Including erased types, because those are concrete types too [dyn Trait and impl Trait], but impl Trait is special.)
✓ Every variable must be assigned some kind of value before you can read its value.
✓ Rust tries very hard to eliminate all undefined behavior.

A: You can do this, provided that the compiler can see that it will always have a value assigned before you try to read from it, and it will only ever be assigned once. This can be helpful in peculiar circumstances. Here's a slightly contrived example.
fn main() {
    let some_cond = false;

    let x;
    let y;
    let z: u8;

    if some_cond {
        x = 1;
        y = 2;
        z = 3;
    } else {
        x = 4;
        y = 5;
        z = 6;
    }

    println!("x = {}", x); // "x = 4"
    println!("y = {}", y); // "y = 5"
    println!("z - 10 = {}", z.wrapping_sub(10)); // "z - 10 = 252"
}


text:
Q: Error occured while sendind data to server from android app I am sending data from android app to PHP server and i have got the errors:

Notice: Undefined index: name in E:\xampp\htdocs\server.php on line 4
Notice: Undefined index: email in E:\xampp\htdocs\server.php on line 5

I have taken two edit text and data enter in the edit text should be sent to the server while the button is clicked. So I have made a method for this purpose and I call it in the button on clicked listener
I don't know why I am not receiving data in server there is no problem in my code Please help me!
My client code is
public class MainActivity extends AppCompatActivity {

    EditText ed_name, ed_email;
    Button btn;
    String url = "http://xxxxxxx/server.php";//hidden

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ed_name=(EditText)findViewById(R.id.editText);
        ed_email=(EditText)findViewById(R.id.editText2);
        btn=(Button)findViewById(R.id.button);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                insert();
            }
        });
    }

    public void insert() {

        StringRequest MyRequest = new StringRequest(Request.Method.POST, url,

                new Response.Listener<String>() {

                    @Override
                    public void onResponse(String response) {

                        Toast.makeText(getApplication(), response, Toast.LENGTH_SHORT).show();
                        //Toast.makeText(MainActivity.this,"There is some error on server side",Toast.LENGTH_LONG).show();
                    }

                }, new Response.ErrorListener() {

            @Override
            public void onErrorResponse(VolleyError error) {

                Toast.makeText(MainActivity.this, error + "", Toast.LENGTH_LONG).show();
            }
        }) {
            protected Map<String, String> getparams() throws AuthFailureError {
                Map<String, String> mydata = new HashMap<String, String>();
                String name=ed_name.getText().toString();
                String email=ed_email.getText().toString();
                mydata.put("name", name);
                mydata.put("email", email);
                return mydata;
            }
        };
        RequestQueue MyRequestQueue = Volley.newRequestQueue(this);
        MyRequestQueue.add(MyRequest);
    }
}

While Server Side Code is:
<?php
    $name = $_POST['name'];//i am retrieving data where ['name]' is key
    $email = $_POST['email'];//Here ['email '] is the key i have given in android code

    echo $name;
    echo $email;
?>


text:
Q: Editing an array inside an object inside an object I'm working on a challenge for a coding class, and for some reason my code won't work. I was given the following:
// Setup
var collection = {
    2548: {
      album: "Slippery When Wet",
      artist: "Bon Jovi",
      tracks: [
        "Let It Rock",
        "You Give Love a Bad Name"
      ]
    },
    2468: {
      album: "1999",
      artist: "Prince",
      tracks: [
        "1999",
        "Little Red Corvette"
      ]
    },
    1245: {
      artist: "Robert Palmer",
      tracks: [ ]
    },
    5439: {
      album: "ABBA Gold"
    }
};
// Keep a copy of the collection for tests
var collectionCopy = JSON.parse(JSON.stringify(collection));

// Only change code below this line

I was supposed to fulfill the following:

*

*After updateRecords(5439, "artist", "ABBA"), artist should be "ABBA"

*After updateRecords(5439, "tracks", "Take a Chance on Me"), tracks should have "Take a Chance on Me" as the last element.

*After updateRecords(2548, "artist", ""), artist should not be set

*After updateRecords(1245, "tracks", "Addicted to Love"), tracks should have "Addicted to Love" as the last element.

*After updateRecords(2548, "tracks", ""), tracks should not be set

My code is only fulfilling the first and 4th requirements. When running updateRecords(5439, "tracks", "Take a Chance on Me"); or updateRecords(2548, "tracks", "");, I get TypeError: Cannot read property 'push' of undefined. When I run updateRecords(2548, "artist", "");, I get TypeError: Cannor convert undefined or null to object.
My code looks like this:
// Only change code below this line
function updateRecords(id, prop, value) {
  if (value !== "" && prop !== "tracks"){
    collection[id][prop] = value;
  }
  else if (value !== "" && prop == "tracks"){
    var currentAlbumTracks = collection[id].tracks;
    currentAlbumTracks.push(value);
  }
  else if (value === ""){
    delete collection.id.prop;
  }
  return collection;
}

Any idea what's going on?
EDIT: I've changed my code a bit. Now I have:
function updateRecords(id, prop, value) {
  var currentAlbumTracks = collection[id].tracks;
  if (value !== "") {
    if (prop !== "tracks"){
      collection[id][prop] = value;
    }
    else if (prop == "tracks"){
      if (currentAlbumTracks) {
       currentAlbumTracks.push(value);
      }
      else if (currentAlbumTracks === ""){
        collection[id].tracks = [value];
      }
    }
  }

  return collection;
}

A: You posted two errors.

*

*This error comes from your attempt to call push on collection[id].tracks. If the tracks property has not been set yet on the collection[id] record, it is not yet an Array, and therefore does not have a push method. You will have to check whether the Array exists before attempting to push to it, or you can pre-assign an empty Array to the tracks property for each record.

*The second error may be the result of your switch from bracket-notation to dot-notation when referencing properties; you refer to collection.id.prop, whereas in all previous cases you refer to collection[id][prop].

A: The error TypeError: Cannot read property 'push' of undefined in the line currentAlbumTracks.push(value); means that currentAlbumTracks is undefined. You need to guard against this possibility:
var currentAlbumTracks = collection[id].tracks;
if (currentAlbumTracks) {
   currentAlbumTracks.push(value);
}

The error TypeError: Cannor convert undefined or null to object in the line delete collection.id.prop; shows a similar problem. You're  trying to access the property named 'prop' which doesn't exist in any of the elements. So you want bracket notation here.
if (collection.id[prop]) {
   delete collection.id[prop];
}

A: We have two mistakes here.

*

*collection[id].tracks is undefined in some cases, so before pushing values you need to define it, So
var currentAlbumTracks = collection[id].tracks;
currentAlbumTracks.push(value);

became
collection[id].tracks = collection[id].tracks || []; //Take existing or create new
collection[id].tracks.push(value);

*Your dot notation is incorrect, more info here
So
delete collection.id.prop;

becomes
delete collection[id][prop];

Overall including all rectification, We can make following function
function updateRecords(id, prop, value) {
  if (value !== "" && prop !== "tracks"){
    collection[id][prop] = value;
  }
  else if (value !== "" && prop == "tracks"){
    collection[id].tracks = collection[id].tracks || [];
    collection[id].tracks.push(value);
  }
  else if (value === ""){
    delete collection[id][prop];
  }
  return collection;
}


text:
Q: How to query my database and have it be outputted on a Google Sheet so that someone can edit this data and then have it reflected back in MySQL? I'd like to push some data from MySQL into Google Sheets. Once I've edited my data in Google Sheets, I'd like to push my edited data back into MySQL. Ideally, I'd even like to schedule it to update it every hour, so my data is always live and matches what's in my MySQL.
Please have in mind that it is for someone on my team who can't figure out querying with SQL, has a hard time navigating MySQL, and that I don't want to train in SQL. I would just like this person to edit Google Sheets and these edits to be reflected back in MySQL, without this person ever having to go into my SQL database.
I've looked into Google Sheets Script and it seems that it enables you to type in a SQL query into a cell in Google Sheets and retrieve your queried data. But it seems that, if you make changes to the queried data in Google Sheets, it will not be reflected in MySQL.
Any suggestion so that I can work with this person in my team who doesn't know how to query with SQL?

A: This is not a complete solution, but could point you in the right direction:

*

*Open an SQL terminal, then execute the SELECT you want and capture the output in a text file

*Import the text file you captured into Google Sheets. I've not used import function with that software, but I have done something similar using Excel and Libre Office Calc before. The output is fairly uniform, and by choosing the correct separator character (usually ) you can get the data in columns. You'll still have to clean it up some, possibly delete some columns before sending the spreadsheet file to your colleague.

*Once they've edited the data and returned the updated spreadsheet to you, you can reverse the process, creating a text file with a list of UPDATE/SET commands to alter the data in the relevant table(s)

*Use the text file as a script in the SQL terminal window to update the SQL database.

I've used a similar process in the past on a regular basis with a customer database for a company I worked for. It's not completely automated, but it's flexible, and it sure beats hand-entry for large datasets. Possibly you could use Sheets' scripting functions to generate the update script automatically from the data in the spreadsheet.


text:
Q: On Checkbox click event, Unable to remove checked="checked' attribute I have a Jquery Dialog box within my view, In this dialog box there is a UL LI list which is transformed to a treeview.   I retain previous checkbox checked selection by adding the checked attribute in my HTML Text Writer helper.  What I am trying to do is to remove the checked attribute once its un-checked. I am able to fire the event and get the value for instance true or false for check or uncheck but I am not able to scuccessfully remove the checked attribute if it was checked. The DOM still have the previous state of checked.
HTML Writer
InUl(() => locations.ForEach(location => InLi(() =>
            {

                var children = this.childrenRenderer(location);

                bool childStatus = !(children != null && children.Count() > 0);
                if (childStatus)
                {

                    writer.AddAttribute("type", "checkbox");
                    writer.AddAttribute("value", urlRenderer(location));
                    writer.AddAttribute("id", htmlPrefix + urlRenderer(location));
                    writer.AddAttribute("onclick", "handleClick(this)");
                    if (keys != null)
                    {
                        if (keys.Contains(Convert.ToInt32(urlRenderer(location))))
                        {
                            writer.AddAttribute("checked", "checked");
                        }
                    }
                    writer.RenderBeginTag("input");
                }
                writer.Write(locationRenderer(location));
                if (childStatus)
                {
                    writer.RenderEndTag();
                }
                RenderLocations(children);
            })));

JS Function
   function handleClick(e) {
        alert("Click, new value = " + e.checked);
        var $this = $(this);
        if (e.checked = false) {
            $this.removeAttr('checked');
        }
    }

If I uncheck a checkbox, the following function still gives the old checkbox which is now unchecked:
$("#errorCodes input:checkbox:checked").each(function () {
                        var v = $(this).val();
                        a.push(v);
                        if (errorTextArea.length > 0) {
                            errorTextArea = errorTextArea + " | ";
                        }
                        errorTextArea = errorTextArea + v;
                    });

A: You have a simple error in your code:
if (e.checked = false)

should read
if (e.checked == false)

A: Try this:
function handleClick(e) {
        alert("Click, new value = " + e.target.checked);
        if (e.target.checked == false) {
            e.target.removeAttr('checked');
    }
}


text:
Q: A metric space in which every infinite subset has a limit point is separable Let X be a metric space in which every infinite subset has a limit point. Prove that X is separable.
Hint: Fix $\delta > 0,$ and pick $x_1 \in X$. Having chosen $x_1,...,x_j \in X$, choose $x_{j+1}$, if possible, so that $d(x_i, x_{j+1}) ≥ \delta$ for $i = 1, ..., j$. Show that this process must stop after finite number of steps, and that X can therefore be covered by finite many neighborhoods of radius $\delta$. Take $\delta = \frac{1}{n} (n = 1, 2, 3, ...)$, and consider the centers of the corresponding neighborhoods.
I'm following Baby Rudin and there is a part "centers of the corresponding neighborhoods" that I don't understand:
"Fix $p ∈ X$. Suppose that p is not in $A=\{x_1,...,x_k\}$. Note that $N_\frac{r}{2}(p)$ can be covered by finite many neighborhoods $N_s(x_1),...,N_s(x_k)$ of radius $s = 1/n$ where $n = [\frac{2}{r}] + 1$ and $x_i \in A$ for $i = 1,...,k$. Hence, $d(x_1,p) ≤ d(x_1,q)+d(q,p) ≤ \frac{r}{2}+s < r$ where $q ∈ N_{\frac{r}{2}}(p)\cap N_s(x_1)$. Therefore, $x_1 \in N_r(p)$ and $x_1= p$ since p is not in A. Hence,p is a limit point of A if p is not in A, that is, A is a countable dense subset, that is, X is separable." Can somebody explain the part with q, how did we get this inequality and then we got $x_1=p$,but $x_1\in A$ and $p \not \in A$. Isn't this a contradiction?

A: We have chosen $x_1,\dots,x_k$ such that $d(x_i,x_j) \ge 1/n$ for each $i\ne j$. Now, for any $p\in X$, it must be the case that $d(p,x_i) < 1/n$ for some $i = 1,\dots,k$. In other words, any other point we choose now cannot be farther than $1/n$ from all of the points $x_1,\dots,x_k$. In other words still, $X = \bigcup_{i=1}^k N_{1/n}(x_i)$. So if we choose $p\notin A$ (or $p\in X$ more generally), the neighborhood $N_{r/2}(p)$ is a subset of $X$, which is itself a subset of the (finite) union $\bigcup_{i=1}^k N_{1/n}(x_i)$. Hence, $N_{r/2}(p)$ can be covered by finitely many of the neighborhoods $N_{1/n}(x_i)$.

A: Equivalently, prove that if $X$ is not separable then $X$ has a sequence with no limit points, as follows:
For each $q\in \Bbb Q^+$ let $F_q$ be a maximal family of pairwise-disjoint open ball of radius $q.$
Maximal in that if $G$ is a family of pairwise-disjoint open balls of radius $q,$ and $F_q\subset G,$ then $G=F_q.$
Let $F_q=\{B_d(x_{j,q},q): j\in S_q\}$ where  $S_q$ is some  (arbitrary) index set, and with $B_d(x_{i,q},r) \cap B_d( x_{j,q},r)=\emptyset$  when $i\ne j. $
For every $x\in X$ there exists $j\in S_q$ such that $d(x,x_{j,q})\leq 2q.$ Otherwise $G=F\cup \{B_d(x,q)\}$ would contradict the maximality of $F_q.$
Let $C_q=\{x_{j,q}:j\in S_q\}.$ Let $D=\cup_{q\in \Bbb Q^+}C_q\,.$ Then $D$ is dense in $X.$ Because for any $x\in X$ and any $r>0,$ take $q\in \Bbb Q^+\cap (0, r/2),$ and take $x_{j,q}\in C_q$ such that  $d(x,x_{j,q})\leq 2q.$ Then $d(x,x_{j,q})<r.$
Now if X is NOT separable then then some $C_q$ is uncountable. Otherwise  the dense set $D=\cup_{q\in \Bbb Q^+}C_q$ would be a countable union of countable sets, which would make $D$ countable.
So for some $q_0\in \Bbb Q^+,$ the set $C_{q_0}=\{x_{j,q}:j\in S_{q_0}\}$ is uncountable. But for any unequal $i,j\in S_{q_0}$ we have $d(x_{i,q},x_{j,q})\geq q.$ So $C_{q_0}$ is an uncountable  closed discrete subspace of $X.$
So if $f:\Bbb N\to C_{q_0}$ is any injection then the sequence $(f(n))_{n\in \Bbb N}$ has no limit points.


text:
Q: Issue using Java Array  import java.io.*;

public class Array {
public static void main(String args[]) throws IOException {
    BufferedReader
    inpt = new BufferedReader(new InputStreamReader(System. in ));

    System.out.println("How many criteria?");//ask for how many records
    int n = Integer.parseInt(inpt.readLine());// store in n

    int[] arrayCrit = new int[n];//create array with size n
    String[] crits = new String[n];

        //**as you mentioned in edit you want to take all the input before printing**
    for (int i = 0; i < n; i++)
    {
      System.out.print("Criteria: ");
      crits[i] = inpt.readLine();

      System.out.print("Percentage: ");
      arrayCrit[i] = Integer.parseInt(inpt.readLine());
    }

    System.out.println("How many students' record?");
    int n1 = Integer.parseInt(inpt.readLine());

    int [] arrayCritr = new int [n1];
    String [] arraySname = new String [n1];

    for(int i=0; i<n1; i++){
    String name;
    System.out.print("Student Name: ");
    arraySname[i] = inpt.readLine();
    for(int j=0; j<n; j++){
    System.out.print("Grade in "+ crits[i] + ": ");
    arrayCritr[j] = Integer.parseInt(inpt.readLine());
    crits[i]=crits[i+1];
  }
  crits[i]=crits[i-i];
}
}
}

*

*How many criteria? 4

*Criteria: Quiz

*Percentage: 25

*Criteria: Att

*Percentage: 15

*Criteria: Major Exam

*Percentage: 40

*Criteria: Minor Exam

*Percentage: 20

*How many students' record? 2

*Student Name: Wayne

*Grade in Quiz: 90

*Grade in Att: 80

*Grade in Att: 70

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
    at Array.main(Array.java:41)
Process completed.
(Thanks again to the people who helped me earlier)
Hello again, I encountered another problem for this program. The output above is somewhat wrong. The arrays are not functioning very well. The 3rd Grade name should be Major Exam but somehow it's not moving and it's stuck in there. Also I want to know how to reset the value in order for the 2nd student to input the grades. Once again, I need your help as I'm new to java and I'm learning it. Thank You.
Edit: I need to output something like this..

*

*How many criteria? 4

*Criteria(1): Quiz

*Percentage: 25

*Criteria(2): Attendance

*Percentage: 25

*Criteria(3): Major Exam

*Percentage: 25

*Criteria(4): Minor Exam

*Percentage 25

*How many students' record? 2

*Student Name(1): Harold

*Grade in Quiz: 90

*Grade in Attendance: 85

*Grade in Major Exam: 95

*Grade in Minor Exam: 89

*Student Name(2): Jane

*Grade in Quiz: 80

*Grade in Attendance: 75

*Grade in Major Exam: 87

*Grade in Minor Exam: 93

This is exactly what I need to display.. am I asking for an impossible thing to do?

A: you iterate from 0 to n on arrayCritr, but you initialize arrayCritr with n1, both of which come from user input.
if n is ever bigger than n1 than you'll get that exception.
in your case, n is 4, and n1 should be 2, so you'll get an exception.

either change your for loop to use n1
for(int j=0; j<n1; j++){

or initialize arrayCritr with n
int [] arrayCritr = new int [n];

A: That line near the end:
for(int j=0; j<n; j++){

Shouldn't it be
for(int j=0; j<n1; j++){

You are using the wrong array limit.

A: Your arrayCritr is of n1 size but you are using index  from 0 to n. When your n > n1 then you will have this error. Change following code:
arrayCritr[j] = Integer.parseInt(inpt.readLine());
to
arrayCritr[i] = Integer.parseInt(inpt.readLine());
also having arrayCritr in your nested loop does not have sense so you better move it higher.

A: You are messing up your Crits array in the line crits[i] = crits[i+1];`
Soon, all the criteria will be overwritten with the last one. You already start to see that in your first bit of output:
Student Name: Wayne
Grade in Quiz: 90
Grade in Att: 80
Grade in Att: 70

But really, you need to get straight in your head what each array means, what each loop counter means. It is helpful to do this with pseudo code:
get number of criteria

get each criteria as input

get number of students

for each student in students:
  output student name
  for each c in criteria:
    output criteria for this student

When you look at your code, you will find that your structure doesn't follow this very well. Don't change the criteria array - change only where you are pointing in the array (i.e., the index).
In this context, it is helpful to use more meaningful variable names: numStudents and numCriteria, and studentIndex and criteriaIndex instead of n, n1, i, j. Once you do that, things will clean up and the problem will become apparent.


text:
Q: How do I sort grep output by time+date of file created? When I run this command,
grep _rlnAveragePmax *model*

I get this output:
run_ct6_it006_model.star:_rlnAveragePmax                             0.153500
run_ct6_it007_model.star:_rlnAveragePmax                             0.096772
run_it000_model.star:_rlnAveragePmax                             0.000000
run_it001_model.star:_rlnAveragePmax                             0.008995
run_it002_model.star:_rlnAveragePmax                         2.517429e-04
run_it003_model.star:_rlnAveragePmax                             0.003727
run_it004_model.star:_rlnAveragePmax                             0.056681
run_it005_model.star:_rlnAveragePmax                             0.109754
run_it006_model.star:_rlnAveragePmax                             0.153500

But the above output is sorted alphabetically.  If we sorted them by time+date created, the output should look like this:
run_it000_model.star:_rlnAveragePmax                             0.000000
run_it001_model.star:_rlnAveragePmax                             0.008995
run_it002_model.star:_rlnAveragePmax                         2.517429e-04
run_it003_model.star:_rlnAveragePmax                             0.003727
run_it004_model.star:_rlnAveragePmax                             0.056681
run_it005_model.star:_rlnAveragePmax                             0.109754
run_it006_model.star:_rlnAveragePmax                             0.153500
run_ct6_it006_model.star:_rlnAveragePmax                             0.153500
run_ct6_it007_model.star:_rlnAveragePmax                             0.096772

What do I have to do to my grep command to get the output sorted by time+date created?

A: Unless you're running macOS, the date a file is created is not stored. That concept is poorly defined anyway, since editing a file often creates a new file that replaces the previous version. What is recorded is the date a file was last modified (which includes both initial creation and any subsequent edit).
The easiest way to sort files by their modification time is to run zsh (as opposed to other, less powerful shells such as bash, ksh or fish). In zsh, you can use glob qualifiers such as Om to sort files by modification time (oldest first, make that Om to get youngest first).
grep _rlnAveragePmax *model*(Om)

That gives the desired result since grep traverses the files in the order given on the command line.

A: First do a time sorted ls, and then pipe the stdout to grep through xargs, using the -H flag to include the filename (since it will do it for only one file, default does not include the filename)
In a first grep after ls, directories are excluded (think this is not a recursive search from the example you provided). A second grep after ls, filters for the filename (without xargs)
ls -tpQ --quoting-style=shell | grep -v / | grep model | xargs -i grep -H _rlnAveragePmax {}

Update after Wildcard's valuable comments:
In order to take into account all cases in which filenames may have strange characters, inode numbers are extracted from ls, and piped into "find" for inode number matching and executing grep command. xargs is replaced with "while read line" since there would be two {}'s that the xargs command couldn't differentiate
Symlinks are followed, only files are included, excluding directories etc. The maxdepth argument is redundant in this context (only files are left) however I included it so that a recursive search could also be possible, changing the arguments:
ls -ti | cut -d " " -f1 | while read line; do find -L . -maxdepth 1 -type f -inum $line -exec grep -H xxx {} \; ; done


text:
Q: Creating a link from another column in a SharePoint List I have a SharePoint 2010 List that contains an email address field which has been created by using the person who added the list items username and tagging on our email domain name.
I have created a new column in the list to create a mailto link:
="Email Me"

This displays as code and works as a hyperlink, the problem I have is that the mailto link doesn't recognise the content of the [Email] address field, it returns:
mailto:[Email]

And when clicked it adds [Email] into the to field in Outlook rather than the email address in the field.
Am I doing something wrong? any help or advice would be gratefully received.
It's worth noting I don't have access to SharePoint Designer

A: You are adding the actual column name to a single string. You need to split the text string and add the column in between using &.
="Email Me"


text:
Q: How can I make socket sendto() block if the receiver's rcvbuf is full under UDP? So I'm trying to send 100000 udp packets to a server, about 20bytes each.
My server needs to do some processing for each packet, so now it seems like the rcvbuf can only hold ~1000 packets since the server is receiving too slow and I guess the rest of the packets are being dropped because of it.
Is there anyway to tell if the receiver's packet queue is full so that I can have my sender wait on it?

A: You can't.
By definition, UDP is an unreliable datagram protocol, with no flow control whatsoever.
If you want the sender to block when the receiver is full, use a TCP connection. UDP is connectionless. The sender has no information on the status of the receiver. All the sender does is send packets. UDP provides no feedback, whatsoever, on the receiver's status. If you want to implement any kind of flow control, you have to engineer it yourself, on top of UDP.


text:
Q: Django views: optimize code I have a problem with my views.py. I repeat a lot of code, I wonder if it is possible to optimize.
Here is my code:
Profile:
def profile(request, id):
    if 'person' in request.session:

        me = Users.objects.get(pk=session)

        total_songs = songs.count()
        total_fans = fans.count()
        total_friends = amigos.count()

        total_storage = porcentajeAlmacenamiento(me);
        storage_left = almacenamientoRestante(me);
        notifications = Notification.objects.all().filter(receptor=session, leido=0)
        total_notifications = notifications.count()

        return render_to_response("profile.html", {
            'total_amigos': total_amigos,
            'total_fans': total_fans,
            'total_songs': total_songs,
            'me': me,
            'total_storage': total_storage,
            'storage_left': storage_left,
            'notificaciones': notificaciones,
            'total_notifications': total_notifications},context_instance=RequestContext(request))
    else:
        return HttpResponseRedirect('/login/')

Home:
def home(request):
    if 'person' in request.session:

        me = Users.objects.get(pk=mi_session)
        songs = Song.objects.filter(autor__in = Friend.objects.filter(usuario=yo).values_list('amigo', flat=True)).order_by('-fecha_subida')
        comments = Comment.objects.all().filter(cancion__in=canciones)

        total_songs = songs.count()
        total_fans = fans.count()
        total_friends = amigos.count()

        total_storage = porcentajeAlmacenamiento(me);
        storage_left = almacenamientoRestante(me);
        notifications = Notification.objects.all().filter(receptor=session, leido=0)
        total_notifications = notifications.count()

        return render_to_response('index.html', {
            'total_friends': total_friends,
            'total_fans': total_fans,
            'total_songs': total_songs,
            'total_storage': total_storage,
            'storage_left': storage_left,
            'me': me,
            'comments': comments,
            'notifications': notifications,
            'total_notifications': total_notifications,
            'songs': songs}, context_instance = RequestContext(request))
    else:
        return HttpResponseRedirect('/login/')

As you can see, there is a part of code that repeats into almost all views:
  total_songs = songs.count()
  total_fans = fans.count()
  total_friends = amigos.count()

  total_storage = porcentajeAlmacenamiento(me);
  storage_left = almacenamientoRestante(me);
  notifications = Notification.objects.all().filter(receptor=session, leido=0)
  total_notifications = notifications.count()

Is there anything I can do to improve it?
Thanks

A: The obvious way would be to make a function returning a dictionary.
In your view you would create a dictionary with the remaining keys, and you would just do something along the following lines:
general_data = get_general_dict() # the redundant keys
specific_data = {'comments':comments, etc.)
specific_data.update(general_data)
return render_to_response('index.html', specific_data, context_instance = RequestContext(request))


text:
Q: Create Approval Process on Account Team Is there anyway to create an approval process on Account Team. So that the account team members will be requested through an approval process and their mangers can approve them so that they can be added in Account Team.

A: You need to build a custom solution for this use case.
Create a separate object like Account Team Management which will have related object like Account Team Members which will have user Id.
Expose Account Team Management as a Tab and define approval process on this object.
After approval, you need to write a trigger to add users to the Account Team.


text:
Q: What Jersey doesn't like in my Stateless Session Bean? This is my SLSB:
@Stateless(name = "FinderEJB")
@Path("/")
public class Finder implements FinderLocal {
  @Path("/simple")
  @GET
  public String simple() {
    return "works";
  }
}

The interface is:
@Local
public interface FinderLocal {
  public String simple();
}

This is what I'm getting in Glassfish server log when I'm trying to open the url /simple:
java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:156)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:67)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:208)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:115)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:75)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:115)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:67)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:775)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:740)
[...]

What is it about? I managed to find a topic about it at nabble.com, but it has no solution..

A: Mixing EJB / JAX-RS, with an interface and an implementation, i had these error too :
java.lang.IllegalArgumentException: object is not an instance of declaring class

It failed with glassfish V3 and 3.1, but it works well with tomcat 7 / jersey 1.5
I submit a bug with the test case :
http://java.net/jira/browse/GLASSFISH-16199

A: I had a similar problem; it turned out it was a configuration error in web.xml.
Be sure to use something like:

    <servlet>        <servlet-name>Jersey Servlet</servlet-name>        <servlet-class>        com.sun.jersey.spi.container.servlet.ServletContainer        </servlet-class>        <init-param>            <param-name>com.sun.jersey.config.property.packages</param-name>            <param-value>my.company.product.rs</param-value>        </init-param>        <load-on-startup>1</load-on-startup>    </servlet>

Hope it helped

A: The problem is that Glassfish (in its default installation) doesn't support EJB 3.1. You have to upgrade it in order to get such a support.


text:
Q: How can I improve Yorick's damage without making him too squishy? I'm testing Yorick as AD carry (sometimes is needed a top or mid that are not AP and does not need more tank), so I tested some builds but I didn't like so much about the damage received.
Here what I did in one test:

*

*Manamune

*Mercury's Treads

*Trinity Force

*infinite Edge

*Atma's Impaler

*and the last item i didn't finish, i was thinking in Warmogs or Spirit Visage.

The output was good (solo baron with an easy time, good damage, good resistence), but he was not resistant enough (This is why warmog or sv).
He attack speed is pretty low for Blood thrist instead of Infinite edge.
I have build him as Tank the whole time, he damage is great, but can't say that he can be a carry with a tank's build.

*

*Which equip should I get for last item?

*Should I change IE For BT?
NOTE: I think this question may help others champions like Nasus or Urgot.
I am really in a loss here, really appreciate some help

A: To answer your questions:

*

*In your build I would take Warmog's Armor or Guardian Angel as the last item.

*I think Infinity Edge is better since it works well with Atma's Impaler

However, you cannot think like that. There is no build which is generally good. Sometimes it is better to get this item othertimes that item.
If you want a general build for Yorick I would go for this one:

*

*Boots of Speed + 3 or 4 health pots (4 pots - when solo top, wait near the fountain and buy 4th pot ASAP)

*Tear of the Goddess => Manamune

*probably Mercury Treads unless they have a heavy ad team, then I would go for Ninja Tabi

*straight for Atma's Impaler

*Warmog's Armor (tankier build) or Frozzen Mallet (better chasing)

*The other one of the previously mentioned items or the new item Maw of Malmortius

*Trinity Force (damage) / Guardian Angel (tanky build) / Infinity Edge (in case I have Frozen Mallet)

In case of a need I would upgrade boots before finishing Manamune, but after Tear of the Goddess. If I woudlnt be doing very well I would also get Wriggle's Lantern after Manamune or even before that and Spirit Visage, but those are items you want to sell in late game.
Early boots upgrade and Atma will give you enough resists and in combination with Manamune you will have circa 250 AD.
Finally, I think that Yorick is better with a tankier build rather than AD.
Ad NOTE: I think Nasus benefits more from a far different build. Urgot is also good with Manamune and Atma, but before Atma he really needs Brutaliser and after Atma it is better to go different items. You can also build Frozen Heart before Atma which makes you even tankier and gives you some damage, too (since you have Manamune).


text:
Q: Getting node name using xpath I am having the following xml data:
<?xml version="1.0" encoding="UTF-8"?>
 <report>
  <sampleduration>900</sampleduration>
  <network>
    <gateway>
      <red>103</red>
      <blue>105</blue>
      <black>120</black>
    </gateway>
  </network>
 </report>

My requirement is to get list of node names and their values. However i am able to get list of values but not their node names.

name(//gate) - prints gate;
//gate/*/name() - prints correctly;

Is there any another way to achieve this apart from above xpath working code. It would be better if we can use functions from here - https://github.com/antchfx/xpath

A: A partial solution can be achieved with XPath-2.0:
//*/concat(name(),' - ',text()[1])

But the output is not in document order.
I don't know of any XPath-1.0 solution.


text:
Q: how to insert data to db in magento I created a new module following with this url:
In my module i created a registration form.
So now i want to insert the data entered into my registration form.
How is it possible?

A: Take a look at these instructions about models and database access:
http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-5-magento-models-and-orm-basics
This should get you up and running.

A: You need a custom db table with a custom model and collection of this table. There are lots of way but this is the magento way.
This link will help you http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/custom_module_with_custom_database_table


text:
Q: how to limit time for input in python, windows? I want to get string from user and limit the time for 5 sec, if he don't enter the string in this time print messege "no more time, bye!"
how to do it?
thanks you

A: You can monitor the keyboard with something like this and include it in a timed loop.