text:
Q: How to upload a partial stream to Google Drive using Node.JS I want to achieve the functionality where I can upload a certain part of a file to Google Drive. I am able to do this by splitting the original read stream into multiple write steams and then uploading them, but this technique isn't acceptable since the write streams will live on the server (which I don't want).
I've tried to overcome this by sending the original read stream in the body of the upload request but I can't find a way to stop the upload when a certain condition is met. My upload function is as follows:
var upload = (auth, google, fileName, readStream, res, lastChunk) => {

console.log(`uploading ${fileName}`);

const drive = google.drive({ version: 'v3', auth });

var fileMetadata = {
    'name': fileName
};

var media = {
    mimeType: 'application/octet-stream',
    body: readStream
};

drive.files.create({
    resource: fileMetadata,
    media: media,
    fields: 'id',
    headers: {
        'uploadType': 'multipart'
    }
}, {
    onUploadProgress: function (e) {
        if (e.bytesRead > 786432){
            // want to stop uploading
            //readStream.close() <- this doesn't stop the upload
        }

        console.log(`Uploaded ${fileName}:`, e.bytesRead.toString());
    }
}, function (err, file) {
    if (err) {
        console.error(err);
    } else {

        if (lastChunk)
            res.render('upload-success.hbs');

        console.log('File Id: ', file.id);
    }
});

Is there a way I can stop uploading and have the uploaded part intact on Google Drive? I've tried multiple actions on the stream including closing, pausing but none seem to stop the upload. Something I would like to add is that if I've read an X bytes of stream of and upload it, then the correct bytes are uploaded, i.e. bytes from X on wards.

A: Based on this blog, you can add a handler for a request part body chunk received.
Something like this:
function write_chunk(request, fileDescriptor, chunk, isLast, closePromise) {
    // Pause receiving request data (until current chunk is written)
    request.pause();
    // Write chunk to file
    sys.debug("Writing chunk");
    posix.write(fileDescriptor, chunk).addCallback(function() {
        sys.debug("Wrote chunk");
        // Resume receiving request data
        request.resume();
        // Close file if completed
        if (isLast) {
            sys.debug("Closing file");
            posix.close(fileDescriptor).addCallback(function() {
                sys.debug("Closed file");

                // Emit file close promise
                closePromise.emitSuccess();
            });
        }
    });
}

function upload_file(req, res) {
     // Request body is binary
     req.setBodyEncoding("binary");

// Handle request as multipart
var stream = new multipart.Stream(req);

// Create promise that will be used to emit event on file close
var closePromise = new events.Promise();

// Add handler for a request part received
stream.addListener("part", function(part) {
    sys.debug("Received part, name = " + part.name + ", filename = " + part.filename);

    var openPromise = null;

    // Add handler for a request part body chunk received
    part.addListener("body", function(chunk) {
        // Calculate upload progress
        var progress = (stream.bytesReceived / stream.bytesTotal * 100).toFixed(2);
        var mb = (stream.bytesTotal / 1024 / 1024).toFixed(1);

        sys.debug("Uploading " + mb + "mb (" + progress + "%)");

        // Ask to open/create file (if not asked before)
        if (openPromise == null) {
            sys.debug("Opening file");
            openPromise = posix.open("./uploads/" + part.filename, process.O_CREAT | process.O_WRONLY, 0600);
        }

        // Add callback to execute after file is opened
        // If file is already open it is executed immediately
        openPromise.addCallback(function(fileDescriptor) {
            // Write chunk to file
            write_chunk(req, fileDescriptor, chunk,
                (stream.bytesReceived == stream.bytesTotal), closePromise);
        });
    });
});

All I/O calls are asynchronous, so write method is not immediately executed. Therefore, use addCallback method of events.Promise to process the method calls and to use for notification. It says that to achieve robust functioning, request.resume() and request.pause() is needed to avoid file corruption.


text:
Q: iterating a list in repeated calls to stored procedure In a MySQL database, how do I make repeated calls to a stored procedure by iterating through a list of strings?  Each string in the list is a parameter that needs to be passed into the procedure separately.  I wrote some pseudocode below that calls the procedure manually for each string, but how can I re-write it in MySQL-compliant SQL so that the procedure is called at each increment while iterating through the list of strings one at a time?
DELIMITER $$

DROP PROCEDURE IF EXISTS `some_procedure`$$
CREATE PROCEDURE `some_procedure`(_paramname varchar(10))
BEGIN
-- code for procedure omitted for clarity of question
END$$

SET @paramname = 'cat';
CALL `some_procedure`(@paramname)$$

SET @paramname = 'dog';
CALL `some_procedure`(@paramname)$$

SET @paramname = 'lizard';
CALL `some_procedure`(@paramname)$$

SET @paramname = 'chicken';
CALL `some_procedure`(@paramname)$$

DROP PROCEDURE IF EXISTS `some_procedure`$$

redpajama_set_name: RedPajamaStackExchange


text:
Q: Find the biggest area of an isosceles triangle in an unit circle An isosceles triangle is inscribed in the unit circle. Determine the largest area of the triangle can assume.
My solution attempt:
An isosceles triangle has two sides of equal size, and the sides will be at some point on the circumference of the unit circle during suggestion the $x$-axis. The height will be $1 + h \le 2$ and width $b + 1 \le 2$
Another way would be to make the vectors of the three points that will be on the periphery (assuming that it can provide the largest area on the periphery)
I really do not know how to solve it.

A: Hint
The triangle is $\Delta ABC$: $AB=AC=b$ and $BC=a$.
Also $\angle A=2x \rightarrow \angle B=\frac{\pi - 2x}{2}=\frac{\pi}{2}-x$, so:
$$S(ABC)=\frac{b^2\sin 2x}{2}$$
And by sine rule:
$$\frac{b}{\sin \angle B}=2\cdot 1 \rightarrow b=2\cdot \cos x$$
and then:
$$S(ABC)=2\cdot \cos^2x\cdot\sin 2x=(1+\cos 2x)\cdot \sin 2x$$
Can you finish?

A: equilateral triangle has maximum area
side would be $\sqrt{3}$ by using trigonometry
area is $\frac{\sqrt 3}{4}a^2$$=$$\frac{3\sqrt 3}{4}$

A: I assumed a central angle within the circle A to create an additional isosceles triangle and find the base N, as well as find the total height.
Because this is a unit circle, the radius is 1.
With the central angle A, we create the isosceles triangle with base N and with base angles X and with height K.
Drawing a perpendicular bisector down from the vertex of A creates two right triangles; each has height K, base angle X, upper angle (for lack of a better term) a/2, and hypotenuse of 1 (because the radius is 1). With this, we can create some functions/equations based on the variables:
X = 90 - (A/2)
sin(x) = K
cos(x) = n/2
2cos(x) = n
The total height of the isosceles triangle in question (the one with the largest area) is given by K+1.
The base of the isosceles triangle with base angle X is given by N (as is the largest possible isosceles triangle).
The area of a triangle is given by ((base*height)/2).
Therefore, we can perform substitutions, and get that
(2cos(x)(sin(x) + 1))/2 = Area.
More simply, cos(x)(sin(x) + 1) = Area.
However, we established these relations based on an assumed central angle; therefore, we need to substitute.
cos(90 - (a/2))(sin(90 - (a/2)) + 1) = Area.
Proceed from there.

A: First note that the two angles in the figure below must be equal (the two triangles in the lower part of the picture are congruent by side-angle-side). Denote their common value by $\theta$.
The area of the triangle is then $A(\theta) = \frac{\sin2\theta}{2}+\sin\theta$, where  $0<\theta<\pi$.
Now find the maximum of $A$ on its domain.


text:
Q: 1950s Children's TV Sci-Fi Where the Villain is an Arrangement of Crystals That Achieved Consciousness I am trying to locate the name of a serialized children's sci-fi program.
My most vivid memory is the ending. The bad guy turned out to be a half dozen crystals whose positions relative to each other allowed it to achieve consciousness. The hero "killed" the villain by just moving one of the crystals. I don't remember if this plot/ending was for the whole series, or just one episode of the series.
Vague recollections (that might be wrong):

*

*It was a 10-minute segment of a half hour children's program.

*It might have had something to do with Crusader Rabbit, Sheriff John or Engineer Bill.

*It aired on a local Los Angeles TV station in the 1950s.

*It might have been stop motion animation.

*It was black and white.

*Low production value.

A: This might be The Space Explorers (1958), which was serialized on Sheriff John's TV show in LA (I saw it in the early 1960s). It involves a boy and a scientist-astronaut who are looking for the boy's father, who is lost in space. I'm not sure about the ending or the crystals, though - I missed the last episode! Anyway, it was cobbled together from no less than three foreign (2 Russian, 1 German) movies & dubbed into English to take advantage of the Space Race. Most it was traditional animation, although the spaceflight scenes consisted of some pretty good model-work from the German film Space Ship Takeoff, a Technical Fantasy, 1938, which can be seen on Youtube.


text:
Q: Without using module, how can I determine the width of an integer? In other words, if I am presented with the number 54352, I want an expression that will tell me the width of that number is 5. I could use a for each loop to do this I know, but that seems rather cumbersome. Any other ideas?

A: you can use len(str(54352)) which will return 5 by converting it into a string, and returning the length of the string representation of the number.
Another way, a bit longer, would be:
def ilen(n):
    i=0
    while n != 0:
      n /= 10
      i += 1
    return i

ilen(54352)

A: Actually is more like len(str(abs(n))) because -1 should probably have length 1.

A: Try
n = 54352
print (len(str(abs(n))))

Amended as user2722968 is correct.


text:
Q: How to set verbose_name for external app model in Django? I'm trying to set verbose_name for a model SocialAuthUser from django_social.
I've tried to use proxy model, setting its Meta.verbose_name to desired value, but had no success (probably I did it wrong). If it's the way to go, I can provide more details.
It would be great to avoid installing module from pip in editable mode just to replace verbose_name in admin site.
Probably I can replace model name in admin site in some other way?
I thought about adding custom link to admin site, but didn't research this method yet because it feels hacky.

A: You almost got it right. For your changes on the proxy model to take effect you need to unregister the model from admin site first and then register the proxy model.
The example below is for social_django.Association model.
# admin.py
from django.contrib import admin
from social_django.admin import AssociationOption
from social_django.models import Association

class AssociationProxy(Association):
    class Meta:
        proxy = True
        verbose_name = 'custom model'
        app_label = 'social_django'

admin.site.unregister(Association)
admin.site.register(AssociationProxy, AssociationOption)

This assumes you are using the default admin site
# urls.py
from django.contrib import admin
from django.urls import path

urlpatterns = [
    path('admin/', admin.site.urls),
]


text:
Q: Set partitioning in ZFC Does $\sf ZFC$ allow the partitioning of a set by claiming that $a$ and $b$ are in the same subset if $f(a,b)$?
Cause I've once seen this technique being used in a proof but I can't see how it is consistent with the axioms of $\sf ZFC$...
Thanks in advance for taking interest in my question!

A: Of course.
It's very easy to forget, and many people do, that the axioms of $\sf ZFC$ allow parameters in the formulas used.
If $A$ is a set, and $f$ is a function whose domain is $A$, then $f$ is a set of ordered pairs, etc. etc. and $f^{-1}(u)=\{a\in A\mid f(a)=u\}$ is a definable subset of $A$, since it uses $f$ and $u$ as parameters; and this means that $\{f^{-1}(u)\mid u\in\operatorname{rng}(f)\}$ is a definable subset of $\mathcal P(A)$, using $f$ as a parameter.
You can easily verify that this is indeed a partition of $A$.


text:
Q: HTML: perform margin-bottom if number of lines in div > 1 I have a HTML div that I want to add a margin to the bottom to but only if the number of lines in that div is greater than 0.
Is this possible? Should I use JS?
HTML:

                    Actions Taken:

                    Actions taken are gotten from a Database

thanks.

A: If I understood your question, you want to add margin-bottom to the divs that has more than 1 line.
This could be done using JavaScript.
In the example below, multi-line text's color is red and single-line text's color is green. The multi-line text is given 50px margin-bottom.
What this code does is it extracts the font-size of the text and compares it with its offsetHeight. Hence this will work for any font-size.

var divs = document.getElementsByTagName('div')

function foo() {
  for (i = 0; i < divs.length; i++) {
    divs[i].style.marginBottom = (divs[i].offsetHeight - 3 > parseInt(getComputedStyle(divs[i]).fontSize.slice(0, -2), 10)) ? '50px' : '0';
  }
}

foo();
window.onresize = foo;
.multi-line {
  color: red;
}
.single-line {
  color: green;
}

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
  in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
  in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
  in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

A: For block_container_1
you can use js
var count = $(".block_container_1 div").length;
if(count > 1){
    $(".block_container_1").css("margin-bottom","10px");
}


text:
Q: Function variables: Whats the range of scope of a function Recently I have been working on a word game in python, nonetheless I am having problems with a little detail.The idea of the game is to create words with letters in a hand given randomly. The function that coordinates the game asks the user to input a letter  and according to it,  lets him/her to play a new hand, play the same hand again or exit the game. The problem is that I cannot make the game to return to the previous hand and let the user play it again. Instead the code returns a modified version of the previous hand, so that if you inputted a word correctly the letters in that word won't be in it. I thought this could not be possible since the function that "updates the hand" lies on a different scope. I am working in python 3.2.1
I posted the entire code so you could test it and see what it does. The problem, however, lies in the functions: play_game, play_hand and update_hand.
import random
import string

VOWELS = 'aeiou'

CONSONANTS = 'bcdfghjklmnpqrstvwxyz'

HAND_SIZE = 7

SCRABBLE_LETTER_VALUES = {
    'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q': 10, 'r': 1, 's': 1, 't': 1, 'u': 1, 'v': 4, 'w': 4, 'x': 8, 'y': 4, 'z': 10
}

WORDLIST_FILENAME = "words.txt"

def load_words():

    """
    Returns a list of valid words. Words are strings of lowercase letters.

    Depending on the size of the word list, this function may
    take a while to finish.
    """
    print ("Loading word list from file...")
    # inFile: file
    inFile = open(WORDLIST_FILENAME, 'r')
    # wordlist: list of strings
    wordlist = []
    for line in inFile:
        wordlist.append(line.strip().lower())
    print ("  ", len(wordlist), "words loaded.")
    return wordlist

def get_frequency_dict(sequence):

    """
    Returns a dictionary where the keys are elements of the sequence
    and the values are integer counts, for the number of times that
    an element is repeated in the sequence.

    sequence: string or list
    return: dictionary
    """
    # freqs: dictionary (element_type -> int)
    freq = {}
    for x in sequence:
        freq[x] = freq.get(x,0) + 1
    return freq

def get_word_score(word, n):

    """
    Returns the score for a word. Assumes the word is a
    valid word.

    The score for a word is the sum of the points for letters
    in the word multiplied by the length of the word, plus 50
    points if all n letters are used on the first go.

    Letters are scored as in Scrabble; A is worth 1, B is
    worth 3, C is worth 3, D is worth 2, E is worth 1, and so on.

    word: string (lowercase letters)
    returns: int >= 0
    """
    score = 0
    for character in word:
        score = score + (SCRABBLE_LETTER_VALUES[character])
    score = score * len(word)
    if len(word) == 7:
        score = score + 50
    return score

def display_hand(hand):

    """
    Displays the letters currently in the hand.

    For example:
       display_hand({'a':1, 'x':2, 'l':3, 'e':1})
    Should print out something like:
       a x x l l l e
    The order of the letters is unimportant.

    hand: dictionary (string -> int)
    """
    for letter in hand.keys():
        for j in range(hand[letter]):
             print (letter,)

def deal_hand(n):

    """
    Returns a random hand containing n lowercase letters.
    At least n/3 the letters in the hand should be VOWELS.

    Hands are represented as dictionaries. The keys are
    letters and the values are the number of times the
    particular letter is repeated in that hand.

    n: int >= 0
    returns: dictionary (string -> int)
    """
    hand={}
    num_vowels = int(n / 3)

    for i in range(num_vowels):
        x = VOWELS[random.randrange(0,len(VOWELS))]
        hand[x] = hand.get(x, 0) + 1

    for i in range(num_vowels, n):
        x = CONSONANTS[random.randrange(0,len(CONSONANTS))]
        hand[x] = hand.get(x, 0) + 1

    return hand

def update_hand(hand, word):

    """
    Assumes that 'hand' has all the letters in word.
    In other words, this assumes that however many times
    a letter appears in 'word', 'hand' has at least as
    many of that letter in it.

    Updates the hand: uses up the letters in the given word
    and returns the new hand, without those letters in it.

    Has no side effects: does not modify hand.

    word: string
    hand: dictionary (string -> int)
    returns: dictionary (string -> int)
    """
    for i in word:
        new_hand = hand
        new_VOWELS = VOWELS
        new_CONSONANTS = CONSONANTS
        if i in VOWELS:
            new_VOWELS = new_VOWELS.replace("i", "")
            new_hand[i] = new_hand.get(i, 0) - 1
            if new_hand[i] <= 0:
                new_hand.pop(i, None)

        else:
            new_CONSONANTS = new_CONSONANTS.replace("i", "")
            new_hand[i] = new_hand.get(i, 0) - 1
            if new_hand[i] <= 0:
                new_hand.pop(i, None)
    return (new_hand)

def is_valid_word(word, hand, word_list):

    """
    Returns True if word is in the word_list and is entirely
    composed of letters in the hand. Otherwise, returns False.
    Does not mutate hand or word_list.

    word: string
    hand: dictionary (string -> int)
    word_list: list of lowercase strings
    """

    for character in word:
        x = 0
        if character in hand:
            x = x + 1
    if (x==(len(word)-1)) and (word in word_list):
        return (True)
    else:
        return (False)

def calculate_handlen(hand):
    handlen = 0
    for v in hand.values():
        handlen += v
    return handlen

def play_hand(hand, word_list):

    """
    Allows the user to play the given hand, as follows:

    * The hand is displayed.

    * The user may input a word.

    * An invalid word is rejected, and a message is displayed asking
      the user to choose another word.

    * When a valid word is entered, it uses up letters from the hand.

    * After every valid word: the score for that word is displayed,
      the remaining letters in the hand are displayed, and the user
      is asked to input another word.

    * The sum of the word scores is displayed when the hand finishes.

    * The hand finishes when there are no more unused letters.
      The user can also finish playing the hand by inputing a single
      period (the string '.') instead of a word.

      hand: dictionary (string -> int)
      word_list: list of lowercase strings

    """
    score = 0
    han = hand
    while True:
        print ("Score= ", score)
        word = str(input("Enter your word: "))
        value = is_valid_word(word, han, word_list)
        if value == True:
            print ("Congratulations, that word is worth", get_word_score(word, 7), "points")
            print ("Please input another word")
            han = update_hand(han, word)
            print ("Current hand=")
            display_hand(han)
            score = score + get_word_score(word, 7)
        elif word == "." or len(hand)==0:
            break
        else:
            print ("Current hand=")
            display_hand(han)
            print ("Sorry, that word is not valid")
            print ("Please choose another word")

def play_game(word_list):

    """
    Allow the user to play an arbitrary number of hands.

    * Asks the user to input 'n' or 'r' or 'e'.

    * If the user inputs 'n', let the user play a new (random) hand.
      When done playing the hand, ask the 'n' or 'e' question again.

    * If the user inputs 'r', let the user play the last hand again.

    * If the user inputs 'e', exit the game.

    * If the user inputs anything else, ask them again.
    """
    global handy
    handy = deal_hand(7)
    while True:
        print ("Use 'n' to play a new hand, 'r' to play the last hand again or 'e' to exit game")
        inp = str(input("Enter a letter:'n' or 'r' or 'e': ="))
        if inp == 'n':
            hand = deal_hand(7)
            handy = hand
            print("Current hand =")
            display_hand(hand)
            play_hand(hand, word_list)
        elif inp == 'r':
            print("Current hand =")
            display_hand(handy)
            play_hand(handy, word_list)
        elif inp == 'e':
            exit(play_game)
        else:
            print ("Please input a valid letter")

if __name__ == '__main__':
    word_list = load_words()
    play_game(word_list)

A: Writing y = x makes y refer to the same thing as x. It does NOT copy x. With "immutable" objects, this looks like a copy because you have to make a new object in order for any "change" to be evident. With "mutable" objects like lists, because x and y both refer to the same object, changes to one name appear in the other.
You probably want to copy the list:
new_hand = hand[:] # this funny slicing notation produces a shallow copy of the original list


text:
Q: Symfony form rendered in twig template as controller is not submitting I'd like to have simple "Search" input field in base.html.twig. Normally I would need to write code to maintain form in every route. To solve this problem I decided to create separate controller with route to render it directly in base.html.twig template:

{{ render(controller("App\\Controller\\SearchController::searchProduct"))}}

It works find except nothing happens when the form is submitted. I tried it in normal way in one of my routes and it was working fine. So don't know where the problem is.
My SearchController with route which is rendered in twig :
class SearchController extends AbstractController
{
    #[Route('search-product', name: 'search_product')]
    public function searchProduct(Request $request)
    {
        $searchForm = $this->createForm(SearchProductType::class);
        $searchForm->handleRequest($request);

        if ($searchForm->isSubmitted() && $searchForm->isValid()) {

            dump('Form submitted');
        }
        return $this->render('components/search-input.html.twig', [
            'searchForm' => $searchForm->createView()
            ]);
    }
}

Search input.html.twig component:

            {{ form(searchForm) }}

and the main controller which renders index.html.twig with base.html.twig:
 #[Route('/', name: 'home')]
    public function index(FileHandler $fileHandler, SessionInterface $session, Request $request): Response
    {

        $products = $this->doctrine->getRepository(Product::class)->getProducts('Dresses', 4);
        $products = $this->addPathToImages($products, 'Dresses');

        return $this->render('shop/index.html.twig', [
            'products' => $products
        ]);
    }

The line
dump('Form submitted');

is not executed when the form is submitted. Page refreshes but nothing happens.
I think the whole logic should stay in this route/controller or I am missing something?

A: As requested I publish my solution:
Instead of embedding controller directly in Twig file and decided to handle my little form (just Search input, submitted by pressing "enter") with js. The reason for this is that it's impossible to redirect from embedded controller.
Code in twig:
<form id="top-search-form">

                        <input id="search-string"
                        class="top-search__input" type="search"
                        placeholder="Search shop">

</form>

and code written in Javascript (requires FOSJSRouting Bundle):
const routes = require('/public/js/fos_js_routes.json');
import Routing from '/vendor/friendsofsymfony/jsrouting-bundle/Resources/public/js/router.min.js';

Routing.setRoutingData(routes);

document.addEventListener('DOMContentLoaded', function() {
    const searchForm = document.getElementById('top-search-form');

    searchForm.addEventListener('submit', function(e) {
        e.preventDefault();
        const searchString = document.getElementById('search-string').value;

        var url = Routing.generate('items_filter', {
            'searchText': searchString
        });

        location.href = url;
    });
})


text:
Q: How to know Excel file cells count using .NET wrapper for MS Office In my programm I'm using .NET wrapper for MS Office for reading Excel file into 2D array.
It works just fine with following code:
public static object[,] OpenExcelFileToArray(string filename, string start, string end, int sheetNumber = 1)
{
    using (var app = MSExcel.Application.CreateApplication())
    {
        var book = app.Workbooks.Open(filename);
        var sheet = (MSExcel.Worksheet)book.Worksheets[1];
        var range = sheet.GetRange(start, end);

        return (object[,]) range.Value2;
    }
}

In this method I'm sending string start and string end as the parameters(for example start = "A1" and end = "Z10".
It works only if I know already the size of Excel content table.
But what if I don't know the last cell of Excel file?
Could this be resolved using .NET wrapper for MS Office?
I didn't find requred info on their website.

A: I think, the Worksheet.UsedRange property is what you're looking for.
I'm not sure, if MS Office Wrapper for .NET offers it.
Microsoft's official .Net wrapper for Office is VSTO, and it supports this property:
https://msdn.microsoft.com/en-us/library/bb608603.aspx


text:
Q: Apache poi: remove Picture in XWPFDocument I'm writing an application that takes a .docx file with a bunch of empty paragraphs and tables and fills them programmatically using Apache POI with data from a db.
The .docx model I've been provided with also has a serie of pictures in it: my problem is I'd like to remove the ones I don't need (again, programmatically). I see there is a method for adding pictures to a XWPFRun (addPicture()) but not one for removing them.
Can this be done? How do you remove a picture from a .docx file with POI?
Thanks in advance!!


text:
Q: DataTable check if row is last in collection Say I have a DataTable like so:
state of D is DataViewRowState.Deleted and lets say O are rows that have not been touched
index: 0 | state: O
index: 1 | state: O
index: 2 | state: O
index: 3 | state: D
index: 4 | state: D

Say I delete the row at index 2 (I set the row state to deleted). Is there a way to know if row at index 1 is the last non-deleted row in the collection without "walking forward" and checking the rows state of each record after index 1?

A: You can use LINQ:
int deletedIndex = 2;
DataRow firstNonDeletedBeforeDeletedIndex = table.AsEnumerable()
    .Where((row, index) => index < deletedIndex && row.RowState != DataRowState.Deleted)
    .LastOrDefault(); // null if none found


text:
Q: Definition of Graded Algebra I attempt to understand the definition of graded algebra from An Introduction to Manifolds by Loring Tu (page no. 30). Below I quote the definition supplied in the book.

An algebra $A$ over a field $K$ is said to be graded if it can be written as a direct sum $A = \bigoplus_{k = 0}^{\infty} A^k$ of vector spaces over $K$ such that the multiplication map sends $A^k \times A^l$ to $A^{k+l}$. The notation $A = \bigoplus_{k = 0}^{\infty} A^k$ means that each nonzero eleement of $A$ is uniquely a finite sum
  $$
a = a_{i_1} + \cdots a_{i_m},
$$
  where $a_{i_j} \neq 0 \in A^{i_j}$.

My Questions

*

*Why does the sum for $a = a_{i_1} + \cdots a_{i_n}$ have to be finite?

*Why is the condition: $a_{i_j} \neq 0 \in A^{i_j}$ applied for the sum?

*Can you please provide a simple example of the multiplication map that sends $A^k \times A^l$ to $A^{k+l}$ for a graded vector space $A$ over  $K$?

*The definition in the quote mentions a multiplication map that sends $A^k \times A^l$ to $A^{k+l}$. According to my understanding, here a multiplication map $\mu: A \times A \to A$ can be considered which preserves the degree; i.e., $\mu(A^k, A^l) \subseteq A^{k+l}$, where $k, l \in \mathbb{N}$. Does this multiplication map also satisfy distributivity, associativity, and homogeneity (just like the definition of algebra between two vector spaces over a field)?
For question no. 1 and 2, my confusion arises from the fact that I am trying to see these two conditions (finite sum and $a_{i_j} \neq 0 \in A^{i_j}$) as consequences of the direct sum of vector spaces, not just as parts of the definition, in particular as concrescences of the following definition and theorem.
Definiton (Direct sum of vector spaces): Let $U$ and $V$ be subspaces of a vector space $W$. If the sum $U + V = W$ and $ U \cap V = \bar{0}$, then $W$ is said to be the direct sum of $U$ and $V$, where $\bar{0}$ is the zero vector in $U$, $V$ and $W$. In this case, we write $W = U \bigoplus V$.
Theorem: Every element $w \in W$ can be written uniquely as $w = u + v$, where $u \in U$ and $v \in V$.
In this definition and theorem, the conditions described in question no. 1 and 2 are not mentioned.


text:
Q: How to disable docker diff The following is the disk usage of my machine. I ran docker system df -v
CONTAINER ID   IMAGE               COMMAND   LOCAL VOLUMES   SIZE      CREATED             STATUS
a7ea593ae05e   c265fa50d720        "bash"    0               20.7GB    21 hours ago        Up 21 hours

This reports the correct amount of storage used by the container. This container created a 19GB file.
However,
df -h shows the following disk space consumption
Filesystem      Size  Used Avail Use% Mounted on
overlay          97G   72G   26G  75% /var/lib/docker/overlay2/aa15e95ad170e94462a8a2064b9f1bad62d3c2ea579f4e7ffcb16e159fbc1cea/merged

On checking this folder. I found out that /var/lib/docker/overlay2/9a58de48986643e6284123effe601e57099133ca55e471b548d059906b20434b
folder was consuming 42 GB.
On checking the disk usage statistics for this folder
20G /var/lib/docker/overlay2/9a58de48986643e6284123effe601e57099133ca55e471b548d059906b20434b/diff
23G /var/lib/docker/overlay2/9a58de48986643e6284123effe601e57099133ca55e471b548d059906b20434b/merged
42G /var/lib/docker/overlay2/9a58de48986643e6284123effe601e57099133ca55e471b548d059906b20434b

On further checking I could find the 20 GB file in both merged and diff directory.
This explains why it was consuming double the amount of storage.
I never run a docker diff on a production instance. So this is causing me more harm than benfit. I wanted to know if there is a possibility to disable docker running diff for some specific folders so that redundant copy of the file the instance creates is not stored?
Please find below the steps to create a minimal reproducible example
Docker file
FROM ubuntu:18.04

RUN apt update -y
RUN apt upgrade -y

RUN apt-get install -y python3 python3-dev
RUN apt-get install -y python3-pip jq

RUN mkdir -p /opt/program/

WORKDIR "/opt/program/"
ADD ./ /opt/program/
CMD  ["bash", "-c", "python3 -u program.py"]

program.py
import logging
import time
import argparse
import random

logging.basicConfig(level=logging.DEBUG)

if __name__ == "__main__":
    # parser = argparse.ArgumentParser()
    # parser.add_argument('--test')
    # args = parser.parse_args()
    l = ['test_' + str(i) for i in range(1000000)]
    with open('/tmp/test_abc123', 'w') as f:
        f.write('\n'.join(l))
    while 1:

        time.sleep(1)
        logging.info("%s", 'test')

I executed the following commands
1. sudo docker build -f Dockerfile .
2. sudo docker run -d <image_id>
3. sudo docker container exec -it <container_id> bash
4. Verified a 11 MB file is created in /tmp in the container.
5. Now, I search for the file in my host machine

satinders:/var/lib/docker/overlay2# ls -l $(find . -iname test_abc123)
-rw-r--r-- 1 root root 11888889 Jan 11 18:03 ./edf8615137c5b04e14116f6285757d4db170187282a5b51d78f4f77ca4c9b707/diff/tmp/test_abc123
-rw-r--r-- 1 root root 11888889 Jan 11 18:03 ./edf8615137c5b04e14116f6285757d4db170187282a5b51d78f4f77ca4c9b707/merged/tmp/test_abc123

Update
I found this in the documentation for docker diff here

List the changed files and directories in a container᾿s filesystem since the container was created. Three different types of change are tracked:

A   A file or directory was added
D   A file or directory was deleted
C   A file or directory was changed

A: merged is an overlay filesystem, which is a combination of filesystem layers, and takes up no actual disk space itself (similar to the behavior of a bind mount). The diff directory is the changes created in that layer, or the containers read write layer (for the merged directory, I believe it's tracked as the upper directory). So either the file was created or modified in that layer, and is stored once in that layer.
If the file is also in the lower layers (e.g. in both the image and container specific layers), then you have likely modified the file, triggering a copy on write. That change can include a permission or ownership change on the file.
To disable the container diff and read-write layer, you can define your container with the --read-only flag. You will not be able to create files in the container that aren't in some other mount (a volume or tmpfs).


text:
Q: @WebFluxTest with Apache Freemarker fails I am using Spring Boot 2.0 with Spring WebFlux and Apache Freemarker,
I have controller like following:
@Controller
public class ArticleController {

    @GetMapping("/new")
    public String newArticle() {
        return "article/new";
    }

}

It works fine when the application is started and /new endpoint is hit with a browser. But the following @WebFluxTest fails.
@RunWith(SpringRunner.class)
@WebFluxTest(ArticleController.class)
public class ArticleControllerTest {

    @Autowired
    private WebTestClient webTestClient;

    @Test
    public void getNew() {
        webTestClient.get().uri("/new").accept(MediaType.TEXT_HTML).exchange().expectStatus().isOk();
    }
}

With the following exception.
java.lang.IllegalStateException: Could not resolve view with name 'article/new'.
    at org.springframework.web.reactive.result.view.ViewResolutionResultHandler.lambda$resolveViews$3(ViewResolutionResultHandler.java:277) ~[spring-webflux-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:107) [reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1069) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoCollectList$MonoBufferAllSubscriber.onComplete(MonoCollectList.java:117) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:349) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onComplete(FluxConcatMap.java:265) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators.complete(Operators.java:125) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:111) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:61) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatMap.subscribe(FluxConcatMap.java:121) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoCollectList.subscribe(MonoCollectList.java:59) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:1626) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:1440) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:1314) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1069) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:241) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:73) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:198) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:198) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1069) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoIgnoreThen$ThenAcceptInner.onNext(MonoIgnoreThen.java:290) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:1626) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoIgnoreThen$ThenAcceptInner.onSubscribe(MonoIgnoreThen.java:279) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:161) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:53) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:148) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:74) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoPeekFuseable.subscribe(MonoPeekFuseable.java:74) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:150) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxSwitchIfEmpty$SwitchIfEmptySubscriber.onNext(FluxSwitchIfEmpty.java:67) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoNext$NextSubscriber.onNext(MonoNext.java:76) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.innerNext(FluxConcatMap.java:271) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatMap$ConcatMapInner.onNext(FluxConcatMap.java:803) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:115) [reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:1626) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:156) [reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:1440) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:1314) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:90) [reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoJust.subscribe(MonoJust.java:54) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoMapFuseable.subscribe(MonoMapFuseable.java:59) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:418) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onSubscribe(FluxConcatMap.java:210) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:128) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxIterable.subscribe(FluxIterable.java:61) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatMap.subscribe(FluxConcatMap.java:121) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoNext.subscribe(MonoNext.java:40) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoSwitchIfEmpty.subscribe(MonoSwitchIfEmpty.java:44) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoFlatMap.subscribe(MonoFlatMap.java:60) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoOnErrorResume.subscribe(MonoOnErrorResume.java:44) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.drain(MonoIgnoreThen.java:167) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:56) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribeWith(Mono.java:3188) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3074) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3041) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3013) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at org.springframework.test.web.reactive.server.HttpHandlerConnector.lambda$connect$1(HttpHandlerConnector.java:89) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.mock.http.client.reactive.MockClientHttpRequest.lambda$null$2(MockClientHttpRequest.java:125) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:44) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatIterable$ConcatIterableSubscriber.onComplete(FluxConcatIterable.java:141) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.FluxConcatIterable.subscribe(FluxConcatIterable.java:60) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.MonoSourceFlux.subscribe(MonoSourceFlux.java:47) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3080) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribeWith(Mono.java:3188) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3074) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3041) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at reactor.core.publisher.Mono.subscribe(Mono.java:3013) ~[reactor-core-3.1.5.RELEASE.jar:3.1.5.RELEASE]
    at org.springframework.test.web.reactive.server.HttpHandlerConnector.connect(HttpHandlerConnector.java:100) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.test.web.reactive.server.WiretapConnector.connect(WiretapConnector.java:73) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.exchange(ExchangeFunctions.java:79) ~[spring-webflux-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.web.reactive.function.client.DefaultWebClient$DefaultRequestBodyUriSpec.exchange(DefaultWebClient.java:325) ~[spring-webflux-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.test.web.reactive.server.DefaultWebTestClient$DefaultRequestBodyUriSpec.exchange(DefaultWebTestClient.java:282) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at com.packtpub.springboot2blog.controller.ArticleControllerTest.getNewArticlePage_ShouldReturnNewArticlePage(ArticleControllerTest.java:30) ~[test-classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) ~[junit-4.12.jar:4.12]
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) ~[junit-4.12.jar:4.12]
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) ~[junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:73) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:83) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) ~[junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) ~[junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) ~[junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) ~[junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) ~[junit-4.12.jar:4.12]
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) ~[junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363) ~[junit-4.12.jar:4.12]
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190) ~[spring-test-5.0.4.RELEASE.jar:5.0.4.RELEASE]
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137) ~[junit-4.12.jar:4.12]
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) ~[junit-rt.jar:na]
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47) ~[junit-rt.jar:na]
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242) ~[junit-rt.jar:na]
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70) ~[junit-rt.jar:na]

