text:
Q: Parsing through a String Array inside a HashMap so basically, I'm trying to parse through each map entry of a HashMap while also reading each string value in the String array. I will then use each of those string values in the array as parameters for specific methods. Now, I know how to parse through each map entry, it's just the iterating through the string array in the map that's confusing me. Any advice?
My code:
HashMap<String,String[]> roomSite = new HashMap<String, String[]>();

Set set = roomSite.entrySet();

Iterator<Map.Entry<String, String[]>> iterator = set.iterator();

while(iterator.hasNext()) {
    Map.Entry mentry = (Map.Entry)iterator.next();
        System.out.print("key is: "+ mentry.getKey() + " & Value is: ");
        System.out.println(Arrays.deepToString((String[]) mentry.getValue()));
}

Output:
key is: 0 & Value is: [wall, d0, wall, wall]
key is: 1 & Value is: [d0, wall, d1, wall]
key is: 2 & Value is: [wall, wall, wall, d1]

A: You already have the String array, just assign it to a variable:
String[] stringArray = (String[]) mentry.getValue();

for (String str : stringArray){
    // process str
}

A: Solution  using Java 8 stream feature
HashMap<String,String[]> roomSite = new HashMap<>();
roomSite.put("1",new String[]{"Hello","World"});
roomSite.put("2",new String[]{"India","Germany"});

//This is to print all value for given key but if you want process for each key with all value then put ur logic into forEach
roomSite.entrySet().stream().map(entry -> "key is: "+entry.getKey() + " & Value is: " + Arrays.stream(entry.getValue())
        .collect(Collectors.joining(","))).forEach(System.out::println);

//This logic emits entry for key and value from array, basically you will have pair of key and value which can be used for processing
roomSite.entrySet().stream().flatMap(entry-> Arrays.stream(entry.getValue()).map(value->new AbstractMap.SimpleEntry<>(entry.getKey(),value))).forEach(simpleEntry-> {
    final String key= simpleEntry.getKey();
    final String value= simpleEntry.getValue();
    System.out.println("Key : "+ key+" , value : "+ value);

    //process ur logic
});


text:
Q: Pulling a custom H1 field into page code I wanted to create a custom field for pages where i can populate a custom H1 tag into the page. I used Advanced Custom Fields to make the field labeled "custom-h1" and then added the script call to header.php to pull through to all pages, but it's not currently working for all page types.
I've got one bit of script that works for all normal pages, and one that works for all category pages.. but I need a piece of script that will work across the whole site (all page types). Code below:
If I use this, then it succesfully pulls field data through, but only for normal "pages" (eg /contact/):

<?php the_field('custom-h1'); ?>

If I use this, I get the opposite affect (it ONLY works for category pages):

<?php
$queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id;
the_field('custom-h1', $taxonomy . '_' . $term_id);
?>

Please help! I feel like this is a really basic solution, I simply don't know enough about PHP to make it so.

A: try this one:
<?php echo "
";
 $queried_object = get_queried_object();
$taxonomy = $queried_object->taxonomy;
$term_id = $queried_object->term_id; echo "
"  ?>

redpajama_set_name: RedPajamaStackExchange


text:
Q: Stuck to run Selenium RC script simultaneously in multiple browsers I am working in selenium RC with Java+Junit+Eclipse.
For my project I have developed script which will run in only one browser i.e Firefox through the below code..
public void setUp() throws Exception
{
   selenium = new DefaultSelenium("localhost", 4444,"*firefox","http://www.google.com");
   FinalTestSuite.selenium.start();
   selenium.windowFocus();
   selenium.windowMaximize();
}

Now I am stuck because requirement came to run the script simultaneously in multiple browsers.
I didn't find any helpful article..
Please anyone working on this same scenario...HELP! :)

A: You can use Selenium Grid to run a script in multiple browsers. Also you can refer this blog regarding its setup configuration.
Hope this helps.

A: Create a runner which will run the suite containing setUp()
Pass the browser name by variable to setup.
You can run the code multiple times with multiple RC server started on different ports.
e.g. My projects runs through ant so i pass -Dargument=*firefox on command prompt then my test cases run on firefox browser also you can pass the port number and host ip.
Thanks

A: The best thing to use for parallel execution is TestNG. But since you are using Junit , the following link may help you in that.
http://blog.varunin.com/2011/07/running-selenium-tests-on-different.html


text:
Q: Macro in VBA for excel that processes large quantities of data I need some help with a particular macro I am working on.
The macro processes columns of data that have been imported from a pdf file. The import process produces multiple sheets of consistent data, all variables stay in the same columns across multiple sheets. This macro needs to read the three columns of numbers, subtract all cells in two columns one from another, place solved value in an empty column at the end of each row. Then repeat with another combination of two columns. After that, it needs to compare the solved values against a margin value, and generate a new sheet that pulls the whole row of data that the failed margin value is in to a new sheet at the front of the workbook.
This is what I have so far.
I can preform the function on one sheet so far, but don't know how to automate this to the other sheets. Numbers populate columns B, C, and D, Answers should be placed in G, H and any other columns after H are empty.
Private Sub FindAndCreateSheet3dBm()
  ' Declare variables
    Dim eWs As Worksheet
    Dim rMargin As Range
    Dim myUnion As Range

        'Column G: subrtact max and measured values
        Worksheets("page 6").Range("G1:G21").Formula = "=(C1-D1)"
            '*need to fix sheet reference, make all sheets, add flexible range to
            'end of G range

       'Column H: subrtact measured and min values
         Worksheets("page 6").Range("H1:H21").Formula = "=(D1-B1)"
            '*need to fix sheet reference, make all sheets, add flexible range to
            'end of H range

      ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
      ' Create the report sheet at first position then name it "Less than 3dBm"
      Dim wsReport As Worksheet
      Dim rCellwsReport As Range
      Set wsReport = ThisWorkbook.Sheets.Add(Before:=ThisWorkbook.Sheets(1))
      wsReport.Name = "Less than 3dBm"

      Set rCellwsReport = wsReport.Cells(1, 1)

      'Create union of columns to search G and H?
        Set myUnion = Union(Columns("G"), Columns("H"))

      'Check whole Workbook, union G and H  for values less than rMargin

    NextSheet:
      Next
    End Sub

Thank you

A: This should work for your needs. Before I get into my code, I just want to note that usually the response you'll get from the community when asking a 'how do I do this' question is that SO is not a code for me site. We are happy to help fix broken code, but these kinds of problems can generally be solved with Google.
That being said, I wanted a break from the project I was working on, so I threw this together. My hope here is that you can use it as a learning opportunity of how to write better code (and maybe get some kudos from your boss in the process).
Here's the code:
Private Sub FindAndCreateSheet3dBm()
    ' Ideally, you wouldnt even use something like this. For your purposes
    ' it will get you going. I highly recommend finding a dynamic way of
    ' determining the positions of the data. It may be consistent now, but
    ' in the world of programming, everything changes, especially when
    ' you think it wont.

    Const FIRST_INPUT_COL As Long = 3       ' Column    C
    Const SECOND_INPUT_COL As Long = 4      '           D
    Const THIRD_INPUT_COL As Long = 2       '           B

    Const FIRST_OUTPUT_COL As Long = 7      '           G
    Const SECOND_OUTPUT_COL As Long = 8     '           H

    Dim marginReport As Worksheet
    Set marginReport = ThisWorkbook.Sheets.Add(Before:=ThisWorkbook.Sheets(1))
    marginReport.Name = "Less than 3dBm"

    Dim targetWorksheet As Worksheet

    For Each targetWorksheet In ThisWorkbook.Worksheets
        If Not targetWorksheet Is marginReport Then
            Dim inputData As Variant
            inputData = targetWorksheet.UsedRange.value

            Dim outputData As Variant
            ' I resize the array to be the exact same as the first, but to add two additional columns
            ReDim outputData(LBound(inputData, 1) To UBound(inputData, 1), LBound(inputData, 2) To UBound(inputData, 2) + 2)

            Dim i As Long
            Dim j As Long
            ' Loop through rows
            For i = LBound(inputData, 1) To UBound(inputData, 1)
                ' Loop through columns
                For j = LBound(inputData, 2) To UBound(inputData, 2)
                    ' Essentially, just copy the data
                    outputData(i, j) = inputData(i, j)
                Next
            Next

            Dim offSetValue As Long
            If LBound(outputData, 2) = 1 Then offSetValue = -1
            ' For your purposes I will use hardcoded indices here, but it is far more ideal to manage this in a more flexible manner
            For i = LBound(outputData, 1) To UBound(outputData, 1)
                outputData(i, FIRST_OUTPUT_COL) = outputData(i, FIRST_INPUT_COL) - outputData(i, SECOND_INPUT_COL)
                outputData(i, SECOND_OUTPUT_COL) = outputData(i, FIRST_OUTPUT_COL) - outputData(i, THIRD_INPUT_COL)
                If LessThanMargin(outputData(i, SECOND_OUTPUT_COL)) Then
                    For j = LBound(outputData, 2) To UBound(outputData, 2)
                        ' I start with the output worksheet, and use the 'End(xlUp) to find the first
                        ' non-blank row. I then iterate columnwise and add values to the row beneath it.
                        ' The offSetValue variable ensures I am not skipping any cells if the array
                        ' is 1-Based versus the default 0-Base.
                        marginReport.Range("A1048576").End(xlUp).Offset(1, j + offSetValue).value = outputData(i, j)
                    Next
                End If
            Next

            OutputArray outputData, targetWorksheet, "UpdatedData_" & UCase(Replace(targetWorksheet.Name, " ", "_"))
        End If
    Next
End Sub
' I am just checking for a negative number here, but change this to use the logic you need
Public Function LessThanMargin(ByVal InputValue As Double)
    LessThanMargin = InputValue < 0
End Function
Public Sub OutputArray(ByVal InputArray As Variant, ByVal InputWorksheet As Worksheet, ByVal TableName As String)

    Dim AddLengthH As Long
    Dim AddLengthW As Long

    If NumberOfArrayDimensions(InputArray) = 2 Then
        If LBound(InputArray, 1) = 0 Then AddLengthH = 1
        If LBound(InputArray, 2) = 0 Then AddLengthW = 1

        Dim r As Range
        If Not InputWorksheet Is Nothing Then
            With InputWorksheet
                .Cells.Clear
                Set r = .Range("A1").Resize(UBound(InputArray, 1) + AddLengthH, UBound(InputArray, 2) + AddLengthW)
                r.value = InputArray
                .ListObjects.Add(xlSrcRange, r, , xlYes).Name = TableName

                With .ListObjects(1).Sort
                    .Header = xlYes
                    .MatchCase = False
                    .Orientation = xlTopToBottom
                    .SortMethod = xlPinYin
                    .Apply
                End With
            End With
        End If
    End If
