text:
Q: How to delete least filled duplicate rows? I have excel with Survey Results.
There are multiple submissions(rows) by the same email.
I want to find the most filled / most completed row and delete the rest of the duplicate rows with the same email address.
I have a table like this. Multiple Submissions from a single email.

Email
Question 1
Question 2
Question 3

Email1
Answer
Answer
Answer

Email1
Answer

Answer

Email2
Answer

Email2

Answer

Email2
Answer
Answer

I need to delete the least filed duplicated rows. and get Results like bellow.

Email
Question 1
Question 2
Question 3

Email1
Answer
Answer
Answer

Email2
Answer
Answer

How can I do this using openrefine or Excel?

A: This is easily possible with Excel.

*

*Create a helper column containing the formula COUNTA(%RowRange%).

*Then sort this helper column from largest to smallest.

*Last you select the entire table, click "Remove Duplicates" and in the pop-up box unselect all fields except email.
See these step-by-step screenshots:

Note:
In a case like this:

Email
Question 1
Question 2
Question 3

Email2

Answer

Email2
Answer

Answer

The answer to question 2 would be lost of course. If you need to consolidate such cases to result in one row like this:

Email
Question 1
Question 2
Question 3

Email2
Answer
Answer
Answer

That is also easily possible. Let me know if this is what you need or if the first solution is sufficient.

A: Use Excel Formulas
These steps, using only formulas, give you the result that you require.

*

*Add a helper column to calculate the number of answers per row.

=COUNTA($B$2:$D$2)

*Add a second helper column to calculate the most number of answers per Email.

=MAXIFS($E$2:$E$6,$A$2:$A$6,A2)

*Add a third helper column to calculate if a particular row has the most number of answers for the
Email.

=IF(E2=F2,"Keep","Remove")

*Combine the UNIQUE and FILTER functions to extract the e-mails to keep

=UNIQUE(FILTER(A1:D6,G1:G6="Keep",""),FALSE,FALSE)

An e-mail may have two or more rows with the same number of Most no. of answers.
Step 4 keeps the first row and removes the others.

Use Power Query
An alternate approach using the same methodology, is to use the Power Query functionality built into Excel.
In the M code, the assumption is that the source data is held in the same workbook as the query.
The data is in an Excel Table called Table1

*

*Select a cell in the table holding the data.

*On the Data menu tab in the Get & Transform Data section, click on From Table/Range

*Power Query will launch.  On the Home menu tab, click on Advanced Editor.

*Copy and paste the code below into the window, replacing the existing code.  Click on the Done button.

*On the Home menu tab, click on Close & Load
A new sheet will be added with the filtered data.
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Email", type text}, {"Question 1", type text}, {"Question 2", type text}, {"Question 3", type text}}),
    #"Added Column - No. of answers" = Table.AddColumn(#"Changed Type", "No. of answers", each List.Count(List.Select({[Question 1],[Question 2],[Question 3]},each _ <> null))),
    #"Grouped Rows - By No. of answers" = Table.Group(#"Added Column - No. of answers", {"Email"}, {{"Most no. of answers", each List.Max([No. of answers]), type number}, {"All", each _, type table [Email=nullable text, Question 1=nullable text, Question 2=nullable text, Question 3=nullable text, No. of answers=number]}}),
    #"Expanded grouped data" = Table.ExpandTableColumn(#"Grouped Rows - By No. of answers", "All", {"Question 1", "Question 2", "Question 3", "No. of answers"}, {"Question 1", "Question 2", "Question 3", "No. of answers"}),
    #"Added Column - Keep or Remove" = Table.AddColumn(#"Expanded grouped data", "Keep or Remove", each if ([Most no. of answers] = [No. of answers]) then "Keep" else "Remove"),
    #"Filtered Rows" = Table.SelectRows(#"Added Column - Keep or Remove", each ([Keep or Remove] = "Keep")),
    #"Removed Added Columns" = Table.RemoveColumns(#"Filtered Rows",{"Most no. of answers", "No. of answers", "Keep or Remove"}),
    #"Removed Duplicates" = Table.Distinct(#"Removed Added Columns", {"Email"})
in
    #"Removed Duplicates"

A: Remove Least Filled Duplicates

*

*After reviewing your post, it seems logical that you want to keep the last occurrence of an email with the most answers while this code keeps the first (see Email2 in the screenshot: it should keep the one in the 30th data row). To get this functionality, only a simple change is needed:
If qArr(dict(Key)) > qArr(sr) Then IsRow = True

*The result is ordered by when the first email was sent (2, 5, 3, 1, 4), not necessarily the email with the first maximum answers (2, 5, 1, 3, 4 or 5, 1, 3, 4, 2 after adopting the previously mentioned change). Also, the ID column, which has nothing to do with the code's functionality, 'testifies' about this. If this is necessary, let me know. The change is a little more elaborate.
Sub RemoveLeastFilledDuplicates()

    ' Define constants.
    Const WORKSHEET_NAME As String = "Sheet1"
    Const E_COLUMN As Long = 1
    Const Q_COLUMNS As String = "2:4"
    Const Q_DELIMITER As String = ":" ' one character only

    ' Reference the workbook and the worksheet.
    Dim wb As Workbook: Set wb = ThisWorkbook ' workbook containing this code
    Dim sws As Worksheet: Set sws = wb.Worksheets(WORKSHEET_NAME)

    Dim rg As Range, srCount As Long, cCount As Long

    ' Reference the range.
    With sws.Range("A1").CurrentRegion
        srCount = .Rows.Count - 1 ' use -1 to exclude headers
        cCount = .Columns.Count
        Set rg = .Resize(srCount).Offset(1)
    End With

    ' Write the values from the range to the Data array.
    Dim Data() As Variant: Data = rg.Value

    ' Extract the first and last question columns.
    Dim qPos As Long: qPos = InStr(Q_COLUMNS, Q_DELIMITER)
    Dim qFirst As Long: qFirst = Left(Q_COLUMNS, qPos - 1)
    Dim qLast As Long: qLast = Right(Q_COLUMNS, Len(Q_COLUMNS) - qPos)

    ' Define the Questions array.
    Dim qArr() As Long: ReDim qArr(1 To srCount)

    Dim sr As Long, c As Long, qCount As Long

    ' Write the number of non-empty question columns to the Questions array.
    For sr = 1 To srCount
        For c = qFirst To qLast
            If Len(CStr(Data(sr, c))) > 0 Then qCount = qCount + 1
        Next c
        If qCount > 0 Then qArr(sr) = qCount: qCount = 0
    Next sr

    ' Write the unique values from the email column to a dictionary.
    ' The 'keys' will hold the emails while the 'items' will hold the rows.
    ' The data from the Questions array is used to determine the row
    ' with the most non-empty question columns per email.
    ' The emails are ordered by their first occurrence.

    Dim dict As Object: Set dict = CreateObject("Scripting.Dictionary")
    dict.CompareMode = vbTextCompare

    Dim Key As Variant
    Dim IsRow As Boolean

    For sr = 1 To srCount
        Key = Data(sr, E_COLUMN)
        If Not IsError(Key) Then
            If Len(CStr(Key)) > 0 Then
                If dict.Exists(Key) Then
                    If qArr(dict(Key)) >= qArr(sr) Then IsRow = True
                End If
                If IsRow Then IsRow = False Else dict(Key) = sr
            End If
        End If
    Next sr

    Erase qArr

    ' Write the data from the dictionary to the top of the Data array.

    Dim dr As Long

    ' Write to the top.
    For Each Key In dict.Keys
        sr = dict(Key)
        dr = dr + 1
        For c = 1 To cCount
            Data(dr, c) = Data(sr, c)
        Next c
    Next Key

    Set dict = Nothing

    ' Clear the bottom.
    For sr = dr + 1 To srCount
        For c = 1 To cCount
            Data(sr, c) = Empty
        Next c
    Next sr

    ' Write the values from the Data array to the range.

    rg.Value = Data

    ' Inform.

    MsgBox "Least filled duplicates removed.", vbInformation

End Sub

A: I am going to assume that what you mean by:

delete least filled duplicate rows?

is to preserve the rows with the maximum number of responses rather than remove the rows with the least number of questions responded for a given email. If you want to remove the row per email group with the least number of responses I provided a modified version of Formula 1 at the end that satisfies this requirement.
Note: Based on your input data both approaches will produce the same result, but in a more general case the result will differ.
In cell F2 you can put the following formula (Formula 1);
=LET(emails, A2:A6, ans, B2:D6, cols, COLUMN(ans), ones, TOCOL(cols/cols),
 nonEmpty, IF(ans <>"", 1, 0), counts, MMULT(nonEmpty, ones),
 rank, MAP(emails, counts, LAMBDA(e,c, SUMPRODUCT((emails=e) * (counts > c))+1)),
 out, FILTER(HSTACK(emails, ans), rank = 1),
 IF(out=0, "", out)
)

and here is the output:

Note: This solution doesn't require helper columns to obtain the result.
Explanation
We use LET function for easy reading and composition. We are going to count non-blanks via MMULT. First, we identify non-empty answers as follows: IF(ans <>"", 1, 0) and name it nonEmpty. We define a unit vector (ones) to do the multiplication and sum by row. The name counts, has the output of MMULT(nonEmpty, ones). This is the corresponding output for the sample data:
3
2
1
1
2

Now we are going find the rank for rows within the same email based on counts. The rank 1 will be for the email with the maximum number of answers, then rank 2, and so on. For more information check the answer to the question: Set row maximum for FILTER formula provided by @DavidLeal. This is the condition to calculate the rank by descending order of counts, and we name it rank.
MAP(emails, counts, LAMBDA(e,c, SUMPRODUCT((emails=e) * (counts > c))+1))

Because we want to filter the result for emails with the maximum number of responses, then we filter by rank equal to 1. If we want to select also the row with the second most answered questions, then the condition will be instead rank <= 2. So it allows you to customize the result you want to filter.
FILTER(HSTACK(emails, ans), rank = 1)

The final step is just to remove the 0's generated by FILTER with an empty string.
Note: Once we have counts, there are multiple ways of achieving the same result. For example via DROP/REDUCE/VSTACK pattern. Check the answer from this question: how to transform a table in Excel from vertical to horizontal but with different length from @DavidLeal:
=LET(emails, A2:A6, ans, B2:D6,
 cols, COLUMN(ans), ones, TOCOL(cols/cols),
 nonEmpty, IF(ans <>"", 1, 0), counts, MMULT(nonEmpty, ones),
 uxEmails, UNIQUE(emails),
 out, DROP(REDUCE("", uxEmails, LAMBDA(acc, email, LET(
  maxCnt, MAX(FILTER(counts, emails=email)), result,
    FILTER(HSTACK(emails, ans), (emails=email) * (counts = maxCnt)),
    VSTACK(acc, result)))),1),
 IF(out=0, "", out)
)

