text:
Q: Degenerate critical points and higher order derivatives (Intuition) The question I'd like to ask is about the relevance of higher order derivatives in determining the behaviour of a function around a critical point in the multivariate case. The question occurs towards the end and I am going to try to be clear about what I get and what I don't get.
Now in a single variable case, we know from Taylor expansion around the critical point that
$$\Delta y=\frac{1}{2}f''(x_{0})(x-x_{0})^2+R$$
where R is the remainder term which goes to zero one degree faster than the quadratic term, thus if $$f''(x_{0})=0$$, the behaviour around the critical point, i.e. the sign of $$\Delta y$$ is determined by the sign of the third derivative, assuming that its non zero and so on.
In two variable case, we know from Taylor expansion around the critical point that
$$\Delta y=\frac{1}{2}f_{xx}(x_{0},y_{0})(x-x_{0})^2+f_{xy}(x_{0},y_{0})(x-x_{0})(y-y_{0})+\frac{1}{2}f_{yy}(x_{0},y_{0})(y-y_{0})^2+R$$
Now if the determinant of the Hessian matrix is  strictly positive, then depending on the sign of $$f_{xx}$$, delta y is always positive or negative so we either have a local minimum or a local maximum. Similarly, if the determinant of the Hessian is strictly negative, then there are some (x,y) where the change is positive, and some (x,y) where the change is negative, so the critical point is a saddle point.
Now what I don't get is, if the determinant is zero, then the polynomial becomes
$$\Delta y=\frac{1}{2}f_{xx}(x_{0},y_{0})((x-x_{0})+\frac{f_{xy}(x_{0},y_{0})}{f_{xx}(x_{0},y_{0})}(y-y_{0}))^2+R$$
(completing the squares) for which the quadratic part is always positive or always negative, assuming that $$f_{xx}(x_{0},y_{0})$$ is non-zero (I don't have any problems with the case when it is zero). So how come the higher-order derivatives are relevant, since always positive or always negative implies local min or local max? The common explanation is that "the derivative is degenerate in one direction so the behaviour in that direction is determined by the higher order terms". I don't get this explanation from the expression above.
Thanks.
Note: I can get the intuition of the examples where partials drop down completely easily, i.e. for the ones where if you expand and take a Taylor expansion around (0,0), all the partials of second and third (or k-1th) order drops, so you are only left with the 4th (or kth) order term, which determines the behaviour of the function around (0,0).
The examples that throw my intuition off are the ones (unfortunately, I can't provide an explicit function), where $$f_{xx}(critical)\neq 0,f_{yy}(critical)\neq 0,f_{xy}(critical)\neq 0 $$, but $$f_{xx}(critical)f_{yy}(critical)-f_{xy}(critical)^2=0$$. In those cases, the second order part of the Taylor expansion drops only partially, not completely. Is that because it loses part of it, it stops dominating the effects of higher order terms?

A: In order to get a feeling of what is possible you should look at polynomial functions $(x,y)\mapsto f(x,y)$ with $f(0,0)=f_x(0,0)=f_y(0,0)=0$. Such functions are their own Taylor expansions to start with, and the character of the citical point $(0,0)$ is immediately visible in the sign of $f(x,y)$ for various $(x,y)$ near $(0,0)$.
The generic case is that $f(x,y)=a x^2 + 2b x y + c y^2 +{\rm higher\ terms}$ with $ac -b^2\ne 0$. In this case you have a local max, a local min or a saddle point at $(0,0)$.
Consider now as an example  the function
$$f(x,y)=(y-x^2)(y+x^2)\ .$$
Its zero set consists of the two parabolas $y=\pm x^2$, and it is easy to see that $f$ takes positive as well as negative values in the immediate neighborhood of $(0,0)$; whence we don't have a local extremum there. If $f$ were given in a more disguised form (and/or would have additional higher terms) you would have to look at the fourth degree Taylor polynomial of $f$ to find this out through analyzing partial derivatives.
This example tells you that in the case of a degenerate critical point heavy algebraic machinery could be needed for a final diagnosis of this point.


text:
Q: Making Movable Windows in Angular 7 I'm trying to create movable windows in Angular 7. To do this, I have an absolutely positioned div that windows will go inside of. I have an app-window-toolbar component and an app-window-container component. When the toolbar is dragged, I want to change the top and left CSS attributes of the app-window-container component. The app-window-toolbar component is a child of the app-window-container component.
app.component.html
<app-window-container *ngFor="let window of windows">
    <app-window-toolbar>
    </app-window-toolbar>

Window content here

</app-window-container>

window-toolbar.component.ts
@Component({
    selector: "app-window-toolbar",
    templateUrl: "./window-toolbar.component.html",
    styleUrls: ["./window-toolbar.component.scss"]
})
export class WindowToolbarComponent implements OnInit {

    moving = false

    constructor(private elRef: ElementRef) { }

    ngOnInit() {
    }

    startMove() {
        this.moving = true
    }

    @HostListener("document:mousemove", ["$event"])
    move(event: MouseEvent) {
        if (this.moving) {
            // Here I'm trying to access the parent element to set it's
            // CSS properties. The mouse y position is being logged
            // successfully, but the parent elements style is not being set.
            console.log("mouse y: " + event.clientY)
            this.elRef.nativeElement.parentElement.style.top = event.clientY
            this.elRef.nativeElement.parentElement.style.left = event.clientX
        }
    }

    @HostListener("document:mouseup")
    stopMove() {
        this.moving = false
    }

}
window-toolbar.component.html

        <ng-content></ng-content>

        close

I'm not sure where I'm going wrong here. I'm also looking for feedback on whether this is the best way of doing this? From what I've read this style of DOM manipulation seems to be frowned upon, but I'm not sure I have much of choice to implement this feature. The only other thing I can think of doing is emitting events when the toolbar is dragged, and have the container listen to those events. Not sure how great the performance would be though.

A: I guess it doesn't work since style.top|left properties should take px values but you're setting numbers.
this.elRef.nativeElement.parentElement.style.top = event.clientY + 'px'
                                                                    /\
                                                               don't forget it

Also, if you don't want your toolbar jumps when starting dragging then you should take into account the shift between your cursor and top left corner of that toolbar.
shift = {
  x: 0,
  y: 0
}

startMove(e) {
   const position = getPosition(e.currentTarget);
   this.shift = {
     x: e.pageX - position.left,
     y: e.pageY - position.top
   }

   this.moving = true
 }

move(event: MouseEvent) {
  if (this.moving) {
    this.elRef.nativeElement.parentElement.style.top = (event.clientY - this.shift.y) + 'px'
    this.elRef.nativeElement.parentElement.style.left = (event.clientX - this.shift.x) + 'px'
  }
}

function getPosition(elem) {
  const box = elem.getBoundingClientRect();
  return {
    top: box.top + pageYOffset,
    left: box.left + pageXOffset
  };
}

Ng-run Example

A: As was pointed out in the comments, there is a module in Angular Material that already solves this. I decided to go with this solution as once you start thinking about the edge cases, it doesn't make sense to roll your own solution.
It was easy to create a draggable window by doing the following:
Register the DragDropModule:
import {DragDropModule} from '@angular/cdk/drag-drop';

@NgModule({
    declarations: [],
    imports: [
          DragDropModule
    ],
    providers: [],
    bootstrap: [AppComponent]
})
export class AppModule { }

Use the directives in your layout:

redpajama_set_name: RedPajamaStackExchange


text:
Q: Curl POST upload file test I have a FastAPI with the following type:
@app.post("/extract_text")
async def create_upload_file(upload_file: UploadFile = File(...)):
    return FileResponse(path="Outputs/ocr_output.zip", filename="{}".format(main.allinall(upload_file))+"_output.zip", media_type='application/zip')

In browser and with the help of UI that I have, I am able to upoad files and download the output file (return...).
I want to test this on a linux service and I have to test this api through a curl command. I am using this command:
 curl -X 'POST' 'http://localhost/extract_text' -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F 'file=@demo2_test_imageinput.png;type=application/json'

and here is the error I receive:
{"detail":[{"loc":["body","upload_file"],"msg":"field required","type":"value_error.missing"}]}

input is a png file avaialble in the current folder and output would be a zipfile as the output of allinall function.
when I try this:
curl -i -X POST -H "Content-Type: multipart/form-data" -F "data=@demo2_test_imageinput.png" http://localhost/extract_text

I receive this error:
HTTP/1.1 422 Unprocessable Entity
Server: nginx/1.15.12
Date: Thu, 19 May 2022 20:16:44 GMT
Content-Type: application/json
Content-Length: 95
Connection: keep-alive

A: This is where you are getting it wrong.
file=@demo2_test_imageinput.png

As per your function def, your multipart field name should be upload_file
async def create_upload_file(upload_file: UploadFile = File(...))
So your curl request must have the parameter
upload_file=@demo2_test_imageinput.png


text:
Q: CSS arrow point to currently selected li element Here's my jsfiddle example:
http://jsfiddle.net/7PqqT/
Update: This is my work around solution: http://jsfiddle.net/7PqqT/1/
However I would like to achieve this same effect without needing the arrow divs to be in each li element.
Now what I'm going to be doing is having jquery addClass('current') to whichever of the 3 li elements the user clicks on, and it I want the arrow to appear below that li element in the center of the text. I'm not sure the best way to do this, I'm hoping there's a simple method to go about doing this.

A: Here you go, I updated your JSFiddle.
Basically, I just deleted the arrow div completely and change the arrow-related CSS to :before and :after pseudoelements. Works like a charm.


text:
Q: How to get a script executed when the user confirms an action? I'm doing a delete of records with the SweetAlert library and I want that when the user clicks the delete button a warning message appears. When I press the delete button the message appears and then the delete is executed, I want to avoid that, I just want it to be executed when the user confirms.
I made this action with Jquery and Ajax::
<script>
$(document).ready(function () {
    $(".btn-eliminar").on("click", function () {
        Swal.fire({
            title: 'Are you sure you want to delete this Chat?',
            text: "You will not be able to recover the data!",
            type: 'warning',
            showCloseButton: true,
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes, delete it!',
            cancelButtonText: 'Cancel'
        }).then(function (isConfirm) {
            if (isConfirm) {
                Swal.fire(
                    'Removed!',
                    'A chat was deleted.',
                    'success'
                ).then(function () {

                        $.ajax({
                                type: "POST",
                                url: '@Url.Action("DeleteChat", "Chat")',
                                data: { id: $(this).parent().siblings(".td-id").text().trim() },
                                success: function (rpta) {

                                },
                                error: function (req, textStatus, errorThrown) {
                                    alert('Ooops, something happened: ' + textStatus + ' ' + errorThrown);
                                }
                           });

                    });
            } else {

            }
            });
    });
});

A: Try this one :
$(document).ready(function() {
    $(".btn-eliminar").on("click", function() {
        Swal.fire({
            title: 'Are you sure you want to delete this Chat?',
            text: "You will not be able to recover the data!",
            type: 'warning',
            showCloseButton: true,
            showCancelButton: true,
            confirmButtonColor: '#3085d6',
            cancelButtonColor: '#d33',
            confirmButtonText: 'Yes, delete it!',
            cancelButtonText: 'Cancel'
        }).then((isConfirm) => {
            if (isConfirm.value) {
                $.ajax({
                    type: "POST",
                    url: '@Url.Action("DeleteChat", "Chat")',
                    data: {
                        id: $(this).parent().siblings(".td-id").text().trim()
                    },
                    success: function(rpta) {

                    },
                    error: function(req, textStatus, errorThrown) {
                        alert('Ooops, something happened: ' + textStatus + ' ' + errorThrown);
                    }
                });

            } else {

            }
        });
    });
});


text:
Q: Using selectors for image view in android I have around 6 images which i am using as tabs in my application.Its just images and they aren't the tabs that android provides.
So my question is that when i click on a image i want replace the image with a another image so that it can let user know that which tab is selected.
What i am did was creating different xml for this  it in my layout.But its tedious to do so since I can't be creating different xml's for every image.
What i am trying to do now is using  for this but not getting the result.
How is it possible to use for this ?

A: Its quite simple.You dont have to make different xml for each image/tab.you just have to make one xml and include this xml in every xml which needs these images..in the xml set only one image as selected and the rest unselected.Suppose for the image1 keep image1 selected and the rest unselected.by clicking image2 will redirect to activity2.In activity2 set image2 selected and the rest unselected and the same for the remaining activities.This way will be the easiest way.Trust me i have implemented this and will help you too.any sort of queries you can ask me.
i have done with 4 images but in your case there will be 6.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">
    <Button
        android:id="@+id/btn1"
        style="@style/toolButton"
        android:background="@drawable/image1"
        android:gravity="center"
        />

    <Button
        android:id="@+id/btn2"
        style="@style/toolButton"
        android:background="@drawable/image2"
        android:gravity="center"
        />

    <Button
        android:id="@+id/btn3"
        style="@style/toolButton"
        android:background="@drawable/image3"
        android:gravity="center"/>

    <Button
        android:id="@+id/btn4"
        style="@style/toolButton"
        android:background="@drawable/image4"
        android:gravity="center"
       />
    </LinearLayout>
</RelativeLayout>

And here is style.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="toolButton">
        <item name="android:layout_width">0dp</item>
        <item name="android:layout_height">45dip</item>
        <item name="android:gravity">center_horizontal</item>
        <item name="android:layout_gravity">center_vertical</item>
        <item name="android:layout_weight">5</item>
        <item name="android:layout_marginBottom">0dip</item>
        <item name="android:layout_marginTop">0dip</item>
    </style>

</resources>


text:
Q: Structuring UIViewControllers with images inside of text I have to create an application that has 5 UIViewControllers, each with big text and images inside the text. What I have done so far was to add a UITextView in the UIViewController and load with an rtf file the whole text (every text is big).
Now I have to add images inside the text in some places. What do you propose that could be the best way to construct it? I tried to add the image inside the the rtf file but it is not working properly. Since the text is too big I did not want to add the text manually by typing it. Also, I have a top bar menu that slides the view to each content, that is why I had to have only one UITextView. I am looking for a best solution.

A: What about adding your texts with images on UIWebView with loading these texts by  wrapping them into html?
You can also add javascript callbacks which you will be able to handle in swift or obj-c by adding JavascriptCore.framework to your build phases:
Add button in your code:
<button text="Close" onclick="javascript:callSwiftCode()">Call swift code</button>

And in your UIWebViewDelegate class:
func webViewDidFinishLoad(webView: UIWebView) {
    let context: JSContext =  webView.valueForKeyPath("documentView.webView.mainFrame.javaScriptContext") as! JSContext

    let codeClosure: @convention(block) ()->() = { ()->() in
        print ("This is callback from javascript you can add your code in this closure")
    }

    let casted: AnyObject = unsafeBitCast(codeClosure, AnyObject.self) as AnyObject
    context.setObject(casted, forKeyedSubscript: "callSwiftCode")
}

A: You can achieve this using NSAttributedString and NSTextAttachment. Attributed strings are strings with formatting attached(bold, italics, colors, etc), but you can also attach the images inside attributed strings, and they just get drawn right along with the text. Below example might help you understand:
//Create a mutable attributed string so that we could append everything to it.
let bigText = NSMutableAttributedString(string: "Your text starts here")

//Create a NSTextAttachment
let image1Attachment = NSTextAttachment()
image1Attachment.image = UIImage(named: "image1.png")

// wrap the attachment in its own attributed string so we can append it
let image1String = NSAttributedString(attachment: image1Attachment)

// add the NSTextAttachment wrapper to our full string, then add some more text.
bigText.appendAttributedString(image1String)
bigText.appendAttributedString(NSAttributedString(string: "End of text"))

// Then set this bigText to your label's attributedText property.
yourLabel.attributedText = bigText


text:
Q: Help to identify Video Amp IC - 4 channel used for Analogue RGB video buffer Way back some 10 yrs ago I used a Chip for RGB video buffer amplifier.it only provided some 3dB gain.  It required no external components , had 4 internal video amplifiers in a 14 pin dil package. I lost all documentation and cannot remember the number or brand. Not sure if it was ANxxxx or uPCxxxx or anything else. Can anyone help please?

A: Maybe it was similar to this Maxim chip (that is also capable of some input routing): -

Maxim have a few offerings so if this isn't the part maybe you should pop along to their website for further investigation? Maybe this 14 pin video buffer amplifier (note the standard pin-out as per many op-amp devices - does this ring any bells?): -

There is also the MAX4395 - maybe try this list of potential parts.

A: I Managed to find it, It was the TEA5116.


text:
Q: What is Cat & Mouse? On your phone, if you to Extras and click on Stats, there's a large amount of information about your various statistics about your game.
On page 10 of 11 at the top of the page, there are two statistics that read as follows:
Cat & Mouse: Most Points Earned: 0
Cat & Mouse: Cash Earned: $0.00
I've finished the main campaign, and I'm currently working my way through the diversions. I've not heard any mention of "Cat & Mouse" at all. I know it's not a diversion.
What is this? Is it something that is co-op only (I've only played single player)?

A: Cat and Mouse is indeed a co-op side mission.  In Saints Row 2, you entered it by killing your co-op partner - the killed partner was then presented with a menu whereby they could choose one of two games to play in retaliation.  Saints Row 3 does something similar.
Cat and Mouse is where one player has a car, and is trying to hit checkpoints similar to a checkpoint race.  The other player has an attack helicopter and has to stop the other player from hitting the checkpoints.  After a set period of time, they switch.  Whoever hit more check points when both timers expire is the winner.


text:
Q: Mock service injected into Angular module run block In my module.run block it is calling a method on a service I have made. When running my tests I want it to reference a mock service instead of the real one which is making http requests. I am currently trying to test a controller, not the actual run block itself - how can I inject the mock service into the run function? I have tried using $provide.factory but it doesn't seem to do anything and is still loading the service as normal.
I am using Jasmine to write my tests.
app.js
angular.module("app")
    .run(function(MyService) {
        MyService.log("starting app");
    });

test.js
describe("MyController", function() {

    beforeEach(function() {
        module(function ($provide) {
            $provide.factory("MyService", { log: function(){} });
        });
    });

    // I want module 'app' to execute its run function using injected value for MyService
    beforeEach(module("app"));

    beforeEach(inject(function($controller, $rootScope) {
        MyController = $controller("MyController", { $scope: $rootScope.$new() });
    }));

    ...........

});

A: In this case is important order.
You need load your app first
beforeEach(module("app"));

and then overwrite MyService definition.
beforeEach(
  module({
    "MyService": {
      log: function(message) {
        console.log("MyFakeService called: " + message);
      }
    }
  })
);

Otherwise app service implementation is last registred and used.
working example is here - look to the console http://plnkr.co/edit/BYQpbY?p=preview


text:
Q: Distributed training example for Temporal Fusion Transformer in SageMaker We're training a big Temporal Fusion Transformer using PyTorch.
We're looking into using Distributed Training and accelerate training jobs with SageMaker.
Does anyone have any examples of this? Any pattern you can recommend?

A: Although there is no direct example for the above mentioned model, you should be able to follow the below documentation for PL
https://docs.aws.amazon.com/sagemaker/latest/dg/data-parallel-modify-sdp-pt-lightning.html
Refer below example for a full example of using SageMaker DDP and Pytorch Lightning.
https://github.com/aws-samples/sagemaker-distributed-training-workshop/blob/main/1_data_parallel/PyTorch%20Lightning%20on%20SageMaker.ipynb


text:
Q: Error "The type or namespace name 'xxx' does not exist in the namespace 'Microsoft.Toolkit.Uwp.UI.Controls'" I have finally updated Microsoft.Toolkit from 7.0 to 7.1. The debug version of an app works fine. When I build the app's package with .Net Native, I get the following errors:
2>  E:\...\My App\obj\x64\Release\XamlTypeInfo.g.cs(701,78,701,82): error CS0234: The type or namespace name 'Core' does not exist in the namespace 'Microsoft.Toolkit.Uwp.UI.Controls' (are you missing an assembly reference?)
2>  E:\...\My App\obj\x64\Release\XamlTypeInfo.g.cs(705,78,705,83): error CS0234: The type or namespace name 'Input' does not exist in the namespace 'Microsoft.Toolkit.Uwp.UI.Controls' (are you missing an assembly reference?)
2>  E:\...\My App\obj\x64\Release\XamlTypeInfo.g.cs(711,78,711,83): error CS0234: The type or namespace name 'Media' does not exist in the namespace 'Microsoft.Toolkit.Uwp.UI.Controls' (are you missing an assembly reference?)

Could anyone shed some light on the possible cause of these errors?  Everything worked fine before the update.


text:
Q: Open array of class element I have a class that inside defines another class as array like this:
class1 = class
private
    fTag : string
    .
    .
published
    property Tag : read fTag write fTag;
end;

arrayOfClass1 = array of class1;

class2 =class
private
    FTvalue1 : string;
    FTaggedValues: arrayOfClass1;
    procedure SetTaggedValues (.....);
        do something;

published
    property value1 : read FTvalue1 write FTValue1;
    property  TaggedValues : arrayOfClass1 Index read FTaggedValues write SetTaggedValues;

end;

My problem is that I can't find a way to add an element to property TaggedValues.
So I am here to ask which is the proper way to initialize, redim and create element?

Thanks for reply mr. Guillot
Probably I omitted too much info about my problem so I'll try to explain myself  a little better.
The class involved are coming from a WSDL and they inherit each from other in this way:
StdOrderDto2 = class(TRemotable)
PrtOrderDto2 = class(StdOrderDto2)
PrtOrderColorDecksDto2 = class(PrtOrderDto2)

this is the snipped code of interested class:
  StdOrderDto2 = class(TRemotable)
  private
    .
    .
    FTaggedValues: ArrayOfStdTagValueDto;
    procedure SetTaggedValues(Index: Integer; const AArrayOfStdTagValueDto: ArrayOfStdTagValueDto);
    .
    .
  public
    destructor Destroy; override;
  published
    .
    property TaggedValues:        ArrayOfStdTagValueDto  Index (IS_OPTN or IS_NLBL) read FTaggedValues write SetTaggedValues stored TaggedValues_Specified;
    .
  end;

where:
  ArrayOfStdTagValueDto = array of StdTagValueDto2;

and:
  StdTagValueDto2 = class(TRemotable)
  private
  .
  .
  (simple datatype are involved)
  published
  .
  (etc)
  .
  end;

So my first question:
Can I use this class (PrtOrderColorDecksDto2) for make a call to server also if the class in not a direct descendant of a TRemotable class?
I guess yes because the ancestor (StdOrderDto2) is a TRemotable... But I am not sure about this..
Second question:
For "populate" TaggedValues I use this snippet:
var temp : PrtOrderColorDecksDto2;
.
.
.
begin
    temp := PrtOrderColorDecksDto2.create;
        temp.someproperty1 := 5;
        temp.someproperty2 := 'Five';
        ....etc.....
    setlength(temp.TaggedValues, 3);  --->>> I got in compiler error "[dcc32 Error] Unit1.pas(38): E2197 Constant object cannot be passed as var parameter"
        temp.TaggedValues[0] := StdTagValueDto2.create;

        temp.TaggedValues[0].someproperty1 := 5;
    ...etc etc....

end;

So my question is: Why do I get an E2197 compiler error?
And once someone can explain me what I made wrong, can provide me a way to solve this?

A: As ViRuSTriNiTy said, a TList< Class1 >  instead of an Array will manage them for you.
But if you still prefer to use an array, just add a AddTag method in Class2 to add a new TagValue, and a Destroy method to free all its tags when freeing your object. No initialization is needed.
class2 = class
private
  ...
  FTaggedValues = array of class1;
published
  ..
  procedure AddTagValue(TagValue: class1);
  destructor Destroy; override;
end;

implementation

procedure class2.AddTagValue(TagValue: class1);
begin
  SetLength(FTaggedValues, Length(FTaggedValues) + 1);
  FTaggedValues[Length(FTaggedValues) - 1] := TagValue;
end;

destructor class2.Destroy;
var TagValue: class1;
begin
  for TagValue in FTaggedValues do TagValue.Free;
  inherited Destroy;
end;


text:
Q: Google Maps iOS SDK and UIGestureRecognizer I'm using Google Maps SDK in an iOS project.
I added UIView in GMSMapView. I want to handle a swipe on UIView and add to UIView UIGestureRecognizer, but the handler's not working when I do UIView on GMSMapView. I know what GMSMapView lock a UIGestureRecognizers. I use consumesGesturesinView=NO, but it didn't help.
How I can unlock UIGestureRecognizer in a GMSMapView subview? Thanks!


text:
Q: How did Christine Palmer protect Doctor Strange? In Doctor Strange in the Multiverse of Madness, Doctor Strange uses the dreamwalking technique in a surprising way and consequently comes under attack from the spirits of the damned.
Christine Palmer is present and protects Doctor Strange. She battles the spirits quite effectively using an artefact. What is the artefact and how did Christine Palmer know how to use it so well?

A: Christine Palmer is something like the head scientist of the Illuminati and has worked closely with Dr. Strange of her universe, therefore it's very likely that she has profound knowledge about many magical artifacts. Also, the bowl was presented prominently in a glass cabinet, which indicates that it's one of the more popular artifacts.
Besides that, the room was stuffed with artifacts, so that she would just have picked another one, if she wasn't familiar with this artifact.

A: The item Earth-838 Christine used against the Souls of the Damned was named by her as the Brazier of Bom'Galiath.
From the Marvel Cinematic Universe Wiki:

The Brazier of Bom'Galiath is a relic in possession of the Masters of the Mystic Arts.

We have relatively little info on Earth-838 Christine's history, so there's no direct explanation as to why she knew how to use the Brazier. She clearly recognised it though, indicating that she had some knowledge of it, and she'd already been shown to be familiar with the Earth-838 version of the Sands of Nisanti; sufficiently familiar to incorporate them into the special handcuffs used to bind Dr. Strange.

EARTH-838 CHRISTINE: I developed those using the Sands of Nisanti... one of 838-Stephen's magical relics.
Doctor Strange in the Multiverse of Madness (2022)

It's possible that she was introduced to these artefacts through her relationship with Earth-838 Strange, but it seems more likely that she took it upon herself to study them after it was determined that he and his variants posed a threat to realities. As she was working for the Illuminati, Earth-838 Mordo would likely have granted her access to, and intel on, anything she requested, within reason.

The Earth-199999 version of the item made a brief appearance in Doctor Strange (2016), during Strange's first fight with Kaecilius, about halfway through the film.

A version of the item also exists in the comics. It made its first appearance in Mighty Thor Vol. 1 #443, where it was used by Strange as part of a spell which enabled Eric Masterson to temporarily trespass within Mephisto's realm, for as long as the flames continued to burn.  The instant the flames died out, Masterson was pulled back to Strange's Sanctum Sanctorum.

DR. STRANGE: One last caution, Masterson--! A spell of this magnitude carries a heavy toll, and I can only maintain it so long as the Brazier of Bom'Galiath continues to burn!

Mighty Thor Vol. 1 #443 (January, 1992)


text:
Q: User input into file path Sorry for such a beginner question but I am trying to create a script that users can use to get filenames from my sftp server.  The directories are basically /files/year/month/day so an example would be files/2017/1/23.
I am trying to take user input to print out the filenames for the particular directory they want.  I think my issue has to do with incorporating the '/' into the path with the input.  But this is my first project and I could be completely off.  Thanks for any input here.
import pysftp as sftp

year = int(input("Enter year of event:  "))
month = int(input("Enter month of event:  "))
day = int(input ("Enter day of event:  "))

srv = sftp.Connection(host="hostname", username="user",
password="pass")

srv.chdir("recordings/'year'/'month'/'day'")

for filename in sorted(srv.listdir()):
    if filename.startswith('web') and filename.endswith('.mp4'):
        print (filename)

srv.close()

A: change srv.chdir("recordings/'year'/'month'/'day'") line to below
srv.chdir("recordings/%s/%s/%s"%(year,month,day))

Hope this helps !


text:
Q: BiometricPrompt class not available in Xamarin Android I've switched to the Xamarin SDK beta channel, and they say they have Android 9.0 support there, however after switching / downloading / installing the latest SDK's and targeting Android 9.0 in my Android project, I still am not seeing the BiometricPrompt class available for consumption. I need to leverage this for facial recognition on login in my app, and to replace the FingerprintManager class (at least for Android 9 devices.)

What am I missing?

A: Your compile target must be set to Android 9.0 (Pie) to gain access to the API Level 28 SDK:

Then the runtime target needs to be set to Android 9.0 API level 28 (or "auto" which would be the compile target of 28). From there you can do your API level checks at runtime to determine which APIs to call.


text:
Q: gcc compiler ignores uninitialized variable warning for debug build gcc compiler ignores uninitialized variable warning for debug build. This looks very weird for me, can some one help me to understand this ?
## Program
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    int i, max;
    int count;
    if (argc < 2) {
        return -1;
    }
    max = atoi(argv[1]);
    for (i = 0; i < max; i++) {
        count++;
    }
    printf("count is %d\n", count);
    return 0;
}

gcc a.c -g -Wall -Werror
No warning
gcc a.c -O3 -Wall -Werror
a.c: In function 'main':
a.c:8:9: error: 'count' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     int count;
         ^~~~~
cc1: all warnings being treated as errors

gcc version: 7.4.0

A: Though it may look weird, this behavior is documented for -Wmaybe-uninitialized gcc option:

-Wmaybe-uninitialized
For an automatic (i.e. local) variable, if there exists a path from the function entry to a use of the variable that is initialized, but there exist some other paths for which the variable is not initialized, the compiler emits a warning if it cannot prove the uninitialized paths are not executed at run time.
These warnings are only possible in optimizing compilation, because otherwise GCC does not keep track of the state of variables.

I guess the reason is that the cost of analyzing not initialized variables is too much for not optimizing compilation. That's why it is done only for optimizing one.


text:
Q: React Native Touchable Highlight When I press on an <TouchableHighlight />, with an <Image/> component inside, a white square appears even though I have set underlayColor prop's opacity value to 0.
What is causing this and how can I fix it?
<TouchableHighlight underlayColor="rgba(255,255,255,0)" onPress={() => this.props.navigation.goBack()} style={{width: 50, height: 50, position: "absolute", top:15, left: 15, elevation: 10, zIndex: 10}}>
    <Image
        style={{ width: 50, height: 50,}}
          source={backArrow}
    />
</TouchableHighlight>

A: Perhaps you could take a different approach, by using TouchableOpacity with  activeOpacity set to 0 like so:
<TouchableOpacity activeOpacity={0} onPress={() => this.props.navigation.goBack()} style={{ width: 50, height: 50, position: "absolute", top:15, left: 15, elevation: 10, zIndex: 10}}>
    <Image style={{ width: 50, height: 50 }} source={backArrow} />
</TouchableOpacity>

If I understand your requirements correctly, then you should find this use of the activeOpacity prop achieves what you want. For more information on activeOpacity, see this documentation


text:
Q: Error building pkg-config-0.28 on OS X 10.8 I'm new to Mac and trying to build pkg-config-0.28 on OS X 10.8. I was able to configure successfully using:
./configure CC="gcc -arch i386 -arch x86_64" CXX="g++ -arch i386 -arch x86_64" CPP="gcc -E" CXXCPP="g++ -E" --with-internal-glib

I tried the "--with-internal-glib" after getting an error saying glib not found.
But now I'm getting the following error when I entered:
$ make -j8

Error message:
> CC       gvarianttype.lo
  CC       gversion.lo
  CC       gwakeup.lo
  CC       gprintf.lo
  CC       glib-unix.lo
  CC       gthread-posix.lo
  CC       giounix.lo
gutils.c: In function 'find_folder':
gutils.c:1423: warning: 'FSFindFolder' is deprecated (declared at /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h:290)
  CC       gspawn.lo
echo   > glib-public-headers.txt.tmp && mv glib-public-headers.txt.tmp glib-public-headers.txt
lipo: can't figure out the architecture type of: /var/folders/wn/zc31626x5mz7w57dq6cf8f7w0000gn/T//cczwFoWN.out
make[6]: *** [gvariant.lo] Error
make[6]: *** Waiting for unfinished jobs....
make[5]: *** [all-recursive] Error 1
make[4]: *** [all] Error 2
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Before that, I installed pkg-config-0.26 from a .pkg file but the problem is, it shows install successful but when I enter "pkg-config" in the terminal it says command not found. For this reason I thought of building from the latest release.
I really need this for building/compiling an opencv project. Now how I can get pkg-config to work? Please help.


text:
Q: Rank customer Transactions per segments in SQL Server I have below table which has customer's transaction details.

Tranactaction date
CustomerID

1/27/2022
1

1/29/2022
1

2/27/2022
1

3/27/2022
1

3/29/2022
1

3/31/2022
1

4/2/2022
1

4/4/2022
1

4/6/2022
1

In this table consecutive transactions occurred in every two days considered as a segment.
For example, Transactions between Jan 27th and Jan 29th considered as segment 1  & Transactions between Mar 29th and Apr 6th considered as Segment 2.  I need to rank the transactions per segment with date order. If a transaction not fall under any segment by default the rank is 1.  Expected output is below.

Segment Rank
Tranactaction date
CustomerID

1
1/27/2022
1

2
1/29/2022
1

1
2/27/2022
1

1
3/27/2022
1

2
3/29/2022
1

3
3/31/2022
1

4
4/2/2022
1

5
4/4/2022
1

6
4/6/2022
1

Can somebody guide how to achieve this in T-sql?

A: Using lag() to check for change in TransDate that is within 2 days and groups together (as a segment). After that use row_number() to generate the required sequence
with
cte as
(
    select *,
           g = case when datediff(day,
                                  lag(t.TransDate) over (order by t.TransDate),
                                  t.TransDate
                                  ) <= 2
                    then 0
                    else 1
                    end
    from   tbl t
),
cte2 as
(
    select *, grp = sum(g) over (order by TransDate)
    from cte
)
select *, row_number() over (partition by grp order by TransDate)
from   cte2

db<>fiddle demo


text:
Q: Ajax Array Display Control - Pagination I have an area which gets populated with about 100 records from a php mysql query.
Need to add ajax pagination meaning to load 10 records first, then on user click to let's say "+" character it populates the next 20.
So the area instead of displaying all at once will display 20, then on click, then next 20, the next... and so on with no refresh.
Should I dump the 100 records on a session variable?
Should I call Myqsl query every time user clicks on next page trigger?
Unsure what will be the best aproach...or way to go around this.
My concern is the database will be growing from 100 to 10,000.
Any help direction is greatly apreciated.

A: your ajax call should call a page which only pulls the exact amount of rows it needs from the database.  so select the top 20 rows from the query on the first page and so on.  your ajax call can take a parameter called pagenum and depending on that is what records you actually pull from the database.  no need for session variables.

A: If you have a large record set that will be viewed often (but not often updated), look at APC to cache the data and share it among sessions.  You can also create a static file that is rewritten when the data changes.
If the data needs to be sorted/manipulated on the page, you will want to limit the number of records loaded to keep the JavaScript from running too long.  ExtJS has some nice widgets that do this, just provide it with JSON data (use PHP's encode method on your record set).  We made one talk to Oracle and do the 20-record paging fairly easily.
If your large record set is frequently updated, and the data must be "real time" accurate, you have some significant challenges ahead.  I would look at comet, ape, or web workers for polling/push solution and build your API to only deal in updates to the "core" data--again, probably cached on the server rather than pulled from the DB every time.


text:
Q: Is it possible to change the connection time out setting for IIS in Azure App Services I have an asp.net application hosted on a VM with IIS. Now I would like host the same application in Azure App Services. We had IIS settings modified like Connection Time-out.
How do set Connection Time-out value for Azure App Services

A: If you want to edit the connectionTimeout setting under system.applicationHost, you could modify the applicationhost.config file. You could create it manually or use IISManager to create the file and modify it.
Here is the sample:
<system.applicationHost>
   <sites>
      <siteDefaults>
         <logFile logFormat="W3C"
            directory="%SystemDrive%\inetpub\logs\LogFiles"
            enabled="true" />
         <traceFailedRequestsLogging enabled="true"
            directory="%SystemDrive%\inetpub\logs\FailedReqLogFiles"
            maxLogFiles="20" />
         <limits connectionTimeout="00:01:00" />
         <ftpServer serverAutoStart="true" />
         <bindings>
            <binding protocol="http" bindingInformation="127.0.0.1:8080:" />
         </bindings>
      </siteDefaults>
   </sites>
</system.applicationHost>


text:
Q: Is PHP Zip creation (overwrite) an atomic operation? Our application overwrites an already existing ZIP file.
The zip file is downloadable, for ZIP creation we use PHP ZipArchive.
Now the question:
Do I have to create a TMP ZIP file and rename it to the desired downloadable filename to have an atomic operation and all time access to a valid ZIP file, or is the ZIP creation process of ZipArchive already atomic?
Edit:
After testing it with multiple addFile calls, separated with a sleep, it seems like that the file is created / overwritten on the final close call. But the question remains, is the final ZIP file creation atomic?

A: After testing it with a huge directory structure (the zip creation needed ~ 10seconds), and a "watch -n 0.1 unzip -t foo.zip" on the resulting ZIP file, it seems like that the ZIP file creation is atomic.
At least I got no errors while testing the ZIP file.


text:
Q: Push aggregated metrics to the Prometheus Pushgateway from clustered Node JS I've ran my node apps in a cluster with Prometheus client implemented. And I've mutated the metrics (for testing purpose) so I've got these result:
# HELP otp_generator_generate_failures A counter counts the number of generate OTP fails.
# TYPE otp_generator_generate_failures counter
otp_generator_generate_failures{priority="high"} 794

# HELP otp_generator_verify_failures A counter counts the number of verify OTP fails.
# TYPE otp_generator_verify_failures counter
otp_generator_verify_failures{priority="high"} 802

# HELP smsblast_failures A counter counts the number of SMS delivery fails.
# TYPE smsblast_failures counter
smsblast_failures{priority="high"} 831

# HELP send_success_calls A counter counts the number of send API success calls.
# TYPE send_success_calls counter
send_success_calls{priority="low"} 847

# HELP send_failure_calls A counter counts the number of send API failure calls.
# TYPE send_failure_calls counter
send_failure_calls{priority="high"} 884

# HELP verify_success_calls A counter counts the number of verify API success calls.
# TYPE verify_success_calls counter
verify_success_calls{priority="low"} 839

# HELP verify_failure_calls A counter counts the number of verify API failure calls.
# TYPE verify_failure_calls counter
verify_failure_calls{priority="high"} 840

FYI: I have adopted the given example from: https://github.com/siimon/prom-client/blob/master/example/cluster.js
Then, I pushed the metrics and everything work fine at the process. But, when I checked the gateway portal, it gives different result from those metrics above.
The one that becomes my opinion is the pushed metrics came from single instance instead of aggregated metrics from few instances running. Isn't it?
So, has anyone ever solved this problem?
Oh, this is my push code:
const { Pushgateway, register } = require('prom-client')
const promPg = new Pushgateway(
  config.get('prometheus.pushgateway'),
  {
    timeout: 5000
  },
  register
)

promPg.push({ jobName: 'sms-otp-middleware' }, (err, resp, body) => {
  console.log(`Error: ${err}`)
  console.log(`Body: ${body}`)
  console.log(`Response status: ${resp.statusCode}`)
  res.status(200).send('metrics_pushed')
})


text:
Q: What be the default connection char-set used in MySQL if not given by client The current variables of MySQL 5.5 is
 show variables like "%char%";
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

If a client connect to this DB, without specifying charset using such as SET NAMES LATIN1, what charset it would use?

A: character_set_database  this will be the default assuming you didn't mention character set while creating the original database.

*

*http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_character-set-server
Update from Comment conversation:
The connection charset for the client will use value of character_set_client.
In this specific case utf8.
Ofcourse this affects only how the client handles strings.


text:
Q: Spanish characters and URISyntaxException I am working on a Spanish version of search  and when ever the user types in the Spanish characters(say HÍBRIDOS)   I see some exception(shown below). Showing how i coded below.
the url is sent is over the wire is as shown.
url=http://wwwdev.searchbridg.com/absd/JSONControllerServlet.do?&N=0&Ntk=AllText&Ntt=HÃBRIDOS&Nty=1&Ntx=mode+matchall
  DefaultHttpClient httpClient = new DefaultHttpClient();
    HttpParams params = httpClient.getParams();
    try {
        HttpConnectionParams.setConnectionTimeout(params, 10000);
        HttpConnectionParams.setSoTimeout(params, 10000);
    } catch (Exception e) {
        e.printStackTrace();
        throw e;
    }
    HttpHost proxy = new HttpHost(getProxy(), getProxyPort());
    ConnRouteParams.setDefaultProxy(params, proxy);
    URI uri;
    InputStream data = null;
        uri = new URI(url);
        HttpGet method = new HttpGet(uri);
        HttpResponse response=null;
        try {
        response = httpClient.execute(method);
        }catch(Exception e) {
            e.printStackTrace();
            throw e;
        }
        data = response.getEntity().getContent();
    Reader r = new InputStreamReader(data);
    HashMap<String, Object> jsonObj = (HashMap<String, Object>) GenericJSONUtil.fromJson(r);

java.net.URISyntaxException: Illegal character in query at index 101: http://wwwdev.searchbridge.com/abs/JSONControllerServlet.do?&N=0&Ntk=AllText&Ntt=H├?BRIDOS&Nty=1&Ntx=mode+matchall
    at java.net.URI$Parser.fail(URI.java:2816)
    at java.net.URI$Parser.checkChars(URI.java:2989)
    at java.net.URI$Parser.parseHierarchical(URI.java:3079)
    at java.net.URI$Parser.parse(URI.java:3021)
    at java.net.URI.<init>(URI.java:578)

I tried encoding using UTF-8 encoding and  still not working shows same exception. The html pages is set to <meta charset="utf-8" />
byte[] bytes = url.getBytes("UTF8");
    String stringuRL = new String(bytes,"UTF-8");
        uri = new URI(stringuRL);

A: If you're sending special chars on request (GET request), you must URLescape them. Look at this thread to find out how. HTTP URL Address Encoding in Java
When you receive the request, you must do the reverse process to get the original word.

A: All parameters in a get request needs to have its value encoded.
If you are using HTTPClient 4 you can do this more or less like this:
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add(new BasicNameValuePair("parameter_name_Ã", "another value with ~ãé"));
parameters.add(new BasicNameValuePair("second_parameter", "still other ú û"));
String url = "http://foo.bar/?" + URLEncodedUtils.format(parameters, "UTF-8");

The result on this case will be http://foo.bar/?parameter_name_%C3%83=another+value+with+%7E%C3%A3%C3%A9&second_parameter=still+other+%C3%BA+%C3%BB


text:
Q: Custom autocomplete search I want to implement a custom search.
My code:
$(document).ready(function() {
$('#w-input-search').autocomplete({
    minLength: 1,
    delay: 500,
    source: function (request, response) {
        $.getJSON("/demo/account/getUsers", request, function(result) {
            response($.map(result, function(item) {
                return {
                    label: "<img src='" + item.photoUrl + "'/>"+item.firstName ,
                    value: item.firstName,
                    tag_url: "http://" + window.location.host +"/tags/" + item.tagId + "/" + item.name
                }
            }));
        });
    },

});

This is displaying:

How can I make that list to display images and not the text? ""
I must sayI'm a jquery beginner.


text:
Q: Recover data from HDD Out of the blue, when I plugged in one of my external drives, I could only see a part of the contents in File Explorer; after trying to open the volume again a few times, I rebooted and was greeted by the volume not being recognized anymore (trying to open it would trigger an error saying the volume was corrupted and unreadable).
Upon opening disk management, I found to my dismay that the partition was detected as RAW instead of NTFS.
I then attempted a chkdsk /f on the affected volume: the program reported finding a number of issues and reported fixing the volume's Master File Table; this did give me back an accessible NTFS volume, but with most of the contents missing.
I am now running a second chkdsk (/r instead of /f this time).
Do I have a chance of getting my data back?
Also, how could this possibly happen? I have always unmounted the volume before unplugging, the disk had been working fine the last time I used it and had been disconnected from power or data cables since then.

A: If you have a serious problem it is preferable to not chkdsk the drive. When you thought it might have been pulled wrong, it would be natural to chkdsk it, but once things start going badly, you should stop and image the drive first.
You would avoid writing to the drive in any way. When chkdsk does not know what is going on it can make corrections that make it worse.
It sounds most like the internal drive itself has failed (or is failing). Many external boxes the drive can be extracted and connected "different" like direct to a sata port.
It Is also possible with both USB powered externals and seperate powered externals that you have a power problem.
If that happened to me I would first Leave it alone for a day, make sure it is in a Dry location.  I would then try and test the power any way that I could.  I might attempt again after that day to test it, and see if it was totally dead or not.  I would extract it form the case if I could,  test again the power if possible. Then try  and connect it up internally to a computer, or externally using a different controller and power supply.
How could it happen?
it could happen a bunch of ways, it could have been smacked around, it could have got moisture in it. Moving a disk from a hot humid location to a cold location it could build up tiny bits of moisture on the platters.  The power supply could be failing, a Surge of power could have occured.  Any number of things.
There are "pro" $$$ ways to get data back as long as the platters have data on them.


text:
Q: silverlight wrappanel does not wrap I have a itemscontrol with a scrollviewer inside of that I have a wrappanel
the thing will not wrap unless I set a width to it.  Do I not understand how to use this control?  Can I use it without a width?  I want it to use stretch auto.

A: The wrap panel must aquire from somewhere how wide its allowed to be.  It sounds like you want it to be limited to the available space in the container.  In that case the container must of a type that will limit the width.  For example the following works fine:-
<UserControl x:Class="SilverlightApplication1.WrapPanelStuff"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:toolkitControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit">
  <Grid x:Name="LayoutRoot" Background="White">
        <ScrollViewer>
            <toolkitControls:WrapPanel>
                <Border BorderBrush="Black" BorderThickness="2">
                    <TextBlock Text="This should be quite long so that it takes up some horizontal space" />
                </Border>
                <Border BorderBrush="Black" BorderThickness="2">
                    <TextBlock Text="This should be quite long so that it takes up some horizontal space" />
                </Border>
                <Border BorderBrush="Black" BorderThickness="2">
                    <TextBlock Text="This should be quite long so that it takes up some horizontal space" />
                </Border>
            </toolkitControls:WrapPanel>
        </ScrollViewer>
    </Grid>
</UserControl>

The Grid limits the WrapPanel to the available width.  Replace Grid with Canvas and it no longer works because Canvas does not limit the width of its content.

A: The WrapPanel logic is going to continue placing children along the same row until it is constrained in some way. Probably the easiest way to do that without specifying a width would be to disable the horizontal scroll bar of the ScrollViewer.
    <ScrollViewer HorizontalScrollBarVisibility="Disabled">
         <toolkitControls:WrapPanel />
    </ScrollViewer>

You could then stretch the containing ItemsControl horizontally and it should force the wrap.


text:
Q: formview textbox control textchanged event will not fire I need help in VB (no C# or Javascript, please -- I'm clueless with those languages)
I have also checked all the "questions that may already have your answer -- and those that were in VB didn't match my situation or were resolved by using AutoPostback,coding a textChanged event, or adding ontextchanged= to the textbox field --- I have all of these in my code already.
I can't seem to get the TextChanged event to fire despite setting the AutoPostBack to true.
Even after creating at submit button it still won't fire, what have I left out?
What I'm trying to accomplish:
I want the Finish Date to set to a date 30 days after the Start Date if and only if the user edits a start date.
Otherwise just display in the Finish Date whatever would have originally displayed there.
Both dates are allowed to be null in the database and both are defined as datetime.
In Default.aspx
<asp:FormView ID="FormView1" runat="server" DataKeyNames="MASTERID_Action"
DataSourceID="srcAction">
<EditItemTemplate>
MASTERID_Action:
<asp:Label ID="MASTERID_ActionLabel1" runat="server"
Text='<%# Eval("MASTERID_Action") %>' />

Action_StartDate:
<asp:TextBox ID="Action_StartDateTextBox" runat="server"
Text='<%# Bind("Action_StartDate") %>'
ontextchanged="Action_StartDateTextBox_TextChanged" AutoPostBack="True" />         <rjs:PopCalendar ID="StartDateCal" runat="server" Control="Action_STartDateTextBox" />

Action_FinishDate:
<asp:TextBox ID="Action_FinishDateTextBox" runat="server"
Text='<%# Eval("Action_FinishDate") %>' />

<asp:Button ID="SubmitButton1" runat="server" Text="Refresh"
onclick="SubmitButton1_Click" />
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
CommandName="Update" Text="Update" />
 <asp:LinkButton ID="UpdateCancelButton" runat="server"
CausesValidation="False" CommandName="Cancel" Text="Cancel" />
</EditItemTemplate>

In Default.aspx.vb
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Action_StartDateTextBox_TextChanged(sender As Object, e As System.EventArgs)
Dim txtStartDate As TextBox = Me.FormView1.FindControl("Action_StartDateTextBox")
Dim txtFinishDate As TextBox = Me.FormView1.FindControl("Action_finishdatetextbox")
Dim strNewFinishDate As String

If txtFinishDate.Text = "" And txtStartDate.Text <> "" Then
strNewFinishDate = Convert.ToString(Convert.ToDateTime(txtStartDate).AddDays(30))
ElseIf txtFinishDate.Text <> "" Then
strNewFinishDate = txtFinishDate.Text
Else
strNewFinishDate = ""
End If

txtFinishDate.Text = strNewFinishDate

End Sub

Protected Sub SubmitButton1_Click(sender As Object, e As System.EventArgs)
Dim mytest As String
End Sub
End Class

16/01/2013 edit: had a typo in Protected Sub Action_StartDateTextBox_TextChanged ran the page but it still doesn't fire.  Still need help with this, please.
17/01/2013 edit: My question is still unanswered, the response I did receive caused more errors.  Please help.

A: I think you might have been deleted your controls after writing its corresponding events.If so, as a result it will remove all the handlers that you had specified with the events.
'---This is your code, by the way it seems to be missing its handler
... Action_StartDateTextBox_TextChanged(sender As Object, e As System.EventArgs)

try to add its handler like this,
'---Adding hanler
... Action_StartDateTextBox_TextChanged(sender As Object, e As System.EventArgs) Handles Action_StartDateTextBox.TextChanged

If you need more details regarding Event Handler, Just refer this.

A: No response on this, but I have to keep moving.  So, I have chosen what is probably the smarter route -- to take care of my postbacks as client-side javascript.   I would have accepted an answer of "asp.net can't do this. Javascript would make your life so much easier" for this issue....


text:
Q: Is it safe to zpool upgrade my boot pool? I have a home server that was originally installed with Ubuntu 14.04 and is currently running 19.10 (will eventually be upgraded to 20.04). All the filesystems, including the one that contains /boot, are ZFS. When I run zpool status rpool, it advises me to run zpool upgrade:
$ zpool status rpool
  pool: rpool
 state: ONLINE
status: Some supported features are not enabled on the pool. The pool can
        still be used, but some features are unavailable.
action: Enable all features using 'zpool upgrade'. Once this is done,
        the pool may no longer be accessible by software that does not support
        the features. See zpool-features(5) for details.
  scan: scrub repaired 0B in 0 days 03:59:33 with 0 errors on Sun Jul 12 04:23:43 2020
config:

        NAME                                                STATE     READ WRITE CKSUM
        rpool                                               ONLINE       0     0     0
          raidz1-0                                          ONLINE       0     0     0
            ata-WDC_WD10EZEX-00BN5A0_WD-WCC3F0ZX6U1R-part1  ONLINE       0     0     0
            ata-WDC_WD10EZEX-00BN5A0_WD-WCC3F2VSJVE1-part1  ONLINE       0     0     0
            ata-WDC_WD10EADS-11M2B1_WD-WCAV54517936-part1   ONLINE       0     0     0

errors: No known data errors

At the time I installed 14.04, I believe the advice was to explicitly disable certain ZFS features in order to make the pool readable to GRUB, which is why the above message is appearing in the first place. However, I have no idea if this advice still applies. Is it safe to run zpool upgrade rpool, or will doing so render my boot volume unreadable to GRUB and prevent it from booting?
Here are some hopefully relevant bits of system info:
$ apt-cache policy grub2 zfsutils-linux linux-image-generic
grub2:
  Installed: 2.04-1ubuntu12.2
  Candidate: 2.04-1ubuntu12.2
  Version table:
 *** 2.04-1ubuntu12.2 500
        500 http://us.archive.ubuntu.com/ubuntu eoan-updates/universe amd64 Packages
        100 /var/lib/dpkg/status
     2.04-1ubuntu12 500
        500 http://us.archive.ubuntu.com/ubuntu eoan/universe amd64 Packages
zfsutils-linux:
  Installed: 0.8.1-1ubuntu14.4
  Candidate: 0.8.1-1ubuntu14.4
  Version table:
 *** 0.8.1-1ubuntu14.4 500
        500 http://us.archive.ubuntu.com/ubuntu eoan-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     0.8.1-1ubuntu14 500
        500 http://us.archive.ubuntu.com/ubuntu eoan/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu eoan/main amd64 Packages
linux-image-generic:
  Installed: 5.3.0.62.52
  Candidate: 5.3.0.62.52
  Version table:
 *** 5.3.0.62.52 500
        500 http://us.archive.ubuntu.com/ubuntu eoan-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu eoan-security/main amd64 Packages
        100 /var/lib/dpkg/status
     5.3.0.18.21 500
        500 http://us.archive.ubuntu.com/ubuntu eoan/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu eoan/main amd64 Packages

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 19.10
Release:        19.10
Codename:       eoan

$ uname -a
Linux mneme.dedyn.io 5.3.0-62-generic #56-Ubuntu SMP Tue Jun 23 11:20:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

A: Given that I already have another computer running 20.04 on ZFS with all feature flags enabled, I decided to upgrade my server to 20.04 and then take the chance and run zpool upgrade (after verifying that both machines had the same versions of grub and zfs). It worked! My server still boots just fine. So while I can't say anything about 19.10, I can say that as of 20.04, running zpool upgrade on your boot pool should not render your machine unbootable.


text:
Q: Syntax error using keyboard input in a simple python code I have this simple python code which throws errors when i run it. I am not sure what is causing this can somebody help shed some light?
Here is my code file test.py:
name = input("What's your name? ")
print("You are great" + name + "!")
age = input("Your age? ")
print("you look great at" + str(age))

and here is the error:
>>>
What's your name? kiran

Traceback (most recent call last):
  File "C:\Users\Sunshine\Desktop\test.py", line 1, in <module>
    name = input("What's your name? ")
  File "<string>", line 1, in <module>
NameError: name 'kiran' is not defined
>>>

A: if you are using Python 2.7 the correct way of getting a string from user input is using the method raw_input(""), input("") is for python 3.


text:
Q: cxf bouncycastle collision in camel application I am using camel and cxf in an application. There is a new module which has bouncycastle dependency org.bouncycastle:bcprov-jdk15on:jar:1.53. After adding this module, I started to get Exceptions in runtime:
21-Dec-2015 12:02:06.194 INFO [Camel (camel-1) thread #17 - seda://sp-tsm:handleEndServiceChangeNotification] org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading Illegal access: this web application instance has been stopped already. Could not load [org.bouncycastle.jcajce.provider.symmetric.PBEPKCS12$AlgParams]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org.bouncycastle.jcajce.provider.symmetric.PBEPKCS12$AlgParams]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForResourceLoading(WebappClassLoaderBase.java:1335)
    at org.apache.catalina.loader.WebappClassLoaderBase.checkStateForClassLoading(WebappClassLoaderBase.java:1321)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1203)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1164)
    at java.security.Provider$Service.getImplClass(Provider.java:1636)
    at java.security.Provider$Service.newInstance(Provider.java:1592)
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
    at sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
    at java.security.Security.getImpl(Security.java:695)
    at java.security.AlgorithmParameters.getInstance(AlgorithmParameters.java:146)
    at sun.security.x509.AlgorithmId.decodeParams(AlgorithmId.java:121)
    at sun.security.x509.AlgorithmId.<init>(AlgorithmId.java:114)
    at sun.security.x509.AlgorithmId.parse(AlgorithmId.java:372)
    at sun.security.pkcs.EncryptedPrivateKeyInfo.<init>(EncryptedPrivateKeyInfo.java:80)
    at sun.security.pkcs12.PKCS12KeyStore.engineGetKey(PKCS12KeyStore.java:321)
    at java.security.KeyStore.getKey(KeyStore.java:1023)
    at org.apache.wss4j.common.crypto.Merlin.getPrivateKey(Merlin.java:766)
    at org.apache.wss4j.dom.message.WSSecSignature.computeSignature(WSSecSignature.java:555)
    at org.apache.wss4j.dom.action.SignatureAction.execute(SignatureAction.java:152)
    at org.apache.wss4j.dom.handler.WSHandler.doSenderAction(WSHandler.java:237)
    at com.toro.wm.protocol.gpm.ws.interceptor.WSS4JOutCustomInterceptor.access$200(WSS4JOutCustomInterceptor.java:56)
    at com.toro.wm.protocol.gpm.ws.interceptor.WSS4JOutCustomInterceptor$WSS4JOutInterceptorInternal.handleMessageInternal(WSS4JOutCustomInterceptor.java:284)
    at com.toro.wm.protocol.gpm.ws.interceptor.WSS4JOutCustomInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutCustomInterceptor.java:156)
    at com.toro.wm.protocol.gpm.ws.interceptor.WSS4JOutCustomInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutCustomInterceptor.java:143)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425)
    at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:153)
    at org.apache.camel.impl.SynchronousDelegateProducer.process(SynchronousDelegateProducer.java:62)
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
    at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291)
    at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200)
    at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

