text:
Q: BackboneJS + RequireJS allow view to act on a collection using global event dispatcher Update: Problems solved, case closed.

I'm still having problems getting one part of my code to work.
My view now listens to the collection for updates, and what should happen is:

*

*ListView listens to Results Collection

*Results are synced

*ListView creates an ItemView for each Result

*ListView (ul) appends each ItemView (li)

Everything seems to work fine, up until the final step.
The function in ListView that is supposed to add the results to a list does not have access to the ListView's element.
I can create an ItemView, and retrieve it's element "<li>", but the ListView's "<ul>" cannot be referred to within the function.
Sample code bits from ListView:
el: $('.result-list'),

initialize: function() {
   this.listenTo(this.collection, 'add', this.addOne);
},

addOne: function(result) {
   view = new ItemView({ model: result });
   this.$el.append(view.render().el);
},

In the above code, the variable view exists, as does it's element, but "this" doesn't refer to the ListView anymore.

Problem below solved
What I'm trying to accomplish is having a View module (search) able to trigger an event in a Collection (results).
When the Search View is submitted, it should pass the input field to the Collection's fetch method to retrieve results from the server. Currently, I can trigger a function from the View, but the function does not have access to any of the Collection's methods.
Previously, I had the View/Collection refer to each other directly by their variable names.
Since I have separated the code into modules, the View/Collection cannot access each other directly anymore.
Here is some of the code: (written in Coffeescript)
app.coffee - global_dispatcher is applied to Backbone
define [
    'jquery'
    'underscore'
    'backbone'
    'cs!router'
], ($, _, Backbone, Router) ->
    # global_dispatcher added to all Backbone Collection, Model, View and Router classes
    dispatcher = _.extend {}, Backbone.Events, cid: 'dispatcher'
    _.each [ Backbone.Collection::, Backbone.Model::, Backbone.View::, Backbone.Router:: ], (proto) ->
        _.extend proto, global_dispatcher: dispatcher

    new Router()

router.coffee - This is where I'm having trouble. The function for 'getResults' is triggered, but the collection 'results' is not accessible from here.
define [
    'backbone'
    'cs!views/resuls/list'
    'cs!views/results/search'
    'cs!collections/results'
], (Backbone, ListView, SearchView, Results) ->
    Backbone.Router.extend
        routes:
            # URL routes
            '': 'index'

        index: ->
            results = new Results
            new ListView { model: results }
            new SearchView

            @global_dispatcher.bind 'getResults', (data) ->
                console.log results

search.coffee - View which triggers the event, it will successfully trigger the event and pass the correct arguments.
define [
    'jquery'
    'backbone'
], ($, Backbone) ->
    Backbone.View.extend
        events:
            'submit #search-form': 'submit'

        submit: (evt) ->
            evt.preventDefault()

            phrase = @.$('input').val()
            @.$('input').val('')

            args = name: phrase

            @global_dispatcher.trigger 'getResults', args

A: If I'm understanding your problem correctly it's not hard to solve.  Here's some dummy code to illustrate:
var Results = Backbone.Collection.extend();
var Search = Backbone.View.extend({
    someEventHandler: function() {
        // The next line accesses the collection from the view
        this.collection.fetch();
    }
});
var results = new Results();
var search = new Search({collection: results});

If you want your view to do something after the results come back, just bind an event handler on the collection:
var Search = Backbone.View.extend({
    fetchResposne: function() { /* do something*/},
    someEventHandler: function() {
        // The next line accesses the collection from the view
        this.collection.on('sync', this.fetchResponse);
        this.collection.fetch();
    }
});


text:
Q: Providing Default value to username field in user_register_form drupal 7 /**
 * Implements hook_form_alter()
 */
function voen_registration_form_alter(&$form, &$form_state, $form_id) {
  switch($form_id){
    case 'user_register_form':
      $form['account']['name']['#type'] = 'hidden';
      array_unshift($form['#validate'],'_voen_registration_custom_validate');
      array_unshift($form['#submit'],'_voen_registration_generate_username');
      break;
  }
}

function _voen_registration_generate_username(&$form, &$form_state){
  drupal_set_message('Function Running');
}

/**
 * Since the validation functions runs before submit
 * We are assigning value to the username field so that it passes
 * the default validation function
 */
function _voen_registration_custom_validate(&$form, &$form_state){
  $form_state['values']['name'] = 'Abc Name';
}

Hi, Thy goal i want to achieve from the above code is that i want to hide the username field from the registration form and instead i want to concatenate the first and last name to make username by code before it goes to database.
However the problem is that the default validation of the user_register_form occur before my any code. So i am trying to invoke my custom validation method before the default validation of user_register_form so that it sets the default value of username field to ABC Name.
But still now when i submit the form it shows me the error of username is required.
How can i fix this. I have to do this via code not any other module.

A: Okay so i fix it by setting the #needs_validation attribute for the username field to false
$form['account']['name']['#needs_validation'] = false;

redpajama_set_name: RedPajamaStackExchange


text:
Q: Filter Visualforce List Dynamically Using Picklist I am trying to create a visualforce page that has a list of field values in a table that uses a picklist that on change will reRender the list by filtering by a specific field value. My problem is that, I can't seem to connect the picklist value with the field in the table that I want filtered. Can someone show me how I could fix this? Thanks!
Controller
    public with sharing class DynamicCasesExtension {

    public Case c { get; set; }
    public String objectName { get; set; }
    public List<String> objectFields { get; set; }
    public List<Case> SObjectListToShow { get; set; }

    public DynamicCasesExtension(){
        objectName = 'Case';
        SObjectListToShow = getSObjectList();
    }

    // Getting field list for the sObject
    public List<Case> getSObjectList(){
        objectFields = new List<String>();
        Map<String, Schema.SObjectType> globalDescription = Schema.getGlobalDescribe();
        Schema.sObjectType sObjType = globalDescription.get(objectName);
        Schema.DescribeSObjectResult res = sObjType.getDescribe();

        Map<String , Schema.SObjectField> mapFieldList = res.fields.getMap();
        for(Schema.SObjectField field : mapFieldList.values())
        {
            Schema.DescribeFieldResult fieldResult = field.getDescribe();
            if(fieldResult.isAccessible() && (fieldResult.getName() == 'CaseNumber' || fieldResult.getName() == 'Assigned_To__c' || fieldResult.getName() == 'Subject' || fieldResult.getName() == 'Priority' || fieldResult.getName() == 'Status' || fieldResult.getName() == 'CreatedDate'))
            {
                objectFields.add(fieldResult.getName());
            }
        }

        //Building Query with the fields
        Integer i = 0;
        String fieldsToFetch = '';
        Integer len = objectFields.size();

        for(String temp: objectFields){
            if(i==len-1){
                  fieldsToFetch = fieldsToFetch + temp;
            } else {
                  fieldsToFetch = fieldsToFetch + temp + ',';
            }
            i++;
        }

        ID MerchantTypeRecordType = [SELECT Id FROM RecordType WHERE sObjectType = 'Case' AND DeveloperName = 'Merchant_Support' LIMIT 1].id;
        String caseStatus = ApexPages.currentPage().getParameters().get('c.Status');

        String qryStr = 'Select ' + fieldsToFetch + ' From ' + objectName + ' WHERE (RecordTypeId = :MerchantTypeRecordType and Case.Status = ' + caseStatus + ') Limit ' + 20;
        return Database.Query(qryStr);

    }

}

===============================================================================
Visualforce Page
<apex:page controller="DynamicCasesExtension">

<apex:form >
    <apex:pageMessages />

    <apex:pageBlock title="Filter Based on Case Status: ">
        <apex:outputText value="Filter Based on Case Status"></apex:outputText>
        <apex:actionRegion >
            <apex:selectList value="{!c.status}" multiselect="false" size="1" required="true">
                <apex:selectOption itemValue="None" itemLabel="-None-"/>
                <apex:selectOption itemValue="New" itemLabel="New" />
                <apex:selectOption itemValue="Closed" itemLabel="Closed"/>
                <apex:selectOption itemValue="In Progress" itemLabel="In Progress"/>
                <apex:actionSupport event="onchange" rerender="result"/>
            </apex:selectList>
        </apex:actionRegion>
    </apex:pageBlock>

    <apex:pageBlock >
        <apex:outputPanel>
            <apex:pageBlockTable value="{!sObjectList}" var="res" id="result">
                <apex:repeat value="{!objectFields}" var="field" >
                    <apex:column value="{!res[field]}" id="results"/>
                </apex:repeat>
                <apex:actionPoller rerender="results" interval="10" status="state"/>
                <apex:actionStatus id="state" startText="Refreshing" stopText=""/>
            </apex:pageBlockTable>
        </apex:outputPanel>
    </apex:pageBlock>
</apex:form>

A: I have changed the below controller. I initially didn't see that you're not calling any method from the apex:actionSupport tag. I have changed the below code (Apex / VF) and added some comments.
public with sharing class DynamicCasesExtension {

    public Case c { get; set; }
    public String objectName { get; set; }
    public List<String> objectFields { get; set; }
    public List<Case> SObjectListToShow { get; set; }

    public DynamicCasesExtension(){
        objectName = 'Case';
        //set the status to the value you need. In your case I assume it is coming in as a parameter. This is to be set only for the first load.
        c.Status = ApexPages.currentPage().getParameters().get('c.Status');
        //SObjectListToShow = getSObjectList();
        generateList();
    }

    // a new method which will be called everytime the value in the picklist is changed
    public void generateList() {
        SObjectListToShow = caseSObjectList();
    }

    // Getting field list for the sObject. Changed the name of the method.
    public List<Case> caseSObjectList(){
        .
        .
        .
        //Change it to c.Status so that it gets set to the value selected from the page.
        String caseStatus = c.Status;
        .
        .
        .
    }

}

VF Page:
<apex:actionSupport event="onchange" rerender="result" action="{!generateList}"/>


text:
Q: Convert list to data frame I am facing the problem of having a list in my data.frame:
> str(df.res)
'data.frame':   10 obs. of  5 variables:
 $ cryptodf.linksdf.k.   : Factor w/ 1178 levels "https://coinmarketcap.com/currencies/0x/",..: 126 405 883 121 637 301 721 130 722 698
 $ cryptodf.symboldf.k.  : Factor w/ 1164 levels "$$$","020","1337",..: 166 378 1125 98 592 277 1095 96 676 1108
 $ cryptodf.coinnamedf.k.: Factor w/ 1175 levels "020LondonCoin",..: 121 401 881 123 633 302 720 131 721 697
 $ website1              :List of 10
  ..$ : chr "Website\n                <a href=\"https://www.bitcoin.com/\" target=\"_"| __truncated__
  ..$ : chr "Website\n                \n                <a href=\"https://live.e"| __truncated__
  ..$ : chr "Website\n                \n                <a href=\"https://ripple.com/g"| __truncated__
  ..$ : chr "Website\n                \n                <a href=\"https://blo"| __truncated__
  ..$ : chr "Website\n                <a href=\"https://litecoin.org/\" target=\"_bla"| __truncated__
  ..$ : chr "Website\n                \n                <a href=\"https://chainz.cry"| __truncated__
  ..$ : chr "Website\n                \n                <a href=\"http://nembex.nem.ninja/\""| __truncated__
  ..$ : chr "Website\n                \n                <a href=\"https://chain"| __truncated__
  ..$ : chr "Website\n                \n                <a href=\"https://neotracker.io\""| __truncated__
  ..$ : chr "Website\n                \n

