text:
Q: strange sqares like hints in Silverlight application? Good day!
Strange square appears on mouse hover on text boxes, buttons, etc (something like hint) in a silverlight navigation application - how can I remove it?
a scrin shot
an example .xaml page:
<Code:BasePage x:Class="CAP.Views.Main"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
       xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
       mc:Ignorable="d"
       xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
       xmlns:Code="clr-namespace:CAP.Code"
       d:DesignWidth="640" d:DesignHeight="480"
       Title="Личный кабинет клиентов ООО АУРИТ">
<Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
        <RowDefinition Height="103*" />
        <RowDefinition Height="377*" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="120*" />
        <ColumnDefinition Width="520*" />
    </Grid.ColumnDefinitions>
    <Image Height="85" HorizontalAlignment="Left" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="84" Margin="12,0,0,0" ImageFailed="image1_ImageFailed" Source="/CAP;component/Images/My-Computer.png" />
    <TextBlock Grid.Column="1" Height="Auto" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="0,12,0,0" Name="textBlock1" Text="Good day!" VerticalAlignment="Top" FontFamily="Verdana" FontSize="16" Width="345" FontWeight="Bold" />
    <TextBlock Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Height="299" HorizontalAlignment="Left" Name="textBlock2"  VerticalAlignment="Top"  FontFamily="Verdana" FontSize="14" Width="441" >
       <Run Text="Some text "/><LineBreak/><LineBreak/><Run Text="and so on"/>
        <LineBreak/>
    </TextBlock>
</Grid>

xaml.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
using CAP.Code;

namespace CAP.Views
{
    public partial class Main : BasePage
    {
        public Main()  : base()
        {
            InitializeComponent();
            MapBuilder.AddToMap(new SiteMapUnit() { Caption = "Главная", RelativeUrl = "Main" },true);
            ((App)Application.Current).Mainpage.tvMainMenu.SelectedItems.Clear();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        private void image1_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {

        }
        protected override string[] NeededPermission()
        {
            return new string[0];
        }

    }
}

MainPage.xaml
<UserControl
    x:Class="CAP.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Code="clr-namespace:CAP.Code"
    xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
    xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
 xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
    mc:Ignorable="d" Margin="0,0,0,0"  Width="auto" Height="auto" xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input">
    <ScrollViewer Width="auto"  Height="auto" BorderBrush="White" BorderThickness="0" Margin="0,0,0,0"   x:Name="sV" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" >
        <ScrollViewer.Content>
            <Grid Width="auto"  Height="auto" x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}"  Margin="0,0,0,0">
        <StackPanel Width="auto"  Height="auto" Orientation="Vertical" Margin="250,0,0,50">
            <Border x:Name="ContentBorder2" Margin="0,0,0,0" >
                <!--<navigation:Frame  Margin="0,0,0,0" Width="auto" Height="auto" x:Name="AnotherFrame"  VerticalAlignment="Top" Style="{StaticResource ContentFrameStyle}"  Source="/Views/Menu.xaml"  NavigationFailed="ContentFrame_NavigationFailed" JournalOwnership="OwnsJournal"  Loaded="AnotherFrame_Loaded">

                </navigation:Frame>-->
                <StackPanel Orientation="Vertical" Height="82" Width="Auto" HorizontalAlignment="Right" Margin="0,0,0,0" DataContext="{Binding}">
                   <TextBlock HorizontalAlignment="Right" Foreground="White" x:Name="ApplicationNameTextBlock4" Style="{StaticResource ApplicationNameStyle}" FontSize="20"
                   Text="Личный кабинет" Margin="20,16,20,0"/>
                   <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                <Image x:Name="imDoor" Visibility="Collapsed"  MouseEnter="imDoor_MouseEnter" MouseLeave="imDoor_MouseLeave" Height="24" Stretch="Fill" Width="25" Margin="10,0,10,0" Source="/CAP;component/Images/sm_white_doors.png" MouseLeftButtonDown="bTest_Click" />
                       <TextBlock x:Name="bLogout" MouseEnter="bLogout_MouseEnter" MouseLeave="bLogout_MouseLeave" TextDecorations="Underline" Margin="0,6,20,4" Height="23"  Text="Выйти" HorizontalAlignment="Right" Visibility="Collapsed" MouseLeftButtonDown="bTest_Click" FontFamily="Verdana" FontSize="13" FontWeight="Normal" Foreground="#FF1C1C92" />
                    </StackPanel>
                </StackPanel>
             </Border>
             <Border x:Name="bSiteMap" Margin="0,0,0,0" >
                 <StackPanel x:Name="spSiteMap" Orientation="Horizontal" Height="20" Width="Auto" HorizontalAlignment="Left" Margin="0,0,0,0" DataContext="{Binding}">
                           <!-- <TextBlock Visibility="Visible" TextDecorations="Underline"  Height="23" HorizontalAlignment="Left" x:Name="ar" Text="1" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13"  />
                            <TextBlock Visibility="Visible" Height="23" HorizontalAlignment="Left" x:Name="Map" Text="->" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13"  />
                            <TextBlock Visibility="Visible" TextDecorations="Underline"  Height="23" HorizontalAlignment="Left" x:Name="ar1" Text="2" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13"  />
                            <TextBlock Visibility="Visible" Height="23" HorizontalAlignment="Left" x:Name="Map1" Text="->" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13"  />
                            <TextBlock Visibility="Visible" TextDecorations="Underline"  Height="23" HorizontalAlignment="Left" x:Name="ar2" Text="3" VerticalAlignment="Top" Foreground="Blue" FontFamily="Verdana" FontSize="13"  />-->
                </StackPanel>
             </Border>
             <Border Width="auto"  Height="auto" x:Name="ContentBorder" Margin="0,0,0,0" >

                        <navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}"
                              Source="Main" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed" ToolTipService.ToolTip=" " Margin="0,0,0,0">
                            <navigation:Frame.UriMapper>
                                <uriMapper:UriMapper>

                                    <!--Client-->
                                    <uriMapper:UriMapping Uri="RegistrateClient" MappedUri="/Views/Client/RegistrateClient.xaml"/>
                                    <!--So on-->
                                </uriMapper:UriMapper>
                            </navigation:Frame.UriMapper>
                       </navigation:Frame>

                </Border>

                </StackPanel>

        <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}" Margin="0,0,0,0" Background="{x:Null}" >
            <StackPanel Orientation="Vertical" Height="Auto" Width="250" HorizontalAlignment="Center" Margin="0,0,0,50" DataContext="{Binding}">
                <Image Width="150" Height="90"  HorizontalAlignment="Center"  VerticalAlignment="Top" Source="/CAP;component/Images/logo__au.png" Margin="0,20,0,70"/>

                <Border x:Name="BrandingBorder" MinHeight="222" Width="250" Style="{StaticResource BrandingBorderStyle3}" HorizontalAlignment="Center" Opacity="60" Margin="0,0,0,0">
                 <Border.Background>
                                <ImageBrush ImageSource="/CAP;component/Images/papka.png"/>
                 </Border.Background>
                    <Grid Width="250" x:Name="LichniyCabinet" Margin="0,10,0,0" HorizontalAlignment="Center" Height="211">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="19*" />
                                    <ColumnDefinition Width="62*" />
                                    <ColumnDefinition Width="151*" />
                                    <ColumnDefinition Width="18*" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="13" />
                                    <RowDefinition Height="24" />
                                    <RowDefinition Height="35" />
                                    <RowDefinition Height="35" />
                                    <RowDefinition Height="43" />
                                    <RowDefinition Height="28" />
                                    <RowDefinition Height="32*" />
                                </Grid.RowDefinitions>
                                <TextBlock Visibility="Visible" Grid.Row="2" Height="23" HorizontalAlignment="Left" x:Name="tLogin" Text="Логин" VerticalAlignment="Top" FontFamily="Verdana" FontSize="13" Foreground="White" Margin="1,0,0,0" Grid.Column="1" />
                                <TextBlock Visibility="Visible"  FontFamily="Verdana" FontSize="13" Foreground="White" Height="23" HorizontalAlignment="Left" x:Name="tPassw" Text="Пароль" VerticalAlignment="Top" Grid.Row="3" Grid.Column="1" />
                                <TextBox  Visibility="Visible" Grid.Column="2" Grid.Row="2" Height="24" HorizontalAlignment="Left" x:Name="logLogin" VerticalAlignment="Top" Width="150" />
                                <PasswordBox Visibility="Visible" Code:DefaultButtonService.DefaultButton="{Binding ElementName=bLogin}" PasswordChar="*" Height="24" HorizontalAlignment="Left" x:Name="logPassword" VerticalAlignment="Top" Width="150" Grid.Column="2" Grid.Row="3" />
                                <Button  x:Name="bLogin"  MouseEnter="bLogin_MouseEnter" MouseLeave="bLogin_MouseLeave" Visibility="Visible" Content="Войти" Grid.Column="2" Grid.Row="4" Click="Button_Click" Height="23" HorizontalAlignment="Left" Margin="81,0,0,0" VerticalAlignment="Top" Width="70" />
                                <TextBlock MouseLeftButtonDown="ForgotPassword_MouseLeftButtonDown" MouseEnter="ForgotPassword_MouseEnter" MouseLeave="ForgotPassword_MouseLeave" Visibility="Visible" TextDecorations="Underline" Grid.ColumnSpan="2" Grid.Row="4" Height="23" HorizontalAlignment="Left" x:Name="ForgotPassword" Text="Забыли пароль?" VerticalAlignment="Top" Foreground="White" FontFamily="Verdana" FontSize="13" Grid.Column="1"   />
                                <TextBlock MouseEnter="tbRegistration_MouseEnter" MouseLeave="tbRegistration_MouseLeave" MouseLeftButtonDown="tbRegistration_MouseLeftButtonDown" Grid.Column="2" Grid.Row="6" Height="23" x:Name="tbRegistration"  TextDecorations="Underline" Text="Регистрация" VerticalAlignment="Top" FontFamily="Verdana" FontSize="13" TextAlignment="Center" HorizontalAlignment="Center" Foreground="#FF1C1C92" FontWeight="Normal" Margin="0,0,57,0" />
                                <TextBlock  Cursor="Arrow"  Height="23" HorizontalAlignment="Left" Margin="11,-3,0,0"   Text="Личный кабинет" VerticalAlignment="Top" Grid.ColumnSpan="3" Grid.RowSpan="2" FontFamily="Verdana" FontSize="13" FontWeight="Bold" Foreground="White" />
                                <Image Visibility="Collapsed" Height="70" x:Name="imUser"  Stretch="Fill" Width="70" Grid.ColumnSpan="2" Margin="11,0,0,0" Grid.Row="2" Grid.RowSpan="2" Source="/CAP;component/Images/user2.png" />
                                <TextBlock x:Name="tbHello" Grid.Column="2" Visibility="Collapsed" Grid.Row="2" Height="auto" TextWrapping="Wrap" HorizontalAlignment="Left" Margin="6,0,0,0"  Text="" VerticalAlignment="Top" FontFamily="Verdana" FontSize="13" Foreground="White" Width="145" />
                            </Grid>

            </Border>

            <Border x:Name="MenuBorder" Margin="0,0,0,50" Width="250" Visibility="Collapsed">
                    <StackPanel x:Name="spMenu" Width="240" HorizontalAlignment="Left">
                                <telerikNavigation:RadTreeView x:Name="tvMainMenu"
                                                               Width="240"
                                                               Selected="TreeView1_Selected"
                                                               SelectedValuePath="Text"
                                                               telerik:Theming.Theme="Windows7"
                                                               FontFamily="Verdana"
                                                               FontSize="12"/>
                    </StackPanel>
             </Border>
        </StackPanel>
        </Grid>
                <Border x:Name="FooterBorder" VerticalAlignment="Bottom" Width="auto"   Height="76">
                    <Border.Background>
                        <ImageBrush ImageSource="/CAP;component/Images/footer2.png" />
                    </Border.Background>
                    <TextBlock  x:Name="tbFooter" Height="24"  Width="auto" Margin="0,20,0,0" TextAlignment="Center" HorizontalAlignment="Stretch" VerticalAlignment="Center" Foreground="White" FontFamily="Verdana" FontSize="11">

                    </TextBlock>
                </Border>
      </Grid>
        </ScrollViewer.Content>
    </ScrollViewer>