and
10:21:53.919 [Camel (camel-1) thread #7 - seda://sp-tsm:checkGlobalEligibility] ERROR c.t.w.c.r.ExceptionHandlingRoutes - Exchange[ExchangePattern: InOut, BodyType: org.globalplatform.namespaces.systems_messaging._2_1.CheckGlobalEligibilityRequestType, Body: org.globalplatform.namespaces.systems_messaging._2_1.CheckGlobalEligibilityRequestType@29f83af2, CaughtExceptionType: org.apache.cxf.binding.soap.SoapFault,
CaughtExceptionMessage: Security processing failed.,
StackTrace: org.apache.cxf.binding.soap.SoapFault: Security processing failed.
    at com.toro.wm.protocol.gpm.ws.interceptor.WSS4JOutCustomInterceptor$WSS4JOutInterceptorInternal.handleMessageInternal(WSS4JOutCustomInterceptor.java:292)
    at com.toro.wm.protocol.gpm.ws.interceptor.WSS4JOutCustomInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutCustomInterceptor.java:156)
    at com.toro.wm.protocol.gpm.ws.interceptor.WSS4JOutCustomInterceptor$WSS4JOutInterceptorInternal.handleMessage(WSS4JOutCustomInterceptor.java:143)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:418)
    at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:116)
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:129)
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
    at org.apache.camel.component.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291)
    at org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200)
    at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.wss4j.common.ext.WSSecurityException: Cannot create Crypto class org.apache.wss4j.common.crypto.Merlin