Any hints on how to test this would be appreciated.

A: I had the same problem, but using Thymeleaf. I forgot to add the following annotation to my test class:
@Import({ThymeleafAutoConfiguration.class})

This will configure a view resolver. On Spring Boot 2.0.5, there is a similar class for FreeMarker, so you can try adding it to your test class:
@Import({FreeMarkerAutoConfiguration.class})


text:
Q: "Grouped expression is missing ')'", except it isn't Using VS2010's find dialog, I'm using the following regex: (?'outer'^div\#.+) input$.
I'm trying to create a named group of "outer" with the contents div#someId from div#someId input (in this case where someId matches .+)
However, Visual Studio is presenting the dialog: Grouped expression is missing ')'.
However, the ) is there after the +. What am I escaping or failing to escape?
EDIT:
I don't necessarily need to used named groupings, I just need to be able to use div#someId in the replace to add another selector.

A: It appears that Visual Studio's find and replace uses braces { } and not parentheses ( ) for backreferences and named references.

Since someone may find this trying to use backreferences/named grouping in a Find and Replace in Visual Studio, here's an example of using them:
To replace
div#someId input

with
div#someId input,
div#someId textarea

Find: {^div\#.+ }input and replace with: \0,\n\1textarea
It will put div#someId (with the space, which matches ^div\#.+ into the first backreference.
Building the replace string with a backreference:
The replace will then replace the whole string :\0
div#someId input

then a comma: ,
div#someId input,

then a new line: \n
div#someId input,

then the first group: \1
div#someId input,
div#someId

then the given text: textarea
div#someId input,
div#someId textarea

Altogether makes the replace string \0,\n\1textarea
Update: Based on this MSDN question in VS2012 backreferences are accessed using $n rather than \n, so the replace string would be: $0,\n$1textarea

A: You should use the Productivity Power Tools' inline Replace feature, which uses standard .Net regexes


text:
Q: Pyspark - how to handle '^M' character in source file I am reading data from the source file and the source file contains this character: ^M. Because of this, spark is going to a new line, which I do not want. How can I handle this?
Sample data :
I | 00683041  |000000000807698|OKC 9800            _____^M                               |0001-01-01|N|1D11|XMS530|2004-03-17|0001-01-01|     |02|00|00|09    |N|0001-01-01|N|0001-01-01|0001-01-01|9998

I am using below API to read the code:
DF2 = spark.read.option("sep", '|').format("csv").load("file.txt")

 682907 I | 00682907  |000000000807564|OKC 6800            _____^M
                              |0001-01-01|N|1D11|XMS544|2004-03-10|0001-01-01|     |02|00|00|09    |N|        0001-01-01|N|0001-01-01|0001-01-01|9998


text:
Q: ¿Cómo finalizar un release con git flow sin escribir un mensaje? Estoy tratando de automatizar el release de un módulo con jenkins y parte de ello es hacer un release de un determinado módulo o programa.
Estoy usando git flow para hacer los releases pero me topé con el problema de que me pide un mensaje a la hora de finalizar dicho release y por eso no puedo automatizarlo.
Déjenme explicarles mejor con un ejemplo:
Inicio mi release:
git flow release start 1.0.0
//...luego hago otros pasos

Finalizo mi release:
git flow release finish 1.0.0

Acá quiero que NO me salga la siguiente pantalla:
//Línea en blanco para que yo escriba mi mensaje
#
# Write a tag message
# Lines starting with '#' will be ignored.

Cuando escribo el mensaje y guardo, todo sale bien pero quiero alguna forma de poner algún mensaje por defecto o dejarlo en blanco. ¿Hay alguna forma de hacerlo?

A: Puede que esto sea lo que busca ->
git flow release finish 1.0.0 -m 'Su mensaje'
git flow release finish -m 'Su mensaje' 1.0.0
git flow release finish [-FsumpkS]
el de -m
https://github.com/nvie/gitflow/blob/develop/git-flow-release#L194
https://github.com/nvie/gitflow/blob/develop/git-flow-release#L251

el de -f mensajeFile
https://github.com/nvie/gitflow/blob/develop/git-flow-release#L195
https://github.com/nvie/gitflow/blob/develop/git-flow-release#L252


text:
Q: Http Response is not working I have a registration section in which the username and password are send to parse using rest service. That is working fine. In the login section I want to check whether the username and password are registered in the parse, so I'm taking http response but there is some error in my code. The response is not coming back for some reason.
My loginSuccesfull method is below:
private boolean loginSuccesfull() throws ClientProtocolException, IOException {
        // TODO Auto-generated method stub
        InputStream result = null;
        HttpClient httpClient = new DefaultHttpClient();
        HttpGet get = new HttpGet("https://api.parse.com/1/classes/Login?where={"+"\"UserName\""+":"+"\"abc\""+"}");
        HttpResponse response = httpClient.execute(get);
        if (response != null && response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
            BufferedHttpEntity bufferedHttpEntity = new BufferedHttpEntity(response.getEntity());
            result = bufferedHttpEntity.getContent();
            return true;
        }else {
            // insert error handling
            return false;
        }
    }

A: to make a successful HTTP response and handle all exception , use the following Code:

        HttpParams httpParams = new BasicHttpParams();
        ConnManagerParams.setTimeout(httpParams, 10000);
        HttpConnectionParams.setConnectionTimeout(httpParams, 30000);
        HttpConnectionParams.setSoTimeout(httpParams, 30000);

        HttpClient httpClient = new DefaultHttpClient(httpParams);
        HttpPost httpPost = new HttpPost(BASE_URL);

        httpPost.setEntity(new ByteArrayEntity(request.toString()
                .getBytes()));
        HttpResponse httpResponse = httpClient.execute(httpPost);
        HttpEntity httpEntity = httpResponse.getEntity();

        return EntityUtils.toString(httpEntity);

    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
        System.out.println("UnsupportedEncodingException >>>>>>> "
                + e.getMessage());
    } catch (ClientProtocolException e) {
        e.printStackTrace();
        System.out.println("ClientProtocolException >>>>>>> "
                + e.getMessage());
    } catch (ConnectTimeoutException e) {
        Log.e("CONN TIMEOUT", e.toString());
        e.printStackTrace();

    } catch (SocketTimeoutException e) {
        Log.e("SOCK TIMEOUT", e.toString());
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
        System.out.println("IOException >>>>>>> " + e.getMessage());
    } catch (Exception e) {
        Log.e("OTHER EXCEPTIONS", e.toString());
        System.out.println("Exception >>>>>>> " + e.getMessage());
    }