End Sub

I use arrays to solve the problem since they are far more efficient when processing data versus using excel-formulas. While this is unlikely to make a performance boost on a ~200 row project, it makes tremendous differences when you're dealing with a few thousand rows or even more.
I also used constants for the column positions to make it easier for you to adjust these in the future. This comes with a caution though, even constants (for this purpose) are terrible habit so dont get used to them. Learn how to calculate where the data is.
Finally, please (for the love of all that is programmatic) don't just copy and paste this code and never look back. I put this up here for you (and others) to learn from it. Not for it to be some sort of quick fix. I hope you can use it to grow.


text:
Q: Pymongo way slower than MongoDB on the exact same query I have a query that I'm running in both pymongo and Mongodb.
The bottleneck is most probably in the $match statement.
But it runs fine in MongoDB and gives me issues in Pymongo.
Query -
list(db.mentorbasicdetails.aggregate([

    {"$lookup":{
        "from":"colleges",
        "let":{
                     "college":"$educations.collegeId",
                     "profile":"$educations.profileTypeId"
              },
        "pipeline":[

          { "$match": {
            "$expr": {
              "$and": [
                { "$eq": ["$patientId", "$$patientId"] },
                { "$eq": ["$_id", "$$college"] }
              ]
            }
          }},

            {"$project":

                 {

                     "tier":{"$min":["$tier",3]},
                     "profile":"$$profile",
                     "_id":0

                 }

            }

        ],
        "as":"collegetiers"
    }},
]))

pymongo.has_c() returns True.
Takes around a minute to run in pymongo but ~2 secs for MongoDB.


text:
Q: Copying a value from range "H" after inserting rows based on the range "F" value I found a code that I use to insert rows based on the cell value:
Sub Add_Rows()
  Dim r As Long

  Application.ScreenUpdating = False
  For r = Range("F" & Rows.count).End(xlUp).Row To 1 Step -1
    If Cells(r, "F").Value > 0 Then Rows(r + 1).Resize(Cells(r, "F").Value).Insert
  Next r
  Application.ScreenUpdating = True
End Sub

But I also need to copy the value of the cell with the same index as "F" into the inserted rows:

How can I modify the code so that rows are inserted based on the value of the range F and a value from the range H is inserted into these rows in parallel?
That is, the script should have logic: if the value of "F" is 2, two rows are inserted - and the value from the index "H" is inserted into these two new rows
In the code that I sent, I manage to insert rows based on the value from the index "F", but I can't supplement the code so that the value from the index H is inserted for each new row
Please tell me how to modify the code?
Thanks

A: Try something like this:
Sub Add_Rows()

  Dim r As Long

  Application.ScreenUpdating = False

  For r = Range("F" & Rows.Count).End(xlUp).Row To 1 Step -1
    If Cells(r, 5).Value > 0 Then
        Rows(r + 1).Resize(Cells(r, 5).Value).Insert
        ' insert h value
        Cells(r + 1, 7).Value = Cells(r, 7).Value
    End If
  Next r

  Application.ScreenUpdating = True

End Sub

A: I added a line after the .Insert that assigns the value to the "H" column of those new rows. I used the same dynamic range ideas that .Insert used to find the correct range for those new rows.
Sub Add_Rows()
  Dim r As Long

  Application.ScreenUpdating = False
  For r = Range("F" & Rows.Count).End(xlUp).Row To 1 Step -1
    If Cells(r, "F").Value > 0 Then
        Rows(r + 1).Resize(Cells(r, "F").Value).Insert
        Cells(r + 1, "H").Resize(Cells(r, "F").Value).Value = Cells(r, "H").Value
    End If
  Next r
  Application.ScreenUpdating = True
End Sub


text:
Q: How to catch url parameter of a script (while on client server) plugin in json So i have been able to catch in separate tests catching url parameters successfully. But i'm struggling with connecting it all up.
Where the parameter is in a second layer. If i can put the pubID in a var that would be great.
Or if somebody can point me in the right direction that would be great. Thanks
So i'm planning to build api widgets, but having trouble with getting parameter from the script
On the clients server i would have the following script

Then the loader script would have the following code.
The following code is the loader.js file. This code has been written by someone else which works great for widgets, but having trouble to get the basics done haha
(function() {

// Localize jQuery variable
var jQuery;

/******** Load jQuery if not present *********/
if (window.jQuery === undefined || window.jQuery.fn.jquery !== '1.7.2') {
var script_tag = document.createElement('script');
script_tag.setAttribute("type","text/javascript");
script_tag.setAttribute("src",
    "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js");
if (script_tag.readyState) {
  script_tag.onreadystatechange = function () { // For old versions of IE
      if (this.readyState == 'complete' || this.readyState == 'loaded') {
          scriptLoadHandler();
      }
  };
} else {
  script_tag.onload = scriptLoadHandler;
}
// Try to find the head, otherwise default to the documentElement
(document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag);
} else {
// The jQuery version on the window is the one we want to use
jQuery = window.jQuery;
main();
}

/******** Called once jQuery has loaded ******/
function scriptLoadHandler() {
// Restore $ and window.jQuery to their previous values and store the
// new jQuery in our local jQuery variable
jQuery = window.jQuery.noConflict(true);
// Call our main function
main();
}

/******** Our main function ********/
function main() {
jQuery(document).ready(function($) {
    /******* Load CSS *******/
    var css_link = $("<link>", {
        rel: "stylesheet",
        type: "text/css",
        href: "style.css"
    });
    css_link.appendTo('head');

    $.getJSON("http://api.yoursite.com/js/json.php?jsoncallback=?",
function(data){
  $('#myDiv').html(data.name);
});

});
}

})(); // We call our anonymous function immediately

To catch the parameters i used the following working script.
// Parse URL Queries
function url_query( query ) {
query = query.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var expr = "[\\?&]"+query+"=([^&#]*)";
var regex = new RegExp( expr );
var results = regex.exec( window.location.href );
if( results !== null ) {
    return results[1];
    return decodeURIComponent(results[1].replace(/\+/g, " "));
} else {
    return false;
}
}

// Example usage - http://www.kevinleary.net/?load=yes
var url_param = url_query('pubID');
if( url_param ) {
alert(url_param); // "yes"
}

A: It's called query string.
Use the function provided in this post: How can I get query string values in JavaScript?


text:
Q: Using a button and a menu item to call the same fragment (without creating duplicates in backStack) I am creating an application that has a drawer one MainActivity and many fragments one of the fragments holds all the buttons to the other fragments (excluding it self) so both the buttonsFragment and the drawer can call the fragments now the problem is that im creating two copies of each fragment when i call it from the drawer and when i call it from the buttonsFragment
My code:
MainActivity()
 @SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
    // Handle navigation view item clicks here.

    int id = item.getItemId();
    xFragment xFrag = new xfragment();

    if (id == R.id.menuItem1) {

        FragmentManager manager = getSupportFragmentManager();
        android.support.v4.app.FragmentTransaction fM =     manager.beginTransaction();

        boolean moneyFragmentPoppedMenu = manager.popBackStackImmediate(xFragName,0);

        if(!FragmentPoppedMenu){

            fM.replace(R.id.content_main, xfrag, mT);
            fM.addToBackStack(mFragName);
            fM.commit();
        }

       else if (FragmentPoppedMenu){

        fM.replace(R.id.content_main, xfrag);}

    }

buttonsFragment()
xFragButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            FragmentManager manager = getActivity().getSupportFragmentManager();

            android.support.v4.app.FragmentTransaction fM = manager.beginTransaction();
            boolean FragmentPoppedButton = manager.popBackStackImmediate(xFragName, 0 );

            if(!FragmentPoppedButton){
                fM.replace(R.id.content_main, xfrag);
                fM.addToBackStack(xFragName);
                fM.commit();
            }

         else  if (FragmentPoppedButton){ fM.replace(R.id.content_main, xfrag);}

I found out because when i open from menu and type something in an editText then open from buttonsFragment it shows a clear editText then when i open again from menu what i typed is still there

A: @SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
// Handle navigation view item clicks here.

int id = item.getItemId();
xFragment xFrag = new xfragment();

if (id == R.id.menuItem1) {
         xFragButton.performClick();

}