Original Exception was org.apache.wss4j.common.ext.WSSecurityException: Failed to load credentials.
Original Exception was java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: pad block corrupted
    at org.apache.wss4j.common.crypto.CryptoFactory.getInstance(CryptoFactory.java:134)
    at org.apache.wss4j.common.crypto.CryptoFactory.getInstance(CryptoFactory.java:203)
    at org.apache.cxf.ws.security.wss4j.WSS4JUtils.loadCryptoFromPropertiesFile(WSS4JUtils.java:350)
    at org.apache.cxf.ws.security.wss4j.AbstractWSS4JInterceptor.loadCryptoFromPropertiesFile(AbstractWSS4JInterceptor.java:207)
    at org.apache.wss4j.dom.handler.WSHandler.loadCrypto(WSHandler.java:1096)
    at org.apache.wss4j.dom.handler.WSHandler.loadSignatureCrypto(WSHandler.java:990)
    at org.apache.wss4j.dom.handler.WSHandler.doSenderAction(WSHandler.java:142)
    at com.toro.wm.protocol.gpm.ws.interceptor.WSS4JOutCustomInterceptor.access$200(WSS4JOutCustomInterceptor.java:56)
    at com.toro.wm.protocol.gpm.ws.interceptor.WSS4JOutCustomInterceptor$WSS4JOutInterceptorInternal.handleMessageInternal(WSS4JOutCustomInterceptor.java:284)
    ... 19 more