</UserControl>

MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Navigation;
using CAP.Code;
using CAP.Registrator;
using System.Windows.Input;
using System.ComponentModel.DataAnnotations;
using System.Windows.Browser;
using Telerik.Windows.Controls;
using System.Net;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CAP
{
    public partial class MainPage
    {
        public App Appvars = Application.Current as App;
        private readonly RegistratorClient registrator;
        public SiteMapBuilder builder;
        public MainPage()
        {
            InitializeComponent();
            sV.SetIsMouseWheelScrollingEnabled(true);
            builder = new SiteMapBuilder(spSiteMap);
            try
            {
                //working with service
            }
            catch
            {
                this.ContentFrame.Navigate(new Uri(String.Format("ErrorPage"), UriKind.RelativeOrAbsolute));
            }
        }

        /// Recursive method to update the correct scrollviewer (if exists)
        private ScrollViewer CheckParent(FrameworkElement element)
        {
            ScrollViewer _result = element as ScrollViewer;
            if (element != null && _result == null)
            {
                FrameworkElement _temp = element.Parent as FrameworkElement;
                _result = CheckParent(_temp);
            }
            return _result;
        }

        // If an error occurs during navigation, show an error window
        private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
        {
            e.Handled = true;
            ChildWindow errorWin = new ErrorWindow(e.Uri);
            errorWin.Show();
        }

    }

}

A: i've solved the problem!!!
it was only a property ToolTipService.ToolTip=" " of Navigation:Frame
!!!!!!!!!!!!!!!!!!!!!!


text:
Q: Jest .toBeCalledWith objectContaining not matching expect on received I am trying to partially match the object which are being passed to TitleRepo.find. I am not able to understand what wrong I am doing.

expect(jest.fn()).toBeCalledWith(...expected)

Expected: ObjectContaining {"filter": {"limit": Any<Number>}}
Received: {"filter": {"title_ids.xxx.deleted_at": null, "title_ids.xxx.deleted_at": null, "title_ids.xxx.id": {"$exists": true, "$ne": null}}, "limit": 10, "sort": {"created_at": -1}}

Number of calls: 1

  31 |         });
  32 |
> 33 |         expect(TitleRepo.find).toBeCalledWith(
     |                                ^
  34 |             expect.objectContaining({"filter": {"limit": expect.any(Number)}}),
  35 |         );
  36 |     })

  at Object.<anonymous> (tests/query/TitleQuery.test.js:33:32)

Related lines from test is.
TitleRepo.find = jest.fn();

it('should able to set platform correctly', async () => {
        const titles = await TitleQuery.find({
            platform: 'chandu'
        });

        expect(TitleRepo.find).toBeCalledWith(
            expect.objectContaining({"filter": {"limit": expect.any(Number)}}),
        );
    })

A: limit property is on the same level as filter.
It should be:
expect(TitleRepo.find).toBeCalledWith(expect.objectContaining({ limit: expect.any(Number) })

redpajama_set_name: RedPajamaStackExchange


text:
Q: help with cakephp foreign keys i'm currently building a calendar which displays events each event belongsto an eventlocation with a foreign key of event_location_id each eventlocation hasmany events with a foreign id of event_location_id. Which gets the name of the event_location based on its id. Now im adding side deals and i can only get the event_location_id and not the name can anyone help? or possibly give a better explanation of what foreign id are for and do.
i just need to know how to get an event by it's id and then get the event_location_id  from the event and then get the name from event_locations table according to the event_location_id.

A: I would suggest using the containable behaviour. It will manage the recursion for you. Containable will be good enough for most purposes, unless the query is very complicated.

A: If you have set up your associations properly it should be as easy as:
$this->Event->recursive = 2;
$event = $this->Event->read(null, $id);

debug($event);

Cake automatically fetches data for associated models.


text:
Q: How to create a qr code reader? I'm developing an application which scans the qr code ,get the phone number from that and send sms to a particular person..
i searched a lot and cannot find a proper answer to that.
I need to develop it within my project by import zxing package.
please help me what are the steps to develop a qr code reader using zxing...

A: You can also try Zbar. It is easy to integrate and use. See this reference
https://github.com/DushyanthMaguluru/ZBarScanner.
Let me know if you could integrate it.


text:
Q: Java basic GUI program errors In my online Java class, I need to write a program that counts the number of mouse clicks on a button within a frame. Here is my code:
import java.awt.*;
import java.awt.event.*;

public class option1 extends Frame {
    option1() {
        setTitle("Final Project Option 1");
        setSize(300,300);
        show();
    }
    public static void main(String[] args) {
        option1 test = new option1();

        int a = 0;
        String s1 = "" + a;

        Frame objFrame;
        Button objButton1;
        Label objLabel1;

        objFrame = new option1();
        objButton1 = new Button("Button");
        objLabel1 = new Label();

        objLabel1.setBounds(150,220,50,30);
        objButton1.setBounds(40,35,50,50);

        objLabel1.setText(s1);

        objButton1.addMouseListener(new MyMouseListener()); //line 29

        objFrame.add(objLabel1);
        objFrame.add(objButton1);
    }
    public class MyMouseListener extends MouseAdapter {
        public void mouseClicked(MouseEvent me) {
            a++; //line 36
        }
    }
}

When compiling, I get two errors. One error is on line 29, which is "non-static variable this cannot be referenced from a static context", and the other is on line 36, which is "cannot find symbol".
So, what exactly am I doing wrong? I would appreciate responders telling exactly what I need to do to fix the problem, and avoiding using technical terms since I'm rather new to programming.

A: I see two issues, namely your inner class should be static (to use it without an instance of option1 which should probably be Option1 to fit with Java naming conventions) and you need to define and initialize a. Something like
public static class MyMouseListener extends MouseAdapter {
    int a = 0; //<-- add this.
    public void mouseClicked(MouseEvent me) {
        a++;
    }
}

Also, I suggest you consider using the more modern JFrame instead of the older Frame.
Edit
You'll need to save a reference to your MouseListener like
MyMouseListener mml = new MyMouseListener();
objButton1.addMouseListener(mml);

Then you can get it the a like
System.out.println(mml.a);

Finally, your original approach of "" + a would be "0".

A: Generally, as soon as you possibly can, get out of the main method into a non-static context...
public class option1 extends Frame {
    private int a = 0;
    private Label objLabel1;
    option1() {
        setTitle("Final Project Option 1");
        setSize(300,300);

        Button objButton1;

        objButton1 = new Button("Button");
        objLabel1 = new Label();

        objLabel1.setBounds(150,220,50,30);
        objButton1.setBounds(40,35,50,50);

        objLabel1.setText(Integer.toString(a));

        objButton1.addMouseListener(new MyMouseListener()); //line 29

        add(objLabel1);
        add(objButton1);

        show();
    }
    public static void main(String[] args) {
        option1 test = new option1();
    }
    public class MyMouseListener extends MouseAdapter {
        public void mouseClicked(MouseEvent me) {
            a++; //line 36
            objLabel1.setText(Integer.toString(a));
        }
    }
}

*

*Generally speaking, AWT is out-of-date (by some 15 years) and you really should be trying to use Swing or JavaFX instead.

*Buttons should use ActionListener, as a mouse is not the only way a button might be triggered

*You might like to have a read through Code Conventions for the Java TM Programming Language, it will make it easier for people to read your code and for you to read others

A: I just tried to make your code working. But there is some issues regarding the standard Java coding. But you should consider previous answers concerning the coding style.
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

public class Main {

public static void main(String[] args) {

    final Frame mainFrame = new OptionOne();
    Button button = new Button("Button");
    final Label label = new Label();

    label.setBounds(150, 220, 50, 30);
    label.setText("0");
    button.setBounds(40, 35, 50, 50);

    label.addPropertyChangeListener(label.getText(), new PropertyChangeListener() {
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            mainFrame.addNotify();
        }
    });

    button.addMouseListener(new MouseListener() {
        @Override
        public void mouseClicked(MouseEvent e) {
            int value = Integer.parseInt(label.getText());
            label.setText(String.valueOf(value + 1));
        }

        @Override
        public void mousePressed(MouseEvent e) {

        }

        @Override
        public void mouseReleased(MouseEvent e) {

        }

        @Override
        public void mouseEntered(MouseEvent e) {

        }

        @Override
        public void mouseExited(MouseEvent e) {

        }
    });

    mainFrame.add(label);
    mainFrame.add(button);
 }
}

class OptionOne extends Frame {

   OptionOne() {
    setTitle("Final Project Option 1");
    setSize(300, 300);
    show();
   }
}


text:
Q: Angular animate parent div of ng-view using element insde ng-view Is it possible to css animate a div (background-color) that is outside the ng-view, using a directive on a $state inside the ng-view?
The ng-view has css animations for the routing.
If I do not animate the div then the ng-view anims work fine, but..
If I add animation classes to the div(bgId) then the routing anims do not fire.
Here is a sample of html: (Button added as example - would normally be in the template pages eg. home.html / login.html )

        <ion-nav-view animation="slide-left-right">
        </ion-nav-view>

    <button swapcolour="changeColour()" data-nxtpage="1">change colour</button>

This is controlled by a directive(swapcolour) that gets the nxtpage value from the button attr and updates the colorVal in MainCtrl.
//MainCtrl.js
.controller('MainCtrl', ['$scope', '$state', function($scope, $state) {
    $scope.colorVal = 'redBg';
}])

//Directive.js
.directive('swapcolour', function ($rootScope, $state) {
    var pageArr = [{home:'redBg'},{login:'blueBg'}];

    return function (scope, element, attrs) {

        var nextPageNum = attrs.nxtpage;
        var obj = pageArr[nextPageNum];
        var item = Object.keys(obj);
        var objItem = obj[item];

        element.bind('click', function () {
            $state.transitionTo(item[0]);
            $rootScope.$$childHead.colorVal = objItem;
        });
    }
}])

I do not know why it fails. Any ideas?? I am new to directives. (Trying to setup a plunker, but having issues getting ionic working with it)