buttonsFragment:
onCreateView(){
Button xFragButton = (Button) v.findViewById(R.id.Button1);

xFragButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        FragmentManager manager = getSupportFragmentManager();
    android.support.v4.app.FragmentTransaction fM =     manager.beginTransaction();

    boolean moneyFragmentPoppedMenu = manager.popBackStackImmediate(xFragName,0);

    if(!FragmentPoppedMenu){

        fM.replace(R.id.content_main, xfrag, mT);
        fM.addToBackStack(mFragName);
        fM.commit();
    }

   else if (FragmentPoppedMenu){

    fM.replace(R.id.content_main, xfrag);
   }


text:
Q: how set value in dictionary when content a dictionary and class I defined the variable below:
Dictionary<clssMenu_Item, Dictionary<clssMenu_Item, List<clssMenu_Item>>> dicMenu =
        new Dictionary<clssMenu_Item, Dictionary<clssMenu_Item, List<clssMenu_Item>>>();

The type clssMenu_Item is defined as:
class clssMenu_Item
{
    public string name;
    public string text;
}

I have a string (I call strKey) already assigned to the text property of clssMenu_Item inside dicMenu.  It's clear text is part of key.  I want to search dicMenu to find value of strKey in all over of dictionary such as its sub. I don't know how can get this value?!
this method calculates the key of the dictionary:
private  List<clssMenu_Item> GetFormButtons(Form form)
{
    List<clssMenu_Item> ListBtn = new List<clssMenu_Item>();
    foreach (Control c in GetAllControls<Button>(form))
    {
        int btnIndex= c.Name.IndexOf("btn");
        if (btnIndex != 0) // find all of the determined buttons
        {
            clssMenu_Item objBtn = new clssMenu_Item();
            objBtn.name = c.Name.ToString();
            objBtn.text = c.Text;

            ListBtn.Add(objBtn);
        }
    }
    return ListBtn;
}

here is how I populate the key:
foreach (var k in objH.mainForm) //fill dicMenu
{
    dicMenu.Add(k,null);
}

The reason that I'm using a nested dictionary is that this tree has only 3 levels.  Each clssMenu_Items has a group of children like itself type.  dictionary was my solution to save them.
problem:
now I wanna fill value of keys by below code:
Dictionary<clssMenu_Item, List<clssMenu_Item>> d2 = new Dictionary<clssMenu_Item, List<clssMenu_Item>>();
    clssMenu_Item k = new clssMenu_Item();
    k.text = strKey;
    foreach(var prp in dicMenu.Keys) //we should fill all of the variables in class
    {
        if (prp.text == strKey)
        { k.name = prp.name; break; }
    }
    d2= dicMenu[k]; //assign value of key

I dont know why I have error on d2= dicMenu[k]; said k is not in DicMenu, although I debug this block. we have k in DicMenu :( I dont know what should I do?!
is there other way to create a tree?


text:
Q: Getting the location of a folder next to my .jar file In a program I am making, I need to access images in a folder placed alongside it. The program works fine when I run it with Eclipse, but when I export it to a .jar file, it does not get the location of the folder properly.
File roomF = new File("Assets/Rooms/1/0.png");

In the IDE, roomF refers to the correct location:

C:\Users\[Username]\Desktop\Eclipse Java\[Project name]\Assets\Rooms\1\0.png

However, in the .jar file, it refers to this:

C:\Users\[Username]\Assets\Rooms\1\0.png.

How can I fix this?

A: You should not have resources outside of your JAR or dependencies that need a local path in order to work. Create a resource folder in your project and load the file from there.

A: There are two solutions to this:

*

*Place your JAR at:

'C:\Users[Username]\Desktop\Eclipse Java'

This way, when you are accessing Assets/Rooms/1/0.png, it points to the correct location.

*Make a folder where you will place your JAR everytime. Create the path 'Assets/Rooms/1' in the folder and place your file 0.png there, hence you wouldn't be needing to place your JAR each time you make a new one as said in step 1.


text:
Q: ASP MVC native helper for ViewModel property path rendering Assume that we have MainViewModel which contains collection of ItemViewModel, like below :
public class MainViewModel
{
    public IList<ItemViewModel> Items { get; set; }
}

public class ItemViewModel
{
    public string Name { get; set; }
}

And, I would like to render form for that model, then I have some thing like this:
@for (int i = 0; i < Model.Items.Count; i++)
{
    int index = i;
    @Html.TextBoxFor(x => x.Items[index].Name)
}

which will produce following html:
<input id="Items_0__Name" name="Items[0].Name" type="text" value="">
<input id="Items_1__Name" name="Items[1].Name" type="text" value="">
...

and my question is, if ASP MVC expose any helper method for rendering id and name strings, I mean about those strings:
Items_0__Name //id
Items[0].Name //name

I known that I have bunch of methods, which allows me to generate property paths by hand, but I am looking for something native, from asp mvc. I do not want to rewrite framework.
I am also aware that presented design is not the best possible! For sure, I would like to change it! but right now I need to deal with it.

A: You can use the htmlAtributes of the TextBoxFor method
@Html.TextBoxFor(x => x.Items[index].Name, new { id=/*your id*/ , name=/*your name*/} )


text:
Q: How to get latest patch of a Helm chart I have following syntax in my requirements.yaml
# umbrella/requirements.yaml
dependencies:
  - name: my-chart
    version: ~1.0
    repository: "@my-repo"

I want to receive all the patches of my-chart every time I run helm dependency update. However, it seems to work only if I have release versions like 1.0.8, 1.0.12, etc. in my-repo. But not for snapshots, e.g. 1.0.13-SNAPSHOT

Error: Can't get a valid version for repositories umbrella

Is that an expected behavior or how should I fix this?


text:
Q: Could not find or load main class Start I am starting to dive into Android app development using eclipse. I have used eclipse before for java development with no issues.
I am following the "Creating an Android Project" from develop.android.com and I am unable to run the app because I am getting "Error: Could not find or load main class Start"
The instructions say nothing of creating a Start class nor does the Android plugin create one during the initial steps of creation.
I have done my homework and searched for a solution to my issue, but none of the possible answers to my question have netted any results.
I have installed:
Eclipse Java EE IDE for Web Developers.
Version: Juno Service Release 1
Build id: 20121004-1855
Android Development Toolkit
Version: 20.0.3.v201208082019-427395

I also have every Android SDK Installed as well.
One thing I did see during the setup portion of the tutorial on develop.android.com is they make mention of is after the initial install of the plugin for eclipse is to configure the plugin

Once Eclipse restarts, you must specify the location of your Android SDK directory:
1.In the "Welcome to Android Development" window that appears, select Use existing SDKs.
2.Browse and select the location of the Android SDK directory you recently downloaded.
3.Click Next.

However, I never encountered this "Welcome to Android Development" screen and I am thinking that this may be the issue, but I cannot find where I can Configure the ADT plugin.
I appreciate any assistance and also apologize for my ignorance on the subject
Thanks,
HalbergM


text:
Q: v-btn 'to' prop adds path to base url (localhost), how can I direct to another website? I'm using a Vue.js project setup with Nuxt and Vuetify.js.
I'm trying to add FontAwesome icons as v-btns to lead the user to an Instagram page.
Unfortunately when clicking the icon, the browser is directed to http://localhost:3000/https://www.instagram.com/therock/?hl=en instead of just https://www.instagram.com/therock/?hl=en as expected. The Instagram account URL is tacked onto the end of the base URL.
Here's the template portion of the Vue file:
<template>
  <v-app>
    <v-toolbar app flat color="rgb(249, 249, 249)">
      <router-link to="/" class="toolbar-title">
        <v-toolbar-title>Chumiest Bucket</v-toolbar-title>
      </router-link>
      <v-spacer></v-spacer>
      <v-toolbar-items class="hidden-sm-and-down">
        <v-btn
          v-for="(item, index) in items"
          :key="index"
          :to="item.path"
          flat
        >{{ item.name }}</v-btn>
        <v-btn flat :to="instagram.path">

        </v-btn>
      </v-toolbar-items>

      <v-menu class="hidden-md-and-up">
        <v-toolbar-side-icon slot="activator"></v-toolbar-side-icon>
        <v-list>
          <v-list-item v-for="(item, index) in items" :key="index">
            <v-btn :to="item.path" flat>{{ item.name }}</v-btn>
          </v-list-item>
          <v-btn flat :to="instagram.path">

          </v-btn>
        </v-list>
      </v-menu>

    </v-toolbar>

    <v-content style="padding-top: 19px;">
      <v-container>
        <nuxt />
      </v-container>
    </v-content>

    <v-footer app style="position: absolute;">
      © 2019 Chumiest Bucket
    </v-footer>
  </v-app>
</template>

here's the script portion of the Vue file:

A: The "to" prop is used for navigating to pages within your routes. See documentation here. To navigate to external links, Bind the url to href instead.

  {{ url }}


text:
Q: Installed 12.04 from Live CD, after login/password and updates completed, then all I get is a black screen and a arrow cursor.  I am very newbie, so need help in complete instructions, I am using 9.04 to ask here, it is the only way I knew to get online. Thanks Dolores

A: i think you are getting the command line interface and not the graphical interface.
Try the startx command when the cursor shows up


text:
Q: In a database how to find connections between tables I have a database and it has lot of tables. I want to find column names from tables that link them to each other. So as to join them.
I simply want to know what columns are common between the tables so I will know how to go ahead and join them to get the desired result.
Is there a way to know how to find the column names similar or do I have to check each and every table?
This is for SQL Server 2008

A: sys.foreign_keys will contain information about the columns which are explicitly related as keys.
Aside from that, there is no structural relationship in the schema between any given pair of columns.  If any two columns on separate tables are supposed to be connected but aren't actually connected in the schema, that's more of a failure of the schema than anything else.
There is no mechanism which will reveal what columns the system's creators intended to be related but didn't actually relate.

A: My personal favorite is to look at column names if the FK method doesnt pan out.
SELECT c.name AS column_
, t.name AS table_

FROM sys.columns c
INNER JOIN sys.tables t
ON c.object_id = t.object_id
WHERE c.name LIKE '%userID%'
ORDER BY t.name


text:
Q: Datatable Fixed Column (Right Only) Issue I'm using JQuery Datatable and I ran into a problem when I used fixed column.
It has been showing two times my fixed column
I'm using serverside processing and that's my code:
dataTable = table.dataTable({
            fixedColumns:   {
                leftColumns: 0,
                rightColumns: 1
            },
            scrollX:true,
            scrollCollapse: true,
            "fnDrawCallback":function(oSettings) {
                $('div.choosePage select').val(dataTable.DataTable().page());
            },
            "pagingType":"bootstrap_full_number",
            "processing": true,
            "serverSide": true,
            "ajax": {
             "data":GETDATA,
             "dataSrc":SETAJAXDATA
            },
            "fnInitComplete":completeProcess,
            "colReorder": true,
            "order": [
            [0, 'asc']
            ],
            "dom": "<'row' <'col-md-12'>><'row'<'col-md-6 col-sm-12'f>r><'table-scrollable't><'row'<'col-md-4 col-sm-12'i><'col-md-5 col-sm-12 toolbar'p><'col-md-push-1 col-md-3 col-sm-12 toolbar choosePage'>>", // horizobtal scrollable datatable
        })

Ajax is working good and there is no problem when I used fixed column on left side,but when I used it on right side i'm running into this problem.
Thanks.

A: I believe it is a bug in Jquery Datatable if you haven't setup scrollY from the options, make sure you set some value.
Because when you inspect the element you can see scroll-y overflow is auto. If you set it as hidden or not setup a value from the options, there you go, you see the space at the right side.
Incase you do not want to use scroll-y at all, then you need to make your hands dirty with some css code by giving some minor margin which is an ugly solution. But I cannot see any other option for you.
It's a shame for Jquery datatable plugin.
Below shows an example option list from the plugin website.
$(document).ready(function() {
    var table = $('#example').DataTable( {
        scrollY:        "300px",
        scrollX:        true,
        scrollCollapse: true,
        paging:         false,
        fixedColumns:   {
            leftColumns: 0,
            rightColumns: 1
        }
    } );
} );


text:
Q: Placement of subtitle paragraph before table when exporting multiple tables to DOCX with officer I want to export multiple tables with a multi row caption or header to the same document using the officer package.
Background: In my company docx template a table or plot has a caption which consists of a title and a subtitle, both with their own styles. While the title corresponds to the caption in docx or officer, the subtitle is simply added as a paragraph.
Thanks to officer this is not a big deal and works great when exporting (gg)plots or just one table to docx.
However, when I export multiple tables the subtitle is placed at the right position only for the first table, while for all subsequent tables the subtitle is placed after the table:

The issue arises both with officer::body_add_table and flexible::body_add_flextable.
I already did some trial and error with changing the order in which I add the elements and had a look at the docs but wasn't able to figure out a solution. Maybe I missed the right argument to fix my issue.
A minimal reproducible example based on the default docx template shipped with officer:
library(officer)

to_docx <- function(docx, value, title, subtitle) {
  # Add table or plot
  if (inherits(value, "ggplot")) {
    pre_label <- seq_id <- "Figure"
    docx <- body_add_gg(docx, value = value)
  } else {
    pre_label <- seq_id <- "Table"
    docx <- body_add_table(docx, value = value, align_table = "center")
  }

  # Add title above table
  run_num <- run_autonum(seq_id = seq_id, pre_label = pre_label)
  title <- block_caption(title, style = "Image Caption", autonum = run_num)
  docx <- body_add_caption(docx, title, pos = "before")
  # Add subtitle above table
  subtitle <- fpar(ftext(subtitle, prop = fp_text(color = "red")))
  docx <- body_add_fpar(docx, subtitle, style = "Normal", pos = "after")
  docx <- cursor_end(docx)
  # Add a page breaks
  docx <- body_add_break(docx, pos = "after")

  invisible(docx)
}

docx <- read_docx()
tab <- head(mtcars[1:3])

to_docx(docx, tab, "Title 1", "Subtitle 1")
to_docx(docx, tab, "Title 2", "Subtitle 2")

fn <- tempfile(fileext = ".docx")
print(docx, fn)

show <- FALSE # Setting to TRUE will open the docx
if (show) fs::file_show(fn)

And as a reference, using the function to export multiple ggplots works as intended:
library(ggplot2)

docx <- read_docx()

gg <- ggplot(mtcars, aes(hp, mpg)) +
  geom_point()

to_docx(docx, gg, "Title 1", "Subtitle 1")
to_docx(docx, gg, "Title 2", "Subtitle 2")

fn <- tempfile(fileext = ".docx")
print(docx, fn)

show <- FALSE
if (show) fs::file_show(fn)

A: This was a bug and is now fixed in the dev version (or >= 0.4.5).
With the update, it's important to assign the result of to_docx to docx (there was an internal change with the cursor management):
library(officer)

to_docx <- function(docx, value, title, subtitle) {
  # Add table or plot
  if (inherits(value, "ggplot")) {
    pre_label <- seq_id <- "Figure"
    docx <- body_add_gg(docx, value = value)
  } else {
    pre_label <- seq_id <- "Table"
    docx <- body_add_table(docx, value = value, align_table = "center")
  }

  # Add title above table
  run_num <- run_autonum(seq_id = seq_id, pre_label = pre_label)
  title <- block_caption(title, style = "Image Caption", autonum = run_num)
  docx <- body_add_caption(docx, title, pos = "before")
  # Add subtitle above table
  subtitle <- fpar(ftext(subtitle, prop = fp_text(color = "red")))
  docx <- body_add_fpar(docx, subtitle, style = "Normal", pos = "after")
  docx <- cursor_end(docx)
  # Add a page breaks
  docx <- body_add_break(docx, pos = "after")

  invisible(docx)
}

docx <- read_docx()
tab <- head(mtcars[1:3])

docx <- to_docx(docx, tab, "Title 1", "Subtitle 1")
docx <- to_docx(docx, tab, "Title 2", "Subtitle 2")

fn <- tempfile(fileext = ".docx")
print(docx, fn)

show <- FALSE # Setting to TRUE will open the docx
if (show) fs::file_show(fn)

As an alternative solution, you could also use block_list(), below an illustration (only with the table):
library(officer)
library(ggplot2)

to_docx <- function(docx, value, title, subtitle) {
  # Add table
  pre_label <- seq_id <- "Table"
  run_num <- run_autonum(seq_id = seq_id, pre_label = pre_label)

  bl <- block_list(
    block_caption(title, style = "Image Caption", autonum = run_num),
    fpar(subtitle, fp_p = fp_par(word_style = "Normal")),
    block_table(x = value, header = TRUE,
                properties = prop_table(
                  tcf = table_conditional_formatting(
                    first_row = TRUE, first_column = TRUE)
                  ))
  )

  docx <- body_add_blocks(docx, bl, pos = "after")

  invisible(docx)
}

docx <- read_docx()
tab <- head(mtcars[1:3])

docx <- to_docx(docx, tab, "title-1", "subtitle")
docx <- to_docx(docx, tab, "title-2", "subtitle")

fn <- tempfile(fileext = ".docx")
print(docx, fn)

show <- FALSE # Setting to TRUE will open the docx
if (show) fs::file_show(fn)


text:
Q: Make a blank response in twilio webhook How can I make a blank response in twilio using php/laravel?
Here is a sample Twiml:
<Response></Response>

A: This is the code that I have come up with (I'm using laravel):
public function receivedSms(){
    $response = new Twiml();

    return response($response)
      ->header('Content-Type', 'text/xml');
}

A: If you are using twilio api packages for aspnet.core you can return NoContent() on your api end-points.
[ValidateTwilioRequest]
[Produces("text/xml")]
[HttpPost("userresponse")]
public IActionResult ReceiveSMS()
{
// do your action for the received response
return NoContent();
}


text:
Q: How to use labels in batch I have a batch file and I want to show the user the process in the file. I've created small tables with Operation and Status headers. Each table is for a particular command/line. After the line has run, I print the corresponding table, which clears the screen and prints the new table with the updated status. So you get a good look. This is the code:
@echo off

REM   Process started
goto zeroth
timeout /t 1 /nobreak > NUL
REM   do some work. first operation is done
goto first
timeout /t 1 /nobreak > NUL
REM   do some work. second operation is done
goto second
REM ...

:zeroth
cls
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Waiting
echo  * op2                                     Waiting
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
echo.

:first
cls
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Waiting
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
echo.

:second
cls
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Done
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
echo.

pause

but it doesn't work. I've checked other label examples and they usually have goto end or something at the end, but I'm not going to close the window. What should I be modifying?

A: goto are pretty simple, the script is read from top to bottom and once down he does not go back unless to invite them. The goto command is a way to do that.
example:

@echo off

echo goto is also used to skip a step, example go directly to step-2.
@timeout /t 2 /nobreak>NUL
goto step-2

:step-1
echo hello world
@timeout /t 2 /nobreak>NUL
goto step-3

:step-2
echo How are you? Oh sorry, I missed Salute.
@timeout /t 2 /nobreak>NUL
goto step-1

:step-3
echo Show me your code
@timeout /t 2 /nobreak>NUL
type %~f0 | more

exit /b 0

Edit:
Same example modified with call to show you the script continue from where was called with the help of goto :eof
@echo off

echo goto is also used to skip a step, example go directly to step-2.
@timeout /t 2 /nobreak>NUL
goto step-2

:step-1
echo hello world
@timeout /t 2 /nobreak>NUL
::goto step-3
goto:eof

:step-2
echo How are you? Oh sorry, I missed Salute.
@timeout /t 2 /nobreak>NUL
::goto step-1
call :step-1

:step-3
echo Show me your code
@timeout /t 2 /nobreak>NUL
::type %~f0 | more

exit /b 0

A: You can think of batch files as simply a list of CMD commands that the OS needs to run, and the order in which to run them in. Like other scripting languages, batch files are run from the top down, unless the direction is altered by goto statements and their corresponding line labels.
In your case, goto zeroth goes to the :zeroth label, and then continues on its merry way towards the bottom of the file. Because it never gets told to go higher up in the script, it never does.
Fortunately, you can also use labels in batch to simulate subroutines if you replace goto with call. (It's not really a subroutine; it's more like running a chunk of the script as its own separate batch script.) When you do this, you also have to use goto :eof to tell the script where the "subroutine" ends.
@echo off

REM   Process started
call :zeroth
timeout /t 1 /nobreak > NUL
REM   do some work. first operation is done
call :first
timeout /t 1 /nobreak > NUL
REM   do some work. second operation is done
call :second
REM ...
pause
REM We are at the end of the main chunk of code; everything below this is a subroutine
exit /b

:zeroth
cls
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Waiting
echo  * op2                                     Waiting
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
echo.
goto :eof

:first
cls
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Waiting
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
echo.
goto :eof

:second
cls
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Done
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
echo.
goto :eof

A: There are problems with your original code, line 4 you have a goto, which is fine
@echo off

REM   Process started
goto zeroth

so the code goes to "zeroth" as it should. but than at the end of :zeroth you don't have any code to tell the batch file to go anywhere else, so it continues to go down. using goto is a good way to jump around the batch file. but if you're just going to down the line, IE goto 0, 1, 2, 3... you don't really need a goto at all, you could simply remove all of the gotos and the code will run just fine.
@ECHO OFF
REM   Process started
goto zeroth

:zeroth
cls
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Waiting
echo  * op2                                     Waiting
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
echo.
TIMEOUT>NUL /T 1
::zeroth done, going to next
goto first
:first
cls
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Waiting
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
echo.
TIMEOUT>NUL /T 1
:: first done, going to next
:second
cls
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Done
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
echo.

pause
:: Processes all done
GOTO :EOF

A: Using SomethingDark's answer, I changed my code to this:
@ECHO OFF

call :1stOpRunning
timeout /t 1 /nobreak > NUL
REM   1st op code

call :2ndOpRunning
timeout /t 1 /nobreak > NUL
REM   2nd op code

call :3rdOpRunning
timeout /t 1 /nobreak > NUL
REM   3rd op code

call :4thOpRunning
timeout /t 1 /nobreak > NUL
REM   4th op code

call :allDone

exit /b

:1stOpRunning
cls
echo.
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Waiting
echo  * op2                                     Waiting
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
timeout /t 1 /nobreak > NUL
cls
echo.
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Processing
echo  * op2                                     Waiting
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
goto :eof

:2ndOpRunning
cls
echo.
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Processing
echo  * op3                                     Waiting
echo  * op4                                     Waiting
echo ====================================================
goto :eof

:3rdOpRunning
cls
echo.
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Done
echo  * op3                                     Processing
echo  * op4                                     Waiting
echo ====================================================
goto :eof

:4thOpRunning
cls
echo.
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Done
echo  * op3                                     Done
echo  * op4                                     Processing
echo ====================================================
goto :eof

:allDone
cls
echo.
echo    Operation                               Status
echo ====================================================
echo  * op1                                     Done
echo  * op2                                     Done
echo  * op3                                     Done
echo  * op4                                     Done
echo ====================================================
echo.

echo    Press any key to continue . . .
timeout /t 5 > NUL
exit


text:
Q: Angular Customer directive , for change of color of link  on hover I need a help in implementing this use case .
How can I write code for customer directive in angular to change of link  on hover over.
Can we use ElementRef for this?
Any leads, Please!


text:
Q: UICollectionView Layout Wrong Item Size I am programmatically creating a UICollectionViewController:
class MyCollectionVC: UICollectionViewController, UICollectionViewDelegateFlowLayout {

init() {
        super.init(collectionViewLayout: UICollectionViewFlowLayout())
}

override func loadView() {
    super.loadView()

    self.collectionView.delegate = self

    ...
}

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout:
    UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {

    let dimension = self.view.bounds/3
    return CGSize(width: dimension, height: dimension)

}

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

 print ("Cell Size: (self.collectionViewLayout as! UICollectionViewFlowLayout).itemSize)

}

}
I need thee actually cell size at cellForItemAt to do more work.
Cell size above prints out 50 x 50 at all times. This is the default size given. iPhone or iPad, portrait of landscape, it is always 50.
The odd thing is, the actual cell layout gets displayed correctly. Everything else works and looks perfectly.
What am I missing here?

A: Try This
class GridLayout: UICollectionViewFlowLayout {
    override init() {
        super.init()
        self.minimumLineSpacing = 0
        self.minimumInteritemSpacing = 0
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func prepare() {
        super.prepare()
        guard let collectionView = self.collectionView else {return}
        let cellWidth = collectionView.frame.width / 3
        self.itemSize = CGSize(width: cellWidth, height: cellWidth) // Your Cell Size
    }
}

    override func viewDidLoad() {
        super.viewDidLoad()
        self.collectionView.collectionViewLayout = GridLayout()
        collectionView.delegate = self
        collectionView.dataSource = self
    }

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

        print((self.collectionView.collectionViewLayout as! UICollectionViewFlowLayout).itemSize)

        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Your Cell Id", for: indexPath)
        return cell
    }


text:
Q: Ionic 3: Check if sub-array exists in NavParams.get So, my app gets a response and navCtrl.push's it as an array into another page
let's say the constructor on the ts of that page looks like this

constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.id = navParams.get('infoList')[0].id;
    this.name = navParams.get('infoList')[0].full_name;
    this.email = navParams.get('infoList')[0].email;
    this.epmname = navParams.get('infoList')[0].managers[0].full_name;
    this.epmemail = navParams.get('infoList')[0].managers[0].email;
    this.epm2name = navParams.get('infoList')[0].managers[1].full_name;
    this.epm2email = navParams.get('infoList')[0].managers[1].email;
    this.epm3name = navParams.get('infoList')[0].managers[2].full_name;
    this.epm3email = navParams.get('infoList')[0].managers[2].email;
  }

Now, the response may not always have a managers sub array or may only have 1 or 2 sub-elements and not 3, How can I perform a check for this? Thanks
UPDATE: this is how a part of my results.html page looks like:

<ion-item-divider color="light">
      Manager Info (Second EPM - if exists):
    </ion-item-divider>
    <ion-item color="none">
      Name: {{epm2name}}
    </ion-item>
    <ion-item color="none">
      Country Code: {{epm2countrycode}}
    </ion-item>
    <ion-item color="none">
      Phone number: {{epm2phone}}
    </ion-item>
    <ion-item color="none">
      Email: {{epm2email}}
    </ion-item>

A: This is really a horrible way to do that. I highly suggest you use a more object-oriented pattern here. If you follow that then you can easily check the null and etc.
Note: I have extracted below example from one of my project.So please adjust it according to your app. If you have any questions feel free to ask it.
Send
my-send-page.ts
goToEditBudget(data: Budget) {
    let dtoBudget = new DtoBudget();
    dtoBudget.budget = data;
    dtoBudget.action = 'edit'
    this.navCtrl.push('AddBudgetPage', { data: dtoBudget });
  }

Retrieved
add-budget-page.ts
constructor(private navCtrl: NavController, private navParams: NavParams) {
    let data: DtoBudget = this.navParams.get('data');
    if (data != null) {
      this.data = data.budget;
      this.action = data.action;
    }
  }

DtoBudget.ts
import { Transaction } from './../Transaction';
import { Budget } from './../Budget';

export class DtoBudget {
    budget: Budget;
    action: string;
    transactions: Transaction[]
}


text:
Q: Making link clickable within a CSS3 hover 'after' pseudo element I've set up some image hover styling based on this tutorial which creates the hover styling using the before and after pseudo-elements.
Works (and looks) great but I need to be able to insert buttons/links within the hover content but due to this being styled on the pseudo-elements, the after is preventing the buttons/links to be clickable.
It looks like the below, I've set up a jsfiddle to demonstrate what I am wanting to do - as you'll notice, the link isn't clickable on hover and I'm wondering if anyone can suggest a simple way of making this link clickable without having to completely change the way this is structured.
Default State

Hover State

.media {
  display: inline-block;
  position: relative;
  vertical-align: top;
}

.media__image { display: block; }

.media__body {
  background: rgba(41, 128, 185, 0.7);
  bottom: 0;
  color: white;
  font-size: 1em;
  left: 0;
  opacity: 0;
  overflow: hidden;
  padding: 3.75em 3em;
  position: absolute;
  text-align: center;
  top: 0;
  right: 0;
  -webkit-transition: 0.6s;
  transition: 0.6s;
}

.media__body:hover { opacity: 1; }

.media__body:after,
.media__body:before {
  border: 1px solid rgba(255, 255, 255, 0.7);
  bottom: 1em;
  content: '';
  left: 1em;
  opacity: 0;
  position: absolute;
  right: 1em;
  top: 1em;
  -webkit-transform: scale(1.5);
  -ms-transform: scale(1.5);
  transform: scale(1.5);
  -webkit-transition: 0.6s 0.2s;
  transition: 0.6s 0.2s;
}

.media__body:before {
  border-bottom: none;
  border-top: none;
  left: 2em;
  right: 2em;
}

.media__body:after {
  border-left: none;
  border-right: none;
  bottom: 2em;
  top: 2em;
}

.media__body:hover:after,
.media__body:hover:before {
  -webkit-transform: scale(1);
  -ms-transform: scale(1);
  transform: scale(1);
  opacity: 1;
}

.media__body h2 { margin-top: 0; }

.media__body p { margin-bottom: 1.5em; }

Cool Title

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nesciunt laboriosam voluptatem necessitatibus cum, tenetur repellat, eaque eos debitis! Quaerat.

A: A CSS3-only (actually moved into CSS4 specs) solution would be the pointer-events property, e.g.
.media__body:hover:after,
.media__body:hover:before {
  ...
  pointer-events: none;
}

supported on all modern browser but only from IE11 (on HTML/XML content)
Example: http://jsfiddle.net/8uz7mx6h/

Another solution, supported also on older IE, is to apply position: relative with a z-index to the paragraph, e.g.
.media__body p {
  margin-bottom: 1.5em;
  position: relative;
  z-index: 1;
}

Example: http://jsfiddle.net/0nrbjwmg/2/

A: .media__body p { margin-bottom: 1.5em;
position: relative;
z-index:999;

}
try this !


text:
Q: Limit of $-itc\sqrt{n}+n\log(1-\frac{it}{c\sqrt{n}})$ For $c>0, t\in \mathbb{R}$ why $$ -itc\sqrt{n}+nc\sum_{k\geq 0}\frac{1}{k+1}\bigl(\frac{it}{\sqrt{n}}\bigr)^{k+1}\stackrel{n\rightarrow \infty}\longrightarrow \frac{-ct^2}{2}?$$ Just because it isn't very clear, the summation was $$\log(1-\frac{it}{\sqrt{n}})$$ where $\log$ is the complex logarithm.
I only see it converging to $-\infty$.

A: What I have written at first was wrong. That was causing me the problem. Gary's remark helped.
Solution:
Separate the first 2 terms of the sum and simplify. What you get is $-itc\sqrt{n}+itc\sqrt{n}+\frac{(it)^2c}{2}$ + something converging to 0.


text:
Q: how to render tabs Navigation and stack navigation at the same time i am trying to use stack navigation and tab navigation at the same time,i have created a stack navigator and tabs in my app.js files but whenever my app loads they are showing different pages at the same time and i don,t know how to resolve this issue. my app.js code is
import { createStackNavigator, createAppContainer } from 'react-navigation';
import IntroSlides from './src/screens/introslides/introslides';
import Dashboard from './src/screens/dashboard/dashboard';
import InboxScreen from '../screens/inbox/inbox';
import Favourites from '../screens/favourite/favourite';

const MainNavigator = createStackNavigator({
  dashboard: { screen: Dashboard },
  intro: { screen: IntroSlides },
 }, {
  headerMode: 'none',
  navigationOptions: {
     headerVisible: false,
  }
});
const TabNavigator = createBottomTabNavigator({
   // dashboard: { screen: Dashboard },
   Inbox: { screen: InboxScreen },
   Favourites: { screen: Favourites }
});

const App = createAppContainer(MainNavigator);

export default App;

when the app loads both the stack shows pages at the same time ,any Help would be appreciated

A: Here is an example to use tab navigator and stack navigator together:
const Stylelist = StackNavigator({
  Login: {
    screen: LoginScreen,
    navigationOptions: ({ navigation }) => ({
      header: null,
    }),
  },
  Register: {
    screen: RegisterScreen,
    navigationOptions: ({ navigation }) => ({
      header: null,
    }),
  },
  Home: {
    screen: TabNavigator({
      Home: {
        screen: HomeScreen,
        navigationOptions: ({ navigation }) => ({
          title: 'Home',
        }),
      },
      Friends: {
        screen: FriendsScreen,
        navigationOptions: ({ navigation }) => ({
          title: 'My Friends',
        }),
      },
    }),
    navigationOptions: ({ navigation }) => ({
      title: 'Home',
    }),
  },
});

export default Stylelist;


text:
Q: "Buy not only seasonal and local but also seeded produce." Is this sentence grammatically okay? Just one sentence.
"Buy not only seasonal and local but also seeded produce." Is this sentence grammatically okay?
Do you use this structure 'not only A and B but also C'?

A: Your sentence using the structure

not only A and B but also C

is grammatically correct, but doesn't really make sense in meaning.
What do you mean by "seeded"?


text:
Q: JAVASCRIPT, How to create new div on statement line dynamic webpage? How to create new div on statement line dynamic webpage ?
Example
i want to create new div cover ADP
this image http://postimg.org/image/sqmn34c9t/
I'm doing ChromeExtension. This app about Stock Market Indexes, Ability of app is find word on webpage. If word is symbol of Indexes. This app will show information of indexes when mouse hover on word.
Now , i stored word about indexes be array
Example
var text = new Array("ADDYY","NKE","BUD");

and i  find a word by
while ( (node = nodeIterator.nextNode()) ) {
        for (var i = 0; i <= 10; i++) {
            node.data = node.data.replace(text[i],temptxt );
        }

}

and Now i have a solution about addition div tag on webpage .
this js file
injectedCode.js
var ignoreTags = ["NOSCRIPT","SCRIPT","STYLE"];
var nodeIterator = document.createNodeIterator(document,NodeFilter.SHOW_TEXT,
    function (node){
          var parentTag = node.parentNode.tagName.toUpperCase();
          if ( ignoreTags.indexOf(parentTag)==-1 ) {return true} else {return false};
           },
    false
);

var node;
var div = document.createElement('div');
div.id ='popup';
div.innerHTML = "Hello";
var temptxt = document.getElementsByTagName('body')[0].appendChild(div);
var text = new Array("ADDYY","NKE","BUD");
while ( (node = nodeIterator.nextNode()) ) {
    for (var i = 0; i <= 10; i++) {
            node.data = node.data.replace(text[i],temptxt );
 }

}

Now, on webpage i get result : " [object HTMLDivElement] " on word
And ,This all my code https://github.com/DevNewbie93/replacesymbol
Thank you Anyone who advises and sorry if i did something wrong.

A: The error you are getting
In your function here:
while ( (node = nodeIterator.nextNode()) ) {
  for (var i = 0; i <= 10; i++) {
    node.data = node.data.replace(text[i],temptxt );
  }
}

node is some DOM node, more specifically a Text node. Its data attribute it a String. When calling replace, it finds matches to the first argument and replaces them with second argument. From replace documentation: Second argument is expected to be a String, or a function that will return a String.
In your case, temptxt is NOT a string, but a DOM element. When you try to pass it as string, its .toString() method is called and returns "[object HTMLDivElement]".
Your actual question
It took some work to understand what you're trying to do. But it can be formulated as follows:
"How can I find all occurrences of a word in a document and replace them with another element?"
It's a non-trivial question. A good overview (and an implementation) is available, for instance, here.
Your solution will not work, since you're editing a Text node and it cannot contain any mark-up.
This answer is also a good source of information.


text:
Q: How to express $E[\max(x,y)]$ as an integral? In Hull (2008, p. 307), the following equation is found (Eq. 13A.2):
$$E[\max(V-K,0)]=\int_{K}^{\infty} (V-K)g(V)\:dV$$
Where $g(V)$ is the PDF of $V$ and $V,K>0$.
I'd like to extrapolate from this to find a general expression for $E[\max(x,y)]$ where $x,y>0$.
I guess it would be:
$$E[\max(x,y)]=\int_{0}^{\infty} x g(x)\:dx+\int_{0}^{\infty} y f(y)\:dy$$
Where $g(x)$ and $f(y)$ are the respective PDFs of variables $x$ and $y$.  Is that right?

A: If $X$ and $Y$ are random variables defined on a probability space $(\Omega,\mathcal F,\mathbb P)$, it is not hard to prove that $W:=\max\{X,Y\}$ is also a random variable. Then by definition,
$$\mathbb E[W] = \int_\Omega W\ \mathsf d\mathbb P.$$
By the "law of the unconscious statistician" we can compute this expectation as:
$$\mathbb E[W] = \int_{\mathbb R^2} \max\{x,y\}\ \mathsf dF(x,y),$$
where $F$ is the joint distribution function of $(X,Y)$. If we assume that $X$ and $Y$ are independent, we can find the distribution of $W$ explicitly. The event $\{W\leqslant w\}$ is equivalent to $\{X\leqslant w\}\cap\{Y\leqslant w\}$, and so
$$\mathbb P\{W\leqslant w\}=\mathbb P\{X\leqslant w\cap Y\leqslant w\}=\mathbb P\{X\leqslant w\}\mathbb P\{Y\leqslant w\}. $$
Hence the distribution function of $W$ is $G := F_XF_Y$ where $F_X$ and $F_Y$ are the distribution functions of $X$ and $Y$, respectively. It follows then that
$$\mathbb E[W] = \int_{\mathbb R}w\ \mathsf d(F_X(w)F_Y(w)). $$
If $X$ and $Y$ are continuous random variables, then this reduces to
$$\mathbb E[W] = \int_{\mathbb R}w(f_X(w)F_Y(w) + F_X(w)f_Y(w))\ \mathsf dw, $$
where $f_X$ and $f_Y$ are probability density functions of $X$ and $Y$, respectively.

A: Let $X$ and $Y$ be (say positive) independent random variables, with continuous distributions, densities $f(x)$ and $g(y)$, and cumulative distribution functions $F(x)$ and $G(y)$. Let $W=\max(X,Y)$. Then $\Pr(W\le w)=\Pr(X\le w)\Pr(Y\le w)=F(w)G(w)$.
Thus the cumulative distribution function of $W$ is $F(w)G(w)$, and therefore by the Product Rule the density function of $W$ is
$$F(w)g(w)+G(w)f(w),$$
and therefore
$$E(W)=\int_0^\infty wF(w)g(w)\,dw+\int_0^\infty wG(w)f(w)\,dw.$$
Remark: The above expression can be manipulated in various ways, but your expression is not one of them. For let $X$ and $Y$ be independent with uniform distribution on $(0,1)$. Then $E(W)=\frac{2}{3}$, while your expression gives $1$ (which in any case cannot be correct).

A: Let $Z=\max(X,Y)$ and $f(x,y)$ be the joint PDF of $(X,Y)$ (not assuming independence). Then,
\begin{align*}
Pr[Z<z] &= Pr[\max(X,Y)<z] \\
&= Pr[X<z \text{ and } Y<z] \\
&= \int_{-\infty}^z \int_{-\infty}^z f(x,y)\,dx\,dy \\
&= F(z)
\end{align*}
With the CDF function $F(z)$, we may find the PDF $f(z)=F'(z)$ by Leibniz rule:
$$ f(z) = \int_{-\infty}^z f(z,y)\,dy + \int_{-\infty}^z f(x,z)\,dx = \int_{-\infty}^z [f(t,z)+f(z,t)]\,dt. $$
Finally, we may now compute the expectation of $Z$:
$$ \mathbb{E}[Z] = \int_{-\infty}^\infty z \int_{-\infty}^z [f(t,z)+f(z,t)]\,dt\,dz = \int_{-\infty}^\infty \int_{t}^\infty z[f(t,z)+f(z,t)]\,dz\,dt. $$
(Note: I just noticed you said your variables were positive. Just replace $-\infty$ with $0$ and the result holds.)


text:
Q: Basic Recurrence Problem in the Analysis of Algorithm I am taking an algorithm course at Coursera. From this webpage by a Princeton Professor, Example 1.5 (Analysis of quicksort) gives the following codes.

public class Quick
{
private static int partition(Comparable[] a, int lo, int hi)
{
int i = lo, j = hi+1;
while (true)
{

   while (less(a[++i], a[lo])) if (i == hi) break;

   while (less(a[lo], a[--j])) if (j == lo) break;

   if (i >= j) break;

   exch(a, i, j);

}

exch(a, lo, j);

return j;

}
private static void sort(Comparable[] a, int lo, int hi)
{
if (hi <= lo) return;

int j = partition(a, lo, hi);

sort(a, lo, j-1);

sort(a, j+1, hi);

}
}

Define $C_N$ to be the number of compares to sort $N$ elements and analyze $C_N$. Then,
$C_N = N+1+\frac{2}{N}\sum\limits_{0\leq k\leq N-1} C_k$ is equivalent to
$NC_N=(N+1)N+2\sum\limits_{0\leq k\leq N-1} C_k$, which is equivalent to
$NC_N-(N-1)C_{N-1}=N(N+1)-(N-1)N+2C_{N-1}$.
Questions
I could not derive the third equation from the second. Indeed, if they are equivalent, then $2(C_o + C_1 + \dots +C_{N-1})=(N-1)(C_{N-1} -N)$. Is it true?
Also, the definition of $C_N$ looks a little fuzzy to me. In fact, I have googled the definition of "compares" for a while, but still could not understand it completely. Does $C_N$ define the number of comparisons we would make in order to compare $N$ elements? (Yes, this is my first algorithm course, and I have no java background.)

A: The second equation says that
$$2(C_0+C_1+\cdots+C_{N-1})=D_N\tag{1}$$
where we define
$$D_N=NC_N-N(N+1).$$
Replacing $N$ by $N-1$ in (*) gives
$$2(C_0+C_1+\cdots+C_{N-2})=D_{N-1}.\tag{2}$$
Subtracting (2) from (1) gives
$$2C_{N-1}=D_N-D_{N-1}.\tag{3}$$
That's your third equation.
From (3) one has
$$2(C_0+C_1+\cdots+C_{N-1})
=(D_1-D_0)+(D_2-D_1)+\cdots+(D_N-D_{N-1})=D_N-D_0.$$
But $D_0=0C_0-0=0$ so this recovers (1).


text: Q: onmouseover change image I was trying to put a link on an image. When the mouse is over the image, the image changes from login_button_22.jpg to login_button_11.jpg. I am using the following piece of code, which is working for IE but not for chrome and others. Any ideas how to modify it, to work for all explorers? Thanks


text:
Q: PHP - Replace String on Array I want to make a String Replace on a variable that user input. May I know how do I want it to accept (') on the string. Let say for example,
$string = ' *this* is 'a' test' ';
$regexes = array('/~(.*?)~/six','/\*(.*?)\*/six');
$replaces = array('$1','$1');
$new_string = preg_replace($regexes, $replaces, $string);

echo $new_string;

I can make it to change to bold and italic text but if the string has ' '' ', it will give an error. How do I want to accomplish this?

A: This may help you, use addslashes and stripslashes as required.
<?php
$string = " *this* is 'a' test' ";
$string = addslashes($string);
$regexes = array('/~(.*?)~/six','/\*(.*?)\*/six');
$replaces = array('$1','$1');
$new_string = preg_replace($regexes, $replaces, $string);
echo stripslashes($new_string);
?>

This Outputs: this is 'a' test'


text:
Q: Unable to call POST method using Volley Code as below:
public void loginPost(String url, String emailAddress, String password){
        Map<String, String> params = new HashMap();
        params.put("email", emailAddress);
        params.put("password", password);
        JSONObject parameters = new JSONObject(params);
        String LOGIN_REQUEST_TAG = "LOGIN_REQUEST_TAG";

        JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, url, parameters, new Response.Listener<JSONObject>() {
            @Override
            public void onResponse(JSONObject response) {
                Log.d("Login Response:", response.toString());
                JSONObject responseOject = response;
                if(responseOject.has("data")){
                    try {
                        Log.d("Data Response", responseOject.getString("data"));
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }else if(responseOject.has("error")){
                    try {
                        errorMessage = responseOject.getString("error");
                        new AlertDialog.Builder(MainActivity.this)
                                .setTitle("Error")
                                .setMessage(errorMessage)
                                .setNegativeButton("OK", null)
                                .show();
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                }else{
                    //Server error. Come back again later
                    Log.d("Server error", "Server Error");

                }
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                VolleyLog.e("Error at login: ", error.getMessage());
            }

        });
        AppSingleton.getInstance(getApplicationContext()).addToRequestQueue(jsonObjectRequest,LOGIN_REQUEST_TAG);

    }

All the parameters and URL are correct as I have checked it during debug. And everything works fine in Postman as well. However, the code above just wont go into onResponse method and I am not receiving any error. But it is giving a warning that "responseOject" is redundant. Am I doing it wrongly? Quite new to Android development.
Error:
BasicNetwork.performRequest: Unexpected response code 401

It is a POST API and I am using Request.Method.Post, why am I receiving that error?

A: Before using the API test it in Postman. You will get a clear view of what is happening.
The error code 401 means you parameters are wrong. OR you are unauthorized to access that API.
Try this code for this type of call.
  private void callNetwork(final String email, final String password) {
        String json_object_request = "jsonObjectRequest";
        //Creating a string request
        StringRequest stringRequest = new StringRequest(Request.Method.POST, Config.URL_LOGIN,
                new Response.Listener<String>() {
                    @Override
                    public void onResponse(String response) {
                        if (response != null) {
                            parseData(response);
                        }
                    }
                },
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        progressBar.setVisibility(View.GONE);
                    }
                }) {
            @Override
            protected Map<String, String> getParams() {
                Map<String, String> params = new HashMap<>();
                //Adding parameters to request
                params.put("email", email);
                params.put("password", password);
                //returning parameter
                return params;
            }
        };

        //Adding the string request to the queue

        AppController.getInstance().addToRequestQueue(stringRequest, json_object_request);
    }


text:
Q: How does local-name find attributes in an xml node? I'm trying to select on an attribute within an XML node like this one here:
<tdf:TrustedDataObject xmlns="urn:com:bank:baml:tdf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" >

I'm able to find the node using Firepath with something like this:
/*[local-name()='TrustedDataObject']

But if I wanted to select on an attribute within the node, like the gml attribute, I'm not sure how to do this.  I've tried a few different ways like:
/*[local-name()='TrustedDataObject']/@gml

or
/*[local-name()='TrustedDataObject'][gml]

And they don't match anything.
Does anybody have some suggestions?  I know this isn't complete code, I don't have access to the entire document right now so I apologize.
EDIT- Ok, I wasn't sure if I should start another question or just edit my original.  I understand that there are limitations when trying to access the namespace attributes, but really what I was trying to do was create a content node on the attributes in NoticeText like - ownerProducer and pocType.
<document>
   <tdf:TrustedDataObject xmlns="urn:com:bank:baml:tdf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" >
      <ism:Notice ism:classification="X" ism:ownerProducer="ABC" ism:noticeType="POC" ism:externalNotice="true">
        <ism:NoticeText ism:classification="X" ism:ownerProducer="ABC" ism:pocType="JJJ-710">John Smith, Walmart, jsmith@walmart.com</ism:NoticeText>
      </ism:Notice>
   </tdf:TrustedDataObject>
<document>

Again, I would think being able to traverse down to the NoticeText node, using local-name() should work.  Something like this?
//*[local-name()='NoticeText']/@ownerProducer

Thanks again for the help.  Maybe you're telling me that all of these attributes aren't accessible via xpath...

A: In general, xpath processors allow you to register namespaces, so the xpath would be (having registered the namespaces with the same prefixes)
//ism:NoticeText/@ism:ownerProducer

For example, in XSLT you would register the namespaces in the XML of the template using namespace declarations, and then use the prefixes in the xpath expressions
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ism="urn:us:gov:ic:ism">
<xsl:template match="/">
<result>
<xsl:value-of select="//ism:NoticeText/@ism:ownerProducer">
</result>
</xsl:template>
</xsl:stylesheet>

According to this answer you can't register namespaces when using FirePath, so a work-around is to look at the local name only. Note that this may cause problems if other namespaces use the same local name - you're defeating the whole point of namespaces when you do this, so use a better tool in production code.
So to select all attributes whose local name is 'ownerProducer' from all elements whose local name is 'NoticeText' irrespective of namespace, the xpath would be
//*[local-name()='NoticeText']/@*[local-name()='ownerProducer']

which breaks down as
//                             a descendent of the current context
*                              any element
[local-name()='NoticeText']    whose local name is 'NoticeText'
/                              a child of the current context
@*                             any attribute
[local-name()='ownerProducer'] whole local name is 'ownerProducer'

A: While the XML element has three attributes, all of them are namespace declarations and in the XSLT and XPath data model namespace declarations don't appear as attributes in the tree. So with XPath you can't access those attributes, all you could do is access the namespace nodes that are in scope on the namespace axis.
See http://www.w3.org/TR/xpath/#namespace-nodes for details on namespace nodes.

A: As gml is not an attribute as mentioned above. If still you want to access value of gml namespace in your our output. Please use the following code
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="1.0">
<xsl:template match="/">
     <output> <xsl:value-of select="/*/namespace::node()[local-name()='gml']"></xsl:value-of></output>
</xsl:template>
</xsl:stylesheet>

Input :
<tdf:TrustedDataObject xmlns:tdf="urn:com:bank:baml:tdf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gml="http://www.opengis.net/gml" >
 </tdf:TrustedDataObject>

Output :
   <output>http://www.opengis.net/gml</output>


text:
Q: How to know when image uploading is finished? I want to use blockUI plugin for my project. I want to block UI during the uploading images, but i use simple image upload component (non ajax). Does any kind to identify when uploading images is finished and unbock UI?
Thx

A: If I understood correctly, when you are not using AJAX, then the image upload does a POST to the server (i.e., entire page will reload). Then, you can run the blockUI JavaScript before submitting the form (in the form's onSubmit event) and the page will be unblocked the response is back.


text:
Q: Is 20 dollars here a direct object or a predicate complement? 'This book cost me 20 dollars.' In this sentence:

This book cost me 20 dollars.

Is 20 dollars a direct object or a predicative complement?

A: In comments, Professor Lawler wrote [modulo typographical substitutions and formatting]:

...[I]t's not a direct object. It's a measure phrase and can't be passivized, for instance: ✴100 kilos was weighed by Bill and ✴$20 was cost by this book are both ungrammatical. Cost is a commercial transaction verb, with special syntax.

and in response to Shoe's
The CGEL's analysis of passivisation (p1432) has the example sentence: A packet of cigarettes costs around seven dollars. Other verbs exemplified in this section are boast, contain, hold and lack. The CGEL continues: Because the objects here cannot be externalised by passivisation they differ sharply from prototypical objects. The view taken here, however, is that the resistance of the verbs to passivisation does not provide convincing grounds for saying that the post-verbal NPs are not objects: passivisation does not provide either a necessary or a sufficient condition for object status.

If "object status" were a binary state this might be true; but in fact every test passed or failed tests a slightly different variable in the concept of "object", which — in the final analysis — is a semantic type that depends almost entirely on — and consists almost entirely of — the semantic categories imposed by the transitive predicate concerned, and the type and degree of transitivity of the individual sentence. Verb–object semantics is fractal down as far as I've been able to trace it.

tchrist note: I've preserved John's comments as a searchable post mostly so that linguistics term measure phrase should be more easily searchable on our site.

A: You are right to ask this question. With numbers or measurements one has the feeling "object" isn't the appropriate term. The book does not effect an action on " 20 dollars". But I think everybody knows that the structure is the verb to cost + price (how much). Similar case: The horse stood two meters high. Here I would say the underlying concept is: The horse is two meters high (to be + complement). I think as to "twenty dollars" you will find different views. One might even say it is an adverbial sentence part indicating how much.

A: It's a direct object, just as it would be in "This book cost 20 dollars".
me is an indirect object.
Note in particular that while we can also say "This book cost me" this is a slightly different meaning of cost so we can't just drop the "20 dollars" and keep the rest of the sentence working in the same way.

A: A predicative complement (also called subject complement) follows the copula (e.g. to be, to become) and is the complement to the subject.
The verb to cost is not a linking verb; thus, "20 dollars" cannot be a predicative complement. It's the direct object of to cost.
Just for the sake of completeness, there are also object complements. An object complement follows the direct object. In "It made me happy" happy is the complement to me.


text:
Q: How to access SOAP headers in Spyne I can't get to read even the simplest SOAP header.
I've been following the documentation which gives this example:
class RequestHeader(ComplexModel):
    user_name = Mandatory.Unicode
    session_id = Mandatory.Unicode

class UserService(ServiceBase):
    __tns__ = 'spyne.examples.authentication'
    __in_header__ = RequestHeader

    @rpc(_returns=Preferences)
    def some_call(ctx):
        username = ctx.in_header.user_name

But it doesn't say what the request should look like. I've tried:
<soap:Header>
    <user_name>test</user_name>
    <session_id>123</session_id>
</soap:Header>

But ctx.in_header is None. However, ctx.in_header_doc is there, so it tells me it's the parsing the XML into Python object that fails.
The header I'm trying to parse looks like this:
<soap:Header>
    <credentials>
        <loginToken>
            <token>12345678</token>
            <key>123456789</key>
            <householdId>46345435</householdId>
        </loginToken>
        <deviceId>345345345</deviceId>
        <deviceProvider>aaa</deviceProvider>
  </credentials>
</soap:Header>

How would I go about getting this in ctx.in_header? I tried creating nested objects for each XML element but it doesn't work. Which doesn't surprise me since the basic example from the docs doesn't work either.

A: You're getting ctx.in_header as None because the incoming document does not fit the object description.
Your current header could be parsed by something along the lines of:
class UserService(ServiceBase):
    __in_header__ = Unicode, Integer

... which does not seem to be what you want.
Your definition would work for the following input:
<soap:Header>
  <tns:RequestHeader>
    <tns:user_name>test</user_name>
    <tns:session_id>123</session_id>
  </tns:RequestHeader>
</soap:Header>

... where the tns: prefix is defined up there somewhere as the namespace of the RequestHeader object. The namespaces are important -- you need to learn how to work with them if you want your SOAP stuff to work.
Finally, to parse the credentials tag, you need at least something like a following definition (plus namespace qualifications):
class LoginToken(ComplexModel):
    _type_info = [
        ('token', Integer),
        ('key', Integer),
        ('householdId', Integer),
    ]

class Credentials(ComplexModel):
    __type_name__ = 'credentials'
    _type_info = [
        ('loginToken', LoginToken),
        ('deviceId', Integer),
        ('deviceProvider', Unicode),
    ]

I hope that helps.


text:
Q: Docker file with git installation for windows I need to create a docker file that does the following:
Install python.
Install git.
Clone git repo.
Run with latest commit.
I have the following for linux:
FROM ubuntu:16.04

RUN apt-get update && apt-get install -y --no-install-recommends python-pip
RUN apt-get install -y --no-install-recommends python-setuptools
RUN apt-get install -y --no-install-recommends python-wheel
RUN apt-get install -y --no-install-recommends git

# Clone project github repository
WORKDIR /repo
RUN git clone https://github.com/<repo>.git
# Checkout version
WORKDIR /repo/project
RUN git checkout <latest commit>

In the windows docker file creation I'll skip python installation by using python:2.7-windowsservercore-1809 as the base image.
I tried to search online for ways to install git like the above in linux, but couldn't find any way that worked for me (like using chocolaty)
Any ideas how to create an equivalent docker file for windows container?


text:
Q: Determinants of Vandermonde -type matrix with mixed powers A certain combinatorics problem requires finding the determinant of matrices like this:
\begin{equation}
 \begin{bmatrix}
a & b & c & d & f \\
a^2 & b^2 & c^2 & d^2 & f^2 \\
a^m & b^m & c^m & d^m & f^m \\
a^{m+1} & b^{m+1} & c^{m+1} & d^{m+1} & f^{m+1} \\
a^{m+2} & b^{m+2} & c^{m+2} & d^{m+2} & f^{m+2}
\end{bmatrix}
\end{equation}
For each column, is an arithmetic progression of powers and then another arithmetic progression for ${m+y}$ for integer $m$
What is this type of matrix called? I cannot find any information about matrices of this form or a book or paper that describes how to find determinants  of this type of matrix.
In the above example, the has $C(5,3)=10$ permutations of triples of $a^m,b^m,c^m,d^m,f^m $ and then polynomials of $a,b,c,d,f$ associated with each in order to construct the determinant. One is $(a-b)(c-d)(c-f)(d-f)(cdf)^{m}$

A: It does not have an elegant solution
Too many partitions. The reason  why the original  vandermonde matrix  has a nice form is because there is one partition regardless of the size.
So for the 7x7 version of the above matrix, we have 4 parts which have powers of m and 3 which do not. So the determinant will be of the form in which each 4-permutation of the 7 variables, for 35 different products.
Consider that  $a,b,c \approx z^{1/3}$ and $d,f,g,h \approx z$ as expansion of infinite series
So the determinant will be of the form $f_1(z)z^{4m}+f_2(z)z^{10m/3}+f_3(z)z^{8m/3}+f_4(z)z^{2m}$
So we have $C(4,1)C(3,3)+C(4,4)+C(4,3)C(3,1)+C(3,2)C(4,2)=C(7,4)=35$
$f_1(z)z^{4m}$ is the easiest and only has a single permutation, that being $C(4,4)$. This means that the $a^{m+y},b^{m+y},c^{m+y}$ terms can be zeroed-out, so you have a partition block matrix with one of the blocks zero, and determinant is easy to evaluate on this being the product of two small regular vandermonde matrices determinants, which is the product of 9 pairs (three for the 3x3 matrix and six for the 4x4 one). This can allow one to determine the asymptotic behavior of such matrices.
The next one has 12 permutations, so the determinant gets really messy fast.  This require zero-ing out triples of a,b...h and then swapping rows to make additional block matrices.


text:
Q: Gitzilla: Integration of github-project in Bugzilla I am working on a Debian server, where I installed bugzilla. According to the suggestions in the gitzilla-installation guidelines, I would like to integrate Gitzilla to a project on github.com, using the github.com-project as my central repo. Therefore, I am not quite sure, where to do the following steps:
Switch to the hooks directory (/path/to/repository/.git/hooks) and delete the post-receive and update hooks.

Link (or copy) the gitzilla provided hooks:

ln -s $(which gitzilla-post-receive) post-receive
ln -s $(which gitzilla-update) update

Moreover, I tested to choose my github.com-URL to integrate in the /etc/gitzillarc, but without success. PyBugz is installed, and I defined the link to bugzilla, the user_name and PW of the bugzilla-admin.
Best,
H.M.

A: https://github.com/your_repository.git/.git/hooks will be the path where you should execute the steps.
In case you have a bare repository, then https://github.com/your_repository.git/hooks would be the path.


text:
Q: How can I plot time-series on matplotlib polar plot? Unsure if a polar plot is exactly what I should be using to accomplish this. But, essentially, I have multiple time-series (just amplitude vs. time), each corresponding to a different angle in degrees. For example, I have ampl. vs time at 5 degrees, 10 degrees, 15, etc. For angles 0 to 360 at increments of 5, I would like to plot each time series on a circular, or polar plot.
I am attempting to do this with matplotlib and the projection='polar' flag on. There are 8000 amplitude values for each time-series. They are in a numpy array called data. To test plotting the time-series associated with 5-degrees, I made a numpy array of 8000 5's with 5*np.ones(8000) so that they are the same length.
thetas=np.arange(0,365,5) #make 0 to 360 degrees at increments of 5

ax=plt.subplot(111,projection='polar') #turn on polar projection
ax.plot(5*np.ones(8000),data)

plt.show()

I get:

You can see these data are not plotting along the 5-degree line, nor does it look like any amplitudes are showing (there should be squiggles up and down varying with time). Thank you in advance!
EDIT: Example of what I want (each color line is a different time-series)


text:
Q: Change router URL without navigating, but add to browser history I have a search page, where the user can perform a search and see a result.
Initially, my issue was to update the router URL without navigating, but I solved that by using "Location".
My ngOnInit - my search page can be navigated to by another page, so I listen for queryParams to perform the search if any happens:
ngOnInit() {
    this.queryParamsSubscription = this.activatedRoute.queryParams.subscribe(queryParams => {
      this.searchText = queryParams[TD_QUERY_PARAMS.text];
      if (this.searchText) {
        this.search();
      }
    });
  }

my search method:
search() {
    const queryParams: Params = { text: this.searchText };
    const desiredUrl = this.router.createUrlTree([], {
      queryParams: queryParams,
      relativeTo: this.activatedRoute,
      skipLocationChange: true
    });
    this.location.replaceState(desiredUrl.toString());
  }

This implementation makes sure that I update the URL when the user searches within the search page, which was the first part of my solution.
However, I also want to add any search to the browser history, ie:

*

*I start by launching my application on 'localhost:4200/landing'.

*On this page, I have a search bar, that when triggered will navigate to my search page.

*From the landing page, I search for '1'. The router then navigates to: 'localhost:4200/search?text=1'

*Then on the search page, I search for '2'. the search is performed, and the URL is updated to: 'localhost:4200/search?text=2'

*Finally I search for '3': ''localhost:4200/search?text=3'.
When I then press the browsers 'Back' button, I would expect to be navigated to ''localhost:4200/search?text=2'.
However, none of the searches I made within the page has been added to history, so I will be navigated to whatever page I was accessing before the search page. In my case, 'localhost:4200/landing'.
How can I add each of these searches to the browsers history?

A: I believe that one of these is what yo need:

*

*this.router.navigate(['/yourRouteGoesHere'], { replaceUrl: true });

*The other options that you have is to use: SkipLocationChange this.router.navigateByUrl(['yourFullPath'], { skipLocationChange: true });

*use this.router.replaceUrl('path').
That way you can navigate, without adding this route to history.

A: This was a case of way overthinking the issue I was facing.
By just using router.navigate(['/search'], { queryParams: queryPrams })
I got the result I desired. The URL was changed, a point was added to browser history.
What I failed to realize, was that router.navigate, will not reload the entire page, when only the queryParams are changed.
Hope this helps anyone struggling with the same issue.


text:
Q: How to get a full_html textarea field in a Drupal 8 configuration form? In my module I have a configuration form (ConfigFormBase) with a simple textarea field without formatting that works correctly.
$form['page_message'] = [
  '#type' => 'textarea',
  '#title' => $this->t('Message'),
  '#description' => $this->t('Message display to customer contacts.'),
  '#default_value' => $config->get('page_message'),
];

But I would like a textarea full_html field.
Is this possible and how with Drupal 8?

A: Yes it is possible, but you have to do it like this:
$form['page_message'] = [
  '#type' => 'text_format',
  '#title' => $this->t('Message'),
  '#format' => 'full_html',
  '#description' => $this->t('Message display to customer contacts.'),
  '#default_value' => $config->get('page_message'),
];

You can check Drupal api for TextFormat.php here, just click on view source and you will have all the info you need.