text:
Q: Type casting object[] to generic type K which is also an array I try to write a generic type casting method which will work for both complex objects and  arrays of objects. Below is my code:
public void Test()
{
     MyClass2[] t2 = m.MapItem<MyClass1[], MyClass2[]>(t1);
     return;
}

public K MapItem<T, K>(T source)
{
    if (typeof(T).IsArray && typeof(K).IsArray)
    {
        Type ek = typeof(K).GetElementType();
        IList sourceList = (IList)source;
        List<object> tmp = new List<object>();
        for (int i = 0; i < sourceList.Count; i++)
        {
            var k = Activator.CreateInstance(ek);
            tmp.Add(k);
        }
        var resultObj = tmp.ToArray();
        MapItem(source, resultObj);

        //Here i have resultObj is an object[] of the results,
        //which is to be casted result type K
        //BUT DOES NOT WORK!!!
        return (K)Convert.ChangeType(resultObj, typeof(K));

    }
    else
    {
        MethodInfo myMapperMethod = GetMyMapperMethodForThisType(typeof(T), typeof(K));
        return (K)myMapperMethod.Invoke(null, new object[] { source });
    }
}

public K MapItem<T, K>(T source, K dest)
{
    if (typeof(T).IsArray && typeof(K).IsArray)
    {
        IList sourceList = (IList)source;
        IList destList = (IList)dest;
        for (int i = 0; i < sourceList.Count; i++)
        {
            MapItem(sourceList[i], destList[i]);
        }
        return dest;
    }
    else
    {
        MethodInfo myMapperMethod = GetMyMapperMethodForThisType(typeof(T),typeof(K));
        return (K) myMapperMethod.Invoke(null, new object[] { source, dest });
    }
}

private MethodInfo GetMyMapperMethodForThisType(Type type1, Type type2)
{
    //some code to find appropriate function...
}

But, return (K) Convert.ChangeType(y, typeof(K)); cannot cast from object[] to K. How can I do this casting to return K from object[]?
Note: json serialization works but I don't want to use reflection or serialization.
  string jsonStr = JsonConvert.SerializeObject(resultObj);
  return JsonConvert.DeserializeObject<K>(jsonStr);

A: Fundamentally I think you want to avoid using List<object> at all. You should just create the array of the right size:
IList dest = Array.CreateInstance(ek, sourceList.Count);
for (int i = 0; i < sourceList.Count; i++)
{
    dest[i] = Activator.CreateInstance(ek);
}
K result = (K) dest;
// Note that this is calling MapItem<T, K>, not MapItem<T, object[]>
MapItem(source, result);
return result;


text:
Q: Can I have one class instance that returns another class instance? I'm trying to have one object that returns another object and passes some data to all the micro instances. This is what I'm trying to achieve.
export class Macro {
  constructor(props) {
    return (props) => {
      return Micro(props)
    }
  }
}

export class Micro {
  constructor(props) {
    this.macro = props
  }
}

let MicroInstance = new Macro({'happy': true})
let instance = new MicroInstance()
console.log(instance.macro.happy) // true

This throws an error:
  _classCallCheck(this, Macro);
                        ^

ReferenceError: Macro is not defined

Update 1)
Here's a more realistic use case for this. I'm trying to create a custom error object that uses info from a definition class, that way I don't have to keep passing all the same parameters to the LangError class.
let languages = {
  "en": {
    "login_errors": {
      "invalid_name": "Invalid Name: {name}!"
    }
  },
  "jp": {
    "login_errors": {
      "invalid_name": "無効な名前: {name}"
    }
  },
  "es": {
    "login_errors": {
      "invalid_name": "Nombre no válido: {name}!"
    }
  }
}

let LangError = new LangErrorDefinition({languages, nestedLocalesProp: 'login_errors'})
let error = new LangError('invalid_name', { name: 'Thomas' })
console.log(error.messages)

// { en: 'Invalid Name: Thomas!',
//   jp: '無効な名前: Thomas',
//   es: 'Nombre no válido: Thomas!' }

Update 2)
Using Jonathan Lonowski's answer it works here jsfiddle.
class Macro {
  constructor(props) {
    return () => {
      return new Micro(props)
    }
  }
}

class Micro {
  constructor(props) {
    this.macro = props
  }
}

let MicroInstance = new Macro({'happy': true})
let instance = new MicroInstance()
console.log(instance.macro.happy) // true

However it's still giving me a babel error in my local file.
/Users/thomasreggi/Desktop/project/test/error-suite.js:99
  _classCallCheck(this, Macro);
                        ^

ReferenceError: Macro is not defined
    at new Macro (error-suite.js:94:7)
    at Object.<anonymous> (error-suite.js:108:21)
    at Module._compile (module.js:398:26)
    at loader (/Users/thomasreggi/.nvm/versions/node/v5.3.0/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:130:5)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/thomasreggi/.nvm/versions/node/v5.3.0/lib/node_modules/babel-cli/node_modules/babel-register/lib/node.js:140:7)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:430:10)
    at /Users/thomasreggi/.nvm/versions/node/v5.3.0/lib/node_modules/babel-cli/lib/_babel-node.js:161:27
    at Object.<anonymous> (/Users/thomasreggi/.nvm/versions/node/v5.3.0/lib/node_modules/babel-cli/lib/_babel-node.js:162:7)

Update 3)
The error above is due to having commend Japanese characters, I'm using babel-node and 2015 and react presets.
https://gist.github.com/reggi/cb9e83ce74de17da1ca2935b0bb3ff1d

A: Not really. When a constructor returns any object, including a function, new will return that object as-is instead of the instance it created.
console.log(MicroInstance instanceof Macro);    // false
console.log(MicroInstance instanceof Function); // true

Though, with this in mind, Macro (or LangErrorDefinition) could just be a function and what it returns could be a new class (e.g., ModifiedMicro).
This can still make use of Micro through inheritance (extends), to avoid redefining the majority of the class for each ModifiedMicro created in a closure (Macro).
export class Micro {
  constructor(props, ...args) {
    this.macro = props;
    this.micro = args;
  }
}

export function Macro(props) {
  return class ModifiedMicro extends Micro {
    constructor(...args) {
      super(props, ...args);
    }
  };
}

let MicroInstance = Macro({'happy': true}) // no need for `new`
let instance = new MicroInstance('one', 'two')

console.log(instance.macro.happy) // true
console.log(instance.micro)       // ['one', 'two']

console.log(instance instanceof Micro); // true

[original answer]
The constructor for Macro has 2 issues currently:

*

*The props argument is declared twice.
constructor(props) {   // 1st
  return (props) => {  // 2nd
    // ...
  }
}

The 2nd declaration will be provided to Micro(props) due to variable shadowing, but only the 1st is given a value in your usage:
let MicroInstance = new Macro({'happy': true}) // 1st
let instance = new MicroInstance(/* props */)  // 2nd

*Missing new when returning Micro(props):
return new Micro(props)

Without that, you should see a TypeError:

Class constructor Micro cannot be invoked without 'new'

Adjusting for these, the console.log() should report true as you expected:
export class Macro {
  constructor(props) { // keep 1st `props`, removing 2nd
    return () => {
      return new Micro(props)
    }
  }
}

A: export function Macro( props) {
    return function() { this.macro = props }
}

may provide the stated functionality without the use of a fat arrow function (which can't be used as a constructor), or interacting with the prototype chain.
The new in a new Macro call would be noise and should be omitted.  Including it creates a new Macro instance object prototyped on Macro.prototype when Macro is called, only to have the instance object discarded because Macro returns a (different) function object.

redpajama_set_name: RedPajamaStackExchange


text:
Q: How to use value with placeholder This code is showing 0 but i want show enter location with back end hidden value 0
<input type="text" name="location" value="0" placeholder="Enter Location" />

How to do this please help me to fix the small issue.
Thanks

A: The value attribute refers to the value inside the text-field.
The placeholder is only visible if the text-field has no value.
because of this there is no way to set the value attribute and still see the
placeholder.
try using a custom attribute for your back-end code:
data-value

A: Remove value="0" from your markup and it will work. value="0" is like you typed 0 into it, so it does not show the placeholder

A: Unfortuntaly, any value added to the input, makes the placeholder dissapear. What you could do is add a value in the forms onsubmit handler if no value was entered
<form id="myForm">
   <input type="text" name="location" placeholder="Enter Location" />
</form>

<script>
    document.getElementById('myForm').addEventListener('submit', function() {
        var input = this.getElementsByName('location')[0];
        if (input.value.length === 0) input.value = '0';
    })
</script>

That way a zero is sent to the server if no value was inputted.
It would probably be easier to just check serverside if the input is part of the form data.

A: I think one of the solutions would be to put only the place-holder in the html & assign the default value in JS(if null).

$('form').submit(function(){
    var input = $('#test').val();
    if(input == ''){
         $('#test').val('empty');
    }
    alert($('#test').val());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<form>
    <input id="test" type="text" placeholder="Type here" />
    <input type="submit" />
</form>


text:
Q: Show that $M = 0$ iff $M_{\mathfrak{p}} = 0$ iff $M_{\mathfrak{m}} = 0$.
Let $R$ a commutative ring and $M$ an $R$-module. Show that the following statement are equivalent:

*

*$M = 0$,

*$M_{\mathfrak{p}} = 0$ for all $\mathfrak{p} \in \mathrm{Spec}(R)$,

*$M_{\mathfrak{m}} = 0$ for all $\mathfrak{m} \in \mathrm{Specm}(R)$.

Proof :

*

*1) $\implies$ 2): Let $M = 0$. Let $a/b \in M_{\mathfrak{p}}$ (i.e., $b \notin \mathfrak{p}$). Then
$$
  \frac{a}{b} = \frac{a}{1} \cdot \frac{1}{b} = \frac{0}{1}
$$
since $\frac{a}{1} = \frac{0}{1}$ and $\frac{0}{1} \cdot \frac{1}{b} = 0$.

*2) $\implies$ 3): Let $M_{\mathfrak{p}} = 0$ for all $\mathfrak{p} \in \mathrm{Spec}(R)$. Let $\mathfrak{m} \in \mathrm{Specm}(R)$ and $\mathfrak{p} \subset \mathfrak{m}$ a prime ideal. Let $a/b \in M_{\mathfrak{m}}$ (i.e., $b \notin \mathfrak{m}$). Since $b \notin \mathfrak{m}$, then $b \notin \mathfrak{p}$, and thus $a/b \in M_{\mathfrak{p}} = 0$. Therefore $\frac{a}{b} = \frac{0}{1}$.

