text:
Q: PHP MySQL check user online last 30min and then select their thumbnail photo from another table I have two tables 'profiles' and 'photos'. I have a code that automatically updates DATETIME into 'Profiles > 'online' as a user navigates around the website. Then when the user goes to see everyone who is online I query the database, here is what I'm trying to achieve:
*QUERY1 - Select all users from Profiles where 'online' is less than 30minutes old.
*QUERY2 Select all users 'thumb' where 'user_id' matches QUERY1 and where 'profile'=1
The result I want is to return all users who have been active for the last 30 minutes and return the url to their thumbnail photo that is in a second table.
Profiles:
| user_id |  online  | user_ip |
+---------+----------+---------+
|   INT   | DATETIME | INT(10) |
+---------+----------+---------+

Photos:
|   id    | user_id |     image    |    thumb     |      profile    |
+---------+---------+--------------+--------------+-----------------+
|   INT   |   INT   | VARCHAR(200) | VARCHAR(200) |  ENUM('0', '1') |
+---------+---------+--------------+--------------+-----------------+

CURRENT CODE:
$date = new DateTime();
$date = date("Y-m-d H:i:s");
$time = strtotime($date);
$time = $time - (30 * 00);
$date = date("Y-m-d H:i:s", $time);

if ($SQL = $DBcon->query("
SELECT  A.user_id as a_user_id, B.thumb as b_thumb
FROM profiles A
INNER JOIN photos B ON B.user_id = A.user_id AND B.profile='1'
WHERE A.online >= '$date'")) {

while ($online = mysqli_fetch_array($SQL)) {
        echo "";
}
$SQL->free();

}
I have been trying now for two days and have hit a brick wall, any help is greatly appreciated. Many thanks in advance.


text:
Q: Best way to get combination of array of elements in Ramda? What is the best way to implement a function that takes three arguments

*

*smallest length of combinations

*highest length of combinations

*array of values

and returns all combinations of length l (arg1 <= l <= arg2). E.g.
getComb (2, 2, [1, 2, 3]) === [[1,2], [2,3], [3,1]]
getComb (0, 3, [1, 2, 3]) === [[],[1],[2],[3],[1,2],[2,3],[3,1],[1,2,3]]

(=== is defined here as deep equals without respect to order (almost set equality for both depths of the array) Also duplicate values should be ignored (e.g. getComb(a, b, [x,x,y]) === getComb(a, b, [x,y]) for all a,
b, x, y)
Then a fn to get all combinations can be implemented:
getAllComb = arr => getComb (0, arr.length, arr)

Thanks!

A: Here's another recursive solution, structured slightly differently from the answer by Nina Scholz.  It has a function to choose exactly n elements from the list, and then uses that in the main function, which calls it for each value from min to max:

const choose = (n, xs) =>
  n < 1 || n > xs .length
    ? []
    : n == 1
      ? [...xs .map (x => [x])]
      : [
          ...choose (n - 1, xs .slice (1)) .map (ys => [xs [0], ...ys]),
          ...choose (n , xs .slice (1))
        ]

const getCombs = (min, max, xs) =>
  xs .length == 0 || min > max
    ? []
    : [...choose (min, xs), ...getCombs (min + 1, max, xs)]

console .log (
  getCombs (0, 3, [1, 2, 3]),
  getCombs (2, 2, [1, 2, 3])
)

Here getCombs is the main function, and should be fairly clear, just concatenating the result of choose (min, xs) with the result of the recursive call to getCombs (min + 1, max, xs).  choose is a nicely reusable function which operates on a double recursion, the first one selecting all those combinations which use the initial element and the second all those that don't.
This doesn't quite match Nina's solution, as it ignores the empty list when min is zero.  If you want one that includes the empty list, you could change choose to the (slightly uglier, IMHO) version:
const choose = (n, xs) =>
  n < 1 || n > xs .length
    ? [[]]
    : [
        ...choose (n - 1, xs .slice (1)) .map (ys => [xs [0], ...ys]),
        ...(n + 1 > xs .length ? [] : choose (n , xs .slice (1)))
      ]

A: one way to implement getComb is :
[1,2,3].reduce( (acc, v, i, original) =>
    acc.concat(original.slice(i+1).map( w => [w, v] )),
[]);

A: You could take a recursive approach.

function getComb(min, max, array) {
    function iter(left, right = [], push = true) {
        if (push && min <= right.length && right.length <= max) result.push(right);
        if (!left.length) return;
        iter(left.slice(1), [...right, left[0]]);
        iter(left.slice(1), right, false);
    }

    var result = [];
    iter(array);
    return result;
}

console.log(getComb(2, 2, [1, 2, 3]));
console.log(getComb(0, 3, [1, 2, 3]));
.as-console-wrapper { max-height: 100% !important; top: 0; }

A: Ok I have a partial solution (for a = 1, b = arr.length):
const list = R.unapply (R.identity)
const xproduct = arr => R.apply (R.liftN (arr.length) (list)) (arr)
const getPerm = arr => xproduct (R.repeat (arr) (arr.length))
const getComb = arr => R.uniq (R.map (R.uniq) (getPerm (arr)))

getComb([1,2,3]) === [[1],[2],[3],[1,2],[2,3],[3,1],[1,2,3]]

There's got to be something better ;)

A: Here's a solution (atleast to getAllComb) that I'm kinda proud of :) There's a lot of stuff, but most of it is boilerplate
Inspired by bitstrings
// Generic helper functions
const appendIfNotFalse = fn => (acc, val) => R.ifElse (R.equals (false)) (R.always (acc)) (R.flip (R.append) (acc)) (fn (acc, val))

const mapAndFilter = fn => arr => R.reduce (appendIfNotFalse (fn)) ([]) (arr)

// My helper fn
const has1InBitstring = n => idx => (n & 2 ** idx) > 0

// Soltuion
const indices = arr => key => mapAndFilter ((_, j) => has1InBitstring (key) (j) ? j : false) (R.range (0) (arr.length))

const getAllComb = arr => R.times (i => R.props (indices (arr) (i)) (arr)) (2 ** arr.length)

// Example
getAllComb ([1,2,3]) === [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]

redpajama_set_name: RedPajamaStackExchange


text:
Q: Why is part of the text being cut off by the background of the sticky header? I'm currently trying to create a sticky rotated header for the html table. Currently part of the text is being cut off by the background of the sticky header, and I've tried playing around with the css and change the z-index of other elements, but nothing seems to be helping. I'm not sure if I'm implementing this in an incorrect fashion, or if there was a better way to do. Here's my html code -

.rotated-header{
  width:30px;
  height:80px;
  position:relative;
  transform:
      translate(30px, 50px)
      rotate(315deg);
  white-space:nowrap;
}

.header {
  vertical-align: bottom;
}

.tableFixHead {
  overflow: auto;
  height: 150px;
}

.tableFixHead thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background:white;
}

      Asset

          Rotated row 1

          Rotated row 2

      some
      some
      some

      some
      some
      some

      some
      some
      some

      some
      some
      some

      some
      some
      some

      some
      some
      some

A: One solution is to remove width and add top. or simply just make .tableFixHead thead th background transparent like so

.rotated-header{
  height:80px;
  width: 30px;
  position:relative;
  transform:
      translate(30px, 50px)
      rotate(315deg);
  white-space:nowrap;
}

.header {
  vertical-align: bottom;
}

.tableFixHead {
  overflow: auto;
  height: 150px;
}

.tableFixHead thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background:transparent;
}

      Asset

          Rotated row 1

          Rotated row 2

      some
      some
      some

      some
      some
      some

      some
      some
      some

      some
      some
      some

      some
      some
      some

      some
      some
      some

A: You can make just the table row sticky instead of making each of the heading cells sticky as Konrad Linkowski said in a comment.
.tableFixHead thead tr {
    position: sticky;
}

.rotated-header {
  width: 30px;
  height: 80px;
  position: relative;
  transform: translate(30px, 50px) rotate(315deg);
  white-space: nowrap;
}

.header {
  vertical-align: bottom;
}

.tableFixHead {
  overflow: auto;
  height: 150px;
}

.tableFixHead thead tr {
  position: sticky;
  top: 0;
  z-index: 1;
  background: white;
}

        Asset

            Rotated row 1

            Rotated row 2

        some
        some
        some

        some
        some
        some

        some
        some
        some

        some
        some
        some

        some
        some
        some

        some
        some
        some


text:
Q: How to embed a Media Player How to embed a Jukebox or a media player in C# .NET?
Or rather create a playlist which can play WAV files.

A: You can embed microsoft media player COM component and control it from code.
How to interact with Windows Media Player in C#

A: Soundplayer to just play sound, windows media player for audio/video playback on a form
Soundplayer
Windows media player

A: If you are using .NET Framework 3.5 and WPF, you can try System.Windows.Media.MediaPlayer
http://msdn.microsoft.com/en-us/library/system.windows.media.mediaplayer.aspx


text:
Q: Configure Cakephp 2.6.0 with Redis Engine I am trying to configure cakephp ver 2.6.0 to use redis engine by default. but somehow i am not able to make it work. any help will be highly appreciated.
Things Which i have tried so far..
Configured app/config folder 2 files , core.php and bootstrap.php. , according to the guidelines provided here in this blog configure cake with redis and this blog too Another cake-redis config setup
but i keep on getting errors like.
Fatal error: Uncaught exception 'CacheException' with message 'Cache engine session is not properly configured.' in C:\wamp\www\project\cakephp\cakephp_2.6.0\lib\Cake\Cache\Cache.php on line 181
CacheException: Cache engine session is not properly configured. in C:\wamp\www\project\cakephp\cakephp_2.6.0\lib\Cake\Cache\Cache.php on line 181
Any help will be highly appreciated.

A: I was having the same exact issue today while trying to setup CakePHP to use Redis as the cache engine.
Coincidentally, I also read the same setup instructions from the two blogs you linked to.
The reason was that I had copied pasted the Configure::write(...) code block from the Another cake-redis config setup blog post as it is and pasted it into the file without first commenting out the Configure::write(...) code block that was already in the core.php file.
I'm assuming that you have already successfully setup Redis on Windows and have installed the PHPRedis extension without any issues.
I am using the instructions from Another cake-redis config setup here.
In your app/Config/core.php file, comment out the following block: (this was starting at line 218 in my core.php)
    Configure::write('Session', array(
    'defaults' => 'php'
));

Instead, you can put this in: (You can change the values to suit your particular needs)
Configure::write('Session', array(
'defaults' => 'cache',
'timeout' => 100,
'start' => true,
'checkAgent' => false,
'handler' => array(
    'config' => 'session'
    )
));

After this, change the value of $engine to 'Redis', so it becomes:
$engine = 'Redis';

And then, put this code in, I put this in at the very end of the file: (Again, your values can be different depending on what your setup is)
    Cache::config ('session', array (
    'Engine' => $engine,
    'Prefix' => $prefix . 'cake_session_',
    'Duration' => $duration
));

And that's it. You're done! No need to change anything else.
To make sure that Redis is working properly with CakePHP, I ran the RedisEngine Test Suite that comes with CakePHP. You need to have PHPUnit installed for this to work.
It can be accessed via http://your-cakephp-project/test.php
Click on 'Tests' under Core and then click on 'Cache/Engine/RedisEngine'
If everything is working successfully, you should see all the tests pass.
Alternatively, you can use redis-cli at the command prompt to confirm that Redis is storing keys properly.
Once you have logged in by typing redis-cli, type KEYS *
This should give you a list of keys related to your CakePHP setup.
An example would be the "myapp_cake_core_object_map" key.
Hope this helps.