A: I fixed it! - I think.
Basically after totally stripping the application to its bones I managed to build a plunker and got it working.
There was nothing wrong with my code after all.

        <ion-nav-view animation="slide-left-right">
        </ion-nav-view>

http://plnkr.co/edit/Oug8zD?p=preview
Then I tried this code on my app - and it still did not work! So I tried replacing my ionic.bundle.js and ionic.css files (orig installed using npm) with the files used in the plunker (1.0.0-rc.1) and my app worked :)
Hope this helps others in trouble in the future.


text:
Q: mqtt_client does not publish immediately I am trying a trivial networking application where I have multiple nodes communicating using the publish subscribe model in paho-mqtt (mosquitto) in python.
The use case I want to model is a node has a certain job it needs to perform and it should acknowledge the receipt of a request to perform the job, and if the requesting node does not receive the acknowledgement in a certain time, it resubmits the request.
I start performing the job in the method designated for on_message event of mqtt_client
I have a following sort of code in my on_message method
# mqtt_client is the client object
# Job represents the job I need to start
# mqtt_topic is the topic the requester listens
def on_message(client, userdata, msg):
  request = msg.payload
  if "PERFORM" in request:
    mqtt_client.publish(mqtt_topic, "ACK", 2, False)
    job = Job()
    job.dispatch()

The job definitely requires an arbitrarily long time to complete.
The problem I am facing is that the "ACK" message is not sent immediately by the mqtt_client before starting the job, and it waits to be send until the job has finished. I tried publishing the "ACK" and dispatching the job on a different threads but ended up with same results.
Now because the requester thinks the request has timed out every time, I enter a loop of request and job dispatches.
I wanted to know if there is any way that I can have the "ACK" publish complete before I start with the job.


text:
Q: Destroying Instantiated Clone Components Breaks Original Game Object Components? Maybe im missing something obvious but to keep it short. I have working code for a character. When you "dash" I want to leave behind an after-image type effect, by cloning the player, removing its unneeded components and then applying a shader. Issue is as soon as I instantiate the clone the original player stops functioning (cant move etc). It still has all its components and everything as normal, and the clone does get the correct components removed. But it still breaks. As soon as I remove that line, its back to normal. Any ideas?
This is the only relevant code in the script that instantiates the clone.
private void DodgeEffect()
    {
        GameObject _DodgeSFX = Instantiate(gameObject, transform.position, transform.rotation );

        Destroy(_DodgeSFX.GetComponent<PlayerController>());
        Destroy(_DodgeSFX.GetComponent<PlayerCombat>());
        Destroy(_DodgeSFX.GetComponent<WarpController>());
        Destroy(_DodgeSFX.GetComponent<Animator>());
    }

A: its because you are making a copy of gameObject. while Instantiate() returns a GameObject, it also returns whatever you put into the first section of the method. instead, make a seperate gameObject than the player in the editor, and make _DodgeSFX public so you can put the copy into the slot. Then, just instantiate that seperate GameObject and you wont have to destroy the components through script(because you remove the components in the editor), saving time

A: Ok so from some testing I think its down to the Unity.InputSystem only allowing 1 instance of each Input to be enabled at once. When I instantiated a clone of the player, it still goes through the Enable/Awake functions before those components are destroyed, and since the Inputs on that clone were never disabled, that becomes the "main" one. If I set the main player's scripts with Inputs deactive and then active again, it all works as normal. Note that the script was still working on the main character just fine, it was only the inputs that was broken. Im still not sure why this is the case, if its a limitation of the input system, or intentional, cant seem to find documentation of this experience anywhere.


text:
Q: Debugging React code in VSCode when running Playwright tests Even if I run both my React (next.js) application and Playwright tests from VSCode, I am unable to debug code running in the browser. Is there any way to achieve this?
I think the problem is that when debugging a React app, VSCode launches it's own browser and hooks up to the remote debugging of that instance but Playwright creates a new browser for each test.
It looks like there may be ways of enabling remote debugging in the browser launched by Playwright or having Playwright connect to an existing browser instead of launching it's own but it's not clear to me which approach, if any, I should be attempting.


text:
Q: add custom fields in Elasticsearch indices while pushing logs from Fluentd we are using Fluentd to push kubernetes container logs to Elasticsearch. and we want to create indices on Elasticsearch in format of NAMESPACE_CONTAINERNAME. below is our config of record transformer and Elasticsearch outPut plugin.
      <filter kubernetes.**>
        @type record_transformer
        enable_ruby true
        <record>
          container_name ${record["kubernetes"]["container_name"]}
          namespace ${record["kubernetes"]["namespace_name"]}
          pod ${record["kubernetes"]["pod_name"]}
          host ${record["kubernetes"]["host"]}
          app ${record["kubernetes"]["labels"]["app"]}
        </record>
      </filter>

Elasticsearch Output:
    <label @OUTPUT>
      <match **>
        @type elasticsearch
        host "elasticsearch-master.default.svc.cluster.local"
        port 9200
        logstash_format true
        logstash_prefix ${namespace}_${container_name}
      </match>
    </label>

but when Fluentd pushing logs to Elasticsearch, indices getting created as ${namespace}_${container_name}-2021.02.25.
any suggestion or guidance on this most welcome. :slightly_smiling_face:

A: was able to make it work by adding buffer section.
    <label @OUTPUT>
      <match **>
        @type elasticsearch
        host "#{ENV['FLUENT_ELASTICSEARCH_HOST']}"
        port "#{ENV['FLUENT_ELASTICSEARCH_PORT']}"
        logstash_format true
        logstash_prefix ${namespace}_${container_name}
        <buffer tag, container_name, namespace>
          @type file
          path /var/log/${container_name}/app.log
        </buffer>
      </match>
    </label>


text:
Q: Browser Zoom level I know this post already exist but no one answer correctly.
I want to know how to change the browser zoom in JS
My first page : I zoom to 150% with ctrl +
I want to go to my second page : I click on a button 'second page'.
After this I have the 150% in my second page, how can I modify or set to default 100% my  second page.
What I know :
ZOOM propriety css is not what I want, it's the browser(opera,chrome,mozilla), same for scale propriety.
AccessKey permit to keypress on the keyboard but I want to click or touch to do the opposite like one click = ctrl +.
Thanks you
MT


text:
Q: Detecting Push Notification enabled with UIBackgroundModes configured in Info.plist this is my question:
I implemented this code for detected is user enabled or not Push Notification
if ([[UIApplication sharedApplication] isRegisteredForRemoteNotifications]) {
  NSLog(@"Yes, s(he) accepted Push Notification");
} else {
  NSLog(@"No, s(he) rejected Push Notification");
}

which, it works very well. But I had to implemented to receive silent Push Notification in background, so I added this code in my Info.plist
<key>UIBackgroundModes</key>
<array>
  <string>remote-notification</string>
</array>

Then, when I added this, the code that detected if user enabled or not Push notification always return TRUE, it doesn't matter if user enabled or not Push Notification. There is any way to detect only if the user enabled visible Push Notification (alerts in the top of the phone), allowing the UIBackgroundModes?

A: Is not [[UIApplication sharedApplication] isRegisteredForRemoteNotifications] correct to use. To know the decision of the user about Push notification is with
currentUserNotificationSettings
UIUserNotificationSettings *notificationSettings = [[UIApplication sharedApplication] currentUserNotificationSettings];

if (!notificationSettings || (notificationSettings.types == UIUserNotificationTypeNone)) {
      isEnabled = NO;
} else {
      isEnabled = YES;
}


text:
Q: OpenID + OAuth for Webapp and Desktop/Mobile application Authentication and Authorizaiton I'd like to use OpenID to authenticate users on my webapp -- similar to how StackExchange does it. I'd also like to enable users of my website to use my Desktop and Mobile Apps using the same account. I've read this requires OAuth (OpenID is purely website only).
What I don't know is

*

*Is this the correct approach?

*What would the workflow for this be?

*What data do I need in my database per user/OpenID? Do I store an "account" and then when they've authenticated with OpenID, I allow them to generate an OAuth Token for the mobile app?

In an ideal world, I would be able to have buttons similar to those on https://stackoverflow.com/users/login for both my WebApp and also in my Desktop and Mobile Apps which would simply allow users to login with their google or facebook account, is that possible? Simplicity for users is paramount, because my userbase will not take well anything remotely complex.
Can I use something like DotNetOpenAuth to provide all of this functionality?
Would a better solution be to break this up and allow users to authenticate to my site with OpenID and then I provide my own OAuth scheme for my desktop and mobile clients?

A: Probably the simplest mechanism is to embed a web view, and simply watch for navigation to a specific callback page and grab the authentication data that way. You should still be able to use OpenID for this.

A: What you should be looking into is Windows Identity Framework (WIF), it will work similarly for Web or Desktop applications using Claims-Based Identity.  You would store an authorization token for each user (along with any other information you need) and you would get it in the Authorization Header of an authenticated HTTP Request.  oAuth is the protocol for passing authorization requests and responses.  WIF is a .NET toolkit to simplify this interaction.
For more info, check out the WIF home page and the following blog (not mine):
http://msdn.microsoft.com/en-us/security/aa570351
http://blogs.msdn.com/b/vbertocci/

A: This is the workflow that I came up with, and so far I think its working well.
The user is required to authenticate to the website via third party OpenID/Facebook/etc (mobile friendly website is available). Then, in their "profile" they can generate an API "key" which they can copy/paste into their client software. It isn't 100% transparent to the user, but its pretty good.


text:
Q: Denominator in Jensen's inequality What is the intuition behind having a denominator in Jensen's inequality?
For example, why do we need $n$ in a version of Jensen's inequality when all weights are equal:
$$
\phi\left(\frac{\sum x_i}{n}\right)\leq\frac{\sum\phi(x_i)}{n},
$$
where $\phi$ is a convex function.

A: You can apply $\phi$ to the average of the $x_i$'s, or you can average the $\phi(x_i)$'s. Jensen says that the second way gives a larger value than the first, if $\phi$ is convex.

A: If you add $\frac 1 n $ $n$ times you get 1. This is crucial for Jensen's inequality. For example, $\phi (x)=x^{2}$ is convex but it is not true that $\phi (\sum x_i) \leq \sum \phi (x_i)$ in this case, as you can easily see by expanding $(\sum x_i)^{2}$.


text:
Q: How do you setup dependencies for production deploy when Babel is used in build script? My understanding is that Babel is used for compiling codes, so it makes sense to be placed at devDependencies.
But if I include Babel command in my build script and I would like to npm install --only=prod before npm run build at deploy stage (or Dockerfile).
Should I move Babel and related packages like plugins, preset into dependencies?

A: Just found out a reasonable solution.
If the project needs to be built by babel, then

our project is no longer considered the "front end app", but instead "the project that builds the front end app.

Therefore installing babel related dependencies in production is fine.