*3) $\implies$ 1): Suppose $M \neq 0$, i.e., there is $x \in M$ with $x \neq 0$. Let $\mathfrak{m}$ a maximal ideal that contain $x$. Then $\frac{x}{1} = \frac{0}{1}$, and thus $x = 0$ which is a contradiction. Therefore, $M = 0$.
Question: Are my proofs correct ?

A: $$\boxed{(1) \implies (2)}$$
It seems to be correct, but writing $\frac{a}{b}=\frac{a}{1}\frac{1}{b}$ is a bit unclear somehow. What does $a/1$ really mean? What is the product between $\frac{a}{1}$ and $\frac{1}{b}$?
In order to clarify that, recall that $\dfrac{a}{s}$ is just an equivalence class of $(a,s) \in M \times S$ under some equivalence relation $\sim$.
Proving $ \dfrac{a}{s} = \dfrac{0}{1}$ is just proving that $(a,s) \sim (0,1)$, that is
$$\exists s' \in S,\;  s'(a\cdot 1 - 0 \cdot s) = 0$$
But $a=0$...

$$\boxed{(2) \implies (3)}$$
When you wrote "let $\mathfrak p\subset \mathfrak m$ a prime ideal", actually $\mathfrak p = \mathfrak m$ is fine. As mentioned in the comments, this implication is trivial since any maximal ideal of a commutative unital ring is prime.

$$\boxed{(3) \implies (1)}$$
As mentioned in the comments, saying "Let $\mathfrak m$ a maximal ideal that contain $x$" has no sense, because $x \in M$ while $\mathfrak m \subset R$.
Nevertheless, your idea is the right one (just applied to the wrong object ;-)) : you want some maximal ideal... containing not $x$ (which is not an element of $R$), but rather containing
$$I := (0 :_R x) = \mathrm{Ann}_R(x) = \{r \in R \mid r \cdot x = 0\}$$
Notice that $x \neq 0 \implies I \neq R$, so you can find a maximal ideal $\mathfrak m$ of $R$ that contains $I$. I let you finish the proof.


text:
Q: Pandas: How do I delete first two rows of headers? I'm using an excel file and would like to drop first two rows of headers that has 3 rows of headers.
Current File Example:
    Type1, Type2, Type3, Type4
    SubType1, SubType2, SubType3, SubType4
    SubSubType1-3,,,SubSubType4
0   Blah, Blah1, Blah2, Blah4
1
2

After dropping two headers:
    SubSubType1-3,,,SubSubType4
0   Blah, Blah1, Blah2, Blah4
1
2

I know there are several ways to drop rows using index but I could not find a way to drop first two rows of headers in multiple-header data.
Would appreciate any help.

A: Use header parameter with a value = 2.
data = pd.read_csv("file_name.csv", header=2)


text:
Q: How to extract specific no. of character from dataframe column Python Like Left formula we Used in Excel same as I want to extract no. of character from Policy no. column based on Insurer column like.....
if insurer is HDFC then Extract only 10 character form the sting and
if insurer is tata then Extract only 7 character form the sting.
and if insurer other than HDFC & tata then leave it as blank.
also see hdfc insure comes with lot of different name.
How I will achieve this in python

Insurer
Policy no.
Expected OutPut

Hdfc
4509242332
4509242332

Tata
tatadigitNational
tatadig

Hdfc ergo
09082323ab12sd
09082323ab

HDFC
nolanheroman
nolanherom

Tata
97543007356
9754300

Tata
pqrsequence2o202
pqrsequ

Tata
987654321
9876543

HDFC health ergo
nolanheroman
nolanherom

Digit
1733choola

star
naahiHonaar

A: What you can do is define a new function that does the comparison and apply that to a new column (Expected OutPut in your example).
def f(row):
    val = str(row['Policy no.'])
    return val[:10] if row['Insurer'] == "Hdfc" else val[:7]

df['Expected OutPut'] = df.apply(f, axis=1)

A: You can try np.select
df['out'] = np.select(
    [df['Insurer'].str.lower().eq('hdfc'),
     df['Insurer'].str.lower().eq('tata')],
    [df['Policy no.'].str[:10],
     df['Policy no.'].str[:7],],
    df['Policy no.']
    )

print(df)

  Insurer         Policy no. Expected OutPut         out
0    Hdfc         4509242332      4509242332  4509242332
1    Tata  tatadigitNational         tatadig     tatadig
2    Hdfc     09082323ab12sd      09082323ab  09082323ab
3    Hdfc       nolanheroman      nolanherom  nolanherom
4    Tata        97543007356         9754300     9754300
5    Tata   pqrsequence2o202         pqrsequ     pqrsequ
6    Tata          987654321         9876543     9876543

A: One possible solution is,
df['temp'] = df['Insurer'].map({'Hdfc':10, 'Tata':7})
df['Expected Output'] = df.apply(lambda x: x['Policy no.'][:x['temp']], axis=1)

O/P:
  Insurer         Policy no. Expected Output  temp
0    Hdfc         4509242332      4509242332    10
1    Tata  tatadigitNational         tatadig     7
2    Hdfc     09082323ab12sd      09082323ab    10
3    Hdfc       nolanheroman      nolanherom    10
4    Tata        97543007356         9754300     7
5    Tata   pqrsequence2o202         pqrsequ     7
6    Tata          987654321         9876543     7

A: Another solution:
df['Expected OutPut'] = df.apply(lambda x: x['Policy no.'][0:10] if x['Insurer']=='Hdfc' else x['Policy no.'][0:7], axis = 1)
print(df)

Insurer         Policy no. Expected OutPut
0    Hdfc         4509242332      4509242332
1    Tata  tatadigitNational         tatadig
2    Hdfc     09082323ab12sd      09082323ab
3    Hdfc       nolanheroman      nolanherom
4    Tata        97543007356         9754300
5    Tata   pqrsequence2o202         pqrsequ
6    Tata          987654321         9876543

A: You could try this

df['Expected Output'] = np.where(df['Insurer']== 'Hdfc', df["Policy no"].str[:10],df["Policy no"].str[:7])

A: You can easily do this by converting the dataframe to an array, then iterating through every row
array = df.to_numpy()

for row in array:
    #assuming you only have 2 columns, check to see if the insurer is Tata
    if row[0] == 'Tata':
        #slice string in the Policy column
        row[1] = row[1][:7]
#now, convert array back to df
pd.Dataframe(array, columns=['Insurer','Policy no.'])


text:
Q: How to encode a string in python3.6..? My code is
import base64
var = "this is a program for string capitalize method"
var1 = base64.b64encode(bytes('var','utf-8'))
print("String Encode:",end=''),print(var1.encode('base64','strict'))

but I am getting the following error:

AttributeError: 'bytes' object has no attribute 'encode'

A: Line 3 replace 'var' with var.
line 4 print var1 directly.
import base64
var = "this is a program for string capitalize method"
var1 = base64.b64encode(bytes(var,'utf-8')) # to encode above text
print("String Encode:",end=''),print(var1)) # var1 encoded string in bytes


text:
Q: Junit Test Method I have always a confusion about the Methods  in Junit.

*

*If someone is asking whether can I make a test method Private/Protected in Junit, So is he talking about the Method which should start with test or any other method like setup() , teardown() in Junit.

*What is the return type of Junit Method. So I have always seen the return type use to be Void so can we change the return type?

*Now sometimes the question will come like can I test a Private method Using Junit. So as much I know Junit by default call the method which will start with test and it should be Public then only It will be able to call outside of the class using Junit. So if I declared a test Method as private how Junit will call it or test it outside of the class.

A: 1) Your test methods should be public.
2) return type is always void.
3) You don't test private methods you test the public methods in your class, which will in turn presumably call the logic within your private methods. You should try and cover all the branches of code within these private methods too.

A: From org.junit.Test annotation docs
The Test annotation tells JUnit that the public void method to which it is attached can be run as a test case

A: For testing private methods, I recommend making them protected or package protected. Then you can create a subclass that overrides the method and test it.
I have seen many posts stating flatly that you MUST not test private methods. I cannot imagine less useful straitjacketing. If you are trying to refactor your code, you are obligated to yourself and everyone around you to create a set of tests that ensure that the functionality is preserved before you even start changing the code. With regression problems properly fenced in, you can then start refactoring/retesting/refactoring.
Similarly, internal methods often are the places where fault recognition or recovery are done. Testing of those methods requires that proper firewalling of data is performed and that "impossible" situations are recognized. Recovery operations should also be checked to see that they handle "impossible" situations as well.
Using reflection to test private methods is a last resort, but it may be necessary if you cannot change the class under test or if you have orders from management. The "bad practice" is that you are violating encapsulation. However, encapsulation is only of concern to blackbox testing; the process of whitebox testing involves finding out if ALL of your code works, not just the visible stuff.


text:
Q: hstore_translate existing data migration I've added hstore_translate to a Rails4 project with existing data.
class Product < ActiveRecord::Base
  translates :subtitle, :description
end

config.i18n.fallbacks = true

class AddTranslationColumnsToProducts < ActiveRecord::Migration
  def change
    add_column :products, :subtitle_translations, :hstore
    add_column :products, :description_translations,  :hstore
  end
end

How can I access my old subtitle and description fields? Because now Post.subtitle and Post.description always nil. Fallback doesn't work or I need migrate data first?
upd:
This migration solves problem.
class MigrateExistingDataToTranslations < ActiveRecord::Migration
  def change
    execute "UPDATE products p SET subtitle_translations=hstore('en',(select subtitle from products where id = p.id));"
    execute "UPDATE products p SET description_translations=hstore('en', (select description from products where id = p.id));"
  end
end