text:
Q: PerformanceResourceTiming.responseStart and PerformanceResourceTiming.requestStart both are 0 for a status ok http request I want to measure TTFB (Time to First Byte) for an HTTP request. I've hosted a 0KB pdf file on an amazon S3 server, and I'm using the fetch api to get it. Here's my code:
let url = "https://s3-us-west-2.amazonaws.com/speedtest.waveform.com/ping.pdf";
await fetch(url).then(res => res.text());
let perf  = performance.getEntriesByName(url).pop();
console.log("ttfb", perf.responseStart - perf.requestStart);

In the chrome developers network tab, I can see the request and all of its timing info:

But I can't access this info in the PerformanceResourceTiming document. In fact, many of the attributes including requestStart and responseStart are unset. Printing the perf record to console shows:

This is weird cuz doing the same thing using this url works just fine: "https://speed.cloudflare.com/__down?bytes=0"

A: This was because timing-allow-origin header was not set by the s3 server. Cloudflare did set that option which is why I was able to read ttfb values.


text:
Q: Payee account is invalid. #PAYEE_ACCOUNT_INVALID I am trying to implement PayPal Credit card functionality on Laravel for Rest Api. I am receiving the "PAYEE_ACCOUNT_INVALID" error. Any idea what am I doing wrong? Any help would be really appreciated.
I've tried with different test card numbers provided by PayPal via card generator mock.
Thanks.
This is my code snippet.
public function payment()
    {
        $gateway = Omnipay::create('PayPal_Rest');

        // Initialise the gateway
        $gateway->initialize(array(
            'clientId' => env('PAYPAL_SANDBOX_CLIENT_ID'),
            'secret' => env('PAYPAL_SANDBOX_CLIENT_SECRET'),
            'testMode' => true,
        ));

        #### Direct Credit Card Payment

        // Create a credit card object
        // DO NOT USE THESE CARD VALUES -- substitute your own
        // see the documentation in the class header.
        $card = new CreditCard([
            'firstName' => 'Example',
            'lastName' => 'User',
            'number' => '4111111111111111',
            'expiryMonth' => '01',
            'expiryYear' => '2027',
            'cvv' => '123',
        ]);

        // Do a purchase transaction on the gateway
        try {
            $transaction = $gateway->purchase([
                'amount' => '1.00',
                'currency' => 'AUD',
                'description' => 'This is a test purchase transaction.',
                'card' => $card,
            ]);

            $response = $transaction->send();
            $data = $response->getData();
            echo "Gateway purchase response data == " . print_r($data, true) . "\n";

            if ($response->isSuccessful()) {
                echo "Purchase transaction was successful!\n";
            }
        } catch (Exception $e) {
            echo "Exception caught while attempting authorize.\n";
            echo "Exception type == " . get_class($e) . "\n";
            echo "Message == " . $e->getMessage() . "\n";
        }
    }

A: Payee account invalid means the receiving account cannot process the transaction. Most likely this is a deprecated integration method, although it is hard to say without seeing the actual API request and response.
The current way to process credit cards is with the PayPal Checkout SDK, which has a black debit or credit card button that expands a form on your site. Optionally there is an Advanced integration that can be added on for presenting the card fields in a more customized way; it's more work to implement.


text:
Q: How to call a getter from a subclass which hasn't an abstract declaration in the superclass I have a superclass that I instantiate as ArrayList. A subclass of the superclass is saved in the ArrayList. Now I want to get the information out of the ArrayList, but the getter for the attribute is only available in the subclass. I can get the information (which are saved in the ArrayList too) from other classes that have an abstract declaration in the abstract superclass. However, I don't like to implement "dummy" methods in all classes which extend the superclass.
Code truncated:
public class Question{

        QuestionPool() {
         questionPool = new ArrayList<Question>();
         ClozeQuestions q15 = new ClozeQuestions("Erster Text", "Zweiter Text");
         questionPool.add(q15);
        }
         public int startQuiz{
         System.out.printf("Q: %s", questionPool.get(i).?????
        }
}

public abstract class Question {

    String question;
    public String getQuestion() {
    return question;
    }
}

public class ClozeQuestions extends Question {

    ClozeQuestions(String questionPart1, String questionPart2){
        this.questionPart1 = questionPart1;
        this.questionPart2 = questionPart2;
    }

    public String getQuestionPart1() {
        return questionPart1;
    }

    public String getQuestionPart2() {
        return questionPart2;
    }
}

To circumvent the problem I implemented a "helper method" in the Question class:
        ClozeQuestions question2ClozeQuestion = new ClozeQuestions();
        return question2ClozeQuestion.getQuestionPart1();
    }

Which I call from the QuestionPool class:
System.out.printf("Q: %s", questionPool.get(i).getQuestionPart1());

A: Since the objects in the list are stored as the type of the superclass, you will have to cast it to the subclass before you can access the subclass methods. This is what type casting looks like:
(Subclass)objectOfSuperclassType

And to be safe, you should type check before casting which can be done with 'instanceof':
if (objectOfSuperclassType instanceof Subclass) {
    Subclass objectOfSubclassType = (Subclass)objectOfSuperClass
}

And finally, an example of how to implement this when dealing with a list:
List<Superclass> myList = new ArrayList<>();
myList.add(new Subclass());

if (myList.get(0) instanceof Subclass) {
        System.out.println( ((Subclass) myList.get(0)).getSomeString() );
}

Although this may answer your question, the code you provided does not require the List to be initialized with the superclass at all. If you were to have two different subclasses and stored both of them in the same list, only then would it make sense to do this.


text:
Q: Javascript:: Loop until readyState is complete I was wondering why this simple code loops forever ?
var iBody=document.getElementsByTagName('body')[0];

d=document.createElement('iframe');
d.src='http://m.puaction.com';
d.id="myiFrame";
iBody.appendChild(d);

while(document.getElementById('myiFrame').readyState!=='complete')
{
    //do nothing;
}

alert('iFrame fully loaded');

Basically I want to make sure that it's completely loaded and then check if it's completely visible (another while loop?)

A: I found the following link via Google: http://wpapi.com/check-iframes-loaded-completely-browser/
Don't know if it solves the 'Page Not Found' issue.
<script type="javascript">
var iframe = document.createElement("iframe");
iframe.src = "http://www.your_iframe.com/";
if (navigator.userAgent.indexOf("MSIE") > -1 && !window.opera) {
  iframe.onreadystatechange = function(){
    if (iframe.readyState == "complete"){
      alert("Iframe is now loaded.");
    }
  };
} else {
  iframe.onload = function(){
    alert("Iframe is now loaded.");
  };
}
</script>

I haven't tried it myself, so I don't know if it works. Good luck!
And in your case you need are not checking onreadystatechange,
Better way to implement that is
document.getElementById('myIframe').onreadystatechange = MyIframeReadyStateChanged;

function MyIframeReadyStateChanged()
{
    if(document.getElementById('myIframe').readyState == 'complete')
    {
        alert("Iframe is now loaded.");
    }
}

And the tiny short and sweet jQuery code is
$('#iframe').on('load', iframeLoaded);

For Sync Behaviour
function restOfTheCode(){
// Having your whole rest of the code
}

Now just do restOfTheCode() instead of alert("IFrame is loaded").

A: Use addEventListener function
iframe.addEventListener("readystatechange", () => {
    if (iframe.readyState == "complete") {
        alert("Iframe is now loaded.");
    }
});


text:
Q: Generating Oauth authorization token using base64 encoding I am trying to follow the guide to generate Oauth authentication tokens for YAHOO DSP API.

Base64 encoding is a way of encoding binary data into text so that it can be easily transmitted across a network without error.
In this step, you will take the client ID and client secret that the YDN console generated for you and encode them using the base64 protocol. You can use an online encoding service like base64encode.org.
No matter which service you use, ensure that no spaces are appended to the CLIENT_ID and CLIENT_SECRET keys and separate the CLIENT_ID and CLIENT_SECRET with a colon, i.e. CLIENT_ID:CLIENT_SECRET.
The generated value will now be referenced as ENCODED(CLIENT_ID:CLIENT_SECRET) in this guide.

An example is given:

CLIENT_ID = dj0yJmk9N2pIazlsZk1iTzIxJmQ9WVdrOWVEUmpVMFpWTXpRbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD00NA–
CLIENT_SECRET= a7e13ea3740b933496d88755ff341bfb824805a6
AUTHORIZATION = ZGoweUptazlOMnBJYXpsc1prMWlUekl4Sm1ROVdWZHJPV1ZFVW1wVk1GcFdUWHBSYldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQwME5BLS06YTdlMTNlYTM3NDBiOTMzNDk2ZDg4NzU1ZmYzNDFiZmI4MjQ4MDVhNg==

Using the recommended website I get the wrong AUTHORIZATION.
I have tried both encoding the whole thing at once ie. encode(CLIENT_ID:CLIENT_SECRET), and each element individually encode(CLIENT_ID):encode(CLIENT_SECRET).

Attempt encoding whole thing:
  ZGoweUptazlOMnBJYXpsc1prMWlUekl4Sm1ROVdWZHJPV1ZFVW1wVk1GcFdUWHBSYldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQwME5B4oCTOiBhN2UxM2VhMzc0MGI5MzM0OTZkODg3NTVmZjM0MWJmYjgyNDgwNWE2
Attempt encoding each element:
  ZGoweUptazlOMnBJYXpsc1prMWlUekl4Sm1ROVdWZHJPV1ZFVW1wVk1GcFdUWHBSYldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQwME5B4oCT:YTdlMTNlYTM3NDBiOTMzNDk2ZDg4NzU1ZmYzNDFiZmI4MjQ4MDVhNg==
Expected result:
  ZGoweUptazlOMnBJYXpsc1prMWlUekl4Sm1ROVdWZHJPV1ZFVW1wVk1GcFdUWHBSYldOSGJ6bE5RUzB0Sm5NOVkyOXVjM1Z0WlhKelpXTnlaWFFtZUQwME5BLS06YTdlMTNlYTM3NDBiOTMzNDk2ZDg4NzU1ZmYzNDFiZmI4MjQ4MDVhNg==

The difference between 'each element' and the expected result is only a few characters corresponding to the end of client_ID and the colon.
B4oCT: should be BLS06.
Links to full documentation:
https://developer.yahoo.com/dsp/api/docs/authentication/tokens.html
https://developer.yahoo.com/dsp/api/docs/traffic/info/sandbox.html
Update:
The final character of Client_ID is '–' . This is some sort of non-standard character that is interpreted as two dashes i.e.'--' in utf-8 and windows 1258.

A: One different, TO NOTE is, that when you decrypt the expected output you will get your client id as
dj0yJmk9N2pIazlsZk1iTzIxJmQ9WVdrOWVEUmpVMFpWTXpRbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD00NA--

instead of
dj0yJmk9N2pIazlsZk1iTzIxJmQ9WVdrOWVEUmpVMFpWTXpRbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD00NA–

NOTE, there are two "-" at the end.
OAuth client auth token is always generated using Base64 encoding with following format
Base64_Encoding(CLIENT_ID:CLIENT_SECRET)

Most of the usage perform this Base64 encoding with encoding type as "UTF-8".
It looks like, Yahoo requires this token with different encoding. On "https://www.base64encode.org/" if you try to encode your "CLIENT_ID:CLIENT_SECRET" with "Windows-1254" as destination charset, you will receive the expected result. So, it looks like both encoding and decoding here is done keeping "Windows-1254" charset in place.


text:
Q: How does size_t and the __w64, time_t and __int64 work? I am not a veteran in C or C++. I don't know the howtime_t is defined and designed.
Several posts like:

*

*What is ultimately a time_t typedef to?

*What is size_t in C?

*Difference between size_t and std::size_t
But these posts only state what is time_t or size_t. It didn't state clearly how and where is time_t or size_t defined and declared.
I am using WIN8 VS2012 Express C++. I searched the library and found that size_t is defined in crtdefs.h instead of cstddef.

*

*Why need types like size_t, time_t? We can let sizeof just return unsigned int.

*Why C++ library does not define size_t?

*Can I say size_t is NOT a C/C++ built-in type?