text:
Q: .NET Intercepted STDOUT from Python is always empty in Unity I'm trying to use a Python program to send a continuous stream of information from one program to another, like this question, but in byte form.
pythonPath and pythonScript are just the file locations of the script and python.exe.
C# code
public static void PythonKernel_Test() {
    Process pythonProcess = Process.Start(new ProcessStartInfo() {
        FileName = pythonPath,
        Arguments = pythonScript,
        RedirectStandardOutput = true,
        RedirectStandardInput = true,
        UseShellExecute = false,
        CreateNoWindow = true
    });
    Stream pythonStdOut = pythonProcess.StandardOutput.BaseStream;
    for (int i = 0; i < 1000; i++) {
        byte[] buffer = new byte[256];
        pythonStdOut.Read(buffer, 0, 256);
        Debug.Log(Encoding.ASCII.GetString(buffer) + Environment.NewLine + BitConverter.ToString(buffer));
    }
    pythonStdOut.Close();
}

Although this is in Unity, you could just substitute Debug.Log for Console.WriteLine().
However, even though I am spamming stdout with SYNC, nothing appears on the C# side. It does however, appear in the command prompt when ran from shell.
Python code
w = sys.stdout.buffer
while True:
    w.write(b"SYNC\n")
    sys.stdout.flush()

A: Here a working sample to try out
public static void PythonKernel_Test()
{
    var pi = new ProcessStartInfo
    {
        FileName = "python",
        Arguments = "test.py",
        RedirectStandardOutput = true,
        RedirectStandardError = true,
        CreateNoWindow = true,
    };
    var pythonProcess = new Process
    {
        StartInfo = pi,
    };

    pythonProcess.OutputDataReceived+= (s,e) =>
    {
        Console.WriteLine("OUT: {0}",e.Data);
    };
    pythonProcess.ErrorDataReceived+= (s,e) =>
    {
        Console.WriteLine("ERR: {0}",e.Data);
    };

    pythonProcess.Start();
    pythonProcess.BeginOutputReadLine();
    pythonProcess.BeginErrorReadLine();
    pythonProcess.WaitForExit();
}

It will read the output asynchronously
Taken from https://stackoverflow.com/a/29753402/1744164
test.py
import sys

while True:
    sys.stdout.write(b"SYNC\n")
    sys.stdout.flush()


text:
Q: Web.xml - not redirecting specific file or url to servlet I want to redirect all connections (/*) to a specific servlet, except a specific file (someFile.xml).
I have the following section in web.xml:
<servlet-mapping>
      <servlet-name>someServlet</servlet-name>
      <url-pattern>/*</url-pattern>
</servlet-mapping>

How can I modify it so that /someFile.xml will not be mapped to this servlet.
If I cannot do it using web.xml, is there some other way?

A: You can create a Servlet and map it to receive /someFile.xml.
    <servlet-mapping>
          <servlet-name>someServlet</servlet-name>
          <url-pattern>/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
           <servlet-name>SomeFileServlet</servlet-name>
           <url-pattern>/someFile.xml</url-pattern>
    </servlet-mapping>

In this way all request except /someFile.xml will go to someServlet and request for /someFile.xml will go to SomeFileServlet.
**/* mapping in web.xml it answers all requests except other path mappings.**


text:
Q: Seperate integers from 1 variable into different variables Not sure how to explain this the best but I have a variable with 4 int's in it. Is there a simple way to extract the 4 int's into 4 seperate var's?
Example:
The variable contains: 4567
And then the output is:
   var1 = 4
   var2 = 5
   var3 = 6
   var4 = 7

A: Another way can be:
val n = 4567
val (var1, var2, var3, var4) = "$n".map { it.digitToInt() }

Note that this will fail if number contains less than 4 digits.

A: You can do this:
val input = 4567

val var1 = input / 1000
val var2 = (input % 1000) / 100
val var3 = (input % 100) / 10
val var4 = (input % 10)


text:
Q: Null vector space in Minkowski space Let us consider a Minkowski space of the form:
$$ds^2 = -dt^2 + dx^2 + dy^2 +dz^2.$$
What would the linearly independent null vectors of this space be?
I am aware this is a trivial question but is something that has not been made clear to me and so causes me some confusion when reading some of the GR literature.

A: The light cone consists of all vectors $\mathbf V$ such that $\boldsymbol \eta(\mathbf V,\mathbf V) = 0$ (where $\boldsymbol \eta$ is the Minkowski metric).  In Cartesian coordinates $(t,x,y,z)$, this means that
$$\boldsymbol \eta(\mathbf V,\mathbf V) = -(V^t)^2 + (V^x)^2+(V^y)^2+(V^z)^2 = 0$$
or $$V^t = \pm \sqrt{(V^x)^2+(V^y)^2+(V^z)^2}$$
As mentioned by Javier in the comments, the set of null vectors is not a vector space, so it's not clear what you mean when you ask for the linearly independent null vectors.


text:
Q: Cyclic reference in Python C extension I have a Cython extension class that keeps a shared pointer to a C++ class. The class itself keeps a pointer to the Cython class.
cdef class A
    cdef shared_ptr[B] thisptr

    def __init__(Basic self, name, *args, **kwargs):
        self.thisptr = create_b(<PyObject*>self)

I need the python object to stay alive while thisptr is alive and thisptr to stay alive while the python object is alive. (C++ class B is designed so that it will increase the refcount of the python object it is storing when it is created and refcount is decreased once the C++ object is destroyed.) Note that thisptr maybe shared by other Python objects, but this class is the one creating the object.
This situation leads to a cyclic reference.
Is there a way to indicate to the python garbage collector to consider this a cyclic reference and free the python object if there is only one reference to it? (i.e. from the C++ object)


text:
Q: Fetching SQL data in R with parameters I would like to extract some data from a MySQL server. Therefore Im using the following code:
#connect to database
getPlayersHome <- dbGetQuery(con,"SELECT * FROM match_player_home WHERE match_id = 1;")

This works fine, however I would like include it in a function with a parameter. But if I do this:
getData <- function(selector){
   getPlayersHome <- dbGetQuery(con,"SELECT * FROM match_player_home WHERE match_id = selector;")

}

My query does not work (it returns everything). Any thoughts on what goes wrong here?

A: You are using the selector parameter incorrectly, as you wrote it selector it's interpreted as a literal. You can use sprintf to create the sql string passing parameters:
getData <- function(selector){
    sql <- sprintf("SELECT * FROM match_player_home WHERE match_id = %s", selector)
    rs = dbSendQuery(con, sql)
}

The string "%s" inside sprintf will be substitute by the value of selector.


text:
Q: Changing the value of a react input component with JS doesn't fire the inputs onChange event I have a range input that has a few things happening onChange.  This works as I'd expect with manual click/drag usage.  However, when I try to change the value with JavaScript, my onChange event doesn't seem to fire.
Here is my code:
const App = () => {
  const [currentValue, setCurrentValue] = useState(0);

  const setRangeValue = () => {
    const range = document.querySelector("input");

    range.value = 50;
    range.dispatchEvent(new Event("change", { bubbles: true }));
  };

  return (

Current Value: {currentValue}

      <input
        type="range"
        min={0}
        max={100}
        step={10}
        onChange={e => {
          console.log("Change!");
          setCurrentValue(+e.target.value);
        }}
        defaultValue={0}
      />

      <button onClick={setRangeValue}>Set current value to 50</button>

  );
};

And here it is (not) working in CodeSandbox:
https://codesandbox.io/s/divine-resonance-rps1n
NOTE:
Just to clarify.  My actual issue comes from testing my component with jest/react testing library.  The button demo is just a nice way to visualize the problem without getting into the weeds of having to duplicate all of my test stuff too.
    const getMessage = (value, message) => {
        const slider = getByRole('slider');
        fireEvent.change(slider, { target: { value } });
        slider.dispatchEvent(new Event('change', { bubbles: true }));
        return getByText(message).innerHTML;
    };

When the fireEvent changes the value, it doesn't run the onChange events attached to the input.  Which means that getByText(message).innerHTML is incorrect, as that will only update when a set hook gets called onChange.  (All of this works when manually clicking/dragging the input slider, I just can't "test" it)
Any help would be great!

A: The issue is that React has a virtual DOM which doesn't connect directly to the DOM. Note how the events from React are SyntheticEvents. They are not the actual event from the DOM.
https://github.com/facebook/react/issues/1152
If this is for a unit test, create a separate component for the slider and text and make sure they perform as expected separate from each other with props.
For a more in-depth article on how to specifically test a range slider, checkout https://blog.bitsrc.io/build-and-test-sliders-with-react-hooks-38aaa9422772
Best of luck to ya!


text:
Q: Is there a guide on porting edk2 to a new ARM64 platform? I am new to EDK2.
For porting ekd2 firmware to a new ARM64 platform, it would be good  to first get a minimum edk2 port which can run UEFI Shell at least, improvements can be added gradually based on that.
It seems that the first step is rather steep, e.g., how to determine a minimal set of "items" in .dsc and .fdf file for a platform? In my case, I would like to build the .fd for my platform and treat it as BL33 of TF-A, effectively I would like to build an edk2 firmware to replace u-boot.
It seems that such a guide is hard to find on the web. I found a old version of edk2 which contains some instructions, but apparently they are obsolete (not exist in latest master branch, while can be found in UDK branches such as UDK2014), and I am not sure why those documents are removed from master branch.
Currently I can build .fd for FVP (edk2-platforms/Platform/ARM/VExpressPkg/ArmVExpress-FVP-AArch64.dsc), and it seems that the build output FVP_AARCH64_EFI.fd is supposed to be treated as BL33. Theoretically this could be a prototype for my new ARM64 platform, but to me it's too complex to start with: the firmware is about 2.5MiB in size (as compare to 500K of u-boot), so I guess it's far from a "minimum" version. but it's hard to figure out what features to be removed (and how).
I am wondering if there is a detailed guide on such topic...

A: After 1 month of trial and error, today I managed to bring my ARM64 platform into a UEFI Shell environment. I treat it as my 1st milestone on the EDK2 journey. Below I will try to summarize the steps I took so far,  as a tentative answer to my question above. Guidance/corrections/comments are welcomed.

*Get familiar with UEFI/PI spec and EDK2 implementation by reading books/specs/articles. Well, UEFI/PI specs are thousands of pages long...how to start? My main reading list is:

*

*"Beyond Bios--Developing with the Unified Extensible Firmware Interface", 3rd ed, by Vincent Zimmer, et al. As the authors explained, the book is a kind of high level summary of the thousands-paged specs. And I find that the book is well organized for a new comer to get familiar with various UEFI related concepts.  The main purpose of the 1st read (before playing with edk2 code base) is to get familiar with concepts and architectural ideas, not the details yet. Related sections need to be consulted later when reading EDK2 implementations.

*EDK2 specs, including:

*

*EDKII User Manual

*EDKII Build Specification

*EDKII DSC/FDF/DEC/INF File Specification

*Various articles on the web...

*Get a reference platform which can correctly boot a FD image built from latest EDK2 source, and play with the boot manager and Shell environment a bit. In my case, I chose RPi4B. For me, this is very important, as the reference platform serves as a handrail during the whole process, that whenever I encounter bugs or have doubts, I check the source/log of the reference platform. This solves most of the problems I encountered. Btw, always generating "build log" and "build report" for both reference platform and the target platform, as the two files contains very detailed information for comparison and check. Consult the EDK2 build spec on how to generate these two files during build.
I use the following script to build for RPi4B platform:
#!/bin/bash