A: hstore_translate defines methods to read the various translations.
When defining translates :subtitle, :description, the methods subtitle & description are created, which gets the fitting translation. So when calling Product.subtitle, instead of getting the column and its data it is calling the method.
To access the data temporarily you should comment out the hstore_translate setup
class Product < ActiveRecord::Base
  # translates :subtitle, :description
end

Then merge your data to the new columns before uncommenting again.


text:
Q: How to show singular Sturm-Liouville problem has no eigenvalues? I have the following SL problem:
$$ (x^{2} f')'+ \lambda f = 0 $$
where $ \lvert f(x) \rvert $ is bounded as $ x \rightarrow 0 $ and $ f(1) = 0 $
I have to show that the above problem has NO eigenvalues.
I know that this is a Cauchy-Euler ODE and set $ f = x^m $ and plugged it in.
I solved for $ m $ using the quadratic equation in terms of $ \lambda $ but I am not sure how to prove there are no eigenvalues.

A: There are solution $x^m$ of $(x^2 f')'+\lambda f=0$, where
$$
                         m(m+1)+\lambda=0 \\
                         m^2+m+\lambda = 0 \\
                        (m+1/2)^2=1/4-\lambda \\
                         m=-1/2\pm\sqrt{1/4-\lambda}.
$$
For convenience, normalize this solution at $x=1$ by imposing $f(1)=0$, $f'(1)=1$, which gives
$$
             f(x)=\frac{x^{-1/2+\sqrt{1/4-\lambda}}-x^{-1/2-\sqrt{1/4-\lambda}}}{2\sqrt{1/4-\lambda}} \\
        = \frac{x^{\sqrt{1/4-\lambda}}-x^{-\sqrt{1/4-\lambda}}}{2\sqrt{x}\sqrt{1/4-\lambda}} \\
        = \frac{e^{i\ln(x)\sqrt{\lambda-1/4}}-e^{-i\ln(x)\sqrt{\lambda-1/4}}}{2i\sqrt{x}\sqrt{\lambda-1/4}} \\
        = \frac{\sin(\ln(x)\sqrt{\lambda-1/4})}{\ln(x)\sqrt{\lambda-1/4}}\cdot\frac{\ln(x)}{\sqrt{x}}
$$
This function is not bounded near $x=0$, regardless of the value of $\lambda$.


text:
Q: Search for duplicates, then assign value to another column based on which has the highest value in a separate column I need to look for duplicates in my table, then check to see which has the highest age, update the oldest column with which one of them is the oldest, by replacing with their name.
+---------+-----+--------+
|  Name   | Age | Oldest |
+---------+-----+--------+
| John    | 22  | NULL   |
| John    | 25  | NULL   |
| James1  | 34  | NULL   |
+---------+-----+--------+

A: You will find your duplicates with this select statement
SELECT name FROM your_table
GROUP BY name
Having COUNT(name) > 1

result "John"

This will result in a list (of one in this case) of duplicate names.

Then you may use this update statement to obtain the result you are looking for:
UPDATE your_table
SET oldest = name
WHERE name = 'John'
AND age IN (SELECT MAX(age) FROM your_table WHERE name = 'John'

In this particular case, you need to do the process manually running the update statement once for each duplicate that you found with the duplicate select query.
In any case, it would be convenient that your table had an identification column such  an id (INT)column. This two step process may be further develop in a stored procedure.


text:
Q: Python OpenCV2 (cv2) wrapper to get image size? How to get the size of an image in cv2 wrapper in Python OpenCV (numpy). Is there a correct way to do that other than numpy.shape(). How can I get it in these format dimensions: (width, height) list?

A: cv2 uses numpy for manipulating images, so the proper and best way to get the size of an image is using numpy.shape. Assuming you are working with BGR images, here is an example:
>>> import numpy as np
>>> import cv2
>>> img = cv2.imread('foo.jpg')
>>> height, width, channels = img.shape
>>> print height, width, channels
  600 800 3

In case you were working with binary images, img will have two dimensions, and therefore you must change the code to: height, width = img.shape

A: I'm afraid there is no "better" way to get this size, however it's not that much pain.
Of course your code should be safe for both binary/mono images as well as multi-channel ones, but the principal dimensions of the image always come first in the numpy array's shape. If you opt for readability, or don't want to bother typing this, you can wrap it up in a function, and give it a name you like, e.g. cv_size:
import numpy as np
import cv2

# ...

def cv_size(img):
    return tuple(img.shape[1::-1])

If you're on a terminal / ipython, you can also express it with a lambda:
>>> cv_size = lambda img: tuple(img.shape[1::-1])
>>> cv_size(img)
(640, 480)

Writing functions with def is not fun while working interactively.
Edit
Originally I thought that using [:2] was OK, but the numpy shape is (height, width[, depth]), and we need (width, height), as e.g. cv2.resize expects, so - we must use [1::-1]. Even less memorable than [:2]. And who remembers reverse slicing anyway?
Python 3 tuple unpacking
After we all moved to Python 3, and thus have this https://peps.python.org/pep-3132/ -- we can also get h and w by using tuple unpacking:
h, w, *_ = img.shape

This time, we need not worry about single channel images :)

A: import cv2
import numpy as np

def main():
    # init cv
    cap = cv2.VideoCapture(0)

    while True:
        success, img = cap.read()
# WAY 1
        img = cv2.flip(img, 1)

        print(img.shape)
# WAY 2
        print(
            f"width: {cap.get(cv2.CAP_PROP_FRAME_WIDTH)}, height: {cap.get(cv2.CAP_PROP_FRAME_HEIGHT)}, fps: {cap.get(cv2.CAP_PROP_FPS)}")
        cv2.imshow(winname="universal control", mat=img)
        cv2.waitKey(1)

if __name__ == '__main__':
    main()


text:
Q: Compute and draw a weighted networkx graph with edge lengths corresponding to weights Say I have a networkx graph:
g=nx.gnm_random_graph(5,5)
for u,v,w in g.edges(data=True):
    w = np.random.randint(0,10)

I'd like to represent this as if each edge has a fixed length (its weight value). The networks I am looking at are radial in nature - I know in advance that this is possible (I don't have the restriction raised in unutbu's comment here).
I want to randomly compute co-ordinates for the nodes (with the fixed edge length constraints) and plot them. I then want to tabulate the distance between all the nodes that are not linked by edges.
From what I've read so far, it seems as though networkx draws nodes without consideration of edge lengths. But the node positions can be explicitly defined. So I'd need to write a function to compute the node positions.
Does anyone know of a networkx, or other, function that might help with this?
More generally, is networkx suited to this task?

A: I stumbled over this and even though its fairly old I will try to give an answer:
First, I tried your code and it doesnt seem to work.
In [60]:  for u,v,w in g.edges(data=True):
    ...:      w = np.random.randint(0,10)

gives me
In [61]:  list(g.edges_iter(data='weight',default = 1))
Out[61]:  [(0, 4, 1), (0, 2, 1), (1, 2, 1), (2, 3, 1), (2, 4, 1)]

So the weights all remain '1'. Thats logical, since you are only altering 'w' and not the edge's parameter 'weight'. You can achieve that by using the following:
In [62]:  for u,v in g.edges():
    ...:      g[u][v]['weight'] = np.random.randint(0,10)

which gives you
In [63]:  list(g.edges_iter(data='weight',default = 1))
Out[64]:  [(0, 4, 1), (0, 2, 8), (1, 2, 7), (2, 3, 3), (2, 4, 8)]

The Placement of the nodes is done by passing a dictonary with x and y coordinates for each node. Such a dictonary can be obtained by using the networkx placing algorithms, which can be foud here networkx.drawing.layout. Using the networkx.circular_layout as a basis, you could use numpy  to subsequently build your graph-coordinates outwards from center. That would of cause require a little bit of simple trigonometrics and would only work, if your system is not over-determined.


text:
Q: Exclude selected text in R (Rstudio) I would like to select part of my R script and "exclude" it by inserting # at the beginning of each line. (I don't know what's the term for this)
Sample code:
df <-
   data.frame(Numbers = 1:26,
              Letters = letters)

df

What I would like to do:
#df <-
#   data.frame(Numbers = 1:26,
#              Letters = letters)

#df

Is there a shortcut to do this other than inserting the #'s manually?

A: Try this, Select line and Ctrl+Shift+c

A: Ctrl+ Shift + C

If you use RStudio, you can use the keyboard shortcut Ctrl + Shift + C (Command + Shift + C on macOS) to comment out a line of text.

Source


text:
Q: Extend Property with isDirty I want to track changes to the properties of my classes in typescript so that I only update the fields in my database which have actually changed. Currently, I am using an array where I add properties when they change and then I iterate through the array to determine what fields changed and need to be updated in the database. However, I would prefer to do this with some sort of isDirty check.  My thought is that I would be able to call something like if (property.dirty) then {} to determine if a property has changed.
I remember being able to do something along these lines in vb.net, but it's been a while and I can't remember exactly what we did in that codebase.
Is the desired code below possible?
Current Code
class test{
  private _ID: Guid;
  private _dirty: Array<{}>;

  get ID(): Guid {
    return this._ID;
  }
  set ID(id: Guid) {
    if (this._ID != id) {
        this._ID = id;
        this._dirty.filter(function (f) { return f.Field == "id" }).length > 0 ? this._dirty.filter(function (f) { return f.Field == "id" })[0].Value = id.toString() : this._dirty.push({Field: "id", Value: id});
    }
  }

  get Name(): string {
      return this._Name;
  }
  set Name(name: string) {
      if (this._Name != name) {
          this._Name = name;
          this._DirtyFields.filter(function (f) { return f.Field == "ccseq_name" }).length > 0 ? this._DirtyFields.filter(function (f) { return f.Field == "ccseq_name" })[0].Value = name : this._DirtyFields.push(new EntityField("ccseq_name", name, FieldType.String));
      }
  }
}

Desired Code
class test{
  private _ID: Guid;

  get ID(): Guid {
    return this._ID;
  }
  set ID(id: Guid) {
    if (this._ID != id) {
        this._ID = id;
        this._ID.isDirty = true;
    }
  }

  get Name(): string {
      return this._Name;
  }
  set Name(name: string) {
      if (this._Name != name) {
          this._Name = name;
          this._Name.isDirty = true;
      }
  }
}

A: In javascript you can add a property to an object so it's not a problem to do this:
this._ID.dirty = true;

Even when Guid doesn't have this dirty member.
The problem of course is typescript which will complain because of that.
To avoid that you can simply do:
private _ID: Guid & { dirty?: boolean };

Edit
Again, javascript already supports it, you can do this:
obj.dirty = true;

For any js type: booleans, strings, arrays and even functions.
But for having support for that in typescript you can do this:
interface Object {
    dirty?: boolean;
}

But be aware that you are adding this to **all* of the objects that you have in your code. As you're not actually changing the prototype it won't have any effect in runtime, but typescript-wise it will effect all instances.

A: The way I solved this was to create a Field class that I then used as properties in my Objects.
Field Class
export class EntityField {
    private _Field: string;
    private _Value: any;
    private _FType: FieldType;
    private _isDirty: boolean;

    constructor(field: string, value: any, fType: FieldType) {
        this._Field = field;
        this._Value = value;
        this._FType = fType;
        this._isDirty = false;
    }

    markClean(): void {
        this._isDirty = false;
    }

    markDirty(): void {
        this._isDirty = true;
    }

    get isDirty(): boolean {
        return this._isDirty;
    }

    get Field(): string {
        return this._Field;
    }
    set Field(field) {
        if (this._Field !== field) {
            this._Field = field;
        }
    }

    get Value(): any {
        return this._Value;
    }
    set Value(value: any) {
        if (this._Value !== value) {
            this._Value = value;
            this._isDirty = true;
        }
    }

    get FType(): FieldType {
        return this._FType;
    }
    set FType(fType: FieldType) {
        if (this._FType != fType) {
            this._FType = fType;
        }
    }
}

Usage
export class Entity{
  public Name: Field
}

Entity test = new Entity()
Entity.Name.isDirty() // Returns False
Entity.Name.Value = "Test";
Entity.Name.isDirty() // Returns True


text:
Q: What are the device-width css for iphone7 plus? I need to detect the devices for IOS devices  by JS,
for iphone-6 I check it by the ratio and devicePixelRatio,
I didn't find any information to check if the device is iPhone 7 plus.
I found information for the older devices,
What are the device-width css viewport sizes of the iPhone6 and iPhone 6 Plus
or this
http://mydevice.io/devices/

A: iPhone 7 has same device width/height as the iPhone 6: 375x667
iPhone 7 plus according the same: 414x736

A: You can easily detect your device CSS width and height by single clicking this link: http://viewportsizes.com/mine/
For iPhone 6 its 375px X 667px
For iPhone 6+ its 375px x 667px
For iPhone 7 its 375px X 667px
For iPhone 7+ its 414px x 736px

A: The iPhone 7 Plus is 414 x 736 according to Apple:
https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html


text:
Q: meaning of Press Book I can't understand the meaning of "press book" in the sentence below:

They could marry soon. Preparations for a wedding had been in the Royal family's press book since she was sixteen; they could pull it out in a month if they wanted to.

Who is talking is a princess of a fairy tale, but she lives in a imaginary kingdom that seems United Kingdom.

A: The term press book, in this context, may be used to emphasise the fact that the wedding of the 16-year-old lady had been planned for years, so it's something prearranged and well-known to everybody. If something is written in the press book of a person, it is going to happen in the future regardless of the  individual's will; the meaning is close to that of to be written in the stars, but with the difference that at the origin of the prearrangement there is a person/a community and not an abstract entity as that of Destiny.
I'm brought to this conclusion by this article, where it's said that a press book...

... is a collection of works and communications used to represent an individual, group of individuals, service, company or product. It is usually associated with creative professionals. It may be textual,graphic (photo, illustration,painting...), animated (video/film,3D...), or algorithmic (games...).

It may include press releases, advertisings, editorials, instructions for use, or any information that pertains to that person/product, or of works and communications used to represent an individual, group of individuals, service, company, or product. It is usually associated with creative professionals.


text:
Q: Simple HTML DOM Parser not same as Chrome Source Viewer? Trying to get code from this page xem-phim-sat-pha-lang-kill-zone
if press F12 on Chrome and Press Ctrl+F to find Object Tags, you will see Object tag with flashvar and some param tags.
but i use Simple_html_dom.php to parsing, it cannot show that Object tags...
$html2=file_get_html('http://phimhay77.com/xem-phim-sat-pha-lang-kill-zone-33797');
$hihi=$html2->find('object',0);
echo htmlentities($hihi);

A: If you press Ctrl-F in Chrome then you see the DOM: which is the DOM from the original source HTML, plus modifications cause by any JavaScript which has run.
My guess is that the <object> which you see was created by JavaScript, and that the <object>does not exist in the original source HTML (I don't see an <object> in the HTML when I do "view page source"); and I guess that file_get_html is parsing the HTML without/before any modifications made to the DOM by JavaScript.
I suspect that the <object> which you're seeing is from the 'jwplayer' video player component (see this hyperlink and this hyperlink for further details), which uses inserts <object> into the DOM if it's run in a browser which supports the Adobe Flash player.

So How can I parsing Value of "Proxy.link" from this script?

It's here in the HTML source code:


text:
Q: I have two tables,from that am fetching data with left join post id is the common field in both the tables.If I want to select the comments under same post_id,only 1 time the post should display and all its comments under it..
this is my code....
home.php

<?php

$sql="SELECT family_news.post_id,family_news.username,family_news.post,
            family_news.fileToUpload,family_news.description,
            family_comments.post_id,family_comments.comment,
            family_comments.commenter
     FROM family_news
        LEFT JOIN family_comments ON family_news.post_id = family_comments.post_id
     ORDER BY family_news.post_id DESC";

if($result =  mysqli_query($con, $sql))
{
    while($row = mysqli_fetch_array($result))
    {
?>

    <?php
        echo $row['username'];
    ?>

        <?php
        if($row['fileToUpload'] != NULL)
        {
        ?>
     <form action="post_comment.php" method="POST">
            <input class="form-control" type="hidden" name="post_id" value="<?php echo $row['post_id']; ?>">

        <img class="img-responsive" src="../admin_panel/uploads/<?php echo $row['fileToUpload']; ?>" alt="Image Loading" height='80' width='120'>

            <?php
                echo $row['description'];
            ?>

Comments

            <?php
                echo $row['commenter'];
            ?>

            <?php
                echo $row['comment'];
            ?>

            <input class="form-control" type="text" name="comment" placeholder="Write a comment">

            <input class="form-control" type="hidden" name="commenter" value="<?php echo $_SESSION['uname']; ?>">
            <input type="submit" class="btn btn-primary" value="Post">

    </form>
        <?php
        }
        if($row['post'] != NULL)
        {
        ?>

            <form action="post_comment.php" method="POST">
            <input class="form-control" type="hidden" name="post_id" value="<?php echo $row['post_id']; ?>">
            <?php
            echo $row['post'];
            ?>

Comments

            <?php
                echo $row['commenter'];
            ?>

            <?php
                echo $row['comment'];
            ?>

            <input class="form-control" type="text" name="comment" placeholder="Write a comment">

            <input class="form-control" type="hidden" name="commenter" value="<?php echo $_SESSION['uname']; ?>">
            <input type="submit" class="btn btn-primary" value="Post">
            </form>
<?php
        }
?>

<?php
    }
}

?>

post_comment.php

<?php
$post_id=$_POST['post_id'];
$comment=$_POST['comment'];
$commenter=$_POST['commenter'];

if($comment != NULL) {
    $sql="INSERT INTO family_comments
                (post_id, comment, commenter)
          VALUES ('$post_id', '$comment', '$commenter')";

    if($con ->query($sql) == TRUE)
    {
        echo 'Comment saved Successfully...';
    }
} else {
    echo 'Please Write Something...';
}
?>


text:
Q: How to track when a data download from SQL Server DB in Email I am using SQL server email client.
I am sending mails using
EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'Mailer_Profile',
    @recipients = @Email,
    @copy_recipients = @ccRecipts,
    @body = @MESSAGE  ,
    @body_format = 'HTML',
    @subject = @SUB

In the  @MESSAGE we are putting some information , when the mail will be opened , it has to be downloaded from our Database end. We need to track this. i.e. when it was downloaded or which mail ID it has downloaded.

A: You want know if the mail has been opened, or has the link been clicked and some data downloaded?
If the former is true, then there's no way to check this from sql server. Over here you can check sent_status field, which has three values for: 1=sent, 2=failed and 3=unsent. But no value for delivered.
SELECT * FROM msdb..sysmail_mailitems

If you want to check if the user has clicked the link, then your code EXEC msdb.dbo.sp_send_dbmail doesn't help much, because we don't know what is supposed to happen when the user clicks the link, and you'll have -10 for this question very soon :).


text:
Q: AngularJS ng-attr-placeholder doesn't work in input type text I realised that placeholder attribute in Internet Explorer 11 does not work when the cursor is on (what a surprise!) despite that w3schools says it is compatible with ie10+ (even though their try it yourself example does not work well in ie).
This is what users see when they want to login:

so I found about ng-attr-placeholder instead but I cannot seem to make it work.
<input type="password" name="password" id="password" ng-model="user.password" class="form-control" ng-attr-placeholder="Password" required="" autofocus="">

Any ideas what I am doing wrong?
Thank you in advance!


text:
Q: R: Dataframe organisation, structuring and subsetting dataframe I have the following dataframe in R (only sample data)
data <- data.frame(NAME=c("NAME1", "NAME1", "NAME1","NAME2","NAME2","NAME2"),
                   ID=c(47,47,47,259,259,259),
                   SURVEY_YEAR=c(1960,1961,1965,2007,2010,2014),
                   REFERENCE_YEAR=c(1959,1960,1963,2004,2009,2011),
                   CUMULATIVE_SUM=c(-6,-10,-23,-9,NA,-40))

In a tabular form it looks like this:
  NAME  ID SURVEY_YEAR REFERENCE_YEAR CUMULATIVE_SUM
1 NAME1  47        1960           1959             -6
2 NAME1  47        1961           1960            -10
3 NAME1  47        1965           1963            -23
4 NAME2 259        2007           2004             -9
5 NAME2 259        2010           2009             NA
6 NAME2 259        2014           2011            -40

What I am trying to do is to restructure my dataframe so that it should look like this in the end:
   NAME  ID SURVEY_YEAR REFERENCE_YEAR CUMULATIVE_SUM CUMULATIVE_SUM_REFYEAR
1 NAME1  47        1960           1959             -6                      0
2 NAME1  47        1961           1960            -10                     -6
3 NAME1  47        1965           1963            -23                    -10
4 NAME2 259        2007           2004             -9                      0
5 NAME2 259        2010           2009             NA                     NA
6 NAME2 259        2014           2011            -40                     -9

I am trying to achieve this by using the following code:
# loop through elements in data$CUMULATIVE_SUM
for (i in 1:length(data$CUMULATIVE_SUM)) {
  # take value of upper row, but take NULL if in upper row there is another NAME or end of table
  if (i==1) {
    value=0 # If first row
  } else {
    if (data$NAME[i-1]==data$NAME[i]) {
      value=data$CUMULATIVE_SUM[i-1] # Normal case: take upper value
    } else {
      value=0 # If other NAME
    }
  }
  data$CUMULATIVE_SUM_REFYEAR[i] <- value # Write new value in new column
}

Using this code, my result of the above code looks like this:
   NAME  ID SURVEY_YEAR REFERENCE_YEAR CUMULATIVE_SUM CUMULATIVE_SUM_REFYEAR
1 NAME1  47        1960           1959             -6                      0
2 NAME1  47        1961           1960            -10                     -6
3 NAME1  47        1965           1963            -23                    -10
4 NAME2 259        2007           2004             -9                      0
5 NAME2 259        2010           2009             NA                     **-9**
6 NAME2 259        2014           2011            -40                     NA

As you may have noticed when comparing it with my desired solution the value of -9 is in the wrong place (marked in bold). Is there a way how I could make this exception if there is a NA value in a row? I am stuck. Thank you for your help!

A: Try
library(data.table)
setDT(data)[!is.na(CUMULATIVE_SUM),
            CUMULATIVE_SUM_REFYEAR := c(0, CUMULATIVE_SUM[-.N]),
            by = NAME]
data
#     NAME  ID SURVEY_YEAR REFERENCE_YEAR CUMULATIVE_SUM CUMULATIVE_SUM_REFYEAR
# 1: NAME1  47        1960           1959             -6                      0
# 2: NAME1  47        1961           1960            -10                     -6
# 3: NAME1  47        1965           1963            -23                    -10
# 4: NAME2 259        2007           2004             -9                      0
# 5: NAME2 259        2010           2009             NA                     NA
# 6: NAME2 259        2014           2011            -40                     -9

A: Using dplyr
  library(dplyr)
  left_join(data, data %>%
  group_by(NAME) %>%
  filter(!is.na(CUMULATIVE_SUM)) %>%
  mutate(CUMULATIVE_SUM_REFYEAR= lag(CUMULATIVE_SUM, 1, 0)))
  #      NAME  ID SURVEY_YEAR REFERENCE_YEAR CUMULATIVE_SUM CUMULATIVE_SUM_REFYEAR
  #1 NAME1  47        1960           1959             -6                      0
  #2 NAME1  47        1961           1960            -10                     -6
  #3 NAME1  47        1965           1963            -23                    -10
  #4 NAME2 259        2007           2004             -9                      0
  #5 NAME2 259        2010           2009             NA                     NA
  #6 NAME2 259        2014           2011            -40                     -9


text:
Q: Fortran Read into multiple variables I am currently working on understanding the process of a mutliscale simulation built in fortran which was not commented very well, and coupled with my lack of knowledge about fortran is making this a difficult task. I'm primarily having an issue understanding one statement regarding the fortran read command. A skeleton of the statement is below.
read(somestring, *, iostat = iospara) outstring, &
(someint, somearray(index), index = 1, statenum)

Now somestring is read from an input file and has the form of:
'label     1 2'

where the pair of numbers depends on statenum which is read from a different line in the input file. For example if statenum = 2 then somestring has the form:
'label     1 2 2 2'

My question is how do the parenthesis in the output variable list affect the read statement? That would be the:
(someint, somearray(index), index=1, statenum)

I haven't been able to find any information on this looking through documentation of READ. This is in fortran 2008. I also can't really provide a full working example as the code is extremely large and my attempts to recreate this statement separately have not succeeded.

A: That is an implied do, you will find many  questions and answers about this feature on this site. Sometimes people call it also implicit do, but that is not the standard name.
It repeats the part before the index: someint, somearray(index), for the values of the index i with values from 1 to statenum.
That translates the input list as:
outstring, someint, somearray(1)

for statenum = 1, and to
outstring, someint, somearray(1), someint, somearray(2)

for statenum = 2.
Note that someint should not appear twice in the same input list or its value will be undefined.


text:
Q: Give redux-form input an active class What is the best way to have buttons in redux-form control radio inputs?
We are trying to have a button that when clicked, has an "active" class, and also selects the corresponding radio button.


text:
Q: How to display part of a bitmap transparent I want to anti-alias some bitmap in Delphi. The file is loaded from file, assigned to an image, processed (apply_kernel) and the result is assigned to another image. In Delphi the left/bottom pixel determines the transparent color when Image.Transparent = True. I work only with 32 bit bitmaps.
dump ('henon.bmp');
Image3.Picture.LoadFromFile ('henon.bmp');
apply_kernel (Image3.Picture.Bitmap, bitmap, kernel);
Image4.Picture.Bitmap := bitmap;
Image4.Picture.Bitmap.SaveToFile ('alias.bmp');
dump ('alias.bmp');

This works for the loaded bitmap assigned to Image3, but not for the computed bitmap assigned to Image4. The color of the left/bottom remains unchanged (clWhite). In order to understand what happens I dump the bitmaps to file, each color separately (see dumps below). I did check the transparency of the images, autosize is of, as is center and stretch, the bitmap is 32x32, the images too. I also tried To set TransparentColor := clWhite, to no avail. I must make a very stupid mistake but can't find it. Could somebody help me?
Edit
Torbins reminded me I had forgotten about the reserved byte. It is set at 128 at some positions, actually exactly the position of the zeroes (see the updated dump). I did several things which in the end resulted in a transparent bitmap:
 - simply zeroed all reserved bytes.
 - a lot more which all did not work until
 - using the assigment works, the Draw does not work strangely enough, the reasoning of Sertac seems sound
Anyhow, the code that works is
dump ('henon.bmp');
Image3.Picture.LoadFromFile ('lorenz.bmp');
apply_kernel (Image3.Picture.Bitmap, bitmap, kernel);
Image4.Picture.Bitmap.SetSize (bitmap.Width, bitmap.Height);
//   Image4.Picture.Bitmap.Canvas.Draw (0, 0, bitmap); // <== does not work
Image4.Picture.Bitmap := bitmap;                   // <== works
bitmap.SaveToFile ('alias.bmp');
dump ('alias.bmp');

@Sertac, maybe I do something wrong with the Draw?
@Torbins, zeroing all reserved bytes is rather rude, I'll experiment some with your suggestion with the alpha channel
Thanks you all very much!
henon.bmp:
    Red
        0: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        1: 255   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        2: 255 255 255   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        3: 255 255 255 255 255   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        4: 255 255 255 255 255 255 255 255   0   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        5: 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        6: 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255
        7: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255
        8: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255
        9: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0   0 255 255 255 255 255 255
       10: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255   0   0   0 255 255 255 255 255
       11: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255   0   0   0 255 255 255
       12: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255   0   0 255 255 255
       13: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255   0   0 255 255
       14: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255   0   0 255
       15: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255   0 255   0   0 255
       16: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255   0 255
       17: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255 255   0   0 255
       18: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255   0   0 255
       19: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255 255   0   0 255 255
       20: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255   0   0 255 255 255
       21: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255 255   0   0 255 255 255 255
       22: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255 255   0   0 255 255 255 255 255
       23: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255 255   0   0 255 255 255 255 255 255 255
       24: 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255 255 255 255   0   0 255 255 255 255 255 255 255 255 255
       25: 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255 255 255   0   0   0 255 255 255 255 255 255 255 255 255 255
       26: 255 255 255 255 255 255 255 255 255   0 255 255 255 255 255 255   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255
       27: 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       28: 255 255 255 255 255 255 255 255 255 255   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       29: 255 255 255 255 255 255 255   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       30: 255 255 255 255 255   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       31: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255

    Green
        0: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        1: 255   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        2: 255 255 255   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        3: 255 255 255 255 255   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        4: 255 255 255 255 255 255 255 255   0   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        5: 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        6: 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255
        7: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255 255
        8: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0 255 255 255 255 255 255 255 255 255
        9: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0   0   0   0 255 255 255 255 255 255
       10: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255   0   0   0 255 255 255 255 255
       11: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255   0   0   0 255 255 255
       12: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255   0   0 255 255 255
       13: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255   0   0 255 255
       14: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255   0   0 255
       15: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255   0 255   0   0 255
       16: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255   0 255
       17: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255 255   0   0 255
       18: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255   0   0 255
       19: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255 255   0   0 255 255
       20: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255   0   0 255 255 255
       21: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255 255   0   0 255 255 255 255
       22: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255 255   0   0 255 255 255 255 255
       23: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255 255   0   0 255 255 255 255 255 255 255
       24: 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0 255 255 255 255 255 255   0   0 255 255 255 255 255 255 255 255 255
       25: 255 255 255 255 255 255 255 255 255 255   0   0   0 255 255 255 255 255 255   0   0   0 255 255 255 255 255 255 255 255 255 255
       26: 255 255 255 255 255 255 255 255 255   0 255 255 255 255 255 255   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255
       27: 255 255 255 255 255 255 255 255 255 255 255 255 255   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       28: 255 255 255 255 255 255 255 255 255 255   0   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       29: 255 255 255 255 255 255 255   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       30: 255 255 255 255 255   0   0   0 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       31: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255

    Blue
        0: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        1: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        2: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        3: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        4: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        5: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        6: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        7: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        8: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        9: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       10: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       11: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       12: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       13: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       14: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       15: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       16: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       17: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       18: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       19: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       20: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       21: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       22: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       23: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       24: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       25: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       26: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       27: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       28: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       29: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       30: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       31: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255

reserved
    0:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
    1:   0 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
    2:   0   0   0 128 128 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
    3:   0   0   0   0   0 128 128 128 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
    4:   0   0   0   0   0   0   0   0 128 128 128 128 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
    5:   0   0   0   0   0   0   0   0   0   0   0 128 128 128 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
    6:   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128 128 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0
    7:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128 128 128 128   0   0   0   0   0   0   0   0   0   0
    8:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128 128 128 128   0   0   0   0   0   0   0   0   0
    9:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128 128 128 128 128   0   0   0   0   0   0
   10:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128   0 128 128 128   0   0   0   0   0
   11:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128   0   0 128 128 128   0   0   0
   12:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128   0   0 128 128   0   0   0
   13:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128   0   0   0 128 128   0   0
   14:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128   0   0   0 128 128   0
   15:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128   0 128   0 128 128   0
   16:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128   0   0   0   0 128   0
   17:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128   0   0   0   0 128 128   0
   18:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128   0   0   0   0 128 128   0
   19:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128   0   0   0   0 128 128   0   0
   20:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128   0   0   0   0 128 128   0   0   0
   21:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128   0   0   0   0 128 128   0   0   0   0
   22:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128   0   0   0   0   0 128 128   0   0   0   0   0
   23:   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128   0   0   0   0   0 128 128   0   0   0   0   0   0   0
   24:   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128   0   0   0   0   0   0 128 128   0   0   0   0   0   0   0   0   0
   25:   0   0   0   0   0   0   0   0   0   0 128 128 128   0   0   0   0   0   0 128 128 128   0   0   0   0   0   0   0   0   0   0
   26:   0   0   0   0   0   0   0   0   0 128   0   0   0   0   0   0 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0
   27:   0   0   0   0   0   0   0   0   0   0   0   0   0 128 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
   28:   0   0   0   0   0   0   0   0   0   0 128 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
   29:   0   0   0   0   0   0   0 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
   30:   0   0   0   0   0 128 128 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
   31: 128   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

alias.bmp:
    Red
        0: 194 154 148 106  98  98 123 156 205 238 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        1: 207 177 172 133 114  95 102 121 159 191 216 235 248 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        2: 212 184 179 144 127 110 115 127 150 173 197 214 226 231 237 249 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        3: 229 216 214 191 168 133 110  98  98 110 127 150 168 185 197 214 231 249 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        4: 255 248 249 231 214 197 173 150 127 110  98  98  92  92 110 150 185 214 226 237 249 255 255 255 255 255 255 255 255 255 255 255
        5: 255 255 255 255 249 237 226 214 197 173 150 121  92  69  69  86 110 144 173 197 214 231 249 255 255 255 255 255 255 255 255 255
        6: 255 255 255 255 255 255 255 249 237 226 214 185 150 110  86  81  75  69  81 110 150 185 220 243 255 255 255 255 255 255 255 255
        7: 255 255 255 255 255 255 255 255 255 255 249 231 214 197 173 139  98  69  52  46  69 110 162 202 226 237 249 255 255 255 255 255
        8: 255 255 255 255 255 255 255 255 255 255 255 255 249 237 226 202 162 110  69  40  34  52  98 150 179 197 220 243 255 255 255 255
        9: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 243 220 185 144  92  52  40  52  81 110 139 168 202 231 249 255 255
       10: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 231 202 162 110  75  57  75  86 110 127 156 191 231 248 255
       11: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 243 220 179 139  92  81  92 121 121 121 133 185 229 255
       12: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 220 173 115  86  92 127 139 133 127 156 197 238
       13: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 214 150  98  98 139 162 144 121 127 159 204
       14: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 231 173  98  75 110 168 168 144 121 127 161
       15: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 243 197 115  81 104 162 173 150 110 114 153
       16: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 231 173  98  75 110 179 208 185 133 114 153
       17: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 214 150  98  98 150 208 214 168 121 114 153
       18: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 220 173 115  92 115 179 220 202 156 127 127 161
       19: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 231 185 144 115 121 162 208 202 168 139 133 159 204
       20: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 237 214 185 144 121 121 162 197 197 168 144 144 168 204 238
       21: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 231 214 202 191 168 144 144 162 185 197 179 150 144 168 208 242 255
       22: 255 255 255 255 255 255 255 255 255 255 255 255 249 231 220 202 179 150 150 156 168 168 185 197 185 162 156 173 208 243 255 255
       23: 255 255 255 255 255 255 255 255 255 249 237 226 220 208 191 162 150 150 173 179 179 173 179 173 173 185 197 220 243 255 255 255
       24: 255 255 255 255 255 255 255 255 243 226 214 202 185 173 173 179 179 173 179 179 173 156 162 185 208 220 231 249 255 255 255 255
       25: 255 255 255 255 255 255 255 249 231 202 173 162 162 173 179 179 173 179 179 162 150 156 185 208 231 249 255 255 255 255 255 255
       26: 255 255 255 255 255 255 255 243 226 197 179 173 173 168 168 168 150 150 162 185 197 202 220 243 255 255 255 255 255 255 255 255
       27: 255 255 255 255 255 255 249 231 214 197 185 168 156 144 139 139 150 179 202 220 226 237 249 255 255 255 255 255 255 255 255 255
       28: 255 255 255 255 249 231 214 202 191 173 162 150 144 150 173 191 202 214 231 249 255 255 255 255 255 255 255 255 255 255 255 255
       29: 255 255 255 249 237 208 179 150 150 162 185 197 202 202 214 226 237 249 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       30: 255 255 255 242 216 172 146 140 172 197 216 223 229 235 248 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       31: 255 255 255 246 230 205 189 180 197 222 246 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255

    Green
        0: 194 154 148 106  98  98 123 156 205 238 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        1: 207 177 172 133 114  95 102 121 159 191 216 235 248 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        2: 212 184 179 144 127 110 115 127 150 173 197 214 226 231 237 249 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        3: 229 216 214 191 168 133 110  98  98 110 127 150 168 185 197 214 231 249 255 255 255 255 255 255 255 255 255 255 255 255 255 255
        4: 255 248 249 231 214 197 173 150 127 110  98  98  92  92 110 150 185 214 226 237 249 255 255 255 255 255 255 255 255 255 255 255
        5: 255 255 255 255 249 237 226 214 197 173 150 121  92  69  69  86 110 144 173 197 214 231 249 255 255 255 255 255 255 255 255 255
        6: 255 255 255 255 255 255 255 249 237 226 214 185 150 110  86  81  75  69  81 110 150 185 220 243 255 255 255 255 255 255 255 255
        7: 255 255 255 255 255 255 255 255 255 255 249 231 214 197 173 139  98  69  52  46  69 110 162 202 226 237 249 255 255 255 255 255
        8: 255 255 255 255 255 255 255 255 255 255 255 255 249 237 226 202 162 110  69  40  34  52  98 150 179 197 220 243 255 255 255 255
        9: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 243 220 185 144  92  52  40  52  81 110 139 168 202 231 249 255 255
       10: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 231 202 162 110  75  57  75  86 110 127 156 191 231 248 255
       11: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 243 220 179 139  92  81  92 121 121 121 133 185 229 255
       12: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 220 173 115  86  92 127 139 133 127 156 197 238
       13: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 214 150  98  98 139 162 144 121 127 159 204
       14: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 231 173  98  75 110 168 168 144 121 127 161
       15: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 243 197 115  81 104 162 173 150 110 114 153
       16: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 231 173  98  75 110 179 208 185 133 114 153
       17: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 214 150  98  98 150 208 214 168 121 114 153
       18: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 220 173 115  92 115 179 220 202 156 127 127 161
       19: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 231 185 144 115 121 162 208 202 168 139 133 159 204
       20: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 237 214 185 144 121 121 162 197 197 168 144 144 168 204 238
       21: 255 255 255 255 255 255 255 255 255 255 255 255 255 255 249 231 214 202 191 168 144 144 162 185 197 179 150 144 168 208 242 255
       22: 255 255 255 255 255 255 255 255 255 255 255 255 249 231 220 202 179 150 150 156 168 168 185 197 185 162 156 173 208 243 255 255
       23: 255 255 255 255 255 255 255 255 255 249 237 226 220 208 191 162 150 150 173 179 179 173 179 173 173 185 197 220 243 255 255 255
       24: 255 255 255 255 255 255 255 255 243 226 214 202 185 173 173 179 179 173 179 179 173 156 162 185 208 220 231 249 255 255 255 255
       25: 255 255 255 255 255 255 255 249 231 202 173 162 162 173 179 179 173 179 179 162 150 156 185 208 231 249 255 255 255 255 255 255
       26: 255 255 255 255 255 255 255 243 226 197 179 173 173 168 168 168 150 150 162 185 197 202 220 243 255 255 255 255 255 255 255 255
       27: 255 255 255 255 255 255 249 231 214 197 185 168 156 144 139 139 150 179 202 220 226 237 249 255 255 255 255 255 255 255 255 255
       28: 255 255 255 255 249 231 214 202 191 173 162 150 144 150 173 191 202 214 231 249 255 255 255 255 255 255 255 255 255 255 255 255
       29: 255 255 255 249 237 208 179 150 150 162 185 197 202 202 214 226 237 249 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       30: 255 255 255 242 216 172 146 140 172 197 216 223 229 235 248 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
       31: 255 255 255 246 230 205 189 180 197 222 246 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255

    Blue (omitted as it is all 255)

A: You have to draw the bitmap, assigning won't work. See the documentation for TransparentColor for instance:

Determines which color of the bitmap is to be transparent when the
  bitmap is drawn.

But then it's likely that you'll still end up with a white background. Here's how it goes: If you use something like Image4.Picture.Bitmap.Canvas.Draw(.. the image will be drawn such that pixels having the transparent color in the source image will not be drawn. That is, the background of the target image with those pixels will not be changed. And those unchanged pixels are white (default background color of a new bitmap). So you'll have to use something like this:
Image4.Picture.Bitmap.Canvas.Brush.Color := clGreen; // specify your background color
Image4.Picture.Bitmap.SetSize(32, 32);               // now you have a green bitmap
Image4.Picture.Bitmap.Canvas.Draw(0, 0, bitmap); // draw non-transparent parts over green bg.

A: To borrow from the Delphi help documentation I have here.
 procedure TForm1.Button1Click(Sender: TObject);
  var
    mybitmap: TBitmap;
  begin
    mybitmap := TBitmap.Create;
    try
      with mybitmap do begin
        LoadFromFile('C:\Program Files\Borland\Delphi 3\Images\Splash\256color\factory.bmp');
        Transparent := True;
        TransParentColor := mybitmap.canvas.pixels[25,25];
        Form1.Canvas.Draw(0,0,myBitMap);
        TransparentMode := tmAuto;   // Transparent color now is clDefault =  TColor($20000000);
        Form1.canvas.Draw(250,0,myBitMap);
        end;
    finally
       myBitmap.free;
    end;
end;

A:
I want to anti-alias some bitmap in Delphi.

If you want to draw with alpha-transparency, then you need to check forth byte (rgbReserved) of your bitmaps. In modern Delphi versions the use of that forth byte is controlled via TBitmap.AlphaFormat. You need to set it to afDefined and that's all. In older Delphi versions you will need to draw bitmaps manually via AlphaBlend function.
Also for older Delphi versions I have created this unit, maybe it will help you somehow: http://mikolatorbins.narod.ru/AlphaImageUtils.pas (it is free for any use).


text:
Q: what parameters can impove kube-proxy performance? We are having problems on kube-proxy loading iptables. It locks docker when there's a large number of services. Is there a way to tune this with its parameters?
From its documentation, I can only find --iptables-min-sync-period and --iptables-sync-period might be related? What's the recommended values for these in a large network?

A: We spent the last few weeks looking at this, too.  I assume you are also also seeing big CPU spikes (or even a constant 100% iptables) in networks with large amounts of ingress rules/routes.
That was identified a few releases ago and in the 1.5 cycle we got a few patches in that would reduce the number of iptables calls being made.  In addition to that, we have introduced the min-sync-period flag which guarantees iptables will only run every X period.
Our tests set iptables-min-sync-interval=30s but we haven't yet decided yet what to do by default in OpenShift.  Hope to have some more formal position soon.


text:
Q: Is there any sort of 'default' variable in R, like in Perl? So, I want to select some values out of a vector based on their output from a certain function.
Where, for example:
RES <- c("CTSD_1", "CTSD_2", "ARID3A")
RE <- RES[1]
strhead(RE, -2)

Would return "CTSD"
Now, what I want to do is something along these lines:
RES[strhead($_, -2) == strhead(RE, -2)]

Where $_ would be replaced with whatever the respective value of RES is. Is there a good way to do this?
I'm aware I could just write a for loop and do it like that, but it would be nice to have it in one line.

A: So, you just want to get "those elements in RES where the first two characters match [the first two characters of the first entry in RES]"? If so, sort of; R is a vectorised language. When you perform an operation on a vector, like subsetting, what you're actually doing is performing that test on each /element/ of the vector. So you want something like:
RES <- RES[strhead(RES, -2) == strhead(RES[1],-2)]


text:
Q: Angular Typeahead (ui.bootstrap.typeahead) - getting latitude/longitude I am having trouble using the angular typehead
There is an example here that uses angular typehead to create an auto-complete using the Google maps API.
My problem is that when I click on the results within the typehead my model is then populated with the item.formatted_address data.  How can I click on the formatted address and then populate with the lat/longitude data
// Any function returning a promise object can be used to load values asynchronously
$scope.getLocation = function(val) {
  return $http.get('http://maps.googleapis.com/maps/api/geocode/json', {
    params: {
      address: val,
      sensor: false
    }
  }).then(function(res){
    var addresses = [];
    angular.forEach(res.data.results, function(item){
      addresses.push(item.formatted_address);
    });
    return addresses;
  });   };

Asynchronous results

Model: {{asyncSelected | json}}

<input type="text" ng-model="asyncSelected" placeholder="Locations loaded via $http" typeahead="address for address in getLocation($viewValue)" typeahead-loading="loadingLocations" class="form-control">

A: There are many ways of achieving the desired result, below I'm presenting one of the possibilities. But before diving into the solution it is important to notice that the typeahead uses similar syntax to the AngularJS built-in select directive and as such you can use expressions in all the parts of the typeahead attribute. Given this you could write:
typeahead="address as address.formatted_address for address in getLocation($viewValue)"

and change your XHR success callback to:
.then(function(response){
      return response.data.results.map(function(item){
        return {
          location: item.geometry.location,
          formatted_address: item.formatted_address
        }
      });

Here is a working plunk: http://plnkr.co/edit/4PwaFaeIOeIDRCsvuidn?p=preview

A: This is a part of the model of the item returned by the google map API :
Model: {
  "address_components": [
//Not useful here
[...]
    }
  ],
  "formatted_address": "E, Santiago de Cuba, Cuba",
  "geometry": {
    "bounds": {
      "northeast": {
        "lat": 20.0076143,
        "lng": -75.8325446
      },
      "southwest": {
        "lat": 20.0069908,
        "lng": -75.8372035
      }
    },
    "location": {
      "lat": 20.007418,
      "lng": -75.8349013
    },
    "location_type": "GEOMETRIC_CENTER",
    "viewport": {
      "northeast": {
        "lat": 20.00865153029151,
        "lng": -75.8325446
      },
      "southwest": {
        "lat": 20.0059535697085,
        "lng": -75.8372035
      }
    }
  },
  "types": [
    "route"
  ]
}

As you can see, in their example angular-ui selects item.formatted_adress
You want latitude and longitude information, so that would be item.location.
Getting it straight from the typeahead would involve manipulating JSON and finding the correct data structure, so you may want to start by letting the user select the location as it exists in the documentation example, and then asking the maps API more details about that particular location, thus retrieving location data.


text:
Q: placing read data from file into record I have a record for employees. Six fields long, with things such as
private String name;
private String id;
private double salary;

I need to read the raw data from a .txt file containing 18 lines of data for three different employees (6 lines per employee), and place the data into a specific employee record. So far, this is what I have in my main method:
public static void main(String[] args)
{
    //employee declarations
    Employee e1 = new Employee();
    Employee e2 = new Employee();
    Employee e3 = new Employee();
    int count = 0;
    int emp_count = 0;

    File in_file = new File("EmployeeData.txt");
    Scanner fscan = new Scanner(in_file);

    while(fscan.hasNext())
    {
        e1.set_name

not quite sure how to get the appropriate line of data from the txt file into its corresponding slot in an employee record. Any suggestions?

A: You can create a separate function which only read one Employee record at a time
public static Employee readEmployeeData(Scanner scanner) {

    Employee employee = new Employee();
    if (scanner.hasNext())
        employee.name = scanner.next();//Use getter setters
    if (scanner.hasNext())
        employee.id = scanner.next();
    if (scanner.hasNextDouble())
        employee.salary = scanner.nextDouble();
    else
        scanner.next();// For double case

    return employee;
}

A: You could use reflect for the fields of Employee class, which may be represented as a array or something. After the array is filled with everything, you can change into another object to fill.
The only question is that, the order of data in txt file same is the same as the field list of the object. There may be something you should do to adjust the order between the field in object and the data line in txt file.


text:
Q: How to you reference a required script that is bundled? I'm working with the Hot Towel SPA template and I'm trying to add in some data that I want to get from breeze. I have the breeze nuget package installed and the breeze script files are in the scripts folder of the site.
I can reference it by using the actual file name like the following:
define(['durandal/app', '../scripts/breeze.min.js'], function (app, breeze) {
...
});

However, this will break when my site is running in release mode and the script is actually bundled. Plus, it is really ugly and feels like a hack to put the full name in there.
What is the correct way to do this?

A: By default Durandal loads external libraries via normal script calls not via requirejs. Same is true for HotTowel.
e.g. https://github.com/BlueSpire/Durandal/blob/master/index.html#L31
or if your platform supports it via bundling
https://github.com/johnpapa/PluralsightSpaJumpStartFinal/blob/master/SPAJumpStart/App_Start/BundleConfig.cs#L18
Simply load breeze before requiring main.js and you should be good to go.


text:
Q: How to implement OAuth flow in Bot without using OAuthPrompt Dialog for unsupported channels such as Zoom and WebEx I have an existing bot code that uses OAuthPrompt dialog that I would like to deploy for Zoom and WebEx that are not supported by Azure Bot Service. As per the documentation and sample code, I have used the adapter for supporting those channels. It works fine. But it does not support OAuthPrompt Dialog, it returns "OAuthPrompt.BeginDialog(): not supported by the current adapter".
When I debugged with the source code (Bot builder SDK /w Adapter), Implementation of OAuthPrompt dialog checks whether adapter implements IExtendedUserTokenProvider interface, currently it is not, so it returns error. How to add OAuth card support without using OAuthPrompt Dialog/Azure Bot Service?
This question is similar to mine:
(Is there any way to use authentication service without azure bot service?)
Following are my thoughts:

*

*Directly send a request to identity provider with redirect URL (my bot endpoint) for OAuth2 code flow. Also update the redirect URI in the App Registration portal with bot endpoint, currently I have provided Redirect URI as "https://token.botframework.com/.auth/web/redirect" for supported channels.

*Implement the IExtendedUserTokenProvider in the adapter (similar to Emulator).
Any feedback is appreciated.

A: I can get it working by having customized OAuthPrompt dialog for Zoom, implementing IExtendedUserTokenProvider in ZoomAdapter (ZoomAdapterWIthErrorHandler). OAuth connection settings (such as identity server endpoint, scopes, redirect uri} are stored in the appSettings.json for the connection name. Supported channels (MS Teams and Slack) will use the SDK provided implementation (OAuthPrompt Dialog) with settings from ConnectionName configured in the Azure, unsupported channels will get the settings from the AppSettings.json file. GetSignInResourceAsync() should have the right implementation that returns the sign-in resource Uri.


text:
Q: Setup the bottom of the page AdMob banner I'm trying to setup an AdMob banner on the bottom of the page, but the Ad does not show.
Space appears the bottom of the page there, but the AdMob does not show there.

*

*Add and reference the Google Play services library. - YES

*Add a meta-data tag in AndroidManifest.xml. - YES

*Declare com.google.android.gms.ads.AdActivity in the manifest. - YES

*Set up network permissions in the manifest. - YES

Somebody tell me why.
Thank you.
My XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/flContainer"                <!-- DATA Layout -->
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/ad_layout"
        android:orientation="vertical" />

    <LinearLayout
        android:id="@+id/ad_layout"                  <!-- AdMob Layout -->
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:layout_alignParentBottom="true"
        android:orientation="vertical" />

</RelativeLayout>

MainActivity.java
// Create an ad.
adView = new AdView(context);
adView.setAdSize(AdSize.BANNER);
adView.setAdUnitId(AD_UNIT_ID);

// Add the AdView to the view hierarchy. The view
// will have no size
// until the ad is loaded.
LinearLayout layout = (LinearLayout) findViewById(R.id.ad_layout);
//layout.getBottom();
layout.addView(adView);

// Create an ad request. Check logcat output for the
// hashed device ID to
// get test ads on a physical device.
AdRequest adRequest = new AdRequest.Builder()
        .addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
        .addTestDevice("INSERT_YOUR_HASHED_DEVICE_ID_HERE").build();

// Start loading the ad in the background.
adView.loadAd(adRequest);

A: You told fldContainer to matchParent. THis means it will consume all the space of the parent, leaving none for your ad.
Instead try:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:id="@+id/flContainer"                <!-- DATA Layout -->
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical" />

    <LinearLayout
        android:id="@+id/ad_layout"                  <!-- AdMob Layout -->
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:orientation="vertical" />

</LinearLayout>


text:
Q: Irrational P-adics $\mathbb{Q}_p$ is completion of $\mathbb{Q}$ by defining a new metric. So, with respect to this new metric they are complete.
I just want to be sure, are there p-adic rationals? If there are P-adic irrationals, what sense they make. I mean, how are they constructed?
Edit My question was if P-adic irrationals exist. I made some type rendering a little confusing question. Sorry. I did not intend to ask if p-adic rationals are existant.
Thank You.

A: Ittay Weiss already answered the main question, so I will only add an example construction of an irrational $5$ adic number. Let's do a $5$-adic $\sqrt{-1}$.
We begin by noticing that $2$ is a good $5$-adic approximation to $\sqrt{-1}$, because $2^2=4=-1+5$ is pretty close to $-1$ as $5$ is a small number in this context. Can we find a better one? After a little bit of searching we notice that
$$
7^2=49=-1+50=-1+2\cdot5^2
$$
is even closer to $-1$ as $2\cdot 5^2$ is a smaller error than $5$ (the higher the power of $5$ dividing a number, the smaller it is $5$-adically). Observe that $7=2+1\cdot5$, so I left the "most significant digit" $2$ in tact, and only tuned up the next digit the best I could.
Proceed with this turning our attention to the next digit. How could we find it? We are looking for an even better approximation $q=7+a\cdot 25$. Given this we can calculate
$$
q^2=7^2+14a \cdot 25+ a^2\cdot 5^4.
$$
Aiming at an error divisible by $5^3=125$ we can ignore that last term. We want to select $a$ in such a way that $7^2+14a\cdot25\equiv -1\pmod{125}$. This is equivalent to $$14 a\cdot25\equiv -50=-2\cdot25\pmod{125},$$ and thus also to $14a\equiv -2\pmod5.$ We see that $a=2$ is a solution to this congruence. Therefore we end up with $q=7+2\cdot25=57$. Let's check
$$
57^2=3249=-1+3250=-1+26\cdot 125.
$$
The error in the square has, indeed, shrunk to a multiple of $125$.
It is not hard to see (once your studies reach Hensel's Lemma, you'll learn why)
that we can go on forever, and find numbers $a_i\in\{0,1,2,3,4\}$, $i=3,4,\ldots,$ such that the partial sums of the series
$$
2+1\cdot5+2\cdot5^2+a_3\cdot5^3+a_4\cdot5^4+\cdots
$$
have squares differing from $-1$ by multiples of everincreasing powers of five.
This justifies calling the sum of this series (to get it to converge we need to go the $5$-adic completion)
$$
"\sqrt{-1}"=\lim_{n\to\infty}\left(57+\sum_{k=3}^na_k5^k\right)
$$
A caveat: there is another $5$-adic square root of $-1$, not unexpexctedly, the negative of the one above. It is a bit dangerous to pick one of them and call it "the square root of $-1$" so I really shouldn't. As an exercise you can do
a few iterations of this process starting with another good initial approximation
$\sqrt{-1}\approx3$ ($3^2=9=-1+2\cdot5$), and check that you get the "negative" of the series I was calculating. The verification will be easier, if you observe that
$$
-1=\frac{4}{1-5}=4\frac1{1-5}=4\sum_{k=0}^\infty5^k=4+4\cdot5+4\cdot5^2+\cdots
$$
as a consequence of the sum formula of the geometric series.

A: The rationals with a given metric embed in the completion with respect to that metric (this is true of any metric space of course). So, given a $p$-adic metric on $\mathbb Q$, we have that $Q$ embeds in the completion. The completion is the set of $p$-adic numbers. So, we may identify the rationals in the $p$-adic numbers and thus consider elements in the completion that are not in the rationals to be irrational $p$-adic numbers. The existence of such irrationals is immediate: The set of rationals is countable, but the completion is uncountable.


text:
Q: Make API call to Office365 Graph I want to send Office365 Graph HTTP requests using C#.
For eg.
Graph query : https://graph.microsoft.com/v1.0/users
will fetch all the users in a json format.
So I need to do with the help of C# so that I can easily play with json and can print those users in my console.

A: Doing the api call would look something like that:
string json = null;
using (var client = new HttpClient())
{
    var response = await client.GetAsync("https://graph.microsoft.com/v1.0/users");
    if(response.IsSuccessStatusCode)
    {
        json = await response.Content.ReadAsStringAsync();
    }
}

if(!string.IsNullOrEmpty(json))
{
    // Do something with your json
}

To be able to work with the returned json data I suggest using Json.Net.
Note:
The type HttpClient lives in the Namespace System.Net.Http, so don't forget to add:
using System.Net.Http;


text:
Q: Display extra data from a Search Query Currently learning through a Udemy Course but changed the lecture to something I am more interested in developing.
Project Basis:
- using Gem Flightstats-flex to pull flight data
- trying to display associated info from a search query
Current setup
app/controllers/trackers_controller.rb
class TrackersController < ApplicationController

  def search
    @tracker = FlightTracker.new_from_lookup(params[:tracker])
    render 'users/my_tracker'
  end

end

app/models/flight_tracker.rb
class FlightTracker < ActiveRecord::Base

    self.table_name='trackers'

    def self.new_from_lookup(tracker)
      flight_track = FlightStats::FlightStatus.by_flight_id(tracker)
      # flight_position = FlightStats::FlightStatus.track_by_flight_id(tracker)

end

This is where the problem happens, when I remove # from flight_position = FlightStats::FlightStatus.track_by_flight_id(tracker)

*

*the results overwrite the top

*if I use the line only it displays and vice versa for the top line

app/views/users/my_tracker.html.erb the data does render

  My Tracker

Search for Flights

  <%= form_tag search_trackers_path, method: :get, id: "tracker-lookup-form" do %>

        <%= text_field_tag :tracker, params[:tracker],
                                  placeholder: "Stock ticker symbol", autofocus: true,
                                  class: "form-control search-box input-lg" %>

        <%= button_tag(type: :submit, class: "btn btn-lg btn-success") do %>
           Look up a tracker
        <% end %>

  <% end %>

  <%=@tracker.inspect%>
    ID:  <%#= @tracker&.flight_id %>
    Code:  <%#= @tracker&.carrier_fs_code %>
    Number:  <%#= @tracker&.flight_number %>
    Departure:  <%#= @tracker&.departure_airport_fs_code %>
    Arrival:  <%#= @tracker&.arrival_airport_fs_code %>
    <%# Departure Terminal:  <%= @tracker&.departure_terminal %> %>
  <%=@position.inspect%>

So when an user searches for a .by_flight_id , I want it to show the related data for .track_by_flight_id
Hoping to move to the next stage of more data associations after a query is completed.

A: As illustration for my comment
def self.new_from_lookup(tracker)
  flight_track = FlightStats::FlightStatus.by_flight_id(tracker)
  flight_position = FlightStats::FlightStatus.track_by_flight_id(tracker)
  OpenStruct.new(flight_track: flight_track, flight_position: flight_position)
end

Then you'll need to rewrite template my_tracker.html.erb to handle new data structure


text:
Q: How to change the index property in Azure SQL Database I could change the index property in one of the table from Unique, Non-Clustered, Filtered to Non-Unique, Non-Clustered in SQL Server on local machine. But I could NOT find any property in accessing Azure SQL Database via SQL Server MAnagement Studio.
How do I change in via TSQL?

A: After upgrading to latest SSMS 17.9.1, still not be able to change this via this tool So the query will drop first and then recreated:
DROP INDEX [IX_ClubApplicationUser_LastModifiedBy] ON [dbo].[ClubApplicationUser]
GO

CREATE NONCLUSTERED INDEX [IX_ClubApplicationUser_LastModifiedBy] ON [dbo].[ClubApplicationUser]
(
    [LastModifiedBy] ASC
)
GO

This will change into NONCLUSTERED, NON-UNIQUE as well as NON-FILTERED.
The reason we change as the "Code First" approach in .NET CORE 2 generated automatically this type of index.