Caused by: org.apache.wss4j.common.ext.WSSecurityException: Failed to load credentials.
Original Exception was java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: pad block corrupted
    at org.apache.wss4j.common.crypto.Merlin.load(Merlin.java:409)
    at org.apache.wss4j.common.crypto.Merlin.loadProperties(Merlin.java:225)
    at org.apache.wss4j.common.crypto.Merlin.<init>(Merlin.java:161)
    at org.apache.wss4j.common.crypto.CryptoFactory.getInstance(CryptoFactory.java:129)
    ... 27 more
Caused by: java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: pad block corrupted
    at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1978)
    at java.security.KeyStore.load(KeyStore.java:1445)
    at org.apache.wss4j.common.crypto.Merlin.load(Merlin.java:403)
    ... 30 more
Caused by: javax.crypto.BadPaddingException: pad block corrupted
    at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher$BufferedGenericBlockCipher.doFinal(Unknown Source)
    at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineDoFinal(Unknown Source)
    at javax.crypto.Cipher.doFinal(Cipher.java:2165)
    at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1969)
    ... 32 more

Bouncycastle is not used anywhere else in the application. CXF version is 3.0.6.
So it seems that CXF and bouncycastle don't work well together somehow (at least in my case). How can I fix this problem?

A: According to this thread problem with loading Bouncy Castle it seems to be a permission issue, since you should install your Crypto providers into a specific directory:

Crypto providers need to be installed into the JRE extension directory
  (e.g. $JRE_HOME/lib/ext) and an entry must be added to
  $JRE_HOME/lib/security/java.security to install the provider.  For
  example:
security.provider.5=org.bouncycastle.jce.provider.BouncyCastleProvider


text:
Q: How to make while read faster (how to use grep instead) I have a file named "compare" and a file named "final_contigs_c10K.fa"
I want to eleminate lines AND THE NEXT LINE from "final_contigs_c10K.fa" containing specific strings in "compare".
compare looks like this :
k119_1
k119_3
...

and the number of lines of compare is 26364.
final_contigs_c10K.fa looks like :
>k119_1
AAAACCCCC
>k119_2
CCCCC
>k119_3
AAAAAAAA
...

I want to make make final_contigs_c10K.fa into a format :
>k119_1
AAAACCCCC
>k119_3
AAAAAAAA
...

I tried this code, but this code takes too much time, though it seems to be working fine. I think it takes too much time because the number of lines in compare is 26364, which is too much compared to my other files that I had tested the code on.
while read line; do sed -i -e "/$line/ { N; d; }" final_contigs_c10K.fa; done < compare

Is there a way to make this command faster?

A: Using awk
$ awk 'NR==FNR{a[">" $1];next}$1 in a{p=3} --p>0' compare final_contigs_c10K.fa
>k119_1
AAAACCCCC
>k119_3
AAAAAAAA