# https://github.com/tianocore/edk2-platforms#how-to-build-linux-environment

export WORKSPACE=/home/bruin/work/tianocore
export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms:$WORKSPACE/edk2-non-osi

pushd $WORKSPACE

rm -rf ./Build/RPi4

source edk2/edksetup.sh

echo "Building BaseTools..."
make -C edk2/BaseTools all

#sudo apt install acpica-tools    # iasl
# pip install antlr4-python3-runtime   # -Y EXECUTION_ORDER

echo "Building firmware for Pi4B..."
GCC5_AARCH64_PREFIX=aarch64-none-linux-gnu- build \
    -n 4 \
    -a AARCH64 \
    -p Platform/RaspberryPi/RPi4/RPi4.dsc \
    -t GCC5 \
    -b NOOPT \
    -v -d 9 -j RPi4-build.log \
    -y RPi4-build-report.txt \
    -Y PCD \
    -Y LIBRARY \
    -Y DEPEX \
    -Y HASH \
    -Y BUILD_FLAGS \
    -Y FLASH \
    -Y FIXED_ADDRESS \
    -Y EXECUTION_ORDER \
    all

How to use the build result RPI_EFI.fd on RPi4B, consult the following:

*

*edk2-platforms/Platform/RaspberryPi/RPi4/Readme.md

*readme.md inside https://github.com/pftf/RPi4/releases/download/v1.17/RPi4_UEFI_Firmware_v1.32.zip. btw, I need to replace the original start4.elf and fixup4.dat with the ones in the zip file, otherwise, the boot of RPi4 will fail, complaining something like below:
RpiFirmwareGetClockRate: Get Clock Rate return: ClockRate=0 ClockId=C
ASSERT [ArasanMMCHost] /home/bruin/work/tianocore/edk2-platforms/Platform/RaspberryPi/
Drivers/ArasanMmcHostDxe/ArasanMmcHostDxe.c(263): BaseFrequency != 0

*It's worth to analysis the RPI_EFI.fd content to some extend, by using some UEFI utilities. I mainly use the GUI version UEFITool of sudo apt install uefitool uefitool-cli. Other tools are also available. The anotomy of RPI_EFI.fd is of help when reading EDK2 build specs for checking understanding of the concepts.

*

*One special aspect of RPI_EFI.fd is that the 1st 128K is bl31.bin binary from ATF. I guess this is due to the special booting connfiguration methods for RPi. For my platform, I don't need such kind of packaging, I only need to build the UEFI image MY.fd, which is treated as BL33 image and packaged into fip.bin togehter with BL2 and BL31 images by ATF build script.

*Another aspect to notice is the "reset vector" in the begining of the .fd file. This related to the entry point of UEFI image (and entry point of each EDK2 modules), as well as interpreting the BL instruction for AArch64. Basically, it can be summarized as below:

The first [Components] in RPI_EFI.fd is ArmPlatformPkg/PrePi/PeiUniCore.inf, which is of MODULE_TYPE = SEC.

*

*What's this component: this is the first (and only) SEC (Security) module in RPi4. What the name PrePi and Pei implies?

... the PI spec is not tied to edk2 PEIMs, and I don't see where EDKII PEI modules are currently the only "acknowledged" silicon init environment. The edk2 tree itself seems to contain platforms that don't use the edk2 PEI module set at all, but (IIRC) jump from SEC to DXE. I believe "ArmPlatformPkg/PrePi" and "ArmVirtPkg/PrePi" are related to this.
--- https://listman.redhat.com/archives/edk2-devel-archive/2020-November/msg00021.html

*Its entry point: all UEFI components have the same entry point (_ModuleEntryPoint).

*

*By "component", it means either a UEFI driver and UEFI app, both are PE32 executables, usually with suffix .efi.

*The .efis are converted from ELF executables (.dll) by GenFw tool: modifying the file headers.

*To verify that "all components' entry point is _ModuleEntryPoint":

*

*Check the .dll generating command line in build report (build -y <BUILD_REPORT_FILE>), we have two flags "aarch64-none-linux-gnu-gcc" -o xxx.dll -u _ModuleEntryPoint -Wl,-e,_ModuleEntryPoint ...:

*

*-u: gcc --help -v|grep "undefined SYMBOL" gives -u SYMBOL --undefined SYMBOL: star with undefined reference to SYMBOL.

*Wl,-e: ld --help|grep "entry" gives -e ADDRESS, --entry ADDRESS Set start address.

*Check all .dll files that Entry point address == _ModuleEntryPoint: find . -type f -name "*.dll" -exec sh -c "readelf -a {} |grep -E 'Entry point address|_ModuleEntryPoint'" \;

*Its entry point is the entry point of whole UEFI FD image (i.e., from bl33_base_addr jump to this _ModuleEntryPoint):

Topology of the UEFI Firmware File
A UEFI Firmware File (actually a UEFI Firmware Device - FD file) is a collection of UEFI binaries encapsulated into a single image. The format of this image is defined by the Platform Initialization Specification Volume 3. A Vector Table is located at the base of this file. A 'BL' branch instruction at the base of the firwmare (location of the Reset Entry into the Vector Table) will jump to the first 'SEC' module of the UEFI Firmware Image.
--- https://github.com/lzeng14/tianocore/wiki/ArmPkg-Debugging

*

*To verify the statements above:

*

*Disassember the reset vector (i.e., the 1st word) of generated .FD (we got offset=0x360):
$ xxd -l 4 -e TEST.fd       <== dump 4 bytes in little endian
00000000: 140000d8          <== BL   {PC}+(0xd8<<2); offset=0x360

*Check the Entry point in .dll (we got offset=0x240):
$ aarch64-none-elf-objdump -t ArmPlatformPrePiUniCore.dll|grep _ModuleEntryPoint
0000000000000240 g     F .text  0000000000000000 _ModuleEntryPoint
$ readelf -h ArmPlatformPrePiUniCore.dll|grep Entry
Entry point address:               0x240

*Compare contents of two files at different offset (we got identicial content):
$ xxd -s 0x360 -l 64 TEST.fd                      <== skip 0x360 bytes, dump 64 bytes
00000360: 901e 0094 050a 0094 ea03 00aa a1cd 0a58  ...............X
00000370: 0200 e0d2 2200 c0f2 0240 a0f2 0200 80f2  ...."....@......
00000380: c303 a0d2 e3ff 9ff2 6304 00d1 6300 028b  ........c...c...
00000390: 0400 a1d2 0400 80f2 2000 03eb 8400 0054  ........ ......T
$ xxd -s 0x240 -l 64 ArmPlatformPrePiUniCore.dll  <== skip 0x240 bytes
00000240: 901e 0094 050a 0094 ea03 00aa a1cd 0a58  ...............X
00000250: 0200 e0d2 2200 c0f2 0240 a0f2 0200 80f2  ...."....@......
00000260: c303 a0d2 e3ff 9ff2 6304 00d1 6300 028b  ........c...c...
00000270: 0400 a1d2 0400 80f2 2000 03eb 8400 0054  ........ ......T

*Prepare an empty pkg, and make it build ok. The main purpuse is to do some exercise with EDK2 build system, and use the empty pkg as the start point for the new platform.

*

*Make a copy of RaspberryPi.dec, change all gRaspberry to gMyPlatform.

*Make a copy of RPi4.dsc and RPi4.fdf, and comment out all stuff in DSC and FDF file.

*Replace all GUIDs in DSC/FDF/DEC files, generating new ones using online guid generator.

*Note that PCD are declared in DEC files, and DEC files are refered by modules (INF files). As the empty package contains no module, no PCD definition will be available in FDF. So for a success build of the empty package, we need to comment out all PCD reference in FDF.

*The NOOPT build command for MyPlatform is as below:
#!/bin/bash

export WORKSPACE=/home/bruin/work/tianocore
export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms:$WORKSPACE/edk2-non-osi
pushd $WORKSPACE
source edk2/edksetup.sh

echo "Building BaseTools..."
make -C edk2/BaseTools all

echo "Building UEFI firmware for MyPlatform..."
GCC5_AARCH64_PREFIX=aarch64-none-linux-gnu- build \
      -n 4 \
      -a AARCH64 \
      -p Platform/MyCorp/MyPlatform/MyPlatform.dsc \
      -t GCC5 \
      -b NOOPT \
      -v -d 9 -j MyPlatform-build.log \
      -y MyPlatform-build-report.txt \
      -Y EXECUTION_ORDER \
      -Y PCD \
      -Y LIBRARY \
      -Y DEPEX \
      -Y HASH \
      -Y BUILD_FLAGS \
      -Y FLASH \
      -Y FIXED_ADDRESS \
      all
popd

*Add the 1st component ArmPlatformPrePiUniCore. This component is to prepare the HOBs for DXE phae. The main purpose is to get serial port working and memory config correct. Another purpose of this step is to familiar with steps for adding a component/module/lib. Below is a brief summary of the steps:

*

*Uncomment the module's INF into both DSC ([Components] section), and FDF ([FV.FVMAIN_COMPACT]).

*Rebuild the pkg, and resolve all Instance of library class [xxxLib] is not found errors reported, by updating [LibraryClasses] sections of DSC.

*

*This step is a repeating process for dozens of times.

*Some lib-class has multiple lib-instances, making sure choose the appropriate lib-instance (ref the build-report of RPi4).

*if encounter ModuleEntryPoint.iiii:31: Error: immediate out of range: enable gArmTokenSpaceGuid.PcdFdBaseAddress and gArmTokenSpaceGuid.PcdFdSize in FDF.

*if encounter undefined reference to _gPcd_BinaryPatch_PcdSerialClockRate: set PcdSerialClockRate in [PcdsPatchableInModule] section in DSC. FIXME: why? ref.

*Check the PCDs listed in build log: inspect any abnormal PCD values, and supply correct values.

*Customize platform-specific drivers or libraries.

*

*SerialPortLib: locate the lib-class header file (MdePkg/Include/Library/SerialPortLib.h) by find edk2 -type f -name "*.dec" -exec grep -Hn SerialPortLib. The following functions are required:

*

*SerialPortInitialize()

*SerialPortWrite()

*SerialPortRead()

*SerialPortPoll()

*SerialPortSetControl(): RETURN_UNSUPPORTED

*SerialPortGetControl(): RETURN_UNSUPPORTED

*SerialPortSetAttributes(): RETURN_UNSUPPORTED

*ArmPlatformLib: interface header at Include/Library/ArmPlatformLib.h. The following functions are required:

*

*ArmPlatformGetCorePosition(): return cpu idx in the cluster given the MPIDR value. this function is used in _ModuleEntryPoint for setting stack for secondary cores. Assuming one cluster for now.

*ArmPlatformIsPrimaryCore()

*ArmPlatformGetPrimaryCoreMpId()

*ArmPlatformGetBootMode()

*ArmPlatformPeiBootAction()

*ArmPlatformInitialize()

*ArmPlatformGetVirtualMemoryMap()

*ArmPlatformGetPlatformPpiList()

*etc...

*Uncomment more modules in DSC/FDF, module by module...For driver/libs which are RPi platform specific, we can:

*

*either search the edk2/edk2-platform for similiar driver or lib instances, or

*copy the RPi4 implementation and comment out most of the content, make the pkg build success first, and then bug fixing.

*Debugging: my current main debugging method is through adding "printf()", i.e., the edk2 macro DEBUG((DEBUG_INFO,)). One needs to set gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel to an appropriate value to see more debug info.


text:
Q: NuSoap operation not present in WSDL I must use a webservice made with Oracle, I tested all the examples I found of NuSoap but none work, the error I get is:

operation GetMsisdnPortabilityInfoRequest not present in WSDL

GetMsisdnPortabilityInfoRequest is the name of the action I must call, the request must look like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://www.tigo.com/GetMsisdnPortabilityInfoRequest/V1" xmlns:v11="http://www.tigo.com/Core/Common/Header/Request/V1" xmlns:v12="http://www.tigo.com/ParameterType/V1">
   <soapenv:Header/>
   <soapenv:Body>
      <v1:GetMsisdnPortabilityInfoRequest>
         <v11:RequestHeader>
            <v11:Consumer code="WEBTIGO" name="WEBTIGO">
            </v11:Consumer>
            <v11:Transport code="WS" name="WS">
               <v11:communicationType>SYN</v11:communicationType>
            </v11:Transport>
            <v11:Service code="1" name="1">
            </v11:Service>
            <v11:Message messageId="1" messageIdCorrelation="1" conversationId="1">
            </v11:Message>
            <v11:Country name="PY" isoCode="600"/>
         </v11:RequestHeader>
         <v1:requestBody>
            <v1:msisdn>0961123456</v1:msisdn>
         </v1:requestBody>
      </v1:GetMsisdnPortabilityInfoRequest>
   </soapenv:Body>
</soapenv:Envelope>

The only parameter I must send is msindn, my code looks like this:
require_once('lib/nusoap.php');

$url = "http://10.16.210.128/sbresource?PROXY/Portability/Gateway/PS/PS_GetMsisdnPortabilityInfo";
$headers_raw = '<v11:RequestHeader>
        <v11:Consumer code="WEBTIGO" name="WEBTIGO">
        </v11:Consumer>
        <v11:Transport code="WS" name="WS">
           <v11:communicationType>SYN</v11:communicationType>
        </v11:Transport>
        <v11:Service code="1" name="1">
        </v11:Service>
        <v11:Message messageId="1" messageIdCorrelation="1" conversationId="1">
        </v11:Message>
        <v11:Country name="PY" isoCode="600"/>
     </v11:RequestHeader>';

$body_raw_xml = '<v1:msisdn>0961123456</v1:msisdn>';

$client = new nusoap_client($url, true);

$err = $client->getError();
if ($err) {
  echo '
Constructor error

' . $err . '
';
  echo '
Debug

' . $client->getDebug() . '
';
  exit();
}

$result = $client->call('GetMsisdnPortabilityInfoRequest', $body_raw_xml, '', '',  $headers_raw, null);

if ($client->fault) {
  echo '
Fault (Expect - The request contains an invalid SOAP body)

'; print_r($result); echo '
';
} else {
  $err = $client->getError();
  if ($err) {
    echo '
Error

' . $err . '
';
  } else {
    echo '
Result

'; print_r($result); echo '
';
  }
}

echo '
Request

' . $client->request . '
';
echo '
Response

' . $client->response . '
';
echo '
Debug

' . $client->getDebug() . '
';

The complete WSDL is in https://gist.github.com/f55472fe9181856b30de
(The webservice is on a local network, not accessible outside, I have changed the original domains for "example" and "example2" to protect the innocent servers)
I have tried also this way, but always says operation GetMsisdnPortabilityInfoRequest not present in WSDL
$params = array('v1:msisdn' => $number);

$result = $client->call('V1:GetMsisdnPortabilityInfoRequest', $params, '', '', $headers_raw);

What I doing wrong?
I would like to know how I must send the request.
Thanks in advance!
Edit
The correct action name was "process" and the final code looks like this:
$raw_xml = '<v1:GetMsisdnPortabilityInfoRequest>
       <v11:RequestHeader>
          <v11:Consumer code="WEBTIGO" name="WEBTIGO">
          </v11:Consumer>
          <v11:Transport code="WS" name="WS">
             <v11:communicationType>SYN</v11:communicationType>
          </v11:Transport>
          <v11:Service code="1" name="1">
          </v11:Service>
          <v11:Message messageId="1" messageIdCorrelation="1" conversationId="1">
          </v11:Message>
          <v11:Country name="PY" isoCode="600"/>
       </v11:RequestHeader>
       <v1:requestBody>
          <v1:msisdn>' . $full_number . '</v1:msisdn>
       </v1:requestBody>
    </v1:GetMsisdnPortabilityInfoRequest>';

// cliente del soap
$client = new nusoap_client($url, true);

$err = $client->getError();
if ($err) {
  echo json_encode(array('status' => $err));
  exit();
}

// realizamos la consulta al webservice, nombre método consultado = process
$result = $client->call('process', $raw_xml);

A: Try calling only GetMsisdnPortabilityInfo and not GetMsisdnPortabilityInfoRequest or GetMsisdnPortabilityInfoResponse


text:
Q: CSS doesn't load Example:
This is my simple HTML document:
<!DOCTYPE html>

 Put an image anywhere in this box.

    <link href="john.css" text="text/css" rel="stylesheets.css">

This is my simple CSS document:
#left {
    float: left;
    width: 250px;
    height: 250px;
    margin: 5px;
    border: 3px solid blue;
}

#right {
    float: left;
    width: 250px;
    height: 250px;
    margin: 5px;
    border: 3px solid green;
}

The HTML loads in my firefox web-browser, but the css does not.I downloaded chromium as well and it doest work either. Ive checked many examples and I think I got it right. The question is...where do I look next to solve this problem. I have no clue where to start as I am not very educated with computers.

A: You weren't kidding around. You really are getting your ass kicked by stupid stuff.
It looks like you haven't linked in you stylesheet properly You need to link it in your  section - it won't work in the footer. Even if you moved what you have in your footer to your  it is malformed.
Take a look at this example:

<link rel="stylesheet" type="text/css" href="john.css">


text:
Q: Make a POST request with JQuery to c# .net rest API I am trying to make an ajax post request to a backend server that is built with .net framework. The backend is a REST API built with c# .net.
When i try to make a POST request with postman everything goes well, but when i try to do it with ajax, i dont get any data on the backend.
This is the C# code:
public Documento()
        {
            this.DocContabilidade = new Dictionary<string, string>()
            {
            };
            this.Linha1 = new Dictionary<string, string>()
            {
            };
            this.Linha2 = new Dictionary<string, string>()
            {
            };
            this.Linha3 = new Dictionary<string, string>()
            {
            };
        }
 public HttpResponseMessage Post([FromBody] Documento documento)
    {

        Console.WriteLine(documento);

        // (when I make the request with postman the var has data, when i do it with ajax its empty)
        .
        .
        var response = Request.CreateResponse(System.Net.HttpStatusCode.Created, "a");
        return response;
    }

when i try to send an object with postman, like I said it works well.
this is the postman data, its the same i send with ajax.
 {
        "doccontabilidade": {
            "ano": "2020",
            "doc": "411",
            "diario": "22",
            "mes": "09",
            "dia": "30",
            "moeda": "EUR",
            "modulo": "L",
            "descricao":"FT54011481",
            "num_doc_externo": "54011841"
        },
        "linha1": {
            "tipo_linha": "F",
            "conta": "211110001",
            "natureza": "C",
            "moeda": "EUR",
            "tipo_entidade": "F",
            "entidade": "FVD",
            "valor": "529,02",
            "valor_alt": "529,02",
            "valor_origem": "529,02",
            "descricao": "FT 9999",
            "lote":"1"
        },
        "linha2": {
            "tipo_linha": "F",
            "conta": "31211",
            "natureza": "D",
            "moeda": "EUR",
            "tipo_entidade": "F",
            "entidade": "FVD",
            "valor": "430,1",
            "valor_alt": "430,1",
            "valor_origem": "430,1",
            "descricao": "FT 9999",
            "lote":"2",
            "iva":"12132311"
        },
        "linha3": {
            "tipo_linha": "F",
            "conta": "24321132311",
            "natureza": "D",
            "moeda": "EUR",
            "tipo_entidade": "F",
            "entidade": "FVD",
            "valor": "98,92",
            "valor_alt": "98,92",
            "valor_origem": "98,92",
            "descricao": "FT 9965",
            "lote":"3"
        }
    }

this is the response from postman:
postman response
the ajax request is as follows:
var dados = {
    "doccontabilidade": {
        "ano": "2020",
        "doc": "411",
        "diario": "22",
        "mes": "09",
        "dia": "30",
        "moeda": "EUR",
        "modulo": "L",
        "descricao":"FT54011481",
        "num_doc_externo": "54011841"
    },
    "linha1": {
        "tipo_linha": "F",
        "conta": "211110001",
        "natureza": "C",
        "moeda": "EUR",
        "tipo_entidade": "F",
        "entidade": "FVD",
        "valor": "529,02",
        "valor_alt": "529,02",
        "valor_origem": "529,02",
        "descricao": "FT 9999",
        "lote":"1"
    },
    "linha2": {
        "tipo_linha": "F",
        "conta": "31211",
        "natureza": "D",
        "moeda": "EUR",
        "tipo_entidade": "F",
        "entidade": "FVD",
        "valor": "430,1",
        "valor_alt": "430,1",
        "valor_origem": "430,1",
        "descricao": "FT 9999",
        "lote":"2",
        "iva":"12132311"
    },
    "linha3": {
        "tipo_linha": "F",
        "conta": "24321132311",
        "natureza": "D",
        "moeda": "EUR",
        "tipo_entidade": "F",
        "entidade": "FVD",
        "valor": "98,92",
        "valor_alt": "98,92",
        "valor_origem": "98,92",
        "descricao": "FT 9965",
        "lote":"3"
    }
}

Ajax request:
$.ajax({
        url: "https://192.168.33.122:44395/api/movimento",
        type: 'POST',
        data: JSON.stringify(dados),
        dataType: 'application/json; charset=utf-8',
        success: function (response) {
            alert(response["resultado"])
        },
        failure: function (response) {[enter image description here][1]
            console.log('Erro');
        }
   });

and this is the response from ajax:
ajax response
I tried to send the data without the JSON.stringify but C# still cant detect anything.

A: The way I do it and is working is:
var dados= { dados: [... your elements ...]};

        $.ajax({
            type: 'post',
            url: 'Your-URI',
            data: JSON.stringify(dados),
            contentType: "application/json; charset=utf-8",
            cache: false,
            traditional: true,
            success: function (response) {
            alert(response["resultado"])
            },
            failure: function (response) {
                console.log('Erro');
            }
        });

or
$.ajax({
    url: "@Url.Action("Your-METHOD", "Your-Controller")",
    type: "POST",
    contentType: "application/json",
    data: JSON.stringify({ dados: Documento}),
    traditional: true,
    success: function(response) {
        response ? alert("Processing") : alert("Error");
    }
});

