text:
Q: How to read a file in Play Framework 2.2.1? I have a static file that I want to read in one of my Play Framework models. The file contains some simple text in it. I can't find any examples or API that shows where the appropriate location is to store such a resource and second, how to access that resource. For whatever it is worth I'm using Play for Scala, but I don't think that's relevant here.

A: There is no real designated location where data files should go. I usually set a path in my application.conf and then read it in the application via
Play.application().configuration.getString("my.data.path")

If you want to store it somewhere inside your Play application's directory, you can get its root path via
Play.application().path()

which returns a java.io.File.
For reading files, there is no Play-specific technique. This question has been asked and answered before. In short, to read a small text file, just do this:
val lines = scala.io.Source.fromFile("file.txt").mkString

A: You can place any resource file in the folder /conf and load it (Programatically) as explained here: Custom configuration files - Play! Framework 2.0

A: I have answered to a similar question at https://stackoverflow.com/a/37180103/5715934. I think the same answer will be applied for you too.
You can choose a location you prefer other than in dedicated folders for some specific tasks. For an example you can create /resources folder. Don't make any resource folder inside /app folder since it is only a location to store code. Same goes with other specific folders. Then you can use
import import play.Play;
    Play.application().getFile("relative_path_from_<Project_Root>);

to access the file inside your code.
Only this will work perfectly on dev environment. But once you put this in production using the dist file it will not work since the entire resources folder you put will not be added to the dist. In order to do that, you have to explicitly ask play to add the /resources folder to your dist also. For that what you have to do is go to your /build.sbt and add these lines
import com.typesafe.sbt.packager.MappingsHelper._
    mappings in Universal ++= directory(baseDirectory.value / "resources")

Now if you take and check your dist, you can see it has an additional folder 'resources' inside the dist. Then it will work for the production environment also.


text:
Q: Inline bash program has incorrect mv usage In my current directory, I have multiple subdirectories that contain files. I'm trying to move those files from the subdirectories to my current directory. To this end, I've created this inline bash program:
for i in */ ; do for j in $f* ; do mv "$i$j" $PWD ; done ; done
When I run this program, however, I'm prompted by the correct use format:
usage: mv [-f | -i | -n] [-v] source target
       mv [-f | -i | -n] [-v] source ... directory

I'd appreciate any clarification as to why this is happening.
Thanks!

redpajama_set_name: RedPajamaStackExchange


text:
Q: Woocommerce load an external page on thankyou page I am using an SMS API to send sms to customer on Thankyou page of woocommerce. The API redirects to the API provide's page after sending the SMS. I asked them for a solution, they suggested to use the iframe. But the redirection exists. Then, they suggested to call variables from page checkout. I am unable to understand. Kindly, guide me. Here, is my code.
function tz_send_message_to_customer($order_id){

$order = new WC_Order( $order_id );
$currency = $order->get_order_currency();
$total = $order->get_total();
$date = $order->order_date;
$name = $order->billing_first_name . $order->billing_last_name;

// Configuration variables
$id = "xxxxx"; // Account Username
$pass = "xxxx"; // Account Password
$mask = "xxxx"; // Account Masking

// Data for text message
$to =  $order->billing_phone; // Recipient Number with "92" Pakistan Code
$message = urlencode("Dear " . $name . "!" . "Your following Order is Under Process" . "Order ID: " .$order_id . "Total: " . $currency.$total.  "Thankyou For Shopping") ;

// Prepare data for POST request - DO NOT EDIT
$data = "id=".$id."&pass=".$pass."&msg=".$message."&to=".$to."&lang=English"."&mask=".$mask."&type=xml";

// Send the POST request with cURL - DO NOT EDIT
//header("location:http://ip-address/api/sendsms.php?".$data);
$url = "http://ip-address/api/sendsms.php?".$data;
?>
<iframe src="<?php echo $url; ?>">
<?php
}

add_action( 'woocommerce_thankyou', 'tz_send_message_to_customer', 10, 1 );

A: I have found the solution by searching on Google. It was suggested that use sandbox attribute in iframe like  sandbox="allow-same-origin". So, the iframe code looks like as
<iframe src="<?php echo $url; ?>" sandbox="allow-same-origin" style=" display: none;">

More info can be found at: https://www.html5rocks.com/en/tutorials/security/sandboxed-iframes/


text: Q: Random GameObjects Comes Wrong Rotate I try to do a 3d android game in Unity with c#. I put random barriers and code is works well. But problem is the barriers rotate comes wrong, I want to see from the front but they are coming from the side. How can I rotate them front? And how to fix overlap two barriers?


text:
Q: How to select/deselect all checkboxes in a certain row in excel if there are other checkboxes in the worksheet? Since I already have a button for all the checkboxes in the worksheet, I want to assign a button for each column that will select and deselect all the checkbox in that column.
This is what I did for Selecting all the checkboxes in the worksheet and it worked

Dim cb As CheckBox

For Each cb In ActiveSheet.Checkboxes

    If cb.Name <> ActiveSheet.Checkboxes("Check Box 69").Name Then
        cb.Value = ActiveSheet.Checkboxes("Check Box 69").Value
    End If

Next

End Sub

A: Checkboxes have a TopLeftCell property which you can use:
Sub TT()

    Dim cb As CheckBox, cb69 As CheckBox

    Set cb69 = ActiveSheet.CheckBoxes("Check Box 69")

    For Each cb In ActiveSheet.CheckBoxes

        If cb.TopLeftCell.Column = 3 And cb.Name <> cb69.Name Then
            cb.Value = cb69.Value
        End If

    Next

End Sub


text:
Q: how to set custom SIP user agent in android? I am developing a SIP application. When I am registering on a SIP server through my android application the default user agent displayed by android on asterisk server is SIPAUA/0.1.001. How do I change that? I have searched on the Internet couldn't find anything? Is there any method in android to change it? Resources which I use is

*

*asterisk 1.8.7.1

*android 2.3.3

A: You can specify that value, using User-Agent header field in your REGISTER method.
See section 20.41 of the SIP RFC.
Example body of REGISTER method, which contains User-Agent header field:
Session Initiation Protocol
    Request-Line: REGISTER sip:192.168.16.40 SIP/2.0
        Method: REGISTER
        [Resent Packet: False]
    Message Header
        Via: SIP/2.0/UDP 192.168.16.181:32262;branch=z9hG4bK-d87543-624dc77d9c1b9618-1--d87543-;rport
        Max-Forwards: 70
        Contact: <sip:11@192.168.16.181:32262;rinstance=9dd2c78e6ac0a5a5>
        To: "soft 2"<sip:11@192.168.16.40>
        From: "soft 2"<sip:11@192.168.16.40>;tag=394aa21c
        Call-ID: YjYzYTAyNzM0NGVkYmEzZWMyMzJmNzMzNDZjMzIyMjg.
        CSeq: 1 REGISTER
        Expires: 3600
        Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
        User-Agent: X-Lite release 1011s stamp 41150
        Content-Length: 0

EDIT:
This code should be in your application, not on the server.
You should implement or use a ready SIP Stack.
Popular free SIP Stack libraries are - MjSip and Doubango - a lot of open source software SIP Clients (phones) use them.
Basically in the SIP Stack you have a class for each header field (according to the RFC) - pretty much as a POJO/Simple Java Bean. Than you have a Message Factory, which supports the creation for all SIP2.0 (sometimes + extension messages for SIMPLE - that's chat and presence service) Messages - REGISTER, INVITE, ACK and so on.
Than you have a Parser which offers convenient methods to extract information from a message body (supports all message types). That's roughly what the SIPStack holds.
So, when you create a message, you have collection of header fields (and collection of attributes for the SDP, if required) attached to that message (programatically, it really depends on the SIPStack implementation) and you just add in the collection the necessary header fields.

A: You have also specify which sip lib you use and consult that lib's documentation.
Most probalby you just  not set  that field in library,as result it use default.


text:
Q: paging in gridview get same data for all pages I had gridview which get data from database according to two event .The first from method ,the second when selected ddl.it worked well ,I made paging and when I go through paging pages I must click two click on number of page to go to this page also all pages get same data for firt page .So plaes any one help me.
<aspx>

                                                        Dealers list

                                                        Select City

                                                        <asp:SqlDataSource ID="SDSGetDealerArea" runat="server" ConnectionString="<%$ ConnectionStrings:ElarabyGroup %>"
                                                            ProviderName="System.Data.SqlClient" SelectCommand="SELECT [AREA_ID], [AREA_ENG] FROM [DealerArea]">
                                                        </asp:SqlDataSource>
                                                        <%--  <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                                                <ContentTemplate>--%>
                                                        <asp:DropDownList CssClass="ad_mun_font_h" ID="DDlCity" runat="server" AutoPostBack="True"
                                                            DataSourceID="SDSGetDealerArea" DataTextField="AREA_ENG" DataValueField="AREA_ID"
                                                            OnDataBound="DDlCity_DataBound" OnSelectedIndexChanged="DDlCity_SelectedIndexChanged">
                                                        </asp:DropDownList>
                                                        <%-- </ContentTemplate>
                                                                <Triggers>
                                                                    <asp:AsyncPostBackTrigger ControlID="DDlCity" EventName="SelectedIndexChanged" />
                                                                </Triggers>
                                                            </asp:UpdatePanel>--%>

                                                        <asp:Label ID="LblResult" runat="server" Text="Result" Font-Bold="True" ForeColor="#006699"
                                                            Visible="false"></asp:Label>

                                            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                                                AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="None"
                                                CellPadding="3" DataKeyNames="DEALER_ID,LOC_ID,CAT_ID,AREA_ID" CellSpacing="3"
                                                GridLines="Horizontal" Width="510px" BorderWidth="1px" OnPageIndexChanging="GridView1_PageIndexChanging">
                                                <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                                                <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                                                <Columns>
                                                    <asp:TemplateField HeaderText="Name" SortExpression="NAME_ENG">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("NAME_ENG") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("NAME_ENG") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Address" SortExpression="ADR_ENG">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("ADR_ENG") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ADR_ENG") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Telephone" SortExpression="TEL_ENG">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("TEL_ENG") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("TEL_ENG") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Mobile" SortExpression="TEL_ARA">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("TEL_ARA") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("TEL_ARA") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Location" SortExpression="LOC_ENG">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label5" runat="server" Text='<%# Bind("LOC_ENG") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("LOC_ENG") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Category" SortExpression="CAT_NAME">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label6" runat="server" Text='<%# Bind("CAT_NAME") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("CAT_NAME") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Area" SortExpression="AREA_ENG">
                                                        <ItemTemplate>
                                                            <asp:Label ID="Label7" runat="server" Text='<%# Bind("AREA_ENG") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="TextBox7" runat="server" Text='<%# Bind("AREA_ENG") %>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                                                <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                                                <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
                                                <AlternatingRowStyle BackColor="#DCDCDC" />
                                            </asp:GridView>
                                            <asp:Panel ID="pnlModal" runat="server" Style="display: none" CssClass="modalPopup">
                                                Our Valued Customer You Are Not Registered Are You Want To Register?

                                                            Username :

                                                                <asp:TextBox ID="TxtUser" runat="server" Width="125px"></asp:TextBox>

                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                                                                ControlToValidate="TxtUser" Display="Dynamic" SetFocusOnError="True">*</asp:RequiredFieldValidator>

                                                                            <asp:CheckBox ID="CBRemeber" runat="server" class="tx_s" OnCheckedChanged="CBRemeber_CheckedChanged" />

                                                                        Remember me

                                                            Password :

                                                                <asp:TextBox ID="TXTPassword" runat="server" TextMode="Password" Width="125px"></asp:TextBox>

                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                                                                ControlToValidate="TXTPassword" Display="Dynamic" SetFocusOnError="True">*</asp:RequiredFieldValidator>

                                                            <asp:ImageButton ID="IBLogin" runat="server" ImageUrl="images/home-d_login.jpg" OnClick="IBLogin_Click" />

                                                            <asp:Label ID="Label8" runat="server" CssClass="ad_mun_font" Text="result" Visible="false"></asp:Label>

                                                            Close

                                                            Register

                                            </asp:Panel>
                                            <cc1:ModalPopupExtender TargetControlID="btnYes" ID="pnlModal_ModalPopupExtender"
                                                runat="server" Enabled="True" BackgroundCssClass="modalBackground" PopupControlID="pnlModal"
                                                CancelControlID="btnYes" DropShadow="true">
                                            </cc1:ModalPopupExtender>
                                            <asp:HiddenField ID="btnYes" runat="server" />

 protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {

           BindGridFunction();
        }

    }

    private void BindGridFunction()
    {

        DataTable DT = new DataTable();
        using (SqlConnection con = Connection.GetConnection())
        {
            SqlCommand Com = new SqlCommand();
            if (DDlCity.SelectedIndex < 0)
            {
                Com = new SqlCommand("GetDealers", con);
                Com.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter DA = new SqlDataAdapter(Com);
                DA.Fill(DT);
                GridView1.DataSource = DT;
                GridView1.DataBind();
            }
            else
            {
                Com = new SqlCommand("GetDealersByArea", con);
                Com.CommandType = CommandType.StoredProcedure;
                Com.Parameters.Add(Parameter.NewNVarChar("@AREA_ENG", DDlCity.SelectedItem.Text));
                SqlDataAdapter DA = new SqlDataAdapter(Com);
                DA.Fill(DT);
                GridView1.DataSource = DT;
                GridView1.DataBind();
            }

        }
    }

    protected void DDlCity_SelectedIndexChanged(object sender, EventArgs e)
    {
        BindGridFunction();

    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GridView1.PageIndex = e.NewPageIndex;
    }
}