If I want to write my data.frame to a csv I get:
> write.table(df.res, file = path, row.names=FALSE, sep=";")
Error in .External2(C_writetable, x, file, nrow(x), p, rnames, sep, eol,  :
  unimplemented type 'list' in 'EncodeElement'

I tried either to rename the column and also the unlist function, but either of these two ways give me back a false format. I would like to simply have each list item in one row as the other factors.
Any suggestions what I am doing wrong?
UDPATE
Please find below the dput() output of the website  column:
     > dput(head(df.res))
structure(list(cryptodf.linksdf.k. = c("https://coinmarketcap.com/currencies/bitcoin/",
"https://coinmarketcap.com/currencies/ethereum/", "https://coinmarketcap.com/currencies/ripple/",
"https://coinmarketcap.com/currencies/bitcoin-cash/", "https://coinmarketcap.com/currencies/litecoin/",
"https://coinmarketcap.com/currencies/dash/"), cryptodf.symboldf.k. = c("BTC",
"ETH", "XRP", "BCH", "LTC", "DASH"), cryptodf.coinnamedf.k. = c("Bitcoin",
"Ethereum", "Ripple", "BitcoinCash", "Litecoin", "Dash"), website1 = c("Website\n                Website 2\n                Explorer\n                Explorer 2\n                \n                   Message Board\n                   Message Board 2\n                \n\n                \n               \n                     Rank 1\n                \n                \n                \n                \n                    \n                        Mineable\n                    \n                        Coin\n                    \n                    \n                \n                \n            ",
"Website\n                \n                Explorer\n                Explorer 2\n                Explorer 3\n                   Message Board\n                \n
    Announcement\n\n                \n               \n                     Rank 2\n                \n                \n                \n                \n                    \n                        Mineable\n                    \n                        Coin\n                    \n                    \n                \n                \n            ",
"Website\n                \n                Explorer\n                Explorer 2\n                \n                   Message Board\n                \n                \n\n                \n               \n                     Rank 3\n                \n                \n                \n                \n                    \n                        Coin\n                    \n                    \n                \n                \n            ",
"Website\n                \n                Explorer\n                Explorer 2\n                Explorer 3\n                \n                \n
    Announcement\n\n                \n               \n                     Rank 4\n                \n                \n                \n                \n                    \n                        Mineable\n                    \n                        Coin\n                    \n                    \n                \n                \n            ",
"Website\n                Website 2\n                Explorer\n                Explorer 2\n                Explorer 3\n                   Message Board\n                \n
    Announcement\n\n                \n               \n                     Rank 5\n                \n                \n                \n                \n                    \n                        Mineable\n                    \n                        Coin\n                    \n                    \n                \n                \n            ",
"Website\n                \n                Explorer\n                \n                \n                   Message Board\n                \n
    Announcement\n\n                \n               \n                     Rank 6\n                \n                \n                \n                \n                    \n                        Mineable\n                    \n                        Coin\n                    \n                    \n                \n                \n            "
), logo = structure(1:6, .Label = c("https://files.coinmarketcap.com/static/img/coins/32x32/bitcoin.png",
"https://files.coinmarketcap.com/static/img/coins/32x32/ethereum.png",
"https://files.coinmarketcap.com/static/img/coins/32x32/ripple.png",
"https://files.coinmarketcap.com/static/img/coins/32x32/bitcoin-cash.png",
"https://files.coinmarketcap.com/static/img/coins/32x32/litecoin.png",
"https://files.coinmarketcap.com/static/img/coins/32x32/dash.png",
"https://files.coinmarketcap.com/static/img/coins/32x32/nem.png",
"https://files.coinmarketcap.com/static/img/coins/32x32/bitconnect.png",
"https://files.coinmarketcap.com/static/img/coins/32x32/neo.png",
"https://files.coinmarketcap.com/static/img/coins/32x32/monero.png"
), class = "factor")), .Names = c("cryptodf.linksdf.k.", "cryptodf.symboldf.k.",
"cryptodf.coinnamedf.k.", "website1", "logo"), row.names = c("hrefs1",
"hrefs2", "hrefs3", "hrefs4", "hrefs5", "hrefs6"), class = "data.frame")

A: You have line breaks in your website1 column. You could replace them with another character, for example with
df.res[,"website1"] <- gsub("\\n", "; ", df.res[,"website1"])


text:
Q: Django+Selenium tests give different results with and without coverage If I run my tests using coverage, a selenium test fails.  If I run them with python manage.py test ..., this test passes.
I have a test suite including some plain python/django tests as well as some tests using Selenium.  CustomWebDriver() is a subclass of selenium.webdriver.firefox.webdriver.
class WebDriverITTTests(LiveServerTestCase, Someothermixins):
    @classmethod
    def setUpClass(cls):
        cls.webdriver = webdriver.CustomWebDriver()
        super(WebDriverITTTests, cls).setUpClass()

    def test_instructions_logic(self):
        ...
        login, check that some things happened on the server side
        open a page, check for "#some_element" loaded via ajax
        ...

The test_instructions_logic test fails when I run it under coverage because it fails to find "#some_element".
Coverage command: coverage run --source mymodule.subapp manage.py test mymodule.subapp --settings myproj.settings
Manage.py command: python manage.py test mymodule.subapp --settings myproj.settings
Why are the tests results different in these two cases?

A: I figured it out.  I was using this as a reference, and the problem was...

*

*When using Selenium find_element_by_blah(), if the element is loaded via Ajax, you need to wait until it's loaded before looking for it.  Hence the wait_for_css() method in the link. (I was indeed using that method).

*The difference between the manage.py test runner and coverage test running is probably due to time - if I added a time.sleep(2) before checking for the element, the test would pass in both cases.

*But why doesn't the wait_for_css method prevent this problem???

*Because I naively created the NoSuchElementException, like
class NoSuchElementException(Exception)
    pass

instead of importing it: from selenium.common.exceptions import NoSuchElementException (and thus find_css method from the link was raising a different exception than what Selenium was expecting, and failing and exiting instead of waiting).
Oy.


text:
Q: Issue with WatiN and IE9 regarding multiple dialogs I am using the latest 4/12/2011 build of WatiN (2.1.0.1196).
I have an aspx page loaded into an IFrame in Dynamics Crm.  There is a button on the page that opens and modal dialog form.  So far most of the test cases are working correctly with WatiN except for a specific use case.
If a specific combination of controls are set on the modal dialog, a confirm dialog box will pop up after the user presses the submit button.  If the user selects ok it will continue the submit execution, if cancel it will return back to the modal dialog.  The test times out when this confirm dialog box appears.  I cant seem to get the handler setup right to catch the confirm dialog.
Here is a test method I have been trying:
    [TestMethod]
    public void Add_New_Post_To_Record_Public_NotOnBehalf_NoSub_No_Notifications()
    {
        using (var browser = new IE("URL to the IFRAME"))
        {
            var approveConfirmDialog = ReturnDialogHandler.CreateInstance();
            var confirmCode = Guid.NewGuid();

           //logon to CRM
            logonToADFS(browser);

            var recordPage = browser.Page<DiscussionRecordpage>();
            recordPage.CreateNewPostButton.ClickNoWait();

            HtmlDialog dialog = browser.HtmlDialog(Find.ByTitle("New Post"));
            var messageText = dialog.TextField(Find.ByClass("required"));
            messageText.TypeText("Type some text. Confirmation code: " + confirmCode.ToString());

            var button = dialog.Button(Find.ByClass("submit-button"));

            using (new UseDialogOnce(browser.DialogWatcher, approveConfirmDialog))
            {
                button.ClickNoWait();
                approveConfirmDialog.WaitUntilExists();
                approveConfirmDialog.OKButton.Click();
            }
            browser.WaitForComplete();

            Assert.IsTrue(browser.ContainsText(confirmCode.ToString()));
        }
    }

I have tried a couple different variations all with the same result.  I assume that I need to use the ReturnDialogHanlder.CreateInstance() method for IE9 compatibility, but the standard ConfirmDialogHandler did not seem to work either.  Honestly, I don't know if I am using the dialog handler correctly in this case, but  I can click the ok buttons on other confirm dialogs that spawn from buttons on other pages.  This is a bit unique since it is spawning from a modal dialog instead of a page.
I also tried using this custom handler (C# WatiN - Add an AlertDialogHandler to click ok button on every Alert dialog window) with no results.
Thanks in advance.

A: It's too hard. I suggest a workaround: most of the case, you could close the dialog using keyboard. so you could sendkeys to close the dialog. Just FYI.


text:
Q: Is it possible to create an association between two normal fields in Entity Framework, thereby ignoring the primary key? I have the following situation between these three tables:

Before I start explaining what I'm trying to accomplish here, let me clarify three things:

*

*I drew the model on EntityFramework, but this is actually the database view. Just assume that the fields type match between tables;

*I know that this database model sucks. But changing it is out of question. I know that it would make my life easier.

*I'm using Visual Studio 2008 and .Net 3.5 on this project. But I'm accepting solutions based on Visual Studio 2010 and .Net 4.0 as well.
So, as I tried to demonstrate on the picture above, in this project that I'm working on I got these 3 tables. One of then, TransactionLine, associates a file to a transaction line, that is part of a full transaction.
Now, what I'm trying to associate here is TransactionLine and File. However, TransactionLine doens't have FileId field from the File table. The fields FileNumber and FileType from this table stand for an composite key on File. And indeed, File's FileNumber and FileType never repeat. They could be the primary key, but then again, I can't touch the database structure.
I try to associate TransactionLine and File by creanting an Association of One To Many From File to TransactionLine. After that, I select the Association and change to the Mapping Details screen, then I select Map's to TransactionLine.
The data that he askes me to fill on the model screen are:

*

*File.FileId;

*TransactionLine.TransactionId;

*TransactionLine.FileNumber;

*TransactionLine.FileType,

All of the TransactionLine scalar properties are set by theirs corresponding database fields, which are of the same name. But when I'm going to specify the linkage with File table, the only scalar field that I can specify there is FileId, which I don't have on the TransactionLine table.
I also tried to set File's FileNumber and FileType scalar properties entity key flag to true, and FileId entity flag to false, but with no success, since the program warns me that database FileId is a primary key but is not set like one on the entity.
Is it possible to link TransactionLine FileNumber and FileType with File? Is there any workaround for this situation?
Special Note: FileId is indeed the primary key for File. Others tables link with it by this field. The TransactionLine here is an exception to the common sense rule. :(

A: We archieved our goal :D.
Thanks to Dr. Wily's Apprentice for giving us a tip about the solution.
Here is what we did:

*

*We created a view, named VIEWFILEEXTRA, with just the fields we'd like to use in the association;

*After that, we created an entity based on this view, named FileExtra;

*Map FileExtra to VIEWFILEEXTRA, if not done yet;

*Change FileNumber and FileType from FileExtra Entity Key flag to true;

*Delete FileNumber and FileType scalar properties from File;

*Create an 1 on 1 association between file and FileExtra;

*Set the scalar properties in the association mapping to point to File's database fields FileNumber and FileType;

*Create an 1 to Many association between FileExtra and TransactionLine;

*Point the association mapping to TransactionLine, and set the fields.
And that's it. Thank you very much for your attention and tips :D.


text:
Q: Use the system call select with files I'm trying to write a single threaded non blocking program with the system call select. However, it doesn't work well using file handlers.
Here is the code:
import sys
import select

while True:
    file_handler = open('filename.txt')
    inputs = [file_handler, sys.stdin]
    try:
        _input, _output, _error = select.select(inputs, [], [])
    except select.error, e:
        print e

    for i in _input:
        txt = i.readline()
        if len(txt) > 0:
            print 'txt:', txt

It reaches the print message when there is a new input from stdin, but not when a new line is written to the file.
It works perfectly fine when using sockets instead of files.

A: Which operating system are you using? Windows or UNIX or MacOS X or what?
Traditionally, the select() call on UNIX-likes systems will return files as "always readable" and "always writable" so trying to use select() for I/O multiplexing will not be useful.
On Windows, select() on files isn't expected to work at all, as it's a feature of the WinSock library.
There are various "file notify" functions and APIs that may be better for your particular case -- Python even has some libraries that abstracts the OS specific code. However, that won't natively interact with sockets very well, so I believe the best way to get a program that both "reacts to input sockets" and "reacts to file changes" without using polling, is to create one or more Python threads.


text:
Q: MS SpeechRecognitionEngine doesn't always return when reading WAV files There is a similar question that already exists here, but the solution does not apply to my situation, and they ultimately never solved the problem anyways.
So, as the title suggests, the recognizer.Recognize() function doesn't always return, doesn't even seem to be throwing an error that I can see, and I cannot for the life of me figure out why. It returns consistently for one of my test WAV files (we'll call this one working.wav), but never ever returns for my other file (failing.wav). These files are created the same way and simply contain a brief (8 seconds) recording of the same person asking different questions. They both have a similar period of silence at the start, and the question itself ends after about 3-4 seconds, with about 4 seconds of silence at the end of the recording.
I've loaded grammars, tried both default (empty) grammar and this custom one, and I am handling SpeechDetected(), SpeechRecognized() and SpeechRecognitionRejected(). None of these events get called for failing.wav, but they work for working.wav.
I had also tried setting the BabbleTimeout, EndSilenceTimeout, EndSilenceTimeoutAmbiguous and InitialSilenceTimeout properties to be around 1 second each, but these made no difference either, so I removed them.
public string ReadQuestion()
{
    RecognitionResult recResults;
    string question = "Is this a default question?"; //default question for debug purposes

    using (SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine(new System.Globalization.CultureInfo("en-US")))
    {
        GrammarBuilder areYou = new GrammarBuilder("Are you");
        areYou.AppendDictation();

        Choices anActor = new Choices(new GrammarBuilder[] { areYou });
        Grammar grammar = new Grammar((GrammarBuilder)anActor);
        recognizer.LoadGrammar(grammar);

        //wav file generated by UE4
        recognizer.SetInputToWaveFile(@"..\..\..\..\..\Saved\BouncedWavFiles\question.wav");

        recognizer.SpeechDetected +=
            new EventHandler<SpeechDetectedEventArgs>(recognizer_SpeechDetected);

        recognizer.SpeechRecognized +=
            new EventHandler<SpeechRecognizedEventArgs>(recognizer_SpeechRecognized);

        recognizer.SpeechRecognitionRejected +=
            new EventHandler<SpeechRecognitionRejectedEventArgs>(recognizer_SpeechRecognitionRejected);

        try
        {
            Console.WriteLine("Entering STT...");
            recResults =  recognizer.Recognize();
            Console.WriteLine("Leaving STT...");

            question = recResults.Text;
        }
        catch (Exception e)
        {
            Console.WriteLine("Caught exception " + e.Message);
        }
    }

    return question;
}

Of course, one could simply call RecognizeAsync() and cancel after a short timeout, but that defeats the purpose of, you know, having a functional speech recognition engine, since it's failing to return very often and for seemingly arbitrary reasons.
If anyone would have any insight whatsoever about why Recognize() stalls, or even ways I could better debug this, I would be really grateful.


text:
Q: Are there accepted conventions for argv, options, environment variables, stdin, stdout, and stderr when building CLIs? I tend to talk about how simple command line applications are. Usually, I say something like, "they read from standard in and write to standard out and standard error, that's it." Then, I draw a picture like:

But then I started thinking that's not actually the end of the story. Command line applications read from standard in and write to standard error and standard out, and...

*

*read configuration files (from any number of places like /etc, ~, or .)

*read environment variables

*read command line switches

*read command line flags

*read command line arguments

*set the exit status

A command line application ends up looking more like:

Which is objectively more complex than simply stdin, stdout, and stderr.
I use command line applications all day. Over time I've developed an opinion and intuition about them:

*

*standard in - usually data, not arguments (unless I use xargs)

*standard out - the product, preferably columnated data

*standard error - for logging cruft or error messages if something goes wrong

*the exit status - sacred, either 0 for success or 1 for failure (or something else for some other type of failure)

*arguments - important but read somehow differently than standard in

*flags - like arguments but less important

*switches - like flags but are either on or off

*environment variables - sort of like arguments but there's some kind of philosophical difference between them

*configuration files - kind of like environment variables in the sense that you can control switches or flags, but you can keep them in version control and generally use them to prevent having to use frustratingly combinations of switches and flags, or show everyone how cool your dotfiles are

These guidelines tend to work with various command line tools I use. However, when it comes to making them for other people to use, I'd like to have a reference.
For example, the following is a command line application written with Ruby:
#!/usr/bin/env ruby
# somecli

require 'optparse'
require 'yaml'

options = {}

etc_config = File.join('etc', 'somecli')
if File.exist? etc_config
  options.merge! YAML.load_file(etc_config)
end

home_config = File.join(ENV['HOME'], '.somecli')
if File.exist? home_config
  options.merge! YAML.load_file(home_config)
end

current_working_directory_config = '.somecli'
if File.exist? current_working_directory_config
  options.merge! YAML.load_file(current_working_directory_config)
end

OptionParser.new do |opts|
  opts.on("-s", "--[no-]switch") do |s|
    options[:switch] = s
  end
  opts.on("-a", "--[no-]another-switch") do |as|
    options[:'another-switch'] = as
  end
  opts.on("-y", "--[no-]yet-another-switch") do |yas|
    options[:'yet-another-switch'] = yas
  end
  opts.on("-y", "--[no-]even-yet-another-switch") do |eyas|
    options[:'even-yet-another-switch'] = eyas
  end
  opts.on("--flag FLAG") do |f|
    options[:flag] = f
  end
end.parse!

puts "ARGV=#{ARGV.inspect}"
puts "options=#{options.inspect}"
puts "ENV['cats']=#{ENV['cats'].inspect}"
unless STDIN.tty?
  puts "STDIN.read=#{STDIN.read.inspect}"
end
$stderr.puts "stderr: hello world!"
$stdout.puts "stdout: hello world!"
exit 0

When run it looks like
echo -n foo bar baz | ./somecli -s -f flap jacks; echo $?
ARGV=["jacks"]
options={:"another-switch"=>true, :"even-yet-another-switch"=>true, :switch=>true, :flag=>"flap"}
ENV['cats']="flapjacks"
STDIN.read="foo bar baz"
stderr: hello world!
stdout: hello world!
0

I'd like to have a link in the README to a more official document that guided it's input and output conventions and design decisions.
I know POSIX exists for deciding which common utility programs are installed on a system, except I'm wondering 2 things when it comes to building command line applications:

*

*Are there any other common ways for getting input into a command line program that I missed?

*Does authoritative documentation exist for conventions around how to organize the various inputs and outputs?

A: There are some general guidelines for command line utilities documented in POSIX.1/Single UNIX Specification.
See Section 12.2: Utility Syntax Guidelines.

A: I don't think there are any conventions but for common sense.
As for input and output methods, or in general, communication methods, there's one that you mentioned, but only partially. It's reading and writing to files. (You mentioned reading config files, or in general, file descriptors.)
Similar things to files are pipes and sockets. Eg. TCP, UDP or Unix sockets, which can be considered a way of Inter-process Communication (IPC). Other kinds of IPC include:

*

*shared and mapped memory

*signals

*semaphores

*D-Bus


text:
Q: Question on the uncertainty principle The problem statement:

Measurement detects a position of a proton with accuracy of $\pm10pm$.
  How much is the position uncertainty $1s$ later? Assume the speed of a
  proton $v\ll c$.

What i understand:
I know that in general it holds that:
\begin{align}
\Delta x \Delta p \geq \frac{\hbar}{2}
\end{align}
This means i can calculate momentum uncertainty for the first measurement:
\begin{align}
\Delta x_1\Delta p_1 &\geq \frac{\hbar}{2}\\
\Delta p_1 &\geq \frac{\hbar}{2\Delta x_1}\\
\Delta p_1 &\geq \frac{1.055\times10^{-34}Js}{2\cdot 10\times10^{-12}m \rlap{~\longleftarrow \substack{\text{should I insert 20pm}\\\text{instead of 10pm?}}}}\\
\Delta p_1 &\geq 5.275\times10^{-24} \frac{kg m}{s}\\
\Delta p_1 &\geq 9.845 keV/c
\end{align}
Question:
Using the position uncertainty $\Delta x_1$ I calculated the momentum uncertainty in first measurement $\Delta p_1$.
How do I calculate the position uncertainty $\Delta x_2$ after $1s$? I am not sure what happens $1s$ later but is a momentum uncertainty conserved so that it holds $\Delta p_1 = \Delta p_2$? I know that the problem expects me to use the clasic relation $p=m_ev$ somehow but how?

A: You are on the right track in calculating the uncertainty in momentum using the uncertainty principle.
The new position will be
$$x_2 = x_1 + \frac{p}{m} t$$
There is a well known technique of error propagation which works like
$\delta(f(x_1, x_2, x_i, ...) = \sqrt{\Sigma\left(\frac{\partial f }{\partial x_i} \delta x_i\right)^2 }  $,
where $\delta x_i$ means the uncertainty in $x_i$, which is an independent coordinate (including momenta and times) of the motion. You sum over every measurement that has an uncertainty.
This comes from the Taylor series.
Applying this, you will get
$$\delta x_2 = \sqrt{\delta x_1^2 + \left(\frac{t}{m} \delta p\right)^2}$$
EDIT -
I thought about this a little more and I think that the addition in quadrature is not so appropriate here. Usually you use this for measurement uncertainties, where you look for one-sigma intervals, but for quantum mechanics, where you look for complete uncertainty, it might be more correct to add the components directly.
$$\delta x_2 = \delta x_1 + \left(\frac{t}{m} \delta p\right)$$

A: Let's suppose you did the measurement in the rest frame of the proton. You've worked out that $\Delta p$ is $5.275 \times 10^{-24}$ kg.m/s. This means the probability distribution of the momentum will be some curve (usually taken to be a gaussian) with a half width of $5.275 \times 10^{-24}$. To convert this to a velocity probability distribution just divide by the proton mass, $1.673 \times 10^{-27}$ kg, and you'll find the velocity probability distribution half width is $3,150$ m/s. Therefore after 1 second the probability distribution of the proton position will have a half width of $3,150$ m.


text:
Q: Ajax and MVC (asp.net) I need to add a collapsble panel to an MVC View. Example show , but when I add

I added the AjaxToolkit dll that I downloaded as a refrence to my project - but I still don't seem to have no Ajax support....
Hopefully someone can guide me.

A: AjaxToolkit contains extensions for classic web forms applications and is not intended to be used in ASP.NET MVC. So you can safely remove this reference from your ASP.NET MVC application and use jQuery UI.

A: Most ASP.NET MVC developers are using jQuery for AJAX. Here is the rough setup.
1) Partial view that returns the bit you want to refresh
2) When you need to get the data, fire a jQuery get
$.get('/Controller/Action', function(data) {
    $('.myContainer').html(data);
});

(http://api.jquery.com/jQuery.get/)


text:
Q: laravel 419 status code (unknown status) I do an ajax call but I keep getting this error:
419 (unknown status)

i include in meta tag:
<meta name="csrf-token" content="{{ csrf_token() }}">

my table (without form):

                        Full nametd>
                        Lớp
                        <input type="checkbox" id="select_all">

i use DataTables library load all data from Controller:
var table = $('#dataTables').DataTable({
            "pagingType": "full_numbers",
            "processing": true,
            "serverSide": true,
            "lengthMenu": [[5, 10, -1], [5, 10, "All"]],
            "iDisplayLength": 5,
            "ordering": false,
            "ajax": '{!! url(Request::segment(1).'/lists?class_id='.Input::get('class_id')) !!}',
            'createdRow': function (row, data, dataIndex) {
                $(row).attr('id', data.id);
            },
            "columns": [
                ...
                {
                    "data": "id", "sClass": "text-center",
                    "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
                        $(nTd).html("<input type='checkbox' name='check[]' value='" + oData.id + "'>");
                    }
                },
            ],
            "language": {
                "url": "{{url('public/extension/datatables/vietnamese.json')}}"
            }
        });

My Ajax:
$('#save').click(function () {
            $.ajax({
                type: 'POST',
                url: "{{url('class/store')}}",
                cache: false,
                data: {"check": sThisVal }, //sThisVal get all input checkbox checked
                success: function (r) {
                    $('#msg').html(r);
                },
                error: function (jqXHR, text, errorThrown) {
                    $('#msg').html(jqXHR + " " + text + " " + errorThrown);
                }
            });
        });

My route:
Route::post('class/lists', 'ClassController@lists');

My controller method
public function store(Request $request){
    var_dump($request->all());exit;
}

Result after click submit is null ???

A: In addition to putting the crsf-token value in the header meta you need to pass it through in your AJAX requests with something like:
$.ajaxSetup({
  headers: {
    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
  }
});

This is from: https://laravel.com/docs/5.6/csrf#csrf-x-csrf-token

A: I added the crsf-token in the data section on my ajax and it worked like a charm for me.
 $('#save').click(function () {
            $.ajax({
                type: 'POST',
                url: "{{url('class/store')}}",
                cache: false,
                data: {
                       "check": sThisVal,
                       "_token": "{{ csrf_token() }}",
                }, //sThisVal get all input checkbox checked
                success: function (r) {
                    $('#msg').html(r);
                },
                error: function (jqXHR, text, errorThrown) {
                    $('#msg').html(jqXHR + " " + text + " " + errorThrown);
                }
            });
        });

Hope this Helps

A: sometimes all u need to do to fix this is to make the method post caps like the below


text:
Q: Angular keyvalue pipe: argument type is not assignable to parameter type I want to iterate a map and display the keys and values in my html file, for doing that I used Angular's *ngfor with keyvalue pipe.
However, there's an error with the ngFor iteration:

Argument type Map<string, BarcodeInfoModel> is not assignable to parameter type {[p: string]: (() => IterableIterator) | ((key: string, value: BarcodeInfoModel) => this) | ((key: string) => boolean) | string | ((key: string) => (BarcodeInfoModel | undefined)) | (() => IterableIterator<[string, BarcodeInfoModel]>) | number | (() => IterableIterator) | (() => void) | ((callbackfn: (value: BarcodeInfoModel, key: string, map: Map<string, BarcodeInfoModel>) => void, thisArg?: any) => void)} | Map<string, (() => IterableIterator) | ((key: string, value: BarcodeInfoModel) => this) | ((key: string) => boolean) | string | ((key: string) => (BarcodeInfoModel | undefined)) | (() => IterableIterator<[string, BarcodeInfoModel]>) | number | (() => IterableIterator) | (() => void) | ((callbackfn: (value: BarcodeInfoModel, key: string, map: Map<string, BarcodeInfoModel>) => void, thisArg?: any) => void)>

Here the Map is declared and initialized with private files: Map<string, BarcodeInfoModel> = new Map<string, BarcodeInfoModel>(); where BarcodeInfoModel is a customized type, with variables like this:

export class BarcodeInfoModel {
    _codeType: string;
    _receivingID: string;
    _cache: Array<string>;
    _dcr: string;
    _packageType: string;
    _condition: string;

    constructor() {}

    ...

}

And in my html I use the iteration like:

<mat-accordion>
    <mat-expansion-panel *ngFor="let file of files | keyvalue">
      <mat-expansion-panel-header>
        <mat-panel-title>
          {{file.key}}
        </mat-panel-title>
      </mat-expansion-panel-header>
      <p>{{file.value}}</p>
    </mat-expansion-panel>
  </mat-accordion>

And that's where the error occurs. If I run this snippet in my browser, files.value produces [object Object], not indicating it is of BarcodeInfoModel type. Also, in the html, I cannot get attributes of BarcodeInfoModel by doing something like {{file.value._codeType}}.

A: The type of your objects declared in your map does not correspond to the type of the objects you have passed to your map.
For example :
map = new Map<number, string>([[2, 'Burger'], [1, 'Tomato']]);

You won't have error

and if you write it like :
map = new Map([[2, 'Burger'], [1, 'Tomato']]);

you will have the error that number, string is not assignable

TYPEscript.
Goodluck


text:
Q: How to set NumberTextBox accepts only digits in dojo? I have the following NumberTextBox and i wanted to allow only the digits,but i don't know what is the constraints properties used to make it possible.
<input type="text" data-dojo-type="dijit.form.NumberTextBox" invalidMessage="Please enter only numbers" constraints="{}" required="true"

A: You can have following for example:
constraints: { min:0, places:0}

see also: http://www.unicode.org/reports/tr35/#Number_Format_Patterns
Using the dojo NumberTextBox you are still allowed to enter characters: a, b, c. It only gives you invalid message. If you want to only allow digit input, you can use the javascript here.


text:
Q: Buscando a próxima tabela após um elemento clicado Olá, estou tentando preencher a próxima tabela mais próxima do botão clicado, mas não estou conseguindo.
É importante que seja a próxima logo após, pois existem várias tabelas com a mesma classe, será que podem me ajudar??
Eis o javascript:
 $(".btnMostrarCategoria").click(
        function() {

            var nome = $(this).data('nome');

            jQuery("#tabelaUploads tbody").html("");

            console.log($(this).next("table"));

            $.ajax({
              url: "/painel/mostrarUploadsCategorias",
              method: 'POST',
              data: {_token: jQuery(".token").val(), nome: nome},

              success: function(e) {
                console.log(e);
                e.forEach(function(item, indice) {
                    //remove o diretório da string e só deixa o nome final do arquivo
                    var nomeArquivo = item.replace('public/painel/categorias/' + nome + "/", "");
                    $(this).find('.tabelaUploads tbody').append("
" + nomeArquivo + "	 Download <button type='button' class='btn btn-danger' onclick=\"excluirUpload('" + item + "')\">Excluir</button>
");
                });
              }
            }).done(function() {        //só abre o modal assim que terminar a requisição ajax
                hidePleaseWait();
            });
        }
    );

HTML:
@foreach($categorias as $categoria)
                    @if($loop->first)

                    @else

                    @endif

                        <input type="hidden" name="" id="nomeCategoria" value="{{$categoria->nome}}">

{{$categoria->id}}  -  {{ $categoria->nome }}

                          <button type="button" class="btn btn-box-tool btnMostrarCategoria" data-widget="collapse" data-toggle="tooltip" title="Collapse" data-nome={{ $categoria->nome }}>
                            @if($loop->first)
                              </button>
                            @else
                              </button>
                            @endif

                            <input type="hidden" id="idPasta">

                              <input type="file" name="files[]" id="fileupload" data-token="{!! csrf_token() !!}" data-pasta="" class="btn btn-primary" multiple >

                                      0%

                              Arquivo enviado com sucesso!

                                    Arquivo
                                    Ações

               @endforeach

insira o código aqui

A: Olá, boa noite.
Para conseguir selecionar a tabela mais próxima ao seu botão, eu recomendaria você criar uma div para cada categoria criada, nisso você iria agrupar todos os botões e sua respectiva tabela a essa div, com isso você seria capaz de utilizar o comando closest disponível na biblioteca jQuery.
Fiz um exemplo para que você consiga esclarecer suas dúvidas: https://jsfiddle.net/bh3oj408/


text:
Q: canvas drawText and emoji alpha color the design recommendation for android regarding text legibility (https://material.io/design/color/text-legibility.html#legibility-standards) says to use for the font a black color with Alpha 87% or 60% depending on the importance of the text. So I paint text on my canvas like this :
paint.setColor(#99000000);
canvas.drawText('a text  with emoji', x, y, paint);

This work well for the text, It looks a little grayed and not pure black, however, the emoji  is also painted with the alpha and for a colored image, this is not good to use Alpha to draw it :(
On iOS, for example, emoji are drawn without taking care of the alpha of the font color. Is there any way under Android to draw a text on the canvas with font color alpha that will be applied only to the text and not for the emoji contained in the text?


text:
Q: Need simple modification for Javascript Cookie notice wordpress plugin I followed a tutorial to create cookie notice popup for my wordpress site, it works as expected, I'm not good at javascript, so I want after user click on X button and accept cookies, to be automatically redirected to the same page with ?ok=3 query

A: Although I felt bad that some people instead of helping me fix my issue, they decide to give me negative rate. but I'll share the solution which fix my issue, in case other people facing the same issue, the problem wasn't in finding the JS code to navigate to a web page location.href, the problem was where should I add it in this minifyed code.
Anyways, the solution is:
adding ,location.href = window.location.href+"?ok=3";
after localStorage.setItem(cookieLaw.iId,"1"),
and before }},cookieLaw.show({
so the final code will be:

Maybe the solution was easy, but as I mentioned, I'm good at javascript, specially that the code looks minifyed.


text:
Q: About A- star Algorithm In A-Star algorithm did we replace the node in frontier if a better path is found to a node currently on the frontier (open list)?
For Example: frontier has node B having evaluation function value f(x)= 25 and while exploring the children of node C we have a path from C to B having f(x)= 15 do we replace this value in frontier?

A: A-Star data structures:
Open list: Contains nodes that have not been expanded. Sorted by evaluation function f(n) = g(n) + h(n). Initially contains the root. To expand a node you get the first one from the list. Besides you add the successors to the list.
Closed list: Contains nodes that have been expanded. When you are going to expand a node you check that it is not in the closed list. If it is you discard it.
Note that open list is sorted by evaluation function so that the node with the best evaluation function is placed in the front of the list.
Hope this helps.


text:
Q: Distance to object, taking into account size of object I have a number of polygon features on the edge of a lake feature. I also have sample points throughout the lake feature. I am looking to add some sort of indicator for these points as to how influences they are by a nearby wetland. For example, being 100m away from a large wetland should give a different value compared to 100m from a small wetland. In addition, 100m away from two small wetlands should give the same as being 100m away from a single 2x as large wetland.
Is there a single tool for this or do I need to do a calculation on my own. E.g. find distance, find size of nearest wetland and multiply.
Thinking maybe to write a program that takes distW1 * areaW1 + distW2 * areaW2 etc...

A: If I understand your question correctly, it sounds like you are trying to plot the relationship between size of wetland and distance to your sample points. I don't think there is a single tool that will do what you want in one step. The Near tool in the Proximity toolset will calculate the closest distance to the other feature. The point distance tool will calculate the distance of every point in a feature class to every point in another. As far as I know there is not an equivalent tool that takes a polygon feature as input.


text:
Q: How to Center a Photoslideshow I have trouble with centering my photoslideshow....
I hope you guys could help me.
Photoslideshow in Html :

A: Here a flexbox suggestion (I used different size images just as proof they are indeed sliding):

var myIndex = 0;
carousel();

function carousel() {
  var i;
  var x = document.getElementsByClassName("mySlides");
  for (i = 0; i < x.length; i++) {
    x[i].style.display = "none";
  }
  myIndex++;
  if (myIndex > x.length) {
    myIndex = 1
  }
  x[myIndex - 1].style.display = "block";
  setTimeout(carousel, 2500);
}
.w3-content {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
}

A: Try this

A: Use margin: auto; and display: block; style For center image. see  here for display center image. http://www.w3schools.com/css/css_align.asp.
Try below css style:
 .w3-content img{
      display: block;
      margin:0 auto;
 }

Demo

var myIndex = 0;
carousel();

function carousel() {
  var i;
  var x = document.getElementsByClassName("mySlides");
  for (i = 0; i < x.length; i++) {
    x[i].style.display = "none";
  }
  myIndex++;
  if (myIndex > x.length) {
    myIndex = 1
  }
  x[myIndex - 1].style.display = "block";
  setTimeout(carousel, 2500);
}
.w3-content img{
  display: block;
  margin:0 auto;
}

A: Try styling with 'center-class'.


text:
Q: How to select all options in a list with IONIC ion-select I want a select where I can choice "select All" or "unselect all" options of a list.
I have this in my html:
<ion-item>
      <ion-label class="opciones">Mas opciones:</ion-label>
      <ion-select class="seleccion" multiple="false" placeholder="Marcar todo">
        <ion-option (click)="selectAll(elemento)">Marcar todo</ion-option>
        <ion-option (click)="unselectAll(elemento)">Desmarcar todo</ion-option>
      </ion-select>
    </ion-item>

And here is my function
elemento = document.getElementsByClassName("anim-icons");
  public selectAll(listaProducto: ListaProducto) {
    for (var i = 0; i < this.elemento.length; i++) {
      this.elemento[i].className += " active" + " alt";
      console.log("elemento: " + this.elemento);
    }
  }

The css class "active" put the checkbox of a item in check.
My funtion doesn´t work and I'm new with this framework.
Thank you!


text:
Q: Chipset unkown - airmon-ng root@ubuntu:~# airmon-ng

Interface   Chipset     Driver

mon0        Unknown     iwlwifi - [phy0]
mon1        Unknown     iwlwifi - [phy0]
mon2        Unknown     iwlwifi - [phy0]
wlan0       Unknown     iwlwifi - [phy0]

root@ubuntu:~# iwconfig
mon0      IEEE 802.11abgn  Mode:Monitor  Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

mon1      IEEE 802.11abgn  Mode:Monitor  Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

mon2      IEEE 802.11abgn  Mode:Monitor  Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off

eth0      no wireless extensions.

lo        no wireless extensions.

wlan0     IEEE 802.11abgn  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=15 dBm
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

Which one should I choose?

A: I'm going to assume you ran
sudo airmon-ng start wlan0

to get your mon0-2 monitor channels.
The problem you have now it that you ran the above command 3 times and not just once.
first stop mon1 and 2 by running
sudo airmon-ng stop mon1
sudo airmon-ng stop mon2

Now depending on what you want to do you'll need to chose wlan0 or mon0.
If you simply want to monitor your wifi box you'll need to chose mon0. If you actually want to affect your wifi connection you'll need to chose wlan0.
Your next problem is that you haven't installed the correct drivers for your chipset that work with airmon-ng (if there are any at all. Airmon-ng doesn't support every chipset). You can get it to work without the correct airmon-ng drivers but your mon0 will be set to the -1 channel.
Instructions on how to determine and install the correct airmon-ng drivers for your chipset can be found here.
I would normally include the instructions here but they are several pages long so I decided against that.


text:
Q: What is wrong with the export of my npm packaged vue component? I have a small local npm package (fomantic-ui-vue) whose main js is
import Vue from 'vue'
// Import vue component
import  button from './elements/button/button.vue'
import  buttonGroup from './elements/button/button-group.vue'

console.log('--------- package called begin ------------------');
console.log('Register: '+button.name)
Vue.component(button.name, button);
console.log('Register: '+buttonGroup.name)
Vue.component(buttonGroup.name, buttonGroup);
console.log('--------- package called end ------------------');

export const components = {
        button,
        buttonGroup,
    };
export const test = () => {
    console.log('--------- TEST ------------------');
};

In my test application I have
import FUI from '../../fomantic-ui-vue/dist/main.js'
console.log(FUI)
FUI.test()

*

*The first line has to be somehow correct because in the browser shell I see package called begin and so on.

*console.log(FUI) gives {}. Where are test and components?

*for FUI.test() I get the error TypeError: _fomantic_ui_vue_dist_main_js__WEBPACK_IMPORTED_MODULE_2___default.a.test is not a function Where the a comes from? what is wrong?

*If I comment FUI.test() out to avoid the error I get the error that the vue component fue-button is not registered, thus I conclude that the npm package registered it in some other place

These are many errors but I think that they are all connected.
EDIT
const myTest = () => {
    console.log('--------- TEST ------------------');
};

export default {
    test: myTest,
    components: {
        button,
        buttonGroup
    }
};

A: You are using name export, so in order to use the test function you should import it as so:
import {test} from '../../fomantic-ui-vue/dist/main.js';
If you want to use it with a dot notation the in your main.js the export should be an object with the each key referencing on of the functions:
...
const myTestFunc = () => 'test';
const aComponent = () => Vue.component(..);

export default {
   test: myTestFunc,
   component: aComponent
}

Hope it helps

A: The solution is to add library and libraryTarget in the webpack.config.js:
module.exports = {
  entry: './src/index.js',
  output: {
    library: 'fomantic-ui-vue',
    libraryTarget: 'umd',
    filename: 'main.js',
    path: path.resolve(__dirname, 'dist'),
  },


text:
Q: problema al hacer una consulta usando inner join tengo un problema al hacer una consulta usando inner join, cuando hago la consulta , los registros se multiplican por el numero de registros en la tabla.
Tablas
CREATE TABLE [dbo].[Informes_tecnicos](
    [id_Articulo] [int] ,
    [id_informes] [varchar](10) NOT NULL,
    [centro_publicacion] [varchar](100) NOT NULL,
    [mes_publicacion] [char](2) NOT NULL,
    [ano_publicacion] [char](4) NOT NULL,
    [descripcion] varchar (50) not null
)
CREATE TABLE [dbo].[Articulos](
    [id_articulos] [int] IDENTITY(1,1) NOT NULL,
    [Titulo] [varchar](100) NOT NULL,
    [Autor] [varchar](50) NOT NULL,
    [palabras_claves] [varchar](100) NOT NULL,
    [correo_elec] [varchar](100) NOT NULL,
    localizacion varchar (30) not null,
    [tipo] [varchar](30) Not NULL,
    [copia] [char](1) NOT NULL
)
create procedure [dbo].[ConsultarInformes]
as
begin
select  Informes_tecnicos.id_informes, Informes_tecnicos.centro_publicacion, Informes_tecnicos.mes_publicacion, Informes_tecnicos.ano_publicacion,
         Articulos.Titulo, Articulos.tipo, Informes_tecnicos.descripcion
       FROM Articulos INNER JOIN Informes_tecnicos
       ON Articulos.tipo = Informes_tecnicos.descripcion;
END

Esa tabla solo tiene 3 registro.
Resultado

A: Debes comparar los ID's osea el campo que no se repite.
por lo que entiendo de tu código id_Articulo es un FK (Clave foranea), asi que quedaría así.
select  Informes_tecnicos.id_informes, Informes_tecnicos.centro_publicacion, Informes_tecnicos.mes_publicacion, Informes_tecnicos.ano_publicacion,
     Articulos.Titulo, Articulos.tipo, Informes_tecnicos.descripcion
   FROM Articulos INNER JOIN Informes_tecnicos
   ON Articulos.id_Articulo = Informes_tecnicos.id_articulos;

A: Trata usando distinct en el select de tu procedimiento
select distinct Informes_tecnicos.id_informes, Informes_tecnicos.centro_publicacion, Informes_tecnicos.mes_publicacion, Informes_tecnicos.ano_publicacion,
         Articulos.Titulo, Articulos.tipo, Informes_tecnicos.descripcion
       FROM Articulos INNER JOIN Informes_tecnicos
       ON Articulos.tipo = Informes_tecnicos.descripcion;
END

Aunque lo ideal seria como comenta @Erick Zarate es que compares por id Articulos.id = Informes_tecnicos.id así solo selecciona aquellos artículos que estén ligados a un Informe técnico, suponiendo que puedas crear artículos pero que aun no sepas a que informe técnico pertenece, en ese caso no habría relación una tabla con la otra Y es recomendable que utilices llaves primarias y foráneas para que la relación sea mas clara entre las tablas.

A: Intenta con esto
create procedure [dbo].[ConsultarInformes]
as
begin
select  Informes_tecnicos.id_informes, Informes_tecnicos.centro_publicacion, Informes_tecnicos.mes_publicacion, Informes_tecnicos.ano_publicacion,
         Articulos.Titulo, Articulos.tipo, Informes_tecnicos.descripcion
       FROM Articulos INNER JOIN Informes_tecnicos
       ON Articulos.id_articulos = Informes_tecnicos.id_Articulo;
END


text:
Q: Accessing Azure Blob Storage Using Rest API I am trying to create container using rest api in azure storage. I have followed everything written in microsoft's documentation provided here and tried to create authorization token from here. Still I am getting:

403 Forbidden Server failed to authenticate the request. Make sure
  the value of Authorization header is formed correctly including the
  signature.

Below is my code snippet.
 class Program
{
    private const string BlobStorageAccount = "myacc";
    private const string BlobStorageAccessKey = "ACCESS_KEY";
    static void Main(string[] args)
    {
        CreateContainer("myfirstcontainer");
    }

    private static bool CreateContainer(string containerName)
    {
        String requestMethod = "PUT";
        String msVersion = "2016-05-31";
        string dt = DateTime.UtcNow.ToString("R", CultureInfo.InvariantCulture);

        String canHeaders = String.Format("x-ms-date:{0}\nx-ms-version:{1}", dt, msVersion);
        String canResource = String.Format("/{0}/{1}\nrestype:container", BlobStorageAccount, containerName);
        String SignStr = String.Format("{0}\n\n\n\n\n\n\n\n\n\n\n\n{1}\n{2}", requestMethod, canHeaders, canResource);
        string auth = CreateAuthString(SignStr);
        string urlPath = string.Format("https://{0}.blob.core.windows.net/{1}?restype=container", BlobStorageAccount, containerName);
        Uri uri = new Uri(urlPath);

        HttpClient client = new HttpClient();
        client.DefaultRequestHeaders.Add("x-ms-date", dt);
        client.DefaultRequestHeaders.Add("x-ms-version", "2016-05-31");
        client.DefaultRequestHeaders.Add("x-ms-client-request-id", Guid.NewGuid().ToString());
        client.DefaultRequestHeaders.Add("Authorization", auth);

        HttpContent empty = null;
        HttpResponseMessage response = client.PutAsync(uri, empty).Result;

        return response.IsSuccessStatusCode;
    }

    private static String CreateAuthString(String SignStr)
    {
        String signature = string.Empty;
        byte[] unicodeKey = Convert.FromBase64String(BlobStorageAccessKey);
        using (HMACSHA256 hmacSha256 = new HMACSHA256(unicodeKey))
        {
            Byte[] dataToHmac = System.Text.Encoding.UTF8.GetBytes(SignStr);
            signature = Convert.ToBase64String(hmacSha256.ComputeHash(dataToHmac));
        }

        String authorizationHeader = String.Format(
              CultureInfo.InvariantCulture,
              "{0} {1}:{2}",
              "SharedKey",
              BlobStorageAccount,
              signature);

        return authorizationHeader;
    }
}

A: Your request includes 3 request headers but canHeaders only include 2. So you would need to add the 3rd header there.
var clientRequestId = Guid.NewGuid().ToString();
String canHeaders = String.Format("x-ms-client-request-id:{0}\nx-ms-date:{1}\nx-ms-version:{2}", clientRequestId, dt, msVersion);
String canResource = String.Format("/{0}/{1}\nrestype:container", BlobStorageAccount, containerName);
        String SignStr = String.Format("{0}\n\n\n\n\n\n\n\n\n\n\n\n{1}\n{2}", requestMethod, canHeaders, canResource);
    string auth = CreateAuthString(SignStr);
    string urlPath = string.Format("https://{0}.blob.core.windows.net/{1}?restype=container", BlobStorageAccount, containerName);
    Uri uri = new Uri(urlPath);

    HttpClient client = new HttpClient();
    client.DefaultRequestHeaders.Add("x-ms-date", dt);
    client.DefaultRequestHeaders.Add("x-ms-version", "2016-05-31");
    client.DefaultRequestHeaders.Add("x-ms-client-request-id", clientRequestId);
    client.DefaultRequestHeaders.Add("Authorization", auth);


text:
Q: Make image responsive maintaining aspect ratio, with padding either side Here is a link to the working pen: https://codepen.io/Adam0410/pen/OBqRRN
HTML

CSS
#imgWrapper {
  display: flex;
  justify-content: center;

  width: 100%;

  padding: 0 20px;
}

#imgWrapper img {
  width: 100%;
  max-width: 1660px;
  height: auto;
}

I don't want the image to exceed its original width (hence max-width) but I want it to scale down to the width of the viewport while maintaining its aspect ratio. Currently, the height does not scale with the width, why is this?

A: Why do you need display flex to imgWrapper?
Change it to block and it will work as expected. In case you need flex in there add it to other wrapper.
#imgWrapper {
  display: block;
}

A: What about using the vm unit to your #imgWrapper making it always responsive:
#imgWrapper {
 display: flex;
 justyfy-content: center;
 vm: 100%;
 padding: 0 20px;
}


text:
Q: What can prototypal approach do that es6 class can't? Is there anything that can only be achieved with classic/old prototypal approach, yet?
Why I need this: imagine I am writing a subset of JS that is free of old stuff (prototypes instead of classes, var, etc.)

A: There are several things, including but not limited to:

*

*When using the function notation, you can call the constructor without new. The class notation forbids this.
As a side note: where sub-classing would tradionally be done with something like MyParentClass.call(this) (which is not allowed when MyParentClass was defined with class), you would now combine the class syntax with the extends and super keywords.

*function declarations can appear after their use, since they are hoisted, class declarations are not.

*function declarations can be overridden by a new declaration, class declarations cannot redefine an earlier declaration

*Prototype methods can be used as constructors when defined in the old style, not when defined using the class syntax.

*function declarations can be made in "sloppy" mode (not strict), while class methods always run in strict mode. As a consequence you cannot use the caller, callee or arguments properties of the methods/constructor in class notation. All other consequences of strict mode apply as well of course. It would go too far too list them all here.

*You can assign a new object to an old-style function's prototype property (it is writable). With class the prototype property is not writable (note that this does not mean you cannot mutate it).


text:
Q: Incorrect line ending characters from Excel-generated .txt files not accepted by Gnuplot I want to make a data file of 1000+ data points to splot with Gnuplot. However, Excel uses the CR line endings, while I can only get LF to work fully.
The Gnuplot command I use is simply splot "data.txt" u 1:2:3 w l.
As mentioned in the comments, I tried to use
splot '< tr "\r" "\n" < data.dat' u 1:2:3

This partly solved my problem; now at least some data points show up (Fig. 1), but the y-values are incorrect (all set to 1).
Also, I get the same results as in Fig. 1 if I copy the data contents into a text file on a linux system via ssh conncetion to a univeristy computer.
cat -v data.txt

(linux-generated text file) results in printing the data, while doing the same with the Excel generated text file gives:
1   1   3^M1    2   4^M1    3   5^M     ^M2 1   6^M2    2   7^M2    3

It should be
1 1 3
1 2 4
1 3 5

2 1 6
2 2 7
2 3 8

Fig. 1

A: If the problem it's a file ending with CR, you can filter those by plotting through a pipe:
plot '< tr "\r" "\n" < data.dat'

On the other hand, I tested CRLF and gnuplot understands those.
p.s. That's a shame that excel uses CR: that was used on mac os 9...


text:
Q: Understanding the & operator in templates so im currently reading sams Teach yourself C++ and am unable to figure out when and why the & operator is used, as it seems like it would be uneccesary in many cases like so:
template <typename objectType>
objectType & GetMax (const objectType & value1, const objectType & value2)
{
    if (value1 > value2)
        return value1;
    else
        return value2;
};

Another example:
Template <typename T>
class myTemplateClass
{
public:
    void SetVariable (T& newValue) {m_Value = newValue; };

    T& GetValue() {return m_Value;};

private:
    T m_Value;
};

Please help me understand why &, which I know gets the address of the data type, is here! its definately not making learning the STL any easier.......... THANKS! =)

A: That's not an operator, and it's not (directly) related to templates.
It's a type modifier, creating (or indicating or denoting or forming) a reference, just like * creates a pointer.
Much of the time, it's an optimization rather than a necessity.  Two Three cases where it is necessary:

*

*In the copy-constructor, it's needed to avoid infinite recursion:
class X
{
     //X(X);
     // pass by value, the formal parameter is a copy of the actual parameter
     // the copy constructor must be called to make the copy

     X(const X&); // pass by reference, ok, no copy constructor call necessary
};

Const references in general save having to copy a large object, which is a useful optimization with no surprising behavior.

*When the return type of a function, especially operator[] overload, must appear on the left hand side of an expression:
class Container
{
     //Element operator[](int index);
     // problematic because c[i] is a temporary
     // so c[i] = 5; doesn't actually modify the collection, like it would with an array

     Element& operator[](int index); // correct

};
As a similar case, for operators that mutate their left operand, like compound assignment and stream insertion, it's necessary to use a non-const reference parameter.
Any other cases (e.g. output arguments) can (and I think should) be handled with pointers, since a function call that LOOKS like pass-by-value but changes its argument violates the principle of least-surprise.  Perfect example: auto_ptr<int> a = new int(5); f(a); /* is a still valid !?! */
Which brings us to case 3, (created because somebody used non-const references outside of operators):

*

*In templates, when the actual type might by auto_ptr or unique_ptr, a reference is needed to avoid inferring a type that destroys the original:
auto_ptr<int> a = new int(5);

//template<typename T>
//void dump_target( T handle ) { cout << *item; }
// bad: dump_target(a); destroys *a

template<typename T>
void dump_target( const T& handle ) { cout << *item; } // correct


text:
Q: WCF Between Matlab & a C# application I am trying to communicate between 2 applications.
1 matlab application
1 C# written application.
The C# application publishes its functions with the Microsoft WSDL application that is non-standard and matlab cannot understand it.
Do you know of any solutions to this problem?
Some application that does publish the WCF functions in a standard manner or some automatic tool that fixes this?
Thanks,

A: A well-known issue - actually, the Microsoft output is standard-compliant, but most other systems don't support it :-)
Check out these WCF extensions that will allow you to "flatten" your WSDL to include the XSD as inline <wsdl:schema> elements:

*

*Flatten your WSDL with this Custom ServiceHost for WCF

*Improving WCF Interoperability: Flattening your WSDL

*Flatten WCF WSDL on demand

*Inline XSD in WSDL for WCF
Hope that helps!
Marc

A: You can change the C# application as a .net remonting service.
And then, you can use matlab-net-api call C# dll to communicate with the service.
As the mode, you can use WCF as a service and use use matlab-net-api call C# dll to communicate with the service.

A: IPC: You can do this with interprocess communication. For example you could use a socket or a named pipe.
DLL: Or if you just want to use the C# methods in Matlab you could build a .NET framework dll and use it in matlab with NET.addAssembly('path to your dll');
MQTT: If the interprocess communication is to complicated, you could also use MQTT for simple messaging (for example JSON) between the processes.


text:
Q: Adding a TemplateField to a GridView at Runtime I have a set of GridViews and DataSources which shared several columns and settings, so I combined them all into one UserControl, which I gave a DataControlFieldCollection to enabled me add columns to the aspx file.  Thus, I can do this:
<mine:PreGeneratedGridView runat="server">
    <Columns>
        <asp:BoundField DataField="mycolumn"
            HeaderText="My Header" SortExpression="mycolumn" />
    </Columns>
</mine:PreGeneratedGridView>

I am using this code to move additional columns into the GridView that is contained in my PreGeneratedGridView UserControl:
    protected void Page_Load(object sender, EventArgs e)
    {
        for (int i = 0; i < Columns.Count; ++i)
        {
            if (IsPostBack) myGridView.Columns.RemoveAt(i);
            myGridView.Columns.Insert(i, Columns[i]);
        }
    }

It strikes me as a bit ugly (and probably flat out wrong, though it seems to work) to be adding the columns to the GridView on every page load, but when I tried putting this column-loading code into Page_Init it prevented columns of type TemplateField from running (i.e., the columns were blank, though the header was not) during a PostBack.
Is there a way to load my columns without using Page_Load/IsPostBack in this manner?

A: The following example should help you. It uses a class that implements ITemplate and allows you to add controls to dynamically created TemplateFields with EditItemTemplates.
How to add a ComboBox to an asp.net unbound GridView

A: I'm not entirely certain what you're asking, but if your goal is to display fields in a TemplateField in a GridView where the GridView is bound to an anonymous type, you could write something like this, using the Eval method:
// Code to bind GridView
gv.DataSource = foo.Select( x => new {
    field1 = x.boomboom(),
    field2 = x.scramble() };
gv.DataBind;

<%-- code in your ASP.net codebehind --%>
    <asp:TemplateField>
        <ItemTemplate>
            <%# Eval("field1").ToString() %>
        </ItemTemplate>
    </asp:TemplateField>
    <asp:TemplateField>
        <ItemTemplate>
            <%# Eval("field12).ToString() %>
        </ItemTemplate>
    </asp:TemplateField>


text:
Q: Change transform-origin on already scaled element I am trying to achieve a zoom effect which takes into consideration where on the to-be-zoomed element the user decides to scroll-in i.e. zoom.
In order to achieve this I'm trying to change the transform-origin.
This change seems to cause the element to jump back to it's original position before changing the transform-origin and then scale up the element from that point.
if (i === 0) {
    $(this).css({
        'transform': 'scale(2)',
        'transform-origin': '100% 100%'
    });
    i++;
} else {
    $(this).css({
        'transform': 'scale(2.5)',
        'transform-origin': '30% 70%'
    });
}

Here's a fiddle that shows what I'm trying to explain.
Any help would be greatly appreciated.

A: You have set in your css: -webkit-transition: -webkit-transform 500ms linear;
This is valid only for transform, but not for transform-origin, because that's a separate property. That's why the origin jumps on second click. Instead write:
-webkit-transition: -webkit-transform 500 ms linear, //note the comma-separation
                    -webkit-transform-origin 500ms linear;

Now the transform-origin is transitioned too.
In a comma-separated list of properties you can define speed and easing for each property separately.
If you want the same behaviour for all properties, you can simply write:
-webkit-transition: all 500ms linear;

I have updated your fiddle.


text:
Q: Angular - 2 way data binding rxjs subject property, never emits on the child, yet emits on the parent I have this custom child component in the template of a parent component:
parent html:
<cb-filter-chip-list [(filter-chips$)]="$ctrl.filterChips$"
                     [(filter-chip-adds)]="$ctrl.filterChipAdds"
                     [(filter-chip-deletes)]="$ctrl.filterChipDeletes"
                     [(current-chip-count)]="$ctrl.currentChipCount"
                     (update-data-behind-filter-chips)="$ctrl.updateDataBehindFilterChips($event)">
</cb-filter-chip-list>

parent ts:
public filterChips$ = new BehaviorSubject<Array<FilterChip>>(undefined);
public filterChipAdds = new ReplaySubject<any>(10);
public filterChipDeletes = new Subject();

child ts:
export class FilterChipListComponent implements OnInit {
    @Input() public filterChips$: BehaviorSubject<Array<FilterChip>>;
    @Input() public filterChipAdds: BehaviorSubject<any>;
    @Input() public filterChipDeletes: Subject<any>;
    @Output() public updateDataBehindFilterChips = new EventEmitter<FilterChip[]>();
    createChip: Observable<any>;
    deleteChip: Observable<any>;
    chipVariations: Observable<unknown>;
    @Input() public currentChipCount: any;

    constructor() { }

    public ngOnInit(): void {
        this.createChip = this.filterChipAdds.pipe(map(chip => ([{ ...chip, action: 'add' }])));
        this.deleteChip = this.filterChipDeletes.pipe(
            tap((chipId) => this.updateDataBehindFilterChips.emit(chipId)),
            map(chipId => ([{ id: chipId, action: 'delete' }])));
        this.chipVariations = merge(this.createChip, this.deleteChip);
        this.currentChipCount = this.chipVariations.pipe(
           // startWith(this.filterChips$.value),
            scan((totalCurrentChips: FilterChip[], changeInChips: ChipAction) => {
                if (changeInChips[0].action === 'add') {
                    if (totalCurrentChips.some(tcc => tcc.id === changeInChips[0].id)) {
                        totalCurrentChips.forEach(element => {
                            if (element.id === changeInChips[0].id) {
                                element.text = changeInChips[0].text;
                            }
                        });
                    } else {
                        totalCurrentChips.push(changeInChips[0]);
                    }
                } else if (changeInChips[0].action === 'delete') {
                    totalCurrentChips = totalCurrentChips.filter(chip => chip.id !== changeInChips[0].id);
                }
                return totalCurrentChips.sort((a, b) => a.sortOrder - b.sortOrder);
            })
        );

        // console.log(this.filterChipAdds);
        this.currentChipCount.subscribe();
        this.filterChipAdds.subscribe(x => console.log("fc", x));
    }
}

In the parent I make it emit by doing this:
this.filterChipAdds.next({
                id: "fromDate",
                sortOrder: 4,
                text: `From Date - ${this.datePipe.transform(this.userCacheItem.silentData.fromDate, "dd MMM yyyy")
                    }`
            });

For some reason the this.filterChipAdds.subscribe(console.log); on the parent console logs the values being emitted, but the this.filterChipAdds.subscribe(x => console.log("fc", x)); doesn't log anything. nothing emits on the child. even though it should technically emit for both since it is a two way data binding. Why is the emission not mirrored on the child component?

A: I don't think there is any issue with 2 way binding, it should work the way you are expecting i.e. the child component's subscribe should also gets triggered.
Now I actually took your code and try to run and it did work if I comment some of the lines and that makes me think that it won't work if you pass some undefined value from your parent. Because as soon as observable emits an error it will stop emitting new items, unless you have handle the errors correct which is not the case here.
Here is how I tired
In child component
@Input() public filterChips$: BehaviorSubject<Array<any>>;
    @Input() public filterChipAdds: BehaviorSubject<any>;
    @Input() public filterChipDeletes: Subject<any>;
    @Output() public updateDataBehindFilterChips = new EventEmitter<any[]>();
    createChip: Observable<any>;
    deleteChip: Observable<any>;
    chipVariations: Observable<unknown>;
    @Input() public currentChipCount: any;

    constructor() { }

    public ngOnInit(): void {
        // this.createChip = this.filterChipAdds.pipe(map(chip => ([{ ...chip, action: 'add' }])));
        // this.deleteChip = this.filterChipDeletes.pipe(
        //     tap((chipId) => this.updateDataBehindFilterChips.emit(chipId)),
        //     map(chipId => ([{ id: chipId, action: 'delete' }])));
        // this.chipVariations = merge(this.createChip, this.deleteChip);
        // this.currentChipCount = this.chipVariations.pipe(
        //    // startWith(this.filterChips$.value),
        //     scan((totalCurrentChips: any[], changeInChips: any) => {
        //         if (changeInChips[0].action === 'add') {
        //             if (totalCurrentChips.some(tcc => tcc.id === changeInChips[0].id)) {
        //                 totalCurrentChips.forEach(element => {
        //                     if (element.id === changeInChips[0].id) {
        //                         element.text = changeInChips[0].text;
        //                     }
        //                 });
        //             } else {
        //                 totalCurrentChips.push(changeInChips[0]);
        //             }
        //         } else if (changeInChips[0].action === 'delete') {
        //             totalCurrentChips = totalCurrentChips.filter(chip => chip.id !== changeInChips[0].id);
        //         }
        //         return totalCurrentChips.sort((a, b) => a.sortOrder - b.sortOrder);
        //     })
        // );

        // console.log(this.filterChipAdds);
        // this.currentChipCount.subscribe();
        this.filterChipAdds.subscribe(x => console.log("fc", x));
    }

In parent component
filterChipAdds = new ReplaySubject<any>(10);

  click(){
    console.log('clicked');
    this.filterChipAdds.next('aaa');
  }

And just to test if its working created a button in parent component which will call the parent component's method which then set the value of observable.
<button (click)="click()">Click</button>

This is the output of the program after clicking on the button

What I recommend is first try to comment out all the lines and just focus on filterChipAdds the way I did it in the stackblitz. Once it starts showing you the result then one by one try to analyze the miss.
I hope you will track the down the issue this way.


text:
Q: Android: Manifest merger failed I seem to be getting the error of:

Error:Execution failed for task ':app:processDebugManifest'.> Manifest
  merger failed : Attribute meta-data#android.support.VERSION@value
  value=(26.0.0-alpha1) from
  [com.android.support:appcompat-v7:26.0.0-alpha1]
  AndroidManifest.xml:27:9-38 is also present at
  [com.android.support:exifinterface:25.3.1] AndroidManifest.xml:24:9-31
  value=(25.3.1). Suggestion: add 'tools:replace="android:value"' to
   element at AndroidManifest.xml:25:5-27:41 to override.

It seems as though this error is caused, when I include an image cropping library of: compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'
Gradle build
apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"

    defaultConfig {
        applicationId "com.myproj.blogapp"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.android.support:cardview-v7:26.0.+'
    compile 'com.android.support:recyclerview-v7:26.0.+'
    compile 'com.squareup.picasso:picasso:2.5.2'

    compile 'com.google.firebase:firebase-core:11.0.4'
    compile 'com.google.firebase:firebase-database:11.0.4'
    compile 'com.google.firebase:firebase-appindexing:11.0.4'
    compile 'com.google.firebase:firebase-storage:11.0.4'
    compile 'com.google.firebase:firebase-crash:11.0.4'
    compile 'com.google.firebase:firebase-auth:11.0.4'
    compile 'com.firebase:firebase-client-android:2.3.1'
    compile 'com.squareup.okhttp:okhttp:2.7.5'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+' //This dependency causing error

    // FirebaseUI Database only
    compile 'com.firebaseui:firebase-ui-database:2.1.1'

}
apply plugin: 'com.google.gms.google-services'

Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.myproj.blogapp"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        tools:node="replace"
        android:name=".SimpleBlog"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="PT Mosque"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:label="Feed">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
            android:theme="@style/Base.Theme.AppCompat" />
        <activity
            android:name=".PostActivity"
            android:windowSoftInputMode="adjustResize" />
        <activity
            android:name=".timetable"
            android:label="Salah Times"
            android:windowSoftInputMode="adjustResize" />
        <activity android:name=".RegisterActivity" />
        <activity android:name=".LoginActivity" />
        <activity android:name=".SetupActivity"></activity>
    </application>

</manifest>

A: Change
 compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
 compile 'com.android.support:design:26.0.0-alpha1'
 compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'

to
 compile 'com.android.support:appcompat-v7:26.+'
 compile 'com.android.support:support-v4:26.+'
 compile ('com.theartofdev.edmodo:android-image-cropper:2.4.+'){

        exclude group: 'com.android.support'
}

A: Add this to
xmlns:tools="http://schemas.android.com/tools"
Add this to
tools:node="replace"

A: Image cropper library requires older version of support library than your app.
There's a fresh bug filled in the issues for the library already but it's not fixed yet.
You can downgrade support library version used by your app ( to 25.3.1 ) and wait for a fix.
EDIT: you would need to lower build target accordingly. There's another bug for build target on github.


text:
Q: How to debug Qt dll issues with cross compiled builds? After cross-compiling Qt 5 applications (host: Fedora 19/64 bit, target: Windows 32 bit) I execute following steps for deploying the executable:
$ DEST=/windows/testdir
$ cp /usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll $DEST
$ mkdir $DEST/platforms
$ cp /usr/i686-w64-mingw32/sys-root/mingw/lib/qt5/plugins/platforms/qwindows.dll\
     $DEST/platforms
$ cp release/main.exe $DEST # the cross-compiled Qt5 binary

I test it on Windows like this:
say /windows is mounted on f:
start command prompt window
f:
cd testdir
main

And there I get:

Failed to load platform plugin "windows". Available platforms are:

Microsoft Visual C++ Runtime Library
  This application has requested the Runtime to terminate it in an unusual way.
  Please contact the application's support team for more information.

I don't really believe the first message because:
a) the above steps worked in the past (executed on the same Fedora 19 system)
b) the platforms directory is there as documented in the qt docs.
What changed is that now the application includes some PNGs/JPGs in dialogs (read via Qt's resource file system, as QIcons).
Thus, I've also copied some plugins:
$ cp -r /usr/i686-w64-mingw32/sys-root/mingw/lib/qt5/plugins $DEST

Which didn't help to resolve the above issue.
Conclusion
Is there a way to debug dynamic runtime linker issues like these?
Can I instruct it such that I somehow get output on which dll's the app/linker tries to load and where is does its lookups? (and why they fail ...)
For example something like this would be great:
ldd: main.exe -> load of foo.dll in work-dir failed (no such file)
ldd: main.exe -> load of bar.dll in work-dir/platforms failed (wrong file format)
ldd: main.exe -> load of baz.dll in work-dir successful
...

Compile steps
I used following steps for cross-compiling on Fedora 19:
$ mingw32-qmake-qt5 main.pro -o win32.mf
$ mingw32-make -f win32.mf
$ # -> binary is created in release/main.exe

Wine
I've looked at wine for testing purposes. It is helpful because it displays an error message when it can't find a DLL, e.g.:
$ wine $DEST/main.exe
err:module:import_dll Library libEGL.dll (which is needed by L"Z:\\usr\\i686-w64-mingw32\\sys-root\\mingw\\lib\\qt5\\plugins\\platforms\\qwindows.dll") not found
err:module:import_dll Library libjpeg-62.dll (which is needed by L"Z:\\usr\\i686-w64-mingw32\\sys-root\\mingw\\lib\\qt5\\plugins\\imageformats\\qjpeg.dll") not found

Interestingly, it directly finds the platforms library and needed plugin under Z:\\usr\\i686-w64-mingw32\\sys-root\\mingw\\lib\\qt5\\.
But when all needed DLLs from /usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll are copied to $DEST, wine runs the same main.exe just fine - where on native windows (7) I get the above error boxes.

A: You can use tools like Dependency Walker for checking dependencies of a single DLL, Wine for quickly checking startup on the compile-host and Process Monitor to see which directories/files are accessed during runtime of the process.
It also makes sense to debug-output the library path from the Qt application, e.g.
int main(int argc, char **argv)
{
  qDebug() << "Library paths: " << QApplication::libraryPaths();
  QApplication app(argc, argv);
  ...

With that I get following output on native windows:
Library paths:  ()

(To enable qDebug() statements - even with release binaries - you have to add CONFIG += console to your qmake project file.)
Looking at the Process Monitor output it seems that the binary does not try to open any plugins (platforms or other) in its current working directory (CWD) nor in its base directory.
When I extend the library path the binary finds all needed plugins in its CWD:
int main(int argc, char **argv)
{
  QApplication::addLibraryPath(QDir::currentPath());
  QApplication app(argc, argv);
  ...

I don't know if this qualifies as a work-around - perhaps one is supposed to do something like this. But the Qt documentation seems to suggest opposite:

To deploy the application, we must make sure that we copy the relevant Qt DLL (corresponding to the Qt modules used in the application) and the windows platform plugin as well as the executable to the same directory in the release subdirectory.

The complete deploy procedure is now:
$ cp /usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll $DEST
# copying platforms, imageformats etc. plugin directories:
$ cp /usr/i686-w64-mingw32/sys-root/mingw/lib/qt5/plugins/* $DEST -r
$ cp release/main.exe $DEST

(Depending on what packages are installed on your compile-host you probably don't need to copy all DLLs - with wine it is easy to start a fixpoint iteration for all needed non-plugin dlls.)
Missing non-platform plugins don't necessarily abort the programs startup - e.g. without a jpeg plugin some icons are just not displayed.


text:
Q: Lists become pd.Series, the again lists with one dimension more I have another problem with pandas, I will never make mine this library.
First, this is - I think - how zip() is supposed to work with lists:
import numpy as np
import pandas as pd

a = [1,2]
b = [3,4]
print(type(a))
print(type(b))

vv = zip([1,2], [3,4])
for i, v in enumerate(vv):
    print(f"{i}: {v}")

with output:
<class 'list'>
<class 'list'>
0: (1, 3)
1: (2, 4)

Problem. I create a dataframe, with list elements (in the actual code the lists come from grouping ops and I cannot change them, basically they contain all the values in a dataframe grouped by a column).
# create dataframe
values = [{'x': list( (1, 2, 3) ), 'y': list( (4, 5, 6))}]
df = pd.DataFrame.from_dict(values)
print(df)

           x          y
0  [1, 2, 3]  [4, 5, 6]

However, the lists are now pd.Series:
print(type(df["x"]))

<class 'pandas.core.series.Series'>

If I do this:
col1 = df["x"].tolist()
col2 = df["y"].tolist()

print(f"col1 is of type {type(col1)}, with length {len(col1)}, first el is {col1[0]} of type {type(col1[0])}")

col1 is of type <class 'list'>, width length 1, first el is [1, 2, 3] of type <class 'list'>

Basically, the tolist() returned a list of list (why?):
Indeed:
print("ZIP AND ITER")
vv = zip(col1, col2)
for v in zip(col1, col2):
    print(v)

ZIP AND ITER
([1, 2, 3], [4, 5, 6])

I neeed only to compute this:
# this fails because x (y) is a list
# df['s'] = [np.sqrt(x**2 + y**2) for x, y in zip(df["x"], df["y"])]

I could add df["x"][0] that seems not very elegant.
Question:
How am I supposed to compute sqrt(x^2 + y^2) when x and y are in two columns df["x"] and df["y"]

A: This should calculate df['s']
df['s'] = df.apply(lambda row: [np.sqrt(x**2 + y**2) for x, y in zip(row["x"], row["y"])], axis=1)

A:
Basically, the tolist() returned a list of list (why?):

Because your dataframe has only 1 row, with two columns and both columns contain a list for its value. So, returning that column as a list of its values, it would return a list with 1 element (the list that is the value).
I think you wanted to create a dataframe like this:
values = {'x': list( (1, 2, 3) ), 'y': list( (4, 5, 6))}

   x  y
0  1  4
1  2  5
2  3  6

A: values = [{'x': list( (1, 2, 3) ), 'y': list( (4, 5, 6))}]
df = pd.DataFrame.from_dict(values)

print(df) # yields
           x          y
 0  [1, 2, 3]  [4, 5, 6]

An elegant solution to computing sqrt(x^2 + y^2) can be done by converting the dataframe as following:
new_df = df.iloc[0,:].apply(pd.Series).T.reset_index(drop=True)

This yields the follwoing output
    x   y
0   1   4
1   2   5
2   3   6

Now compute the sqrt(x^2 + y^2)
np.sqrt(new_df['x']**2 + new_df['y']**2)

This yields :
0    4.123106
1    5.385165
2    6.708204
dtype: float64


text:
Q: How to show PIN code screen when the app is activated from the background with React native? I am developing an app with React native, my problem is to display a PINCode screen when the app is reactivated from the background.
I used PINCode component from @haskkor/react-native-pincode for the PIN code input screen. It works well when the user login to the app, but I am not sure how to set the configuration or some other statements for displaying this screen when the user reactive the App from the background.
Any answer or comments would be great help to me!
Thanks in advance.

A: You probably need AppState
Just need to manage something in parent component to display pincode component.
AppState will provide you current state of application, and prevState of application can be stored. So your condition can be something like
appState = AppState.currentState
AppState.addEventListener("change", websocketManager._handleAppStateChange)

_handleAppStateChange = nextAppState => {
    if (appState?.match(/inactive|background/) && nextAppState === "active") {
        // Coming from background, so display pincode component.
    }
    appState = nextAppState
}

A: You can implement appstate update listener and navigate to any specific screen depending on the state update, details can be found in the following link Appstate


text:
Q: How to get a div height within owl-carousel on window resize? I am using owl-Carousel to a project and I need the height of the content div(topSlidetxt) inside owlCarousel on window resize and window load, I have tried this but can't get any positive result yet.
$('.heroSlide').owlCarousel({
  smartSpeed: 1500,
  items: 1,
  margin:0,
  nav:true,
  dots:true
});

        South Beach Residences

Icon to Many, Home to Few

        DISCOVER MORE

A: You should use API Events (initialized.owl.carousel, resized.owl.carousel) of Owl Carousel 2
Example of usage:
$('.heroSlide').owlCarousel({
  smartSpeed: 1500,
  items: 1,
  margin:0,
  nav:true,
  dots:true,
  onInitialized: function () { /* read and use $('.topSlidetxt').height() here */ },
  onResized: function () { /* read and use $('.topSlidetxt').height() here */ },
});

live example code: https://jsfiddle.net/cichy380/sna04L7p/