This will produce the output to stdout ie. won't make any changes to original files.
Explained:
$ awk '
NR==FNR {                        # process the first file
    a[">" $1]                    # hash to a, adding > while at it
    next                         # process the next record
}                                # process th second file after this point
$1 in a { p=3 }                  # if current record was in compare file set p
--p>0                            # print current file match and the next record
' compare final_contigs_c10K.fa  # mind the file order


text:
Q: How to start data visualization of a mat-table at an x value and create load more button. (Angular/Typescript) When starting the page, I need the table as printed below to show 10 items/lines and when the user clicks on the "Load More" button, it loads another 10 items, or the amount in which there is, if all the items are loaded, the button disappears and the message "All items loaded" appears. How can I do this?

Component TS
    export interface PeriodicElement {
        event: string;
        professional: string;
        job: number;
        checkOut: string;
        value: string;
    }

    const ELEMENT_DATA: PeriodicElement[] = [
        {professional: '87.737.817/0001-25', event: 'Lollapaloza', job: 638, checkOut: '18 set 2021 - 22h15', value: 'R$ 540,00'},
        {professional: '87.737.817/0001-25', event: 'Lollapaloza', job: 638, checkOut: '18 set 2021 - 22h15', value: 'R$ 540,00'},
        {professional: '87.737.817/0001-25', event: 'Lollapaloza', job: 638, checkOut: '18 set 2021 - 22h15', value: 'R$ 540,00'},
    ];