A: Try rebinding after GridView1.PageIndex = e.NewPageIndex; call GridView1.DataBind();
.
--EDIT--
DataSet and then DataBind(), try it like:
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
    GridView1.PageIndex = e.NewPageIndex;
    BindGridFunction();
}


text:
Q: помогите a function-definition is not allowed here before '{' token #include <SPI.h>
#include <MFRC522.h>

#define SS_PIN 10
#define RST_PIN 9
#define Trig 7
#define Echo 6
#define ledPin 3
MFRC522 mfrc522(SS_PIN, RST_PIN);

void setup()
{
  pinMode(Trig, OUTPUT);
  pinMode(Echo, INPUT);
  pinMode(ledPin, OUTPUT);
;

unsigned int impulseTime=0;
unsigned int distance_sm=0;
{
 Serial.begin(9600);
 SPI.begin();
 mfrc522.PCD_Init();
 Serial.println("Scan PICC to see UID and type...");
}

void loop()
 {
  digitalWrite(Trig, HIGH);
 delayMicroseconds(10);
  digitalWrite(Trig, LOW);
  impulseTime=pulseIn(Echo, HIGH);
  distance_sm=impulseTime/58;
  if (distance_sm<30)
  {
    digitalWrite(ledPin, HIGH);
  }
  else
  {
    digitalWrite(ledPin, LOW);
  }
  delay(100);

  {
  byte uidCard[4] = {0x93, 0x48, 0x67, 0x9A};

 if ( ! mfrc522.PICC_IsNewCardPresent()) {
  return;
 }

 // Select one of the cards
 if ( ! mfrc522.PICC_ReadCardSerial()) {
  return;
 }

        for (byte i = 0; i < 4; i++) {
          if (uidCard[i] != mfrc522.uid.uidByte[i])
            return;
        }

  Serial.println("OPEN");
  // digitalWrite();
  delay(5000);
  // digitalWrite();
}

A: Судя по форматированию, потеряна закрывающая операторная скобка
void setup()
{
  pinMode(Trig, OUTPUT);
  pinMode(Echo, INPUT);
  pinMode(ledPin, OUTPUT);
; // <------------------------------- в этом месте

unsigned int impulseTime=0;

Но тогда непонятно, куда относится этот блок:
{
 Serial.begin(9600);
 SPI.begin();
 mfrc522.PCD_Init();
 Serial.println("Scan PICC to see UID and type...");
}

Судя по командам, он должен быть внутри функции setup
Но переменные impulseTime и distance_sm используются внутри функции loop, значит она должны быть объявлены или глобально или внутри loop, но никак не внутри setup.
После объявления функции loop количество открывающих и закрывающих операторных скобок тоже не совпадает.
Код похож на монстра Франкенштейна, собранного из разных кусков.
Проще переписать заново, чем пытаться исправлять.


text:
Q: Creating split ellipse using tikz, arc I am trying to create an ellipse (split) using tikz and arc command.

Semi-major axis a = 5
Semi-minor axis b = 3
Coordinates of various points:
O(0,0);
A(4.797,0.846); B(0.526,2.983); C(-0.526,2.983); D(-4.797,0.846);
E(-4.797,0.846); F(-0.526,-2.983); G(0.526,-2.983); H(4.797,-0.846);
Angle made by OA with x-axis is 10 degree
Angle made by OB with x-axis is 80 degree
Angle made by OC with x-axis is 100 degree
Angle made by OD with x-axis is 170 degree
Angle made by OE with x-axis is 190 degree
Angle made by OF with x-axis is 260 degree
Angle made by OG with x-axis is 280 degree
Angle made by OH with x-axis is 350 degree
I have used the following and the result also attached.

\begin{tikzpicture}
\draw (4.797,0.846) arc(10:80:5cm and 3 cm);
\draw (-0.526,2.983) arc(100:170:5cm and 3 cm);
\end{tikzpicture}

Kindly suggest corrections to create correct split ellipse.

A: May I suggest that you just mirror one ellipse with scope:
For the lines that became thicker i used \edge.
\documentclass[border=3.41mm]{standalone}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}

    %axis
    \draw (0,-8) -- (0,8);
    \draw[] (-8,0)-- +(15,0) edge[thick] (8,0);

    % original ellipse
    \draw[thick] (4.797,0.846) arc(10:80:5cm and 3 cm);
    \node[xshift=5pt,yshift=-10](a) at (4.79,0.85) {A};
    \node[yshift=5pt,xshift=-10pt](b) at (0.75,3.28) {B};

    \draw[] (0,0)-- +(4.79,0.85) edge[thick] (8,1.45); % A line
    \draw[] (0,0)-- +(0.75,3.28) edge[thick] (1,4.5); % B line
    \draw[<->,>=stealth] (8,0) arc(0:28:2cm and 3 cm) node[midway,xshift=10pt]{10°};
    \draw[<->,>=stealth] (7,0) arc(0:80:7.25cm and 4.5 cm) node[midway,yshift=10pt]{80°};

    % mirror ellipse
    \begin{scope}[yscale=1,xscale=-1]
        \draw[thick] (4.797,0.846) arc(10:80:5cm and 3 cm);
        \node[xshift=-5pt](a) at (4.79,0.85) {D};
        \node[yshift=5pt](b) at (0.75,3.28) {C};
        \draw[] (4.79,0.85) -- (0,0);
        \draw[] (0.75,3.28) -- (0,0);
    \end{scope}

    % mirror ellipse
    \begin{scope}[yscale=-1,xscale=-1]
        \draw[thick] (4.797,0.846) arc(10:80:5cm and 3 cm);
        \node[xshift=-5pt](a) at (4.79,0.85) {E};
        \node[yshift=-5pt](b) at (0.75,3.28) {F};
        \draw[] (4.79,0.85) -- (0,0);
        \draw[] (0.75,3.28) -- (0,0);
    \end{scope}

    % mirror ellipse
    \begin{scope}[yscale=-1,xscale=1]
        \draw[thick] (4.797,0.846) arc(10:80:5cm and 3 cm);
        \node[xshift=5pt](a) at (4.79,0.85) {G};
        \node[yshift=-5pt](b) at (0.75,3.28) {H};
        \draw[] (4.79,0.85) -- (0,0);
        \draw[] (0.75,3.28) -- (0,0);
    \end{scope}

    \node[xshift=7pt,yshift=-7pt](o) at (0,0) {O};

\end{tikzpicture}

\end{document}

A: Following code generated required image. Thank you all. I now better appreciate the scope and scale commands.
% original ellipse
\draw[line width=1.5pt] (10:5 and 3) arc(10:80:5cm and 3 cm);

% mirror ellipse
\begin{scope}[yscale=1,xscale=-1]
    \draw[line width=1.5pt] (10:5 and 3) arc(10:80:5cm and 3 cm);
\end{scope}

% mirror ellipse
\begin{scope}[yscale=-1,xscale=-1]
    \draw[line width=1.5pt] (10:5 and 3) arc(10:80:5cm and 3 cm);
\end{scope}

% mirror ellipse
\begin{scope}[yscale=-1,xscale=1]
    \draw[line width=1.5pt] (10:5 and 3) arc(10:80:5cm and 3 cm);
\end{scope}


text:
Q: Rails unit testing associations Should I write unit tests for my associations?
I haven't found many good resources on how and whether to do the testing. I also see/hear some opinion that it is okay to not test your associations (belongs_to and has_many) as they are already tested in rails. And there is another view that says, if it code you write, it is code you test.
So if you say I should, please tell me few good ways of doing this.
Currently, I'm writing tests using Test::Unit and I'm not using Shoulda (I don't have any macros). So for testing each association, I am creating a bunch of objects and then doing asserts on them. Somewhat like this -
For a Post model that has_many comments, my test logic goes this way -
p = Post.create(:title => 'dummy_title', :content => 'lorem ...')
3.times{ Comment.create(:post_id :=> p.id, :commentor => 'jack')}
assert_equal(3, p.comments.size, "post doesn't have correct no of comments")

A: To me, testing the association borders on testing the language (or in this case, testing the framework).
I'd reserve it for circumstances where you're doing something nonstandard with the association.  For example, if every time you create a comment it changes something in the parent post, test that.


text:
Q: Why some VPN clients break Java debugging and how to work around the issue? I am using IntelliJ to develop a Scala project.
Due to client-server architecture of the system, my integration tests have to be run with the following settings in build.sbt:
fork in IntegrationTest := true
javaOptions in (IntegrationTest) ++= Seq("-Djdk.logging.allowStackWalkSearch=true", "-XX:PermSize=256M", "-XX:MaxPermSize=512M", "-Xmx1024m")
// for attaching with debugger to the processes under test
javaOptions in (IntegrationTest) += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"

Normally everything works fine - tests are being run, debugging works.
Sometimes I need to establish a VPN connection to access some resources of my employee company. I'm using Check Point Endpoint Security VPN (that's the officially recommended software of my employee and I'm not sure if anything else would work).
So, if I happen to be connected to the VPN and then run the integration tests, then SBT console starts getting stuck right after:
Listening for transport dt_socket at address: 5005

The exact message is:
Listening for transport dt_socket at address: 5025
[error] Uncaught exception when running tests: java.net.ConnectException: Connection timed out: connect
[trace] Stack trace suppressed: run last project/it:test for the full output.
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8

When I run last project/it:test (I have to reload SBT console first because it has stuck in (busy) > state) I see this:
[debug] javaOptions: List(-Djdk.logging.allowStackWalkSearch=true, -XX:PermSize=256M, -XX:MaxPermSize=512M, -Xmx1024m, -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005)
[debug] Forking tests - parallelism = false
[debug] Create a single-thread test executor
[error] Uncaught exception when running tests: java.net.ConnectException: Connection timed out: connect

Sometimes when I disconnect the VPN and run the tests again, it starts working. But often disconnecting VPN doesn't help and I have to reboot my computer.
I have tried some less dramatic solutions - restarting IDE, killing all java and javaw processes, looking at netstat results to see anything still using the port 5005, changing the port to 5025 in build.sbt and reloading SBT console... nothing works, only reboot and only until the next time I need to connect to VPN.
That's a nightmare. I don't want to reboot my machine each time after I connect to VPN.
Is there any solution to this? Any Java flags? Any Windows network stack settings? Any VPN settings?


text:
Q: Is posible accept all kind of resources in Restful Jersey web service? Is there any way to accept and handle any resource, i.e.
I want to handle myappname/xxx where xxx could be anything, and how could I handle?
Note: I already know is posible create any class and then bind a resource to a class, but I don't want it. I want a one universal class that handles every resource.

A: I don't know Jersey well, but as it implements JAX-RS I expexted that would work (not tested):
@Path("/myappname")
public class CatchItAll {

    @GET
    @Path("/{anyThing:.*}")
    public String catch(@PathParam("anyThing") String anyThing) {

    }
}

It uses the regular expression feature.


text:
Q: Nginx strips cookie on websocket upgrade Hopefully this helps anyone surprised by this quirk. I have a node server that sets a jwt auth token in a cookie and then upgrades the https to wss. Before the nginx reverse proxy everything worked and the cookie did its job but now that I have nginx in between with a CSP I'm noticing the cookie is gone and then the CSP gives a connect-src error. Not sure what happened. I have a redirect for naked domains to https and the full domain name with www so not sure if that is changing the src or removing the cookie. Everything works until the wss. I have ws: and wss: set in the CSP so it should let it pass.
What is nginx doing on the wss upgrade to strip the cookie? I've looked all over for the solution including some proxy headers for cookies but I don't think that's the problem. Any help would be greatly appreciated. Been working on this for days now.


text:
Q: Play video in loop from the selected duration I have a video file in my design which has length of 2min. For the first time the video will play from the beginning and then the video have to play from 1.00 sec to 2.00 sec in loop. Is this possible to do using jquery? I have tried alternative methods. It works but there is a jump in video. Change video source after the first video ends.
Here are the code I have:
JQuery:
document.getElementById('bgvid').addEventListener('ended', myHandler, false);

function myHandler(e) {
   //*what to do?*//
}

HTML:
div class="anim-logo ">
    <video playsinline autoplay muted  poster="assets/img/video3.jpg" id="bgvid">
    <source src="assets/img/video3.webm" type="video/webm">
    <source src="assets/img/video3.mp4" type="video/mp4">
</video>
      </div><!--end of anim logo-->

A: You can do something like this:

var video = document.getElementById('videoElm')
video.addEventListener('ended',function(){
    // set the video's start position to the video's duration minus 10 seconds. "video.currentTime" is in milliseconds, "video.duration" is in seconds
    video.currentTime = (parseInt(video.duration) - 10) * 1000;
    video.play();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
    <video id="videoElm" autoplay muted>
    <source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/webm">
</video>
</div>


text:
Q: nightly installed TF is the new 1.5 TF? today I heard that there are a new version 1.5 TF which is with good support dynamic graph.
And I also find there is a new nightly installed method.
So this nightly installing method is install the new Version TF?
chg0901@ubuntu:~$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
2018-01-06 16:49:32.242801: I tensorflow/core/platform/s3/aws_logging.cc:53] Initializing Curl library
>>> print(tf.__version__)
1.6.0-dev20180105
>>> x = [[2.]]
>>> m = tf.matmul(x,x)
>>> print(m)
Tensor("MatMul:0", shape=(1, 1), dtype=float32)
>>> print(tf.Session().run(m))
2018-01-06 16:51:25.418750: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX FMA
[[ 4.]]

A: Currently TF 1.5.0rc0 is out. You can install release candidates of latest versions by this command:
pip install tensorflow --pre

When you check its version, you will see something like this:
> import tensorflow as tf
> tf.__version__
'1.5.0-rc0'

The installation you have is the "nightly" which is built every night from the master branch. The version string you see, 1.6.0-dev20180105 means next release up is 1.6 and it was built on 2018-01-05.


text:
Q: Generic class to read csv in scala I am new to Scala and I am trying to build a framework that can read multiple types of csv files and all read operations will go through one class. For eg, I have two types of CSVs: Student and Professor and I am doing something like this.
abstract class Person
case class Student(name: String, major: String, marks: Double) extends Person
case class Professor(name: String, salary: Double) extends Person

my csv reader looks something like this
  private def readCsv[T: Encoder](location: String) = {
    spark
      .read
      .option("header", "true")
      .option("inferSchema", "true")
      .option("delimiter", ";")
      .csv(location)
      .as[T]
  }

def data:Dataset[Person](location) = readCsv[Person](location)

I am getting a compile-time error in the last line as No implicit arguments of Type: Encoder[Person]. Call to this method looks something like this:
val studentData = storage.data[Student]("Student.csv")

Is there any better way to achieve this?

A: *

*your ADT definition should probably be final/sealed else it's hard to derive Encoders for it.

*IIRC Spark does not support Sum types sadly because there is no schema representation for it. A somewhat common hack is to represent Either[A, B] as (Option[A], Option[B]) but yeah it's a pain


text:
Q: ActivityInfo.loadIcon causes OutOfMemoryError if an app icon is a HD I came through this problem and looking for your input on the best approach on how to solve/avoid it & to bring other developers attention to it.
I'm using this code to fetch the installed apps data (label, icon, etc.). Everything was OK until I found my app using a lot of memory for no clear reason in my code.
    List<ResolveInfo> availableActivities = getPackageManager().queryIntentActivities(intent, 0);
    for(ResolveInfo ri : availableActivities){
        AppDetail appDetail = new AppDetail();

        appDetail.mAppIcon = ri.activityInfo.loadIcon(getApplicationContext().getPackageManager());
     }

A: It turns out that I installed a new app which has a 3000*3000 dimension as an app icon (Really bad practice from the app developer), which increases the memory usage by 47MB. Which affected my app performance especially GridView scrolling.


text:
Q: How to retrieve data from sql server database and manipulate it in c#? I am new to asp.net. I am trying to retrieve data from SQL Server in an asp.net website. This is the result of my table in SQL,
Day_Of_Week    Product_Count
-----------------------------
Sunday              8
Monday            150
Tuesday            80
Wednesday          95
Thursday          345
Friday            229
Saturday           48

This is my code in c#,
    DataTable dt = new DataTable();
    SqlConnection con = new SqlConnection(Settings.DatabaseConnectionString);
    SqlCommand com = new SqlCommand("Select * from tblProducts");
    com.CommandType = CommandType.Text;
    com.Connection = con;
    con.Open();
    SqlDataAdapter da = new SqlDataAdapter(com);
    da.Fill(dt);

   int monday = Convert.ToInt32(dt.Rows[1]["Product_Count"]);
   int tuesday = monday + Convert.ToInt32(dt.Rows[2]["Product_Count"]);
   int wednesday = tuesday + Convert.ToInt32(dt.Rows[3]["Product_Count"]);
   int thursday = wednesday + Convert.ToInt32(dt.Rows[4]["Product_Count"]) ;
   int friday = thursday + Convert.ToInt32(dt.Rows[5]["Product_Count"]);

Now, if there are no records on Sunday, it does not display Sunday row and I have to change the c# code. Instead, I want to put a switch case or something so that if the day is Monday, then I can write dt.Rows[0], if the day is Tuesday, then dt.Rows[0], etc.
Let me know what would be the best option to do this. Any help will be appreciated.
Thanks.

A: You can use a foreach to iterate through the rows and a switch to set the data. Pre-initialize your variables first.
int monday = 0;
int tuesday = 0;
// and repeat
foreach(DataRow row in dt.Rows)
{
    switch(row["Days_Of_Week"].ToString().ToLower())
    {
        case "monday":
             monday = (int)row["Product_Count"];
        break;
        case "tuesday":
             tuesday = (int)row["Product_Count"] + monday;
        break;
        // repeat for each
    }
}

A: You need to reconsider your approach. Since all you want to do is fetch the product count by day I'd do something like this instead of relying on the row number.
public static int FetchProductCountByDayOfWeek(DayOfWeek dayOfWeek)
{
    using(SqlConnection con = new SqlConnection(Settings.DatabaseConnectionString))
    {
         con.Open();

         SqlCommand com = new SqlCommand("Select * from tblProducts where Day_Of_Week = @day_of_week");
         com.CommandType = CommandType.Text;
         com.Connection = con;

         com.Parameters.AddWithValue("@day_of_week", dayOfWeek.ToString());

         using (SqlDataAdapter da = new SqlDataAdapter(com))
         {
               DataTable dt = new DataTable();
               da.Fill(dt);

               return Convert.ToInt32(dt.Rows[0]["Product_Count"]);
         }
    }
}

You would then call this like so:
int monday = ProductHelper.FetchProductCountByDayOfWeek(DayOfWeek.Monday);

Though this isn't as efficient as reading the rows in one go as it's doing multiple DB calls.

A: It might be better to retrieve the required data using a query so you won't have to manipulate it in C#.
You might use a T-SQL statement to detect when there is no row for a given day. Not the exact query you want but basically you might use ISNULL to detect the cases where there is no row, for instance days with no counts.
SELECT ISNULL(
(SELECT 1 FROM tblProducts T
WHERE T.Day_Of_Week = @DayName and T. Product_Count > 0), 0)

A: Suppose to change your query to use the PIVOT SQL Statement
string query = @"
   SELECT 'Day Production' As DayProduction, Sunday, Monday, Tuesday, Wednesday,
                                             Thursday, Friday, Saturday
FROM (SELECT Day_Of_Week, ProductCount FROM tblProducts) as tbp
PIVOT
(
    SUM(ProductCount)
    FOR Day_Of_Week IN ( Sunday, Monday, Tuesday,Wednesday,Thursday,Friday,Saturday )
) AS Totals";

Now your code could be rewritten as
using(SqlConnection con = new SqlConnection(Settings.DatabaseConnectionString))
using(SqlCommand cmd = new SqlCommand(query, con))
{
     con.Open();

     // The query will return just one row with eight columns
     using(SqlDataReader reader = cmd.ExecuteReader())
     {
       if(reader.Read())
       {
         // The column at ordinal 0 is the DayProduction one....

         // Check if column at ordinal 1 (Sunday) contains a DBNull.Value or not...
         int sunday = reader.IsDBNull(1) ? 0 : Convert.ToInt32(reader[1]);

         int monday = reader.IsDBNull(2) ? 0 : Convert.ToInt32(reader[2]);
         int tuesday = reader.IsDBNull(3) ? 0 : Convert.ToInt32(reader[3]);
         int wednesday = reader.IsDBNull(4) ? 0 : Convert.ToInt32(reader[4]);
         int thursday = reader.IsDBNull(5) ? 0 : Convert.ToInt32(reader[5]);
         int friday = reader.IsDBNull(6) ? 0 : Convert.ToInt32(reader[6]);
         int saturday = reader.IsDBNull(7) ? 0 : Convert.ToInt32(reader[7]);
       }
     }
}

The rows of your previous query are rotated as columns and the Sunday (or any other day) if not present is always returned as a DBNull.Value.


text:
Q: Cover Image Add option not working getid3 I tried to write a php script to get cover image and use it as cover image for mp3 file using getid3 php but the cover image is not showing up in media players.
The cover image is showing in windows folders but not in media players icon badge... Also not showing up on google play music on android.
Belows the code.
<?php
$scr1=$_POST['search1'];
$op90=$_POST['search2'];
$kat=$_POST['search3'];
$album=$_POST['search4'];
$genre=$_POST['search5'];
$TextEncoding = 'UTF-8';
$albumPath = "../../image/".$scr1.".jpg"; // path to your image

require_once("../getid3/getid3.php");
// Initialize getID3 engine
$getID3 = new getID3;
$getID3->setOption(array('encoding'=>$TextEncoding));

require_once("../getid3/write.php");
// Initialize getID3 tag-writing module
$tagwriter = new getid3_writetags;
$tagwriter->filename = '../../../public_html/song/'.$op90.'.mp3';
$filename='../../../public_html/song/'.$op90.'.mp3';
//$tagwriter->tagformats = array('id3v1', 'id3v2.3');
$tagwriter->tagformats = array('id3v2.3');
$ThisFileInfo = $getID3->analyze($filename);
// set various options (optional)
$tagwriter->overwrite_tags    = true;  // if true will erase existing tag data and write only passed data; if false will merge passed data with existing tag data (experimental)
$tagwriter->remove_other_tags = false; // if true removes other tag formats (e.g. ID3v1, ID3v2, APE, Lyrics3, etc) that may be present in the file and only write the specified tag format(s). If false leaves any unspecified tag formats as-is.
$tagwriter->tag_encoding      = $TextEncoding;
$tagwriter->remove_other_tags = true;

// populate data array
$TagData = array(
    'title'         => array($op90),
    'artist'        => array($kat),
    'album'         => array($album),
    'year'          => array($ThisFileInfo['comments_html']['year'][0]),
    'genre'         => array($genre),
    'comment'       => array($ThisFileInfo['comments_html']['comment'][0]),
    'track'         => array($ThisFileInfo['comments_html']['track'][0]),
);
$fd = fopen($albumPath, 'rb');
$APICdata = fread($fd, filesize($albumPath));
fclose($fd);

if($APICdata) {
    $TagData += array(
        'attached_picture' => array(0 => array(
            'data'          => $APICdata,
            'picturetypeid' => '0x03',
            'description'   => 'cover',
            'mime'          => image_type_to_mime_type(@$albumExifType)
        ))
    );
}

$tagwriter->tag_data = $TagData;

// write tags
if ($tagwriter->WriteTags()) {if (!empty($tagwriter->warnings)) {}} else {}


text:
Q: mostrar una variable de Javascript en HTML Lo que busco es que me quede algo parecido a esto

El codigo que tengo es este
Esta es la parte de la funciones

 function can_x2(){
      var cantx2 = (quantity * 2)  ;
      return (cantx2);
    }
    function can_x4(){
      var cantx4 = (quantity * 4)  ;
      return (cantx4);
    }
  <!DOCTYPE html>

  <meta charset="UTF-8" />
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="Assets/css/bootstrap.css" />
  <link rel="stylesheet" href="Assets/css/estyles.css" />
  <link rel="stylesheet" href="Assets/css/fontawesome.min.css" />
  <link rel="preconnect" href="https://fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@1,900&display=swap" rel="stylesheet">
  <title>Elabels - Quotes</title>

Get A Quotes

            <form class="row g-3" method="post" action="">

              Width
                             <input type="number" name="width" id="width" class="form-control" min="1" max="13"  step="any" required>

              Height
                             <input type="number" name="height" id="height" class="form-control" required step="any" min="1" max="25">

              Quantity
                             <input type="number" name="quantity" id="quantity" class="form-control" required   min="1" >

    la cantidad es <?php echo $cantx2 ?>

Basicamente lo que busco es podes que la cantida que se esta haciendo el la operacion mejor dicho el resultado de esta me pueda dar el resultado si el cliente pone 5 que la cantx2 se muestre en el span o label o si es en un boton radio mucho mejor. Las operaciones me funcionan perfectamente en la consola me da los resultados pero al momento que yo quiero mostrar en la pantalla ya del cliente me sale que esa variable no esta definida

A: revisando tu codigo puedo ver que estas tratando de imprimir una variable de PHP <?php echo $cantx2 ?>, sin embargo toda tu logica esta en JS ese es el primer error.
El segundo error de tu codigo es que en ningun momento estas instanciando al elemento quantity en el JS.
Tambien para lograr imprimir tus variables dentro del cuerpo de HTML debes hacerlo con innerHTML, teniendo eso en mente tu codigo debe quedar de la siguiente manera

let quantity = document.getElementById("quantity");
let toShow = document.getElementById("toShow");

quantity.addEventListener('change', can_x2);

function can_x2(){
  var cantx2 = (quantity.value * 2)  ;
  toShow.innerHTML = "La cantidad es: "+cantx2;
}
<!DOCTYPE html>

  <meta charset="UTF-8" />
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <link rel="stylesheet" href="Assets/css/bootstrap.css" />
  <link rel="stylesheet" href="Assets/css/estyles.css" />
  <link rel="stylesheet" href="Assets/css/fontawesome.min.css" />
  <link rel="preconnect" href="https://fonts.gstatic.com">
  <link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@1,900&display=swap" rel="stylesheet">
  <title>Elabels - Quotes</title>

Get A Quotes

            <form class="row g-3" method="post" action="">

              Width
                             <input type="number" name="width" id="width" class="form-control" min="1" max="13"  step="any" required>

              Height
                             <input type="number" name="height" id="height" class="form-control" required step="any" min="1" max="25">

              Quantity
                             <input type="number" name="quantity" id="quantity" class="form-control" required   min="1" oninput="can_x2(this.value)">


text:
Q: How to change address location of JAX-WS webservice We have currently exposed JAX-RPC webservice with following URL
http://xx.xx.xx.xx/myservice/MYGatewaySoapHttpPort?wsdl
We migrated webservice to JAX-WS by generating WebService from above WSDL
But new webservice is accessible from following URL
http://xx.xx.xx.xx/myservice/MYGateway?wsdl
How i can make my JAX-WS webservice to be accessible by same URL mentioned first? so that our customer dont have any problem.
Update:
Service Element of WSDL from which i created is as per expectation
<WL5G3N0:service name="MyGateway">
    <WL5G3N0:port binding="WL5G3N2:MyGatewaySoapHttp" name="MyGatewaySoapHttpPort">
      <WL5G3N3:address location="http://xx.xx.xx/myservice/MyGatewaySoapHttpPort"/>
    </WL5G3N0:port>
  </WL5G3N0:service>

But WSDL of JAX-WS is not same and this WSDL is auto generated.
<WL5G3N0:service name="MyGateway">
- <WL5G3N0:port binding="WL5G3N2:MyGatewaySoapHttp" name="MyGatewaySoapHttpPort">
  <WL5G3N3:address location="http://xx.xx.xx/myservice/MyGateway" />
  </WL5G3N0:port>
 </WL5G3N0:service

I created webservice with Oracle Eclipse Indigo.
Can i change with any annotaion?
Regards,

A: We missed very basic point, servlet mapping in web.xml did all trick. for details please find below link
http://pic.dhe.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=%2Fcom.ibm.websphere.wsfep.multiplatform.doc%2Finfo%2Fae%2Fae%2Ftwbs_customwebxml.html

A: This allows setting the endpoint in the client:
MYGateway service = new MYGateway();
MYGatewaySoapServiceHttpPort port = service.getMYGatewaySoapServiceHttpPort();
BindingProvider bp = (BindingProvider) port;
bp.getRequestContext().put(
    BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
    "http://xx.xx.xx.xx/myservice/MYGateway");

(thanks to user FoGH for pointing out that the endpoint should indicate the service, not the WSDL)
EDIT: here is some more information about setting up the org.codehaus.mojo.jaxws-maven-plugin:
In your pom.xml:
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>MyGateway</id>
            <goals>
                <goal>wsimport</goal>
            </goals>
            <configuration>
                <wsdlDirectory>src/main/resources/META-INF/wsdl</wsdlDirectory>
                <wsdlFiles>
                    <wsdlFile>MyGateway.wsdl</wsdlFile>
                </wsdlFiles>
                <wsdlLocation>MyGatewaySystemId</wsdlLocation>
                <!-- Line below to avoid regeneration bug if you have multiple executions -->
                <staleFile>${project.build.directory}/jaxws/stale/wsdl.MyGateway.done</staleFile>
            </configuration>
        </execution>
    </executions>
</plugin>

In ./src/main/resources/META-INF/jax-ws-catalog.xml:
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
    <system systemId="MyGatewaySystemId" uri="wsdl/MyGateWay.wsdl"/>
</catalog>

Put your WSDL in ./src/main/resources/META-INF/wsdl/MyGateway.wsdl
So the wsdlLocation in the plugin configuration refers to an entry in the jax-ws-catalog.xml file. This file points to the actual WSDL file using a relative directory notation.
The value 'MyGatewaySystemId' ends up in the generated web service code as the location. So you could change this to the actual URL of the WSDL. Note that you would need configure your pom to set the correct URL for the build environment (dev, test, prod) for this to work consistently. A pointer in the right direction for this is to use maven profiles.
Tip: an easy way to download a copy of an online WSDL (and related XSD's) is to create a SoapUI project for it and then go to the 'WSDL content' tab.

A: Check your Service element of your JAX-WS WSDL file.
<service name="Hello_Service">
      <documentation>WSDL File for HelloService</documentation>
      <port binding="tns:Hello_Binding" name="Hello_Port">
         <soap:address
            location="http://www.examples.com/SayHello/">
      </port>
   </service>

location element specifies through which port to access the Web service.
read this


text:
Q: External Page Content Overflows out of Bootstrap Modal I have the following Modal:

                <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

When I click the link to launch modal, the content of somepage.htm overflows out of the modal and there are no scroll bars on the modal?
How come this is happening?

A: The content of somepage.htm overflows out of the modal because your somepage.htm page is not responsive, and your modal have some fixed height and width. So try to make your page responsive using bootstrap classes and some additional css if needed.
So making somepage.htm page content responsive will solve both problems of content overflows out of the modal as well as scroll bar.
Hope it will help you!

A: Let's say you have 2 pages, index.htm and somepage.htm
you have modal in page index.htm and you want to show somepage.htm inside modal. Then
index.htm page code will be

         //Here you can show the content from `somepage.htm`

and somepage.htm page content will be

    <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

  //Put the page content here

    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

This will resolve the issue somepage.htm overflows out of the modal and there are no scroll bars on the modal
Alternate Solution
OP asked in comments to load the remote page content into modal-body and above code example is default behavior of bootstrap v3+ where modal ignores the modal-body and always load the remote content into
 doesn't matter even if
 exist inside the
.
To get around this and make sure that the remote content load inside

*

*Use bootstrap modal events

*Do not use href or remote in modal call button or link

So the modal call button or link will be

where href changed to datalink or any word can be used but not href or remote otherwise modal will detect it as remote content and ignores the
 and load the content into

Modal HTML

            <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

            //Remote Page Content loads here

            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

and JS


text:
Q: Using Drupal 7 VBO and Rules Component Action Set to unblock users - insufficient permissions When users join up to the site I'm creating, their accounts are Blocked.
I want to make it possible for a user with a special role (user admin) to approve those new users, but I don't want to grant global permissions to that user which might affect other users and user data.
I've created a View with a VBO on it that accesses a Rules Component Action Set which simply unblocks the user(s) it is passed. However, running this action results in a message of:
Skipped Activate user on user New User due to insufficient permissions.
In order to get the action to run successfully I have had to grant the user admin role the Administer users permission. Once I do that, though, my user admin is able to mess around with far more than I want them to be able to (including blocking users and changing user data).
I have tried to use the Actions permissions module to provide the permission for this action, but as a Rules component it isn't listed (the readme indicates there is an open feature request to add this functionality, but looking at it, it has been implemented in Rules, and appears to give me the ability to limit use of a component, which I've done, but not permit the changes in the action to be made if the user doesn't have the permission to carry out those actions - ie. I want a form of sudo, if you will).
What options, if any, do I have?


text:
Q: What is the purpose of msbuild's GenerateRuntimeConfigurationFiles? I upgraded a netcore1.1 project to the new VS2017/csproj.
In my test projects only, it added:
<PropertyGroup>
  <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>

I did some digging to discover that it generates these files in the bin directory:

*

*ProjectName.Tests.runtimeconfig.json

*ProjectName.Tests.runtimeconfig.dev.json
What is this setting and these files, and why do I need them?
Why were they only generated for my test projects?

A: These are specific to .NET Core projects and specify

*

*Which runtime and version to use. Typically Microsoft.NETCore.App. The "host framework resolver" looks for a matching folder inside the shared folder (e.g. C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.1.2). This is important since multiple runtimes can be installed side-by-side and the host needs to know which one to use when you run dotnet myapp.dll.

*Additional options for the runtime. The most prominent is probably the garbage collection setting that switches between "desktop" and "server" mode. When you set <ServerGarbageCollection>true</ServerGarbageCollection> int he csproj file, this will cause a value in the runtimeconfig.json to be set. (This property is defaulted to true for web projects)

*Additional options for the host. additionalProbingPath for example is set to your local NuGet cache which contains the restored packages. You may have noticed that referencing a NuGet package does not cause its dll files to be copied to the output directory (by default). The host uses the additional probing path to look for packages / dlls referenced to in this location (actually it is a two-step lookup: deps.json tells the host which packages to use and this property tells where to look for this package). Since this is only used for development and shouldn't end up in the published output (since this would mean relying on a NuGet cache on the target), this settings is put into a runtimeconfig.dev.json.

"Classic" .NET Framework projects also had a concept of letting the application set some runtime settings. This was accomplished by having an .exe.config file (which would be built from an App.config file in a project if present). You can think of runtimeconfig.json as "the new .exe.config" but the only have a few overlapping concerns.


text:
Q: stream a big dataset from server and visualize the data asynchronously Is there a way to stream a big dataset from server and visualize the data with dc.js in an async fashion?
Chunk the dataset then update the visualization on the client with the chunks as they arrive.
Like this page: http://vcf.iobio.io/?vcf=http://s3.amazonaws.com/vcf.files/ExAC.r0.2.sites.vep.vcf.gz&species=Human&build=GRCh37

A: I think all you need to do is set up all your charts and then set a recurrent interval timer that fetches chunks and calls crossfilter.add and then dc.redrawAll():
var cf = crossfilter([]); // start with no data
// set up dimensions, groups, and charts, then ...
window.setInterval(function() {
    d3.csv(/* your data source with chunk parameters */, function(error, data) {
        data.forEach(function(d) {
            // preprocess data
        });
        cf.add(data);
        dc.redrawAll();
    });
}, 5000); // or choose an appropriate interval for processing your chunks

There may be a more intelligent way to chain the requests so that there is always an ajax request in flight, and a chunk of data being processed by the browser. (Probably starting the next request as soon as the last one has arrived.)
But I think this is the best way to get started because it is easy to understand.
I don't know of a public data source with a restful chunk API, but if you know of one and can create a fiddle example, I'm sure an example would help a lot of people.


text:
Q: Stream melt framework video with VLC - no sout stream modules matched  I followed the two example commands based on How can I stream as transport stream over HTTP?  only changing the url, I am attempting it do this inside fresh debian docker container with only apt vlc and melt framework, so it shouldnt be a network issue.
I will be forever in your debt if you can help!
Using this first to start the stream, where there is melt formatted xml, the project renders with this normally.
melt -profile square_pal project.xml -consumer avformat:udp://224.224.224.224:1234?pkt_size=1316\&reuse=1 real_time=1 terminate_on_pause=0 f=mpegts vcodec=mpeg4 b=1000k s=320x240 acodec=mp2 ab=128k

Then using the following in a a seperate terminal:
cvlc -I dummy -vvv udp://@224.224.224.224:1234 --sout \#std{access=http,mux=ts,dst=0.0.0.0:8081}

Warning full output
vlc@f56c133a87c5:/usr$ cvlc -I dummy -vv udp://@0.0.0.0:1234 --sout \#std{access=http,mux=ts,dst=0.0.0.0:8081}
VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[000056517c3bf460] main libvlc debug: VLC media player - 3.0.16 Vetinari
[000056517c3bf460] main libvlc debug: Copyright © 1996-2021 the VideoLAN team
[000056517c3bf460] main libvlc debug: revision 3.0.13-8-g41878ff4f2
[000056517c3bf460] main libvlc debug: configured with ./configure  '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-debug' '--config-cache' '--disable-update-check' '--enable-fast-install' '--docdir=/usr/share/doc/vlc' '--with-binary-version=3.0.16-1' '--enable-a52' '--enable-aa' '--enable-aribsub' '--enable-avahi' '--enable-bluray' '--enable-caca' '--enable-chromaprint' '--enable-chromecast' '--enable-dav1d' '--enable-dbus' '--enable-dca' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-gles2' '--enable-gnutls' '--enable-harfbuzz' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libxml2' '--enable-lirc' '--enable-mad' '--enable-matroska' '--enable-mod' '--enable-mpc' '--enable-mpg123' '--enable-mtp' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-opus' '--enable-pulse' '--enable-qt' '--enable-realrtsp' '--enable-samplerate' '--enable-sdl-image' '--enable-sftp' '--enable-shine' '--enable-shout' '--enable-skins2' '--enable-sndio' '--enable-soxr' '--enable-spatialaudio' '--enable-speex' '--enable-svg' '--enable-svgdec' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vdpau' '--enable-vnc' '--enable-vorbis' '--enable-x264' '--enable-x265' '--enable-zvbi' '--with-kde-solid=/usr/share/solid/actions/' '--disable-aom' '--disable-crystalhd' '--disable-d3d11va' '--disable-decklink' '--disable-directx' '--disable-dsm' '--disable-dxva2' '--disable-fdkaac' '--disable-fluidlite' '--disable-freerdp' '--disable-goom' '--disable-gst-decode' '--disable-libtar' '--disable-live555' '--disable-macosx' '--disable-macosx-avfoundation' '--disable-macosx-qtkit' '--disable-mfx' '--disable-microdns' '--disable-opencv' '--disable-projectm' '--disable-schroedinger' '--disable-sparkle' '--disable-srt' '--disable-telx' '--disable-vpx' '--disable-vsxu' '--disable-wasapi' '--enable-alsa' '--enable-dc1394' '--enable-dv1394' '--enable-libplacebo' '--enable-linsys' '--enable-nfs' '--enable-udev' '--enable-v4l2' '--enable-wayland' '--enable-libva' '--enable-vcd' '--enable-smbclient' '--disable-oss' '--enable-mmx' '--enable-sse' '--disable-neon' '--disable-altivec' '--disable-omxil' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -ffile-prefix-map=/build/vlc-0rjD9V/vlc-3.0.16=. -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -ffile-prefix-map=/build/vlc-0rjD9V/vlc-3.0.16=. -fstack-protector-strong -Wformat -Werror=format-security ' 'OBJCFLAGS=-g -O2 -ffile-prefix-map=/build/vlc-0rjD9V/vlc-3.0.16=. -fstack-protector-strong -Wformat -Werror=format-security'
[000056517c3bf460] main libvlc debug: searching plug-in modules
[000056517c3bf460] main libvlc debug: loading plugins cache file /usr/lib/x86_64-linux-gnu/vlc/plugins/plugins.dat
[000056517c3bf460] main libvlc debug: recursively browsing `/usr/lib/x86_64-linux-gnu/vlc/plugins'
[000056517c3bf460] main libvlc debug: plug-ins loaded: 508 modules
[000056517c3bf460] main libvlc debug: opening config file (/home/vlc/.config/vlc/vlcrc)
[000056517c3bf7b0] main logger debug: looking for logger module matching "any": 4 candidates
[000056517c3bf7b0] main logger debug: using logger module "console"
[000056517c3bf460] main libvlc debug: translation test: code is "C"
[000056517c457300] main keystore debug: looking for keystore module matching "memory": 4 candidates
[000056517c457300] main keystore debug: using keystore module "memory"
[000056517c3bf460] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2 FPU
[000056517c45b910] main input debug: Creating an input for 'Media Library'
[000056517c45b910] main input debug: Input is a meta file: disabling unneeded options
[000056517c45b910] main input debug: using timeshift granularity of 50 MiB
[000056517c45b910] main input debug: using default timeshift path
[000056517c45b910] main input debug: `file/directory:///home/vlc/.local/share/vlc/ml.xspf' gives access `file' demux `directory' path `/home/vlc/.local/share/vlc/ml.xspf'
[000056517c456b60] main input source debug: creating demux: access='file' demux='directory' location='/home/vlc/.local/share/vlc/ml.xspf' file='/home/vlc/.local/share/vlc/ml.xspf'
[000056517c455620] main demux debug: looking for access_demux module matching "file": 16 candidates
[000056517c455620] main demux debug: no access_demux modules matched
[000056517c47af40] main stream debug: creating access: file:///home/vlc/.local/share/vlc/ml.xspf
[000056517c47af40] main stream debug:  (path: /home/vlc/.local/share/vlc/ml.xspf)
[000056517c47af40] main stream debug: looking for access module matching "file": 28 candidates
[000056517c47af40] main stream debug: using access module "filesystem"
[000056517c47c330] main stream debug: looking for stream_filter module matching "prefetch,cache_read": 26 candidates
[000056517c47c330] cache_read stream debug: Using stream method for AStream*
[000056517c47c330] cache_read stream debug: starting pre-buffering
[000056517c47c330] cache_read stream debug: received first data after 0 ms
[000056517c47c330] cache_read stream debug: pre-buffering done 296 bytes in 0s - 5781 KiB/s
[000056517c47c330] main stream debug: using stream_filter module "cache_read"
[000056517c47d390] main stream debug: looking for stream_filter module matching "any": 26 candidates
[000056517c47d390] playlist stream debug: using XSPF playlist reader
[000056517c47d390] main stream debug: using stream_filter module "playlist"
[000056517c47d390] main stream debug: stream filter added to 0x56517c47c330
[000056517c480890] main stream debug: looking for stream_filter module matching "any": 26 candidates
[000056517c480890] main stream debug: no stream_filter modules matched
[000056517c456910] main stream_directory debug: looking for stream_directory module matching "any": 1 candidates
[000056517c456910] main stream_directory debug: no stream_directory modules matched
[000056517c456b60] main input source debug: attachment of directory-extractor failed for file:///home/vlc/.local/share/vlc/ml.xspf
[000056517c480890] main stream debug: looking for stream_filter module matching "record": 26 candidates
[000056517c480890] main stream debug: using stream_filter module "record"
[000056517c456b60] main input source debug: creating demux: access='file' demux='directory' location='/home/vlc/.local/share/vlc/ml.xspf' file='/home/vlc/.local/share/vlc/ml.xspf'
[000056517c455620] main demux debug: looking for demux module matching "directory": 54 candidates
[000056517c455620] main demux debug: using demux module "directory"
[000056517c484760] main demux meta debug: looking for meta reader module matching "any": 2 candidates
[000056517c484760] lua demux meta debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/reader
[000056517c484760] lua demux meta debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/reader
[000056517c484760] lua demux meta debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/reader/filename.luac
[000056517c484760] lua demux meta debug: Trying Lua scripts in /usr/share/vlc/lua/meta/reader
[000056517c484760] main demux meta debug: no meta reader modules matched
[000056517c45b910] main input debug: `file/directory:///home/vlc/.local/share/vlc/ml.xspf' successfully opened
[000056517c489570] main xml reader debug: looking for xml reader module matching "any": 1 candidates
[000056517c489570] main xml reader debug: using xml reader module "xml"
[000056517c45b910] main input debug: EOF reached
[000056517c455620] main demux debug: removing module "directory"
[000056517c480890] main stream debug: removing module "record"
[000056517c47d390] main stream debug: removing module "playlist"
[000056517c47c330] main stream debug: removing module "cache_read"
[000056517c47af40] main stream debug: removing module "filesystem"
[000056517c3c0e50] main playlist debug: creating audio output
[000056517c4803d0] main audio output debug: looking for audio output module matching "any": 6 candidates
[000056517c4803d0] vlcpulse audio output debug: using library version 14.2.0
[000056517c4803d0] vlcpulse audio output debug:  (compiled with version 14.2.0, protocol 34)
[000056517c4803d0] vlcpulse audio output error: PulseAudio server connection failure: Connection refused
[000056517c4803d0] alsa audio output debug: Available ALSA PCM devices:
[000056517c4803d0] alsa audio output debug: Discard all samples (playback) or generate zero samples (capture) (null)
[000056517c4803d0] main audio output debug: using audio output module "alsa"
[000056517c3c0e50] main playlist debug: keeping audio output
[000056517c4c4230] main interface debug: looking for interface module matching "dbus,none": 17 candidates
[000056517c4c4230] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[000056517c4c4230] main interface debug: no interface modules matched
[000056517c4c4230] main interface error: no suitable interface module
[000056517c3bf460] main libvlc error: interface "dbus,none" initialization failed
[000056517c4c4230] main interface debug: looking for interface module matching "hotkeys,none": 17 candidates
[00007f975c000c20] main input debug: Creating an input for preparsing '#stddst=0.0.0.0:8081'
[000056517c4c4230] main interface debug: using interface module "hotkeys"
[000056517c493b30] main interface debug: looking for interface module matching "globalhotkeys,none": 17 candidates
[00007f975c000c20] main input debug: Creating an input for preparsing '#stdmux=ts'
[000056517c493b30] main interface debug: no interface modules matched
[000056517c493b30] main interface error: no suitable interface module
[000056517c3bf460] main libvlc error: interface "globalhotkeys,none" initialization failed
[000056517c493b30] main interface debug: looking for interface module matching "dummy": 17 candidates
[00007f9750000c20] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
[000056517c493b30] dummy interface: using the dummy interface module...
[000056517c493b30] main interface debug: using interface module "dummy"
[00007f9750000c20] main meta fetcher debug: no meta fetcher modules matched
[00007f9750000c20] main art finder debug: looking for art finder module matching "any": 2 candidates
[000056517c3c0e50] main playlist debug: processing request item: null, node: Playlist, skip: 0
[000056517c3c0e50] main playlist debug: rebuilding array of current - root Playlist
[000056517c3c0e50] main playlist debug: rebuild done - 3 items, index -1
[000056517c3c0e50] main playlist debug: starting playback of new item
[000056517c3c0e50] main playlist debug: resyncing on udp://0.0.0.0:1234
[000056517c3c0e50] main playlist debug: udp://0.0.0.0:1234 is at 0
[000056517c3c0e50] main playlist debug: creating new input thread
[00007f9748000c80] main input debug: Creating an input for 'udp://0.0.0.0:1234'
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[000056517c3c0e50] main playlist debug: requesting art for new input thread
[00007f9758000e60] main stream output debug: using sout chain=`stdaccess=http'
[00007f9758000e60] main stream output debug: stream=`stdaccess=http'
[00007f97580010e0] main stream out debug: looking for sout stream module matching "stdaccess=http": 23 candidates
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007f97580010e0] main stream out debug: no sout stream modules matched
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f97580010e0] main stream out debug: destroying chain... (name=(null))
[00007f97580010e0] main stream out debug: destroying chain done
[00007f9758000e60] main stream output error: stream chain failed for `stdaccess=http'
[00007f9748000c80] main input error: cannot start stream output instance, aborting
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[000056517c3c0e50] main playlist debug: dead input
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[00007f9750000c20] main art finder debug: no art finder modules matched
[00007f9750000c20] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
[00007f9750000c20] main meta fetcher debug: no meta fetcher modules matched
[00007f9750000c20] main art finder debug: looking for art finder module matching "any": 2 candidates
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[00007f9750000c20] main art finder debug: no art finder modules matched
[00007f9750000c20] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
[00007f9750000c20] main meta fetcher debug: no meta fetcher modules matched
[00007f9750000c20] main art finder debug: looking for art finder module matching "any": 2 candidates
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[00007f9750000c20] main art finder debug: no art finder modules matched
[000056517c3c0e50] main playlist debug: changing item without a request (current 0/3)
[000056517c3c0e50] main playlist debug: using item 1
[000056517c3c0e50] main playlist debug: starting playback of new item
[000056517c3c0e50] main playlist debug: resyncing on #stdmux=ts
[000056517c3c0e50] main playlist debug: #stdmux=ts is at 1
[000056517c3c0e50] main playlist debug: creating new input thread
[00007f9748000c80] main input debug: Creating an input for '#stdmux=ts'
[000056517c3c0e50] main playlist debug: requesting art for new input thread
[00007f9750001630] main stream output debug: using sout chain=`stdaccess=http'
[00007f9750001630] main stream output debug: stream=`stdaccess=http'
[00007f97500017c0] main stream out debug: looking for sout stream module matching "stdaccess=http": 23 candidates
[00007f97500017c0] main stream out debug: no sout stream modules matched
[00007f97500017c0] main stream out debug: destroying chain... (name=(null))
[00007f97500017c0] main stream out debug: destroying chain done
[00007f9750001630] main stream output error: stream chain failed for `stdaccess=http'
[00007f9748000c80] main input error: cannot start stream output instance, aborting
[000056517c3c0e50] main playlist debug: dead input
[00007f9750000c20] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
[00007f9750000c20] main meta fetcher debug: no meta fetcher modules matched
[00007f9750000c20] main art finder debug: looking for art finder module matching "any": 2 candidates
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[00007f9750000c20] main art finder debug: no art finder modules matched
[000056517c3c0e50] main playlist debug: changing item without a request (current 1/3)
[000056517c3c0e50] main playlist debug: using item 2
[000056517c3c0e50] main playlist debug: starting playback of new item
[000056517c3c0e50] main playlist debug: resyncing on #stddst=0.0.0.0:8081
[000056517c3c0e50] main playlist debug: #stddst=0.0.0.0:8081 is at 2
[000056517c3c0e50] main playlist debug: creating new input thread
[00007f9748000c80] main input debug: Creating an input for '#stddst=0.0.0.0:8081'
[000056517c3c0e50] main playlist debug: requesting art for new input thread
[00007f9750001630] main stream output debug: using sout chain=`stdaccess=http'
[00007f9750001630] main stream output debug: stream=`stdaccess=http'
[00007f97500017c0] main stream out debug: looking for sout stream module matching "stdaccess=http": 23 candidates
[00007f97500017c0] main stream out debug: no sout stream modules matched
[00007f97500017c0] main stream out debug: destroying chain... (name=(null))
[00007f97500017c0] main stream out debug: destroying chain done
[00007f9750001630] main stream output error: stream chain failed for `stdaccess=http'
[00007f9748000c80] main input error: cannot start stream output instance, aborting
[000056517c3c0e50] main playlist debug: dead input
[00007f9750000c20] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/fetcher
[00007f9750000c20] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
[00007f9750000c20] main meta fetcher debug: no meta fetcher modules matched
[00007f9750000c20] main art finder debug: looking for art finder module matching "any": 2 candidates
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /home/vlc/.local/share/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
[00007f9750000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
[00007f9750000c20] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
[00007f9750000c20] main art finder debug: no art finder modules matched
[000056517c3c0e50] main playlist debug: changing item without a request (current 2/3)
[000056517c3c0e50] main playlist debug: nothing to play

Seems like a VLC issue, even running vlc normally causes some errors, wondering how I can fix it.


text:
Q: Get list of tables name MS Access with JayDeBeApi I'm working with Access database (file format *.accdb) and I need to read it from Python code, so I'm using JayDeBeApi.
I'm trying to get the list of all the tables name.
I've tried the query
SELECT MSysObjects.[Name] FROM MSysObjects WHERE Flags = 0 And Type = 1;
But I get net.ucanaccess.jdbc.UcanaccessSQLException: UCAExc:::5.0.1 user lacks privilege or object not found: MSYSOBJECTS error.
From what I understand, I would need the change user permission on the table MSysObjects, but newer Access files have removed the user permission.
so how can I get the list of the tables names ?
I've also looked at the answers here : list the tables in a database
but this is for Java code and don't know ow to use it with my Python library
My python code is :
# path_to_db: Path to the database
# query: query to execute

u_can_access_jars = [
            f"jdbc_access/ucanaccess-5.0.1.jar",
            f"jdbc_access/commons-lang3-3.8.1.jar",
            f"jdbc_access/commons-logging-1.2.jar",
            f"jdbc_access/hsqldb-2.5.0.jar",
            f"/jdbc_access/jackcess-3.0.1.jar"
        ]
classpath = ";".join(u_can_access_jars)
with jaydebeapi.connect(
            "net.ucanaccess.jdbc.UcanaccessDriver",
            f"jdbc:ucanaccess:///{path_to_db}",
            ["", ""],
            self.classpath
        ) as conn:
    with conn.cursor() as cursor:
        cursor.execute(query)

Thanks


text:
Q: How to redirect to external url from service class? In my current spring project, I am adding several pairs of classes (controller/service) to provide payment option through several payment services. Each one of this classes have a structure like that:
controller
@Controller
@RequestMapping(value = "pagseguro")
public class pagseguroPaymentController extends paymentController<Pagseguro> {
    ...
    @Override
    @RequestMapping(value = "comprar", method = RequestMethod.POST)
    public void comprar(String payerId, String guid) throws Exception {
        this.payment.comprar(payerId, guid);
    }
    ...
}

service
@Service
public class pagseguroPaymentService extends paymentService<Pagseguro> {
  ...
  @Override
  public void comprar(String payerId, String guid) throws Exception {
    ...
    String response = checkout.register(null, false);
  }
  ...
}

in the method comprar from service class, I need redirect the application to an URL stored in a String variable (response in the example above).
My initial idea is use the library java.net from Java and create a utilitary class like that:
public class Redirect {
    public static String url;

    public static void redirect() {
        ...
    }
}

Anyone can give me a hint about how to accomplish that?

A: To perform a simple redirection, you can inject the HttpServletResponse in your Controller layer:
@RequestMapping(value = "comprar", method = RequestMethod.POST)
public void comprar(String payerId, String guid, HttpServletResponse response) throws Exception {
    this.payment.comprar(payerId, guid);
}

And then simply do a redirect using that object:
response.sendRedirect("http://newUrl");

Now - as the Luiggi mentions in the comment - I would not do the redirect itself in the service layer, but rather return a boolean which decides if the redirect needs to be done - and then do it here, in the controller layer.
Hope it helps.


text:
Q: what is causing to play song on this blog I am trying to understand as why on this blog
http://mysiddhashram.blogspot.com/
each time I refresh it starts playing sound.
I tried to read the source code but I am not clear as what is causing the sound to play.
Can any one help me to understand as which lines are causing the sound to be played?

A: Flash scripts on the page are playing sound. You can identify them in source by <object> and <embed> tags.


text:
Q: get json data inside html object, and object is from ajax get response how to get just json data,from this reponse
$.get('http://localhost:8000/json', function(response) {
  alert(response);
});

response is :

    {"logo":"logo.jpg"}

how to get value inside response function, so i can get like alert(response.logo) means logo.jpg

A: The obvious answer is fix your response,
but, as a workaround, you can parse the string you get with jquery...

var str = '
 {"logo":"logo.jpg"}
 '

var el = $(str)

var inner = el.html()

console.log(JSON.parse(inner))

console.log(JSON.parse(inner).logo)


text:
Q: Facebook Analytics 'Current URL' doesn't work...? It seems that filtering data, eg. creating a segment, or defining a funnel step, cannot use the 'Current URL' field. Or at least, it doesn't seem to work for me at all.
Am I missing something? Is this just broken?
Kind Regards,
Michael

A: Here are some docs that might help you. You can also play around with the Demo Event Source Group and create a segment like so:

A: Try leaving out the https://www.
That sometimes seems to help.


text:
Q: Print TextField on button click - printing incorrectly I'm attempting to incorporate a function in my react app, where a user will input a search term, and when the button is pressed it will go search it. (text input and buttons are using material-ui components) For now I just want it to print the term to the console log to check its okay. When running the below code, the output is: "[object Object]. Does anyone know why that is?
 import React from 'react';
 import TextField from '@material-ui/core/TextField';
 import Button from '@material-ui/core/Button';

class searchText extends React.Component {
  state = {
    searchTerm: null,
  }

  handleClick = (searchTerm) => {
    this.setState({ searchTerm });
  }

  render() {
    const { searchTerm } = this.state;

    return (

        <TextField
          id = "outlined-search"
          label="Enter Query"
          type = "search"
          className ="Search"
          variant="filled"
          value = {searchTerm}
         />

        <Button
         onClick={() =>{console.log("search: " +{searchTerm}); }}
         varient ="contained"
         classname="goButton" >
         Enter Query Here!
        <Button/>

    );
  }
}

export default Search
update: fixed typos

A: The + searchTem coerces the object into a string, which in your case is [object Object]
Just change it to:
console.log("search: ", searchTerm)

You can read more about it here: https://developer.mozilla.org/en-US/docs/Web/API/console#Outputting_text_to_the_console

A: Right now your'e not calling handleClick as you just console log it. That means that you're not changing/setting the state.searchTerm to anything. It's the handleClick that will update the state. So the value will always be null. Also you have a typo in your handleClick:
Your parameter says "serchTerm" ... it should say "searchTerm". You missed an a there ;)

A: Classes use PascalCase as they are components, not simple functions. The Buttons component were badly terminated and maybe you can just simply call your function handler when the user clicks on the button and then show the state on the console
class SearchText extends React.Component {
  state = {
    searchTerm: null,
  }

  handleClick = (term) => {

    this.setState({ searchTerm: term });
    console.log(this.state.searchTerm)
  }

  render() {
    const { searchTerm } = this.state;

    return (

        <TextField
          id = "outlined-search"
          label="Enter Query"
          type = "search"
          className ="Search"
          variant="filled"
          value = {searchTerm}
         />

        <Button
         onClick={this.handleClick}
         varient ="contained"
         classname="goButton" >
         Enter Query Here!
        </Button>

    );
  }
}

Hope helps :)

A: your have not any function to get the input value and set that value in state.
Try this.
// function for TextField Value Change
    getvalue=(event)=>{
        this.setState({
          searchTerm:event.target.value
        })
    }
// function for button click
    handleClick = () => {
        console.log(this.state.searchTerm)
    }

                <TextField
                  id = "outlined-search"
                  label="Enter Query"
                  type = "search"
                  className ="Search"
                  variant="filled"
                  value = {this.state.searchTerm}
                  onChange={this.getvalue}
                 />


text:
Q: Why isn't standard output displayed from a rake task called via backticks? When a rake task is called via backpacks its output is suppressed:
task :two do
    puts 'two'
end

task :one do
    puts 'one'
    `rake two`
end

-bash> bundle exec rake one
one

Whereas, the output is displayed when called via .invoke:
task :one do
    puts 'one'
    Rake::Task['two'].invoke
end

-bash> bundle exec rake one
one
two

Why is the output suppressed with backticks, and how can it be displayed?
The above is a contrived example, but ultimately I want to be able to run a local rake task that itself runs a remote rake task, on Heroku, and I want to see its output in real time (because the remote task is interactive, i.e. it asks questions via puts and waits for user/standard input via $stdin.gets.chomp):
task :one do
    puts 'one'
    `heroku run rake my_app:reset_user_passwords --app #{MY_APP_NAME}`
end

A: Backticks return the standard output of command so if you want to see the result, just call puts:
task :one do
    puts 'one'
    puts `heroku run rake my_app:reset_user_passwords --app #{MY_APP_NAME}`
end

If you want a interactive execution, you can try to use IO#expect


text:
Q: angular.min.js:92 Error: [$injector:unpr] I develop Angularjs application with php backend. I got error like this
Error: [$injector:unpr] http://errors.angularjs.org/1.2.25/$injector/unpr?p0=constantsProvider%20%3C-onstants%20%3C-%20userService
    at http://localhost/Security/libs/js/angular.min.js:6:450
    at http://localhost/Security/libs/js/angular.min.js:36:202
    at Object.c [as get] (http://localhost/Security/libs/js/angular.min.js:34:305)
    at http://localhost/Security/libs/js/angular.min.js:36:270
    at c (http://localhost/Security/libs/js/angular.min.js:34:305)
    at d (http://localhost/Security/libs/js/angular.min.js:35:6)
    at Object.instantiate (http://localhost/Security/libs/js/angular.min.js:35:165)
    at Object.<anonymous> (http://localhost/Security/libs/js/angular.min.js:35:435)
    at Object.d [as invoke] (http://localhost/Security/libs/js/angular.min.js:35:36)
    at http://localhost/Security/libs/js/angular.min.js:36:288

and my controller
(function () {
'use strict';
angular.module('smss').controller('loginController', ['$scope','userService','$http', loginController]);

function loginController($scope,userService, $http) {
    $scope.data = {email: '', password: ''};

    // login function
    $scope.login = function (data) {

        // user auth data
        var authData = {
            email: data.email,
            password: data.password,
            id: 1
        }

        userService.authUser(authData).success(function(){
            }).error(function(){
              $scope.data = {email : '',password : ''};
            })

      }

  }

})();

and my service class like below
(function() {
    "use strict";
    angular.module('smss').service('userService', ['$http','constants', userService]);

    function userService($http,constants) {
        return {
            checkUser: function(data){
                return $http.post(constants.SERVER_URL+ '/api/checkUser',data);
            },
            newUser: function(data){
                return $http.post(constants.SERVER_URL+ '/api/newUser',data);
            },
            authUser: function(data){
                $http.post('api/authUser.php', data).success(function (data) {
                        console.log(data);

                });
                return $http.post(constants.SERVER_URL+ '/api/authUser',data);
            }
        };
    }
})();

and constants
(function() {
     "use strict";
    angular.module('smss').constant('constants', {
        SERVER_URL: 'http://localhost/security/'
    })
})();

Why, I got error like this? how i solve it? there userService , I want to add my controller but i got error below.
I want send $http post requst to my php file but I try to get like this way.

A: Thye problem is you are not injecting $http properly. you forgot to add $http.
angular.module('smss',[]);// You must need to declare module this way.

Than,
angular.module('smss').controller('loginController', ['$scope','userService','$http', loginController]);

 function loginController($scope,userService, $http) {}