If one or more rows per unique email have the maximum number of responses, all corresponding rows will be returned.
In my opinion, the rank approach gives more flexibility in case you want to show rows with a wider range of rank values and it is a less verbose formula.
Exclude least filled duplicate rows
If you want instead to exclude the rows with the least number of responses for a given group, the Formula 1 can be modified as follow:
=LET(emails, A2:A6, ans, B2:D6, cols, COLUMN(ans), ones, TOCOL(cols/cols),
 nonEmpty, IF(ans <>"", 1, 0), counts, MMULT(nonEmpty, ones),
 rank, MAP(emails, counts, LAMBDA(e,c, SUMPRODUCT((emails=e) * (counts < c))+1)),
 out, FILTER(HSTACK(emails, ans), rank > 1),
 IF(out=0, "", out)
)

We made the following changes:

*

*counts > c -> counts < c

*rank = 1 -> rank > 1
The first change reverses the rank, now the highest rank (rank =1) will be the the email within a group with the least number of responses. So if we want to exclude it, we just filter for rank greater than 1.

A: This is a straightforward solution how to solve this with OpenRefine.

*

*Count the number of answers in a new column named Sorting Helper via the GREL expression.

forEach(
    row.columnNames,
    colName,
    if(isNonBlank(row.cells[colName].value), 1, 0))
  .sum()

Note that there will be an offset in the count, as we additionaly count the column Email. This has no impact on the sorting.

*Sort the column Email.

*Additional descending sort on the Sorting Helper column.

*Use the blank down function via the Email => Edit cells => Blank down.

*Filter the rows with now empty Email cells using a Facet via Email => Facet => Customized facets => Facet by blank (null or empty string).

*Delete the filtered rows via All => Edit rows => Remove matching rows.