A: The parse server has an inbuilt Login Table we can use this table by adding username and password in that table and follow this to check whether the login is succesfull or not
ParseUser parseUser = new ParseUser();
                parseUser.logInInBackground( mEtUserName.getText().toString()
                        .trim()
                        ,mEtPswd.getText().toString(),new LogInCallback() {
                    @Override
                    public void done(ParseUser arg0, com.parse.ParseException arg1) {
                        if(arg1==null ){
                            startActivity(new Intent(LoginActivity.this,CaptureActivity.class));
                        }
                        else{
                            arg1.printStackTrace();
                            Toast.makeText(LoginActivity.this,"UserName or Password is Incorrect", 0).show();
                        }
                    }
                });

for that we have to first register the username and password in the parse using the following code
HttpPost request = new HttpPost(SERVICE_URI);
            request.addHeader("X-Parse-Application-Id",
                    "e7ynC0ZB1ts5EQVpghywywoUUCNafT4XZnoJO3j5");
            request.addHeader("X-Parse-REST-API-Key",
                    "w9iInpo0kPmzibzjyCkhyjO199tc5V0vqtafL2yW");
            request.addHeader("Content-Type", "application/json");
            // Build JSON string
            JSONStringer TestApp = null;

            try {
                TestApp = new JSONStringer().object().key("username")
                        .value(mStrUname).key("password").value(mStrPswd).key("FullName").value(mStrFullName)
                        .endObject();
            } catch (JSONException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            StringEntity entity = null;

            try {
                entity = new StringEntity(TestApp.toString());
            } catch (UnsupportedEncodingException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            Log.d("****Parameter Input****", "Testing:" + TestApp);
            request.setEntity(entity);
            // Send request to WCF service
            DefaultHttpClient httpClient = new DefaultHttpClient();
            HttpResponse response = null;

            try {
                response = httpClient.execute(request);
            } catch (ClientProtocolException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            Log.d("WebInvoke", "Saving: " + response.getStatusLine().toString());
            // Get the status of web service
            BufferedReader rd = null;
            try {
                rd = new BufferedReader(new InputStreamReader(
                        response.getEntity().getContent()));
            } catch (IllegalStateException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            // print status in log
            String line = "";
            try {
                while ((line = rd.readLine()) != null) {
                    Log.d("****Status Line***", "Webservice: " + line);

                }
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

            return null;
        }


text:
Q: Load scripts after AJAX loads content? I'm using jQuery and YQL to get the content of a website and display a certain element on the page, in this case, the table element. I also have a search function set up using the jQuery QuickSearch plugin.
This works great, and now to the problem...
It seems that the search script is loading before the AJAX content getter gets the content. I think the script then caches the data, so that it's easier to search. Since it's loading after the content is there though, it doesn't search anything and it doesn't work. Is there any way to load the search script AFTER the AJAX content is loaded?
I already attempted calling it via the ready function in jQ:
$(document).ready(function() {

But that still loads before the content is loaded. My AJAX script is below:

A: Not sure I really get the question, but to load a script after the content is loaded with Ajax you could do something like this:
$.ajax({
  url: url,
  data: data,
  success: function() {
     //success loading content
  },
  error: function() {
    //error loading content
  },
  complete: function() {
     $.getScript("/scripts/mysearchscript.js", function() {
          alert('loaded script and content');
     });
  }
});

A: "If .ready() is called after the DOM has been initialized, the new handler passed in will be executed immediately." - http://api.jquery.com/ready/
EDIT
I think I may have misinterpreted your question, sorry.  Are you saying that the search tries to search before the table is fully loaded?  I thought you were trying to search before the page had completed loading.  Have you tried using a callback function attached to your .load(), or just after container.append()?
after load
$('#content').load(url,callSearchFunction());

you can do it much simpler after append
 container.append(justTable);
 callSearchFunction();

A: $('.container').load('yourPage.html',function(){
    //Do whatever you want here
});

You can pass an anonymous function like a parameter on the jquery method .load()
http://api.jquery.com/load/
That function will execute when the ajax request is complete


text:
Q: How to dump (and reload) django allauth social apps data to/from file I am using django 2.0.8,Python 3.5 and django-allauth. I have manually created the social app data using the

Home › Social Accounts › Social applications

menu in the django admin page. However, I want to automate this process (to eliminate manually creating the social apps via the django admin), as I will be deploying the website via Docker, on a virtual machine.
I know python manage.py dumpdata allows one to dump data from a django project, but it is not clear how to dump only the data relevant for django-allauth - namely:

*

*site information (sites app)

*allauth social applications

how do I use python manage.py dumpdata/load to dump/load this data?

A: According to the documentation:

Outputs to standard output all data in the database associated with the named application(s).
If no application name is provided, all installed applications will be dumped.

You can pass allauth as application name, you can even select which model you want to dump and then load those fixtures using loaddata.
Take a look at examples here and here


text:
Q: Get (last) CUPS printer error programmatically I am setting up an unattended, automated printing setting. At some point the printer might run out of paper, ink, or experience some other error. I have a Canon iP4500 which on macOS communicates these kinds of errors back to the user interface. With Ubuntu/Lubuntu I have not seen such an interface.
Is there any way to get the (last) CUPS error programmatically?
I've tried

*

*lpstat -p
(which will say something like "Printing page 1, 36%" when there is no paper)

*lpc status

*lpq
(which says "iP4500-series is ready and printing")

*and dug around http://localhost:631/printers/Canon-iP4500-series, i.e. the CUPS web interface

I really don't care how "programmatically" is implemented, i.e. Python, Bash, parsing the CUPS web interface -- anything really. It just needs to be automated.

A: For python, there is the pycups lib. I needed to install libcups2-dev (on Debian 9) to successfully install and compile it. The PyPi page example (https://pypi.org/project/pycups/) is pretty straightforward:
import cups
conn = cups.Connection ()
printers = conn.getPrinters ()
for printer in printers:
    print printer, printers[printer]["device-uri"]

For what you need, I believe that the relevant info is:
printer-info: Printer name
printer-state: numeric representation of the state.
printer-state-message: a string, informing the state.
printer-state-reasons: a list of strings.


text:
Q: Permanent sleep in the function of linux network driver? In a linux network driver:
ssize_t device_read(struct file *file,char *buffer,size_t length, loff_t *offset)
{
#ifdef _DEBUG
int i;
#endif
struct ed_device *edp;
DECLARE_WAITQUEUE(wait,current);
edp = (struct ed_device *)file->private_data;
add_wait_queue(&edp->rwait,&wait);
for(;;){

    set_current_state(TASK_INTERRUPTIBLE);
    if ( file->f_flags & O_NONBLOCK)
        break;
    if ( edp->tx_len > 0)
        break;

    if ( signal_pending(current))
        break;
printk("Start going to sleep\n");
    schedule();
printk("return from scheduler\n");
}
set_current_state(TASK_RUNNING);
remove_wait_queue(&edp->rwait,&wait);

spin_lock(&edp->lock);

if(edp->tx_len == 0) {
     spin_unlock(&edp->lock);
     return 0;

}else
{...}
}

Once the function read(fd_tx, tx_ptr, BUFFER_SIZE-1) is called in a simple application, the kernel process device_read goes into sleep and info Start going to sleep is printed . It can never be awaked unless the application is ceased, then the info return from scheduler is printed.
Why the process cannot be awaked by wake_up_interruptible(&ed[ED_TX_DEVICE].rwait) in other function?


text:
Q: Error Msg: A new password should be set for this login without specifying the old password Good day,
 I have a SQL Server job that keeps on failing. As per checking the error msg states that :

A new password should be set for this login without specifying the old
  password.

I did some research and all the resources I've found suggest to reset the SQL server login password since it might be expired. I looked at the properties of the SQL Server Login pointed by the error but enforce password expiration is not activated. I would like to know what is the posible cause of this error. Hope you could help. Thanks.


text:
Q: AngularJS: How to edit parts of a datetime from different html controls I would like to have 2 textboxes assigned to the same ng-model initialized to Date.now() and allow them to be edited by the user.
My template looks like:

  <input type="text" ng-model="date | date:'yyyy-MM-dd'" />
  <input type="text" ng-model="date | date:'HH:mm'" />

  <button ng-click="submit()">Submit</button>

    {{ date }}

And my controller looks like:
angular.module('app', []).controller('MainCtrl', function($scope) {
  $scope.show = false;
  $scope.date = new Date(Date.now());

  $scope.submit = function () {
    $scope.show = true;
  }
});

Plunker: http://plnkr.co/edit/d2slQW6pDTLM4KTo
In my example, the textboxes are not editable, and I get a console error stating the expression is non-assignable.
How can I modify this example to allow the date parts to be modifiable?

A: If you're willing to use date and time inputs instead of text, this is very easy to do.
<input type="date" ng-model="date" />
<input type="time" ng-model="date" />

Because they're bound to the same Date instance, leap days daylight savings (where a day might be 23 or 25 hours) are supported.
If you don't like the native date and time inputs and want some more control over the style/functionality and consistent UI across devices, you can try Kendo UI's DatePicker and TimePicker widgets. They both have AngularJS support and are included in the free offering called Kendo UI Core.
And if you want to avoid having milliseconds in your time picker, make sure they're stripped from whatever Date instance is bound to your scope property.
$scope.date = new Date(Date.now());
$scope.date.setMilliseconds(0)

As an aside, I don't believe filters work in ng-model expressions, which is probably the source of your error message.


text:
Q: npm module 'bcrypt' is not installing in windows 10 and throwing error in sails I have a sails project which is using 'bcrypt' module and when i am trying to install it using command -
npm install --save bcrypt

but it gives me following error !!!. Also i am using npm version @3.6.0 and node version @5.6.0.Am not able to resolve this error shown below :
 > bcrypt@0.8.5 install C:\Users\vikas\Documents\batua-web\node_modules\bcrypt
 > node-gyp rebuild
 > C:\Users\vikas\Documents\batua-web\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
 > C:\Users\vikas\Documents\batua-web\node_modules\bcrypt\build\bcrypt_lib.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
> gyp ERR! build error
> gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
> gyp ERR! stack     at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
> gyp ERR! stack     at emitTwo (events.js:100:13)
> gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
> gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
> gyp ERR! System Windows_NT 10.0.10586
> gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-     gyp.js" "rebuild"
> gyp ERR! cwd C:\Users\vikas\Documents\batua-web\node_modules\bcrypt
> gyp ERR! node -v v5.6.0
> gyp ERR! node-gyp -v v3.2.1
> gyp ERR! not ok
> npm ERR! Windows_NT 10.0.10586
> npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "bcrypt"
> npm ERR! node v5.6.0
> npm ERR! npm  v3.6.0
> npm ERR! code ELIFECYCLE
> npm ERR! bcrypt@0.8.5 install: `node-gyp rebuild`
> npm ERR! Exit status 1
> npm ERR!
> npm ERR! Failed at the bcrypt@0.8.5 install script 'node-gyp rebuild'.
> npm ERR! Make sure you have the latest version of node.js and npm installed.
> npm ERR! If you do, this is most likely a problem with the bcrypt package,
> npm ERR! not with npm itself.
> npm ERR! Tell the author that this fails on your system:
> npm ERR!     node-gyp rebuild
> npm ERR! You can get information on how to open an issue for this project with:
> npm ERR!     npm bugs bcrypt
> npm ERR! Or if that isn't available, you can get their info via:
> npm ERR!     npm owner ls bcrypt
> npm ERR! There is likely additional logging output above.
> npm ERR! Please include the following file with any support request:
> npm ERR!     C:\Users\vikas\Documents\batua-web\npm-debug.log

A: I tried another way to fix this issue on Window 10. I hope it can help you.
1st step: run Powershell with Administrator role (Click right mouse on Powershell and choose "Run As Administrator")
2nd step: install native addon build tool and Windows-Build-Tools

 npm install -g node-gyp
 npm install --g --production windows-build-tools

3rd step: change directory to current project
4th step: install bcrypt

 npm install bcrypt

A: From the logs I see that you are using windows operating system.
Here on this github page of node-gyp, it says you need to have the following

*

*On Windows:

*

*Python ([v2.7.10][python-v2.7.10] recommended, v3.x.x is not supported)

*

*Make sure that you have a PYTHON environment variable, and it is set to drive:\path\to\python.exe not to a folder

*Windows XP/Vista/7:

*

*Microsoft Visual Studio C++ 2013 ([Express][msvc2013] version works well)

*If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first

*If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1]

*Windows 7/8:

*

*Microsoft Visual Studio C++ 2013 for Windows Desktop ([Express][msvc2013] version works well)

*Windows 10:

*

*Install the latest version of npm (3.3.6 at the time of writing)

*Install Python 2.7 from https://www.python.org/download/releases/2.7/ and make sure its on the System Path

*Install Visual Studio Community 2015 Edition. (Custom Install, Select Visual C++ during the installation)

*Set the environment variable GYP_MSVS_VERSION=2015

*Run the command prompt as Administrator

*$ npm install (--msvs_version=2015) <-- Shouldn't be needed if you have set GYP_MSVS_VERSION env

*If the above steps have not worked or you are unsure please visit http://www.serverpals.com/blog/building-using-node-gyp-with-visual-studio-express-2015-on-windows-10-pro-x64 for a full walkthrough

*All Windows Versions

*

*For 64-bit builds of node and native modules you will also need the [Windows 7 64-bit SDK][win7sdk]

*You may need to run one of the following commands if your build complains about WindowsSDKDir not being set, and you are sure you have already installed the SDK:

For others operating system you can visit the link to see their dependencies.

A: Install python in your windows machine this will definitely solve this problem.

A: First run command to install python bcoz bcrypt is an addon which need to be compiled
sudo apt-get install build-essential python2.7

or
sudo apt install build-essential

then run
npm install bcrypt


text:
Q: Background-image not appearing on site copy, despite identical source & CSS files? Can anyone tell me why this site has a background-image on the header, and this site does not - despite virtually identical source and CSS files?
In the first one, the style is being picked up correctly, and in the second it isn't. But there is no obvious reason why this is the case.
Help!
Thank you :)

A: The selector that's trying to set the background image looks like this:
.logo-image #header #header-left

Since #header is not a descendent of .logo-image, those styles do not get applied.  If, however, the selector was changed to just:
#header #header-left

or even
#header-left

Then it should work (assuming the image URL is good).
Update:
I didn't see the .logo-image class on the body before, but now it's there.  There may have been some sort of caching (wink) issue in place.


text:
Q: Dynamically created child component need to access parent function I have 3 TS files as below: 1) Parent-Component.ts 2) Child-Component.ts 3) Service.ts
We have a button click event in Parent-Component.ts which call the function in Service.ts and this function create the Child Component Dynamically as code given below.
Parent-Component.html:

{{ i18n.common + 'Filter' | dynamicTranslate }}

<button type="button" **(click)="appendAdditionalFilter()" **>
</button>      {{ 'Add Filter' }}
<button type="button" class="btn btn-primary ml-2"
(click)="appendFilterFromService()">{{ i18n.common + 'Apply Filter' | dynamicTranslate }}
</button>

when Add Filter is clicked function appendAdditionalFilter() is called from Parent-Component.ts  which call Service.ts to create child component dynamically.
Parent-Component.ts:
@ViewChild('filterCriteria', { read: ViewContainerRef, static: false})
filterCriteriaContainer: ViewContainerRef;
appendAdditionalFilter() {
this.filterCriteriaContainer = this.filterGridService
.addFilter(this.filterCriteriaContainer, this.MetaData, this.i18n.Test1,
this.Test2);
}

Service.ts:
addFilter(
filterCriteriaContainer: ViewContainerRef,
MetaData: Array<FieldMetaDataDto>,
Test1: string,
Test2?: number,
filter?: FilterDto,
): ViewContainerRef {
const comp = this.componentResolver.resolveComponentFactory(ChildComponent);
const filterCriteria = filterCriteriaContainer.createComponent(comp);

filterCriteria.instance.ref = filterCriteria;

filterCriteria.instance.translationKeyBase = Test1;

filterCriteria.instance.filterMetadata = MetaData;
filterCriteria.instance.dataTarget = Test2;

return filterCriteriaContainer;
}

Now we have a Remove button click event on Child Component which would need to call function appendFilterFromService() in Parent-Component.ts.
Child-Component.html:

<button (click)="remove()" type="button" class="btn btn-action btn-small">

</button>
{{i18n.common + 'Remove Filter' | dynamicTranslate }}

Child-Component.ts:
ref: ComponentRef<ChildComponent>;
remove(){
this.ref.destroy();
//Need to call Parent-Component.ts function appendFilterFromService() here//
}

Any Help would be appreciated.

A: Since your service is expecting few other parameters from the parent component, one possible way would be to raise an event from child component which will be captured in the parent.
Your child component should have an @Output binding like this:
  @Output() removeEvent = new EventEmitter<string>();

in child's html the usual click binding for "Remove" button:
<button type="button" (click)="onRemove()">Remove</button>

the line which will emit the event in onRemove event handler:
  onRemove(): void {
    this.removeEvent.emit('remove');
  }

parent's html should look like this to specify which method should be called once a child component is emitting an event:
  <app-child (removeEvent)="onRemoveFromChild($event)"> </app-child>

then you are now in parent component triggering the whole flow from child component:
  onRemoveFromChild(event: string): void {
    this.appendAdditionalFilter();
  }

Simplified Stackblitz for reference.
Update
In case of a dynamic component once you create it you will get back a reference, something like this:
const componentRef = this.container.createComponent(ChildComponent);

Using that reference you can acccess the "instance" and on that the event with @Output something like this:
componentRef.instance.removeEvent.subscribe((event: string) => {
  this.service.addFilter();
});

Make sure to unsubscribe from these events once component is destroyed.
Forked new Stackblitz


text:
Q: char *str[ ] pass by reference not working I am passing a char *str[] in help function and then adding contents to it but in main function its values are unchanged.
From main i am calling letterCombinations function and it calls help function
In help I am editing valuees of char * str[] wwhihc are changed there but are not reflected in letter Combinations function
Please help me why is it not working
help(char *str[],char* curr,int index,char* digits,char** a,int *k)
        {
            if(strlen(curr)==strlen(digits))
            {
                printf("%d",*k);
                 str[*k]=(char*)malloc(strlen(digits)+1);
                 str[*k]=curr;
                printf("%s %s %d\n",curr,str[*k],*k);

                *k=*k+1;

                return ;
            }

            int i;

            char* loop=a[digits[index]-'0'];

            int l=strlen(loop);
            for(i=0;i<l;i++)
            {
                curr[index]=loop[i];

                help(str,curr,index+1,digits,a,k);
                curr[index]='\0';
            }
        }
  char** letterCombinations(char* digits, int* returnSize) {
            char *str[100];
              int i=0;
            char* curr=malloc(sizeof(strlen(digits)+1));
            char** a=(char**)malloc(10*sizeof(char*));
          int siz=0;
            a[0]="";
            a[1]="";
            a[2]="abc";
            a[3]="def";
            a[4]="ghi";
            a[5]="jkl";
            a[6]="mno";
            a[7]="pqrs";
            a[8]="tuv";
            a[9]="wxyz";

            help(str, curr, 0, digits,a,&siz);

            printf("  %d",siz);
            for(i=0;i<siz;i++)
            {
                printf(" s   %s",str[i]);
            }
           // *returnSize=siz;
            return str;

        }

A: If you compile your code you should see warnings such as:
warning C4172: returning address of local variable or temporary
warning C4100: 'returnSize' : unreferenced formal parameter

returning address of local variable or temporary is the warning which explains your behaviour.
In your code:
char** letterCombinations(char* digits, int* returnSize) {
    char *str[100];
   ...
    return str;
}

You create an array on the stack, str.  When you return from letterCombinations, the variable goes out of scope and the stack memory location gets cleaned up.  ie the memory address used by str is no longer valid.
You could change so that caller passes in their own char* variable which would fix this issue.  Alternatively, you could malloc str and then when you return from the function, the memory location still exists.  But the caller would have to free the memory location - which is messy.
After fixing that ... then move onto the next bug.
The next thing I notice is that in the help function you have:
if (strlen(curr) == strlen(digits))

but curr is not initialised.  Fix that next.  then move onto your next bug.
You should step through each line thinking through how your variables will be populated in each line.


text:
Q: wxPython: How can I display information from a database with information from a url? I am doing an assignment for my python class and I cannot figure out where to go from here. I have tried asking, but did not get an answer. I made a GUI using wxPython to display stock information from a database, along with the price information from a url for each company(each company is represented by a different symbol)
When I run the program and hit the display button, The company name, symbol, and purchase price show in the correct list section, but the values for the "Shares" are displayed in the "current price" section.
I'm not sure what I'm supposed to do to display the current price and how to calculate the Gain/loss and have it displayed in the correct spot.
This is the url with my token
'https://finnhub.io/api/v1/quote?symbol=' + 'c95o1aiad3iek697puk0'
This is the table named 'dow_stock' from the database named 'tech_stocks'

This is the code I have so  far:
import wx
import sqlite3 as db
import datetime
import requests

class MyDialog(wx.Dialog):

    def __init__(self):
        wx.Dialog.__init__(self, None, title="Dialog")

        lbl = wx.StaticText(self, label='Read Data', pos=(120, 10))

        self.com = wx.TextCtrl(self, -1, '', pos=(30, 40))
        wx.StaticText(self, -1, 'Company', pos=(150, 40))

        self.sym = wx.TextCtrl(self, -1, '', (30, 80))
        wx.StaticText(self, -1, 'Symbol', (150, 80))

        self.pur = wx.TextCtrl(self, -1, '', (30, 120))
        wx.StaticText(self, -1, 'Purchase Price', (150, 120))

        self.cur = wx.TextCtrl(self, -1, '', (30, 160))
        wx.StaticText(self, -1, 'Current Price', (150, 160))

        self.sha = wx.TextCtrl(self, -1, '', pos=(200, 40))
        wx.StaticText(self, -1, 'Shares', pos=(320, 40))

        self.gl = wx.TextCtrl(self, -1, '', pos=(200, 80))
        wx.StaticText(self, -1, 'Gain/Loss', pos=(330, 80))

        okBtn = wx.Button(self, id=wx.ID_OK, pos=(135, 200))

class DataFrame(wx.Frame):
    def __init__(self):
        super().__init__(None, id=-1, title='read data', size=(680, 520))

        self.companyNames = { 'MMM': '3M', 'AAPL': 'Apple Inc.', 'BA': 'Boeing',
                              'CAT': 'Caterpillar Inc.', 'CSCO': 'Cisco Systems',
                              'HON': 'Honeywell', 'IBM': 'IBM', 'INTC': 'Intel',
                              'MSFT': 'Microsoft'}

        panel = wx.Panel(self, -1)

         # Top Widgets
        self.date = wx.StaticText(panel, -1, "Today's Date: ")
        self.gl = wx.StaticText(panel, -1, "Total: ")

        # List Control
        self.list = wx.ListCtrl(panel, -1, style=wx.LC_REPORT, size=(590, 280))

        font1 = wx.Font(10, wx.FONTFAMILY_TELETYPE, wx.NORMAL, wx.NORMAL, False, u'Consolas')
        self.list.SetFont(font1)  # use a monospace font
        self.list.InsertColumn(0, 'Company', width=100)
        self.list.InsertColumn(1, 'Symbol', width=80)
        self.list.InsertColumn(2, 'Purchase Price', width=110)
        self.list.InsertColumn(3, 'Current Price', width=110)
        self.list.InsertColumn(4, 'Shares', width=80)
        self.list.InsertColumn(5, 'Gain/Loss',  wx.LIST_FORMAT_LEFT, width=110)

        # Buttons
        display = wx.Button(panel, -1, 'Display', size=(-1, 40))
        cancel = wx.Button(panel, -1, 'Cancel', size=(-1, 40))
        display.Bind(wx.EVT_BUTTON, self.OnDisplay)
        cancel.Bind(wx.EVT_BUTTON, self.OnCancel)

        # Top Sizer
        topRowHsizer = wx.BoxSizer(wx.HORIZONTAL)
        topRowHsizer.Add(self.gl, 0, wx.ALIGN_CENTER | wx.ALL, border=10)

        #Button Sizer
        btnRowHsizer = wx.BoxSizer(wx.HORIZONTAL)
        btnRowHsizer.Add(display, 0, wx.ALIGN_CENTER | wx.ALL, border=15)
        btnRowHsizer.Add(cancel, 0, wx.ALIGN_CENTER | wx.ALL, border=15)

        #Main Sizer
        mainBoxVsizer = wx.BoxSizer(wx.VERTICAL)
        mainBoxVsizer.Add(topRowHsizer, 0, wx.ALIGN_CENTER | wx.ALL, border=15)
        mainBoxVsizer.Add(self.date, 0, wx.ALIGN_CENTER | wx.BOTTOM, border=8)
        mainBoxVsizer.Add(self.list, 0, wx.ALIGN_CENTER | wx.ALL, border=15)  # add list ctrl & buttons to sizers
        mainBoxVsizer.Add(btnRowHsizer, 0, wx.ALIGN_CENTER | wx.ALL, border=15)

        panel.SetSizer(mainBoxVsizer)

        self.Centre()

    def OnCancel(self, event):
        self.Close() # exit program

    def OnDisplay(self,event):
        self.list.DeleteAllItems()
        con = db.connect('tech_stocks.db')
        cur = con.cursor()

        sqlite_select_query = """SELECT company, symbol, purchase_price, shares FROM dow_stocks"""
        cur.execute(sqlite_select_query)
        records = cur.fetchmany(9)
        for row in records:
            self.list.Append(row)

        cur.close()
        con.close()


text:
Q: Embed Web Page in Livecode I just started using Livecode which seems to be really easy to work. I wished to know i there is any way as how I would be able to embed a webpage(live webpage such as google.com) on to the app. So when I create the app(standalone app), the user would actually be working with a web app. I see this would be an easy way to convert a web app into a mobile app(iOs and Android).
Edit : Till now this is what I am doing :

*

*Create a new mainstack.

*Click on code(on the top menu), that takes me to the stack code. It is where I am pasting the code below that Mark has mentioned.

Not working. What am I doing wrong?

A: This code creates a browser.
mobileControlCreate "browser"
put the result into gBrowserID
mobileControlSet gBrowserID,"url","http://www.google.com"
mobileControlSet gBrowserID,"visible",true
mobileControlSet gBrowserID,"rect,the rect of this cd

Make sure to read the entries about these commands in the dictionary. I didn't include error checking. You need to declare gBrowserID as a global variable. That will allow you to delete the browser control when you open a different card or stack.

It seems you are thinking that above code would just run. It won't, because it needs to be placed inside a handler. A possibility is a mouseUp handler:
on mouseUp
  // script goes here
end mouseUp


text:
Q: Behaviour of back button on ajax and non-ajax page with the same url I have got two versions of content (ajax and non-ajax) at one url. One version is with renderred layout for non-ajax requests and the second ajax-version is just the content itself without the layout. The problem is that browsers (chrome/firefox) seems not to differentiate between ajax/non-ajax requests when fetching pages from cache If I click on back button. There are situations where I load the non-ajax version then I do some browsing and then when I return back (by clicking back button repeatedly) I get the ajax ("unformatted") version because that is the version stored currently in the cache. Is this a known issue? Do I need to differentiate ajax vs non-ajax requests in urls e.g. by ?ajax=1?

A: You can set the ajax function to not cache the call. That way when a user hits back, it will render the page layout. If you are using jquery it would look something like this:
$.ajax
  type: "GET"
  dataType: "json"
  cache: false
  url: self.url
  success: (data) ->
    #do something


text:
Q: Generator Brownian Motion I'm referring to the construnction of the generator of the Brownian Motion.
I marked the points I'm referring in the following here.

*

*Why do we need to consider $C_0^2$?

*Where did we show that $B$ is a $C_0$-process?

I only see that for $f \in C_0^2 \subseteq C_0 \Rightarrow P_tf \in C_0^2$ but there could be $f \in C_0$ such that $P_tf \notin C_0$, couldn't?
($C_0$-processes are defined as the Markov processes which generate a
  $C_0$-Semigroup (Def))

*Using the Taylor-formula at the green marked lines it seems that $B^i_h=x^i$. Why is this the case?

*Why is $C_0^2 \subseteq D(A)$ ?

$D(A) := \left\{ f\in L : \operatorname*{\mathit{s}-lim}_{h\downarrow 0} \frac 1 h [P_h f-f] \text{ exists in $L$}\right\}$ for a semigroup $P_tf$ of linear contractions on a Banach space $L$.


text:
Q: Bot framework composer Can anyone help me with the publishing procedure of a sample bot that was created by using bot composer into the On-premise environment ? Have not found much apart from publishing into Azure in the Microsoft documentation..
Thanks.


text:
Q: Manipulate IE with VBA and a modal form I'm trying to automate the uploading of an excel document to a particular webpage. I can't link it as it requires an account. There is a form with a an  browse section (of type=file so I can't just set the value) and an upload button that uses the value of that input.
I can navigate to click the browse button, and I can click the upload button, but when I click the browse button a file explorer window called "Choose File to Upload" pops up and means I can't interact with any other IE window and pauses my VBA code until it is closed, which means I can't automatically pass a file path to it.
The relevant HTML on the page is
<form method="post" name="uploadSkillForm" ENCTYPE="multipart/form-data"  action='uploadSkills.do?operation=upload'>

                    <input type="file" name="uploadedFile"  size="34" id="filePath" class="buttonStyle" style="height:20px"/>
                    <input type="button" name="upload" class="buttonStyle" value="Upload" onclick="javascript:fnUploadData()">

Ideally I just want to be able to keep the VBA running and interact with the dialog box to put in the file path, but any way to get the value set to the path would do.
The VBA currently just opens the webpage and clicks the button so there is no point posting it.
Any help would be really appreciated!

A: So after much digging I decided that I had to just have VBA run an external script that checks for the window and input the file name then presses enter. Currently the issue is that it focuses on the file window so if you aren't in the right folder it doesn't work, but if you are it will select the right file and click open!
The vba:
Dim retval As Variant
retval = Shell("PowerShell .'" & path & "upload_tester.ps1 file_name'", 1)

where the path is where it is stored, upload_tester.ps1 is the script name and file_name is to pass to the script to input to file browser.
The script:
param(
[Parameter(Mandatory=$true)][string]$a
)

$wshell = new-object -com wscript.shell

while(! $wshell.appactivate("Choose File to Upload")){
start-sleep -milliseconds 100
}

$wshell.appactivate("Choose File to Upload")
start-sleep -milliseconds 500;
$wshell.sendkeys($a)
$wshell.sendkeys("{ENTER}")

This will check until the file explorer window is open, type in the file name to match it, and then press enter to select it. If anyone knows how to get it to focus on the text box part rather than the file explorer part that would be great but otherwise this works for my purpose!


text:
Q: p4v cannot see the default tree in pending tab I am new to P4V (perforce) while working with this, i cannot see the default folder in pending tab as i cannt drag any files for editing.
Thanks

A: Have you created a workspace? Open workspaces tab > right click.
Also make sure your connection is set up properly.


text:
Q: Both String look same but dont equal i've same list internal and external comment list both list content look same but it dose not work. see the example below.
List<String> internalComment = Arrays.asList(
    "[~abhijit.karanjkar] [~aiyer][~pdewan]How can we test this if the LDAP configuration is set to false? Is it necessary this be set to false? If so why? Is there a workaround for testing?nnCurrently this would fail any meta plkayak tests in automation as well as manual test performed by webomates or in-house specific testing.");
List<String> externalComment = Arrays.asList(
    "[~abhijit.karanjkar] [~aiyer][~pdewan]How can we test this if the LDAP configuration is set to false? Is it necessary this be set to false? If so why? Is there a workaround for testing?nnCurrently this would fail any meta plkayak tests in automation as well as manual test performed by webomates or in-house specific testing.");

Set<String> newComment = new HashSet<>();
externalComment.forEach(extComm -> {
    if (!internalComment.contains(extComm)) {
        newComment.add(extComm);
    }
});

when i debug and found that one extra space is added which i highlighted as below : why one extra space is added and how to remove it?
internalComment
[[, ~, a, b, h, i, j, i, t, ., k, a, r, a, n, j, k, a, r, ],  , [, ~, a, i, y, e, r, ], [, ~, p, d, e, w, a, n, ], H, o, w,  , c, a, n,  , w, e,  , t, e, s, t,  , t, h, i, s,  , i, f,  , t, h, e,  , L, D, A, P,  , c, o, n, f, i, g, u, r, a, t, i, o, n,  , i, s,  , s, e, t,  , t, o,  , f, a, l, s, e, ?,  , I, s,  , i, t,  , n, e, c, e, s, s, a, r, y,  , t, h, i, s,  , b, e,  , s, e, t,  , t, o,  , f, a, l, s, e, ?,  , I, f,  , s, o,  , w, h, y, ?,  , I, s,  , t, h, e, r, e,  , a,  , w, o, r, k, a, r, o, u, n, d,  , f, o, r,  , t, e, s, t, i, n, g, ?, n, n, C, u, r, r, e, n, t, l, y,  , t, h, i, s,  , w, o, u, l, d,  , f, a, i, l,  , a, n, y,  , m, e, t, a,  , p, l, k, a, y, a, k,  , t, e, s, t, s,  , i, n,  , a, u, t, o, m, a, t, i, o, n,  , a, s,  , w, e, l, l,  , a, s,  , m, a, n, u, a, l,  , t, e, s, t,  , p, e, r, f, o, r, m, e, d,  , b, y,  , w, e, b, o, m, a, t, e, s,  , o, r,  , i, n, -, h, o, u, s, e,  , s, p, e, c, i, f, i, c,  , t, e, s, t, i, n, g, .]
externalComment
[[, ~, a, b, h, i, j, i, t, ., k, a, r, a, n, j, k, a, r, ],  , [, ~, a, i, y, e, r, ], , [, ~, p, d, e, w, a, n, ], H, o, w,  , c, a, n,  , w, e,  , t, e, s, t,  , t, h, i, s,  , i, f,  , t, h, e,  , L, D, A, P,  , c, o, n, f, i, g, u, r, a, t, i, o, n,  , i, s,  , s, e, t,  , t, o,  , f, a, l, s, e, ?,  , I, s,  , i, t,  , n, e, c, e, s, s, a, r, y,  , t, h, i, s,  , b, e,  , s, e, t,  , t, o,  , f, a, l, s, e, ?,  , I, f,  , s, o,  , w, h, y, ?,  , I, s,  , t, h, e, r, e,  , a,  , w, o, r, k, a, r, o, u, n, d,  , f, o, r,  , t, e, s, t, i, n, g, ?, n, n, C, u, r, r, e, n, t, l, y,  , t, h, i, s,  , w, o, u, l, d,  , f, a, i, l,  , a, n, y,  , m, e, t, a,  , p, l, k, a, y, a, k,  , t, e, s, t, s,  , i, n,  , a, u, t, o, m, a, t, i, o, n,  , a, s,  , w, e, l, l,  , a, s,  , m, a, n, u, a, l,  , t, e, s, t,  , p, e, r, f, o, r, m, e, d,  , b, y,  , w, e, b, o, m, a, t, e, s,  , o, r,  , i, n, -, h, o, u, s, e,  , s, p, e, c, i, f, i, c,  , t, e, s, t, i, n, g, .]