export class PaymentsComponent implements OnInit {

    public displayedColumns: string[] = ['professional', 'event', 'job', 'checkOut', 'value', 'actionsColumn3icons'];
    public dataSource: MatTableDataSource<PeriodicElement> = new MatTableDataSource(ELEMENT_DATA); //FAKE TABLE

Component HTML

 0">

        <ng-container matColumnDef="professional">

{{ 'payments.professional' | translate }}

                    {{ element?.freelancer }}
                    {{ element?.limit_date_expired }}

        </ng-container>

        <ng-container matColumnDef="event">

{{ 'payments.event' | translate }}

                        {{ element?.event }}
                        {{ element?.event }}

        </ng-container>

        <ng-container matColumnDef="job">

{{ 'payments.job' | translate }}

                        {{ element?.job_id }}

        </ng-container>

        <ng-container matColumnDef="checkOut">

{{ 'payments.checkOut' | translate }}

                        {{ element?.checkout_date }}

        </ng-container>

        <ng-container matColumnDef="value">

{{ 'payments.value' | translate }}

                        {{ element?.value }}

        </ng-container>

        <ng-container matColumnDef="actionsColumn3icons">

                    <mat-icon class="svg-icon primary-dark inline-self" svgIcon="document-download"></mat-icon>

                        {{ 'payments.toView' | translate }}
                        <button class="btn small danger" (click)="openRejectModal()">
                            <mat-icon class="svg-icon" svgIcon="close-circle"></mat-icon>
                            {{ 'payments.reject' | translate }}
                        </button>
                        <button class="btn small tertiary" (click)="updateStatusInvoice('refused')">
                            <mat-icon class="svg-icon" svgIcon="tick-circle"></mat-icon>
                            {{ 'payments.approved' | translate }}
                        </button>