A: You have quite some answers already (and strangely haven't accepted any of the working).
Here's another way to spill the desired results in Office 365:
=LET(data,   A2:D6,
     count,  MMULT(--(data<>""),TRANSPOSE(COLUMN(data)^0)),
     e,      TAKE(data,,1),
     ue,     UNIQUE(e),
     mec,    DROP(REDUCE(0,e,LAMBDA(a,b,HSTACK(a,(e=b)*count))),,1),
     emec,   BYCOL(mec,LAMBDA(x,MAX(x))),
     uec,      UNIQUE(e&"|"&TRANSPOSE(emec)),
     ec,      e&"|"&count,
SUBSTITUTE(
           INDEX(data,
                 XMATCH(uec,ec),
                 SEQUENCE(1,COLUMNS(data)))
           ,"",""))

This counts the number of non-blanks per row then checks the max number of non-blanks per unique email name. Than the data is indexed to match the rows where the count of answers equals the max count for the email name.


text:
Q: Neo4j database execution error searching against an index with a node name containing a space I'm playing around with neo4j community edition 2.0.1, and I've struck a problem which I can't find a solution to.  My ineptitude with Cypher may be contributing to my issues!
I have a small number of nodes, with an index on a "Name" property.  For demonstration purposes, I have two nodes "Foo" and "Foo Bar".  Running any of the following Cypher queries in the browser interface works fine - returning either one or both nodes:
START n=node:node_auto_index("Name:Foo") match n RETURN n
START n=node:node_auto_index("Name:Foo*") match n RETURN n

However, running the following query returns a Neo database error (Neo.DatabaseError.Statement.ExecutionFailure) - note the space in the name:
START n=node:node_auto_index("Name:Foo Bar") match n RETURN n

I'm at a loss as to what this issue might be - is this an error with my search request, or a known problem with the database?  Many thanks!

A: The string supplied to node:node_auto_index is passed directly to the index provider (which is Lucene by default). There Lucene query syntax applies, see: http://lucene.apache.org/core/2_9_4/queryparsersyntax.html.
Space is a term separator in your case, so you might try:
START n=node:node_auto_index("Name:'Foo Bar'") match n RETURN n

(Actually - it's as per Stefan's comment below:
START n=node:node_auto_index('Name:"Foo Bar"') match n RETURN n

Thanks Stefan!)

redpajama_set_name: RedPajamaStackExchange


text:
Q: Can I trigger onChange function when there is an automated value for input? I have a Form.Input
<Form.Input
fluid
required
label="First name"
placeholder="Jose"
name="firstName"
value={ _.isNil(selectedProfile) ? firstName : selectedProfile.first_name }
onChange={this.onCustomerFieldUpdate}
/>

as you can see from my code, I am checking if selectedProfile is Null or not, if it is null, it will accept the input, but if not, It will get the value for selectedProfile.first_name. the problem is, I want to trigger onCustomerFieldUpdate even though it gets the value from selectedProfile.first_name but it doesn't because it can be triggered onChange. is there a way that I can call onCustomerFieldUpdate when my value is from selectedProfile.first_name?

A: Based on you checking condition you can call this.onCustomerFieldUpdate from componentDidMount method.


text:
Q: Creating/modifying a resource by sending a POST request to another (related) resource I am designing a RESTful API for tests and test runs metadata. I have two resources: Test and TestRun. Under the hood they have a one-to-one relationship in the database.
First I create a Test resource by sending a POST to api/v1/test.
Then I have to start this test. I do this by sending a POST to api/v1/test/{id}/run, which creates a TestRun resource that relates to that Test resource.
Then I can also stop the test by sending a POST to api/v1/test/{id}/finish, which modifies the corresponding TestRun resource (sets some fields, like finish_time, result etc.).
The user of the API will never have GET access to TestRun resources and will only access them through their related Test resources.
While it looks like this design is quite straightforward for the API user, I doubt this is also as straightforward for a developer. Is this design I came up with good enough? Does it violate any REST principles or best practices? I would appreciate any input on this.
An extended design description of the whole API: https://gist.github.com/Ch00k/27724e29ec1bf044ebbfdabef9e842d5

A: Your API will not allow access to the testrun, so a testrun seems not to be a REST Resource. In fact your URLs are a mix of REST, as far as the test is concerned, and RPC, especially the /run and /finish paths.
RPC is not REST, so I would rework this a little bit:

*

*Use only one type of resource, the test, at api/v1/test/{id}.

*A test has state that can be retrievd using a GET request to api/v1/test/{id}:

*

*status: stopped, started, finished, ...

*finish_time

*result

*...

*The state of a test is changed using a PATCH request to api/v1/test/{id} with a JSON body containing the new state: {"status": "started"} to start the test, etc. This replaces the RPC calls.


text:
Q: Split string using java regex I'm trying to split this string :

Testing package [Store Management](https://www.Testing.com/content/zone_store_mgmt_policy\"Store Management Policy") Test package2

using regex, so it splits into 3 parts:

*

*Testing package

*[Store Management]   (https://www.Testing.com/content/zone_store_spl_policy\"Store Management Policy")

*Test package2

The rule is split the string when the pattern [any characters](any characters) is found.
This is what I tried :
String values ="Testing package [Store Management](https://www.Testing.com/content/zone_store_spl_policy\"Store Management Policy\") Test package2";
pattern = Pattern.compile("(?:\\[.*\\]\\(.*\\))");
valueArray = pattern.split(values);
for (String s: valueArray)
           System.out.println(s);

But the output is:
Testing package
Test package2
I need an array containing 3 strings as above.

A: It will be far simpler to use group matching then simple split as you have different delimiters for each portion
Try the following (using very naïve pattern matching)
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexMatches {
   public static void main( String args[] ) {
      String line = "Testing package [Store Management](https://www.Testing.com/content/zone_store_mgmt_policy\"Store Management Policy\") Test package2";
      String pattern = "(.*)\\s*(\\[.*\\])(\\(.*\\))\\s*(.*)";

      // Create a Pattern object
      Pattern r = Pattern.compile(pattern);

      // Now create matcher object.
      Matcher m = r.matcher(line);

      if (m.find( )) {
         System.out.println(m.group(1));
         System.out.println(m.group(2));
         System.out.println(m.group(3));
         System.out.println(m.group(4));
      } else {
         System.out.println("NO MATCH");
      }
   }
}

Some reference:
On capturing groups in regex
Java Matcher


text:
Q: Angular- Got an error while creating routes in Angular I am new on Angular and  I want to create routes in my angular app and I got an error in app.module.ts while declaring routes service. I'm getting confused about what I write in the brackets of RouterModule.forRoot()
error: error TS2304: Cannot find name 'Routes'.RouterModule.forRoot(Routes)

route.service.ts:
import { Injectable } from '@angular/core';
import { Routes } from '@angular/router';
import { ParentComponent } from '../parent/parent.component';
import { from } from 'rxjs';
import { ChildComponent } from '../child/child.component';

const appRoutes:Routes=[

  {path:"parent",component:ParentComponent},
  {path:"child",component:ChildComponent}
]
@Injectable({
  providedIn: 'root'
})
export class RoutesService {

  constructor() { }
}

app.module.ts:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
// import {MessageserviceService} from './services/messageservice.service'
import {MessageserviceService} from './services/messageservice.service';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { ParentComponent } from './parent/parent.component';
import { ChildComponent } from './child/child.component';
import { RoutesService } from './services/routes.service';
import { RouterModule } from '@angular/router';

@NgModule({
  declarations: [
    AppComponent,
    ParentComponent,
    ChildComponent,

  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    RouterModule.forRoot(appRoutes)  //i got error in this line,

  ],
  providers: [MessageserviceService,RoutesService],
  bootstrap: [AppComponent]
})
export class AppModule { }

A: Move this declaration
const appRoutes: Routes = [

  {path:"parent",component:ParentComponent},
  {path:"child",component:ChildComponent}
]

to the AppModule. Also, seems like you can simply remove RoutesService, I don't think it serves any function.

A: If you're trying to separate routes from main Module, just create a routingModule as it is done in angular documentation: https://angular.io/tutorial/toh-pt5#add-the-approutingmodule
By the way, your code just cannot work.
If you want to keep "appRoutes" in a service file, then either use
export const appRoutes: Routes = [

  {path:"parent",component:ParentComponent},
  {path:"child",component:ChildComponent}
];

But then your service is just useless.
Or move appRoutes inside your service, and declare it as an attribute of your service.
In both cases, make sure to import appRoutes in AppModule.
But once again, it's not really the way to handle routing in a "regular" angular app.


text:
Q: I'm getting error while starting yarn services while hadoop configuration Starting yarn daemons,
starting resource manager, logging to /opt/hadoop/logs/yarn-root-resourcemanager-Web.out

[Fatal Error] yarn-site.xml:24:1: The end-tag for element type
  "property" must end with a '>' delimiter. localhost: starting
  nodemanager, logging to /opt/hadoop/logs/yarn-root-nodemanager-Web.out
  localhost: Error: Could not find or load main class
  org.apache.hadoop.yarn.server.nodemanager.NodeManager

A: In your file named "yarn-site.xml", in line 24, at column 1, you have a syntax error.
You haven't ended a property with > as the error message clearly suggests.

Taken from here, the general structure for a property is:
<property>
 <name> </name>
 <value> </value>
 <description> </description>
</property>

It seems like you missed the ending > in the starting or ending tag of the property.


text:
Q: Added programmatically UITabBarItem after switching app got crashed For existing UITabBarController already in storyboard do have Two TabBars (Home / Settings).
Now I added two more TabBarIems based on conditions based
(programVC / reportVC) i.e., UIViewController.
When Switching Tab programVC or reportVC app get crashed.
The @IBOutlet var skeletonView: UIView!  added in ProgramReportVC set to nil
class MainTabbarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        addedConditionalTabs(isInserted: true)
    }

// For existing tab inserted new tabs based on condition
func addedConditionalTabs(isInserted: Bool){
    if isInserted{
        let programVC = ProgramReportVC() // ProgramReportVC -> UIViewController
       programVC = "Program"
        let reportVC = ProgramReportVC()
       reportVC.screenTitle = "Report"

       programVC.tabBarItem = UITabBarItem(title: "Program", image: UIImage(named: "ProgramImage"), tag: 2)
       reportVC.tabBarItem = UITabBarItem(title: "Report", image: UIImage(named: "ReportImage"), tag: 3)

        self.viewControllers?.insert(programVC, at: 2)
        self.viewControllers?.insert(reportVC, at: 3)
    }

 }

s
Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
How to resolved Unexpectedly found nil ?
programVC ->
@IBOutlet var skeletonView: UIView!
@IBOutlet var views: [UIView]!
@IBOutlet var subviews: [UIView]!

override func viewDidLoad() {
    super.viewDidLoad()
    self.showSkeleton()
  }

func showSkeleton() {
    self.skeletonView.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
    self.view.addSubview(self.skeletonView)
    self.view.bringSubviewToFront(self.skeletonView)
    let gradient = SkeletonGradient(baseColor: UIColor(named: "skeletonColor")!)
    let animation = SkeletonAnimationBuilder().makeSlidingAnimation(withDirection: .leftRight)
    self.skeletonView.isSkeletonable = true
    for items in views {
        items.isSkeletonable = true
    }
    for items in subviews {
        items.isSkeletonable = true
        items.showAnimatedGradientSkeleton(usingGradient: gradient, animation: animation)
    }
}

A: It sounds like this is unrelated to the UITabBarController or how you're adding VCs to it. If a UIView that is nil gets force unwrapped (as is the case with your skeletonView IBOutlet), that will cause a crash regardless of whether the VC is presented by a tab controller or by something else.
Update: Based on the thread conversation, your issue is that you're accessing skeletonView inside of the ProgramReportVC's viewDidLoad method. The VC's view will not have been initialized at that point in time, which also means its IBOutlets will not have been resolved yet.
My recommendation would be to call showSkeleton() in viewDidAppear instead, since UI updates in general are best done once the UI is actually visible on the screen.

A: if let programReportVC = UIStoryboard.identifier(.Dashboard).instantiateViewController(identifier: "ProgramReportVC") as? ProgramReportVC{
    // Do your Stuff here.
}

It's worked if added via like this.


text:
Q: Gradle using PreBuilt Static Library I am moving from Eclipse to Android Studio and I am trying to use Gradle in order to include a PreBuilt static library.
I am following the two-libs sample provided with the ndk sample projects and implement it in Android Studio.
What I have:
The prebuilt static library:
[ndk-path]\samples\two-libs\obj\local\armeabi-v7a\libtwolib-first.a
The header file for the library:
[ndk-path]\samples\two-libs\jni\first.h
containing a single method:
extern int first(int  x, int  y);

Now how do I use it as a prebuilt static library in android studio?
What I tried:
Adding the files:
Added the library to my android studio project by creating jniLibs (I read this is used for preBuild dynamic libraries, not sure if preDuilt static libraries should be using this path as well):
[android-studio-project-path]\app\src\main\jniLibs\armeabi-v7a\libtwolib-first.a
And added the header file to:
[android-studio-project-path]\app\src\main\jni\first.h
Code changes:
In java:
called a native method Foo.
In the JNI header file:
declared the Foo method.
In the c file implementing the JNI header:
added the #include "first.h"
and called the first method.
But I get an error during compilation:
"error: undefined reference to 'first'"
Which I am guessing it is because during compile time it doesn't find the implementation file for first.h and does not enable to dynamically load it.
If I add the first.c file (the implementation file and not loading it as a library it works)
I am new to c code and JNI, so any help would be nice!

A: I was struggling with the same problem and tried all kinds of tricks wasting quite a bit of time until I bumped into this: https://groups.google.com/d/msg/adt-dev/FoyeXl2vl3s/jLvH5lztDwAJ and found the solution.
In your build.gradle file put the prebuilt lib as part of ldLibs in the android.ndk section, e.g.
android.ndk {
    moduleName = "myJniModule"
    stl = "gnustl_shared" // Or whichever you like
    // Put your cppFlags or CFlags here too
    ldLibs += ['twolib-first'] // The name of your prebuilt lib without file suffix and 'lib' prefix
}

Then in productFlavors add path of the prebuilt lib in ldFlags:
android.productFlavors {
    create("arm") {
        ndk.with {
            abiFilters += "armeabi-v7a"
            ndk.ldFlags += "-L${file("app/src/main/jniLibs/armeabi-v7a/")}".toString()
        }
    }
}

This worked for me at least. I'm using the experimental Gradle plugin v0.2.0.


text:
Q: To increase or to mute volume programmatically for windows phone I wanted to know is there any classes or API for accessing the same ? I have seen lots of applications on windows phone store. click here for sample.

A: For Windows Phone, you can use Microsoft Media Foundation APIs. If you want to use the volume APIs in c# you need to make a reference to a C++ project that does it.
IMFMediaEngine::SetVolume method :
HRESULT SetVolume(
    [in]  double Volume
);

Volume [in] : The volume level. Volume is expressed as an attenuation level, where 0.0 indicates silence and 1.0 indicates full volume (no attenuation).

I think you can use a background audio agent too.


text:
Q: sql exclude rows based on first occurrence of data and conditions I have created a dataset that has columns for 2 customers:
Cust_No Transaction_date    amount  credit_debit    running_total   row_num
1       5/27/2022           800     D               -200            1
1       5/26/2022           300     D               600             2
1       5/22/2022           800     C               900             3
1       5/20/2022           100     C               100             4

9       5/16/2022           500     D               -300            1
9       5/14/2022           300     D               200             2
9       5/6/2022            200     C               500             3
9       5/5/2022            500     D               300             4
9       5/2/2022            300     D               800             5
9       5/2/2022            500     C               1100            6
9       5/1/2022            500     C               600             7
9       5/1/2022            100     C               100             8

The result I am looking for is:
Cust_No Transaction_date    amount  credit_debit    running_total   row_num
1       5/27/2022           800     D               -200            1
1       5/26/2022           300     D               600             2
1       5/22/2022           800     C               900             3

9       5/16/2022           500     D               -300            1
9       5/14/2022           300     D               200             2
9       5/6/2022            200     C               500             3
9       5/5/2022            500     D               300             4
9       5/2/2022            300     D               800             5
9       5/2/2022            500     C               1100            6

I sorted the dataset based on latest transaction for each customer.
We note the latest transaction amount and search for first occurrence of same amount that was a credit (C) and exclude the rest of the rows after it.
In the example above: Customer 9 has lastest debit transaction of 500, so we look for most recent credit transaction of 500 and exclude all the rows after that for customer 9.
Progress Made so far:

*

*calculated the running total using logic:

sum (case when credit_debit ='C' then amount else -1*amount end) over (partition by cust_no order by transaction_date desc ) as running_total

I also got the data using lead 1,2,3,4,5 but this is not efficient and I could have multiple rows before I find the first credit number with amount same as 1st row:
case when lead(amount, 1) over(partition by cust_no order by transaction_date desc) = amount then amount else null end as lead1

A: No sure which dbms this is for but it need a lateral join in postgres.
It searches for the most recent transaction identified when rn = 1, then it matches that amount to an earlier credit transaction of the same amount and using the rn of that row to form a boundary of row numbers to be returned:
with CTE as (
    select
          Cust_No, Transaction_date, amount, credit_debit, running_total
        , row_number() over(partition by cust_no order by transaction_date DESC) as rn
    from mytable
    )
, RANGE as (
    select *
    from CTE
    left join lateral (
        select c.rn as ignore_after
        from CTE as c
        where CTE.Cust_No = c.Cust_No
            and CTE.amount = c.amount
            and  c.credit_debit = 'C'
            and CTE.rn = 1
        order by c.rn ASC
        limit 1
        ) oa on true
    where CTE.rn = 1
    )
select
     CTE.*
from CTE
inner join RANGE on CTE.rn between RANGE.rn and RANGE.ignore_after
                and CTE.cust_no = RANGE.cust_no

Cust_No | Transaction_date | amount | credit_debit | running_total | rn
------: | :--------------- | -----: | :----------- | ------------: | -:
      1 | 2022-05-27       |    800 | D            |          -200 |  1
      1 | 2022-05-26       |    300 | D            |           600 |  2
      1 | 2022-05-22       |    800 | C            |           900 |  3
      9 | 2022-05-16       |    500 | D            |          -300 |  1
      9 | 2022-05-14       |    300 | D            |           200 |  2
      9 | 2022-05-06       |    200 | C            |           500 |  3
      9 | 2022-05-05       |    500 | D            |           300 |  4
      9 | 2022-05-02       |    300 | D            |           800 |  5
      9 | 2022-05-02       |    500 | C            |          1100 |  6

for postgres see: db<>fiddle here
nb: for an "outer apply" example I have also used SQL Server in the following fiddle  see: db<>fiddle here


text:
Q: How to display Woocommerce products list by tag

<?php
$taxonomyName = "product_tag";
 if($taxonomyname = "latest-product"){
//This gets top layer terms only.  This is done by setting parent to 0.
    $parent_terms = get_terms($taxonomyName, array('parent' => 0, 'orderby' => 'term_id', 'hide_empty' => true, 'order' => 'ASC'));

    foreach ($parent_terms as $pterm) { ?>

                <a href="<?php echo get_term_link($pterm->name, $taxonomyName); ?>">

                    <?php
                    $thumbnail_id = get_woocommerce_term_meta($pterm->term_id, 'thumbnail_id', true);
                            // get the image URL for parent category
                    $image = wp_get_attachment_url($thumbnail_id);

                    echo ''; ?>

<?php echo $pterm->name; ?>

        <?php } ?>
    <?php } ?>

this is my above code where i want to display product with latest-product tag name.
I am not able to display product by latest-product tag.

A: product_tag is non-hierarchical product category.
 To fetch the products you will need to run the query as below :
add_action("admin_init","display_products");
function display_products()
{
 ob_start();

 $args = array(
            'post_type'      => 'product',
            'posts_per_page' => -1,
            'product_tag'    => array('latest-product')
            );
 $loop = new WP_Query( $args );
 $product_count = $loop->post_count;

 if( $product_count > 0 ){
    echo '
';
    while ( $loop->have_posts() ) : $loop->the_post();
            global $product;
            global $post;

            echo "
" . $loop->post->ID. "
";

    endwhile;

    echo '
';
 }else{
       echo 'No product matching your criteria.';
 }

 $result =  ob_get_clean();
 echo $result;
 }

Note : Just to check the snippet I have added it on admin_init hook You can change it.
Tax Query can be added in arguments for supporting multiple tags.

A: Finally Solved my problem My previous code was only for category wise product but when using tag it should be post. for better explain someone can please explain about the whole process.
<?php
            $args = array(
                'number'     => $number,
                'orderby'    => 'title',
                'order'      => 'ASC',
                'hide_empty' => $hide_empty,
                'include'    => $ids
            );
            $product_tags = get_terms( 'product_tag', $args );
            $count = count($product_tags);
            if ( $count > 0 ){
                foreach ( $product_tags as $product_tag ) {
                    // echo '
' . $product_tag->name . '
';
                    $args = array(
                        'posts_per_page' => -1,
                        'tax_query' => array(
                            'relation' => 'AND',
                            array(
                                'taxonomy' => 'product_tag',
                                'field' => 'slug',
                                // 'terms' => 'white-wines'
                                'terms' => $product_tag->slug,
                                'product_tag'=> "latest-product"
                            )
                        ),
                        'post_type' => 'product',
                        'orderby' => 'title,'
                    );
                    $products = new WP_Query( $args );
                    echo "
";
                    while ( $products->have_posts() ) {
                        $products->the_post();
                        ?>

                                <a href="<?php the_permalink(); ?>">
                                    <?php the_title(); ?>
                                    <?php echo get_the_post_thumbnail( $post_id, 'thumbnail' ); ?>

                        <?php
                    }
                    echo "
";
                }
            }
         ?>


text:
Q: vim :make without external window in vim, when I use
:make

the output of make is displayed in a "external" window, I don't like this and I use this map
 nnoremap <leader>m :w <bar> make<CR><CR><CR>:copen<CR>

but, in some case the output of make is
 make: Nothing to be done for `all'.

how I can add a autoclose to copen  when the copen have make: Nothing to be done for all. ?

A: You can check the contents of the quickfix list via getqflist(). Then, I would only conditionally open the quickfix window if the first line does not match the text you don't want to see:
nnoremap <leader>m :w <bar> make<CR><CR><CR>
\:if get(get(getqflist(), 0, {}), 'text', '') !~# 'Nothing to be done' <Bar>
\  copen <Bar>
\endif<CR>

The access via get() avoids errors when the list is empty.
You could also always open the list, and then use :cclose in the conditional, if that better fits your needs.

A: i have a vim script that helps me a lot:

*

*first it saves the current edit window (if possible, won't work if read only)

*then it runs make and redirects errors (stderr) to temp file (stdout is ignored)

*if build failed then open quick fix windows and fill it with error messages.

*delete temporary file

command! -nargs=* Build call s:RunBuild()

function! s:RunBuild()
    let tmpfile = tempname()

    "build and surpresses build status messages to stdout
    "(stdout message are not very informative and may be very very long)
    "Error messages are redirected to temporary file.
    let buildcmd = "make -j 2> " . tmpfile . " >/dev/null"

    let fname = expand("%")
    if fname != ""
        " save current buffer if possible (your bad if file is read only)
        write
    endif

    " --- run build command ---
    echo "Running make ... "
    let cmd_output = system(buildcmd)

    "if getfsize(tmpfile) == 0
    if v:shell_error == 0
      cclose
      execute "silent! cfile " . tmpfile
      echo "Build succeded"
    else

      let old_efm = &efm
      set efm=%f:%l:%m
      execute "silent! cfile " . tmpfile
      let &efm = old_efm

      botright copen
    endif

    call delete(tmpfile)
endfunction

Then i map the F5 key to do the build in each vim mode

"F5 - run make (in normal mode)
:nnoremap  :Build

"F5 - run make (in visual mode)
:vnoremap  :Build

"F5 - run make (in insert mode)
:inoremap  :Build


text:
Q: Display differently styled bulletpoints with pygame Is there any posibility to render differently styled bullet points in Python3 with pygame? I can use the following character ' - ', but I'd rather have round bulletpoints for example, like the ones stackoverflow uses:

*

*This type of bulletpoint

As a horribly ugly workaround I am currently thinking of drawing a circle where the bulletpoint would be, but before I put the effort in, I wanted to ask if it is inherently impossible with pygame or if I am missing something.
Minimal working code if you want to test your solutions:
import pygame
pygame.init()
screen = pygame.display.set_mode((600, 900))
pygame.display.get_surface().fill((200, 200, 200))
# Fonts
pygame.font.init()
my_font = pygame.font.SysFont('Arial', 30)
text_surface = my_font.render('Some Text', False, (0, 0, 0))
text_surface2 = my_font.render('- A bulletpoint text', False, (0, 0, 0))
# Loop
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()
    screen.blit(text_surface, (10, 0))
    screen.blit(text_surface2, (10, 50))
    pygame.display.flip()

A: You have an option to download font that has different types of bulletpoints and use it. An easier but limiting alternative is to directly use the unicode for bulletpoint, which is u'\u2022', but this would limit the types of bulletpoints you can use.
import pygame
pygame.init()
screen = pygame.display.set_mode((600, 900))
pygame.display.get_surface().fill((200, 200, 200))
# Fonts
pygame.font.init()
my_font = pygame.font.SysFont('Arial', 30)
text_surface = my_font.render('Some Text', False, (0, 0, 0))
text_surface2 = my_font.render(u'\u2022 BulletPoint' , False, (0, 0, 0))
# Loop
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            exit()
    screen.blit(text_surface, (10, 0))
    screen.blit(text_surface2, (10, 50))
    pygame.display.flip()

Also, note that you have to set anti-aliasing to True, otherwise it doesn't make a circle.
 my_font.render(u'\u2022 BulletPoint' , True, (0, 0, 0))


text:
Q: Files from sub directories Can somebody help me to implement to add files from sub directories to my listbox ? I have looked for some information from google, but source code from those examples was really diffrent than my and I'm newbie in VB.NET. I think it may be the System.IO.SearchOption.AllDirectories but I have no clue how to implement it in my code.
    Private Sub ButtonFolder_Click(sender As System.Object, e As System.EventArgs) Handles ButtonFolder.Click
    FolderBrowserDialog1.ShowDialog()
    FilePathLabel.Text = System.IO.Path.GetFileName(FolderBrowserDialog1.SelectedPath)
    Dim folder As New IO.DirectoryInfo(System.IO.Path.GetFullPath(FolderBrowserDialog1.SelectedPath))
    Dim arrfile() As IO.FileInfo
    Dim file As IO.FileInfo
    arrfile = folder.GetFiles("*.*")
    dicPaths.Clear()
    For Each file In arrfile
        'ListBox1.Items.Add(file.FullName)
        dicPaths.Add(file.Name, file.FullName)
    Next file
    For Each item As String In dicPaths.Keys
        ListBox1.Items.Add(item)
    Next item
    Label1.Text = "Total Items : " + ListBox1.Items.Count.ToString
End Sub

A: Try This:
Public Function FindFiles(ByVal Path As String) As Boolean
Dim Directories As New IO.DirectoryInfo(Path)
Dim Directory As IO.DirectoryInfo
Dim File As IO.FileInfo
For Each Directory In Directories.GetDirectories
For Each File In Directory.GetFiles
ListBox1.Items.Add(File.Name)
Next

If Directory.GetDirectories.Length > 0 Then
FindFiles(Directory.FullName)
End If
Next
End Function

Usage: FindFiles(FolderBrowserDialog1.SelectedPath)


text:
Q: Alternatives to the Query-string managing state We're using React redux, which is fantastic. However, the moment someone refreshes their browser we lose the Redux store and as a result the application breaks or needs to redirect back to the 'start'.
We are using the Query-string to manage this, but I have been told Management this is 'Ugly' and we should find an alternate place to hold this information and remove it from the URL.
My understanding is we could use a number of things; Cookies, local storage, session storage etc.
However, I don't know which is the best to use.
We're essentially just looking for somewhere to move the information contained in the URL. E.G. https://url.com?querystring=12345&non-sensitive-id=2242
Edit: We're using Typescript, so ideally having a typesafe option would be ideal. We can achieve this with querystrings.

A: You can use localStorage of HTML5.
To store data:

//To store data:
        localStorage.setItem("key", 'value');
//To access data:
        localstorage.getItem("key");
//and to remove from local storage,
        localStorag.removeItem("key");


text:
Q: PayPal not $_POSTing back data to return URL correctly from mobile devices The checkout function on my client's site works by passing data to PayPal based on the following form:
  <input type="hidden" name="cmd" value="_xclick" />
  <input type="hidden" name="rm" value="2" />
  <input type="hidden" name="cbt" value="Confirm your payment" />
  <input type="hidden" name="business" value="blah" />
  <input type="hidden" name="item_name" value="blah" />
  <input type="hidden" name="amount" value="blah" />
  <input type="hidden" name="shipping" value="blah" />
  <input type="hidden" name="button_subtype" value="products" />
  <input type="hidden" name="no_shipping" value="2" />
  <input type="hidden" name="return" value="blah" />
  <input type="hidden" name="notify_url" value="blah" />
  <input type="hidden" name="cancel_return" value="blah" />
  <input type="hidden" name="currency_code" value="blah" />
  <input type="hidden" name="image_url" value="" />
  <input type="hidden" name="lc" value="AU" />
  <input type="hidden" id="custom" name="custom" value="blah" />
  <input type="hidden" class="btn btn-primary" style="width:100%" alt="PayPal - The safer, easier way to pay online!"/>

When checkout is complete, and annoyingly after the customer presses 'Confirm your payment'; PayPal passes post information to 'return'.
This works in some cases. However, when a user pays via a mobile device such as an Android phone or an iPad, occasionally there is no data passed back to the 'return' URL in $_POST which causes a 'Payment Failed' email to be sent out to me with an empty $_POST variable.
Am I doing something wrong? How can I get the data to pass back correctly?
I have the items pulled from a database based on "custom", but my client is unhappy that all of the data (especially the address) is not sent conveniently in one email.

A: I want to recommend not building your clients buttons that way. Any person who can edit html, can simply change the value of amount to $1 and if the merchant doesn't catch it, will ship a product that was only charged a buck.
You may want to complete this task with a api's instead of using $_post
Just seen it happen before.


text:
Q: Is there an easy way to use Vim text-objects on camel case words? Often I'll be doing a quick edit to a camel case word in some code and wish I could use something like text-objects to select one part of the camel case word.
For example, given this snippet:
class TextObject:
    pass

If my cursor is on the 'x' in TextObject, I would like to quickly select/operate on the word 'Text'.  If my cursor is on the 'j', I would like to manipulate the word 'Object'.
Vim text-objects allow me to quickly manipulate the entire word TextObject (e.g 'caw'), but I've noticed that I quite often want to manipulate only a single word in a camel case string like this.
Any pointers?
Thanks in advance

A: This is exactly what the CamelCaseMotion script is for.  I use it all the time.


text:
Q: ReactJS: Unhandled Rejection (TypeError): Cannot read property 'push' of undefined. Having issues pushing to another component App not behaving correctly when I try signing up along with posting Stripe payment, it will not push the sashboard component
The error I am getting:
Unhandled Rejection (TypeError): Cannot read property 'push' of undefined
handleStripeSubmit
src/components/sections/SignupForm.js:78
  75 | const { id } = paymentMethod;

76 | console.log("111111111 and ID_", id);

77 | aprops.signup(state, id);

 78 |    aprops.history.push("/dashboard");

     | ^  79 |
  80 | console.log("3333333333");

81 | // setState({ ...state, stripeId: id });

My Code (what do youthink is not working?:
someone, please help...
import React, { useState } from "react";
import classNames from "classnames";
import { Link, withRouter, Route } from "react-router-dom";
import SectionHeader from "./partials/SectionHeader";
import Input from "../elements/Input";
import Button from "../elements/Button";
import { signupUser } from "../../redux/actions/user_action";
import { CardElement, useStripe, useElements } from "@stripe/react-stripe-js";
import { connect } from "react-redux";
import { createHashHistory } from 'history';

export const history = createHashHistory()

//Checkout Form component-----------------------------------------------=
const StripeForm = (aprops) => {
    const [state, setState] = useState({
        bname: "Busines Name",
        email: "Email address",
        password: "Password",
        name: "Name on Card",
        amount: 0,
        plan: "",
        stripeId: "",
    });
    const {
        className,
        topOuterDivider,
        bottomOuterDivider,
        topDivider,
        bottomDivider,
        hasBgColor,
        invertColor,
        ...props
    } = aprops;

    const outerClasses = classNames(
        "signin section",
        topOuterDivider && "has-top-divider",
        bottomOuterDivider && "has-bottom-divider",
        hasBgColor && "has-bg-color",
        invertColor && "invert-color",
        className
    );

    const innerClasses = classNames(
        "signin-inner section-inner",
        topDivider && "has-top-divider",
        bottomDivider && "has-bottom-divider"
    );

    const sectionHeader = {
        title: "Welcome. We exist to make cybersecurity easier.",
    };

    const handlechangeall = (event) => {
        setState({ ...state, [event.target.name]: event.target.value });
    };

    const handleRadio = (e) => {
        setState({
            ...state,
            amount: Number(e.target.value) * 100,
            plan: e.target.id,
        });
    };

    const handleStripeSubmit = async () => {
        const { error, paymentMethod } = await stripe.createPaymentMethod({
            type: "card",
            card: elements.getElement(CardElement),
        });
        if (!error) {
            console.log("response of stripe payment___", paymentMethod);
            const { id } = paymentMethod;
            console.log("111111111 and ID_", id);
            aprops.signup(state, id);
      aprops.history.push("/dashboard");

            console.log("3333333333");
            // setState({ ...state, stripeId: id });
        }
    };

    const handlesubmit = (event) => {
        event.preventDefault();
        handleStripeSubmit();
        //alert( JSON.stringify(this.state));
        console.log(JSON.stringify(state));
    };

    //Stripe hooks-------
    const stripe = useStripe();
    const elements = useElements();
    //=============================

    return (

                    <SectionHeader
                        tag="h1"
                        data={sectionHeader}
                        className="center-content"
                    />

                                <form onSubmit={handlesubmit}>
                                    <fieldset>

                                            <Input
                                                label="Business name"
                                                type="text"
                                                name="bname"
                                                value={state.bname}
                                                onChange={handlechangeall}
                                                labelHidden
                                                required
                                            />

                                            <Input
                                                type="email"
                                                name="email"
                                                label="Email"
                                                value={state.email}
                                                onChange={handlechangeall}
                                                labelHidden
                                                required
                                            />

                                            <Input
                                                type="password"
                                                name="password"
                                                label="Password"
                                                value={state.password}
                                                onChange={handlechangeall}
                                                labelHidden
                                                required
                                            />

                                        {/* Stripe Integration */}

                                                Select Subscription tier (to select, use up & down arrow
                                                keys):

                                        {/* all packages amounts here */}

                                            {console.log("checking plan amount____", state.amount)}

                                                    <input
                                                        type="radio"
                                                        id="default"
                                                        value="49"
                                                        name="plan"
                                                    />
                                                    ($49/month)

                                                    <input
                                                        type="radio"
                                                        id="basic"
                                                        name="plan"
                                                        value="199"
                                                    />
                                                    Basic ($199/month)

                                                    <input
                                                        type="radio"
                                                        id="complete"
                                                        name="plan"
                                                        value="249"
                                                    />
                                                    Complete ($249/month)

                                            Enter Card Details Here!

                                                <Input
                                                    label="Name on the card"
                                                    type="text"
                                                    name="name"
                                                    value={state.name}
                                                    onChange={handlechangeall}
                                                    labelHidden
                                                    required
                                                />

                                                <CardElement />

                                            {/* <button type="submit" disabled={!stripe}>
                                                    Checkout
                                                </button> */}

                                                <Button type="submit" color="primary" wide>
                                                    Register
                                                </Button>

                                    </fieldset>
                                </form>

                                        Already have an account?{" "}
                                        <Link to="/login/" className="func-link">
                                            Login
                                        </Link>

    );
};

// const SignupForm = () => {
//  return (
//      <Elements stripe={stripePromise}>
//          <StripeForm />
//      </Elements>
//  );
// };
// SignupForm.propTypes = propTypes;
// SignupForm.defaultProps = defaultProps;

const mapStateToProps = (state) => ({});
const mapDispatchToProps = (dispatch) => {
    return { signup: (data, id) => dispatch(signupUser(data, id)) };
};

export default connect(mapStateToProps, mapDispatchToProps)(StripeForm);

A: You are not passing history prop to StripeForm component - it is undefined. what is actually passed is { signup: (data, id) => dispatch(signupUser(data, id)) }.
A possible solution could be:
const mapStateToProps = (state) => ({ history: [] });

or assigning history some default value:
const {
        className,
        topOuterDivider,
        bottomOuterDivider,
        topDivider,
        bottomDivider,
        hasBgColor,
        invertColor,
        history = [],
        ...props
    } = aprops;


text:
Q: What is the purpose of adding BindableAttribute on a property of a custom control? I have seen that BindableAttribute is used to decorate public properties in custom controls.
MSDN briefly mentions that it provides the ability to control the binding direction and whether binding is supported at design time.
public class MyControl : Panel
{
    [Bindable(BindableSupport.No, BindingDirection.OneWay)]
    public string MyString { get; set; }
}

var myControl = new MyControl();
var myString = myControl.MyString;

Questions:
1) I set BindableSupport to No, however I could still do this in markup (.aspx).
What does BindableSupport affect then? Does it hide the property in the toolbox?
<cc:MyControl runat="server" MyString="something" />

2) How does one-way binding and two-way binding work in the context of custom controls and ASP.NET?
Would appreciate any inputs.

A: I believe MSDN is clear enough about this. It may be brief in your eyes, but it's sufficient.
This attribute is used for BINDING. Assigning a string to your variable isn't considered a binding.
This is for instance binding:
myGridView.DataSource = myList;
myGridView.DataBind();

This isn't:
myGridView.ID = "blablabla";

Please, see this link for more info, don't see a reason to duplicate an existing learning source here...
http://msdn.microsoft.com/en-us/library/ms752347.aspx
UPDATE:
For asp.net this link may be more illustrative:
http://www.asp.net/ajaxlibrary/HOW%20TO%20Create%20an%20Editable%20View%20with%20Two-Way%20Data%20Binding.ashx

A: My findings so far:
1) BindableSupport is related to data-binding functionality provided by ASP.NET. E.g. Page.DataBind(), <%# Bind("MyProperty") %>, <%# Eval ("MyProperty") %> and so on.
+1 for @walther's answer.
2) Two-way binding in ASP.NET is the ability to retain modifications to data-bound values on postback. This SO thread provides more details. Bind is two-way, while Eval is one-way.


text:
Q: Can I specify a fallback preference for a "should" query? If I have two documents in an index, with locale values en and pt,
{
  "slug": "my-object",
  "locale": "en",
}

{
  "slug": "my-object",
  "locale": "pt",
}

and I run a query where the result should be in a locale I don't have, fr,
{
  "query": {
    "bool": {
      "must":  [{ "term": { "slug":   "my-object" } }],
      "should":[{ "term": { "locale": "fr" } }]
    }
  },
  "size": 1
}

is there a way make it only fall back to a doc with en locale, not pt or any other?
Basically, I want to say "it should be in French, but I will also accept English."

A: Good news! It looks like recent updates slated for 1.3 release should allow this to work in the general case (more than 1 result, supporting pagination). It isn't in the form of a "should" query, though, it is called the top_hits aggregator:
https://github.com/elasticsearch/elasticsearch/pull/6124
https://github.com/elasticsearch/elasticsearch/issues/6299
If all you need back is one response or a known small response set applying the logic client side is likely the easiest way to get this going with the least amount of effort. So, you do a should "en", "fr" and ignore the en if the fr comes back.
Another option is modeling the data such that you further denormalize things. Therefore, including all variants of the slug within the same document may simplify things. This could add other complications, so YMMV.


text:
Q: how to execute the xml query using xmldataReader in c# from oracle I have xml query as below
cmd1 = new OracleCommand
                  (@"   select  XMLElement(
         ""Person"",XMLAttributes(
                                        'test' as ""TEST""
                                       ),
                    XMLElement(""Body"" ,
                    XMLElement(""SenderID"",'xxx')
                                       ),

                       (select XMLAgg(XMLElement(""Person"" ,
                                       XMLElement(""FirstName"",FirstName),
                                       XMLElement(""ContactNumber"",ContactNumber),
                                       XMLElement(""BirthDate"",BirthDate),
                                       XMLElement(""Gender"",Gender),
                                       XMLElement(""Nationality"",Nationality),
                                       XMLElement(""City"",City)

                                        )  )
                          from member

                          )
                      )

                    AS ""RESULT""
               From dual ",conn);

XmlReader xml_reader = cmd1.ExecuteXmlReader();
This last line throws an error:

Operation is not valid due to the current state of the object.

If I use
OracleDataReader rdr1 = cmd1.ExecuteReader();

I get this error:

ORA-00936: missing expression

but the query is running in toad without any error.
What am I doing wrong?


text:
Q: VBA - trigger macro when radio button is selected I am having trouble running a macro automatically when I select a radio button option. There are two radio-button options, which are linked to the cell named "SimType" on the sheet codenamed "MAIN". I have adapted the following code from MSDN and have included it in the module for the MAIN worksheet but cannot get it to function:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim KeyCells As Range
    Set KeyCells = Range("SimType")
    If Not Application.Intersect(KeyCells, Range(Target.Address)) Is Nothing Then
       RefreshSimsList
    End If
End Sub

I understand Target refers to the ActiveCell so when I manually enter values of 1 or 2 into Range("SimType"), the macro triggers. However, when the cell is altered by the linked radio-buttons, no action is triggered. What can I do to have the sheet recognize that the value has been changed without it being the ActiveCell?

A: Place this code in a module
Sub OptCommon()
    '
    '~~> Rest of the code
    '
End Sub

And simply right click on both the option button and assign macro to it. Now not only the cell value will change but the macro will also run.


text:
Q: How can I dumb down our cutting-edge Text-to-Speech? Back in the old days, text-to-speech, as cutting edge as it was, was very imperfect.  When you typed in a word, it would pretty much read it how you spelled it... in monotone.  Oftentimes, the result would be very funny.  Nowadays, Text-to-Speech is too intelligent to goof in ways that can bring a laugh.
As a personal project, I'd like to make up an application that can bring back this old style of text-to-speech, if only as a toy.  In .Net, I have available to me both System.Speech.dll and the SpeechLib  COM objects. (Microsoft Speech Object Library) Both seem to use the OS's built in Text-to-Speech, which again, is too dang smart.  Are there any ways to configure these to disable whatever it is that makes it intelligent?
I've tried a few different 'SayAs' options, I've tried setting the culture to invariant (exception!), and now I'm looking at SSML.  It's beginning to look like I'll have to find the old technology itself, but I don't even know where to begin there.
As an example of the chaos I'm hoping to see, here's some Moonbase Alpha for you: http://www.youtube.com/watch?v=Hv6RbEOlqRo (Make sure you are wearing headphones!)
Con flab these newfangled text-to-phoneme converters, and normalizers, and cableless phones, and...

A: You probably want what was called the "NRL Algorithm", which was used by the Votrax speech synthesizers in the 1970s and 1980s.  I remember a friend of mine had one of those that we connected (via serial port) to my Osborne I.  We got a lot of laughs out of the way it "said" things.  "Computer" came out "com poo ter", for example.
Or maybe it was a Microvox that my friend had.  That seems to ring a bell.  At the time, all the text to speech boxes used pretty much the same technology.  The linked article is a fountain of information.  About halfway down is a longish section on text to speech conversion.  It describes the rules and the basic algorithm.  I suspect that, with some study and experimentation, you could duplicate the Microvox's speech synthesis.
The NRL Algorithm was implemented by the Unix speak command, the source of which is apparently lost to the great bit bucket of history.  However, M.D. McIlroy wrote a paper about it.   Synthetic English speech by rule (it's a tar file containing scanned pages).
This would be a fun project to play with if I had the time.  Good luck on it.  Let me know if you get anywhere with it.

A: Well, I just managed to stumble across the old "Microsoft Voice Text" library: vtext.dll
This seems to be what I was looking for!  Compared to modern TTS libraries, the interface is very simple.  The result doesn't seem to be exactly the same as the voice in that video I linked, but that was probably a different implementation.  Either way, it's time to reminisce.
var tts = new HTTSLib.TextToSpeech();
tts.Speak("ebrbrbrbrbrbrbrbr");

For some reason it crashes vshost.exe when I make it say "here".  But since this is just a dumb personal project, I can ignore it.


text:
Q: C# - DataGridView ComboBoxCol Displaying Ghost Text of other Cells - Windows Form Application As you can see in the image below the combobox col of the datagridview is displaying ghost images of text from higher rows. If you move the cursor over the text several times it goes away. Scrolling up and down sometimes helps as well. Any thoughts on what is causing this issue? Thanks!

        mainDataGridView.DataSource = bindingSourceDataGridView;

        mainDataGridView.AutoGenerateColumns = false;

        DataGridViewComboBoxColumn ColComboBox = new DataGridViewComboBoxColumn();
        mainDataGridView.Columns.Add(ColComboBox);
        ColComboBox.HeaderText = "Category";
        ColComboBox.ValueType = typeof(string);
        ColComboBox.DisplayStyle = DataGridViewComboBoxDisplayStyle.DropDownButton;
        //ColComboBox.DisplayIndex = 0;
        ColComboBox.Width = 175;
        ColComboBox.DataSource = clSQLServer.getTransactionCategory();
        ColComboBox.DisplayMember = "transactionCategory";
        ColComboBox.ValueMember = "transactionCategoryID";
        ColComboBox.Name = "transactionCategory"; //Category
        ColComboBox.DataPropertyName = "transactionCategoryID"; //CategoryID

        DataGridViewTextBoxColumn textBoxColumn = new DataGridViewTextBoxColumn();
        mainDataGridView.Columns.Add(textBoxColumn);
        textBoxColumn.HeaderText = "Memo";
        textBoxColumn.DataPropertyName = "Memo";

A: Changing the displayStyle from DropDown to ComboBox resolves the issue. I don't like the look as much however it is fully functional this way.
If someone else has a better response please chime in. Thanks!

A: I hooked into the CellPainting event handler.  Not sure why, but each time you paint the cell, the ghosting fades a little more.  3 times seems to do the trick:
private void dataGridView1_CellPainting(object sender,
               DataGridViewCellPaintingEventArgs e)
{
     if(e.RowIndex >= 0 && e.ColumnIndex == col_jobtitle.Index)
     {
         //Due to a Windows 11 ghosting bug in in the
         //  combobox cell, if we repaint it 3 times,
         //  the ghosting goes away...
         e.Paint(e.ClipBounds, e.PaintParts);
         e.Paint(e.ClipBounds, e.PaintParts);
         e.Paint(e.ClipBounds, e.PaintParts);
     }
 }


text:
Q: UNIX Script - setting dynamic variables (indirect variable reference) How to set shell variables from an input file ?
hello,
I need to set dynamic variable from an .ini file in a shell script.
Assume the input file is input.ini :
var1=val1
var2=val2
var3=val3

In a script I want to set var1, var & var3 respectively to their val1, val2 & val3 to get
echo $var1
val1
echo $var2
val2
...

I've tryed :
file="input.ini"
while IFS== read -r f1 f2
do
   eval dynvar=$f1
   dynvar=$f2
done <"$file"

echo $var1
echo $var2
echo $var3

the echo $varx commands give no output. How can I work it out ?
thanks in advance.

A: source input.ini

Or
. input.ini

More info

<source | .> filename [arguments]
    Execute commands from a file in the current shell.

A: Solved
using :
file="install.ini"
while IFS== read -r f v
do
  eval "$f=$v"
done <"$file"

did the trick.


text:
Q: Performance ao desenhar uma imagem Atualmente uso o metodo DrawImage da classe Graphics. Porém, a velocidade de  desenho nos componentes é bem lenta. Como posso otimizar seu uso ?
Bibliotecas como MonoGame ou OpenTK podem oferecer maior desempenho nesse quesito ?
Eis um exemplo de código na sobrecarga do metodo OnPaint.
  if (m_IsThumbnail)
        for (int j = 0; j < 3; j++)
        {
            g.DrawLine(new Pen(Color.DarkGray),
                new Point(dl + 3, dt + dh + 1 + j),
                new Point(dl + dw + 3, dt + dh + 1 + j));
            g.DrawLine(new Pen(Color.DarkGray),
                new Point(dl + dw + 1 + j, dt + 3),
                new Point(dl + dw + 1 + j, dt + dh + 3));
        }

        XImage = dl;
        YImage = dt;

        g.DrawImage(m_Image, dl, dt, dw, dh); // lentidão.


text:
Q: Selecting MAX() on a group doesn't return the corresponding sibling columns I'm using MySQL Tutorial's sample database.
I need to find the sales person with the worst sales (lowest venta_por_empleado) and the best sales (highest venta_por_empleado) per each semestre and city. Using temporary tables I obtain the following result set (tbl_ventas_ciudad_semestre, a temporary table):
| salesRepEmployeeNumber | Nombre_Empleado  | city          | venta_por_empleado | officeCode | orden_year | semestre | periodo |
|------------------------|------------------|---------------|--------------------|------------|------------|----------|---------|
| 1504                   | Barry Jones      | London        | 6719               | 7          | 2019       | 1        | 2019-1  |
| 1286                   | Foon Yue Tseng   | NYC           | 5016               | 3          | 2019       | 1        | 2019-1  |
| 1323                   | George Vanauf    | NYC           | 6372               | 3          | 2019       | 1        | 2019-1  |
| 1702                   | Martin Gerard    | Paris         | 4180               | 4          | 2019       | 1        | 2019-1  |
| 1401                   | Pamela Castillo  | Paris         | 8464               | 4          | 2019       | 1        | 2019-1  |
| 1370                   | Gerard Hernandez | Paris         | 12021              | 4          | 2019       | 1        | 2019-1  |
| 1166                   | Leslie Thompson  | San Francisco | 3587               | 1          | 2019       | 1        | 2019-1  |
| 1165                   | Leslie Jennings  | San Francisco | 11208              | 1          | 2019       | 1        | 2019-1  |
| 1611                   | Andy Fixter      | Sydney        | 5550               | 6          | 2019       | 1        | 2019-1  |
| 1621                   | Mami Nishi       | Tokyo         | 4923               | 5          | 2019       | 1        | 2019-1  |
| 1501                   | Larry Bott       | London        | 7776               | 7          | 2019       | 2        | 2019-2  |
| 1337                   | Loui Bondur      | Paris         | 6186               | 4          | 2019       | 2        | 2019-2  |
| 1188                   | Julie Firrelli   | Boston        | 4227               | 2          | 2020       | 1        | 2020-1  |
| 1612                   | Peter Marsh      | Sydney        | 6036               | 6          | 2020       | 1        | 2020-1  |
| 1216                   | Steve Patterson  | Boston        | 4876               | 2          | 2020       | 2        | 2020-2  |

To find the sales person with the worst sales, I would apply MIN(venta_por_empleado) into the table:
SELECT
    Nombre_Empleado,
    city,
    MIN(venta_por_empleado) as venta_por_empleado,
    orden_year,
    semestre,
    periodo
FROM tbl_ventas_ciudad_semestre
GROUP BY
    city, periodo
ORDER BY
    periodo ASC, venta_por_empleado DESC;

Result:
| Nombre_Empleado | city          | venta_por_empleado | orden_year | semestre | periodo |
|-----------------|---------------|--------------------|------------|----------|---------|
| Barry Jones     | London        | 6719               | 2019       | 1        | 2019-1  |
| Foon Yue Tseng  | NYC           | 5016               | 2019       | 1        | 2019-1  |
| Martin Gerard   | Paris         | 4180               | 2019       | 1        | 2019-1  |
| Leslie Thompson | San Francisco | 3587               | 2019       | 1        | 2019-1  |
| Andy Fixter     | Sydney        | 5550               | 2019       | 1        | 2019-1  |
| Mami Nishi      | Tokyo         | 4923               | 2019       | 1        | 2019-1  |
| Larry Bott      | London        | 7776               | 2019       | 2        | 2019-2  |
| Loui Bondur     | Paris         | 6186               | 2019       | 2        | 2019-2  |
| Julie Firrelli  | Boston        | 4227               | 2020       | 1        | 2020-1  |
| Peter Marsh     | Sydney        | 6036               | 2020       | 1        | 2020-1  |
| Steve Patterson | Boston        | 4876               | 2020       | 2        | 2020-2  |

To find the sales person with the best sales, I would apply MAX(venta_por_empleado) into the table:
SELECT
    Nombre_Empleado,
    city,
    MAX(venta_por_empleado) as venta_por_empleado,
    orden_year,
    semestre,
    periodo
FROM tbl_ventas_ciudad_semestre
GROUP BY
    city, periodo
ORDER BY
    periodo ASC, venta_por_empleado DESC;

| Nombre_Empleado | city          | venta_por_empleado | orden_year | semestre | periodo |
|-----------------|---------------|--------------------|------------|----------|---------|
| Barry Jones     | London        | 6719               | 2019       | 1        | 2019-1  |
| Foon Yue Tseng  | NYC           | 6372               | 2019       | 1        | 2019-1  |
| Martin Gerard   | Paris         | 12021              | 2019       | 1        | 2019-1  |
| Leslie Thompson | San Francisco | 11208              | 2019       | 1        | 2019-1  |
| Andy Fixter     | Sydney        | 5550               | 2019       | 1        | 2019-1  |
| Mami Nishi      | Tokyo         | 4923               | 2019       | 1        | 2019-1  |
| Larry Bott      | London        | 7776               | 2019       | 2        | 2019-2  |
| Loui Bondur     | Paris         | 6186               | 2019       | 2        | 2019-2  |
| Julie Firrelli  | Boston        | 4227               | 2020       | 1        | 2020-1  |
| Peter Marsh     | Sydney        | 6036               | 2020       | 1        | 2020-1  |
| Steve Patterson | Boston        | 4876               | 2020       | 2        | 2020-2  |

Using MIN() and MAX() it returns the right values for sales' numbers but the names of the sales person associated to those sales' number do not match.
How can I obtain the correct name for the right sales' number?

A: Here is a version which might both meet your requirements (more or less) and also work given that tbl_ventas_ciudad_semestre be a temporary table.  We can join your table to a subquery which finds both the minimum and maximum sales figure for each semester and city:
SELECT
    t1.salesRepEmployeeNumber,
    t1.Nombre_Empleado,
    t1.city,
    t1.venta_por_empleado,
    t1.officeCode,
    t1.orden_year,
    t1.semestre,
    t1.periodo
FROM tbl_ventas_ciudad_semestre t1
INNER JOIN
(
    SELECT
        city,
        semestre,
        MIN(venta_por_empleado) AS min_venta_por_empleado,
        MAX(venta_por_empleado) AS max_venta_por_empleado
    FROM tbl_ventas_ciudad_semestre
    GROUP BY
        city,
        semestre
) t2
    ON t1.city = t2.city AND
       t1.semestre = t2.semestre AND
       t1.venta_por_empleado IN (t2.min_venta_por_empleado, t2.max_venta_por_empleado)
ORDER BY
    t1.semestre,
    t1.periodo,
    t1.venta_por_empleado;

A: Given the constraint every table is temporary, I need to create a new temporary table to copy the contents from tbl_ventas_ciudad_semestre as suggested by Tim.
DROP TEMPORARY TABLE IF EXISTS tbl_ventas_ciudad_semestre_2;
CREATE TEMPORARY TABLE tbl_ventas_ciudad_semestre_2
    SELECT * FROM tbl_ventas_ciudad_semestre;

Then It's possible to obtain the correct MIN and MAX of the first table using a subquery
/* MIN or worst sales*/
    SELECT * FROM tbl_ventas_ciudad_semestre a WHERE
    a.venta_por_empleado IN
    (
    SELECT MIN(b.venta_por_empleado) FROM tbl_ventas_ciudad_semestre_2 b
    GROUP BY periodo, city
    );
/* MAX or best sales*/
    SELECT * FROM tbl_ventas_ciudad_semestre a WHERE
    a.venta_por_empleado IN
    (
    SELECT MAX(b.venta_por_empleado) FROM tbl_ventas_ciudad_semestre_2 b
    GROUP BY periodo, city
    )


text:
Q: Visual Studio c++ 2015 runtime deployment with legacy application I have a winforms .net4.5.2 application which depends on a c++\cli wrapper which is included in the VS project by reference. When the winforms application, that is built using Any CPU, is launched a assembly resolver is used to point out the correct platform dll for the reference and Assembly.Load(ed) in the platform specific folders in the root of the application folder i.e. \x64 or \x86.
This c++\cli is now built using the v140 platform toolset which depends on the Universal CRT dll:s. Looking here https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/ I was able to locate the necessary dll:s (41 * 2 of them) and I did what I was told to copy them inside the \x86 and \x64 folders. Now since the change to v140 platform my application does not start anymore and ProcessMonitor file operations tell me the following:
SUCCESS C:\MyApp\x64\TheCLIWrapper.x64.dll
SUCCESS C:\MyApp\x64\ADependency.dll
SUCCESS C:\MyApp\x64\msvcp140.dll
SUCCESS C:\MyApp\x64\vcruntime140.dll
SUCCESS C:\MyApp\x64\api-ms-win-crt-runtime-l1-1-0.dll
NAME NOT FOUND C:\MyApp\ucrtbase.dll

How is this even possible if before assembly resolving my c++\cli wrapper I explicitly set the dll directory (using SetDllDirectory) to the C:\MyApp\x64 folder? By this I mean why is the loading process looking in C:\MyApp for the ucrtbase.dll?
Naturally, if all the 41 dlls of a specific platform are copied to the root C:\MyApp\ folder it works but this is not an option for me, nor is the installation of c++ runtime executable on the clients running the application.
Does anyone have an idea or any tips on how to solve this deployment problem?

A: So you basically wanna do x-xopy deployment with x86-dll's in MyApp\x86, and x64-dll's in MyApp\x64?
How about explicitly loading the dll's with LoadLibrary?

A: I used procmon to inspect where the UCRT DLLs were trying to load each other from. Noticed the paths it was searching did not include the path set from the earlier SetDllDirectory. No matter what I tried the paths it searched seemed to only include the default values.
The working directory was always included as per Dynamic-Link Library Search Order and the only solution I could get was to change the current working directory to the appropriate one, load the DLL with the UCRT requirement, and change it back. Nothing else worked (including changing PATH environment variable)
Note this is very much not threadsafe


text:
Q: Evaluating Integral involving hypergeometric function $\int_0^r (1+z^2)^{-N-k/2}z^{N-1}F(-k/2,-k/2,1- \frac{k+N}{2}; \frac{N}{2};(\frac{z}{r})^2) dz$ As part of my Master thesis, I came across quite horrible integrals involving hypergeometric functions and hope someone here has insight in how to compute them explicitly.
Let $N\geq 2$ and $k\in (-N,0)$ and $F$ the hypergeometric function 2F1: https://functions.wolfram.com/07.23.21.0011.01.
I would like to compute the integrals

$$A( r):=\int_0^r (1+z^2)^{-N-k/2}z^{N-1}F(-k/2,1- \frac{k+N}{2}; \frac{N}{2};(\frac{z}{r})^2) dz$$ and
$$B( r ):=\int_r^{\infty} (1+z^2)^{-N-k/2}z^{N-1+k}F(-k/2,1-\frac{k+N}{2}; \frac{N}{2};(\frac{r}{z})^2) dz$$

The expressions involving $F$ are well-defined because $|\frac{z}{r}|<1$ if $z<r$ and $|\frac{r}{z}|<1$ if $z>r$.
There are plenty of questions about evaluating integrals involving hypergeometric functions, for instance: Integral involving hypergeometric function. But here the arguments in $F$ are a bit more general.
There are many useful formulas involving integrals with hypergeometric functions. Note that F is of the form $F(a,a-b+1/2,b+1/2,.)$. Formula 15.3.17 in https://personal.math.ubc.ca/~cbm/aands/abramowitz_and_stegun.pdf seems useful to simplify the integrand:
$$F(a,b;2b;z)=(\frac12+\frac12\sqrt{1-z})^{-2a}F(a,a-b+1/2;b+1/2;(\frac{1-\sqrt{1-z}}{1+\sqrt{1+z}})^2)$$ but it gives the wrong exponent for $(1+z^2)$.
Background: The question comes from verifying Euler-Lagrange equations/steady states of a Keller-Segel system, the integrals appear in Lemma 6 of the paper https://arxiv.org/abs/1905.07788.
I want to show that the function $\rho_{HLS}(r)=(\frac{1}{1+r^2})^{N+k/2}$ (as (slightly different) defined in equation (6.3) in https://arxiv.org/abs/1612.08225) which maximises the HLS inequality $$\int_{\mathbb{R}^n\times \mathbb{R}^n} \rho(x)\rho(y)|x-y|^k dxdy\leq C_{HLS}||\rho||_m^2$$ solves the Euler-Lagrange equations corresponding to the functional $$\mathcal{F}_2[\rho]_2=C_{HLS}||\rho||_m^2-\int_{\mathbb{R}^n\times \mathbb{R}^n} \rho(x)\rho(y)|x-y|^k dxdy,$$ that is $$2\left(\int \rho^m dx\right)^{\frac{2}{m}-1}\rho(x)^{m-1}-\rho(x)\ast |x|^k=0$$
Using Lemma 6 to rewrite $\rho(x)\ast |x|^k$ in polar coordinates using hypergeometric functions and with $||\rho_{HLS}||_m=(\frac{2^{1-N}\pi{\frac{N+1}{2}}}{\Gamma(\frac{N+1}{2})})^{n+k/2}$ (see Evaluate $\int_{\mathbb{R}^n} \left(\frac{\lambda}{\lambda^2+|x|^2}\right)^N dx$), I want to check that

$$2^{\frac{3N-5}{2}}\pi^{\frac{N-1}{2}}\frac{\Gamma(\frac{N-1}{2})}{\Gamma(N-1)}(r^{k}A( r )+r^{-2n} B( r) )=\frac{2^{\frac{1+2(1-n)(2n+k)}{k}}\pi^{\frac{(n+1)(2n+k)}{k}}} {\Gamma(\frac{N+1}{2})^{\frac{2(2n+k)}{k}}}(\frac{1}{1+r^2})^{-k/2}$$


text:
Q: A problem in PDE . I need help for the solution of this problem :
For $u:\Omega \to R$, $h>0$ and $i\in {1,\ldots,d}$, we define the difference quotient
$D^h_i u(x)= ({u(x+he_i)-u(x))/h}$  on $\Omega_0=\Omega_0(h,i)={x\in\Omega: x+he_i\in \Omega }$. Here $e_i$ denotes the $i^{th}$ standard basis vector .
I want to show the following :
a) For all $i\in {1,\ldots,d}$, $h>0$, and $u \in H^1(\Omega)$, $||D^h_iu||_{L^2(\Omega_0)} \le ||\partial_iu||_{L^2(\Omega)}$.
B) Suppose that for every $V$ compactly contained in $\Omega$ and every $h>0$ such that $D^h_iu$ is defined on $V$, we have $||D^h_iu||_{L^2(V)} \le A$ for some $A \ge 0$,
show that the $i^{th}$ weak partial derivative $\partial_iu$ exists and satisfies $||\partial_i u||_{L^2(\Omega)} \le A $.
I don't even have any idea to start this problem . Any kind of help would be great . Thanks


text:
Q: resample() by PeriodIndex using kind parameter The resample() documentation says that there is a kind parameter that will allow one to resample by a PeriodIndex. Does this mean I can resample based simply on a month?
Example
Let's say I have a Series df:
period
1    1.0
2    2.0
4    4.0
5    5.0
6    6.0

Should I be able to resample using code similar to:
df.resample('M', kind='period').first().fillna(0)

To get:
period
1    1.0
2    2.0
3    0.0
4    4.0
5    5.0
6    6.0

Additional Complexity
If df was:
period
6    6.0

Could I write my resample() code to get:
period
1    0.0
2    0.0
3    0.0
4    0.0
5    0.0
6    6.0

NOTES:

*

*The code I wrote does not work, but I think it's because my assumptions about resample() and PeriodIndex are incorrect.

*All periods are in the same year, so in theory, I can make a datetime, but I'm trying to do this by period if possible.

A: The depicted DataFrame in the question does not appear to have a PeriodIndex.  So it appears that you are hoping to have it convert to a PeriodIndex by .resample(kind=).
You will wind up with AttributeError: 'Int64Index' object has no attribute 'freq' because the resampler is looking for the index type to have frequency which the ordinal index shown in the question does not.
Here is a fully working example outlining how .resample() functions in general, while using a PeriodIndex.
Once your DataFrame has the appropriate index type, you generally shouldn't be worrying about the type.  The framework usually deals with that part.  So below, you can see the resample frequencies are simply passed in.
DataFrame.resample() will not create that which is not there for resampling.  A small trick is to insert an index where you wish resampling to start.
import pandas as pd
import numpy as np
print (pd.__version__)

pidx = pd.period_range(start='2019-01-01', end='2019-06-01', freq='M')

df = pd.DataFrame(index=pidx,data={'period':[1.0,2.0,3.0,4.0,5.0,6.0]})

# knock out 2019-03
df = df.drop(df.index[2])

df = df.resample('M').first().fillna(0)
print(df)

# knock out preceding periods
df = df.drop(df.index[:-1])

df = df.resample('M').first().fillna(0)
print(df)

# preceding period to reconstitute resamples
df.loc[pidx[0]] = np.nan
df = df.resample('M').first().fillna(0)
print(df)


text:
Q: java struts2 hibernate and spring application and soap web services I have a web application using struts2, spring and hibernate frameworks. Now I want to expose some of its methods via soap web service. I have a class and I simply annotated it with @WebService annotation and an Service endpoint interface. Now when I deploy my application on glassfish it deploys fine but when I try to access wsdl via glasssfish admin console. It gives me the following error.
There is no Action mapped for namespace [/] and action name [UsersControllerImplService] associated with context path [/ossoc].

I understand its something related to configuration but I am unable to figure out what configuration.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
       http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
        id="WebApp_ID" version="3.0">

        <display-name>ossoc</display-name>

         <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>

        <filter>
            <filter-name>struts2</filter-name>
            <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
        </filter>

        <filter-mapping>
            <filter-name>struts2</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>

        <welcome-file-list>
            <welcome-file>/index.jsp</welcome-file>
        </welcome-file-list>

    </web-app>

struts2.xml
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
    <constant name="struts.objectFactory" value="spring" />

    <package name="user"  namespace="/" extends="struts-default">
        <interceptors>
            <interceptor name="authentication" class="com.riteshsangwan.ossoc.core.interceptors.AuthenticationInterceptor"></interceptor>
            <interceptor-stack name="authStack">
                <interceptor-ref name="authentication"></interceptor-ref>
                <interceptor-ref name="defaultStack"></interceptor-ref>
            </interceptor-stack>
        </interceptors>

        <default-interceptor-ref name="authStack"></default-interceptor-ref>

         <global-results>
            <result name="login" type="redirect">/index.action</result>
        </global-results>

        <action name="register" class="com.riteshsangwan.ossoc.core.actions.RegisterAction">
          <interceptor-ref name="defaultStack"></interceptor-ref>
          <result name="success">/index.jsp</result>
          <result name="error">/register.jsp</result>
          <result name="input">/register.jsp</result>
        </action>

        <action name="login" class="com.riteshsangwan.ossoc.core.actions.LoginAction">
          <interceptor-ref name="defaultStack"></interceptor-ref>
          <result name="success">/user/home.jsp</result>
          <result name="error">/index.jsp</result>
          <result name="input">/index.jsp</result>
        </action>

        <action name="activate" class="com.riteshsangwan.ossoc.core.actions.ActivateAction">
            <interceptor-ref name="defaultStack"></interceptor-ref>
            <result name="success">/user/home.jsp</result>
            <result name="error">/index.jsp</result>
            <result name="input">/index.jsp</result>
         </action>

        <action name="index">
            <interceptor-ref name="defaultStack"></interceptor-ref>
            <result>/index.jsp</result>
        </action>

        <action name="home">
            <result>/user/home.jsp</result>
        </action>

        <action name="showfiles" class="com.riteshsangwan.ossoc.core.actions.ShowFiles">
            <result name="success">/user/files.jsp</result>
        </action>

        <action name="edit">
            <result>/user/edit.jsp</result>
        </action>

        <action name="logout" class="com.riteshsangwan.ossoc.core.actions.LogoutAction">
            <result name="success">/index.jsp</result>
        </action>

        <action name="changepassword" class="com.riteshsangwan.ossoc.core.actions.ChangePassword">
            <result name="success">/user/edit.jsp</result>
        </action>

        <action name="upload" class="com.riteshsangwan.ossoc.core.actions.UploadFile">
            <result>/user/home.jsp</result>
        </action>

        <action name="showgrid" class="com.riteshsangwan.ossoc.core.actions.ShowFiles">
            <result name="success">/user/files.jsp</result>
        </action>

        <action name="deletefile" class="com.riteshsangwan.ossoc.core.actions.DeleteFile">
            <result name="success">/user/files.jsp</result>
        </action>

        <action name="downloadfile" class="com.riteshsangwan.ossoc.core.actions.DownloadFile">
            <result name="success" type="stream">
                <param name="contentType"></param>
                <param name="inputName"></param>
                <param name="contentDisposition"></param>
                <param name="bufferSize"></param>
                <param name="allowCaching"></param>
                <param name="contentLength"></param>
            </result>
        </action>

    </package>

</struts>

applicationCOntext.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd">

        <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

        <!-- Database Configuration -->

    <import resource="DataSource.xml"/>
    <import resource="HibernateSessionFactory.xml"/>

    <!-- Beans Declaration -->
    <import resource="UsersBean.xml"/>

</beans>

A: Why everyone here is so eager to vote down.
This was the problem.
In web.xml the struts2 filter has /* url pattern mapped so struts2 will filter every request that comes to it including the request to the webservice servlet. Since filters execute before servlets so I was getting the action not mapped error.
From the struts2 documentation.
The action mapping extension has been changed to .action plus "" it means if I simply enter name of servlet in the address bar the struts2 will take it as action and check struts2.xml for relevant action mapping since there are no action mapping so it will throw error.
Solution
I just add the .extension after url in URL pattern mapping so struts2 will treat as a servlet request other option will to use
<constant name="struts.action.excludePattern" value="URLTOEXCLUDE"/>
and configure the webservice to use the excluded URL

Hope this helps others.


text:
Q: M2DOC : s it possible for my service to return specific object and manipulate it I developped my owned M2DOC service and I would like to manipulate it like I manipulate java object in my template.
I have an object "Application" with some attributes, and I would like, in my template, to do something like : App.getName() to print the attribute name of the object Application.
I read that my service must return type like Mtable, MImage...
But Is it possible for my service to return object like Application and manipulate it ?

A: You can do that but you will have to create a service for each getter like that:
public Application getMyApplication(...);

public String getName(Application app) {
  return app.getName();
}

To do this in a generic way you would probably have to implement a JavaMethodService that use the receiver (first argument of service call) as the instance of the invoke. Also you will need a way to register (IQueryEnvironment.registerService()) such services.


text:
Q: Angular ng-transclude scope in repeat I just started to study AngularJS and tries to implement customized table directive with the multiple slots transclude.
And faced situation that scope not transferred to transclude. There is a lot of solutions in other StackOverflow questions, but all of them works only when in directive template ng-repeat appears for top element, but that is not my case.
At least i can't adopt all that solutions.
Simplified version.
Directive:

Some pagination

<input type="text" placeholder="Search"/>

Some filters

Some pagination again

Using of directive:
<my-table>
     <row>
          {{line.col1}}
          {{line.col2}}
      </row>
</my-table>

Full example with the script on Plunkr:
https://plnkr.co/edit/rg43ZdPMGHLBJCTLOoLC
Any advice very appreciated.

A: You need to use $transclude function manually and create new child scope for each line. Other than that you need to pass lines to directive if you are using isolated scope (and you are using it).
Your linking function should look something like this:
link: function($scope, $element, $attrs, controller, $transclude) {
      var tbody = $element.find('tbody');

      $scope.$watch('lines', function (lines) {
        tbody.empty();

        lines.forEach(function (line) {
          var childScope = $scope.$new();
          childScope.line = line;

          $transclude(childScope, function (content) {
            tbody.append('
');
            tbody.append(content);
            tbody.append('
');
          }, null,  'row');
        });
      });
    }

Plunker: https://plnkr.co/edit/MLNZOmoQyMazgIpluMqO?p=preview
But that is bad idea anyway, cos it is hard to create table this way. As you can see child of  is  not  elements. You would have to do a little bit of DOM manipulation to make it work.

A: The simplest and probably cleanest way to directly reference the $scope object created by the ng-repeat in a transcluded template is through the $parent property:
<my-table>
  {{$parent.line.col1}}
  {{$parent.line.col2}}
</my-table>

The $parent property of the $scope created for a transcluded template points to the $scope of the target template into which such template is ultimately transcluded (in this case, the ng-repeat), even though such transcluded $scope is not a child of the target $scope in the usual sense as a result of the transclusion. See this wonderful blog post for a more complete discussion of this.
Working plunkr: https://plnkr.co/edit/LoqIMiQVZKlTt5epDnZF?p=preview.

A: i see you don't really need to use attribute
so code look more simple and clean:

Table test

   <my-table lines="lines"></my-table>

your template:

Some pagination

<input type="text" placeholder="Search"/>

Some filters

               {{line.col1}}
               {{line.col2}}

Some pagination again

and angular directive:
   angular.module('myApp', [])
    .directive("myTable", function() {
      return {
        restrict: 'E',
        transclude: true,
        scope: {
          lines:'=lines',
          api: '@'
        },
        templateUrl: "template.html",
      };
    })
    .controller("tableCtrl", ['$scope', function($scope) {
      $scope.lines = [
        {col1: "testCol1", col2: "testCol2"},
        {col1: "testCol11", col2: "testCol21"}
        ];
    }]);

working example in plunkr: https://plnkr.co/edit/iMxRoD0N3sUXqmViHAQh?p=preview