*I never need to include the corresponding header file in my program to use size_t or time_t(maybe they are defined in std namespace).

I searched again in the library, and found size_t is defined as typedef _W64 unsigned int   size_t, and _W64 is defined as __w64. Up here, I cannot search more on where is __w64 is defined or declared.

*

*What is __w64 type? It is not stated in the C++11/C99 standard.

Similarly when I searched the time_t, I found __int6. But does not know where __int64 comes from.

A: The __w64 is a Microsoft specific extension that "enables warnings when compiling with /Wp64" - it is used to identify code that is "dangerous" if you are trying to compile it for 64-bit - for example assigning a 64-bit value to a 32-bit one. e.g.:
size_t s;
...
unsigned int i;

...
i = s;    // 32 bit can't take all 64 bit values - possible problem.

The definition of size_t and time_t are typedef ... size_t; and typedef ... time_t; - they are not "fixed" in the compiler. The standard just says they have to be there (and be suitable for the system the compiler targets). I think you'll find that cstddef includes crtdefs.h in some place or another.
The __int64 is a Microsoft compiler type. This is defined by the compiler itself. It can then be used to define other "sized types", such as time_t or size_t (with suitable unsigned as needed). Other compilers may not have this type, but there will be SOME way to define a 8, 16, 32 and 64-bit integer. The actual origin of __int64 is probably before the origin of long long, which for a long long time (pun intended) wasn't supported by Microsoft. I believe it is now.

A: C/C++ has 20+ years legacy and it is implemented now maybe on 100+ different architectures.
In fact, some of them are really different from x86. On some of them integer registers are 16 bit, while the address space and address registers are 32 bit. I have experience writing in these environments.
Yes, in this case int/unsigned int is 16 bits, and this makes sense, while pointer and size_t are 32 bits. On x86 this is not so, but well...
This is the answer.

size_t is NOT a C/C++ built-in type?

The true answer is yes and no. Theoretically, you can write your own header files, like crtdefs.h. And write there whatever you want. The compiler most likely will work. But this is a lot of work. Nobody is doing that. Once system header files are part of compiler, then well,  size_t is built in....


text:
Q: How to get the Interface ID (IID, i.e. the GUID) of an interface when importing a WinRT winmd? Short version
How to you get the interface identifier (IID) for an interface from a *.winmd file when using IMetadataImport?
e.g. Windows.Globalization.ICalendar: {CA30221D-86D9-40FB-A26B-D44EB7CF08EA}
Longer Version
A good example is Windows.Globalization.ICalendar interface. Its IID is CA30221D-86D9-40FB-A26B-D44EB7CF08EA.
It's in the IDL
You can find it in the source Windows.Globalization.idl file:
[exclusiveto(Windows.Globalization.Calendar)]
[uuid(CA30221D-86D9-40FB-A26B-D44EB7CF08EA)]
[version(0x06020000)]
interface ICalendar : IInspectable
{
   //...snip...
}

Reminder: You're not supposed to parse these files. It gets compiled into a *.winmd assembly, and that database is the ground-truth.
It's in the header
You can find it in the windows.globalization.h file, which was generated from the *.winmd using an import tool:
namespace ABI {
    namespace Windows {
        namespace Globalization {

            MIDL_INTERFACE("CA30221D-86D9-40FB-A26B-D44EB7CF08EA")
            ICalendar : public IInspectable
            {
               //...snip...
            }

It's even in the winmd
You can even find the InterfaceID in the resulting compiled *.winmd assembly database:

But how do I get it when using the documented IMetadataImporter API?
Code
The abridged version of how to get up and running reading winmd metadata files:
// Create your metadata dispenser:
IMetadataDispsener dispener;
MetaDataGetDispenser(CLSID_CorMetaDataDispenser, IMetaDataDispenser, out dispenser);

//Open the winmd file we want to dump
String filename = "C:\Windows\System32\WinMetadata\Windows.Globalization.winmd";

IMetaDataImport reader; //IMetadataImport2 supports generics
dispenser.OpenScope(filename, ofRead, IMetaDataImport, out reader); //"Import" is used to read metadata. "Emit" is used to write metadata.

Bonus Reading

*

*MSDN Blogs: Metadata Unmanaged API (a preliminary PDF version of an old Word document that, as far as i can tell, is the only Microsoft documentation for the Metadata API) (archive)

A: Short Version
The custom attribute blob is the C# serialized format of a Guid class:

3.2.2 DefineCustomAttribute
The format of pBlob for defining a custom attribute is defined in later in this spec. (broadly speaking, the blob records the argument values to the class constructor, together with zero or more values for named fields/properites – in other words, the information needed to instantiate the object specified at the time the metadata was emitted). If the constructor requires no arguments, then there is no need to provide a blob argument.
4.3.6 GetCustomAttributeProps
A custom attribute is stored as a blob whose format is understood by the metadata engine, and by Reflection; essentially a list of argument values to a constructor method which will create an instance of the custom attribute.

In order to get the GuidAttriute guid value, you have to emulate C#'s deserializing a Guid object from a stream.
Long Version
Starting with your IMetadataImport you call IMetaDataImport.GetCustomAttributeByName.
The first tricky part is figuring out the name of the attribute I'm after. I know it's Guid when viewed in IDL or C#:
[Guid("CA30221D-86D9-40FB-A26B-D44EB7CF08EA")]
interface ICalendar
{
    //...
}

And that underneath it would actually be called "GuidAttribute". But neither of those actually work:

*

*"Guid": Fails with S_FALSE

*"GuidAttribute": Fails with S_FALSE
You might try the full name of the attribute class:

*

*"System.Runtime.InteropServices.GuidAttribute"
But that also fails because that's the name of the GuidAttribute class in the .NET framework. In the WinRT library you have to use "Windows.Foundation.Metadata.GuidAttribute":

*

*"Guid": Fails with S_FALSE

*"GuidAttribute": Fails with S_FALSE

*"System.Runtime.InteropServices.GuidAttribute": Fails with S_FALSE (CLR only)

*"Windows.Foundation.Metadata.GuidAttribute": Works

Now that we figured out the name of the attribute to find, we can query for it:
mdToken calendarTokenID = 0x02000022; //Windows.Globalization.ICalendar
String  attributeName   = "Windows.Foundation.Metadata.GuidAttribute";

Pointer blob;
UInt32 blobLen;
reader.GetCustomAttributeByName(calendarTokenID, attributeName, out blob, out blobLen);

The next tricky part is is decoding the blob.
Decoding the blob
Custom attributes each have a different serialization formats. The blob is essentially passed to the Attribute's constructor. The serialization format is the same as the C# serialization format.
For GuidAttribute attributes, the binary serialization format is 20-bytes:
01 00                                            Prolog (2-bytes)       0x0001 ==> version 1
1D 22 30 CA D9 86 FB 40 A2 6B D4 4E B7 CF 08 EA  Guid (16-bytes)        "CA30221D-86D9-40FB-A26B-D44EB7CF08EA"
00 00                                            Trailing null (2-bytes)

The easiest way for me to extract the Guid is to declare a matching structure, cast the returned pointer to a type of that structure, and access the Guid member:
struct SerializedGuidAttribute
{
   UInt16 prolog; //2-bytes. 0x0001
   Guid   guid;   //16-byte guid
   UInt16 footer; //2-byte footer
}
typedef SerializedGuidAttribute* PSerializedGuidAttribute;

Guid guidAttriute = PSerializedGuidAttribute(blob).guid;

And you have it
Guid GetGuidAttribute(IMetadataReader reader, mdToken intf)
{
   Pointer blob;
   UInt32 blobLen;
   reader.GetCustomAttributeByName(intf, "Windows.Foundation.Metadata.GuidAttribute",
         out blob, out blobLen);

   //if (blobLen != 20) { throw new Exception("Something") };

   return PSerializedGuidAttribute(blob).guid;
}

Bonus

*

*Microsoft Metadata API documentation

*

*9/8/2000: .docx

*8/2/2001: .pdf


text:
Q: Why is the map that takes $1$ to $(-1,0)$ not a ring homeomorphism from $\mathbb{Z}$ to $\mathbb{Z} \times \mathbb{Z}$ This is a question bulding off of an answer that I saw on here (Describe all ring homomorphisms).
One of the questions that is asked is: name all of the homomorphisms $\varphi :\mathbb{Z} \rightarrow \mathbb{Z} \times \mathbb{Z}$
In the answers someone said that $\varphi (n)=(0,0), \varphi (n)=(n,0),$ $\varphi (n)=(0,n), \varphi (n) =(n,n)$ are the only ring homomorphism. Could someone help me understand why a map like $\varphi (n)= (-n,0)$ is not also a ring homomorphism?
I am very new to ring-theory, but it feels like mapping from a generator of a ring to a generator of a similar ring should be a homomorphism.


text:
Q: How to format time durations for media clips {audio, video, music, science etc} Mathematica has powerful date, time and timeseries functions and options.
Yet they all seem to be tightly tied to Time in global clock-calendar-astronomic perception.
I need to do basic time-duration arithmetic and plotting for media clips..
For example: I have sequence of video clips:
v01 = 25m14s
v02 = 2h23m00s
v03 = 1h

v01and02 = v01 + v02
videostotalTime = v01 + v02 +v03

etc
help: I cannot find simple syntax for this in Mathematica
How to format and add/subtract/multiply my data in SIMPLEST most legible manner to give me totals, sub-totals, duration offsets, lists etc?
I tried
v01 = TimeObject[{0,25,14}]
v02 = TimeObject[{2,23,00}]
v01 + v02 is what I want <<< but does not give me duration sum.

I have been looking in docs and googling, but am missing basic keywords/concept
thank you


text:
Q: unable to insert images and use wysiwyg properly i am working on magento website which is based on magento 1.9.
all of sudden am facing a wierd issue that wysiwyg editor is not working properly as when am trying to insert any image same is not getting inserted and even unable to use editor for other purposes too
request if anyone can please help in this.
url : https://i-ranu.com


text:
Q: Filter items in a ListView in real time My program generates ListView full of information. I type into a text box a name that might match one of the item names in the ListView. I want this typed name to weed out the names from the ListView that don't match.
For example, if I type in "abc", names like "uvw" and "xyz" wouldn't show up anymore, but "abc" and "abcde" would still show up in the list view.
The end goal is to be able to check the checkboxes next to the names I want, and search for more names, eventually selecting several, without resetting the checkboxes.
Right now I click a button and the ListView is populated:
private void button1_Click(object sender, EventArgs e)
{
    List<string> myList = getList();
    foreach(string s in myList)
    {
        listView1.Items.Add(s);
    }
}

getList() just returns a List<string> of all the names I want.
I can't figure out how to make the ListView update in real time when I type in my text box. I'm able to update it with a button click via repopulating the ListView based on looping through the List, and checking each name, but that's not what I want. It also doesn't retain checked check boxes, as it's a newly generated list each time.
I read about a "text change listener", but I'm not sure that's what I should be using here...

A: With filtering you need some way of remembering which ListViewItems are selected, so instead of inserting all your ListViewItems into your listview you want to instantiate them in a master list. Then attach a TextChanged event handler to your text box and when the text changes you display the items.
List<ListViewItem> masterlist;

public Form1()
{
    InitializeComponent();
    masterlist = new List<ListViewItem>();
}

private void button1_Click(object sender, EventArgs e)
{
    // Populate the masterlist
    masterlist.Clear();
    foreach(string s in getList())
    {
        masterlist.Items.Add(new ListViewItem(s));
    }

    // Display the items in the listview
    DisplayItems();
}

private void DisplayItems()
{
    listView1.Items.Clear();

    // This filters and adds your filtered items to listView1
    foreach(ListViewItem item in masterlist.Where(lvi => lvi.Text.ToLower().Contains(textBox1.Text.ToLower().Trim())))
    {
        listView1.Items.Add(item);
    }
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
    // Re-display the items when the filter changes
    DisplayItems();
}

As you're dealing directly with ListViewItems in your masterlist they will retain their checked state when swapped in and out of listView1.
I have assumed that your filter textbox is called textBox1.

A: If you want to go for a full C# solution (rather than using any Javascript), as much as it pains me, I would suggest using an UpdatePanel.
Put your ListBox inside they the <ContentTemplate> section of the <UpdatePanel> then add an <asp:AsyncPostBackTrigger> with the ControlID set to that of your textbox. Make sure that the UpdateMode property of the UpdatePanel is set to "Conditional".
On your TextBox you will also have to set the AutoPostBack property to true. On the TextBox itself you will have to create a TextChanged event handler, then in your code behind (.cs file) you will have the logic for your TextChanged handler which will filter the list then set the new value for your ListBox.
UpdatePanels are ok for simply scenarios, but you can very easily get yourself into trouble by mis-using them.


text:
Q: Selection and Remote Data Pagination on Material Table React I need help im using material-table on react for my data table. I want to use the selection and pagination at the same time, but the problem is if i select a certain row and change the page and return to previous page. it doesn't select that row. here is a sample snippet i created. Is it possible to override the selection props?
const Table = () => {
const [selectedRows, setSelectedRows] = useState([]);

function handleSelectChange(rows) {
setSelectedRows(rows)
}
return (
<MaterialTable
      title="Remote Data Preview"
      columns={[
        {
          title: 'Avatar',
          field: 'avatar',
          render: rowData => (
            <img
              style={{ height: 36, borderRadius: '50%' }}
              src={rowData.avatar}
            />
          ),
        },
        { title: 'Id', field: 'id' },
        { title: 'First Name', field: 'first_name' },
        { title: 'Last Name', field: 'last_name' },
      ]}
      options={{
        selection:true,
      }}
      onSelectionChange={(rows) => handleSelectChange(rows)}
      data={query =>
        new Promise((resolve, reject) => {
          let url = 'https://reqres.in/api/users?'
          url += 'per_page=' + query.pageSize
          url += '&page=' + (query.page + 1)
          fetch(url)
            .then(response => response.json())
            .then(result => {
              resolve({
                data: result.data,
                page: result.page - 1,
                totalCount: result.total,
              })
            })
        })
      }
    />
)
}

i already created an issue will put this a reference. https://github.com/mbrn/material-table/issues/1189

A: Since you already know the selected rows, you just have to modify your fetched data like this:
data: result.data.map(row => selectedRows.find(selected => selected.id === row.id) ? { ...row, tableData: { checked: true } } : row)

This will add the tableData.checked key to the fetched data and it will display it as selected.
Here is a codesandbox.

A: This solution only works if you do not select another row on a new page as the new rows from onSelectionChange will overwrite the existing selected rows from the previous pages. To be able to select rows across pages I changed the handleSelectionChange function to first check if the current selectedRows are included in the data displayed and for those that are not I spread that into the setState call.
function handleSelectionChange(rows) {
    const displayedIds = data.results.map(result => result.id)
    const selectedRowsNotDisplayed = selectedRows.filter(selectedRow => {
        return !displayedIds.includes(selectedRow.id)
    })

    setSelectedRows([...selectedRowsNotDisplayed, ...rows])
}


text:
Q: Iterate an enum in ion-select How to iterate an enum with ion-select using ngModel
export enum Escolaridade {
    ANALFABETO = "Analfabeto",
    DE_1_A_3ANOS = "de 1 a 3 anos",
    DE_4_A_7ANOS = "de 4 a 3 anos",
    MAIS_DE_8ANOS = "mais de 8 anos"
}

class Pessoa {
    ...
    public escolaridade:typeof Escolaridade =  Escolaridade;
}

export class CadastroPage {
    ...
    this.p = new Pessoa();
}

home.html
<ion-select interface="popover" [(ngModel)]="p.escolaridade">
<ion-select-option *ngFor="let escolaridade of p.escolaridade">
    {{escolaridade}}
</ion-select-option>
</ion-select>

I need list items in ion-select-option and submit item selected to "this.p"

A: To iterate values on an enum. You can write a function to extract values from the enum.
extractValuesFromEnum(enum)
{
  const retVal = [];
  const keys = Object.keys(enum);
  for(let i=0; i < keys.length; i++)
  {
    if(i %2 !== 0 )  // odd elements in the array will be the values.
      {
        retVal.push(keys[i])
      }
  }
  return retVal
}


text:
Q: How does one identify if Oracle Data Guard is enabled in Oracle database? How does one identify if the Oracle Data Guard feature is enabled in Oracle database?
If this can be determined by a query, what is the query for finding the same?

A: There is a built-in procedure for that.
set serveroutput on
declare
  feature_boolean number;
  aux_count number;
  feature_info clob;
begin
  dbms_feature_data_guard(feature_boolean, aux_count, feature_info);
  dbms_output.put_line(feature_boolean);
  dbms_output.put_line(feature_info);
end;
/

Sample output when Data Guard is not used:
0
Data Guard usage not detected

Sample output when Data Guard is used:
1
Number of standbys: 1, Redo Apply used: TRUE, SQL Apply used: FALSE, Snapshot
Standby used: FALSE, Broker used: TRUE, Protection mode: MAXIMUM PERFORMANCE,
Log transports used: LGWR ASYNC, Fast-Start Failover used: FALSE, Real-Time
Apply used: TRUE, Compression used: FALSE, Flashback used: FALSE

The source of the above procedure is not wrapped, so one can browse it and find how the database detects Data Guard usage.
-- check for Data Guard usage by counting valid standby destinations
execute immediate 'select count(*) from v$archive_dest ' ||
    'where status = ''VALID'' and target = ''STANDBY'''
    into num_standbys;

if (num_standbys > 0) then
    feature_boolean := 1;

Basically, if the result of this query is greater than 0, than the Data Guard is in use as per the procedure:
select count(*) from v$archive_dest where status = 'VALID' and target = 'STANDBY';

A: SELECT NAME,VERSION,CURRENTLY_USED,FEATURE_INFO
FROM DBA_FEATURE_USAGE_STATISTICS
WHERE NAME = 'Data Guard'


text:
Q: How to access RDDs that are supposed to be cached from the DAGScheduler? Does anyone know how can I extract the RDDs that are supposed to be cached from the DAGScheduler. Not the ones that are really cached but the ones that are intended to be cached before the execution of stages starts.

A: You can use SparkContext.getPersistentRDDs:
spark.sparkContext.getPersistentRDDs: Map[Int, RDD[_]]

Returns an immutable map of RDDs that have marked themselves as persistent via cache() call.

A: DAGScheduler
DAGScheduler does not participate in caching RDDs (and very little in task execution).
DAGScheduler is a "function" that accepts RDD lineages (hence the prefix DAG for DAG of RDD dependencies) and produces DAG of stages with tasks (as TaskSets) and only with the tasks for partitions that are missing (i.e. BlockManagers have no RDD blocks for them).
With that said, I'd immediately mark your question about accessing cached RDD from DAGScheduler as invalid.
getPersistentRDDs
You could use SparkContext.getPersistentRDDs (as @user6910411 pointed out), but it gives you RDDs that requested to be cached/persisted (but either have not yet or will never be).
cache and persist methods are lazy so it's only when you execute an action when the RDD blocks get stored in BlockManagers on executors (and hence accessible without reading the data again from the source).
Persisting RDD could also fail (e.g. low memory) yet the internal registry could still reference the RDDs as cached.

(still looking into use cases when cache/persist would fail)


text:
Q: Complex Model the Rails Way I'm implementing questionnaires on a site.  There are multiple questionnaires, each have sections, each section has questions. Users can fill out zero or many questionnaires.
model code below.  ERD image http://i.stack.imgur.com/6Y0r3.png
What would be the "Rails Way" for storing/displaying question results while maintaining section hierarchy in the view?  I don't mind writing code, but wasn't sure if I was missing something obvious.  I've started with methods in the Question model but it doesn't take advantage of Form Helpers and the like.
#Simplistic view code
%h1= @user_questionnaire.questionnaire.value
- for section in @user_questionnaire.questionnaire.sections
  %h4=section.value
  %br
  - for question in section.questions
    =question.value
    =question.result(@user_questionnaire.id)

Any thoughts are welcome.  Thanks!
Donald
Model Code
class Questionnaire < ActiveRecord::Base
  has_many :sections
  has_many :user_questionnaires
end

class Section < ActiveRecord::Base
  belongs_to :questionnaire
  has_many :questions
end

class Question < ActiveRecord::Base
  belongs_to :section
  has_many :user_questionnaire_results