        </ng-container>

<button class="btn small primary">
    Load More
</button>


text:
Q: Getting the TypeError: 'function' object is not iterable Why do I seem to get this TypeError:
mx = list(lambda points: [str(Point(*point)) for point in points])
TypeError: 'function' object is not iterable

All seems fine to me. points is an iterable.
class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __repr__(self):
        return "Pointxxxx(%d, %d)" % (self.x, self.y)

points = [(1,2),(3,4),(5,6),(7,8),(9,10)]
mx = list(lambda points: [str(Point(*point)) for point in points])
print(mx)

A: list function takes iterable object as parament not a function.
Change your code list(lambda points: [str(Point(*point)) for point in points])
function = lambda points: [str(Point(*point)) for point in points]
mx = list(function(points))

Or use
mx = [str(Point(*point)) for point in points]

Or use map function for that purpose
mx = list(map(lambda points: [str(Point(*point)) for point in points], [points]))


text:
Q: Multiplatform error when building iosApp: Command PhaseScriptExecution failed with a nonzero exit code I am working on a multiplatform app in Kotlin on Android Studio and when I try to run the app to an iOS simulator, I get this error:
The following build commands failed:

PhaseScriptExecution [CP-User]\ Build\ shared /Users/cjm/AndroidStudioProjects/GlobeMultiplatform/build/ios/Pods.build/Debug-iphonesimulator/shared.build/Script-882AF45D8B8C4938AC461F4FBA0FE197.sh (in target 'shared' from project 'Pods')

The code in the build.gradle that sets the cocoa pods is this:
cocoapods {
    summary = "Shared"
    homepage = "Link to the Shared Module homepage"
    ios.deploymentTarget = "13"
    frameworkName = "shared"
    podfile = project.file("../iosApp/Podfile")
}

I ran pod install and it showed success but the build of the app still fails. How can I fix this error? What is causing this error? I am brand new to Kotlin and especially Kotlin Multiplatform so I apologize if this is a stupid question.
EDIT: Here's what Xcode says when running the app:
FAILURE: Build failed with an exception.

*

*Where:
Build file '/Users/cjm/AndroidStudioProjects/GlobeMultiplatform/androidApp/build.gradle.kts' line: 1

*What went wrong:
An exception occurred applying plugin request [id: 'com.android.application']

Failed to apply plugin 'com.android.internal.application'.
Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing org.gradle.java.home in gradle.properties.

*

*Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

*Get more help at https://help.gradle.org

A: It seems that it tries to build your code with Java 1.8, you need a Java > 11 version.
I'd look into this or other guidelines to make sure the proper JDK version is used


text: Q: Installing Braid Some time ago I bought the game Braid from the Ubuntu Software Center, but in Ubuntu 14.10 I has been removed and I cannot install it anymore. It is still listed in the Ubuntu Apps Directory, but only for Ubuntu versions up to 14.04. Is there a way to install this game in 14.10? I'd hate to lose this game because I paid for it.


text:
Q: How to define the difference between the similarity (e.g.: measured with cosine) of entities from two given sets? I have two groups of entities, a "valid" group which is expected to contain similar entities, and a "random" group which is expected to contain less similar entities when compared to the valid group. I have a long list of similarity/distance measurements, like cosine, canberra, manhattan, etc., that are all computed within the groups to produce an average similarity scores for the entities in them. My question is, how should the difference between the scores of the two group be defined? I know comparing different metric results is not advised, but this problem mainly stems from the fact, that the entities have two different descriptions (a vector-based and a knowledge-graph-based) that require different similarity metrics, and my aim is to compare the two types of description through the difference of average similarities between valid and random groups of entities.
My first intuition was to simply take
similarity_gain = (valid_score - random_score) / np.abs(random_score)

However, this largely ignored the scale of the metrics, e.g.: dot measurement resulted in huge gains due to the large difference in the vectors, meanwhile other measurements with logarithmic-like scales showed little difference. Would a simply normalization to [0, 1] be a proper solution? Or is there another way to represent the gain through the different metrics for proper comparison?


text:
Q: HandlerInterceptor: The Interceptor is not being called I am implementing a MyInterceptor.java class which extends HandlerInterceptor implementing preHandle(),postHandle() andafterCompletion(). The interceptor methods are not being called.
Here is MyInterceptor.java
    package com.mykong.common.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

public class MyInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
            throws Exception {
        System.out.println("Pre-handle");

        return true;
    }

    @Override
    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
            ModelAndView modelAndView) throws Exception {
        System.out.println("Post-handle");
    }

    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
            throws Exception {
        System.out.println("After completion handle");
    }

}

Here is mvc-dispatcher-servlet.xml
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

    <context:component-scan base-package="com.mkyong.common.controller" />

    <mvc:interceptors>
        <mvc:interceptor>
            <bean class="com.mykong.common.interceptor.MyInterceptor" />
            <mvc:mapping path="/**"/>
        </mvc:interceptor>
    </mvc:interceptors>

   <mvc:annotation-driven />

</beans>

Here is web.xml
    <web-app id="WebApp_ID" version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <display-name>Spring Web MVC Application</display-name>

    <servlet>
        <servlet-name>mvc-dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>

        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/mvc-dispatcher-servlet.xml</param-value>
    </context-param>

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

</web-app>

I am running this project on eclipse. I am  not able to see "Pre-handle","Post-handle" and "After completion handle" being printed in the Console tab of eclipse.
Any help would be appreciated. Thanks :)

A: Change your mvc-dispatcher servlet mapping in your web.xml as follows:
 <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
 </servlet-mapping>

Also, edit your mvc:interceptors in mvc-dispatcher-servlet.xml file as below:
<mvc:interceptors>
            <mvc:interceptor>
                <mvc:mapping path="/**"/>
                <bean class="com.mykong.common.interceptor.MyInterceptor" />
            </mvc:interceptor>
</mvc:interceptors>

Optionally, you can remove below entry from web.xml, as by default Spring looks for servletName-servlet.xml inside your WEB-INF folder:
 <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/mvc-dispatcher-servlet.xml</param-value>
 </context-param>

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


text:
Q: Cannot get response message when using the microsoft translator speech API I created a Microsoft Translator Speech API Service on Microsoft Azure for free . But When I was running the sample project with this service, there was no response message in the web socket. I'm sure the connection was established and the audio file was tansferred to the destination URL. The client program just waited until timeout and nothing received. The return code is 1001.
I want to ask what's wrong with my service and why the service doesn't response. The sample project is on 'https://github.com/MicrosoftTranslator/Java-Speech-Translate'.
Here is the output of my program.

A: Here's a link to an explanation of an error 1001.
Give it a try again and if needed, you can refer to the Microsoft Translator Speech API documentation.
Hope this helps.


text:
Q: IE console issues I checked my index.php and removed all the console.log() but when I go to IE7 I am still getting console errors. The funny thing is if I check the in IE9 and then change the browser mode to IE7 it works fine, however if test the site straight into an IE7 browser it gives a console error message.
Any idea on how to stop this please?

A: You probably missed a console.log call somewhere. The reason why it works in IE9 switching to IE7 is that the console object is created as soon as you open the console to switch the version. Thus no error will be thrown in the IE7 emulation mode of IE9.
The better solution is to include the following in your js-code beforehand:
if (!window.console){console = {log:function(){}};}

Now all your console.log calls won't throw an error but will be silently ignored.
I do the following when developing:
var logging = 1;
if (!window.console){console = {log:function(){}};}
function _log(a) { if(logging) { console.log(a); } }

and keep on using _log("foo") for the entire code. Now you can switch logging with a simple logging = 0 and are safe against the missing console object.