and in backend
[HttpPost]
public async Task<JsonResult> JsonResponseMessage(Documento doc)
.....

It is better if the document data structure is the same as the response data json.
You can convert the json response with JsonToSchemaC#
Hope it helps.


text:
Q: GCD of two polynomials In the code below I want to find Greatest Common Divisor of 2 polynomials.
Sometimes I am getting error on " return c.plus( (a.minus(b.times(c)).divides(b)) );". How can I fix it?
public Polynomial divides(Polynomial b) {
Polynomial a = this;

        if ((b.deg == 0) && (b.coef[0] == 0))
            throw new RuntimeException("Divide by zero polynomial");

        if (a.deg < b.deg) return new Polynomial(0,0);

        int coefficient = a.coef[a.deg]/(b.coef[b.deg]);

        int exponent = a.deg - b.deg;
        Polynomial c = new Polynomial(coefficient, exponent);
        return c.plus( (a.minus(b.times(c)).divides(b)) );
    }

 public Polynomial GCD(Polynomial b) {
            Polynomial a = this;
            Polynomial f = b;
            Polynomial x = a.minus((a.divides(f)).times(f));

            if (x.deg == 0 && x.coef[0] == 0) {
                return b;
            }
            return f.GCD(x);

        }

A: That runtime exception means: you created an endless recursion.
Most likely, because your method divides() is calling itself on that last row - without proper checking in there to avoid that recursion.
In other words: you want to review your maths and the logic in there to simply avoid that divides() keeps calling itself without any limits!


text:
Q: BigQuery imports - CS file not found Our system runs BQ csv file (~8Mb) import from CS every 10 minutes. But today at least 4 times error occured: "Not found: Google Storage File ...". I've double checked the file on CS and download it with no problems. I've tried to (re)start BQ import (job_610b149c0d9041b7a3145ee245b80653), got "not found..." again. All other imports (hundreds of them) are just fine.
We're using GAE (java) for staging csv files on CS and then triggering import jobs (GAE -> CS -> BQ). In general system works fine but it's not very reliable. So, I'm fighting with gaps (missing data) or sometimes duplicates almost every day. Are there any other ways (good practices) of importing "constant flow" of data into BQ? Streaming?
Once we have data in BQ table, things become much easier. BigQuery is really great product! Thanks, sasa

A: This should be fixed. There was a configuration issue that caused some Cloud Storage files to be inaccessible between around 5 PM last night and 10:15 am this morning (PST). Please ping this thread if you have any further issues.


text:
Q: Primefaces 2.2.1 to 3.0.1 Upgrade Issue with Mapping/Locating Spring Managed Beans Background:
I'm using the below two classes (Search.java and SearchBean.java) in a Primefaces web application (version 2.2.1). All of my classes in the com.actions package are request scoped beans that handle the business logic in my application (actionListeners, Listeners, etc).  The classes in the com.beans package are all session scoped beans that maintain state about the application. Each request scoped has an instance of a session scoped bean injected using CDI and each are managed by Spring.
Issue:
When I upgraded to 3.0.1 the classes are not getting registered by Primefaces and I get an error message like Property 'test' not found on type com.actions.Search.  This happens on every single method that's mapped from a Primefaces component to either the request or session beans below. Any ideas on what are the appropriate changes?
Exception:
javax.el.ELException: /WEB-INF/facelet/components/test.xhtml: Property 'process' not found on type com.actions.Search
com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:94)
    com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
    com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
    javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
    javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:853)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
    javax.faces.component.UIComponent.encodeAll(UIComponent.java:1655)
    com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:399)
    com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
    org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:115)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    com.dc.api.service.impl.CacheControlFilter.doFilter(CacheControlFilter.java:31)
    com.dc.api.service.impl.HttpsCookieFilter.doFilter(HttpsCookieFilter.java:46)

Class that handles business logic and holds an instance of a session scoped bean
package com.actions;

import javax.inject.Inject;
import javax.inject.Named;
import org.springframework.context.annotation.Scope;
import com.beans.SearchBean;

@Named
@Scope("request")
public class Search{
    @Inject
    private SearchBean searchBean;

    public void process() {
        //business logic here
        searchBean.get...
    }
}

Bean that maintains data in session state
package com.beans;

import javax.inject.Named;
import org.springframework.context.annotation.Scope;

@Named
@Scope("session")
public class SearchBean {
    private String text="test";
    //getters and setters
}

The below alternate approach also is not working (just using one bean):
package com.actions;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component
@Scope("session")
public class Search {

    public void sessionIdleListener() {
    }
}

A: The issue was resolved by providing the new Primefaces 3.0.1 namespace of xmlns:p="http://primefaces.org/ui" as it had changed from the former version of xmlns:p="http://primefaces.prime.com.tr/ui"


text:
Q: Comparing notions of $A_{\infty}$ homotopy (in char 0): Markl's definition versus "Sullivan homotopy" Suppose that we have $A_{\infty}$ algebras $A,B$ (over a field of characteristic $0$), with $A_{\infty}$ maps $f,g: A \rightarrow B$. In the paper https://arxiv.org/abs/math/0401007 (top of page 4, item $(6)$) Markl defines a notion of $A_{\infty}$ homotopy, which can analogously be used to define a homotopy between maps $f$ and $g$. At least over characteristic $0$, there is a competing definition of a homotopy, defined as an $A_{\infty}$ morphism $H: A \rightarrow B \otimes \Omega^{\bullet}_{[0,1]}$ such that $H|_{t = 0} = f$ and $H|_{t =1} = g$.
Supposedly, in this context, the two definitions are equivalent. How can do I go from Markl's definition to the other definition?
Thank you for your time!

A: $\newcommand{\dd}{\mathrm d}$Markls notion is the same as an $A_\infty$-morphism from $A$ to $B\otimes C^\bullet_{[0,1]}$, where the second factor are the cellular cochains on the interval with (non-commutative!) dga structure defined via the Alexander-Whitney map. The two notions are then related by producing $A_\infty$-morphisms between this dga and $\Omega^\bullet_{[0,1]}$. At least the $A_\infty$-morphism from forms to singular cochains can be written down explicitly via so-called iterated integrals, compare this question I asked a while ago. There are still a lot of combinatorics involved, eg in finding the inverse $A_\infty$-morphism and taking tensor products of $A_\infty$-algebras.
Two recent articles which discuss generalisations of this question are Mazuir's Higher algebra of A∞ and ΩBAs-algebras in Morse theory II and Robert-Nicoud and Vallette's Higher Lie Theory.


text:
Q: php framework help Ok so before anyone states the fact that the php framework question has already been answered, note that I am asking questions specifically on which framework would be best given the requirements that I am providing. I am currently in the proccess of building a large project. I will be in the future working on several medium/large and a few small projects. I am an experienced php developer and fully know OOP inside and out and have a great knowledge of mysql database so learning a system is not a problem.
Now that is out of the way down to what I am actually looking for. I have currently been using a "framework" that is not so great and was provided to me for my projects. I would like to get rid of the "framework" and actually start using an actual framework. I was thinking of building my own framework but was considering (and really leaning towards) using an already preexisting framework. I have looked at a bunch of frameworks and even played with a few of them out there. Once I choose a framework I am going to want to keep using it and not have to switch 6 months down the road so before I choose I will be doing some thorough testing before making the final decision. I would like to get some input from some users as to which ones would fit my needs best.
In a framework I am looking for the following items:

*

*Speed - because of being larger projects I will need to keep speed in mind. I can write efficient code but if the framework is slow it really wont matter now will it :)

*Authentication - I would like to be able to use some built in authentication if possible through the framework. I dont necessarily need granular permissions based on users but more or less through groups (granular permissions is not a turn off just not a requirement).

*Ajax - I like to use ajax in my applications so I would like some kind of ajax implementation in the framework and personally I prefer jquery. It doesnt necessarily need to have built in ajax features but a way to kill the page with the ajax output before anything is output for efficiency.

*Forms - I have seen that alot of frameworks have built in features for managing forms but just thought I would mention it here to save myself the headache.

*Administration - This is possibly one of the most required features that I really need. I need to be able to create a backend to manage the site. I dont want to have to hack something together to make this work.

*Api - I will be in need of an api for accessing/modifying data that I will be allowing.

*Database - Built in database methods. Doesnt necessarily need to do it automatically, just give me access to be able to retrieve/update the data that is need.

These are not neccessarily requirements but more or less nice features:

*

*I would like to be able to encase all of my data that goes with a certain item into a "module" of a sort. So that I could easily copy it to another site and have it all ready to go.

*An easy to navigate structure. I would like to be able to go into controllers and not see 50 files but instead see maybe 10 folders with the files encased in the folders so that it is better separated.

I cant really think of anything else at this time but if I think of anything else I will update the post. I would really like to get feedback from people who are using any frameworks out there. If you havent messed with a framework please do not recommend it as you have no experience with it and will not know if it would suit my needs. Any help is appreciated.
EDIT:
I just wanted to edit this post to clarify some stuff. In the requirements/features that I am looking for I do not necessarily need all of the features to be built into the framework. From some of the responses it seemed as if people were thinking that all of this stuff has to be pre-ready. I more or less am looking for a framework that supports all of the features that I am looking for that is easily accomplished with the components in the framework. For example the administration, it does not have to have a default administration area but allow for me to create an administration easily from the components that I will be adding to the site.

A: From my own experience ( CodeIgniter , Zend Framework ), but realy all major frameworks will allow you to do everithing you asked .

*

*Speed - CodeIgniter is the fastest i worked with , this is not the strongest feature of ZF , in fact where i work we all got to the conclusion that ZF is slow .

*Auth - Zend Framework handles auth better than what i saw in other frameworks

*Ajax - All major Frameworks will allow you do disable the layout/view , Zend is slightly better here , as you can have special json views.

*Forms - CodeIgniter framework handles forms easyer than ZF , however all frameworks should deal with this problem with ease . Symfony needs to be mentioned here with it's form generator .

*Administration - Symfony just becouse it has a nice crud form generator based on the tables you're passing ( "admin generator" how they are advertising it ) , witch will speed development quite a bit .

*???

*Database - ZF handles databases nicer in my opionion , however i've heard good things about Symfony too . CodeIgniter here is not that strict witch is not a good thing in my opinion .

*Modular App - Building modules in ZF is realy easy , and the feature that i like most is that a module structure looks like the whole app itself ( eg. the whole app is a module ... )

*Easy to navigate structure - All of them once you are used to it , however i don't like the fact that CodeIgniter keeps all it's controllers in one place , when in ZF you can add modules and separate things from one and another .

A: Well, I worked with several PHP frameworks in the past and there aren't many good frameworks. You could risk a look at Zend Framework

*

*ok

*ok (but not enterprise level)

*ok, but dojo

*complicated

*no, its a framework, not an application

*ok, but not really a ERM

*encapsulates PDO in an ugly way (bad implemented factory pattern)