  def result(uq_id)
    uqr = UserQuestionnaireResult.where(:question_id => self.id, :user_questionnaire_id => uq_id).first
    uqr.result
  end
end

class UserQuestionnaire < ActiveRecord::Base
  belongs_to :questionnaire
  has_many :user_questionnaire_results
  belongs_to :user
end

class UserQuestionnaireResult < ActiveRecord::Base
  belongs_to :user_questionnaire
  belongs_to :question
end

A: What's wrong with your result(uq_id) method is that it will query DB for every result, which is slow and consty resource-wise. What you could do is to use joins or includes methods to optimize your DB access. So in your model:
class UserQuestionnaire
    def self.includes_questions
      includes :questionnaire => {:sections => [:questions]}
    end

    def loaded_result question
      user_questionnaire_results.to_a.find { |r| r.question_id == question.id }
    end
end

Then in controller:
@user_questionnaire = UserQuestionnaire.includes_questions.find params[:id]

And in view instead of =question.result(@user_questionnaire.id) use:
= @user_questionnaire.loaded_result question

The idea is that you load from DB all sections, questions and result togather, not each separate instance. In the same manner you may try to play with joins function and see if it's better for you.
Check logs or console in dev env to see which queries are executed.


text:
Q: How to restore VT100 DEC Private modes at end of application? Windows Terminal recently added support for bracketed paste mode in the 1.7 release. Terminal-based applications can now detect if text received is part of the user typing or it has been pasted and should be processed in bulk.
It seems support for other Control Sequence Introducers is missing, so there is no way to retrieve the current state (via Request DEC private mode / DECRQM) or use the stack-based save and restore.
Thus my questions are:

*

*Is there any other way to restore the bracketed paste mode prior to exit of of my application?

*If not, what would be the desired way I leave the mode? Set or reset?

A: There's a lot amiss with Windows Terminal #10153, since the developers were as they say "shooting from the hip".  There's no study of the available documentation, testing, etc.
The bug report is not talking about xterm, since its DECRQM does actually return a value for bracketed-paste.  Here's a screenshot in vttest illustrating that:

XTSAVE and XTRESTORE are old features dating back to December 1986, preceding the VT420 PCTerm (announced in February 1992) by a little over 5 years.  Since DEC participated in developing xterm during the 1980s (see copyright notice), one might have assumed that its terminals division would have accommodated this.  But that's so long ago, that it's unlikely that someone can point out why that didn't happen.
Like the cursor save/restore, the private-mode save/restore feature does not use a stack.
Back to the question: the point of #10153 is that the Windows Terminal developers choose to not make it xterm-compatible by providing the control responses that would enable an application to determine what state it is in.  Perhaps at some point Windows Terminal will provide a solution.  However, DECRQM is a VT320 (and up) feature, while Windows Terminal identifies itself as a VT100 (but masquerades as xterm).
Further reading:

*

*XTerm Control Sequences (Miscellaneous)

*Unit test framework for terminal emulation #1746

* Add support for the DECSCNM Screen Mode #3773 (eventually resolved)

*RE: ms-terminal in terminfo.src (not resolved, see #8303)

A: Summarizing the discussion I had on the Windows Terminal bug tracker about the missing support for DECRQM or XTSAVE+XTRESTORE :

It is the implicit assumption that terminal-based application would
set any desired modes upon start and reset to the default at the
end of the application. Even though this is inefficient it is the way
around missing support for DECRQM and other ways to query VT-100
modes.


text:
Q: how setup facebook iframe into autoresize? I build aplication on my server and currently have it set to display the app within the Facebook iframe.
My application is in responsive layout. Becouse display on iframe/canvas on facebook aplication, responsive not working.
How we can make iframe/canvas of facebook app in autosize so my aplication display on app can work responsive?
Thanks


text:
Q: YAML helm chart how to escape & sign I have a helm chart in yaml like this:
env:
   - name: EmailHeader
     value: {{ .Values.npsweb.email.support.header | quote }}

and in my Values file, I have like this:
npsweb:
   email:
      support:
         header:

But it says that Anchor lt;html><img is never used. I tried putting double quote around it, but it still didn't get picked up.
What is the problem here and how can I fix this?

A: You need to explicitly quote the string.  There are a couple of ways to do this, so pick whichever makes sense:
header-with-single-quotes: '<.../>'
header-with-double-quotes: "<.../>"
header-as-block-scalar: |-
  <html>...</html>
header-as-block-scalar-with-whitespace: |-
  <html>
    <body>
      ...
    </body>
  </html>

All of these forms are the same, except that the last one will include embedded newlines and spaces.  (Since your value includes single quotes, the single-quoted form will be a little less convenient.)  You could also consider storing the HTML content in a file and reading it in with .Files.Get (though Helm doesn't include a template function for escaping HTML).
What's wrong with your existing values.yaml file?  YAML has the notion of an anchor; you can give a part of a document a label like this, and reference it from elsewhere in the document.  The '&' character at the beginning of the value marks an anchor, and the text up to the first space is the name of the anchor.
Not so much in Kubernetes, but in Docker Compose you'll somewhat routinely see this for reusable blocks of environment variables:
# (This is a Docker Compose file, not Kubernetes, as a YAML example)
version: '3.8'
x-environment: &environment # <-- anchor
  DB_HOST: db
services:
  db: { image: postgres }
  application:
    build: .
    environment: *environment # <-- reference to anchor
  worker:
    build: .
    command: ./worker
    environment: *environment # <-- same reference to anchor


text:
Q: terraform alicloud failed to create alicloud_cs_managed_kubernetes I'm using terraform to create Ali cloud managed kubernetes. the link I'm following is below:
https://www.terraform.io/docs/providers/alicloud/r/cs_managed_kubernetes.html
I'm using exact same code as terraform states. The Available zone I'm using is cn-shenzhen-a, however, when I run terraform apply, I'm always getting this error
alicloud_cs_managed_kubernetes.k8s: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_cs_managed_kubernetes.go:322: Resource alicloud_cs_managed_kubernetes CreateKubernetesCluster Failed!!! [SDK denverdino/aliyungo ERROR]:
Aliyun API Error: RequestId: C598AA1D-6993-46F6-A831-A9A6E8B8CEC1 Status Code: 400 Code: ZoneNotSupported Message: The current zone  does not support creating SLB, please try other zones

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.

I have double checked the SLB and found cn-shenzhen-a can create SLB.
the Ali cloud account I'm using is china account not international account.

A: you should create vpc & vswitch early, setting vswitch_ids in k8s config.
it resolve same problem in my environment.
data "alicloud_vswitches" "vswitch"{

}
resource "alicloud_cs_managed_kubernetes" "k8s" {
  ......
  vswitch_ids = [data.alicloud_vswitches.vswitch.vswitches[0].id]
}

A: Try it by specifying vswitch_ids instead of availability_zone:
resource "alicloud_cs_managed_kubernetes" "k8s" {
  name              = "${var.name}"
  # availability_zone = "cn-beijing-c"
  vswitch_ids = ["vsw-2ze........."]
  # availability_zone     = "${data.alicloud_zones.main.zones.2.id}"
  new_nat_gateway       = true
 ...

Refer the following link:
https://github.com/terraform-providers/terraform-provider-alicloud/issues/1097#issuecomment-555897474


text:
Q: Font files are blocked by CORS policy I want to build a server accelerated by a CDN provider, which serves static files for my other websites. I decide to use https://www.funfun.org.cn, then for example https://www.funfun.org.cn/libs/font-awesome.min.css and https://www.funfun.org.cn/libs/octicons.min.css should be able to be used by other websites.
However, when I test this server by my website in localhost, I see the following errors:

For example,

Access to Font at 'https://www.funfun.org.cn/libs/octicons.woff' from
  origin 'https://localhost:3000' has been blocked by CORS policy: No
  'Access-Control-Allow-Origin' header is present on the requested
  resource. Origin 'https://localhost:3000' is therefore not allowed
  access.

Other errors are similar and for https://www.funfun.org.cn/fonts/fontawesome-webfont.woff2?v=4.4.0 and https://www.funfun.org.cn/libs/octicons.ttf, etc.
In my website, those above files are not called directly, I only have the following two lines regarding fonts, which must have called the .ttf and .woff2, etc.
<link rel="stylesheet" href="https://www.funfun.org.cn/libs/font-awesome.min.css">
<link rel="stylesheet" href="https://www.funfun.org.cn/libs/octicons.min.css">

So, does anyone know what I can do to fix those errors?
PS: my nginx configuration file is as follows, and all the files are under /var/www/html/libs/ and /var/www/html/fonts/.
server {
    listen 443 ssl;

    ssl_certificate /etc/nginx/cert/1530490648293.pem;
    ssl_certificate_key /etc/nginx/cert/1530490648293.key;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_session_timeout 1d;
    ssl_stapling on;
    ssl_stapling_verify on;
    add_header Strict-Transport-Security max-age=15768000;

    root /var/www/html;

    server_name funfun.org.cn www.funfun.org.cn;

    location / {
        try_files $uri $uri/ =404;
    }
}

A: Try adding this into your configuration:
location ~* \.(eot|otf|ttf|woff|woff2)$ {
    add_header Access-Control-Allow-Origin *;
    expires max;
}

location / {
    try_files $uri $uri/ =404;
}

Also you may need to update the nginx  mine.types file with something like:
application/x-font-ttf           ttc ttf;
application/x-font-otf           otf;
application/font-woff            woff;
application/font-woff2           woff2;
application/vnd.ms-fontobject    eot;

A: check that you have enough permission to read the files. If not then run the following commands
chmod 777 -R fonts_Root_Folder


text:
Q: XamlParseException for some certain StaticResource on some certain computers We are developing a WPF application for .NET 4.
One day the client told me that the new release does not work (application just quits upon startup) on his Windows 7 machine and he found the exception log in the Windows Event Viewer:
    Application: myapp.exe Framework Version: v4.0.30319 Description:
The process was terminated due to an unhandled exception. Exception Info: System.Windows.Markup.XamlParseException
Stack: at System.Windows.Markup.XamlReader.RewrapException(System.Exception, System.Xaml.IXamlLineInfo, System.Uri)
at System.Windows.Markup.WpfXamlLoader.Load(System.Xaml.XamlReader, System.Xaml.IXamlObjectWriterFactory, Boolean, System.Object, System.Xaml.XamlObjectWriterSettings, System.Uri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(System.Xaml.XamlReader, Boolean, System.Object, System.Xaml.Permissions.XamlAccessLevel, System.Uri)
at System.Windows.Markup.XamlReader.LoadBaml(System.IO.Stream, System.Windows.Markup.ParserContext, System.Object, Boolean)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(System.IO.Stream, System.Windows.Markup.ParserContext)
at ... (I guess no point to continue...)

This problem is driving me crazy because nor me nor another developer cannot reproduce it on our machines, and we cannot reproduce it even on a clean Windows 7 install in VirtualBox.
When we tried to find the changes which broke the application for the client, we found the offending piece. Here is the difference:
This works fine:
<ComboBox x:Name="comboBoxZoom" Margin="130,10,0,0" HorizontalAlignment="Left" Width="40" FontFamily="Arial" FontSize="12"  VerticalAlignment="Top" TabIndex="1" Panel.ZIndex="2" />

This breaks:
 <ComboBox x:Name="comboBoxZoom" Style="{StaticResource comboBoxStyle}" Margin="130,10,0,0" HorizontalAlignment="Left" Width="40" FontFamily="Arial" FontSize="12"  VerticalAlignment="Top" TabIndex="1" Panel.ZIndex="2" />

Essentially the difference is only
Style="{StaticResource comboBoxStyle}"

but ths style has been used in other parts of our application before without any issues! And the same file which causes this exception, contains many other Style="{StaticResource someotherstyle}" and they work fine on the client machine.
All these styles are located in one file ControlStyles.xaml. The comboBoxStyle is a modified style copied from some website, similar to this one:
http://social.msdn.microsoft.com/Forums/nl/wpf/thread/53134b87-1a99-4998-a1fb-b3d8a9bd2773
Why does  Style="{StaticResource comboBoxStyle}" make my app crash only on some certain machines and how to fix this bug?

A: I had the same problem and after pulling my hair out for two days,  I figured the solution using Windbg with the help of someone in the C# IRC channel.
So in my case, the exception was thrown because I hadn't set the type attribute for app.config's trace listeners, and it had nothing to do with XAML, although oddly enough when I removed the combobox binding in my XAML, I could run the program in release mode, but the real solution lied in the app.config. I could run the program fine in debug mode though. This sounds like a nasty bug with the compiler.
So look for possible oversights in your app.config, if everything seems right there, then just grab Windbg and debug it on your own until you find the root cause of the exception.


text:
Q: How to show userID (or loginname) in Survey? We are using SP2013 on-premise. We want to use OOTB survey template to do some survey. After some tests, I understood we can export the results to Excel. The users' Display name will be exported.
However, I don't need the Display name. I need the userID (e.g. domain.com\johndoe or just johndoe). Can I customize it without PowerShell access?

A: You can do it in two different ways by setting the value of an SP column.
1: Workflow to set a text field with the string of the person who created the item. Or if that does not work you can set it to Domain Name + Login by using the string constructer (the ... button).

2: Alternatively you should also be able to set a SP field using JS and by getting current SP.user details. Unless needed have this field hidden so to the user it looks like nothing is different.
I recommend method 1.


text:
Q: Greatest Commom Divisor In my lecture notes there is the following:
$$\newcommand{\gcd}{\operatorname{gcd}}
a, b \in \mathbb{N}, \gcd(a, b)=d \implies \exists s, t \in \mathbb{Z} : sa+tb=d \implies tb \equiv d \pmod a$$
If $\gcd(a, b)=1$ then $tb \equiv 1 \pmod a \ $ $ \ \ \ [b]_a \in \mathbb{Z}_a^{\star}$ and $[b]_a^{-1}=[t]_a$
$$r_0=a, r_1=b \\ r_0=q_1 r_1+r_2 , 0 < r_2 <r_1 \\ r_1=q_2 r_2 + r_3, 0<r_3 < r_2 \\ \dots \\ r_{l-1}=q_{l-1}r_{l-1}+r_l, 0<r_l < r_{l-1} \\ r_{l-1}=q_l r_l+0$$
$\gcd(a, b)=r_l$
$$b, b-1, b-2, \dots , 0 \\ l \leq b$$
Because there isn't any explanation what $b, b-1, b-2, \dots , 0$ means, do you have any idea about what it could mean? What does this represent?

A: The point here seems to be to give a simple argument why the Euclidean algorithm terminates.
The sequences of remainders $r_i$ is strictly decreasing and $r_1 = b$. So it will stop at at most $r_b$, as the worst case would be $r_2 = b-1$, $r_3 = b-2$ and so on $r_b = b - (b-1)=1$, so then the following remainder must be $0$.
Note that there are somewhat more sophisticated arguments that give a much better  bound for the number of necessary steps.

A: My guess is the following: your teacher wanted to show that $l < b$. Since $r_1 = b$ and $r_{i+1} \leq r_i - 1$, it follows that $r_{i} \leq b - i + 1$ (which is what that sequence seems to represent). Now since $r_l > 0$, we get that $l \leq b$.


text:
Q: Vaadin 14 grid multi-line cells I have quite long Strings in one column and I want to display them as multi-line cells in my grid.
I'm using Vaadin 14 + Java and I tried to set CSS-Style Class for the specific column:
Java-Code:
@CssImport("./styles/shared-styles.css")
public class RisikoGrid extends Grid<RisikoEntity> {

    public RisikoGrid() {
         setSizeFull();

         // add the column to the grid
         addColumn(Entity::getAttribute).setHeader("MyCol")
            .setFlexGrow(10).setSortable(true).setKey("mycolumn");

         // set CSS style class for the specific column
         this.getColumnByKey("mycolumn").setClassNameGenerator(item -> {return "grid-mycol";});

   }
}

CSS (shared-styles.css)
.grid-mycol{
    background: red;
    white-space: normal;
    word-wrap: break-word;
}

While I do see the class-name when I use the inspector in my webbrowser (chrome), the css is not applied.

What do I need to change to make it work?
Edit: this is how my styles look like - and I can't even see the background:red for instance:

A: You can use the built-in wrap-cell-content theme variant to allow text to wrap inside the cells.
grid.addThemeVariants(GridVariant.LUMO_WRAP_CELL_CONTENT);

See the last example on https://vaadin.com/components/vaadin-grid/html-examples/grid-theme-demos – the texts there are not that long, but if you make your browsers window narrow enough you'll see some of the addresses wrap on two lines.

A: I looked into why my css settings didn't show up in the inspector and the solution was a minimal change from:
@CssImport("./styles/shared-styles.css")

to
@CssImport(value = "./styles/shared-styles.css", themeFor = "vaadin-grid")

I'm guessing the component scope of the grid differs from the global CSS.
It works now.


text:
Q: Create XML attribute using XPath I want to create an xml attribute but in order to find the element I want to add the query on, I need to use xpath. How can I do this?
Example =
const xmlText = `<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
  <title lang="eng">Harry Potter</title>
  <price>29.99</price>
</book>
<book>
  <title id="somethingeng">Learning XML</title>
  <price>39.95</price>
</book>
</bookstore>`;

var doc = new DOMParser().parseFromString(xmlText,'text/xml');

var r = doc.evaluate("//*[@lang[contains(.,'eng')]]", doc, null, XPathResult.ANY_TYPE, null);

I want to create an attribute for this r;

A: First of all the xmlText string should be a template literals now that is has new lines.
evaluate() seamed fine, but the result of that is a XPathResult that needs to be iterated with XPathResult.iterateNext().

const xmlText = `<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
  <title lang="eng">Harry Potter</title>
  <price>29.99</price>
</book>
<book>
  <title id="somethingeng">Learning XML</title>
  <price>39.95</price>
</book>
</bookstore>`;

var doc = new DOMParser().parseFromString(xmlText,'text/xml');

var r = doc.evaluate("//*[@lang[contains(.,'eng')]]", doc, null, XPathResult.ANY_TYPE, null);

var next = r.iterateNext();
while (next) {
  console.log(next.textContent);
  next = r.iterateNext();
}

Update
Based on the iterator you need to collect the nodes that you are interested in and then alter them afterwards. In the following I created functions that can create child elements and attributes based on a XPath expression and an object representing the new data.

const xmlText = `<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
  <title lang="eng">Harry Potter</title>
  <price>29.99</price>
</book>
<book>
  <title id="somethingeng">Learning XML</title>
  <price>39.95</price>
</book>
</bookstore>`;

var doc = new DOMParser().parseFromString(xmlText, 'text/xml');

function addAttribute(doc, xpath, obj) {
  let r = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);

  let nodes = [];
  let next = r.iterateNext();
  while (next) {
    nodes.push(next);
    next = r.iterateNext();
  }

  nodes.forEach(node => {
    Object.keys(obj).forEach(key => {
      let newattr = doc.createAttribute(key);
      newattr.value = obj[key];
      node.setAttributeNode(newattr);
    });
  });
}

function addChildNode(doc, xpath, obj) {
  let r = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);

  let nodes = [];
  let next = r.iterateNext();
  while (next) {
    console.log(next.textContent);
    nodes.push(next);
    next = r.iterateNext();
  }

  nodes.forEach(node => {
    Object.keys(obj).forEach(key => {
      let newnode = doc.createElement(key);
      newnode.textContent = obj[key];
      node.appendChild(newnode);
    });
  });
}

addAttribute(doc, "//title[@lang[contains(.,'eng')]]", {"data-lang":"eng", index: 2});
addChildNode(doc, "//book[number(price) < 30]", {sale: true});

console.log(doc.documentElement.outerHTML);

A: Found the solution by using XPathResult.snapshotItem().

var xmlText = `<?xml version="1.0" encoding="ISO-8859-1"?>
  <bookstore>
    <book>
      <title lang="eng">Harry Potter</title>
      <price>29.99</price>
    </book>

    <book>
      <title id=\"somethingeng\">Learning XML</title>
      <price>39.95</price>
    </book>

  </bookstore>`;

var doc = new DOMParser().parseFromString(xmlText, 'text/xml');
var r = doc.evaluate("//*[@id[contains(.,'eng')]]", doc, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);

var index = 0;
while (index < r.snapshotLength) {
  var next = r.snapshotItem(index);
  next.setAttribute("value", "val");
  index++;
}

var xmlSerializer = new XMLSerializer();
const updatedDoc = xmlSerializer.serializeToString(doc);

console.log(updatedDoc);


text:
Q: CAB "check" button How can we handle the check button in the CAB menu?
Is the item associated to some internal id like android.R.id.checkbox?
I've read that it could be handled in SherlockActionBar CAB, but could it be the same with the native ActionBar CAB?
Is there any way to detect the interaction of this item? onActionModeFinished() is not sufficient since I'm calling it multiple times since the CAB needs to be present due to previous changes that happened.
Thanks.

A: Ok,  finally found a solution after trying some things.
Place the code you want for the checkbox or onbackpressed in the method below
 public void onDestroyActionMode(ActionMode mode)
{
     //place the code you want for the checkbox or back icon here.  If you don't want
     // this code run if other selections are used, then just create a boolean value that
    //you earlier on and check the value in this section before implementing the code
}

};


text:
Q: Unable to identify the webelements on XHTML page Unable to identify the webelements on XHTML page
In My project if I click on a link a PDF opens up in a new tab and I am trying to download the PDF by clicking on Download click.The Web Element is not getting identified as the download icon is on the XHTML page. I have tried replicating this using India Post website. Still unable to identify the element. Below is the code. Does anyone have a solution?
package com.demo.learn;

    import java.util.Set;

    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.chrome.ChromeDriver;

public class handle {

    public static void main (String [] args){
        WebDriver driver;
        System.setProperty("webdriver.chrome.driver", "D://CAHCO Automation//OpteamixAutomation-master(1)//OpteamixAutomation-master//Automation_framework//OPTEAMIX//Drivers//chromedriver.exe");
        driver=new ChromeDriver();
        driver.get("https://www.indiapost.gov.in/VAS/Pages/Form.aspx");
        driver.manage().window().maximize();
        driver.findElement(By.xpath(".//*[@id='ctl00_SPWebPartManager1_g_29491a13_ee77_4e11_a5e4_e031cc13d245']/div[1]/table[1]/tbody/tr[2]/td[1]/a/img")).click();
        Set<String> handles=driver.getWindowHandles();
        String firsthandle = driver.getWindowHandle();
        handles.remove(firsthandle);
        String winhandle = handles.iterator().next();
        if (winhandle!=firsthandle){
             String secondWinHandle = winhandle;
             driver.switchTo().window(secondWinHandle);
             System.out.println("Switched");
             boolean display = driver.findElement(By.xpath(".//*
      [@id='download']")).isDisplayed();
             if(display==true)
             {
                 System.out.println("Displayed");
             }
             else
             {
                 System.out.println("Not Displayed");
             }
        }
    }

}

A: I guess what you are trying to do is clicking on PDF viewer in Chrome. The Chrome PDF viewer is a Chrome plugin so you cannot access it.
I recommend a workaround by adding an attribute to the link to open PDF. The attribute download will tell web browser to download it instead of open it in PDF Viewer. See my code below.
String script = "document.querySelector('#ctl00_SPWebPartManager1_g_29491a13_ee77_4e11_a5e4_e031cc13d245>div>table>tbody>tr>td>a>img').setAttribute('download','name-of-the-download-file-recommend-guid-or-timestamp.pdf');";
((JavascriptExecutor)driver).executeScript(script);
driver.findElement(By.xpath(".//*[@id='ctl00_SPWebPartManager1_g_29491a13_ee77_4e11_a5e4_e031cc13d245']/div[1]/table[1]/tbody/tr[2]/td[1]/a/img")).click();

Please note that the Css Selector in my example #ctl00_SPWebPartManager1_g_29491a13_ee77_4e11_a5e4_e031cc13d245>div>table>tbody>tr>td>a>img is just an example which was converted from your XPath. It might find an incorrect element.


text:
Q: How to add Progress dialog to fragment until it loads in ViewPager with Adapter of type FragmentPagerAdapter? I want to show progress dialog until fragment loads in ViewPager because it inquires data from network and then renders view of fragment. Right now when when I click on Item in ViewPager it renders fragment but it looks like it is stuck before it renders. Rather i would like to show ProgressDialog when its rendering how to solve it. I want something similar to this. I want this to be on Page Change in ViewPager.
Similar to this.
ON Page change if Fragment is rendering show progress dialog as follows.
Please help. Need a example


text:
Q: Does "-een" denote endearment? When reading Nabokov's The Annotated Lolita I came across these two terms on p. 104: girleen, Laureen.

After all, Dante fell madly in love with his Beatrice when she was nine, a sparkling girleen, painted and lovely, and bejeweled, in a crimson frock, and this was in 1274, in Florence, at a private feast in the merry month of May.

And:

And when Petrarch fell madly in love with his Laureen, she was a fair-haired nymphet of twelve running in the wind, in the pollen and dust, a flower in flight, in the beautiful plain as descried from the hills of Vaucluse.

My question is: does the desinence "-een" denote endearment? Could it be applied to other words and names?

A: The suffix -een does exist as a suffix in English, but it is not a very common one, and it is not really productive outside Ireland. Even in Ireland, it enjoys only limited productivity.

In Irish
The suffix comes from the Irish Gaelic diminutive suffix -ín, which does indeed indicate that something is small and endearing. Like Romance languages, Irish has quite a few different diminutive suffixes that can be employed fairly freely. -ín is probably the most frequent one, but other very common ones are -án (which was originally only a diminutive, but is now more common in forming other types of words) and -óg (as in seamróg, which is Anglicised as 'shamrock'—it's nothing to with rocks, just a diminutive of seamair 'clover', with the Irish -óg replaced by the formerly common English diminutive -ock).
In Irish, it can be added to both common nouns and proper names (both male and female, similar to -y/-ie in English), but since it is so productive and common nouns outnumber proper names by a factor of something very high, the number of common nouns in -ín is of course much higher than the number of proper names in -ín. Wiktionary has a whole list of Irish words with this suffix, and many more can be made on the spot.
It is also frequently used to represent the very common English diminutive(-ish) suffix -ing, such as in góislín 'gosling' or féirín 'fairing [gift bought at a fair]'.

In English
The diminutive -een suffix borrowed from Irish doesn't appear in many common nouns in English, at least not words that are used much outside Ireland. Even in Ireland, the number of common nouns suffixed with -een is fairly small. Girleen is one of the ones you'll occasionally hear in Ireland, but I've never heard it anywhere else. A more common one found both in and outside Ireland is colleen, which is a direct Anglicising of Irish cailín 'girl', a diminutive of caile 'girl, wench'. (Bizarrely, colleen is missing from the list of English words suffixed with -een on the Wiktionary page.)
Quite a lot of the proper names that are suffixed with -ín in Irish, however, have corresponding English forms in -een (and one or two common Irish nouns have been reinterpreted as proper names in English), but they are all female names. Male names are never diminutised with -een in English, unlike in Irish. The reason for this is probably that there is a French suffix -ine, which is exclusively feminine and frequently appears in personal names as well; it means something like 'belonging to' or 'showing traits of', which is a common way of forming personal names.1
In Irish, when they borrowed French names with this suffix, it just merged with their own diminutive suffix and it wasn't so very strange that all the French ones happened to be feminine—the Irish one was still perfectly useful for both genders still. In English, however, there was no indigenous suffix for -ine to merge with, so it remained limited to its feminine usage in French. By the time the Irish names suffixed with -ín started being borrowed into English, the /iːn/ suffix was apparently already so fixed from French as a feminine suffix that the male names thus suffixed were just not borrowed.
So English has personal names that end in /iːn/ from (at least) two different sources, Irish and French, and many of them are tangled up enough that it's hard to know which of the two is the more relevant origin of a name. Some examples:

*

*Colleen, from Irish cailín 'girl' (see above)

*Maureen, from Irish Máirín (diminutive of Máire 'Mary')

*Eileen, from Irish Eibhlín (from French Aveline)

*Laureen, from Irish Láirín (diminutive of Lára 'Laura') and/or French Laurine

*Cathleen, from Irish Caitlín (from French Cateline, a variant of Catherine) and/or French Cateline

As mentioned above, though, the suffix is not really productive in English. If you're in Ireland, you may get away with forming such nonce uses as lasseen ('wee lass' = little girl) in conversation, but generally you're limited to using the words that already exist, like girleen (little girl), maneen (little man), poteen (moonshine), velveteen (a type of fabric), spalpeen (rascal), etc. None of these are particularly common words, either.
If you used it productively and talked about your dear little careen (car), most people would probably be quite nonplussed and not know what you meant.
So yes, it is a diminutive suffix that signifies endearment and smallness—but it is not a productive one, and using it as such would not be natural and would most likely just confuse people.

1 The French -ine suffix also shows up in common nouns as well, and it is variously spelt -ine (as in heroine, medicine, etc.) and -een (as in canteen and tureen). The French suffix shows up, as you can see, in many words that are far more common than the ones containing the Irish -ín suffix.
The French suffix is inherited from the Latin suffix -īnus (> French -in), feminine -īna (> French -ine). This is ultimately cognate with the Irish -ín suffix (which is from Proto-Celtic *-īnos), as well as with English -en (as in 'wooden'),  Greek -ῑνος, and a host of other similar suffixes throughout the Indo-European languages. The ultimate origin of the suffix isn't entirely clear: the commonly reconstructed Proto-Indo-European form is *-iHnos; it may or may not be somehow related to the so-called Hoffmann suffix *-h₃onh₂-.


text:
Q: How do I define a reusable sequence of values for Excel 2010? I remember this was pretty easy in previous versions of Excel, but I can't find it anywhere in Excel 2010.  (I can't tell you exactly where it was done, but it was always easy for me to find when I needed it.)
For instance, if you are using numbers, you don't need to define a sequence.  You can just type 1 in a cell, and 2 in another, and then select both and extend the selection to new cells, which will be filled in with 3, 4, 5, etc.  You can do the same with (for instance) days of the week or months of the year.
If you define your own sequence, you could do the same with (for instance) books of the Bible, or anything else you can think of that has a specific sequence, and where you'd want to avoid typing in every single value.
I recently tried to do this with letters of the alphabet, and was shocked that after typing A, B, and C, Excel just repeated them.
So where (in version 2010) does Excel allow you to define your own sequences of values?  (Googling only found me such drivel as this.)

A: Go to the File tab and click on Options. Select Advanced, then scroll down and under General, click "Edit Custom Lists...". In the new window that opens, you can define custom sequences. Just type the items into the text box, one on each line, or import them from the worksheet if you've already typed them all out.

A: I'm using 2007, but I believe it's the same in 2010.  It's in the options, under the advanced tab, click a button labeled Edit Custom Lists....
Try this link: http://www.accountinghead.com/index.php/create-a-ready-made-custom-list-in-excel/


text:
Q: SVG: Могу ли я маскировать изображение с помощью широкой, открытой строки? Я пытаюсь показать историю путешествия с помощью SVG.
Я хотел бы создать эффект тумана войны ( fog of war), чтобы карта раскрывалась, когда человек идет по тропинке.

Это изображение противоположно тому, что я хочу. То есть путь раскрашен. В конечном счете, я бы хотел, чтобы этот путь был единственным прозрачным элементом. Это анимировано как      здесь     и встроено ниже.

.journey-path{
  stroke-dasharray: 10961;
  stroke-dashoffset: 10961;
  mix-blend-mode: multiply;
  animation: dash 10s linear forwards;
}
path{
  stroke-linecap:round;
  stroke-linejoin:round;
}
@keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg2" viewBox="0 0 2730 1976">

  <image width="2730.7" height="1976" preserveAspectRatio="none" xlink:href="http://i.stack.imgur.com/bHAUx.jpg" />

 <path d="M1272.6 1162.4l57.7.8s-5.5-12.2 2.7-39.6c8.3-27.5 11.8-43.2 11.8-43.2l16.5-9 5-107 8-10.5-69.5-114.7-72 121.7 11.5 15.3 2.4 94.3 9.8 11s6.3 14.5 10.6 39.6c4.4 25 5.6 41.2 5.6 41.2z" id="path4364" fill="#fff" fill-rule="nonzero"/>

  <path class="journey-path reveal" d="M1315 1302l-69.2 60.7s-43.2 28-17.3 32.4c26 4.4 166.5 13 183.8-17.2 17.3-30.3-15.2-125.4 8.6-151.3 23.7-26 320-199 320-199s49.6-23.7 54-49.7c4.3-26-473.5-257.2-473.5-257.2s-21.6-15.2-41-8.7c-19.6 6.4-588 348-588 348l-158-88.7c-9.2 3.7 153 81.6 153 81.6l356.7-214.2s99.5-23.8 88.6-73.5c-10.8-49.7-34.5-73.5 32.5-123.2 67-49.6 218.3-136 218.3-136s86.5-41.2 62.7-84.4c-23.8-43.3-147-86.5-129.7-119 17.3-32.4 250.8-190.2 309.2-205.3 58.3-15 95-28 147-2.2 52 26 121 62.8 82 95.2-38.8 32.5-54 41-54 41l91-51.8-201.2-119-402 248.8L1472.2 439l-380.5 252.8s-17.3 116.8 69.2 77.8c86.4-39 119-77.8 173-47.5 54 30.4 516.6 227 473.4 263.8-43.3 36.8-292 119-205.4 186 86.5 67 248.6 164.3 248.6 164.3s58.4 67 138.4 32.5c80-34.6 451.8-257.3 451.8-257.3 73.5-49.7 116.8-47.5 116.8-116.7s30.2-97.3-32.5-103.8c-62.6-6.5 26-103.8 71.5-151.3 45.4-47.6-28-129.7-95.2-101.6-67 28-281 80-382.6 26C2017 609.7 1922 538.2 1911 482c-10.7-56 13-30.2 71.5-25.8 58.4 4.3 17.3 69 95 71.3 78 2.2 266-8.6 309.3-64.8 43.2-56.3 60.5-114.6 23.7-90.8-36.7 23.6-106 69-194.5 58.2-88.7-10.8-162.2-45.4-190.3-90.8C1997.7 294 2231 147 2231 147" id="path4366" fill="none" stroke="#aaa" stroke-width="350" />
</svg>

Я хотел бы, чтобы это была маска, чтобы единственной видимой вещью была область под stroke.
Подобно тому, как работает маска с текстом.
 Я мог бы сделать обводку контура, если бы она была статичной, но анимация сложных форм намного сложнее, чем анимация stroke-dashoffset.
Предлагаемый мною путь решения неправильный?
Я также открыт для решений, которые используют другой подход для достижения той же цели.

A: Так почему вы не попробовали использовать маску?

.journey-path{
  stroke-dasharray: 10961;
  stroke-dashoffset: 10961;
  animation: dash 10s linear forwards;
}

path{
  stroke-linecap:round;
  stroke-linejoin:round;
}

@keyframes dash {
  to {
    stroke-dashoffset: 0;
  }
}
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg2" viewBox="0 0 2730 1976">

  <mask id="journeymask">
    <rect width="100%" height="100%"/>
    <path class="journey-path reveal" d="M1315 1302l-69.2 60.7s-43.2 28-17.3 32.4c26 4.4 166.5 13 183.8-17.2 17.3-30.3-15.2-125.4 8.6-151.3 23.7-26 320-199 320-199s49.6-23.7 54-49.7c4.3-26-473.5-257.2-473.5-257.2s-21.6-15.2-41-8.7c-19.6 6.4-588 348-588 348l-158-88.7c-9.2 3.7 153 81.6 153 81.6l356.7-214.2s99.5-23.8 88.6-73.5c-10.8-49.7-34.5-73.5 32.5-123.2 67-49.6 218.3-136 218.3-136s86.5-41.2 62.7-84.4c-23.8-43.3-147-86.5-129.7-119 17.3-32.4 250.8-190.2 309.2-205.3 58.3-15 95-28 147-2.2 52 26 121 62.8 82 95.2-38.8 32.5-54 41-54 41l91-51.8-201.2-119-402 248.8L1472.2 439l-380.5 252.8s-17.3 116.8 69.2 77.8c86.4-39 119-77.8 173-47.5 54 30.4 516.6 227 473.4 263.8-43.3 36.8-292 119-205.4 186 86.5 67 248.6 164.3 248.6 164.3s58.4 67 138.4 32.5c80-34.6 451.8-257.3 451.8-257.3 73.5-49.7 116.8-47.5 116.8-116.7s30.2-97.3-32.5-103.8c-62.6-6.5 26-103.8 71.5-151.3 45.4-47.6-28-129.7-95.2-101.6-67 28-281 80-382.6 26C2017 609.7 1922 538.2 1911 482c-10.7-56 13-30.2 71.5-25.8 58.4 4.3 17.3 69 95 71.3 78 2.2 266-8.6 309.3-64.8 43.2-56.3 60.5-114.6 23.7-90.8-36.7 23.6-106 69-194.5 58.2-88.7-10.8-162.2-45.4-190.3-90.8C1997.7 294 2231 147 2231 147" id="path4366" fill="none" stroke="white" stroke-width="350" />
  </mask>

  <image width="2730.7" height="1976" preserveAspectRatio="none" xlink:href="http://i.stack.imgur.com/bHAUx.jpg" mask="url(#journeymask)"/>

 <path d="M1272.6 1162.4l57.7.8s-5.5-12.2 2.7-39.6c8.3-27.5 11.8-43.2 11.8-43.2l16.5-9 5-107 8-10.5-69.5-114.7-72 121.7 11.5 15.3 2.4 94.3 9.8 11s6.3 14.5 10.6 39.6c4.4 25 5.6 41.2 5.6 41.2z" id="path4364" fill="#fff" fill-rule="nonzero"/>

</svg>


text:
Q: spectral decomposition of matrix with repeated eigenvalues I have a real symmetric matrix m (below) which I would like to decompose as $Q^TDQ$ with $Q$ orthogonal and $D$ diagonal. When I try to diagonalize it using Eigensystem as below, however, the result is block diagonal:
m - Transpose[m] // Norm

returns 0 but
{vals, vecs} = Eigensystem[m];
vecs . m . Transpose[vecs] // Simplify // MatrixForm

returns a block diagonal matrix. Why not a simple diagonal matrix? (The eigenvectors returned aren't unit length, but normalizing them doesn't change make the result diagonal.)
MWE:
m := {{-8, 1, 1, 1, 4, -2, 1, -2, 4}, {1, 4, -2, 4,
    1, -2, -2, -2, -2}, {1, -2, 4, -2, -2, -2, 4, -2, 1}, {1, 4, -2,
    4, 1, -2, -2, -2, -2}, {4, 1, -2, 1, -8, 1, -2, 1,
    4}, {-2, -2, -2, -2, 1, 4, -2, 4, 1}, {1, -2, 4, -2, -2, -2,
    4, -2, 1}, {-2, -2, -2, -2, 1, 4, -2, 4, 1}, {4, -2, 1, -2, 4, 1,
    1, 1, -8}};
Norm[m - Transpose[m]]
{vals, vecs2} = Eigensystem[m];
Transpose[vecs] . DiagonalMatrix[vals] . vecs // Simplify //
  MatrixForm;
vecs2 . m . Transpose[vecs2] // Simplify // MatrixForm

There are repeated eigenvalues, and I guess Mathematica may choose a nonorthogonal basis for the eigenspaces of dimension >1.  (I say "may" since sometimes it does choose an orthogonal basis, e.g., running Eigensystem on the identity matrix). That's reasonable since Eigensystem doesn't apply just to symmetric matrices and an orthogonal eigenbasis may not exist on its input. If I use SingularValueDecomposition it returns different left and right eigenvectors ie $Q_1^TDQ_2$. Neither routine takes into account that the matrix is symmetric. Is there not a built-in routine for diagonalizing a symmetric matrix a la standard spectral decomposition?

A: Just ortho-normalize the eigenvectors with the Gram–Schmidt process:
m = {{-8,  1,  1,  1,  4, -2,  1, -2,  4},
     { 1,  4, -2,  4,  1, -2, -2, -2, -2},
     { 1, -2,  4, -2, -2, -2,  4, -2,  1},
     { 1,  4, -2,  4,  1, -2, -2, -2, -2},
     { 4,  1, -2,  1, -8,  1, -2,  1,  4},
     {-2, -2, -2, -2,  1,  4, -2,  4,  1},
     { 1, -2,  4, -2, -2, -2,  4, -2,  1},
     {-2, -2, -2, -2,  1,  4, -2,  4,  1},
     { 4, -2,  1, -2,  4,  1,  1,  1, -8}};

{vals, vecs} = Eigensystem[m];
nvecs = Orthogonalize[vecs, Method -> "GramSchmidt"];

nvecs . m . Transpose[nvecs] // FullSimplify // MatrixForm

$$
\left(
\begin{array}{ccccccccc}
 -9 \sqrt{2} & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & -9 \sqrt{2} & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 0 & 9 \sqrt{2} & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 0 & 0 & 9 \sqrt{2} & 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 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\end{array}
\right)
$$
Additionally, if you want simpler expressions for the ortho-normalized eigenvectors, RootReduce can help:
nvecs // RootReduce
(*    simplified ortho-normal eigenvectors    *)


text:
Q: Difference between owner and group Can we consider the owner as a group that has exactly 1 member? Does the owner have any special abilities apart from the given permissions?
I want to have two equal users with the same permissions in directories. These two users (user1, user2) will have rwx. I need another user (user3) who has rx or wx depending on the dir.
Can I chown the dirs to user3 and assign user1, user2 to the same group?

*

*owner = user3 (rx || rw depending on the dir)

*group = user1, user2 (rwx on all dirs)

user1 and user2 are hard linked to user3 /home dir. (I don't know if this is the best practice for a shared dir)
I want to avoid ACL if possible.
edit: user1 and user2 are needed so their individual actions in the system can be traced.

A:
Can we consider the owner as a group that only has exactly 1 member? Does the owner have any special abilities apart from the given permissions?

Not really. The owner owns the file and can change its metadata. For example, the commands chown, chgrp, chmod only work for the owner of a file/directory (or for root).
For non-ACL permissions, the owner, group, and other are exclusive groups - an account cannot be in more than one of them.
With this information you should be able to see that restricting the access permissions of a directory owner makes little sense, because as the owner they can assign any permission they choose. Therefore in your example you cannot have user3 as the owner.
Me, I'd probably own the directory as root. I'd have user1 and user2 in a group as you suggest. And user3 I'd leave out entirely so they they were considered as "other".
If you had yet other accounts on the system that should not be able to access these directories like user3, I'd create another group containing all the permitted users and use a directory with that group permission to host the target directory:
holding_dir: owner:root=rwx, group:big_group(users 1,2,3):rx, other:-
  |
  +-- target1: owner:root=rwx, group:small_group(users 2,3):rwx, other:rx
  +-- target2: owner:root=rwx, group:small_group(users 2,3):rwx, other:wx

A: Well one case would be if the sticky bit ( restricted deletion flag t) is set on a directory, like in the case of /tmp.
Here only the owner of a file may delete it (or the owner of the directory) - no matter the group permissions.

Now for your case:
The owner may as well run chmod u+w as much as he likes, so the approach will fail.

Simple and possible solution:
Why not make user1 and user2 have the same UID and hand the ownership to said UID? Would that clash with other restrictions on your system?


text:
Q: updating final List before updating arrayAdapter/listView I am trying to update a listview after the user deleted an entry. I found I needed to use notifyDataSetChanged(). But to use that I need to update the arrayList first (correct?). But I can't change that because that List is declared final.
It is final because I need it in the getView method and otherwise Android Studio complains about not being able to access it via an inner class.
The relevant code:
        final List<String> arrayList = mydb.getAllAlarms();
        final List<String> timesList = mydb.getAllAlarmTimes();
        final ArrayList<Integer> arrayListID = mydb.getAllAlarmIDs();

        boolean isEmpty = false;
        if (arrayList.isEmpty()) { //default
            arrayList.add("You have no alarms");
            timesList.add("");
            isEmpty = true;
        }

        //initialise arrayadapter to show stuff in the listview
        final ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(getApplicationContext(),
                android.R.layout.simple_list_item_2, android.R.id.text1, arrayList) {
            public View getView(int position, View convertView, ViewGroup parent) {

                TextView text1 = (TextView) convertView.findViewById(android.R.id.text1);
                TextView text2 = (TextView) convertView.findViewById(android.R.id.text2);
                text1.setText(arrayList.get(position));
                text2.setText(timesList.get(position));
                return convertView;
            }
        };

        final ListView listView = (ListView) findViewById(R.id.listView1);
        listView.setAdapter(arrayAdapter); //set our custom adapter to the listview

        if (!isEmpty) { //only set clicklistener if there are alarms
            //set clicklistener for items in the listview
            listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                //...
            });
            listView.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
                @Override
                public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) {

                    //first, find the corresponding database id
                    final int idToDelete = arrayListID.get(position);

                    //show dialog
                    AlertDialog.Builder alert = new AlertDialog.Builder(
                            MainActivity.this);
                    alert.setTitle("Delete alarm");
                    alert.setMessage("Are you sure?");
                    alert.setPositiveButton("YES", new DialogInterface.OnClickListener() {

                        @Override
                        public void onClick(DialogInterface dialog, int which) {
                            mydb.deleteAlarm(idToDelete);
                            //cancel alarm as well
                            ShowAlarm.cancelAlarmIfExists(getApplicationContext(), idToDelete);

                            dialog.dismiss();

                        }
                    });

                    //...
                    alert.show();

                    //PROBLEM LIES HERE

                    //reload listview
//                    arrayList = mydb.getAllAlarms(); //not possible because final List

                    arrayAdapter.clear();
                    arrayAdapter.addAll(arrayList);

                    arrayAdapter.notifyDataSetChanged();
//                    listView.invalidateViews();
//                    listView.setAdapter(arrayAdapter);

                    return true;
                }
            });

        }

A: you can use arrayAdapter.getItem(position); to get a item from your arraylist and perform operation so that it will be reflected correctly


text:
Q: send request from PHP to Node.js I know the idea of JWT. But I have to work with both, PHP as a client which will send data to Node.js API and receive data back.
I know it is trivial if you are using JWT inside PHP only or Node.js. But is it possible to send from PHP to Node.js API?

A: Yes, it is, the validation may be an security issue in some cases, but you could do it with as secret or using  certificates.


text:
Q: Is the statement in Twilio support docs that a US number cannot be easily identified as mobile number incorrect? In the following doc: https://support.twilio.com/hc/en-us/articles/223181828-Does-Twilio-check-to-see-if-phone-numbers-can-receive-SMS-
It is stated "In countries without a "mobile range" like the United States, Canada and most Caribbean nations, there is currently not a reliable way to determine if a phone number is a mobile number or not." Is this statement incorrect?
Reading Twilio Lookup docs it seems like it is easy to identify if a US number is mobile or landline: https://www.twilio.com/docs/lookup/api
I tried a couple US numbers and got an indication of the type be it mobile or landline number. However I just tried another US number in Twilio console and got no result and the following error message "We were unable to complete your Lookup query. Please try again later or contact support." Anybody aware of the limitations that may exist with the Twilio lookup API

A: The Twilio documentation is correct. They are referring to determining the number capabilities type based on the number pattern and range, rather then using another tool like the Twilio Lookup API to do so.
The Twilio Lookup API is designed to tell you the number type [VoIP, Mobile, or Landline] when doing a carrier lookup on that specific number.
The error you got in the Lookup API, may indicate you entered an invalid phone number, not assigned to any carrier/OCN (Operating Company Number).


text:
Q: Finding the projection of v onto the orthogonal complement of u Let $X = \mathbb{R}^{n}$. Known there is an orthogonal basis $\{u, q_1, q_2,...,q_n\}$ for $X$, but only the first basis vector $u$ is given explicitly. Let $v$ be an arbitrary vector in $X$ with respect to above basis.
Now, I want to find the projection of  $v$  onto the orthogonal complement of $u$, which should be $u^{⊥}=span\{q_1, q_2,...,q_n\}$, however, I don't want to compute the orthogonal complement of $u$ explicitly. So, am I be able to find the  projection of $v$ onto $u^{⊥}$ by doing following
$$  v -\frac{(u^Tv)u}{||u||^2} $$
which is subtracting  the projection of $v$ onto $u$ from $v$ ? This is clear in 2D graph, but I am not sure this is still valid for higher dimension.


text:
Q: How to do a reactive assignment across multiple lines in Svelte? In Svelte, it's common to assign variables that are reactively computed from some props or state like so:
    export let x: number
    export let y: number
    $: sum = x + y

What does the multi-line form of this look like, when I have a reaction significantly more complicated than x + y?

A: I will always recommend putting an operation that is mildly complex (or worse, obviously) into a function of its own, and then call that function with the variables you want the operation to react on. It will improve readability and reusability and clarify intent.
I would also encourage making these functions pure whenever you can (i.e. no side effects) but that isn't always possible.
So for instance, rather than having something like this:
$: {
    ...multi-line complex operation on x and y setting value z...
}

I would do this:
function complexOperation(a, b) {
  ...multi-line complex operation on a and b setting value c...
  return c
}

$: z = complexOperation(x, y)

I try to keep all my reactive statements into one-liners, otherwise I move them into functions of their own, but I understand that's personal preference.

A: The extended version of this is
$: if (valesChanged) {
    // do whatever you want
}

And the condition could be a change of one or more of the reactive values.
or more elegant solution if there any change in all props
$: if($$props) {
    console.log($$props)
}


text:
Q: Set custom start point in Image.alpha_composite im trying to use Image.alpha_composite to overlay 2 images with thieir edges overlap.
Like this
Image.alpha_composite(iamge1,image2)

But the start point for ovelaping in Image.alpha_composite is top right corner of the image. Is there any way to change it for custom (x,y), or is there similar method that i can use?