ZF is developed by Zend itself, but I wasn't really happy with that too, because it has a lot of shortcomings (cruel DBAL, complicated form handling, supports dojo instead of jQuery) and if you are used to Java/JBOSS or .NET it just sucks (only mentioning this because you are planning a big project).
If you have some time until your project needs to be deployed and if you dont need to start immediately, you could also try FLOW3 (still alpha) which is developed by the TYPO3 Team. I've played a little bit with FLOW3 and can say that it is the only PHP FW which has at least a good architecture and some good ideas/paradigms (AOP e.g.).
If I understand you in the right way you would need something like a CMS for your backend. Maybe it would be a good idea to evaluate exiting CMS's and check out if you could extend them (use the CMS as framework (TYPO3 e.g.)).
You wont find a FW that matches exactly your needs, therefore you should consider choosing a CMS/FW and customize it in the way you need it. If the project is as big as I imagine there should be enough resources for such task.


text:
Q: Edge Detection, Matlab Vision System Toolbox I have several images where I need to find an edge. I have tried following the vision.EdgeDetector System object in matlab, and the example they give here:  http://www.mathworks.com/help/vision/ref/vision.edgedetectorclass.html
They give the example
    hedge = vision.EdgeDetector;
    hcsc = vision.ColorSpaceConverter('Conversion','RBG to intensity')
    hidtypeconv = vision.ImageDataTypeConverter('OutputDataType',single');
    img = step(hcsc, imread('picture.png'))
    img1 = step(hidtypeconv, ing);
    edge = step(hedge,img1);
    imshow(edges);

Which I have followed exactly in my code.
However this code doesn't produce all the edges I would like, it seems as though Matlab can only pick up on about half of the edges in the entire image. Is there a different approach I can take to finding all the edges, or a way to improve upon the vision.EdgeDetector object in Matlab?

A: By default hedge = vision.EdgeDetector has a Threshold value of 20. Try changing it to hedge = vision.EdgeDetector('Threshold',Value) and play with value to see what value works out the best for you.

A: Try:
imgGray = rgb2gray(imgRGB);
imgEdge = edge(imgGray,'canny');

This should give you most of the edge points, if not, then change parameters THRESH and SIGMA accordingly. Also check the following for other methods:
help edge

You do not have to use vision.EdgeDetector system, somethings are easier without them! ;)


text:
Q: Does $.ajax substitute $(document).ready(function()? I 've made a thorough search, however I cannot find something clear about my assumption. I 've used the following code:
<?php
session_start();
if (isset($_SESSION['valid_user']) && $_SESSION['from']==1)
{
 ?>
    <script type="text/javascript">
        $.ajax({
        method:"POST",
        dataType: 'json',
        url:"user.php",
        success: function(newdata) {
             if (newdata == "nothing")
            {
               var temp1 ="no data!";
               $("#results_ribbon").text(temp1);
               return;
            }
            var temp1 ="You have: ".concat(newdata);
            $("#results_ribbon").text(temp1);
        }
    });
  </script>

which is part of a php file. The HTML code which builds the DOM follows after the above code...
So, I'd expect div with id="results_ribbon" not to have the right content since #results_ribbon does not exist, yet. However, everything works fine. This led me to assume that $.ajax call waits to be executed after DOM loading. Am I right? If not why the above happens?

A: No, it's not correct. Actual Ajax request starts immediately after your call it.
But success callback will fire after a while when it gets the server response.
By that time you already have your #results_ribbon loaded in DOM.

A: Ajax requests do not immediately return a result, there is a delay. This delay may or may not be long enough for your "results_ribbon" div to be created.
To be sure, just wrap the ajax call in $(function(){ (...) }); which is shorthand for $(document).ready.


text:
Q: How to complete a Search in NetSuite using Java API? I have a jar file nsws-2014_1.jar with the bindings for using Netsuite's web services.  I am reading through their examples in the pdf which they have provide online, but the search or querying is confusing.  I would like to complete a query that someone has done in perl, but in java. Can someone help me out?
my $query = {
    basic => [
        { name => 'customFieldList', value => [
                {
                    name => 'customField',
                    attr => {
                        scriptId => 'custentity_hexid',
                        operator => 'is',
                        'xsi:type' =>         'core_2013_2.platform:SearchStringCustomField'
                    },
                    value => $json->{'ServiceOrder'}->{'Id'}
                },
            ],
        },
    ],
};

A:   CustomerSearch customerSrch = new CustomerSearch();
  CustomerSearchBasic customerSrchBsc = new CustomerSearchBasic();

  SearchStringCustomField custentity_externalid =  new SearchStringCustomField();
  custentity_externalid.setInternalId("1015");
  custentity_externalid.setSearchValue(externalID);
  custentity_externalid.setOperator(SearchStringFieldOperator.is);

  SearchCustomFieldList searchCustomFieldList = new SearchCustomFieldList();
  SearchCustomField[] SearchCustomFieldArray = {custentity_externalid};
  searchCustomFieldList.setCustomField(SearchCustomFieldArray);
  customerSrchBsc.setCustomFieldList(searchCustomFieldList);
  customerSrch.setBasic(customerSrchBsc);

  SearchResult searchResult = _service.search(customerSrch);


text:
Q: Pullback connection and curve My teacher defined the pullback bundle and gave me an example:

Let $\gamma:(-1,1) \to \mathbb{R}^2$ be a smooth curve. Then for $w \in \Gamma(\gamma^*T_p{\mathbb{R}^2})$, the pullback connection is
  $$\nabla_{\frac{\partial}{\partial x}}w = \text{directional derivative along curve}$$

Can someone explain this? So this is the directional derivative of $w$ along $\frac{\partial}{\partial x}$? What would such a $w$ look like?

A: The term 'directional derivative' needs to be replaced by the term 'covariant derivative'. Directional derivatives take functions as second inputs, but in this discussion, we are taking vector fields, such as the vector field $ w $ mentioned by the OP when stating the problem, as second inputs (I am using the convention $ {\nabla_{\text{First input}}}(\text{Second input}) $). We thus need an appropriate generalization of the concept of a directional derivative, and that leads one to the concept of a covariant derivative (an affine connection).
According to the definition of a pullback connection, the $ \gamma $-pullback to $ (-1,1) $ of an affine connection $ \nabla $ on $ \mathbb{R}^{2} $, hereafter denoted by $ {\gamma^{*}}(\nabla) $, satisfies the following relation:
$$
(\star) \quad {[{\gamma^{*}}(\nabla)]_{\frac{\partial}{\partial x}}}({\gamma^{*}}(X)) = {\gamma^{*}} \left( {\nabla_{{d \gamma} \left( \frac{\partial}{\partial x} \right)}}(X) \right) = \gamma^{*} \left( {\nabla_{\gamma'}}(X) \right).
$$
The expression at the right end is the $ \gamma $-pullback of the covariant derivative of $ X $ with respect to $ \gamma' $ (the vector field along $ \gamma $), and I have used the fact that $ \left[ {d \gamma} \left( \dfrac{\partial}{\partial x} \right) \right]_{x} = \gamma'(x) $ for all $ x \in (-1,1) $. Hence, your statement could be more precisely phrased as
$$
{[{\gamma^{*}}(\nabla)]_{\frac{\partial}{\partial x}}}({\gamma^{*}}(X)) = \text{The $ \gamma $-pullback of the covariant derivative of $ X $ along $ \gamma $}.
$$
The most important thing to observe is that in ($ \star $), the pullback connection $ {\gamma^{*}}(\nabla) $ is not defined for all vector fields on $ (-1,1) $, but only for vector fields that have been pulled back from those on $ \mathbb{R}^{2} $. In other words, $ {\gamma^{*}}(\nabla) $, as it currently stands, is defined only for elements of $ {\gamma^{*}}(\Gamma(T \mathbb{R}^{2})) $. However, $ {\gamma^{*}}(\nabla) $ can be extended so that it is defined for all sections of the pullback tangent bundle (i.e., defined for all $ s \in \Gamma({\gamma^{*}}(T \mathbb{R}^{2})) $), and such an extension can be shown to be unique. There is a need to extend because we only have $ {\gamma^{*}}(\Gamma(T \mathbb{R}^{2})) \subseteq \Gamma({\gamma^{*}}(T \mathbb{R}^{2})) $ but would like the pullback connection to be defined for all sections of the pullback tangent bundle. In the end, we require $ w $ to be a section of $ {\gamma^{*}}(T \mathbb{R}^{2}) $ and not an arbitrary vector field on $ (-1,1) $.
Now, one may be wondering why $ \nabla $ accepts $ \gamma' $ as first input although it is a vector field that is defined only on the image of $ \gamma $. Do we not need the first input of $ \nabla $ to be a vector field defined on all of $ \mathbb{R}^{2} $? How then can $ \gamma^{*} \left( {\nabla_{\gamma'}}(X) \right) $ be a well-defined object? The reason is as follows: If we extend $ \gamma' $ to two different vector fields $ Y_{1} $ and $ Y_{2} $ on $ \mathbb{R}^{2} $, then the point derivations $ [{\nabla_{Y_{1}}}(X)]_{p} $ and $ [{\nabla_{Y_{2}}}(X)]_{p} $ at any point $ p \in \text{Im}(\gamma) $ must be identical (this is a basic fact about affine connections in differential geometry). It thus follows that for all $ x \in (-1,1) $,
\begin{align}
\left[ \gamma^{*} \left( {\nabla_{Y_{1}}}(X) \right) \right]_{x}
&= \left[ {\nabla_{Y_{1}}}(X) \right]_{\gamma(x)} \quad (\text{By the definition of $ \gamma^{*} $.}) \\
&= \left[ {\nabla_{Y_{2}}}(X) \right]_{\gamma(x)} \quad (\text{By the preceding comment.}) \\
&= \left[ \gamma^{*} \left( {\nabla_{Y_{2}}}(X) \right) \right]_{x} \quad (\text{By the definition of $ \gamma^{*} $ again.})
\end{align}
Therefore, $ \gamma^{*} \left( {\nabla_{\gamma'}}(X) \right) $ is indeed a well-defined object.


text:
Q: Interpolate temperature time series onto a pressure grid I have a time series with corresponding temperature and pressure values and I want to plot each temperature value at the corresponding pressure value while keeping the time series order.
I tried to interpolate the temperature values onto a pressure grid as follows,
%Lets say
T = temperature  (23583 x 11);
P = pressure     (23583 x 11);
t = time         (23583 x 11);
PO=min(min)(P):1:max(max)(P); (1x52) %PO=pressure grid

Tinterp=interp1(P,T,PO);
Gives the error:
Error using griddedInterpolant
The grid vectors must contain unique points.
Error in interp1 (line 149)
F = griddedInterpolant(X,V,method);
I know I have to run the interp1 function in a loop that cycles through all my columns.
n=23583
for i=1:n
    TO(i,:) = interp1(P(i,:),T(i,:),PO)
end

But this has sent matlab running a continues loop for hours. Can someone explain what I'm doing wrong please.
I want to create a filled contour plot with PO on the Yaxis and time on the x axis and TO as my Z value.

A: Try removing the duplicates by using unique function,
T = randi([0 25],1,23583); % random temperature values
P = randi([800 1000],1,23583); % random pressure values
t = [1:1:23583]; % time
PO=min(P):1:max(P); %PO=pressure grid

[P, index] = unique(P);
Tinterp=interp1(P,T(index),PO);